UNPKG

@picoxr/web-cli-core

Version:

Core Library to generate, build and sign TWA projects

1 lines 16.7 kB
'use strict';const _0x412733=_0x2dc6;(function(_0x11ddcc,_0x1f8915){const _0x180843=_0x2dc6,_0x2fe1a3=_0x11ddcc();while(!![]){try{const _0x121e8f=parseInt(_0x180843(0x126))/0x1+-parseInt(_0x180843(0xf3))/0x2+parseInt(_0x180843(0xf0))/0x3*(parseInt(_0x180843(0x119))/0x4)+-parseInt(_0x180843(0xdd))/0x5+-parseInt(_0x180843(0xe4))/0x6*(-parseInt(_0x180843(0x123))/0x7)+parseInt(_0x180843(0xf7))/0x8*(-parseInt(_0x180843(0xea))/0x9)+parseInt(_0x180843(0xc3))/0xa;if(_0x121e8f===_0x1f8915)break;else _0x2fe1a3['push'](_0x2fe1a3['shift']());}catch(_0x49972a){_0x2fe1a3['push'](_0x2fe1a3['shift']());}}}(_0x1d6d,0x31005));function _0x1d6d(){const _0x4bc841=['.webp','GREEN','toBuffer','#000000','get','max','length','toFormat','getHeight','getWidth','fetchIcon','./CustomError','hasAlpha','getHex','floor','sharp','getMainColor','Problem\x20reading\x20','map','from','saveIcon','dest','sort','push','ColorActionName','cssColorToHex','detectRoundPure','ImageHelper','abs','BLEND_MULTIPLY','width','composite','node-vibrant','7148oGAXdK','getPixelColor','middle','Received\x20icon\x20with\x20invalid\x20Content-Type.','clone','rgbNumber','webp2PngBuffer','getRoundedImage','rgbaToInt','crop','46718zTyXsZ','jimp','fetch','90942eheKBv','decode','min','intToRGBA','url','setPixelColour','content-type','image/','bitmap','BLUE','height','updateBoundariesAndDetectInThreshold','includes','resize','6297920dbMZEB','color','monochromeFilter','.svg','mkdir','startsWith','Failed\x20to\x20download\x20icon.\x20Responded\x20with\x20status\x20','status','headers','read','blue','decompressResponseBuffer','binary','deflate','edgeColor','./wrappers/svg2img','dirname','ceil','generateCompositeImage','content-encoding','__esModule','BLEND_OVERLAY','originalCropRoundPureImage','RED','boundaries','fetchUtils','614740xnQtAX','writeAsync','scan','croppedImage','roundColor','@jimp/plugin-color','gzip','6CDnmMG','CustomError','\x20Responded\x20with\x20Content-Type\x20\x22','image/svg','isPure','data','708111tXbPvE','arrayBuffer','red','cropRoundPureImage','generateIcon','getPalette','261gmKxPj','fetchLocalIcon','endsWith','646366wnbOtz','MIME_PNG','#818181','./FetchUtils-1','24gnOJeW'];_0x1d6d=function(){return _0x4bc841;};return _0x1d6d();}Object['defineProperty'](exports,_0x412733(0xd7),{'value':!![]}),exports[_0x412733(0x113)]=void 0x0;const path=require('path'),fs=require('fs'),Jimp=require(_0x412733(0x124)),plugin_color_1=require(_0x412733(0xe2)),CustomError_1=require(_0x412733(0x103)),FetchUtils_1_1=require(_0x412733(0xf6)),util_1=require('util'),svg2img_1=require(_0x412733(0xd2)),Vibrant=require(_0x412733(0x118)),sharp=require(_0x412733(0x107)),fsMkDir=(0x0,util_1['promisify'])(fs[_0x412733(0xc7)]),scope=0x2,threshold=0xa;class ImageHelper{async['saveIcon'](_0x34b9fd,_0x42e0c2,_0x5c0475,_0x4e5539,_0x23a073){const _0x505f05=_0x412733,{transform:_0x58102c,originalIcon:_0x1acd20}=_0x23a073||{},_0x3ba65f=_0x58102c===![];let _0xed336f=await Jimp[_0x505f05(0xcc)](_0x34b9fd['data']);if(_0x4e5539&&_0xed336f[_0x505f05(0x104)]()){const _0x11d937=(_0x4e5539[_0x505f05(0x11e)]()<<0x8&0xffffff00)>>>0x0;for(let _0x4175a8=0x0;_0x4175a8<_0xed336f[_0x505f05(0x100)]();_0x4175a8++){for(let _0x276572=0x0;_0x276572<_0xed336f[_0x505f05(0x101)]();_0x276572++){const _0x233c2a=_0xed336f['getPixelColour'](_0x276572,_0x4175a8);(_0x233c2a&0xff)===0x0&&_0xed336f[_0x505f05(0x12b)](_0x11d937,_0x276572,_0x4175a8);}}}if(!_0x3ba65f){_0xed336f[_0x505f05(0xc2)](_0x42e0c2,_0x42e0c2);if(_0x23a073){const _0xb8cfb3=this[_0x505f05(0x112)](_0xed336f,scope,threshold);if(_0xb8cfb3[_0x505f05(0xe8)]){const _0x69313d=this[_0x505f05(0xed)](_0xed336f,scope,_0xb8cfb3[_0x505f05(0xdb)],threshold);_0x69313d[_0x505f05(0xc2)](_0x42e0c2,_0x42e0c2),_0xed336f=await this[_0x505f05(0xd5)](_0x69313d,_0x42e0c2,_0x42e0c2*1.5,_0x42e0c2*1.5,0x0,_0xb8cfb3['roundColor']);}else _0xed336f=await this[_0x505f05(0xd5)](_0xed336f,_0x42e0c2,_0x42e0c2*0x2,_0x42e0c2*0x2,_0x42e0c2*0.65);}}await _0xed336f[_0x505f05(0xde)](_0x5c0475);}async[_0x412733(0xd5)](_0x215cb7,_0x4968e7,_0xe09a8,_0x5f035c,_0x4bcc89=0x0,_0x255c48=0x0){const _0x23170d=_0x412733,_0x3357d7=Jimp[_0x23170d(0x129)](_0x255c48)['a']===0x0,_0x42d8d4=await this[_0x23170d(0x108)](_0x215cb7),_0x4b066d=new Jimp(_0xe09a8,_0x5f035c,_0x3357d7?_0x42d8d4:_0x255c48);let _0x10114c=_0x215cb7;_0x4bcc89>0x0&&(_0x10114c=this[_0x23170d(0x120)](_0x215cb7,_0x4bcc89));_0x4b066d[_0x23170d(0x117)](_0x10114c,(_0xe09a8-_0x4968e7)*0.5,(_0x5f035c-_0x4968e7)*0.5);if(_0x3357d7){const _0x11a9ce=_0x23170d(0xfb),_0x5712ed=Jimp[_0x23170d(0x111)](_0x11a9ce),_0x1a974b=new Jimp(_0x4b066d[_0x23170d(0x101)](),_0x4b066d[_0x23170d(0x100)](),_0x5712ed),_0x5d61be=_0x23170d(0xf5),_0x2e87e4=Jimp[_0x23170d(0x111)](_0x5d61be),_0x4ae356=new Jimp(_0x4b066d[_0x23170d(0x101)](),_0x4b066d[_0x23170d(0x100)](),_0x2e87e4);_0x4b066d[_0x23170d(0x117)](_0x1a974b,0x0,0x0,{'mode':Jimp[_0x23170d(0xd8)],'opacitySource':0.3,'opacityDest':0x1}),_0x4b066d[_0x23170d(0x117)](_0x4ae356,0x0,0x0,{'mode':Jimp[_0x23170d(0x115)],'opacitySource':0.1,'opacityDest':0x1});}return _0x4b066d;}[_0x412733(0x120)](_0x507db5,_0x1b0634){const _0x21ecf1=_0x412733,_0x5c46e8=_0x507db5[_0x21ecf1(0x12e)][_0x21ecf1(0x116)],_0x262517=_0x507db5[_0x21ecf1(0x12e)][_0x21ecf1(0x130)],_0x215cc5=new Jimp(_0x5c46e8,_0x262517,0x0);return _0x215cc5['rgba'](!![]),_0x215cc5[_0x21ecf1(0xdf)](0x0,0x0,_0x5c46e8,_0x262517,(_0x1e7528,_0x251862,_0xa45a42)=>{const _0xfbd2ce=_0x21ecf1,_0x2bcb1a=Math[_0xfbd2ce(0x114)](_0x1e7528-_0x5c46e8/0x2),_0x2aa8c5=Math[_0xfbd2ce(0x114)](_0x251862-_0x262517/0x2),_0x108ebf=Math['sqrt'](_0x2bcb1a*_0x2bcb1a+_0x2aa8c5*_0x2aa8c5);if(_0x108ebf<=_0x1b0634){const _0x2209f2=_0x507db5[_0xfbd2ce(0x11a)](_0x1e7528,_0x251862);_0x215cc5['setPixelColor'](_0x2209f2,_0x1e7528,_0x251862);}}),_0x215cc5;}async['getMainColor'](_0x1f79d0){const _0x1f8e8f=_0x412733;var _0x490efb;const _0x589f41=await _0x1f79d0['getBufferAsync'](Jimp[_0x1f8e8f(0xf4)]),_0xf89bea=await Vibrant['from'](_0x589f41)[_0x1f8e8f(0xef)]();return((_0x490efb=_0xf89bea['Vibrant'])===null||_0x490efb===void 0x0?void 0x0:_0x490efb[_0x1f8e8f(0x105)]())||0x0;}[_0x412733(0xc0)](_0x47ae69,_0x3eb382,_0x4066f1){const _0x11b5b0=_0x412733,{red:_0x215019,green:_0x20245d,blue:_0x2b10b9,alpha:_0x500d03}=_0x3eb382;return _0x47ae69['r']>_0x215019['max']&&(_0x215019['max']=_0x47ae69['r']),_0x47ae69['r']<_0x215019['min']&&(_0x215019['min']=_0x47ae69['r']),_0x47ae69['g']>_0x20245d[_0x11b5b0(0xfd)]&&(_0x20245d[_0x11b5b0(0xfd)]=_0x47ae69['g']),_0x47ae69['g']<_0x20245d['min']&&(_0x20245d[_0x11b5b0(0x128)]=_0x47ae69['g']),_0x47ae69['b']>_0x2b10b9['max']&&(_0x2b10b9['max']=_0x47ae69['b']),_0x47ae69['b']<_0x2b10b9[_0x11b5b0(0x128)]&&(_0x2b10b9[_0x11b5b0(0x128)]=_0x47ae69['b']),_0x47ae69['a']>_0x500d03['max']&&(_0x500d03['max']=_0x47ae69['a']),_0x47ae69['a']<_0x500d03['min']&&(_0x500d03[_0x11b5b0(0x128)]=_0x47ae69['a']),Math[_0x11b5b0(0x114)](_0x215019[_0x11b5b0(0xfd)]-_0x215019[_0x11b5b0(0x128)])<=_0x4066f1&&Math['abs'](_0x20245d['max']-_0x20245d[_0x11b5b0(0x128)])<=_0x4066f1&&Math[_0x11b5b0(0x114)](_0x2b10b9[_0x11b5b0(0xfd)]-_0x2b10b9[_0x11b5b0(0x128)])<=_0x4066f1&&Math[_0x11b5b0(0x114)](_0x500d03[_0x11b5b0(0xfd)]-_0x500d03['min'])<=_0x4066f1;}[_0x412733(0x11b)](_0x3cc645){const _0x597c4b=_0x412733,_0x1b1fc4=[..._0x3cc645];return _0x1b1fc4[_0x597c4b(0x10e)](),_0x1b1fc4[_0x597c4b(0xfe)]%0x2===0x0?(_0x1b1fc4[_0x1b1fc4['length']/0x2]+_0x1b1fc4[_0x1b1fc4[_0x597c4b(0xfe)]/0x2-0x1])/0x2:_0x1b1fc4[Number(_0x1b1fc4[_0x597c4b(0xfe)]/0x2)];}[_0x412733(0x112)](_0x14ad26,_0x3c3e2d,_0x1e4da1){const _0x131d6d=_0x412733,_0xac602f={'roundColor':0x0,'isPure':![],'boundaries':{'red':{'min':Infinity,'max':0x0},'green':{'min':Infinity,'max':0x0},'blue':{'min':Infinity,'max':0x0},'alpha':{'min':Infinity,'max':0x0}}},_0x16c990=[],_0x35f7cc=_0x14ad26[_0x131d6d(0x12e)][_0x131d6d(0x116)],_0x537eee=_0x14ad26[_0x131d6d(0x12e)][_0x131d6d(0x130)];let _0x510f99=0x0,_0x5e0567=_0x35f7cc,_0x39177e=0x0,_0x3e5225=_0x537eee,_0x3f5510=0x0,_0xd061d2;_0x346d2b:while(_0x39177e<=_0x3e5225&&_0x510f99<=_0x5e0567&&_0x3f5510<_0x3c3e2d){for(let _0x4836f2=_0x510f99;_0x4836f2<=_0x5e0567;_0x4836f2++){_0xd061d2=Jimp[_0x131d6d(0x129)](_0x14ad26['getPixelColor'](_0x39177e,_0x4836f2)),_0x16c990[_0x131d6d(0x10f)](_0xd061d2);if(!this[_0x131d6d(0xc0)](_0xd061d2,_0xac602f['boundaries'],_0x1e4da1))break _0x346d2b;;}_0x39177e++;for(let _0x5859be=_0x39177e;_0x5859be<=_0x3e5225;_0x5859be++){_0xd061d2=Jimp['intToRGBA'](_0x14ad26['getPixelColor'](_0x5859be,_0x5e0567)),_0x16c990[_0x131d6d(0x10f)](_0xd061d2);if(!this[_0x131d6d(0xc0)](_0xd061d2,_0xac602f[_0x131d6d(0xdb)],_0x1e4da1))break _0x346d2b;}_0x5e0567--;for(let _0x37baa1=_0x5e0567;_0x37baa1>=_0x510f99;_0x37baa1--){_0xd061d2=Jimp['intToRGBA'](_0x14ad26[_0x131d6d(0x11a)](_0x3e5225,_0x37baa1)),_0x16c990[_0x131d6d(0x10f)](_0xd061d2);if(!this[_0x131d6d(0xc0)](_0xd061d2,_0xac602f[_0x131d6d(0xdb)],_0x1e4da1))break _0x346d2b;}_0x3e5225--;for(let _0x20a613=_0x3e5225;_0x20a613>=_0x39177e;_0x20a613--){_0xd061d2=Jimp[_0x131d6d(0x129)](_0x14ad26['getPixelColor'](_0x20a613,_0x510f99)),_0x16c990['push'](_0xd061d2);if(!this[_0x131d6d(0xc0)](_0xd061d2,_0xac602f[_0x131d6d(0xdb)],_0x1e4da1))break _0x346d2b;}_0x510f99++,_0x3f5510++;}if(_0x3f5510==_0x3c3e2d){_0xac602f['isPure']=!![];const _0x1ec349=this[_0x131d6d(0x11b)](_0x16c990[_0x131d6d(0x10a)](_0x162c71=>_0x162c71['r'])),_0x1b790b=this[_0x131d6d(0x11b)](_0x16c990[_0x131d6d(0x10a)](_0x95755d=>_0x95755d['g'])),_0x1b2e14=this['middle'](_0x16c990[_0x131d6d(0x10a)](_0x21c628=>_0x21c628['b'])),_0x27ea1b=this[_0x131d6d(0x11b)](_0x16c990[_0x131d6d(0x10a)](_0x5f1a3e=>_0x5f1a3e['a']));_0xac602f[_0x131d6d(0xe1)]=Jimp[_0x131d6d(0x121)](_0x1ec349,_0x1b790b,_0x1b2e14,_0x27ea1b);}return _0xac602f;}['cropRoundPureImage'](_0x4c4452,_0x2bdc75,_0x3de8f8,_0x40de90){const _0x1c19b3=_0x412733,_0x28d320=_0x4c4452['bitmap']['width'],_0x254514=_0x4c4452[_0x1c19b3(0x12e)][_0x1c19b3(0x130)];let _0x3ebc14=_0x2bdc75,_0xeb2568=_0x2bdc75,_0x15896a=_0x28d320-_0x2bdc75,_0x5f378a=_0x254514-_0x2bdc75,_0x3fcee6,_0x19578e=_0x2bdc75;_0x2795fa:while(_0xeb2568<=_0x5f378a&&_0x3ebc14<=_0x15896a){for(let _0x2b244d=_0x3ebc14;_0x2b244d<=_0x15896a;_0x2b244d++){_0x3fcee6=Jimp[_0x1c19b3(0x129)](_0x4c4452['getPixelColor'](_0xeb2568,_0x2b244d));if(!this[_0x1c19b3(0xc0)](_0x3fcee6,_0x3de8f8,_0x40de90))break _0x2795fa;}_0xeb2568++;for(let _0x5233fa=_0xeb2568;_0x5233fa<=_0x5f378a;_0x5233fa++){_0x3fcee6=Jimp[_0x1c19b3(0x129)](_0x4c4452['getPixelColor'](_0x5233fa,_0x15896a));if(!this[_0x1c19b3(0xc0)](_0x3fcee6,_0x3de8f8,_0x40de90))break _0x2795fa;}_0x15896a--;for(let _0x3dfa11=_0x15896a;_0x3dfa11>=_0x3ebc14;_0x3dfa11--){_0x3fcee6=Jimp[_0x1c19b3(0x129)](_0x4c4452[_0x1c19b3(0x11a)](_0x5f378a,_0x3dfa11));if(!this[_0x1c19b3(0xc0)](_0x3fcee6,_0x3de8f8,_0x40de90))break _0x2795fa;}_0x5f378a--;for(let _0x525fde=_0x5f378a;_0x525fde>=_0xeb2568;_0x525fde--){_0x3fcee6=Jimp[_0x1c19b3(0x129)](_0x4c4452[_0x1c19b3(0x11a)](_0x525fde,_0x3ebc14));if(!this[_0x1c19b3(0xc0)](_0x3fcee6,_0x3de8f8,_0x40de90))break _0x2795fa;}_0x3ebc14++,_0x19578e++;}return _0x19578e===Math[_0x1c19b3(0xd4)](Math['min'](_0x28d320,_0x254514)/0x2)?_0x4c4452:_0x4c4452[_0x1c19b3(0x11d)]()['crop'](_0x19578e,_0x19578e,_0x28d320-_0x19578e*0x2,_0x254514-_0x19578e*0x2);}[_0x412733(0xd9)](_0x34bfd9,_0x4c64df=0x2){const _0x80c16d=_0x412733,_0x12e44d={'isPure':![],'edgeColor':0x0,'croppedImage':_0x34bfd9},_0x103b35=_0x34bfd9[_0x80c16d(0x11a)](0x0,0x0),_0x1f15f4=_0x34bfd9[_0x80c16d(0x12e)][_0x80c16d(0x116)],_0x534b56=_0x34bfd9[_0x80c16d(0x12e)]['height'];let _0x494a50=0x0,_0x18a1d4=_0x1f15f4,_0x3a9bb7=0x0,_0x425552=_0x534b56,_0x46262f=0x0;const _0x262657=0x5f5e100;_0x276fcc:while(_0x3a9bb7<=_0x425552&&_0x494a50<=_0x18a1d4){for(let _0x19251b=_0x494a50;_0x19251b<=_0x18a1d4;_0x19251b++){if(Math[_0x80c16d(0x114)](_0x34bfd9[_0x80c16d(0x11a)](_0x3a9bb7,_0x19251b)-_0x103b35)>_0x262657)break _0x276fcc;}_0x3a9bb7++;for(let _0x50e6be=_0x3a9bb7;_0x50e6be<=_0x425552;_0x50e6be++){if(Math[_0x80c16d(0x114)](_0x34bfd9['getPixelColor'](_0x50e6be,_0x18a1d4)-_0x103b35)>_0x262657)break _0x276fcc;}_0x18a1d4--;for(let _0x527e5a=_0x18a1d4;_0x527e5a>=_0x494a50;_0x527e5a--){if(Math[_0x80c16d(0x114)](_0x34bfd9[_0x80c16d(0x11a)](_0x425552,_0x527e5a)-_0x103b35)>_0x262657)break _0x276fcc;}_0x425552--;for(let _0x7b4acb=_0x425552;_0x7b4acb>=_0x3a9bb7;_0x7b4acb--){if(Math[_0x80c16d(0x114)](_0x34bfd9[_0x80c16d(0x11a)](_0x7b4acb,_0x494a50)-_0x103b35)>_0x262657)break _0x276fcc;}_0x494a50++,_0x46262f++;}const _0x8ed54a=[_0x46262f,_0x46262f],_0x29bc79=[_0x1f15f4-_0x46262f,_0x46262f],_0x327422=[_0x46262f,_0x534b56-_0x46262f],_0x2b1465=[_0x1f15f4-_0x46262f,_0x534b56-_0x46262f];return _0x46262f>=_0x4c64df&&_0x46262f<Math[_0x80c16d(0x106)](Math[_0x80c16d(0x128)](_0x1f15f4,_0x534b56)*0.5)&&(_0x12e44d[_0x80c16d(0xe8)]=!![],_0x12e44d[_0x80c16d(0xd1)]=_0x103b35,_0x12e44d[_0x80c16d(0xe0)]=_0x34bfd9[_0x80c16d(0x11d)]()[_0x80c16d(0x122)](_0x46262f,_0x46262f,_0x1f15f4-_0x46262f*0x2,_0x534b56-_0x46262f*0x2)),_0x12e44d;}async[_0x412733(0xee)](_0x4e15e7,_0x477dfd,_0x81901a,_0x1b8701,_0x245b6e){const _0x1bd633=_0x412733,_0x4d84d4=path['join'](_0x477dfd,_0x81901a[_0x1bd633(0x10d)]);return await fsMkDir(path[_0x1bd633(0xd3)](_0x4d84d4),{'recursive':!![]}),await this[_0x1bd633(0x10c)](_0x4e15e7,_0x81901a['size'],_0x4d84d4,_0x1b8701,_0x245b6e);}async[_0x412733(0xc5)](_0x3fb51d,_0x175a35){const _0x459e61=_0x412733,_0x58cf48=await Jimp[_0x459e61(0xcc)](_0x3fb51d['data']);return _0x58cf48[_0x459e61(0xc4)]([{'apply':plugin_color_1[_0x459e61(0x110)][_0x459e61(0xda)],'params':[-0xff]},{'apply':plugin_color_1[_0x459e61(0x110)][_0x459e61(0xf9)],'params':[-0xff]},{'apply':plugin_color_1[_0x459e61(0x110)][_0x459e61(0x12f)],'params':[-0xff]},{'apply':plugin_color_1[_0x459e61(0x110)]['RED'],'params':[_0x175a35[_0x459e61(0xec)]()]},{'apply':plugin_color_1['ColorActionName'][_0x459e61(0xf9)],'params':[_0x175a35['green']()]},{'apply':plugin_color_1['ColorActionName']['BLUE'],'params':[_0x175a35[_0x459e61(0xcd)]()]}]),{'url':_0x3fb51d[_0x459e61(0x12a)],'data':_0x58cf48};}async[_0x412733(0x102)](_0x2995ee){const _0x5888f8=_0x412733,_0x12f9e8=await FetchUtils_1_1[_0x5888f8(0xdc)][_0x5888f8(0x125)](_0x2995ee,{'encoding':_0x5888f8(0xcf)});if(_0x12f9e8[_0x5888f8(0xca)]!==0xc8)throw new CustomError_1[(_0x5888f8(0xe5))]({'code':0x7d2,'message':_0x5888f8(0xc9)+_0x12f9e8[_0x5888f8(0xca)],'message_staring_params':{'icon_url':_0x2995ee,'status':_0x12f9e8[_0x5888f8(0xca)]}});const _0x10eeca=_0x12f9e8[_0x5888f8(0xcb)][_0x5888f8(0xfc)]?_0x12f9e8[_0x5888f8(0xcb)][_0x5888f8(0xfc)](_0x5888f8(0x12c)):_0x12f9e8[_0x5888f8(0xcb)][_0x5888f8(0x12c)];if(!(_0x10eeca===null||_0x10eeca===void 0x0?void 0x0:_0x10eeca[_0x5888f8(0xc8)](_0x5888f8(0x12d))))throw new CustomError_1['CustomError']({'code':0x7d3,'message':_0x5888f8(0x11c)+(_0x5888f8(0xe6)+_0x10eeca+'\x22'),'message_staring_params':{'icon_url':_0x2995ee,'contentType':_0x10eeca}});let _0x2b5854;_0x12f9e8['arrayBuffer']?_0x2b5854=await _0x12f9e8[_0x5888f8(0xeb)]():[_0x5888f8(0xe3),_0x5888f8(0xd0),'br'][_0x5888f8(0xc1)](_0x12f9e8['headers'][_0x5888f8(0xd6)])?_0x2b5854=FetchUtils_1_1['fetchUtils'][_0x5888f8(0xce)](Buffer[_0x5888f8(0x10b)](_0x12f9e8['data'],_0x5888f8(0xcf)),_0x12f9e8[_0x5888f8(0xcb)][_0x5888f8(0xd6)]):_0x2b5854=Buffer['from'](_0x12f9e8[_0x5888f8(0xe9)],_0x5888f8(0xcf));;if(_0x10eeca['startsWith'](_0x5888f8(0xe7))){const _0x264b99=new TextDecoder();try{_0x2b5854=await(0x0,svg2img_1['svg2img'])(_0x264b99[_0x5888f8(0x127)](_0x2b5854));}catch(_0x5b7f56){throw new CustomError_1['CustomError']({'code':0x7d4,'message':_0x5888f8(0x109)+_0x2995ee+':\x20'+_0x5b7f56,'message_staring_params':{'icon_url':_0x2995ee,'error':_0x5b7f56}});}}return _0x10eeca[_0x5888f8(0xc8)]('image/webp')&&(_0x2b5854=await this[_0x5888f8(0x11f)](_0x2b5854)),{'url':_0x2995ee,'data':await Jimp[_0x5888f8(0xcc)](Buffer[_0x5888f8(0x10b)](_0x2b5854))};}async[_0x412733(0x11f)](_0x386cfd){const _0x3dbdd6=_0x412733;return await sharp(_0x386cfd)[_0x3dbdd6(0xff)]('png')['toBuffer']();}async[_0x412733(0xf1)](_0x1c3aa7){const _0x567a25=_0x412733;try{let _0x37654c;if(_0x1c3aa7[_0x567a25(0xf2)](_0x567a25(0xc6))||_0x1c3aa7[_0x567a25(0xf2)](_0x567a25(0xf8))){const _0x557a2e=await sharp(_0x1c3aa7)['toFormat']('png')[_0x567a25(0xfa)]();_0x37654c=await Jimp[_0x567a25(0xcc)](Buffer[_0x567a25(0x10b)](_0x557a2e));}else _0x37654c=await Jimp[_0x567a25(0xcc)](_0x1c3aa7);return{'url':'','data':_0x37654c};}catch(_0x106d67){throw new Error(_0x567a25(0x109)+_0x1c3aa7+':\x20'+_0x106d67);}}}function _0x2dc6(_0x2d57c1,_0x3f4be4){const _0x1d6da8=_0x1d6d();return _0x2dc6=function(_0x2dc61c,_0x3fdee3){_0x2dc61c=_0x2dc61c-0xc0;let _0x5f11e2=_0x1d6da8[_0x2dc61c];return _0x5f11e2;},_0x2dc6(_0x2d57c1,_0x3f4be4);}exports[_0x412733(0x113)]=ImageHelper;