@ckeditor/ckeditor5-uploadcare 47.1.0-alpha.2 → 47.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/uploadcare.js +1 -1
- package/dist/index.js +3 -3
- package/package.json +9 -9
- package/src/ui/uploadcarecontroller.js +2 -2
- package/src/ui/uploadcareformview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditcontroller.js +2 -2
- package/src/uploadcareimageedit/ui/uploadcareimageeditformeditingview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditformerrorview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditformloadingview.js +1 -1
- package/src/uploadcareimageedit/ui/uploadcareimageeditformview.js +1 -1
- package/src/uploadcareimageedit/uploadcareimageeditcommand.js +1 -1
- package/src/utils/dialogfocusmanagerview.js +1 -1
- package/src/utils/editingutils.js +1 -1
- package/src/utils/isancestor.js +1 -1
- package/src/utils/uploadutils.js +1 -1
package/dist/index.js
CHANGED
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x4383ac,Command as _0x445fdc}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x35315f,IconGooglePhotos as _0x3a2c00,IconGoogleDrive as _0x5ca79a,IconFacebook as _0x57961b,IconDropbox as _0x27eec2,IconUploadcareLink as _0x2dbcac,IconUploadcareImageUpload as _0x3469e0,IconError as _0x473bf7,IconUploadcareImageEdit as _0xe45f34}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x10dbd4,MenuBarMenuListItemButtonView as _0x42ba94,View as _0x2ef568,FocusCycler as _0x569ca4,Dialog as _0x4fec6b,DialogViewPosition as _0x1e78d3,SpinnerView as _0x4c7a01,IconView as _0x3faafe,Notification as _0xc0d412}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x1d7d69,DomEmitterMixin as _0x1e95a6,global as _0x4fb6a4,getAncestors as _0x857466,ObservableMixin as _0x30e54e,uid as _0x2a28a0,createElement as _0x407d29}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x65fbcd}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x7cc98d,info as _0x212641}from'@uploadcare/upload-client';import*as _0x4ac318 from'@uploadcare/file-uploader';var i=function(_0x53f3c7){return _0x53f3c7['Local']='local',_0x53f3c7['URL']='url',_0x53f3c7['Dropbox']='dropbox',_0x53f3c7['GDrive']='gdrive',_0x53f3c7['Facebook']='facebook',_0x53f3c7['GPhotos']='gphotos',_0x53f3c7['OneDrive']='onedrive',_0x53f3c7;}({});function _(_0x1a9e58,_0x1823d5,_0x542e8c){const t=_0x1a9e58['t'],_0x1ae411=_0x1a9e58['t'];switch(_0x1823d5){case i['Local']:return{'text':_0x1ae411('Insert'===_0x542e8c?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x1ae411('From\x20computer')};case i['URL']:return{'text':'Insert'===_0x542e8c?_0x1ae411('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x1ae411('Via\x20URL')};case i['Dropbox']:return{'text':t('Insert'===_0x542e8c?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case i['Facebook']:return{'text':t('Insert'===_0x542e8c?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case i['GDrive']:return{'text':t('Insert'===_0x542e8c?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case i['GPhotos']:return{'text':t('Insert'===_0x542e8c?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case i['OneDrive']:return{'text':t('Insert'===_0x542e8c?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x1823d5;}}class e extends _0x4383ac{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'UploadcareUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x143b4d=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x4675f9;for(const _0x4912e2 in _0x143b4d){const _0x228a6e=_0x4912e2,_0x37aa98=_0x143b4d[_0x228a6e];if('uploadcareLicenseKeyValid'==_0x37aa98||'uploadcareLicenseKeyInvalid'==_0x37aa98||'uploadcareLicenseKeyExpired'==_0x37aa98||'uploadcareLicenseKeyDomainLimit'==_0x37aa98||'uploadcareLicenseKeyNotAllowed'==_0x37aa98||'uploadcareLicenseKeyEvaluationLimit'==_0x37aa98||'uploadcareLicenseKeyTrialLimit'==_0x37aa98||'uploadcareLicenseKeyUsageLimit'==_0x37aa98){delete _0x143b4d[_0x228a6e],_0x4675f9=_0x37aa98,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x4675f9&&_0x143b4d['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x4675f9&&_0x143b4d['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x4675f9&&_0x143b4d['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x4675f9&&_0x143b4d['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x4675f9&&_0x143b4d['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyTrialLimit'==_0x4675f9&&_0x143b4d['_showLicenseError']('trialLimit'),'uploadcareLicenseKeyUsageLimit'==_0x4675f9&&_0x143b4d['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x5e0a34}=this,_0x39c24d=_0x5e0a34['commands']['get']('uploadcare');if(!_0x39c24d)return;const _0x5c071e=this['_normalizeConfigSourceList'](_0x5e0a34['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x40c09e,_0x21c05a)=>{const _0xb6b2bc=this['_getIntegrationKey'](_0x21c05a['type']);return _0x40c09e[_0xb6b2bc]||(_0x40c09e[_0xb6b2bc]=[]),_0x40c09e[_0xb6b2bc]['push'](_0x21c05a),_0x40c09e;},{});_0x5e0a34['plugins']['has']('ImageInsertUI')&&_0x5e0a34['commands']['get']('uploadcare')&&Object['entries'](_0x5c071e)['forEach'](([_0x231dd3,_0x142a48])=>{_0x5e0a34['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x231dd3,'observable':()=>_0x39c24d,'buttonViewCreator':()=>this['_createToolbarButton'](_0x142a48),'formViewCreator':()=>this['_createDropdownButtons'](_0x142a48),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x142a48),'override':'assetManager'!==_0x231dd3});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x29ed5c){const {locale:_0x2a2560}=this['editor'];return _0x29ed5c['map'](_0x166e71=>{const _0x4514c7=_(_0x2a2560,_0x166e71,'Insert');switch(_0x166e71){case i['Local']:return{'icon':_0x3469e0,'type':i['Local'],..._0x4514c7};case i['URL']:return{'icon':_0x2dbcac,'type':i['URL'],..._0x4514c7};case i['Dropbox']:return{'icon':_0x27eec2,'type':i['Dropbox'],..._0x4514c7};case i['Facebook']:return{'icon':_0x57961b,'type':i['Facebook'],..._0x4514c7};case i['GDrive']:return{'icon':_0x5ca79a,'type':i['GDrive'],..._0x4514c7};case i['GPhotos']:return{'icon':_0x3a2c00,'type':i['GPhotos'],..._0x4514c7};case i['OneDrive']:return{'icon':_0x35315f,'type':i['OneDrive'],..._0x4514c7};}});}['_getIntegrationKey'](_0x52e8a2){switch(_0x52e8a2){case i['Local']:return'upload';case i['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x220438,_0x139fd1){const _0xf4dce8=this['editor'],_0x181228=new _0x220438(_0xf4dce8['locale']),_0x113b27=_0xf4dce8['commands']['get']('uploadcare');return _0x181228['bind']('isEnabled')['to'](_0x113b27),_0x181228['on']('execute',()=>{_0x113b27['execute'](_0x139fd1);}),_0x181228;}['_createToolbarButton'](_0xa7db12){const {locale:_0x56f2be}=this['editor'],_0x3fa6fa=this['editor']['plugins']['get']('ImageInsertUI'),_0x30838e=_0xa7db12[0x0],_0x21d4af=this['_createButton'](_0x10dbd4,_0x30838e['type']);return _0x21d4af['icon']=_0x30838e['icon'],_0x21d4af['bind']('label')['to'](_0x3fa6fa,'isImageSelected',_0x50a17a=>_(_0x56f2be,_0x30838e['type'],_0x50a17a?'Replace':'Insert')['text']),_0x21d4af['tooltip']=!0x0,_0x21d4af;}['_createDropdownButtons'](_0x15c7af){const {locale:_0x28f619}=this['editor'],_0x56c98d=this['editor']['plugins']['get']('ImageInsertUI');return _0x15c7af['map'](_0x30cf69=>{const _0x1029fc=this['_createButton'](_0x10dbd4,_0x30cf69['type']);return _0x1029fc['withText']=!0x0,_0x1029fc['icon']=_0x30cf69['icon'],_0x1029fc['bind']('label')['to'](_0x56c98d,'isImageSelected',_0xd72016=>_(_0x28f619,_0x30cf69['type'],_0xd72016?'Replace':'Insert')['text']),_0x1029fc;});}['_createMenuBarButtons'](_0x334ba9){return _0x334ba9['map'](_0x284fd5=>{const _0x13e199=this['_createButton'](_0x42ba94,_0x284fd5['type']);return _0x13e199['icon']=_0x284fd5['icon'],_0x13e199['label']=_0x284fd5['shortText'],_0x13e199;});}}class W extends _0x2ef568{['focusTracker'];['focusCycler'];constructor(_0x2450eb){super(_0x2450eb),this['focusTracker']=new _0x1d7d69(),this['focusCycler']=new _0x569ca4({'focusables':this['createCollection'](),'focusTracker':this['focusTracker']});}['getFocusableElement'](){return{'tag':'div','attributes':{'aria-hidden':'true','tabindex':'0'},'on':{'focus':this['bindTemplate']['to'](()=>{this['focusCycler']['fire']('forwardCycle');})}};}}class V extends W{constructor(_0x37adb3,_0x5f3b25){super(_0x37adb3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':[{'tag':'uc-file-uploader-inline','attributes':{'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'uploader-'+_0x5f3b25}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function C(_0x4eb40e,_0x330cd3){const _0x593083=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x53159c=>_0x53159c<=_0x330cd3)['map'](_0x473fd6=>_0x4eb40e['replace'](/\/$/,'')+'/-/resize/'+_0x473fd6+'x/\x20'+_0x473fd6+'w');return{'imageFallbackUrl':_0x4eb40e,'imageSources':[{'srcset':_0x593083['join'](',\x20'),'sizes':'(max-width:\x20'+_0x330cd3+'px)\x20100vw,\x20'+_0x330cd3+'px','type':'image/webp'}]};}function J(_0x5c1eae,_0x380770,_0x8f0c88){const _0x4e49f2=_0x5c1eae['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x4e49f2?parseInt(_0x4e49f2[0x1],0xa):_0x380770,'height':_0x4e49f2?parseInt(_0x4e49f2[0x2],0xa):_0x8f0c88};}function p(_0xe20150,_0x16c340){const _0x3e2216=new(_0x1e95a6())(),_0x2e2d04=_0xe20150['plugins']['get']('ImageUtils'),_0x42e110=_0xe20150['editing']['mapper']['toViewElement'](_0x16c340),_0x20f1df=_0x2e2d04['findViewImgElement'](_0x42e110),_0x27c5b3=_0xe20150['editing']['view']['domConverter']['viewToDom'](_0x20f1df),_0x4b700a=_0x16c340['getAttribute']('width'),_0x1bfeda=_0x16c340['getAttribute']('height'),_0x193a5c='image-processing';_0xe20150['editing']['view']['change'](_0x5cb4c2=>{_0x5cb4c2['addClass'](_0x193a5c,_0x42e110),_0x5cb4c2['setStyle']('aspect-ratio',_0x4b700a+'/'+_0x1bfeda,_0x20f1df);}),_0x3e2216['listenTo'](_0x27c5b3,'load',()=>{_0x3e2216['stopListening'](_0x27c5b3,'load'),_0xe20150['editing']['view']['change'](_0x30c172=>{_0x30c172['removeClass'](_0x193a5c,_0x42e110),_0x30c172['removeStyle']('aspect-ratio',_0x20f1df);});});}function z(_0x344071){if(Array['isArray'](_0x344071)){const _0x55b963=_0x344071['map'](z);return _0x1b2149=>_0x55b963['some'](_0x57ce34=>_0x57ce34(_0x1b2149));}if('origin'==_0x344071){const _0x5a0ea2=_0x4fb6a4['window']['location']['origin'];return _0x9e6919=>new URL(_0x9e6919,_0x4fb6a4['document']['baseURI'])['origin']==_0x5a0ea2;}return'function'==typeof _0x344071?_0x344071:_0x344071 instanceof RegExp?_0xf6fa29=>!(!_0xf6fa29['match'](_0x344071)&&!_0xf6fa29['replace'](/^https?:\/\//,'')['match'](_0x344071)):()=>!0x1;}function Q(_0x4d0427,_0x2224c1){return _0x857466(_0x4d0427['target'])['includes'](_0x2224c1);}class n extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x30e54e(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x4f742d,_0x42bdbf,_0x107287){super(),this['_editor']=_0x4f742d,this['_editing']=_0x42bdbf,this['_dialog']=_0x4f742d['plugins']['get'](_0x4fec6b),this['_api']=_0x42bdbf['ctxElement']['getAPI'](),this['_type']=_0x107287,this['_editing']['configElement']['setAttribute']('source-list',this['_type']),this['_initDialog'](),this['_initListeners'](),this['_api']['initFlow']();}['destroy'](){this['_formView']&&(this['_formView']['destroy'](),this['_formView']=null),this['_api']&&this['_api']['doneFlow'](),this['stopListening'](),this['stopDelegating']();}['_initDialog'](){const {locale:_0x5e1d47,model:_0x209f99}=this['_editor'],_0x263980=_0x209f99['document']['selection']['getSelectedElement'](),_0x527baa=_0x263980&&(_0x263980['is']('element','imageBlock')||_0x263980['is']('element','imageInline'));this['_formView']=new V(_0x5e1d47,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x3469e0,'title':_(_0x5e1d47,this['_type'],_0x527baa?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x1e78d3['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x3a84b5=>!Q(_0x3a84b5,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x3ae0e4}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x9bbec1=>{const _0x5f1d00=_0x3ae0e4['length'];for(const _0x3b94a1 of _0x3ae0e4){const _0x37b8ef=_0x3b94a1===_0x3ae0e4[_0x5f1d00-0x1],{cdnUrl:_0x255785,fileInfo:_0x548337}=_0x3b94a1;if(!_0x255785||!_0x548337)continue;const {width:_0x38b7da,height:_0xdcdc6b}=_0x548337['imageInfo'],_0x2ef7b7=J(_0x255785,_0x38b7da,_0xdcdc6b),_0x449098=C(_0x255785,_0x2ef7b7['width']),_0x4365d9={'id':_0x548337['uuid'],'type':'image','attributes':{'imageDimension':_0x2ef7b7,..._0x449098}};this['_insertAsset'](_0x4365d9,_0x37b8ef,_0x9bbec1);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x288e09=>{'idle'===_0x288e09['detail']['status']&&!_0x288e09['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===i['Local']?this['_api']['setCurrentActivity'](i['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x5763df,_0x1c51e8,_0x55489c){const _0x13f9cc=this['_editor']['model']['document']['selection'],_0xf3e925=_0x13f9cc['getSelectedElement'](),_0x17ef00=!(!_0xf3e925||!_0xf3e925['is']('element','imageInline'));_0x55489c['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x5763df,_0x17ef00),_0x1c51e8||_0x55489c['setSelection'](_0x13f9cc['getLastPosition']());}['_insertImage'](_0x347801,_0x1461ca){const _0xe8f795=this['_editor'],{imageDimension:_0xfc6554,imageFallbackUrl:_0x2aae35,imageSources:_0xe29c6b}=_0x347801['attributes'];_0xe8f795['execute']('insertImage',{'imageType':_0x1461ca?'imageInline':null,'source':{'uploadcareImageId':_0x347801['id'],'src':_0x2aae35,'sources':_0xe29c6b,..._0xfc6554}});}}class w extends _0x445fdc{['_editing'];['_controller']=null;static get['requires'](){return[_0x4fec6b,o];}constructor(_0x2ebb50){super(_0x2ebb50),this['_editing']=_0x2ebb50['plugins']['get'](o);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x570252){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new n(this['editor'],this['_editing'],_0x570252);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class j{static['upload']({file:_0x226efe,..._0x115ef4}){return _0x7cc98d(_0x226efe,_0x115ef4);}static['getInfo'](_0x3ebbb4,_0x1f6bf3){return _0x212641(_0x3ebbb4,_0x1f6bf3);}}class f extends _0x4383ac{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x65fbcd,o];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x227c75=this['editor'];if(!!!_0x227c75['config']['get']('uploadcare'))return;_0x227c75['plugins']['get'](_0x65fbcd)['createUploadAdapter']=_0x56a32c=>new k(_0x56a32c,_0x227c75),_0x227c75['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x20de18,{imageElement:_0x1ac723,data:_0x2a6e7d})=>{_0x227c75['model']['change'](_0x1994be=>{_0x1994be['setAttribute']('uploadcareImageId',_0x2a6e7d['uploadcareImageId'],_0x1ac723);});});}}class k{['loader'];['editor'];['controller'];constructor(_0x13e01f,_0x557186){this['loader']=_0x13e01f,this['editor']=_0x557186,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x338bc8=await this['loader']['file'];return j['upload']({'file':_0x338bc8,'publicKey':this['editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':this['controller']['signal'],'onProgress':_0x2711c0=>{_0x2711c0&&_0x2711c0['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x2711c0['value']);}})['then'](async _0x57591d=>{const {imageFallbackUrl:_0xc3ee6e,imageSources:_0x5751e2}=C(_0x57591d['cdnUrl'],_0x57591d['imageInfo']['width']);return{'uploadcareImageId':_0x57591d['uuid'],'default':_0xc3ee6e,'sources':_0x5751e2};})['catch'](()=>{const _0x50cb8c=t('Cannot\x20upload\x20file:')+('\x20'+_0x338bc8['name']+'.');return Promise['reject'](_0x50cb8c);});}['abort'](){this['controller']['abort']();}}class o extends _0x4383ac{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',f,_0x4fec6b];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x1fd141){super(_0x1fd141),this['ucContextId']=_0x2a28a0();}['init'](){const _0x2937ea=this['editor'];_0x2937ea['commands']['add']('uploadcare',new w(_0x2937ea));}['afterInit'](){this['_initSchema'](),this['_initConversion'](),this['_initConfig'](),this['_initCtx'](),this['_initImageProcessingIndicator'](),this['listenTo'](this['editor'],'destroy',()=>{this['_configElement']&&(this['_configElement']['remove'](),this['_configElement']=null),this['_ctxElement']&&(this['_ctxElement']['remove'](),this['_ctxElement']=null);const _0x54a194=_0x4fb6a4['document']['querySelector']('input[uploadcare-file-input]');_0x54a194&&_0x54a194['remove']();}),async function(_0x52148d){const _0x21e2a6=_0x2b3db5([0x52,0x42,0x63,0x58,0x64,0x47,0x66,0x35,0x36,0x37,0x6d,0x4e,0x6a,0x4b,0x39,0x44,0x54,0x70,0x50,0x30,0x49,0x79,0x69,0x33,0x67,0x65,0x61,0x38,0x5a,0x76,0x7a,0x6c,0x45,0x34,0x62,0x46,0x75,0x57,0x72,0x77,0x73,0x48,0x31,0x68,0x6e,0x4f,0x53,0x4c,0x71,0x6b,0x59,0x32,0x4d,0x51,0x4a,0x78,0x6f,0x56,0x41,0x55,0x74,0x43]),_0x2907ba=0x3d8d0df,_0x563010=0x3dfa687^_0x2907ba,_0x101d6d=window[_0x2b3db5([0x44,0x61,0x74,0x65])][_0x2b3db5([0x6e,0x6f,0x77])](),_0x51d1a5=_0x52148d[_0x2b3db5([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x508e87=new window[(_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x292f06=>{_0x51d1a5[_0x2b3db5([0x6f,0x6e,0x63,0x65])](_0x2b3db5([0x72,0x65,0x61,0x64,0x79]),_0x292f06);}),_0x1dc79a={[_0x2b3db5([0x6b,0x74,0x79])]:_0x2b3db5([0x45,0x43]),[_0x2b3db5([0x75,0x73,0x65])]:_0x2b3db5([0x73,0x69,0x67]),[_0x2b3db5([0x63,0x72,0x76])]:_0x2b3db5([0x50,0x2d,0x32,0x35,0x36]),[_0x2b3db5([0x78])]:_0x2b3db5([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x2b3db5([0x79])]:_0x2b3db5([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x2b3db5([0x61,0x6c,0x67])]:_0x2b3db5([0x45,0x53,0x32,0x35,0x36])},_0x102101=_0x51d1a5[_0x2b3db5([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x2b3db5([0x67,0x65,0x74])](_0x2b3db5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x587b82(){let _0x2026ac,_0x6571f1=null,_0x1f873e=null;try{if(_0x102101==_0x2b3db5([0x47,0x50,0x4c]))return _0x2b3db5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x2026ac=_0x26936a(),!_0x2026ac)return _0x2b3db5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x2026ac[_0x2b3db5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x1f873e=_0x54310f(_0x2026ac[_0x2b3db5([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x2026ac[_0x2b3db5([0x6a,0x74,0x69])])),await _0x5a1647()?_0x5c1c3c()?_0xc9a0d7()?_0x2b3db5([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x3e04a3()?(_0x2026ac[_0x2b3db5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2b3db5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x6571f1=_0x36d2c8(_0x2b3db5([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x2026ac[_0x2b3db5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x2b3db5([0x74,0x72,0x69,0x61,0x6c])&&(_0x6571f1=_0x36d2c8(_0x2b3db5([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x540ee7()):_0x2b3db5([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x2b3db5([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x2b3db5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x2b3db5([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0xc9a0d7(){const _0x239df1=[_0x2b3db5([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x2b3db5([0x74,0x72,0x69,0x61,0x6c])][_0x2b3db5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2026ac[_0x2b3db5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x101d6d/0x3e8:0xe10*_0x563010;return _0x2026ac[_0x2b3db5([0x65,0x78,0x70])]<_0x239df1;}function _0x5c1c3c(){const _0x226ccc=_0x2026ac[_0x2b3db5([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x226ccc&&(!!_0x226ccc[_0x2b3db5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b3db5([0x2a]))||!!_0x226ccc[_0x2b3db5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b3db5([0x55,0x50,0x4c,0x43])));}function _0x3e04a3(){const _0x2b9fd2=_0x2026ac[_0x2b3db5([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x2b9fd2||0x0==_0x2b9fd2[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x44f10f}=new URL(window[_0x2b3db5([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x2b9fd2[_0x2b3db5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x44f10f))return!0x0;const _0x13f2e0=_0x44f10f[_0x2b3db5([0x73,0x70,0x6c,0x69,0x74])](_0x2b3db5([0x2e]));return _0x2b9fd2[_0x2b3db5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4d6909=>_0x4d6909[_0x2b3db5([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2b3db5([0x2a])))[_0x2b3db5([0x6d,0x61,0x70])](_0x44dfb7=>_0x44dfb7[_0x2b3db5([0x73,0x70,0x6c,0x69,0x74])](_0x2b3db5([0x2e])))[_0x2b3db5([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4e7945=>_0x4e7945[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x13f2e0[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2b3db5([0x6d,0x61,0x70])](_0x569a95=>Array(_0x13f2e0[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x569a95[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x2b3db5([0x66,0x69,0x6c,0x6c])](_0x569a95[0x0]===_0x2b3db5([0x2a])?_0x2b3db5([0x2a]):'')[_0x2b3db5([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x569a95))[_0x2b3db5([0x73,0x6f,0x6d,0x65])](_0x5c5098=>_0x13f2e0[_0x2b3db5([0x65,0x76,0x65,0x72,0x79])]((_0x236be3,_0x2d9af4)=>_0x5c5098[_0x2d9af4]===_0x236be3||_0x5c5098[_0x2d9af4]===_0x2b3db5([0x2a])));}function _0x540ee7(){return _0x6571f1&&_0x1f873e?new window[(_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x4a072d,_0x59cdc3)=>{_0x6571f1[_0x2b3db5([0x74,0x68,0x65,0x6e])](_0x4a072d,_0x59cdc3),_0x1f873e[_0x2b3db5([0x74,0x68,0x65,0x6e])](_0xbc177a=>{_0xbc177a!=_0x2b3db5([0x56,0x61,0x6c,0x69,0x64])&&_0x4a072d(_0xbc177a);},_0x59cdc3);}):_0x6571f1||_0x1f873e||_0x2b3db5([0x56,0x61,0x6c,0x69,0x64]);}}function _0x54310f(_0x233899,_0xd9bd30){return new window[(_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1161a7=>{if(_0xc6b2f3())return _0x1161a7(_0x2b3db5([0x56,0x61,0x6c,0x69,0x64]));_0x418a9d(),_0x51d1a5[_0x2b3db5([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x2b3db5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0xf113df=!0x1;const _0x5bd0de=_0x2a28a0();function _0x242c77(_0x36aafa){return!!_0x36aafa&&(typeof _0x36aafa===_0x2b3db5([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x36aafa===_0x2b3db5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x36aafa[_0x2b3db5([0x74,0x68,0x65,0x6e])]===_0x2b3db5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x36aafa[_0x2b3db5([0x63,0x61,0x74,0x63,0x68])]===_0x2b3db5([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x42f3ba(_0x5cd2e8){_0x2ad05d(_0x5cd2e8)[_0x2b3db5([0x74,0x68,0x65,0x6e])](_0x2337e4=>{if(!_0x2337e4||_0x2337e4[_0x2b3db5([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x2b3db5([0x6f,0x6b]))return _0x2b3db5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x2e5d02(_0x206007(_0x5bd0de+_0xd9bd30))!=_0x2337e4[_0x2b3db5([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x2b3db5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x2b3db5([0x56,0x61,0x6c,0x69,0x64]);})[_0x2b3db5([0x74,0x68,0x65,0x6e])](_0x281d34=>(_0xfa0a21(),_0x281d34),()=>{const _0x1a0d1b=_0x100241();return null==_0x1a0d1b?(_0xfa0a21(),_0x2b3db5([0x56,0x61,0x6c,0x69,0x64])):_0x2b3db5(_0x101d6d-_0x1a0d1b>(0x27d454df^_0x2907ba)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x2b3db5([0x74,0x68,0x65,0x6e])](_0x1161a7)[_0x2b3db5([0x63,0x61,0x74,0x63,0x68])](()=>{_0x1161a7(_0x2b3db5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x15a2b5=0x3ee3e5f^_0x2907ba;function _0xfa0a21(){const _0x3e0ba7=_0x2b3db5([0x6c,0x6c,0x63,0x74,0x2d])+_0x2e5d02(_0x206007(_0x233899)),_0x59a1c1=_0xe7442d(_0x2e5d02(window[_0x2b3db5([0x4d,0x61,0x74,0x68])][_0x2b3db5([0x63,0x65,0x69,0x6c])](_0x101d6d/_0x15a2b5)));window[_0x2b3db5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2b3db5([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3e0ba7,_0x59a1c1);}function _0x100241(){const _0x2953c0=_0x2b3db5([0x6c,0x6c,0x63,0x74,0x2d])+_0x2e5d02(_0x206007(_0x233899)),_0xac5667=window[_0x2b3db5([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x2b3db5([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x2953c0);return _0xac5667?window[_0x2b3db5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xe7442d(_0xac5667),0x10)*_0x15a2b5:null;}function _0x2ad05d(_0x59d1c3){return new window[(_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x56f701,_0x2b188a)=>{_0x59d1c3[_0x2b3db5([0x74,0x68,0x65,0x6e])](_0x56f701,_0x2b188a),window[_0x2b3db5([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x2b188a,0x3d9041f^_0x2907ba);});}}_0x51d1a5[_0x2b3db5([0x6f,0x6e])](_0x2b3db5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x538589,_0x422d1d)=>{if(_0x422d1d[0x0]!=_0x233899)return _0x1161a7(_0x2b3db5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x422d1d[0x1]={..._0x422d1d[0x1],[_0x2b3db5([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x5bd0de};},{[_0x2b3db5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2b3db5([0x68,0x69,0x67,0x68])}),_0x51d1a5[_0x2b3db5([0x6f,0x6e])](_0x2b3db5([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x2dd427=>{_0x242c77(_0x2dd427[_0x2b3db5([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0xf113df=!0x0,_0x42f3ba(_0x2dd427[_0x2b3db5([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x2b3db5([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x2b3db5([0x6c,0x6f,0x77])}),_0x508e87[_0x2b3db5([0x74,0x68,0x65,0x6e])](()=>{_0xf113df||_0x1161a7(_0x2b3db5([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0xc6b2f3(){return _0x51d1a5[_0x2b3db5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2b3db5([0x76,0x69,0x65,0x77])][_0x2b3db5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x2b3db5([0x61,0x75,0x74,0x6f]);}function _0x418a9d(){_0x51d1a5[_0x2b3db5([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x2b3db5([0x76,0x69,0x65,0x77])][_0x2b3db5([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x2b3db5([0x61,0x75,0x74,0x6f]);}}function _0x36d2c8(_0x48c0db){const _0xc45ff3=[new window[(_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3c5fdb=>setTimeout(_0x3c5fdb,0x3d1ee13^_0x2907ba)),_0x508e87[_0x2b3db5([0x74,0x68,0x65,0x6e])](()=>new window[(_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x9e8473=>{let _0x529983=0x0;_0x51d1a5[_0x2b3db5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2b3db5([0x6f,0x6e])](_0x2b3db5([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4b7937,_0x21e119)=>{_0x21e119[0x0][_0x2b3db5([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x529983++,_0x529983==(0x3d8d127^_0x2907ba)&&(_0x9e8473(),_0x4b7937[_0x2b3db5([0x6f,0x66,0x66])]());});}))];return window[_0x2b3db5([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x2b3db5([0x72,0x61,0x63,0x65])](_0xc45ff3)[_0x2b3db5([0x74,0x68,0x65,0x6e])](()=>_0x48c0db);}async function _0x54360f(){await _0x508e87,_0x51d1a5[_0x2b3db5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2b3db5([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x565054,_0x51d1a5[_0x2b3db5([0x6d,0x6f,0x64,0x65,0x6c])][_0x2b3db5([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x565054,_0x51d1a5[_0x2b3db5([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x2b3db5([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x48c4f2(_0x273305){const _0x4ec6b3=_0x413ece();_0x51d1a5[_0x4ec6b3]=_0x2b3db5([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x273305,_0x273305!=_0x2b3db5([0x56,0x61,0x6c,0x69,0x64])&&_0x54360f();}function _0x413ece(){const _0x3f5c32=window[_0x2b3db5([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x2b3db5([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x2b3db5([0x6e,0x6f,0x77])]())[_0x2b3db5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x2b3db5([0x2e]),'');let _0x4de702=_0x2b3db5([0x52]);for(let _0x496ad5=0x0;_0x496ad5<_0x3f5c32[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x496ad5+=0x2){let _0x1cbb63=window[_0x2b3db5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x3f5c32[_0x2b3db5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x496ad5,_0x496ad5+0x2));_0x1cbb63>=_0x21e2a6[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1cbb63-=_0x21e2a6[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x4de702+=_0x21e2a6[_0x1cbb63];}return _0x4de702;}function _0x26936a(){const _0x42884a=_0x102101[_0x2b3db5([0x73,0x70,0x6c,0x69,0x74])](_0x2b3db5([0x2e]));if(0x3!=_0x42884a[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x17d6ae(_0x42884a[0x1]);function _0x17d6ae(_0x3c1b27){const _0x5e3a6d=_0x404b6d(_0x3c1b27);return _0x5e3a6d&&_0x5c4bdc()?_0x5e3a6d:null;function _0x5c4bdc(){const _0x25277a=_0x5e3a6d[_0x2b3db5([0x6a,0x74,0x69])],_0x2856ff=window[_0x2b3db5([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x25277a[_0x2b3db5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x25277a[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x508ff9={..._0x5e3a6d,[_0x2b3db5([0x6a,0x74,0x69])]:_0x25277a[_0x2b3db5([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x25277a[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x508ff9[_0x2b3db5([0x76,0x63])],_0x206007(_0x508ff9)==_0x2856ff;}}}async function _0x5a1647(){let _0xcf5264=!0x0;try{const _0x330ecb=_0x102101[_0x2b3db5([0x73,0x70,0x6c,0x69,0x74])](_0x2b3db5([0x2e])),[_0x265c68,_0x2547ab,_0x31eec5]=_0x330ecb;return _0x30ed69(_0x265c68),await _0x38aa69(_0x265c68,_0x2547ab,_0x31eec5),_0xcf5264;}catch{return!0x1;}function _0x30ed69(_0x5c72ca){const _0x22fc7c=_0x404b6d(_0x5c72ca);_0x22fc7c&&_0x22fc7c[_0x2b3db5([0x61,0x6c,0x67])]==_0x2b3db5([0x45,0x53,0x32,0x35,0x36])||(_0xcf5264=!0x1);}async function _0x38aa69(_0x29471e,_0x22ed49,_0x2f918d){const _0x4cd430=window[_0x2b3db5([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x2b3db5([0x66,0x72,0x6f,0x6d])](_0x15bf0f(_0x2f918d),_0x3a1d2d=>_0x3a1d2d[_0x2b3db5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2930ad=new window[(_0x2b3db5([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x2b3db5([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x29471e+_0x2b3db5([0x2e])+_0x22ed49),_0x82feeb=window[_0x2b3db5([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x2b3db5([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x82feeb)return;const _0x451cea=await _0x82feeb[_0x2b3db5([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x2b3db5([0x6a,0x77,0x6b]),_0x1dc79a,{[_0x2b3db5([0x6e,0x61,0x6d,0x65])]:_0x2b3db5([0x45,0x43,0x44,0x53,0x41]),[_0x2b3db5([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x2b3db5([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x2b3db5([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x82feeb[_0x2b3db5([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x2b3db5([0x6e,0x61,0x6d,0x65])]:_0x2b3db5([0x45,0x43,0x44,0x53,0x41]),[_0x2b3db5([0x68,0x61,0x73,0x68])]:{[_0x2b3db5([0x6e,0x61,0x6d,0x65])]:_0x2b3db5([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x451cea,_0x4cd430,_0x2930ad)||(_0xcf5264=!0x1);}}function _0x404b6d(_0x418256){return _0x418256[_0x2b3db5([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x2b3db5([0x65,0x79]))?JSON[_0x2b3db5([0x70,0x61,0x72,0x73,0x65])](_0x15bf0f(_0x418256)):null;}function _0x15bf0f(_0x116ace){return window[_0x2b3db5([0x61,0x74,0x6f,0x62])](_0x116ace[_0x2b3db5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x2b3db5([0x2b]))[_0x2b3db5([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x2b3db5([0x2f])));}function _0x206007(_0x40613c){let _0x5aca6b=0x1505;function _0x1da3dd(_0x2ffd99){for(let _0x3b1f2c=0x0;_0x3b1f2c<_0x2ffd99[_0x2b3db5([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3b1f2c++){const _0x187cde=_0x2ffd99[_0x2b3db5([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3b1f2c);_0x5aca6b=(_0x5aca6b<<0x5)+_0x5aca6b+_0x187cde,_0x5aca6b&=_0x5aca6b;}}function _0x538f16(_0x1ceb04){Array[_0x2b3db5([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x1ceb04)?_0x1ceb04[_0x2b3db5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x538f16):_0x1ceb04&&typeof _0x1ceb04==_0x2b3db5([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x2b3db5([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x1ceb04)[_0x2b3db5([0x73,0x6f,0x72,0x74])]()[_0x2b3db5([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2fe296,_0x5f1c0d])=>{_0x1da3dd(_0x2fe296),_0x538f16(_0x5f1c0d);}):_0x1da3dd(window[_0x2b3db5([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x1ceb04));}return _0x538f16(_0x40613c),_0x5aca6b>>>0x0;}function _0x2e5d02(_0x2695f1){return _0x2695f1[_0x2b3db5([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x2b3db5([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x2b3db5([0x30]));}function _0xe7442d(_0x1e8b81){return _0x1e8b81[_0x2b3db5([0x73,0x70,0x6c,0x69,0x74])]('')[_0x2b3db5([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x2b3db5([0x6a,0x6f,0x69,0x6e])]('');}function _0x565054(){}function _0x2b3db5(_0x238764){return _0x238764['map'](_0x35b213=>String['fromCharCode'](_0x35b213))['join']('');}_0x48c4f2(await _0x587b82());}(this);}['_initSchema'](){const _0x2b8b7e=this['editor']['model']['schema'];_0x2b8b7e['isRegistered']('imageBlock')&&_0x2b8b7e['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x2b8b7e['isRegistered']('imageInline')&&_0x2b8b7e['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x2e17fc=this['editor'];_0x2e17fc['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x2e17fc['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x44a7eb=>_0x44a7eb['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x37c067=_0x2e17fc['commands']['get']('replaceImageSource');_0x37c067&&this['listenTo'](_0x37c067,'cleanupImage',(_0x3446bf,[_0x518e39,_0x228973])=>{_0x518e39['removeAttribute']('uploadcareImageId',_0x228973);});}['_initConfig'](){const _0x3919a3=this['editor']['config']['get']('uploadcare.uploader')||{},_0x1adeb1=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x407d29(_0x4fb6a4['document'],'uc-config',{..._0x3919a3,'pubkey':_0x1adeb1,'ctx-name':'uploader-'+this['ucContextId'],'sourceList':'','imgOnly':'true','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage'],'externalSourcesEmbedCss':'\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup\x20{\x20padding:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-menu\x20{\x20gap:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-footer\x20{\x20padding-top:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__separator\x20{\x20margin:\x200;\x20}\x0a\x09\x09\x09'}),this['_configElement']['iconHrefResolver']=_0xca3655=>{if('closeMax'==_0xca3655)return'#uc-icon-arrow-down';},_0x4fb6a4['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x407d29(_0x4fb6a4['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x4fb6a4['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x106e1e=this['editor']['commands']['get']('insertImage');_0x106e1e&&this['listenTo'](_0x106e1e,'execute',()=>{const _0x268d1b=this['editor']['model']['document']['selection']['getSelectedElement']();_0x268d1b&&_0x268d1b['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x268d1b);});});const _0x223f91=this['editor']['commands']['get']('uploadcareImageReplace');_0x223f91&&this['listenTo'](_0x223f91,'execute',()=>{const _0x7358f8=this['editor']['model']['document']['selection']['getSelectedElement']();_0x7358f8&&_0x7358f8['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x7358f8);});});}}class tt extends _0x4383ac{static get['requires'](){return[o,e];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3dc123){super(_0x3dc123),_0x3dc123['config']['define']('uploadcare.uploader.sourceList',[i['Local'],i['URL']]),_0x4ac318['defineComponents'](_0x4ac318);}}class ii extends _0x2ef568{constructor(_0x5647fe){super(_0x5647fe);const t=_0x5647fe['t'],_0x515796=this['bindTemplate'],_0x157ec0=new _0x4c7a01();_0x157ec0['isVisible']=!0x0,this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__loading'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__loading-spinner']},'children':[_0x157ec0,{'text':_0x515796['to']('imageUploadProgress',_0x43ff59=>t('Loading\x20image...')+'\x20('+(_0x43ff59||0x0)+'%)')}]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class ti extends _0x2ef568{constructor(_0x345ce2){super(_0x345ce2);const t=_0x345ce2['t'];this['set']('errorType',null);const _0x11baa7=new _0x10dbd4(_0x345ce2);_0x11baa7['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x11baa7['withText']=!0x0,_0x11baa7['class']='ck-button-action',_0x11baa7['on']('execute',()=>{this['fire']('retry');}),_0x11baa7['bind']('isVisible')['to'](this,'errorType',_0x23e53d=>'NotFound'!==_0x23e53d);const _0x30fdfa=new _0x3faafe();_0x30fdfa['content']=_0x473bf7,_0x30fdfa['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x5734a=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__error'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__error-contents']},'children':[_0x30fdfa,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x5734a['to']('errorType',_0x5eab7c=>t('NotFound'!==_0x5eab7c?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x11baa7]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class ei extends _0x2ef568{constructor(_0x1de53b,_0x138309){super(_0x1de53b);const _0x1d1ad5=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x138309,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x1d1ad5['to']('imageSrc')}});}}class X extends W{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x2d9c5c,_0x471ec3,_0x4d6509){super(_0x2d9c5c),this['_items']=this['createCollection'](),this['_loadingView']=new ii(_0x2d9c5c),this['_errorView']=new ti(_0x2d9c5c),this['_editingView']=new ei(_0x2d9c5c,_0x4d6509),this['_focusableView']=new _0x2ef568(_0x2d9c5c),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x471ec3),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':this['_items']}),this['_setView'](),this['once']('render',()=>{this['_waitForImageEditorComponent'](this['element'],_0x44c006=>{this['_addUploadcareImageEditorListeners'](_0x44c006);});}),this['on']('change:status',()=>{this['_setView']();}),this['_addErrorViewListeners']();}['focus'](){this['element']['focus']();}['_setView'](){switch(this['_items']['clear'](),this['status']){case'uploading':this['_items']['add'](this['_loadingView']);break;case'error':this['_items']['add'](this['_errorView']);break;case'ready':this['_items']['addMany']([this['_editingView'],this['_focusableView']]);}}['_waitForImageEditorComponent'](_0x49e98d,_0xd4d7af){const _0x3a718a='uc-cloud-image-editor',_0x3207ab=_0x49e98d['querySelector'](_0x3a718a);if(_0x3207ab)return _0xd4d7af(_0x3207ab);const _0x5197a7=new MutationObserver(_0x2bb155=>{const _0x566dae=_0x2bb155['filter'](_0x51b94b=>_0x51b94b['target']===_0x49e98d&&_0x51b94b['addedNodes']['length']>0x0&&_0x51b94b['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x3a718a);_0x566dae['length']&&(_0x5197a7['disconnect'](),_0xd4d7af(_0x566dae[0x0]['addedNodes'][0x0]));});_0x5197a7['observe'](_0x49e98d,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x89f919){_0x89f919['addEventListener']('apply',_0x473d13=>{this['fire']('apply',{'imageSrc':_0x473d13['detail']['cdnUrl']});}),_0x89f919['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class E extends/* #__PURE__ -- @preserve */
|
|
25
|
-
_0x30e54e(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x551dcd,_0x1ce31c,_0x2db7dd){super(),this['_editor']=_0x551dcd,this['_dialog']=_0x1ce31c,this['_imageElement']=_0x2db7dd,this['_imageCache']=this['_editor']['plugins']['get']('UploadcareImageEditUI')['imageCache'],this['_attributes']=this['_editor']['config']['get']('uploadcare.editor')||{},this['set']({'isActive':!0x0,'imageStatus':'ready','imageErrorType':null,'imageId':null,'imageSrc':null,'imageDimension':null,'imageUploadProgress':null}),this['_prepareImage'](),this['_showDialog']();}['destroy'](){this['isActive']=!0x1,this['stopListening'](),this['stopDelegating'](),'uploading'===this['imageStatus']&&this['_controller']&&this['_controller']['abort']();}async['_prepareImage'](){const _0x545289=this['_imageElement'],_0x448dbb=_0x545289['getAttribute']('uploadcareImageId'),_0x1641fd=_0x545289['getAttribute']('src');if(_0x448dbb)await this['_loadImageInfo'](_0x448dbb,_0x1641fd);else{if(this['_imageCache']['has'](_0x1641fd)){const _0x2a01a7=this['_imageCache']['get'](_0x1641fd);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x2a01a7['url'],this['imageDimension']=_0x2a01a7['dimension'],this['imageId']=_0x2a01a7['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x3da139}=this['_editor'],t=_0x3da139['t'],_0x2a941a=new X(_0x3da139,this['imageStatus'],this['_attributes']);_0x2a941a['bind']('status')['to'](this,'imageStatus'),_0x2a941a['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x2a941a['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x2a941a['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x2a941a,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0xe45f34,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x2a941a,'position':_0x1e78d3['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x2a941a['focus']();},'onHide':()=>{_0x2a941a['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0xff9967=>!Q(_0xff9967,_0x2a941a['element'])}});}['_loadImageInfo'](_0x353ef1,_0x265cb8){return j['getInfo'](_0x353ef1,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x1858ce=>{const {width:_0x226051,height:_0x463c04}=_0x1858ce['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x265cb8,this['imageDimension']={'width':_0x226051,'height':_0x463c04},this['imageId']=_0x353ef1;})['catch'](_0x58c502=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x58c502['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x1cd779,_0x6bb1d5){return this['_getImageAsFile'](_0x1cd779)['then'](_0xcdc9e4=>j['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0x6bb1d5['signal'],'file':_0xcdc9e4,'onProgress':_0x2e2783=>{_0x2e2783&&_0x2e2783['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x2e2783['value']));}}))['then'](_0x119d76=>{const {width:_0x29f2d9,height:_0x3ed069}=_0x119d76['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x119d76['cdnUrl'],this['imageDimension']={'width':_0x29f2d9,'height':_0x3ed069},this['imageId']=_0x119d76['uuid'],this['imageUploadProgress']=null;const _0x45f71a=_0x1cd779['getAttribute']('src');this['_imageCache']['set'](_0x45f71a,{'id':_0x119d76['uuid'],'url':_0x119d76['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x501c38=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x501c38['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x30e26a,_0x29e40a){_0x30e26a['on']('apply',(_0x365c10,_0x5e4971)=>{this['_replaceImage'](_0x29e40a,_0x5e4971['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x30e26a['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x30e26a['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0xfa958,_0x51842e,_0x2b2878){const _0x311d47=this['_editor'],{width:_0x6fc78b,height:_0x30c956}=J(_0x51842e,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x9bb442,imageSources:_0x1daa54}=C(_0x51842e,_0x6fc78b);_0x311d47['model']['change'](_0x35d47e=>{if('$graveyard'===_0xfa958['root']['rootName']){_0x311d47['execute']('insertImage',{'imageType':_0xfa958['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0xfa958['getAttributes']()),'uploadcareImageId':_0x2b2878,'src':_0x9bb442,'sources':_0x1daa54,'width':_0x6fc78b,'height':_0x30c956}});const _0x3bc198=_0xfa958['getChildren']();_0xfa958=_0x311d47['model']['document']['selection']['getSelectedElement']();for(const _0x44164c of _0x3bc198)_0x35d47e['append'](_0x35d47e['cloneElement'](_0x44164c),_0xfa958);}else _0x35d47e['setSelection'](_0xfa958,'on'),_0x311d47['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0xfa958['getAttributes']()),'uploadcareImageId':_0x2b2878,'src':_0x9bb442,'sources':_0x1daa54,'width':_0x6fc78b,'height':_0x30c956},_0xfa958);_0x35d47e['setSelection'](_0xfa958,'on');});}async['_getImageAsFile'](_0x19881e){const _0x3d84ad=_0x4fb6a4['window'],_0x5a5883=_0x4fb6a4['document']['location']['href'],_0x386d4b=new _0x3d84ad['URL'](_0x19881e['getAttribute']('src'),_0x5a5883);if('data:'===_0x386d4b['protocol']){const _0x11d5b9=_0x386d4b['href']['split'](','),_0x35d346=_0x11d5b9[0x0]['match'](/:(.*?);/)[0x1],_0xc32f8e=_0x35d346['split']('/')[0x1],_0x541d90=_0x3d84ad['atob'](_0x11d5b9[_0x11d5b9['length']-0x1]);let _0x2e8144=_0x541d90['length'];const _0x1f6d4b=new _0x3d84ad['Uint8Array'](_0x2e8144);for(;_0x2e8144--;)_0x1f6d4b[_0x2e8144]=_0x541d90['charCodeAt'](_0x2e8144);return new _0x3d84ad['File']([_0x1f6d4b],'image.'+_0xc32f8e,{'type':_0x35d346});}const _0x18a903=_0x386d4b['href']['split']('/'),_0xd4f85c=_0x18a903[_0x18a903['length']-0x1],_0x5f5183=_0xd4f85c['split']('.')[0x1];return _0x3d84ad['fetch'](_0x386d4b['href'])['then'](_0x57dec3=>_0x57dec3['clone']()['blob']())['then'](_0x265989=>new _0x3d84ad['File']([_0x265989],_0xd4f85c,{'type':'image/'+_0x5f5183}));}}class O extends _0x445fdc{['imageEditController'];static get['requires'](){return[_0x4fec6b];}['_isEditable'];constructor(_0x3f4b7f){super(_0x3f4b7f),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x254f6d){const _0x2b8016=z(_0x254f6d);return _0x169784=>!(!_0x169784||!_0x169784['is']('element','imageBlock')&&!_0x169784['is']('element','imageInline'))&&(!!_0x169784['hasAttribute']('uploadcareImageId')||!!_0x169784['hasAttribute']('src')&&_0x2b8016(_0x169784['getAttribute']('src')));}(_0x3f4b7f['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x59974d=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x59974d);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x466086=this['editor']['model']['document']['selection']['getSelectedElement']();_0x466086&&(_0x466086['is']('element','imageBlock')||_0x466086['is']('element','imageInline'))&&(this['imageEditController']=new E(this['editor'],this['editor']['plugins']['get'](_0x4fec6b),_0x466086),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class R extends _0x445fdc{['refresh'](){const _0x38d1a8=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x38d1a8&&(_0x38d1a8['is']('element','imageBlock')||_0x38d1a8['is']('element','imageInline')));}['execute'](_0x22dfec){const _0xec335b=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x3dc5b2=>{_0x3dc5b2['setAttributes'](_0x22dfec,_0xec335b),_0x3dc5b2['removeAttribute']('srcset',_0xec335b),_0x3dc5b2['removeAttribute']('sizes',_0xec335b);});}}class m extends _0x4383ac{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[o,_0xc0d412,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x424907}=this;_0x424907['commands']['add']('uploadcareImageEdit',new O(_0x424907)),_0x424907['commands']['add']('uploadcareImageReplace',new R(_0x424907));}}class g extends _0x4383ac{['_imageCache']=new Map();static get['pluginName'](){return'UploadcareImageEditUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['imageCache'](){return this['_imageCache'];}['init'](){const _0x44acb4=this['editor'];_0x44acb4['ui']['componentFactory']['add']('uploadcareImageEdit',_0x37b74e=>{const _0x37dd6d=_0x44acb4['commands']['get']('uploadcareImageEdit'),_0x1421c3=new _0x10dbd4(_0x37b74e),t=_0x37b74e['t'];return _0x1421c3['set']({'icon':_0xe45f34,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x1421c3['bind']('isEnabled')['to'](_0x37dd6d),_0x1421c3['bind']('isOn')['to'](_0x37dd6d,'isActive'),this['listenTo'](_0x1421c3,'execute',()=>{_0x44acb4['execute']('uploadcareImageEdit'),_0x44acb4['editing']['view']['focus']();}),_0x1421c3;}),this['_initConfig']();}['_initConfig'](){const _0x35857e=_0x407d29(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x35857e),this['listenTo'](this['editor'],'destroy',()=>{_0x35857e['remove']();});}}class et extends _0x4383ac{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[m,g];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{tt as Uploadcare,w as UploadcareCommand,o as UploadcareEditing,et as UploadcareImageEdit,O as UploadcareImageEditCommand,m as UploadcareImageEditEditing,g as UploadcareImageEditUI,e as UploadcareUI,f as UploadcareUploadAdapter};
|
|
23
|
+
import{Plugin as _0x25d9de,Command as _0x276389}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0xbb6e58,IconGooglePhotos as _0x56cb5a,IconGoogleDrive as _0x3b8f3e,IconFacebook as _0x16eda1,IconDropbox as _0x319589,IconUploadcareLink as _0x435bab,IconUploadcareImageUpload as _0x1660eb,IconError as _0x501dc0,IconUploadcareImageEdit as _0x255d7b}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x34f56a,MenuBarMenuListItemButtonView as _0x50d4d0,View as _0x1d48bd,FocusCycler as _0x17d295,Dialog as _0xc77812,DialogViewPosition as _0x72711b,SpinnerView as _0x508f29,IconView as _0x44f9f4,Notification as _0x4e8a93}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x1472a6,DomEmitterMixin as _0x434256,global as _0x1d71c0,getAncestors as _0x14c287,ObservableMixin as _0x195942,uid as _0x4a3436,createElement as _0x11cb61}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x1d7905}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x5ce3a3,info as _0x21b0ba}from'@uploadcare/upload-client';import*as _0x46f203 from'@uploadcare/file-uploader';var i=function(_0x51c00c){return _0x51c00c['Local']='local',_0x51c00c['URL']='url',_0x51c00c['Dropbox']='dropbox',_0x51c00c['GDrive']='gdrive',_0x51c00c['Facebook']='facebook',_0x51c00c['GPhotos']='gphotos',_0x51c00c['OneDrive']='onedrive',_0x51c00c;}({});function _(_0x31be57,_0xaa5599,_0x15e7b8){const t=_0x31be57['t'],_0x159aa3=_0x31be57['t'];switch(_0xaa5599){case i['Local']:return{'text':_0x159aa3('Insert'===_0x15e7b8?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x159aa3('From\x20computer')};case i['URL']:return{'text':'Insert'===_0x15e7b8?_0x159aa3('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x159aa3('Via\x20URL')};case i['Dropbox']:return{'text':t('Insert'===_0x15e7b8?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case i['Facebook']:return{'text':t('Insert'===_0x15e7b8?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case i['GDrive']:return{'text':t('Insert'===_0x15e7b8?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case i['GPhotos']:return{'text':t('Insert'===_0x15e7b8?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case i['OneDrive']:return{'text':t('Insert'===_0x15e7b8?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0xaa5599;}}class e extends _0x25d9de{['licenseKey'];['_licenseKeyCheckInterval'];static get['pluginName'](){return'UploadcareUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){this['licenseKey']=this['editor']['config']['get']('licenseKey');const _0x3e34d5=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x18df67;for(const _0x4c06df in _0x3e34d5){const _0x5c6846=_0x4c06df,_0x53fe45=_0x3e34d5[_0x5c6846];if('uploadcareLicenseKeyValid'==_0x53fe45||'uploadcareLicenseKeyInvalid'==_0x53fe45||'uploadcareLicenseKeyExpired'==_0x53fe45||'uploadcareLicenseKeyDomainLimit'==_0x53fe45||'uploadcareLicenseKeyNotAllowed'==_0x53fe45||'uploadcareLicenseKeyEvaluationLimit'==_0x53fe45||'uploadcareLicenseKeyTrialLimit'==_0x53fe45||'uploadcareLicenseKeyUsageLimit'==_0x53fe45){delete _0x3e34d5[_0x5c6846],_0x18df67=_0x53fe45,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x18df67&&_0x3e34d5['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x18df67&&_0x3e34d5['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x18df67&&_0x3e34d5['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x18df67&&_0x3e34d5['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x18df67&&_0x3e34d5['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyTrialLimit'==_0x18df67&&_0x3e34d5['_showLicenseError']('trialLimit'),'uploadcareLicenseKeyUsageLimit'==_0x18df67&&_0x3e34d5['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x377e15}=this,_0x50cea7=_0x377e15['commands']['get']('uploadcare');if(!_0x50cea7)return;const _0x3f9504=this['_normalizeConfigSourceList'](_0x377e15['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x497f88,_0x85b80d)=>{const _0x333b5d=this['_getIntegrationKey'](_0x85b80d['type']);return _0x497f88[_0x333b5d]||(_0x497f88[_0x333b5d]=[]),_0x497f88[_0x333b5d]['push'](_0x85b80d),_0x497f88;},{});_0x377e15['plugins']['has']('ImageInsertUI')&&_0x377e15['commands']['get']('uploadcare')&&Object['entries'](_0x3f9504)['forEach'](([_0x29b00b,_0xe213d5])=>{_0x377e15['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x29b00b,'observable':()=>_0x50cea7,'buttonViewCreator':()=>this['_createToolbarButton'](_0xe213d5),'formViewCreator':()=>this['_createDropdownButtons'](_0xe213d5),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0xe213d5),'override':'assetManager'!==_0x29b00b});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x13ba0d){const {locale:_0x31b813}=this['editor'];return _0x13ba0d['map'](_0x44a6fb=>{const _0x4154a4=_(_0x31b813,_0x44a6fb,'Insert');switch(_0x44a6fb){case i['Local']:return{'icon':_0x1660eb,'type':i['Local'],..._0x4154a4};case i['URL']:return{'icon':_0x435bab,'type':i['URL'],..._0x4154a4};case i['Dropbox']:return{'icon':_0x319589,'type':i['Dropbox'],..._0x4154a4};case i['Facebook']:return{'icon':_0x16eda1,'type':i['Facebook'],..._0x4154a4};case i['GDrive']:return{'icon':_0x3b8f3e,'type':i['GDrive'],..._0x4154a4};case i['GPhotos']:return{'icon':_0x56cb5a,'type':i['GPhotos'],..._0x4154a4};case i['OneDrive']:return{'icon':_0xbb6e58,'type':i['OneDrive'],..._0x4154a4};}});}['_getIntegrationKey'](_0x4257be){switch(_0x4257be){case i['Local']:return'upload';case i['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x1d13d1,_0x4f085e){const _0x2e6120=this['editor'],_0x367942=new _0x1d13d1(_0x2e6120['locale']),_0x547d67=_0x2e6120['commands']['get']('uploadcare');return _0x367942['bind']('isEnabled')['to'](_0x547d67),_0x367942['on']('execute',()=>{_0x547d67['execute'](_0x4f085e);}),_0x367942;}['_createToolbarButton'](_0x593879){const {locale:_0x3f5027}=this['editor'],_0x339968=this['editor']['plugins']['get']('ImageInsertUI'),_0xd5cee8=_0x593879[0x0],_0xac1665=this['_createButton'](_0x34f56a,_0xd5cee8['type']);return _0xac1665['icon']=_0xd5cee8['icon'],_0xac1665['bind']('label')['to'](_0x339968,'isImageSelected',_0x20ba89=>_(_0x3f5027,_0xd5cee8['type'],_0x20ba89?'Replace':'Insert')['text']),_0xac1665['tooltip']=!0x0,_0xac1665;}['_createDropdownButtons'](_0x1250e7){const {locale:_0x2ba12a}=this['editor'],_0x121fbc=this['editor']['plugins']['get']('ImageInsertUI');return _0x1250e7['map'](_0x45e132=>{const _0x1262c2=this['_createButton'](_0x34f56a,_0x45e132['type']);return _0x1262c2['withText']=!0x0,_0x1262c2['icon']=_0x45e132['icon'],_0x1262c2['bind']('label')['to'](_0x121fbc,'isImageSelected',_0x2f19aa=>_(_0x2ba12a,_0x45e132['type'],_0x2f19aa?'Replace':'Insert')['text']),_0x1262c2;});}['_createMenuBarButtons'](_0x4f1523){return _0x4f1523['map'](_0x316666=>{const _0x179371=this['_createButton'](_0x50d4d0,_0x316666['type']);return _0x179371['icon']=_0x316666['icon'],_0x179371['label']=_0x316666['shortText'],_0x179371;});}}class F extends _0x1d48bd{['focusTracker'];['focusCycler'];constructor(_0x2cf6ed){super(_0x2cf6ed),this['focusTracker']=new _0x1472a6(),this['focusCycler']=new _0x17d295({'focusables':this['createCollection'](),'focusTracker':this['focusTracker']});}['getFocusableElement'](){return{'tag':'div','attributes':{'aria-hidden':'true','tabindex':'0'},'on':{'focus':this['bindTemplate']['to'](()=>{this['focusCycler']['fire']('forwardCycle');})}};}}class x extends F{constructor(_0xb2d50f,_0x214d02){super(_0xb2d50f),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':[{'tag':'uc-file-uploader-inline','attributes':{'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'uploader-'+_0x214d02}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function C(_0x32faee,_0x473193){const _0x4af1d7=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x2212e6=>_0x2212e6<=_0x473193)['map'](_0x4ab941=>_0x32faee['replace'](/\/$/,'')+'/-/resize/'+_0x4ab941+'x/\x20'+_0x4ab941+'w');return{'imageFallbackUrl':_0x32faee,'imageSources':[{'srcset':_0x4af1d7['join'](',\x20'),'sizes':'(max-width:\x20'+_0x473193+'px)\x20100vw,\x20'+_0x473193+'px','type':'image/webp'}]};}function S(_0x3282e7,_0xfca109,_0x3d64ee){const _0x379e0b=_0x3282e7['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x379e0b?parseInt(_0x379e0b[0x1],0xa):_0xfca109,'height':_0x379e0b?parseInt(_0x379e0b[0x2],0xa):_0x3d64ee};}function p(_0x52025a,_0x3de3de){const _0x14e210=new(_0x434256())(),_0x562060=_0x52025a['plugins']['get']('ImageUtils'),_0x3796c7=_0x52025a['editing']['mapper']['toViewElement'](_0x3de3de),_0x2227ab=_0x562060['findViewImgElement'](_0x3796c7),_0x11b878=_0x52025a['editing']['view']['domConverter']['viewToDom'](_0x2227ab),_0x3ad4b8=_0x3de3de['getAttribute']('width'),_0x56205f=_0x3de3de['getAttribute']('height'),_0x3ad0a5='image-processing';_0x52025a['editing']['view']['change'](_0x280b9e=>{_0x280b9e['addClass'](_0x3ad0a5,_0x3796c7),_0x280b9e['setStyle']('aspect-ratio',_0x3ad4b8+'/'+_0x56205f,_0x2227ab);}),_0x14e210['listenTo'](_0x11b878,'load',()=>{_0x14e210['stopListening'](_0x11b878,'load'),_0x52025a['editing']['view']['change'](_0x5ccc86=>{_0x5ccc86['removeClass'](_0x3ad0a5,_0x3796c7),_0x5ccc86['removeStyle']('aspect-ratio',_0x2227ab);});});}function G(_0xc18176){if(Array['isArray'](_0xc18176)){const _0x46db51=_0xc18176['map'](G);return _0xe9ff6e=>_0x46db51['some'](_0x1cd399=>_0x1cd399(_0xe9ff6e));}if('origin'==_0xc18176){const _0x59fca8=_0x1d71c0['window']['location']['origin'];return _0x335cb1=>new URL(_0x335cb1,_0x1d71c0['document']['baseURI'])['origin']==_0x59fca8;}return'function'==typeof _0xc18176?_0xc18176:_0xc18176 instanceof RegExp?_0x920d19=>!(!_0x920d19['match'](_0xc18176)&&!_0x920d19['replace'](/^https?:\/\//,'')['match'](_0xc18176)):()=>!0x1;}function A(_0xd48152,_0x364a8d){return _0x14c287(_0xd48152['target'])['includes'](_0x364a8d);}class n extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x195942(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x50ea5a,_0x42086e,_0x556eef){super(),this['_editor']=_0x50ea5a,this['_editing']=_0x42086e,this['_dialog']=_0x50ea5a['plugins']['get'](_0xc77812),this['_api']=_0x42086e['ctxElement']['getAPI'](),this['_type']=_0x556eef,this['_editing']['configElement']['setAttribute']('source-list',this['_type']),this['_initDialog'](),this['_initListeners'](),this['_api']['initFlow']();}['destroy'](){this['_formView']&&(this['_formView']['destroy'](),this['_formView']=null),this['_api']&&this['_api']['doneFlow'](),this['stopListening'](),this['stopDelegating']();}['_initDialog'](){const {locale:_0x12e96c,model:_0x1f10e2}=this['_editor'],_0x5ce3b1=_0x1f10e2['document']['selection']['getSelectedElement'](),_0x516ef5=_0x5ce3b1&&(_0x5ce3b1['is']('element','imageBlock')||_0x5ce3b1['is']('element','imageInline'));this['_formView']=new x(_0x12e96c,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x1660eb,'title':_(_0x12e96c,this['_type'],_0x516ef5?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x72711b['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x2713e9=>!A(_0x2713e9,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x1dbfbd}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x1c828b=>{const _0x26bfb3=_0x1dbfbd['length'];for(const _0x1d2ad4 of _0x1dbfbd){const _0x3b27ed=_0x1d2ad4===_0x1dbfbd[_0x26bfb3-0x1],{cdnUrl:_0xd36f75,fileInfo:_0x1b97cd}=_0x1d2ad4;if(!_0xd36f75||!_0x1b97cd)continue;const {width:_0x5462e6,height:_0x57bc5e}=_0x1b97cd['imageInfo'],_0x5bb914=S(_0xd36f75,_0x5462e6,_0x57bc5e),_0x37e7c5=C(_0xd36f75,_0x5bb914['width']),_0x489bea={'id':_0x1b97cd['uuid'],'type':'image','attributes':{'imageDimension':_0x5bb914,..._0x37e7c5}};this['_insertAsset'](_0x489bea,_0x3b27ed,_0x1c828b);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x32e618=>{'idle'===_0x32e618['detail']['status']&&!_0x32e618['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===i['Local']?this['_api']['setCurrentActivity'](i['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x7be72b,_0x33afc7,_0x4a1be9){const _0x2eb706=this['_editor']['model']['document']['selection'],_0x3fb01d=_0x2eb706['getSelectedElement'](),_0x2e7fed=!(!_0x3fb01d||!_0x3fb01d['is']('element','imageInline'));_0x4a1be9['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x7be72b,_0x2e7fed),_0x33afc7||_0x4a1be9['setSelection'](_0x2eb706['getLastPosition']());}['_insertImage'](_0x2d5c17,_0x1dbefb){const _0x46f1e3=this['_editor'],{imageDimension:_0x129495,imageFallbackUrl:_0x1a76c3,imageSources:_0x445953}=_0x2d5c17['attributes'];_0x46f1e3['execute']('insertImage',{'imageType':_0x1dbefb?'imageInline':null,'source':{'uploadcareImageId':_0x2d5c17['id'],'src':_0x1a76c3,'sources':_0x445953,..._0x129495}});}}class w extends _0x276389{['_editing'];['_controller']=null;static get['requires'](){return[_0xc77812,o];}constructor(_0x58c162){super(_0x58c162),this['_editing']=_0x58c162['plugins']['get'](o);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x25a5b8){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new n(this['editor'],this['_editing'],_0x25a5b8);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class j{static['upload']({file:_0x1561df,..._0x5e1fd8}){return _0x5ce3a3(_0x1561df,_0x5e1fd8);}static['getInfo'](_0x51a935,_0x182e98){return _0x21b0ba(_0x51a935,_0x182e98);}}class f extends _0x25d9de{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x1d7905,o];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x5329e=this['editor'];if(!!!_0x5329e['config']['get']('uploadcare'))return;_0x5329e['plugins']['get'](_0x1d7905)['createUploadAdapter']=_0x35818a=>new k(_0x35818a,_0x5329e),_0x5329e['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x3cf084,{imageElement:_0x2e12fe,data:_0x348967})=>{_0x5329e['model']['change'](_0x106af5=>{_0x106af5['setAttribute']('uploadcareImageId',_0x348967['uploadcareImageId'],_0x2e12fe);});});}}class k{['loader'];['editor'];['controller'];constructor(_0x4071f9,_0xba3932){this['loader']=_0x4071f9,this['editor']=_0xba3932,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0xa0c5b0=await this['loader']['file'];return j['upload']({'file':_0xa0c5b0,'publicKey':this['editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':this['controller']['signal'],'onProgress':_0x3761b3=>{_0x3761b3&&_0x3761b3['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x3761b3['value']);}})['then'](async _0x482825=>{const {imageFallbackUrl:_0x59b74e,imageSources:_0x23411a}=C(_0x482825['cdnUrl'],_0x482825['imageInfo']['width']);return{'uploadcareImageId':_0x482825['uuid'],'default':_0x59b74e,'sources':_0x23411a};})['catch'](()=>{const _0x72c351=t('Cannot\x20upload\x20file:')+('\x20'+_0xa0c5b0['name']+'.');return Promise['reject'](_0x72c351);});}['abort'](){this['controller']['abort']();}}class o extends _0x25d9de{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',f,_0xc77812];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0x18bbca){super(_0x18bbca),this['ucContextId']=_0x4a3436();}['init'](){const _0x12c958=this['editor'];_0x12c958['commands']['add']('uploadcare',new w(_0x12c958));}['afterInit'](){this['_initSchema'](),this['_initConversion'](),this['_initConfig'](),this['_initCtx'](),this['_initImageProcessingIndicator'](),this['listenTo'](this['editor'],'destroy',()=>{this['_configElement']&&(this['_configElement']['remove'](),this['_configElement']=null),this['_ctxElement']&&(this['_ctxElement']['remove'](),this['_ctxElement']=null);const _0x2cab2c=_0x1d71c0['document']['querySelector']('input[uploadcare-file-input]');_0x2cab2c&&_0x2cab2c['remove']();}),async function(_0x33f45f){const _0x1e3a7c=_0x1cab58([0x52,0x42,0x63,0x58,0x64,0x47,0x66,0x35,0x36,0x37,0x6d,0x4e,0x6a,0x4b,0x39,0x44,0x54,0x70,0x50,0x30,0x49,0x79,0x69,0x33,0x67,0x65,0x61,0x38,0x5a,0x76,0x7a,0x6c,0x45,0x34,0x62,0x46,0x75,0x57,0x72,0x77,0x73,0x48,0x31,0x68,0x6e,0x4f,0x53,0x4c,0x71,0x6b,0x59,0x32,0x4d,0x51,0x4a,0x78,0x6f,0x56,0x41,0x55,0x74,0x43]),_0xb2ffde=0x3d8d0df,_0x285ebf=0x3dfa687^_0xb2ffde,_0xfa8c51=window[_0x1cab58([0x44,0x61,0x74,0x65])][_0x1cab58([0x6e,0x6f,0x77])](),_0x4b3303=_0x33f45f[_0x1cab58([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2a247c=new window[(_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x215d5f=>{_0x4b3303[_0x1cab58([0x6f,0x6e,0x63,0x65])](_0x1cab58([0x72,0x65,0x61,0x64,0x79]),_0x215d5f);}),_0x4d65cf={[_0x1cab58([0x6b,0x74,0x79])]:_0x1cab58([0x45,0x43]),[_0x1cab58([0x75,0x73,0x65])]:_0x1cab58([0x73,0x69,0x67]),[_0x1cab58([0x63,0x72,0x76])]:_0x1cab58([0x50,0x2d,0x32,0x35,0x36]),[_0x1cab58([0x78])]:_0x1cab58([0x69,0x43,0x6a,0x4f,0x43,0x76,0x44,0x46,0x49,0x36,0x6c,0x51,0x48,0x48,0x54,0x31,0x38,0x6a,0x56,0x77,0x52,0x66,0x6b,0x66,0x48,0x51,0x32,0x61,0x5f,0x4d,0x79,0x6d,0x54,0x33,0x35,0x4c,0x51,0x56,0x6f,0x46,0x53,0x41,0x49]),[_0x1cab58([0x79])]:_0x1cab58([0x6b,0x58,0x49,0x79,0x4a,0x34,0x65,0x76,0x74,0x43,0x45,0x46,0x52,0x6d,0x78,0x4b,0x53,0x55,0x70,0x4b,0x39,0x66,0x44,0x57,0x34,0x35,0x39,0x76,0x58,0x4f,0x76,0x56,0x72,0x68,0x66,0x36,0x75,0x51,0x41,0x65,0x4f,0x69,0x6f]),[_0x1cab58([0x61,0x6c,0x67])]:_0x1cab58([0x45,0x53,0x32,0x35,0x36])},_0x2e1a8d=_0x4b3303[_0x1cab58([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x1cab58([0x67,0x65,0x74])](_0x1cab58([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0x2e27c5(){let _0x125de5,_0x5aa756=null,_0x5030f4=null;try{if(_0x2e1a8d==_0x1cab58([0x47,0x50,0x4c]))return _0x1cab58([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x125de5=_0x59ede5(),!_0x125de5)return _0x1cab58([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x125de5[_0x1cab58([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x5030f4=_0x464d76(_0x125de5[_0x1cab58([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x125de5[_0x1cab58([0x6a,0x74,0x69])])),await _0x5a0e97()?_0x44a48f()?_0x3f90ef()?_0x1cab58([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2dab9a()?(_0x125de5[_0x1cab58([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1cab58([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x5aa756=_0xa883d7(_0x1cab58([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),_0x125de5[_0x1cab58([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x1cab58([0x74,0x72,0x69,0x61,0x6c])&&(_0x5aa756=_0xa883d7(_0x1cab58([0x54,0x72,0x69,0x61,0x6c,0x4c,0x69,0x6d,0x69,0x74]))),await _0x19beee()):_0x1cab58([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x1cab58([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x1cab58([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x1cab58([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x3f90ef(){const _0x2541bf=[_0x1cab58([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x1cab58([0x74,0x72,0x69,0x61,0x6c])][_0x1cab58([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x125de5[_0x1cab58([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0xfa8c51/0x3e8:0xe10*_0x285ebf;return _0x125de5[_0x1cab58([0x65,0x78,0x70])]<_0x2541bf;}function _0x44a48f(){const _0x4cfaec=_0x125de5[_0x1cab58([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x4cfaec&&(!!_0x4cfaec[_0x1cab58([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1cab58([0x2a]))||!!_0x4cfaec[_0x1cab58([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1cab58([0x55,0x50,0x4c,0x43])));}function _0x2dab9a(){const _0x56ca06=_0x125de5[_0x1cab58([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x56ca06||0x0==_0x56ca06[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x54c20c}=new URL(window[_0x1cab58([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x56ca06[_0x1cab58([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x54c20c))return!0x0;const _0x448243=_0x54c20c[_0x1cab58([0x73,0x70,0x6c,0x69,0x74])](_0x1cab58([0x2e]));return _0x56ca06[_0x1cab58([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x4fdfd9=>_0x4fdfd9[_0x1cab58([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1cab58([0x2a])))[_0x1cab58([0x6d,0x61,0x70])](_0x261311=>_0x261311[_0x1cab58([0x73,0x70,0x6c,0x69,0x74])](_0x1cab58([0x2e])))[_0x1cab58([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x35a36e=>_0x35a36e[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x448243[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1cab58([0x6d,0x61,0x70])](_0x35b55f=>Array(_0x448243[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x35b55f[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x1cab58([0x66,0x69,0x6c,0x6c])](_0x35b55f[0x0]===_0x1cab58([0x2a])?_0x1cab58([0x2a]):'')[_0x1cab58([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x35b55f))[_0x1cab58([0x73,0x6f,0x6d,0x65])](_0x4c8f18=>_0x448243[_0x1cab58([0x65,0x76,0x65,0x72,0x79])]((_0x5cdb2c,_0x530042)=>_0x4c8f18[_0x530042]===_0x5cdb2c||_0x4c8f18[_0x530042]===_0x1cab58([0x2a])));}function _0x19beee(){return _0x5aa756&&_0x5030f4?new window[(_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x56af85,_0x22b445)=>{_0x5aa756[_0x1cab58([0x74,0x68,0x65,0x6e])](_0x56af85,_0x22b445),_0x5030f4[_0x1cab58([0x74,0x68,0x65,0x6e])](_0x684387=>{_0x684387!=_0x1cab58([0x56,0x61,0x6c,0x69,0x64])&&_0x56af85(_0x684387);},_0x22b445);}):_0x5aa756||_0x5030f4||_0x1cab58([0x56,0x61,0x6c,0x69,0x64]);}}function _0x464d76(_0x3614be,_0x353fd5){return new window[(_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x148c8b=>{if(_0x282444())return _0x148c8b(_0x1cab58([0x56,0x61,0x6c,0x69,0x64]));_0x1c8d3e(),_0x4b3303[_0x1cab58([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x1cab58([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x39715c=!0x1;const _0x4454c1=_0x4a3436();function _0x3149c4(_0x32f0a4){return!!_0x32f0a4&&(typeof _0x32f0a4===_0x1cab58([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x32f0a4===_0x1cab58([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x32f0a4[_0x1cab58([0x74,0x68,0x65,0x6e])]===_0x1cab58([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x32f0a4[_0x1cab58([0x63,0x61,0x74,0x63,0x68])]===_0x1cab58([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x461e0e(_0x5828b1){_0x378722(_0x5828b1)[_0x1cab58([0x74,0x68,0x65,0x6e])](_0x20887e=>{if(!_0x20887e||_0x20887e[_0x1cab58([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x1cab58([0x6f,0x6b]))return _0x1cab58([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x23bd66(_0x4e84a2(_0x4454c1+_0x353fd5))!=_0x20887e[_0x1cab58([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x1cab58([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x1cab58([0x56,0x61,0x6c,0x69,0x64]);})[_0x1cab58([0x74,0x68,0x65,0x6e])](_0x2b3945=>(_0x4c8e64(),_0x2b3945),()=>{const _0x15c83d=_0x1124c1();return null==_0x15c83d?(_0x4c8e64(),_0x1cab58([0x56,0x61,0x6c,0x69,0x64])):_0x1cab58(_0xfa8c51-_0x15c83d>(0x27d454df^_0xb2ffde)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x1cab58([0x74,0x68,0x65,0x6e])](_0x148c8b)[_0x1cab58([0x63,0x61,0x74,0x63,0x68])](()=>{_0x148c8b(_0x1cab58([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x4204c4=0x3ee3e5f^_0xb2ffde;function _0x4c8e64(){const _0x14e884=_0x1cab58([0x6c,0x6c,0x63,0x74,0x2d])+_0x23bd66(_0x4e84a2(_0x3614be)),_0xb2295b=_0x117be5(_0x23bd66(window[_0x1cab58([0x4d,0x61,0x74,0x68])][_0x1cab58([0x63,0x65,0x69,0x6c])](_0xfa8c51/_0x4204c4)));window[_0x1cab58([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1cab58([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x14e884,_0xb2295b);}function _0x1124c1(){const _0x3c0dec=_0x1cab58([0x6c,0x6c,0x63,0x74,0x2d])+_0x23bd66(_0x4e84a2(_0x3614be)),_0x3bf191=window[_0x1cab58([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x1cab58([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x3c0dec);return _0x3bf191?window[_0x1cab58([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x117be5(_0x3bf191),0x10)*_0x4204c4:null;}function _0x378722(_0x28a1ed){return new window[(_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0xffb7e6,_0x6c2bab)=>{_0x28a1ed[_0x1cab58([0x74,0x68,0x65,0x6e])](_0xffb7e6,_0x6c2bab),window[_0x1cab58([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x6c2bab,0x3d9041f^_0xb2ffde);});}}_0x4b3303[_0x1cab58([0x6f,0x6e])](_0x1cab58([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x2a6d77,_0x5ccd8e)=>{if(_0x5ccd8e[0x0]!=_0x3614be)return _0x148c8b(_0x1cab58([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x5ccd8e[0x1]={..._0x5ccd8e[0x1],[_0x1cab58([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x4454c1};},{[_0x1cab58([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1cab58([0x68,0x69,0x67,0x68])}),_0x4b3303[_0x1cab58([0x6f,0x6e])](_0x1cab58([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x54cec1=>{_0x3149c4(_0x54cec1[_0x1cab58([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x39715c=!0x0,_0x461e0e(_0x54cec1[_0x1cab58([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x1cab58([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x1cab58([0x6c,0x6f,0x77])}),_0x2a247c[_0x1cab58([0x74,0x68,0x65,0x6e])](()=>{_0x39715c||_0x148c8b(_0x1cab58([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x282444(){return _0x4b3303[_0x1cab58([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1cab58([0x76,0x69,0x65,0x77])][_0x1cab58([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x1cab58([0x61,0x75,0x74,0x6f]);}function _0x1c8d3e(){_0x4b3303[_0x1cab58([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x1cab58([0x76,0x69,0x65,0x77])][_0x1cab58([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x1cab58([0x61,0x75,0x74,0x6f]);}}function _0xa883d7(_0x283791){const _0x42c977=[new window[(_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3bdea9=>setTimeout(_0x3bdea9,0x3d1ee13^_0xb2ffde)),_0x2a247c[_0x1cab58([0x74,0x68,0x65,0x6e])](()=>new window[(_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x57e508=>{let _0xdd7932=0x0;_0x4b3303[_0x1cab58([0x6d,0x6f,0x64,0x65,0x6c])][_0x1cab58([0x6f,0x6e])](_0x1cab58([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x5b6422,_0x3f5b5a)=>{_0x3f5b5a[0x0][_0x1cab58([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0xdd7932++,_0xdd7932==(0x3d8d127^_0xb2ffde)&&(_0x57e508(),_0x5b6422[_0x1cab58([0x6f,0x66,0x66])]());});}))];return window[_0x1cab58([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x1cab58([0x72,0x61,0x63,0x65])](_0x42c977)[_0x1cab58([0x74,0x68,0x65,0x6e])](()=>_0x283791);}async function _0x16cfc9(){await _0x2a247c,_0x4b3303[_0x1cab58([0x6d,0x6f,0x64,0x65,0x6c])][_0x1cab58([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x12b653,_0x4b3303[_0x1cab58([0x6d,0x6f,0x64,0x65,0x6c])][_0x1cab58([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x12b653,_0x4b3303[_0x1cab58([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x1cab58([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x3da848(_0x40c780){const _0x25eff5=_0x386e66();_0x4b3303[_0x25eff5]=_0x1cab58([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x40c780,_0x40c780!=_0x1cab58([0x56,0x61,0x6c,0x69,0x64])&&_0x16cfc9();}function _0x386e66(){const _0x31a5ae=window[_0x1cab58([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x1cab58([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x1cab58([0x6e,0x6f,0x77])]())[_0x1cab58([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x1cab58([0x2e]),'');let _0x29e928=_0x1cab58([0x52]);for(let _0x207a6d=0x0;_0x207a6d<_0x31a5ae[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x207a6d+=0x2){let _0x52cfb6=window[_0x1cab58([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x31a5ae[_0x1cab58([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x207a6d,_0x207a6d+0x2));_0x52cfb6>=_0x1e3a7c[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x52cfb6-=_0x1e3a7c[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x29e928+=_0x1e3a7c[_0x52cfb6];}return _0x29e928;}function _0x59ede5(){const _0x19ec1c=_0x2e1a8d[_0x1cab58([0x73,0x70,0x6c,0x69,0x74])](_0x1cab58([0x2e]));if(0x3!=_0x19ec1c[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xb324d2(_0x19ec1c[0x1]);function _0xb324d2(_0x155373){const _0x3b9ea1=_0x271b4d(_0x155373);return _0x3b9ea1&&_0x4e6ca6()?_0x3b9ea1:null;function _0x4e6ca6(){const _0x24ae97=_0x3b9ea1[_0x1cab58([0x6a,0x74,0x69])],_0x326a08=window[_0x1cab58([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x24ae97[_0x1cab58([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x24ae97[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x273070={..._0x3b9ea1,[_0x1cab58([0x6a,0x74,0x69])]:_0x24ae97[_0x1cab58([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x24ae97[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x273070[_0x1cab58([0x76,0x63])],_0x4e84a2(_0x273070)==_0x326a08;}}}async function _0x5a0e97(){let _0x4673f1=!0x0;try{const _0x3db43b=_0x2e1a8d[_0x1cab58([0x73,0x70,0x6c,0x69,0x74])](_0x1cab58([0x2e])),[_0x4f00b3,_0x175f31,_0x36de39]=_0x3db43b;return _0x465e2f(_0x4f00b3),await _0x4f8e82(_0x4f00b3,_0x175f31,_0x36de39),_0x4673f1;}catch{return!0x1;}function _0x465e2f(_0x2c3e50){const _0x40447b=_0x271b4d(_0x2c3e50);_0x40447b&&_0x40447b[_0x1cab58([0x61,0x6c,0x67])]==_0x1cab58([0x45,0x53,0x32,0x35,0x36])||(_0x4673f1=!0x1);}async function _0x4f8e82(_0x353128,_0x52825c,_0x1ab8ca){const _0x2ebf25=window[_0x1cab58([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x1cab58([0x66,0x72,0x6f,0x6d])](_0x169638(_0x1ab8ca),_0x3b3755=>_0x3b3755[_0x1cab58([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x56cbb4=new window[(_0x1cab58([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x1cab58([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x353128+_0x1cab58([0x2e])+_0x52825c),_0x1d282c=window[_0x1cab58([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x1cab58([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x1d282c)return;const _0x1ccc6d=await _0x1d282c[_0x1cab58([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x1cab58([0x6a,0x77,0x6b]),_0x4d65cf,{[_0x1cab58([0x6e,0x61,0x6d,0x65])]:_0x1cab58([0x45,0x43,0x44,0x53,0x41]),[_0x1cab58([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x1cab58([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x1cab58([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x1d282c[_0x1cab58([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x1cab58([0x6e,0x61,0x6d,0x65])]:_0x1cab58([0x45,0x43,0x44,0x53,0x41]),[_0x1cab58([0x68,0x61,0x73,0x68])]:{[_0x1cab58([0x6e,0x61,0x6d,0x65])]:_0x1cab58([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x1ccc6d,_0x2ebf25,_0x56cbb4)||(_0x4673f1=!0x1);}}function _0x271b4d(_0x47495a){return _0x47495a[_0x1cab58([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x1cab58([0x65,0x79]))?JSON[_0x1cab58([0x70,0x61,0x72,0x73,0x65])](_0x169638(_0x47495a)):null;}function _0x169638(_0x5a6d3c){return window[_0x1cab58([0x61,0x74,0x6f,0x62])](_0x5a6d3c[_0x1cab58([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x1cab58([0x2b]))[_0x1cab58([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x1cab58([0x2f])));}function _0x4e84a2(_0x1a034f){let _0x3bcae3=0x1505;function _0x55025b(_0x50b1be){for(let _0x3dc0da=0x0;_0x3dc0da<_0x50b1be[_0x1cab58([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x3dc0da++){const _0x1f767f=_0x50b1be[_0x1cab58([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x3dc0da);_0x3bcae3=(_0x3bcae3<<0x5)+_0x3bcae3+_0x1f767f,_0x3bcae3&=_0x3bcae3;}}function _0x267827(_0x2092ac){Array[_0x1cab58([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x2092ac)?_0x2092ac[_0x1cab58([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x267827):_0x2092ac&&typeof _0x2092ac==_0x1cab58([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x1cab58([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x2092ac)[_0x1cab58([0x73,0x6f,0x72,0x74])]()[_0x1cab58([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x2dc403,_0x1596ed])=>{_0x55025b(_0x2dc403),_0x267827(_0x1596ed);}):_0x55025b(window[_0x1cab58([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x2092ac));}return _0x267827(_0x1a034f),_0x3bcae3>>>0x0;}function _0x23bd66(_0x4a5297){return _0x4a5297[_0x1cab58([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x1cab58([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x1cab58([0x30]));}function _0x117be5(_0x4944b1){return _0x4944b1[_0x1cab58([0x73,0x70,0x6c,0x69,0x74])]('')[_0x1cab58([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x1cab58([0x6a,0x6f,0x69,0x6e])]('');}function _0x12b653(){}function _0x1cab58(_0x59dd51){return _0x59dd51['map'](_0x152733=>String['fromCharCode'](_0x152733))['join']('');}_0x3da848(await _0x2e27c5());}(this);}['_initSchema'](){const _0x23e334=this['editor']['model']['schema'];_0x23e334['isRegistered']('imageBlock')&&_0x23e334['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x23e334['isRegistered']('imageInline')&&_0x23e334['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x3fe56a=this['editor'];_0x3fe56a['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x3fe56a['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x159b77=>_0x159b77['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x21cba4=_0x3fe56a['commands']['get']('replaceImageSource');_0x21cba4&&this['listenTo'](_0x21cba4,'cleanupImage',(_0x36f6ee,[_0x2a9b01,_0x5761c2])=>{_0x2a9b01['removeAttribute']('uploadcareImageId',_0x5761c2);});}['_initConfig'](){const _0x10fd5c=this['editor']['config']['get']('uploadcare.uploader')||{},_0x4621c1=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x11cb61(_0x1d71c0['document'],'uc-config',{..._0x10fd5c,'pubkey':_0x4621c1,'ctx-name':'uploader-'+this['ucContextId'],'sourceList':'','imgOnly':'true','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage'],'externalSourcesEmbedCss':'\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup\x20{\x20padding:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-menu\x20{\x20gap:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__popup-footer\x20{\x20padding-top:\x200;\x20}\x0a\x09\x09\x09\x09.uc-dropdown-menu__separator\x20{\x20margin:\x200;\x20}\x0a\x09\x09\x09'}),this['_configElement']['iconHrefResolver']=_0x3577c1=>{if('closeMax'==_0x3577c1)return'#uc-icon-arrow-down';},_0x1d71c0['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x11cb61(_0x1d71c0['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x1d71c0['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x34aab7=this['editor']['commands']['get']('insertImage');_0x34aab7&&this['listenTo'](_0x34aab7,'execute',()=>{const _0x42ad54=this['editor']['model']['document']['selection']['getSelectedElement']();_0x42ad54&&_0x42ad54['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x42ad54);});});const _0x2c6c57=this['editor']['commands']['get']('uploadcareImageReplace');_0x2c6c57&&this['listenTo'](_0x2c6c57,'execute',()=>{const _0x4ca7f6=this['editor']['model']['document']['selection']['getSelectedElement']();_0x4ca7f6&&_0x4ca7f6['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{p(this['editor'],_0x4ca7f6);});});}}class tt extends _0x25d9de{static get['requires'](){return[o,e];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x3e2630){super(_0x3e2630),_0x3e2630['config']['define']('uploadcare.uploader.sourceList',[i['Local'],i['URL']]),_0x46f203['defineComponents'](_0x46f203);}}class ii extends _0x1d48bd{constructor(_0x3c593e){super(_0x3c593e);const t=_0x3c593e['t'],_0x8be0de=this['bindTemplate'],_0x5c59eb=new _0x508f29();_0x5c59eb['isVisible']=!0x0,this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__loading'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__loading-spinner']},'children':[_0x5c59eb,{'text':_0x8be0de['to']('imageUploadProgress',_0x486944=>t('Loading\x20image...')+'\x20('+(_0x486944||0x0)+'%)')}]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class ti extends _0x1d48bd{constructor(_0x5aeb0c){super(_0x5aeb0c);const t=_0x5aeb0c['t'];this['set']('errorType',null);const _0x33c60c=new _0x34f56a(_0x5aeb0c);_0x33c60c['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x33c60c['withText']=!0x0,_0x33c60c['class']='ck-button-action',_0x33c60c['on']('execute',()=>{this['fire']('retry');}),_0x33c60c['bind']('isVisible')['to'](this,'errorType',_0x1d0ecc=>'NotFound'!==_0x1d0ecc);const _0x339d0c=new _0x44f9f4();_0x339d0c['content']=_0x501dc0,_0x339d0c['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x50654c=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__error'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__error-contents']},'children':[_0x339d0c,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x50654c['to']('errorType',_0x2452f8=>t('NotFound'!==_0x2452f8?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x33c60c]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}class ei extends _0x1d48bd{constructor(_0x17a907,_0x2781b0){super(_0x17a907);const _0x824e75=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x2781b0,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x824e75['to']('imageSrc')}});}}class X extends F{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x3b4a4a,_0x13d39c,_0x369792){super(_0x3b4a4a),this['_items']=this['createCollection'](),this['_loadingView']=new ii(_0x3b4a4a),this['_errorView']=new ti(_0x3b4a4a),this['_editingView']=new ei(_0x3b4a4a,_0x369792),this['_focusableView']=new _0x1d48bd(_0x3b4a4a),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x13d39c),this['setTemplate']({'tag':'div','attributes':{'class':['ck','ck-reset_all-excluded','ck-uploadcare-form'],'tabindex':'-1'},'children':this['_items']}),this['_setView'](),this['once']('render',()=>{this['_waitForImageEditorComponent'](this['element'],_0x85a49c=>{this['_addUploadcareImageEditorListeners'](_0x85a49c);});}),this['on']('change:status',()=>{this['_setView']();}),this['_addErrorViewListeners']();}['focus'](){this['element']['focus']();}['_setView'](){switch(this['_items']['clear'](),this['status']){case'uploading':this['_items']['add'](this['_loadingView']);break;case'error':this['_items']['add'](this['_errorView']);break;case'ready':this['_items']['addMany']([this['_editingView'],this['_focusableView']]);}}['_waitForImageEditorComponent'](_0x97dc6f,_0x55f065){const _0x569b7c='uc-cloud-image-editor',_0x5423bd=_0x97dc6f['querySelector'](_0x569b7c);if(_0x5423bd)return _0x55f065(_0x5423bd);const _0x28560a=new MutationObserver(_0x70f942=>{const _0x58bf5d=_0x70f942['filter'](_0x598b0c=>_0x598b0c['target']===_0x97dc6f&&_0x598b0c['addedNodes']['length']>0x0&&_0x598b0c['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x569b7c);_0x58bf5d['length']&&(_0x28560a['disconnect'](),_0x55f065(_0x58bf5d[0x0]['addedNodes'][0x0]));});_0x28560a['observe'](_0x97dc6f,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x536522){_0x536522['addEventListener']('apply',_0x567267=>{this['fire']('apply',{'imageSrc':_0x567267['detail']['cdnUrl']});}),_0x536522['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class E extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x195942(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0xea274e,_0x47b8d0,_0x20ecac){super(),this['_editor']=_0xea274e,this['_dialog']=_0x47b8d0,this['_imageElement']=_0x20ecac,this['_imageCache']=this['_editor']['plugins']['get']('UploadcareImageEditUI')['imageCache'],this['_attributes']=this['_editor']['config']['get']('uploadcare.editor')||{},this['set']({'isActive':!0x0,'imageStatus':'ready','imageErrorType':null,'imageId':null,'imageSrc':null,'imageDimension':null,'imageUploadProgress':null}),this['_prepareImage'](),this['_showDialog']();}['destroy'](){this['isActive']=!0x1,this['stopListening'](),this['stopDelegating'](),'uploading'===this['imageStatus']&&this['_controller']&&this['_controller']['abort']();}async['_prepareImage'](){const _0x3cdd10=this['_imageElement'],_0x41b19d=_0x3cdd10['getAttribute']('uploadcareImageId'),_0x1825a8=_0x3cdd10['getAttribute']('src');if(_0x41b19d)await this['_loadImageInfo'](_0x41b19d,_0x1825a8);else{if(this['_imageCache']['has'](_0x1825a8)){const _0x3accbd=this['_imageCache']['get'](_0x1825a8);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3accbd['url'],this['imageDimension']=_0x3accbd['dimension'],this['imageId']=_0x3accbd['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x298879}=this['_editor'],t=_0x298879['t'],_0x2ee770=new X(_0x298879,this['imageStatus'],this['_attributes']);_0x2ee770['bind']('status')['to'](this,'imageStatus'),_0x2ee770['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x2ee770['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x2ee770['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x2ee770,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x255d7b,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x2ee770,'position':_0x72711b['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x2ee770['focus']();},'onHide':()=>{_0x2ee770['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x292122=>!A(_0x292122,_0x2ee770['element'])}});}['_loadImageInfo'](_0x49cd1f,_0x114d79){return j['getInfo'](_0x49cd1f,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x292db7=>{const {width:_0x459947,height:_0x5c5617}=_0x292db7['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x114d79,this['imageDimension']={'width':_0x459947,'height':_0x5c5617},this['imageId']=_0x49cd1f;})['catch'](_0x306f66=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x306f66['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x3d7dd3,_0x42abfa){return this['_getImageAsFile'](_0x3d7dd3)['then'](_0x12fecd=>j['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0x42abfa['signal'],'file':_0x12fecd,'onProgress':_0x533ce8=>{_0x533ce8&&_0x533ce8['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x533ce8['value']));}}))['then'](_0x2a43db=>{const {width:_0x37b324,height:_0x4bf134}=_0x2a43db['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x2a43db['cdnUrl'],this['imageDimension']={'width':_0x37b324,'height':_0x4bf134},this['imageId']=_0x2a43db['uuid'],this['imageUploadProgress']=null;const _0x16c271=_0x3d7dd3['getAttribute']('src');this['_imageCache']['set'](_0x16c271,{'id':_0x2a43db['uuid'],'url':_0x2a43db['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x43ed63=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x43ed63['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x27a0d6,_0xe9a8b4){_0x27a0d6['on']('apply',(_0x4870c7,_0x2fb9b4)=>{this['_replaceImage'](_0xe9a8b4,_0x2fb9b4['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x27a0d6['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x27a0d6['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x2c60f7,_0x34e641,_0x2974f4){const _0x3ca1f0=this['_editor'],{width:_0x13b07f,height:_0x18e778}=S(_0x34e641,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0xc39da,imageSources:_0x1d5f5c}=C(_0x34e641,_0x13b07f);_0x3ca1f0['model']['change'](_0x4f3745=>{if('$graveyard'===_0x2c60f7['root']['rootName']){_0x3ca1f0['execute']('insertImage',{'imageType':_0x2c60f7['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x2c60f7['getAttributes']()),'uploadcareImageId':_0x2974f4,'src':_0xc39da,'sources':_0x1d5f5c,'width':_0x13b07f,'height':_0x18e778}});const _0x5b74c5=_0x2c60f7['getChildren']();_0x2c60f7=_0x3ca1f0['model']['document']['selection']['getSelectedElement']();for(const _0xbe6748 of _0x5b74c5)_0x4f3745['append'](_0x4f3745['cloneElement'](_0xbe6748),_0x2c60f7);}else _0x4f3745['setSelection'](_0x2c60f7,'on'),_0x3ca1f0['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x2c60f7['getAttributes']()),'uploadcareImageId':_0x2974f4,'src':_0xc39da,'sources':_0x1d5f5c,'width':_0x13b07f,'height':_0x18e778},_0x2c60f7);_0x4f3745['setSelection'](_0x2c60f7,'on');});}async['_getImageAsFile'](_0x4c76d9){const _0x1845ec=_0x1d71c0['window'],_0xb4e5af=_0x1d71c0['document']['location']['href'],_0x2dde9f=new _0x1845ec['URL'](_0x4c76d9['getAttribute']('src'),_0xb4e5af);if('data:'===_0x2dde9f['protocol']){const _0x3c5e51=_0x2dde9f['href']['split'](','),_0x158ed2=_0x3c5e51[0x0]['match'](/:(.*?);/)[0x1],_0x445ae1=_0x158ed2['split']('/')[0x1],_0x5f0d88=_0x1845ec['atob'](_0x3c5e51[_0x3c5e51['length']-0x1]);let _0x2b936c=_0x5f0d88['length'];const _0x39857a=new _0x1845ec['Uint8Array'](_0x2b936c);for(;_0x2b936c--;)_0x39857a[_0x2b936c]=_0x5f0d88['charCodeAt'](_0x2b936c);return new _0x1845ec['File']([_0x39857a],'image.'+_0x445ae1,{'type':_0x158ed2});}const _0x590549=_0x2dde9f['href']['split']('/'),_0x309a08=_0x590549[_0x590549['length']-0x1],_0x43085c=_0x309a08['split']('.')[0x1];return _0x1845ec['fetch'](_0x2dde9f['href'])['then'](_0xf27ab=>_0xf27ab['clone']()['blob']())['then'](_0x170d7e=>new _0x1845ec['File']([_0x170d7e],_0x309a08,{'type':'image/'+_0x43085c}));}}class O extends _0x276389{['imageEditController'];static get['requires'](){return[_0xc77812];}['_isEditable'];constructor(_0x47c0de){super(_0x47c0de),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x23eb9b){const _0x1a8291=G(_0x23eb9b);return _0x276f7e=>!(!_0x276f7e||!_0x276f7e['is']('element','imageBlock')&&!_0x276f7e['is']('element','imageInline'))&&(!!_0x276f7e['hasAttribute']('uploadcareImageId')||!!_0x276f7e['hasAttribute']('src')&&_0x1a8291(_0x276f7e['getAttribute']('src')));}(_0x47c0de['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x1cec80=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x1cec80);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x10ac62=this['editor']['model']['document']['selection']['getSelectedElement']();_0x10ac62&&(_0x10ac62['is']('element','imageBlock')||_0x10ac62['is']('element','imageInline'))&&(this['imageEditController']=new E(this['editor'],this['editor']['plugins']['get'](_0xc77812),_0x10ac62),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class R extends _0x276389{['refresh'](){const _0x321812=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x321812&&(_0x321812['is']('element','imageBlock')||_0x321812['is']('element','imageInline')));}['execute'](_0x379079){const _0x31c4f0=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x335ab4=>{_0x335ab4['setAttributes'](_0x379079,_0x31c4f0),_0x335ab4['removeAttribute']('srcset',_0x31c4f0),_0x335ab4['removeAttribute']('sizes',_0x31c4f0);});}}class m extends _0x25d9de{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[o,_0x4e8a93,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x2104fe}=this;_0x2104fe['commands']['add']('uploadcareImageEdit',new O(_0x2104fe)),_0x2104fe['commands']['add']('uploadcareImageReplace',new R(_0x2104fe));}}class g extends _0x25d9de{['_imageCache']=new Map();static get['pluginName'](){return'UploadcareImageEditUI';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}get['imageCache'](){return this['_imageCache'];}['init'](){const _0x553b77=this['editor'];_0x553b77['ui']['componentFactory']['add']('uploadcareImageEdit',_0x12003a=>{const _0x381992=_0x553b77['commands']['get']('uploadcareImageEdit'),_0x37f207=new _0x34f56a(_0x12003a),t=_0x12003a['t'];return _0x37f207['set']({'icon':_0x255d7b,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x37f207['bind']('isEnabled')['to'](_0x381992),_0x37f207['bind']('isOn')['to'](_0x381992,'isActive'),this['listenTo'](_0x37f207,'execute',()=>{_0x553b77['execute']('uploadcareImageEdit'),_0x553b77['editing']['view']['focus']();}),_0x37f207;}),this['_initConfig']();}['_initConfig'](){const _0x27365b=_0x11cb61(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x27365b),this['listenTo'](this['editor'],'destroy',()=>{_0x27365b['remove']();});}}class et extends _0x25d9de{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[m,g];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{tt as Uploadcare,w as UploadcareCommand,o as UploadcareEditing,et as UploadcareImageEdit,O as UploadcareImageEditCommand,m as UploadcareImageEditEditing,g as UploadcareImageEditUI,e as UploadcareUI,f as UploadcareUploadAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-uploadcare",
|
|
3
|
-
"version": "47.1.0
|
|
3
|
+
"version": "47.1.0",
|
|
4
4
|
"description": "Uploadcare feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -23,14 +23,14 @@
|
|
|
23
23
|
"framework"
|
|
24
24
|
],
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ckeditor/ckeditor5-core": "47.1.0
|
|
27
|
-
"@ckeditor/ckeditor5-icons": "47.1.0
|
|
28
|
-
"@ckeditor/ckeditor5-image": "47.1.0
|
|
29
|
-
"@ckeditor/ckeditor5-theme-lark": "47.1.0
|
|
30
|
-
"@ckeditor/ckeditor5-ui": "47.1.0
|
|
31
|
-
"@ckeditor/ckeditor5-upload": "47.1.0
|
|
32
|
-
"@ckeditor/ckeditor5-utils": "47.1.0
|
|
33
|
-
"ckeditor5": "47.1.0
|
|
26
|
+
"@ckeditor/ckeditor5-core": "47.1.0",
|
|
27
|
+
"@ckeditor/ckeditor5-icons": "47.1.0",
|
|
28
|
+
"@ckeditor/ckeditor5-image": "47.1.0",
|
|
29
|
+
"@ckeditor/ckeditor5-theme-lark": "47.1.0",
|
|
30
|
+
"@ckeditor/ckeditor5-ui": "47.1.0",
|
|
31
|
+
"@ckeditor/ckeditor5-upload": "47.1.0",
|
|
32
|
+
"@ckeditor/ckeditor5-utils": "47.1.0",
|
|
33
|
+
"ckeditor5": "47.1.0",
|
|
34
34
|
"@uploadcare/file-uploader": "1.19.4",
|
|
35
35
|
"@uploadcare/upload-client": "6.14.3"
|
|
36
36
|
},
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
function _0x5873(){const _0x12c8e8=['4unlVug','369XAEsPq','execute','source-list','image','isOpen','952878ZxeWje','removeSelectionAttribute','focus','editing','imageInline','_type','imageInfo','7RJaxQH','initFlow','setAttribute','get','stopListening','setCurrentActivity','stopDelegating','_dialog','insertImage','allEntries','change','view','382112VtbqeB','getOutputCollectionState','Local','uploadCare','EDITOR_TOP_CENTER','model','selection','configElement','imageBlock','getSelectedElement','_insertAsset','_editor','828BEvjou','_formView','destroy','document','303222EcnkaB','length','element','_editing','idle','removeAllFiles','width','uuid','setSelection','text','ucContextId','89750hHeTfy','plugins','_api','attributes','160270POBNhI','getLastPosition','linkHref','Insert','status','addEventListener','212168CkKkZQ','getAPI','_initListeners','doneFlow','_initDialog','show','_insertImage','detail','hide','ctxElement','Replace','done-click'];_0x5873=function(){return _0x12c8e8;};return _0x5873();}const _0xfdffcc=_0x1af1;(function(_0x18bf2f,_0x163bf6){const _0x268686=_0x1af1,_0x5b4246=_0x18bf2f();while(!![]){try{const _0x3f129b=parseInt(_0x268686(0xf7))/0x1+-parseInt(_0x268686(0x103))/0x2*(-parseInt(_0x268686(0xe2))/0x3)+parseInt(_0x268686(0xde))/0x4+-parseInt(_0x268686(0xf1))/0x5+parseInt(_0x268686(0x109))/0x6+parseInt(_0x268686(0x110))/0x7*(-parseInt(_0x268686(0x11c))/0x8)+parseInt(_0x268686(0x104))/0x9*(-parseInt(_0x268686(0xed))/0xa);if(_0x3f129b===_0x163bf6)break;else _0x5b4246['push'](_0x5b4246['shift']());}catch(_0x267220){_0x5b4246['push'](_0x5b4246['shift']());}}}(_0x5873,0x1ea67));import{IconUploadcareImageUpload as _0x4da5ed}from'ckeditor5/src/icons.js';import{ObservableMixin as _0x1e34e1}from'ckeditor5/src/utils.js';import{Dialog as _0x307bb2,DialogViewPosition as _0x2d29d4}from'ckeditor5/src/ui.js';import{UploadcareFormView as _0x4342a9}from'./uploadcareformview.js';import{UploadcareSource as _0xfa9c5a}from'../uploadcareconfig.js';import{getTranslation as _0x3a73b0}from'../utils/common-translations.js';import{getImageUrls as _0x49d4bb,getImageDimension as _0x120b62}from'../utils/editingutils.js';import{isAncestor as _0x3721b}from'../utils/isancestor.js';function _0x1af1(_0x3e4915,_0x13ee1d){const _0x58731b=_0x5873();return _0x1af1=function(_0x1af1e5,_0x20c919){_0x1af1e5=_0x1af1e5-0xda;let _0x45546c=_0x58731b[_0x1af1e5];return _0x45546c;},_0x1af1(_0x3e4915,_0x13ee1d);}export class UploadcareController extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x1e34e1(){[_0xfdffcc(0xdd)];[_0xfdffcc(0x117)];[_0xfdffcc(0xe5)];[_0xfdffcc(0xef)];[_0xfdffcc(0x10e)]=null;[_0xfdffcc(0xdf)]=null;constructor(_0x2bba2e,_0xcc8489,_0x7c1d32){const _0x23d2cb=_0xfdffcc;super(),this[_0x23d2cb(0xdd)]=_0x2bba2e,this[_0x23d2cb(0xe5)]=_0xcc8489,this[_0x23d2cb(0x117)]=_0x2bba2e[_0x23d2cb(0xee)][_0x23d2cb(0x113)](_0x307bb2),this[_0x23d2cb(0xef)]=_0xcc8489[_0x23d2cb(0x100)][_0x23d2cb(0xf8)](),this[_0x23d2cb(0x10e)]=_0x7c1d32,this[_0x23d2cb(0xe5)][_0x23d2cb(0x123)][_0x23d2cb(0x112)](_0x23d2cb(0x106),this[_0x23d2cb(0x10e)]),this[_0x23d2cb(0xfb)](),this[_0x23d2cb(0xf9)](),this[_0x23d2cb(0xef)][_0x23d2cb(0x111)]();}[_0xfdffcc(0xe0)](){const _0x5dc316=_0xfdffcc;this[_0x5dc316(0xdf)]&&(this[_0x5dc316(0xdf)][_0x5dc316(0xe0)](),this[_0x5dc316(0xdf)]=null),this[_0x5dc316(0xef)]&&this[_0x5dc316(0xef)][_0x5dc316(0xfa)](),this[_0x5dc316(0x114)](),this[_0x5dc316(0x116)]();}[_0xfdffcc(0xfb)](){const _0x22066d=_0xfdffcc,{locale:_0x1b7182,model:_0x46b886}=this[_0x22066d(0xdd)],_0x340d20=_0x46b886[_0x22066d(0xe1)][_0x22066d(0x122)][_0x22066d(0xdb)](),_0x3db7fe=_0x340d20&&(_0x340d20['is'](_0x22066d(0xe4),_0x22066d(0xda))||_0x340d20['is'](_0x22066d(0xe4),_0x22066d(0x10d)));this[_0x22066d(0xdf)]=new _0x4342a9(_0x1b7182,this[_0x22066d(0xe5)][_0x22066d(0xec)]),this[_0x22066d(0x117)][_0x22066d(0xfc)]({'id':_0x22066d(0x11f),'icon':_0x4da5ed,'title':_0x3a73b0(_0x1b7182,this[_0x22066d(0x10e)],_0x3db7fe?_0x22066d(0x101):_0x22066d(0xf4))[_0x22066d(0xeb)],'content':this[_0x22066d(0xdf)],'position':_0x2d29d4[_0x22066d(0x120)],'isModal':!0x0,'onShow':()=>{const _0x29fc28=_0x22066d;this[_0x29fc28(0xdf)][_0x29fc28(0x10b)]();},'onHide':()=>{const _0x2c28ba=_0x22066d;this[_0x2c28ba(0xef)][_0x2c28ba(0xe7)](),this[_0x2c28ba(0xdd)][_0x2c28ba(0x10c)][_0x2c28ba(0x11b)][_0x2c28ba(0x10b)](),this[_0x2c28ba(0xe0)]();},'keystrokeHandlerOptions':{'filter':_0x3ab1db=>!_0x3721b(_0x3ab1db,this[_0x22066d(0xdf)][_0x22066d(0xe4)])}});}[_0xfdffcc(0xf9)](){const _0x30040c=_0xfdffcc;this[_0x30040c(0xe5)][_0x30040c(0x100)][_0x30040c(0xf6)](_0x30040c(0x102),()=>{const _0xbf831b=_0x30040c,{allEntries:_0x7b085}=this[_0xbf831b(0xef)][_0xbf831b(0x11d)]();this[_0xbf831b(0xdd)][_0xbf831b(0x121)][_0xbf831b(0x11a)](_0x2ae864=>{const _0x4cfcb7=_0xbf831b,_0x4ff75a=_0x7b085[_0x4cfcb7(0xe3)];for(const _0x3d841b of _0x7b085){const _0x52a514=_0x3d841b===_0x7b085[_0x4ff75a-0x1],{cdnUrl:_0xa17e72,fileInfo:_0x505e71}=_0x3d841b;if(!_0xa17e72||!_0x505e71)continue;const {width:_0x354f2e,height:_0x517bfc}=_0x505e71[_0x4cfcb7(0x10f)],_0x482c9e=_0x120b62(_0xa17e72,_0x354f2e,_0x517bfc),_0xd17a0d=_0x49d4bb(_0xa17e72,_0x482c9e[_0x4cfcb7(0xe8)]),_0x214f84={'id':_0x505e71[_0x4cfcb7(0xe9)],'type':_0x4cfcb7(0x107),'attributes':{'imageDimension':_0x482c9e,..._0xd17a0d}};this[_0x4cfcb7(0xdc)](_0x214f84,_0x52a514,_0x2ae864);}}),this[_0xbf831b(0x117)][_0xbf831b(0xff)]();}),this[_0x30040c(0xe5)][_0x30040c(0x100)][_0x30040c(0xf6)](_0x30040c(0x11a),_0x579730=>{const _0x44c36a=_0x30040c;_0x44c36a(0xe6)===_0x579730[_0x44c36a(0xfe)][_0x44c36a(0xf5)]&&!_0x579730[_0x44c36a(0xfe)][_0x44c36a(0x119)][_0x44c36a(0xe3)]&&this[_0x44c36a(0x117)][_0x44c36a(0x108)]&&(this[_0x44c36a(0x10e)]===_0xfa9c5a[_0x44c36a(0x11e)]?this[_0x44c36a(0xef)][_0x44c36a(0x115)](_0xfa9c5a[_0x44c36a(0x11e)]):this[_0x44c36a(0xef)][_0x44c36a(0x111)]());});}[_0xfdffcc(0xdc)](_0x534289,_0xdeaf3,_0x1e2d6e){const _0x3d167c=_0xfdffcc,_0x1e9747=this[_0x3d167c(0xdd)][_0x3d167c(0x121)][_0x3d167c(0xe1)][_0x3d167c(0x122)],_0x50f5ea=_0x1e9747[_0x3d167c(0xdb)](),_0x481925=!(!_0x50f5ea||!_0x50f5ea['is'](_0x3d167c(0xe4),_0x3d167c(0x10d)));_0x1e2d6e[_0x3d167c(0x10a)](_0x3d167c(0xf3)),this[_0x3d167c(0xfd)](_0x534289,_0x481925),_0xdeaf3||_0x1e2d6e[_0x3d167c(0xea)](_0x1e9747[_0x3d167c(0xf2)]());}[_0xfdffcc(0xfd)](_0x20af76,_0x4be1d4){const _0x59cc44=_0xfdffcc,_0x39d9e7=this[_0x59cc44(0xdd)],{imageDimension:_0x194a04,imageFallbackUrl:_0x4a6822,imageSources:_0x209827}=_0x20af76[_0x59cc44(0xf0)];_0x39d9e7[_0x59cc44(0x105)](_0x59cc44(0x118),{'imageType':_0x4be1d4?_0x59cc44(0x10d):null,'source':{'uploadcareImageId':_0x20af76['id'],'src':_0x4a6822,'sources':_0x209827,..._0x194a04}});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
var
|
|
23
|
+
var _0x5e3c7c=_0x3ce9;(function(_0x505175,_0x4019c7){var _0x28dec3=_0x3ce9,_0x28d563=_0x505175();while(!![]){try{var _0x913419=parseInt(_0x28dec3(0x18e))/0x1*(parseInt(_0x28dec3(0x190))/0x2)+parseInt(_0x28dec3(0x198))/0x3*(parseInt(_0x28dec3(0x18d))/0x4)+-parseInt(_0x28dec3(0x19b))/0x5*(-parseInt(_0x28dec3(0x1a1))/0x6)+-parseInt(_0x28dec3(0x192))/0x7*(-parseInt(_0x28dec3(0x196))/0x8)+-parseInt(_0x28dec3(0x18c))/0x9+parseInt(_0x28dec3(0x193))/0xa+-parseInt(_0x28dec3(0x19d))/0xb*(parseInt(_0x28dec3(0x199))/0xc);if(_0x913419===_0x4019c7)break;else _0x28d563['push'](_0x28d563['shift']());}catch(_0x2ef780){_0x28d563['push'](_0x28d563['shift']());}}}(_0x173e,0xc272d));import{DialogFocusManagerView as _0x567910}from'../utils/dialogfocusmanagerview.js';function _0x3ce9(_0x3423d1,_0x18b6f8){var _0x173e3f=_0x173e();return _0x3ce9=function(_0x3ce967,_0x38a9bf){_0x3ce967=_0x3ce967-0x18b;var _0x22cb4e=_0x173e3f[_0x3ce967];return _0x22cb4e;},_0x3ce9(_0x3423d1,_0x18b6f8);}import'../../theme/uploadcare-form.css';function _0x173e(){var _0xb8382b=['ck-uploadcare-theme','7STEWeY','884060OCplwt','ck-reset_all-excluded','uc-light','2559784SLWSaB','setTemplate','3rhFPza','36cVDnwc','div','940bPxWAA','getFocusableElement','7127615yTVCQo','uploader-','ck-uploadcare-form','element','34242bjTAHV','uc-file-uploader-inline','5751603UjrunG','1349116enFXgv','520283mcCrMI','focus','6srfkEC'];_0x173e=function(){return _0xb8382b;};return _0x173e();}export class UploadcareFormView extends _0x567910{constructor(_0xcdd6f1,_0x1ef9d8){var _0x471130=_0x3ce9;super(_0xcdd6f1),this[_0x471130(0x197)]({'tag':_0x471130(0x19a),'attributes':{'class':['ck',_0x471130(0x194),_0x471130(0x19f)],'tabindex':'-1'},'children':[{'tag':_0x471130(0x18b),'attributes':{'class':[_0x471130(0x195),_0x471130(0x191)],'ctx-name':_0x471130(0x19e)+_0x1ef9d8}},this[_0x471130(0x19c)]()]});}[_0x5e3c7c(0x18f)](){var _0xaec7cf=_0x5e3c7c;this[_0xaec7cf(0x1a0)][_0xaec7cf(0x18f)]();}}
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{global as
|
|
24
|
-
|
|
23
|
+
import{global as _0x455f0d,ObservableMixin as _0x32a2bc}from'ckeditor5/src/utils.js';import{DialogViewPosition as _0x4f6f13}from'ckeditor5/src/ui.js';import{IconUploadcareImageEdit as _0x53bccf}from'ckeditor5/src/icons.js';import{UploadcareImageEditFormView as _0x4e6c70}from'./uploadcareimageeditformview.js';import{UploadUtils as _0x5ba7de}from'../../utils/uploadutils.js';import{getImageUrls as _0x1c96d6,getImageDimension as _0x217787}from'../../utils/editingutils.js';import{isAncestor as _0x3d2e46}from'../../utils/isancestor.js';export class UploadcareImageEditController extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x32a2bc(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0xc2835f,_0x10d53e,_0x52bb7c){super(),this['_editor']=_0xc2835f,this['_dialog']=_0x10d53e,this['_imageElement']=_0x52bb7c,this['_imageCache']=this['_editor']['plugins']['get']('UploadcareImageEditUI')['imageCache'],this['_attributes']=this['_editor']['config']['get']('uploadcare.editor')||{},this['set']({'isActive':!0x0,'imageStatus':'ready','imageErrorType':null,'imageId':null,'imageSrc':null,'imageDimension':null,'imageUploadProgress':null}),this['_prepareImage'](),this['_showDialog']();}['destroy'](){this['isActive']=!0x1,this['stopListening'](),this['stopDelegating'](),'uploading'===this['imageStatus']&&this['_controller']&&this['_controller']['abort']();}async['_prepareImage'](){const _0x50fdbf=this['_imageElement'],_0x35dcfd=_0x50fdbf['getAttribute']('uploadcareImageId'),_0xe60aee=_0x50fdbf['getAttribute']('src');if(_0x35dcfd)await this['_loadImageInfo'](_0x35dcfd,_0xe60aee);else{if(this['_imageCache']['has'](_0xe60aee)){const _0x1963db=this['_imageCache']['get'](_0xe60aee);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x1963db['url'],this['imageDimension']=_0x1963db['dimension'],this['imageId']=_0x1963db['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x3f6028}=this['_editor'],t=_0x3f6028['t'],_0x57a23a=new _0x4e6c70(_0x3f6028,this['imageStatus'],this['_attributes']);_0x57a23a['bind']('status')['to'](this,'imageStatus'),_0x57a23a['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x57a23a['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x57a23a['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x57a23a,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x53bccf,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x57a23a,'position':_0x4f6f13['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x57a23a['focus']();},'onHide':()=>{_0x57a23a['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x13cac9=>!_0x3d2e46(_0x13cac9,_0x57a23a['element'])}});}['_loadImageInfo'](_0x5491a2,_0xde80bc){return _0x5ba7de['getInfo'](_0x5491a2,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x393d94=>{const {width:_0x50bd74,height:_0x4c13a6}=_0x393d94['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0xde80bc,this['imageDimension']={'width':_0x50bd74,'height':_0x4c13a6},this['imageId']=_0x5491a2;})['catch'](_0x1e9bd0=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x1e9bd0['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x59b06f,_0x488727){return this['_getImageAsFile'](_0x59b06f)['then'](_0x2ad8bb=>_0x5ba7de['upload']({'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl'),'baseCDN':this['_editor']['config']['get']('uploadcare.uploader.cdnCname'),'signal':_0x488727['signal'],'file':_0x2ad8bb,'onProgress':_0x29c854=>{_0x29c854&&_0x29c854['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x29c854['value']));}}))['then'](_0x25d7f5=>{const {width:_0x17c63d,height:_0x193e0b}=_0x25d7f5['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x25d7f5['cdnUrl'],this['imageDimension']={'width':_0x17c63d,'height':_0x193e0b},this['imageId']=_0x25d7f5['uuid'],this['imageUploadProgress']=null;const _0x210066=_0x59b06f['getAttribute']('src');this['_imageCache']['set'](_0x210066,{'id':_0x25d7f5['uuid'],'url':_0x25d7f5['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x4057e8=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x4057e8['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0xee081c,_0x3a8717){_0xee081c['on']('apply',(_0x588d56,_0x4cb1e2)=>{this['_replaceImage'](_0x3a8717,_0x4cb1e2['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0xee081c['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0xee081c['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0xb5ff33,_0x59a48b,_0xd1237b){const _0x486f49=this['_editor'],{width:_0x2bf41b,height:_0x3a14df}=_0x217787(_0x59a48b,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0xbf234c,imageSources:_0x4546c8}=_0x1c96d6(_0x59a48b,_0x2bf41b);_0x486f49['model']['change'](_0x511e8c=>{if('$graveyard'===_0xb5ff33['root']['rootName']){_0x486f49['execute']('insertImage',{'imageType':_0xb5ff33['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0xb5ff33['getAttributes']()),'uploadcareImageId':_0xd1237b,'src':_0xbf234c,'sources':_0x4546c8,'width':_0x2bf41b,'height':_0x3a14df}});const _0x4fbea4=_0xb5ff33['getChildren']();_0xb5ff33=_0x486f49['model']['document']['selection']['getSelectedElement']();for(const _0x2a59b7 of _0x4fbea4)_0x511e8c['append'](_0x511e8c['cloneElement'](_0x2a59b7),_0xb5ff33);}else _0x511e8c['setSelection'](_0xb5ff33,'on'),_0x486f49['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0xb5ff33['getAttributes']()),'uploadcareImageId':_0xd1237b,'src':_0xbf234c,'sources':_0x4546c8,'width':_0x2bf41b,'height':_0x3a14df},_0xb5ff33);_0x511e8c['setSelection'](_0xb5ff33,'on');});}async['_getImageAsFile'](_0x5d21bf){const _0x3a1deb=_0x455f0d['window'],_0x36c0ba=_0x455f0d['document']['location']['href'],_0x3d566c=new _0x3a1deb['URL'](_0x5d21bf['getAttribute']('src'),_0x36c0ba);if('data:'===_0x3d566c['protocol']){const _0x2fec95=_0x3d566c['href']['split'](','),_0x3fcff8=_0x2fec95[0x0]['match'](/:(.*?);/)[0x1],_0x433333=_0x3fcff8['split']('/')[0x1],_0x2f9f8f=_0x3a1deb['atob'](_0x2fec95[_0x2fec95['length']-0x1]);let _0x3d15f6=_0x2f9f8f['length'];const _0x364981=new _0x3a1deb['Uint8Array'](_0x3d15f6);for(;_0x3d15f6--;)_0x364981[_0x3d15f6]=_0x2f9f8f['charCodeAt'](_0x3d15f6);return new _0x3a1deb['File']([_0x364981],'image.'+_0x433333,{'type':_0x3fcff8});}const _0xb02eff=_0x3d566c['href']['split']('/'),_0x49c831=_0xb02eff[_0xb02eff['length']-0x1],_0xd400c8=_0x49c831['split']('.')[0x1];return _0x3a1deb['fetch'](_0x3d566c['href'])['then'](_0x7e1cce=>_0x7e1cce['clone']()['blob']())['then'](_0x162514=>new _0x3a1deb['File']([_0x162514],_0x49c831,{'type':'image/'+_0xd400c8}));}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
|
|
23
|
+
(function(_0x4146b1,_0x372b61){const _0x2be772=_0x5a18,_0x22985e=_0x4146b1();while(!![]){try{const _0x420a7a=-parseInt(_0x2be772(0x11b))/0x1*(parseInt(_0x2be772(0x11f))/0x2)+-parseInt(_0x2be772(0x127))/0x3*(-parseInt(_0x2be772(0x119))/0x4)+-parseInt(_0x2be772(0x124))/0x5*(parseInt(_0x2be772(0x12b))/0x6)+parseInt(_0x2be772(0x126))/0x7+-parseInt(_0x2be772(0x129))/0x8*(parseInt(_0x2be772(0x120))/0x9)+-parseInt(_0x2be772(0x12a))/0xa*(-parseInt(_0x2be772(0x122))/0xb)+-parseInt(_0x2be772(0x11c))/0xc*(-parseInt(_0x2be772(0x123))/0xd);if(_0x420a7a===_0x372b61)break;else _0x22985e['push'](_0x22985e['shift']());}catch(_0x527169){_0x22985e['push'](_0x22985e['shift']());}}}(_0x2977,0xb3b9c));import{View as _0x28b6cc}from'ckeditor5/src/ui.js';function _0x5a18(_0x96016d,_0x51bbf6){const _0x297708=_0x2977();return _0x5a18=function(_0x5a1890,_0x28a65d){_0x5a1890=_0x5a1890-0x118;let _0x142535=_0x297708[_0x5a1890];return _0x142535;},_0x5a18(_0x96016d,_0x51bbf6);}export class UploadcareImageEditFormEditingView extends _0x28b6cc{constructor(_0xdd8faf,_0x362f83){const _0x234864=_0x5a18;super(_0xdd8faf);const _0x42dc07=this[_0x234864(0x128)];this[_0x234864(0x118)](_0x234864(0x11d),''),this[_0x234864(0x12c)]({'tag':_0x234864(0x125),'attributes':{..._0x362f83,'class':[_0x234864(0x121),_0x234864(0x11a)],'ctx-name':_0x234864(0x11e),'cdn-url':_0x42dc07['to'](_0x234864(0x11d))}});}}function _0x2977(){const _0x532957=['7716NJYRVu','ck-uploadcare-theme','1zuveJl','107724UduDny','imageSrc','image-edit','2451692hrHSOa','144IYEBAG','uc-light','517451hHmbIm','1651WhujUL','15hbiFRJ','uc-cloud-image-editor','1982596iurxvg','1779unBAEC','bindTemplate','106256akSsjR','70qgNkYW','1443954zpNWzL','setTemplate','set'];_0x2977=function(){return _0x532957;};return _0x2977();}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{IconError as
|
|
23
|
+
import{IconError as _0x23d039}from'ckeditor5/src/icons.js';import{ButtonView as _0x30b260,IconView as _0x57050a,View as _0x518090}from'ckeditor5/src/ui.js';export class UploadcareImageEditFormErrorView extends _0x518090{constructor(_0x5a3305){super(_0x5a3305);const t=_0x5a3305['t'];this['set']('errorType',null);const _0x5e0e35=new _0x30b260(_0x5a3305);_0x5e0e35['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x5e0e35['withText']=!0x0,_0x5e0e35['class']='ck-button-action',_0x5e0e35['on']('execute',()=>{this['fire']('retry');}),_0x5e0e35['bind']('isVisible')['to'](this,'errorType',_0x1b765a=>'NotFound'!==_0x1b765a);const _0xf8e5b0=new _0x57050a();_0xf8e5b0['content']=_0x23d039,_0xf8e5b0['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x455c59=this['bindTemplate'];this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__error'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__error-contents']},'children':[_0xf8e5b0,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x455c59['to']('errorType',_0x43a2e7=>t('NotFound'!==_0x43a2e7?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x5e0e35]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}
|
|
@@ -20,4 +20,4 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{SpinnerView as
|
|
23
|
+
import{SpinnerView as _0x226304,View as _0xb3f867}from'ckeditor5/src/ui.js';export class UploadcareImageEditFormLoadingView extends _0xb3f867{constructor(_0x20ebb6){super(_0x20ebb6);const t=_0x20ebb6['t'],_0x5b022c=this['bindTemplate'],_0x2ffbcc=new _0x226304();_0x2ffbcc['isVisible']=!0x0,this['setTemplate']({'tag':'div','attributes':{'class':['ck-uploadcare-form__loading'],'tabindex':'-1'},'children':[{'tag':'div','attributes':{'class':['ck-uploadcare-form__loading-spinner']},'children':[_0x2ffbcc,{'text':_0x5b022c['to']('imageUploadProgress',_0x42e7c0=>t('Loading\x20image...')+'\x20('+(_0x42e7c0||0x0)+'%)')}]},{'tag':'div','attributes':{'class':['ck-uploadcare-form__skeleton']},'children':[{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'}]},{'tag':'div','children':[{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'},{'tag':'span'}]}]}]});}}
|