Built motion from commit e02f907f.|2.6.14
[motion2.git] / server / api / setting / setting.controller.js
index 2fa6d1c..b114767 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xa9de=['defaultLoginLogo','defaultPreferred','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','default_loginLogo.svg','default','ValidationError','securePassword','getPreferred','default_preferred.png','addFavicon','favicon','getFavicon','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','jayson/promise','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','Setting,\x20%s,\x20%s','result','catch','sendStatus','status','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','end','stack','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','merge','VIRTUAL','name','filter','options','includeAll','include','Setting','findAll','rows','params','find','body','addLogo','file','filename','logo','server/files/images/logos','getLicense','loginLogo','preferred','defaultLogo'];(function(_0x8fbe89,_0x260590){var _0x30aaf9=function(_0x448876){while(--_0x448876){_0x8fbe89['push'](_0x8fbe89['shift']());}};_0x30aaf9(++_0x260590);}(_0xa9de,0x99));var _0xea9d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa9de[_0x397e5f];return _0x5302b8;};'use strict';var emlformat=require(_0xea9d('0x0'));var rimraf=require(_0xea9d('0x1'));var zipdir=require(_0xea9d('0x2'));var jsonpatch=require(_0xea9d('0x3'));var rp=require('request-promise');var moment=require(_0xea9d('0x4'));var BPromise=require(_0xea9d('0x5'));var Mustache=require(_0xea9d('0x6'));var util=require(_0xea9d('0x7'));var path=require(_0xea9d('0x8'));var sox=require(_0xea9d('0x9'));var csv=require('to-csv');var ejs=require(_0xea9d('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xea9d('0xb'));var crypto=require(_0xea9d('0xc'));var jsforce=require(_0xea9d('0xd'));var deskjs=require(_0xea9d('0xe'));var toCsv=require(_0xea9d('0xf'));var querystring=require(_0xea9d('0x10'));var Papa=require(_0xea9d('0x11'));var Redis=require('ioredis');var authService=require(_0xea9d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xea9d('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xea9d('0x14'));var utils=require(_0xea9d('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xea9d('0x16'));var db=require(_0xea9d('0x17'))['db'];var jayson=require(_0xea9d('0x18'));var client=jayson['client'][_0xea9d('0x19')]({'port':0x232a});function respondWithRpcPromise(_0x4c4440,_0x53a99d,_0x2d9afb,_0x2dc9ab){return new BPromise(function(_0x11d353,_0x1dfd67){var _0x5f4f19=_0x2dc9ab||client;return _0x5f4f19[_0xea9d('0x1a')](_0x4c4440,_0x2d9afb)['then'](function(_0x2635dc){logger[_0xea9d('0x1b')]('Setting,\x20%s,\x20%s',_0x53a99d,_0xea9d('0x1c'));logger[_0xea9d('0x1d')](_0xea9d('0x1e'),_0x53a99d,'request\x20sent',JSON[_0xea9d('0x1f')](_0x2635dc));if(_0x2635dc['error']){if(_0x2635dc['error'][_0xea9d('0x20')]===0x1f4){logger[_0xea9d('0x21')]('Setting,\x20%s,\x20%s',_0x53a99d,_0x2635dc[_0xea9d('0x21')][_0xea9d('0x22')]);return _0x1dfd67(_0x2635dc[_0xea9d('0x21')]['message']);}logger['error'](_0xea9d('0x23'),_0x53a99d,_0x2635dc[_0xea9d('0x21')][_0xea9d('0x22')]);return _0x11d353(_0x2635dc[_0xea9d('0x21')][_0xea9d('0x22')]);}else{logger[_0xea9d('0x1b')](_0xea9d('0x23'),_0x53a99d,'request\x20sent');_0x11d353(_0x2635dc[_0xea9d('0x24')]['message']);}})[_0xea9d('0x25')](function(_0x18a83c){logger['error']('Setting,\x20%s,\x20%s',_0x53a99d,_0x18a83c);_0x1dfd67(_0x18a83c);});});}function respondWithStatusCode(_0x15800f,_0x468115){_0x468115=_0x468115||0xcc;return function(_0x4c3f3c){if(_0x4c3f3c){return _0x15800f[_0xea9d('0x26')](_0x468115);}return _0x15800f[_0xea9d('0x27')](_0x468115)['end']();};}function respondWithResult(_0xe600f5,_0x390c1b){_0x390c1b=_0x390c1b||0xc8;return function(_0x10d09d){if(_0x10d09d){return _0xe600f5[_0xea9d('0x27')](_0x390c1b)['json'](_0x10d09d);}};}function respondWithFilteredResult(_0x571bf0,_0x481e59){return function(_0x533a4d){if(_0x533a4d){var _0x2d27c6=typeof _0x481e59[_0xea9d('0x28')]===_0xea9d('0x29')&&typeof _0x481e59[_0xea9d('0x2a')]===_0xea9d('0x29');var _0x18a049=_0x533a4d['count'];var _0x90ddcf=_0x2d27c6?0x0:_0x481e59[_0xea9d('0x28')];var _0x274539=_0x2d27c6?_0x533a4d[_0xea9d('0x2b')]:_0x481e59[_0xea9d('0x28')]+_0x481e59[_0xea9d('0x2a')];var _0x4fce4d;if(_0x274539>=_0x18a049){_0x274539=_0x18a049;_0x4fce4d=0xc8;}else{_0x4fce4d=0xce;}_0x571bf0['status'](_0x4fce4d);return _0x571bf0[_0xea9d('0x2c')](_0xea9d('0x2d'),_0x90ddcf+'-'+_0x274539+'/'+_0x18a049)[_0xea9d('0x2e')](_0x533a4d);}return null;};}function patchUpdates(_0x482cb8){return function(_0x8b1785){try{jsonpatch[_0xea9d('0x2f')](_0x8b1785,_0x482cb8,!![]);}catch(_0x4872ef){return BPromise['reject'](_0x4872ef);}return _0x8b1785[_0xea9d('0x30')]();};}function saveUpdates(_0x68da46,_0x4f02e5){return function(_0x3c65a5){if(_0x3c65a5){return _0x3c65a5[_0xea9d('0x31')](_0x68da46)[_0xea9d('0x32')](function(_0xf1519d){return _0xf1519d;});}return null;};}function removeEntity(_0x4533e0,_0x4de2ca){return function(_0x484596){if(_0x484596){return _0x484596[_0xea9d('0x33')]()[_0xea9d('0x32')](function(){_0x4533e0['status'](0xcc)[_0xea9d('0x34')]();});}};}function handleEntityNotFound(_0x581d56,_0x20c23b){return function(_0x441d2a){if(!_0x441d2a){_0x581d56['sendStatus'](0x194);}return _0x441d2a;};}function handleError(_0x3326e4,_0x50f032){_0x50f032=_0x50f032||0x1f4;return function(_0x5771b6){logger[_0xea9d('0x21')](_0x5771b6[_0xea9d('0x35')]);if(_0x5771b6['name']){delete _0x5771b6['name'];}_0x3326e4['status'](_0x50f032)['send'](_0x5771b6);};}exports[_0xea9d('0x36')]=function(_0x577a1c,_0x36f044){var _0x2e6904={},_0xad42e1={},_0x39ce5b={'count':0x0,'rows':[]};var _0x29e4b3=_[_0xea9d('0x37')](db['Setting'][_0xea9d('0x38')],function(_0x5d2bde){return{'name':_0x5d2bde[_0xea9d('0x39')],'type':_0x5d2bde[_0xea9d('0x3a')][_0xea9d('0x3b')]};});_0xad42e1[_0xea9d('0x3c')]=_['map'](_0x29e4b3,'name');_0xad42e1[_0xea9d('0x3d')]=_[_0xea9d('0x3e')](_0x577a1c['query']);_0xad42e1[_0xea9d('0x3f')]=_[_0xea9d('0x40')](_0xad42e1[_0xea9d('0x3c')],_0xad42e1[_0xea9d('0x3d')]);_0x2e6904[_0xea9d('0x41')]=_[_0xea9d('0x40')](_0xad42e1['model'],qs[_0xea9d('0x42')](_0x577a1c[_0xea9d('0x3d')]['fields']));_0x2e6904[_0xea9d('0x41')]=_0x2e6904[_0xea9d('0x41')][_0xea9d('0x43')]?_0x2e6904['attributes']:_0xad42e1[_0xea9d('0x3c')];if(!_0x577a1c[_0xea9d('0x3d')]['hasOwnProperty'](_0xea9d('0x44'))){_0x2e6904['limit']=qs[_0xea9d('0x2a')](_0x577a1c[_0xea9d('0x3d')]['limit']);_0x2e6904[_0xea9d('0x28')]=qs['offset'](_0x577a1c[_0xea9d('0x3d')][_0xea9d('0x28')]);}_0x2e6904['order']=qs['sort'](_0x577a1c[_0xea9d('0x3d')][_0xea9d('0x45')]);_0x2e6904[_0xea9d('0x46')]=qs[_0xea9d('0x3f')](_['pick'](_0x577a1c['query'],_0xad42e1[_0xea9d('0x3f')]),_0x29e4b3);if(_0x577a1c[_0xea9d('0x3d')]['filter']){_0x2e6904['where']=_[_0xea9d('0x47')](_0x2e6904[_0xea9d('0x46')],{'$or':_[_0xea9d('0x37')](_0x29e4b3,function(_0x53e0f3){if(_0x53e0f3['type']!==_0xea9d('0x48')){var _0x26b86c={};_0x26b86c[_0x53e0f3[_0xea9d('0x49')]]={'$like':'%'+_0x577a1c[_0xea9d('0x3d')][_0xea9d('0x4a')]+'%'};return _0x26b86c;}})});}_0x2e6904=_['merge']({},_0x2e6904,_0x577a1c[_0xea9d('0x4b')]);var _0x5a51d8={'where':_0x2e6904[_0xea9d('0x46')]};return db['Setting'][_0xea9d('0x2b')](_0x5a51d8)['then'](function(_0x450455){_0x39ce5b[_0xea9d('0x2b')]=_0x450455;if(_0x577a1c[_0xea9d('0x3d')][_0xea9d('0x4c')]){_0x2e6904[_0xea9d('0x4d')]=[{'all':!![]}];}return db[_0xea9d('0x4e')][_0xea9d('0x4f')](_0x2e6904);})[_0xea9d('0x32')](function(_0x173bfb){_0x39ce5b[_0xea9d('0x50')]=_0x173bfb;return _0x39ce5b;})[_0xea9d('0x32')](respondWithFilteredResult(_0x36f044,_0x2e6904))['catch'](handleError(_0x36f044,null));};exports['show']=function(_0xd74d1,_0x424014){var _0x1f3819={'raw':![],'where':{'id':_0xd74d1[_0xea9d('0x51')]['id']}},_0x2a3515={};_0x2a3515['model']=_[_0xea9d('0x3e')](db['Setting'][_0xea9d('0x38')]);_0x2a3515[_0xea9d('0x3d')]=_[_0xea9d('0x3e')](_0xd74d1[_0xea9d('0x3d')]);_0x2a3515[_0xea9d('0x3f')]=_[_0xea9d('0x40')](_0x2a3515['model'],_0x2a3515[_0xea9d('0x3d')]);_0x1f3819[_0xea9d('0x41')]=_[_0xea9d('0x40')](_0x2a3515[_0xea9d('0x3c')],qs[_0xea9d('0x42')](_0xd74d1[_0xea9d('0x3d')][_0xea9d('0x42')]));_0x1f3819[_0xea9d('0x41')]=_0x1f3819[_0xea9d('0x41')][_0xea9d('0x43')]?_0x1f3819[_0xea9d('0x41')]:_0x2a3515[_0xea9d('0x3c')];if(_0xd74d1['query'][_0xea9d('0x4c')]){_0x1f3819[_0xea9d('0x4d')]=[{'all':!![]}];}_0x1f3819=_[_0xea9d('0x47')]({},_0x1f3819,_0xd74d1[_0xea9d('0x4b')]);return db[_0xea9d('0x4e')][_0xea9d('0x52')](_0x1f3819)['then'](handleEntityNotFound(_0x424014,null))[_0xea9d('0x32')](respondWithResult(_0x424014,null))[_0xea9d('0x25')](handleError(_0x424014,null));};exports[_0xea9d('0x31')]=function(_0x3cbb49,_0x4c7aa4){if(_0x3cbb49[_0xea9d('0x53')]['id']){delete _0x3cbb49[_0xea9d('0x53')]['id'];}return db[_0xea9d('0x4e')][_0xea9d('0x52')]({'where':{'id':_0x3cbb49[_0xea9d('0x51')]['id']}})[_0xea9d('0x32')](handleEntityNotFound(_0x4c7aa4,null))[_0xea9d('0x32')](saveUpdates(_0x3cbb49['body'],null))['then'](respondWithResult(_0x4c7aa4,null))[_0xea9d('0x25')](handleError(_0x4c7aa4,null));};exports[_0xea9d('0x54')]=function(_0x16b15a,_0x2d2292,_0x10edcc){if(_0x16b15a[_0xea9d('0x55')]&&_0x16b15a[_0xea9d('0x55')][_0xea9d('0x56')]){_0x16b15a['body'][_0xea9d('0x57')]=_0x16b15a['file'][_0xea9d('0x56')];}return db['Setting'][_0xea9d('0x52')]({'where':{'id':_0x16b15a[_0xea9d('0x51')]['id']}})['then'](handleEntityNotFound(_0x2d2292,null))[_0xea9d('0x32')](saveUpdates(_0x16b15a[_0xea9d('0x53')],null))['then'](respondWithResult(_0x2d2292,null))['catch'](handleError(_0x2d2292,null));};exports['addLogoLogin']=function(_0x279ca9,_0x1851be,_0x298e67){if(_0x279ca9[_0xea9d('0x55')]&&_0x279ca9[_0xea9d('0x55')][_0xea9d('0x56')]){_0x279ca9['body']['loginLogo']=_0x279ca9[_0xea9d('0x55')][_0xea9d('0x56')];}return db[_0xea9d('0x4e')][_0xea9d('0x52')]({'where':{'id':_0x279ca9[_0xea9d('0x51')]['id']}})[_0xea9d('0x32')](handleEntityNotFound(_0x1851be,null))[_0xea9d('0x32')](saveUpdates(_0x279ca9[_0xea9d('0x53')],null))[_0xea9d('0x32')](respondWithResult(_0x1851be,null))[_0xea9d('0x25')](handleError(_0x1851be,null));};var utilLicense=require('../../config/license/util');exports['getLogo']=function(_0x1460a5,_0x46d316,_0x334bd8){var _0x2d4b6a=_0xea9d('0x58');var _0x430a61={'custom':![]};return utilLicense[_0xea9d('0x59')]()[_0xea9d('0x32')](function(_0x37bf59){if(_0x37bf59){_0x430a61=_0x37bf59;}return db['Setting'][_0xea9d('0x52')]({'where':{'id':_0x1460a5[_0xea9d('0x51')]['id']},'attributes':[_0xea9d('0x57'),_0xea9d('0x5a'),_0xea9d('0x5b'),'favicon',_0xea9d('0x5c'),_0xea9d('0x5d'),_0xea9d('0x5e'),_0xea9d('0x5f')],'raw':!![]});})[_0xea9d('0x32')](handleEntityNotFound(_0x46d316,null))[_0xea9d('0x32')](function(_0x45474f){if(_0x45474f){var _0x432dc2=_0x45474f[_0xea9d('0x57')]&&fs[_0xea9d('0x60')](path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x2d4b6a,_['toLower'](_0x45474f[_0xea9d('0x57')])))?path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x2d4b6a,_[_0xea9d('0x63')](_0x45474f[_0xea9d('0x57')])):path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x2d4b6a,_['toLower'](_0xea9d('0x64')));var _0x4e6518='default'+_[_0xea9d('0x65')](_0xea9d('0x57'));if(_0x45474f[_0x4e6518]||!_0x430a61[_0xea9d('0x66')]){_0x432dc2=path['join'](config['root'],_0x2d4b6a,_[_0xea9d('0x63')]('default_logo.svg'));}if(!fs['existsSync'](_0x432dc2)){throw new db[(_0xea9d('0x67'))]['ValidationError'](_[_0xea9d('0x65')](_0xea9d('0x57'))+_0xea9d('0x68'));}return _0x46d316[_0xea9d('0x69')](_0x432dc2);}})['catch'](handleError(_0x46d316,null));};var utilLicense=require(_0xea9d('0x16'));exports[_0xea9d('0x6a')]=function(_0x25b6f3,_0x4e466b,_0x1bda7d){var _0x5d7e82=_0xea9d('0x58');var _0x33fb8c={'custom':![]};return utilLicense[_0xea9d('0x59')]()['then'](function(_0xe5099c){if(_0xe5099c){_0x33fb8c=_0xe5099c;}return db[_0xea9d('0x4e')]['find']({'where':{'id':_0x25b6f3['params']['id']},'attributes':[_0xea9d('0x57'),'loginLogo','preferred','favicon',_0xea9d('0x5c'),_0xea9d('0x5d'),'defaultPreferred',_0xea9d('0x5f')],'raw':!![]});})[_0xea9d('0x32')](handleEntityNotFound(_0x4e466b,null))[_0xea9d('0x32')](function(_0x16e9d3){if(_0x16e9d3){var _0x585d47=_0x16e9d3['loginLogo']&&fs[_0xea9d('0x60')](path[_0xea9d('0x61')](config['root'],_0x5d7e82,_['toLower'](_0x16e9d3['loginLogo'])))?path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x5d7e82,_[_0xea9d('0x63')](_0x16e9d3[_0xea9d('0x5a')])):path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x5d7e82,_[_0xea9d('0x63')](_0xea9d('0x6b')));var _0x2a33dc=_0xea9d('0x6c')+_[_0xea9d('0x65')](_0xea9d('0x5a'));if(_0x16e9d3[_0x2a33dc]||!_0x33fb8c[_0xea9d('0x66')]){_0x585d47=path['join'](config['root'],_0x5d7e82,_[_0xea9d('0x63')](_0xea9d('0x6b')));}if(!fs[_0xea9d('0x60')](_0x585d47)){throw new db[(_0xea9d('0x67'))][(_0xea9d('0x6d'))](_[_0xea9d('0x65')](_0xea9d('0x5a'))+_0xea9d('0x68'));}return _0x4e466b['download'](_0x585d47);}})[_0xea9d('0x25')](handleError(_0x4e466b,null));};exports['gdpr']=function(_0x1c928d,_0x1cf9ed){return db[_0xea9d('0x4e')]['find']({'where':{'id':_0x1c928d[_0xea9d('0x51')]['id']},'attributes':[_0xea9d('0x6e')]})[_0xea9d('0x32')](respondWithResult(_0x1cf9ed,null))[_0xea9d('0x25')](handleError(_0x1cf9ed,null));};exports['addPreferred']=function(_0x3aa67b,_0x4c1502,_0x58cca4){if(_0x3aa67b['file']&&_0x3aa67b[_0xea9d('0x55')]['filename']){_0x3aa67b[_0xea9d('0x53')][_0xea9d('0x5b')]=_0x3aa67b['file'][_0xea9d('0x56')];}return db['Setting'][_0xea9d('0x52')]({'where':{'id':_0x3aa67b[_0xea9d('0x51')]['id']}})[_0xea9d('0x32')](handleEntityNotFound(_0x4c1502,null))[_0xea9d('0x32')](saveUpdates(_0x3aa67b[_0xea9d('0x53')],null))[_0xea9d('0x32')](respondWithResult(_0x4c1502,null))['catch'](handleError(_0x4c1502,null));};var utilLicense=require('../../config/license/util');exports[_0xea9d('0x6f')]=function(_0x401969,_0x321924,_0x339925){var _0x2d5ff9=_0xea9d('0x58');var _0x2cb79a={'custom':![]};return utilLicense[_0xea9d('0x59')]()[_0xea9d('0x32')](function(_0x4ad0d8){if(_0x4ad0d8){_0x2cb79a=_0x4ad0d8;}return db[_0xea9d('0x4e')][_0xea9d('0x52')]({'where':{'id':_0x401969['params']['id']},'attributes':[_0xea9d('0x57'),_0xea9d('0x5a'),_0xea9d('0x5b'),'favicon',_0xea9d('0x5c'),_0xea9d('0x5d'),_0xea9d('0x5e'),_0xea9d('0x5f')],'raw':!![]});})[_0xea9d('0x32')](handleEntityNotFound(_0x321924,null))['then'](function(_0x1ba9b9){if(_0x1ba9b9){var _0x44dfaa=_0x1ba9b9['preferred']&&fs['existsSync'](path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x2d5ff9,_[_0xea9d('0x63')](_0x1ba9b9['preferred'])))?path['join'](config['root'],_0x2d5ff9,_['toLower'](_0x1ba9b9[_0xea9d('0x5b')])):path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x2d5ff9,_[_0xea9d('0x63')]('default_preferred.png'));var _0x5ec9cb=_0xea9d('0x6c')+_[_0xea9d('0x65')](_0xea9d('0x5b'));if(_0x1ba9b9[_0x5ec9cb]||!_0x2cb79a[_0xea9d('0x66')]||!_0x2cb79a['preferred']){_0x44dfaa=path['join'](config[_0xea9d('0x62')],_0x2d5ff9,_['toLower'](_0xea9d('0x70')));}if(!fs[_0xea9d('0x60')](_0x44dfaa)){throw new db[(_0xea9d('0x67'))][(_0xea9d('0x6d'))](_[_0xea9d('0x65')]('preferred')+'\x20not\x20found');}return _0x321924[_0xea9d('0x69')](_0x44dfaa);}})[_0xea9d('0x25')](handleError(_0x321924,null));};exports[_0xea9d('0x71')]=function(_0x3f2631,_0xf0243a,_0x19e457){if(_0x3f2631[_0xea9d('0x55')]&&_0x3f2631[_0xea9d('0x55')]['filename']){_0x3f2631[_0xea9d('0x53')][_0xea9d('0x72')]=_0x3f2631[_0xea9d('0x55')][_0xea9d('0x56')];}return db['Setting'][_0xea9d('0x52')]({'where':{'id':_0x3f2631[_0xea9d('0x51')]['id']}})[_0xea9d('0x32')](handleEntityNotFound(_0xf0243a,null))[_0xea9d('0x32')](saveUpdates(_0x3f2631['body'],null))[_0xea9d('0x32')](respondWithResult(_0xf0243a,null))[_0xea9d('0x25')](handleError(_0xf0243a,null));};var utilLicense=require('../../config/license/util');exports[_0xea9d('0x73')]=function(_0x293693,_0x16a77d,_0x1b9b63){var _0x424e2f=_0xea9d('0x58');var _0x27eea3={'custom':![]};return utilLicense[_0xea9d('0x59')]()[_0xea9d('0x32')](function(_0x3ff6b1){if(_0x3ff6b1){_0x27eea3=_0x3ff6b1;}return db[_0xea9d('0x4e')][_0xea9d('0x52')]({'where':{'id':_0x293693['params']['id']},'attributes':['logo',_0xea9d('0x5a'),_0xea9d('0x5b'),_0xea9d('0x72'),_0xea9d('0x5c'),_0xea9d('0x5d'),_0xea9d('0x5e'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x16a77d,null))[_0xea9d('0x32')](function(_0x383910){if(_0x383910){var _0x516451=_0x383910[_0xea9d('0x72')]&&fs['existsSync'](path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x424e2f,_[_0xea9d('0x63')](_0x383910['favicon'])))?path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x424e2f,_['toLower'](_0x383910[_0xea9d('0x72')])):path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x424e2f,_['toLower'](_0xea9d('0x74')));var _0x397e94=_0xea9d('0x6c')+_[_0xea9d('0x65')](_0xea9d('0x72'));if(_0x383910[_0x397e94]||!_0x27eea3['custom']){_0x516451=path[_0xea9d('0x61')](config[_0xea9d('0x62')],_0x424e2f,_[_0xea9d('0x63')]('default_favicon.ico'));}if(!fs[_0xea9d('0x60')](_0x516451)){throw new db[(_0xea9d('0x67'))]['ValidationError'](_['upperFirst'](_0xea9d('0x72'))+_0xea9d('0x68'));}return _0x16a77d['download'](_0x516451);}})[_0xea9d('0x25')](handleError(_0x16a77d,null));};exports[_0xea9d('0x75')]=function(_0x15d969,_0x481922){var _0x1d55c1={'offset':moment()[_0xea9d('0x76')]()};_0x1d55c1[_0xea9d('0x77')]=moment()['utcOffset'](_0x1d55c1['offset'])[_0xea9d('0x78')](_0xea9d('0x79'));return _0x481922[_0xea9d('0x27')](0xc8)[_0xea9d('0x7a')](_0x1d55c1);};
\ No newline at end of file
+var _0x64e1=['getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','defaultFavicon','logo','join','root','toLower','default_logo.svg','default','custom','existsSync','upperFirst','\x20not\x20found','download','getLogoLogin','loginLogo','default_loginLogo.svg','ValidationError','gdpr','default_preferred.png','Sequelize','addFavicon','getFavicon','default_favicon.ico','getDate','now','utcOffset','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','fast-json-patch','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','save','update','destroy','end','stack','name','send','Setting','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','body','params','addLogo','file','filename','../../config/license/util','server/files/images/logos'];(function(_0x2f253f,_0x5376e4){var _0x5708f9=function(_0x34903a){while(--_0x34903a){_0x2f253f['push'](_0x2f253f['shift']());}};_0x5708f9(++_0x5376e4);}(_0x64e1,0x9a));var _0x164e=function(_0x1614ee,_0x487233){_0x1614ee=_0x1614ee-0x0;var _0x46d6f8=_0x64e1[_0x1614ee];return _0x46d6f8;};'use strict';var emlformat=require(_0x164e('0x0'));var rimraf=require(_0x164e('0x1'));var zipdir=require(_0x164e('0x2'));var jsonpatch=require(_0x164e('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x164e('0x4'));var path=require('path');var sox=require(_0x164e('0x5'));var csv=require(_0x164e('0x6'));var ejs=require(_0x164e('0x7'));var fs=require('fs');var fs_extra=require(_0x164e('0x8'));var _=require(_0x164e('0x9'));var squel=require(_0x164e('0xa'));var crypto=require(_0x164e('0xb'));var jsforce=require(_0x164e('0xc'));var deskjs=require(_0x164e('0xd'));var toCsv=require(_0x164e('0x6'));var querystring=require(_0x164e('0xe'));var Papa=require('papaparse');var Redis=require(_0x164e('0xf'));var authService=require(_0x164e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x164e('0x11'));var hardwareService=require(_0x164e('0x12'));var logger=require(_0x164e('0x13'))(_0x164e('0x14'));var utils=require(_0x164e('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x164e('0x16'))['db'];var jayson=require(_0x164e('0x17'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2d89cf,_0x1aee4f,_0x1da381,_0x4e5404){return new BPromise(function(_0x39bcd7,_0x52bc40){var _0x200cab=_0x4e5404||client;return _0x200cab[_0x164e('0x18')](_0x2d89cf,_0x1da381)[_0x164e('0x19')](function(_0x144f24){logger[_0x164e('0x1a')](_0x164e('0x1b'),_0x1aee4f,'request\x20sent');logger[_0x164e('0x1c')](_0x164e('0x1d'),_0x1aee4f,'request\x20sent',JSON['stringify'](_0x144f24));if(_0x144f24['error']){if(_0x144f24[_0x164e('0x1e')][_0x164e('0x1f')]===0x1f4){logger[_0x164e('0x1e')](_0x164e('0x1b'),_0x1aee4f,_0x144f24['error'][_0x164e('0x20')]);return _0x52bc40(_0x144f24[_0x164e('0x1e')][_0x164e('0x20')]);}logger[_0x164e('0x1e')](_0x164e('0x1b'),_0x1aee4f,_0x144f24[_0x164e('0x1e')][_0x164e('0x20')]);return _0x39bcd7(_0x144f24[_0x164e('0x1e')]['message']);}else{logger[_0x164e('0x1a')](_0x164e('0x1b'),_0x1aee4f,_0x164e('0x21'));_0x39bcd7(_0x144f24[_0x164e('0x22')][_0x164e('0x20')]);}})['catch'](function(_0x3cabdf){logger[_0x164e('0x1e')](_0x164e('0x1b'),_0x1aee4f,_0x3cabdf);_0x52bc40(_0x3cabdf);});});}function respondWithStatusCode(_0x227b1,_0x1f5f5d){_0x1f5f5d=_0x1f5f5d||0xcc;return function(_0x1dea50){if(_0x1dea50){return _0x227b1[_0x164e('0x23')](_0x1f5f5d);}return _0x227b1['status'](_0x1f5f5d)['end']();};}function respondWithResult(_0x48ca3a,_0x2771b2){_0x2771b2=_0x2771b2||0xc8;return function(_0xecb9f9){if(_0xecb9f9){return _0x48ca3a[_0x164e('0x24')](_0x2771b2)[_0x164e('0x25')](_0xecb9f9);}};}function respondWithFilteredResult(_0x1b90e2,_0x16e61c){return function(_0xadcc96){if(_0xadcc96){var _0x14012c=typeof _0x16e61c[_0x164e('0x26')]===_0x164e('0x27')&&typeof _0x16e61c[_0x164e('0x28')]===_0x164e('0x27');var _0x3cb354=_0xadcc96[_0x164e('0x29')];var _0x2e5a43=_0x14012c?0x0:_0x16e61c[_0x164e('0x26')];var _0x2dfd43=_0x14012c?_0xadcc96[_0x164e('0x29')]:_0x16e61c[_0x164e('0x26')]+_0x16e61c[_0x164e('0x28')];var _0x42db4a;if(_0x2dfd43>=_0x3cb354){_0x2dfd43=_0x3cb354;_0x42db4a=0xc8;}else{_0x42db4a=0xce;}_0x1b90e2['status'](_0x42db4a);return _0x1b90e2[_0x164e('0x2a')](_0x164e('0x2b'),_0x2e5a43+'-'+_0x2dfd43+'/'+_0x3cb354)[_0x164e('0x25')](_0xadcc96);}return null;};}function patchUpdates(_0x2bcd9f){return function(_0xb1e720){try{jsonpatch[_0x164e('0x2c')](_0xb1e720,_0x2bcd9f,!![]);}catch(_0x2bd7a0){return BPromise['reject'](_0x2bd7a0);}return _0xb1e720[_0x164e('0x2d')]();};}function saveUpdates(_0x402bff,_0x3c1a6f){return function(_0x5ecc1d){if(_0x5ecc1d){return _0x5ecc1d[_0x164e('0x2e')](_0x402bff)[_0x164e('0x19')](function(_0x3ebf8a){return _0x3ebf8a;});}return null;};}function removeEntity(_0x265ad3,_0x3a29af){return function(_0xc6c4a1){if(_0xc6c4a1){return _0xc6c4a1[_0x164e('0x2f')]()['then'](function(){_0x265ad3[_0x164e('0x24')](0xcc)[_0x164e('0x30')]();});}};}function handleEntityNotFound(_0x370d25,_0xf1b18b){return function(_0x55568f){if(!_0x55568f){_0x370d25[_0x164e('0x23')](0x194);}return _0x55568f;};}function handleError(_0x1be44f,_0x148c41){_0x148c41=_0x148c41||0x1f4;return function(_0x3fa1ad){logger['error'](_0x3fa1ad[_0x164e('0x31')]);if(_0x3fa1ad[_0x164e('0x32')]){delete _0x3fa1ad['name'];}_0x1be44f[_0x164e('0x24')](_0x148c41)[_0x164e('0x33')](_0x3fa1ad);};}exports['index']=function(_0x4fa422,_0x4a9f68){var _0x4186a7={},_0x2810f8={},_0x30c50e={'count':0x0,'rows':[]};var _0x19bb78=_['map'](db[_0x164e('0x34')][_0x164e('0x35')],function(_0x38b011){return{'name':_0x38b011[_0x164e('0x36')],'type':_0x38b011[_0x164e('0x37')]['key']};});_0x2810f8['model']=_['map'](_0x19bb78,_0x164e('0x32'));_0x2810f8[_0x164e('0x38')]=_[_0x164e('0x39')](_0x4fa422['query']);_0x2810f8[_0x164e('0x3a')]=_[_0x164e('0x3b')](_0x2810f8[_0x164e('0x3c')],_0x2810f8[_0x164e('0x38')]);_0x4186a7[_0x164e('0x3d')]=_[_0x164e('0x3b')](_0x2810f8[_0x164e('0x3c')],qs[_0x164e('0x3e')](_0x4fa422[_0x164e('0x38')]['fields']));_0x4186a7[_0x164e('0x3d')]=_0x4186a7['attributes'][_0x164e('0x3f')]?_0x4186a7[_0x164e('0x3d')]:_0x2810f8[_0x164e('0x3c')];if(!_0x4fa422[_0x164e('0x38')][_0x164e('0x40')](_0x164e('0x41'))){_0x4186a7[_0x164e('0x28')]=qs['limit'](_0x4fa422[_0x164e('0x38')][_0x164e('0x28')]);_0x4186a7[_0x164e('0x26')]=qs[_0x164e('0x26')](_0x4fa422[_0x164e('0x38')][_0x164e('0x26')]);}_0x4186a7['order']=qs[_0x164e('0x42')](_0x4fa422[_0x164e('0x38')][_0x164e('0x42')]);_0x4186a7['where']=qs['filters'](_[_0x164e('0x43')](_0x4fa422['query'],_0x2810f8[_0x164e('0x3a')]),_0x19bb78);if(_0x4fa422[_0x164e('0x38')][_0x164e('0x44')]){_0x4186a7[_0x164e('0x45')]=_[_0x164e('0x46')](_0x4186a7[_0x164e('0x45')],{'$or':_[_0x164e('0x47')](_0x19bb78,function(_0x4fa9b8){if(_0x4fa9b8[_0x164e('0x37')]!==_0x164e('0x48')){var _0x5ea575={};_0x5ea575[_0x4fa9b8[_0x164e('0x32')]]={'$like':'%'+_0x4fa422[_0x164e('0x38')]['filter']+'%'};return _0x5ea575;}})});}_0x4186a7=_[_0x164e('0x46')]({},_0x4186a7,_0x4fa422[_0x164e('0x49')]);var _0x46d91e={'where':_0x4186a7[_0x164e('0x45')]};return db[_0x164e('0x34')][_0x164e('0x29')](_0x46d91e)[_0x164e('0x19')](function(_0x527601){_0x30c50e[_0x164e('0x29')]=_0x527601;if(_0x4fa422['query'][_0x164e('0x4a')]){_0x4186a7[_0x164e('0x4b')]=[{'all':!![]}];}return db[_0x164e('0x34')][_0x164e('0x4c')](_0x4186a7);})[_0x164e('0x19')](function(_0x3ebaaa){_0x30c50e[_0x164e('0x4d')]=_0x3ebaaa;return _0x30c50e;})['then'](respondWithFilteredResult(_0x4a9f68,_0x4186a7))[_0x164e('0x4e')](handleError(_0x4a9f68,null));};exports[_0x164e('0x4f')]=function(_0x546278,_0x302e1c){var _0x1629dc={'raw':![],'where':{'id':_0x546278['params']['id']}},_0x4ff435={};_0x4ff435['model']=_['keys'](db[_0x164e('0x34')]['rawAttributes']);_0x4ff435[_0x164e('0x38')]=_['keys'](_0x546278[_0x164e('0x38')]);_0x4ff435[_0x164e('0x3a')]=_[_0x164e('0x3b')](_0x4ff435[_0x164e('0x3c')],_0x4ff435[_0x164e('0x38')]);_0x1629dc[_0x164e('0x3d')]=_[_0x164e('0x3b')](_0x4ff435[_0x164e('0x3c')],qs[_0x164e('0x3e')](_0x546278[_0x164e('0x38')][_0x164e('0x3e')]));_0x1629dc[_0x164e('0x3d')]=_0x1629dc['attributes']['length']?_0x1629dc['attributes']:_0x4ff435['model'];if(_0x546278[_0x164e('0x38')]['includeAll']){_0x1629dc[_0x164e('0x4b')]=[{'all':!![]}];}_0x1629dc=_[_0x164e('0x46')]({},_0x1629dc,_0x546278[_0x164e('0x49')]);return db[_0x164e('0x34')][_0x164e('0x50')](_0x1629dc)[_0x164e('0x19')](handleEntityNotFound(_0x302e1c,null))[_0x164e('0x19')](respondWithResult(_0x302e1c,null))[_0x164e('0x4e')](handleError(_0x302e1c,null));};exports[_0x164e('0x2e')]=function(_0x1f852d,_0x154980){if(_0x1f852d[_0x164e('0x51')]['id']){delete _0x1f852d['body']['id'];}return db[_0x164e('0x34')]['find']({'where':{'id':_0x1f852d[_0x164e('0x52')]['id']}})[_0x164e('0x19')](handleEntityNotFound(_0x154980,null))[_0x164e('0x19')](saveUpdates(_0x1f852d[_0x164e('0x51')],null))[_0x164e('0x19')](respondWithResult(_0x154980,null))[_0x164e('0x4e')](handleError(_0x154980,null));};exports[_0x164e('0x53')]=function(_0x791f46,_0xaf4f29,_0x5cf45e){if(_0x791f46['file']&&_0x791f46[_0x164e('0x54')]['filename']){_0x791f46[_0x164e('0x51')]['logo']=_0x791f46['file'][_0x164e('0x55')];}return db[_0x164e('0x34')][_0x164e('0x50')]({'where':{'id':_0x791f46[_0x164e('0x52')]['id']}})['then'](handleEntityNotFound(_0xaf4f29,null))[_0x164e('0x19')](saveUpdates(_0x791f46[_0x164e('0x51')],null))[_0x164e('0x19')](respondWithResult(_0xaf4f29,null))[_0x164e('0x4e')](handleError(_0xaf4f29,null));};exports['addLogoLogin']=function(_0x45e100,_0x61599c,_0x3d2aec){if(_0x45e100[_0x164e('0x54')]&&_0x45e100[_0x164e('0x54')][_0x164e('0x55')]){_0x45e100['body']['loginLogo']=_0x45e100[_0x164e('0x54')]['filename'];}return db['Setting'][_0x164e('0x50')]({'where':{'id':_0x45e100[_0x164e('0x52')]['id']}})[_0x164e('0x19')](handleEntityNotFound(_0x61599c,null))[_0x164e('0x19')](saveUpdates(_0x45e100[_0x164e('0x51')],null))[_0x164e('0x19')](respondWithResult(_0x61599c,null))[_0x164e('0x4e')](handleError(_0x61599c,null));};var utilLicense=require(_0x164e('0x56'));exports['getLogo']=function(_0x739309,_0x39df07,_0x2ddea5){var _0x57ac81=_0x164e('0x57');var _0x4fbb57={'custom':![]};return utilLicense[_0x164e('0x58')]()['then'](function(_0x136ef4){if(_0x136ef4){_0x4fbb57=_0x136ef4;}return db[_0x164e('0x34')][_0x164e('0x50')]({'where':{'id':_0x739309[_0x164e('0x52')]['id']},'attributes':['logo','loginLogo',_0x164e('0x59'),_0x164e('0x5a'),_0x164e('0x5b'),_0x164e('0x5c'),_0x164e('0x5d'),_0x164e('0x5e')],'raw':!![]});})[_0x164e('0x19')](handleEntityNotFound(_0x39df07,null))[_0x164e('0x19')](function(_0x2b07e8){if(_0x2b07e8){var _0x5ada06=_0x2b07e8[_0x164e('0x5f')]&&fs['existsSync'](path[_0x164e('0x60')](config[_0x164e('0x61')],_0x57ac81,_[_0x164e('0x62')](_0x2b07e8[_0x164e('0x5f')])))?path[_0x164e('0x60')](config[_0x164e('0x61')],_0x57ac81,_[_0x164e('0x62')](_0x2b07e8[_0x164e('0x5f')])):path[_0x164e('0x60')](config['root'],_0x57ac81,_['toLower'](_0x164e('0x63')));var _0xfcbe35=_0x164e('0x64')+_['upperFirst']('logo');if(_0x2b07e8[_0xfcbe35]||!_0x4fbb57[_0x164e('0x65')]){_0x5ada06=path[_0x164e('0x60')](config[_0x164e('0x61')],_0x57ac81,_[_0x164e('0x62')]('default_logo.svg'));}if(!fs[_0x164e('0x66')](_0x5ada06)){throw new db['Sequelize']['ValidationError'](_[_0x164e('0x67')](_0x164e('0x5f'))+_0x164e('0x68'));}return _0x39df07[_0x164e('0x69')](_0x5ada06);}})['catch'](handleError(_0x39df07,null));};var utilLicense=require('../../config/license/util');exports[_0x164e('0x6a')]=function(_0x32b9c7,_0x3e0c4a,_0x3e219a){var _0x3fddaf='server/files/images/logos';var _0x26e1ab={'custom':![]};return utilLicense[_0x164e('0x58')]()['then'](function(_0x3d11a2){if(_0x3d11a2){_0x26e1ab=_0x3d11a2;}return db[_0x164e('0x34')][_0x164e('0x50')]({'where':{'id':_0x32b9c7[_0x164e('0x52')]['id']},'attributes':[_0x164e('0x5f'),_0x164e('0x6b'),_0x164e('0x59'),_0x164e('0x5a'),_0x164e('0x5b'),_0x164e('0x5c'),'defaultPreferred',_0x164e('0x5e')],'raw':!![]});})[_0x164e('0x19')](handleEntityNotFound(_0x3e0c4a,null))['then'](function(_0x3c2cca){if(_0x3c2cca){var _0xbf4796=_0x3c2cca[_0x164e('0x6b')]&&fs['existsSync'](path[_0x164e('0x60')](config['root'],_0x3fddaf,_['toLower'](_0x3c2cca[_0x164e('0x6b')])))?path['join'](config[_0x164e('0x61')],_0x3fddaf,_[_0x164e('0x62')](_0x3c2cca[_0x164e('0x6b')])):path[_0x164e('0x60')](config['root'],_0x3fddaf,_[_0x164e('0x62')](_0x164e('0x6c')));var _0x19d5d5='default'+_[_0x164e('0x67')](_0x164e('0x6b'));if(_0x3c2cca[_0x19d5d5]||!_0x26e1ab[_0x164e('0x65')]){_0xbf4796=path['join'](config[_0x164e('0x61')],_0x3fddaf,_[_0x164e('0x62')]('default_loginLogo.svg'));}if(!fs[_0x164e('0x66')](_0xbf4796)){throw new db['Sequelize'][(_0x164e('0x6d'))](_[_0x164e('0x67')](_0x164e('0x6b'))+_0x164e('0x68'));}return _0x3e0c4a[_0x164e('0x69')](_0xbf4796);}})[_0x164e('0x4e')](handleError(_0x3e0c4a,null));};exports[_0x164e('0x6e')]=function(_0x5ead68,_0x53518a){return db[_0x164e('0x34')][_0x164e('0x50')]({'where':{'id':_0x5ead68['params']['id']},'attributes':['securePassword']})['then'](respondWithResult(_0x53518a,null))[_0x164e('0x4e')](handleError(_0x53518a,null));};exports['addPreferred']=function(_0x2bcfb8,_0x362a0b,_0x14f9f1){if(_0x2bcfb8['file']&&_0x2bcfb8[_0x164e('0x54')][_0x164e('0x55')]){_0x2bcfb8[_0x164e('0x51')][_0x164e('0x59')]=_0x2bcfb8['file'][_0x164e('0x55')];}return db[_0x164e('0x34')][_0x164e('0x50')]({'where':{'id':_0x2bcfb8[_0x164e('0x52')]['id']}})[_0x164e('0x19')](handleEntityNotFound(_0x362a0b,null))['then'](saveUpdates(_0x2bcfb8[_0x164e('0x51')],null))[_0x164e('0x19')](respondWithResult(_0x362a0b,null))[_0x164e('0x4e')](handleError(_0x362a0b,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x4f1c9b,_0x2c10bf,_0x38fddb){var _0xf97fd=_0x164e('0x57');var _0x562e26={'custom':![]};return utilLicense[_0x164e('0x58')]()['then'](function(_0x5569cc){if(_0x5569cc){_0x562e26=_0x5569cc;}return db['Setting']['find']({'where':{'id':_0x4f1c9b[_0x164e('0x52')]['id']},'attributes':[_0x164e('0x5f'),_0x164e('0x6b'),_0x164e('0x59'),_0x164e('0x5a'),_0x164e('0x5b'),_0x164e('0x5c'),_0x164e('0x5d'),_0x164e('0x5e')],'raw':!![]});})[_0x164e('0x19')](handleEntityNotFound(_0x2c10bf,null))[_0x164e('0x19')](function(_0x341a44){if(_0x341a44){var _0x6dfb35=_0x341a44[_0x164e('0x59')]&&fs[_0x164e('0x66')](path[_0x164e('0x60')](config['root'],_0xf97fd,_['toLower'](_0x341a44[_0x164e('0x59')])))?path[_0x164e('0x60')](config[_0x164e('0x61')],_0xf97fd,_[_0x164e('0x62')](_0x341a44[_0x164e('0x59')])):path[_0x164e('0x60')](config[_0x164e('0x61')],_0xf97fd,_['toLower'](_0x164e('0x6f')));var _0x5f9858=_0x164e('0x64')+_[_0x164e('0x67')](_0x164e('0x59'));if(_0x341a44[_0x5f9858]||!_0x562e26[_0x164e('0x65')]||!_0x562e26[_0x164e('0x59')]){_0x6dfb35=path['join'](config[_0x164e('0x61')],_0xf97fd,_['toLower'](_0x164e('0x6f')));}if(!fs['existsSync'](_0x6dfb35)){throw new db[(_0x164e('0x70'))][(_0x164e('0x6d'))](_['upperFirst'](_0x164e('0x59'))+'\x20not\x20found');}return _0x2c10bf[_0x164e('0x69')](_0x6dfb35);}})[_0x164e('0x4e')](handleError(_0x2c10bf,null));};exports[_0x164e('0x71')]=function(_0x1489e3,_0x330828,_0x2e69e1){if(_0x1489e3[_0x164e('0x54')]&&_0x1489e3[_0x164e('0x54')]['filename']){_0x1489e3[_0x164e('0x51')][_0x164e('0x5a')]=_0x1489e3[_0x164e('0x54')]['filename'];}return db['Setting'][_0x164e('0x50')]({'where':{'id':_0x1489e3[_0x164e('0x52')]['id']}})[_0x164e('0x19')](handleEntityNotFound(_0x330828,null))['then'](saveUpdates(_0x1489e3[_0x164e('0x51')],null))[_0x164e('0x19')](respondWithResult(_0x330828,null))[_0x164e('0x4e')](handleError(_0x330828,null));};var utilLicense=require(_0x164e('0x56'));exports[_0x164e('0x72')]=function(_0x8347cd,_0x401125,_0x12a256){var _0x5d306=_0x164e('0x57');var _0x4e6beb={'custom':![]};return utilLicense[_0x164e('0x58')]()[_0x164e('0x19')](function(_0x4dcc9f){if(_0x4dcc9f){_0x4e6beb=_0x4dcc9f;}return db[_0x164e('0x34')][_0x164e('0x50')]({'where':{'id':_0x8347cd[_0x164e('0x52')]['id']},'attributes':[_0x164e('0x5f'),'loginLogo','preferred',_0x164e('0x5a'),_0x164e('0x5b'),_0x164e('0x5c'),'defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x164e('0x19')](handleEntityNotFound(_0x401125,null))[_0x164e('0x19')](function(_0x56bc29){if(_0x56bc29){var _0xe69858=_0x56bc29[_0x164e('0x5a')]&&fs['existsSync'](path['join'](config['root'],_0x5d306,_[_0x164e('0x62')](_0x56bc29[_0x164e('0x5a')])))?path['join'](config[_0x164e('0x61')],_0x5d306,_[_0x164e('0x62')](_0x56bc29[_0x164e('0x5a')])):path['join'](config[_0x164e('0x61')],_0x5d306,_['toLower'](_0x164e('0x73')));var _0x4a95cc=_0x164e('0x64')+_[_0x164e('0x67')](_0x164e('0x5a'));if(_0x56bc29[_0x4a95cc]||!_0x4e6beb[_0x164e('0x65')]){_0xe69858=path['join'](config['root'],_0x5d306,_[_0x164e('0x62')](_0x164e('0x73')));}if(!fs[_0x164e('0x66')](_0xe69858)){throw new db[(_0x164e('0x70'))][(_0x164e('0x6d'))](_[_0x164e('0x67')](_0x164e('0x5a'))+'\x20not\x20found');}return _0x401125[_0x164e('0x69')](_0xe69858);}})[_0x164e('0x4e')](handleError(_0x401125,null));};exports[_0x164e('0x74')]=function(_0x3b387a,_0x2e4aa4){var _0x2c03e4={'offset':moment()['utcOffset']()};_0x2c03e4[_0x164e('0x75')]=moment()[_0x164e('0x76')](_0x2c03e4[_0x164e('0x26')])[_0x164e('0x77')](_0x164e('0x78'));return _0x2e4aa4[_0x164e('0x24')](0xc8)['send'](_0x2c03e4);};
\ No newline at end of file