@ckeditor/ckeditor5-uploadcare 0.0.0-nightly-next-20260109.0 → 0.0.0-nightly-next-20260110.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/dist/index.js +3 -3
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
*
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
import{Plugin as _0x43a80a,Command as _0x266ed1}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x522601,IconGooglePhotos as _0x2d1b05,IconGoogleDrive as _0x5566cc,IconFacebook as _0x3c317a,IconDropbox as _0x767df9,IconUploadcareLink as _0x1f0729,IconUploadcareImageUpload as _0x382adf,IconError as _0x201453,IconUploadcareImageEdit as _0x21e4e7}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x368b04,MenuBarMenuListItemButtonView as _0x186265,View as _0x49d1b2,FocusCycler as _0x3e1069,Dialog as _0x1166b4,DialogViewPosition as _0x26d088,SpinnerView as _0x553ae1,IconView as _0xc96a27,Notification as _0x529d3d}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x56b82b,DomEmitterMixin as _0x10168a,global as _0x4d2ea8,getAncestors as _0x5d1ff3,ObservableMixin as _0x111ee7,uid as _0x39e3cb,createElement as _0x1177a3}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x89b2c7}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x1addbc,info as _0x40a904}from'@uploadcare/upload-client';import*as _0xdc4c4e from'@uploadcare/file-uploader';var S=function(_0x46b600){return _0x46b600['Local']='local',_0x46b600['URL']='url',_0x46b600['Dropbox']='dropbox',_0x46b600['GDrive']='gdrive',_0x46b600['Facebook']='facebook',_0x46b600['GPhotos']='gphotos',_0x46b600['OneDrive']='onedrive',_0x46b600;}({});function T(_0x2bdb53,_0x4cc6ea,_0x3b23bd){const t=_0x2bdb53['t'],_0x4d8cf8=_0x2bdb53['t'];switch(_0x4cc6ea){case S['Local']:return{'text':_0x4d8cf8('Insert'===_0x3b23bd?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x4d8cf8('From\x20computer')};case S['URL']:return{'text':'Insert'===_0x3b23bd?_0x4d8cf8('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x4d8cf8('Via\x20URL')};case S['Dropbox']:return{'text':t('Insert'===_0x3b23bd?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case S['Facebook']:return{'text':t('Insert'===_0x3b23bd?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case S['GDrive']:return{'text':t('Insert'===_0x3b23bd?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case S['GPhotos']:return{'text':t('Insert'===_0x3b23bd?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case S['OneDrive']:return{'text':t('Insert'===_0x3b23bd?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x4cc6ea;}}class A extends _0x43a80a{['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 _0x2a6273=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x8d488e;for(const _0x176cbb in _0x2a6273){const _0xe8d0f7=_0x176cbb,_0x378bcd=_0x2a6273[_0xe8d0f7];if('uploadcareLicenseKeyValid'==_0x378bcd||'uploadcareLicenseKeyInvalid'==_0x378bcd||'uploadcareLicenseKeyExpired'==_0x378bcd||'uploadcareLicenseKeyDomainLimit'==_0x378bcd||'uploadcareLicenseKeyNotAllowed'==_0x378bcd||'uploadcareLicenseKeyEvaluationLimit'==_0x378bcd||'uploadcareLicenseKeyUsageLimit'==_0x378bcd){delete _0x2a6273[_0xe8d0f7],_0x8d488e=_0x378bcd,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x8d488e&&_0x2a6273['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x8d488e&&_0x2a6273['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x8d488e&&_0x2a6273['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x8d488e&&_0x2a6273['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x8d488e&&_0x2a6273['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x8d488e&&_0x2a6273['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x4ac027}=this,_0xaed97b=_0x4ac027['commands']['get']('uploadcare');if(!_0xaed97b)return;const _0x58895f=this['_normalizeConfigSourceList'](_0x4ac027['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0x860605,_0x315cbf)=>{const _0x297ae3=this['_getIntegrationKey'](_0x315cbf['type']);return _0x860605[_0x297ae3]||(_0x860605[_0x297ae3]=[]),_0x860605[_0x297ae3]['push'](_0x315cbf),_0x860605;},{});_0x4ac027['plugins']['has']('ImageInsertUI')&&_0x4ac027['commands']['get']('uploadcare')&&Object['entries'](_0x58895f)['forEach'](([_0x2da114,_0x2ac08e])=>{_0x4ac027['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x2da114,'observable':()=>_0xaed97b,'buttonViewCreator':()=>this['_createToolbarButton'](_0x2ac08e),'formViewCreator':()=>this['_createDropdownButtons'](_0x2ac08e),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x2ac08e),'override':'assetManager'!==_0x2da114});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x434670){const {locale:_0x2481f4}=this['editor'];return _0x434670['map'](_0x317dfc=>{const _0x4cd033=T(_0x2481f4,_0x317dfc,'Insert');switch(_0x317dfc){case S['Local']:return{'icon':_0x382adf,'type':S['Local'],..._0x4cd033};case S['URL']:return{'icon':_0x1f0729,'type':S['URL'],..._0x4cd033};case S['Dropbox']:return{'icon':_0x767df9,'type':S['Dropbox'],..._0x4cd033};case S['Facebook']:return{'icon':_0x3c317a,'type':S['Facebook'],..._0x4cd033};case S['GDrive']:return{'icon':_0x5566cc,'type':S['GDrive'],..._0x4cd033};case S['GPhotos']:return{'icon':_0x2d1b05,'type':S['GPhotos'],..._0x4cd033};case S['OneDrive']:return{'icon':_0x522601,'type':S['OneDrive'],..._0x4cd033};}});}['_getIntegrationKey'](_0x3bf34b){switch(_0x3bf34b){case S['Local']:return'upload';case S['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x5e18f9,_0x4bdcb0){const _0x6e315a=this['editor'],_0x681ea5=new _0x5e18f9(_0x6e315a['locale']),_0xd3191b=_0x6e315a['commands']['get']('uploadcare');return _0x681ea5['bind']('isEnabled')['to'](_0xd3191b),_0x681ea5['on']('execute',()=>{_0xd3191b['execute'](_0x4bdcb0);}),_0x681ea5;}['_createToolbarButton'](_0x453077){const {locale:_0x5f4479}=this['editor'],_0x36ece6=this['editor']['plugins']['get']('ImageInsertUI'),_0x1d4af2=_0x453077[0x0],_0x1d03d7=this['_createButton'](_0x368b04,_0x1d4af2['type']);return _0x1d03d7['icon']=_0x1d4af2['icon'],_0x1d03d7['bind']('label')['to'](_0x36ece6,'isImageSelected',_0x3f9d25=>T(_0x5f4479,_0x1d4af2['type'],_0x3f9d25?'Replace':'Insert')['text']),_0x1d03d7['tooltip']=!0x0,_0x1d03d7;}['_createDropdownButtons'](_0x3882de){const {locale:_0x49231f}=this['editor'],_0x47a5e8=this['editor']['plugins']['get']('ImageInsertUI');return _0x3882de['map'](_0x46f803=>{const _0x10bc02=this['_createButton'](_0x368b04,_0x46f803['type']);return _0x10bc02['withText']=!0x0,_0x10bc02['icon']=_0x46f803['icon'],_0x10bc02['bind']('label')['to'](_0x47a5e8,'isImageSelected',_0x5dc62d=>T(_0x49231f,_0x46f803['type'],_0x5dc62d?'Replace':'Insert')['text']),_0x10bc02;});}['_createMenuBarButtons'](_0xa215ca){return _0xa215ca['map'](_0x487b6d=>{const _0x126e3b=this['_createButton'](_0x186265,_0x487b6d['type']);return _0x126e3b['icon']=_0x487b6d['icon'],_0x126e3b['label']=_0x487b6d['shortText'],_0x126e3b;});}}class K extends _0x49d1b2{['focusTracker'];['focusCycler'];constructor(_0x2ed684){super(_0x2ed684),this['focusTracker']=new _0x56b82b(),this['focusCycler']=new _0x3e1069({'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 O extends K{constructor(_0x1485da,_0x4ed195){super(_0x1485da),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-'+_0x4ed195}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function D(_0x25c487,_0x289157){const _0x1fc26e=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x1ba9ca=>_0x1ba9ca<=_0x289157)['map'](_0x5426ee=>_0x25c487['replace'](/\/$/,'')+'/-/resize/'+_0x5426ee+'x/\x20'+_0x5426ee+'w');return{'imageFallbackUrl':_0x25c487,'imageSources':[{'srcset':_0x1fc26e['join'](',\x20'),'sizes':'(max-width:\x20'+_0x289157+'px)\x20100vw,\x20'+_0x289157+'px','type':'image/webp'}]};}function F(_0x403e70,_0x4a1e84,_0x3d05de){const _0xf33e8=_0x403e70['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0xf33e8?parseInt(_0xf33e8[0x1],0xa):_0x4a1e84,'height':_0xf33e8?parseInt(_0xf33e8[0x2],0xa):_0x3d05de};}function $(_0x4ebabb,_0x37b3ad){const _0x1eeb37=new(_0x10168a())(),_0x3bacec=_0x4ebabb['plugins']['get']('ImageUtils'),_0x4b5e66=_0x4ebabb['editing']['mapper']['toViewElement'](_0x37b3ad),_0xdd603a=_0x3bacec['findViewImgElement'](_0x4b5e66),_0x1e3277=_0x4ebabb['editing']['view']['domConverter']['viewToDom'](_0xdd603a),_0x2dfd1c=_0x37b3ad['getAttribute']('width'),_0x19763c=_0x37b3ad['getAttribute']('height'),_0x251194='image-processing';_0x4ebabb['editing']['view']['change'](_0x1580f4=>{_0x1580f4['addClass'](_0x251194,_0x4b5e66),_0x1580f4['setStyle']('aspect-ratio',_0x2dfd1c+'/'+_0x19763c,_0xdd603a);}),_0x1eeb37['listenTo'](_0x1e3277,'load',()=>{_0x1eeb37['stopListening'](_0x1e3277,'load'),_0x4ebabb['editing']['view']['change'](_0x113b90=>{_0x113b90['removeClass'](_0x251194,_0x4b5e66),_0x113b90['removeStyle']('aspect-ratio',_0xdd603a);});});}function B(_0x2d7841){if(Array['isArray'](_0x2d7841)){const _0x4d8257=_0x2d7841['map'](B);return _0x2c20e7=>_0x4d8257['some'](_0x3ebef0=>_0x3ebef0(_0x2c20e7));}if('origin'==_0x2d7841){const _0x4ce9be=_0x4d2ea8['window']['location']['origin'];return _0x375b49=>new URL(_0x375b49,_0x4d2ea8['document']['baseURI'])['origin']==_0x4ce9be;}return'function'==typeof _0x2d7841?_0x2d7841:_0x2d7841 instanceof RegExp?_0x39c3f5=>!(!_0x39c3f5['match'](_0x2d7841)&&!_0x39c3f5['replace'](/^https?:\/\//,'')['match'](_0x2d7841)):()=>!0x1;}function V(_0x3e34f4,_0x31d5da){return _0x5d1ff3(_0x3e34f4['target'])['includes'](_0x31d5da);}class j extends/* #__PURE__ -- @preserve */
|
|
24
|
-
_0x111ee7(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x3c6ca9,_0x5d9eb2,_0x533693){super(),this['_editor']=_0x3c6ca9,this['_editing']=_0x5d9eb2,this['_dialog']=_0x3c6ca9['plugins']['get'](_0x1166b4),this['_api']=_0x5d9eb2['ctxElement']['getAPI'](),this['_type']=_0x533693,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:_0x413ab2,model:_0x203f2d}=this['_editor'],_0x1f205c=_0x203f2d['document']['selection']['getSelectedElement'](),_0x26472f=_0x1f205c&&(_0x1f205c['is']('element','imageBlock')||_0x1f205c['is']('element','imageInline'));this['_formView']=new O(_0x413ab2,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x382adf,'title':T(_0x413ab2,this['_type'],_0x26472f?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x26d088['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x2b8ba9=>!V(_0x2b8ba9,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x4a71f5}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x49cb70=>{const _0x57e773=_0x4a71f5['length'];for(const _0x3232a4 of _0x4a71f5){const _0x326d07=_0x3232a4===_0x4a71f5[_0x57e773-0x1],{cdnUrl:_0x35a8b4,fileInfo:_0x29b619}=_0x3232a4;if(!_0x35a8b4||!_0x29b619)continue;const {width:_0x1b0b95,height:_0x18eb7e}=_0x29b619['imageInfo'],_0x4783d1=F(_0x35a8b4,_0x1b0b95,_0x18eb7e),_0x5e2b5f=D(_0x35a8b4,_0x4783d1['width']),_0x4f8b3f={'id':_0x29b619['uuid'],'type':'image','attributes':{'imageDimension':_0x4783d1,..._0x5e2b5f}};this['_insertAsset'](_0x4f8b3f,_0x326d07,_0x49cb70);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x262408=>{'idle'===_0x262408['detail']['status']&&!_0x262408['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===S['Local']?this['_api']['setCurrentActivity'](S['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x4d7d1a,_0x5bdeec,_0xc457f5){const _0x1588ca=this['_editor']['model']['document']['selection'],_0x4a0aab=_0x1588ca['getSelectedElement'](),_0x2a8868=!(!_0x4a0aab||!_0x4a0aab['is']('element','imageInline'));_0xc457f5['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x4d7d1a,_0x2a8868),_0x5bdeec||_0xc457f5['setSelection'](_0x1588ca['getLastPosition']());}['_insertImage'](_0x59d7d4,_0x3d0e02){const _0x1ebf22=this['_editor'],{imageDimension:_0x59d172,imageFallbackUrl:_0x189a26,imageSources:_0x5bf2b9}=_0x59d7d4['attributes'];_0x1ebf22['execute']('insertImage',{'imageType':_0x3d0e02?'imageInline':null,'source':{'uploadcareImageId':_0x59d7d4['id'],'src':_0x189a26,'sources':_0x5bf2b9,..._0x59d172}});}}class M extends _0x266ed1{['_editing'];['_controller']=null;static get['requires'](){return[_0x1166b4,z];}constructor(_0x5066f8){super(_0x5066f8),this['_editing']=_0x5066f8['plugins']['get'](z);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x12c404){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new j(this['editor'],this['_editing'],_0x12c404);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class q{static['upload']({file:_0x496ea3,..._0x3865a6}){return _0x1addbc(_0x496ea3,_0x3865a6);}static['getInfo'](_0x7a12ba,_0x857359){return _0x40a904(_0x7a12ba,_0x857359);}}class W extends _0x43a80a{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x89b2c7,z];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x22a1f0=this['editor'];if(!!!_0x22a1f0['config']['get']('uploadcare'))return;_0x22a1f0['plugins']['get'](_0x89b2c7)['createUploadAdapter']=_0x36b56f=>new G(_0x36b56f,_0x22a1f0),_0x22a1f0['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x347a3f,{imageElement:_0x1d476a,data:_0x2e1245})=>{_0x22a1f0['model']['change'](_0x4f4601=>{_0x4f4601['setAttribute']('uploadcareImageId',_0x2e1245['uploadcareImageId'],_0x1d476a);});});}}class G{['loader'];['editor'];['controller'];constructor(_0x34e89c,_0x6f96bc){this['loader']=_0x34e89c,this['editor']=_0x6f96bc,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x59fd66=await this['loader']['file'];return q['upload']({'file':_0x59fd66,'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':_0x3bcd49=>{_0x3bcd49&&_0x3bcd49['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x3bcd49['value']);}})['then'](async _0x309299=>{const {imageFallbackUrl:_0x1f4718,imageSources:_0x1c1951}=D(_0x309299['cdnUrl'],_0x309299['imageInfo']['width']);return{'uploadcareImageId':_0x309299['uuid'],'default':_0x1f4718,'sources':_0x1c1951};})['catch'](()=>{const _0x4cd04b=t('Cannot\x20upload\x20file:')+('\x20'+_0x59fd66['name']+'.');return Promise['reject'](_0x4cd04b);});}['abort'](){this['controller']['abort']();}}class z extends _0x43a80a{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',W,_0x1166b4];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0xf8782f){super(_0xf8782f),this['ucContextId']=_0x39e3cb();}['init'](){const _0x2a47f0=this['editor'];_0x2a47f0['commands']['add']('uploadcare',new M(_0x2a47f0));}['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 _0x5e3b02=_0x4d2ea8['document']['querySelector']('input[uploadcare-file-input]');_0x5e3b02&&_0x5e3b02['remove']();}),async function(_0x5b0403){const _0x4527b4=_0x18049f([0x68,0x67,0x50,0x36,0x38,0x70,0x71,0x63,0x37,0x4f,0x42,0x4a,0x78,0x39,0x75,0x33,0x7a,0x72,0x48,0x61,0x74,0x59,0x55,0x58,0x66,0x30,0x34,0x54,0x64,0x56,0x6b,0x4d,0x46,0x6d,0x77,0x43,0x73,0x35,0x53,0x44,0x41,0x76,0x6a,0x32,0x31,0x69,0x57,0x51,0x47,0x65,0x5a,0x4b,0x4c,0x79,0x52,0x6c,0x45,0x4e,0x6e,0x6f,0x49,0x62]),_0x350e94=0x535f8c3a,_0x2f393d=0x5358f26a^_0x350e94,_0x3dc3ce=window[_0x18049f([0x44,0x61,0x74,0x65])][_0x18049f([0x6e,0x6f,0x77])](),_0xe6cc83=_0x5b0403[_0x18049f([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x191ff7=new window[(_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1bed36=>{_0xe6cc83[_0x18049f([0x6f,0x6e,0x63,0x65])](_0x18049f([0x72,0x65,0x61,0x64,0x79]),_0x1bed36);}),_0x2089b6={[_0x18049f([0x6b,0x74,0x79])]:_0x18049f([0x45,0x43]),[_0x18049f([0x75,0x73,0x65])]:_0x18049f([0x73,0x69,0x67]),[_0x18049f([0x63,0x72,0x76])]:_0x18049f([0x50,0x2d,0x32,0x35,0x36]),[_0x18049f([0x78])]:_0x18049f([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]),[_0x18049f([0x79])]:_0x18049f([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]),[_0x18049f([0x61,0x6c,0x67])]:_0x18049f([0x45,0x53,0x32,0x35,0x36])},_0xa3b7cb=_0xe6cc83[_0x18049f([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x18049f([0x67,0x65,0x74])](_0x18049f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xa24df5(){let _0x45db9f,_0x4c3f53=null,_0x115842=null;try{if(_0xa3b7cb==_0x18049f([0x47,0x50,0x4c]))return _0x18049f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x45db9f=_0x1e533d(),!_0x45db9f)return _0x18049f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x45db9f[_0x18049f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x115842=_0x2b3674(_0x45db9f[_0x18049f([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x45db9f[_0x18049f([0x6a,0x74,0x69])])),await _0x4bda2c()?_0x2686fe()?_0x37197a()?_0x18049f([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0x2b5056()?(_0x45db9f[_0x18049f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x18049f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x4c3f53=_0x42859e(_0x18049f([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x479745()):_0x18049f([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x18049f([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x18049f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x18049f([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x37197a(){const _0x739de8=[_0x18049f([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x18049f([0x74,0x72,0x69,0x61,0x6c])][_0x18049f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x45db9f[_0x18049f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x3dc3ce/0x3e8:0xe10*_0x2f393d;return _0x45db9f[_0x18049f([0x65,0x78,0x70])]<_0x739de8;}function _0x2686fe(){const _0x3254df=_0x45db9f[_0x18049f([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x3254df&&(!!_0x3254df[_0x18049f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18049f([0x2a]))||!!_0x3254df[_0x18049f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18049f([0x55,0x50,0x4c,0x43])));}function _0x2b5056(){const _0x13f09a=_0x45db9f[_0x18049f([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x13f09a||0x0==_0x13f09a[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x1b9f2d}=new URL(window[_0x18049f([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x13f09a[_0x18049f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x1b9f2d))return!0x0;const _0x2bb5a6=_0x1b9f2d[_0x18049f([0x73,0x70,0x6c,0x69,0x74])](_0x18049f([0x2e]));return _0x13f09a[_0x18049f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x14ae63=>_0x14ae63[_0x18049f([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18049f([0x2a])))[_0x18049f([0x6d,0x61,0x70])](_0x349a2c=>_0x349a2c[_0x18049f([0x73,0x70,0x6c,0x69,0x74])](_0x18049f([0x2e])))[_0x18049f([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x433457=>_0x433457[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x2bb5a6[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x18049f([0x6d,0x61,0x70])](_0x1b8818=>Array(_0x2bb5a6[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x1b8818[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x18049f([0x66,0x69,0x6c,0x6c])](_0x1b8818[0x0]===_0x18049f([0x2a])?_0x18049f([0x2a]):'')[_0x18049f([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x1b8818))[_0x18049f([0x73,0x6f,0x6d,0x65])](_0x5ba467=>_0x2bb5a6[_0x18049f([0x65,0x76,0x65,0x72,0x79])]((_0x2658e7,_0x1ad073)=>_0x5ba467[_0x1ad073]===_0x2658e7||_0x5ba467[_0x1ad073]===_0x18049f([0x2a])));}function _0x479745(){return _0x4c3f53&&_0x115842?new window[(_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x3b0eeb,_0x5c3f39)=>{_0x4c3f53[_0x18049f([0x74,0x68,0x65,0x6e])](_0x3b0eeb,_0x5c3f39),_0x115842[_0x18049f([0x74,0x68,0x65,0x6e])](_0x124ac8=>{_0x124ac8!=_0x18049f([0x56,0x61,0x6c,0x69,0x64])&&_0x3b0eeb(_0x124ac8);},_0x5c3f39);}):_0x4c3f53||_0x115842||_0x18049f([0x56,0x61,0x6c,0x69,0x64]);}}function _0x2b3674(_0x2abecb,_0xf48b54){return new window[(_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x4c8ed9=>{if(_0x3f0bc2())return _0x4c8ed9(_0x18049f([0x56,0x61,0x6c,0x69,0x64]));_0x422ae0(),_0xe6cc83[_0x18049f([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x18049f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x3fb5a7=!0x1;const _0x236abb=_0x39e3cb();function _0x3067d0(_0x504969){return!!_0x504969&&(typeof _0x504969===_0x18049f([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x504969===_0x18049f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x504969[_0x18049f([0x74,0x68,0x65,0x6e])]===_0x18049f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x504969[_0x18049f([0x63,0x61,0x74,0x63,0x68])]===_0x18049f([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x38e182(_0xe7369a){_0x2e976c(_0xe7369a)[_0x18049f([0x74,0x68,0x65,0x6e])](_0x3795c7=>{if(!_0x3795c7||_0x3795c7[_0x18049f([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x18049f([0x6f,0x6b]))return _0x18049f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x51c18c(_0x164520(_0x236abb+_0xf48b54))!=_0x3795c7[_0x18049f([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x18049f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x18049f([0x56,0x61,0x6c,0x69,0x64]);})[_0x18049f([0x74,0x68,0x65,0x6e])](_0x3b84c4=>(_0x428112(),_0x3b84c4),()=>{const _0x251190=_0x203d1b();return null==_0x251190?(_0x428112(),_0x18049f([0x56,0x61,0x6c,0x69,0x64])):_0x18049f(_0x3dc3ce-_0x251190>(0x7753083a^_0x350e94)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x18049f([0x74,0x68,0x65,0x6e])](_0x4c8ed9)[_0x18049f([0x63,0x61,0x74,0x63,0x68])](()=>{_0x4c8ed9(_0x18049f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x37cfd4=0x536962ba^_0x350e94;function _0x428112(){const _0x1cbf95=_0x18049f([0x6c,0x6c,0x63,0x74,0x2d])+_0x51c18c(_0x164520(_0x2abecb)),_0x211b55=_0xe0a273(_0x51c18c(window[_0x18049f([0x4d,0x61,0x74,0x68])][_0x18049f([0x63,0x65,0x69,0x6c])](_0x3dc3ce/_0x37cfd4)));window[_0x18049f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x18049f([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1cbf95,_0x211b55);}function _0x203d1b(){const _0x29124e=_0x18049f([0x6c,0x6c,0x63,0x74,0x2d])+_0x51c18c(_0x164520(_0x2abecb)),_0x31bfdc=window[_0x18049f([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x18049f([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x29124e);return _0x31bfdc?window[_0x18049f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0xe0a273(_0x31bfdc),0x10)*_0x37cfd4:null;}function _0x2e976c(_0x45a303){return new window[(_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x200e07,_0x5ab507)=>{_0x45a303[_0x18049f([0x74,0x68,0x65,0x6e])](_0x200e07,_0x5ab507),window[_0x18049f([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5ab507,0x535e58fa^_0x350e94);});}}_0xe6cc83[_0x18049f([0x6f,0x6e])](_0x18049f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0x5044e6,_0x3d367b)=>{if(_0x3d367b[0x0]!=_0x2abecb)return _0x4c8ed9(_0x18049f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x3d367b[0x1]={..._0x3d367b[0x1],[_0x18049f([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x236abb};},{[_0x18049f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x18049f([0x68,0x69,0x67,0x68])}),_0xe6cc83[_0x18049f([0x6f,0x6e])](_0x18049f([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x227c00=>{_0x3067d0(_0x227c00[_0x18049f([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x3fb5a7=!0x0,_0x38e182(_0x227c00[_0x18049f([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x18049f([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x18049f([0x6c,0x6f,0x77])}),_0x191ff7[_0x18049f([0x74,0x68,0x65,0x6e])](()=>{_0x3fb5a7||_0x4c8ed9(_0x18049f([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x3f0bc2(){return _0xe6cc83[_0x18049f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x18049f([0x76,0x69,0x65,0x77])][_0x18049f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x18049f([0x61,0x75,0x74,0x6f]);}function _0x422ae0(){_0xe6cc83[_0x18049f([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x18049f([0x76,0x69,0x65,0x77])][_0x18049f([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x18049f([0x61,0x75,0x74,0x6f]);}}function _0x42859e(_0xc39ebc){const _0x376779=[new window[(_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x47fd03=>setTimeout(_0x47fd03,0x5356b2f6^_0x350e94)),_0x191ff7[_0x18049f([0x74,0x68,0x65,0x6e])](()=>new window[(_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3ae68c=>{let _0x54f2a2=0x0;_0xe6cc83[_0x18049f([0x6d,0x6f,0x64,0x65,0x6c])][_0x18049f([0x6f,0x6e])](_0x18049f([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x4a226b,_0x2d700a)=>{_0x2d700a[0x0][_0x18049f([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x54f2a2++,_0x54f2a2==(0x535f89d2^_0x350e94)&&(_0x3ae68c(),_0x4a226b[_0x18049f([0x6f,0x66,0x66])]());});}))];return window[_0x18049f([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x18049f([0x72,0x61,0x63,0x65])](_0x376779)[_0x18049f([0x74,0x68,0x65,0x6e])](()=>_0xc39ebc);}async function _0x295822(){await _0x191ff7,_0xe6cc83[_0x18049f([0x6d,0x6f,0x64,0x65,0x6c])][_0x18049f([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x141357,_0xe6cc83[_0x18049f([0x6d,0x6f,0x64,0x65,0x6c])][_0x18049f([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x141357,_0xe6cc83[_0x18049f([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x18049f([0x6d,0x6f,0x64,0x65,0x6c]));}function _0xf08c80(_0x46f5d4){const _0x50303b=_0x3c0090();_0xe6cc83[_0x50303b]=_0x18049f([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x46f5d4,_0x46f5d4!=_0x18049f([0x56,0x61,0x6c,0x69,0x64])&&_0x295822();}function _0x3c0090(){const _0x139d5b=window[_0x18049f([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x18049f([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x18049f([0x6e,0x6f,0x77])]())[_0x18049f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x18049f([0x2e]),'');let _0x56e401=_0x18049f([0x68]);for(let _0x4391bf=0x0;_0x4391bf<_0x139d5b[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x4391bf+=0x2){let _0x1f97af=window[_0x18049f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x139d5b[_0x18049f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4391bf,_0x4391bf+0x2));_0x1f97af>=_0x4527b4[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x1f97af-=_0x4527b4[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x56e401+=_0x4527b4[_0x1f97af];}return _0x56e401;}function _0x1e533d(){const _0x5d0f62=_0xa3b7cb[_0x18049f([0x73,0x70,0x6c,0x69,0x74])](_0x18049f([0x2e]));if(0x3!=_0x5d0f62[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0x4373db(_0x5d0f62[0x1]);function _0x4373db(_0x157d5a){const _0x1007e4=_0x3e6e92(_0x157d5a);return _0x1007e4&&_0x84a096()?_0x1007e4:null;function _0x84a096(){const _0x15b7e4=_0x1007e4[_0x18049f([0x6a,0x74,0x69])],_0x247f6b=window[_0x18049f([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x15b7e4[_0x18049f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x15b7e4[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x3dbd91={..._0x1007e4,[_0x18049f([0x6a,0x74,0x69])]:_0x15b7e4[_0x18049f([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x15b7e4[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x3dbd91[_0x18049f([0x76,0x63])],_0x164520(_0x3dbd91)==_0x247f6b;}}}async function _0x4bda2c(){let _0x13d0b9=!0x0;try{const _0x51acd2=_0xa3b7cb[_0x18049f([0x73,0x70,0x6c,0x69,0x74])](_0x18049f([0x2e])),[_0x5f0301,_0x1f566a,_0x28c3f1]=_0x51acd2;return _0x3bb105(_0x5f0301),await _0x48f6c0(_0x5f0301,_0x1f566a,_0x28c3f1),_0x13d0b9;}catch{return!0x1;}function _0x3bb105(_0x521162){const _0x442c1e=_0x3e6e92(_0x521162);_0x442c1e&&_0x442c1e[_0x18049f([0x61,0x6c,0x67])]==_0x18049f([0x45,0x53,0x32,0x35,0x36])||(_0x13d0b9=!0x1);}async function _0x48f6c0(_0x392199,_0x2a9d33,_0x2ceb2f){const _0x377190=window[_0x18049f([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x18049f([0x66,0x72,0x6f,0x6d])](_0x1d54ff(_0x2ceb2f),_0x25967c=>_0x25967c[_0x18049f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x572dfb=new window[(_0x18049f([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x18049f([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x392199+_0x18049f([0x2e])+_0x2a9d33),_0x2219c6=window[_0x18049f([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x18049f([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x2219c6)return;const _0xbecfac=await _0x2219c6[_0x18049f([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x18049f([0x6a,0x77,0x6b]),_0x2089b6,{[_0x18049f([0x6e,0x61,0x6d,0x65])]:_0x18049f([0x45,0x43,0x44,0x53,0x41]),[_0x18049f([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x18049f([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x18049f([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x2219c6[_0x18049f([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x18049f([0x6e,0x61,0x6d,0x65])]:_0x18049f([0x45,0x43,0x44,0x53,0x41]),[_0x18049f([0x68,0x61,0x73,0x68])]:{[_0x18049f([0x6e,0x61,0x6d,0x65])]:_0x18049f([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0xbecfac,_0x377190,_0x572dfb)||(_0x13d0b9=!0x1);}}function _0x3e6e92(_0x119783){return _0x119783[_0x18049f([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x18049f([0x65,0x79]))?JSON[_0x18049f([0x70,0x61,0x72,0x73,0x65])](_0x1d54ff(_0x119783)):null;}function _0x1d54ff(_0x305cac){return window[_0x18049f([0x61,0x74,0x6f,0x62])](_0x305cac[_0x18049f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x18049f([0x2b]))[_0x18049f([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x18049f([0x2f])));}function _0x164520(_0xffdad7){let _0x3d989c=0x1505;function _0x30c668(_0x6301da){for(let _0x335e29=0x0;_0x335e29<_0x6301da[_0x18049f([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x335e29++){const _0x1acf15=_0x6301da[_0x18049f([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x335e29);_0x3d989c=(_0x3d989c<<0x5)+_0x3d989c+_0x1acf15,_0x3d989c&=_0x3d989c;}}function _0x4965b2(_0x556e53){Array[_0x18049f([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x556e53)?_0x556e53[_0x18049f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4965b2):_0x556e53&&typeof _0x556e53==_0x18049f([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x18049f([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x556e53)[_0x18049f([0x73,0x6f,0x72,0x74])]()[_0x18049f([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x4019f8,_0x4b78b2])=>{_0x30c668(_0x4019f8),_0x4965b2(_0x4b78b2);}):_0x30c668(window[_0x18049f([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x556e53));}return _0x4965b2(_0xffdad7),_0x3d989c>>>0x0;}function _0x51c18c(_0x31bfa2){return _0x31bfa2[_0x18049f([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x18049f([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x18049f([0x30]));}function _0xe0a273(_0x401135){return _0x401135[_0x18049f([0x73,0x70,0x6c,0x69,0x74])]('')[_0x18049f([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x18049f([0x6a,0x6f,0x69,0x6e])]('');}function _0x141357(){}function _0x18049f(_0xdbc491){return _0xdbc491['map'](_0x2ebb2b=>String['fromCharCode'](_0x2ebb2b))['join']('');}_0xf08c80(await _0xa24df5());}(this);}['_initSchema'](){const _0x13c8e1=this['editor']['model']['schema'];_0x13c8e1['isRegistered']('imageBlock')&&_0x13c8e1['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x13c8e1['isRegistered']('imageInline')&&_0x13c8e1['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x11c8d1=this['editor'];_0x11c8d1['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x11c8d1['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x2788f8=>_0x2788f8['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x57ccc9=_0x11c8d1['commands']['get']('replaceImageSource');_0x57ccc9&&this['listenTo'](_0x57ccc9,'cleanupImage',(_0x457541,[_0x973314,_0x18e38d])=>{_0x973314['removeAttribute']('uploadcareImageId',_0x18e38d);});}['_initConfig'](){const _0x1c5e6d=this['editor']['config']['get']('uploadcare.uploader')||{},_0x3a0041=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x1177a3(_0x4d2ea8['document'],'uc-config',{..._0x1c5e6d,'pubkey':_0x3a0041,'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']=_0x598abc=>{if('closeMax'==_0x598abc)return'#uc-icon-arrow-down';},_0x4d2ea8['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x1177a3(_0x4d2ea8['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x4d2ea8['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0xcc2d86=this['editor']['commands']['get']('insertImage');_0xcc2d86&&this['listenTo'](_0xcc2d86,'execute',()=>{const _0x354533=this['editor']['model']['document']['selection']['getSelectedElement']();_0x354533&&_0x354533['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x354533);});});const _0x123d43=this['editor']['commands']['get']('uploadcareImageReplace');_0x123d43&&this['listenTo'](_0x123d43,'execute',()=>{const _0x5a49bf=this['editor']['model']['document']['selection']['getSelectedElement']();_0x5a49bf&&_0x5a49bf['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x5a49bf);});});}}class H extends _0x43a80a{static get['requires'](){return[z,A];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x45b108){super(_0x45b108),_0x45b108['config']['define']('uploadcare.uploader.sourceList',[S['Local'],S['URL']]),_0xdc4c4e['defineComponents'](_0xdc4c4e),this['_defineLocale']();}['_defineLocale'](){const _0x584112=this['editor']['config']['get']('uploadcare.locale'),_0xc69b1a=this['editor']['locale']['contentLanguage'];_0x584112&&_0xdc4c4e['defineLocale'](_0xc69b1a,_0x584112);}}class J extends _0x49d1b2{constructor(_0x496bf6){super(_0x496bf6);const t=_0x496bf6['t'],_0x52ff72=this['bindTemplate'],_0x3b5467=new _0x553ae1();_0x3b5467['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':[_0x3b5467,{'text':_0x52ff72['to']('imageUploadProgress',_0x4c9fa9=>t('Loading\x20image...')+'\x20('+(_0x4c9fa9||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 Z extends _0x49d1b2{constructor(_0x318bfb){super(_0x318bfb);const t=_0x318bfb['t'];this['set']('errorType',null);const _0xb7b605=new _0x368b04(_0x318bfb);_0xb7b605['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0xb7b605['withText']=!0x0,_0xb7b605['class']='ck-button-action',_0xb7b605['on']('execute',()=>{this['fire']('retry');}),_0xb7b605['bind']('isVisible')['to'](this,'errorType',_0x46993a=>'NotFound'!==_0x46993a);const _0x3f092d=new _0xc96a27();_0x3f092d['content']=_0x201453,_0x3f092d['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x37508b=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':[_0x3f092d,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x37508b['to']('errorType',_0x2e6412=>t('NotFound'!==_0x2e6412?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0xb7b605]},{'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 Q extends _0x49d1b2{constructor(_0xc6ae53,_0x1d1608){super(_0xc6ae53);const _0x2ace21=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x1d1608,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x2ace21['to']('imageSrc')}});}}class X extends K{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x2c7a58,_0x3ec87a,_0x2659d0){super(_0x2c7a58),this['_items']=this['createCollection'](),this['_loadingView']=new J(_0x2c7a58),this['_errorView']=new Z(_0x2c7a58),this['_editingView']=new Q(_0x2c7a58,_0x2659d0),this['_focusableView']=new _0x49d1b2(_0x2c7a58),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x3ec87a),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'],_0x18a915=>{this['_addUploadcareImageEditorListeners'](_0x18a915);});}),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'](_0x2a78b5,_0x5c1e41){const _0x372c2f='uc-cloud-image-editor',_0xe9d4ec=_0x2a78b5['querySelector'](_0x372c2f);if(_0xe9d4ec)return _0x5c1e41(_0xe9d4ec);const _0x1b0cae=new MutationObserver(_0x1e8d63=>{const _0x27c45f=_0x1e8d63['filter'](_0x4e1236=>_0x4e1236['target']===_0x2a78b5&&_0x4e1236['addedNodes']['length']>0x0&&_0x4e1236['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x372c2f);_0x27c45f['length']&&(_0x1b0cae['disconnect'](),_0x5c1e41(_0x27c45f[0x0]['addedNodes'][0x0]));});_0x1b0cae['observe'](_0x2a78b5,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0x52b4aa){_0x52b4aa['addEventListener']('apply',_0xb2cedf=>{this['fire']('apply',{'imageSrc':_0xb2cedf['detail']['cdnUrl']});}),_0x52b4aa['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class Y extends/* #__PURE__ -- @preserve */
|
|
25
|
-
_0x111ee7(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x513489,_0x54fe0e,_0x423cfa){super(),this['_editor']=_0x513489,this['_dialog']=_0x54fe0e,this['_imageElement']=_0x423cfa,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 _0x32f60e=this['_imageElement'],_0x26ff13=_0x32f60e['getAttribute']('uploadcareImageId'),_0x4ec3e3=_0x32f60e['getAttribute']('src');if(_0x26ff13)await this['_loadImageInfo'](_0x26ff13,_0x4ec3e3);else{if(this['_imageCache']['has'](_0x4ec3e3)){const _0x461fa0=this['_imageCache']['get'](_0x4ec3e3);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x461fa0['url'],this['imageDimension']=_0x461fa0['dimension'],this['imageId']=_0x461fa0['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x3d596b}=this['_editor'],t=_0x3d596b['t'],_0x2c0133=new X(_0x3d596b,this['imageStatus'],this['_attributes']);_0x2c0133['bind']('status')['to'](this,'imageStatus'),_0x2c0133['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x2c0133['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x2c0133['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x2c0133,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x21e4e7,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x2c0133,'position':_0x26d088['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x2c0133['focus']();},'onHide':()=>{_0x2c0133['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x38d59c=>!V(_0x38d59c,_0x2c0133['element'])}});}['_loadImageInfo'](_0x2c58dd,_0x3c6329){return q['getInfo'](_0x2c58dd,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x5629ab=>{const {width:_0xd30a4a,height:_0x375b0}=_0x5629ab['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x3c6329,this['imageDimension']={'width':_0xd30a4a,'height':_0x375b0},this['imageId']=_0x2c58dd;})['catch'](_0x1a0098=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x1a0098['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x3de534,_0x264cb4){return this['_getImageAsFile'](_0x3de534)['then'](_0x3e01cc=>q['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':_0x264cb4['signal'],'file':_0x3e01cc,'onProgress':_0x4a36ab=>{_0x4a36ab&&_0x4a36ab['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x4a36ab['value']));}}))['then'](_0x2e5390=>{const {width:_0x533457,height:_0x259cf8}=_0x2e5390['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x2e5390['cdnUrl'],this['imageDimension']={'width':_0x533457,'height':_0x259cf8},this['imageId']=_0x2e5390['uuid'],this['imageUploadProgress']=null;const _0x44a8bd=_0x3de534['getAttribute']('src');this['_imageCache']['set'](_0x44a8bd,{'id':_0x2e5390['uuid'],'url':_0x2e5390['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x418d97=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x418d97['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x1fe5d5,_0x24aee0){_0x1fe5d5['on']('apply',(_0x498189,_0x3cbc70)=>{this['_replaceImage'](_0x24aee0,_0x3cbc70['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x1fe5d5['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x1fe5d5['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x18f4cf,_0x379d44,_0x1b4f85){const _0x20ad6c=this['_editor'],{width:_0xa53060,height:_0x408dd0}=F(_0x379d44,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x418fee,imageSources:_0xa1bb5f}=D(_0x379d44,_0xa53060);_0x20ad6c['model']['change'](_0x5e9719=>{if('$graveyard'===_0x18f4cf['root']['rootName']){_0x20ad6c['execute']('insertImage',{'imageType':_0x18f4cf['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x18f4cf['getAttributes']()),'uploadcareImageId':_0x1b4f85,'src':_0x418fee,'sources':_0xa1bb5f,'width':_0xa53060,'height':_0x408dd0}});const _0x4b0a3c=_0x18f4cf['getChildren']();_0x18f4cf=_0x20ad6c['model']['document']['selection']['getSelectedElement']();for(const _0x1389ff of _0x4b0a3c)_0x5e9719['append'](_0x5e9719['cloneElement'](_0x1389ff),_0x18f4cf);}else _0x5e9719['setSelection'](_0x18f4cf,'on'),_0x20ad6c['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x18f4cf['getAttributes']()),'uploadcareImageId':_0x1b4f85,'src':_0x418fee,'sources':_0xa1bb5f,'width':_0xa53060,'height':_0x408dd0},_0x18f4cf);_0x5e9719['setSelection'](_0x18f4cf,'on');});}async['_getImageAsFile'](_0x1f8112){const _0x1a58dd=_0x4d2ea8['window'],_0x28e4fa=_0x4d2ea8['document']['location']['href'],_0x3043db=new _0x1a58dd['URL'](_0x1f8112['getAttribute']('src'),_0x28e4fa);if('data:'===_0x3043db['protocol']){const _0x161600=_0x3043db['href']['split'](','),_0x1252fb=_0x161600[0x0]['match'](/:(.*?);/)[0x1],_0x913b6c=_0x1252fb['split']('/')[0x1],_0x47722a=_0x1a58dd['atob'](_0x161600[_0x161600['length']-0x1]);let _0x418086=_0x47722a['length'];const _0x405ae8=new _0x1a58dd['Uint8Array'](_0x418086);for(;_0x418086--;)_0x405ae8[_0x418086]=_0x47722a['charCodeAt'](_0x418086);return new _0x1a58dd['File']([_0x405ae8],'image.'+_0x913b6c,{'type':_0x1252fb});}const _0x38c8e3=_0x3043db['href']['split']('/'),_0x37a5a0=_0x38c8e3[_0x38c8e3['length']-0x1],_0x4bd075=_0x37a5a0['split']('.')[0x1];return _0x1a58dd['fetch'](_0x3043db['href'])['then'](_0x4f2462=>_0x4f2462['clone']()['blob']())['then'](_0x2c946a=>new _0x1a58dd['File']([_0x2c946a],_0x37a5a0,{'type':'image/'+_0x4bd075}));}}class tt extends _0x266ed1{['imageEditController'];static get['requires'](){return[_0x1166b4];}['_isEditable'];constructor(_0x5848e6){super(_0x5848e6),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x16d593){const _0x5d3005=B(_0x16d593);return _0x47ff5a=>!(!_0x47ff5a||!_0x47ff5a['is']('element','imageBlock')&&!_0x47ff5a['is']('element','imageInline'))&&(!!_0x47ff5a['hasAttribute']('uploadcareImageId')||!!_0x47ff5a['hasAttribute']('src')&&_0x5d3005(_0x47ff5a['getAttribute']('src')));}(_0x5848e6['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0xc36677=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0xc36677);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0x5104fd=this['editor']['model']['document']['selection']['getSelectedElement']();_0x5104fd&&(_0x5104fd['is']('element','imageBlock')||_0x5104fd['is']('element','imageInline'))&&(this['imageEditController']=new Y(this['editor'],this['editor']['plugins']['get'](_0x1166b4),_0x5104fd),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class et extends _0x266ed1{['refresh'](){const _0x189a18=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x189a18&&(_0x189a18['is']('element','imageBlock')||_0x189a18['is']('element','imageInline')));}['execute'](_0x468716){const _0x4933ae=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x4c07cc=>{_0x4c07cc['setAttributes'](_0x468716,_0x4933ae),_0x4c07cc['removeAttribute']('srcset',_0x4933ae),_0x4c07cc['removeAttribute']('sizes',_0x4933ae);});}}class it extends _0x43a80a{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[z,_0x529d3d,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x46e21f}=this;_0x46e21f['commands']['add']('uploadcareImageEdit',new tt(_0x46e21f)),_0x46e21f['commands']['add']('uploadcareImageReplace',new et(_0x46e21f));}}class st extends _0x43a80a{['_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 _0x111259=this['editor'];_0x111259['ui']['componentFactory']['add']('uploadcareImageEdit',_0x2e6890=>{const _0x4d7e95=_0x111259['commands']['get']('uploadcareImageEdit'),_0x58bee5=new _0x368b04(_0x2e6890),t=_0x2e6890['t'];return _0x58bee5['set']({'icon':_0x21e4e7,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x58bee5['bind']('isEnabled')['to'](_0x4d7e95),_0x58bee5['bind']('isOn')['to'](_0x4d7e95,'isActive'),this['listenTo'](_0x58bee5,'execute',()=>{_0x111259['execute']('uploadcareImageEdit'),_0x111259['editing']['view']['focus']();}),_0x58bee5;}),this['_initConfig']();}['_initConfig'](){const _0x1873cb=_0x1177a3(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x1873cb),this['listenTo'](this['editor'],'destroy',()=>{_0x1873cb['remove']();});}}class nt extends _0x43a80a{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[it,st];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{H as Uploadcare,M as UploadcareCommand,z as UploadcareEditing,nt as UploadcareImageEdit,tt as UploadcareImageEditCommand,it as UploadcareImageEditEditing,st as UploadcareImageEditUI,A as UploadcareUI,W as UploadcareUploadAdapter};
|
|
23
|
+
import{Plugin as _0x1b7228,Command as _0x30ceb0}from'@ckeditor/ckeditor5-core/dist/index.js';import{IconOneDrive as _0x2d4911,IconGooglePhotos as _0x2fb8a8,IconGoogleDrive as _0x149548,IconFacebook as _0x26fbd9,IconDropbox as _0x54167f,IconUploadcareLink as _0xcc5310,IconUploadcareImageUpload as _0x573c74,IconError as _0x30c07e,IconUploadcareImageEdit as _0x490283}from'@ckeditor/ckeditor5-icons/dist/index.js';import{ButtonView as _0x3477b3,MenuBarMenuListItemButtonView as _0x314e19,View as _0x5b3c93,FocusCycler as _0x1d6401,Dialog as _0x8c9fa8,DialogViewPosition as _0x4eaec8,SpinnerView as _0x2d1516,IconView as _0x163133,Notification as _0x48afc8}from'@ckeditor/ckeditor5-ui/dist/index.js';import{FocusTracker as _0x389ca5,DomEmitterMixin as _0x4b7148,global as _0x4a042a,getAncestors as _0x305865,ObservableMixin as _0x4b88f5,uid as _0x536ef3,createElement as _0x2691ab}from'@ckeditor/ckeditor5-utils/dist/index.js';import{FileRepository as _0x50e140}from'@ckeditor/ckeditor5-upload/dist/index.js';import{uploadFile as _0x2bcf19,info as _0x2f6ba1}from'@uploadcare/upload-client';import*as _0xb11b3 from'@uploadcare/file-uploader';var S=function(_0x12b7a4){return _0x12b7a4['Local']='local',_0x12b7a4['URL']='url',_0x12b7a4['Dropbox']='dropbox',_0x12b7a4['GDrive']='gdrive',_0x12b7a4['Facebook']='facebook',_0x12b7a4['GPhotos']='gphotos',_0x12b7a4['OneDrive']='onedrive',_0x12b7a4;}({});function T(_0x21dfd4,_0x92b6f8,_0xb7ecec){const t=_0x21dfd4['t'],_0x7d8506=_0x21dfd4['t'];switch(_0x92b6f8){case S['Local']:return{'text':_0x7d8506('Insert'===_0xb7ecec?'Upload\x20from\x20computer':'Replace\x20from\x20computer'),'shortText':_0x7d8506('From\x20computer')};case S['URL']:return{'text':'Insert'===_0xb7ecec?_0x7d8506('Insert\x20via\x20URL'):t('Replace\x20via\x20URL'),'shortText':_0x7d8506('Via\x20URL')};case S['Dropbox']:return{'text':t('Insert'===_0xb7ecec?'Insert\x20with\x20Dropbox':'Replace\x20with\x20Dropbox'),'shortText':t('With\x20Dropbox')};case S['Facebook']:return{'text':t('Insert'===_0xb7ecec?'Insert\x20with\x20Facebook':'Replace\x20with\x20Facebook'),'shortText':t('With\x20Facebook')};case S['GDrive']:return{'text':t('Insert'===_0xb7ecec?'Insert\x20with\x20Google\x20Drive':'Replace\x20with\x20Google\x20Drive'),'shortText':t('With\x20Google\x20Drive')};case S['GPhotos']:return{'text':t('Insert'===_0xb7ecec?'Insert\x20with\x20Google\x20Photos':'Replace\x20with\x20Google\x20Photos'),'shortText':t('With\x20Google\x20Photos')};case S['OneDrive']:return{'text':t('Insert'===_0xb7ecec?'Insert\x20with\x20OneDrive':'Replace\x20with\x20OneDrive'),'shortText':t('With\x20OneDrive')};default:return _0x92b6f8;}}class A extends _0x1b7228{['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 _0x368b23=this['editor'];this['_licenseKeyCheckInterval']=setInterval(()=>{let _0x1427ec;for(const _0x4bff36 in _0x368b23){const _0xdfef89=_0x4bff36,_0x36cace=_0x368b23[_0xdfef89];if('uploadcareLicenseKeyValid'==_0x36cace||'uploadcareLicenseKeyInvalid'==_0x36cace||'uploadcareLicenseKeyExpired'==_0x36cace||'uploadcareLicenseKeyDomainLimit'==_0x36cace||'uploadcareLicenseKeyNotAllowed'==_0x36cace||'uploadcareLicenseKeyEvaluationLimit'==_0x36cace||'uploadcareLicenseKeyUsageLimit'==_0x36cace){delete _0x368b23[_0xdfef89],_0x1427ec=_0x36cace,clearInterval(this['_licenseKeyCheckInterval']),this['_licenseKeyCheckInterval']=void 0x0;break;}}'uploadcareLicenseKeyInvalid'==_0x1427ec&&_0x368b23['_showLicenseError']('invalid'),'uploadcareLicenseKeyExpired'==_0x1427ec&&_0x368b23['_showLicenseError']('expired'),'uploadcareLicenseKeyDomainLimit'==_0x1427ec&&_0x368b23['_showLicenseError']('domainLimit'),'uploadcareLicenseKeyNotAllowed'==_0x1427ec&&_0x368b23['_showLicenseError']('featureNotAllowed','Uploadcare'),'uploadcareLicenseKeyEvaluationLimit'==_0x1427ec&&_0x368b23['_showLicenseError']('evaluationLimit'),'uploadcareLicenseKeyUsageLimit'==_0x1427ec&&_0x368b23['_showLicenseError']('usageLimit');},0x3e8);}['afterInit'](){const {editor:_0x3122af}=this,_0x496a1d=_0x3122af['commands']['get']('uploadcare');if(!_0x496a1d)return;const _0x2b49fc=this['_normalizeConfigSourceList'](_0x3122af['config']['get']('uploadcare.uploader.sourceList'))['reduce']((_0xaa1523,_0x441f59)=>{const _0x300530=this['_getIntegrationKey'](_0x441f59['type']);return _0xaa1523[_0x300530]||(_0xaa1523[_0x300530]=[]),_0xaa1523[_0x300530]['push'](_0x441f59),_0xaa1523;},{});_0x3122af['plugins']['has']('ImageInsertUI')&&_0x3122af['commands']['get']('uploadcare')&&Object['entries'](_0x2b49fc)['forEach'](([_0x2b2697,_0x2d2f55])=>{_0x3122af['plugins']['get']('ImageInsertUI')['registerIntegration']({'name':_0x2b2697,'observable':()=>_0x496a1d,'buttonViewCreator':()=>this['_createToolbarButton'](_0x2d2f55),'formViewCreator':()=>this['_createDropdownButtons'](_0x2d2f55),'menuBarButtonViewCreator':()=>this['_createMenuBarButtons'](_0x2d2f55),'override':'assetManager'!==_0x2b2697});});}['destroy'](){super['destroy'](),this['_licenseKeyCheckInterval']&&clearInterval(this['_licenseKeyCheckInterval']);}['_normalizeConfigSourceList'](_0x594076){const {locale:_0x3fc7d4}=this['editor'];return _0x594076['map'](_0x310eaa=>{const _0x3da119=T(_0x3fc7d4,_0x310eaa,'Insert');switch(_0x310eaa){case S['Local']:return{'icon':_0x573c74,'type':S['Local'],..._0x3da119};case S['URL']:return{'icon':_0xcc5310,'type':S['URL'],..._0x3da119};case S['Dropbox']:return{'icon':_0x54167f,'type':S['Dropbox'],..._0x3da119};case S['Facebook']:return{'icon':_0x26fbd9,'type':S['Facebook'],..._0x3da119};case S['GDrive']:return{'icon':_0x149548,'type':S['GDrive'],..._0x3da119};case S['GPhotos']:return{'icon':_0x2fb8a8,'type':S['GPhotos'],..._0x3da119};case S['OneDrive']:return{'icon':_0x2d4911,'type':S['OneDrive'],..._0x3da119};}});}['_getIntegrationKey'](_0xcf271){switch(_0xcf271){case S['Local']:return'upload';case S['URL']:return'url';default:return'assetManager';}}['_createButton'](_0x7cae4d,_0x491ee6){const _0x501291=this['editor'],_0x1e3b1a=new _0x7cae4d(_0x501291['locale']),_0x4374a7=_0x501291['commands']['get']('uploadcare');return _0x1e3b1a['bind']('isEnabled')['to'](_0x4374a7),_0x1e3b1a['on']('execute',()=>{_0x4374a7['execute'](_0x491ee6);}),_0x1e3b1a;}['_createToolbarButton'](_0xd7abb5){const {locale:_0x53997c}=this['editor'],_0x1d6e49=this['editor']['plugins']['get']('ImageInsertUI'),_0x2e9e2d=_0xd7abb5[0x0],_0x5681d4=this['_createButton'](_0x3477b3,_0x2e9e2d['type']);return _0x5681d4['icon']=_0x2e9e2d['icon'],_0x5681d4['bind']('label')['to'](_0x1d6e49,'isImageSelected',_0x445772=>T(_0x53997c,_0x2e9e2d['type'],_0x445772?'Replace':'Insert')['text']),_0x5681d4['tooltip']=!0x0,_0x5681d4;}['_createDropdownButtons'](_0x2e09c2){const {locale:_0x4d3123}=this['editor'],_0x1940e6=this['editor']['plugins']['get']('ImageInsertUI');return _0x2e09c2['map'](_0x1b325a=>{const _0x37e2f5=this['_createButton'](_0x3477b3,_0x1b325a['type']);return _0x37e2f5['withText']=!0x0,_0x37e2f5['icon']=_0x1b325a['icon'],_0x37e2f5['bind']('label')['to'](_0x1940e6,'isImageSelected',_0x456b2b=>T(_0x4d3123,_0x1b325a['type'],_0x456b2b?'Replace':'Insert')['text']),_0x37e2f5;});}['_createMenuBarButtons'](_0x181510){return _0x181510['map'](_0x72a975=>{const _0x3bda67=this['_createButton'](_0x314e19,_0x72a975['type']);return _0x3bda67['icon']=_0x72a975['icon'],_0x3bda67['label']=_0x72a975['shortText'],_0x3bda67;});}}class K extends _0x5b3c93{['focusTracker'];['focusCycler'];constructor(_0x322cf5){super(_0x322cf5),this['focusTracker']=new _0x389ca5(),this['focusCycler']=new _0x1d6401({'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 O extends K{constructor(_0xd59fea,_0x36c349){super(_0xd59fea),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-'+_0x36c349}},this['getFocusableElement']()]});}['focus'](){this['element']['focus']();}}function D(_0x4d0a50,_0x3f8d50){const _0x4d9005=[0x140,0x1e0,0x300,0x400,0x4b0,0x640,0x780,0x960]['filter'](_0x5c03ff=>_0x5c03ff<=_0x3f8d50)['map'](_0x1f6459=>_0x4d0a50['replace'](/\/$/,'')+'/-/resize/'+_0x1f6459+'x/\x20'+_0x1f6459+'w');return{'imageFallbackUrl':_0x4d0a50,'imageSources':[{'srcset':_0x4d9005['join'](',\x20'),'sizes':'(max-width:\x20'+_0x3f8d50+'px)\x20100vw,\x20'+_0x3f8d50+'px','type':'image/webp'}]};}function F(_0x3e2ab2,_0x5af8b3,_0x3e938a){const _0x567b55=_0x3e2ab2['match'](/\/crop\/(\d+)x(\d+)\//);return{'width':_0x567b55?parseInt(_0x567b55[0x1],0xa):_0x5af8b3,'height':_0x567b55?parseInt(_0x567b55[0x2],0xa):_0x3e938a};}function $(_0x262f63,_0x4a1464){const _0x3a040d=new(_0x4b7148())(),_0x573bc9=_0x262f63['plugins']['get']('ImageUtils'),_0x2c4efb=_0x262f63['editing']['mapper']['toViewElement'](_0x4a1464),_0x45b5fb=_0x573bc9['findViewImgElement'](_0x2c4efb),_0x3529e7=_0x262f63['editing']['view']['domConverter']['viewToDom'](_0x45b5fb),_0x5b5e0f=_0x4a1464['getAttribute']('width'),_0x86c8e1=_0x4a1464['getAttribute']('height'),_0x298b3d='image-processing';_0x262f63['editing']['view']['change'](_0x339482=>{_0x339482['addClass'](_0x298b3d,_0x2c4efb),_0x339482['setStyle']('aspect-ratio',_0x5b5e0f+'/'+_0x86c8e1,_0x45b5fb);}),_0x3a040d['listenTo'](_0x3529e7,'load',()=>{_0x3a040d['stopListening'](_0x3529e7,'load'),_0x262f63['editing']['view']['change'](_0x4c292d=>{_0x4c292d['removeClass'](_0x298b3d,_0x2c4efb),_0x4c292d['removeStyle']('aspect-ratio',_0x45b5fb);});});}function B(_0x1cbb87){if(Array['isArray'](_0x1cbb87)){const _0x19cbbd=_0x1cbb87['map'](B);return _0x36257f=>_0x19cbbd['some'](_0x24b14a=>_0x24b14a(_0x36257f));}if('origin'==_0x1cbb87){const _0x387057=_0x4a042a['window']['location']['origin'];return _0x3c407f=>new URL(_0x3c407f,_0x4a042a['document']['baseURI'])['origin']==_0x387057;}return'function'==typeof _0x1cbb87?_0x1cbb87:_0x1cbb87 instanceof RegExp?_0x47b397=>!(!_0x47b397['match'](_0x1cbb87)&&!_0x47b397['replace'](/^https?:\/\//,'')['match'](_0x1cbb87)):()=>!0x1;}function V(_0xcbef6e,_0x7f0756){return _0x305865(_0xcbef6e['target'])['includes'](_0x7f0756);}class j extends/* #__PURE__ -- @preserve */
|
|
24
|
+
_0x4b88f5(){['_editor'];['_dialog'];['_editing'];['_api'];['_type']=null;['_formView']=null;constructor(_0x49380c,_0x2928d8,_0x3776fb){super(),this['_editor']=_0x49380c,this['_editing']=_0x2928d8,this['_dialog']=_0x49380c['plugins']['get'](_0x8c9fa8),this['_api']=_0x2928d8['ctxElement']['getAPI'](),this['_type']=_0x3776fb,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:_0x5509b5,model:_0x2ea744}=this['_editor'],_0x32f448=_0x2ea744['document']['selection']['getSelectedElement'](),_0x4bad5f=_0x32f448&&(_0x32f448['is']('element','imageBlock')||_0x32f448['is']('element','imageInline'));this['_formView']=new O(_0x5509b5,this['_editing']['ucContextId']),this['_dialog']['show']({'id':'uploadCare','icon':_0x573c74,'title':T(_0x5509b5,this['_type'],_0x4bad5f?'Replace':'Insert')['text'],'content':this['_formView'],'position':_0x4eaec8['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{this['_formView']['focus']();},'onHide':()=>{this['_api']['removeAllFiles'](),this['_editor']['editing']['view']['focus'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x478318=>!V(_0x478318,this['_formView']['element'])}});}['_initListeners'](){this['_editing']['ctxElement']['addEventListener']('done-click',()=>{const {allEntries:_0x47abf4}=this['_api']['getOutputCollectionState']();this['_editor']['model']['change'](_0x82af2=>{const _0x223c05=_0x47abf4['length'];for(const _0x4f4afb of _0x47abf4){const _0x5265ba=_0x4f4afb===_0x47abf4[_0x223c05-0x1],{cdnUrl:_0x2658e5,fileInfo:_0x10bb7e}=_0x4f4afb;if(!_0x2658e5||!_0x10bb7e)continue;const {width:_0x4c957c,height:_0x1b599c}=_0x10bb7e['imageInfo'],_0x504e22=F(_0x2658e5,_0x4c957c,_0x1b599c),_0x272f60=D(_0x2658e5,_0x504e22['width']),_0x1f8e39={'id':_0x10bb7e['uuid'],'type':'image','attributes':{'imageDimension':_0x504e22,..._0x272f60}};this['_insertAsset'](_0x1f8e39,_0x5265ba,_0x82af2);}}),this['_dialog']['hide']();}),this['_editing']['ctxElement']['addEventListener']('change',_0x180a73=>{'idle'===_0x180a73['detail']['status']&&!_0x180a73['detail']['allEntries']['length']&&this['_dialog']['isOpen']&&(this['_type']===S['Local']?this['_api']['setCurrentActivity'](S['Local']):this['_api']['initFlow']());});}['_insertAsset'](_0x33c1e2,_0x25f90d,_0x37b14e){const _0x509b81=this['_editor']['model']['document']['selection'],_0x130106=_0x509b81['getSelectedElement'](),_0x4fc8ac=!(!_0x130106||!_0x130106['is']('element','imageInline'));_0x37b14e['removeSelectionAttribute']('linkHref'),this['_insertImage'](_0x33c1e2,_0x4fc8ac),_0x25f90d||_0x37b14e['setSelection'](_0x509b81['getLastPosition']());}['_insertImage'](_0x57d153,_0x3e6905){const _0x3ea4e3=this['_editor'],{imageDimension:_0x13ae53,imageFallbackUrl:_0x58c1f8,imageSources:_0xd261b8}=_0x57d153['attributes'];_0x3ea4e3['execute']('insertImage',{'imageType':_0x3e6905?'imageInline':null,'source':{'uploadcareImageId':_0x57d153['id'],'src':_0x58c1f8,'sources':_0xd261b8,..._0x13ae53}});}}class M extends _0x30ceb0{['_editing'];['_controller']=null;static get['requires'](){return[_0x8c9fa8,z];}constructor(_0x2ba100){super(_0x2ba100),this['_editing']=_0x2ba100['plugins']['get'](z);}['refresh'](){this['isEnabled']=this['_checkEnabled']();}['execute'](_0x4a1117){this['_controller']&&(this['_controller']['destroy'](),this['_controller']=null),this['_controller']=new j(this['editor'],this['_editing'],_0x4a1117);}['_checkEnabled'](){return this['editor']['commands']['get']('insertImage')['isEnabled'];}}class q{static['upload']({file:_0x3b4929,..._0x26a1c5}){return _0x2bcf19(_0x3b4929,_0x26a1c5);}static['getInfo'](_0x4c4a25,_0x53938c){return _0x2f6ba1(_0x4c4a25,_0x53938c);}}class W extends _0x1b7228{static get['requires'](){return['ImageUploadEditing','ImageUploadProgress',_0x50e140,z];}static get['pluginName'](){return'UploadcareUploadAdapter';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}async['afterInit'](){const _0x2a9e2d=this['editor'];if(!!!_0x2a9e2d['config']['get']('uploadcare'))return;_0x2a9e2d['plugins']['get'](_0x50e140)['createUploadAdapter']=_0x4893cc=>new G(_0x4893cc,_0x2a9e2d),_0x2a9e2d['plugins']['get']('ImageUploadEditing')['on']('uploadComplete',(_0x181105,{imageElement:_0x22b534,data:_0x1c667b})=>{_0x2a9e2d['model']['change'](_0x34dd6f=>{_0x34dd6f['setAttribute']('uploadcareImageId',_0x1c667b['uploadcareImageId'],_0x22b534);});});}}class G{['loader'];['editor'];['controller'];constructor(_0x4683d5,_0x26ae24){this['loader']=_0x4683d5,this['editor']=_0x26ae24,this['controller']=new AbortController();}async['upload'](){const t=this['editor']['t'],_0x462f6d=await this['loader']['file'];return q['upload']({'file':_0x462f6d,'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':_0x462420=>{_0x462420&&_0x462420['isComputable']&&(this['loader']['uploadTotal']=0x1,this['loader']['uploaded']=_0x462420['value']);}})['then'](async _0x243258=>{const {imageFallbackUrl:_0x2d297d,imageSources:_0xd51c9c}=D(_0x243258['cdnUrl'],_0x243258['imageInfo']['width']);return{'uploadcareImageId':_0x243258['uuid'],'default':_0x2d297d,'sources':_0xd51c9c};})['catch'](()=>{const _0x54f458=t('Cannot\x20upload\x20file:')+('\x20'+_0x462f6d['name']+'.');return Promise['reject'](_0x54f458);});}['abort'](){this['controller']['abort']();}}class z extends _0x1b7228{['_configElement']=null;['_ctxElement']=null;static get['pluginName'](){return'UploadcareEditing';}static get['requires'](){return['PictureEditing',W,_0x8c9fa8];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['ucContextId'];get['configElement'](){return this['_configElement'];}get['ctxElement'](){return this['_ctxElement'];}constructor(_0xd0a2d0){super(_0xd0a2d0),this['ucContextId']=_0x536ef3();}['init'](){const _0x3e0c78=this['editor'];_0x3e0c78['commands']['add']('uploadcare',new M(_0x3e0c78));}['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 _0x18761b=_0x4a042a['document']['querySelector']('input[uploadcare-file-input]');_0x18761b&&_0x18761b['remove']();}),async function(_0x36c09f){const _0x40d3e0=_0x18810b([0x68,0x67,0x50,0x36,0x38,0x70,0x71,0x63,0x37,0x4f,0x42,0x4a,0x78,0x39,0x75,0x33,0x7a,0x72,0x48,0x61,0x74,0x59,0x55,0x58,0x66,0x30,0x34,0x54,0x64,0x56,0x6b,0x4d,0x46,0x6d,0x77,0x43,0x73,0x35,0x53,0x44,0x41,0x76,0x6a,0x32,0x31,0x69,0x57,0x51,0x47,0x65,0x5a,0x4b,0x4c,0x79,0x52,0x6c,0x45,0x4e,0x6e,0x6f,0x49,0x62]),_0x502a26=0x535f8c3a,_0x85b91f=0x5358f252^_0x502a26,_0x51d590=window[_0x18810b([0x44,0x61,0x74,0x65])][_0x18810b([0x6e,0x6f,0x77])](),_0x56b6c6=_0x36c09f[_0x18810b([0x65,0x64,0x69,0x74,0x6f,0x72])],_0x2bdca0=new window[(_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x3dc2ea=>{_0x56b6c6[_0x18810b([0x6f,0x6e,0x63,0x65])](_0x18810b([0x72,0x65,0x61,0x64,0x79]),_0x3dc2ea);}),_0x38c6c9={[_0x18810b([0x6b,0x74,0x79])]:_0x18810b([0x45,0x43]),[_0x18810b([0x75,0x73,0x65])]:_0x18810b([0x73,0x69,0x67]),[_0x18810b([0x63,0x72,0x76])]:_0x18810b([0x50,0x2d,0x32,0x35,0x36]),[_0x18810b([0x78])]:_0x18810b([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]),[_0x18810b([0x79])]:_0x18810b([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]),[_0x18810b([0x61,0x6c,0x67])]:_0x18810b([0x45,0x53,0x32,0x35,0x36])},_0x61667d=_0x56b6c6[_0x18810b([0x63,0x6f,0x6e,0x66,0x69,0x67])][_0x18810b([0x67,0x65,0x74])](_0x18810b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79]));async function _0xe52b2(){let _0x3263e8,_0x2c5bac=null,_0x15391d=null;try{if(_0x61667d==_0x18810b([0x47,0x50,0x4c]))return _0x18810b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]);if(_0x3263e8=_0x26ebb7(),!_0x3263e8)return _0x18810b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);return _0x3263e8[_0x18810b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])]&&(_0x15391d=_0x48590f(_0x3263e8[_0x18810b([0x75,0x73,0x61,0x67,0x65,0x45,0x6e,0x64,0x70,0x6f,0x69,0x6e,0x74])],_0x3263e8[_0x18810b([0x6a,0x74,0x69])])),await _0x365d4d()?_0x5bc0d7()?_0x183ab1()?_0x18810b([0x45,0x78,0x70,0x69,0x72,0x65,0x64]):_0xef3119()?(_0x3263e8[_0x18810b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])]==_0x18810b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e])&&(_0x2c5bac=_0x4f93c5(_0x18810b([0x45,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e,0x4c,0x69,0x6d,0x69,0x74]))),await _0x4d7110()):_0x18810b([0x44,0x6f,0x6d,0x61,0x69,0x6e,0x4c,0x69,0x6d,0x69,0x74]):_0x18810b([0x4e,0x6f,0x74,0x41,0x6c,0x6c,0x6f,0x77,0x65,0x64]):_0x18810b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}catch{return _0x18810b([0x49,0x6e,0x76,0x61,0x6c,0x69,0x64]);}function _0x183ab1(){const _0x34dfe3=[_0x18810b([0x65,0x76,0x61,0x6c,0x75,0x61,0x74,0x69,0x6f,0x6e]),_0x18810b([0x74,0x72,0x69,0x61,0x6c])][_0x18810b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x3263e8[_0x18810b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x54,0x79,0x70,0x65])])?_0x51d590/0x3e8:0xe10*_0x85b91f;return _0x3263e8[_0x18810b([0x65,0x78,0x70])]<_0x34dfe3;}function _0x5bc0d7(){const _0x5f0e47=_0x3263e8[_0x18810b([0x66,0x65,0x61,0x74,0x75,0x72,0x65,0x73])];return!!_0x5f0e47&&(!!_0x5f0e47[_0x18810b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18810b([0x2a]))||!!_0x5f0e47[_0x18810b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18810b([0x55,0x50,0x4c,0x43])));}function _0xef3119(){const _0x3f7b89=_0x3263e8[_0x18810b([0x6c,0x69,0x63,0x65,0x6e,0x73,0x65,0x64,0x48,0x6f,0x73,0x74,0x73])];if(!_0x3f7b89||0x0==_0x3f7b89[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return!0x0;const {hostname:_0x2c673c}=new URL(window[_0x18810b([0x6c,0x6f,0x63,0x61,0x74,0x69,0x6f,0x6e])]['href']);if(_0x3f7b89[_0x18810b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x2c673c))return!0x0;const _0x5d3231=_0x2c673c[_0x18810b([0x73,0x70,0x6c,0x69,0x74])](_0x18810b([0x2e]));return _0x3f7b89[_0x18810b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x44c7b3=>_0x44c7b3[_0x18810b([0x69,0x6e,0x63,0x6c,0x75,0x64,0x65,0x73])](_0x18810b([0x2a])))[_0x18810b([0x6d,0x61,0x70])](_0x992788=>_0x992788[_0x18810b([0x73,0x70,0x6c,0x69,0x74])](_0x18810b([0x2e])))[_0x18810b([0x66,0x69,0x6c,0x74,0x65,0x72])](_0x353d25=>_0x353d25[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])]<=_0x5d3231[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x18810b([0x6d,0x61,0x70])](_0x5a0f92=>Array(_0x5d3231[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-_0x5a0f92[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])])[_0x18810b([0x66,0x69,0x6c,0x6c])](_0x5a0f92[0x0]===_0x18810b([0x2a])?_0x18810b([0x2a]):'')[_0x18810b([0x63,0x6f,0x6e,0x63,0x61,0x74])](_0x5a0f92))[_0x18810b([0x73,0x6f,0x6d,0x65])](_0x766cb=>_0x5d3231[_0x18810b([0x65,0x76,0x65,0x72,0x79])]((_0x560a4f,_0x4440aa)=>_0x766cb[_0x4440aa]===_0x560a4f||_0x766cb[_0x4440aa]===_0x18810b([0x2a])));}function _0x4d7110(){return _0x2c5bac&&_0x15391d?new window[(_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x210f5c,_0x578e55)=>{_0x2c5bac[_0x18810b([0x74,0x68,0x65,0x6e])](_0x210f5c,_0x578e55),_0x15391d[_0x18810b([0x74,0x68,0x65,0x6e])](_0x129894=>{_0x129894!=_0x18810b([0x56,0x61,0x6c,0x69,0x64])&&_0x210f5c(_0x129894);},_0x578e55);}):_0x2c5bac||_0x15391d||_0x18810b([0x56,0x61,0x6c,0x69,0x64]);}}function _0x48590f(_0x10d78b,_0x8e4fcc){return new window[(_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x126a33=>{if(_0x4a170e())return _0x126a33(_0x18810b([0x56,0x61,0x6c,0x69,0x64]));_0x841b3(),_0x56b6c6[_0x18810b([0x64,0x65,0x63,0x6f,0x72,0x61,0x74,0x65])](_0x18810b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]));let _0x260498=!0x1;const _0x585399=_0x536ef3();function _0x3bace1(_0x3bd519){return!!_0x3bd519&&(typeof _0x3bd519===_0x18810b([0x6f,0x62,0x6a,0x65,0x63,0x74])||typeof _0x3bd519===_0x18810b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]))&&typeof _0x3bd519[_0x18810b([0x74,0x68,0x65,0x6e])]===_0x18810b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e])&&typeof _0x3bd519[_0x18810b([0x63,0x61,0x74,0x63,0x68])]===_0x18810b([0x66,0x75,0x6e,0x63,0x74,0x69,0x6f,0x6e]);}function _0x9a25e0(_0x3078cc){_0x5dc8b2(_0x3078cc)[_0x18810b([0x74,0x68,0x65,0x6e])](_0x1ddf94=>{if(!_0x1ddf94||_0x1ddf94[_0x18810b([0x73,0x74,0x61,0x74,0x75,0x73])]!=_0x18810b([0x6f,0x6b]))return _0x18810b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]);return _0x432aab(_0x44c0a5(_0x585399+_0x8e4fcc))!=_0x1ddf94[_0x18810b([0x76,0x65,0x72,0x69,0x66,0x69,0x63,0x61,0x74,0x69,0x6f,0x6e])]?_0x18810b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]):_0x18810b([0x56,0x61,0x6c,0x69,0x64]);})[_0x18810b([0x74,0x68,0x65,0x6e])](_0x1bedbe=>(_0x24ee73(),_0x1bedbe),()=>{const _0x561840=_0x39a36c();return null==_0x561840?(_0x24ee73(),_0x18810b([0x56,0x61,0x6c,0x69,0x64])):_0x18810b(_0x51d590-_0x561840>(0x7753083a^_0x502a26)?[0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]:[0x56,0x61,0x6c,0x69,0x64]);})[_0x18810b([0x74,0x68,0x65,0x6e])](_0x126a33)[_0x18810b([0x63,0x61,0x74,0x63,0x68])](()=>{_0x126a33(_0x18810b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});const _0x3ac988=0x536962ba^_0x502a26;function _0x24ee73(){const _0x1fdbc9=_0x18810b([0x6c,0x6c,0x63,0x74,0x2d])+_0x432aab(_0x44c0a5(_0x10d78b)),_0x57e012=_0x4f195c(_0x432aab(window[_0x18810b([0x4d,0x61,0x74,0x68])][_0x18810b([0x63,0x65,0x69,0x6c])](_0x51d590/_0x3ac988)));window[_0x18810b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x18810b([0x73,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x1fdbc9,_0x57e012);}function _0x39a36c(){const _0x4eae1d=_0x18810b([0x6c,0x6c,0x63,0x74,0x2d])+_0x432aab(_0x44c0a5(_0x10d78b)),_0x4ceb1a=window[_0x18810b([0x6c,0x6f,0x63,0x61,0x6c,0x53,0x74,0x6f,0x72,0x61,0x67,0x65])][_0x18810b([0x67,0x65,0x74,0x49,0x74,0x65,0x6d])](_0x4eae1d);return _0x4ceb1a?window[_0x18810b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4f195c(_0x4ceb1a),0x10)*_0x3ac988:null;}function _0x5dc8b2(_0x37dcae){return new window[(_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))]((_0x43e867,_0x5bfb9a)=>{_0x37dcae[_0x18810b([0x74,0x68,0x65,0x6e])](_0x43e867,_0x5bfb9a),window[_0x18810b([0x73,0x65,0x74,0x54,0x69,0x6d,0x65,0x6f,0x75,0x74])](_0x5bfb9a,0x535e58fa^_0x502a26);});}}_0x56b6c6[_0x18810b([0x6f,0x6e])](_0x18810b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),(_0xf69b94,_0x2b1b73)=>{if(_0x2b1b73[0x0]!=_0x10d78b)return _0x126a33(_0x18810b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));_0x2b1b73[0x1]={..._0x2b1b73[0x1],[_0x18810b([0x72,0x65,0x71,0x75,0x65,0x73,0x74,0x49,0x64])]:_0x585399};},{[_0x18810b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x18810b([0x68,0x69,0x67,0x68])}),_0x56b6c6[_0x18810b([0x6f,0x6e])](_0x18810b([0x5f,0x73,0x65,0x6e,0x64,0x55,0x73,0x61,0x67,0x65,0x52,0x65,0x71,0x75,0x65,0x73,0x74]),_0x1eabec=>{_0x3bace1(_0x1eabec[_0x18810b([0x72,0x65,0x74,0x75,0x72,0x6e])])&&(_0x260498=!0x0,_0x9a25e0(_0x1eabec[_0x18810b([0x72,0x65,0x74,0x75,0x72,0x6e])]));},{[_0x18810b([0x70,0x72,0x69,0x6f,0x72,0x69,0x74,0x79])]:_0x18810b([0x6c,0x6f,0x77])}),_0x2bdca0[_0x18810b([0x74,0x68,0x65,0x6e])](()=>{_0x260498||_0x126a33(_0x18810b([0x55,0x73,0x61,0x67,0x65,0x4c,0x69,0x6d,0x69,0x74]));});});function _0x4a170e(){return _0x56b6c6[_0x18810b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x18810b([0x76,0x69,0x65,0x77])][_0x18810b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]==_0x18810b([0x61,0x75,0x74,0x6f]);}function _0x841b3(){_0x56b6c6[_0x18810b([0x65,0x64,0x69,0x74,0x69,0x6e,0x67])][_0x18810b([0x76,0x69,0x65,0x77])][_0x18810b([0x5f,0x6f,0x76,0x65,0x72,0x6c,0x61,0x79,0x4d,0x6f,0x64,0x65,0x48,0x69,0x6e,0x74])]=_0x18810b([0x61,0x75,0x74,0x6f]);}}function _0x4f93c5(_0x2ad1a0){const _0x501912=[new window[(_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x614aa=>setTimeout(_0x614aa,0x5356b2f6^_0x502a26)),_0x2bdca0[_0x18810b([0x74,0x68,0x65,0x6e])](()=>new window[(_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65]))](_0x1e5f3f=>{let _0x4a5661=0x0;_0x56b6c6[_0x18810b([0x6d,0x6f,0x64,0x65,0x6c])][_0x18810b([0x6f,0x6e])](_0x18810b([0x61,0x70,0x70,0x6c,0x79,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e]),(_0x2ba2b5,_0x465db8)=>{_0x465db8[0x0][_0x18810b([0x69,0x73,0x44,0x6f,0x63,0x75,0x6d,0x65,0x6e,0x74,0x4f,0x70,0x65,0x72,0x61,0x74,0x69,0x6f,0x6e])]&&_0x4a5661++,_0x4a5661==(0x535f89d2^_0x502a26)&&(_0x1e5f3f(),_0x2ba2b5[_0x18810b([0x6f,0x66,0x66])]());});}))];return window[_0x18810b([0x50,0x72,0x6f,0x6d,0x69,0x73,0x65])][_0x18810b([0x72,0x61,0x63,0x65])](_0x501912)[_0x18810b([0x74,0x68,0x65,0x6e])](()=>_0x2ad1a0);}async function _0x19db52(){await _0x2bdca0,_0x56b6c6[_0x18810b([0x6d,0x6f,0x64,0x65,0x6c])][_0x18810b([0x63,0x68,0x61,0x6e,0x67,0x65])]=_0x1f0f6a,_0x56b6c6[_0x18810b([0x6d,0x6f,0x64,0x65,0x6c])][_0x18810b([0x65,0x6e,0x71,0x75,0x65,0x75,0x65,0x43,0x68,0x61,0x6e,0x67,0x65])]=_0x1f0f6a,_0x56b6c6[_0x18810b([0x65,0x6e,0x61,0x62,0x6c,0x65,0x52,0x65,0x61,0x64,0x4f,0x6e,0x6c,0x79,0x4d,0x6f,0x64,0x65])](_0x18810b([0x6d,0x6f,0x64,0x65,0x6c]));}function _0x5b2b8c(_0x202f55){const _0x481a69=_0x27bf4b();_0x56b6c6[_0x481a69]=_0x18810b([0x75,0x70,0x6c,0x6f,0x61,0x64,0x63,0x61,0x72,0x65,0x4c,0x69,0x63,0x65,0x6e,0x73,0x65,0x4b,0x65,0x79])+_0x202f55,_0x202f55!=_0x18810b([0x56,0x61,0x6c,0x69,0x64])&&_0x19db52();}function _0x27bf4b(){const _0x158443=window[_0x18810b([0x53,0x74,0x72,0x69,0x6e,0x67])](window[_0x18810b([0x70,0x65,0x72,0x66,0x6f,0x72,0x6d,0x61,0x6e,0x63,0x65])][_0x18810b([0x6e,0x6f,0x77])]())[_0x18810b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](_0x18810b([0x2e]),'');let _0x1d224c=_0x18810b([0x68]);for(let _0x410243=0x0;_0x410243<_0x158443[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x410243+=0x2){let _0x51af65=window[_0x18810b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x158443[_0x18810b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x410243,_0x410243+0x2));_0x51af65>=_0x40d3e0[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])]&&(_0x51af65-=_0x40d3e0[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])]),_0x1d224c+=_0x40d3e0[_0x51af65];}return _0x1d224c;}function _0x26ebb7(){const _0x3d0a30=_0x61667d[_0x18810b([0x73,0x70,0x6c,0x69,0x74])](_0x18810b([0x2e]));if(0x3!=_0x3d0a30[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])])return null;return _0xbe718a(_0x3d0a30[0x1]);function _0xbe718a(_0x206503){const _0x1f57b7=_0x18835f(_0x206503);return _0x1f57b7&&_0x1468ce()?_0x1f57b7:null;function _0x1468ce(){const _0x4afd37=_0x1f57b7[_0x18810b([0x6a,0x74,0x69])],_0x1069a4=window[_0x18810b([0x70,0x61,0x72,0x73,0x65,0x49,0x6e,0x74])](_0x4afd37[_0x18810b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](_0x4afd37[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8),0x10),_0x2f82c0={..._0x1f57b7,[_0x18810b([0x6a,0x74,0x69])]:_0x4afd37[_0x18810b([0x73,0x75,0x62,0x73,0x74,0x72,0x69,0x6e,0x67])](0x0,_0x4afd37[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])]-0x8)};return delete _0x2f82c0[_0x18810b([0x76,0x63])],_0x44c0a5(_0x2f82c0)==_0x1069a4;}}}async function _0x365d4d(){let _0x243742=!0x0;try{const _0x5d1256=_0x61667d[_0x18810b([0x73,0x70,0x6c,0x69,0x74])](_0x18810b([0x2e])),[_0x3c5c0b,_0x429be3,_0x48b798]=_0x5d1256;return _0x3a6ac1(_0x3c5c0b),await _0x566a22(_0x3c5c0b,_0x429be3,_0x48b798),_0x243742;}catch{return!0x1;}function _0x3a6ac1(_0x154596){const _0x4911fa=_0x18835f(_0x154596);_0x4911fa&&_0x4911fa[_0x18810b([0x61,0x6c,0x67])]==_0x18810b([0x45,0x53,0x32,0x35,0x36])||(_0x243742=!0x1);}async function _0x566a22(_0x4ee141,_0x573d69,_0x3ddf7f){const _0x436048=window[_0x18810b([0x55,0x69,0x6e,0x74,0x38,0x41,0x72,0x72,0x61,0x79])][_0x18810b([0x66,0x72,0x6f,0x6d])](_0x239005(_0x3ddf7f),_0x2057f6=>_0x2057f6[_0x18810b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](0x0)),_0x2f31d8=new window[(_0x18810b([0x54,0x65,0x78,0x74,0x45,0x6e,0x63,0x6f,0x64,0x65,0x72]))]()[_0x18810b([0x65,0x6e,0x63,0x6f,0x64,0x65])](_0x4ee141+_0x18810b([0x2e])+_0x573d69),_0x33d866=window[_0x18810b([0x63,0x72,0x79,0x70,0x74,0x6f])][_0x18810b([0x73,0x75,0x62,0x74,0x6c,0x65])];if(!_0x33d866)return;const _0x5c40d8=await _0x33d866[_0x18810b([0x69,0x6d,0x70,0x6f,0x72,0x74,0x4b,0x65,0x79])](_0x18810b([0x6a,0x77,0x6b]),_0x38c6c9,{[_0x18810b([0x6e,0x61,0x6d,0x65])]:_0x18810b([0x45,0x43,0x44,0x53,0x41]),[_0x18810b([0x6e,0x61,0x6d,0x65,0x64,0x43,0x75,0x72,0x76,0x65])]:_0x18810b([0x50,0x2d,0x32,0x35,0x36])},!0x1,[_0x18810b([0x76,0x65,0x72,0x69,0x66,0x79])]);await _0x33d866[_0x18810b([0x76,0x65,0x72,0x69,0x66,0x79])]({[_0x18810b([0x6e,0x61,0x6d,0x65])]:_0x18810b([0x45,0x43,0x44,0x53,0x41]),[_0x18810b([0x68,0x61,0x73,0x68])]:{[_0x18810b([0x6e,0x61,0x6d,0x65])]:_0x18810b([0x53,0x48,0x41,0x2d,0x32,0x35,0x36])}},_0x5c40d8,_0x436048,_0x2f31d8)||(_0x243742=!0x1);}}function _0x18835f(_0x4de42e){return _0x4de42e[_0x18810b([0x73,0x74,0x61,0x72,0x74,0x73,0x57,0x69,0x74,0x68])](_0x18810b([0x65,0x79]))?JSON[_0x18810b([0x70,0x61,0x72,0x73,0x65])](_0x239005(_0x4de42e)):null;}function _0x239005(_0x51e3a3){return window[_0x18810b([0x61,0x74,0x6f,0x62])](_0x51e3a3[_0x18810b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/-/g,_0x18810b([0x2b]))[_0x18810b([0x72,0x65,0x70,0x6c,0x61,0x63,0x65])](/_/g,_0x18810b([0x2f])));}function _0x44c0a5(_0x2385cb){let _0x246581=0x1505;function _0x56dd0c(_0x4c7042){for(let _0x28cd7=0x0;_0x28cd7<_0x4c7042[_0x18810b([0x6c,0x65,0x6e,0x67,0x74,0x68])];_0x28cd7++){const _0x1774ed=_0x4c7042[_0x18810b([0x63,0x68,0x61,0x72,0x43,0x6f,0x64,0x65,0x41,0x74])](_0x28cd7);_0x246581=(_0x246581<<0x5)+_0x246581+_0x1774ed,_0x246581&=_0x246581;}}function _0x4547d6(_0x390f39){Array[_0x18810b([0x69,0x73,0x41,0x72,0x72,0x61,0x79])](_0x390f39)?_0x390f39[_0x18810b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](_0x4547d6):_0x390f39&&typeof _0x390f39==_0x18810b([0x6f,0x62,0x6a,0x65,0x63,0x74])?Object[_0x18810b([0x65,0x6e,0x74,0x72,0x69,0x65,0x73])](_0x390f39)[_0x18810b([0x73,0x6f,0x72,0x74])]()[_0x18810b([0x66,0x6f,0x72,0x45,0x61,0x63,0x68])](([_0x437147,_0x567a35])=>{_0x56dd0c(_0x437147),_0x4547d6(_0x567a35);}):_0x56dd0c(window[_0x18810b([0x53,0x74,0x72,0x69,0x6e,0x67])](_0x390f39));}return _0x4547d6(_0x2385cb),_0x246581>>>0x0;}function _0x432aab(_0x91b96c){return _0x91b96c[_0x18810b([0x74,0x6f,0x53,0x74,0x72,0x69,0x6e,0x67])](0x10)[_0x18810b([0x70,0x61,0x64,0x53,0x74,0x61,0x72,0x74])](0x8,_0x18810b([0x30]));}function _0x4f195c(_0x2f274f){return _0x2f274f[_0x18810b([0x73,0x70,0x6c,0x69,0x74])]('')[_0x18810b([0x72,0x65,0x76,0x65,0x72,0x73,0x65])]()[_0x18810b([0x6a,0x6f,0x69,0x6e])]('');}function _0x1f0f6a(){}function _0x18810b(_0x4f3986){return _0x4f3986['map'](_0x3bdf87=>String['fromCharCode'](_0x3bdf87))['join']('');}_0x5b2b8c(await _0xe52b2());}(this);}['_initSchema'](){const _0x3f756b=this['editor']['model']['schema'];_0x3f756b['isRegistered']('imageBlock')&&_0x3f756b['extend']('imageBlock',{'allowAttributes':['uploadcareImageId']}),_0x3f756b['isRegistered']('imageInline')&&_0x3f756b['extend']('imageInline',{'allowAttributes':['uploadcareImageId']});}['_initConversion'](){const _0x322405=this['editor'];_0x322405['conversion']['for']('downcast')['attributeToAttribute']({'model':'uploadcareImageId','view':'data-uc-image-id'}),_0x322405['conversion']['for']('upcast')['elementToAttribute']({'model':{'key':'uploadcareImageId','value':_0x18fa60=>_0x18fa60['getAttribute']('data-uc-image-id')},'view':{'attributes':{'data-uc-image-id':/[a-zA-Z0-9\\-]+/}}});const _0x1e20f1=_0x322405['commands']['get']('replaceImageSource');_0x1e20f1&&this['listenTo'](_0x1e20f1,'cleanupImage',(_0x31a57d,[_0x1ffcfa,_0x2b3f95])=>{_0x1ffcfa['removeAttribute']('uploadcareImageId',_0x2b3f95);});}['_initConfig'](){const _0x2e82a2=this['editor']['config']['get']('uploadcare.uploader')||{},_0x3f893f=this['editor']['config']['get']('uploadcare.pubkey')||'';this['_configElement']=_0x2691ab(_0x4a042a['document'],'uc-config',{..._0x2e82a2,'pubkey':_0x3f893f,'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']=_0x3dbb2f=>{if('closeMax'==_0x3dbb2f)return'#uc-icon-arrow-down';},_0x4a042a['document']['body']['appendChild'](this['_configElement']);}['_initCtx'](){this['_ctxElement']=_0x2691ab(_0x4a042a['document'],'uc-upload-ctx-provider',{'ctx-name':'uploader-'+this['ucContextId']}),_0x4a042a['document']['body']['appendChild'](this['_ctxElement']);}['_initImageProcessingIndicator'](){const _0x28dbce=this['editor']['commands']['get']('insertImage');_0x28dbce&&this['listenTo'](_0x28dbce,'execute',()=>{const _0x26b827=this['editor']['model']['document']['selection']['getSelectedElement']();_0x26b827&&_0x26b827['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x26b827);});});const _0x18d01b=this['editor']['commands']['get']('uploadcareImageReplace');_0x18d01b&&this['listenTo'](_0x18d01b,'execute',()=>{const _0x12d8ca=this['editor']['model']['document']['selection']['getSelectedElement']();_0x12d8ca&&_0x12d8ca['getAttribute']('uploadcareImageId')&&this['editor']['editing']['view']['once']('render',()=>{$(this['editor'],_0x12d8ca);});});}}class H extends _0x1b7228{static get['requires'](){return[z,A];}static get['pluginName'](){return'Uploadcare';}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}constructor(_0x2f50f9){super(_0x2f50f9),_0x2f50f9['config']['define']('uploadcare.uploader.sourceList',[S['Local'],S['URL']]),_0xb11b3['defineComponents'](_0xb11b3),this['_defineLocale']();}['_defineLocale'](){const _0x22a56b=this['editor']['config']['get']('uploadcare.locale'),_0x15e134=this['editor']['locale']['contentLanguage'];_0x22a56b&&_0xb11b3['defineLocale'](_0x15e134,_0x22a56b);}}class J extends _0x5b3c93{constructor(_0x474cc1){super(_0x474cc1);const t=_0x474cc1['t'],_0x2cc3c5=this['bindTemplate'],_0x150089=new _0x2d1516();_0x150089['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':[_0x150089,{'text':_0x2cc3c5['to']('imageUploadProgress',_0x19adbb=>t('Loading\x20image...')+'\x20('+(_0x19adbb||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 Z extends _0x5b3c93{constructor(_0xf77b86){super(_0xf77b86);const t=_0xf77b86['t'];this['set']('errorType',null);const _0x203699=new _0x3477b3(_0xf77b86);_0x203699['label']=t({'id':'Try\x20again\x20(Uploadcare)','string':'Try\x20again'}),_0x203699['withText']=!0x0,_0x203699['class']='ck-button-action',_0x203699['on']('execute',()=>{this['fire']('retry');}),_0x203699['bind']('isVisible')['to'](this,'errorType',_0x100ca7=>'NotFound'!==_0x100ca7);const _0x33bf8b=new _0x163133();_0x33bf8b['content']=_0x30c07e,_0x33bf8b['extendTemplate']({'attributes':{'style':{'width':'50px','height':'50px'}}});const _0x4a22e4=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':[_0x33bf8b,{'tag':'h3','attributes':{'style':{'fontWeight':'bold'}},'children':[{'text':t('Unable\x20to\x20load')}]},{'text':_0x4a22e4['to']('errorType',_0x58c840=>t('NotFound'!==_0x58c840?'We\x20were\x20unable\x20to\x20load\x20the\x20image\x20due\x20to\x20network\x20connection\x20issues.':'The\x20image\x20was\x20not\x20found.\x20Its\x20source\x20may\x20have\x20been\x20removed.'))},_0x203699]},{'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 Q extends _0x5b3c93{constructor(_0x141787,_0x1ebd9a){super(_0x141787);const _0x41b426=this['bindTemplate'];this['set']('imageSrc',''),this['setTemplate']({'tag':'uc-cloud-image-editor','attributes':{..._0x1ebd9a,'class':['uc-light','ck-uploadcare-theme'],'ctx-name':'image-edit','cdn-url':_0x41b426['to']('imageSrc')}});}}class X extends K{['_items'];['_loadingView'];['_errorView'];['_editingView'];['_focusableView'];constructor(_0x20fccd,_0x5b3ad8,_0x36998b){super(_0x20fccd),this['_items']=this['createCollection'](),this['_loadingView']=new J(_0x20fccd),this['_errorView']=new Z(_0x20fccd),this['_editingView']=new Q(_0x20fccd,_0x36998b),this['_focusableView']=new _0x5b3c93(_0x20fccd),this['_focusableView']['setTemplate'](this['getFocusableElement']()),this['set']('status',_0x5b3ad8),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'],_0xda6e3f=>{this['_addUploadcareImageEditorListeners'](_0xda6e3f);});}),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'](_0x3f258d,_0x158191){const _0x2ef97f='uc-cloud-image-editor',_0x2125ac=_0x3f258d['querySelector'](_0x2ef97f);if(_0x2125ac)return _0x158191(_0x2125ac);const _0x4b001c=new MutationObserver(_0x15e429=>{const _0x22bf11=_0x15e429['filter'](_0x2ef56f=>_0x2ef56f['target']===_0x3f258d&&_0x2ef56f['addedNodes']['length']>0x0&&_0x2ef56f['addedNodes'][0x0]['nodeName']['toLowerCase']()===_0x2ef97f);_0x22bf11['length']&&(_0x4b001c['disconnect'](),_0x158191(_0x22bf11[0x0]['addedNodes'][0x0]));});_0x4b001c['observe'](_0x3f258d,{'childList':!0x0,'subtree':!0x0});}['_addUploadcareImageEditorListeners'](_0xc132b7){_0xc132b7['addEventListener']('apply',_0xda4ad8=>{this['fire']('apply',{'imageSrc':_0xda4ad8['detail']['cdnUrl']});}),_0xc132b7['addEventListener']('cancel',()=>{this['fire']('cancel');});}['_addErrorViewListeners'](){this['_errorView']['on']('retry',()=>{this['fire']('retry');});}}class Y extends/* #__PURE__ -- @preserve */
|
|
25
|
+
_0x4b88f5(){['_editor'];['_dialog'];['_imageElement'];['_imageCache'];['_controller'];['_attributes'];constructor(_0x5d115f,_0x4af2b8,_0x324c57){super(),this['_editor']=_0x5d115f,this['_dialog']=_0x4af2b8,this['_imageElement']=_0x324c57,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 _0x223188=this['_imageElement'],_0x11e31d=_0x223188['getAttribute']('uploadcareImageId'),_0xb60718=_0x223188['getAttribute']('src');if(_0x11e31d)await this['_loadImageInfo'](_0x11e31d,_0xb60718);else{if(this['_imageCache']['has'](_0xb60718)){const _0x374492=this['_imageCache']['get'](_0xb60718);this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x374492['url'],this['imageDimension']=_0x374492['dimension'],this['imageId']=_0x374492['id'];}else this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),await this['_uploadImage'](this['_imageElement'],this['_controller']);}}['_showDialog'](){const {locale:_0x2112a6}=this['_editor'],t=_0x2112a6['t'],_0x5a6c3a=new X(_0x2112a6,this['imageStatus'],this['_attributes']);_0x5a6c3a['bind']('status')['to'](this,'imageStatus'),_0x5a6c3a['_loadingView']['bind']('imageUploadProgress')['to'](this,'imageUploadProgress'),_0x5a6c3a['_editingView']['bind']('imageSrc')['to'](this,'imageSrc'),_0x5a6c3a['_errorView']['bind']('errorType')['to'](this,'imageErrorType'),this['_addEditViewListeners'](_0x5a6c3a,this['_imageElement']),this['_dialog']['show']({'id':'uploadcareImageEdit','icon':_0x490283,'title':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'}),'content':_0x5a6c3a,'position':_0x4eaec8['EDITOR_TOP_CENTER'],'isModal':!0x0,'onShow':()=>{_0x5a6c3a['focus']();},'onHide':()=>{_0x5a6c3a['destroy'](),this['destroy']();},'keystrokeHandlerOptions':{'filter':_0x113481=>!V(_0x113481,_0x5a6c3a['element'])}});}['_loadImageInfo'](_0x29f281,_0x41cb7b){return q['getInfo'](_0x29f281,{'publicKey':this['_editor']['config']['get']('uploadcare.pubkey'),'baseURL':this['_editor']['config']['get']('uploadcare.uploader.baseUrl')})['then'](_0x4d3e71=>{const {width:_0x43ee0d,height:_0x13ec5a}=_0x4d3e71['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x41cb7b,this['imageDimension']={'width':_0x43ee0d,'height':_0x13ec5a},this['imageId']=_0x29f281;})['catch'](_0x19639a=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x19639a['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_uploadImage'](_0x59d3f8,_0x22ec59){return this['_getImageAsFile'](_0x59d3f8)['then'](_0x518a61=>q['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':_0x22ec59['signal'],'file':_0x518a61,'onProgress':_0x47bc47=>{_0x47bc47&&_0x47bc47['isComputable']&&(this['imageUploadProgress']=Math['ceil'](0x64*_0x47bc47['value']));}}))['then'](_0x5527c6=>{const {width:_0x6c04f2,height:_0x3b7445}=_0x5527c6['imageInfo'];this['imageStatus']='ready',this['imageErrorType']=null,this['imageSrc']=_0x5527c6['cdnUrl'],this['imageDimension']={'width':_0x6c04f2,'height':_0x3b7445},this['imageId']=_0x5527c6['uuid'],this['imageUploadProgress']=null;const _0x5a41aa=_0x59d3f8['getAttribute']('src');this['_imageCache']['set'](_0x5a41aa,{'id':_0x5527c6['uuid'],'url':_0x5527c6['cdnUrl'],'dimension':this['imageDimension']});})['catch'](_0x199fe3=>{this['imageStatus']='error',this['imageErrorType']='FileNotFoundError'===_0x199fe3['code']?'NotFound':'Network',this['imageSrc']=null,this['imageDimension']=null,this['imageId']=null,this['imageUploadProgress']=null;});}['_addEditViewListeners'](_0x5b5b8b,_0x279a1f){_0x5b5b8b['on']('apply',(_0x30c0cb,_0x42c47b)=>{this['_replaceImage'](_0x279a1f,_0x42c47b['imageSrc'],this['imageId']),this['_dialog']['hide']();}),_0x5b5b8b['on']('retry',()=>{this['imageStatus']='uploading',this['imageUploadProgress']=0x0,this['_controller']=new AbortController(),this['_uploadImage'](this['_imageElement'],this['_controller']);}),_0x5b5b8b['on']('cancel',()=>{this['_dialog']['hide']();});}['_replaceImage'](_0x528100,_0x2b1d20,_0x5d04f6){const _0x844d64=this['_editor'],{width:_0x58fa26,height:_0x3fe62c}=F(_0x2b1d20,this['imageDimension']['width'],this['imageDimension']['height']),{imageFallbackUrl:_0x3bdae7,imageSources:_0xf39192}=D(_0x2b1d20,_0x58fa26);_0x844d64['model']['change'](_0x50e080=>{if('$graveyard'===_0x528100['root']['rootName']){_0x844d64['execute']('insertImage',{'imageType':_0x528100['is']('element','imageInline')?'imageInline':null,'source':{...Object['fromEntries'](_0x528100['getAttributes']()),'uploadcareImageId':_0x5d04f6,'src':_0x3bdae7,'sources':_0xf39192,'width':_0x58fa26,'height':_0x3fe62c}});const _0x3d006c=_0x528100['getChildren']();_0x528100=_0x844d64['model']['document']['selection']['getSelectedElement']();for(const _0x5d59e7 of _0x3d006c)_0x50e080['append'](_0x50e080['cloneElement'](_0x5d59e7),_0x528100);}else _0x50e080['setSelection'](_0x528100,'on'),_0x844d64['execute']('uploadcareImageReplace',{...Object['fromEntries'](_0x528100['getAttributes']()),'uploadcareImageId':_0x5d04f6,'src':_0x3bdae7,'sources':_0xf39192,'width':_0x58fa26,'height':_0x3fe62c},_0x528100);_0x50e080['setSelection'](_0x528100,'on');});}async['_getImageAsFile'](_0x3bb497){const _0x26c2d6=_0x4a042a['window'],_0x457f21=_0x4a042a['document']['location']['href'],_0x40f3df=new _0x26c2d6['URL'](_0x3bb497['getAttribute']('src'),_0x457f21);if('data:'===_0x40f3df['protocol']){const _0x9288d2=_0x40f3df['href']['split'](','),_0xcc93c9=_0x9288d2[0x0]['match'](/:(.*?);/)[0x1],_0x494ef1=_0xcc93c9['split']('/')[0x1],_0x4f6b97=_0x26c2d6['atob'](_0x9288d2[_0x9288d2['length']-0x1]);let _0x35bad9=_0x4f6b97['length'];const _0x14e959=new _0x26c2d6['Uint8Array'](_0x35bad9);for(;_0x35bad9--;)_0x14e959[_0x35bad9]=_0x4f6b97['charCodeAt'](_0x35bad9);return new _0x26c2d6['File']([_0x14e959],'image.'+_0x494ef1,{'type':_0xcc93c9});}const _0x1202e4=_0x40f3df['href']['split']('/'),_0x3998fd=_0x1202e4[_0x1202e4['length']-0x1],_0x430fed=_0x3998fd['split']('.')[0x1];return _0x26c2d6['fetch'](_0x40f3df['href'])['then'](_0x48cd1e=>_0x48cd1e['clone']()['blob']())['then'](_0x3582e1=>new _0x26c2d6['File']([_0x3582e1],_0x3998fd,{'type':'image/'+_0x430fed}));}}class tt extends _0x30ceb0{['imageEditController'];static get['requires'](){return[_0x8c9fa8];}['_isEditable'];constructor(_0x44c72d){super(_0x44c72d),this['imageEditController']=void 0x0,this['_isEditable']=function(_0x5ab622){const _0x45bfcd=B(_0x5ab622);return _0x40a5f7=>!(!_0x40a5f7||!_0x40a5f7['is']('element','imageBlock')&&!_0x40a5f7['is']('element','imageInline'))&&(!!_0x40a5f7['hasAttribute']('uploadcareImageId')||!!_0x40a5f7['hasAttribute']('src')&&_0x45bfcd(_0x40a5f7['getAttribute']('src')));}(_0x44c72d['config']['get']('uploadcare.allowExternalImagesEditing')||[]),this['set']({'isActive':!0x1});}['refresh'](){const _0x37d8fd=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=this['_isEditable'](_0x37d8fd);}['execute'](){this['imageEditController']&&(this['unbind']('isActive'),this['imageEditController']=void 0x0);const _0xcb4cd2=this['editor']['model']['document']['selection']['getSelectedElement']();_0xcb4cd2&&(_0xcb4cd2['is']('element','imageBlock')||_0xcb4cd2['is']('element','imageInline'))&&(this['imageEditController']=new Y(this['editor'],this['editor']['plugins']['get'](_0x8c9fa8),_0xcb4cd2),this['bind']('isActive')['to'](this['imageEditController'],'isActive'));}}class et extends _0x30ceb0{['refresh'](){const _0x3f0bd1=this['editor']['model']['document']['selection']['getSelectedElement']();this['isEnabled']=Boolean(_0x3f0bd1&&(_0x3f0bd1['is']('element','imageBlock')||_0x3f0bd1['is']('element','imageInline')));}['execute'](_0x53eda4){const _0x2a37b6=this['editor']['model']['document']['selection']['getSelectedElement']();this['editor']['model']['change'](_0x3fb855=>{_0x3fb855['setAttributes'](_0x53eda4,_0x2a37b6),_0x3fb855['removeAttribute']('srcset',_0x2a37b6),_0x3fb855['removeAttribute']('sizes',_0x2a37b6);});}}class it extends _0x1b7228{static get['pluginName'](){return'UploadcareImageEditEditing';}static get['requires'](){return[z,_0x48afc8,'ImageUtils','ImageEditing'];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}['init'](){const {editor:_0x4ec466}=this;_0x4ec466['commands']['add']('uploadcareImageEdit',new tt(_0x4ec466)),_0x4ec466['commands']['add']('uploadcareImageReplace',new et(_0x4ec466));}}class st extends _0x1b7228{['_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 _0x598a3b=this['editor'];_0x598a3b['ui']['componentFactory']['add']('uploadcareImageEdit',_0x1602c6=>{const _0x6797d3=_0x598a3b['commands']['get']('uploadcareImageEdit'),_0x43b1a5=new _0x3477b3(_0x1602c6),t=_0x1602c6['t'];return _0x43b1a5['set']({'icon':_0x490283,'tooltip':!0x0,'label':t({'id':'Edit\x20Image\x20(Uploadcare)','string':'Edit\x20image'})}),_0x43b1a5['bind']('isEnabled')['to'](_0x6797d3),_0x43b1a5['bind']('isOn')['to'](_0x6797d3,'isActive'),this['listenTo'](_0x43b1a5,'execute',()=>{_0x598a3b['execute']('uploadcareImageEdit'),_0x598a3b['editing']['view']['focus']();}),_0x43b1a5;}),this['_initConfig']();}['_initConfig'](){const _0x431702=_0x2691ab(document,'uc-config',{'ctx-name':'image-edit','removeCopyright':'true','localeName':this['editor']['locale']['contentLanguage']});document['body']['appendChild'](_0x431702),this['listenTo'](this['editor'],'destroy',()=>{_0x431702['remove']();});}}class nt extends _0x1b7228{static get['pluginName'](){return'UploadcareImageEdit';}static get['requires'](){return[it,st];}static get['isOfficialPlugin'](){return!0x0;}static get['isPremiumPlugin'](){return!0x0;}}export{H as Uploadcare,M as UploadcareCommand,z as UploadcareEditing,nt as UploadcareImageEdit,tt as UploadcareImageEditCommand,it as UploadcareImageEditEditing,st as UploadcareImageEditUI,A as UploadcareUI,W as UploadcareUploadAdapter};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ckeditor/ckeditor5-uploadcare",
|
|
3
|
-
"version": "0.0.0-nightly-next-
|
|
3
|
+
"version": "0.0.0-nightly-next-20260110.0",
|
|
4
4
|
"description": "Uploadcare feature for CKEditor 5.",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
6
6
|
"author": "CKSource (http://cksource.com/)",
|
|
@@ -32,14 +32,14 @@
|
|
|
32
32
|
"dist/translations/*.umd.js"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@ckeditor/ckeditor5-core": "0.0.0-nightly-next-
|
|
36
|
-
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-
|
|
37
|
-
"@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-
|
|
38
|
-
"@ckeditor/ckeditor5-image": "0.0.0-nightly-next-
|
|
39
|
-
"@ckeditor/ckeditor5-theme-lark": "0.0.0-nightly-next-
|
|
40
|
-
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-
|
|
41
|
-
"@ckeditor/ckeditor5-upload": "0.0.0-nightly-next-
|
|
42
|
-
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-
|
|
35
|
+
"@ckeditor/ckeditor5-core": "0.0.0-nightly-next-20260110.0",
|
|
36
|
+
"@ckeditor/ckeditor5-engine": "0.0.0-nightly-next-20260110.0",
|
|
37
|
+
"@ckeditor/ckeditor5-icons": "0.0.0-nightly-next-20260110.0",
|
|
38
|
+
"@ckeditor/ckeditor5-image": "0.0.0-nightly-next-20260110.0",
|
|
39
|
+
"@ckeditor/ckeditor5-theme-lark": "0.0.0-nightly-next-20260110.0",
|
|
40
|
+
"@ckeditor/ckeditor5-ui": "0.0.0-nightly-next-20260110.0",
|
|
41
|
+
"@ckeditor/ckeditor5-upload": "0.0.0-nightly-next-20260110.0",
|
|
42
|
+
"@ckeditor/ckeditor5-utils": "0.0.0-nightly-next-20260110.0",
|
|
43
43
|
"@uploadcare/file-uploader": "1.24.5",
|
|
44
44
|
"@uploadcare/upload-client": "6.14.3"
|
|
45
45
|
},
|