Built motion from commit cf5ff673.|2.5.41
[motion2.git] / server / api / setting / setting.controller.js
index 727290d..3a80fe9 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x637f=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','options','findAll','rows','show','params','includeAll','include','merge','find','body','addLogo','file','filename','logo','addLogoLogin','getLogo','server/files/images/logos','getLicense','preferred','favicon','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','upperFirst','Sequelize','ValidationError','download','getLogoLogin','loginLogo','defaultLogo','default_loginLogo.svg','custom','\x20not\x20found','addPreferred','getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','zip-dir','request-promise','moment','bluebird','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','index','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x637f,0x1af));var _0xf637=function(_0x118c30,_0x7eb1eb){_0x118c30=_0x118c30-0x0;var _0x569999=_0x637f[_0x118c30];return _0x569999;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf637('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf637('0x1'));var moment=require(_0xf637('0x2'));var BPromise=require(_0xf637('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf637('0x4'));var ejs=require(_0xf637('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xf637('0x6'));var crypto=require(_0xf637('0x7'));var jsforce=require(_0xf637('0x8'));var deskjs=require(_0xf637('0x9'));var toCsv=require(_0xf637('0x4'));var querystring=require('querystring');var Papa=require(_0xf637('0xa'));var Redis=require(_0xf637('0xb'));var authService=require(_0xf637('0xc'));var qs=require(_0xf637('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf637('0xe'))(_0xf637('0xf'));var utils=require(_0xf637('0x10'));var config=require('../../config/environment');var licenseUtil=require(_0xf637('0x11'));var db=require(_0xf637('0x12'))['db'];var jayson=require(_0xf637('0x13'));var client=jayson['client'][_0xf637('0x14')]({'port':0x232a});function respondWithRpcPromise(_0x30a1e2,_0xd26c91,_0x5889ae,_0xff4ae6){return new BPromise(function(_0x2f0249,_0x25906d){var _0x135055=_0xff4ae6||client;return _0x135055[_0xf637('0x15')](_0x30a1e2,_0x5889ae)[_0xf637('0x16')](function(_0x5064be){logger[_0xf637('0x17')](_0xf637('0x18'),_0xd26c91,'request\x20sent');logger['debug'](_0xf637('0x19'),_0xd26c91,_0xf637('0x1a'),JSON[_0xf637('0x1b')](_0x5064be));if(_0x5064be[_0xf637('0x1c')]){if(_0x5064be[_0xf637('0x1c')][_0xf637('0x1d')]===0x1f4){logger[_0xf637('0x1c')](_0xf637('0x18'),_0xd26c91,_0x5064be[_0xf637('0x1c')][_0xf637('0x1e')]);return _0x25906d(_0x5064be[_0xf637('0x1c')]['message']);}logger[_0xf637('0x1c')](_0xf637('0x18'),_0xd26c91,_0x5064be[_0xf637('0x1c')][_0xf637('0x1e')]);return _0x2f0249(_0x5064be[_0xf637('0x1c')][_0xf637('0x1e')]);}else{logger['info'](_0xf637('0x18'),_0xd26c91,_0xf637('0x1a'));_0x2f0249(_0x5064be[_0xf637('0x1f')][_0xf637('0x1e')]);}})[_0xf637('0x20')](function(_0x28502c){logger[_0xf637('0x1c')](_0xf637('0x18'),_0xd26c91,_0x28502c);_0x25906d(_0x28502c);});});}function respondWithStatusCode(_0x5911a6,_0xfb3808){_0xfb3808=_0xfb3808||0xcc;return function(_0x495ccd){if(_0x495ccd){return _0x5911a6[_0xf637('0x21')](_0xfb3808);}return _0x5911a6[_0xf637('0x22')](_0xfb3808)[_0xf637('0x23')]();};}function respondWithResult(_0x16905b,_0x3bc238){_0x3bc238=_0x3bc238||0xc8;return function(_0x165380){if(_0x165380){return _0x16905b['status'](_0x3bc238)[_0xf637('0x24')](_0x165380);}};}function respondWithFilteredResult(_0x308b22,_0x4c822d){return function(_0xd2ba99){if(_0xd2ba99){var _0x11ec96=typeof _0x4c822d[_0xf637('0x25')]===_0xf637('0x26')&&typeof _0x4c822d[_0xf637('0x27')]===_0xf637('0x26');var _0xf0daa1=_0xd2ba99[_0xf637('0x28')];var _0x3c1e19=_0x11ec96?0x0:_0x4c822d['offset'];var _0x31efc7=_0x11ec96?_0xd2ba99[_0xf637('0x28')]:_0x4c822d[_0xf637('0x25')]+_0x4c822d[_0xf637('0x27')];var _0x4a7077;if(_0x31efc7>=_0xf0daa1){_0x31efc7=_0xf0daa1;_0x4a7077=0xc8;}else{_0x4a7077=0xce;}_0x308b22[_0xf637('0x22')](_0x4a7077);return _0x308b22[_0xf637('0x29')](_0xf637('0x2a'),_0x3c1e19+'-'+_0x31efc7+'/'+_0xf0daa1)[_0xf637('0x24')](_0xd2ba99);}return null;};}function patchUpdates(_0x3e71d4){return function(_0x15c867){try{jsonpatch[_0xf637('0x2b')](_0x15c867,_0x3e71d4,!![]);}catch(_0x3971e6){return BPromise[_0xf637('0x2c')](_0x3971e6);}return _0x15c867[_0xf637('0x2d')]();};}function saveUpdates(_0x5d9433,_0x3afc30){return function(_0x2d0f54){if(_0x2d0f54){return _0x2d0f54[_0xf637('0x2e')](_0x5d9433)[_0xf637('0x16')](function(_0x2876a1){return _0x2876a1;});}return null;};}function removeEntity(_0x48ae1e,_0x1d06e2){return function(_0x782b7b){if(_0x782b7b){return _0x782b7b[_0xf637('0x2f')]()[_0xf637('0x16')](function(){_0x48ae1e[_0xf637('0x22')](0xcc)[_0xf637('0x23')]();});}};}function handleEntityNotFound(_0x47bf1d,_0x3fbab7){return function(_0x226067){if(!_0x226067){_0x47bf1d[_0xf637('0x21')](0x194);}return _0x226067;};}function handleError(_0xf2b7e3,_0x156eb7){_0x156eb7=_0x156eb7||0x1f4;return function(_0x36abff){logger[_0xf637('0x1c')](_0x36abff[_0xf637('0x30')]);if(_0x36abff[_0xf637('0x31')]){delete _0x36abff[_0xf637('0x31')];}_0xf2b7e3['status'](_0x156eb7)['send'](_0x36abff);};}exports[_0xf637('0x32')]=function(_0x283b6f,_0x3feed4){var _0x556505={},_0x4d369e={},_0x1a4e84={'count':0x0,'rows':[]};var _0x3fdc9a=_[_0xf637('0x33')](db[_0xf637('0x34')][_0xf637('0x35')],function(_0x1346bb){return{'name':_0x1346bb[_0xf637('0x36')],'type':_0x1346bb[_0xf637('0x37')][_0xf637('0x38')]};});_0x4d369e[_0xf637('0x39')]=_[_0xf637('0x33')](_0x3fdc9a,_0xf637('0x31'));_0x4d369e[_0xf637('0x3a')]=_[_0xf637('0x3b')](_0x283b6f['query']);_0x4d369e[_0xf637('0x3c')]=_[_0xf637('0x3d')](_0x4d369e[_0xf637('0x39')],_0x4d369e[_0xf637('0x3a')]);_0x556505[_0xf637('0x3e')]=_[_0xf637('0x3d')](_0x4d369e[_0xf637('0x39')],qs[_0xf637('0x3f')](_0x283b6f[_0xf637('0x3a')][_0xf637('0x3f')]));_0x556505[_0xf637('0x3e')]=_0x556505[_0xf637('0x3e')][_0xf637('0x40')]?_0x556505[_0xf637('0x3e')]:_0x4d369e['model'];if(!_0x283b6f[_0xf637('0x3a')][_0xf637('0x41')](_0xf637('0x42'))){_0x556505[_0xf637('0x27')]=qs['limit'](_0x283b6f[_0xf637('0x3a')][_0xf637('0x27')]);_0x556505[_0xf637('0x25')]=qs[_0xf637('0x25')](_0x283b6f[_0xf637('0x3a')][_0xf637('0x25')]);}_0x556505[_0xf637('0x43')]=qs[_0xf637('0x44')](_0x283b6f[_0xf637('0x3a')][_0xf637('0x44')]);_0x556505[_0xf637('0x45')]=qs[_0xf637('0x3c')](_['pick'](_0x283b6f[_0xf637('0x3a')],_0x4d369e[_0xf637('0x3c')]),_0x3fdc9a);if(_0x283b6f[_0xf637('0x3a')][_0xf637('0x46')]){_0x556505['where']=_['merge'](_0x556505[_0xf637('0x45')],{'$or':_['map'](_0x3fdc9a,function(_0x424f3){if(_0x424f3[_0xf637('0x37')]!==_0xf637('0x47')){var _0x26f013={};_0x26f013[_0x424f3[_0xf637('0x31')]]={'$like':'%'+_0x283b6f[_0xf637('0x3a')][_0xf637('0x46')]+'%'};return _0x26f013;}})});}_0x556505=_['merge']({},_0x556505,_0x283b6f[_0xf637('0x48')]);var _0x58f911={'where':_0x556505[_0xf637('0x45')]};return db['Setting'][_0xf637('0x28')](_0x58f911)['then'](function(_0x34ca1a){_0x1a4e84[_0xf637('0x28')]=_0x34ca1a;if(_0x283b6f[_0xf637('0x3a')]['includeAll']){_0x556505['include']=[{'all':!![]}];}return db[_0xf637('0x34')][_0xf637('0x49')](_0x556505);})[_0xf637('0x16')](function(_0x586ff0){_0x1a4e84[_0xf637('0x4a')]=_0x586ff0;return _0x1a4e84;})[_0xf637('0x16')](respondWithFilteredResult(_0x3feed4,_0x556505))[_0xf637('0x20')](handleError(_0x3feed4,null));};exports[_0xf637('0x4b')]=function(_0x40119f,_0x412b27){var _0x529d2b={'raw':![],'where':{'id':_0x40119f[_0xf637('0x4c')]['id']}},_0x331009={};_0x331009['model']=_[_0xf637('0x3b')](db['Setting'][_0xf637('0x35')]);_0x331009['query']=_['keys'](_0x40119f[_0xf637('0x3a')]);_0x331009[_0xf637('0x3c')]=_[_0xf637('0x3d')](_0x331009[_0xf637('0x39')],_0x331009[_0xf637('0x3a')]);_0x529d2b[_0xf637('0x3e')]=_[_0xf637('0x3d')](_0x331009[_0xf637('0x39')],qs['fields'](_0x40119f[_0xf637('0x3a')][_0xf637('0x3f')]));_0x529d2b[_0xf637('0x3e')]=_0x529d2b[_0xf637('0x3e')]['length']?_0x529d2b[_0xf637('0x3e')]:_0x331009['model'];if(_0x40119f[_0xf637('0x3a')][_0xf637('0x4d')]){_0x529d2b[_0xf637('0x4e')]=[{'all':!![]}];}_0x529d2b=_[_0xf637('0x4f')]({},_0x529d2b,_0x40119f[_0xf637('0x48')]);return db[_0xf637('0x34')][_0xf637('0x50')](_0x529d2b)['then'](handleEntityNotFound(_0x412b27,null))['then'](respondWithResult(_0x412b27,null))['catch'](handleError(_0x412b27,null));};exports[_0xf637('0x2e')]=function(_0x1a5a28,_0x33ce4f){if(_0x1a5a28[_0xf637('0x51')]['id']){delete _0x1a5a28[_0xf637('0x51')]['id'];}return db[_0xf637('0x34')]['find']({'where':{'id':_0x1a5a28[_0xf637('0x4c')]['id']}})['then'](handleEntityNotFound(_0x33ce4f,null))[_0xf637('0x16')](saveUpdates(_0x1a5a28[_0xf637('0x51')],null))[_0xf637('0x16')](respondWithResult(_0x33ce4f,null))[_0xf637('0x20')](handleError(_0x33ce4f,null));};exports[_0xf637('0x52')]=function(_0x4a308e,_0x325c1b,_0x41ad3f){if(_0x4a308e[_0xf637('0x53')]&&_0x4a308e[_0xf637('0x53')][_0xf637('0x54')]){_0x4a308e[_0xf637('0x51')][_0xf637('0x55')]=_0x4a308e['file'][_0xf637('0x54')];}return db[_0xf637('0x34')][_0xf637('0x50')]({'where':{'id':_0x4a308e[_0xf637('0x4c')]['id']}})[_0xf637('0x16')](handleEntityNotFound(_0x325c1b,null))[_0xf637('0x16')](saveUpdates(_0x4a308e['body'],null))[_0xf637('0x16')](respondWithResult(_0x325c1b,null))[_0xf637('0x20')](handleError(_0x325c1b,null));};exports[_0xf637('0x56')]=function(_0x16b17f,_0x3a49ee,_0x1de052){if(_0x16b17f[_0xf637('0x53')]&&_0x16b17f[_0xf637('0x53')][_0xf637('0x54')]){_0x16b17f[_0xf637('0x51')]['loginLogo']=_0x16b17f[_0xf637('0x53')][_0xf637('0x54')];}return db[_0xf637('0x34')][_0xf637('0x50')]({'where':{'id':_0x16b17f[_0xf637('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3a49ee,null))['then'](saveUpdates(_0x16b17f['body'],null))[_0xf637('0x16')](respondWithResult(_0x3a49ee,null))[_0xf637('0x20')](handleError(_0x3a49ee,null));};var utilLicense=require('../../config/license/util');exports[_0xf637('0x57')]=function(_0x240168,_0x2a4c6e,_0x2797c9){var _0x5334c8=_0xf637('0x58');var _0xa5271d={'custom':![]};return utilLicense[_0xf637('0x59')]()[_0xf637('0x16')](function(_0x3eb402){if(_0x3eb402){_0xa5271d=_0x3eb402;}return db['Setting'][_0xf637('0x50')]({'where':{'id':_0x240168[_0xf637('0x4c')]['id']},'attributes':[_0xf637('0x55'),'loginLogo',_0xf637('0x5a'),_0xf637('0x5b'),'defaultLogo',_0xf637('0x5c'),_0xf637('0x5d'),_0xf637('0x5e')],'raw':!![]});})[_0xf637('0x16')](handleEntityNotFound(_0x2a4c6e,null))[_0xf637('0x16')](function(_0xce43fe){if(_0xce43fe){var _0x17cf9e=_0xce43fe[_0xf637('0x55')]&&fs[_0xf637('0x5f')](path[_0xf637('0x60')](config[_0xf637('0x61')],_0x5334c8,_['toLower'](_0xce43fe[_0xf637('0x55')])))?path[_0xf637('0x60')](config[_0xf637('0x61')],_0x5334c8,_[_0xf637('0x62')](_0xce43fe[_0xf637('0x55')])):path[_0xf637('0x60')](config[_0xf637('0x61')],_0x5334c8,_['toLower'](_0xf637('0x63')));var _0x10df56=_0xf637('0x64')+_[_0xf637('0x65')](_0xf637('0x55'));if(_0xce43fe[_0x10df56]||!_0xa5271d['custom']){_0x17cf9e=path[_0xf637('0x60')](config['root'],_0x5334c8,_[_0xf637('0x62')]('default_logo.svg'));}if(!fs[_0xf637('0x5f')](_0x17cf9e)){throw new db[(_0xf637('0x66'))][(_0xf637('0x67'))](_[_0xf637('0x65')]('logo')+'\x20not\x20found');}return _0x2a4c6e[_0xf637('0x68')](_0x17cf9e);}})[_0xf637('0x20')](handleError(_0x2a4c6e,null));};var utilLicense=require(_0xf637('0x11'));exports[_0xf637('0x69')]=function(_0x67ca0b,_0x59d4c6,_0xb3cc89){var _0xc0c5f2=_0xf637('0x58');var _0x448506={'custom':![]};return utilLicense[_0xf637('0x59')]()[_0xf637('0x16')](function(_0x29bbbc){if(_0x29bbbc){_0x448506=_0x29bbbc;}return db[_0xf637('0x34')]['find']({'where':{'id':_0x67ca0b[_0xf637('0x4c')]['id']},'attributes':[_0xf637('0x55'),_0xf637('0x6a'),_0xf637('0x5a'),_0xf637('0x5b'),_0xf637('0x6b'),_0xf637('0x5c'),_0xf637('0x5d'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x59d4c6,null))['then'](function(_0x5f5728){if(_0x5f5728){var _0x452316=_0x5f5728[_0xf637('0x6a')]&&fs[_0xf637('0x5f')](path[_0xf637('0x60')](config['root'],_0xc0c5f2,_[_0xf637('0x62')](_0x5f5728['loginLogo'])))?path['join'](config[_0xf637('0x61')],_0xc0c5f2,_[_0xf637('0x62')](_0x5f5728[_0xf637('0x6a')])):path[_0xf637('0x60')](config[_0xf637('0x61')],_0xc0c5f2,_[_0xf637('0x62')](_0xf637('0x6c')));var _0x2f781b=_0xf637('0x64')+_['upperFirst'](_0xf637('0x6a'));if(_0x5f5728[_0x2f781b]||!_0x448506[_0xf637('0x6d')]){_0x452316=path[_0xf637('0x60')](config['root'],_0xc0c5f2,_['toLower']('default_loginLogo.svg'));}if(!fs[_0xf637('0x5f')](_0x452316)){throw new db['Sequelize'][(_0xf637('0x67'))](_['upperFirst'](_0xf637('0x6a'))+_0xf637('0x6e'));}return _0x59d4c6['download'](_0x452316);}})['catch'](handleError(_0x59d4c6,null));};exports['gdpr']=function(_0x59fde7,_0x4203a1){return db['Setting'][_0xf637('0x50')]({'where':{'id':_0x59fde7[_0xf637('0x4c')]['id']},'attributes':['securePassword']})[_0xf637('0x16')](respondWithResult(_0x4203a1,null))[_0xf637('0x20')](handleError(_0x4203a1,null));};exports[_0xf637('0x6f')]=function(_0x24688d,_0xe7953f,_0x12bd40){if(_0x24688d[_0xf637('0x53')]&&_0x24688d[_0xf637('0x53')][_0xf637('0x54')]){_0x24688d['body']['preferred']=_0x24688d[_0xf637('0x53')][_0xf637('0x54')];}return db['Setting'][_0xf637('0x50')]({'where':{'id':_0x24688d[_0xf637('0x4c')]['id']}})['then'](handleEntityNotFound(_0xe7953f,null))[_0xf637('0x16')](saveUpdates(_0x24688d[_0xf637('0x51')],null))[_0xf637('0x16')](respondWithResult(_0xe7953f,null))['catch'](handleError(_0xe7953f,null));};var utilLicense=require(_0xf637('0x11'));exports[_0xf637('0x70')]=function(_0x4c899,_0x339116,_0x243d19){var _0x293c7d=_0xf637('0x58');var _0x57f30e={'custom':![]};return utilLicense[_0xf637('0x59')]()[_0xf637('0x16')](function(_0x2c7892){if(_0x2c7892){_0x57f30e=_0x2c7892;}return db[_0xf637('0x34')][_0xf637('0x50')]({'where':{'id':_0x4c899[_0xf637('0x4c')]['id']},'attributes':[_0xf637('0x55'),_0xf637('0x6a'),_0xf637('0x5a'),_0xf637('0x5b'),_0xf637('0x6b'),_0xf637('0x5c'),_0xf637('0x5d'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x339116,null))[_0xf637('0x16')](function(_0x626315){if(_0x626315){var _0xa97b44=_0x626315[_0xf637('0x5a')]&&fs['existsSync'](path[_0xf637('0x60')](config[_0xf637('0x61')],_0x293c7d,_[_0xf637('0x62')](_0x626315['preferred'])))?path[_0xf637('0x60')](config[_0xf637('0x61')],_0x293c7d,_['toLower'](_0x626315[_0xf637('0x5a')])):path[_0xf637('0x60')](config[_0xf637('0x61')],_0x293c7d,_[_0xf637('0x62')](_0xf637('0x71')));var _0xb583b4=_0xf637('0x64')+_[_0xf637('0x65')](_0xf637('0x5a'));if(_0x626315[_0xb583b4]||!_0x57f30e[_0xf637('0x6d')]||!_0x57f30e[_0xf637('0x5a')]){_0xa97b44=path[_0xf637('0x60')](config[_0xf637('0x61')],_0x293c7d,_[_0xf637('0x62')]('default_preferred.png'));}if(!fs['existsSync'](_0xa97b44)){throw new db[(_0xf637('0x66'))][(_0xf637('0x67'))](_[_0xf637('0x65')](_0xf637('0x5a'))+_0xf637('0x6e'));}return _0x339116[_0xf637('0x68')](_0xa97b44);}})['catch'](handleError(_0x339116,null));};exports[_0xf637('0x72')]=function(_0x54ccda,_0x1edfd0,_0x1087c5){if(_0x54ccda[_0xf637('0x53')]&&_0x54ccda[_0xf637('0x53')][_0xf637('0x54')]){_0x54ccda['body'][_0xf637('0x5b')]=_0x54ccda[_0xf637('0x53')]['filename'];}return db[_0xf637('0x34')][_0xf637('0x50')]({'where':{'id':_0x54ccda[_0xf637('0x4c')]['id']}})[_0xf637('0x16')](handleEntityNotFound(_0x1edfd0,null))[_0xf637('0x16')](saveUpdates(_0x54ccda['body'],null))['then'](respondWithResult(_0x1edfd0,null))[_0xf637('0x20')](handleError(_0x1edfd0,null));};var utilLicense=require('../../config/license/util');exports[_0xf637('0x73')]=function(_0x273433,_0x42e48d,_0x5751c5){var _0x436fab=_0xf637('0x58');var _0x277823={'custom':![]};return utilLicense[_0xf637('0x59')]()[_0xf637('0x16')](function(_0xcaf0e7){if(_0xcaf0e7){_0x277823=_0xcaf0e7;}return db['Setting'][_0xf637('0x50')]({'where':{'id':_0x273433[_0xf637('0x4c')]['id']},'attributes':[_0xf637('0x55'),_0xf637('0x6a'),_0xf637('0x5a'),_0xf637('0x5b'),_0xf637('0x6b'),_0xf637('0x5c'),_0xf637('0x5d'),_0xf637('0x5e')],'raw':!![]});})[_0xf637('0x16')](handleEntityNotFound(_0x42e48d,null))[_0xf637('0x16')](function(_0x1887b0){if(_0x1887b0){var _0x3a70f0=_0x1887b0['favicon']&&fs['existsSync'](path[_0xf637('0x60')](config[_0xf637('0x61')],_0x436fab,_[_0xf637('0x62')](_0x1887b0[_0xf637('0x5b')])))?path[_0xf637('0x60')](config['root'],_0x436fab,_[_0xf637('0x62')](_0x1887b0['favicon'])):path['join'](config[_0xf637('0x61')],_0x436fab,_[_0xf637('0x62')](_0xf637('0x74')));var _0x3e5ca4=_0xf637('0x64')+_['upperFirst'](_0xf637('0x5b'));if(_0x1887b0[_0x3e5ca4]||!_0x277823[_0xf637('0x6d')]){_0x3a70f0=path['join'](config['root'],_0x436fab,_[_0xf637('0x62')]('default_favicon.ico'));}if(!fs[_0xf637('0x5f')](_0x3a70f0)){throw new db[(_0xf637('0x66'))][(_0xf637('0x67'))](_[_0xf637('0x65')](_0xf637('0x5b'))+'\x20not\x20found');}return _0x42e48d['download'](_0x3a70f0);}})[_0xf637('0x20')](handleError(_0x42e48d,null));};exports[_0xf637('0x75')]=function(_0x35101e,_0x15117e){var _0x515d79={'offset':moment()[_0xf637('0x76')]()};_0x515d79[_0xf637('0x77')]=moment()[_0xf637('0x76')](_0x515d79['offset'])[_0xf637('0x78')](_0xf637('0x79'));return _0x15117e[_0xf637('0x22')](0xc8)[_0xf637('0x7a')](_0x515d79);};
\ No newline at end of file
+var _0xb13b=['ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','client','http','request','Setting,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','end','status','json','offset','count','limit','set','Content-Range','apply','reject','save','update','then','name','index','map','Setting','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','params','keys','include','find','body','addLogo','file','filename','logo','addLogoLogin','loginLogo','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','root','toLower','join','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','getLogoLogin','default_loginLogo.svg','gdpr','securePassword','addPreferred','getPreferred','favicon','default_preferred.png','download','addFavicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv'];(function(_0x2742db,_0x58e00c){var _0x18659e=function(_0x5bd3ac){while(--_0x5bd3ac){_0x2742db['push'](_0x2742db['shift']());}};_0x18659e(++_0x58e00c);}(_0xb13b,0x1de));var _0xbb13=function(_0x5d4607,_0x6b5e7b){_0x5d4607=_0x5d4607-0x0;var _0x5e4a86=_0xb13b[_0x5d4607];return _0x5e4a86;};'use strict';var emlformat=require(_0xbb13('0x0'));var rimraf=require(_0xbb13('0x1'));var zipdir=require(_0xbb13('0x2'));var jsonpatch=require(_0xbb13('0x3'));var rp=require(_0xbb13('0x4'));var moment=require('moment');var BPromise=require(_0xbb13('0x5'));var Mustache=require(_0xbb13('0x6'));var util=require('util');var path=require(_0xbb13('0x7'));var sox=require(_0xbb13('0x8'));var csv=require(_0xbb13('0x9'));var ejs=require(_0xbb13('0xa'));var fs=require('fs');var fs_extra=require(_0xbb13('0xb'));var _=require(_0xbb13('0xc'));var squel=require(_0xbb13('0xd'));var crypto=require(_0xbb13('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbb13('0x9'));var querystring=require(_0xbb13('0xf'));var Papa=require(_0xbb13('0x10'));var Redis=require(_0xbb13('0x11'));var authService=require(_0xbb13('0x12'));var qs=require(_0xbb13('0x13'));var as=require(_0xbb13('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbb13('0x15'))(_0xbb13('0x16'));var utils=require(_0xbb13('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbb13('0x18'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0xbb13('0x19')][_0xbb13('0x1a')]({'port':0x232a});function respondWithRpcPromise(_0xb696b9,_0x1531af,_0x558bac,_0x11e664){return new BPromise(function(_0x58f59d,_0x3eda54){var _0x5f1473=_0x11e664||client;return _0x5f1473[_0xbb13('0x1b')](_0xb696b9,_0x558bac)['then'](function(_0x1ee7a6){logger['info'](_0xbb13('0x1c'),_0x1531af,_0xbb13('0x1d'));logger[_0xbb13('0x1e')]('Setting,\x20%s,\x20%s,\x20%s',_0x1531af,'request\x20sent',JSON['stringify'](_0x1ee7a6));if(_0x1ee7a6[_0xbb13('0x1f')]){if(_0x1ee7a6['error']['code']===0x1f4){logger['error'](_0xbb13('0x1c'),_0x1531af,_0x1ee7a6[_0xbb13('0x1f')][_0xbb13('0x20')]);return _0x3eda54(_0x1ee7a6[_0xbb13('0x1f')][_0xbb13('0x20')]);}logger[_0xbb13('0x1f')]('Setting,\x20%s,\x20%s',_0x1531af,_0x1ee7a6[_0xbb13('0x1f')][_0xbb13('0x20')]);return _0x58f59d(_0x1ee7a6[_0xbb13('0x1f')][_0xbb13('0x20')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x1531af,_0xbb13('0x1d'));_0x58f59d(_0x1ee7a6[_0xbb13('0x21')][_0xbb13('0x20')]);}})[_0xbb13('0x22')](function(_0x4ac38f){logger[_0xbb13('0x1f')](_0xbb13('0x1c'),_0x1531af,_0x4ac38f);_0x3eda54(_0x4ac38f);});});}function respondWithStatusCode(_0xc119cc,_0x4d64b7){_0x4d64b7=_0x4d64b7||0xcc;return function(_0x4319c3){if(_0x4319c3){return _0xc119cc['sendStatus'](_0x4d64b7);}return _0xc119cc['status'](_0x4d64b7)[_0xbb13('0x23')]();};}function respondWithResult(_0x2a41a1,_0x2ba6b6){_0x2ba6b6=_0x2ba6b6||0xc8;return function(_0x259e48){if(_0x259e48){return _0x2a41a1[_0xbb13('0x24')](_0x2ba6b6)[_0xbb13('0x25')](_0x259e48);}};}function respondWithFilteredResult(_0xb1063d,_0x3872f3){return function(_0x16e451){if(_0x16e451){var _0x1f8e5b=typeof _0x3872f3[_0xbb13('0x26')]==='undefined'&&typeof _0x3872f3['limit']==='undefined';var _0x4348ae=_0x16e451[_0xbb13('0x27')];var _0x1531cf=_0x1f8e5b?0x0:_0x3872f3[_0xbb13('0x26')];var _0x21b19d=_0x1f8e5b?_0x16e451[_0xbb13('0x27')]:_0x3872f3[_0xbb13('0x26')]+_0x3872f3[_0xbb13('0x28')];var _0x3cb80a;if(_0x21b19d>=_0x4348ae){_0x21b19d=_0x4348ae;_0x3cb80a=0xc8;}else{_0x3cb80a=0xce;}_0xb1063d['status'](_0x3cb80a);return _0xb1063d[_0xbb13('0x29')](_0xbb13('0x2a'),_0x1531cf+'-'+_0x21b19d+'/'+_0x4348ae)[_0xbb13('0x25')](_0x16e451);}return null;};}function patchUpdates(_0x251137){return function(_0x485b27){try{jsonpatch[_0xbb13('0x2b')](_0x485b27,_0x251137,!![]);}catch(_0x51d3b9){return BPromise[_0xbb13('0x2c')](_0x51d3b9);}return _0x485b27[_0xbb13('0x2d')]();};}function saveUpdates(_0x50d62f,_0x3c6f8c){return function(_0x5599e2){if(_0x5599e2){return _0x5599e2[_0xbb13('0x2e')](_0x50d62f)[_0xbb13('0x2f')](function(_0x2192b0){return _0x2192b0;});}return null;};}function removeEntity(_0x1dd82b,_0x2ca22b){return function(_0x87f68c){if(_0x87f68c){return _0x87f68c['destroy']()['then'](function(){_0x1dd82b[_0xbb13('0x24')](0xcc)[_0xbb13('0x23')]();});}};}function handleEntityNotFound(_0x45586f,_0x14014f){return function(_0x53853b){if(!_0x53853b){_0x45586f['sendStatus'](0x194);}return _0x53853b;};}function handleError(_0x3b53ff,_0x21080d){_0x21080d=_0x21080d||0x1f4;return function(_0x4e3501){logger[_0xbb13('0x1f')](_0x4e3501['stack']);if(_0x4e3501[_0xbb13('0x30')]){delete _0x4e3501[_0xbb13('0x30')];}_0x3b53ff['status'](_0x21080d)['send'](_0x4e3501);};}exports[_0xbb13('0x31')]=function(_0x399cc5,_0x51e236){var _0x29e86d={},_0x33dd55={},_0x12a553={'count':0x0,'rows':[]};var _0x380d8c=_[_0xbb13('0x32')](db[_0xbb13('0x33')][_0xbb13('0x34')],function(_0x29d310){return{'name':_0x29d310[_0xbb13('0x35')],'type':_0x29d310[_0xbb13('0x36')][_0xbb13('0x37')]};});_0x33dd55[_0xbb13('0x38')]=_[_0xbb13('0x32')](_0x380d8c,'name');_0x33dd55[_0xbb13('0x39')]=_['keys'](_0x399cc5['query']);_0x33dd55[_0xbb13('0x3a')]=_[_0xbb13('0x3b')](_0x33dd55[_0xbb13('0x38')],_0x33dd55[_0xbb13('0x39')]);_0x29e86d['attributes']=_[_0xbb13('0x3b')](_0x33dd55['model'],qs[_0xbb13('0x3c')](_0x399cc5[_0xbb13('0x39')][_0xbb13('0x3c')]));_0x29e86d[_0xbb13('0x3d')]=_0x29e86d[_0xbb13('0x3d')][_0xbb13('0x3e')]?_0x29e86d[_0xbb13('0x3d')]:_0x33dd55[_0xbb13('0x38')];if(!_0x399cc5[_0xbb13('0x39')][_0xbb13('0x3f')](_0xbb13('0x40'))){_0x29e86d['limit']=qs['limit'](_0x399cc5[_0xbb13('0x39')][_0xbb13('0x28')]);_0x29e86d[_0xbb13('0x26')]=qs[_0xbb13('0x26')](_0x399cc5['query']['offset']);}_0x29e86d['order']=qs[_0xbb13('0x41')](_0x399cc5[_0xbb13('0x39')][_0xbb13('0x41')]);_0x29e86d[_0xbb13('0x42')]=qs['filters'](_[_0xbb13('0x43')](_0x399cc5['query'],_0x33dd55[_0xbb13('0x3a')]),_0x380d8c);if(_0x399cc5[_0xbb13('0x39')]['filter']){_0x29e86d[_0xbb13('0x42')]=_[_0xbb13('0x44')](_0x29e86d[_0xbb13('0x42')],{'$or':_[_0xbb13('0x32')](_0x380d8c,function(_0x4ff149){if(_0x4ff149[_0xbb13('0x36')]!==_0xbb13('0x45')){var _0x22c645={};_0x22c645[_0x4ff149['name']]={'$like':'%'+_0x399cc5[_0xbb13('0x39')][_0xbb13('0x46')]+'%'};return _0x22c645;}})});}_0x29e86d=_[_0xbb13('0x44')]({},_0x29e86d,_0x399cc5[_0xbb13('0x47')]);var _0x4765cb={'where':_0x29e86d[_0xbb13('0x42')]};return db[_0xbb13('0x33')][_0xbb13('0x27')](_0x4765cb)[_0xbb13('0x2f')](function(_0x3aea8d){_0x12a553[_0xbb13('0x27')]=_0x3aea8d;if(_0x399cc5[_0xbb13('0x39')][_0xbb13('0x48')]){_0x29e86d['include']=[{'all':!![]}];}return db[_0xbb13('0x33')][_0xbb13('0x49')](_0x29e86d);})[_0xbb13('0x2f')](function(_0xd03995){_0x12a553[_0xbb13('0x4a')]=_0xd03995;return _0x12a553;})[_0xbb13('0x2f')](respondWithFilteredResult(_0x51e236,_0x29e86d))[_0xbb13('0x22')](handleError(_0x51e236,null));};exports['show']=function(_0x3cd945,_0x225f31){var _0x11875d={'raw':![],'where':{'id':_0x3cd945[_0xbb13('0x4b')]['id']}},_0x2d7716={};_0x2d7716[_0xbb13('0x38')]=_[_0xbb13('0x4c')](db[_0xbb13('0x33')][_0xbb13('0x34')]);_0x2d7716[_0xbb13('0x39')]=_[_0xbb13('0x4c')](_0x3cd945[_0xbb13('0x39')]);_0x2d7716[_0xbb13('0x3a')]=_[_0xbb13('0x3b')](_0x2d7716[_0xbb13('0x38')],_0x2d7716[_0xbb13('0x39')]);_0x11875d[_0xbb13('0x3d')]=_['intersection'](_0x2d7716[_0xbb13('0x38')],qs[_0xbb13('0x3c')](_0x3cd945[_0xbb13('0x39')][_0xbb13('0x3c')]));_0x11875d[_0xbb13('0x3d')]=_0x11875d[_0xbb13('0x3d')][_0xbb13('0x3e')]?_0x11875d[_0xbb13('0x3d')]:_0x2d7716[_0xbb13('0x38')];if(_0x3cd945['query'][_0xbb13('0x48')]){_0x11875d[_0xbb13('0x4d')]=[{'all':!![]}];}_0x11875d=_[_0xbb13('0x44')]({},_0x11875d,_0x3cd945[_0xbb13('0x47')]);return db[_0xbb13('0x33')]['find'](_0x11875d)[_0xbb13('0x2f')](handleEntityNotFound(_0x225f31,null))['then'](respondWithResult(_0x225f31,null))['catch'](handleError(_0x225f31,null));};exports[_0xbb13('0x2e')]=function(_0x3f26ab,_0x45ac80){if(_0x3f26ab['body']['id']){delete _0x3f26ab['body']['id'];}return db['Setting'][_0xbb13('0x4e')]({'where':{'id':_0x3f26ab[_0xbb13('0x4b')]['id']}})['then'](handleEntityNotFound(_0x45ac80,null))[_0xbb13('0x2f')](saveUpdates(_0x3f26ab[_0xbb13('0x4f')],null))[_0xbb13('0x2f')](respondWithResult(_0x45ac80,null))[_0xbb13('0x22')](handleError(_0x45ac80,null));};exports[_0xbb13('0x50')]=function(_0x5312a9,_0x3a664d,_0x590a9f){if(_0x5312a9['file']&&_0x5312a9[_0xbb13('0x51')][_0xbb13('0x52')]){_0x5312a9[_0xbb13('0x4f')][_0xbb13('0x53')]=_0x5312a9[_0xbb13('0x51')][_0xbb13('0x52')];}return db['Setting'][_0xbb13('0x4e')]({'where':{'id':_0x5312a9[_0xbb13('0x4b')]['id']}})[_0xbb13('0x2f')](handleEntityNotFound(_0x3a664d,null))[_0xbb13('0x2f')](saveUpdates(_0x5312a9[_0xbb13('0x4f')],null))[_0xbb13('0x2f')](respondWithResult(_0x3a664d,null))[_0xbb13('0x22')](handleError(_0x3a664d,null));};exports[_0xbb13('0x54')]=function(_0x59a226,_0x2e2f8b,_0x587185){if(_0x59a226['file']&&_0x59a226[_0xbb13('0x51')][_0xbb13('0x52')]){_0x59a226['body'][_0xbb13('0x55')]=_0x59a226[_0xbb13('0x51')][_0xbb13('0x52')];}return db['Setting'][_0xbb13('0x4e')]({'where':{'id':_0x59a226[_0xbb13('0x4b')]['id']}})[_0xbb13('0x2f')](handleEntityNotFound(_0x2e2f8b,null))[_0xbb13('0x2f')](saveUpdates(_0x59a226['body'],null))[_0xbb13('0x2f')](respondWithResult(_0x2e2f8b,null))[_0xbb13('0x22')](handleError(_0x2e2f8b,null));};var utilLicense=require(_0xbb13('0x18'));exports['getLogo']=function(_0x585a05,_0x508007,_0x5846e6){var _0x46c55b=_0xbb13('0x56');var _0x18d148={'custom':![]};return utilLicense[_0xbb13('0x57')]()[_0xbb13('0x2f')](function(_0x19ee96){if(_0x19ee96){_0x18d148=_0x19ee96;}return db['Setting'][_0xbb13('0x4e')]({'where':{'id':_0x585a05['params']['id']},'attributes':[_0xbb13('0x53'),'loginLogo',_0xbb13('0x58'),'favicon',_0xbb13('0x59'),_0xbb13('0x5a'),_0xbb13('0x5b'),_0xbb13('0x5c')],'raw':!![]});})[_0xbb13('0x2f')](handleEntityNotFound(_0x508007,null))[_0xbb13('0x2f')](function(_0x443fe5){if(_0x443fe5){var _0x1e61cd=_0x443fe5[_0xbb13('0x53')]&&fs[_0xbb13('0x5d')](path['join'](config[_0xbb13('0x5e')],_0x46c55b,_[_0xbb13('0x5f')](_0x443fe5[_0xbb13('0x53')])))?path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0x46c55b,_[_0xbb13('0x5f')](_0x443fe5[_0xbb13('0x53')])):path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0x46c55b,_['toLower'](_0xbb13('0x61')));var _0x4e083f=_0xbb13('0x62')+_['upperFirst'](_0xbb13('0x53'));if(_0x443fe5[_0x4e083f]||!_0x18d148[_0xbb13('0x63')]){_0x1e61cd=path['join'](config[_0xbb13('0x5e')],_0x46c55b,_['toLower'](_0xbb13('0x61')));}if(!fs[_0xbb13('0x5d')](_0x1e61cd)){throw new db[(_0xbb13('0x64'))][(_0xbb13('0x65'))](_[_0xbb13('0x66')](_0xbb13('0x53'))+_0xbb13('0x67'));}return _0x508007['download'](_0x1e61cd);}})[_0xbb13('0x22')](handleError(_0x508007,null));};var utilLicense=require(_0xbb13('0x18'));exports[_0xbb13('0x68')]=function(_0x58c8a8,_0x11d612,_0x29092e){var _0x4b5237=_0xbb13('0x56');var _0x9e3fe1={'custom':![]};return utilLicense[_0xbb13('0x57')]()[_0xbb13('0x2f')](function(_0x2df60f){if(_0x2df60f){_0x9e3fe1=_0x2df60f;}return db[_0xbb13('0x33')][_0xbb13('0x4e')]({'where':{'id':_0x58c8a8[_0xbb13('0x4b')]['id']},'attributes':[_0xbb13('0x53'),_0xbb13('0x55'),_0xbb13('0x58'),'favicon',_0xbb13('0x59'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0xbb13('0x2f')](handleEntityNotFound(_0x11d612,null))[_0xbb13('0x2f')](function(_0xa68dd0){if(_0xa68dd0){var _0x3b9fa0=_0xa68dd0[_0xbb13('0x55')]&&fs[_0xbb13('0x5d')](path[_0xbb13('0x60')](config['root'],_0x4b5237,_[_0xbb13('0x5f')](_0xa68dd0['loginLogo'])))?path['join'](config[_0xbb13('0x5e')],_0x4b5237,_['toLower'](_0xa68dd0[_0xbb13('0x55')])):path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0x4b5237,_[_0xbb13('0x5f')](_0xbb13('0x69')));var _0x4e658c='default'+_[_0xbb13('0x66')]('loginLogo');if(_0xa68dd0[_0x4e658c]||!_0x9e3fe1[_0xbb13('0x63')]){_0x3b9fa0=path[_0xbb13('0x60')](config['root'],_0x4b5237,_[_0xbb13('0x5f')](_0xbb13('0x69')));}if(!fs[_0xbb13('0x5d')](_0x3b9fa0)){throw new db['Sequelize'][(_0xbb13('0x65'))](_[_0xbb13('0x66')]('loginLogo')+'\x20not\x20found');}return _0x11d612['download'](_0x3b9fa0);}})[_0xbb13('0x22')](handleError(_0x11d612,null));};exports[_0xbb13('0x6a')]=function(_0x2b0a2a,_0x31ca0e){return db[_0xbb13('0x33')][_0xbb13('0x4e')]({'where':{'id':_0x2b0a2a[_0xbb13('0x4b')]['id']},'attributes':[_0xbb13('0x6b')]})[_0xbb13('0x2f')](respondWithResult(_0x31ca0e,null))[_0xbb13('0x22')](handleError(_0x31ca0e,null));};exports[_0xbb13('0x6c')]=function(_0x3a208e,_0x17108f,_0x458e97){if(_0x3a208e['file']&&_0x3a208e[_0xbb13('0x51')][_0xbb13('0x52')]){_0x3a208e[_0xbb13('0x4f')][_0xbb13('0x58')]=_0x3a208e[_0xbb13('0x51')]['filename'];}return db[_0xbb13('0x33')]['find']({'where':{'id':_0x3a208e[_0xbb13('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17108f,null))['then'](saveUpdates(_0x3a208e[_0xbb13('0x4f')],null))['then'](respondWithResult(_0x17108f,null))[_0xbb13('0x22')](handleError(_0x17108f,null));};var utilLicense=require(_0xbb13('0x18'));exports[_0xbb13('0x6d')]=function(_0x48c191,_0x24b99e,_0x482475){var _0x5eccc9='server/files/images/logos';var _0x556ba7={'custom':![]};return utilLicense[_0xbb13('0x57')]()[_0xbb13('0x2f')](function(_0x4fc595){if(_0x4fc595){_0x556ba7=_0x4fc595;}return db['Setting'][_0xbb13('0x4e')]({'where':{'id':_0x48c191[_0xbb13('0x4b')]['id']},'attributes':['logo',_0xbb13('0x55'),_0xbb13('0x58'),_0xbb13('0x6e'),'defaultLogo',_0xbb13('0x5a'),_0xbb13('0x5b'),_0xbb13('0x5c')],'raw':!![]});})[_0xbb13('0x2f')](handleEntityNotFound(_0x24b99e,null))[_0xbb13('0x2f')](function(_0x3cfe26){if(_0x3cfe26){var _0x2444c7=_0x3cfe26[_0xbb13('0x58')]&&fs[_0xbb13('0x5d')](path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0x5eccc9,_[_0xbb13('0x5f')](_0x3cfe26[_0xbb13('0x58')])))?path['join'](config[_0xbb13('0x5e')],_0x5eccc9,_[_0xbb13('0x5f')](_0x3cfe26[_0xbb13('0x58')])):path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0x5eccc9,_[_0xbb13('0x5f')]('default_preferred.png'));var _0x232315=_0xbb13('0x62')+_[_0xbb13('0x66')]('preferred');if(_0x3cfe26[_0x232315]||!_0x556ba7[_0xbb13('0x63')]||!_0x556ba7[_0xbb13('0x58')]){_0x2444c7=path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0x5eccc9,_[_0xbb13('0x5f')](_0xbb13('0x6f')));}if(!fs[_0xbb13('0x5d')](_0x2444c7)){throw new db[(_0xbb13('0x64'))][(_0xbb13('0x65'))](_['upperFirst']('preferred')+_0xbb13('0x67'));}return _0x24b99e[_0xbb13('0x70')](_0x2444c7);}})[_0xbb13('0x22')](handleError(_0x24b99e,null));};exports[_0xbb13('0x71')]=function(_0x2436f6,_0x19e6c8,_0x1e579b){if(_0x2436f6[_0xbb13('0x51')]&&_0x2436f6[_0xbb13('0x51')]['filename']){_0x2436f6[_0xbb13('0x4f')][_0xbb13('0x6e')]=_0x2436f6[_0xbb13('0x51')][_0xbb13('0x52')];}return db[_0xbb13('0x33')]['find']({'where':{'id':_0x2436f6[_0xbb13('0x4b')]['id']}})[_0xbb13('0x2f')](handleEntityNotFound(_0x19e6c8,null))[_0xbb13('0x2f')](saveUpdates(_0x2436f6[_0xbb13('0x4f')],null))[_0xbb13('0x2f')](respondWithResult(_0x19e6c8,null))[_0xbb13('0x22')](handleError(_0x19e6c8,null));};var utilLicense=require(_0xbb13('0x18'));exports[_0xbb13('0x72')]=function(_0x1282dd,_0xbd302f,_0x426190){var _0xb88f97=_0xbb13('0x56');var _0x11d52c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x57f2b5){if(_0x57f2b5){_0x11d52c=_0x57f2b5;}return db['Setting'][_0xbb13('0x4e')]({'where':{'id':_0x1282dd[_0xbb13('0x4b')]['id']},'attributes':['logo',_0xbb13('0x55'),_0xbb13('0x58'),'favicon',_0xbb13('0x59'),'defaultLoginLogo',_0xbb13('0x5b'),_0xbb13('0x5c')],'raw':!![]});})[_0xbb13('0x2f')](handleEntityNotFound(_0xbd302f,null))[_0xbb13('0x2f')](function(_0x32afce){if(_0x32afce){var _0x439986=_0x32afce['favicon']&&fs[_0xbb13('0x5d')](path['join'](config[_0xbb13('0x5e')],_0xb88f97,_[_0xbb13('0x5f')](_0x32afce[_0xbb13('0x6e')])))?path['join'](config['root'],_0xb88f97,_[_0xbb13('0x5f')](_0x32afce[_0xbb13('0x6e')])):path[_0xbb13('0x60')](config['root'],_0xb88f97,_[_0xbb13('0x5f')](_0xbb13('0x73')));var _0x32ae1e=_0xbb13('0x62')+_['upperFirst'](_0xbb13('0x6e'));if(_0x32afce[_0x32ae1e]||!_0x11d52c[_0xbb13('0x63')]){_0x439986=path[_0xbb13('0x60')](config[_0xbb13('0x5e')],_0xb88f97,_[_0xbb13('0x5f')]('default_favicon.ico'));}if(!fs[_0xbb13('0x5d')](_0x439986)){throw new db[(_0xbb13('0x64'))][(_0xbb13('0x65'))](_['upperFirst']('favicon')+_0xbb13('0x67'));}return _0xbd302f[_0xbb13('0x70')](_0x439986);}})[_0xbb13('0x22')](handleError(_0xbd302f,null));};exports[_0xbb13('0x74')]=function(_0x6e715a,_0x371641){var _0x3932f7={'offset':moment()[_0xbb13('0x75')]()};_0x3932f7[_0xbb13('0x76')]=moment()['utcOffset'](_0x3932f7[_0xbb13('0x26')])[_0xbb13('0x77')](_0xbb13('0x78'));return _0x371641[_0xbb13('0x24')](0xc8)[_0xbb13('0x79')](_0x3932f7);};
\ No newline at end of file