// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xee16=['ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','undefined','limit','count','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','where','pick','filter','merge','VIRTUAL','SquareOdbc','includeAll','include','findAll','rows','catch','show','params','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ODBC','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','odbc','dsn','closeSync','rimraf','zip-dir','request-promise','bluebird','util','sox','to-csv'];(function(_0x12c022,_0x13c372){var _0x318686=function(_0x479f42){while(--_0x479f42){_0x12c022['push'](_0x12c022['shift']());}};_0x318686(++_0x13c372);}(_0xee16,0xfe));var _0x6ee1=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0xee16[_0x211bc3];return _0x34c9a2;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6ee1('0x0'));var zipdir=require(_0x6ee1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6ee1('0x2'));var moment=require('moment');var BPromise=require(_0x6ee1('0x3'));var Mustache=require('mustache');var util=require(_0x6ee1('0x4'));var path=require('path');var sox=require(_0x6ee1('0x5'));var csv=require(_0x6ee1('0x6'));var ejs=require(_0x6ee1('0x7'));var fs=require('fs');var fs_extra=require(_0x6ee1('0x8'));var _=require(_0x6ee1('0x9'));var squel=require('squel');var crypto=require(_0x6ee1('0xa'));var jsforce=require(_0x6ee1('0xb'));var deskjs=require(_0x6ee1('0xc'));var toCsv=require(_0x6ee1('0x6'));var querystring=require(_0x6ee1('0xd'));var Papa=require(_0x6ee1('0xe'));var Redis=require(_0x6ee1('0xf'));var authService=require(_0x6ee1('0x10'));var qs=require(_0x6ee1('0x11'));var as=require(_0x6ee1('0x12'));var hardwareService=require(_0x6ee1('0x13'));var logger=require(_0x6ee1('0x14'))(_0x6ee1('0x15'));var utils=require(_0x6ee1('0x16'));var config=require(_0x6ee1('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6ee1('0x18'))['db'];function respondWithStatusCode(_0x5c4f7f,_0x179187){_0x179187=_0x179187||0xcc;return function(_0x23b9f9){if(_0x23b9f9){return _0x5c4f7f[_0x6ee1('0x19')](_0x179187);}return _0x5c4f7f['status'](_0x179187)[_0x6ee1('0x1a')]();};}function respondWithResult(_0x3363e1,_0x152cb6){_0x152cb6=_0x152cb6||0xc8;return function(_0x435616){if(_0x435616){return _0x3363e1[_0x6ee1('0x1b')](_0x152cb6)[_0x6ee1('0x1c')](_0x435616);}};}function respondWithFilteredResult(_0x58c1e2,_0x4ae5ad){return function(_0x194cf4){if(_0x194cf4){var _0x3a6881=typeof _0x4ae5ad['offset']===_0x6ee1('0x1d')&&typeof _0x4ae5ad[_0x6ee1('0x1e')]===_0x6ee1('0x1d');var _0x1f62eb=_0x194cf4[_0x6ee1('0x1f')];var _0x3b3f75=_0x3a6881?0x0:_0x4ae5ad['offset'];var _0x2d5d81=_0x3a6881?_0x194cf4[_0x6ee1('0x1f')]:_0x4ae5ad['offset']+_0x4ae5ad[_0x6ee1('0x1e')];var _0x1e7137;if(_0x2d5d81>=_0x1f62eb){_0x2d5d81=_0x1f62eb;_0x1e7137=0xc8;}else{_0x1e7137=0xce;}_0x58c1e2[_0x6ee1('0x1b')](_0x1e7137);return _0x58c1e2['set'](_0x6ee1('0x20'),_0x3b3f75+'-'+_0x2d5d81+'/'+_0x1f62eb)['json'](_0x194cf4);}return null;};}function patchUpdates(_0x345bc1){return function(_0x54618f){try{jsonpatch[_0x6ee1('0x21')](_0x54618f,_0x345bc1,!![]);}catch(_0x49e0c6){return BPromise[_0x6ee1('0x22')](_0x49e0c6);}return _0x54618f['save']();};}function saveUpdates(_0x4c7d8e,_0x9e675a){return function(_0x57ff1c){if(_0x57ff1c){return _0x57ff1c[_0x6ee1('0x23')](_0x4c7d8e)[_0x6ee1('0x24')](function(_0x47b6f0){return _0x47b6f0;});}return null;};}function removeEntity(_0x54f29f,_0x304dc0){return function(_0x3a9abc){if(_0x3a9abc){return _0x3a9abc[_0x6ee1('0x25')]()[_0x6ee1('0x24')](function(){var _0x174d8b=_0x3a9abc[_0x6ee1('0x26')]({'plain':!![]});var _0x5af5de='ODBC';return db[_0x6ee1('0x27')][_0x6ee1('0x25')]({'where':{'type':_0x5af5de,'resourceId':_0x174d8b['id']}})[_0x6ee1('0x24')](function(){return _0x3a9abc;});})['then'](function(){_0x54f29f[_0x6ee1('0x1b')](0xcc)[_0x6ee1('0x1a')]();});}};}function handleEntityNotFound(_0x1ffe08,_0x126c36){return function(_0x3e85b2){if(!_0x3e85b2){_0x1ffe08[_0x6ee1('0x19')](0x194);}return _0x3e85b2;};}function handleError(_0x590b94,_0xa6ec60){_0xa6ec60=_0xa6ec60||0x1f4;return function(_0x8e87ab){logger[_0x6ee1('0x28')](_0x8e87ab[_0x6ee1('0x29')]);if(_0x8e87ab['name']){delete _0x8e87ab[_0x6ee1('0x2a')];}_0x590b94[_0x6ee1('0x1b')](_0xa6ec60)[_0x6ee1('0x2b')](_0x8e87ab);};}exports[_0x6ee1('0x2c')]=function(_0x15f42d,_0x5a571c){var _0x51a4a3={},_0x56e857={},_0x1299c1={'count':0x0,'rows':[]};var _0x5bd86b=_[_0x6ee1('0x2d')](db['SquareOdbc'][_0x6ee1('0x2e')],function(_0x3a72c4){return{'name':_0x3a72c4['fieldName'],'type':_0x3a72c4[_0x6ee1('0x2f')][_0x6ee1('0x30')]};});_0x56e857[_0x6ee1('0x31')]=_[_0x6ee1('0x2d')](_0x5bd86b,_0x6ee1('0x2a'));_0x56e857[_0x6ee1('0x32')]=_[_0x6ee1('0x33')](_0x15f42d[_0x6ee1('0x32')]);_0x56e857[_0x6ee1('0x34')]=_[_0x6ee1('0x35')](_0x56e857[_0x6ee1('0x31')],_0x56e857[_0x6ee1('0x32')]);_0x51a4a3['attributes']=_[_0x6ee1('0x35')](_0x56e857['model'],qs['fields'](_0x15f42d[_0x6ee1('0x32')][_0x6ee1('0x36')]));_0x51a4a3['attributes']=_0x51a4a3[_0x6ee1('0x37')]['length']?_0x51a4a3[_0x6ee1('0x37')]:_0x56e857[_0x6ee1('0x31')];if(!_0x15f42d[_0x6ee1('0x32')][_0x6ee1('0x38')](_0x6ee1('0x39'))){_0x51a4a3[_0x6ee1('0x1e')]=qs['limit'](_0x15f42d[_0x6ee1('0x32')]['limit']);_0x51a4a3[_0x6ee1('0x3a')]=qs[_0x6ee1('0x3a')](_0x15f42d['query']['offset']);}_0x51a4a3[_0x6ee1('0x3b')]=qs['sort'](_0x15f42d[_0x6ee1('0x32')]['sort']);_0x51a4a3[_0x6ee1('0x3c')]=qs[_0x6ee1('0x34')](_[_0x6ee1('0x3d')](_0x15f42d[_0x6ee1('0x32')],_0x56e857[_0x6ee1('0x34')]),_0x5bd86b);if(_0x15f42d['query'][_0x6ee1('0x3e')]){_0x51a4a3[_0x6ee1('0x3c')]=_[_0x6ee1('0x3f')](_0x51a4a3[_0x6ee1('0x3c')],{'$or':_[_0x6ee1('0x2d')](_0x5bd86b,function(_0x4ef134){if(_0x4ef134[_0x6ee1('0x2f')]!==_0x6ee1('0x40')){var _0x350eaa={};_0x350eaa[_0x4ef134['name']]={'$like':'%'+_0x15f42d['query'][_0x6ee1('0x3e')]+'%'};return _0x350eaa;}})});}_0x51a4a3=_[_0x6ee1('0x3f')]({},_0x51a4a3,_0x15f42d['options']);var _0x3fd352={'where':_0x51a4a3[_0x6ee1('0x3c')]};return db[_0x6ee1('0x41')][_0x6ee1('0x1f')](_0x3fd352)[_0x6ee1('0x24')](function(_0x3a57cc){_0x1299c1[_0x6ee1('0x1f')]=_0x3a57cc;if(_0x15f42d[_0x6ee1('0x32')][_0x6ee1('0x42')]){_0x51a4a3[_0x6ee1('0x43')]=[{'all':!![]}];}return db['SquareOdbc'][_0x6ee1('0x44')](_0x51a4a3);})['then'](function(_0x4c7dc0){_0x1299c1[_0x6ee1('0x45')]=_0x4c7dc0;return _0x1299c1;})[_0x6ee1('0x24')](respondWithFilteredResult(_0x5a571c,_0x51a4a3))[_0x6ee1('0x46')](handleError(_0x5a571c,null));};exports[_0x6ee1('0x47')]=function(_0x545bba,_0x49cec2){var _0x16a115={'raw':!![],'where':{'id':_0x545bba[_0x6ee1('0x48')]['id']}},_0x148fe1={};_0x148fe1[_0x6ee1('0x31')]=_[_0x6ee1('0x33')](db[_0x6ee1('0x41')]['rawAttributes']);_0x148fe1[_0x6ee1('0x32')]=_[_0x6ee1('0x33')](_0x545bba[_0x6ee1('0x32')]);_0x148fe1[_0x6ee1('0x34')]=_['intersection'](_0x148fe1['model'],_0x148fe1[_0x6ee1('0x32')]);_0x16a115[_0x6ee1('0x37')]=_[_0x6ee1('0x35')](_0x148fe1[_0x6ee1('0x31')],qs[_0x6ee1('0x36')](_0x545bba['query']['fields']));_0x16a115[_0x6ee1('0x37')]=_0x16a115[_0x6ee1('0x37')][_0x6ee1('0x49')]?_0x16a115[_0x6ee1('0x37')]:_0x148fe1[_0x6ee1('0x31')];if(_0x545bba[_0x6ee1('0x32')]['includeAll']){_0x16a115[_0x6ee1('0x43')]=[{'all':!![]}];}_0x16a115=_[_0x6ee1('0x3f')]({},_0x16a115,_0x545bba[_0x6ee1('0x4a')]);return db['SquareOdbc']['find'](_0x16a115)[_0x6ee1('0x24')](handleEntityNotFound(_0x49cec2,null))[_0x6ee1('0x24')](respondWithResult(_0x49cec2,null))[_0x6ee1('0x46')](handleError(_0x49cec2,null));};exports[_0x6ee1('0x4b')]=function(_0x56c576,_0x263ee4){return db[_0x6ee1('0x41')][_0x6ee1('0x4b')](_0x56c576[_0x6ee1('0x4c')],{})[_0x6ee1('0x24')](function(_0x3d39d6){var _0xeee1ac=_0x56c576[_0x6ee1('0x4d')][_0x6ee1('0x26')]({'plain':!![]});if(!_0xeee1ac)throw new Error(_0x6ee1('0x4e'));if(_0xeee1ac[_0x6ee1('0x4f')]===_0x6ee1('0x4d')){var _0x1574f2=_0x3d39d6[_0x6ee1('0x26')]({'plain':!![]});var _0x17d523=_0x6ee1('0x50');return db['UserProfileSection'][_0x6ee1('0x51')]({'where':{'name':_0x17d523,'userProfileId':_0xeee1ac['userProfileId']},'raw':!![]})[_0x6ee1('0x24')](function(_0x112620){if(_0x112620&&_0x112620[_0x6ee1('0x52')]===0x0){return db[_0x6ee1('0x27')][_0x6ee1('0x4b')]({'name':_0x1574f2[_0x6ee1('0x2a')],'resourceId':_0x1574f2['id'],'type':_0x112620[_0x6ee1('0x2a')],'sectionId':_0x112620['id']},{})[_0x6ee1('0x24')](function(){return _0x3d39d6;});}else{return _0x3d39d6;}})[_0x6ee1('0x46')](function(_0x18e16d){logger[_0x6ee1('0x28')](_0x6ee1('0x53'),_0x18e16d);throw _0x18e16d;});}return _0x3d39d6;})['then'](respondWithResult(_0x263ee4,0xc9))[_0x6ee1('0x46')](handleError(_0x263ee4,null));};exports['update']=function(_0x2107e2,_0x340833){if(_0x2107e2['body']['id']){delete _0x2107e2[_0x6ee1('0x4c')]['id'];}return db['SquareOdbc'][_0x6ee1('0x51')]({'where':{'id':_0x2107e2[_0x6ee1('0x48')]['id']}})['then'](handleEntityNotFound(_0x340833,null))[_0x6ee1('0x24')](saveUpdates(_0x2107e2[_0x6ee1('0x4c')],null))[_0x6ee1('0x24')](respondWithResult(_0x340833,null))[_0x6ee1('0x46')](handleError(_0x340833,null));};exports['destroy']=function(_0x2fb7e9,_0x201aba){return db['SquareOdbc'][_0x6ee1('0x51')]({'where':{'id':_0x2fb7e9[_0x6ee1('0x48')]['id']}})['then'](handleEntityNotFound(_0x201aba,null))[_0x6ee1('0x24')](removeEntity(_0x201aba,null))[_0x6ee1('0x46')](handleError(_0x201aba,null));};exports['test']=function(_0x201403,_0x63dbf9,_0x302917){var _0x9bf6d2;return db[_0x6ee1('0x41')][_0x6ee1('0x51')]({'where':{'id':_0x201403[_0x6ee1('0x48')]['id']},'attributes':['id','dsn']})[_0x6ee1('0x24')](handleEntityNotFound(_0x63dbf9,null))['then'](function(_0x5b450e){if(_0x5b450e){var _0x49f09d=require(_0x6ee1('0x54'))();_0x49f09d['openSync'](_0x5b450e[_0x6ee1('0x55')]);_0x49f09d[_0x6ee1('0x56')]();return _0x5b450e;}})[_0x6ee1('0x24')](respondWithResult(_0x63dbf9,null))[_0x6ee1('0x46')](handleError(_0x63dbf9,null));};
\ No newline at end of file
+var _0xdd0e=['stack','name','send','map','SquareOdbc','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','update','test','dsn','odbc','openSync','closeSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','then','get','ODBC','UserProfileResource','destroy','error'];(function(_0x172dfd,_0x869e62){var _0x248c26=function(_0x11c307){while(--_0x11c307){_0x172dfd['push'](_0x172dfd['shift']());}};_0x248c26(++_0x869e62);}(_0xdd0e,0x1d0));var _0xedd0=function(_0x59cba9,_0x1e8f27){_0x59cba9=_0x59cba9-0x0;var _0xae4206=_0xdd0e[_0x59cba9];return _0xae4206;};'use strict';var emlformat=require(_0xedd0('0x0'));var rimraf=require(_0xedd0('0x1'));var zipdir=require(_0xedd0('0x2'));var jsonpatch=require(_0xedd0('0x3'));var rp=require(_0xedd0('0x4'));var moment=require(_0xedd0('0x5'));var BPromise=require(_0xedd0('0x6'));var Mustache=require(_0xedd0('0x7'));var util=require(_0xedd0('0x8'));var path=require('path');var sox=require(_0xedd0('0x9'));var csv=require(_0xedd0('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xedd0('0xb'));var squel=require(_0xedd0('0xc'));var crypto=require(_0xedd0('0xd'));var jsforce=require(_0xedd0('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xedd0('0xa'));var querystring=require(_0xedd0('0xf'));var Papa=require(_0xedd0('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xedd0('0x11'));var hardwareService=require(_0xedd0('0x12'));var logger=require('../../config/logger')(_0xedd0('0x13'));var utils=require(_0xedd0('0x14'));var config=require(_0xedd0('0x15'));var licenseUtil=require(_0xedd0('0x16'));var db=require(_0xedd0('0x17'))['db'];function respondWithStatusCode(_0x20a293,_0x452ed4){_0x452ed4=_0x452ed4||0xcc;return function(_0x4e559d){if(_0x4e559d){return _0x20a293['sendStatus'](_0x452ed4);}return _0x20a293[_0xedd0('0x18')](_0x452ed4)[_0xedd0('0x19')]();};}function respondWithResult(_0x1ff09d,_0x4373bf){_0x4373bf=_0x4373bf||0xc8;return function(_0x951af8){if(_0x951af8){return _0x1ff09d[_0xedd0('0x18')](_0x4373bf)[_0xedd0('0x1a')](_0x951af8);}};}function respondWithFilteredResult(_0x2d240b,_0x3b3c94){return function(_0x52246d){if(_0x52246d){var _0x267eec=typeof _0x3b3c94[_0xedd0('0x1b')]===_0xedd0('0x1c')&&typeof _0x3b3c94[_0xedd0('0x1d')]==='undefined';var _0x24c878=_0x52246d[_0xedd0('0x1e')];var _0x41dc66=_0x267eec?0x0:_0x3b3c94[_0xedd0('0x1b')];var _0x4155b2=_0x267eec?_0x52246d['count']:_0x3b3c94[_0xedd0('0x1b')]+_0x3b3c94[_0xedd0('0x1d')];var _0x410344;if(_0x4155b2>=_0x24c878){_0x4155b2=_0x24c878;_0x410344=0xc8;}else{_0x410344=0xce;}_0x2d240b[_0xedd0('0x18')](_0x410344);return _0x2d240b[_0xedd0('0x1f')](_0xedd0('0x20'),_0x41dc66+'-'+_0x4155b2+'/'+_0x24c878)[_0xedd0('0x1a')](_0x52246d);}return null;};}function patchUpdates(_0x42df9a){return function(_0x3c2117){try{jsonpatch['apply'](_0x3c2117,_0x42df9a,!![]);}catch(_0x31a9c3){return BPromise[_0xedd0('0x21')](_0x31a9c3);}return _0x3c2117['save']();};}function saveUpdates(_0x581127,_0x55d6c9){return function(_0x159a93){if(_0x159a93){return _0x159a93['update'](_0x581127)[_0xedd0('0x22')](function(_0x53eb37){return _0x53eb37;});}return null;};}function removeEntity(_0x3d8768,_0x37dfdd){return function(_0x213f54){if(_0x213f54){return _0x213f54['destroy']()[_0xedd0('0x22')](function(){var _0x51111c=_0x213f54[_0xedd0('0x23')]({'plain':!![]});var _0x5768a5=_0xedd0('0x24');return db[_0xedd0('0x25')][_0xedd0('0x26')]({'where':{'type':_0x5768a5,'resourceId':_0x51111c['id']}})[_0xedd0('0x22')](function(){return _0x213f54;});})[_0xedd0('0x22')](function(){_0x3d8768['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x133351,_0x35a02b){return function(_0x4f2147){if(!_0x4f2147){_0x133351['sendStatus'](0x194);}return _0x4f2147;};}function handleError(_0x2e84c1,_0x1fca97){_0x1fca97=_0x1fca97||0x1f4;return function(_0x15a284){logger[_0xedd0('0x27')](_0x15a284[_0xedd0('0x28')]);if(_0x15a284['name']){delete _0x15a284[_0xedd0('0x29')];}_0x2e84c1[_0xedd0('0x18')](_0x1fca97)[_0xedd0('0x2a')](_0x15a284);};}exports['index']=function(_0xc33d61,_0x3a389f){var _0x3c362d={},_0x2926d3={},_0x2185f2={'count':0x0,'rows':[]};var _0x560c27=_[_0xedd0('0x2b')](db[_0xedd0('0x2c')]['rawAttributes'],function(_0x3eda58){return{'name':_0x3eda58[_0xedd0('0x2d')],'type':_0x3eda58[_0xedd0('0x2e')]['key']};});_0x2926d3[_0xedd0('0x2f')]=_[_0xedd0('0x2b')](_0x560c27,_0xedd0('0x29'));_0x2926d3[_0xedd0('0x30')]=_[_0xedd0('0x31')](_0xc33d61[_0xedd0('0x30')]);_0x2926d3[_0xedd0('0x32')]=_[_0xedd0('0x33')](_0x2926d3[_0xedd0('0x2f')],_0x2926d3[_0xedd0('0x30')]);_0x3c362d[_0xedd0('0x34')]=_['intersection'](_0x2926d3[_0xedd0('0x2f')],qs[_0xedd0('0x35')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x35')]));_0x3c362d['attributes']=_0x3c362d[_0xedd0('0x34')][_0xedd0('0x36')]?_0x3c362d['attributes']:_0x2926d3[_0xedd0('0x2f')];if(!_0xc33d61['query'][_0xedd0('0x37')](_0xedd0('0x38'))){_0x3c362d[_0xedd0('0x1d')]=qs[_0xedd0('0x1d')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x1d')]);_0x3c362d[_0xedd0('0x1b')]=qs[_0xedd0('0x1b')](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x1b')]);}_0x3c362d['order']=qs['sort'](_0xc33d61[_0xedd0('0x30')][_0xedd0('0x39')]);_0x3c362d[_0xedd0('0x3a')]=qs[_0xedd0('0x32')](_[_0xedd0('0x3b')](_0xc33d61[_0xedd0('0x30')],_0x2926d3[_0xedd0('0x32')]),_0x560c27);if(_0xc33d61[_0xedd0('0x30')]['filter']){_0x3c362d[_0xedd0('0x3a')]=_[_0xedd0('0x3c')](_0x3c362d[_0xedd0('0x3a')],{'$or':_['map'](_0x560c27,function(_0x3bc3a3){if(_0x3bc3a3[_0xedd0('0x2e')]!==_0xedd0('0x3d')){var _0x36d058={};_0x36d058[_0x3bc3a3['name']]={'$like':'%'+_0xc33d61['query']['filter']+'%'};return _0x36d058;}})});}_0x3c362d=_['merge']({},_0x3c362d,_0xc33d61[_0xedd0('0x3e')]);var _0x11262d={'where':_0x3c362d[_0xedd0('0x3a')]};return db[_0xedd0('0x2c')][_0xedd0('0x1e')](_0x11262d)[_0xedd0('0x22')](function(_0x2f5777){_0x2185f2[_0xedd0('0x1e')]=_0x2f5777;if(_0xc33d61['query'][_0xedd0('0x3f')]){_0x3c362d[_0xedd0('0x40')]=[{'all':!![]}];}return db[_0xedd0('0x2c')][_0xedd0('0x41')](_0x3c362d);})[_0xedd0('0x22')](function(_0x4d5764){_0x2185f2[_0xedd0('0x42')]=_0x4d5764;return _0x2185f2;})['then'](respondWithFilteredResult(_0x3a389f,_0x3c362d))[_0xedd0('0x43')](handleError(_0x3a389f,null));};exports['show']=function(_0x47b400,_0x2c6a25){var _0x56b408={'raw':!![],'where':{'id':_0x47b400[_0xedd0('0x44')]['id']}},_0x1a7d41={};_0x1a7d41['model']=_[_0xedd0('0x31')](db['SquareOdbc'][_0xedd0('0x45')]);_0x1a7d41[_0xedd0('0x30')]=_[_0xedd0('0x31')](_0x47b400[_0xedd0('0x30')]);_0x1a7d41[_0xedd0('0x32')]=_['intersection'](_0x1a7d41[_0xedd0('0x2f')],_0x1a7d41[_0xedd0('0x30')]);_0x56b408[_0xedd0('0x34')]=_[_0xedd0('0x33')](_0x1a7d41[_0xedd0('0x2f')],qs[_0xedd0('0x35')](_0x47b400['query']['fields']));_0x56b408[_0xedd0('0x34')]=_0x56b408[_0xedd0('0x34')][_0xedd0('0x36')]?_0x56b408[_0xedd0('0x34')]:_0x1a7d41[_0xedd0('0x2f')];if(_0x47b400['query']['includeAll']){_0x56b408[_0xedd0('0x40')]=[{'all':!![]}];}_0x56b408=_['merge']({},_0x56b408,_0x47b400[_0xedd0('0x3e')]);return db[_0xedd0('0x2c')][_0xedd0('0x46')](_0x56b408)[_0xedd0('0x22')](handleEntityNotFound(_0x2c6a25,null))['then'](respondWithResult(_0x2c6a25,null))[_0xedd0('0x43')](handleError(_0x2c6a25,null));};exports[_0xedd0('0x47')]=function(_0x4ad2e1,_0xcec4b6){return db[_0xedd0('0x2c')][_0xedd0('0x47')](_0x4ad2e1[_0xedd0('0x48')],{})[_0xedd0('0x22')](function(_0x3fc4aa){var _0x227083=_0x4ad2e1['user'][_0xedd0('0x23')]({'plain':!![]});if(!_0x227083)throw new Error(_0xedd0('0x49'));if(_0x227083[_0xedd0('0x4a')]==='user'){var _0x48b8cb=_0x3fc4aa[_0xedd0('0x23')]({'plain':!![]});var _0x315943=_0xedd0('0x24');return db[_0xedd0('0x4b')][_0xedd0('0x46')]({'where':{'name':_0x315943,'userProfileId':_0x227083[_0xedd0('0x4c')]},'raw':!![]})[_0xedd0('0x22')](function(_0x507ee8){if(_0x507ee8&&_0x507ee8[_0xedd0('0x4d')]===0x0){return db[_0xedd0('0x25')][_0xedd0('0x47')]({'name':_0x48b8cb[_0xedd0('0x29')],'resourceId':_0x48b8cb['id'],'type':_0x507ee8[_0xedd0('0x29')],'sectionId':_0x507ee8['id']},{})[_0xedd0('0x22')](function(){return _0x3fc4aa;});}else{return _0x3fc4aa;}})[_0xedd0('0x43')](function(_0x38a526){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38a526);throw _0x38a526;});}return _0x3fc4aa;})[_0xedd0('0x22')](respondWithResult(_0xcec4b6,0xc9))[_0xedd0('0x43')](handleError(_0xcec4b6,null));};exports[_0xedd0('0x4e')]=function(_0x1e5321,_0x4b3330){if(_0x1e5321[_0xedd0('0x48')]['id']){delete _0x1e5321['body']['id'];}return db[_0xedd0('0x2c')]['find']({'where':{'id':_0x1e5321[_0xedd0('0x44')]['id']}})[_0xedd0('0x22')](handleEntityNotFound(_0x4b3330,null))[_0xedd0('0x22')](saveUpdates(_0x1e5321[_0xedd0('0x48')],null))[_0xedd0('0x22')](respondWithResult(_0x4b3330,null))[_0xedd0('0x43')](handleError(_0x4b3330,null));};exports['destroy']=function(_0x2ec0c3,_0x3e0407){return db['SquareOdbc'][_0xedd0('0x46')]({'where':{'id':_0x2ec0c3[_0xedd0('0x44')]['id']}})[_0xedd0('0x22')](handleEntityNotFound(_0x3e0407,null))['then'](removeEntity(_0x3e0407,null))['catch'](handleError(_0x3e0407,null));};exports[_0xedd0('0x4f')]=function(_0x1fdfdc,_0x437b65,_0x4f6f97){var _0x4543f8;return db[_0xedd0('0x2c')][_0xedd0('0x46')]({'where':{'id':_0x1fdfdc[_0xedd0('0x44')]['id']},'attributes':['id',_0xedd0('0x50')]})['then'](handleEntityNotFound(_0x437b65,null))[_0xedd0('0x22')](function(_0x14028a){if(_0x14028a){var _0x2c8b75=require(_0xedd0('0x51'))();_0x2c8b75[_0xedd0('0x52')](_0x14028a['dsn']);_0x2c8b75[_0xedd0('0x53')]();return _0x14028a;}})[_0xedd0('0x22')](respondWithResult(_0x437b65,null))[_0xedd0('0x43')](handleError(_0x437b65,null));};
\ No newline at end of file