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

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 _0x210b33,PendingActions as _0x4adf70,Plugin as _0x271ac9}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x11d1a3,env as _0x67a4a9,formatHtml as _0x53a741,uid as _0x370f84}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x21d128}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x33df17,MenuBarMenuListItemButtonView as _0x2363ff,View as _0x256f4e}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x2262fc,crosshairCursor as _0x229ac4,drawSelection as _0x13da17,dropCursor as _0x28e326,highlightActiveLine as _0x105695,highlightActiveLineGutter as _0x1bc4f3,highlightSpecialChars as _0x46180a,keymap as _0x29c6e5,lineNumbers as _0x5e3fd0,rectangularSelection as _0xe2aebb}from'@codemirror/view';import{Compartment as _0x54853e,Transaction as _0x559a0a}from'@codemirror/state';import{bracketMatching as _0x101c29,defaultHighlightStyle as _0xc368e,foldGutter as _0x5e360a,foldKeymap as _0x271493,indentOnInput as _0x563dfb,syntaxHighlighting as _0x500061}from'@codemirror/language';import{defaultKeymap as _0xbac9f5,history as _0x1edf52,historyKeymap as _0xc96341,indentLess as _0x14e655,indentMore as _0x4e5dc0,redo as _0x2702ce,toggleTabFocusMode as _0x4df859,undo as _0x563a94}from'@codemirror/commands';import{autocompletion as _0x455174,closeBrackets as _0x2e71e4,closeBracketsKeymap as _0x4ec2e8,completionKeymap as _0x56be56}from'@codemirror/autocomplete';import{html as _0x4cb09c}from'@codemirror/lang-html';import{markdown as _0x5282c7}from'@codemirror/lang-markdown';import{oneDark as _0x3b2aae}from'@codemirror/theme-one-dark';function Q(_0x456e14,_0x4cc1d4){const t=_0x456e14['t'];switch(_0x4cc1d4){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 _0x4cc1d4;}}function B(_0x5d55d9){const _0x14c33a=_0x5d55d9['editing']['view']['document']['roots'],_0x121066=_0x14c33a['length'];if(0x0===_0x121066)throw new _0x11d1a3('source-editing-enhanced-editor-no-root',_0x5d55d9);return 0x1===_0x121066?_0x14c33a['first']['rootName']:Array['from'](_0x5d55d9['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x5a35d6){return J(_0x5a35d6['replace'](/^[\n\s]*/g,''))?_0x5a35d6['replace'](/\s+/g,''):_0x5a35d6;}function J(_0x53c6a2){return _0x53c6a2['startsWith']('<');}function X(_0x145fff){const _0x47dcf7=[_0x2262fc['lineWrapping'],_0x455174(),_0x101c29(),_0x2e71e4(),_0x229ac4(),_0x13da17(),_0x28e326(),_0x5e3fd0(),_0x5e360a(),_0x105695(),_0x1bc4f3(),_0x46180a(),_0x1edf52(),_0x563dfb(),_0xe2aebb(),_0x500061(_0xc368e,{'fallback':!0x0})],_0xe096f1=new _0x54853e();_0x47dcf7['push'](_0xe096f1['of'](_0x2262fc['editable']['of'](!0x0))),'html'===_0x145fff['syntaxLanguage']?_0x47dcf7['push'](_0x4cb09c()):_0x47dcf7['push'](_0x5282c7());const _0x2755d2=(_0x11d24=_0x145fff['theme'])&&'default'!==_0x11d24?'dark'===_0x11d24?_0x3b2aae:_0x11d24:null;var _0x11d24;_0x2755d2&&_0x47dcf7['push'](_0x2755d2),_0x47dcf7['push'](_0x29c6e5['of']([..._0x4ec2e8,..._0xbac9f5,..._0xc96341,..._0x271493,..._0x56be56,{'key':'Tab','run':_0x4e5dc0,'shift':_0x14e655,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2702ce,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2702ce,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x563a94,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x2b182e=new _0x2262fc({'extensions':_0x47dcf7,'parent':_0x145fff['parent']});return _0x4df859(_0x2b182e),{'focus':()=>{_0x2b182e['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x2b182e['focus']();},'getData':()=>_0x2b182e['state']['doc']['toString'](),'setData':_0x1ca23e=>{_0x2b182e['dispatch']({'changes':{'from':0x0,'to':_0x2b182e['state']['doc']['length'],'insert':_0x1ca23e},'annotations':_0x559a0a['addToHistory']['of'](!0x1)});},'setReadOnly':_0x52062e=>{_0x2b182e['dispatch']({'effects':[_0xe096f1['reconfigure'](_0x2262fc['editable']['of'](!_0x52062e))]});},'destroy':()=>{_0x2b182e['destroy']();},'instance':_0x2b182e};}var Z=class extends _0x256f4e{_codeEditorApi=null;_options;constructor(_0x275cac,_0x32e630){super(_0x275cac),this['_options']=_0x32e630,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',(_0x4d8715,_0x4dcd39,_0x1ae530)=>{this['setReadOnly'](_0x1ae530);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x1e7199){this['_codeEditorApi']['setData'](_0x1e7199);}setReadOnly(_0x134f4f){this['_codeEditorApi']['setReadOnly'](_0x134f4f);}};const G='SourceEditingEnhancedMode';var W=class extends _0x210b33{constructor(_0x49a397){super(_0x49a397),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x4adf70)['on']('change:hasAny',(_0x3bdb34,_0x353351,_0x4fa9f0)=>{_0x4fa9f0?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x51163d=this['editor'];for(const _0x2b2831 of _0x51163d['commands']['names']())['replaceSource','editSource']['includes'](_0x2b2831)||_0x51163d['commands']['get'](_0x2b2831)['forceDisabled'](G);}['_enableCommands'](){const _0x2d3b9f=this['editor'];for(const _0x2d248c of _0x2d3b9f['commands']['commands']())_0x2d248c['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x4d4466=this['editor'],_0x33a46d=_0x4d4466['locale'],_0xaef42c=_0x4d4466['plugins']['get']('Dialog'),_0x27820a=B(_0x4d4466),_0x4416a4=_0x4d4466['data']['get']({'rootName':_0x27820a}),_0x520ac4=J(_0x1167b0=_0x4416a4)?_0x53a741(_0x1167b0):_0x1167b0;var _0x1167b0;const _0xda9e70=new Z(_0x33a46d,{'syntaxLanguage':_0x4d4466['plugins']['has']('Markdown')?'markdown':'html','theme':_0x4d4466['config']['get']('sourceEditingEnhanced.theme')});let _0x45b89b=!0x0;const _0x3a99cb=_0x405c65=>{if(!_0x45b89b)return;return Y(_0xda9e70['getData']())!==Y(_0x520ac4)?window['confirm'](Q(_0x33a46d,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x405c65['stop']():void 0x0;};_0xaef42c['show']({'id':'sourceEditingEnhanced','title':Q(_0x33a46d,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0xda9e70,'actionButtons':[{'label':Q(_0x33a46d,'Cancel'),'withText':!0x0,'onExecute':()=>{_0xaef42c['hide']();}},{'label':Q(_0x33a46d,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0xb1a169=Y(_0xda9e70['getData']())!==Y(_0x520ac4);_0xb1a169&&_0x4d4466['execute']('replaceSource',_0xda9e70['getData']()),_0x45b89b=!0x1,_0xaef42c['hide'](),_0xb1a169&&'editables'in _0x4d4466['ui']['view']&&_0x4d4466['ui']['view']['editables'][_0x27820a]['element']['focus']();},'onCreate':_0x398653=>{_0x398653['set']('isEnabled',!_0x4d4466['isReadOnly']),_0x398653['bind']('isEnabled')['to'](_0x4d4466,'isReadOnly',this,'isEnabled',(_0x348e48,_0x4252fa)=>!_0x348e48&&_0x4252fa);}}],'onHide':()=>{this['_enableCommands'](),_0xaef42c['off']('hide',_0x3a99cb),_0xda9e70['destroy']();},'onShow':()=>{_0xda9e70['bind']('isReadOnly')['to'](_0x4d4466,'isReadOnly',this,'isEnabled',(_0x4eb5bf,_0x4a599c)=>_0x4eb5bf||!_0x4a599c),_0xda9e70['setData'](_0x520ac4),_0xda9e70['focus'](),_0xaef42c['on']('hide',_0x3a99cb,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x271ac9{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x4adf70];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x5a0d14=this['editor'],_0x1a02b3=_0x5a0d14['locale'],_0x262b52=new W(_0x5a0d14);_0x5a0d14['commands']['add']('editSource',_0x262b52),_0x5a0d14['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x505917=this['_createButton'](_0x33df17,_0x262b52);return _0x505917['set']({'label':Q(_0x1a02b3,'Source'),'icon':_0x21d128,'tooltip':Q(_0x1a02b3,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x505917;}),_0x5a0d14['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x16c7e4=this['_createButton'](_0x2363ff,_0x262b52,!0x0);return _0x16c7e4['set']({'label':Q(_0x1a02b3,'Edit\x20source\x20modal\x20label'),'icon':_0x21d128,'role':'menuitemcheckbox'}),_0x16c7e4;}),this['_registerKeybindings']();}afterInit(){!async function(_0x336216){const _0x3382a6='RBcXdGf567mNjK9DTpP0Iyi3gea8ZvzlE4bFuWrwsH1hnOSLqkY2MQJxoVAUtC',_0x4f2d3f=0x79788,_0x40ff39={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'};async function _0x944fa3(_0x114c7b){const _0x3f0288=new window['Promise'](_0x510978=>{_0x114c7b['once']('ready',_0x510978);}),_0x462306=window['Date']['now'](),_0x56e144=_0x114c7b['config']['get']('licenseKey');async function _0x1579f4(){let _0x4426d3,_0x354ba9=null,_0x4cc833=null;try{return'GPL'==_0x56e144?'NotAllowed':(_0x4426d3=_0x536b19(),_0x4426d3?(_0x4426d3['usageEndpoint']&&(_0x4cc833=_0x677041(_0x4426d3['usageEndpoint'],_0x4426d3['jti'])),await _0x589c41()?_0x1f66cd()?_0x374ab3()?'Expired':_0x47e93e()?('evaluation'==_0x4426d3['licenseType']&&(_0x354ba9=_0xe0ee95('EvaluationLimit')),await _0x1aa5a4()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x374ab3(){const _0x231570=['evaluation','trial']['includes'](_0x4426d3['licenseType'])?_0x462306/0x3e8:0xe10*_0x4f2d3f;return _0x4426d3['exp']<_0x231570;}function _0x1f66cd(){const _0x3a928f=_0x4426d3['features'];return!!_0x3a928f&&(!!_0x3a928f['includes']('*')||!!_0x3a928f['includes']('SEE'));}function _0x47e93e(){const _0x24414e=_0x4426d3['licensedHosts'];if(!_0x24414e||0x0==_0x24414e['length'])return!0x0;const {hostname:_0x5e3118}=new URL(window['location']['href']);if(_0x24414e['includes'](_0x5e3118))return!0x0;const _0x4f1c90=_0x5e3118['split']('.');return _0x24414e['filter'](_0x1fdc0c=>_0x1fdc0c['includes']('*'))['map'](_0x5b11af=>_0x5b11af['split']('.'))['filter'](_0x3667a5=>_0x3667a5['length']<=_0x4f1c90['length'])['map'](_0x246ab4=>Array(_0x4f1c90['length']-_0x246ab4['length'])['fill']('*'===_0x246ab4[0x0]?'*':'')['concat'](_0x246ab4))['some'](_0x20684f=>_0x4f1c90['every']((_0x3d74f2,_0x31e66c)=>_0x20684f[_0x31e66c]===_0x3d74f2||'*'===_0x20684f[_0x31e66c]));}function _0x1aa5a4(){return _0x354ba9&&_0x4cc833?new window['Promise']((_0x5526e5,_0x4182ea)=>{_0x354ba9['then'](_0x5526e5,_0x4182ea),_0x4cc833['then'](_0x163027=>{'Valid'!=_0x163027&&_0x5526e5(_0x163027);},_0x4182ea);}):_0x354ba9||_0x4cc833||'Valid';}}function _0x677041(_0x169d71,_0x33e632){return new window['Promise'](_0x322eaa=>{if(_0x5bb8c3())return _0x322eaa('Valid');_0x283485(),_0x114c7b['decorate']('_sendUsageRequest');let _0x2213ba=!0x1;const _0x4f0702=_0x370f84();function _0xfbbeb6(_0x240f3e){return!!_0x240f3e&&('object'==typeof _0x240f3e||'function'==typeof _0x240f3e)&&'function'==typeof _0x240f3e['then']&&'function'==typeof _0x240f3e['catch'];}function _0x4c10b8(_0x38e3d5){_0x3430bf(_0x38e3d5)['then'](_0x2c28d4=>_0x2c28d4&&'ok'==_0x2c28d4['status']?_0x4abe89(_0x22996c(_0x4f0702+_0x33e632))!=_0x2c28d4['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5183d3=>(_0x261f7f(),_0x5183d3),()=>{const _0x1a90f4=_0x5935e6();return null==_0x1a90f4?(_0x261f7f(),'Valid'):_0x462306-_0x1a90f4>0x240c8400?'UsageLimit':'Valid';})['then'](_0x322eaa)['catch'](()=>{_0x322eaa('UsageLimit');});const _0x436104=0x36ee80;function _0x261f7f(){const _0x21cde5='llct-'+_0x4abe89(_0x22996c(_0x169d71)),_0x280f57=_0x598b50(_0x4abe89(window['Math']['ceil'](_0x462306/_0x436104)));window['localStorage']['setItem'](_0x21cde5,_0x280f57);}function _0x5935e6(){const _0x5cfc47='llct-'+_0x4abe89(_0x22996c(_0x169d71)),_0x16773a=window['localStorage']['getItem'](_0x5cfc47);return _0x16773a?window['parseInt'](_0x598b50(_0x16773a),0x10)*_0x436104:null;}function _0x3430bf(_0x51220e){return new window['Promise']((_0x54fe3a,_0x3babd2)=>{_0x51220e['then'](_0x54fe3a,_0x3babd2),window['setTimeout'](_0x3babd2,0x1d4c0);});}}_0x114c7b['on']('_sendUsageRequest',(_0x505a19,_0x2e992b)=>{if(_0x2e992b[0x0]!=_0x169d71)return _0x322eaa('UsageLimit');_0x2e992b[0x1]={..._0x2e992b[0x1],'requestId':_0x4f0702};},{'priority':'high'}),_0x114c7b['on']('_sendUsageRequest',_0x19f309=>{_0xfbbeb6(_0x19f309['return'])&&(_0x2213ba=!0x0,_0x4c10b8(_0x19f309['return']));},{'priority':'low'}),_0x3f0288['then'](()=>{_0x2213ba||_0x322eaa('UsageLimit');});});function _0x5bb8c3(){return'auto'==_0x114c7b['editing']['view']['_overlayModeHint'];}function _0x283485(){_0x114c7b['editing']['view']['_overlayModeHint']='auto';}}function _0xe0ee95(_0x3e653c){const _0x47f774=[new window['Promise'](_0x2ca6ff=>setTimeout(_0x2ca6ff,0x93ecc)),_0x3f0288['then'](()=>new window['Promise'](_0x29c98f=>{let _0x2a6569=0x0;_0x114c7b['model']['on']('applyOperation',(_0x3f9ab7,_0x4d1440)=>{_0x4d1440[0x0]['isDocumentOperation']&&_0x2a6569++,0x5e8==_0x2a6569&&(_0x29c98f(),_0x3f9ab7['off']());});}))];return window['Promise']['race'](_0x47f774)['then'](()=>_0x3e653c);}async function _0x2f2e18(){await _0x3f0288,_0x114c7b['model']['change']=_0x52ae88,_0x114c7b['model']['enqueueChange']=_0x52ae88,_0x114c7b['enableReadOnlyMode']('model');}function _0x1e6274(_0x3d6904){const _0x1b669a=_0x1293cf();_0x114c7b[_0x1b669a]='sourceEditingEnhancedLicenseKey'+_0x3d6904,'Valid'!=_0x3d6904&&_0x2f2e18();}function _0x1293cf(){const _0x3560f5=window['String'](window['performance']['now']())['replace']('.','');let _0x4b1b18='R';for(let _0x2ef85c=0x0;_0x2ef85c<_0x3560f5['length'];_0x2ef85c+=0x2){let _0xaeac42=window['parseInt'](_0x3560f5['substring'](_0x2ef85c,_0x2ef85c+0x2));_0xaeac42>=0x3e&&(_0xaeac42-=0x3e),_0x4b1b18+=_0x3382a6[_0xaeac42];}return _0x4b1b18;}function _0x536b19(){const _0x2a528e=_0x56e144['split']('.');if(0x3!=_0x2a528e['length'])return null;return _0x10660e(_0x2a528e[0x1]);function _0x10660e(_0xb013c5){const _0x48e583=_0x89dcc6(_0xb013c5);return _0x48e583&&_0x342fe8()?_0x48e583:null;function _0x342fe8(){const _0x5a1a17=_0x48e583['jti'],_0x455345=window['parseInt'](_0x5a1a17['substring'](_0x5a1a17['length']-0x8),0x10),_0x1f07b1={..._0x48e583,'jti':_0x5a1a17['substring'](0x0,_0x5a1a17['length']-0x8)};return delete _0x1f07b1['vc'],_0x22996c(_0x1f07b1)==_0x455345;}}}async function _0x589c41(){let _0x1fa2a6=!0x0;try{const [_0x25ce2f,_0x3e0207,_0x4b0ec1]=_0x56e144['split']('.');return _0x15040b(_0x25ce2f),await _0x12985c(_0x25ce2f,_0x3e0207,_0x4b0ec1),_0x1fa2a6;}catch{return!0x1;}function _0x15040b(_0x3b723f){const _0x33e25e=_0x89dcc6(_0x3b723f);_0x33e25e&&'ES256'==_0x33e25e['alg']||(_0x1fa2a6=!0x1);}async function _0x12985c(_0x55c6b1,_0x1123d0,_0x4bbbf9){const _0x34620d=window['Uint8Array']['from'](_0x4b1d06(_0x4bbbf9),_0x1285a2=>_0x1285a2['charCodeAt'](0x0)),_0xaf7ba2=new window['TextEncoder']()['encode'](_0x55c6b1+'.'+_0x1123d0),_0x2cb4d7=window['crypto']['subtle'];if(!_0x2cb4d7)return;const _0x3f9d7b=await _0x2cb4d7['importKey']('jwk',_0x40ff39,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x2cb4d7['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x3f9d7b,_0x34620d,_0xaf7ba2)||(_0x1fa2a6=!0x1);}}function _0x89dcc6(_0x393be3){return _0x393be3['startsWith']('ey')?JSON['parse'](_0x4b1d06(_0x393be3)):null;}function _0x4b1d06(_0x46bef2){return window['atob'](_0x46bef2['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x22996c(_0x52fe74){let _0x83c891=0x1505;function _0x270adc(_0x789c8c){for(let _0x21dbde=0x0;_0x21dbde<_0x789c8c['length'];_0x21dbde++){const _0xa0cc2d=_0x789c8c['charCodeAt'](_0x21dbde);_0x83c891=(_0x83c891<<0x5)+_0x83c891+_0xa0cc2d,_0x83c891&=_0x83c891;}}function _0x42b7ba(_0xa3ccf){Array['isArray'](_0xa3ccf)?_0xa3ccf['forEach'](_0x42b7ba):_0xa3ccf&&'object'==typeof _0xa3ccf?Object['entries'](_0xa3ccf)['sort']()['forEach'](([_0xe59781,_0x2598ff])=>{_0x270adc(_0xe59781),_0x42b7ba(_0x2598ff);}):_0x270adc(window['String'](_0xa3ccf));}return _0x42b7ba(_0x52fe74),_0x83c891>>>0x0;}function _0x4abe89(_0x4dc7c0){return _0x4dc7c0['toString'](0x10)['padStart'](0x8,'0');}function _0x598b50(_0x19626f){return _0x19626f['split']('')['reverse']()['join']('');}function _0x52ae88(){}_0x1e6274(await _0x1579f4());}_0x944fa3(_0x336216['editor']);}(this);}_createButton(_0x80f6a6,_0x45a193,_0xad57cf=!0x1){const _0x2c6447=new _0x80f6a6(this['editor']['locale']);return _0x2c6447['set']({'withText':_0xad57cf,'isToggleable':!0x1}),_0x2c6447['bind']('isEnabled')['to'](_0x45a193,'isEnabled'),this['listenTo'](_0x2c6447,'execute',()=>_0x45a193['execute']()),_0x2c6447;}_registerKeybindings(){const _0x185ea8=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x185ea8,'Source\x20Editing\x20Enhanced')});const _0x459527=_0x67a4a9['isMac']||_0x67a4a9['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x185ea8,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x185ea8,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x185ea8,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x185ea8,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x185ea8,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x185ea8,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x185ea8,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x459527?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x185ea8,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x185ea8,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x185ea8,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x185ea8,'Select\x20line'),'keystroke':_0x459527?'Ctrl!+L':'Alt+L'},{'label':Q(_0x185ea8,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x459527?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x185ea8,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x185ea8,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x185ea8,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x185ea8,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x185ea8,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x459527?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x210b33{constructor(_0x1067ec){super(_0x1067ec),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x116ed4,_0x59a1e1){const _0x27dc2b=this['editor'],_0x4cc2ac=_0x59a1e1?.['rootName']??B(_0x27dc2b);_0x27dc2b['data']['set']({[_0x4cc2ac]:_0x116ed4},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x271ac9{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x4cc58d){super(_0x4cc58d),_0x4cc58d['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 _0x2d9333=[this['editor']];for(const _0x2d6771 of _0x2d9333){let _0x320f33;for(const _0x3d2f1b in _0x2d6771){const _0x269c87=_0x3d2f1b,_0x3455e8=_0x2d6771[_0x269c87];if('sourceEditingEnhancedLicenseKeyValid'==_0x3455e8||'sourceEditingEnhancedLicenseKeyInvalid'==_0x3455e8||'sourceEditingEnhancedLicenseKeyExpired'==_0x3455e8||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3455e8||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3455e8||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3455e8||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3455e8){delete _0x2d6771[_0x269c87],_0x320f33=_0x3455e8,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x320f33&&_0x2d6771['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x320f33&&_0x2d6771['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x320f33&&_0x2d6771['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x320f33&&_0x2d6771['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x320f33&&_0x2d6771['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x320f33&&_0x2d6771['_showLicenseError']('usageLimit');}},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x236fd9=this['editor'],_0x431e36=_0x236fd9['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x431e36&&_0x236fd9['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x11d1a3('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x431e36&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x541b96=>_0x236fd9['plugins']['has'](_0x541b96))&&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.'),_0x236fd9['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.5",
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.5",
30
+ "@ckeditor/ckeditor5-engine": "49.0.0-alpha.5",
31
+ "@ckeditor/ckeditor5-icons": "49.0.0-alpha.5",
32
+ "@ckeditor/ckeditor5-ui": "49.0.0-alpha.5",
33
+ "@ckeditor/ckeditor5-utils": "49.0.0-alpha.5",
34
34
  "@codemirror/autocomplete": "^6.7.1",
35
35
  "@codemirror/commands": "6.8.1",
36
36
  "@codemirror/lang-html": "^6.0.0",