@ckeditor/ckeditor5-source-editing-enhanced 48.4.0-alpha.3 → 48.4.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 _0xb1fe12,PendingActions as _0x2f5b19,Plugin as _0x4ff81f}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x43b165,env as _0x1d934e,formatHtml as _0x481975,uid as _0xa81394}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x8edc89}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x4b4621,MenuBarMenuListItemButtonView as _0x314047,View as _0x1b2132}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x45dfbc,crosshairCursor as _0x2824e4,drawSelection as _0x51d865,dropCursor as _0x3f57ce,highlightActiveLine as _0x1468d5,highlightActiveLineGutter as _0x1e6358,highlightSpecialChars as _0x54c4fe,keymap as _0xfa00ae,lineNumbers as _0xec3a5e,rectangularSelection as _0x159c68}from'@codemirror/view';import{Compartment as _0xad5413,Transaction as _0x4e28ac}from'@codemirror/state';import{bracketMatching as _0x53e5df,defaultHighlightStyle as _0x1902b5,foldGutter as _0x59ebbf,foldKeymap as _0x13df9d,indentOnInput as _0x4172ca,syntaxHighlighting as _0x48ae4e}from'@codemirror/language';import{defaultKeymap as _0x3c6cf9,history as _0x1d670f,historyKeymap as _0x39cf8b,indentLess as _0x5a89e1,indentMore as _0x22a400,redo as _0x2f083e,toggleTabFocusMode as _0x2c5b73,undo as _0x2b1de4}from'@codemirror/commands';import{autocompletion as _0x2719a1,closeBrackets as _0x191c20,closeBracketsKeymap as _0x52f656,completionKeymap as _0x455e36}from'@codemirror/autocomplete';import{html as _0x42ae81}from'@codemirror/lang-html';import{markdown as _0x438217}from'@codemirror/lang-markdown';import{oneDark as _0x443069}from'@codemirror/theme-one-dark';function Q(_0x41f9b9,_0x5a5385){const t=_0x41f9b9['t'];switch(_0x5a5385){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 _0x5a5385;}}function B(_0x48553b){const _0x53a9a9=_0x48553b['editing']['view']['document']['roots'],_0x466374=_0x53a9a9['length'];if(0x0===_0x466374)throw new _0x43b165('source-editing-enhanced-editor-no-root',_0x48553b);return 0x1===_0x466374?_0x53a9a9['first']['rootName']:Array['from'](_0x48553b['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x4613b4){return J(_0x4613b4['replace'](/^[\n\s]*/g,''))?_0x4613b4['replace'](/\s+/g,''):_0x4613b4;}function J(_0x5cd096){return _0x5cd096['startsWith']('<');}function X(_0x2bbd33){const _0x34ee08=[_0x45dfbc['lineWrapping'],_0x2719a1(),_0x53e5df(),_0x191c20(),_0x2824e4(),_0x51d865(),_0x3f57ce(),_0xec3a5e(),_0x59ebbf(),_0x1468d5(),_0x1e6358(),_0x54c4fe(),_0x1d670f(),_0x4172ca(),_0x159c68(),_0x48ae4e(_0x1902b5,{'fallback':!0x0})],_0x4718e9=new _0xad5413();_0x34ee08['push'](_0x4718e9['of'](_0x45dfbc['editable']['of'](!0x0))),'html'===_0x2bbd33['syntaxLanguage']?_0x34ee08['push'](_0x42ae81()):_0x34ee08['push'](_0x438217());const _0xc9182c=(_0x47e282=_0x2bbd33['theme'])&&'default'!==_0x47e282?'dark'===_0x47e282?_0x443069:_0x47e282:null;var _0x47e282;_0xc9182c&&_0x34ee08['push'](_0xc9182c),_0x34ee08['push'](_0xfa00ae['of']([..._0x52f656,..._0x3c6cf9,..._0x39cf8b,..._0x13df9d,..._0x455e36,{'key':'Tab','run':_0x22a400,'shift':_0x5a89e1,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x2f083e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x2f083e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x2b1de4,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0xc6c92a=new _0x45dfbc({'extensions':_0x34ee08,'parent':_0x2bbd33['parent']});return _0x2c5b73(_0xc6c92a),{'focus':()=>{_0xc6c92a['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0xc6c92a['focus']();},'getData':()=>_0xc6c92a['state']['doc']['toString'](),'setData':_0x4c70e0=>{_0xc6c92a['dispatch']({'changes':{'from':0x0,'to':_0xc6c92a['state']['doc']['length'],'insert':_0x4c70e0},'annotations':_0x4e28ac['addToHistory']['of'](!0x1)});},'setReadOnly':_0x86055f=>{_0xc6c92a['dispatch']({'effects':[_0x4718e9['reconfigure'](_0x45dfbc['editable']['of'](!_0x86055f))]});},'destroy':()=>{_0xc6c92a['destroy']();},'instance':_0xc6c92a};}var Z=class extends _0x1b2132{_codeEditorApi=null;_options;constructor(_0x30bbd5,_0x473d15){super(_0x30bbd5),this['_options']=_0x473d15,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',(_0x26ea05,_0x4220dc,_0x7d7681)=>{this['setReadOnly'](_0x7d7681);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x31a447){this['_codeEditorApi']['setData'](_0x31a447);}setReadOnly(_0x918025){this['_codeEditorApi']['setReadOnly'](_0x918025);}};const G='SourceEditingEnhancedMode';var W=class extends _0xb1fe12{constructor(_0x41bfc3){super(_0x41bfc3),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x2f5b19)['on']('change:hasAny',(_0x511802,_0xf19aa1,_0x2ec002)=>{_0x2ec002?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x42e688=this['editor'];for(const _0x3c5d76 of _0x42e688['commands']['names']())['replaceSource','editSource']['includes'](_0x3c5d76)||_0x42e688['commands']['get'](_0x3c5d76)['forceDisabled'](G);}['_enableCommands'](){const _0x25c37f=this['editor'];for(const _0x103eff of _0x25c37f['commands']['commands']())_0x103eff['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x9f5206=this['editor'],_0x3818c2=_0x9f5206['locale'],_0x5827e2=_0x9f5206['plugins']['get']('Dialog'),_0x1b4804=B(_0x9f5206),_0xad34d1=J(_0x128d1b=_0x9f5206['data']['get']({'rootName':_0x1b4804}))?_0x481975(_0x128d1b):_0x128d1b;var _0x128d1b;const _0x226299=new Z(_0x3818c2,{'syntaxLanguage':_0x9f5206['plugins']['has']('Markdown')?'markdown':'html','theme':_0x9f5206['config']['get']('sourceEditingEnhanced.theme')});let _0x1a6249=!0x0;const _0x36a632=_0x351d73=>{if(_0x1a6249&&Y(_0x226299['getData']())!==Y(_0xad34d1))return window['confirm'](Q(_0x3818c2,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x351d73['stop']();};_0x5827e2['show']({'id':'sourceEditingEnhanced','title':Q(_0x3818c2,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x226299,'actionButtons':[{'label':Q(_0x3818c2,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x5827e2['hide']();}},{'label':Q(_0x3818c2,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x343444=Y(_0x226299['getData']())!==Y(_0xad34d1);_0x343444&&_0x9f5206['execute']('replaceSource',_0x226299['getData']()),_0x1a6249=!0x1,_0x5827e2['hide'](),_0x343444&&'editables'in _0x9f5206['ui']['view']&&_0x9f5206['ui']['view']['editables'][_0x1b4804]['element']['focus']();},'onCreate':_0x332165=>{_0x332165['set']('isEnabled',!_0x9f5206['isReadOnly']),_0x332165['bind']('isEnabled')['to'](_0x9f5206,'isReadOnly',this,'isEnabled',(_0xf2466b,_0x494024)=>!_0xf2466b&&_0x494024);}}],'onHide':()=>{this['_enableCommands'](),_0x5827e2['off']('hide',_0x36a632),_0x226299['destroy']();},'onShow':()=>{_0x226299['bind']('isReadOnly')['to'](_0x9f5206,'isReadOnly',this,'isEnabled',(_0x148e9f,_0x32d978)=>_0x148e9f||!_0x32d978),_0x226299['setData'](_0xad34d1),_0x226299['focus'](),_0x5827e2['on']('hide',_0x36a632,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x4ff81f{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x2f5b19];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x500abd=this['editor'],_0xdc272d=_0x500abd['locale'],_0x3cb311=new W(_0x500abd);_0x500abd['commands']['add']('editSource',_0x3cb311),_0x500abd['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x4e36a7=this['_createButton'](_0x4b4621,_0x3cb311);return _0x4e36a7['set']({'label':Q(_0xdc272d,'Source'),'icon':_0x8edc89,'tooltip':Q(_0xdc272d,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x4e36a7;}),_0x500abd['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x26ea76=this['_createButton'](_0x314047,_0x3cb311,!0x0);return _0x26ea76['set']({'label':Q(_0xdc272d,'Edit\x20source\x20modal\x20label'),'icon':_0x8edc89,'role':'menuitemcheckbox'}),_0x26ea76;}),this['_registerKeybindings']();}afterInit(){!async function(_0x5bf53c){const _0x3eb9c1='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x6ebb07=0x79170,_0x7a522b=window['Date']['now'](),_0xb15747=_0x5bf53c['editor'],_0x3b2a29=new window['Promise'](_0x23921a=>{_0xb15747['once']('ready',_0x23921a);}),_0x5318a9={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x3c6ef1=_0xb15747['config']['get']('licenseKey');async function _0x406140(){let _0x3e6092,_0x53d34c=null,_0x8d9b8a=null;try{return'GPL'==_0x3c6ef1?'NotAllowed':(_0x3e6092=_0x14363c(),_0x3e6092?(_0x3e6092['usageEndpoint']&&(_0x8d9b8a=_0x2c87f3(_0x3e6092['usageEndpoint'],_0x3e6092['jti'])),await _0x1e0f98()?_0x5ed67c()?_0x2a46e1()?'Expired':_0x2489ec()?('evaluation'==_0x3e6092['licenseType']&&(_0x53d34c=_0xe14bf8('EvaluationLimit')),await _0x3bc926()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x2a46e1(){const _0x5b164b=['evaluation','trial']['includes'](_0x3e6092['licenseType'])?_0x7a522b/0x3e8:0xe10*_0x6ebb07;return _0x3e6092['exp']<_0x5b164b;}function _0x5ed67c(){const _0x278769=_0x3e6092['features'];return!!_0x278769&&(!!_0x278769['includes']('*')||!!_0x278769['includes']('SEE'));}function _0x2489ec(){const _0x3b7cb4=_0x3e6092['licensedHosts'];if(!_0x3b7cb4||0x0==_0x3b7cb4['length'])return!0x0;const {hostname:_0x368c50}=new URL(window['location']['href']);if(_0x3b7cb4['includes'](_0x368c50))return!0x0;const _0x24e373=_0x368c50['split']('.');return _0x3b7cb4['filter'](_0x54b4df=>_0x54b4df['includes']('*'))['map'](_0x3a95db=>_0x3a95db['split']('.'))['filter'](_0x3edede=>_0x3edede['length']<=_0x24e373['length'])['map'](_0x99cadc=>Array(_0x24e373['length']-_0x99cadc['length'])['fill']('*'===_0x99cadc[0x0]?'*':'')['concat'](_0x99cadc))['some'](_0x35c551=>_0x24e373['every']((_0x3129fb,_0x1eefff)=>_0x35c551[_0x1eefff]===_0x3129fb||'*'===_0x35c551[_0x1eefff]));}function _0x3bc926(){return _0x53d34c&&_0x8d9b8a?new window['Promise']((_0x4d3732,_0x223853)=>{_0x53d34c['then'](_0x4d3732,_0x223853),_0x8d9b8a['then'](_0x8320fb=>{'Valid'!=_0x8320fb&&_0x4d3732(_0x8320fb);},_0x223853);}):_0x53d34c||_0x8d9b8a||'Valid';}}function _0x2c87f3(_0x1e7938,_0x47abe8){return new window['Promise'](_0x1b9ae7=>{if(_0x253d10())return _0x1b9ae7('Valid');_0x73e882(),_0xb15747['decorate']('_sendUsageRequest');let _0x3b661a=!0x1;const _0x34a9e3=_0xa81394();function _0x59cd56(_0x3eb02c){return!!_0x3eb02c&&('object'==typeof _0x3eb02c||'function'==typeof _0x3eb02c)&&'function'==typeof _0x3eb02c['then']&&'function'==typeof _0x3eb02c['catch'];}function _0x1cb33c(_0x58b912){_0x4e9fb5(_0x58b912)['then'](_0x4c5a0a=>_0x4c5a0a&&'ok'==_0x4c5a0a['status']?_0x4c3020(_0x477932(_0x34a9e3+_0x47abe8))!=_0x4c5a0a['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x5b5ab4=>(_0x1ac42b(),_0x5b5ab4),()=>{const _0x1122da=_0x1d0f09();return null==_0x1122da?(_0x1ac42b(),'Valid'):_0x7a522b-_0x1122da>0x240c8400?'UsageLimit':'Valid';})['then'](_0x1b9ae7)['catch'](()=>{_0x1b9ae7('UsageLimit');});const _0x1fde71=0x36ee80;function _0x1ac42b(){const _0x240133='llct-'+_0x4c3020(_0x477932(_0x1e7938)),_0x547e04=_0x2d7a37(_0x4c3020(window['Math']['ceil'](_0x7a522b/_0x1fde71)));window['localStorage']['setItem'](_0x240133,_0x547e04);}function _0x1d0f09(){const _0x53d7cb='llct-'+_0x4c3020(_0x477932(_0x1e7938)),_0x430a22=window['localStorage']['getItem'](_0x53d7cb);return _0x430a22?window['parseInt'](_0x2d7a37(_0x430a22),0x10)*_0x1fde71:null;}function _0x4e9fb5(_0xd74084){return new window['Promise']((_0x4a1ef9,_0x57fc2a)=>{_0xd74084['then'](_0x4a1ef9,_0x57fc2a),window['setTimeout'](_0x57fc2a,0x1d4c0);});}}_0xb15747['on']('_sendUsageRequest',(_0x3e8538,_0x3e26b7)=>{if(_0x3e26b7[0x0]!=_0x1e7938)return _0x1b9ae7('UsageLimit');_0x3e26b7[0x1]={..._0x3e26b7[0x1],'requestId':_0x34a9e3};},{'priority':'high'}),_0xb15747['on']('_sendUsageRequest',_0xa9a91e=>{_0x59cd56(_0xa9a91e['return'])&&(_0x3b661a=!0x0,_0x1cb33c(_0xa9a91e['return']));},{'priority':'low'}),_0x3b2a29['then'](()=>{_0x3b661a||_0x1b9ae7('UsageLimit');});});function _0x253d10(){return'auto'==_0xb15747['editing']['view']['_overlayModeHint'];}function _0x73e882(){_0xb15747['editing']['view']['_overlayModeHint']='auto';}}function _0xe14bf8(_0x16e1fa){const _0x114177=[new window['Promise'](_0x1b5f0d=>setTimeout(_0x1b5f0d,0x93ecc)),_0x3b2a29['then'](()=>new window['Promise'](_0x4d7d9a=>{let _0x4a8ba2=0x0;_0xb15747['model']['on']('applyOperation',(_0x2fe776,_0x4c4f41)=>{_0x4c4f41[0x0]['isDocumentOperation']&&_0x4a8ba2++,0x5e8==_0x4a8ba2&&(_0x4d7d9a(),_0x2fe776['off']());});}))];return window['Promise']['race'](_0x114177)['then'](()=>_0x16e1fa);}async function _0x52c695(){await _0x3b2a29,_0xb15747['model']['change']=_0x110d89,_0xb15747['model']['enqueueChange']=_0x110d89,_0xb15747['enableReadOnlyMode']('model');}function _0x5baa3b(_0x56a935){const _0x2e820a=_0x1550a0();_0xb15747[_0x2e820a]='sourceEditingEnhancedLicenseKey'+_0x56a935,'Valid'!=_0x56a935&&_0x52c695();}function _0x1550a0(){const _0x371c8f=window['String'](window['performance']['now']())['replace']('.','');let _0x1d876b='N';for(let _0x1ec819=0x0;_0x1ec819<_0x371c8f['length'];_0x1ec819+=0x2){let _0x3473f4=window['parseInt'](_0x371c8f['substring'](_0x1ec819,_0x1ec819+0x2));_0x3473f4>=0x3e&&(_0x3473f4-=0x3e),_0x1d876b+=_0x3eb9c1[_0x3473f4];}return _0x1d876b;}function _0x14363c(){const _0x2993fc=_0x3c6ef1['split']('.');if(0x3!=_0x2993fc['length'])return null;return _0x20c815(_0x2993fc[0x1]);function _0x20c815(_0x17902b){const _0x4da314=_0x1d9456(_0x17902b);return _0x4da314&&_0x14e339()?_0x4da314:null;function _0x14e339(){const _0x12c736=_0x4da314['jti'],_0x38de6b=window['parseInt'](_0x12c736['substring'](_0x12c736['length']-0x8),0x10),_0x537918={..._0x4da314,'jti':_0x12c736['substring'](0x0,_0x12c736['length']-0x8)};return delete _0x537918['vc'],_0x477932(_0x537918)==_0x38de6b;}}}async function _0x1e0f98(){let _0x37028e=!0x0;try{const [_0x16f1f2,_0x2cffd2,_0xf680e5]=_0x3c6ef1['split']('.');return _0x377cbf(_0x16f1f2),await _0x3bc11b(_0x16f1f2,_0x2cffd2,_0xf680e5),_0x37028e;}catch{return!0x1;}function _0x377cbf(_0x197351){const _0x2cf3f3=_0x1d9456(_0x197351);_0x2cf3f3&&'ES256'==_0x2cf3f3['alg']||(_0x37028e=!0x1);}async function _0x3bc11b(_0x8e6d30,_0x58d9ab,_0xef56d){const _0x35221f=window['Uint8Array']['from'](_0x14b8ee(_0xef56d),_0x5896c5=>_0x5896c5['charCodeAt'](0x0)),_0x5e93a5=new window['TextEncoder']()['encode'](_0x8e6d30+'.'+_0x58d9ab),_0x48121f=window['crypto']['subtle'];if(!_0x48121f)return;const _0x373dba=await _0x48121f['importKey']('jwk',_0x5318a9,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0x48121f['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x373dba,_0x35221f,_0x5e93a5)||(_0x37028e=!0x1);}}function _0x1d9456(_0x469345){return _0x469345['startsWith']('ey')?JSON['parse'](_0x14b8ee(_0x469345)):null;}function _0x14b8ee(_0xfa1ca3){return window['atob'](_0xfa1ca3['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x477932(_0x53497d){let _0x18bac4=0x1505;function _0x142789(_0x2f882a){for(let _0x1227cd=0x0;_0x1227cd<_0x2f882a['length'];_0x1227cd++){const _0xda4292=_0x2f882a['charCodeAt'](_0x1227cd);_0x18bac4=(_0x18bac4<<0x5)+_0x18bac4+_0xda4292,_0x18bac4&=_0x18bac4;}}function _0x411876(_0x3fb5d8){Array['isArray'](_0x3fb5d8)?_0x3fb5d8['forEach'](_0x411876):_0x3fb5d8&&'object'==typeof _0x3fb5d8?Object['entries'](_0x3fb5d8)['sort']()['forEach'](([_0x50a3f0,_0x2f83c2])=>{_0x142789(_0x50a3f0),_0x411876(_0x2f83c2);}):_0x142789(window['String'](_0x3fb5d8));}return _0x411876(_0x53497d),_0x18bac4>>>0x0;}function _0x4c3020(_0x3a11eb){return _0x3a11eb['toString'](0x10)['padStart'](0x8,'0');}function _0x2d7a37(_0x34686e){return _0x34686e['split']('')['reverse']()['join']('');}function _0x110d89(){}_0x5baa3b(await _0x406140());}(this);}_createButton(_0x473e67,_0x534275,_0x347cda=!0x1){const _0x4ef536=new _0x473e67(this['editor']['locale']);return _0x4ef536['set']({'withText':_0x347cda,'isToggleable':!0x1}),_0x4ef536['bind']('isEnabled')['to'](_0x534275,'isEnabled'),this['listenTo'](_0x4ef536,'execute',()=>_0x534275['execute']()),_0x4ef536;}_registerKeybindings(){const _0x352805=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0x352805,'Source\x20Editing\x20Enhanced')});const _0x9d6d02=_0x1d934e['isMac']||_0x1d934e['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0x352805,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0x352805,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0x352805,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0x352805,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0x352805,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0x352805,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0x352805,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x9d6d02?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0x352805,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0x352805,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0x352805,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0x352805,'Select\x20line'),'keystroke':_0x9d6d02?'Ctrl!+L':'Alt+L'},{'label':Q(_0x352805,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x9d6d02?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0x352805,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0x352805,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0x352805,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0x352805,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0x352805,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x9d6d02?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0xb1fe12{constructor(_0x1d833a){super(_0x1d833a),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x5af911,_0x3b3387){const _0x43a6f3=this['editor'],_0x41fc7a=_0x3b3387?.['rootName']??B(_0x43a6f3);_0x43a6f3['data']['set']({[_0x41fc7a]:_0x5af911},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x4ff81f{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0x169a74){super(_0x169a74),_0x169a74['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x293abb=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x299a89;for(const _0x2a6b34 in _0x293abb){const _0x50b7f9=_0x2a6b34,_0x375f64=_0x293abb[_0x50b7f9];if('sourceEditingEnhancedLicenseKeyValid'==_0x375f64||'sourceEditingEnhancedLicenseKeyInvalid'==_0x375f64||'sourceEditingEnhancedLicenseKeyExpired'==_0x375f64||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x375f64||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x375f64||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x375f64||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x375f64){delete _0x293abb[_0x50b7f9],_0x299a89=_0x375f64,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x299a89&&_0x293abb['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x299a89&&_0x293abb['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x299a89&&_0x293abb['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x299a89&&_0x293abb['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x299a89&&_0x293abb['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x299a89&&_0x293abb['_showLicenseError']('usageLimit');},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x1657e7=this['editor'],_0x34b525=_0x1657e7['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x34b525&&_0x1657e7['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x43b165('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x34b525&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0x317291=>_0x1657e7['plugins']['has'](_0x317291))&&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.'),_0x1657e7['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 _0x3b2fde,PendingActions as _0x3f715c,Plugin as _0x54c4a5}from'@ckeditor/ckeditor5-core';import{CKEditorError as _0x510066,env as _0x592e7f,formatHtml as _0x4b4a77,uid as _0x573555}from'@ckeditor/ckeditor5-utils';import{IconSource as _0x297380}from'@ckeditor/ckeditor5-icons';import{ButtonView as _0x49d334,MenuBarMenuListItemButtonView as _0x2517f8,View as _0x5778db}from'@ckeditor/ckeditor5-ui';import{EditorView as _0x30aaa2,crosshairCursor as _0x3be862,drawSelection as _0x48c87b,dropCursor as _0x4e624a,highlightActiveLine as _0x59deb6,highlightActiveLineGutter as _0x46c5e2,highlightSpecialChars as _0x821633,keymap as _0x49531d,lineNumbers as _0x5b7bed,rectangularSelection as _0x3edb11}from'@codemirror/view';import{Compartment as _0x315de1,Transaction as _0x4ee730}from'@codemirror/state';import{bracketMatching as _0x6542a8,defaultHighlightStyle as _0x239333,foldGutter as _0x3db8d5,foldKeymap as _0x2deeee,indentOnInput as _0x416efd,syntaxHighlighting as _0x114268}from'@codemirror/language';import{defaultKeymap as _0x37056c,history as _0x58208f,historyKeymap as _0x5357ec,indentLess as _0x16acc4,indentMore as _0x4524c0,redo as _0x1d465e,toggleTabFocusMode as _0x1f9b2d,undo as _0x6777f1}from'@codemirror/commands';import{autocompletion as _0x14ea03,closeBrackets as _0x3275ce,closeBracketsKeymap as _0x239dcc,completionKeymap as _0x172af3}from'@codemirror/autocomplete';import{html as _0x4cbd56}from'@codemirror/lang-html';import{markdown as _0xab2fec}from'@codemirror/lang-markdown';import{oneDark as _0x274762}from'@codemirror/theme-one-dark';function Q(_0xc9d228,_0x26e22a){const t=_0xc9d228['t'];switch(_0x26e22a){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 _0x26e22a;}}function B(_0x3e18d3){const _0x9e9395=_0x3e18d3['editing']['view']['document']['roots'],_0x1a0379=_0x9e9395['length'];if(0x0===_0x1a0379)throw new _0x510066('source-editing-enhanced-editor-no-root',_0x3e18d3);return 0x1===_0x1a0379?_0x9e9395['first']['rootName']:Array['from'](_0x3e18d3['editing']['view']['document']['selection']['getRanges']())[0x0]['root']['rootName'];}function Y(_0x51aee0){return J(_0x51aee0['replace'](/^[\n\s]*/g,''))?_0x51aee0['replace'](/\s+/g,''):_0x51aee0;}function J(_0x51f10d){return _0x51f10d['startsWith']('<');}function X(_0x1b2fc7){const _0x5936a1=[_0x30aaa2['lineWrapping'],_0x14ea03(),_0x6542a8(),_0x3275ce(),_0x3be862(),_0x48c87b(),_0x4e624a(),_0x5b7bed(),_0x3db8d5(),_0x59deb6(),_0x46c5e2(),_0x821633(),_0x58208f(),_0x416efd(),_0x3edb11(),_0x114268(_0x239333,{'fallback':!0x0})],_0x3f3eed=new _0x315de1();_0x5936a1['push'](_0x3f3eed['of'](_0x30aaa2['editable']['of'](!0x0))),'html'===_0x1b2fc7['syntaxLanguage']?_0x5936a1['push'](_0x4cbd56()):_0x5936a1['push'](_0xab2fec());const _0x2c70e5=(_0x16f096=_0x1b2fc7['theme'])&&'default'!==_0x16f096?'dark'===_0x16f096?_0x274762:_0x16f096:null;var _0x16f096;_0x2c70e5&&_0x5936a1['push'](_0x2c70e5),_0x5936a1['push'](_0x49531d['of']([..._0x239dcc,..._0x37056c,..._0x5357ec,..._0x2deeee,..._0x172af3,{'key':'Tab','run':_0x4524c0,'shift':_0x16acc4,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-y','mac':'Cmd-y','run':_0x1d465e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-Shift-z','mac':'Cmd-Shift-z','run':_0x1d465e,'preventDefault':!0x0,'stopPropagation':!0x0},{'key':'Ctrl-z','mac':'Cmd-z','run':_0x6777f1,'preventDefault':!0x0,'stopPropagation':!0x0}]));const _0x5dd615=new _0x30aaa2({'extensions':_0x5936a1,'parent':_0x1b2fc7['parent']});return _0x1f9b2d(_0x5dd615),{'focus':()=>{_0x5dd615['dispatch']({'selection':{'anchor':0x0},'scrollIntoView':!0x0}),_0x5dd615['focus']();},'getData':()=>_0x5dd615['state']['doc']['toString'](),'setData':_0x5d610e=>{_0x5dd615['dispatch']({'changes':{'from':0x0,'to':_0x5dd615['state']['doc']['length'],'insert':_0x5d610e},'annotations':_0x4ee730['addToHistory']['of'](!0x1)});},'setReadOnly':_0x3d4d6d=>{_0x5dd615['dispatch']({'effects':[_0x3f3eed['reconfigure'](_0x30aaa2['editable']['of'](!_0x3d4d6d))]});},'destroy':()=>{_0x5dd615['destroy']();},'instance':_0x5dd615};}var Z=class extends _0x5778db{_codeEditorApi=null;_options;constructor(_0x2bf3bc,_0x114493){super(_0x2bf3bc),this['_options']=_0x114493,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',(_0x99becf,_0x3f7b9b,_0x82b664)=>{this['setReadOnly'](_0x82b664);});}destroy(){super['destroy'](),this['_codeEditorApi']['destroy'](),this['_codeEditorApi']=null;}['focus'](){this['isReadOnly']?this['element']['focus']():this['_codeEditorApi']['focus']();}getData(){return this['_codeEditorApi']['getData']();}setData(_0x1b4dce){this['_codeEditorApi']['setData'](_0x1b4dce);}setReadOnly(_0x102d53){this['_codeEditorApi']['setReadOnly'](_0x102d53);}};const G='SourceEditingEnhancedMode';var W=class extends _0x3b2fde{constructor(_0xcf4044){super(_0xcf4044),this['affectsData']=!0x1,this['editor']['plugins']['get'](_0x3f715c)['on']('change:hasAny',(_0x497997,_0xca86da,_0x4dd816)=>{_0x4dd816?this['forceDisabled']('pendingActions'):this['clearForceDisabled']('pendingActions');});}['_disableCommands'](){const _0x24d3ab=this['editor'];for(const _0x17f6d3 of _0x24d3ab['commands']['names']())['replaceSource','editSource']['includes'](_0x17f6d3)||_0x24d3ab['commands']['get'](_0x17f6d3)['forceDisabled'](G);}['_enableCommands'](){const _0x2888cc=this['editor'];for(const _0x487f8e of _0x2888cc['commands']['commands']())_0x487f8e['clearForceDisabled'](G);}['refresh'](){this['isEnabled']=!0x0;}execute(){const _0x3431f8=this['editor'],_0x22655f=_0x3431f8['locale'],_0x1a6be2=_0x3431f8['plugins']['get']('Dialog'),_0x2a7ed6=B(_0x3431f8),_0x1361db=J(_0x649978=_0x3431f8['data']['get']({'rootName':_0x2a7ed6}))?_0x4b4a77(_0x649978):_0x649978;var _0x649978;const _0x1c16ce=new Z(_0x22655f,{'syntaxLanguage':_0x3431f8['plugins']['has']('Markdown')?'markdown':'html','theme':_0x3431f8['config']['get']('sourceEditingEnhanced.theme')});let _0x5e527f=!0x0;const _0x5e6903=_0x6c3fc9=>{if(_0x5e527f&&Y(_0x1c16ce['getData']())!==Y(_0x1361db))return window['confirm'](Q(_0x22655f,'Are\x20you\x20sure\x20you\x20want\x20to\x20discard\x20your\x20changes?\x20This\x20action\x20cannot\x20be\x20undone.'))?void 0x0:_0x6c3fc9['stop']();};_0x1a6be2['show']({'id':'sourceEditingEnhanced','title':Q(_0x22655f,'Edit\x20source\x20modal\x20label'),'isModal':!0x0,'className':'ck-source-editing-enhanced-dialog','content':_0x1c16ce,'actionButtons':[{'label':Q(_0x22655f,'Cancel'),'withText':!0x0,'onExecute':()=>{_0x1a6be2['hide']();}},{'label':Q(_0x22655f,'Save'),'class':'ck-button-action','withText':!0x0,'onExecute':()=>{const _0x226fda=Y(_0x1c16ce['getData']())!==Y(_0x1361db);_0x226fda&&_0x3431f8['execute']('replaceSource',_0x1c16ce['getData']()),_0x5e527f=!0x1,_0x1a6be2['hide'](),_0x226fda&&'editables'in _0x3431f8['ui']['view']&&_0x3431f8['ui']['view']['editables'][_0x2a7ed6]['element']['focus']();},'onCreate':_0x19ffeb=>{_0x19ffeb['set']('isEnabled',!_0x3431f8['isReadOnly']),_0x19ffeb['bind']('isEnabled')['to'](_0x3431f8,'isReadOnly',this,'isEnabled',(_0x3d9ec9,_0x3ddf74)=>!_0x3d9ec9&&_0x3ddf74);}}],'onHide':()=>{this['_enableCommands'](),_0x1a6be2['off']('hide',_0x5e6903),_0x1c16ce['destroy']();},'onShow':()=>{_0x1c16ce['bind']('isReadOnly')['to'](_0x3431f8,'isReadOnly',this,'isEnabled',(_0x43383d,_0x414098)=>_0x43383d||!_0x414098),_0x1c16ce['setData'](_0x1361db),_0x1c16ce['focus'](),_0x1a6be2['on']('hide',_0x5e6903,{'priority':'highest'}),this['_disableCommands']();}});}},$=class extends _0x54c4a5{static get['pluginName'](){return'SourceEditingEnhancedUI';}static get requires(){return[_0x3f715c];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}init(){const _0x44bff1=this['editor'],_0x387211=_0x44bff1['locale'],_0x34c7d9=new W(_0x44bff1);_0x44bff1['commands']['add']('editSource',_0x34c7d9),_0x44bff1['ui']['componentFactory']['add']('sourceEditingEnhanced',()=>{const _0x1b7f06=this['_createButton'](_0x49d334,_0x34c7d9);return _0x1b7f06['set']({'label':Q(_0x387211,'Source'),'icon':_0x297380,'tooltip':Q(_0x387211,'Edit\x20source\x20modal\x20label'),'class':'ck-source-editing-enhanced-button'}),_0x1b7f06;}),_0x44bff1['ui']['componentFactory']['add']('menuBar:sourceEditingEnhanced',()=>{const _0x36865f=this['_createButton'](_0x2517f8,_0x34c7d9,!0x0);return _0x36865f['set']({'label':Q(_0x387211,'Edit\x20source\x20modal\x20label'),'icon':_0x297380,'role':'menuitemcheckbox'}),_0x36865f;}),this['_registerKeybindings']();}afterInit(){!async function(_0x2cb856){const _0x4ff35f='NQVXyBFHJzr8WGI4aZnTeoUx6p9jfv3DitLwuckYlhdMA2K5S7mbCOPEs1qgR0',_0x8aa1a1=0x79188,_0x29cd40=window['Date']['now'](),_0x23b678=_0x2cb856['editor'],_0x2c6367=new window['Promise'](_0x1b1d5e=>{_0x23b678['once']('ready',_0x1b1d5e);}),_0x5d3e2b={'kty':'EC','use':'sig','crv':'P-256','x':'iCjOCvDFI6lQHHT18jVwRfkfHQ2a_MymT35LQVoFSAI','y':'kXIyJ4evtCEFRmxKSUpK9fDW459vXOvVrhf6uQAeOio','alg':'ES256'},_0x58fed2=_0x23b678['config']['get']('licenseKey');async function _0x44b13d(){let _0x162c2c,_0x2258c9=null,_0x23149a=null;try{return'GPL'==_0x58fed2?'NotAllowed':(_0x162c2c=_0x55d034(),_0x162c2c?(_0x162c2c['usageEndpoint']&&(_0x23149a=_0x4556c0(_0x162c2c['usageEndpoint'],_0x162c2c['jti'])),await _0x46f8d6()?_0x9e4771()?_0x3ed258()?'Expired':_0x47586d()?('evaluation'==_0x162c2c['licenseType']&&(_0x2258c9=_0x2757bb('EvaluationLimit')),await _0x5d6600()):'DomainLimit':'NotAllowed':'Invalid'):'Invalid');}catch{return'Invalid';}function _0x3ed258(){const _0x383197=['evaluation','trial']['includes'](_0x162c2c['licenseType'])?_0x29cd40/0x3e8:0xe10*_0x8aa1a1;return _0x162c2c['exp']<_0x383197;}function _0x9e4771(){const _0x58fdd1=_0x162c2c['features'];return!!_0x58fdd1&&(!!_0x58fdd1['includes']('*')||!!_0x58fdd1['includes']('SEE'));}function _0x47586d(){const _0x39d7c6=_0x162c2c['licensedHosts'];if(!_0x39d7c6||0x0==_0x39d7c6['length'])return!0x0;const {hostname:_0x10a86b}=new URL(window['location']['href']);if(_0x39d7c6['includes'](_0x10a86b))return!0x0;const _0x4c533b=_0x10a86b['split']('.');return _0x39d7c6['filter'](_0x2e7cf2=>_0x2e7cf2['includes']('*'))['map'](_0x375e90=>_0x375e90['split']('.'))['filter'](_0x2b73f0=>_0x2b73f0['length']<=_0x4c533b['length'])['map'](_0xeff94f=>Array(_0x4c533b['length']-_0xeff94f['length'])['fill']('*'===_0xeff94f[0x0]?'*':'')['concat'](_0xeff94f))['some'](_0x502554=>_0x4c533b['every']((_0x2e9dd6,_0x3c32a5)=>_0x502554[_0x3c32a5]===_0x2e9dd6||'*'===_0x502554[_0x3c32a5]));}function _0x5d6600(){return _0x2258c9&&_0x23149a?new window['Promise']((_0x4d9f09,_0x367dde)=>{_0x2258c9['then'](_0x4d9f09,_0x367dde),_0x23149a['then'](_0x3959bb=>{'Valid'!=_0x3959bb&&_0x4d9f09(_0x3959bb);},_0x367dde);}):_0x2258c9||_0x23149a||'Valid';}}function _0x4556c0(_0x1deb41,_0x100084){return new window['Promise'](_0x50bd8f=>{if(_0x4c7e67())return _0x50bd8f('Valid');_0x17e612(),_0x23b678['decorate']('_sendUsageRequest');let _0xd82dfe=!0x1;const _0x554fd4=_0x573555();function _0x19e275(_0x586677){return!!_0x586677&&('object'==typeof _0x586677||'function'==typeof _0x586677)&&'function'==typeof _0x586677['then']&&'function'==typeof _0x586677['catch'];}function _0x11ecb2(_0x39ceb1){_0x3f3569(_0x39ceb1)['then'](_0x3b6017=>_0x3b6017&&'ok'==_0x3b6017['status']?_0x5c1b82(_0x5d1007(_0x554fd4+_0x100084))!=_0x3b6017['verification']?'UsageLimit':'Valid':'UsageLimit')['then'](_0x3b8aa1=>(_0x32d947(),_0x3b8aa1),()=>{const _0x2ba024=_0x57678a();return null==_0x2ba024?(_0x32d947(),'Valid'):_0x29cd40-_0x2ba024>0x240c8400?'UsageLimit':'Valid';})['then'](_0x50bd8f)['catch'](()=>{_0x50bd8f('UsageLimit');});const _0x563d9b=0x36ee80;function _0x32d947(){const _0x18f060='llct-'+_0x5c1b82(_0x5d1007(_0x1deb41)),_0x267f8a=_0x89e6f0(_0x5c1b82(window['Math']['ceil'](_0x29cd40/_0x563d9b)));window['localStorage']['setItem'](_0x18f060,_0x267f8a);}function _0x57678a(){const _0x36129e='llct-'+_0x5c1b82(_0x5d1007(_0x1deb41)),_0x5837e0=window['localStorage']['getItem'](_0x36129e);return _0x5837e0?window['parseInt'](_0x89e6f0(_0x5837e0),0x10)*_0x563d9b:null;}function _0x3f3569(_0xdd6c68){return new window['Promise']((_0x390929,_0x43a362)=>{_0xdd6c68['then'](_0x390929,_0x43a362),window['setTimeout'](_0x43a362,0x1d4c0);});}}_0x23b678['on']('_sendUsageRequest',(_0x4b6c30,_0x47e741)=>{if(_0x47e741[0x0]!=_0x1deb41)return _0x50bd8f('UsageLimit');_0x47e741[0x1]={..._0x47e741[0x1],'requestId':_0x554fd4};},{'priority':'high'}),_0x23b678['on']('_sendUsageRequest',_0xc1f210=>{_0x19e275(_0xc1f210['return'])&&(_0xd82dfe=!0x0,_0x11ecb2(_0xc1f210['return']));},{'priority':'low'}),_0x2c6367['then'](()=>{_0xd82dfe||_0x50bd8f('UsageLimit');});});function _0x4c7e67(){return'auto'==_0x23b678['editing']['view']['_overlayModeHint'];}function _0x17e612(){_0x23b678['editing']['view']['_overlayModeHint']='auto';}}function _0x2757bb(_0x2111ac){const _0x2941c9=[new window['Promise'](_0x198f1d=>setTimeout(_0x198f1d,0x93ecc)),_0x2c6367['then'](()=>new window['Promise'](_0x4ad7cd=>{let _0x2a5644=0x0;_0x23b678['model']['on']('applyOperation',(_0xce1c5f,_0x41cbda)=>{_0x41cbda[0x0]['isDocumentOperation']&&_0x2a5644++,0x5e8==_0x2a5644&&(_0x4ad7cd(),_0xce1c5f['off']());});}))];return window['Promise']['race'](_0x2941c9)['then'](()=>_0x2111ac);}async function _0x4aefe5(){await _0x2c6367,_0x23b678['model']['change']=_0x54e9d2,_0x23b678['model']['enqueueChange']=_0x54e9d2,_0x23b678['enableReadOnlyMode']('model');}function _0x2ae657(_0x14ef92){const _0x152cd5=_0x4cc027();_0x23b678[_0x152cd5]='sourceEditingEnhancedLicenseKey'+_0x14ef92,'Valid'!=_0x14ef92&&_0x4aefe5();}function _0x4cc027(){const _0x1edb60=window['String'](window['performance']['now']())['replace']('.','');let _0x5c77ab='N';for(let _0x147583=0x0;_0x147583<_0x1edb60['length'];_0x147583+=0x2){let _0x3efe8c=window['parseInt'](_0x1edb60['substring'](_0x147583,_0x147583+0x2));_0x3efe8c>=0x3e&&(_0x3efe8c-=0x3e),_0x5c77ab+=_0x4ff35f[_0x3efe8c];}return _0x5c77ab;}function _0x55d034(){const _0x5ed557=_0x58fed2['split']('.');if(0x3!=_0x5ed557['length'])return null;return _0xd23fb0(_0x5ed557[0x1]);function _0xd23fb0(_0x420f52){const _0x3f56d3=_0x2bf792(_0x420f52);return _0x3f56d3&&_0x415ca7()?_0x3f56d3:null;function _0x415ca7(){const _0x59a399=_0x3f56d3['jti'],_0x3d753d=window['parseInt'](_0x59a399['substring'](_0x59a399['length']-0x8),0x10),_0x5cc7b4={..._0x3f56d3,'jti':_0x59a399['substring'](0x0,_0x59a399['length']-0x8)};return delete _0x5cc7b4['vc'],_0x5d1007(_0x5cc7b4)==_0x3d753d;}}}async function _0x46f8d6(){let _0x36c4a8=!0x0;try{const [_0xdcf931,_0x2e611a,_0xd484ef]=_0x58fed2['split']('.');return _0x5d5659(_0xdcf931),await _0x17d577(_0xdcf931,_0x2e611a,_0xd484ef),_0x36c4a8;}catch{return!0x1;}function _0x5d5659(_0x22163c){const _0x4d38a6=_0x2bf792(_0x22163c);_0x4d38a6&&'ES256'==_0x4d38a6['alg']||(_0x36c4a8=!0x1);}async function _0x17d577(_0x4696a0,_0x3609ff,_0x5b77d2){const _0x50b0f5=window['Uint8Array']['from'](_0x584f68(_0x5b77d2),_0x227aea=>_0x227aea['charCodeAt'](0x0)),_0x51c8f5=new window['TextEncoder']()['encode'](_0x4696a0+'.'+_0x3609ff),_0xf6e742=window['crypto']['subtle'];if(!_0xf6e742)return;const _0x34fbe3=await _0xf6e742['importKey']('jwk',_0x5d3e2b,{'name':'ECDSA','namedCurve':'P-256'},!0x1,['verify']);await _0xf6e742['verify']({'name':'ECDSA','hash':{'name':'SHA-256'}},_0x34fbe3,_0x50b0f5,_0x51c8f5)||(_0x36c4a8=!0x1);}}function _0x2bf792(_0x2e3a9a){return _0x2e3a9a['startsWith']('ey')?JSON['parse'](_0x584f68(_0x2e3a9a)):null;}function _0x584f68(_0x5b9135){return window['atob'](_0x5b9135['replace'](/-/g,'+')['replace'](/_/g,'/'));}function _0x5d1007(_0x29ccc3){let _0x3af90f=0x1505;function _0x14f58e(_0xed85d2){for(let _0x195f7c=0x0;_0x195f7c<_0xed85d2['length'];_0x195f7c++){const _0x17dc8b=_0xed85d2['charCodeAt'](_0x195f7c);_0x3af90f=(_0x3af90f<<0x5)+_0x3af90f+_0x17dc8b,_0x3af90f&=_0x3af90f;}}function _0x58cb01(_0x242c63){Array['isArray'](_0x242c63)?_0x242c63['forEach'](_0x58cb01):_0x242c63&&'object'==typeof _0x242c63?Object['entries'](_0x242c63)['sort']()['forEach'](([_0x1c8539,_0x4058b])=>{_0x14f58e(_0x1c8539),_0x58cb01(_0x4058b);}):_0x14f58e(window['String'](_0x242c63));}return _0x58cb01(_0x29ccc3),_0x3af90f>>>0x0;}function _0x5c1b82(_0x5962f9){return _0x5962f9['toString'](0x10)['padStart'](0x8,'0');}function _0x89e6f0(_0x4e3b39){return _0x4e3b39['split']('')['reverse']()['join']('');}function _0x54e9d2(){}_0x2ae657(await _0x44b13d());}(this);}_createButton(_0x40dd92,_0xbfda4d,_0x219149=!0x1){const _0x544979=new _0x40dd92(this['editor']['locale']);return _0x544979['set']({'withText':_0x219149,'isToggleable':!0x1}),_0x544979['bind']('isEnabled')['to'](_0xbfda4d,'isEnabled'),this['listenTo'](_0x544979,'execute',()=>_0xbfda4d['execute']()),_0x544979;}_registerKeybindings(){const _0xd4b374=this['editor']['locale'];this['editor']['accessibility']['addKeystrokeInfoCategory']({'id':'sourceEditingEnhanced','label':Q(_0xd4b374,'Source\x20Editing\x20Enhanced')});const _0x349817=_0x592e7f['isMac']||_0x592e7f['isiOS'];this['editor']['accessibility']['addKeystrokeInfos']({'categoryId':'sourceEditingEnhanced','keystrokes':[{'label':Q(_0xd4b374,'Copy\x20line\x20down'),'keystroke':'Shift+Alt+ArrowDown'},{'label':Q(_0xd4b374,'Copy\x20line\x20up'),'keystroke':'Shift+Alt+ArrowUp'},{'label':Q(_0xd4b374,'Delete\x20line'),'keystroke':'Shift+Ctrl+K'},{'label':Q(_0xd4b374,'Indent\x20less'),'keystroke':'Ctrl+['},{'label':Q(_0xd4b374,'Indent\x20more'),'keystroke':'Ctrl+]'},{'label':Q(_0xd4b374,'Fold\x20all'),'keystroke':'Ctrl!+Alt+['},{'label':Q(_0xd4b374,'Fold\x20code\x20(current\x20level)'),'keystroke':_0x349817?'Cmd+Alt+[':'Ctrl+Shift+['},{'label':Q(_0xd4b374,'Move\x20line\x20down'),'keystroke':'Alt+ArrowDown'},{'label':Q(_0xd4b374,'Move\x20line\x20up'),'keystroke':'Alt+ArrowUp'},{'label':Q(_0xd4b374,'Redo\x20(keystroke)'),'keystroke':[['Ctrl+Shift+Z'],['Ctrl+Y']]},{'label':Q(_0xd4b374,'Select\x20line'),'keystroke':_0x349817?'Ctrl!+L':'Alt+L'},{'label':Q(_0xd4b374,'Switch\x20between\x20\x22focus\x20with\x20tab\x22\x20and\x20\x22indent\x20with\x20tab\x22\x20mode'),'keystroke':_0x349817?'Alt+Shift+M':'Ctrl+M'},{'label':Q(_0xd4b374,'Toggle\x20block\x20comment'),'keystroke':'Shift+Alt+A'},{'label':Q(_0xd4b374,'Toggle\x20comment'),'keystroke':'Ctrl+/'},{'label':Q(_0xd4b374,'Undo\x20(keystroke)'),'keystroke':'Ctrl+Z'},{'label':Q(_0xd4b374,'Unfold\x20all'),'keystroke':'Ctrl!+Alt+]'},{'label':Q(_0xd4b374,'Unfold\x20code\x20(current\x20level)'),'keystroke':_0x349817?'Cmd+Alt+]':'Ctrl+Shift+]'}]});}},ee=class extends _0x3b2fde{constructor(_0x300e36){super(_0x300e36),this['refresh']();}['refresh'](){this['isEnabled']=!this['editor']['isReadOnly'];}execute(_0x394257,_0x207043){const _0x29374e=this['editor'],_0x40ac7e=_0x207043?.['rootName']??B(_0x29374e);_0x29374e['data']['set']({[_0x40ac7e]:_0x394257},{'batchType':{'isUndoable':!0x0},'suppressErrorInCollaboration':!0x0});}},te=class extends _0x54c4a5{['licenseKey'];_licenseKeyCheckInterval;static get['pluginName'](){return'SourceEditingEnhanced';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}static get requires(){return[$];}constructor(_0xfeb3d7){super(_0xfeb3d7),_0xfeb3d7['config']['define']('sourceEditingEnhanced.allowCollaborationFeatures',!0x1);}init(){this['_checkCompatibility'](),this['editor']['commands']['add']('replaceSource',new ee(this['editor'])),this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3a1b20=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x3a3ca1;for(const _0xcb84e1 in _0x3a1b20){const _0x305ce5=_0xcb84e1,_0x211843=_0x3a1b20[_0x305ce5];if('sourceEditingEnhancedLicenseKeyValid'==_0x211843||'sourceEditingEnhancedLicenseKeyInvalid'==_0x211843||'sourceEditingEnhancedLicenseKeyExpired'==_0x211843||'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x211843||'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x211843||'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x211843||'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x211843){delete _0x3a1b20[_0x305ce5],_0x3a3ca1=_0x211843,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'sourceEditingEnhancedLicenseKeyInvalid'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('invalid'),'sourceEditingEnhancedLicenseKeyExpired'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('expired'),'sourceEditingEnhancedLicenseKeyDomainLimit'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('domainLimit'),'sourceEditingEnhancedLicenseKeyNotAllowed'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('featureNotAllowed','SourceEditingEnhanced'),'sourceEditingEnhancedLicenseKeyEvaluationLimit'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('evaluationLimit'),'sourceEditingEnhancedLicenseKeyUsageLimit'==_0x3a3ca1&&_0x3a1b20['_showLicenseError']('usageLimit');},0x3e8);}destroy(){this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}_checkCompatibility(){const _0x3c3971=this['editor'],_0x41b775=_0x3c3971['config']['get']('sourceEditingEnhanced.allowCollaborationFeatures');if(!_0x41b775&&_0x3c3971['plugins']['has']('RealTimeCollaborativeEditing'))throw new _0x510066('source-editing-enhanced-incompatible-with-real-time-collaboration',null);!_0x41b775&&['CommentsEditing','TrackChangesEditing','RevisionHistory']['some'](_0xfdfab5=>_0x3c3971['plugins']['has'](_0xfdfab5))&&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.'),_0x3c3971['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": "48.4.0-alpha.3",
3
+ "version": "48.4.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": "48.4.0-alpha.3",
30
- "@ckeditor/ckeditor5-engine": "48.4.0-alpha.3",
31
- "@ckeditor/ckeditor5-icons": "48.4.0-alpha.3",
32
- "@ckeditor/ckeditor5-ui": "48.4.0-alpha.3",
33
- "@ckeditor/ckeditor5-utils": "48.4.0-alpha.3",
29
+ "@ckeditor/ckeditor5-core": "48.4.0-alpha.4",
30
+ "@ckeditor/ckeditor5-engine": "48.4.0-alpha.4",
31
+ "@ckeditor/ckeditor5-icons": "48.4.0-alpha.4",
32
+ "@ckeditor/ckeditor5-ui": "48.4.0-alpha.4",
33
+ "@ckeditor/ckeditor5-utils": "48.4.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",