Built motion from commit da617fac.|2.6.6
[motion2.git] / server / api / setting / setting.controller.js
index 52379c3..ffdf096 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x43f7=['defaultFavicon','root','toLower','join','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','existsSync','default_loginLogo.svg','default','ValidationError','gdpr','securePassword','addPreferred','getPreferred','default_preferred.png','default_favicon.ico','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','fs-extra','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','client','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','status','end','json','offset','undefined','limit','count','apply','update','destroy','sendStatus','stack','name','send','index','map','Setting','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','body','find','params','addLogo','file','filename','addLogoLogin','loginLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred'];(function(_0x5713af,_0x2fb312){var _0x31ef76=function(_0x2c9378){while(--_0x2c9378){_0x5713af['push'](_0x5713af['shift']());}};_0x31ef76(++_0x2fb312);}(_0x43f7,0x8e));var _0x743f=function(_0x3fcedd,_0xc3c004){_0x3fcedd=_0x3fcedd-0x0;var _0x2af2f3=_0x43f7[_0x3fcedd];return _0x2af2f3;};'use strict';var emlformat=require(_0x743f('0x0'));var rimraf=require(_0x743f('0x1'));var zipdir=require(_0x743f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x743f('0x3'));var Mustache=require(_0x743f('0x4'));var util=require(_0x743f('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x743f('0x6'));var ejs=require(_0x743f('0x7'));var fs=require('fs');var fs_extra=require(_0x743f('0x8'));var _=require('lodash');var squel=require(_0x743f('0x9'));var crypto=require(_0x743f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x743f('0xb'));var toCsv=require(_0x743f('0x6'));var querystring=require(_0x743f('0xc'));var Papa=require(_0x743f('0xd'));var Redis=require(_0x743f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x743f('0xf'));var as=require(_0x743f('0x10'));var hardwareService=require(_0x743f('0x11'));var logger=require('../../config/logger')(_0x743f('0x12'));var utils=require(_0x743f('0x13'));var config=require('../../config/environment');var licenseUtil=require(_0x743f('0x14'));var db=require(_0x743f('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x743f('0x16')][_0x743f('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x42fa59,_0xf37fc7,_0x3b9197,_0x9f3e98){return new BPromise(function(_0x2393d1,_0x57016d){var _0x1574f3=_0x9f3e98||client;return _0x1574f3[_0x743f('0x18')](_0x42fa59,_0x3b9197)[_0x743f('0x19')](function(_0x2db8a6){logger[_0x743f('0x1a')](_0x743f('0x1b'),_0xf37fc7,_0x743f('0x1c'));logger[_0x743f('0x1d')](_0x743f('0x1e'),_0xf37fc7,_0x743f('0x1c'),JSON['stringify'](_0x2db8a6));if(_0x2db8a6['error']){if(_0x2db8a6[_0x743f('0x1f')][_0x743f('0x20')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0xf37fc7,_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);return _0x57016d(_0x2db8a6['error']['message']);}logger[_0x743f('0x1f')](_0x743f('0x1b'),_0xf37fc7,_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);return _0x2393d1(_0x2db8a6[_0x743f('0x1f')][_0x743f('0x21')]);}else{logger['info'](_0x743f('0x1b'),_0xf37fc7,_0x743f('0x1c'));_0x2393d1(_0x2db8a6['result'][_0x743f('0x21')]);}})['catch'](function(_0x40332b){logger[_0x743f('0x1f')](_0x743f('0x1b'),_0xf37fc7,_0x40332b);_0x57016d(_0x40332b);});});}function respondWithStatusCode(_0x506a31,_0x1c033c){_0x1c033c=_0x1c033c||0xcc;return function(_0x540f6b){if(_0x540f6b){return _0x506a31['sendStatus'](_0x1c033c);}return _0x506a31[_0x743f('0x22')](_0x1c033c)[_0x743f('0x23')]();};}function respondWithResult(_0x1e5baa,_0x342b65){_0x342b65=_0x342b65||0xc8;return function(_0x4849d7){if(_0x4849d7){return _0x1e5baa[_0x743f('0x22')](_0x342b65)[_0x743f('0x24')](_0x4849d7);}};}function respondWithFilteredResult(_0x187e93,_0x2e9215){return function(_0x5c6313){if(_0x5c6313){var _0xf93c45=typeof _0x2e9215[_0x743f('0x25')]===_0x743f('0x26')&&typeof _0x2e9215[_0x743f('0x27')]===_0x743f('0x26');var _0x305fc2=_0x5c6313['count'];var _0x5dee6d=_0xf93c45?0x0:_0x2e9215['offset'];var _0x16bbb5=_0xf93c45?_0x5c6313[_0x743f('0x28')]:_0x2e9215[_0x743f('0x25')]+_0x2e9215['limit'];var _0x5e39a2;if(_0x16bbb5>=_0x305fc2){_0x16bbb5=_0x305fc2;_0x5e39a2=0xc8;}else{_0x5e39a2=0xce;}_0x187e93[_0x743f('0x22')](_0x5e39a2);return _0x187e93['set']('Content-Range',_0x5dee6d+'-'+_0x16bbb5+'/'+_0x305fc2)[_0x743f('0x24')](_0x5c6313);}return null;};}function patchUpdates(_0x448899){return function(_0x202f9f){try{jsonpatch[_0x743f('0x29')](_0x202f9f,_0x448899,!![]);}catch(_0x17e185){return BPromise['reject'](_0x17e185);}return _0x202f9f['save']();};}function saveUpdates(_0x52cfb1,_0x25160c){return function(_0x2db3f9){if(_0x2db3f9){return _0x2db3f9[_0x743f('0x2a')](_0x52cfb1)['then'](function(_0x463268){return _0x463268;});}return null;};}function removeEntity(_0x59dd3d,_0x328834){return function(_0x48ce5c){if(_0x48ce5c){return _0x48ce5c[_0x743f('0x2b')]()['then'](function(){_0x59dd3d[_0x743f('0x22')](0xcc)[_0x743f('0x23')]();});}};}function handleEntityNotFound(_0x5dfb14,_0x54eb48){return function(_0x33d4ab){if(!_0x33d4ab){_0x5dfb14[_0x743f('0x2c')](0x194);}return _0x33d4ab;};}function handleError(_0x401eea,_0x42eee2){_0x42eee2=_0x42eee2||0x1f4;return function(_0x279318){logger[_0x743f('0x1f')](_0x279318[_0x743f('0x2d')]);if(_0x279318[_0x743f('0x2e')]){delete _0x279318[_0x743f('0x2e')];}_0x401eea[_0x743f('0x22')](_0x42eee2)[_0x743f('0x2f')](_0x279318);};}exports[_0x743f('0x30')]=function(_0xf4cd45,_0x2f59d3){var _0x169074={},_0x54633b={},_0x54c0f1={'count':0x0,'rows':[]};var _0x692233=_[_0x743f('0x31')](db[_0x743f('0x32')][_0x743f('0x33')],function(_0x592738){return{'name':_0x592738[_0x743f('0x34')],'type':_0x592738['type']['key']};});_0x54633b['model']=_[_0x743f('0x31')](_0x692233,_0x743f('0x2e'));_0x54633b[_0x743f('0x35')]=_[_0x743f('0x36')](_0xf4cd45[_0x743f('0x35')]);_0x54633b[_0x743f('0x37')]=_[_0x743f('0x38')](_0x54633b[_0x743f('0x39')],_0x54633b[_0x743f('0x35')]);_0x169074[_0x743f('0x3a')]=_['intersection'](_0x54633b[_0x743f('0x39')],qs[_0x743f('0x3b')](_0xf4cd45['query'][_0x743f('0x3b')]));_0x169074['attributes']=_0x169074['attributes'][_0x743f('0x3c')]?_0x169074['attributes']:_0x54633b[_0x743f('0x39')];if(!_0xf4cd45[_0x743f('0x35')]['hasOwnProperty'](_0x743f('0x3d'))){_0x169074['limit']=qs[_0x743f('0x27')](_0xf4cd45[_0x743f('0x35')][_0x743f('0x27')]);_0x169074['offset']=qs[_0x743f('0x25')](_0xf4cd45[_0x743f('0x35')][_0x743f('0x25')]);}_0x169074['order']=qs[_0x743f('0x3e')](_0xf4cd45['query'][_0x743f('0x3e')]);_0x169074[_0x743f('0x3f')]=qs['filters'](_[_0x743f('0x40')](_0xf4cd45['query'],_0x54633b['filters']),_0x692233);if(_0xf4cd45[_0x743f('0x35')]['filter']){_0x169074[_0x743f('0x3f')]=_[_0x743f('0x41')](_0x169074[_0x743f('0x3f')],{'$or':_[_0x743f('0x31')](_0x692233,function(_0x141b35){if(_0x141b35[_0x743f('0x42')]!==_0x743f('0x43')){var _0x33e453={};_0x33e453[_0x141b35['name']]={'$like':'%'+_0xf4cd45[_0x743f('0x35')][_0x743f('0x44')]+'%'};return _0x33e453;}})});}_0x169074=_['merge']({},_0x169074,_0xf4cd45[_0x743f('0x45')]);var _0x381fe0={'where':_0x169074['where']};return db['Setting'][_0x743f('0x28')](_0x381fe0)[_0x743f('0x19')](function(_0xb09d1a){_0x54c0f1[_0x743f('0x28')]=_0xb09d1a;if(_0xf4cd45[_0x743f('0x35')][_0x743f('0x46')]){_0x169074[_0x743f('0x47')]=[{'all':!![]}];}return db[_0x743f('0x32')][_0x743f('0x48')](_0x169074);})[_0x743f('0x19')](function(_0x3c6678){_0x54c0f1[_0x743f('0x49')]=_0x3c6678;return _0x54c0f1;})['then'](respondWithFilteredResult(_0x2f59d3,_0x169074))[_0x743f('0x4a')](handleError(_0x2f59d3,null));};exports[_0x743f('0x4b')]=function(_0x1916b4,_0x1b5a7f){var _0x944cfc={'raw':![],'where':{'id':_0x1916b4['params']['id']}},_0x59d3bf={};_0x59d3bf[_0x743f('0x39')]=_[_0x743f('0x36')](db['Setting'][_0x743f('0x33')]);_0x59d3bf[_0x743f('0x35')]=_[_0x743f('0x36')](_0x1916b4[_0x743f('0x35')]);_0x59d3bf[_0x743f('0x37')]=_[_0x743f('0x38')](_0x59d3bf[_0x743f('0x39')],_0x59d3bf[_0x743f('0x35')]);_0x944cfc[_0x743f('0x3a')]=_[_0x743f('0x38')](_0x59d3bf['model'],qs[_0x743f('0x3b')](_0x1916b4[_0x743f('0x35')][_0x743f('0x3b')]));_0x944cfc[_0x743f('0x3a')]=_0x944cfc[_0x743f('0x3a')][_0x743f('0x3c')]?_0x944cfc[_0x743f('0x3a')]:_0x59d3bf[_0x743f('0x39')];if(_0x1916b4[_0x743f('0x35')][_0x743f('0x46')]){_0x944cfc[_0x743f('0x47')]=[{'all':!![]}];}_0x944cfc=_[_0x743f('0x41')]({},_0x944cfc,_0x1916b4[_0x743f('0x45')]);return db['Setting']['find'](_0x944cfc)['then'](handleEntityNotFound(_0x1b5a7f,null))[_0x743f('0x19')](respondWithResult(_0x1b5a7f,null))[_0x743f('0x4a')](handleError(_0x1b5a7f,null));};exports[_0x743f('0x2a')]=function(_0x247ef5,_0x303c76){if(_0x247ef5[_0x743f('0x4c')]['id']){delete _0x247ef5[_0x743f('0x4c')]['id'];}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x247ef5[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x303c76,null))[_0x743f('0x19')](saveUpdates(_0x247ef5[_0x743f('0x4c')],null))['then'](respondWithResult(_0x303c76,null))['catch'](handleError(_0x303c76,null));};exports[_0x743f('0x4f')]=function(_0x37e868,_0x13af22,_0xd3addb){if(_0x37e868[_0x743f('0x50')]&&_0x37e868[_0x743f('0x50')][_0x743f('0x51')]){_0x37e868['body']['logo']=_0x37e868[_0x743f('0x50')][_0x743f('0x51')];}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x37e868[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x13af22,null))[_0x743f('0x19')](saveUpdates(_0x37e868['body'],null))['then'](respondWithResult(_0x13af22,null))[_0x743f('0x4a')](handleError(_0x13af22,null));};exports[_0x743f('0x52')]=function(_0x4e336e,_0x4e9ffd,_0x175f08){if(_0x4e336e[_0x743f('0x50')]&&_0x4e336e[_0x743f('0x50')][_0x743f('0x51')]){_0x4e336e[_0x743f('0x4c')][_0x743f('0x53')]=_0x4e336e[_0x743f('0x50')][_0x743f('0x51')];}return db['Setting'][_0x743f('0x4d')]({'where':{'id':_0x4e336e[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x4e9ffd,null))[_0x743f('0x19')](saveUpdates(_0x4e336e[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x4e9ffd,null))[_0x743f('0x4a')](handleError(_0x4e9ffd,null));};var utilLicense=require(_0x743f('0x14'));exports['getLogo']=function(_0x14f576,_0xb8f178,_0x5a3dfb){var _0x48b3ae=_0x743f('0x54');var _0x31d83a={'custom':![]};return utilLicense[_0x743f('0x55')]()['then'](function(_0x376d52){if(_0x376d52){_0x31d83a=_0x376d52;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x14f576[_0x743f('0x4e')]['id']},'attributes':[_0x743f('0x56'),_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),_0x743f('0x5b'),_0x743f('0x5c')],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0xb8f178,null))[_0x743f('0x19')](function(_0x3f3f53){if(_0x3f3f53){var _0x4bd9d5=_0x3f3f53['logo']&&fs['existsSync'](path['join'](config[_0x743f('0x5d')],_0x48b3ae,_[_0x743f('0x5e')](_0x3f3f53[_0x743f('0x56')])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x48b3ae,_['toLower'](_0x3f3f53[_0x743f('0x56')])):path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x48b3ae,_[_0x743f('0x5e')](_0x743f('0x60')));var _0x258935='default'+_[_0x743f('0x61')](_0x743f('0x56'));if(_0x3f3f53[_0x258935]||!_0x31d83a[_0x743f('0x62')]){_0x4bd9d5=path['join'](config['root'],_0x48b3ae,_['toLower'](_0x743f('0x60')));}if(!fs['existsSync'](_0x4bd9d5)){throw new db[(_0x743f('0x63'))]['ValidationError'](_[_0x743f('0x61')](_0x743f('0x56'))+_0x743f('0x64'));}return _0xb8f178[_0x743f('0x65')](_0x4bd9d5);}})[_0x743f('0x4a')](handleError(_0xb8f178,null));};var utilLicense=require(_0x743f('0x14'));exports['getLogoLogin']=function(_0x3d19b6,_0x54de45,_0x58effc){var _0x287b62=_0x743f('0x54');var _0xcdd72e={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x29f6e3){if(_0x29f6e3){_0xcdd72e=_0x29f6e3;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x3d19b6['params']['id']},'attributes':['logo',_0x743f('0x53'),'preferred',_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),'defaultPreferred',_0x743f('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x54de45,null))[_0x743f('0x19')](function(_0xdf82a9){if(_0xdf82a9){var _0x4d08ac=_0xdf82a9['loginLogo']&&fs[_0x743f('0x66')](path['join'](config[_0x743f('0x5d')],_0x287b62,_[_0x743f('0x5e')](_0xdf82a9[_0x743f('0x53')])))?path[_0x743f('0x5f')](config['root'],_0x287b62,_['toLower'](_0xdf82a9['loginLogo'])):path['join'](config[_0x743f('0x5d')],_0x287b62,_[_0x743f('0x5e')](_0x743f('0x67')));var _0x1fe676=_0x743f('0x68')+_['upperFirst'](_0x743f('0x53'));if(_0xdf82a9[_0x1fe676]||!_0xcdd72e[_0x743f('0x62')]){_0x4d08ac=path[_0x743f('0x5f')](config['root'],_0x287b62,_[_0x743f('0x5e')](_0x743f('0x67')));}if(!fs[_0x743f('0x66')](_0x4d08ac)){throw new db['Sequelize'][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x53'))+_0x743f('0x64'));}return _0x54de45['download'](_0x4d08ac);}})['catch'](handleError(_0x54de45,null));};exports[_0x743f('0x6a')]=function(_0x416a0f,_0x511392){return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x416a0f[_0x743f('0x4e')]['id']},'attributes':[_0x743f('0x6b')]})[_0x743f('0x19')](respondWithResult(_0x511392,null))['catch'](handleError(_0x511392,null));};exports[_0x743f('0x6c')]=function(_0x157e6f,_0x2e5598,_0x554d80){if(_0x157e6f['file']&&_0x157e6f['file'][_0x743f('0x51')]){_0x157e6f[_0x743f('0x4c')]['preferred']=_0x157e6f['file'][_0x743f('0x51')];}return db[_0x743f('0x32')]['find']({'where':{'id':_0x157e6f[_0x743f('0x4e')]['id']}})[_0x743f('0x19')](handleEntityNotFound(_0x2e5598,null))['then'](saveUpdates(_0x157e6f[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x2e5598,null))[_0x743f('0x4a')](handleError(_0x2e5598,null));};var utilLicense=require(_0x743f('0x14'));exports[_0x743f('0x6d')]=function(_0x4fa0ce,_0x2545a8,_0x2e702c){var _0x5fb5c2=_0x743f('0x54');var _0x156c04={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x488a86){if(_0x488a86){_0x156c04=_0x488a86;}return db[_0x743f('0x32')]['find']({'where':{'id':_0x4fa0ce['params']['id']},'attributes':['logo',_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),'defaultLogo',_0x743f('0x5a'),_0x743f('0x5b'),_0x743f('0x5c')],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0x2545a8,null))[_0x743f('0x19')](function(_0x2e0cd0){if(_0x2e0cd0){var _0x238eee=_0x2e0cd0['preferred']&&fs['existsSync'](path[_0x743f('0x5f')](config['root'],_0x5fb5c2,_[_0x743f('0x5e')](_0x2e0cd0['preferred'])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x5fb5c2,_[_0x743f('0x5e')](_0x2e0cd0[_0x743f('0x57')])):path[_0x743f('0x5f')](config['root'],_0x5fb5c2,_[_0x743f('0x5e')]('default_preferred.png'));var _0x20c8f7='default'+_[_0x743f('0x61')](_0x743f('0x57'));if(_0x2e0cd0[_0x20c8f7]||!_0x156c04[_0x743f('0x62')]||!_0x156c04['preferred']){_0x238eee=path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x5fb5c2,_[_0x743f('0x5e')](_0x743f('0x6e')));}if(!fs[_0x743f('0x66')](_0x238eee)){throw new db[(_0x743f('0x63'))][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x57'))+_0x743f('0x64'));}return _0x2545a8[_0x743f('0x65')](_0x238eee);}})[_0x743f('0x4a')](handleError(_0x2545a8,null));};exports['addFavicon']=function(_0x2d67f7,_0x27166f,_0x5075b0){if(_0x2d67f7[_0x743f('0x50')]&&_0x2d67f7[_0x743f('0x50')]['filename']){_0x2d67f7[_0x743f('0x4c')][_0x743f('0x58')]=_0x2d67f7['file'][_0x743f('0x51')];}return db['Setting']['find']({'where':{'id':_0x2d67f7['params']['id']}})['then'](handleEntityNotFound(_0x27166f,null))[_0x743f('0x19')](saveUpdates(_0x2d67f7[_0x743f('0x4c')],null))[_0x743f('0x19')](respondWithResult(_0x27166f,null))[_0x743f('0x4a')](handleError(_0x27166f,null));};var utilLicense=require('../../config/license/util');exports['getFavicon']=function(_0x50a9f5,_0x22baf5,_0x29e2b4){var _0x4114b6=_0x743f('0x54');var _0x3aa114={'custom':![]};return utilLicense[_0x743f('0x55')]()[_0x743f('0x19')](function(_0x5b1f8c){if(_0x5b1f8c){_0x3aa114=_0x5b1f8c;}return db[_0x743f('0x32')][_0x743f('0x4d')]({'where':{'id':_0x50a9f5['params']['id']},'attributes':['logo',_0x743f('0x53'),_0x743f('0x57'),_0x743f('0x58'),_0x743f('0x59'),_0x743f('0x5a'),_0x743f('0x5b'),'defaultFavicon'],'raw':!![]});})[_0x743f('0x19')](handleEntityNotFound(_0x22baf5,null))[_0x743f('0x19')](function(_0x1f8dcc){if(_0x1f8dcc){var _0x59675c=_0x1f8dcc[_0x743f('0x58')]&&fs[_0x743f('0x66')](path[_0x743f('0x5f')](config['root'],_0x4114b6,_[_0x743f('0x5e')](_0x1f8dcc[_0x743f('0x58')])))?path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x4114b6,_[_0x743f('0x5e')](_0x1f8dcc[_0x743f('0x58')])):path[_0x743f('0x5f')](config[_0x743f('0x5d')],_0x4114b6,_[_0x743f('0x5e')](_0x743f('0x6f')));var _0x5a7832=_0x743f('0x68')+_['upperFirst']('favicon');if(_0x1f8dcc[_0x5a7832]||!_0x3aa114[_0x743f('0x62')]){_0x59675c=path[_0x743f('0x5f')](config['root'],_0x4114b6,_[_0x743f('0x5e')](_0x743f('0x6f')));}if(!fs[_0x743f('0x66')](_0x59675c)){throw new db['Sequelize'][(_0x743f('0x69'))](_[_0x743f('0x61')](_0x743f('0x58'))+_0x743f('0x64'));}return _0x22baf5[_0x743f('0x65')](_0x59675c);}})[_0x743f('0x4a')](handleError(_0x22baf5,null));};exports[_0x743f('0x70')]=function(_0x4ccb93,_0x5bc760){var _0x509aec={'offset':moment()[_0x743f('0x71')]()};_0x509aec[_0x743f('0x72')]=moment()[_0x743f('0x71')](_0x509aec[_0x743f('0x25')])[_0x743f('0x73')](_0x743f('0x74'));return _0x5bc760[_0x743f('0x22')](0xc8)['send'](_0x509aec);};
\ No newline at end of file
+var _0x8758=['request\x20sent','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','destroy','stack','name','send','map','Setting','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','type','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','update','body','file','logo','filename','addLogoLogin','loginLogo','../../config/license/util','server/files/images/logos','getLicense','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.svg','default','custom','Sequelize','ValidationError','upperFirst','\x20not\x20found','download','getLogoLogin','favicon','default_loginLogo.svg','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','now','YYYY-MM-DD\x20HH:mm:ss:SSS','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','http','request','info','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','Setting,\x20%s,\x20%s','message'];(function(_0x522e32,_0x440e6d){var _0x216842=function(_0x467028){while(--_0x467028){_0x522e32['push'](_0x522e32['shift']());}};_0x216842(++_0x440e6d);}(_0x8758,0x1b8));var _0x8875=function(_0x3e3b7e,_0xe059d0){_0x3e3b7e=_0x3e3b7e-0x0;var _0x5bc606=_0x8758[_0x3e3b7e];return _0x5bc606;};'use strict';var emlformat=require(_0x8875('0x0'));var rimraf=require(_0x8875('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8875('0x2'));var rp=require(_0x8875('0x3'));var moment=require(_0x8875('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8875('0x5'));var util=require(_0x8875('0x6'));var path=require(_0x8875('0x7'));var sox=require(_0x8875('0x8'));var csv=require(_0x8875('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8875('0xa'));var squel=require('squel');var crypto=require(_0x8875('0xb'));var jsforce=require(_0x8875('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x8875('0x9'));var querystring=require(_0x8875('0xd'));var Papa=require('papaparse');var Redis=require(_0x8875('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8875('0xf'));var as=require(_0x8875('0x10'));var hardwareService=require(_0x8875('0x11'));var logger=require(_0x8875('0x12'))('api');var utils=require(_0x8875('0x13'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8875('0x14'))['db'];var jayson=require(_0x8875('0x15'));var client=jayson[_0x8875('0x16')][_0x8875('0x17')]({'port':0x232a});function respondWithRpcPromise(_0x2c9173,_0x5daf11,_0x1d6c56,_0x4b4c61){return new BPromise(function(_0x120f7c,_0x573236){var _0x45d8dc=_0x4b4c61||client;return _0x45d8dc[_0x8875('0x18')](_0x2c9173,_0x1d6c56)['then'](function(_0x1e1987){logger[_0x8875('0x19')]('Setting,\x20%s,\x20%s',_0x5daf11,'request\x20sent');logger[_0x8875('0x1a')](_0x8875('0x1b'),_0x5daf11,'request\x20sent',JSON['stringify'](_0x1e1987));if(_0x1e1987[_0x8875('0x1c')]){if(_0x1e1987['error'][_0x8875('0x1d')]===0x1f4){logger['error'](_0x8875('0x1e'),_0x5daf11,_0x1e1987[_0x8875('0x1c')][_0x8875('0x1f')]);return _0x573236(_0x1e1987[_0x8875('0x1c')][_0x8875('0x1f')]);}logger[_0x8875('0x1c')](_0x8875('0x1e'),_0x5daf11,_0x1e1987[_0x8875('0x1c')][_0x8875('0x1f')]);return _0x120f7c(_0x1e1987[_0x8875('0x1c')]['message']);}else{logger[_0x8875('0x19')](_0x8875('0x1e'),_0x5daf11,_0x8875('0x20'));_0x120f7c(_0x1e1987[_0x8875('0x21')]['message']);}})[_0x8875('0x22')](function(_0x27f186){logger['error'](_0x8875('0x1e'),_0x5daf11,_0x27f186);_0x573236(_0x27f186);});});}function respondWithStatusCode(_0x203318,_0x40d6d9){_0x40d6d9=_0x40d6d9||0xcc;return function(_0x3b4bb0){if(_0x3b4bb0){return _0x203318[_0x8875('0x23')](_0x40d6d9);}return _0x203318[_0x8875('0x24')](_0x40d6d9)['end']();};}function respondWithResult(_0x2c8fff,_0x11e49c){_0x11e49c=_0x11e49c||0xc8;return function(_0x2c0cbc){if(_0x2c0cbc){return _0x2c8fff[_0x8875('0x24')](_0x11e49c)[_0x8875('0x25')](_0x2c0cbc);}};}function respondWithFilteredResult(_0x215adf,_0x58b8a3){return function(_0x13ab7a){if(_0x13ab7a){var _0x2186e2=typeof _0x58b8a3['offset']===_0x8875('0x26')&&typeof _0x58b8a3[_0x8875('0x27')]==='undefined';var _0x22c3e0=_0x13ab7a[_0x8875('0x28')];var _0x54e851=_0x2186e2?0x0:_0x58b8a3[_0x8875('0x29')];var _0x56019c=_0x2186e2?_0x13ab7a['count']:_0x58b8a3[_0x8875('0x29')]+_0x58b8a3[_0x8875('0x27')];var _0x30d471;if(_0x56019c>=_0x22c3e0){_0x56019c=_0x22c3e0;_0x30d471=0xc8;}else{_0x30d471=0xce;}_0x215adf['status'](_0x30d471);return _0x215adf[_0x8875('0x2a')](_0x8875('0x2b'),_0x54e851+'-'+_0x56019c+'/'+_0x22c3e0)[_0x8875('0x25')](_0x13ab7a);}return null;};}function patchUpdates(_0x25fc4c){return function(_0x44a052){try{jsonpatch[_0x8875('0x2c')](_0x44a052,_0x25fc4c,!![]);}catch(_0x8ded96){return BPromise['reject'](_0x8ded96);}return _0x44a052[_0x8875('0x2d')]();};}function saveUpdates(_0x542ab4,_0x270a30){return function(_0x42204d){if(_0x42204d){return _0x42204d['update'](_0x542ab4)[_0x8875('0x2e')](function(_0x3e8152){return _0x3e8152;});}return null;};}function removeEntity(_0x365a2a,_0xcad8c3){return function(_0x2b3e30){if(_0x2b3e30){return _0x2b3e30[_0x8875('0x2f')]()[_0x8875('0x2e')](function(){_0x365a2a[_0x8875('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c78c4,_0x5b9128){return function(_0x55852f){if(!_0x55852f){_0x5c78c4['sendStatus'](0x194);}return _0x55852f;};}function handleError(_0x52f51f,_0x39256e){_0x39256e=_0x39256e||0x1f4;return function(_0x175aa9){logger[_0x8875('0x1c')](_0x175aa9[_0x8875('0x30')]);if(_0x175aa9[_0x8875('0x31')]){delete _0x175aa9[_0x8875('0x31')];}_0x52f51f[_0x8875('0x24')](_0x39256e)[_0x8875('0x32')](_0x175aa9);};}exports['index']=function(_0x259e09,_0x45e095){var _0x4b6922={},_0x38585a={},_0x20083e={'count':0x0,'rows':[]};var _0x428e5b=_[_0x8875('0x33')](db[_0x8875('0x34')][_0x8875('0x35')],function(_0x537464){return{'name':_0x537464['fieldName'],'type':_0x537464['type'][_0x8875('0x36')]};});_0x38585a[_0x8875('0x37')]=_[_0x8875('0x33')](_0x428e5b,_0x8875('0x31'));_0x38585a[_0x8875('0x38')]=_[_0x8875('0x39')](_0x259e09['query']);_0x38585a[_0x8875('0x3a')]=_[_0x8875('0x3b')](_0x38585a['model'],_0x38585a[_0x8875('0x38')]);_0x4b6922[_0x8875('0x3c')]=_[_0x8875('0x3b')](_0x38585a[_0x8875('0x37')],qs['fields'](_0x259e09['query'][_0x8875('0x3d')]));_0x4b6922[_0x8875('0x3c')]=_0x4b6922[_0x8875('0x3c')]['length']?_0x4b6922[_0x8875('0x3c')]:_0x38585a[_0x8875('0x37')];if(!_0x259e09[_0x8875('0x38')][_0x8875('0x3e')](_0x8875('0x3f'))){_0x4b6922['limit']=qs[_0x8875('0x27')](_0x259e09[_0x8875('0x38')][_0x8875('0x27')]);_0x4b6922['offset']=qs['offset'](_0x259e09[_0x8875('0x38')]['offset']);}_0x4b6922['order']=qs['sort'](_0x259e09[_0x8875('0x38')][_0x8875('0x40')]);_0x4b6922[_0x8875('0x41')]=qs[_0x8875('0x3a')](_[_0x8875('0x42')](_0x259e09['query'],_0x38585a[_0x8875('0x3a')]),_0x428e5b);if(_0x259e09['query']['filter']){_0x4b6922[_0x8875('0x41')]=_[_0x8875('0x43')](_0x4b6922[_0x8875('0x41')],{'$or':_['map'](_0x428e5b,function(_0x1ae88e){if(_0x1ae88e[_0x8875('0x44')]!==_0x8875('0x45')){var _0x4bdac5={};_0x4bdac5[_0x1ae88e[_0x8875('0x31')]]={'$like':'%'+_0x259e09[_0x8875('0x38')]['filter']+'%'};return _0x4bdac5;}})});}_0x4b6922=_[_0x8875('0x43')]({},_0x4b6922,_0x259e09[_0x8875('0x46')]);var _0x2cbe70={'where':_0x4b6922[_0x8875('0x41')]};return db[_0x8875('0x34')]['count'](_0x2cbe70)[_0x8875('0x2e')](function(_0x9e8e54){_0x20083e[_0x8875('0x28')]=_0x9e8e54;if(_0x259e09[_0x8875('0x38')]['includeAll']){_0x4b6922[_0x8875('0x47')]=[{'all':!![]}];}return db['Setting'][_0x8875('0x48')](_0x4b6922);})['then'](function(_0x6a11c5){_0x20083e[_0x8875('0x49')]=_0x6a11c5;return _0x20083e;})[_0x8875('0x2e')](respondWithFilteredResult(_0x45e095,_0x4b6922))[_0x8875('0x22')](handleError(_0x45e095,null));};exports[_0x8875('0x4a')]=function(_0x67edf,_0x3754f8){var _0x2f6567={'raw':![],'where':{'id':_0x67edf[_0x8875('0x4b')]['id']}},_0x2c5aed={};_0x2c5aed[_0x8875('0x37')]=_['keys'](db[_0x8875('0x34')]['rawAttributes']);_0x2c5aed[_0x8875('0x38')]=_['keys'](_0x67edf[_0x8875('0x38')]);_0x2c5aed['filters']=_[_0x8875('0x3b')](_0x2c5aed[_0x8875('0x37')],_0x2c5aed['query']);_0x2f6567[_0x8875('0x3c')]=_[_0x8875('0x3b')](_0x2c5aed[_0x8875('0x37')],qs[_0x8875('0x3d')](_0x67edf[_0x8875('0x38')][_0x8875('0x3d')]));_0x2f6567['attributes']=_0x2f6567[_0x8875('0x3c')][_0x8875('0x4c')]?_0x2f6567['attributes']:_0x2c5aed[_0x8875('0x37')];if(_0x67edf[_0x8875('0x38')][_0x8875('0x4d')]){_0x2f6567['include']=[{'all':!![]}];}_0x2f6567=_[_0x8875('0x43')]({},_0x2f6567,_0x67edf['options']);return db[_0x8875('0x34')][_0x8875('0x4e')](_0x2f6567)[_0x8875('0x2e')](handleEntityNotFound(_0x3754f8,null))[_0x8875('0x2e')](respondWithResult(_0x3754f8,null))[_0x8875('0x22')](handleError(_0x3754f8,null));};exports[_0x8875('0x4f')]=function(_0x1177c8,_0x38f8aa){if(_0x1177c8[_0x8875('0x50')]['id']){delete _0x1177c8[_0x8875('0x50')]['id'];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x1177c8[_0x8875('0x4b')]['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0x38f8aa,null))[_0x8875('0x2e')](saveUpdates(_0x1177c8['body'],null))[_0x8875('0x2e')](respondWithResult(_0x38f8aa,null))[_0x8875('0x22')](handleError(_0x38f8aa,null));};exports['addLogo']=function(_0x38b47e,_0x31122d,_0x51ccff){if(_0x38b47e[_0x8875('0x51')]&&_0x38b47e['file']['filename']){_0x38b47e[_0x8875('0x50')][_0x8875('0x52')]=_0x38b47e[_0x8875('0x51')][_0x8875('0x53')];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x38b47e[_0x8875('0x4b')]['id']}})['then'](handleEntityNotFound(_0x31122d,null))[_0x8875('0x2e')](saveUpdates(_0x38b47e[_0x8875('0x50')],null))[_0x8875('0x2e')](respondWithResult(_0x31122d,null))['catch'](handleError(_0x31122d,null));};exports[_0x8875('0x54')]=function(_0x2c2724,_0x420c73,_0x3faa7c){if(_0x2c2724[_0x8875('0x51')]&&_0x2c2724[_0x8875('0x51')][_0x8875('0x53')]){_0x2c2724[_0x8875('0x50')][_0x8875('0x55')]=_0x2c2724[_0x8875('0x51')][_0x8875('0x53')];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x2c2724['params']['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0x420c73,null))[_0x8875('0x2e')](saveUpdates(_0x2c2724[_0x8875('0x50')],null))['then'](respondWithResult(_0x420c73,null))[_0x8875('0x22')](handleError(_0x420c73,null));};var utilLicense=require(_0x8875('0x56'));exports['getLogo']=function(_0xd4e7f1,_0x3c6035,_0x25794f){var _0x4b32d0=_0x8875('0x57');var _0x1d59fb={'custom':![]};return utilLicense[_0x8875('0x58')]()[_0x8875('0x2e')](function(_0x1d26e4){if(_0x1d26e4){_0x1d59fb=_0x1d26e4;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0xd4e7f1[_0x8875('0x4b')]['id']},'attributes':['logo',_0x8875('0x55'),_0x8875('0x59'),'favicon',_0x8875('0x5a'),_0x8875('0x5b'),'defaultPreferred',_0x8875('0x5c')],'raw':!![]});})['then'](handleEntityNotFound(_0x3c6035,null))[_0x8875('0x2e')](function(_0x1ed91b){if(_0x1ed91b){var _0x15aef2=_0x1ed91b[_0x8875('0x52')]&&fs[_0x8875('0x5d')](path[_0x8875('0x5e')](config['root'],_0x4b32d0,_['toLower'](_0x1ed91b['logo'])))?path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x4b32d0,_[_0x8875('0x60')](_0x1ed91b[_0x8875('0x52')])):path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x4b32d0,_[_0x8875('0x60')](_0x8875('0x61')));var _0x331253=_0x8875('0x62')+_['upperFirst'](_0x8875('0x52'));if(_0x1ed91b[_0x331253]||!_0x1d59fb[_0x8875('0x63')]){_0x15aef2=path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x4b32d0,_[_0x8875('0x60')](_0x8875('0x61')));}if(!fs['existsSync'](_0x15aef2)){throw new db[(_0x8875('0x64'))][(_0x8875('0x65'))](_[_0x8875('0x66')]('logo')+_0x8875('0x67'));}return _0x3c6035[_0x8875('0x68')](_0x15aef2);}})['catch'](handleError(_0x3c6035,null));};var utilLicense=require(_0x8875('0x56'));exports[_0x8875('0x69')]=function(_0x3c31aa,_0x5cd3e2,_0x2c0104){var _0x221e43='server/files/images/logos';var _0x2226a2={'custom':![]};return utilLicense['getLicense']()[_0x8875('0x2e')](function(_0x4613a8){if(_0x4613a8){_0x2226a2=_0x4613a8;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x3c31aa[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x52'),_0x8875('0x55'),_0x8875('0x59'),_0x8875('0x6a'),'defaultLogo',_0x8875('0x5b'),'defaultPreferred',_0x8875('0x5c')],'raw':!![]});})[_0x8875('0x2e')](handleEntityNotFound(_0x5cd3e2,null))[_0x8875('0x2e')](function(_0x49ca67){if(_0x49ca67){var _0xc5a54a=_0x49ca67['loginLogo']&&fs[_0x8875('0x5d')](path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x49ca67[_0x8875('0x55')])))?path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x49ca67[_0x8875('0x55')])):path['join'](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x8875('0x6b')));var _0x499965=_0x8875('0x62')+_[_0x8875('0x66')]('loginLogo');if(_0x49ca67[_0x499965]||!_0x2226a2[_0x8875('0x63')]){_0xc5a54a=path['join'](config[_0x8875('0x5f')],_0x221e43,_[_0x8875('0x60')](_0x8875('0x6b')));}if(!fs['existsSync'](_0xc5a54a)){throw new db[(_0x8875('0x64'))][(_0x8875('0x65'))](_['upperFirst']('loginLogo')+_0x8875('0x67'));}return _0x5cd3e2[_0x8875('0x68')](_0xc5a54a);}})[_0x8875('0x22')](handleError(_0x5cd3e2,null));};exports['gdpr']=function(_0x537922,_0x24e16c){return db['Setting'][_0x8875('0x4e')]({'where':{'id':_0x537922[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x6c')]})['then'](respondWithResult(_0x24e16c,null))[_0x8875('0x22')](handleError(_0x24e16c,null));};exports[_0x8875('0x6d')]=function(_0x1ccf01,_0x2dff1c,_0x4f4e1b){if(_0x1ccf01[_0x8875('0x51')]&&_0x1ccf01[_0x8875('0x51')][_0x8875('0x53')]){_0x1ccf01['body'][_0x8875('0x59')]=_0x1ccf01[_0x8875('0x51')]['filename'];}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x1ccf01[_0x8875('0x4b')]['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0x2dff1c,null))[_0x8875('0x2e')](saveUpdates(_0x1ccf01[_0x8875('0x50')],null))['then'](respondWithResult(_0x2dff1c,null))[_0x8875('0x22')](handleError(_0x2dff1c,null));};var utilLicense=require(_0x8875('0x56'));exports[_0x8875('0x6e')]=function(_0x24111a,_0x506f88,_0x36598f){var _0x176d8f=_0x8875('0x57');var _0x39e75c={'custom':![]};return utilLicense['getLicense']()[_0x8875('0x2e')](function(_0x3cf248){if(_0x3cf248){_0x39e75c=_0x3cf248;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x24111a[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x52'),_0x8875('0x55'),_0x8875('0x59'),'favicon',_0x8875('0x5a'),_0x8875('0x5b'),_0x8875('0x6f'),_0x8875('0x5c')],'raw':!![]});})[_0x8875('0x2e')](handleEntityNotFound(_0x506f88,null))['then'](function(_0x12e763){if(_0x12e763){var _0xeb0383=_0x12e763['preferred']&&fs['existsSync'](path[_0x8875('0x5e')](config['root'],_0x176d8f,_[_0x8875('0x60')](_0x12e763[_0x8875('0x59')])))?path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x176d8f,_['toLower'](_0x12e763[_0x8875('0x59')])):path[_0x8875('0x5e')](config['root'],_0x176d8f,_[_0x8875('0x60')](_0x8875('0x70')));var _0x3e4115=_0x8875('0x62')+_[_0x8875('0x66')](_0x8875('0x59'));if(_0x12e763[_0x3e4115]||!_0x39e75c[_0x8875('0x63')]||!_0x39e75c[_0x8875('0x59')]){_0xeb0383=path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x176d8f,_[_0x8875('0x60')](_0x8875('0x70')));}if(!fs[_0x8875('0x5d')](_0xeb0383)){throw new db[(_0x8875('0x64'))][(_0x8875('0x65'))](_[_0x8875('0x66')](_0x8875('0x59'))+_0x8875('0x67'));}return _0x506f88[_0x8875('0x68')](_0xeb0383);}})[_0x8875('0x22')](handleError(_0x506f88,null));};exports[_0x8875('0x71')]=function(_0x2761ae,_0xf2373a,_0x50ccf9){if(_0x2761ae['file']&&_0x2761ae[_0x8875('0x51')][_0x8875('0x53')]){_0x2761ae['body']['favicon']=_0x2761ae[_0x8875('0x51')][_0x8875('0x53')];}return db['Setting']['find']({'where':{'id':_0x2761ae['params']['id']}})[_0x8875('0x2e')](handleEntityNotFound(_0xf2373a,null))['then'](saveUpdates(_0x2761ae[_0x8875('0x50')],null))['then'](respondWithResult(_0xf2373a,null))[_0x8875('0x22')](handleError(_0xf2373a,null));};var utilLicense=require(_0x8875('0x56'));exports[_0x8875('0x72')]=function(_0x2da84c,_0x337c98,_0x21bf97){var _0x3408c1='server/files/images/logos';var _0x320463={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x88e30b){if(_0x88e30b){_0x320463=_0x88e30b;}return db[_0x8875('0x34')][_0x8875('0x4e')]({'where':{'id':_0x2da84c[_0x8875('0x4b')]['id']},'attributes':[_0x8875('0x52'),_0x8875('0x55'),_0x8875('0x59'),_0x8875('0x6a'),_0x8875('0x5a'),_0x8875('0x5b'),_0x8875('0x6f'),_0x8875('0x5c')],'raw':!![]});})[_0x8875('0x2e')](handleEntityNotFound(_0x337c98,null))[_0x8875('0x2e')](function(_0x2c35e9){if(_0x2c35e9){var _0x2f49f3=_0x2c35e9[_0x8875('0x6a')]&&fs[_0x8875('0x5d')](path[_0x8875('0x5e')](config[_0x8875('0x5f')],_0x3408c1,_[_0x8875('0x60')](_0x2c35e9[_0x8875('0x6a')])))?path[_0x8875('0x5e')](config['root'],_0x3408c1,_[_0x8875('0x60')](_0x2c35e9['favicon'])):path[_0x8875('0x5e')](config['root'],_0x3408c1,_[_0x8875('0x60')]('default_favicon.ico'));var _0x28ba07=_0x8875('0x62')+_[_0x8875('0x66')](_0x8875('0x6a'));if(_0x2c35e9[_0x28ba07]||!_0x320463['custom']){_0x2f49f3=path['join'](config[_0x8875('0x5f')],_0x3408c1,_[_0x8875('0x60')](_0x8875('0x73')));}if(!fs['existsSync'](_0x2f49f3)){throw new db['Sequelize']['ValidationError'](_['upperFirst'](_0x8875('0x6a'))+'\x20not\x20found');}return _0x337c98[_0x8875('0x68')](_0x2f49f3);}})[_0x8875('0x22')](handleError(_0x337c98,null));};exports['getDate']=function(_0x2aceaa,_0x16a6e0){var _0x358e57={'offset':moment()['utcOffset']()};_0x358e57[_0x8875('0x74')]=moment()['utcOffset'](_0x358e57[_0x8875('0x29')])['format'](_0x8875('0x75'));return _0x16a6e0['status'](0xc8)[_0x8875('0x32')](_0x358e57);};
\ No newline at end of file