Built motion from commit d1eab355.|2.6.28
[motion2.git] / server / api / setting / setting.controller.js
index 52379c3..518c8f2 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 _0xfa4b=['favicon','default_loginLogo.svg','securePassword','getPreferred','defaultFavicon','default_preferred.png','default','getFavicon','default_favicon.ico','ValidationError','getDate','utcOffset','now','format','YYYY-MM-DD\x20HH:mm:ss:SSS','send','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','fs-extra','lodash','squel','crypto','jsforce','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','jayson/promise','http','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','undefined','limit','count','offset','set','apply','reject','save','update','destroy','stack','name','index','map','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','order','sort','where','pick','VIRTUAL','filter','merge','Setting','includeAll','include','findAll','rows','catch','show','fields','length','options','find','params','body','addLogo','file','filename','loginLogo','getLogo','getLicense','logo','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','join','root','toLower','default_logo.svg','upperFirst','custom','Sequelize','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred'];(function(_0xf7724,_0x192e75){var _0x3383bf=function(_0x2ca8ab){while(--_0x2ca8ab){_0xf7724['push'](_0xf7724['shift']());}};_0x3383bf(++_0x192e75);}(_0xfa4b,0x175));var _0xbfa4=function(_0x4fad99,_0x4e2702){_0x4fad99=_0x4fad99-0x0;var _0x3cdd35=_0xfa4b[_0x4fad99];return _0x3cdd35;};'use strict';var emlformat=require(_0xbfa4('0x0'));var rimraf=require(_0xbfa4('0x1'));var zipdir=require(_0xbfa4('0x2'));var jsonpatch=require(_0xbfa4('0x3'));var rp=require(_0xbfa4('0x4'));var moment=require(_0xbfa4('0x5'));var BPromise=require(_0xbfa4('0x6'));var Mustache=require(_0xbfa4('0x7'));var util=require('util');var path=require(_0xbfa4('0x8'));var sox=require('sox');var csv=require(_0xbfa4('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbfa4('0xa'));var _=require(_0xbfa4('0xb'));var squel=require(_0xbfa4('0xc'));var crypto=require(_0xbfa4('0xd'));var jsforce=require(_0xbfa4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbfa4('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbfa4('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbfa4('0x10'));var logger=require(_0xbfa4('0x11'))(_0xbfa4('0x12'));var utils=require('../../config/utils');var config=require(_0xbfa4('0x13'));var licenseUtil=require(_0xbfa4('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0xbfa4('0x15'));var client=jayson['client'][_0xbfa4('0x16')]({'port':0x232a});function respondWithRpcPromise(_0x39b86e,_0x4bc4e5,_0x166ab9,_0x271f54){return new BPromise(function(_0x318138,_0xd76956){var _0x39b017=_0x271f54||client;return _0x39b017[_0xbfa4('0x17')](_0x39b86e,_0x166ab9)[_0xbfa4('0x18')](function(_0x10c1a4){logger[_0xbfa4('0x19')](_0xbfa4('0x1a'),_0x4bc4e5,_0xbfa4('0x1b'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x4bc4e5,_0xbfa4('0x1b'),JSON[_0xbfa4('0x1c')](_0x10c1a4));if(_0x10c1a4[_0xbfa4('0x1d')]){if(_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1e')]===0x1f4){logger[_0xbfa4('0x1d')](_0xbfa4('0x1a'),_0x4bc4e5,_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);return _0xd76956(_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);}logger['error'](_0xbfa4('0x1a'),_0x4bc4e5,_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);return _0x318138(_0x10c1a4[_0xbfa4('0x1d')][_0xbfa4('0x1f')]);}else{logger['info']('Setting,\x20%s,\x20%s',_0x4bc4e5,_0xbfa4('0x1b'));_0x318138(_0x10c1a4[_0xbfa4('0x20')][_0xbfa4('0x1f')]);}})['catch'](function(_0x3a38b7){logger[_0xbfa4('0x1d')](_0xbfa4('0x1a'),_0x4bc4e5,_0x3a38b7);_0xd76956(_0x3a38b7);});});}function respondWithStatusCode(_0x445946,_0x345617){_0x345617=_0x345617||0xcc;return function(_0x650703){if(_0x650703){return _0x445946[_0xbfa4('0x21')](_0x345617);}return _0x445946[_0xbfa4('0x22')](_0x345617)[_0xbfa4('0x23')]();};}function respondWithResult(_0x305d57,_0x4beaba){_0x4beaba=_0x4beaba||0xc8;return function(_0x45cf52){if(_0x45cf52){return _0x305d57[_0xbfa4('0x22')](_0x4beaba)[_0xbfa4('0x24')](_0x45cf52);}};}function respondWithFilteredResult(_0x5bf280,_0x1aec4c){return function(_0x34ef7b){if(_0x34ef7b){var _0x424a1a=typeof _0x1aec4c['offset']===_0xbfa4('0x25')&&typeof _0x1aec4c[_0xbfa4('0x26')]===_0xbfa4('0x25');var _0x125c04=_0x34ef7b[_0xbfa4('0x27')];var _0x1bff1a=_0x424a1a?0x0:_0x1aec4c['offset'];var _0x4a03fa=_0x424a1a?_0x34ef7b[_0xbfa4('0x27')]:_0x1aec4c[_0xbfa4('0x28')]+_0x1aec4c['limit'];var _0x117056;if(_0x4a03fa>=_0x125c04){_0x4a03fa=_0x125c04;_0x117056=0xc8;}else{_0x117056=0xce;}_0x5bf280[_0xbfa4('0x22')](_0x117056);return _0x5bf280[_0xbfa4('0x29')]('Content-Range',_0x1bff1a+'-'+_0x4a03fa+'/'+_0x125c04)[_0xbfa4('0x24')](_0x34ef7b);}return null;};}function patchUpdates(_0x44d0e1){return function(_0x5ab3eb){try{jsonpatch[_0xbfa4('0x2a')](_0x5ab3eb,_0x44d0e1,!![]);}catch(_0x25518c){return BPromise[_0xbfa4('0x2b')](_0x25518c);}return _0x5ab3eb[_0xbfa4('0x2c')]();};}function saveUpdates(_0x389c8a,_0x4169fb){return function(_0x4540f8){if(_0x4540f8){return _0x4540f8[_0xbfa4('0x2d')](_0x389c8a)[_0xbfa4('0x18')](function(_0x283ee7){return _0x283ee7;});}return null;};}function removeEntity(_0x1041d9,_0xa8b043){return function(_0x31e3a7){if(_0x31e3a7){return _0x31e3a7[_0xbfa4('0x2e')]()[_0xbfa4('0x18')](function(){_0x1041d9['status'](0xcc)[_0xbfa4('0x23')]();});}};}function handleEntityNotFound(_0x3906eb,_0x315e94){return function(_0xf3a3a9){if(!_0xf3a3a9){_0x3906eb[_0xbfa4('0x21')](0x194);}return _0xf3a3a9;};}function handleError(_0x25e6a3,_0x5e4536){_0x5e4536=_0x5e4536||0x1f4;return function(_0x586de0){logger[_0xbfa4('0x1d')](_0x586de0[_0xbfa4('0x2f')]);if(_0x586de0[_0xbfa4('0x30')]){delete _0x586de0[_0xbfa4('0x30')];}_0x25e6a3[_0xbfa4('0x22')](_0x5e4536)['send'](_0x586de0);};}exports[_0xbfa4('0x31')]=function(_0x3283e1,_0x23f9ef){var _0x4b984={},_0x58c308={},_0x4fe5b1={'count':0x0,'rows':[]};var _0xc8ce99=_[_0xbfa4('0x32')](db['Setting'][_0xbfa4('0x33')],function(_0x5dc1b2){return{'name':_0x5dc1b2['fieldName'],'type':_0x5dc1b2[_0xbfa4('0x34')][_0xbfa4('0x35')]};});_0x58c308['model']=_[_0xbfa4('0x32')](_0xc8ce99,_0xbfa4('0x30'));_0x58c308[_0xbfa4('0x36')]=_[_0xbfa4('0x37')](_0x3283e1[_0xbfa4('0x36')]);_0x58c308[_0xbfa4('0x38')]=_[_0xbfa4('0x39')](_0x58c308[_0xbfa4('0x3a')],_0x58c308[_0xbfa4('0x36')]);_0x4b984[_0xbfa4('0x3b')]=_[_0xbfa4('0x39')](_0x58c308['model'],qs['fields'](_0x3283e1['query']['fields']));_0x4b984[_0xbfa4('0x3b')]=_0x4b984[_0xbfa4('0x3b')]['length']?_0x4b984[_0xbfa4('0x3b')]:_0x58c308[_0xbfa4('0x3a')];if(!_0x3283e1[_0xbfa4('0x36')]['hasOwnProperty']('nolimit')){_0x4b984[_0xbfa4('0x26')]=qs['limit'](_0x3283e1[_0xbfa4('0x36')]['limit']);_0x4b984[_0xbfa4('0x28')]=qs['offset'](_0x3283e1[_0xbfa4('0x36')][_0xbfa4('0x28')]);}_0x4b984[_0xbfa4('0x3c')]=qs[_0xbfa4('0x3d')](_0x3283e1['query']['sort']);_0x4b984[_0xbfa4('0x3e')]=qs[_0xbfa4('0x38')](_[_0xbfa4('0x3f')](_0x3283e1[_0xbfa4('0x36')],_0x58c308[_0xbfa4('0x38')]),_0xc8ce99);if(_0x3283e1[_0xbfa4('0x36')]['filter']){_0x4b984[_0xbfa4('0x3e')]=_['merge'](_0x4b984[_0xbfa4('0x3e')],{'$or':_[_0xbfa4('0x32')](_0xc8ce99,function(_0x1c8f67){if(_0x1c8f67['type']!==_0xbfa4('0x40')){var _0x6d715d={};_0x6d715d[_0x1c8f67[_0xbfa4('0x30')]]={'$like':'%'+_0x3283e1['query'][_0xbfa4('0x41')]+'%'};return _0x6d715d;}})});}_0x4b984=_[_0xbfa4('0x42')]({},_0x4b984,_0x3283e1['options']);var _0x2ecde7={'where':_0x4b984[_0xbfa4('0x3e')]};return db[_0xbfa4('0x43')]['count'](_0x2ecde7)[_0xbfa4('0x18')](function(_0x3c8e3b){_0x4fe5b1[_0xbfa4('0x27')]=_0x3c8e3b;if(_0x3283e1[_0xbfa4('0x36')][_0xbfa4('0x44')]){_0x4b984[_0xbfa4('0x45')]=[{'all':!![]}];}return db[_0xbfa4('0x43')][_0xbfa4('0x46')](_0x4b984);})[_0xbfa4('0x18')](function(_0x18a826){_0x4fe5b1[_0xbfa4('0x47')]=_0x18a826;return _0x4fe5b1;})[_0xbfa4('0x18')](respondWithFilteredResult(_0x23f9ef,_0x4b984))[_0xbfa4('0x48')](handleError(_0x23f9ef,null));};exports[_0xbfa4('0x49')]=function(_0x6ea3f,_0x16e1e6){var _0x24edc8={'raw':![],'where':{'id':_0x6ea3f['params']['id']}},_0x33a58b={};_0x33a58b['model']=_[_0xbfa4('0x37')](db[_0xbfa4('0x43')][_0xbfa4('0x33')]);_0x33a58b[_0xbfa4('0x36')]=_[_0xbfa4('0x37')](_0x6ea3f[_0xbfa4('0x36')]);_0x33a58b[_0xbfa4('0x38')]=_[_0xbfa4('0x39')](_0x33a58b[_0xbfa4('0x3a')],_0x33a58b[_0xbfa4('0x36')]);_0x24edc8[_0xbfa4('0x3b')]=_['intersection'](_0x33a58b[_0xbfa4('0x3a')],qs[_0xbfa4('0x4a')](_0x6ea3f[_0xbfa4('0x36')][_0xbfa4('0x4a')]));_0x24edc8[_0xbfa4('0x3b')]=_0x24edc8[_0xbfa4('0x3b')][_0xbfa4('0x4b')]?_0x24edc8['attributes']:_0x33a58b[_0xbfa4('0x3a')];if(_0x6ea3f[_0xbfa4('0x36')]['includeAll']){_0x24edc8[_0xbfa4('0x45')]=[{'all':!![]}];}_0x24edc8=_[_0xbfa4('0x42')]({},_0x24edc8,_0x6ea3f[_0xbfa4('0x4c')]);return db['Setting'][_0xbfa4('0x4d')](_0x24edc8)['then'](handleEntityNotFound(_0x16e1e6,null))[_0xbfa4('0x18')](respondWithResult(_0x16e1e6,null))[_0xbfa4('0x48')](handleError(_0x16e1e6,null));};exports[_0xbfa4('0x2d')]=function(_0x56b695,_0x311335){if(_0x56b695['body']['id']){delete _0x56b695['body']['id'];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x56b695[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x311335,null))['then'](saveUpdates(_0x56b695[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x311335,null))['catch'](handleError(_0x311335,null));};exports[_0xbfa4('0x50')]=function(_0x258c31,_0x39ca27,_0x3f405b){if(_0x258c31[_0xbfa4('0x51')]&&_0x258c31[_0xbfa4('0x51')][_0xbfa4('0x52')]){_0x258c31[_0xbfa4('0x4f')]['logo']=_0x258c31[_0xbfa4('0x51')][_0xbfa4('0x52')];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x258c31[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x39ca27,null))['then'](saveUpdates(_0x258c31[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x39ca27,null))[_0xbfa4('0x48')](handleError(_0x39ca27,null));};exports['addLogoLogin']=function(_0x59ef1e,_0x579e7c,_0x4a7576){if(_0x59ef1e[_0xbfa4('0x51')]&&_0x59ef1e[_0xbfa4('0x51')][_0xbfa4('0x52')]){_0x59ef1e[_0xbfa4('0x4f')][_0xbfa4('0x53')]=_0x59ef1e[_0xbfa4('0x51')][_0xbfa4('0x52')];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x59ef1e[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x579e7c,null))['then'](saveUpdates(_0x59ef1e['body'],null))[_0xbfa4('0x18')](respondWithResult(_0x579e7c,null))['catch'](handleError(_0x579e7c,null));};var utilLicense=require('../../config/license/util');exports[_0xbfa4('0x54')]=function(_0x2cdd39,_0x54789e,_0xa007f2){var _0x22b647='server/files/images/logos';var _0x268018={'custom':![]};return utilLicense[_0xbfa4('0x55')]()['then'](function(_0x42d152){if(_0x42d152){_0x268018=_0x42d152;}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x2cdd39[_0xbfa4('0x4e')]['id']},'attributes':[_0xbfa4('0x56'),_0xbfa4('0x53'),'preferred','favicon',_0xbfa4('0x57'),_0xbfa4('0x58'),_0xbfa4('0x59'),'defaultFavicon'],'raw':!![]});})[_0xbfa4('0x18')](handleEntityNotFound(_0x54789e,null))['then'](function(_0x38348d){if(_0x38348d){var _0x1dcf28=_0x38348d[_0xbfa4('0x56')]&&fs[_0xbfa4('0x5a')](path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x22b647,_[_0xbfa4('0x5d')](_0x38348d[_0xbfa4('0x56')])))?path[_0xbfa4('0x5b')](config['root'],_0x22b647,_['toLower'](_0x38348d[_0xbfa4('0x56')])):path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x22b647,_[_0xbfa4('0x5d')](_0xbfa4('0x5e')));var _0x312260='default'+_[_0xbfa4('0x5f')](_0xbfa4('0x56'));if(_0x38348d[_0x312260]||!_0x268018[_0xbfa4('0x60')]){_0x1dcf28=path[_0xbfa4('0x5b')](config['root'],_0x22b647,_[_0xbfa4('0x5d')](_0xbfa4('0x5e')));}if(!fs['existsSync'](_0x1dcf28)){throw new db[(_0xbfa4('0x61'))]['ValidationError'](_[_0xbfa4('0x5f')](_0xbfa4('0x56'))+_0xbfa4('0x62'));}return _0x54789e[_0xbfa4('0x63')](_0x1dcf28);}})['catch'](handleError(_0x54789e,null));};var utilLicense=require(_0xbfa4('0x14'));exports[_0xbfa4('0x64')]=function(_0x564abd,_0x53248c,_0x3b2d01){var _0x555b26=_0xbfa4('0x65');var _0x1208d9={'custom':![]};return utilLicense[_0xbfa4('0x55')]()[_0xbfa4('0x18')](function(_0x10fae8){if(_0x10fae8){_0x1208d9=_0x10fae8;}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x564abd[_0xbfa4('0x4e')]['id']},'attributes':['logo',_0xbfa4('0x53'),_0xbfa4('0x66'),_0xbfa4('0x67'),_0xbfa4('0x57'),'defaultLoginLogo',_0xbfa4('0x59'),'defaultFavicon'],'raw':!![]});})[_0xbfa4('0x18')](handleEntityNotFound(_0x53248c,null))[_0xbfa4('0x18')](function(_0x13e14a){if(_0x13e14a){var _0x2c3a54=_0x13e14a[_0xbfa4('0x53')]&&fs[_0xbfa4('0x5a')](path['join'](config[_0xbfa4('0x5c')],_0x555b26,_['toLower'](_0x13e14a[_0xbfa4('0x53')])))?path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x555b26,_[_0xbfa4('0x5d')](_0x13e14a['loginLogo'])):path['join'](config[_0xbfa4('0x5c')],_0x555b26,_[_0xbfa4('0x5d')](_0xbfa4('0x68')));var _0x395e4f='default'+_[_0xbfa4('0x5f')](_0xbfa4('0x53'));if(_0x13e14a[_0x395e4f]||!_0x1208d9[_0xbfa4('0x60')]){_0x2c3a54=path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x555b26,_[_0xbfa4('0x5d')]('default_loginLogo.svg'));}if(!fs['existsSync'](_0x2c3a54)){throw new db[(_0xbfa4('0x61'))]['ValidationError'](_['upperFirst'](_0xbfa4('0x53'))+_0xbfa4('0x62'));}return _0x53248c['download'](_0x2c3a54);}})[_0xbfa4('0x48')](handleError(_0x53248c,null));};exports['gdpr']=function(_0x4756d9,_0x3d391b){return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x4756d9['params']['id']},'attributes':[_0xbfa4('0x69')]})[_0xbfa4('0x18')](respondWithResult(_0x3d391b,null))['catch'](handleError(_0x3d391b,null));};exports['addPreferred']=function(_0x191239,_0x1b0f3f,_0x1fa79b){if(_0x191239['file']&&_0x191239['file'][_0xbfa4('0x52')]){_0x191239[_0xbfa4('0x4f')][_0xbfa4('0x66')]=_0x191239[_0xbfa4('0x51')]['filename'];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x191239[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x1b0f3f,null))['then'](saveUpdates(_0x191239[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x1b0f3f,null))[_0xbfa4('0x48')](handleError(_0x1b0f3f,null));};var utilLicense=require(_0xbfa4('0x14'));exports[_0xbfa4('0x6a')]=function(_0x57cb89,_0x392408,_0x254037){var _0x3119fa=_0xbfa4('0x65');var _0x57954d={'custom':![]};return utilLicense[_0xbfa4('0x55')]()[_0xbfa4('0x18')](function(_0x5f4840){if(_0x5f4840){_0x57954d=_0x5f4840;}return db[_0xbfa4('0x43')]['find']({'where':{'id':_0x57cb89[_0xbfa4('0x4e')]['id']},'attributes':[_0xbfa4('0x56'),_0xbfa4('0x53'),_0xbfa4('0x66'),'favicon','defaultLogo',_0xbfa4('0x58'),_0xbfa4('0x59'),_0xbfa4('0x6b')],'raw':!![]});})['then'](handleEntityNotFound(_0x392408,null))['then'](function(_0x16861c){if(_0x16861c){var _0xc568de=_0x16861c['preferred']&&fs[_0xbfa4('0x5a')](path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x3119fa,_[_0xbfa4('0x5d')](_0x16861c[_0xbfa4('0x66')])))?path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x3119fa,_[_0xbfa4('0x5d')](_0x16861c[_0xbfa4('0x66')])):path['join'](config[_0xbfa4('0x5c')],_0x3119fa,_[_0xbfa4('0x5d')](_0xbfa4('0x6c')));var _0x604df8=_0xbfa4('0x6d')+_[_0xbfa4('0x5f')]('preferred');if(_0x16861c[_0x604df8]||!_0x57954d[_0xbfa4('0x60')]||!_0x57954d[_0xbfa4('0x66')]){_0xc568de=path[_0xbfa4('0x5b')](config['root'],_0x3119fa,_['toLower'](_0xbfa4('0x6c')));}if(!fs[_0xbfa4('0x5a')](_0xc568de)){throw new db['Sequelize']['ValidationError'](_[_0xbfa4('0x5f')](_0xbfa4('0x66'))+_0xbfa4('0x62'));}return _0x392408[_0xbfa4('0x63')](_0xc568de);}})[_0xbfa4('0x48')](handleError(_0x392408,null));};exports['addFavicon']=function(_0x87b31e,_0x2a6a6b,_0x4f9f09){if(_0x87b31e[_0xbfa4('0x51')]&&_0x87b31e[_0xbfa4('0x51')][_0xbfa4('0x52')]){_0x87b31e[_0xbfa4('0x4f')][_0xbfa4('0x67')]=_0x87b31e[_0xbfa4('0x51')]['filename'];}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x87b31e[_0xbfa4('0x4e')]['id']}})[_0xbfa4('0x18')](handleEntityNotFound(_0x2a6a6b,null))[_0xbfa4('0x18')](saveUpdates(_0x87b31e[_0xbfa4('0x4f')],null))[_0xbfa4('0x18')](respondWithResult(_0x2a6a6b,null))[_0xbfa4('0x48')](handleError(_0x2a6a6b,null));};var utilLicense=require('../../config/license/util');exports[_0xbfa4('0x6e')]=function(_0x1733e8,_0x30a45d,_0x5a00a7){var _0x5ce9b9=_0xbfa4('0x65');var _0x21d770={'custom':![]};return utilLicense[_0xbfa4('0x55')]()[_0xbfa4('0x18')](function(_0x117172){if(_0x117172){_0x21d770=_0x117172;}return db[_0xbfa4('0x43')][_0xbfa4('0x4d')]({'where':{'id':_0x1733e8[_0xbfa4('0x4e')]['id']},'attributes':[_0xbfa4('0x56'),_0xbfa4('0x53'),_0xbfa4('0x66'),_0xbfa4('0x67'),_0xbfa4('0x57'),_0xbfa4('0x58'),_0xbfa4('0x59'),_0xbfa4('0x6b')],'raw':!![]});})[_0xbfa4('0x18')](handleEntityNotFound(_0x30a45d,null))[_0xbfa4('0x18')](function(_0x34961f){if(_0x34961f){var _0xf00c49=_0x34961f['favicon']&&fs[_0xbfa4('0x5a')](path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x5ce9b9,_[_0xbfa4('0x5d')](_0x34961f[_0xbfa4('0x67')])))?path['join'](config['root'],_0x5ce9b9,_[_0xbfa4('0x5d')](_0x34961f['favicon'])):path['join'](config['root'],_0x5ce9b9,_[_0xbfa4('0x5d')](_0xbfa4('0x6f')));var _0x5662e9=_0xbfa4('0x6d')+_[_0xbfa4('0x5f')]('favicon');if(_0x34961f[_0x5662e9]||!_0x21d770[_0xbfa4('0x60')]){_0xf00c49=path[_0xbfa4('0x5b')](config[_0xbfa4('0x5c')],_0x5ce9b9,_[_0xbfa4('0x5d')](_0xbfa4('0x6f')));}if(!fs[_0xbfa4('0x5a')](_0xf00c49)){throw new db[(_0xbfa4('0x61'))][(_0xbfa4('0x70'))](_[_0xbfa4('0x5f')](_0xbfa4('0x67'))+_0xbfa4('0x62'));}return _0x30a45d[_0xbfa4('0x63')](_0xf00c49);}})[_0xbfa4('0x48')](handleError(_0x30a45d,null));};exports[_0xbfa4('0x71')]=function(_0x34e9bb,_0x474d21){var _0x420c82={'offset':moment()[_0xbfa4('0x72')]()};_0x420c82[_0xbfa4('0x73')]=moment()[_0xbfa4('0x72')](_0x420c82[_0xbfa4('0x28')])[_0xbfa4('0x74')](_0xbfa4('0x75'));return _0x474d21[_0xbfa4('0x22')](0xc8)[_0xbfa4('0x76')](_0x420c82);};
\ No newline at end of file