Built motion from commit ecdc8e66766c75b1b08288b0ea13eb12d42606b4. Version 3.0.0...
[motion-next.git] / server / api / setting / setting.controller.js
index ff0b541..a201ab8 100644 (file)
@@ -1 +1 @@
-const a538_0x148d=['like','defaultLogo','merge','length','filename','then','query','default_preferred.png','preferred','offset','toLower','params','status','path','set','Setting','../../config/environment','limit','getLicense','favicon','rawAttributes','default_loginLogo.svg','join','loginLogo','map','catch','findOne','addPreferred','files/images/logos','findAll','json','root','../../components/parsers/qs','\x20not\x20found','filters','name','fields','type','nolimit','addLogoLogin','stack','count','intersection','update','where','logo','defaultLoginLogo','default_logo.svg','include','getLogo','order','file','sequelize','download','upperFirst','../../config/license/util','options','securePassword','getFavicon','body','sort','default_favicon.ico','default','includeAll','defaultFavicon','addLogo','defaultPreferred','keys','Content-Range','model','undefined','gdpr','existsSync','addFavicon','attributes','filter','custom','api'];(function(_0x5846e6,_0x148d1a){const _0xe8d5b8=function(_0x4dc23d){while(--_0x4dc23d){_0x5846e6['push'](_0x5846e6['shift']());}};_0xe8d5b8(++_0x148d1a);}(a538_0x148d,0xa5));const a538_0xe8d5=function(_0x5846e6,_0x148d1a){_0x5846e6=_0x5846e6-0x0;let _0xe8d5b8=a538_0x148d[_0x5846e6];return _0xe8d5b8;};const _0x489e4e=a538_0xe8d5;'use strict';const path=require(_0x489e4e('0x4')),fs=require('fs'),_=require('lodash'),qs=require(_0x489e4e('0x17')),logger=require('../../config/logger')(_0x489e4e('0x44')),config=require(_0x489e4e('0x7')),db=require('../../mysqldb')['db'],{Op,ValidationError}=require(_0x489e4e('0x2b')),utilLicense=require(_0x489e4e('0x2e'));function respondWithResult(_0x4dc23d,_0xc5cc8a){return _0xc5cc8a=_0xc5cc8a||0xc8,function(_0x29cea8){const _0x5805b9=a538_0xe8d5;if(_0x29cea8)return _0x4dc23d[_0x5805b9('0x3')](_0xc5cc8a)[_0x5805b9('0x15')](_0x29cea8);};}function respondWithFilteredResult(_0x48fb1a,_0xcf5c98){return function(_0x25b34d){const _0x4d4811=a538_0xe8d5;if(_0x25b34d){const _0x425e0e=_0x25b34d[_0x4d4811('0x20')],_0x9e45b3=_0xcf5c98['offset'];let _0x3e5de5=_0xcf5c98['offset']+_0xcf5c98[_0x4d4811('0x8')],_0x7f8cdd;return _0x3e5de5>=_0x425e0e?(_0x3e5de5=_0x425e0e,_0x7f8cdd=0xc8):_0x7f8cdd=0xce,_0x48fb1a[_0x4d4811('0x3')](_0x7f8cdd),_0x48fb1a[_0x4d4811('0x5')](_0x4d4811('0x3b'),_0x9e45b3+'-'+_0x3e5de5+'/'+_0x425e0e)[_0x4d4811('0x15')](_0x25b34d);}return null;};}function saveUpdates(_0x4d0873){return function(_0x2abff3){const _0x14fdbc=a538_0xe8d5;if(_0x2abff3)return _0x2abff3[_0x14fdbc('0x22')](_0x4d0873)[_0x14fdbc('0x4a')](function(_0x125130){return _0x125130;});return null;};}function handleEntityNotFound(_0x1a66cc){return function(_0x5cb5a1){return!_0x5cb5a1&&_0x1a66cc['sendStatus'](0x194),_0x5cb5a1;};}function handleError(_0x4b7e8e,_0x4094d6){return _0x4094d6=_0x4094d6||0x1f4,function(_0x3f35e9){const _0x4d10dc=a538_0xe8d5;logger['error'](_0x3f35e9[_0x4d10dc('0x1f')]),_0x3f35e9[_0x4d10dc('0x1a')]&&delete _0x3f35e9[_0x4d10dc('0x1a')],_0x4b7e8e[_0x4d10dc('0x3')](_0x4094d6)['send'](_0x3f35e9);};}exports['index']=function(_0x1c00f5,_0x153603){const _0x512f74=_0x489e4e;let _0x4f488c={};const _0xfcfbb9={},_0x19c551={'count':0x0,'rows':[]},_0x4bbb29=_[_0x512f74('0xf')](db[_0x512f74('0x6')][_0x512f74('0xb')],function(_0x2fb70f){const _0x2bb336=_0x512f74;return{'name':_0x2fb70f['fieldName'],'type':_0x2fb70f[_0x2bb336('0x1c')]['key']};});_0xfcfbb9[_0x512f74('0x3c')]=_[_0x512f74('0xf')](_0x4bbb29,_0x512f74('0x1a')),_0xfcfbb9['query']=_[_0x512f74('0x3a')](_0x1c00f5['query']),_0xfcfbb9[_0x512f74('0x19')]=_['intersection'](_0xfcfbb9['model'],_0xfcfbb9['query']),_0x4f488c['attributes']=_[_0x512f74('0x21')](_0xfcfbb9[_0x512f74('0x3c')],qs[_0x512f74('0x1b')](_0x1c00f5['query'][_0x512f74('0x1b')])),_0x4f488c[_0x512f74('0x41')]=_0x4f488c[_0x512f74('0x41')]['length']?_0x4f488c['attributes']:_0xfcfbb9['model'];typeof _0x1c00f5[_0x512f74('0x4b')][_0x512f74('0x1d')]===_0x512f74('0x3d')&&(_0x4f488c[_0x512f74('0x8')]=qs[_0x512f74('0x8')](_0x1c00f5[_0x512f74('0x4b')]['limit']),_0x4f488c[_0x512f74('0x0')]=qs[_0x512f74('0x0')](_0x1c00f5[_0x512f74('0x4b')][_0x512f74('0x0')]));_0x4f488c[_0x512f74('0x29')]=qs[_0x512f74('0x33')](_0x1c00f5['query'][_0x512f74('0x33')]),_0x4f488c[_0x512f74('0x23')]=qs[_0x512f74('0x19')](_['pick'](_0x1c00f5[_0x512f74('0x4b')],_0xfcfbb9[_0x512f74('0x19')]),_0x4bbb29);_0x1c00f5[_0x512f74('0x4b')][_0x512f74('0x42')]&&(_0x4f488c[_0x512f74('0x23')]=_[_0x512f74('0x47')](_0x4f488c[_0x512f74('0x23')],{[Op['or']]:_[_0x512f74('0xf')](_0x4bbb29,function(_0x451053){const _0x1bdbda=_0x512f74;if(_0x451053[_0x1bdbda('0x1c')]!=='VIRTUAL'){const _0x490578={};return _0x490578[_0x451053[_0x1bdbda('0x1a')]]={[Op[_0x1bdbda('0x45')]]:'%'+_0x1c00f5[_0x1bdbda('0x4b')][_0x1bdbda('0x42')]+'%'},_0x490578;}})}));_0x4f488c=_[_0x512f74('0x47')]({},_0x4f488c,_0x1c00f5[_0x512f74('0x2f')]);const _0x561fd8={'where':_0x4f488c[_0x512f74('0x23')]};return db[_0x512f74('0x6')][_0x512f74('0x20')](_0x561fd8)[_0x512f74('0x4a')](function(_0xe86604){const _0x54a107=_0x512f74;return _0x19c551[_0x54a107('0x20')]=_0xe86604,_0x1c00f5[_0x54a107('0x4b')][_0x54a107('0x36')]&&(_0x4f488c[_0x54a107('0x27')]=[{'all':!![]}]),db[_0x54a107('0x6')][_0x54a107('0x14')](_0x4f488c);})[_0x512f74('0x4a')](function(_0x357d3d){return _0x19c551['rows']=_0x357d3d,_0x19c551;})[_0x512f74('0x4a')](respondWithFilteredResult(_0x153603,_0x4f488c))[_0x512f74('0x10')](handleError(_0x153603,null));},exports['show']=function(_0x17628e,_0x2e17aa){const _0x19996f=_0x489e4e;let _0x1e8ef8={'raw':![],'where':{'id':_0x17628e[_0x19996f('0x2')]['id']}};const _0x130ef5={};return _0x130ef5[_0x19996f('0x3c')]=_[_0x19996f('0x3a')](db['Setting']['rawAttributes']),_0x130ef5[_0x19996f('0x4b')]=_[_0x19996f('0x3a')](_0x17628e[_0x19996f('0x4b')]),_0x130ef5['filters']=_[_0x19996f('0x21')](_0x130ef5[_0x19996f('0x3c')],_0x130ef5['query']),_0x1e8ef8[_0x19996f('0x41')]=_['intersection'](_0x130ef5['model'],qs[_0x19996f('0x1b')](_0x17628e[_0x19996f('0x4b')][_0x19996f('0x1b')])),_0x1e8ef8[_0x19996f('0x41')]=_0x1e8ef8['attributes'][_0x19996f('0x48')]?_0x1e8ef8[_0x19996f('0x41')]:_0x130ef5['model'],_0x17628e[_0x19996f('0x4b')]['includeAll']&&(_0x1e8ef8[_0x19996f('0x27')]=[{'all':!![]}]),_0x1e8ef8=_[_0x19996f('0x47')]({},_0x1e8ef8,_0x17628e[_0x19996f('0x2f')]),db['Setting'][_0x19996f('0x11')](_0x1e8ef8)[_0x19996f('0x4a')](handleEntityNotFound(_0x2e17aa,null))[_0x19996f('0x4a')](respondWithResult(_0x2e17aa,null))['catch'](handleError(_0x2e17aa,null));},exports[_0x489e4e('0x22')]=function(_0x4a57c4,_0x593914){const _0x3edced=_0x489e4e;return _0x4a57c4[_0x3edced('0x32')]['id']&&delete _0x4a57c4['body']['id'],db[_0x3edced('0x6')][_0x3edced('0x11')]({'where':{'id':_0x4a57c4['params']['id']}})['then'](handleEntityNotFound(_0x593914,null))['then'](saveUpdates(_0x4a57c4['body'],null))[_0x3edced('0x4a')](respondWithResult(_0x593914,null))[_0x3edced('0x10')](handleError(_0x593914,null));},exports[_0x489e4e('0x38')]=function(_0x19319e,_0x3ffaff){const _0x41f82b=_0x489e4e;return _0x19319e['file']&&_0x19319e[_0x41f82b('0x2a')][_0x41f82b('0x49')]&&(_0x19319e['body'][_0x41f82b('0x24')]=_0x19319e['file'][_0x41f82b('0x49')]),db['Setting'][_0x41f82b('0x11')]({'where':{'id':_0x19319e[_0x41f82b('0x2')]['id']}})[_0x41f82b('0x4a')](handleEntityNotFound(_0x3ffaff,null))[_0x41f82b('0x4a')](saveUpdates(_0x19319e[_0x41f82b('0x32')],null))[_0x41f82b('0x4a')](respondWithResult(_0x3ffaff,null))[_0x41f82b('0x10')](handleError(_0x3ffaff,null));},exports[_0x489e4e('0x1e')]=function(_0x1bc119,_0x1a225f){const _0x1916e3=_0x489e4e;return _0x1bc119[_0x1916e3('0x2a')]&&_0x1bc119['file'][_0x1916e3('0x49')]&&(_0x1bc119['body']['loginLogo']=_0x1bc119[_0x1916e3('0x2a')][_0x1916e3('0x49')]),db[_0x1916e3('0x6')][_0x1916e3('0x11')]({'where':{'id':_0x1bc119[_0x1916e3('0x2')]['id']}})[_0x1916e3('0x4a')](handleEntityNotFound(_0x1a225f,null))[_0x1916e3('0x4a')](saveUpdates(_0x1bc119[_0x1916e3('0x32')],null))[_0x1916e3('0x4a')](respondWithResult(_0x1a225f,null))[_0x1916e3('0x10')](handleError(_0x1a225f,null));},exports[_0x489e4e('0x28')]=function(_0x36903a,_0x1a29b0){const _0x543108=_0x489e4e,_0x57d066=path[_0x543108('0xd')](config[_0x543108('0x16')],'files/images/logos');let _0x355766={'custom':![]};return utilLicense[_0x543108('0x9')]()[_0x543108('0x4a')](function(_0x44fbdd){const _0x4c2064=_0x543108;return _0x44fbdd&&(_0x355766=_0x44fbdd),db[_0x4c2064('0x6')]['findOne']({'where':{'id':_0x36903a['params']['id']},'attributes':[_0x4c2064('0x24'),_0x4c2064('0xe'),'preferred',_0x4c2064('0xa'),_0x4c2064('0x46'),_0x4c2064('0x25'),_0x4c2064('0x39'),_0x4c2064('0x37')],'raw':!![]});})[_0x543108('0x4a')](handleEntityNotFound(_0x1a29b0,null))['then'](function(_0x1baa04){const _0x126756=_0x543108;if(_0x1baa04){let _0x2d7d7d=_0x1baa04[_0x126756('0x24')]&&fs[_0x126756('0x3f')](path['join'](_0x57d066,_[_0x126756('0x1')](_0x1baa04[_0x126756('0x24')])))?path[_0x126756('0xd')](_0x57d066,_[_0x126756('0x1')](_0x1baa04[_0x126756('0x24')])):path[_0x126756('0xd')](_0x57d066,_[_0x126756('0x1')](_0x126756('0x26')));const _0x15f7b9='default'+_['upperFirst']('logo');(_0x1baa04[_0x15f7b9]||!_0x355766[_0x126756('0x43')])&&(_0x2d7d7d=path[_0x126756('0xd')](_0x57d066,_['toLower']('default_logo.svg')));if(!fs['existsSync'](_0x2d7d7d))throw new ValidationError(_[_0x126756('0x2d')]('logo')+_0x126756('0x18'));return _0x1a29b0['download'](_0x2d7d7d);}})[_0x543108('0x10')](handleError(_0x1a29b0,null));},exports['getLogoLogin']=function(_0x416b30,_0x45d549){const _0xb1a1ef=_0x489e4e,_0x5ad226=path[_0xb1a1ef('0xd')](config[_0xb1a1ef('0x16')],_0xb1a1ef('0x13'));let _0x206e1a={'custom':![]};return utilLicense[_0xb1a1ef('0x9')]()['then'](function(_0x5d5a44){const _0x93f33c=_0xb1a1ef;return _0x5d5a44&&(_0x206e1a=_0x5d5a44),db[_0x93f33c('0x6')][_0x93f33c('0x11')]({'where':{'id':_0x416b30[_0x93f33c('0x2')]['id']},'attributes':['logo',_0x93f33c('0xe'),_0x93f33c('0x4d'),'favicon',_0x93f33c('0x46'),_0x93f33c('0x25'),_0x93f33c('0x39'),_0x93f33c('0x37')],'raw':!![]});})['then'](handleEntityNotFound(_0x45d549,null))[_0xb1a1ef('0x4a')](function(_0x185ec8){const _0x2ba4b1=_0xb1a1ef;if(_0x185ec8){let _0x475573=_0x185ec8[_0x2ba4b1('0xe')]&&fs['existsSync'](path[_0x2ba4b1('0xd')](_0x5ad226,_[_0x2ba4b1('0x1')](_0x185ec8[_0x2ba4b1('0xe')])))?path['join'](_0x5ad226,_['toLower'](_0x185ec8['loginLogo'])):path['join'](_0x5ad226,_[_0x2ba4b1('0x1')](_0x2ba4b1('0xc')));const _0x4f54d2=_0x2ba4b1('0x35')+_[_0x2ba4b1('0x2d')](_0x2ba4b1('0xe'));(_0x185ec8[_0x4f54d2]||!_0x206e1a['custom'])&&(_0x475573=path['join'](_0x5ad226,_['toLower'](_0x2ba4b1('0xc'))));if(!fs[_0x2ba4b1('0x3f')](_0x475573))throw new ValidationError(_['upperFirst']('loginLogo')+_0x2ba4b1('0x18'));return _0x45d549[_0x2ba4b1('0x2c')](_0x475573);}})[_0xb1a1ef('0x10')](handleError(_0x45d549,null));},exports[_0x489e4e('0x3e')]=function(_0x971a1d,_0x388c1f){const _0x1183d6=_0x489e4e;return db[_0x1183d6('0x6')]['findOne']({'where':{'id':_0x971a1d[_0x1183d6('0x2')]['id']},'attributes':[_0x1183d6('0x30')]})[_0x1183d6('0x4a')](respondWithResult(_0x388c1f,null))['catch'](handleError(_0x388c1f,null));},exports[_0x489e4e('0x12')]=function(_0x20aa01,_0x230a75){const _0xebeaa1=_0x489e4e;return _0x20aa01[_0xebeaa1('0x2a')]&&_0x20aa01[_0xebeaa1('0x2a')]['filename']&&(_0x20aa01[_0xebeaa1('0x32')][_0xebeaa1('0x4d')]=_0x20aa01[_0xebeaa1('0x2a')][_0xebeaa1('0x49')]),db['Setting'][_0xebeaa1('0x11')]({'where':{'id':_0x20aa01[_0xebeaa1('0x2')]['id']}})[_0xebeaa1('0x4a')](handleEntityNotFound(_0x230a75,null))[_0xebeaa1('0x4a')](saveUpdates(_0x20aa01[_0xebeaa1('0x32')],null))[_0xebeaa1('0x4a')](respondWithResult(_0x230a75,null))['catch'](handleError(_0x230a75,null));},exports['getPreferred']=function(_0x2d44cb,_0xb28e37){const _0x5d8f5a=_0x489e4e,_0x40a996=path[_0x5d8f5a('0xd')](config['root'],'files/images/logos');let _0x5096b={'custom':![]};return utilLicense['getLicense']()[_0x5d8f5a('0x4a')](function(_0x1547a8){const _0x205208=_0x5d8f5a;return _0x1547a8&&(_0x5096b=_0x1547a8),db[_0x205208('0x6')][_0x205208('0x11')]({'where':{'id':_0x2d44cb[_0x205208('0x2')]['id']},'attributes':[_0x205208('0x24'),_0x205208('0xe'),_0x205208('0x4d'),'favicon',_0x205208('0x46'),_0x205208('0x25'),_0x205208('0x39'),_0x205208('0x37')],'raw':!![]});})[_0x5d8f5a('0x4a')](handleEntityNotFound(_0xb28e37,null))[_0x5d8f5a('0x4a')](function(_0x49e829){const _0x239a84=_0x5d8f5a;if(_0x49e829){let _0x20aa2f=_0x49e829[_0x239a84('0x4d')]&&fs[_0x239a84('0x3f')](path[_0x239a84('0xd')](_0x40a996,_[_0x239a84('0x1')](_0x49e829[_0x239a84('0x4d')])))?path['join'](_0x40a996,_[_0x239a84('0x1')](_0x49e829['preferred'])):path[_0x239a84('0xd')](_0x40a996,_[_0x239a84('0x1')]('default_preferred.png'));const _0x3bed48=_0x239a84('0x35')+_[_0x239a84('0x2d')](_0x239a84('0x4d'));(_0x49e829[_0x3bed48]||!_0x5096b['custom']||!_0x5096b[_0x239a84('0x4d')])&&(_0x20aa2f=path[_0x239a84('0xd')](_0x40a996,_[_0x239a84('0x1')](_0x239a84('0x4c'))));if(!fs[_0x239a84('0x3f')](_0x20aa2f))throw new ValidationError(_[_0x239a84('0x2d')](_0x239a84('0x4d'))+_0x239a84('0x18'));return _0xb28e37[_0x239a84('0x2c')](_0x20aa2f);}})['catch'](handleError(_0xb28e37,null));},exports[_0x489e4e('0x40')]=function(_0x404f2c,_0x20bdc8){const _0x14b6a7=_0x489e4e;return _0x404f2c[_0x14b6a7('0x2a')]&&_0x404f2c['file'][_0x14b6a7('0x49')]&&(_0x404f2c['body'][_0x14b6a7('0xa')]=_0x404f2c[_0x14b6a7('0x2a')][_0x14b6a7('0x49')]),db[_0x14b6a7('0x6')][_0x14b6a7('0x11')]({'where':{'id':_0x404f2c['params']['id']}})[_0x14b6a7('0x4a')](handleEntityNotFound(_0x20bdc8,null))['then'](saveUpdates(_0x404f2c[_0x14b6a7('0x32')],null))['then'](respondWithResult(_0x20bdc8,null))[_0x14b6a7('0x10')](handleError(_0x20bdc8,null));},exports[_0x489e4e('0x31')]=function(_0x5df14b,_0x462cbb){const _0x239d0b=_0x489e4e,_0x222516=path[_0x239d0b('0xd')](config[_0x239d0b('0x16')],_0x239d0b('0x13'));let _0x1b8a5e={'custom':![]};return utilLicense[_0x239d0b('0x9')]()[_0x239d0b('0x4a')](function(_0x1436c8){const _0x5461f8=_0x239d0b;return _0x1436c8&&(_0x1b8a5e=_0x1436c8),db['Setting'][_0x5461f8('0x11')]({'where':{'id':_0x5df14b[_0x5461f8('0x2')]['id']},'attributes':[_0x5461f8('0x24'),_0x5461f8('0xe'),'preferred',_0x5461f8('0xa'),'defaultLogo',_0x5461f8('0x25'),_0x5461f8('0x39'),_0x5461f8('0x37')],'raw':!![]});})[_0x239d0b('0x4a')](handleEntityNotFound(_0x462cbb,null))[_0x239d0b('0x4a')](function(_0xb0f344){const _0x154247=_0x239d0b;if(_0xb0f344){let _0x4b50f2=_0xb0f344['favicon']&&fs[_0x154247('0x3f')](path['join'](_0x222516,_[_0x154247('0x1')](_0xb0f344[_0x154247('0xa')])))?path[_0x154247('0xd')](_0x222516,_[_0x154247('0x1')](_0xb0f344[_0x154247('0xa')])):path[_0x154247('0xd')](_0x222516,_[_0x154247('0x1')]('default_favicon.ico'));const _0x2e7deb=_0x154247('0x35')+_['upperFirst']('favicon');(_0xb0f344[_0x2e7deb]||!_0x1b8a5e[_0x154247('0x43')])&&(_0x4b50f2=path[_0x154247('0xd')](_0x222516,_[_0x154247('0x1')](_0x154247('0x34'))));if(!fs[_0x154247('0x3f')](_0x4b50f2))throw new ValidationError(_[_0x154247('0x2d')](_0x154247('0xa'))+_0x154247('0x18'));return _0x462cbb[_0x154247('0x2c')](_0x4b50f2);}})['catch'](handleError(_0x462cbb,null));};
\ No newline at end of file
+const a538_0xaa93=['preferred','sendStatus','VIRTUAL','addLogoLogin','offset','like','existsSync','file','keys','addLogo','send','getLicense','custom','getLogo','filename','filter','rows','includeAll','model','merge','favicon','default_favicon.ico','index','files/images/logos','default_preferred.png','sequelize','download','logo','nolimit','show','intersection','Setting','../../config/license/util','count','map','order','root','upperFirst','fields','path','include','sort','json','length','getPreferred','addFavicon','fieldName','\x20not\x20found','defaultLoginLogo','undefined','status','join','attributes','loginLogo','getLogoLogin','name','body','../../components/parsers/qs','pick','api','default_loginLogo.svg','toLower','update','getFavicon','query','lodash','defaultPreferred','set','type','default','defaultFavicon','securePassword','then','limit','Content-Range','filters','key','options','where','catch','defaultLogo','findOne','error','params'];(function(_0xdf88a,_0xaa9347){const _0x3e82df=function(_0x3cc0f0){while(--_0x3cc0f0){_0xdf88a['push'](_0xdf88a['shift']());}};_0x3e82df(++_0xaa9347);}(a538_0xaa93,0x163));const a538_0x3e82=function(_0xdf88a,_0xaa9347){_0xdf88a=_0xdf88a-0x0;let _0x3e82df=a538_0xaa93[_0xdf88a];return _0x3e82df;};const _0x1b37d9=a538_0x3e82;'use strict';const path=require(_0x1b37d9('0x14')),fs=require('fs'),_=require(_0x1b37d9('0x2e')),qs=require(_0x1b37d9('0x26')),logger=require('../../config/logger')(_0x1b37d9('0x28')),config=require('../../config/environment'),db=require('../../mysqldb')['db'],{Op,ValidationError}=require(_0x1b37d9('0x6')),utilLicense=require(_0x1b37d9('0xd'));function respondWithResult(_0x3cc0f0,_0x423647){return _0x423647=_0x423647||0xc8,function(_0x231e74){const _0x2e128a=a538_0x3e82;if(_0x231e74)return _0x3cc0f0[_0x2e128a('0x1f')](_0x423647)[_0x2e128a('0x17')](_0x231e74);};}function respondWithFilteredResult(_0x261f7e,_0x590f60){return function(_0x34044a){const _0x369efa=a538_0x3e82;if(_0x34044a){const _0x2fd54d=_0x34044a['count'],_0x5d6b0c=_0x590f60[_0x369efa('0x45')];let _0x46dfb8=_0x590f60[_0x369efa('0x45')]+_0x590f60['limit'],_0x51a888;return _0x46dfb8>=_0x2fd54d?(_0x46dfb8=_0x2fd54d,_0x51a888=0xc8):_0x51a888=0xce,_0x261f7e[_0x369efa('0x1f')](_0x51a888),_0x261f7e[_0x369efa('0x30')](_0x369efa('0x37'),_0x5d6b0c+'-'+_0x46dfb8+'/'+_0x2fd54d)[_0x369efa('0x17')](_0x34044a);}return null;};}function saveUpdates(_0x568640){return function(_0xfaa2d2){const _0x4ff4da=a538_0x3e82;if(_0xfaa2d2)return _0xfaa2d2[_0x4ff4da('0x2b')](_0x568640)[_0x4ff4da('0x35')](function(_0x3a3ff3){return _0x3a3ff3;});return null;};}function handleEntityNotFound(_0x1afd5a){return function(_0x68710d){const _0x2f0515=a538_0x3e82;return!_0x68710d&&_0x1afd5a[_0x2f0515('0x42')](0x194),_0x68710d;};}function handleError(_0x4f3e1a,_0xa95545){return _0xa95545=_0xa95545||0x1f4,function(_0x2b7d40){const _0x1ee66f=a538_0x3e82;logger[_0x1ee66f('0x3f')](_0x2b7d40['stack']),_0x2b7d40[_0x1ee66f('0x24')]&&delete _0x2b7d40[_0x1ee66f('0x24')],_0x4f3e1a[_0x1ee66f('0x1f')](_0xa95545)[_0x1ee66f('0x4b')](_0x2b7d40);};}exports[_0x1b37d9('0x3')]=function(_0x86529c,_0x1b1330){const _0x3440af=_0x1b37d9;let _0x4e68d5={};const _0xbbf2f9={},_0x1474a4={'count':0x0,'rows':[]},_0x5150a4=_[_0x3440af('0xf')](db[_0x3440af('0xc')]['rawAttributes'],function(_0x173887){const _0x229ae5=_0x3440af;return{'name':_0x173887[_0x229ae5('0x1b')],'type':_0x173887[_0x229ae5('0x31')][_0x229ae5('0x39')]};});_0xbbf2f9[_0x3440af('0x53')]=_[_0x3440af('0xf')](_0x5150a4,_0x3440af('0x24')),_0xbbf2f9[_0x3440af('0x2d')]=_[_0x3440af('0x49')](_0x86529c[_0x3440af('0x2d')]),_0xbbf2f9[_0x3440af('0x38')]=_[_0x3440af('0xb')](_0xbbf2f9[_0x3440af('0x53')],_0xbbf2f9['query']),_0x4e68d5['attributes']=_['intersection'](_0xbbf2f9[_0x3440af('0x53')],qs[_0x3440af('0x13')](_0x86529c[_0x3440af('0x2d')][_0x3440af('0x13')])),_0x4e68d5[_0x3440af('0x21')]=_0x4e68d5[_0x3440af('0x21')][_0x3440af('0x18')]?_0x4e68d5[_0x3440af('0x21')]:_0xbbf2f9['model'];typeof _0x86529c[_0x3440af('0x2d')][_0x3440af('0x9')]===_0x3440af('0x1e')&&(_0x4e68d5[_0x3440af('0x36')]=qs['limit'](_0x86529c[_0x3440af('0x2d')][_0x3440af('0x36')]),_0x4e68d5[_0x3440af('0x45')]=qs[_0x3440af('0x45')](_0x86529c['query']['offset']));_0x4e68d5[_0x3440af('0x10')]=qs[_0x3440af('0x16')](_0x86529c[_0x3440af('0x2d')]['sort']),_0x4e68d5[_0x3440af('0x3b')]=qs[_0x3440af('0x38')](_[_0x3440af('0x27')](_0x86529c[_0x3440af('0x2d')],_0xbbf2f9[_0x3440af('0x38')]),_0x5150a4);_0x86529c[_0x3440af('0x2d')][_0x3440af('0x50')]&&(_0x4e68d5[_0x3440af('0x3b')]=_[_0x3440af('0x0')](_0x4e68d5['where'],{[Op['or']]:_[_0x3440af('0xf')](_0x5150a4,function(_0x5416b8){const _0xafc3a1=_0x3440af;if(_0x5416b8[_0xafc3a1('0x31')]!==_0xafc3a1('0x43')){const _0x1e65be={};return _0x1e65be[_0x5416b8['name']]={[Op[_0xafc3a1('0x46')]]:'%'+_0x86529c['query'][_0xafc3a1('0x50')]+'%'},_0x1e65be;}})}));_0x4e68d5=_[_0x3440af('0x0')]({},_0x4e68d5,_0x86529c[_0x3440af('0x3a')]);const _0x49b472={'where':_0x4e68d5[_0x3440af('0x3b')]};return db['Setting'][_0x3440af('0xe')](_0x49b472)['then'](function(_0x191efa){const _0x487204=_0x3440af;return _0x1474a4[_0x487204('0xe')]=_0x191efa,_0x86529c['query'][_0x487204('0x52')]&&(_0x4e68d5[_0x487204('0x15')]=[{'all':!![]}]),db[_0x487204('0xc')]['findAll'](_0x4e68d5);})['then'](function(_0x5881d7){const _0x4a69b6=_0x3440af;return _0x1474a4[_0x4a69b6('0x51')]=_0x5881d7,_0x1474a4;})[_0x3440af('0x35')](respondWithFilteredResult(_0x1b1330,_0x4e68d5))['catch'](handleError(_0x1b1330,null));},exports[_0x1b37d9('0xa')]=function(_0x54d7b2,_0x704b1d){const _0x5d21a7=_0x1b37d9;let _0x39f23d={'raw':![],'where':{'id':_0x54d7b2[_0x5d21a7('0x40')]['id']}};const _0x335739={};return _0x335739[_0x5d21a7('0x53')]=_[_0x5d21a7('0x49')](db['Setting']['rawAttributes']),_0x335739[_0x5d21a7('0x2d')]=_[_0x5d21a7('0x49')](_0x54d7b2[_0x5d21a7('0x2d')]),_0x335739['filters']=_['intersection'](_0x335739[_0x5d21a7('0x53')],_0x335739[_0x5d21a7('0x2d')]),_0x39f23d[_0x5d21a7('0x21')]=_[_0x5d21a7('0xb')](_0x335739['model'],qs['fields'](_0x54d7b2['query']['fields'])),_0x39f23d[_0x5d21a7('0x21')]=_0x39f23d[_0x5d21a7('0x21')]['length']?_0x39f23d['attributes']:_0x335739[_0x5d21a7('0x53')],_0x54d7b2['query']['includeAll']&&(_0x39f23d[_0x5d21a7('0x15')]=[{'all':!![]}]),_0x39f23d=_[_0x5d21a7('0x0')]({},_0x39f23d,_0x54d7b2['options']),db[_0x5d21a7('0xc')][_0x5d21a7('0x3e')](_0x39f23d)[_0x5d21a7('0x35')](handleEntityNotFound(_0x704b1d,null))[_0x5d21a7('0x35')](respondWithResult(_0x704b1d,null))[_0x5d21a7('0x3c')](handleError(_0x704b1d,null));},exports[_0x1b37d9('0x2b')]=function(_0x342b8e,_0xd5eacf){const _0x223ae3=_0x1b37d9;return _0x342b8e[_0x223ae3('0x25')]['id']&&delete _0x342b8e['body']['id'],db[_0x223ae3('0xc')][_0x223ae3('0x3e')]({'where':{'id':_0x342b8e[_0x223ae3('0x40')]['id']}})[_0x223ae3('0x35')](handleEntityNotFound(_0xd5eacf,null))[_0x223ae3('0x35')](saveUpdates(_0x342b8e[_0x223ae3('0x25')],null))[_0x223ae3('0x35')](respondWithResult(_0xd5eacf,null))[_0x223ae3('0x3c')](handleError(_0xd5eacf,null));},exports[_0x1b37d9('0x4a')]=function(_0x5e1241,_0x374686){const _0x381653=_0x1b37d9;return _0x5e1241[_0x381653('0x48')]&&_0x5e1241['file'][_0x381653('0x4f')]&&(_0x5e1241[_0x381653('0x25')][_0x381653('0x8')]=_0x5e1241[_0x381653('0x48')]['filename']),db[_0x381653('0xc')][_0x381653('0x3e')]({'where':{'id':_0x5e1241[_0x381653('0x40')]['id']}})[_0x381653('0x35')](handleEntityNotFound(_0x374686,null))[_0x381653('0x35')](saveUpdates(_0x5e1241['body'],null))[_0x381653('0x35')](respondWithResult(_0x374686,null))[_0x381653('0x3c')](handleError(_0x374686,null));},exports[_0x1b37d9('0x44')]=function(_0x3080cd,_0x4cd4f8){const _0x364e33=_0x1b37d9;return _0x3080cd[_0x364e33('0x48')]&&_0x3080cd[_0x364e33('0x48')][_0x364e33('0x4f')]&&(_0x3080cd[_0x364e33('0x25')][_0x364e33('0x22')]=_0x3080cd['file'][_0x364e33('0x4f')]),db[_0x364e33('0xc')]['findOne']({'where':{'id':_0x3080cd[_0x364e33('0x40')]['id']}})['then'](handleEntityNotFound(_0x4cd4f8,null))['then'](saveUpdates(_0x3080cd[_0x364e33('0x25')],null))['then'](respondWithResult(_0x4cd4f8,null))['catch'](handleError(_0x4cd4f8,null));},exports[_0x1b37d9('0x4e')]=function(_0x451ef7,_0xe6a5a4){const _0x4b59e0=_0x1b37d9,_0x224ca7=path[_0x4b59e0('0x20')](config[_0x4b59e0('0x11')],_0x4b59e0('0x4'));let _0x2926cf={'custom':![]};return utilLicense['getLicense']()['then'](function(_0x70fe57){const _0x543b94=_0x4b59e0;return _0x70fe57&&(_0x2926cf=_0x70fe57),db['Setting'][_0x543b94('0x3e')]({'where':{'id':_0x451ef7[_0x543b94('0x40')]['id']},'attributes':[_0x543b94('0x8'),_0x543b94('0x22'),'preferred','favicon',_0x543b94('0x3d'),_0x543b94('0x1d'),'defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0xe6a5a4,null))['then'](function(_0x2ba1bc){const _0x29dc07=_0x4b59e0;if(_0x2ba1bc){let _0x5b37fa=_0x2ba1bc[_0x29dc07('0x8')]&&fs[_0x29dc07('0x47')](path['join'](_0x224ca7,_[_0x29dc07('0x2a')](_0x2ba1bc[_0x29dc07('0x8')])))?path[_0x29dc07('0x20')](_0x224ca7,_[_0x29dc07('0x2a')](_0x2ba1bc[_0x29dc07('0x8')])):path['join'](_0x224ca7,_['toLower']('default_logo.svg'));const _0x15b092=_0x29dc07('0x32')+_[_0x29dc07('0x12')]('logo');(_0x2ba1bc[_0x15b092]||!_0x2926cf[_0x29dc07('0x4d')])&&(_0x5b37fa=path['join'](_0x224ca7,_[_0x29dc07('0x2a')]('default_logo.svg')));if(!fs[_0x29dc07('0x47')](_0x5b37fa))throw new ValidationError(_[_0x29dc07('0x12')](_0x29dc07('0x8'))+_0x29dc07('0x1c'));return _0xe6a5a4[_0x29dc07('0x7')](_0x5b37fa);}})[_0x4b59e0('0x3c')](handleError(_0xe6a5a4,null));},exports[_0x1b37d9('0x23')]=function(_0x6abdc1,_0x4bb32d){const _0x5f472f=_0x1b37d9,_0x257a0a=path[_0x5f472f('0x20')](config[_0x5f472f('0x11')],_0x5f472f('0x4'));let _0x561963={'custom':![]};return utilLicense[_0x5f472f('0x4c')]()['then'](function(_0x24782e){const _0xaf9206=_0x5f472f;return _0x24782e&&(_0x561963=_0x24782e),db[_0xaf9206('0xc')][_0xaf9206('0x3e')]({'where':{'id':_0x6abdc1[_0xaf9206('0x40')]['id']},'attributes':['logo',_0xaf9206('0x22'),'preferred',_0xaf9206('0x1'),_0xaf9206('0x3d'),_0xaf9206('0x1d'),_0xaf9206('0x2f'),_0xaf9206('0x33')],'raw':!![]});})[_0x5f472f('0x35')](handleEntityNotFound(_0x4bb32d,null))['then'](function(_0x1fc4f2){const _0xb31dc3=_0x5f472f;if(_0x1fc4f2){let _0x18f43e=_0x1fc4f2[_0xb31dc3('0x22')]&&fs[_0xb31dc3('0x47')](path[_0xb31dc3('0x20')](_0x257a0a,_[_0xb31dc3('0x2a')](_0x1fc4f2[_0xb31dc3('0x22')])))?path[_0xb31dc3('0x20')](_0x257a0a,_[_0xb31dc3('0x2a')](_0x1fc4f2[_0xb31dc3('0x22')])):path[_0xb31dc3('0x20')](_0x257a0a,_[_0xb31dc3('0x2a')](_0xb31dc3('0x29')));const _0x116226=_0xb31dc3('0x32')+_['upperFirst'](_0xb31dc3('0x22'));(_0x1fc4f2[_0x116226]||!_0x561963[_0xb31dc3('0x4d')])&&(_0x18f43e=path['join'](_0x257a0a,_[_0xb31dc3('0x2a')](_0xb31dc3('0x29'))));if(!fs['existsSync'](_0x18f43e))throw new ValidationError(_[_0xb31dc3('0x12')]('loginLogo')+_0xb31dc3('0x1c'));return _0x4bb32d['download'](_0x18f43e);}})[_0x5f472f('0x3c')](handleError(_0x4bb32d,null));},exports['gdpr']=function(_0x2d4270,_0x5577df){const _0x56447d=_0x1b37d9;return db['Setting'][_0x56447d('0x3e')]({'where':{'id':_0x2d4270[_0x56447d('0x40')]['id']},'attributes':[_0x56447d('0x34')]})['then'](respondWithResult(_0x5577df,null))[_0x56447d('0x3c')](handleError(_0x5577df,null));},exports['addPreferred']=function(_0x158278,_0xf5099c){const _0x248713=_0x1b37d9;return _0x158278['file']&&_0x158278[_0x248713('0x48')][_0x248713('0x4f')]&&(_0x158278[_0x248713('0x25')][_0x248713('0x41')]=_0x158278['file']['filename']),db[_0x248713('0xc')][_0x248713('0x3e')]({'where':{'id':_0x158278['params']['id']}})[_0x248713('0x35')](handleEntityNotFound(_0xf5099c,null))[_0x248713('0x35')](saveUpdates(_0x158278[_0x248713('0x25')],null))[_0x248713('0x35')](respondWithResult(_0xf5099c,null))[_0x248713('0x3c')](handleError(_0xf5099c,null));},exports[_0x1b37d9('0x19')]=function(_0xda9c2b,_0x4381b6){const _0x2e35c8=_0x1b37d9,_0x3a1dd5=path[_0x2e35c8('0x20')](config['root'],'files/images/logos');let _0x1d5cea={'custom':![]};return utilLicense[_0x2e35c8('0x4c')]()[_0x2e35c8('0x35')](function(_0x264b03){const _0x2ede5f=_0x2e35c8;return _0x264b03&&(_0x1d5cea=_0x264b03),db['Setting']['findOne']({'where':{'id':_0xda9c2b[_0x2ede5f('0x40')]['id']},'attributes':['logo',_0x2ede5f('0x22'),_0x2ede5f('0x41'),_0x2ede5f('0x1'),_0x2ede5f('0x3d'),_0x2ede5f('0x1d'),'defaultPreferred',_0x2ede5f('0x33')],'raw':!![]});})[_0x2e35c8('0x35')](handleEntityNotFound(_0x4381b6,null))['then'](function(_0x5b4d53){const _0x1a9a88=_0x2e35c8;if(_0x5b4d53){let _0x3c2ab4=_0x5b4d53[_0x1a9a88('0x41')]&&fs[_0x1a9a88('0x47')](path[_0x1a9a88('0x20')](_0x3a1dd5,_[_0x1a9a88('0x2a')](_0x5b4d53[_0x1a9a88('0x41')])))?path[_0x1a9a88('0x20')](_0x3a1dd5,_[_0x1a9a88('0x2a')](_0x5b4d53['preferred'])):path[_0x1a9a88('0x20')](_0x3a1dd5,_['toLower']('default_preferred.png'));const _0x53d113=_0x1a9a88('0x32')+_[_0x1a9a88('0x12')](_0x1a9a88('0x41'));(_0x5b4d53[_0x53d113]||!_0x1d5cea[_0x1a9a88('0x4d')]||!_0x1d5cea[_0x1a9a88('0x41')])&&(_0x3c2ab4=path['join'](_0x3a1dd5,_[_0x1a9a88('0x2a')](_0x1a9a88('0x5'))));if(!fs['existsSync'](_0x3c2ab4))throw new ValidationError(_[_0x1a9a88('0x12')](_0x1a9a88('0x41'))+'\x20not\x20found');return _0x4381b6[_0x1a9a88('0x7')](_0x3c2ab4);}})['catch'](handleError(_0x4381b6,null));},exports[_0x1b37d9('0x1a')]=function(_0x476250,_0x42ec21){const _0x1a1549=_0x1b37d9;return _0x476250['file']&&_0x476250['file'][_0x1a1549('0x4f')]&&(_0x476250['body'][_0x1a1549('0x1')]=_0x476250['file'][_0x1a1549('0x4f')]),db['Setting'][_0x1a1549('0x3e')]({'where':{'id':_0x476250[_0x1a1549('0x40')]['id']}})[_0x1a1549('0x35')](handleEntityNotFound(_0x42ec21,null))['then'](saveUpdates(_0x476250['body'],null))[_0x1a1549('0x35')](respondWithResult(_0x42ec21,null))[_0x1a1549('0x3c')](handleError(_0x42ec21,null));},exports[_0x1b37d9('0x2c')]=function(_0x4ead16,_0x3c1069){const _0x217006=_0x1b37d9,_0x5d2fd2=path[_0x217006('0x20')](config[_0x217006('0x11')],'files/images/logos');let _0x4cd3ec={'custom':![]};return utilLicense[_0x217006('0x4c')]()[_0x217006('0x35')](function(_0x2dc839){const _0x184bcc=_0x217006;return _0x2dc839&&(_0x4cd3ec=_0x2dc839),db[_0x184bcc('0xc')][_0x184bcc('0x3e')]({'where':{'id':_0x4ead16[_0x184bcc('0x40')]['id']},'attributes':[_0x184bcc('0x8'),_0x184bcc('0x22'),_0x184bcc('0x41'),_0x184bcc('0x1'),_0x184bcc('0x3d'),_0x184bcc('0x1d'),'defaultPreferred',_0x184bcc('0x33')],'raw':!![]});})[_0x217006('0x35')](handleEntityNotFound(_0x3c1069,null))[_0x217006('0x35')](function(_0xe365f3){const _0x50fc0b=_0x217006;if(_0xe365f3){let _0x49b3a1=_0xe365f3[_0x50fc0b('0x1')]&&fs[_0x50fc0b('0x47')](path['join'](_0x5d2fd2,_[_0x50fc0b('0x2a')](_0xe365f3[_0x50fc0b('0x1')])))?path[_0x50fc0b('0x20')](_0x5d2fd2,_['toLower'](_0xe365f3[_0x50fc0b('0x1')])):path[_0x50fc0b('0x20')](_0x5d2fd2,_[_0x50fc0b('0x2a')](_0x50fc0b('0x2')));const _0x30a837=_0x50fc0b('0x32')+_[_0x50fc0b('0x12')](_0x50fc0b('0x1'));(_0xe365f3[_0x30a837]||!_0x4cd3ec[_0x50fc0b('0x4d')])&&(_0x49b3a1=path['join'](_0x5d2fd2,_[_0x50fc0b('0x2a')](_0x50fc0b('0x2'))));if(!fs[_0x50fc0b('0x47')](_0x49b3a1))throw new ValidationError(_['upperFirst'](_0x50fc0b('0x1'))+_0x50fc0b('0x1c'));return _0x3c1069['download'](_0x49b3a1);}})['catch'](handleError(_0x3c1069,null));};
\ No newline at end of file