From: support
Date: Fri, 21 Oct 2022 11:15:01 +0000 (+0000)
Subject: Built motion from commit 21186556.|2.6.19
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=526671bfd61106e43d5f8eb80d8e7e4e0c8ffb9a;p=motion2.git
Built motion from commit 21186556.|2.6.19
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 28c33aa..95247ef 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-21T10:22:18.173Z",
+ "time": "2022-10-21T11:07:24.689Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 80a5b7f..2984e78 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-21T10:22:18.173Z",
+ "time": "2022-10-21T11:07:24.689Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js
index c716112..4a67956 100644
--- a/server/api/action/action.attributes.js
+++ b/server/api/action/action.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd928=['integration','motionbar','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','action','contactManager'];(function(_0x370f61,_0x26dfc4){var _0x44b611=function(_0x52404d){while(--_0x52404d){_0x370f61['push'](_0x370f61['shift']());}};_0x44b611(++_0x26dfc4);}(_0xd928,0x85));var _0x8d92=function(_0x2c0f5c,_0x58bdbc){_0x2c0f5c=_0x2c0f5c-0x0;var _0x2ca3a2=_0xd928[_0x2c0f5c];return _0x2ca3a2;};'use strict';var Sequelize=require('sequelize');module[_0x8d92('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x9dc1a9){return this['getDataValue'](_0x8d92('0x1'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x8d92('0x2'),_0x8d92('0x3'),_0x8d92('0x4'),'jscripty',_0x8d92('0x5'),_0x8d92('0x6'),_0x8d92('0x7'),_0x8d92('0x8')]],'msg':_0x8d92('0x9')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x8d92('0xa')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0x8d92('0xa')](0x1000),'comment':_0x8d92('0xb')},'data4':{'type':Sequelize[_0x8d92('0xa')](0x1000),'comments':_0x8d92('0xc')},'data5':{'type':Sequelize[_0x8d92('0xa')](0x1000),'comments':_0x8d92('0xd')},'data6':{'type':Sequelize[_0x8d92('0xa')],'comments':_0x8d92('0xe')},'data7':{'type':Sequelize[_0x8d92('0xf')],'comments':_0x8d92('0x10')}};
\ No newline at end of file
+var _0xfa74=['VIRTUAL','getDataValue','action','STRING','integration','motionbar','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]'];(function(_0x3fb1c0,_0x57a877){var _0x533f47=function(_0x2b7420){while(--_0x2b7420){_0x3fb1c0['push'](_0x3fb1c0['shift']());}};_0x533f47(++_0x57a877);}(_0xfa74,0x1b0));var _0x4fa7=function(_0x31db2b,_0xb218b7){_0x31db2b=_0x31db2b-0x0;var _0x1459a0=_0xfa74[_0x31db2b];return _0x1459a0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x4fa7('0x0')],'get':function(_0x4a83b7){return this[_0x4fa7('0x1')](_0x4fa7('0x2'));}},'action':{'type':Sequelize[_0x4fa7('0x3')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0x4fa7('0x4'),_0x4fa7('0x5'),_0x4fa7('0x6'),_0x4fa7('0x7'),'browser','bot',_0x4fa7('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x4fa7('0x9')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x4fa7('0xa')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x4fa7('0xb')},'data3':{'type':Sequelize[_0x4fa7('0x3')](0x1000),'comment':_0x4fa7('0xc')},'data4':{'type':Sequelize[_0x4fa7('0x3')](0x1000),'comments':_0x4fa7('0xd')},'data5':{'type':Sequelize['STRING'](0x1000),'comments':_0x4fa7('0xe')},'data6':{'type':Sequelize[_0x4fa7('0x3')],'comments':_0x4fa7('0xf')},'data7':{'type':Sequelize[_0x4fa7('0x10')],'comments':_0x4fa7('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index b9df812..62c2c8f 100644
--- a/server/api/action/action.controller.js
+++ b/server/api/action/action.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf5bb=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','save','then','error','stack','name','body','Action','catch','destroy','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger'];(function(_0x4f6dc2,_0x7c72f4){var _0x1288f0=function(_0x3509ae){while(--_0x3509ae){_0x4f6dc2['push'](_0x4f6dc2['shift']());}};_0x1288f0(++_0x7c72f4);}(_0xf5bb,0x9c));var _0xbf5b=function(_0x5b8d18,_0x1bbfa0){_0x5b8d18=_0x5b8d18-0x0;var _0x43ac37=_0xf5bb[_0x5b8d18];return _0x43ac37;};'use strict';var emlformat=require(_0xbf5b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbf5b('0x1'));var jsonpatch=require(_0xbf5b('0x2'));var rp=require(_0xbf5b('0x3'));var moment=require(_0xbf5b('0x4'));var BPromise=require(_0xbf5b('0x5'));var Mustache=require('mustache');var util=require(_0xbf5b('0x6'));var path=require('path');var sox=require(_0xbf5b('0x7'));var csv=require(_0xbf5b('0x8'));var ejs=require(_0xbf5b('0x9'));var fs=require('fs');var fs_extra=require(_0xbf5b('0xa'));var _=require(_0xbf5b('0xb'));var squel=require(_0xbf5b('0xc'));var crypto=require(_0xbf5b('0xd'));var jsforce=require(_0xbf5b('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbf5b('0x8'));var querystring=require(_0xbf5b('0xf'));var Papa=require(_0xbf5b('0x10'));var Redis=require('ioredis');var authService=require(_0xbf5b('0x11'));var qs=require(_0xbf5b('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xbf5b('0x13'))(_0xbf5b('0x14'));var utils=require(_0xbf5b('0x15'));var config=require(_0xbf5b('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xbf5b('0x17'))['db'];function respondWithStatusCode(_0x3ee392,_0x4c72f6){_0x4c72f6=_0x4c72f6||0xcc;return function(_0x25386d){if(_0x25386d){return _0x3ee392[_0xbf5b('0x18')](_0x4c72f6);}return _0x3ee392[_0xbf5b('0x19')](_0x4c72f6)[_0xbf5b('0x1a')]();};}function respondWithResult(_0x4a1b1d,_0x556e3d){_0x556e3d=_0x556e3d||0xc8;return function(_0x1b6a99){if(_0x1b6a99){return _0x4a1b1d[_0xbf5b('0x19')](_0x556e3d)[_0xbf5b('0x1b')](_0x1b6a99);}};}function respondWithFilteredResult(_0x2799c4,_0x5a4d66){return function(_0x498c30){if(_0x498c30){var _0x3e3ea3=typeof _0x5a4d66['offset']===_0xbf5b('0x1c')&&typeof _0x5a4d66[_0xbf5b('0x1d')]===_0xbf5b('0x1c');var _0x1ee1d8=_0x498c30['count'];var _0x9012f3=_0x3e3ea3?0x0:_0x5a4d66['offset'];var _0x54a6ee=_0x3e3ea3?_0x498c30[_0xbf5b('0x1e')]:_0x5a4d66[_0xbf5b('0x1f')]+_0x5a4d66[_0xbf5b('0x1d')];var _0x2d79e5;if(_0x54a6ee>=_0x1ee1d8){_0x54a6ee=_0x1ee1d8;_0x2d79e5=0xc8;}else{_0x2d79e5=0xce;}_0x2799c4['status'](_0x2d79e5);return _0x2799c4[_0xbf5b('0x20')](_0xbf5b('0x21'),_0x9012f3+'-'+_0x54a6ee+'/'+_0x1ee1d8)['json'](_0x498c30);}return null;};}function patchUpdates(_0xe769cf){return function(_0x2459a0){try{jsonpatch['apply'](_0x2459a0,_0xe769cf,!![]);}catch(_0x52956e){return BPromise['reject'](_0x52956e);}return _0x2459a0[_0xbf5b('0x22')]();};}function saveUpdates(_0x2addf5,_0x38b693){return function(_0x1b7680){if(_0x1b7680){return _0x1b7680['update'](_0x2addf5)[_0xbf5b('0x23')](function(_0xc8264d){return _0xc8264d;});}return null;};}function removeEntity(_0x2a046f,_0x19121a){return function(_0x29ae9c){if(_0x29ae9c){return _0x29ae9c['destroy']()[_0xbf5b('0x23')](function(){_0x2a046f[_0xbf5b('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0xdbaec7,_0x4eddd2){return function(_0x34870a){if(!_0x34870a){_0xdbaec7[_0xbf5b('0x18')](0x194);}return _0x34870a;};}function handleError(_0x1c3df4,_0xd9be4){_0xd9be4=_0xd9be4||0x1f4;return function(_0x2fa22b){logger[_0xbf5b('0x24')](_0x2fa22b[_0xbf5b('0x25')]);if(_0x2fa22b['name']){delete _0x2fa22b[_0xbf5b('0x26')];}_0x1c3df4[_0xbf5b('0x19')](_0xd9be4)['send'](_0x2fa22b);};}exports['update']=function(_0x11656c,_0x5c1af8){if(_0x11656c[_0xbf5b('0x27')]['id']){delete _0x11656c[_0xbf5b('0x27')]['id'];}return db[_0xbf5b('0x28')]['find']({'where':{'id':_0x11656c['params']['id']}})[_0xbf5b('0x23')](handleEntityNotFound(_0x5c1af8,null))[_0xbf5b('0x23')](saveUpdates(_0x11656c[_0xbf5b('0x27')],null))[_0xbf5b('0x23')](respondWithResult(_0x5c1af8,null))[_0xbf5b('0x29')](handleError(_0x5c1af8,null));};exports[_0xbf5b('0x2a')]=function(_0x398faa,_0x33de3b){return db[_0xbf5b('0x28')]['find']({'where':{'id':_0x398faa[_0xbf5b('0x2b')]['id']}})['then'](handleEntityNotFound(_0x33de3b,null))['then'](removeEntity(_0x33de3b,null))[_0xbf5b('0x29')](handleError(_0x33de3b,null));};
\ No newline at end of file
+var _0xddb9=['limit','offset','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','body','params','catch','Action','find','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined'];(function(_0x541499,_0x216973){var _0x1dba9a=function(_0x48bb68){while(--_0x48bb68){_0x541499['push'](_0x541499['shift']());}};_0x1dba9a(++_0x216973);}(_0xddb9,0x70));var _0x9ddb=function(_0x5d8b04,_0x360b56){_0x5d8b04=_0x5d8b04-0x0;var _0x507df7=_0xddb9[_0x5d8b04];return _0x507df7;};'use strict';var emlformat=require(_0x9ddb('0x0'));var rimraf=require(_0x9ddb('0x1'));var zipdir=require(_0x9ddb('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9ddb('0x3'));var moment=require('moment');var BPromise=require(_0x9ddb('0x4'));var Mustache=require(_0x9ddb('0x5'));var util=require(_0x9ddb('0x6'));var path=require(_0x9ddb('0x7'));var sox=require(_0x9ddb('0x8'));var csv=require(_0x9ddb('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9ddb('0xa'));var _=require(_0x9ddb('0xb'));var squel=require(_0x9ddb('0xc'));var crypto=require('crypto');var jsforce=require(_0x9ddb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x9ddb('0x9'));var querystring=require(_0x9ddb('0xe'));var Papa=require(_0x9ddb('0xf'));var Redis=require(_0x9ddb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9ddb('0x11'));var as=require(_0x9ddb('0x12'));var hardwareService=require(_0x9ddb('0x13'));var logger=require(_0x9ddb('0x14'))('api');var utils=require(_0x9ddb('0x15'));var config=require(_0x9ddb('0x16'));var licenseUtil=require(_0x9ddb('0x17'));var db=require(_0x9ddb('0x18'))['db'];function respondWithStatusCode(_0x3853e7,_0x25fcbe){_0x25fcbe=_0x25fcbe||0xcc;return function(_0x4177e2){if(_0x4177e2){return _0x3853e7['sendStatus'](_0x25fcbe);}return _0x3853e7[_0x9ddb('0x19')](_0x25fcbe)[_0x9ddb('0x1a')]();};}function respondWithResult(_0x372a43,_0x50114e){_0x50114e=_0x50114e||0xc8;return function(_0x17a95b){if(_0x17a95b){return _0x372a43[_0x9ddb('0x19')](_0x50114e)[_0x9ddb('0x1b')](_0x17a95b);}};}function respondWithFilteredResult(_0x3b3c28,_0x580655){return function(_0x16bff2){if(_0x16bff2){var _0x519ed7=typeof _0x580655['offset']===_0x9ddb('0x1c')&&typeof _0x580655[_0x9ddb('0x1d')]===_0x9ddb('0x1c');var _0x336a90=_0x16bff2['count'];var _0x4245c6=_0x519ed7?0x0:_0x580655['offset'];var _0x4f726b=_0x519ed7?_0x16bff2['count']:_0x580655[_0x9ddb('0x1e')]+_0x580655[_0x9ddb('0x1d')];var _0x5534c8;if(_0x4f726b>=_0x336a90){_0x4f726b=_0x336a90;_0x5534c8=0xc8;}else{_0x5534c8=0xce;}_0x3b3c28['status'](_0x5534c8);return _0x3b3c28[_0x9ddb('0x1f')](_0x9ddb('0x20'),_0x4245c6+'-'+_0x4f726b+'/'+_0x336a90)[_0x9ddb('0x1b')](_0x16bff2);}return null;};}function patchUpdates(_0x67fd8f){return function(_0x52c207){try{jsonpatch[_0x9ddb('0x21')](_0x52c207,_0x67fd8f,!![]);}catch(_0x3851af){return BPromise['reject'](_0x3851af);}return _0x52c207[_0x9ddb('0x22')]();};}function saveUpdates(_0x1540ef,_0x28ad34){return function(_0x444cd3){if(_0x444cd3){return _0x444cd3[_0x9ddb('0x23')](_0x1540ef)[_0x9ddb('0x24')](function(_0x5c5053){return _0x5c5053;});}return null;};}function removeEntity(_0x45de66,_0xcc5c30){return function(_0x34b231){if(_0x34b231){return _0x34b231[_0x9ddb('0x25')]()[_0x9ddb('0x24')](function(){_0x45de66[_0x9ddb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9e8311,_0x4cc715){return function(_0x5e9126){if(!_0x5e9126){_0x9e8311[_0x9ddb('0x26')](0x194);}return _0x5e9126;};}function handleError(_0x2aec9b,_0x56290a){_0x56290a=_0x56290a||0x1f4;return function(_0x25a1c5){logger['error'](_0x25a1c5[_0x9ddb('0x27')]);if(_0x25a1c5[_0x9ddb('0x28')]){delete _0x25a1c5[_0x9ddb('0x28')];}_0x2aec9b[_0x9ddb('0x19')](_0x56290a)[_0x9ddb('0x29')](_0x25a1c5);};}exports[_0x9ddb('0x23')]=function(_0x31aba3,_0x5a3fd4){if(_0x31aba3[_0x9ddb('0x2a')]['id']){delete _0x31aba3[_0x9ddb('0x2a')]['id'];}return db['Action']['find']({'where':{'id':_0x31aba3[_0x9ddb('0x2b')]['id']}})[_0x9ddb('0x24')](handleEntityNotFound(_0x5a3fd4,null))[_0x9ddb('0x24')](saveUpdates(_0x31aba3['body'],null))[_0x9ddb('0x24')](respondWithResult(_0x5a3fd4,null))[_0x9ddb('0x2c')](handleError(_0x5a3fd4,null));};exports[_0x9ddb('0x25')]=function(_0xd7bb7b,_0x5e56c8){return db[_0x9ddb('0x2d')][_0x9ddb('0x2e')]({'where':{'id':_0xd7bb7b[_0x9ddb('0x2b')]['id']}})[_0x9ddb('0x24')](handleEntityNotFound(_0x5e56c8,null))[_0x9ddb('0x24')](removeEntity(_0x5e56c8,null))[_0x9ddb('0x2c')](handleError(_0x5e56c8,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 04f67a4..2f4c293 100644
--- a/server/api/action/action.model.js
+++ b/server/api/action/action.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x14e0=['lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./action.attributes','define','tools_actions'];(function(_0x4765c3,_0x3f2f9f){var _0x3e86d9=function(_0x59b6d6){while(--_0x59b6d6){_0x4765c3['push'](_0x4765c3['shift']());}};_0x3e86d9(++_0x3f2f9f);}(_0x14e0,0x6e));var _0x014e=function(_0x1344d6,_0x2181e6){_0x1344d6=_0x1344d6-0x0;var _0xf45b24=_0x14e0[_0x1344d6];return _0xf45b24;};'use strict';var _=require(_0x014e('0x0'));var util=require(_0x014e('0x1'));var logger=require(_0x014e('0x2'))(_0x014e('0x3'));var moment=require('moment');var BPromise=require(_0x014e('0x4'));var rp=require(_0x014e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x014e('0x6'));var attributes=require(_0x014e('0x7'));module['exports']=function(_0x58cdc6,_0x5f12e5){return _0x58cdc6[_0x014e('0x8')]('Action',attributes,{'tableName':_0x014e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15ec=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions'];(function(_0x17a395,_0x55e197){var _0x12c683=function(_0x8dd304){while(--_0x8dd304){_0x17a395['push'](_0x17a395['shift']());}};_0x12c683(++_0x55e197);}(_0x15ec,0x16c));var _0xc15e=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x15ec[_0x53cf8e];return _0x459197;};'use strict';var _=require('lodash');var util=require(_0xc15e('0x0'));var logger=require(_0xc15e('0x1'))(_0xc15e('0x2'));var moment=require(_0xc15e('0x3'));var BPromise=require(_0xc15e('0x4'));var rp=require(_0xc15e('0x5'));var fs=require('fs');var path=require(_0xc15e('0x6'));var rimraf=require(_0xc15e('0x7'));var config=require(_0xc15e('0x8'));var attributes=require(_0xc15e('0x9'));module[_0xc15e('0xa')]=function(_0x4e7b48,_0x46f5d3){return _0x4e7b48['define'](_0xc15e('0xb'),attributes,{'tableName':_0xc15e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 9683cc9..220bc24 100644
--- a/server/api/action/action.rpc.js
+++ b/server/api/action/action.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1cb9=['error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2f2a5a,_0x10dbea){_0x2f2a5a=_0x2f2a5a-0x0;var _0x1ebf12=_0x1cb9[_0x2f2a5a];return _0x1ebf12;};'use strict';var _=require(_0x91cb('0x0'));var util=require('util');var moment=require(_0x91cb('0x1'));var BPromise=require(_0x91cb('0x2'));var rs=require(_0x91cb('0x3'));var fs=require('fs');var Redis=require(_0x91cb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x91cb('0x5'));var logger=require(_0x91cb('0x6'))('rpc');var config=require(_0x91cb('0x7'));var jayson=require(_0x91cb('0x8'));var client=jayson[_0x91cb('0x9')][_0x91cb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3b9d98,_0x8f8a3b,_0x4c1f56){return new BPromise(function(_0x15c517,_0x5bda2f){return client[_0x91cb('0xb')](_0x3b9d98,_0x4c1f56)['then'](function(_0xa43e7a){logger[_0x91cb('0xc')](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));logger[_0x91cb('0xf')](_0x91cb('0x10'),_0x8f8a3b,_0x91cb('0xe'),JSON[_0x91cb('0x11')](_0xa43e7a));if(_0xa43e7a[_0x91cb('0x12')]){if(_0xa43e7a[_0x91cb('0x12')]['code']===0x1f4){logger[_0x91cb('0x12')](_0x91cb('0xd'),_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x5bda2f(_0xa43e7a[_0x91cb('0x12')][_0x91cb('0x13')]);}logger[_0x91cb('0x12')]('Action,\x20%s,\x20%s',_0x8f8a3b,_0xa43e7a['error'][_0x91cb('0x13')]);return _0x15c517(_0xa43e7a[_0x91cb('0x12')]['message']);}else{logger['info'](_0x91cb('0xd'),_0x8f8a3b,_0x91cb('0xe'));_0x15c517(_0xa43e7a[_0x91cb('0x14')]['message']);}})[_0x91cb('0x15')](function(_0x135890){logger['error'](_0x91cb('0xd'),_0x8f8a3b,_0x135890);_0x5bda2f(_0x135890);});});}
\ No newline at end of file
+var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','Action,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0xf494,0x1c6));var _0x4f49=function(_0xabf149,_0x7c2cc6){_0xabf149=_0xabf149-0x0;var _0x26bdfb=_0xf494[_0xabf149];return _0x26bdfb;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 88a4046..b86fb56 100644
--- a/server/api/action/index.js
+++ b/server/api/action/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9bc6=['../../components/auth/service','../../components/interaction/service','./action.controller','isAuthenticated','update','delete','/:id','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x46dc9e,_0x33b927){var _0x446121=function(_0x1bb285){while(--_0x1bb285){_0x46dc9e['push'](_0x46dc9e['shift']());}};_0x446121(++_0x33b927);}(_0x9bc6,0x126));var _0x69bc=function(_0x87e0dc,_0x577dce){_0x87e0dc=_0x87e0dc-0x0;var _0x2cd2d1=_0x9bc6[_0x87e0dc];return _0x2cd2d1;};'use strict';var multer=require(_0x69bc('0x0'));var util=require(_0x69bc('0x1'));var path=require(_0x69bc('0x2'));var timeout=require(_0x69bc('0x3'));var express=require('express');var router=express[_0x69bc('0x4')]();var fs_extra=require(_0x69bc('0x5'));var auth=require(_0x69bc('0x6'));var interaction=require(_0x69bc('0x7'));var config=require('../../config/environment');var controller=require(_0x69bc('0x8'));router['put']('/:id',auth[_0x69bc('0x9')](),controller[_0x69bc('0xa')]);router[_0x69bc('0xb')](_0x69bc('0xc'),auth[_0x69bc('0x9')](),controller[_0x69bc('0xd')]);module[_0x69bc('0xe')]=router;
\ No newline at end of file
+var _0xd0ba=['./action.controller','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4c797d,_0x4960ac){var _0x286e7a=function(_0x34b6b8){while(--_0x34b6b8){_0x4c797d['push'](_0x4c797d['shift']());}};_0x286e7a(++_0x4960ac);}(_0xd0ba,0xd8));var _0xad0b=function(_0x3e112d,_0x2bb132){_0x3e112d=_0x3e112d-0x0;var _0x531c31=_0xd0ba[_0x3e112d];return _0x531c31;};'use strict';var multer=require(_0xad0b('0x0'));var util=require('util');var path=require(_0xad0b('0x1'));var timeout=require(_0xad0b('0x2'));var express=require('express');var router=express[_0xad0b('0x3')]();var fs_extra=require(_0xad0b('0x4'));var auth=require(_0xad0b('0x5'));var interaction=require(_0xad0b('0x6'));var config=require(_0xad0b('0x7'));var controller=require(_0xad0b('0x8'));router[_0xad0b('0x9')](_0xad0b('0xa'),auth[_0xad0b('0xb')](),controller[_0xad0b('0xc')]);router[_0xad0b('0xd')](_0xad0b('0xa'),auth['isAuthenticated'](),controller[_0xad0b('0xe')]);module[_0xad0b('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 6be6311..7740aaa 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.attributes.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x57447f,_0x158ad1){var _0x22e71a=function(_0xcfe41d){while(--_0xcfe41d){_0x57447f['push'](_0x57447f['shift']());}};_0x22e71a(++_0x158ad1);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x16ecb8,_0x52d849){_0x16ecb8=_0x16ecb8-0x0;var _0x4b869c=_0x3f8a[_0x16ecb8];return _0x4b869c;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
+var _0x5496=['TEXT','sequelize','exports','STRING'];(function(_0x2e839a,_0xad03e6){var _0x535ede=function(_0x1cffe5){while(--_0x1cffe5){_0x2e839a['push'](_0x2e839a['shift']());}};_0x535ede(++_0xad03e6);}(_0x5496,0x175));var _0x6549=function(_0x4f7dbb,_0x150269){_0x4f7dbb=_0x4f7dbb-0x0;var _0x64f386=_0x5496[_0x4f7dbb];return _0x64f386;};'use strict';var Sequelize=require(_0x6549('0x0'));module[_0x6549('0x1')]={'name':{'type':Sequelize[_0x6549('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x6549('0x2')]},'parent':{'type':Sequelize[_0x6549('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x6549('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 5c931af..579a9f5 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.controller.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc210=['AnalyticCustomReport','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','name','options','includeAll','rows','show','params','keys','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','CustomReports','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','field','condition','value','AnalyticMetric','findAll','keyBy','from','MetricId','function','replace','format','groupBy','group','orderBy','order','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','table','conditions','clone','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','includes','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','metric','output','web','fullPath','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','../../files/reports','savename','select','COUNT(*)','run','runReport','SEC_TO_TIME(%s)','operator','ValidationErrorItem','alias','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','dbH','sendStatus','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','send','index'];(function(_0xf34109,_0x380779){var _0x570bfc=function(_0x1ad086){while(--_0x1ad086){_0xf34109['push'](_0xf34109['shift']());}};_0x570bfc(++_0x380779);}(_0xc210,0x7c));var _0x0c21=function(_0x431970,_0x3d390b){_0x431970=_0x431970-0x0;var _0x3a347a=_0xc210[_0x431970];return _0x3a347a;};'use strict';var emlformat=require(_0x0c21('0x0'));var rimraf=require(_0x0c21('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0c21('0x2'));var rp=require(_0x0c21('0x3'));var moment=require(_0x0c21('0x4'));var BPromise=require(_0x0c21('0x5'));var Mustache=require(_0x0c21('0x6'));var util=require(_0x0c21('0x7'));var path=require(_0x0c21('0x8'));var sox=require(_0x0c21('0x9'));var csv=require(_0x0c21('0xa'));var ejs=require(_0x0c21('0xb'));var fs=require('fs');var fs_extra=require(_0x0c21('0xc'));var _=require(_0x0c21('0xd'));var squel=require(_0x0c21('0xe'));var crypto=require('crypto');var jsforce=require(_0x0c21('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x0c21('0x10'));var Papa=require(_0x0c21('0x11'));var Redis=require(_0x0c21('0x12'));var authService=require(_0x0c21('0x13'));var qs=require(_0x0c21('0x14'));var as=require(_0x0c21('0x15'));var hardwareService=require(_0x0c21('0x16'));var logger=require('../../config/logger')(_0x0c21('0x17'));var utils=require(_0x0c21('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x0c21('0x19'))['db'];var dbH=require(_0x0c21('0x19'))[_0x0c21('0x1a')];function respondWithStatusCode(_0x3f13ab,_0x4e9cd1){_0x4e9cd1=_0x4e9cd1||0xcc;return function(_0x219915){if(_0x219915){return _0x3f13ab[_0x0c21('0x1b')](_0x4e9cd1);}return _0x3f13ab[_0x0c21('0x1c')](_0x4e9cd1)[_0x0c21('0x1d')]();};}function respondWithResult(_0x1e6991,_0x522612){_0x522612=_0x522612||0xc8;return function(_0x59af8f){if(_0x59af8f){return _0x1e6991[_0x0c21('0x1c')](_0x522612)[_0x0c21('0x1e')](_0x59af8f);}};}function respondWithFilteredResult(_0x3c5187,_0x50f86f){return function(_0xd3fa93){if(_0xd3fa93){var _0x2ea818=typeof _0x50f86f['offset']===_0x0c21('0x1f')&&typeof _0x50f86f[_0x0c21('0x20')]===_0x0c21('0x1f');var _0x52afdb=_0xd3fa93['count'];var _0x208ed6=_0x2ea818?0x0:_0x50f86f[_0x0c21('0x21')];var _0x4e1ba6=_0x2ea818?_0xd3fa93[_0x0c21('0x22')]:_0x50f86f['offset']+_0x50f86f[_0x0c21('0x20')];var _0x184f99;if(_0x4e1ba6>=_0x52afdb){_0x4e1ba6=_0x52afdb;_0x184f99=0xc8;}else{_0x184f99=0xce;}_0x3c5187['status'](_0x184f99);return _0x3c5187[_0x0c21('0x23')](_0x0c21('0x24'),_0x208ed6+'-'+_0x4e1ba6+'/'+_0x52afdb)['json'](_0xd3fa93);}return null;};}function patchUpdates(_0x199622){return function(_0x5753f0){try{jsonpatch[_0x0c21('0x25')](_0x5753f0,_0x199622,!![]);}catch(_0x36e1d0){return BPromise[_0x0c21('0x26')](_0x36e1d0);}return _0x5753f0[_0x0c21('0x27')]();};}function saveUpdates(_0x3b71e3,_0x4f1a66){return function(_0x570313){if(_0x570313){return _0x570313[_0x0c21('0x28')](_0x3b71e3)[_0x0c21('0x29')](function(_0x606d3){return _0x606d3;});}return null;};}function removeEntity(_0x2ef9f0,_0x136cd5){return function(_0x3f9e91){if(_0x3f9e91){return _0x3f9e91[_0x0c21('0x2a')]()[_0x0c21('0x29')](function(){var _0x47eaf1=_0x3f9e91[_0x0c21('0x2b')]({'plain':!![]});var _0x1950a2='CustomReports';return db[_0x0c21('0x2c')][_0x0c21('0x2a')]({'where':{'type':_0x1950a2,'resourceId':_0x47eaf1['id']}})[_0x0c21('0x29')](function(){return _0x3f9e91;});})[_0x0c21('0x29')](function(){_0x2ef9f0[_0x0c21('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2355b6,_0x56d863){return function(_0x2b8b14){if(!_0x2b8b14){_0x2355b6[_0x0c21('0x1b')](0x194);}return _0x2b8b14;};}function handleError(_0x48b6f1,_0x1586bb){_0x1586bb=_0x1586bb||0x1f4;return function(_0x2ab69a){logger[_0x0c21('0x2d')](_0x2ab69a[_0x0c21('0x2e')]);if(_0x2ab69a['name']){delete _0x2ab69a['name'];}_0x48b6f1[_0x0c21('0x1c')](_0x1586bb)[_0x0c21('0x2f')](_0x2ab69a);};}exports[_0x0c21('0x30')]=function(_0x567484,_0x101351){var _0x2b5ad8={},_0x8211b1={},_0x209ee4={'count':0x0,'rows':[]};var _0x15b491=_['map'](db[_0x0c21('0x31')][_0x0c21('0x32')],function(_0x5dad89){return{'name':_0x5dad89[_0x0c21('0x33')],'type':_0x5dad89['type'][_0x0c21('0x34')]};});_0x8211b1[_0x0c21('0x35')]=_['map'](_0x15b491,'name');_0x8211b1[_0x0c21('0x36')]=_['keys'](_0x567484[_0x0c21('0x36')]);_0x8211b1[_0x0c21('0x37')]=_['intersection'](_0x8211b1[_0x0c21('0x35')],_0x8211b1[_0x0c21('0x36')]);_0x2b5ad8[_0x0c21('0x38')]=_[_0x0c21('0x39')](_0x8211b1[_0x0c21('0x35')],qs['fields'](_0x567484[_0x0c21('0x36')][_0x0c21('0x3a')]));_0x2b5ad8['attributes']=_0x2b5ad8[_0x0c21('0x38')][_0x0c21('0x3b')]?_0x2b5ad8[_0x0c21('0x38')]:_0x8211b1[_0x0c21('0x35')];if(!_0x567484[_0x0c21('0x36')][_0x0c21('0x3c')](_0x0c21('0x3d'))){_0x2b5ad8[_0x0c21('0x20')]=qs['limit'](_0x567484[_0x0c21('0x36')][_0x0c21('0x20')]);_0x2b5ad8[_0x0c21('0x21')]=qs[_0x0c21('0x21')](_0x567484[_0x0c21('0x36')][_0x0c21('0x21')]);}_0x2b5ad8['order']=qs[_0x0c21('0x3e')](_0x567484[_0x0c21('0x36')][_0x0c21('0x3e')]);_0x2b5ad8[_0x0c21('0x3f')]=qs['filters'](_[_0x0c21('0x40')](_0x567484[_0x0c21('0x36')],_0x8211b1[_0x0c21('0x37')]),_0x15b491);if(_0x567484[_0x0c21('0x36')][_0x0c21('0x41')]){_0x2b5ad8['where']=_[_0x0c21('0x42')](_0x2b5ad8['where'],{'$or':_[_0x0c21('0x43')](_0x15b491,function(_0x2665b8){if(_0x2665b8[_0x0c21('0x44')]!==_0x0c21('0x45')){var _0x2bba41={};_0x2bba41[_0x2665b8[_0x0c21('0x46')]]={'$like':'%'+_0x567484[_0x0c21('0x36')][_0x0c21('0x41')]+'%'};return _0x2bba41;}})});}_0x2b5ad8=_['merge']({},_0x2b5ad8,_0x567484[_0x0c21('0x47')]);var _0x39d6df={'where':_0x2b5ad8['where']};return db[_0x0c21('0x31')][_0x0c21('0x22')](_0x39d6df)[_0x0c21('0x29')](function(_0x4a6d74){_0x209ee4[_0x0c21('0x22')]=_0x4a6d74;if(_0x567484[_0x0c21('0x36')][_0x0c21('0x48')]){_0x2b5ad8['include']=[{'all':!![]}];}return db[_0x0c21('0x31')]['findAll'](_0x2b5ad8);})[_0x0c21('0x29')](function(_0x4838e9){_0x209ee4[_0x0c21('0x49')]=_0x4838e9;return _0x209ee4;})['then'](respondWithFilteredResult(_0x101351,_0x2b5ad8))['catch'](handleError(_0x101351,null));};exports[_0x0c21('0x4a')]=function(_0x350e10,_0x21a949){var _0x19c795={'raw':![],'where':{'id':_0x350e10[_0x0c21('0x4b')]['id']}},_0x104b6f={};_0x104b6f['model']=_[_0x0c21('0x4c')](db['AnalyticCustomReport'][_0x0c21('0x32')]);_0x104b6f[_0x0c21('0x36')]=_[_0x0c21('0x4c')](_0x350e10[_0x0c21('0x36')]);_0x104b6f[_0x0c21('0x37')]=_[_0x0c21('0x39')](_0x104b6f['model'],_0x104b6f['query']);_0x19c795[_0x0c21('0x38')]=_[_0x0c21('0x39')](_0x104b6f[_0x0c21('0x35')],qs[_0x0c21('0x3a')](_0x350e10['query'][_0x0c21('0x3a')]));_0x19c795[_0x0c21('0x38')]=_0x19c795['attributes'][_0x0c21('0x3b')]?_0x19c795[_0x0c21('0x38')]:_0x104b6f['model'];if(_0x350e10[_0x0c21('0x36')]['includeAll']){_0x19c795[_0x0c21('0x4d')]=[{'all':!![]}];}_0x19c795=_[_0x0c21('0x42')]({},_0x19c795,_0x350e10[_0x0c21('0x47')]);return db[_0x0c21('0x31')][_0x0c21('0x4e')](_0x19c795)[_0x0c21('0x29')](handleEntityNotFound(_0x21a949,null))[_0x0c21('0x29')](respondWithResult(_0x21a949,null))[_0x0c21('0x4f')](handleError(_0x21a949,null));};exports[_0x0c21('0x50')]=function(_0x5bb9c0,_0x50f29c){return db[_0x0c21('0x31')]['create'](_0x5bb9c0[_0x0c21('0x51')],{})[_0x0c21('0x29')](function(_0x6495e5){var _0x3c4716=_0x5bb9c0[_0x0c21('0x52')][_0x0c21('0x2b')]({'plain':!![]});if(!_0x3c4716)throw new Error(_0x0c21('0x53'));if(_0x3c4716['role']===_0x0c21('0x52')){var _0x2b5e19=_0x6495e5[_0x0c21('0x2b')]({'plain':!![]});var _0x43736d=_0x0c21('0x54');return db[_0x0c21('0x55')][_0x0c21('0x4e')]({'where':{'name':_0x43736d,'userProfileId':_0x3c4716['userProfileId']},'raw':!![]})[_0x0c21('0x29')](function(_0x4078ea){if(_0x4078ea&&_0x4078ea[_0x0c21('0x56')]===0x0){return db[_0x0c21('0x2c')]['create']({'name':_0x2b5e19['name'],'resourceId':_0x2b5e19['id'],'type':_0x0c21('0x57'),'sectionId':_0x4078ea['id']},{})[_0x0c21('0x29')](function(){return _0x6495e5;});}else{return _0x6495e5;}})['catch'](function(_0x1f3bd3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f3bd3);throw _0x1f3bd3;});}return _0x6495e5;})['then'](respondWithResult(_0x50f29c,0xc9))[_0x0c21('0x4f')](handleError(_0x50f29c,null));};exports[_0x0c21('0x28')]=function(_0x17a16e,_0x3e0119){if(_0x17a16e['body']['id']){delete _0x17a16e[_0x0c21('0x51')]['id'];}return db[_0x0c21('0x31')][_0x0c21('0x4e')]({'where':{'id':_0x17a16e[_0x0c21('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3e0119,null))[_0x0c21('0x29')](saveUpdates(_0x17a16e[_0x0c21('0x51')],null))[_0x0c21('0x29')](respondWithResult(_0x3e0119,null))['catch'](handleError(_0x3e0119,null));};exports['destroy']=function(_0xa40f94,_0x3c227f){return db[_0x0c21('0x31')][_0x0c21('0x4e')]({'where':{'id':_0xa40f94[_0x0c21('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c227f,null))[_0x0c21('0x29')](removeEntity(_0x3c227f,null))[_0x0c21('0x4f')](handleError(_0x3c227f,null));};exports[_0x0c21('0x58')]=function(_0x578767,_0x3458a2){var _0x5d5f94=0xa;var _0x10d966=[_0x0c21('0x59'),'left_join',_0x0c21('0x5a'),_0x0c21('0x5b')];var _0xd84e04={'SUM':_0x0c21('0x5c'),'COUNT':_0x0c21('0x5d'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x0c21('0x5e'),'GROUP_CONCAT ASC':_0x0c21('0x5f'),'GROUP_CONCAT DESC':_0x0c21('0x60')};var _0x5f2f41={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x0c21('0x61'),'HOUR':_0x0c21('0x62'),'ROUND':_0x0c21('0x63'),'UNIX_TIMESTAMP':_0x0c21('0x64')};var _0x5e1836=function(_0x478761){return!_['includes']([_0x0c21('0x65'),_0x0c21('0x66'),_0x0c21('0x67'),_0x0c21('0x68')],_0x478761);};var _0x498cf2=function(_0xc6761c){if(!_0xc6761c||!_0xc6761c[_0x0c21('0x69')]['length']){return'';}for(var _0x96b66e='(',_0x2c1b02=0x0;_0x2c1b02<_0xc6761c[_0x0c21('0x69')]['length'];_0x2c1b02+=0x1){_0x2c1b02>0x0&&(_0x96b66e+='\x20'+_0xc6761c['operator']+'\x20');_0x96b66e+=_0xc6761c[_0x0c21('0x69')][_0x2c1b02]['group']?_0x498cf2(_0xc6761c['rules'][_0x2c1b02]['group']):_0xc6761c[_0x0c21('0x69')][_0x2c1b02][_0x0c21('0x6a')]+'\x20'+_0xc6761c[_0x0c21('0x69')][_0x2c1b02][_0x0c21('0x6b')]+(_0x5e1836(_0xc6761c[_0x0c21('0x69')][_0x2c1b02][_0x0c21('0x6b')])?'\x20'+_0xc6761c[_0x0c21('0x69')][_0x2c1b02][_0x0c21('0x6c')]:'');}return _0x96b66e+')';};var _0x48aefe={'where':{'id':_0x578767[_0x0c21('0x4b')]['id']}},_0x360445,_0x2a18d0,_0x596d61,_0x569240,_0xba2ce8;_0x48aefe=_[_0x0c21('0x42')]({},_0x48aefe,_0x578767[_0x0c21('0x47')]);return db['AnalyticCustomReport'][_0x0c21('0x4e')](_0x48aefe)['then'](function(_0x29cbbe){if(_0x29cbbe){_0x360445=_0x29cbbe;return _0x29cbbe['getFields']();}return null;})[_0x0c21('0x29')](function(_0x6459ae){if(_0x6459ae){if(!_0x6459ae[_0x0c21('0x3b')]){throw new db['Sequelize']['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2a18d0=_0x6459ae;return db[_0x0c21('0x6d')][_0x0c21('0x6e')]({'raw':!![]});}return null;})[_0x0c21('0x29')](function(_0x544eff){if(_0x544eff){_0x596d61=_[_0x0c21('0x6f')](_0x544eff,'id');var _0x4fddc7;var _0x398427=squel['select']();_0x398427[_0x0c21('0x70')](_0x360445['table']);for(var _0x2c0fc8=0x0;_0x2c0fc8<_0x2a18d0['length'];_0x2c0fc8+=0x1){_0x4fddc7=_0x2a18d0[_0x2c0fc8]['MetricId']?_0x596d61[_0x2a18d0[_0x2c0fc8][_0x0c21('0x71')]]['metric']:_0x2a18d0[_0x2c0fc8][_0x0c21('0x6a')];_0x4fddc7=_0x2a18d0[_0x2c0fc8][_0x0c21('0x72')]?_[_0x0c21('0x73')](_0xd84e04[_0x2a18d0[_0x2c0fc8][_0x0c21('0x72')]],'%s',_0x4fddc7):_0x4fddc7;_0x4fddc7=_0x2a18d0[_0x2c0fc8][_0x0c21('0x74')]?_[_0x0c21('0x73')](_0x5f2f41[_0x2a18d0[_0x2c0fc8][_0x0c21('0x74')]],'%s',_0x4fddc7):_0x4fddc7;if(_0x2a18d0[_0x2c0fc8][_0x0c21('0x75')]){_0x398427[_0x0c21('0x76')](_0x4fddc7);}_0x2a18d0[_0x2c0fc8][_0x0c21('0x77')]&&_0x398427[_0x0c21('0x78')](_0x4fddc7,_0x2a18d0[_0x2c0fc8][_0x0c21('0x77')]===_0x0c21('0x79')?![]:!![]);_0x398427[_0x0c21('0x6a')](_0x4fddc7,_0x2a18d0[_0x2c0fc8]['alias']||_0x4fddc7);}if(_0x360445[_0x0c21('0x7a')]){_0x360445[_0x0c21('0x7a')]=JSON[_0x0c21('0x7b')](_0x360445[_0x0c21('0x7a')]);for(var _0x544733=0x0;_0x544733<_0x360445['joins'][_0x0c21('0x3b')];_0x544733+=0x1){if(_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x44')]&&_['includes'](_0x10d966,_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x44')])&&_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x7c')]&&_0x360445['joins'][_0x544733][_0x0c21('0x7d')]&&_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x7e')]){_0x398427[_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x44')]](_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x7d')],null,util[_0x0c21('0x74')](_0x0c21('0x7f'),_0x360445[_0x0c21('0x80')],_0x360445['joins'][_0x544733][_0x0c21('0x7c')],_0x360445['joins'][_0x544733][_0x0c21('0x7d')],_0x360445[_0x0c21('0x7a')][_0x544733][_0x0c21('0x7e')]));}}}if(_0x360445[_0x0c21('0x81')]){_0x360445[_0x0c21('0x81')]=JSON[_0x0c21('0x7b')](_0x360445['conditions']);_0x398427[_0x0c21('0x3f')](_0x498cf2(_0x360445[_0x0c21('0x81')]['group']));}_0xba2ce8=_0x398427[_0x0c21('0x82')]();_0x398427[_0x0c21('0x20')](_0x5d5f94);_0x398427['offset'](0x0);logger[_0x0c21('0x83')](_0x0c21('0x84'),_0x398427['toString']());return dbH[_0x0c21('0x85')][_0x0c21('0x36')](_0x398427['toString'](),{'type':dbH[_0x0c21('0x85')][_0x0c21('0x86')][_0x0c21('0x87')]});}})[_0x0c21('0x29')](respondWithResult(_0x3458a2,null))['catch'](handleError(_0x3458a2,null));};function runReport(_0x460001,_0x3e208c,_0x47bb49){var _0x20ee1d=_0x3e208c[_0x0c21('0x46')];var _0x28b763=0xa;var _0x139445=['join',_0x0c21('0x88'),_0x0c21('0x5a'),_0x0c21('0x5b')];var _0x205ff5={'SUM':_0x0c21('0x5c'),'COUNT':_0x0c21('0x5d'),'COUNT DISTINCT':_0x0c21('0x89'),'MAX':_0x0c21('0x8a'),'MIN':_0x0c21('0x8b'),'AVG':_0x0c21('0x8c'),'GROUP_CONCAT':_0x0c21('0x5e'),'GROUP_CONCAT ASC':_0x0c21('0x5f'),'GROUP_CONCAT DESC':_0x0c21('0x60')};var _0x1c399f={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x0c21('0x64')};var _0x54702c=function(_0x196a77){return!_[_0x0c21('0x8d')]([_0x0c21('0x65'),'IS\x20NOT\x20NULL',_0x0c21('0x67'),_0x0c21('0x68')],_0x196a77);};var _0x1601b3=function(_0x28e29f){if(!_0x28e29f||!_0x28e29f[_0x0c21('0x69')][_0x0c21('0x3b')]){return'';}for(var _0x12df7e='(',_0x10aaf3=0x0;_0x10aaf3<_0x28e29f['rules'][_0x0c21('0x3b')];_0x10aaf3+=0x1){_0x10aaf3>0x0&&(_0x12df7e+='\x20'+_0x28e29f['operator']+'\x20');_0x12df7e+=_0x28e29f[_0x0c21('0x69')][_0x10aaf3][_0x0c21('0x76')]?_0x1601b3(_0x28e29f[_0x0c21('0x69')][_0x10aaf3][_0x0c21('0x76')]):_0x28e29f[_0x0c21('0x69')][_0x10aaf3][_0x0c21('0x6a')]+'\x20'+_0x28e29f[_0x0c21('0x69')][_0x10aaf3]['condition']+(_0x54702c(_0x28e29f[_0x0c21('0x69')][_0x10aaf3][_0x0c21('0x6b')])?'\x20'+_0x28e29f['rules'][_0x10aaf3]['value']:'');}return _0x12df7e+')';};var _0x414e8b={'where':{'id':_0x460001['id']}},_0x155245,_0x342731,_0x329350,_0x273f6f,_0x4c4ec3;_0x414e8b=_[_0x0c21('0x42')]({},_0x414e8b,_0x47bb49);return db[_0x0c21('0x31')]['find'](_0x414e8b)[_0x0c21('0x29')](function(_0x5e26ab){if(_0x5e26ab){_0x155245=_0x5e26ab;return _0x5e26ab[_0x0c21('0x8e')]();}return null;})[_0x0c21('0x29')](function(_0x51188f){if(_0x51188f){if(!_0x51188f[_0x0c21('0x3b')]){throw new db[(_0x0c21('0x8f'))]['ValidationErrorItem'](_0x0c21('0x90'),0x193);}_0x342731=_0x51188f;return db['AnalyticMetric'][_0x0c21('0x6e')]({'raw':!![]});}return null;})[_0x0c21('0x29')](function(_0x2d54f1){if(_0x2d54f1){_0x329350=_[_0x0c21('0x6f')](_0x2d54f1,'id');var _0x1d1dd9;var _0x469196=squel['select']();_0x469196[_0x0c21('0x70')](_0x155245[_0x0c21('0x80')]);for(var _0x294488=0x0;_0x294488<_0x342731[_0x0c21('0x3b')];_0x294488+=0x1){_0x1d1dd9=_0x342731[_0x294488][_0x0c21('0x71')]?_0x329350[_0x342731[_0x294488][_0x0c21('0x71')]][_0x0c21('0x91')]:_0x342731[_0x294488][_0x0c21('0x6a')];_0x1d1dd9=_0x342731[_0x294488][_0x0c21('0x72')]?_[_0x0c21('0x73')](_0x205ff5[_0x342731[_0x294488][_0x0c21('0x72')]],'%s',_0x1d1dd9):_0x1d1dd9;_0x1d1dd9=_0x342731[_0x294488]['format']?_[_0x0c21('0x73')](_0x1c399f[_0x342731[_0x294488]['format']],'%s',_0x1d1dd9):_0x1d1dd9;if(_0x342731[_0x294488]['groupBy']){_0x469196[_0x0c21('0x76')](_0x1d1dd9);}_0x342731[_0x294488][_0x0c21('0x77')]&&_0x469196['order'](_0x1d1dd9,_0x342731[_0x294488][_0x0c21('0x77')]===_0x0c21('0x79')?![]:!![]);_0x469196[_0x0c21('0x6a')](_0x1d1dd9,_0x342731[_0x294488]['alias']||_0x1d1dd9);}if(_0x155245[_0x0c21('0x7a')]){_0x155245[_0x0c21('0x7a')]=JSON[_0x0c21('0x7b')](_0x155245['joins']);for(var _0x55ccc1=0x0;_0x55ccc1<_0x155245[_0x0c21('0x7a')]['length'];_0x55ccc1+=0x1){if(_0x155245[_0x0c21('0x7a')][_0x55ccc1][_0x0c21('0x44')]&&_[_0x0c21('0x8d')](_0x139445,_0x155245[_0x0c21('0x7a')][_0x55ccc1][_0x0c21('0x44')])&&_0x155245[_0x0c21('0x7a')][_0x55ccc1]['parentKey']&&_0x155245[_0x0c21('0x7a')][_0x55ccc1]['foreignTable']&&_0x155245[_0x0c21('0x7a')][_0x55ccc1][_0x0c21('0x7e')]){_0x469196[_0x155245['joins'][_0x55ccc1][_0x0c21('0x44')]](_0x155245[_0x0c21('0x7a')][_0x55ccc1][_0x0c21('0x7d')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x155245[_0x0c21('0x80')],_0x155245[_0x0c21('0x7a')][_0x55ccc1][_0x0c21('0x7c')],_0x155245['joins'][_0x55ccc1][_0x0c21('0x7d')],_0x155245[_0x0c21('0x7a')][_0x55ccc1][_0x0c21('0x7e')]));}}}if(_0x155245['conditions']){_0x155245[_0x0c21('0x81')]=JSON['parse'](_0x155245[_0x0c21('0x81')]);_0x469196['where'](_0x1601b3(_0x155245[_0x0c21('0x81')][_0x0c21('0x76')]));}_0x4c4ec3=_0x469196[_0x0c21('0x82')]();_0x469196[_0x0c21('0x20')](_0x28b763);_0x469196['offset'](0x0);return;}})[_0x0c21('0x29')](function(){if(_0x3e208c[_0x0c21('0x92')]===_0x0c21('0x93')){return null;}var _0x6ab66e=_[_0x0c21('0x42')](_0x3e208c,{'name':_0x3e208c[_0x0c21('0x94')]||_0x3e208c['name']||_0x155245[_0x0c21('0x46')],'basename':_0x20ee1d,'savename':util[_0x0c21('0x74')]('%s-%s.%s',_0x3e208c['name']||_0x155245[_0x0c21('0x46')],require(_0x0c21('0x95'))[_0x0c21('0x96')](0x4),_0x3e208c[_0x0c21('0x92')]||_0x0c21('0x97')),'reportId':_0x155245['id'],'reportType':_0x0c21('0x98')});return db[_0x0c21('0x99')][_0x0c21('0x50')](_0x6ab66e,{'raw':!![]});})[_0x0c21('0x29')](function(_0x33fd56){if(_0x155245[_0x0c21('0x80')]===_0x0c21('0x9a')){_0x4c4ec3['where'](_0x155245[_0x0c21('0x80')]+_0x0c21('0x9b'),_0x3e208c[_0x0c21('0x9c')],_0x3e208c[_0x0c21('0x9d')]);}else{_0x4c4ec3[_0x0c21('0x3f')](_0x155245['table']+_0x0c21('0x9e'),_0x3e208c['startDate'],_0x3e208c['endDate']);}if(_0x33fd56){logger[_0x0c21('0x9f')](_0x0c21('0xa0'),_0x4c4ec3[_0x0c21('0xa1')]());require(_0x0c21('0xa2'))['fork'](path[_0x0c21('0x59')](__dirname,'../../components/export/',_0x33fd56[_0x0c21('0x92')]),[_0x33fd56['id'],_0x4c4ec3['toString'](),path[_0x0c21('0x59')](__dirname,_0x0c21('0xa3'),_0x33fd56[_0x0c21('0xa4')]),_0x20ee1d]);return _0x33fd56;}else{var _0x25d49a=squel[_0x0c21('0xa5')]();_0x25d49a[_0x0c21('0x70')]('('+_0x4c4ec3[_0x0c21('0xa1')]()+')','countTable');_0x25d49a[_0x0c21('0x6a')](_0x0c21('0xa6'),'count');_0x4c4ec3['limit'](_0x3e208c[_0x0c21('0x20')]||_0x28b763);_0x4c4ec3[_0x0c21('0x21')](_0x3e208c[_0x0c21('0x21')]||0x0);return dbH[_0x0c21('0x85')][_0x0c21('0x36')](_0x25d49a[_0x0c21('0xa1')](),{'type':dbH['sequelize']['QueryTypes'][_0x0c21('0x87')]})[_0x0c21('0x29')](function(_0x51fc26){if(!_0x51fc26[_0x0c21('0x3b')]){_0x273f6f=0x0;}else{_0x273f6f=_0x51fc26[0x0][_0x0c21('0x22')]||0x0;}return dbH[_0x0c21('0x85')][_0x0c21('0x36')](_0x4c4ec3[_0x0c21('0xa1')](),{'type':dbH['sequelize'][_0x0c21('0x86')][_0x0c21('0x87')]});})[_0x0c21('0x29')](function(_0x19c6e9){return{'rows':_0x19c6e9||[],'count':_0x273f6f};});}});}exports[_0x0c21('0xa7')]=function(_0x186290,_0x579d2c){return runReport(_0x186290[_0x0c21('0x4b')],_0x186290[_0x0c21('0x36')],_0x186290['options'])[_0x0c21('0x29')](respondWithResult(_0x579d2c,null))[_0x0c21('0x4f')](handleError(_0x579d2c,null));};exports[_0x0c21('0xa8')]=runReport;exports[_0x0c21('0x36')]=function(_0x528bad,_0x241b9f){var _0x365f58=0xa;var _0xcbaedd=[_0x0c21('0x59'),_0x0c21('0x88'),_0x0c21('0x5a'),'cross_join'];var _0x4d11c5={'SUM':'SUM(%s)','COUNT':_0x0c21('0x5d'),'COUNT DISTINCT':_0x0c21('0x89'),'MAX':_0x0c21('0x8a'),'MIN':_0x0c21('0x8b'),'AVG':_0x0c21('0x8c'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x0c21('0x5f'),'GROUP_CONCAT DESC':_0x0c21('0x60')};var _0x374746={'SEC_TO_TIME':_0x0c21('0xa9'),'DATE':_0x0c21('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x0c21('0x63'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x36ca1e=function(_0xb513df){return!_[_0x0c21('0x8d')](['IS\x20NULL',_0x0c21('0x66'),_0x0c21('0x67'),'IS\x20NOT\x20EMPTY'],_0xb513df);};var _0x5af4f7=function(_0x44fadd){if(!_0x44fadd||!_0x44fadd[_0x0c21('0x69')]['length']){return'';}for(var _0x2418e8='(',_0x21afec=0x0;_0x21afec<_0x44fadd[_0x0c21('0x69')][_0x0c21('0x3b')];_0x21afec+=0x1){_0x21afec>0x0&&(_0x2418e8+='\x20'+_0x44fadd[_0x0c21('0xaa')]+'\x20');_0x2418e8+=_0x44fadd[_0x0c21('0x69')][_0x21afec]['group']?_0x5af4f7(_0x44fadd[_0x0c21('0x69')][_0x21afec][_0x0c21('0x76')]):_0x44fadd['rules'][_0x21afec][_0x0c21('0x6a')]+'\x20'+_0x44fadd['rules'][_0x21afec]['condition']+(_0x36ca1e(_0x44fadd[_0x0c21('0x69')][_0x21afec][_0x0c21('0x6b')])?'\x20'+_0x44fadd[_0x0c21('0x69')][_0x21afec][_0x0c21('0x6c')]:'');}return _0x2418e8+')';};var _0x5bd68a={'where':{'id':_0x528bad[_0x0c21('0x4b')]['id']}},_0x2a8c11,_0x582d91,_0x465ae4,_0x28bc2a,_0x555977;_0x5bd68a=_[_0x0c21('0x42')]({},_0x5bd68a,_0x528bad[_0x0c21('0x47')]);return db['AnalyticCustomReport'][_0x0c21('0x4e')](_0x5bd68a)['then'](function(_0x1b2b98){if(_0x1b2b98){_0x2a8c11=_0x1b2b98;return _0x1b2b98[_0x0c21('0x8e')]();}return null;})[_0x0c21('0x29')](function(_0x2d060e){if(_0x2d060e){if(!_0x2d060e[_0x0c21('0x3b')]){throw new db[(_0x0c21('0x8f'))][(_0x0c21('0xab'))](_0x0c21('0x90'),0x193);}_0x582d91=_0x2d060e;return db[_0x0c21('0x6d')][_0x0c21('0x6e')]({'raw':!![]});}return null;})[_0x0c21('0x29')](function(_0x5582d1){if(_0x5582d1){_0x465ae4=_[_0x0c21('0x6f')](_0x5582d1,'id');var _0x5fd204;var _0x37cb38=squel[_0x0c21('0xa5')]();_0x37cb38[_0x0c21('0x70')](_0x2a8c11[_0x0c21('0x80')]);for(var _0x269173=0x0;_0x269173<_0x582d91[_0x0c21('0x3b')];_0x269173+=0x1){_0x5fd204=_0x582d91[_0x269173][_0x0c21('0x71')]?_0x465ae4[_0x582d91[_0x269173][_0x0c21('0x71')]][_0x0c21('0x91')]:_0x582d91[_0x269173][_0x0c21('0x6a')];_0x5fd204=_0x582d91[_0x269173][_0x0c21('0x72')]?_['replace'](_0x4d11c5[_0x582d91[_0x269173][_0x0c21('0x72')]],'%s',_0x5fd204):_0x5fd204;_0x5fd204=_0x582d91[_0x269173]['format']?_[_0x0c21('0x73')](_0x374746[_0x582d91[_0x269173][_0x0c21('0x74')]],'%s',_0x5fd204):_0x5fd204;if(_0x582d91[_0x269173]['groupBy']){_0x37cb38[_0x0c21('0x76')](_0x5fd204);}_0x582d91[_0x269173]['orderBy']&&_0x37cb38[_0x0c21('0x78')](_0x5fd204,_0x582d91[_0x269173][_0x0c21('0x77')]===_0x0c21('0x79')?![]:!![]);_0x37cb38['field'](_0x5fd204,_0x582d91[_0x269173][_0x0c21('0xac')]||_0x5fd204);}if(_0x2a8c11[_0x0c21('0x7a')]){_0x2a8c11[_0x0c21('0x7a')]=JSON['parse'](_0x2a8c11['joins']);for(var _0x1f3dfd=0x0;_0x1f3dfd<_0x2a8c11[_0x0c21('0x7a')][_0x0c21('0x3b')];_0x1f3dfd+=0x1){if(_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd][_0x0c21('0x44')]&&_[_0x0c21('0x8d')](_0xcbaedd,_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd]['type'])&&_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd]['parentKey']&&_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd][_0x0c21('0x7d')]&&_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd]['foreignKey']){_0x37cb38[_0x2a8c11['joins'][_0x1f3dfd][_0x0c21('0x44')]](_0x2a8c11['joins'][_0x1f3dfd]['foreignTable'],null,util[_0x0c21('0x74')](_0x0c21('0x7f'),_0x2a8c11[_0x0c21('0x80')],_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd][_0x0c21('0x7c')],_0x2a8c11[_0x0c21('0x7a')][_0x1f3dfd][_0x0c21('0x7d')],_0x2a8c11['joins'][_0x1f3dfd][_0x0c21('0x7e')]));}}}if(_0x2a8c11[_0x0c21('0x81')]){_0x2a8c11[_0x0c21('0x81')]=JSON[_0x0c21('0x7b')](_0x2a8c11['conditions']);_0x37cb38['where'](_0x5af4f7(_0x2a8c11[_0x0c21('0x81')][_0x0c21('0x76')]));}_0x555977=_0x37cb38[_0x0c21('0x82')]();_0x37cb38[_0x0c21('0x20')](_0x365f58);_0x37cb38[_0x0c21('0x21')](0x0);logger['debug'](_0x0c21('0x84'),_0x37cb38[_0x0c21('0xa1')]());return dbH[_0x0c21('0x85')]['query'](_0x37cb38[_0x0c21('0xa1')](),{'type':dbH[_0x0c21('0x85')]['QueryTypes'][_0x0c21('0x87')]});}})['then'](function(){return{'sql':_0x555977[_0x0c21('0xa1')]()};})[_0x0c21('0x29')](respondWithResult(_0x241b9f,null))['catch'](handleError(_0x241b9f,null));};
\ No newline at end of file
+var _0x068d=['COUNT(%s)','DATE(%s)','operator','getFields','findAll','keyBy','select','groupBy','DESC','output','web','%s-%s.%s','generate','csv','custom','cdr','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','QueryTypes','runReport','UNIX_TIMESTAMP(%s)','order','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','json','apply','save','update','then','UserProfileResource','destroy','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','keys','intersection','query','attributes','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','filter','options','rows','catch','params','fields','include','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','find','userProfileId','autoAssociation','error','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','from','table','MetricId','metric','field','function','replace','format','orderBy','alias','joins','parse','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','debug','sequelize','SELECT','cross_join'];(function(_0x447af3,_0x381c44){var _0x202e95=function(_0x29daef){while(--_0x29daef){_0x447af3['push'](_0x447af3['shift']());}};_0x202e95(++_0x381c44);}(_0x068d,0x166));var _0xd068=function(_0x49cbba,_0x10eb69){_0x49cbba=_0x49cbba-0x0;var _0x27bdf3=_0x068d[_0x49cbba];return _0x27bdf3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd068('0x0'));var zipdir=require(_0xd068('0x1'));var jsonpatch=require(_0xd068('0x2'));var rp=require('request-promise');var moment=require(_0xd068('0x3'));var BPromise=require(_0xd068('0x4'));var Mustache=require(_0xd068('0x5'));var util=require(_0xd068('0x6'));var path=require(_0xd068('0x7'));var sox=require(_0xd068('0x8'));var csv=require(_0xd068('0x9'));var ejs=require(_0xd068('0xa'));var fs=require('fs');var fs_extra=require(_0xd068('0xb'));var _=require(_0xd068('0xc'));var squel=require(_0xd068('0xd'));var crypto=require('crypto');var jsforce=require(_0xd068('0xe'));var deskjs=require(_0xd068('0xf'));var toCsv=require(_0xd068('0x9'));var querystring=require(_0xd068('0x10'));var Papa=require(_0xd068('0x11'));var Redis=require(_0xd068('0x12'));var authService=require(_0xd068('0x13'));var qs=require(_0xd068('0x14'));var as=require(_0xd068('0x15'));var hardwareService=require(_0xd068('0x16'));var logger=require('../../config/logger')(_0xd068('0x17'));var utils=require(_0xd068('0x18'));var config=require(_0xd068('0x19'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];var dbH=require(_0xd068('0x1a'))[_0xd068('0x1b')];function respondWithStatusCode(_0x321f58,_0x54d3c2){_0x54d3c2=_0x54d3c2||0xcc;return function(_0x2bfd59){if(_0x2bfd59){return _0x321f58[_0xd068('0x1c')](_0x54d3c2);}return _0x321f58[_0xd068('0x1d')](_0x54d3c2)[_0xd068('0x1e')]();};}function respondWithResult(_0x4830ab,_0x48244e){_0x48244e=_0x48244e||0xc8;return function(_0x36f8a8){if(_0x36f8a8){return _0x4830ab['status'](_0x48244e)['json'](_0x36f8a8);}};}function respondWithFilteredResult(_0x2afda6,_0xcbbeaa){return function(_0x268394){if(_0x268394){var _0x58f4b8=typeof _0xcbbeaa[_0xd068('0x1f')]===_0xd068('0x20')&&typeof _0xcbbeaa[_0xd068('0x21')]===_0xd068('0x20');var _0x27c017=_0x268394[_0xd068('0x22')];var _0x1529c9=_0x58f4b8?0x0:_0xcbbeaa[_0xd068('0x1f')];var _0x1caffd=_0x58f4b8?_0x268394['count']:_0xcbbeaa['offset']+_0xcbbeaa[_0xd068('0x21')];var _0x1a4a2a;if(_0x1caffd>=_0x27c017){_0x1caffd=_0x27c017;_0x1a4a2a=0xc8;}else{_0x1a4a2a=0xce;}_0x2afda6[_0xd068('0x1d')](_0x1a4a2a);return _0x2afda6['set']('Content-Range',_0x1529c9+'-'+_0x1caffd+'/'+_0x27c017)[_0xd068('0x23')](_0x268394);}return null;};}function patchUpdates(_0x5f1ded){return function(_0x2dfc70){try{jsonpatch[_0xd068('0x24')](_0x2dfc70,_0x5f1ded,!![]);}catch(_0x1af325){return BPromise['reject'](_0x1af325);}return _0x2dfc70[_0xd068('0x25')]();};}function saveUpdates(_0x41646a,_0x3e8ea2){return function(_0x5b3451){if(_0x5b3451){return _0x5b3451[_0xd068('0x26')](_0x41646a)[_0xd068('0x27')](function(_0x3f394c){return _0x3f394c;});}return null;};}function removeEntity(_0x799626,_0x370bc3){return function(_0x1ec4de){if(_0x1ec4de){return _0x1ec4de['destroy']()[_0xd068('0x27')](function(){var _0x5aa86b=_0x1ec4de['get']({'plain':!![]});var _0x10b129='CustomReports';return db[_0xd068('0x28')][_0xd068('0x29')]({'where':{'type':_0x10b129,'resourceId':_0x5aa86b['id']}})[_0xd068('0x27')](function(){return _0x1ec4de;});})[_0xd068('0x27')](function(){_0x799626['status'](0xcc)[_0xd068('0x1e')]();});}};}function handleEntityNotFound(_0x102cca,_0x2c472c){return function(_0x3958f6){if(!_0x3958f6){_0x102cca['sendStatus'](0x194);}return _0x3958f6;};}function handleError(_0x16c213,_0x545479){_0x545479=_0x545479||0x1f4;return function(_0x5b2b73){logger['error'](_0x5b2b73[_0xd068('0x2a')]);if(_0x5b2b73['name']){delete _0x5b2b73[_0xd068('0x2b')];}_0x16c213[_0xd068('0x1d')](_0x545479)[_0xd068('0x2c')](_0x5b2b73);};}exports[_0xd068('0x2d')]=function(_0x118707,_0x5cf407){var _0x9a93c7={},_0x19898f={},_0x571dfa={'count':0x0,'rows':[]};var _0x877a67=_[_0xd068('0x2e')](db[_0xd068('0x2f')][_0xd068('0x30')],function(_0x345ed8){return{'name':_0x345ed8[_0xd068('0x31')],'type':_0x345ed8[_0xd068('0x32')]['key']};});_0x19898f[_0xd068('0x33')]=_[_0xd068('0x2e')](_0x877a67,_0xd068('0x2b'));_0x19898f['query']=_[_0xd068('0x34')](_0x118707['query']);_0x19898f['filters']=_[_0xd068('0x35')](_0x19898f[_0xd068('0x33')],_0x19898f[_0xd068('0x36')]);_0x9a93c7['attributes']=_[_0xd068('0x35')](_0x19898f['model'],qs['fields'](_0x118707[_0xd068('0x36')]['fields']));_0x9a93c7['attributes']=_0x9a93c7[_0xd068('0x37')][_0xd068('0x38')]?_0x9a93c7['attributes']:_0x19898f[_0xd068('0x33')];if(!_0x118707[_0xd068('0x36')][_0xd068('0x39')](_0xd068('0x3a'))){_0x9a93c7[_0xd068('0x21')]=qs['limit'](_0x118707[_0xd068('0x36')]['limit']);_0x9a93c7['offset']=qs[_0xd068('0x1f')](_0x118707[_0xd068('0x36')]['offset']);}_0x9a93c7['order']=qs[_0xd068('0x3b')](_0x118707['query']['sort']);_0x9a93c7[_0xd068('0x3c')]=qs[_0xd068('0x3d')](_[_0xd068('0x3e')](_0x118707['query'],_0x19898f[_0xd068('0x3d')]),_0x877a67);if(_0x118707[_0xd068('0x36')]['filter']){_0x9a93c7[_0xd068('0x3c')]=_[_0xd068('0x3f')](_0x9a93c7['where'],{'$or':_[_0xd068('0x2e')](_0x877a67,function(_0x4ab98b){if(_0x4ab98b['type']!==_0xd068('0x40')){var _0x10ce05={};_0x10ce05[_0x4ab98b[_0xd068('0x2b')]]={'$like':'%'+_0x118707[_0xd068('0x36')][_0xd068('0x41')]+'%'};return _0x10ce05;}})});}_0x9a93c7=_[_0xd068('0x3f')]({},_0x9a93c7,_0x118707[_0xd068('0x42')]);var _0x5d23f6={'where':_0x9a93c7['where']};return db[_0xd068('0x2f')]['count'](_0x5d23f6)[_0xd068('0x27')](function(_0x30078a){_0x571dfa[_0xd068('0x22')]=_0x30078a;if(_0x118707[_0xd068('0x36')]['includeAll']){_0x9a93c7['include']=[{'all':!![]}];}return db[_0xd068('0x2f')]['findAll'](_0x9a93c7);})[_0xd068('0x27')](function(_0x4b20fa){_0x571dfa[_0xd068('0x43')]=_0x4b20fa;return _0x571dfa;})[_0xd068('0x27')](respondWithFilteredResult(_0x5cf407,_0x9a93c7))[_0xd068('0x44')](handleError(_0x5cf407,null));};exports['show']=function(_0xe847b4,_0x213d55){var _0x48d88c={'raw':![],'where':{'id':_0xe847b4[_0xd068('0x45')]['id']}},_0x532843={};_0x532843[_0xd068('0x33')]=_[_0xd068('0x34')](db[_0xd068('0x2f')][_0xd068('0x30')]);_0x532843[_0xd068('0x36')]=_[_0xd068('0x34')](_0xe847b4['query']);_0x532843[_0xd068('0x3d')]=_[_0xd068('0x35')](_0x532843['model'],_0x532843[_0xd068('0x36')]);_0x48d88c[_0xd068('0x37')]=_[_0xd068('0x35')](_0x532843[_0xd068('0x33')],qs[_0xd068('0x46')](_0xe847b4[_0xd068('0x36')]['fields']));_0x48d88c['attributes']=_0x48d88c['attributes'][_0xd068('0x38')]?_0x48d88c[_0xd068('0x37')]:_0x532843[_0xd068('0x33')];if(_0xe847b4[_0xd068('0x36')]['includeAll']){_0x48d88c[_0xd068('0x47')]=[{'all':!![]}];}_0x48d88c=_[_0xd068('0x3f')]({},_0x48d88c,_0xe847b4['options']);return db[_0xd068('0x2f')]['find'](_0x48d88c)[_0xd068('0x27')](handleEntityNotFound(_0x213d55,null))[_0xd068('0x27')](respondWithResult(_0x213d55,null))[_0xd068('0x44')](handleError(_0x213d55,null));};exports[_0xd068('0x48')]=function(_0xb76c96,_0x317069){return db[_0xd068('0x2f')][_0xd068('0x48')](_0xb76c96[_0xd068('0x49')],{})['then'](function(_0x45c215){var _0x2741d5=_0xb76c96[_0xd068('0x4a')][_0xd068('0x4b')]({'plain':!![]});if(!_0x2741d5)throw new Error(_0xd068('0x4c'));if(_0x2741d5['role']===_0xd068('0x4a')){var _0xf302ac=_0x45c215[_0xd068('0x4b')]({'plain':!![]});var _0x1150e9=_0xd068('0x4d');return db['UserProfileSection'][_0xd068('0x4e')]({'where':{'name':_0x1150e9,'userProfileId':_0x2741d5[_0xd068('0x4f')]},'raw':!![]})[_0xd068('0x27')](function(_0x3358af){if(_0x3358af&&_0x3358af[_0xd068('0x50')]===0x0){return db['UserProfileResource']['create']({'name':_0xf302ac[_0xd068('0x2b')],'resourceId':_0xf302ac['id'],'type':'CustomReports','sectionId':_0x3358af['id']},{})[_0xd068('0x27')](function(){return _0x45c215;});}else{return _0x45c215;}})[_0xd068('0x44')](function(_0x9bdf7e){logger[_0xd068('0x51')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x9bdf7e);throw _0x9bdf7e;});}return _0x45c215;})['then'](respondWithResult(_0x317069,0xc9))[_0xd068('0x44')](handleError(_0x317069,null));};exports['update']=function(_0x32896a,_0x1581ee){if(_0x32896a[_0xd068('0x49')]['id']){delete _0x32896a['body']['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x32896a['params']['id']}})[_0xd068('0x27')](handleEntityNotFound(_0x1581ee,null))[_0xd068('0x27')](saveUpdates(_0x32896a['body'],null))[_0xd068('0x27')](respondWithResult(_0x1581ee,null))[_0xd068('0x44')](handleError(_0x1581ee,null));};exports['destroy']=function(_0x6dd33b,_0x4fe337){return db[_0xd068('0x2f')][_0xd068('0x4e')]({'where':{'id':_0x6dd33b[_0xd068('0x45')]['id']}})[_0xd068('0x27')](handleEntityNotFound(_0x4fe337,null))[_0xd068('0x27')](removeEntity(_0x4fe337,null))['catch'](handleError(_0x4fe337,null));};exports['preview']=function(_0xb9ceb1,_0x17be36){var _0x1b51c9=0xa;var _0x401a23=[_0xd068('0x52'),_0xd068('0x53'),_0xd068('0x54'),'cross_join'];var _0x3e147f={'SUM':_0xd068('0x55'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xd068('0x56'),'MAX':_0xd068('0x57'),'MIN':_0xd068('0x58'),'AVG':_0xd068('0x59'),'GROUP_CONCAT':_0xd068('0x5a'),'GROUP_CONCAT ASC':_0xd068('0x5b'),'GROUP_CONCAT DESC':_0xd068('0x5c')};var _0x5617a9={'SEC_TO_TIME':_0xd068('0x5d'),'DATE':'DATE(%s)','HOUR':_0xd068('0x5e'),'ROUND':_0xd068('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x492b6c=function(_0x3747fd){return!_[_0xd068('0x60')]([_0xd068('0x61'),_0xd068('0x62'),_0xd068('0x63'),_0xd068('0x64')],_0x3747fd);};var _0x564803=function(_0x215f6c){if(!_0x215f6c||!_0x215f6c['rules'][_0xd068('0x38')]){return'';}for(var _0x17b4ce='(',_0x287d9d=0x0;_0x287d9d<_0x215f6c[_0xd068('0x65')][_0xd068('0x38')];_0x287d9d+=0x1){_0x287d9d>0x0&&(_0x17b4ce+='\x20'+_0x215f6c['operator']+'\x20');_0x17b4ce+=_0x215f6c[_0xd068('0x65')][_0x287d9d][_0xd068('0x66')]?_0x564803(_0x215f6c[_0xd068('0x65')][_0x287d9d][_0xd068('0x66')]):_0x215f6c[_0xd068('0x65')][_0x287d9d]['field']+'\x20'+_0x215f6c[_0xd068('0x65')][_0x287d9d][_0xd068('0x67')]+(_0x492b6c(_0x215f6c['rules'][_0x287d9d]['condition'])?'\x20'+_0x215f6c[_0xd068('0x65')][_0x287d9d][_0xd068('0x68')]:'');}return _0x17b4ce+')';};var _0x454abd={'where':{'id':_0xb9ceb1[_0xd068('0x45')]['id']}},_0x1cdae7,_0x24c1c8,_0x4cecb2,_0x1df435,_0x5b92c0;_0x454abd=_['merge']({},_0x454abd,_0xb9ceb1[_0xd068('0x42')]);return db[_0xd068('0x2f')]['find'](_0x454abd)[_0xd068('0x27')](function(_0x320d1b){if(_0x320d1b){_0x1cdae7=_0x320d1b;return _0x320d1b['getFields']();}return null;})['then'](function(_0x1c63b7){if(_0x1c63b7){if(!_0x1c63b7[_0xd068('0x38')]){throw new db[(_0xd068('0x69'))][(_0xd068('0x6a'))](_0xd068('0x6b'),0x193);}_0x24c1c8=_0x1c63b7;return db[_0xd068('0x6c')]['findAll']({'raw':!![]});}return null;})[_0xd068('0x27')](function(_0x3cd55b){if(_0x3cd55b){_0x4cecb2=_['keyBy'](_0x3cd55b,'id');var _0x1a1e86;var _0x40c418=squel['select']();_0x40c418[_0xd068('0x6d')](_0x1cdae7[_0xd068('0x6e')]);for(var _0x8fb13=0x0;_0x8fb13<_0x24c1c8[_0xd068('0x38')];_0x8fb13+=0x1){_0x1a1e86=_0x24c1c8[_0x8fb13][_0xd068('0x6f')]?_0x4cecb2[_0x24c1c8[_0x8fb13][_0xd068('0x6f')]][_0xd068('0x70')]:_0x24c1c8[_0x8fb13][_0xd068('0x71')];_0x1a1e86=_0x24c1c8[_0x8fb13][_0xd068('0x72')]?_[_0xd068('0x73')](_0x3e147f[_0x24c1c8[_0x8fb13]['function']],'%s',_0x1a1e86):_0x1a1e86;_0x1a1e86=_0x24c1c8[_0x8fb13][_0xd068('0x74')]?_['replace'](_0x5617a9[_0x24c1c8[_0x8fb13]['format']],'%s',_0x1a1e86):_0x1a1e86;if(_0x24c1c8[_0x8fb13]['groupBy']){_0x40c418[_0xd068('0x66')](_0x1a1e86);}_0x24c1c8[_0x8fb13][_0xd068('0x75')]&&_0x40c418['order'](_0x1a1e86,_0x24c1c8[_0x8fb13][_0xd068('0x75')]==='DESC'?![]:!![]);_0x40c418[_0xd068('0x71')](_0x1a1e86,_0x24c1c8[_0x8fb13][_0xd068('0x76')]||_0x1a1e86);}if(_0x1cdae7[_0xd068('0x77')]){_0x1cdae7['joins']=JSON[_0xd068('0x78')](_0x1cdae7[_0xd068('0x77')]);for(var _0x2c52b9=0x0;_0x2c52b9<_0x1cdae7[_0xd068('0x77')][_0xd068('0x38')];_0x2c52b9+=0x1){if(_0x1cdae7['joins'][_0x2c52b9][_0xd068('0x32')]&&_[_0xd068('0x60')](_0x401a23,_0x1cdae7['joins'][_0x2c52b9]['type'])&&_0x1cdae7[_0xd068('0x77')][_0x2c52b9][_0xd068('0x79')]&&_0x1cdae7[_0xd068('0x77')][_0x2c52b9][_0xd068('0x7a')]&&_0x1cdae7[_0xd068('0x77')][_0x2c52b9]['foreignKey']){_0x40c418[_0x1cdae7[_0xd068('0x77')][_0x2c52b9][_0xd068('0x32')]](_0x1cdae7[_0xd068('0x77')][_0x2c52b9][_0xd068('0x7a')],null,util['format'](_0xd068('0x7b'),_0x1cdae7['table'],_0x1cdae7[_0xd068('0x77')][_0x2c52b9][_0xd068('0x79')],_0x1cdae7['joins'][_0x2c52b9][_0xd068('0x7a')],_0x1cdae7[_0xd068('0x77')][_0x2c52b9][_0xd068('0x7c')]));}}}if(_0x1cdae7[_0xd068('0x7d')]){_0x1cdae7['conditions']=JSON['parse'](_0x1cdae7['conditions']);_0x40c418[_0xd068('0x3c')](_0x564803(_0x1cdae7[_0xd068('0x7d')][_0xd068('0x66')]));}_0x5b92c0=_0x40c418[_0xd068('0x7e')]();_0x40c418['limit'](_0x1b51c9);_0x40c418[_0xd068('0x1f')](0x0);logger[_0xd068('0x7f')]('Limited\x20Query:',_0x40c418['toString']());return dbH[_0xd068('0x80')][_0xd068('0x36')](_0x40c418['toString'](),{'type':dbH[_0xd068('0x80')]['QueryTypes'][_0xd068('0x81')]});}})[_0xd068('0x27')](respondWithResult(_0x17be36,null))[_0xd068('0x44')](handleError(_0x17be36,null));};function runReport(_0x23aac6,_0x582268,_0x189531){var _0x117180=_0x582268[_0xd068('0x2b')];var _0x1496be=0xa;var _0x7fe9dc=['join','left_join',_0xd068('0x54'),_0xd068('0x82')];var _0x11d2e1={'SUM':_0xd068('0x55'),'COUNT':_0xd068('0x83'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xd068('0x57'),'MIN':_0xd068('0x58'),'AVG':_0xd068('0x59'),'GROUP_CONCAT':_0xd068('0x5a'),'GROUP_CONCAT ASC':_0xd068('0x5b'),'GROUP_CONCAT DESC':_0xd068('0x5c')};var _0x5cb52={'SEC_TO_TIME':_0xd068('0x5d'),'DATE':_0xd068('0x84'),'HOUR':_0xd068('0x5e'),'ROUND':_0xd068('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2e9001=function(_0x4fa70c){return!_[_0xd068('0x60')]([_0xd068('0x61'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0xd068('0x64')],_0x4fa70c);};var _0x143ae8=function(_0x562f96){if(!_0x562f96||!_0x562f96[_0xd068('0x65')][_0xd068('0x38')]){return'';}for(var _0xb5f069='(',_0x2a84c6=0x0;_0x2a84c6<_0x562f96[_0xd068('0x65')][_0xd068('0x38')];_0x2a84c6+=0x1){_0x2a84c6>0x0&&(_0xb5f069+='\x20'+_0x562f96[_0xd068('0x85')]+'\x20');_0xb5f069+=_0x562f96[_0xd068('0x65')][_0x2a84c6][_0xd068('0x66')]?_0x143ae8(_0x562f96[_0xd068('0x65')][_0x2a84c6][_0xd068('0x66')]):_0x562f96['rules'][_0x2a84c6][_0xd068('0x71')]+'\x20'+_0x562f96[_0xd068('0x65')][_0x2a84c6][_0xd068('0x67')]+(_0x2e9001(_0x562f96[_0xd068('0x65')][_0x2a84c6][_0xd068('0x67')])?'\x20'+_0x562f96[_0xd068('0x65')][_0x2a84c6][_0xd068('0x68')]:'');}return _0xb5f069+')';};var _0x75c762={'where':{'id':_0x23aac6['id']}},_0x1d1cf1,_0x198a42,_0x594b7b,_0x5069aa,_0x552301;_0x75c762=_[_0xd068('0x3f')]({},_0x75c762,_0x189531);return db['AnalyticCustomReport'][_0xd068('0x4e')](_0x75c762)[_0xd068('0x27')](function(_0x3c8164){if(_0x3c8164){_0x1d1cf1=_0x3c8164;return _0x3c8164[_0xd068('0x86')]();}return null;})[_0xd068('0x27')](function(_0x15a198){if(_0x15a198){if(!_0x15a198[_0xd068('0x38')]){throw new db['Sequelize'][(_0xd068('0x6a'))](_0xd068('0x6b'),0x193);}_0x198a42=_0x15a198;return db['AnalyticMetric'][_0xd068('0x87')]({'raw':!![]});}return null;})['then'](function(_0xf6d62a){if(_0xf6d62a){_0x594b7b=_[_0xd068('0x88')](_0xf6d62a,'id');var _0x15c518;var _0x3cbe0e=squel[_0xd068('0x89')]();_0x3cbe0e['from'](_0x1d1cf1[_0xd068('0x6e')]);for(var _0x581fa0=0x0;_0x581fa0<_0x198a42[_0xd068('0x38')];_0x581fa0+=0x1){_0x15c518=_0x198a42[_0x581fa0]['MetricId']?_0x594b7b[_0x198a42[_0x581fa0][_0xd068('0x6f')]]['metric']:_0x198a42[_0x581fa0]['field'];_0x15c518=_0x198a42[_0x581fa0][_0xd068('0x72')]?_[_0xd068('0x73')](_0x11d2e1[_0x198a42[_0x581fa0]['function']],'%s',_0x15c518):_0x15c518;_0x15c518=_0x198a42[_0x581fa0][_0xd068('0x74')]?_[_0xd068('0x73')](_0x5cb52[_0x198a42[_0x581fa0][_0xd068('0x74')]],'%s',_0x15c518):_0x15c518;if(_0x198a42[_0x581fa0][_0xd068('0x8a')]){_0x3cbe0e[_0xd068('0x66')](_0x15c518);}_0x198a42[_0x581fa0][_0xd068('0x75')]&&_0x3cbe0e['order'](_0x15c518,_0x198a42[_0x581fa0]['orderBy']===_0xd068('0x8b')?![]:!![]);_0x3cbe0e[_0xd068('0x71')](_0x15c518,_0x198a42[_0x581fa0][_0xd068('0x76')]||_0x15c518);}if(_0x1d1cf1[_0xd068('0x77')]){_0x1d1cf1[_0xd068('0x77')]=JSON['parse'](_0x1d1cf1['joins']);for(var _0x4893fd=0x0;_0x4893fd<_0x1d1cf1[_0xd068('0x77')][_0xd068('0x38')];_0x4893fd+=0x1){if(_0x1d1cf1[_0xd068('0x77')][_0x4893fd][_0xd068('0x32')]&&_[_0xd068('0x60')](_0x7fe9dc,_0x1d1cf1['joins'][_0x4893fd]['type'])&&_0x1d1cf1['joins'][_0x4893fd][_0xd068('0x79')]&&_0x1d1cf1[_0xd068('0x77')][_0x4893fd][_0xd068('0x7a')]&&_0x1d1cf1[_0xd068('0x77')][_0x4893fd][_0xd068('0x7c')]){_0x3cbe0e[_0x1d1cf1[_0xd068('0x77')][_0x4893fd][_0xd068('0x32')]](_0x1d1cf1[_0xd068('0x77')][_0x4893fd]['foreignTable'],null,util[_0xd068('0x74')]('%s.%s\x20=\x20%s.%s',_0x1d1cf1[_0xd068('0x6e')],_0x1d1cf1[_0xd068('0x77')][_0x4893fd][_0xd068('0x79')],_0x1d1cf1['joins'][_0x4893fd][_0xd068('0x7a')],_0x1d1cf1[_0xd068('0x77')][_0x4893fd][_0xd068('0x7c')]));}}}if(_0x1d1cf1['conditions']){_0x1d1cf1['conditions']=JSON[_0xd068('0x78')](_0x1d1cf1[_0xd068('0x7d')]);_0x3cbe0e[_0xd068('0x3c')](_0x143ae8(_0x1d1cf1['conditions'][_0xd068('0x66')]));}_0x552301=_0x3cbe0e['clone']();_0x3cbe0e[_0xd068('0x21')](_0x1496be);_0x3cbe0e[_0xd068('0x1f')](0x0);return;}})[_0xd068('0x27')](function(){if(_0x582268[_0xd068('0x8c')]===_0xd068('0x8d')){return null;}var _0x467dcf=_[_0xd068('0x3f')](_0x582268,{'name':_0x582268['fullPath']||_0x582268[_0xd068('0x2b')]||_0x1d1cf1[_0xd068('0x2b')],'basename':_0x117180,'savename':util[_0xd068('0x74')](_0xd068('0x8e'),_0x582268['name']||_0x1d1cf1[_0xd068('0x2b')],require('randomstring')[_0xd068('0x8f')](0x4),_0x582268[_0xd068('0x8c')]||_0xd068('0x90')),'reportId':_0x1d1cf1['id'],'reportType':_0xd068('0x91')});return db['AnalyticExtractedReport'][_0xd068('0x48')](_0x467dcf,{'raw':!![]});})[_0xd068('0x27')](function(_0x5c5a86){if(_0x1d1cf1[_0xd068('0x6e')]===_0xd068('0x92')){_0x552301[_0xd068('0x3c')](_0x1d1cf1['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x582268['startDate'],_0x582268[_0xd068('0x93')]);}else{_0x552301[_0xd068('0x3c')](_0x1d1cf1['table']+_0xd068('0x94'),_0x582268[_0xd068('0x95')],_0x582268['endDate']);}if(_0x5c5a86){logger[_0xd068('0x96')](_0xd068('0x97'),_0x552301[_0xd068('0x98')]());require(_0xd068('0x99'))[_0xd068('0x9a')](path[_0xd068('0x52')](__dirname,_0xd068('0x9b'),_0x5c5a86[_0xd068('0x8c')]),[_0x5c5a86['id'],_0x552301[_0xd068('0x98')](),path[_0xd068('0x52')](__dirname,_0xd068('0x9c'),_0x5c5a86[_0xd068('0x9d')]),_0x117180]);return _0x5c5a86;}else{var _0x13db3b=squel['select']();_0x13db3b[_0xd068('0x6d')]('('+_0x552301[_0xd068('0x98')]()+')','countTable');_0x13db3b[_0xd068('0x71')]('COUNT(*)',_0xd068('0x22'));_0x552301[_0xd068('0x21')](_0x582268[_0xd068('0x21')]||_0x1496be);_0x552301[_0xd068('0x1f')](_0x582268['offset']||0x0);return dbH['sequelize'][_0xd068('0x36')](_0x13db3b[_0xd068('0x98')](),{'type':dbH[_0xd068('0x80')][_0xd068('0x9e')][_0xd068('0x81')]})[_0xd068('0x27')](function(_0x2ab604){if(!_0x2ab604['length']){_0x5069aa=0x0;}else{_0x5069aa=_0x2ab604[0x0][_0xd068('0x22')]||0x0;}return dbH[_0xd068('0x80')][_0xd068('0x36')](_0x552301[_0xd068('0x98')](),{'type':dbH[_0xd068('0x80')][_0xd068('0x9e')][_0xd068('0x81')]});})['then'](function(_0x588e94){return{'rows':_0x588e94||[],'count':_0x5069aa};});}});}exports['run']=function(_0x495ef8,_0x390848){return runReport(_0x495ef8[_0xd068('0x45')],_0x495ef8[_0xd068('0x36')],_0x495ef8['options'])[_0xd068('0x27')](respondWithResult(_0x390848,null))[_0xd068('0x44')](handleError(_0x390848,null));};exports[_0xd068('0x9f')]=runReport;exports[_0xd068('0x36')]=function(_0x18b56e,_0x3153b8){var _0xc97751=0xa;var _0x2c1379=[_0xd068('0x52'),_0xd068('0x53'),_0xd068('0x54'),'cross_join'];var _0x4fc28a={'SUM':_0xd068('0x55'),'COUNT':_0xd068('0x83'),'COUNT DISTINCT':_0xd068('0x56'),'MAX':_0xd068('0x57'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xd068('0x5a'),'GROUP_CONCAT ASC':_0xd068('0x5b'),'GROUP_CONCAT DESC':_0xd068('0x5c')};var _0x1d8155={'SEC_TO_TIME':_0xd068('0x5d'),'DATE':_0xd068('0x84'),'HOUR':_0xd068('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd068('0xa0')};var _0x3c58ed=function(_0x11e701){return!_[_0xd068('0x60')]([_0xd068('0x61'),_0xd068('0x62'),_0xd068('0x63'),_0xd068('0x64')],_0x11e701);};var _0x425715=function(_0xb3ab46){if(!_0xb3ab46||!_0xb3ab46[_0xd068('0x65')][_0xd068('0x38')]){return'';}for(var _0x4d70ec='(',_0x57a9c7=0x0;_0x57a9c7<_0xb3ab46[_0xd068('0x65')][_0xd068('0x38')];_0x57a9c7+=0x1){_0x57a9c7>0x0&&(_0x4d70ec+='\x20'+_0xb3ab46[_0xd068('0x85')]+'\x20');_0x4d70ec+=_0xb3ab46[_0xd068('0x65')][_0x57a9c7][_0xd068('0x66')]?_0x425715(_0xb3ab46[_0xd068('0x65')][_0x57a9c7][_0xd068('0x66')]):_0xb3ab46[_0xd068('0x65')][_0x57a9c7]['field']+'\x20'+_0xb3ab46[_0xd068('0x65')][_0x57a9c7][_0xd068('0x67')]+(_0x3c58ed(_0xb3ab46['rules'][_0x57a9c7][_0xd068('0x67')])?'\x20'+_0xb3ab46[_0xd068('0x65')][_0x57a9c7][_0xd068('0x68')]:'');}return _0x4d70ec+')';};var _0x32c5d5={'where':{'id':_0x18b56e[_0xd068('0x45')]['id']}},_0x5da094,_0x9c978e,_0x243753,_0x371645,_0xd9aea0;_0x32c5d5=_['merge']({},_0x32c5d5,_0x18b56e[_0xd068('0x42')]);return db[_0xd068('0x2f')]['find'](_0x32c5d5)[_0xd068('0x27')](function(_0x4f7e81){if(_0x4f7e81){_0x5da094=_0x4f7e81;return _0x4f7e81[_0xd068('0x86')]();}return null;})[_0xd068('0x27')](function(_0x2858a7){if(_0x2858a7){if(!_0x2858a7[_0xd068('0x38')]){throw new db[(_0xd068('0x69'))][(_0xd068('0x6a'))](_0xd068('0x6b'),0x193);}_0x9c978e=_0x2858a7;return db[_0xd068('0x6c')][_0xd068('0x87')]({'raw':!![]});}return null;})['then'](function(_0x15fde3){if(_0x15fde3){_0x243753=_[_0xd068('0x88')](_0x15fde3,'id');var _0x1d54ee;var _0x6e120c=squel[_0xd068('0x89')]();_0x6e120c[_0xd068('0x6d')](_0x5da094['table']);for(var _0x4ba000=0x0;_0x4ba000<_0x9c978e[_0xd068('0x38')];_0x4ba000+=0x1){_0x1d54ee=_0x9c978e[_0x4ba000]['MetricId']?_0x243753[_0x9c978e[_0x4ba000]['MetricId']][_0xd068('0x70')]:_0x9c978e[_0x4ba000]['field'];_0x1d54ee=_0x9c978e[_0x4ba000][_0xd068('0x72')]?_['replace'](_0x4fc28a[_0x9c978e[_0x4ba000][_0xd068('0x72')]],'%s',_0x1d54ee):_0x1d54ee;_0x1d54ee=_0x9c978e[_0x4ba000][_0xd068('0x74')]?_[_0xd068('0x73')](_0x1d8155[_0x9c978e[_0x4ba000][_0xd068('0x74')]],'%s',_0x1d54ee):_0x1d54ee;if(_0x9c978e[_0x4ba000][_0xd068('0x8a')]){_0x6e120c[_0xd068('0x66')](_0x1d54ee);}_0x9c978e[_0x4ba000][_0xd068('0x75')]&&_0x6e120c[_0xd068('0xa1')](_0x1d54ee,_0x9c978e[_0x4ba000][_0xd068('0x75')]===_0xd068('0x8b')?![]:!![]);_0x6e120c[_0xd068('0x71')](_0x1d54ee,_0x9c978e[_0x4ba000]['alias']||_0x1d54ee);}if(_0x5da094['joins']){_0x5da094[_0xd068('0x77')]=JSON[_0xd068('0x78')](_0x5da094[_0xd068('0x77')]);for(var _0x520d33=0x0;_0x520d33<_0x5da094[_0xd068('0x77')][_0xd068('0x38')];_0x520d33+=0x1){if(_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x32')]&&_[_0xd068('0x60')](_0x2c1379,_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x32')])&&_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x79')]&&_0x5da094['joins'][_0x520d33]['foreignTable']&&_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x7c')]){_0x6e120c[_0x5da094['joins'][_0x520d33][_0xd068('0x32')]](_0x5da094[_0xd068('0x77')][_0x520d33]['foreignTable'],null,util[_0xd068('0x74')](_0xd068('0x7b'),_0x5da094['table'],_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x79')],_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x7a')],_0x5da094[_0xd068('0x77')][_0x520d33][_0xd068('0x7c')]));}}}if(_0x5da094[_0xd068('0x7d')]){_0x5da094[_0xd068('0x7d')]=JSON['parse'](_0x5da094[_0xd068('0x7d')]);_0x6e120c['where'](_0x425715(_0x5da094[_0xd068('0x7d')][_0xd068('0x66')]));}_0xd9aea0=_0x6e120c[_0xd068('0x7e')]();_0x6e120c[_0xd068('0x21')](_0xc97751);_0x6e120c[_0xd068('0x1f')](0x0);logger[_0xd068('0x7f')](_0xd068('0xa2'),_0x6e120c[_0xd068('0x98')]());return dbH[_0xd068('0x80')][_0xd068('0x36')](_0x6e120c[_0xd068('0x98')](),{'type':dbH[_0xd068('0x80')][_0xd068('0x9e')][_0xd068('0x81')]});}})['then'](function(){return{'sql':_0xd9aea0[_0xd068('0x98')]()};})[_0xd068('0x27')](respondWithResult(_0x3153b8,null))[_0xd068('0x44')](handleError(_0x3153b8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 1398d01..bbbbc70 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.model.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0994=['exports','AnalyticCustomReport','analytics_custom_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4de6ec,_0x2fc209){var _0x1bfbdc=function(_0x514762){while(--_0x514762){_0x4de6ec['push'](_0x4de6ec['shift']());}};_0x1bfbdc(++_0x2fc209);}(_0x0994,0x179));var _0x4099=function(_0x484976,_0x450694){_0x484976=_0x484976-0x0;var _0x407cd8=_0x0994[_0x484976];return _0x407cd8;};'use strict';var _=require('lodash');var util=require(_0x4099('0x0'));var logger=require(_0x4099('0x1'))(_0x4099('0x2'));var moment=require('moment');var BPromise=require(_0x4099('0x3'));var rp=require(_0x4099('0x4'));var fs=require('fs');var path=require(_0x4099('0x5'));var rimraf=require(_0x4099('0x6'));var config=require(_0x4099('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x4099('0x8')]=function(_0x751527,_0x4dbb25){return _0x751527['define'](_0x4099('0x9'),attributes,{'tableName':_0x4099('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9164=['exports','define','lodash','util','api','moment','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x237dcb,_0x5caca4){var _0x54e4de=function(_0x4beced){while(--_0x4beced){_0x237dcb['push'](_0x237dcb['shift']());}};_0x54e4de(++_0x5caca4);}(_0x9164,0x158));var _0x4916=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9164[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x4916('0x0'));var util=require(_0x4916('0x1'));var logger=require('../../config/logger')(_0x4916('0x2'));var moment=require(_0x4916('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4916('0x4'));var config=require(_0x4916('0x5'));var attributes=require(_0x4916('0x6'));module[_0x4916('0x7')]=function(_0x4e8285,_0x38e122){return _0x4e8285[_0x4916('0x8')]('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 0cd0438..02b3f22 100644
--- a/server/api/analyticCustomReport/analyticCustomReport.rpc.js
+++ b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x77c8=['info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x2e2b37,_0xdac58a){var _0x20b4a5=function(_0x48a833){while(--_0x48a833){_0x2e2b37['push'](_0x2e2b37['shift']());}};_0x20b4a5(++_0xdac58a);}(_0x77c8,0x122));var _0x877c=function(_0x2ca2d0,_0x3ea8e4){_0x2ca2d0=_0x2ca2d0-0x0;var _0x521c23=_0x77c8[_0x2ca2d0];return _0x521c23;};'use strict';var _=require(_0x877c('0x0'));var util=require(_0x877c('0x1'));var moment=require(_0x877c('0x2'));var BPromise=require('bluebird');var rs=require(_0x877c('0x3'));var fs=require('fs');var Redis=require(_0x877c('0x4'));var db=require(_0x877c('0x5'))['db'];var utils=require(_0x877c('0x6'));var logger=require(_0x877c('0x7'))(_0x877c('0x8'));var config=require(_0x877c('0x9'));var jayson=require(_0x877c('0xa'));var client=jayson[_0x877c('0xb')][_0x877c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d27f5,_0x2ccbda,_0x4f5ba6){return new BPromise(function(_0x514876,_0x248bb6){return client[_0x877c('0xd')](_0x1d27f5,_0x4f5ba6)[_0x877c('0xe')](function(_0x3dea49){logger['info'](_0x877c('0xf'),_0x2ccbda,_0x877c('0x10'));logger[_0x877c('0x11')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x2ccbda,'request\x20sent',JSON[_0x877c('0x12')](_0x3dea49));if(_0x3dea49[_0x877c('0x13')]){if(_0x3dea49[_0x877c('0x13')][_0x877c('0x14')]===0x1f4){logger[_0x877c('0x13')](_0x877c('0xf'),_0x2ccbda,_0x3dea49['error'][_0x877c('0x15')]);return _0x248bb6(_0x3dea49['error'][_0x877c('0x15')]);}logger[_0x877c('0x13')](_0x877c('0xf'),_0x2ccbda,_0x3dea49[_0x877c('0x13')][_0x877c('0x15')]);return _0x514876(_0x3dea49[_0x877c('0x13')][_0x877c('0x15')]);}else{logger[_0x877c('0x16')](_0x877c('0xf'),_0x2ccbda,'request\x20sent');_0x514876(_0x3dea49['result']['message']);}})[_0x877c('0x17')](function(_0x148dff){logger[_0x877c('0x13')](_0x877c('0xf'),_0x2ccbda,_0x148dff);_0x248bb6(_0x148dff);});});}
\ No newline at end of file
+var _0xd49b=['lodash','util','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message'];(function(_0x187649,_0x2e0589){var _0x24a605=function(_0x106ae0){while(--_0x106ae0){_0x187649['push'](_0x187649['shift']());}};_0x24a605(++_0x2e0589);}(_0xd49b,0x187));var _0xbd49=function(_0x34bd34,_0x1444f7){_0x34bd34=_0x34bd34-0x0;var _0x4e36d6=_0xd49b[_0x34bd34];return _0x4e36d6;};'use strict';var _=require(_0xbd49('0x0'));var util=require(_0xbd49('0x1'));var moment=require('moment');var BPromise=require(_0xbd49('0x2'));var rs=require(_0xbd49('0x3'));var fs=require('fs');var Redis=require(_0xbd49('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xbd49('0x5'));var config=require(_0xbd49('0x6'));var jayson=require(_0xbd49('0x7'));var client=jayson[_0xbd49('0x8')][_0xbd49('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2161f2,_0x5edbf0,_0x12f5e1){return new BPromise(function(_0x32d506,_0x259b53){return client[_0xbd49('0xa')](_0x2161f2,_0x12f5e1)['then'](function(_0x7062fe){logger['info'](_0xbd49('0xb'),_0x5edbf0,_0xbd49('0xc'));logger[_0xbd49('0xd')](_0xbd49('0xe'),_0x5edbf0,'request\x20sent',JSON['stringify'](_0x7062fe));if(_0x7062fe['error']){if(_0x7062fe[_0xbd49('0xf')]['code']===0x1f4){logger[_0xbd49('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edbf0,_0x7062fe[_0xbd49('0xf')][_0xbd49('0x10')]);return _0x259b53(_0x7062fe[_0xbd49('0xf')][_0xbd49('0x10')]);}logger[_0xbd49('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edbf0,_0x7062fe[_0xbd49('0xf')][_0xbd49('0x10')]);return _0x32d506(_0x7062fe['error'][_0xbd49('0x10')]);}else{logger['info'](_0xbd49('0xb'),_0x5edbf0,'request\x20sent');_0x32d506(_0x7062fe['result'][_0xbd49('0x10')]);}})['catch'](function(_0x3e9047){logger[_0xbd49('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5edbf0,_0x3e9047);_0x259b53(_0x3e9047);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ca96115..3a8576c 100644
--- a/server/api/analyticCustomReport/index.js
+++ b/server/api/analyticCustomReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8035=['show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','destroy','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id'];(function(_0x55b3b5,_0x254983){var _0x5297a9=function(_0x5f302f){while(--_0x5f302f){_0x55b3b5['push'](_0x55b3b5['shift']());}};_0x5297a9(++_0x254983);}(_0x8035,0x1d3));var _0x5803=function(_0x2c3a8f,_0x374e56){_0x2c3a8f=_0x2c3a8f-0x0;var _0x189412=_0x8035[_0x2c3a8f];return _0x189412;};'use strict';var multer=require(_0x5803('0x0'));var util=require(_0x5803('0x1'));var path=require(_0x5803('0x2'));var timeout=require('connect-timeout');var express=require(_0x5803('0x3'));var router=express['Router']();var fs_extra=require(_0x5803('0x4'));var auth=require(_0x5803('0x5'));var interaction=require(_0x5803('0x6'));var config=require(_0x5803('0x7'));var controller=require(_0x5803('0x8'));router[_0x5803('0x9')]('/',auth[_0x5803('0xa')](),controller[_0x5803('0xb')]);router[_0x5803('0x9')](_0x5803('0xc'),auth[_0x5803('0xa')](),controller[_0x5803('0xd')]);router['get'](_0x5803('0xe'),auth[_0x5803('0xa')](),controller[_0x5803('0xf')]);router[_0x5803('0x9')](_0x5803('0x10'),auth[_0x5803('0xa')](),controller[_0x5803('0x11')]);router[_0x5803('0x9')](_0x5803('0x12'),auth[_0x5803('0xa')](),controller['query']);router[_0x5803('0x13')]('/',auth[_0x5803('0xa')](),controller[_0x5803('0x14')]);router[_0x5803('0x15')](_0x5803('0xc'),auth[_0x5803('0xa')](),controller[_0x5803('0x16')]);router['delete']('/:id',auth[_0x5803('0xa')](),controller[_0x5803('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xbc88=['isAuthenticated','index','get','/:id','show','preview','/:id/run','run','/:id/query','query','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller'];(function(_0xb1cf84,_0x813740){var _0x4bad2e=function(_0x53e6f2){while(--_0x53e6f2){_0xb1cf84['push'](_0xb1cf84['shift']());}};_0x4bad2e(++_0x813740);}(_0xbc88,0x153));var _0x8bc8=function(_0x541d2a,_0x54b175){_0x541d2a=_0x541d2a-0x0;var _0x390245=_0xbc88[_0x541d2a];return _0x390245;};'use strict';var multer=require(_0x8bc8('0x0'));var util=require(_0x8bc8('0x1'));var path=require(_0x8bc8('0x2'));var timeout=require(_0x8bc8('0x3'));var express=require(_0x8bc8('0x4'));var router=express[_0x8bc8('0x5')]();var fs_extra=require(_0x8bc8('0x6'));var auth=require(_0x8bc8('0x7'));var interaction=require(_0x8bc8('0x8'));var config=require(_0x8bc8('0x9'));var controller=require(_0x8bc8('0xa'));router['get']('/',auth[_0x8bc8('0xb')](),controller[_0x8bc8('0xc')]);router[_0x8bc8('0xd')](_0x8bc8('0xe'),auth[_0x8bc8('0xb')](),controller[_0x8bc8('0xf')]);router[_0x8bc8('0xd')]('/:id/preview',auth['isAuthenticated'](),controller[_0x8bc8('0x10')]);router[_0x8bc8('0xd')](_0x8bc8('0x11'),auth[_0x8bc8('0xb')](),controller[_0x8bc8('0x12')]);router[_0x8bc8('0xd')](_0x8bc8('0x13'),auth[_0x8bc8('0xb')](),controller[_0x8bc8('0x14')]);router['post']('/',auth[_0x8bc8('0xb')](),controller['create']);router[_0x8bc8('0x15')](_0x8bc8('0xe'),auth[_0x8bc8('0xb')](),controller['update']);router[_0x8bc8('0x16')](_0x8bc8('0xe'),auth[_0x8bc8('0xb')](),controller[_0x8bc8('0x17')]);module[_0x8bc8('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 0c35e14..d8b9c75 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd51=['sequelize','STRING'];(function(_0x37d4ac,_0x4e47d6){var _0x5e727a=function(_0x5adbff){while(--_0x5adbff){_0x37d4ac['push'](_0x37d4ac['shift']());}};_0x5e727a(++_0x4e47d6);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x4ce21b,_0x5c6759){_0x4ce21b=_0x4ce21b-0x0;var _0x824d87=_0xbd51[_0x4ce21b];return _0x824d87;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x33c5=['STRING','TEXT','exports'];(function(_0x3990de,_0xaa7852){var _0x4e6d1e=function(_0x1a8dd7){while(--_0x1a8dd7){_0x3990de['push'](_0x3990de['shift']());}};_0x4e6d1e(++_0xaa7852);}(_0x33c5,0xe6));var _0x533c=function(_0x1196b0,_0x36c47a){_0x1196b0=_0x1196b0-0x0;var _0x111c52=_0x33c5[_0x1196b0];return _0x111c52;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 741a6b8..4919e33 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4819=['keyBy','table','metric','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','from','countTable','COUNT(*)','SELECT','run','cross_join','COUNT(DISTINCT\x20%s)','debug','Limited\x20Query:','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','get','DefaultReports','UserProfileResource','destroy','error','stack','name','send','rawAttributes','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','options','AnalyticDefaultReport','includeAll','include','findAll','rows','show','params','keys','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','body','preview','join','left_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','MetricId','function','replace','format','groupBy','group','orderBy','DESC','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','toString','sequelize','QueryTypes','right_join','SEC_TO_TIME(%s)','IS\x20NULL','IS\x20EMPTY','operator','condition'];(function(_0x514816,_0x57c091){var _0x5c3a43=function(_0xd4a413){while(--_0xd4a413){_0x514816['push'](_0x514816['shift']());}};_0x5c3a43(++_0x57c091);}(_0x4819,0xcd));var _0x9481=function(_0x5d289a,_0x352880){_0x5d289a=_0x5d289a-0x0;var _0x14bd5f=_0x4819[_0x5d289a];return _0x14bd5f;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9481('0x0'));var zipdir=require(_0x9481('0x1'));var jsonpatch=require(_0x9481('0x2'));var rp=require(_0x9481('0x3'));var moment=require(_0x9481('0x4'));var BPromise=require(_0x9481('0x5'));var Mustache=require(_0x9481('0x6'));var util=require(_0x9481('0x7'));var path=require(_0x9481('0x8'));var sox=require(_0x9481('0x9'));var csv=require('to-csv');var ejs=require(_0x9481('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x9481('0xb'));var crypto=require(_0x9481('0xc'));var jsforce=require(_0x9481('0xd'));var deskjs=require(_0x9481('0xe'));var toCsv=require(_0x9481('0xf'));var querystring=require('querystring');var Papa=require(_0x9481('0x10'));var Redis=require('ioredis');var authService=require(_0x9481('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9481('0x12'));var hardwareService=require(_0x9481('0x13'));var logger=require(_0x9481('0x14'))(_0x9481('0x15'));var utils=require(_0x9481('0x16'));var config=require(_0x9481('0x17'));var licenseUtil=require(_0x9481('0x18'));var db=require(_0x9481('0x19'))['db'];var dbH=require(_0x9481('0x19'))['dbH'];function respondWithStatusCode(_0x5aac02,_0xce6fa2){_0xce6fa2=_0xce6fa2||0xcc;return function(_0x150276){if(_0x150276){return _0x5aac02[_0x9481('0x1a')](_0xce6fa2);}return _0x5aac02[_0x9481('0x1b')](_0xce6fa2)[_0x9481('0x1c')]();};}function respondWithResult(_0xc7a0b5,_0x3fb97f){_0x3fb97f=_0x3fb97f||0xc8;return function(_0x495b30){if(_0x495b30){return _0xc7a0b5[_0x9481('0x1b')](_0x3fb97f)[_0x9481('0x1d')](_0x495b30);}};}function respondWithFilteredResult(_0x5b1fe6,_0x2266d5){return function(_0x518150){if(_0x518150){var _0x34108d=typeof _0x2266d5[_0x9481('0x1e')]===_0x9481('0x1f')&&typeof _0x2266d5[_0x9481('0x20')]==='undefined';var _0x5eda66=_0x518150[_0x9481('0x21')];var _0x50a559=_0x34108d?0x0:_0x2266d5['offset'];var _0x26671c=_0x34108d?_0x518150[_0x9481('0x21')]:_0x2266d5[_0x9481('0x1e')]+_0x2266d5[_0x9481('0x20')];var _0x7000e7;if(_0x26671c>=_0x5eda66){_0x26671c=_0x5eda66;_0x7000e7=0xc8;}else{_0x7000e7=0xce;}_0x5b1fe6[_0x9481('0x1b')](_0x7000e7);return _0x5b1fe6['set'](_0x9481('0x22'),_0x50a559+'-'+_0x26671c+'/'+_0x5eda66)[_0x9481('0x1d')](_0x518150);}return null;};}function patchUpdates(_0x45f9df){return function(_0x615e02){try{jsonpatch[_0x9481('0x23')](_0x615e02,_0x45f9df,!![]);}catch(_0x56da97){return BPromise[_0x9481('0x24')](_0x56da97);}return _0x615e02[_0x9481('0x25')]();};}function saveUpdates(_0x572599,_0x2bcf37){return function(_0xd1cd1a){if(_0xd1cd1a){return _0xd1cd1a[_0x9481('0x26')](_0x572599)[_0x9481('0x27')](function(_0x2dc02e){return _0x2dc02e;});}return null;};}function removeEntity(_0x49ecfa,_0x91e3d9){return function(_0x22f0b5){if(_0x22f0b5){return _0x22f0b5['destroy']()['then'](function(){var _0x12b0c3=_0x22f0b5[_0x9481('0x28')]({'plain':!![]});var _0x550fce=_0x9481('0x29');return db[_0x9481('0x2a')][_0x9481('0x2b')]({'where':{'type':_0x550fce,'resourceId':_0x12b0c3['id']}})[_0x9481('0x27')](function(){return _0x22f0b5;});})['then'](function(){_0x49ecfa[_0x9481('0x1b')](0xcc)[_0x9481('0x1c')]();});}};}function handleEntityNotFound(_0x3c2585,_0x587706){return function(_0x1791b2){if(!_0x1791b2){_0x3c2585['sendStatus'](0x194);}return _0x1791b2;};}function handleError(_0x2e1eff,_0xe153ab){_0xe153ab=_0xe153ab||0x1f4;return function(_0x22ab26){logger[_0x9481('0x2c')](_0x22ab26[_0x9481('0x2d')]);if(_0x22ab26['name']){delete _0x22ab26[_0x9481('0x2e')];}_0x2e1eff[_0x9481('0x1b')](_0xe153ab)[_0x9481('0x2f')](_0x22ab26);};}exports['index']=function(_0x56752e,_0x1addc8){var _0x427c25={},_0x42df68={},_0x2b33f8={'count':0x0,'rows':[]};var _0x5d9926=_['map'](db['AnalyticDefaultReport'][_0x9481('0x30')],function(_0x5d6c65){return{'name':_0x5d6c65[_0x9481('0x31')],'type':_0x5d6c65['type'][_0x9481('0x32')]};});_0x42df68[_0x9481('0x33')]=_[_0x9481('0x34')](_0x5d9926,_0x9481('0x2e'));_0x42df68[_0x9481('0x35')]=_['keys'](_0x56752e[_0x9481('0x35')]);_0x42df68[_0x9481('0x36')]=_[_0x9481('0x37')](_0x42df68['model'],_0x42df68[_0x9481('0x35')]);_0x427c25[_0x9481('0x38')]=_[_0x9481('0x37')](_0x42df68[_0x9481('0x33')],qs[_0x9481('0x39')](_0x56752e[_0x9481('0x35')]['fields']));_0x427c25[_0x9481('0x38')]=_0x427c25['attributes'][_0x9481('0x3a')]?_0x427c25[_0x9481('0x38')]:_0x42df68[_0x9481('0x33')];if(!_0x56752e[_0x9481('0x35')][_0x9481('0x3b')](_0x9481('0x3c'))){_0x427c25['limit']=qs[_0x9481('0x20')](_0x56752e[_0x9481('0x35')]['limit']);_0x427c25['offset']=qs[_0x9481('0x1e')](_0x56752e['query'][_0x9481('0x1e')]);}_0x427c25[_0x9481('0x3d')]=qs[_0x9481('0x3e')](_0x56752e[_0x9481('0x35')]['sort']);_0x427c25[_0x9481('0x3f')]=qs['filters'](_[_0x9481('0x40')](_0x56752e['query'],_0x42df68[_0x9481('0x36')]),_0x5d9926);if(_0x56752e['query'][_0x9481('0x41')]){_0x427c25[_0x9481('0x3f')]=_[_0x9481('0x42')](_0x427c25[_0x9481('0x3f')],{'$or':_[_0x9481('0x34')](_0x5d9926,function(_0x3b7998){if(_0x3b7998[_0x9481('0x43')]!=='VIRTUAL'){var _0x464080={};_0x464080[_0x3b7998[_0x9481('0x2e')]]={'$like':'%'+_0x56752e[_0x9481('0x35')][_0x9481('0x41')]+'%'};return _0x464080;}})});}_0x427c25=_[_0x9481('0x42')]({},_0x427c25,_0x56752e[_0x9481('0x44')]);var _0x2e4241={'where':_0x427c25['where']};return db[_0x9481('0x45')][_0x9481('0x21')](_0x2e4241)['then'](function(_0x704e81){_0x2b33f8[_0x9481('0x21')]=_0x704e81;if(_0x56752e[_0x9481('0x35')][_0x9481('0x46')]){_0x427c25[_0x9481('0x47')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x9481('0x48')](_0x427c25);})['then'](function(_0x23811a){_0x2b33f8[_0x9481('0x49')]=_0x23811a;return _0x2b33f8;})['then'](respondWithFilteredResult(_0x1addc8,_0x427c25))['catch'](handleError(_0x1addc8,null));};exports[_0x9481('0x4a')]=function(_0x1d0df0,_0x42b19a){var _0x4c4caf={'raw':!![],'where':{'id':_0x1d0df0[_0x9481('0x4b')]['id']}},_0x4402f6={};_0x4402f6['model']=_['keys'](db[_0x9481('0x45')]['rawAttributes']);_0x4402f6[_0x9481('0x35')]=_[_0x9481('0x4c')](_0x1d0df0[_0x9481('0x35')]);_0x4402f6[_0x9481('0x36')]=_[_0x9481('0x37')](_0x4402f6['model'],_0x4402f6[_0x9481('0x35')]);_0x4c4caf[_0x9481('0x38')]=_['intersection'](_0x4402f6[_0x9481('0x33')],qs[_0x9481('0x39')](_0x1d0df0[_0x9481('0x35')][_0x9481('0x39')]));_0x4c4caf[_0x9481('0x38')]=_0x4c4caf[_0x9481('0x38')][_0x9481('0x3a')]?_0x4c4caf[_0x9481('0x38')]:_0x4402f6[_0x9481('0x33')];if(_0x1d0df0['query'][_0x9481('0x46')]){_0x4c4caf['include']=[{'all':!![]}];}_0x4c4caf=_['merge']({},_0x4c4caf,_0x1d0df0[_0x9481('0x44')]);return db['AnalyticDefaultReport'][_0x9481('0x4d')](_0x4c4caf)[_0x9481('0x27')](handleEntityNotFound(_0x42b19a,null))['then'](respondWithResult(_0x42b19a,null))[_0x9481('0x4e')](handleError(_0x42b19a,null));};exports[_0x9481('0x4f')]=function(_0x2f3413,_0x13b674){return db[_0x9481('0x45')][_0x9481('0x4f')](_0x2f3413['body'],{})['then'](function(_0x424b22){var _0x44d7e0=_0x2f3413[_0x9481('0x50')][_0x9481('0x28')]({'plain':!![]});if(!_0x44d7e0)throw new Error(_0x9481('0x51'));if(_0x44d7e0[_0x9481('0x52')]===_0x9481('0x50')){var _0x3d2250=_0x424b22['get']({'plain':!![]});var _0x3972c1=_0x9481('0x53');return db[_0x9481('0x54')][_0x9481('0x4d')]({'where':{'name':_0x3972c1,'userProfileId':_0x44d7e0[_0x9481('0x55')]},'raw':!![]})['then'](function(_0x4c3048){if(_0x4c3048&&_0x4c3048[_0x9481('0x56')]===0x0){return db[_0x9481('0x2a')][_0x9481('0x4f')]({'name':_0x3d2250['name'],'resourceId':_0x3d2250['id'],'type':'DefaultReports','sectionId':_0x4c3048['id']},{})['then'](function(){return _0x424b22;});}else{return _0x424b22;}})['catch'](function(_0x538507){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x538507);throw _0x538507;});}return _0x424b22;})[_0x9481('0x27')](respondWithResult(_0x13b674,0xc9))[_0x9481('0x4e')](handleError(_0x13b674,null));};exports['update']=function(_0xd8351c,_0x5f210c){if(_0xd8351c[_0x9481('0x57')]['id']){delete _0xd8351c[_0x9481('0x57')]['id'];}return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0xd8351c[_0x9481('0x4b')]['id']}})[_0x9481('0x27')](handleEntityNotFound(_0x5f210c,null))[_0x9481('0x27')](saveUpdates(_0xd8351c['body'],null))[_0x9481('0x27')](respondWithResult(_0x5f210c,null))[_0x9481('0x4e')](handleError(_0x5f210c,null));};exports['destroy']=function(_0x16416a,_0x1240dc){return db[_0x9481('0x45')][_0x9481('0x4d')]({'where':{'id':_0x16416a[_0x9481('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1240dc,null))[_0x9481('0x27')](removeEntity(_0x1240dc,null))[_0x9481('0x4e')](handleError(_0x1240dc,null));};exports[_0x9481('0x58')]=function(_0x3fc0f9,_0x559dd2){var _0x3ac428=0xa;var _0x2927f5=[_0x9481('0x59'),_0x9481('0x5a'),'right_join','cross_join'];var _0x5b4234={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x589b16={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x239676=function(_0x205b96){return!_['includes'](['IS\x20NULL',_0x9481('0x67'),'IS\x20EMPTY',_0x9481('0x68')],_0x205b96);};var _0x59637f=function(_0x9af916){if(!_0x9af916||!_0x9af916[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x492464='(',_0x28d331=0x0;_0x28d331<_0x9af916[_0x9481('0x69')]['length'];_0x28d331+=0x1){_0x28d331>0x0&&(_0x492464+='\x20'+_0x9af916['operator']+'\x20');_0x492464+=_0x9af916['rules'][_0x28d331]['group']?_0x59637f(_0x9af916[_0x9481('0x69')][_0x28d331]['group']):_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6a')]+'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331]['condition']+(_0x239676(_0x9af916[_0x9481('0x69')][_0x28d331]['condition'])?'\x20'+_0x9af916[_0x9481('0x69')][_0x28d331][_0x9481('0x6b')]:'');}return _0x492464+')';};var _0x3c267b={'where':{'id':_0x3fc0f9[_0x9481('0x4b')]['id']}},_0x4f157d,_0x2f20b4,_0x40fed2,_0x4ff016,_0x321972;_0x3c267b=_[_0x9481('0x42')]({},_0x3c267b,_0x3fc0f9[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x3c267b)[_0x9481('0x27')](function(_0x32ebde){if(_0x32ebde){_0x4f157d=_0x32ebde;return _0x32ebde[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x237d9b){if(_0x237d9b){if(!_0x237d9b[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x2f20b4=_0x237d9b;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})['then'](function(_0x1e05f8){if(_0x1e05f8){_0x40fed2=_['keyBy'](_0x1e05f8,'id');var _0x47bf37;var _0x1a7892=squel['select']();_0x1a7892['from'](_0x4f157d['table']);for(var _0x1b1967=0x0;_0x1b1967<_0x2f20b4[_0x9481('0x3a')];_0x1b1967+=0x1){_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x71')]?_0x40fed2[_0x2f20b4[_0x1b1967][_0x9481('0x71')]]['metric']:_0x2f20b4[_0x1b1967][_0x9481('0x6a')];_0x47bf37=_0x2f20b4[_0x1b1967][_0x9481('0x72')]?_[_0x9481('0x73')](_0x5b4234[_0x2f20b4[_0x1b1967][_0x9481('0x72')]],'%s',_0x47bf37):_0x47bf37;_0x47bf37=_0x2f20b4[_0x1b1967]['format']?_['replace'](_0x589b16[_0x2f20b4[_0x1b1967][_0x9481('0x74')]],'%s',_0x47bf37):_0x47bf37;if(_0x2f20b4[_0x1b1967][_0x9481('0x75')]){_0x1a7892[_0x9481('0x76')](_0x47bf37);}_0x2f20b4[_0x1b1967][_0x9481('0x77')]&&_0x1a7892[_0x9481('0x3d')](_0x47bf37,_0x2f20b4[_0x1b1967]['orderBy']===_0x9481('0x78')?![]:!![]);_0x1a7892[_0x9481('0x6a')](_0x47bf37,_0x2f20b4[_0x1b1967][_0x9481('0x79')]||_0x47bf37);}if(_0x4f157d[_0x9481('0x7a')]){_0x4f157d[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x4f157d[_0x9481('0x7a')]);for(var _0x42a6d2=0x0;_0x42a6d2<_0x4f157d[_0x9481('0x7a')][_0x9481('0x3a')];_0x42a6d2+=0x1){if(_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2927f5,_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')])&&_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7d')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7e')]&&_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x7f')]){_0x1a7892[_0x4f157d[_0x9481('0x7a')][_0x42a6d2][_0x9481('0x43')]](_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x4f157d['table'],_0x4f157d[_0x9481('0x7a')][_0x42a6d2]['parentKey'],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7e')],_0x4f157d['joins'][_0x42a6d2][_0x9481('0x7f')]));}}}if(_0x4f157d[_0x9481('0x80')]){_0x4f157d[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x4f157d['conditions']);_0x1a7892[_0x9481('0x3f')](_0x59637f(_0x4f157d['conditions'][_0x9481('0x76')]));}_0x321972=_0x1a7892[_0x9481('0x81')]();_0x1a7892[_0x9481('0x20')](_0x3ac428);_0x1a7892['offset'](0x0);logger['debug']('Limited\x20Query:',_0x1a7892[_0x9481('0x82')]());return dbH['sequelize']['query'](_0x1a7892[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')]['SELECT']});}})[_0x9481('0x27')](respondWithResult(_0x559dd2,null))[_0x9481('0x4e')](handleError(_0x559dd2,null));};function runReport(_0x545457,_0x226932,_0x3c8241){var _0x1ea93a=_0x226932[_0x9481('0x2e')];var _0x5f4be2=0xa;var _0x2e585d=['join',_0x9481('0x5a'),_0x9481('0x85'),'cross_join'];var _0x1c82a1={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x9481('0x5e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x55b428={'SEC_TO_TIME':_0x9481('0x86'),'DATE':_0x9481('0x63'),'HOUR':_0x9481('0x64'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x9481('0x66')};var _0x31e097=function(_0x339a30){return!_[_0x9481('0x7c')]([_0x9481('0x87'),_0x9481('0x67'),_0x9481('0x88'),_0x9481('0x68')],_0x339a30);};var _0x22e787=function(_0x31b70b){if(!_0x31b70b||!_0x31b70b['rules'][_0x9481('0x3a')]){return'';}for(var _0x5c430e='(',_0x4f55b5=0x0;_0x4f55b5<_0x31b70b['rules'][_0x9481('0x3a')];_0x4f55b5+=0x1){_0x4f55b5>0x0&&(_0x5c430e+='\x20'+_0x31b70b[_0x9481('0x89')]+'\x20');_0x5c430e+=_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x76')]?_0x22e787(_0x31b70b[_0x9481('0x69')][_0x4f55b5]['group']):_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6a')]+'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')]+(_0x31e097(_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x8a')])?'\x20'+_0x31b70b[_0x9481('0x69')][_0x4f55b5][_0x9481('0x6b')]:'');}return _0x5c430e+')';};var _0x28d924={'where':{'id':_0x545457['id']}},_0x426d56,_0x5808c8,_0x27be69,_0x1d49ba,_0x458a6f;_0x28d924=_[_0x9481('0x42')]({},_0x28d924,_0x3c8241);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x28d924)[_0x9481('0x27')](function(_0x1173e9){if(_0x1173e9){_0x426d56=_0x1173e9;return _0x1173e9[_0x9481('0x6c')]();}return null;})[_0x9481('0x27')](function(_0x5557d7){if(_0x5557d7){if(!_0x5557d7[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x5808c8=_0x5557d7;return db[_0x9481('0x70')][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x3ae3e2){if(_0x3ae3e2){_0x27be69=_[_0x9481('0x8b')](_0x3ae3e2,'id');var _0x538fe0;var _0x44e2c2=squel['select']();_0x44e2c2['from'](_0x426d56[_0x9481('0x8c')]);for(var _0x382455=0x0;_0x382455<_0x5808c8[_0x9481('0x3a')];_0x382455+=0x1){_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x71')]?_0x27be69[_0x5808c8[_0x382455][_0x9481('0x71')]][_0x9481('0x8d')]:_0x5808c8[_0x382455]['field'];_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x72')]?_['replace'](_0x1c82a1[_0x5808c8[_0x382455][_0x9481('0x72')]],'%s',_0x538fe0):_0x538fe0;_0x538fe0=_0x5808c8[_0x382455][_0x9481('0x74')]?_[_0x9481('0x73')](_0x55b428[_0x5808c8[_0x382455]['format']],'%s',_0x538fe0):_0x538fe0;if(_0x5808c8[_0x382455]['groupBy']){_0x44e2c2[_0x9481('0x76')](_0x538fe0);}_0x5808c8[_0x382455][_0x9481('0x77')]&&_0x44e2c2[_0x9481('0x3d')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x44e2c2[_0x9481('0x6a')](_0x538fe0,_0x5808c8[_0x382455][_0x9481('0x79')]||_0x538fe0);}if(_0x426d56[_0x9481('0x7a')]){_0x426d56[_0x9481('0x7a')]=JSON['parse'](_0x426d56[_0x9481('0x7a')]);for(var _0xd64114=0x0;_0xd64114<_0x426d56['joins'][_0x9481('0x3a')];_0xd64114+=0x1){if(_0x426d56['joins'][_0xd64114][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x2e585d,_0x426d56['joins'][_0xd64114][_0x9481('0x43')])&&_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')]&&_0x426d56['joins'][_0xd64114][_0x9481('0x7e')]&&_0x426d56[_0x9481('0x7a')][_0xd64114]['foreignKey']){_0x44e2c2[_0x426d56[_0x9481('0x7a')][_0xd64114]['type']](_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x426d56['table'],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7d')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7e')],_0x426d56[_0x9481('0x7a')][_0xd64114][_0x9481('0x7f')]));}}}if(_0x426d56['conditions']){_0x426d56[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x426d56[_0x9481('0x80')]);_0x44e2c2[_0x9481('0x3f')](_0x22e787(_0x426d56[_0x9481('0x80')][_0x9481('0x76')]));}_0x458a6f=_0x44e2c2[_0x9481('0x81')]();_0x44e2c2['limit'](_0x5f4be2);_0x44e2c2[_0x9481('0x1e')](0x0);return;}})[_0x9481('0x27')](function(){if(_0x226932[_0x9481('0x8e')]===_0x9481('0x8f')){return null;}var _0x4e5a8d=_[_0x9481('0x42')](_0x226932,{'name':_0x226932[_0x9481('0x90')]||_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],'basename':_0x1ea93a,'savename':util['format'](_0x9481('0x91'),_0x226932[_0x9481('0x2e')]||_0x426d56[_0x9481('0x2e')],require(_0x9481('0x92'))[_0x9481('0x93')](0x4),_0x226932[_0x9481('0x8e')]||_0x9481('0x94')),'reportId':_0x426d56['id'],'reportType':_0x9481('0x95')});return db[_0x9481('0x96')][_0x9481('0x4f')](_0x4e5a8d,{'raw':!![]});})[_0x9481('0x27')](function(_0x5930d6){if(_0x426d56[_0x9481('0x8c')]==='cdr'){_0x458a6f[_0x9481('0x3f')](_0x426d56[_0x9481('0x8c')]+_0x9481('0x97'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}else{_0x458a6f['where'](_0x426d56[_0x9481('0x8c')]+_0x9481('0x9a'),_0x226932[_0x9481('0x98')],_0x226932[_0x9481('0x99')]);}if(_0x5930d6){logger[_0x9481('0x9b')](_0x9481('0x9c'),_0x458a6f['toString']());require(_0x9481('0x9d'))[_0x9481('0x9e')](path[_0x9481('0x59')](__dirname,_0x9481('0x9f'),_0x5930d6[_0x9481('0x8e')]),[_0x5930d6['id'],_0x458a6f[_0x9481('0x82')](),path[_0x9481('0x59')](__dirname,_0x9481('0xa0'),_0x5930d6[_0x9481('0xa1')]),_0x1ea93a]);return _0x5930d6;}else{var _0x26a666=squel[_0x9481('0xa2')]();_0x26a666[_0x9481('0xa3')]('('+_0x458a6f['toString']()+')',_0x9481('0xa4'));_0x26a666[_0x9481('0x6a')](_0x9481('0xa5'),_0x9481('0x21'));_0x458a6f[_0x9481('0x20')](_0x226932[_0x9481('0x20')]||_0x5f4be2);_0x458a6f[_0x9481('0x1e')](_0x226932[_0x9481('0x1e')]||0x0);return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x26a666[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]})[_0x9481('0x27')](function(_0xcf83d2){if(!_0xcf83d2[_0x9481('0x3a')]){_0x1d49ba=0x0;}else{_0x1d49ba=_0xcf83d2[0x0][_0x9481('0x21')]||0x0;}return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x458a6f['toString'](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});})[_0x9481('0x27')](function(_0x4553fc){return{'rows':_0x4553fc||[],'count':_0x1d49ba};});}});}exports[_0x9481('0xa7')]=function(_0x55c4ab,_0x57928a){return runReport(_0x55c4ab[_0x9481('0x4b')],_0x55c4ab[_0x9481('0x35')],_0x55c4ab[_0x9481('0x44')])[_0x9481('0x27')](respondWithResult(_0x57928a,null))['catch'](handleError(_0x57928a,null));};exports['runReport']=runReport;exports['query']=function(_0x52b980,_0x5792b1){var _0x3a199b=0xa;var _0x4b779b=[_0x9481('0x59'),_0x9481('0x5a'),_0x9481('0x85'),_0x9481('0xa8')];var _0x55a65f={'SUM':_0x9481('0x5b'),'COUNT':_0x9481('0x5c'),'COUNT DISTINCT':_0x9481('0xa9'),'MAX':_0x9481('0x5d'),'MIN':_0x9481('0x5e'),'AVG':_0x9481('0x5f'),'GROUP_CONCAT':_0x9481('0x60'),'GROUP_CONCAT ASC':_0x9481('0x61'),'GROUP_CONCAT DESC':_0x9481('0x62')};var _0x583490={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x9481('0x63'),'HOUR':'HOUR(%s)','ROUND':_0x9481('0x65'),'UNIX_TIMESTAMP':_0x9481('0x66')};var _0x1e40fe=function(_0x26c87b){return!_[_0x9481('0x7c')](['IS\x20NULL',_0x9481('0x67'),_0x9481('0x88'),'IS\x20NOT\x20EMPTY'],_0x26c87b);};var _0x4ea411=function(_0x1cdca0){if(!_0x1cdca0||!_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')]){return'';}for(var _0x15c53f='(',_0x7ee854=0x0;_0x7ee854<_0x1cdca0[_0x9481('0x69')][_0x9481('0x3a')];_0x7ee854+=0x1){_0x7ee854>0x0&&(_0x15c53f+='\x20'+_0x1cdca0[_0x9481('0x89')]+'\x20');_0x15c53f+=_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x76')]?_0x4ea411(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x76')]):_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x6a')]+'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854][_0x9481('0x8a')]+(_0x1e40fe(_0x1cdca0['rules'][_0x7ee854][_0x9481('0x8a')])?'\x20'+_0x1cdca0[_0x9481('0x69')][_0x7ee854]['value']:'');}return _0x15c53f+')';};var _0x49a6db={'where':{'id':_0x52b980['params']['id']}},_0x224b16,_0x83543f,_0x58c043,_0x97a67a,_0xe157e4;_0x49a6db=_[_0x9481('0x42')]({},_0x49a6db,_0x52b980[_0x9481('0x44')]);return db[_0x9481('0x45')][_0x9481('0x4d')](_0x49a6db)['then'](function(_0x1a1058){if(_0x1a1058){_0x224b16=_0x1a1058;return _0x1a1058['getFields']();}return null;})[_0x9481('0x27')](function(_0x206661){if(_0x206661){if(!_0x206661[_0x9481('0x3a')]){throw new db[(_0x9481('0x6d'))][(_0x9481('0x6e'))](_0x9481('0x6f'),0x193);}_0x83543f=_0x206661;return db['AnalyticMetric'][_0x9481('0x48')]({'raw':!![]});}return null;})[_0x9481('0x27')](function(_0x40cdf9){if(_0x40cdf9){_0x58c043=_['keyBy'](_0x40cdf9,'id');var _0x5467fe;var _0x440d88=squel['select']();_0x440d88[_0x9481('0xa3')](_0x224b16['table']);for(var _0x2a0367=0x0;_0x2a0367<_0x83543f[_0x9481('0x3a')];_0x2a0367+=0x1){_0x5467fe=_0x83543f[_0x2a0367]['MetricId']?_0x58c043[_0x83543f[_0x2a0367][_0x9481('0x71')]][_0x9481('0x8d')]:_0x83543f[_0x2a0367][_0x9481('0x6a')];_0x5467fe=_0x83543f[_0x2a0367]['function']?_[_0x9481('0x73')](_0x55a65f[_0x83543f[_0x2a0367][_0x9481('0x72')]],'%s',_0x5467fe):_0x5467fe;_0x5467fe=_0x83543f[_0x2a0367][_0x9481('0x74')]?_[_0x9481('0x73')](_0x583490[_0x83543f[_0x2a0367][_0x9481('0x74')]],'%s',_0x5467fe):_0x5467fe;if(_0x83543f[_0x2a0367][_0x9481('0x75')]){_0x440d88[_0x9481('0x76')](_0x5467fe);}_0x83543f[_0x2a0367]['orderBy']&&_0x440d88[_0x9481('0x3d')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x77')]===_0x9481('0x78')?![]:!![]);_0x440d88[_0x9481('0x6a')](_0x5467fe,_0x83543f[_0x2a0367][_0x9481('0x79')]||_0x5467fe);}if(_0x224b16['joins']){_0x224b16[_0x9481('0x7a')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x7a')]);for(var _0x527ef6=0x0;_0x527ef6<_0x224b16['joins'][_0x9481('0x3a')];_0x527ef6+=0x1){if(_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]&&_[_0x9481('0x7c')](_0x4b779b,_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')])&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7d')]&&_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')]&&_0x224b16['joins'][_0x527ef6][_0x9481('0x7f')]){_0x440d88[_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x43')]](_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],null,util[_0x9481('0x74')]('%s.%s\x20=\x20%s.%s',_0x224b16[_0x9481('0x8c')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['parentKey'],_0x224b16[_0x9481('0x7a')][_0x527ef6][_0x9481('0x7e')],_0x224b16[_0x9481('0x7a')][_0x527ef6]['foreignKey']));}}}if(_0x224b16[_0x9481('0x80')]){_0x224b16[_0x9481('0x80')]=JSON[_0x9481('0x7b')](_0x224b16[_0x9481('0x80')]);_0x440d88['where'](_0x4ea411(_0x224b16[_0x9481('0x80')][_0x9481('0x76')]));}_0xe157e4=_0x440d88[_0x9481('0x81')]();_0x440d88[_0x9481('0x20')](_0x3a199b);_0x440d88['offset'](0x0);logger[_0x9481('0xaa')](_0x9481('0xab'),_0x440d88[_0x9481('0x82')]());return dbH[_0x9481('0x83')][_0x9481('0x35')](_0x440d88[_0x9481('0x82')](),{'type':dbH[_0x9481('0x83')][_0x9481('0x84')][_0x9481('0xa6')]});}})[_0x9481('0x27')](function(){return{'sql':_0xe157e4['toString']()};})[_0x9481('0x27')](respondWithResult(_0x5792b1,null))[_0x9481('0x4e')](handleError(_0x5792b1,null));};
\ No newline at end of file
+var _0x5fab=['debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','from','function','order','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','run','params','runReport','AVG(%s)','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','status','end','limit','undefined','count','offset','Content-Range','apply','save','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','query','where','pick','filters','filter','VIRTUAL','merge','options','include','findAll','rows','catch','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','replace','format','groupBy','orderBy','DESC','alias','joins','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone'];(function(_0x19f332,_0x42a8ad){var _0x1696e2=function(_0x320b4a){while(--_0x320b4a){_0x19f332['push'](_0x19f332['shift']());}};_0x1696e2(++_0x42a8ad);}(_0x5fab,0x177));var _0xb5fa=function(_0x3aac69,_0x81d09f){_0x3aac69=_0x3aac69-0x0;var _0x38d35b=_0x5fab[_0x3aac69];return _0x38d35b;};'use strict';var emlformat=require(_0xb5fa('0x0'));var rimraf=require(_0xb5fa('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb5fa('0x2'));var rp=require(_0xb5fa('0x3'));var moment=require(_0xb5fa('0x4'));var BPromise=require(_0xb5fa('0x5'));var Mustache=require(_0xb5fa('0x6'));var util=require(_0xb5fa('0x7'));var path=require(_0xb5fa('0x8'));var sox=require(_0xb5fa('0x9'));var csv=require(_0xb5fa('0xa'));var ejs=require(_0xb5fa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xa'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var licenseUtil=require(_0xb5fa('0x18'));var db=require(_0xb5fa('0x19'))['db'];var dbH=require('../../mysqldb')[_0xb5fa('0x1a')];function respondWithStatusCode(_0x3dad4d,_0x56e8b0){_0x56e8b0=_0x56e8b0||0xcc;return function(_0x116849){if(_0x116849){return _0x3dad4d['sendStatus'](_0x56e8b0);}return _0x3dad4d[_0xb5fa('0x1b')](_0x56e8b0)[_0xb5fa('0x1c')]();};}function respondWithResult(_0x40c914,_0xca8d82){_0xca8d82=_0xca8d82||0xc8;return function(_0x8e9d1c){if(_0x8e9d1c){return _0x40c914['status'](_0xca8d82)['json'](_0x8e9d1c);}};}function respondWithFilteredResult(_0x38e964,_0x587043){return function(_0x31f252){if(_0x31f252){var _0x27c8f7=typeof _0x587043['offset']==='undefined'&&typeof _0x587043[_0xb5fa('0x1d')]===_0xb5fa('0x1e');var _0x32e9e5=_0x31f252[_0xb5fa('0x1f')];var _0x324ba5=_0x27c8f7?0x0:_0x587043[_0xb5fa('0x20')];var _0x3b0f69=_0x27c8f7?_0x31f252[_0xb5fa('0x1f')]:_0x587043[_0xb5fa('0x20')]+_0x587043[_0xb5fa('0x1d')];var _0x3c8d53;if(_0x3b0f69>=_0x32e9e5){_0x3b0f69=_0x32e9e5;_0x3c8d53=0xc8;}else{_0x3c8d53=0xce;}_0x38e964[_0xb5fa('0x1b')](_0x3c8d53);return _0x38e964['set'](_0xb5fa('0x21'),_0x324ba5+'-'+_0x3b0f69+'/'+_0x32e9e5)['json'](_0x31f252);}return null;};}function patchUpdates(_0x37ae06){return function(_0x4a6c04){try{jsonpatch[_0xb5fa('0x22')](_0x4a6c04,_0x37ae06,!![]);}catch(_0x43c09f){return BPromise['reject'](_0x43c09f);}return _0x4a6c04[_0xb5fa('0x23')]();};}function saveUpdates(_0x3a2ab9,_0x283a56){return function(_0x47f71a){if(_0x47f71a){return _0x47f71a[_0xb5fa('0x24')](_0x3a2ab9)[_0xb5fa('0x25')](function(_0x444237){return _0x444237;});}return null;};}function removeEntity(_0x542348,_0x224ec8){return function(_0x5d55f7){if(_0x5d55f7){return _0x5d55f7[_0xb5fa('0x26')]()[_0xb5fa('0x25')](function(){var _0x11053a=_0x5d55f7[_0xb5fa('0x27')]({'plain':!![]});var _0x2dbd22=_0xb5fa('0x28');return db[_0xb5fa('0x29')][_0xb5fa('0x26')]({'where':{'type':_0x2dbd22,'resourceId':_0x11053a['id']}})['then'](function(){return _0x5d55f7;});})['then'](function(){_0x542348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x28a350,_0x460b54){return function(_0x12c0d4){if(!_0x12c0d4){_0x28a350[_0xb5fa('0x2a')](0x194);}return _0x12c0d4;};}function handleError(_0x534884,_0x3506a4){_0x3506a4=_0x3506a4||0x1f4;return function(_0x358549){logger[_0xb5fa('0x2b')](_0x358549[_0xb5fa('0x2c')]);if(_0x358549[_0xb5fa('0x2d')]){delete _0x358549[_0xb5fa('0x2d')];}_0x534884[_0xb5fa('0x1b')](_0x3506a4)[_0xb5fa('0x2e')](_0x358549);};}exports[_0xb5fa('0x2f')]=function(_0xed02e,_0x116773){var _0x5a0152={},_0x3fd1fb={},_0x21fc7e={'count':0x0,'rows':[]};var _0x319c48=_[_0xb5fa('0x30')](db[_0xb5fa('0x31')][_0xb5fa('0x32')],function(_0x25fc7c){return{'name':_0x25fc7c['fieldName'],'type':_0x25fc7c[_0xb5fa('0x33')]['key']};});_0x3fd1fb['model']=_['map'](_0x319c48,_0xb5fa('0x2d'));_0x3fd1fb['query']=_[_0xb5fa('0x34')](_0xed02e['query']);_0x3fd1fb['filters']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],_0x3fd1fb['query']);_0x5a0152['attributes']=_[_0xb5fa('0x35')](_0x3fd1fb[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0xed02e['query'][_0xb5fa('0x37')]));_0x5a0152[_0xb5fa('0x38')]=_0x5a0152['attributes'][_0xb5fa('0x39')]?_0x5a0152[_0xb5fa('0x38')]:_0x3fd1fb[_0xb5fa('0x36')];if(!_0xed02e['query'][_0xb5fa('0x3a')](_0xb5fa('0x3b'))){_0x5a0152[_0xb5fa('0x1d')]=qs['limit'](_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x1d')]);_0x5a0152[_0xb5fa('0x20')]=qs[_0xb5fa('0x20')](_0xed02e['query']['offset']);}_0x5a0152['order']=qs['sort'](_0xed02e['query']['sort']);_0x5a0152[_0xb5fa('0x3d')]=qs['filters'](_[_0xb5fa('0x3e')](_0xed02e[_0xb5fa('0x3c')],_0x3fd1fb[_0xb5fa('0x3f')]),_0x319c48);if(_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]){_0x5a0152[_0xb5fa('0x3d')]=_['merge'](_0x5a0152['where'],{'$or':_['map'](_0x319c48,function(_0x534b38){if(_0x534b38['type']!==_0xb5fa('0x41')){var _0x5addd5={};_0x5addd5[_0x534b38['name']]={'$like':'%'+_0xed02e[_0xb5fa('0x3c')][_0xb5fa('0x40')]+'%'};return _0x5addd5;}})});}_0x5a0152=_[_0xb5fa('0x42')]({},_0x5a0152,_0xed02e[_0xb5fa('0x43')]);var _0x5bc93f={'where':_0x5a0152[_0xb5fa('0x3d')]};return db[_0xb5fa('0x31')][_0xb5fa('0x1f')](_0x5bc93f)[_0xb5fa('0x25')](function(_0x402a68){_0x21fc7e['count']=_0x402a68;if(_0xed02e[_0xb5fa('0x3c')]['includeAll']){_0x5a0152[_0xb5fa('0x44')]=[{'all':!![]}];}return db[_0xb5fa('0x31')][_0xb5fa('0x45')](_0x5a0152);})[_0xb5fa('0x25')](function(_0x1c706b){_0x21fc7e[_0xb5fa('0x46')]=_0x1c706b;return _0x21fc7e;})[_0xb5fa('0x25')](respondWithFilteredResult(_0x116773,_0x5a0152))[_0xb5fa('0x47')](handleError(_0x116773,null));};exports['show']=function(_0x1c3c2c,_0xc03e44){var _0x59ae64={'raw':!![],'where':{'id':_0x1c3c2c['params']['id']}},_0x293c19={};_0x293c19[_0xb5fa('0x36')]=_[_0xb5fa('0x34')](db['AnalyticDefaultReport']['rawAttributes']);_0x293c19[_0xb5fa('0x3c')]=_[_0xb5fa('0x34')](_0x1c3c2c[_0xb5fa('0x3c')]);_0x293c19[_0xb5fa('0x3f')]=_[_0xb5fa('0x35')](_0x293c19[_0xb5fa('0x36')],_0x293c19[_0xb5fa('0x3c')]);_0x59ae64[_0xb5fa('0x38')]=_['intersection'](_0x293c19[_0xb5fa('0x36')],qs[_0xb5fa('0x37')](_0x1c3c2c['query'][_0xb5fa('0x37')]));_0x59ae64[_0xb5fa('0x38')]=_0x59ae64[_0xb5fa('0x38')][_0xb5fa('0x39')]?_0x59ae64[_0xb5fa('0x38')]:_0x293c19[_0xb5fa('0x36')];if(_0x1c3c2c[_0xb5fa('0x3c')][_0xb5fa('0x48')]){_0x59ae64[_0xb5fa('0x44')]=[{'all':!![]}];}_0x59ae64=_[_0xb5fa('0x42')]({},_0x59ae64,_0x1c3c2c[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x59ae64)[_0xb5fa('0x25')](handleEntityNotFound(_0xc03e44,null))[_0xb5fa('0x25')](respondWithResult(_0xc03e44,null))[_0xb5fa('0x47')](handleError(_0xc03e44,null));};exports['create']=function(_0x56dceb,_0x46194d){return db['AnalyticDefaultReport'][_0xb5fa('0x4a')](_0x56dceb[_0xb5fa('0x4b')],{})['then'](function(_0x4ef1d0){var _0x2931a7=_0x56dceb[_0xb5fa('0x4c')][_0xb5fa('0x27')]({'plain':!![]});if(!_0x2931a7)throw new Error(_0xb5fa('0x4d'));if(_0x2931a7[_0xb5fa('0x4e')]==='user'){var _0x27a651=_0x4ef1d0['get']({'plain':!![]});var _0x251d36=_0xb5fa('0x4f');return db[_0xb5fa('0x50')]['find']({'where':{'name':_0x251d36,'userProfileId':_0x2931a7[_0xb5fa('0x51')]},'raw':!![]})[_0xb5fa('0x25')](function(_0x4dea87){if(_0x4dea87&&_0x4dea87['autoAssociation']===0x0){return db[_0xb5fa('0x29')][_0xb5fa('0x4a')]({'name':_0x27a651[_0xb5fa('0x2d')],'resourceId':_0x27a651['id'],'type':_0xb5fa('0x28'),'sectionId':_0x4dea87['id']},{})[_0xb5fa('0x25')](function(){return _0x4ef1d0;});}else{return _0x4ef1d0;}})[_0xb5fa('0x47')](function(_0x31c91f){logger[_0xb5fa('0x2b')](_0xb5fa('0x52'),_0x31c91f);throw _0x31c91f;});}return _0x4ef1d0;})[_0xb5fa('0x25')](respondWithResult(_0x46194d,0xc9))[_0xb5fa('0x47')](handleError(_0x46194d,null));};exports[_0xb5fa('0x24')]=function(_0x3ccfd1,_0x2799e7){if(_0x3ccfd1[_0xb5fa('0x4b')]['id']){delete _0x3ccfd1[_0xb5fa('0x4b')]['id'];}return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x3ccfd1['params']['id']}})[_0xb5fa('0x25')](handleEntityNotFound(_0x2799e7,null))[_0xb5fa('0x25')](saveUpdates(_0x3ccfd1[_0xb5fa('0x4b')],null))[_0xb5fa('0x25')](respondWithResult(_0x2799e7,null))[_0xb5fa('0x47')](handleError(_0x2799e7,null));};exports[_0xb5fa('0x26')]=function(_0x4224cf,_0x24117e){return db[_0xb5fa('0x31')][_0xb5fa('0x49')]({'where':{'id':_0x4224cf['params']['id']}})['then'](handleEntityNotFound(_0x24117e,null))[_0xb5fa('0x25')](removeEntity(_0x24117e,null))[_0xb5fa('0x47')](handleError(_0x24117e,null));};exports[_0xb5fa('0x53')]=function(_0x5caf84,_0x441c41){var _0x367f7a=0xa;var _0x1572fb=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x4f82f0={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x2b9a45={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0x1c24e3=function(_0xfb88cc){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0xfb88cc);};var _0x41cce9=function(_0x23fb01){if(!_0x23fb01||!_0x23fb01[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x421a93='(',_0x36fc0f=0x0;_0x36fc0f<_0x23fb01['rules'][_0xb5fa('0x39')];_0x36fc0f+=0x1){_0x36fc0f>0x0&&(_0x421a93+='\x20'+_0x23fb01[_0xb5fa('0x6a')]+'\x20');_0x421a93+=_0x23fb01[_0xb5fa('0x69')][_0x36fc0f]['group']?_0x41cce9(_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6b')]):_0x23fb01['rules'][_0x36fc0f][_0xb5fa('0x6c')]+'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6d')]+(_0x1c24e3(_0x23fb01['rules'][_0x36fc0f]['condition'])?'\x20'+_0x23fb01[_0xb5fa('0x69')][_0x36fc0f][_0xb5fa('0x6e')]:'');}return _0x421a93+')';};var _0x432f04={'where':{'id':_0x5caf84['params']['id']}},_0x57d8b7,_0x597206,_0x30d53b,_0x199555,_0x12b0a2;_0x432f04=_['merge']({},_0x432f04,_0x5caf84['options']);return db[_0xb5fa('0x31')][_0xb5fa('0x49')](_0x432f04)[_0xb5fa('0x25')](function(_0x4ce1bd){if(_0x4ce1bd){_0x57d8b7=_0x4ce1bd;return _0x4ce1bd[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x13ef3a){if(_0x13ef3a){if(!_0x13ef3a[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x597206=_0x13ef3a;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x3a1db9){if(_0x3a1db9){_0x30d53b=_[_0xb5fa('0x74')](_0x3a1db9,'id');var _0xecdff3;var _0x38faa6=squel[_0xb5fa('0x75')]();_0x38faa6['from'](_0x57d8b7[_0xb5fa('0x76')]);for(var _0x5a6f74=0x0;_0x5a6f74<_0x597206[_0xb5fa('0x39')];_0x5a6f74+=0x1){_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x77')]?_0x30d53b[_0x597206[_0x5a6f74][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x597206[_0x5a6f74][_0xb5fa('0x6c')];_0xecdff3=_0x597206[_0x5a6f74]['function']?_[_0xb5fa('0x79')](_0x4f82f0[_0x597206[_0x5a6f74]['function']],'%s',_0xecdff3):_0xecdff3;_0xecdff3=_0x597206[_0x5a6f74][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x2b9a45[_0x597206[_0x5a6f74][_0xb5fa('0x7a')]],'%s',_0xecdff3):_0xecdff3;if(_0x597206[_0x5a6f74][_0xb5fa('0x7b')]){_0x38faa6['group'](_0xecdff3);}_0x597206[_0x5a6f74]['orderBy']&&_0x38faa6['order'](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x38faa6[_0xb5fa('0x6c')](_0xecdff3,_0x597206[_0x5a6f74][_0xb5fa('0x7e')]||_0xecdff3);}if(_0x57d8b7[_0xb5fa('0x7f')]){_0x57d8b7[_0xb5fa('0x7f')]=JSON['parse'](_0x57d8b7[_0xb5fa('0x7f')]);for(var _0x5c08e1=0x0;_0x5c08e1<_0x57d8b7['joins'][_0xb5fa('0x39')];_0x5c08e1+=0x1){if(_0x57d8b7['joins'][_0x5c08e1]['type']&&_['includes'](_0x1572fb,_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type'])&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')]&&_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['foreignTable']&&_0x57d8b7['joins'][_0x5c08e1][_0xb5fa('0x81')]){_0x38faa6[_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1]['type']](_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x57d8b7['table'],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x80')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x82')],_0x57d8b7[_0xb5fa('0x7f')][_0x5c08e1][_0xb5fa('0x81')]));}}}if(_0x57d8b7[_0xb5fa('0x84')]){_0x57d8b7['conditions']=JSON[_0xb5fa('0x85')](_0x57d8b7['conditions']);_0x38faa6[_0xb5fa('0x3d')](_0x41cce9(_0x57d8b7[_0xb5fa('0x84')]['group']));}_0x12b0a2=_0x38faa6[_0xb5fa('0x86')]();_0x38faa6[_0xb5fa('0x1d')](_0x367f7a);_0x38faa6[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x38faa6[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x38faa6['toString'](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](respondWithResult(_0x441c41,null))['catch'](handleError(_0x441c41,null));};function runReport(_0x593386,_0x47d72b,_0x5557a3){var _0x1c60bd=_0x47d72b[_0xb5fa('0x2d')];var _0xff504d=0xa;var _0x188e66=['join','left_join',_0xb5fa('0x56'),'cross_join'];var _0x32eebd={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':'MAX(%s)','MIN':_0xb5fa('0x5b'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5e6852={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':_0xb5fa('0x60'),'HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':_0xb5fa('0x63')};var _0xa7fd3b=function(_0x42e210){return!_[_0xb5fa('0x64')]([_0xb5fa('0x65'),_0xb5fa('0x66'),_0xb5fa('0x67'),_0xb5fa('0x68')],_0x42e210);};var _0x86dfe9=function(_0x53c7b5){if(!_0x53c7b5||!_0x53c7b5['rules'][_0xb5fa('0x39')]){return'';}for(var _0x52384b='(',_0x1cb113=0x0;_0x1cb113<_0x53c7b5[_0xb5fa('0x69')]['length'];_0x1cb113+=0x1){_0x1cb113>0x0&&(_0x52384b+='\x20'+_0x53c7b5[_0xb5fa('0x6a')]+'\x20');_0x52384b+=_0x53c7b5[_0xb5fa('0x69')][_0x1cb113]['group']?_0x86dfe9(_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6b')]):_0x53c7b5['rules'][_0x1cb113][_0xb5fa('0x6c')]+'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6d')]+(_0xa7fd3b(_0x53c7b5['rules'][_0x1cb113]['condition'])?'\x20'+_0x53c7b5[_0xb5fa('0x69')][_0x1cb113][_0xb5fa('0x6e')]:'');}return _0x52384b+')';};var _0x3b5e1d={'where':{'id':_0x593386['id']}},_0x3d18a9,_0x397830,_0x234d9d,_0x10222c,_0x1eec65;_0x3b5e1d=_[_0xb5fa('0x42')]({},_0x3b5e1d,_0x5557a3);return db[_0xb5fa('0x31')]['find'](_0x3b5e1d)['then'](function(_0x3c5563){if(_0x3c5563){_0x3d18a9=_0x3c5563;return _0x3c5563[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x18498d){if(_0x18498d){if(!_0x18498d['length']){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x397830=_0x18498d;return db['AnalyticMetric'][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x109dd9){if(_0x109dd9){_0x234d9d=_[_0xb5fa('0x74')](_0x109dd9,'id');var _0x5ba2e7;var _0x1175da=squel[_0xb5fa('0x75')]();_0x1175da[_0xb5fa('0x8e')](_0x3d18a9[_0xb5fa('0x76')]);for(var _0x19717a=0x0;_0x19717a<_0x397830[_0xb5fa('0x39')];_0x19717a+=0x1){_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x77')]?_0x234d9d[_0x397830[_0x19717a][_0xb5fa('0x77')]][_0xb5fa('0x78')]:_0x397830[_0x19717a][_0xb5fa('0x6c')];_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x32eebd[_0x397830[_0x19717a][_0xb5fa('0x8f')]],'%s',_0x5ba2e7):_0x5ba2e7;_0x5ba2e7=_0x397830[_0x19717a][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x5e6852[_0x397830[_0x19717a]['format']],'%s',_0x5ba2e7):_0x5ba2e7;if(_0x397830[_0x19717a][_0xb5fa('0x7b')]){_0x1175da[_0xb5fa('0x6b')](_0x5ba2e7);}_0x397830[_0x19717a][_0xb5fa('0x7c')]&&_0x1175da[_0xb5fa('0x90')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7c')]===_0xb5fa('0x7d')?![]:!![]);_0x1175da[_0xb5fa('0x6c')](_0x5ba2e7,_0x397830[_0x19717a][_0xb5fa('0x7e')]||_0x5ba2e7);}if(_0x3d18a9['joins']){_0x3d18a9['joins']=JSON[_0xb5fa('0x85')](_0x3d18a9['joins']);for(var _0x5d0ca8=0x0;_0x5d0ca8<_0x3d18a9[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x5d0ca8+=0x1){if(_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['type']&&_[_0xb5fa('0x64')](_0x188e66,_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')])&&_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x80')]&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable']&&_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x81')]){_0x1175da[_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x33')]](_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')]('%s.%s\x20=\x20%s.%s',_0x3d18a9[_0xb5fa('0x76')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8][_0xb5fa('0x80')],_0x3d18a9[_0xb5fa('0x7f')][_0x5d0ca8]['foreignTable'],_0x3d18a9['joins'][_0x5d0ca8][_0xb5fa('0x81')]));}}}if(_0x3d18a9[_0xb5fa('0x84')]){_0x3d18a9[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3d18a9['conditions']);_0x1175da['where'](_0x86dfe9(_0x3d18a9['conditions']['group']));}_0x1eec65=_0x1175da[_0xb5fa('0x86')]();_0x1175da[_0xb5fa('0x1d')](_0xff504d);_0x1175da[_0xb5fa('0x20')](0x0);return;}})[_0xb5fa('0x25')](function(){if(_0x47d72b[_0xb5fa('0x91')]===_0xb5fa('0x92')){return null;}var _0x3c36a8=_[_0xb5fa('0x42')](_0x47d72b,{'name':_0x47d72b[_0xb5fa('0x93')]||_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9[_0xb5fa('0x2d')],'basename':_0x1c60bd,'savename':util['format'](_0xb5fa('0x94'),_0x47d72b[_0xb5fa('0x2d')]||_0x3d18a9['name'],require(_0xb5fa('0x95'))[_0xb5fa('0x96')](0x4),_0x47d72b['output']||_0xb5fa('0x97')),'reportId':_0x3d18a9['id'],'reportType':_0xb5fa('0x98')});return db[_0xb5fa('0x99')][_0xb5fa('0x4a')](_0x3c36a8,{'raw':!![]});})[_0xb5fa('0x25')](function(_0x2b449a){if(_0x3d18a9[_0xb5fa('0x76')]===_0xb5fa('0x9a')){_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9['table']+_0xb5fa('0x9b'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}else{_0x1eec65[_0xb5fa('0x3d')](_0x3d18a9[_0xb5fa('0x76')]+_0xb5fa('0x9e'),_0x47d72b[_0xb5fa('0x9c')],_0x47d72b[_0xb5fa('0x9d')]);}if(_0x2b449a){logger['info'](_0xb5fa('0x9f'),_0x1eec65['toString']());require(_0xb5fa('0xa0'))[_0xb5fa('0xa1')](path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa2'),_0x2b449a[_0xb5fa('0x91')]),[_0x2b449a['id'],_0x1eec65[_0xb5fa('0x89')](),path[_0xb5fa('0x54')](__dirname,_0xb5fa('0xa3'),_0x2b449a[_0xb5fa('0xa4')]),_0x1c60bd]);return _0x2b449a;}else{var _0x4bb9b4=squel['select']();_0x4bb9b4[_0xb5fa('0x8e')]('('+_0x1eec65[_0xb5fa('0x89')]()+')',_0xb5fa('0xa5'));_0x4bb9b4[_0xb5fa('0x6c')]('COUNT(*)',_0xb5fa('0x1f'));_0x1eec65['limit'](_0x47d72b[_0xb5fa('0x1d')]||_0xff504d);_0x1eec65[_0xb5fa('0x20')](_0x47d72b['offset']||0x0);return dbH[_0xb5fa('0x8a')]['query'](_0x4bb9b4[_0xb5fa('0x89')](),{'type':dbH['sequelize'][_0xb5fa('0x8b')][_0xb5fa('0x8c')]})[_0xb5fa('0x25')](function(_0x70e4ae){if(!_0x70e4ae[_0xb5fa('0x39')]){_0x10222c=0x0;}else{_0x10222c=_0x70e4ae[0x0][_0xb5fa('0x1f')]||0x0;}return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x1eec65[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')][_0xb5fa('0x8b')]['SELECT']});})[_0xb5fa('0x25')](function(_0x284b34){return{'rows':_0x284b34||[],'count':_0x10222c};});}});}exports[_0xb5fa('0xa6')]=function(_0x497931,_0x2145d8){return runReport(_0x497931[_0xb5fa('0xa7')],_0x497931[_0xb5fa('0x3c')],_0x497931[_0xb5fa('0x43')])[_0xb5fa('0x25')](respondWithResult(_0x2145d8,null))[_0xb5fa('0x47')](handleError(_0x2145d8,null));};exports[_0xb5fa('0xa8')]=runReport;exports[_0xb5fa('0x3c')]=function(_0x59fd75,_0x245ee1){var _0x5c1e1f=0xa;var _0x3ba723=[_0xb5fa('0x54'),_0xb5fa('0x55'),_0xb5fa('0x56'),_0xb5fa('0x57')];var _0x105c0f={'SUM':_0xb5fa('0x58'),'COUNT':_0xb5fa('0x59'),'COUNT DISTINCT':_0xb5fa('0x8d'),'MAX':_0xb5fa('0x5a'),'MIN':_0xb5fa('0x5b'),'AVG':_0xb5fa('0xa9'),'GROUP_CONCAT':_0xb5fa('0x5c'),'GROUP_CONCAT ASC':_0xb5fa('0x5d'),'GROUP_CONCAT DESC':_0xb5fa('0x5e')};var _0x41e086={'SEC_TO_TIME':_0xb5fa('0x5f'),'DATE':'DATE(%s)','HOUR':_0xb5fa('0x61'),'ROUND':_0xb5fa('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xd34c31=function(_0x2e614e){return!_['includes'](['IS\x20NULL','IS\x20NOT\x20NULL',_0xb5fa('0x67'),_0xb5fa('0x68')],_0x2e614e);};var _0x1aae82=function(_0x474bb){if(!_0x474bb||!_0x474bb[_0xb5fa('0x69')][_0xb5fa('0x39')]){return'';}for(var _0x17ae50='(',_0x51c9ba=0x0;_0x51c9ba<_0x474bb['rules']['length'];_0x51c9ba+=0x1){_0x51c9ba>0x0&&(_0x17ae50+='\x20'+_0x474bb[_0xb5fa('0x6a')]+'\x20');_0x17ae50+=_0x474bb['rules'][_0x51c9ba]['group']?_0x1aae82(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['group']):_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6c')]+'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6d')]+(_0xd34c31(_0x474bb[_0xb5fa('0x69')][_0x51c9ba]['condition'])?'\x20'+_0x474bb[_0xb5fa('0x69')][_0x51c9ba][_0xb5fa('0x6e')]:'');}return _0x17ae50+')';};var _0x2fe715={'where':{'id':_0x59fd75[_0xb5fa('0xa7')]['id']}},_0x3c5ac4,_0x23b70f,_0x488818,_0x15b228,_0x42fd84;_0x2fe715=_[_0xb5fa('0x42')]({},_0x2fe715,_0x59fd75[_0xb5fa('0x43')]);return db[_0xb5fa('0x31')]['find'](_0x2fe715)[_0xb5fa('0x25')](function(_0x390043){if(_0x390043){_0x3c5ac4=_0x390043;return _0x390043[_0xb5fa('0x6f')]();}return null;})[_0xb5fa('0x25')](function(_0x32c191){if(_0x32c191){if(!_0x32c191[_0xb5fa('0x39')]){throw new db[(_0xb5fa('0x70'))][(_0xb5fa('0x71'))](_0xb5fa('0x72'),0x193);}_0x23b70f=_0x32c191;return db[_0xb5fa('0x73')][_0xb5fa('0x45')]({'raw':!![]});}return null;})[_0xb5fa('0x25')](function(_0x1d307c){if(_0x1d307c){_0x488818=_[_0xb5fa('0x74')](_0x1d307c,'id');var _0x3347eb;var _0x349e0b=squel[_0xb5fa('0x75')]();_0x349e0b[_0xb5fa('0x8e')](_0x3c5ac4[_0xb5fa('0x76')]);for(var _0x2b1c3f=0x0;_0x2b1c3f<_0x23b70f[_0xb5fa('0x39')];_0x2b1c3f+=0x1){_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x77')]?_0x488818[_0x23b70f[_0x2b1c3f]['MetricId']]['metric']:_0x23b70f[_0x2b1c3f][_0xb5fa('0x6c')];_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]?_[_0xb5fa('0x79')](_0x105c0f[_0x23b70f[_0x2b1c3f][_0xb5fa('0x8f')]],'%s',_0x3347eb):_0x3347eb;_0x3347eb=_0x23b70f[_0x2b1c3f][_0xb5fa('0x7a')]?_[_0xb5fa('0x79')](_0x41e086[_0x23b70f[_0x2b1c3f]['format']],'%s',_0x3347eb):_0x3347eb;if(_0x23b70f[_0x2b1c3f]['groupBy']){_0x349e0b['group'](_0x3347eb);}_0x23b70f[_0x2b1c3f][_0xb5fa('0x7c')]&&_0x349e0b[_0xb5fa('0x90')](_0x3347eb,_0x23b70f[_0x2b1c3f]['orderBy']===_0xb5fa('0x7d')?![]:!![]);_0x349e0b[_0xb5fa('0x6c')](_0x3347eb,_0x23b70f[_0x2b1c3f]['alias']||_0x3347eb);}if(_0x3c5ac4[_0xb5fa('0x7f')]){_0x3c5ac4[_0xb5fa('0x7f')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x7f')]);for(var _0x10dbdf=0x0;_0x10dbdf<_0x3c5ac4[_0xb5fa('0x7f')][_0xb5fa('0x39')];_0x10dbdf+=0x1){if(_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['type']&&_[_0xb5fa('0x64')](_0x3ba723,_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x33')])&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')]&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable']&&_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x81')]){_0x349e0b[_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x33')]](_0x3c5ac4['joins'][_0x10dbdf][_0xb5fa('0x82')],null,util[_0xb5fa('0x7a')](_0xb5fa('0x83'),_0x3c5ac4[_0xb5fa('0x76')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf][_0xb5fa('0x80')],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignTable'],_0x3c5ac4[_0xb5fa('0x7f')][_0x10dbdf]['foreignKey']));}}}if(_0x3c5ac4[_0xb5fa('0x84')]){_0x3c5ac4[_0xb5fa('0x84')]=JSON[_0xb5fa('0x85')](_0x3c5ac4[_0xb5fa('0x84')]);_0x349e0b[_0xb5fa('0x3d')](_0x1aae82(_0x3c5ac4[_0xb5fa('0x84')][_0xb5fa('0x6b')]));}_0x42fd84=_0x349e0b['clone']();_0x349e0b['limit'](_0x5c1e1f);_0x349e0b[_0xb5fa('0x20')](0x0);logger[_0xb5fa('0x87')](_0xb5fa('0x88'),_0x349e0b[_0xb5fa('0x89')]());return dbH[_0xb5fa('0x8a')][_0xb5fa('0x3c')](_0x349e0b[_0xb5fa('0x89')](),{'type':dbH[_0xb5fa('0x8a')]['QueryTypes'][_0xb5fa('0x8c')]});}})[_0xb5fa('0x25')](function(){return{'sql':_0x42fd84[_0xb5fa('0x89')]()};})[_0xb5fa('0x25')](respondWithResult(_0x245ee1,null))[_0xb5fa('0x47')](handleError(_0x245ee1,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index ea1914a..ac2aa58 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.model.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x626a=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util'];(function(_0x492275,_0x44cb8b){var _0xe2777d=function(_0x30f0a2){while(--_0x30f0a2){_0x492275['push'](_0x492275['shift']());}};_0xe2777d(++_0x44cb8b);}(_0x626a,0x196));var _0xa626=function(_0x58a5cb,_0x366da2){_0x58a5cb=_0x58a5cb-0x0;var _0x55e749=_0x626a[_0x58a5cb];return _0x55e749;};'use strict';var _=require(_0xa626('0x0'));var util=require(_0xa626('0x1'));var logger=require('../../config/logger')(_0xa626('0x2'));var moment=require(_0xa626('0x3'));var BPromise=require('bluebird');var rp=require(_0xa626('0x4'));var fs=require('fs');var path=require(_0xa626('0x5'));var rimraf=require(_0xa626('0x6'));var config=require(_0xa626('0x7'));var attributes=require('./analyticDefaultReport.attributes');module[_0xa626('0x8')]=function(_0x40bcf6,_0xba9314){return _0x40bcf6[_0xa626('0x9')](_0xa626('0xa'),attributes,{'tableName':_0xa626('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x00f0=['analytics_default_reports','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','define','AnalyticDefaultReport'];(function(_0x4a543a,_0xb24670){var _0x3fdc45=function(_0x409a2d){while(--_0x409a2d){_0x4a543a['push'](_0x4a543a['shift']());}};_0x3fdc45(++_0xb24670);}(_0x00f0,0xe5));var _0x000f=function(_0x3785e4,_0xfa6027){_0x3785e4=_0x3785e4-0x0;var _0x3c66d2=_0x00f0[_0x3785e4];return _0x3c66d2;};'use strict';var _=require(_0x000f('0x0'));var util=require('util');var logger=require(_0x000f('0x1'))(_0x000f('0x2'));var moment=require('moment');var BPromise=require(_0x000f('0x3'));var rp=require(_0x000f('0x4'));var fs=require('fs');var path=require(_0x000f('0x5'));var rimraf=require(_0x000f('0x6'));var config=require(_0x000f('0x7'));var attributes=require(_0x000f('0x8'));module['exports']=function(_0x3608a8,_0x4e986a){return _0x3608a8[_0x000f('0x9')](_0x000f('0xa'),attributes,{'tableName':_0x000f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 866abd8..47bec05 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb6ed=['error','code','message','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3fc61e,_0x5b8599){var _0x58e101=function(_0x12066c){while(--_0x12066c){_0x3fc61e['push'](_0x3fc61e['shift']());}};_0x58e101(++_0x5b8599);}(_0xb6ed,0x17d));var _0xdb6e=function(_0x5ef8a4,_0x39e26a){_0x5ef8a4=_0x5ef8a4-0x0;var _0x1772ff=_0xb6ed[_0x5ef8a4];return _0x1772ff;};'use strict';var _=require(_0xdb6e('0x0'));var util=require(_0xdb6e('0x1'));var moment=require(_0xdb6e('0x2'));var BPromise=require(_0xdb6e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdb6e('0x4'));var db=require(_0xdb6e('0x5'))['db'];var utils=require(_0xdb6e('0x6'));var logger=require(_0xdb6e('0x7'))(_0xdb6e('0x8'));var config=require(_0xdb6e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdb6e('0xa')][_0xdb6e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5577d9,_0x36e203,_0x4732b2){return new BPromise(function(_0x30f168,_0x4d07d6){return client[_0xdb6e('0xc')](_0x5577d9,_0x4732b2)[_0xdb6e('0xd')](function(_0x1e8456){logger[_0xdb6e('0xe')](_0xdb6e('0xf'),_0x36e203,_0xdb6e('0x10'));logger[_0xdb6e('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x36e203,'request\x20sent',JSON['stringify'](_0x1e8456));if(_0x1e8456[_0xdb6e('0x12')]){if(_0x1e8456[_0xdb6e('0x12')][_0xdb6e('0x13')]===0x1f4){logger['error'](_0xdb6e('0xf'),_0x36e203,_0x1e8456[_0xdb6e('0x12')][_0xdb6e('0x14')]);return _0x4d07d6(_0x1e8456[_0xdb6e('0x12')][_0xdb6e('0x14')]);}logger[_0xdb6e('0x12')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x36e203,_0x1e8456[_0xdb6e('0x12')]['message']);return _0x30f168(_0x1e8456['error'][_0xdb6e('0x14')]);}else{logger[_0xdb6e('0xe')](_0xdb6e('0xf'),_0x36e203,_0xdb6e('0x10'));_0x30f168(_0x1e8456['result'][_0xdb6e('0x14')]);}})['catch'](function(_0x34b3be){logger[_0xdb6e('0x12')](_0xdb6e('0xf'),_0x36e203,_0x34b3be);_0x4d07d6(_0x34b3be);});});}
\ No newline at end of file
+var _0x3377=['../../config/utils','rpc','../../config/environment','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x3377,0x164));var _0x7337=function(_0x47590a,_0x3369bc){_0x47590a=_0x47590a-0x0;var _0x576ab3=_0x3377[_0x47590a];return _0x576ab3;};'use strict';var _=require(_0x7337('0x0'));var util=require(_0x7337('0x1'));var moment=require(_0x7337('0x2'));var BPromise=require('bluebird');var rs=require(_0x7337('0x3'));var fs=require('fs');var Redis=require(_0x7337('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7337('0x5'));var logger=require('../../config/logger')(_0x7337('0x6'));var config=require(_0x7337('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7337('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x192895,_0x1f1156,_0xbf990e){return new BPromise(function(_0x2d07ea,_0x406bf4){return client[_0x7337('0x9')](_0x192895,_0xbf990e)[_0x7337('0xa')](function(_0x7663a8){logger[_0x7337('0xb')](_0x7337('0xc'),_0x1f1156,_0x7337('0xd'));logger[_0x7337('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1f1156,_0x7337('0xd'),JSON['stringify'](_0x7663a8));if(_0x7663a8[_0x7337('0xf')]){if(_0x7663a8['error'][_0x7337('0x10')]===0x1f4){logger[_0x7337('0xf')](_0x7337('0xc'),_0x1f1156,_0x7663a8[_0x7337('0xf')]['message']);return _0x406bf4(_0x7663a8['error'][_0x7337('0x11')]);}logger[_0x7337('0xf')](_0x7337('0xc'),_0x1f1156,_0x7663a8[_0x7337('0xf')][_0x7337('0x11')]);return _0x2d07ea(_0x7663a8[_0x7337('0xf')][_0x7337('0x11')]);}else{logger[_0x7337('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1f1156,_0x7337('0xd'));_0x2d07ea(_0x7663a8['result']['message']);}})[_0x7337('0x12')](function(_0x200de9){logger[_0x7337('0xf')](_0x7337('0xc'),_0x1f1156,_0x200de9);_0x406bf4(_0x200de9);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 4e25035..9770a73 100644
--- a/server/api/analyticDefaultReport/index.js
+++ b/server/api/analyticDefaultReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcf71=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','/:id/query','query','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra'];(function(_0x13ca07,_0x22b8ef){var _0x48782e=function(_0x1c7850){while(--_0x1c7850){_0x13ca07['push'](_0x13ca07['shift']());}};_0x48782e(++_0x22b8ef);}(_0xcf71,0xba));var _0x1cf7=function(_0x533843,_0x3d5ec0){_0x533843=_0x533843-0x0;var _0x55a5f4=_0xcf71[_0x533843];return _0x55a5f4;};'use strict';var multer=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var path=require(_0x1cf7('0x2'));var timeout=require(_0x1cf7('0x3'));var express=require('express');var router=express[_0x1cf7('0x4')]();var fs_extra=require(_0x1cf7('0x5'));var auth=require(_0x1cf7('0x6'));var interaction=require(_0x1cf7('0x7'));var config=require(_0x1cf7('0x8'));var controller=require(_0x1cf7('0x9'));router[_0x1cf7('0xa')]('/',auth[_0x1cf7('0xb')](),controller[_0x1cf7('0xc')]);router[_0x1cf7('0xa')](_0x1cf7('0xd'),auth[_0x1cf7('0xb')](),controller['show']);router['get'](_0x1cf7('0xe'),auth[_0x1cf7('0xb')](),controller[_0x1cf7('0xf')]);router['get'](_0x1cf7('0x10'),auth['isAuthenticated'](),controller['run']);router[_0x1cf7('0xa')](_0x1cf7('0x11'),auth[_0x1cf7('0xb')](),controller[_0x1cf7('0x12')]);router[_0x1cf7('0x13')]('/',auth[_0x1cf7('0xb')](),controller['create']);router[_0x1cf7('0x14')]('/:id',auth[_0x1cf7('0xb')](),controller['update']);router[_0x1cf7('0x15')](_0x1cf7('0xd'),auth['isAuthenticated'](),controller[_0x1cf7('0x16')]);module[_0x1cf7('0x17')]=router;
\ No newline at end of file
+var _0x44fa=['/:id/query','query','post','create','put','/:id','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','show','preview','/:id/run','run'];(function(_0x1ef9e4,_0x4be134){var _0x1dcb4c=function(_0x21a6db){while(--_0x21a6db){_0x1ef9e4['push'](_0x1ef9e4['shift']());}};_0x1dcb4c(++_0x4be134);}(_0x44fa,0x68));var _0xa44f=function(_0x345660,_0x2d90a6){_0x345660=_0x345660-0x0;var _0x3b4601=_0x44fa[_0x345660];return _0x3b4601;};'use strict';var multer=require(_0xa44f('0x0'));var util=require(_0xa44f('0x1'));var path=require(_0xa44f('0x2'));var timeout=require(_0xa44f('0x3'));var express=require(_0xa44f('0x4'));var router=express[_0xa44f('0x5')]();var fs_extra=require(_0xa44f('0x6'));var auth=require(_0xa44f('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xa44f('0x8'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0xa44f('0x9')](),controller[_0xa44f('0xa')]);router[_0xa44f('0xb')]('/:id',auth[_0xa44f('0x9')](),controller[_0xa44f('0xc')]);router[_0xa44f('0xb')]('/:id/preview',auth[_0xa44f('0x9')](),controller[_0xa44f('0xd')]);router[_0xa44f('0xb')](_0xa44f('0xe'),auth[_0xa44f('0x9')](),controller[_0xa44f('0xf')]);router[_0xa44f('0xb')](_0xa44f('0x10'),auth[_0xa44f('0x9')](),controller[_0xa44f('0x11')]);router[_0xa44f('0x12')]('/',auth[_0xa44f('0x9')](),controller[_0xa44f('0x13')]);router[_0xa44f('0x14')](_0xa44f('0x15'),auth[_0xa44f('0x9')](),controller['update']);router[_0xa44f('0x16')](_0xa44f('0x15'),auth[_0xa44f('0x9')](),controller['destroy']);module[_0xa44f('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 31bed74..561ad9a 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70dd=['INTEGER','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','scheduled','manual'];(function(_0x20a68a,_0x54502e){var _0x56c5d4=function(_0x4ace56){while(--_0x4ace56){_0x20a68a['push'](_0x20a68a['shift']());}};_0x56c5d4(++_0x54502e);}(_0x70dd,0xe5));var _0xd70d=function(_0x3789f0,_0x30af4a){_0x3789f0=_0x3789f0-0x0;var _0x3486cc=_0x70dd[_0x3789f0];return _0x3486cc;};'use strict';var Sequelize=require(_0xd70d('0x0'));var moment=require(_0xd70d('0x1'));module[_0xd70d('0x2')]={'name':{'type':Sequelize[_0xd70d('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xd70d('0x4')](_0xd70d('0x5'),_0xd70d('0x6'),_0xd70d('0x7')),'allowNull':![],'defaultValue':_0xd70d('0x5')},'savename':{'type':Sequelize[_0xd70d('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0xd70d('0x8')]},'endDate':{'type':Sequelize[_0xd70d('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xd70d('0x4')]('manual',_0xd70d('0x9')),'allowNull':![],'defaultValue':_0xd70d('0xa')},'reportId':{'type':Sequelize[_0xd70d('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xd846=['moment','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x23e6d6,_0x1be04f){var _0xa8469b=function(_0x573263){while(--_0x573263){_0x23e6d6['push'](_0x23e6d6['shift']());}};_0xa8469b(++_0x1be04f);}(_0xd846,0x1c3));var _0x6d84=function(_0x65b116,_0x417a2d){_0x65b116=_0x65b116-0x0;var _0x3c7274=_0xd846[_0x65b116];return _0x3c7274;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x6d84('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x6d84('0x1')],'allowNull':![]},'output':{'type':Sequelize[_0x6d84('0x2')]('csv',_0x6d84('0x3'),_0x6d84('0x4')),'allowNull':![],'defaultValue':_0x6d84('0x5')},'savename':{'type':Sequelize[_0x6d84('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x6d84('0x6')]},'endDate':{'type':Sequelize[_0x6d84('0x6')]},'status':{'type':Sequelize[_0x6d84('0x1')],'defaultValue':_0x6d84('0x7')},'type':{'type':Sequelize[_0x6d84('0x2')](_0x6d84('0x8'),_0x6d84('0x9')),'allowNull':![],'defaultValue':_0x6d84('0x8')},'reportId':{'type':Sequelize[_0x6d84('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x6d84('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index eb32715..a406b43 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6ef5=['json','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','include','rows','catch','params','includeAll','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','savename','existsSync','root','Sequelize','ValidationError','sendStatus','join','server/files/reports','format','%s.%s','output','toLowerCase','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','end','status','offset','undefined','limit','count','set'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x6ef5,0xfe));var _0x56ef=function(_0x453c4e,_0x4cc709){_0x453c4e=_0x453c4e-0x0;var _0x4aaa99=_0x6ef5[_0x453c4e];return _0x4aaa99;};'use strict';var emlformat=require(_0x56ef('0x0'));var rimraf=require(_0x56ef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x56ef('0x2'));var rp=require('request-promise');var moment=require(_0x56ef('0x3'));var BPromise=require(_0x56ef('0x4'));var Mustache=require(_0x56ef('0x5'));var util=require('util');var path=require(_0x56ef('0x6'));var sox=require(_0x56ef('0x7'));var csv=require(_0x56ef('0x8'));var ejs=require(_0x56ef('0x9'));var fs=require('fs');var fs_extra=require(_0x56ef('0xa'));var _=require(_0x56ef('0xb'));var squel=require(_0x56ef('0xc'));var crypto=require(_0x56ef('0xd'));var jsforce=require(_0x56ef('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x56ef('0xf'));var Papa=require(_0x56ef('0x10'));var Redis=require(_0x56ef('0x11'));var authService=require(_0x56ef('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x56ef('0x13'));var hardwareService=require(_0x56ef('0x14'));var logger=require('../../config/logger')(_0x56ef('0x15'));var utils=require('../../config/utils');var config=require(_0x56ef('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x56ef('0x17'))['db'];function respondWithStatusCode(_0x28d751,_0xaa0b97){_0xaa0b97=_0xaa0b97||0xcc;return function(_0x2070f9){if(_0x2070f9){return _0x28d751['sendStatus'](_0xaa0b97);}return _0x28d751['status'](_0xaa0b97)[_0x56ef('0x18')]();};}function respondWithResult(_0x5a5915,_0x155718){_0x155718=_0x155718||0xc8;return function(_0x52a9e8){if(_0x52a9e8){return _0x5a5915[_0x56ef('0x19')](_0x155718)['json'](_0x52a9e8);}};}function respondWithFilteredResult(_0x34c068,_0x259c98){return function(_0x4c5f71){if(_0x4c5f71){var _0x3307e7=typeof _0x259c98[_0x56ef('0x1a')]===_0x56ef('0x1b')&&typeof _0x259c98[_0x56ef('0x1c')]===_0x56ef('0x1b');var _0x32d4ba=_0x4c5f71[_0x56ef('0x1d')];var _0xccfdd6=_0x3307e7?0x0:_0x259c98[_0x56ef('0x1a')];var _0x22e97e=_0x3307e7?_0x4c5f71[_0x56ef('0x1d')]:_0x259c98[_0x56ef('0x1a')]+_0x259c98['limit'];var _0xabb79b;if(_0x22e97e>=_0x32d4ba){_0x22e97e=_0x32d4ba;_0xabb79b=0xc8;}else{_0xabb79b=0xce;}_0x34c068['status'](_0xabb79b);return _0x34c068[_0x56ef('0x1e')]('Content-Range',_0xccfdd6+'-'+_0x22e97e+'/'+_0x32d4ba)[_0x56ef('0x1f')](_0x4c5f71);}return null;};}function patchUpdates(_0x3d7905){return function(_0x4054ac){try{jsonpatch[_0x56ef('0x20')](_0x4054ac,_0x3d7905,!![]);}catch(_0x16275a){return BPromise[_0x56ef('0x21')](_0x16275a);}return _0x4054ac['save']();};}function saveUpdates(_0x4808ad,_0x3af7eb){return function(_0x4fed25){if(_0x4fed25){return _0x4fed25[_0x56ef('0x22')](_0x4808ad)[_0x56ef('0x23')](function(_0x151bfd){return _0x151bfd;});}return null;};}function removeEntity(_0xbba6f,_0x3e1946){return function(_0x38378a){if(_0x38378a){return _0x38378a[_0x56ef('0x24')]()['then'](function(){var _0x54dafb=_0x38378a[_0x56ef('0x25')]({'plain':!![]});var _0x55026e='ExtractedReports';return db[_0x56ef('0x26')][_0x56ef('0x24')]({'where':{'type':_0x55026e,'resourceId':_0x54dafb['id']}})[_0x56ef('0x23')](function(){return _0x38378a;});})[_0x56ef('0x23')](function(){_0xbba6f[_0x56ef('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4589fe,_0xda6fc3){return function(_0x33446d){if(!_0x33446d){_0x4589fe['sendStatus'](0x194);}return _0x33446d;};}function handleError(_0x2689f6,_0x32d4b6){_0x32d4b6=_0x32d4b6||0x1f4;return function(_0x4fe908){logger[_0x56ef('0x27')](_0x4fe908[_0x56ef('0x28')]);if(_0x4fe908[_0x56ef('0x29')]){delete _0x4fe908['name'];}_0x2689f6[_0x56ef('0x19')](_0x32d4b6)[_0x56ef('0x2a')](_0x4fe908);};}exports[_0x56ef('0x2b')]=function(_0x581719,_0x118b24){var _0x24aa29={},_0x219d4c={},_0x354f8e={'count':0x0,'rows':[]};var _0x683ab2=_['map'](db[_0x56ef('0x2c')][_0x56ef('0x2d')],function(_0x40e57c){return{'name':_0x40e57c[_0x56ef('0x2e')],'type':_0x40e57c[_0x56ef('0x2f')][_0x56ef('0x30')]};});_0x219d4c[_0x56ef('0x31')]=_[_0x56ef('0x32')](_0x683ab2,'name');_0x219d4c[_0x56ef('0x33')]=_[_0x56ef('0x34')](_0x581719[_0x56ef('0x33')]);_0x219d4c['filters']=_['intersection'](_0x219d4c[_0x56ef('0x31')],_0x219d4c['query']);_0x24aa29['attributes']=_[_0x56ef('0x35')](_0x219d4c['model'],qs[_0x56ef('0x36')](_0x581719[_0x56ef('0x33')][_0x56ef('0x36')]));_0x24aa29[_0x56ef('0x37')]=_0x24aa29[_0x56ef('0x37')][_0x56ef('0x38')]?_0x24aa29[_0x56ef('0x37')]:_0x219d4c['model'];if(!_0x581719[_0x56ef('0x33')][_0x56ef('0x39')](_0x56ef('0x3a'))){_0x24aa29[_0x56ef('0x1c')]=qs['limit'](_0x581719['query'][_0x56ef('0x1c')]);_0x24aa29['offset']=qs[_0x56ef('0x1a')](_0x581719[_0x56ef('0x33')][_0x56ef('0x1a')]);}_0x24aa29[_0x56ef('0x3b')]=qs['sort'](_0x581719[_0x56ef('0x33')][_0x56ef('0x3c')]);_0x24aa29[_0x56ef('0x3d')]=qs[_0x56ef('0x3e')](_[_0x56ef('0x3f')](_0x581719['query'],_0x219d4c[_0x56ef('0x3e')]),_0x683ab2);if(_0x581719[_0x56ef('0x33')]['filter']){_0x24aa29[_0x56ef('0x3d')]=_['merge'](_0x24aa29['where'],{'$or':_[_0x56ef('0x32')](_0x683ab2,function(_0x256e59){if(_0x256e59[_0x56ef('0x2f')]!=='VIRTUAL'){var _0x17f9ce={};_0x17f9ce[_0x256e59[_0x56ef('0x29')]]={'$like':'%'+_0x581719['query'][_0x56ef('0x40')]+'%'};return _0x17f9ce;}})});}_0x24aa29=_[_0x56ef('0x41')]({},_0x24aa29,_0x581719['options']);var _0x417778={'where':_0x24aa29['where']};return db[_0x56ef('0x2c')][_0x56ef('0x1d')](_0x417778)[_0x56ef('0x23')](function(_0x5a5a69){_0x354f8e['count']=_0x5a5a69;if(_0x581719[_0x56ef('0x33')]['includeAll']){_0x24aa29[_0x56ef('0x42')]=[{'all':!![]}];}return db[_0x56ef('0x2c')]['findAll'](_0x24aa29);})[_0x56ef('0x23')](function(_0xff76e7){_0x354f8e[_0x56ef('0x43')]=_0xff76e7;return _0x354f8e;})[_0x56ef('0x23')](respondWithFilteredResult(_0x118b24,_0x24aa29))[_0x56ef('0x44')](handleError(_0x118b24,null));};exports['show']=function(_0x7228cc,_0x2c9cb5){var _0x35e900={'raw':!![],'where':{'id':_0x7228cc[_0x56ef('0x45')]['id']}},_0x4c226c={};_0x4c226c[_0x56ef('0x31')]=_[_0x56ef('0x34')](db[_0x56ef('0x2c')][_0x56ef('0x2d')]);_0x4c226c[_0x56ef('0x33')]=_[_0x56ef('0x34')](_0x7228cc[_0x56ef('0x33')]);_0x4c226c[_0x56ef('0x3e')]=_[_0x56ef('0x35')](_0x4c226c[_0x56ef('0x31')],_0x4c226c['query']);_0x35e900[_0x56ef('0x37')]=_[_0x56ef('0x35')](_0x4c226c['model'],qs['fields'](_0x7228cc[_0x56ef('0x33')][_0x56ef('0x36')]));_0x35e900[_0x56ef('0x37')]=_0x35e900['attributes'][_0x56ef('0x38')]?_0x35e900['attributes']:_0x4c226c['model'];if(_0x7228cc['query'][_0x56ef('0x46')]){_0x35e900[_0x56ef('0x42')]=[{'all':!![]}];}_0x35e900=_['merge']({},_0x35e900,_0x7228cc[_0x56ef('0x47')]);return db[_0x56ef('0x2c')][_0x56ef('0x48')](_0x35e900)['then'](handleEntityNotFound(_0x2c9cb5,null))[_0x56ef('0x23')](respondWithResult(_0x2c9cb5,null))[_0x56ef('0x44')](handleError(_0x2c9cb5,null));};exports[_0x56ef('0x49')]=function(_0x3ac98e,_0x593ff9){return db['AnalyticExtractedReport']['create'](_0x3ac98e[_0x56ef('0x4a')],{})[_0x56ef('0x23')](function(_0x3b6970){var _0x145b86=_0x3ac98e[_0x56ef('0x4b')][_0x56ef('0x25')]({'plain':!![]});if(!_0x145b86)throw new Error(_0x56ef('0x4c'));if(_0x145b86[_0x56ef('0x4d')]===_0x56ef('0x4b')){var _0x4c0d2e=_0x3b6970[_0x56ef('0x25')]({'plain':!![]});var _0x461b45=_0x56ef('0x4e');return db['UserProfileSection'][_0x56ef('0x48')]({'where':{'name':_0x461b45,'userProfileId':_0x145b86[_0x56ef('0x4f')]},'raw':!![]})[_0x56ef('0x23')](function(_0x33c4df){if(_0x33c4df&&_0x33c4df['autoAssociation']===0x0){return db['UserProfileResource'][_0x56ef('0x49')]({'name':_0x4c0d2e[_0x56ef('0x29')],'resourceId':_0x4c0d2e['id'],'type':_0x33c4df[_0x56ef('0x29')],'sectionId':_0x33c4df['id']},{})['then'](function(){return _0x3b6970;});}else{return _0x3b6970;}})[_0x56ef('0x44')](function(_0x26c5eb){logger[_0x56ef('0x27')](_0x56ef('0x50'),_0x26c5eb);throw _0x26c5eb;});}return _0x3b6970;})[_0x56ef('0x23')](respondWithResult(_0x593ff9,0xc9))[_0x56ef('0x44')](handleError(_0x593ff9,null));};exports[_0x56ef('0x22')]=function(_0x2229fe,_0x4c60a3){if(_0x2229fe['body']['id']){delete _0x2229fe[_0x56ef('0x4a')]['id'];}return db['AnalyticExtractedReport'][_0x56ef('0x48')]({'where':{'id':_0x2229fe[_0x56ef('0x45')]['id']}})[_0x56ef('0x23')](handleEntityNotFound(_0x4c60a3,null))[_0x56ef('0x23')](saveUpdates(_0x2229fe[_0x56ef('0x4a')],null))[_0x56ef('0x23')](respondWithResult(_0x4c60a3,null))['catch'](handleError(_0x4c60a3,null));};exports['destroy']=function(_0x46fbb1,_0x14c193){return db[_0x56ef('0x2c')][_0x56ef('0x48')]({'where':{'id':_0x46fbb1[_0x56ef('0x45')]['id']}})[_0x56ef('0x23')](handleEntityNotFound(_0x14c193,null))[_0x56ef('0x23')](removeEntity(_0x14c193,null))[_0x56ef('0x44')](handleError(_0x14c193,null));};exports[_0x56ef('0x51')]=function(_0x2684a7,_0x1aeb93,_0xf4b9ca){return db[_0x56ef('0x2c')][_0x56ef('0x48')]({'where':{'id':_0x2684a7[_0x56ef('0x45')]['id']},'attributes':[_0x56ef('0x29'),_0x56ef('0x52'),_0x56ef('0x53'),'output'],'raw':!![]})['then'](handleEntityNotFound(_0x1aeb93,null))['then'](function(_0x31f042){if(_0x31f042){if(!fs[_0x56ef('0x54')](path['join'](config[_0x56ef('0x55')],'server/files/reports',_0x31f042['savename']))){throw new db[(_0x56ef('0x56'))][(_0x56ef('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x2684a7['query']['exists']){return _0x1aeb93[_0x56ef('0x58')](0xc8);}return _0x1aeb93[_0x56ef('0x51')](path[_0x56ef('0x59')](config[_0x56ef('0x55')],_0x56ef('0x5a'),_0x31f042[_0x56ef('0x53')]),util[_0x56ef('0x5b')](_0x56ef('0x5c'),_0x31f042[_0x56ef('0x52')]||_0x31f042[_0x56ef('0x29')],_0x31f042[_0x56ef('0x5d')][_0x56ef('0x5e')]()));}})['catch'](handleError(_0x1aeb93,null));};
\ No newline at end of file
+var _0xcbbf=['fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','AnalyticExtractedReport','includeAll','findAll','rows','catch','show','fields','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','download','basename','output','existsSync','join','savename','ValidationError','exists','root','server/files/reports','format','%s.%s','toLowerCase','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','get','ExtractedReports','UserProfileResource','stack','name','map','rawAttributes'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcbbf,0x156));var _0xfcbb=function(_0x51208e,_0x30cc15){_0x51208e=_0x51208e-0x0;var _0x11dc15=_0xcbbf[_0x51208e];return _0x11dc15;};'use strict';var emlformat=require(_0xfcbb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfcbb('0x1'));var jsonpatch=require(_0xfcbb('0x2'));var rp=require('request-promise');var moment=require(_0xfcbb('0x3'));var BPromise=require(_0xfcbb('0x4'));var Mustache=require(_0xfcbb('0x5'));var util=require('util');var path=require(_0xfcbb('0x6'));var sox=require(_0xfcbb('0x7'));var csv=require(_0xfcbb('0x8'));var ejs=require(_0xfcbb('0x9'));var fs=require('fs');var fs_extra=require(_0xfcbb('0xa'));var _=require(_0xfcbb('0xb'));var squel=require(_0xfcbb('0xc'));var crypto=require('crypto');var jsforce=require(_0xfcbb('0xd'));var deskjs=require(_0xfcbb('0xe'));var toCsv=require(_0xfcbb('0x8'));var querystring=require(_0xfcbb('0xf'));var Papa=require(_0xfcbb('0x10'));var Redis=require(_0xfcbb('0x11'));var authService=require(_0xfcbb('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xfcbb('0x13'));var hardwareService=require(_0xfcbb('0x14'));var logger=require(_0xfcbb('0x15'))(_0xfcbb('0x16'));var utils=require(_0xfcbb('0x17'));var config=require(_0xfcbb('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xfcbb('0x19'))['db'];function respondWithStatusCode(_0x139bb1,_0x301f64){_0x301f64=_0x301f64||0xcc;return function(_0x57594f){if(_0x57594f){return _0x139bb1[_0xfcbb('0x1a')](_0x301f64);}return _0x139bb1[_0xfcbb('0x1b')](_0x301f64)[_0xfcbb('0x1c')]();};}function respondWithResult(_0xb76a3,_0x43269b){_0x43269b=_0x43269b||0xc8;return function(_0x404c23){if(_0x404c23){return _0xb76a3[_0xfcbb('0x1b')](_0x43269b)[_0xfcbb('0x1d')](_0x404c23);}};}function respondWithFilteredResult(_0x53cd42,_0x40849c){return function(_0x3a96bf){if(_0x3a96bf){var _0xb54303=typeof _0x40849c[_0xfcbb('0x1e')]===_0xfcbb('0x1f')&&typeof _0x40849c[_0xfcbb('0x20')]===_0xfcbb('0x1f');var _0x4605f9=_0x3a96bf['count'];var _0x5d8c0e=_0xb54303?0x0:_0x40849c[_0xfcbb('0x1e')];var _0x494550=_0xb54303?_0x3a96bf[_0xfcbb('0x21')]:_0x40849c['offset']+_0x40849c[_0xfcbb('0x20')];var _0x1485ab;if(_0x494550>=_0x4605f9){_0x494550=_0x4605f9;_0x1485ab=0xc8;}else{_0x1485ab=0xce;}_0x53cd42[_0xfcbb('0x1b')](_0x1485ab);return _0x53cd42[_0xfcbb('0x22')](_0xfcbb('0x23'),_0x5d8c0e+'-'+_0x494550+'/'+_0x4605f9)['json'](_0x3a96bf);}return null;};}function patchUpdates(_0x45544e){return function(_0x1c9827){try{jsonpatch['apply'](_0x1c9827,_0x45544e,!![]);}catch(_0x42b6b8){return BPromise[_0xfcbb('0x24')](_0x42b6b8);}return _0x1c9827[_0xfcbb('0x25')]();};}function saveUpdates(_0x3203ab,_0x18b70a){return function(_0x49b353){if(_0x49b353){return _0x49b353['update'](_0x3203ab)['then'](function(_0x145c9b){return _0x145c9b;});}return null;};}function removeEntity(_0x401459,_0x3601f9){return function(_0xb7e4b7){if(_0xb7e4b7){return _0xb7e4b7['destroy']()[_0xfcbb('0x26')](function(){var _0xd35ac5=_0xb7e4b7[_0xfcbb('0x27')]({'plain':!![]});var _0xc3e951=_0xfcbb('0x28');return db[_0xfcbb('0x29')]['destroy']({'where':{'type':_0xc3e951,'resourceId':_0xd35ac5['id']}})['then'](function(){return _0xb7e4b7;});})[_0xfcbb('0x26')](function(){_0x401459[_0xfcbb('0x1b')](0xcc)[_0xfcbb('0x1c')]();});}};}function handleEntityNotFound(_0x117544,_0x1d7d91){return function(_0x2af2a3){if(!_0x2af2a3){_0x117544[_0xfcbb('0x1a')](0x194);}return _0x2af2a3;};}function handleError(_0x1f9e2e,_0x2e802c){_0x2e802c=_0x2e802c||0x1f4;return function(_0x1d2910){logger['error'](_0x1d2910[_0xfcbb('0x2a')]);if(_0x1d2910['name']){delete _0x1d2910[_0xfcbb('0x2b')];}_0x1f9e2e[_0xfcbb('0x1b')](_0x2e802c)['send'](_0x1d2910);};}exports['index']=function(_0x131d6a,_0x3ddafa){var _0x3ae130={},_0x341f33={},_0x21aed5={'count':0x0,'rows':[]};var _0x5488de=_[_0xfcbb('0x2c')](db['AnalyticExtractedReport'][_0xfcbb('0x2d')],function(_0x59d01a){return{'name':_0x59d01a[_0xfcbb('0x2e')],'type':_0x59d01a[_0xfcbb('0x2f')][_0xfcbb('0x30')]};});_0x341f33[_0xfcbb('0x31')]=_[_0xfcbb('0x2c')](_0x5488de,_0xfcbb('0x2b'));_0x341f33[_0xfcbb('0x32')]=_[_0xfcbb('0x33')](_0x131d6a[_0xfcbb('0x32')]);_0x341f33[_0xfcbb('0x34')]=_[_0xfcbb('0x35')](_0x341f33[_0xfcbb('0x31')],_0x341f33['query']);_0x3ae130[_0xfcbb('0x36')]=_['intersection'](_0x341f33[_0xfcbb('0x31')],qs['fields'](_0x131d6a[_0xfcbb('0x32')]['fields']));_0x3ae130[_0xfcbb('0x36')]=_0x3ae130[_0xfcbb('0x36')][_0xfcbb('0x37')]?_0x3ae130['attributes']:_0x341f33[_0xfcbb('0x31')];if(!_0x131d6a[_0xfcbb('0x32')][_0xfcbb('0x38')]('nolimit')){_0x3ae130[_0xfcbb('0x20')]=qs[_0xfcbb('0x20')](_0x131d6a[_0xfcbb('0x32')]['limit']);_0x3ae130['offset']=qs['offset'](_0x131d6a[_0xfcbb('0x32')][_0xfcbb('0x1e')]);}_0x3ae130['order']=qs[_0xfcbb('0x39')](_0x131d6a['query'][_0xfcbb('0x39')]);_0x3ae130['where']=qs[_0xfcbb('0x34')](_[_0xfcbb('0x3a')](_0x131d6a[_0xfcbb('0x32')],_0x341f33[_0xfcbb('0x34')]),_0x5488de);if(_0x131d6a[_0xfcbb('0x32')][_0xfcbb('0x3b')]){_0x3ae130[_0xfcbb('0x3c')]=_['merge'](_0x3ae130[_0xfcbb('0x3c')],{'$or':_[_0xfcbb('0x2c')](_0x5488de,function(_0x4e93e1){if(_0x4e93e1[_0xfcbb('0x2f')]!==_0xfcbb('0x3d')){var _0x57f796={};_0x57f796[_0x4e93e1[_0xfcbb('0x2b')]]={'$like':'%'+_0x131d6a[_0xfcbb('0x32')][_0xfcbb('0x3b')]+'%'};return _0x57f796;}})});}_0x3ae130=_['merge']({},_0x3ae130,_0x131d6a[_0xfcbb('0x3e')]);var _0x4cb4f1={'where':_0x3ae130['where']};return db[_0xfcbb('0x3f')]['count'](_0x4cb4f1)[_0xfcbb('0x26')](function(_0x41514f){_0x21aed5[_0xfcbb('0x21')]=_0x41514f;if(_0x131d6a[_0xfcbb('0x32')][_0xfcbb('0x40')]){_0x3ae130['include']=[{'all':!![]}];}return db[_0xfcbb('0x3f')][_0xfcbb('0x41')](_0x3ae130);})[_0xfcbb('0x26')](function(_0x4c6041){_0x21aed5[_0xfcbb('0x42')]=_0x4c6041;return _0x21aed5;})[_0xfcbb('0x26')](respondWithFilteredResult(_0x3ddafa,_0x3ae130))[_0xfcbb('0x43')](handleError(_0x3ddafa,null));};exports[_0xfcbb('0x44')]=function(_0x31896a,_0x166de5){var _0x1ef719={'raw':!![],'where':{'id':_0x31896a['params']['id']}},_0x5c3e11={};_0x5c3e11[_0xfcbb('0x31')]=_[_0xfcbb('0x33')](db[_0xfcbb('0x3f')][_0xfcbb('0x2d')]);_0x5c3e11[_0xfcbb('0x32')]=_[_0xfcbb('0x33')](_0x31896a['query']);_0x5c3e11[_0xfcbb('0x34')]=_[_0xfcbb('0x35')](_0x5c3e11['model'],_0x5c3e11[_0xfcbb('0x32')]);_0x1ef719[_0xfcbb('0x36')]=_[_0xfcbb('0x35')](_0x5c3e11[_0xfcbb('0x31')],qs[_0xfcbb('0x45')](_0x31896a[_0xfcbb('0x32')][_0xfcbb('0x45')]));_0x1ef719[_0xfcbb('0x36')]=_0x1ef719[_0xfcbb('0x36')][_0xfcbb('0x37')]?_0x1ef719['attributes']:_0x5c3e11[_0xfcbb('0x31')];if(_0x31896a[_0xfcbb('0x32')][_0xfcbb('0x40')]){_0x1ef719[_0xfcbb('0x46')]=[{'all':!![]}];}_0x1ef719=_['merge']({},_0x1ef719,_0x31896a[_0xfcbb('0x3e')]);return db['AnalyticExtractedReport'][_0xfcbb('0x47')](_0x1ef719)[_0xfcbb('0x26')](handleEntityNotFound(_0x166de5,null))[_0xfcbb('0x26')](respondWithResult(_0x166de5,null))[_0xfcbb('0x43')](handleError(_0x166de5,null));};exports['create']=function(_0x4abc5f,_0x5e335c){return db[_0xfcbb('0x3f')][_0xfcbb('0x48')](_0x4abc5f['body'],{})[_0xfcbb('0x26')](function(_0x3133aa){var _0x4aead5=_0x4abc5f[_0xfcbb('0x49')][_0xfcbb('0x27')]({'plain':!![]});if(!_0x4aead5)throw new Error(_0xfcbb('0x4a'));if(_0x4aead5[_0xfcbb('0x4b')]==='user'){var _0xa3f7d2=_0x3133aa[_0xfcbb('0x27')]({'plain':!![]});var _0x3c24ce=_0xfcbb('0x28');return db[_0xfcbb('0x4c')][_0xfcbb('0x47')]({'where':{'name':_0x3c24ce,'userProfileId':_0x4aead5[_0xfcbb('0x4d')]},'raw':!![]})[_0xfcbb('0x26')](function(_0x420e06){if(_0x420e06&&_0x420e06[_0xfcbb('0x4e')]===0x0){return db[_0xfcbb('0x29')][_0xfcbb('0x48')]({'name':_0xa3f7d2[_0xfcbb('0x2b')],'resourceId':_0xa3f7d2['id'],'type':_0x420e06[_0xfcbb('0x2b')],'sectionId':_0x420e06['id']},{})[_0xfcbb('0x26')](function(){return _0x3133aa;});}else{return _0x3133aa;}})[_0xfcbb('0x43')](function(_0x5bcf92){logger[_0xfcbb('0x4f')](_0xfcbb('0x50'),_0x5bcf92);throw _0x5bcf92;});}return _0x3133aa;})[_0xfcbb('0x26')](respondWithResult(_0x5e335c,0xc9))[_0xfcbb('0x43')](handleError(_0x5e335c,null));};exports[_0xfcbb('0x51')]=function(_0x21bdb1,_0x334dd8){if(_0x21bdb1[_0xfcbb('0x52')]['id']){delete _0x21bdb1[_0xfcbb('0x52')]['id'];}return db['AnalyticExtractedReport'][_0xfcbb('0x47')]({'where':{'id':_0x21bdb1[_0xfcbb('0x53')]['id']}})['then'](handleEntityNotFound(_0x334dd8,null))[_0xfcbb('0x26')](saveUpdates(_0x21bdb1[_0xfcbb('0x52')],null))['then'](respondWithResult(_0x334dd8,null))[_0xfcbb('0x43')](handleError(_0x334dd8,null));};exports['destroy']=function(_0x1bb980,_0x2ff169){return db[_0xfcbb('0x3f')]['find']({'where':{'id':_0x1bb980[_0xfcbb('0x53')]['id']}})['then'](handleEntityNotFound(_0x2ff169,null))[_0xfcbb('0x26')](removeEntity(_0x2ff169,null))['catch'](handleError(_0x2ff169,null));};exports[_0xfcbb('0x54')]=function(_0x445a8d,_0x2b2ba9,_0x2e6cb6){return db[_0xfcbb('0x3f')][_0xfcbb('0x47')]({'where':{'id':_0x445a8d['params']['id']},'attributes':[_0xfcbb('0x2b'),_0xfcbb('0x55'),'savename',_0xfcbb('0x56')],'raw':!![]})[_0xfcbb('0x26')](handleEntityNotFound(_0x2b2ba9,null))[_0xfcbb('0x26')](function(_0x26038b){if(_0x26038b){if(!fs[_0xfcbb('0x57')](path[_0xfcbb('0x58')](config['root'],'server/files/reports',_0x26038b[_0xfcbb('0x59')]))){throw new db['Sequelize'][(_0xfcbb('0x5a'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x445a8d[_0xfcbb('0x32')][_0xfcbb('0x5b')]){return _0x2b2ba9[_0xfcbb('0x1a')](0xc8);}return _0x2b2ba9[_0xfcbb('0x54')](path['join'](config[_0xfcbb('0x5c')],_0xfcbb('0x5d'),_0x26038b[_0xfcbb('0x59')]),util[_0xfcbb('0x5e')](_0xfcbb('0x5f'),_0x26038b[_0xfcbb('0x55')]||_0x26038b[_0xfcbb('0x2b')],_0x26038b['output'][_0xfcbb('0x60')]()));}})[_0xfcbb('0x43')](handleError(_0x2b2ba9,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index ea0ead5..cc5f0d8 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.model.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb3fa=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','analytics_extracted_reports','api','moment'];(function(_0x71e493,_0x4308b7){var _0x3d40ab=function(_0x29715){while(--_0x29715){_0x71e493['push'](_0x71e493['shift']());}};_0x3d40ab(++_0x4308b7);}(_0xb3fa,0xda));var _0xab3f=function(_0x33f9bb,_0x57740e){_0x33f9bb=_0x33f9bb-0x0;var _0x1ead6d=_0xb3fa[_0x33f9bb];return _0x1ead6d;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0xab3f('0x0'));var moment=require(_0xab3f('0x1'));var BPromise=require(_0xab3f('0x2'));var rp=require(_0xab3f('0x3'));var fs=require('fs');var path=require(_0xab3f('0x4'));var rimraf=require(_0xab3f('0x5'));var config=require(_0xab3f('0x6'));var attributes=require(_0xab3f('0x7'));module[_0xab3f('0x8')]=function(_0x3c0781,_0x1a6048){return _0x3c0781['define']('AnalyticExtractedReport',attributes,{'tableName':_0xab3f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd597=['path','rimraf','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash','util','api','moment','bluebird'];(function(_0x5d491a,_0x46fe1b){var _0x31b402=function(_0x14854e){while(--_0x14854e){_0x5d491a['push'](_0x5d491a['shift']());}};_0x31b402(++_0x46fe1b);}(_0xd597,0x119));var _0x7d59=function(_0x407885,_0x43907d){_0x407885=_0x407885-0x0;var _0x2c9a72=_0xd597[_0x407885];return _0x2c9a72;};'use strict';var _=require(_0x7d59('0x0'));var util=require(_0x7d59('0x1'));var logger=require('../../config/logger')(_0x7d59('0x2'));var moment=require(_0x7d59('0x3'));var BPromise=require(_0x7d59('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d59('0x5'));var rimraf=require(_0x7d59('0x6'));var config=require('../../config/environment');var attributes=require(_0x7d59('0x7'));module[_0x7d59('0x8')]=function(_0x2d6eae,_0x56732f){return _0x2d6eae[_0x7d59('0x9')](_0x7d59('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index d19a91d..214c0b4 100644
--- a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
+++ b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe764=['client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xe764,0x85));var _0x4e76=function(_0x4c5a90,_0x39edaf){_0x4c5a90=_0x4c5a90-0x0;var _0x8e83e8=_0xe764[_0x4c5a90];return _0x8e83e8;};'use strict';var _=require(_0x4e76('0x0'));var util=require(_0x4e76('0x1'));var moment=require(_0x4e76('0x2'));var BPromise=require('bluebird');var rs=require(_0x4e76('0x3'));var fs=require('fs');var Redis=require(_0x4e76('0x4'));var db=require(_0x4e76('0x5'))['db'];var utils=require(_0x4e76('0x6'));var logger=require(_0x4e76('0x7'))(_0x4e76('0x8'));var config=require(_0x4e76('0x9'));var jayson=require(_0x4e76('0xa'));var client=jayson[_0x4e76('0xb')][_0x4e76('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4cf943,_0x1d3ebe,_0x4f9f3f){return new BPromise(function(_0x4e2d37,_0x46e59f){return client[_0x4e76('0xd')](_0x4cf943,_0x4f9f3f)[_0x4e76('0xe')](function(_0xf47aae){logger['info'](_0x4e76('0xf'),_0x1d3ebe,_0x4e76('0x10'));logger[_0x4e76('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x1d3ebe,_0x4e76('0x10'),JSON[_0x4e76('0x12')](_0xf47aae));if(_0xf47aae[_0x4e76('0x13')]){if(_0xf47aae[_0x4e76('0x13')]['code']===0x1f4){logger[_0x4e76('0x13')](_0x4e76('0xf'),_0x1d3ebe,_0xf47aae[_0x4e76('0x13')]['message']);return _0x46e59f(_0xf47aae['error'][_0x4e76('0x14')]);}logger[_0x4e76('0x13')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d3ebe,_0xf47aae[_0x4e76('0x13')][_0x4e76('0x14')]);return _0x4e2d37(_0xf47aae[_0x4e76('0x13')]['message']);}else{logger[_0x4e76('0x15')](_0x4e76('0xf'),_0x1d3ebe,'request\x20sent');_0x4e2d37(_0xf47aae[_0x4e76('0x16')][_0x4e76('0x14')]);}})[_0x4e76('0x17')](function(_0x5b9c99){logger[_0x4e76('0x13')](_0x4e76('0xf'),_0x1d3ebe,_0x5b9c99);_0x46e59f(_0x5b9c99);});});}
\ No newline at end of file
+var _0xa72e=['then','info','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x4dca07,_0x21eac1){var _0x11dcac=function(_0x5420e6){while(--_0x5420e6){_0x4dca07['push'](_0x4dca07['shift']());}};_0x11dcac(++_0x21eac1);}(_0xa72e,0x150));var _0xea72=function(_0x3e68f2,_0x5e7bf7){_0x3e68f2=_0x3e68f2-0x0;var _0x18718b=_0xa72e[_0x3e68f2];return _0x18718b;};'use strict';var _=require(_0xea72('0x0'));var util=require(_0xea72('0x1'));var moment=require(_0xea72('0x2'));var BPromise=require(_0xea72('0x3'));var rs=require(_0xea72('0x4'));var fs=require('fs');var Redis=require(_0xea72('0x5'));var db=require(_0xea72('0x6'))['db'];var utils=require(_0xea72('0x7'));var logger=require(_0xea72('0x8'))(_0xea72('0x9'));var config=require(_0xea72('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xea72('0xb')][_0xea72('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4de5ff,_0x4659d3,_0x131b75){return new BPromise(function(_0x3c6d64,_0x1c1dd6){return client[_0xea72('0xd')](_0x4de5ff,_0x131b75)[_0xea72('0xe')](function(_0x2c84a2){logger[_0xea72('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4659d3,_0xea72('0x10'));logger[_0xea72('0x11')](_0xea72('0x12'),_0x4659d3,_0xea72('0x10'),JSON[_0xea72('0x13')](_0x2c84a2));if(_0x2c84a2[_0xea72('0x14')]){if(_0x2c84a2['error']['code']===0x1f4){logger['error'](_0xea72('0x15'),_0x4659d3,_0x2c84a2['error'][_0xea72('0x16')]);return _0x1c1dd6(_0x2c84a2['error']['message']);}logger[_0xea72('0x14')](_0xea72('0x15'),_0x4659d3,_0x2c84a2['error'][_0xea72('0x16')]);return _0x3c6d64(_0x2c84a2[_0xea72('0x14')][_0xea72('0x16')]);}else{logger[_0xea72('0xf')](_0xea72('0x15'),_0x4659d3,_0xea72('0x10'));_0x3c6d64(_0x2c84a2[_0xea72('0x17')][_0xea72('0x16')]);}})[_0xea72('0x18')](function(_0x3d4af8){logger[_0xea72('0x14')](_0xea72('0x15'),_0x4659d3,_0x3d4af8);_0x1c1dd6(_0x3d4af8);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 5ae31be..dc20746 100644
--- a/server/api/analyticExtractedReport/index.js
+++ b/server/api/analyticExtractedReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f27=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','index','/:id','show','get','/:id/download','post','create','put','update','delete','exports','path','connect-timeout','express','Router'];(function(_0x17586f,_0xc29f47){var _0x583035=function(_0x56ce8e){while(--_0x56ce8e){_0x17586f['push'](_0x17586f['shift']());}};_0x583035(++_0xc29f47);}(_0x3f27,0xc4));var _0x73f2=function(_0x400b93,_0xf89da3){_0x400b93=_0x400b93-0x0;var _0x365d4b=_0x3f27[_0x400b93];return _0x365d4b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73f2('0x0'));var timeout=require(_0x73f2('0x1'));var express=require(_0x73f2('0x2'));var router=express[_0x73f2('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x73f2('0x4'));var interaction=require(_0x73f2('0x5'));var config=require(_0x73f2('0x6'));var controller=require(_0x73f2('0x7'));router['get']('/',auth[_0x73f2('0x8')](),controller[_0x73f2('0x9')]);router['get'](_0x73f2('0xa'),auth[_0x73f2('0x8')](),controller[_0x73f2('0xb')]);router[_0x73f2('0xc')](_0x73f2('0xd'),auth[_0x73f2('0x8')](),controller['download']);router[_0x73f2('0xe')]('/',auth[_0x73f2('0x8')](),controller[_0x73f2('0xf')]);router[_0x73f2('0x10')](_0x73f2('0xa'),auth[_0x73f2('0x8')](),controller[_0x73f2('0x11')]);router[_0x73f2('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x73f2('0x13')]=router;
\ No newline at end of file
+var _0xcc93=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service'];(function(_0x4fafac,_0x3a1c4d){var _0x3d2b43=function(_0x7fa4fe){while(--_0x7fa4fe){_0x4fafac['push'](_0x4fafac['shift']());}};_0x3d2b43(++_0x3a1c4d);}(_0xcc93,0x1c1));var _0x3cc9=function(_0x2da4c6,_0x3cbf23){_0x2da4c6=_0x2da4c6-0x0;var _0x4741c6=_0xcc93[_0x2da4c6];return _0x4741c6;};'use strict';var multer=require(_0x3cc9('0x0'));var util=require(_0x3cc9('0x1'));var path=require('path');var timeout=require(_0x3cc9('0x2'));var express=require(_0x3cc9('0x3'));var router=express[_0x3cc9('0x4')]();var fs_extra=require(_0x3cc9('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x3cc9('0x6'));var config=require(_0x3cc9('0x7'));var controller=require(_0x3cc9('0x8'));router[_0x3cc9('0x9')]('/',auth[_0x3cc9('0xa')](),controller['index']);router[_0x3cc9('0x9')](_0x3cc9('0xb'),auth[_0x3cc9('0xa')](),controller[_0x3cc9('0xc')]);router[_0x3cc9('0x9')]('/:id/download',auth[_0x3cc9('0xa')](),controller['download']);router[_0x3cc9('0xd')]('/',auth[_0x3cc9('0xa')](),controller[_0x3cc9('0xe')]);router[_0x3cc9('0xf')](_0x3cc9('0xb'),auth[_0x3cc9('0xa')](),controller[_0x3cc9('0x10')]);router[_0x3cc9('0x11')](_0x3cc9('0xb'),auth['isAuthenticated'](),controller[_0x3cc9('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1e97237..5c11f80 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.attributes.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdfd6=['BOOLEAN','sequelize','exports','TEXT','STRING'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xdfd6,0xb5));var _0x6dfd=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xdfd6[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x6dfd('0x0'));module[_0x6dfd('0x1')]={'field':{'type':Sequelize[_0x6dfd('0x2')]},'alias':{'type':Sequelize[_0x6dfd('0x3')]},'function':{'type':Sequelize[_0x6dfd('0x3')]},'format':{'type':Sequelize[_0x6dfd('0x3')]},'groupBy':{'type':Sequelize[_0x6dfd('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x6dfd('0x3')]},'custom':{'type':Sequelize[_0x6dfd('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x49a7=['BOOLEAN','exports','STRING'];(function(_0x3a3d63,_0x225317){var _0x10da5a=function(_0x12c907){while(--_0x12c907){_0x3a3d63['push'](_0x3a3d63['shift']());}};_0x10da5a(++_0x225317);}(_0x49a7,0x70));var _0x749a=function(_0x247ee7,_0x5ba033){_0x247ee7=_0x247ee7-0x0;var _0x1b6421=_0x49a7[_0x247ee7];return _0x1b6421;};'use strict';var Sequelize=require('sequelize');module[_0x749a('0x0')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x749a('0x1')]},'format':{'type':Sequelize[_0x749a('0x1')]},'groupBy':{'type':Sequelize[_0x749a('0x2')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x749a('0x1')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 964edd8..3f77877 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.controller.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x07c2=['lodash','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','send','index','AnalyticFieldReport','rawAttributes','fieldName','key','model','map','name','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','merge','options','findAll','catch','show','params','length','includeAll','include','find','create','body','bulkCreate','bulkDestroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra'];(function(_0x5da52e,_0x12e17c){var _0x3265cd=function(_0x3a2500){while(--_0x3a2500){_0x5da52e['push'](_0x5da52e['shift']());}};_0x3265cd(++_0x12e17c);}(_0x07c2,0xf1));var _0x207c=function(_0x268b06,_0x446ed1){_0x268b06=_0x268b06-0x0;var _0x31d48b=_0x07c2[_0x268b06];return _0x31d48b;};'use strict';var emlformat=require(_0x207c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x207c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x207c('0x2'));var moment=require(_0x207c('0x3'));var BPromise=require(_0x207c('0x4'));var Mustache=require(_0x207c('0x5'));var util=require(_0x207c('0x6'));var path=require(_0x207c('0x7'));var sox=require('sox');var csv=require(_0x207c('0x8'));var ejs=require(_0x207c('0x9'));var fs=require('fs');var fs_extra=require(_0x207c('0xa'));var _=require(_0x207c('0xb'));var squel=require('squel');var crypto=require(_0x207c('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x207c('0x8'));var querystring=require(_0x207c('0xd'));var Papa=require(_0x207c('0xe'));var Redis=require(_0x207c('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x207c('0x10'));var as=require(_0x207c('0x11'));var hardwareService=require(_0x207c('0x12'));var logger=require(_0x207c('0x13'))(_0x207c('0x14'));var utils=require(_0x207c('0x15'));var config=require(_0x207c('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x207c('0x17'))['db'];function respondWithStatusCode(_0x542ba8,_0x9f5604){_0x9f5604=_0x9f5604||0xcc;return function(_0x5cb038){if(_0x5cb038){return _0x542ba8['sendStatus'](_0x9f5604);}return _0x542ba8[_0x207c('0x18')](_0x9f5604)[_0x207c('0x19')]();};}function respondWithResult(_0x5ac7bc,_0x209f2c){_0x209f2c=_0x209f2c||0xc8;return function(_0x2d296c){if(_0x2d296c){return _0x5ac7bc[_0x207c('0x18')](_0x209f2c)[_0x207c('0x1a')](_0x2d296c);}};}function respondWithFilteredResult(_0x417000,_0x4d4f2b){return function(_0x8da5f8){if(_0x8da5f8){var _0x4ade90=typeof _0x4d4f2b[_0x207c('0x1b')]===_0x207c('0x1c')&&typeof _0x4d4f2b['limit']==='undefined';var _0x1ddcb3=_0x8da5f8[_0x207c('0x1d')];var _0x4d245e=_0x4ade90?0x0:_0x4d4f2b[_0x207c('0x1b')];var _0x2f03bc=_0x4ade90?_0x8da5f8[_0x207c('0x1d')]:_0x4d4f2b[_0x207c('0x1b')]+_0x4d4f2b[_0x207c('0x1e')];var _0x327bd0;if(_0x2f03bc>=_0x1ddcb3){_0x2f03bc=_0x1ddcb3;_0x327bd0=0xc8;}else{_0x327bd0=0xce;}_0x417000[_0x207c('0x18')](_0x327bd0);return _0x417000['set'](_0x207c('0x1f'),_0x4d245e+'-'+_0x2f03bc+'/'+_0x1ddcb3)[_0x207c('0x1a')](_0x8da5f8);}return null;};}function patchUpdates(_0x19ce80){return function(_0xe80172){try{jsonpatch[_0x207c('0x20')](_0xe80172,_0x19ce80,!![]);}catch(_0xc94ef3){return BPromise[_0x207c('0x21')](_0xc94ef3);}return _0xe80172[_0x207c('0x22')]();};}function saveUpdates(_0x30c1de,_0x1fd868){return function(_0x1e5eff){if(_0x1e5eff){return _0x1e5eff[_0x207c('0x23')](_0x30c1de)['then'](function(_0x5f3401){return _0x5f3401;});}return null;};}function removeEntity(_0x421e87,_0x4fe300){return function(_0x447821){if(_0x447821){return _0x447821[_0x207c('0x24')]()[_0x207c('0x25')](function(){_0x421e87[_0x207c('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x277b73,_0x1a1a6a){return function(_0x18a3d5){if(!_0x18a3d5){_0x277b73[_0x207c('0x26')](0x194);}return _0x18a3d5;};}function handleError(_0x2ceb79,_0x273794){_0x273794=_0x273794||0x1f4;return function(_0x5708d0){logger[_0x207c('0x27')](_0x5708d0[_0x207c('0x28')]);if(_0x5708d0['name']){delete _0x5708d0['name'];}_0x2ceb79[_0x207c('0x18')](_0x273794)[_0x207c('0x29')](_0x5708d0);};}exports[_0x207c('0x2a')]=function(_0x53d82b,_0x11217c){var _0x5dee74={},_0x466de8={},_0xeafa01={'count':0x0,'rows':[]};var _0x3aa0fe=_['map'](db[_0x207c('0x2b')][_0x207c('0x2c')],function(_0x2d43ce){return{'name':_0x2d43ce[_0x207c('0x2d')],'type':_0x2d43ce['type'][_0x207c('0x2e')]};});_0x466de8[_0x207c('0x2f')]=_[_0x207c('0x30')](_0x3aa0fe,_0x207c('0x31'));_0x466de8[_0x207c('0x32')]=_[_0x207c('0x33')](_0x53d82b['query']);_0x466de8[_0x207c('0x34')]=_[_0x207c('0x35')](_0x466de8[_0x207c('0x2f')],_0x466de8[_0x207c('0x32')]);_0x5dee74[_0x207c('0x36')]=_[_0x207c('0x35')](_0x466de8[_0x207c('0x2f')],qs[_0x207c('0x37')](_0x53d82b[_0x207c('0x32')][_0x207c('0x37')]));_0x5dee74[_0x207c('0x36')]=_0x5dee74[_0x207c('0x36')]['length']?_0x5dee74[_0x207c('0x36')]:_0x466de8[_0x207c('0x2f')];if(!_0x53d82b[_0x207c('0x32')][_0x207c('0x38')](_0x207c('0x39'))){_0x5dee74[_0x207c('0x1e')]=qs['limit'](_0x53d82b[_0x207c('0x32')][_0x207c('0x1e')]);_0x5dee74[_0x207c('0x1b')]=qs[_0x207c('0x1b')](_0x53d82b[_0x207c('0x32')][_0x207c('0x1b')]);}_0x5dee74[_0x207c('0x3a')]=qs[_0x207c('0x3b')](_0x53d82b['query'][_0x207c('0x3b')]);_0x5dee74[_0x207c('0x3c')]=qs[_0x207c('0x34')](_[_0x207c('0x3d')](_0x53d82b['query'],_0x466de8[_0x207c('0x34')]),_0x3aa0fe);if(_0x53d82b['query']['filter']){_0x5dee74[_0x207c('0x3c')]=_['merge'](_0x5dee74['where'],{'$or':_[_0x207c('0x30')](_0x3aa0fe,function(_0x35b55c){if(_0x35b55c[_0x207c('0x3e')]!==_0x207c('0x3f')){var _0x1fc615={};_0x1fc615[_0x35b55c['name']]={'$like':'%'+_0x53d82b[_0x207c('0x32')][_0x207c('0x40')]+'%'};return _0x1fc615;}})});}_0x5dee74=_[_0x207c('0x41')]({},_0x5dee74,_0x53d82b[_0x207c('0x42')]);var _0x4391b4={'where':_0x5dee74[_0x207c('0x3c')]};return db[_0x207c('0x2b')][_0x207c('0x1d')](_0x4391b4)[_0x207c('0x25')](function(_0x3a9001){_0xeafa01['count']=_0x3a9001;if(_0x53d82b['query']['includeAll']){_0x5dee74['include']=[{'all':!![]}];}return db[_0x207c('0x2b')][_0x207c('0x43')](_0x5dee74);})[_0x207c('0x25')](function(_0x3dc7fe){_0xeafa01['rows']=_0x3dc7fe;return _0xeafa01;})[_0x207c('0x25')](respondWithFilteredResult(_0x11217c,_0x5dee74))[_0x207c('0x44')](handleError(_0x11217c,null));};exports[_0x207c('0x45')]=function(_0x5dea31,_0xf18826){var _0x3058b8={'raw':![],'where':{'id':_0x5dea31[_0x207c('0x46')]['id']}},_0x4821a8={};_0x4821a8[_0x207c('0x2f')]=_['keys'](db[_0x207c('0x2b')][_0x207c('0x2c')]);_0x4821a8[_0x207c('0x32')]=_['keys'](_0x5dea31[_0x207c('0x32')]);_0x4821a8['filters']=_[_0x207c('0x35')](_0x4821a8['model'],_0x4821a8[_0x207c('0x32')]);_0x3058b8[_0x207c('0x36')]=_[_0x207c('0x35')](_0x4821a8['model'],qs[_0x207c('0x37')](_0x5dea31[_0x207c('0x32')][_0x207c('0x37')]));_0x3058b8['attributes']=_0x3058b8['attributes'][_0x207c('0x47')]?_0x3058b8['attributes']:_0x4821a8[_0x207c('0x2f')];if(_0x5dea31[_0x207c('0x32')][_0x207c('0x48')]){_0x3058b8[_0x207c('0x49')]=[{'all':!![]}];}_0x3058b8=_[_0x207c('0x41')]({},_0x3058b8,_0x5dea31['options']);return db[_0x207c('0x2b')][_0x207c('0x4a')](_0x3058b8)['then'](handleEntityNotFound(_0xf18826,null))[_0x207c('0x25')](respondWithResult(_0xf18826,null))['catch'](handleError(_0xf18826,null));};exports['create']=function(_0x377a6e,_0x297415){return db[_0x207c('0x2b')][_0x207c('0x4b')](_0x377a6e[_0x207c('0x4c')],{})['then'](respondWithResult(_0x297415,0xc9))[_0x207c('0x44')](handleError(_0x297415,null));};exports['bulkCreate']=function(_0x2f847e,_0x4930cb){return db[_0x207c('0x2b')][_0x207c('0x4d')](_0x2f847e[_0x207c('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4930cb,0xc9))['catch'](handleError(_0x4930cb,null));};exports[_0x207c('0x23')]=function(_0x1a6154,_0x31e3e5){if(_0x1a6154[_0x207c('0x4c')]['id']){delete _0x1a6154[_0x207c('0x4c')]['id'];}return db[_0x207c('0x2b')][_0x207c('0x4a')]({'where':{'id':_0x1a6154[_0x207c('0x46')]['id']}})[_0x207c('0x25')](handleEntityNotFound(_0x31e3e5,null))[_0x207c('0x25')](saveUpdates(_0x1a6154[_0x207c('0x4c')],null))[_0x207c('0x25')](respondWithResult(_0x31e3e5,null))[_0x207c('0x44')](handleError(_0x31e3e5,null));};exports[_0x207c('0x24')]=function(_0x462b43,_0x10e335){return db[_0x207c('0x2b')]['find']({'where':{'id':_0x462b43[_0x207c('0x46')]['id']}})['then'](handleEntityNotFound(_0x10e335,null))[_0x207c('0x25')](removeEntity(_0x10e335,null))[_0x207c('0x44')](handleError(_0x10e335,null));};exports[_0x207c('0x4e')]=function(_0x1d332b,_0x2274e2){return db[_0x207c('0x2b')][_0x207c('0x24')]({'where':{'id':_0x1d332b[_0x207c('0x32')][_0x207c('0x4f')]||[]},'raw':![],'individualHooks':!![]})[_0x207c('0x25')](respondWithResult(_0x2274e2,0xcc))[_0x207c('0x44')](handleError(_0x2274e2,null));};exports['addFields']=function(_0x5897d5,_0x1cd405,_0x5cc019){return db[_0x207c('0x50')][_0x207c('0x51')]({'where':{'id':_0x5897d5[_0x207c('0x46')]['id']}})[_0x207c('0x25')](handleEntityNotFound(_0x1cd405,null))[_0x207c('0x25')](function(_0x2e8ab6){if(_0x2e8ab6){return db[_0x207c('0x52')][_0x207c('0x53')](function(_0x22861f){return db[_0x207c('0x2b')][_0x207c('0x24')]({'where':{'CustomReportId':_0x5897d5[_0x207c('0x46')]['id']},'transaction':_0x22861f})[_0x207c('0x25')](function(_0x4c8b66){var _0x142e6f=_[_0x207c('0x30')](_0x5897d5[_0x207c('0x4c')],function(_0xe302cd){delete _0xe302cd['id'];_0xe302cd['CustomReportId']=_0x5897d5[_0x207c('0x46')]['id'];return _0xe302cd;});return db[_0x207c('0x2b')][_0x207c('0x4d')](_0x142e6f,{'transaction':_0x22861f});});})[_0x207c('0x25')](function(){return db[_0x207c('0x2b')]['findAll']({'where':{'CustomReportId':_0x5897d5[_0x207c('0x46')]['id']}});});}})[_0x207c('0x25')](respondWithResult(_0x1cd405,null))[_0x207c('0x44')](handleError(_0x1cd405,null));};
\ No newline at end of file
+var _0x25a1=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','body','bulkCreate','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','fast-json-patch','bluebird','util','path','to-csv','ejs','lodash','squel','crypto'];(function(_0x39ac40,_0x1b0147){var _0xca35ad=function(_0x2b16aa){while(--_0x2b16aa){_0x39ac40['push'](_0x39ac40['shift']());}};_0xca35ad(++_0x1b0147);}(_0x25a1,0x1d0));var _0x125a=function(_0x1869e5,_0x1d98fd){_0x1869e5=_0x1869e5-0x0;var _0xd18c76=_0x25a1[_0x1869e5];return _0xd18c76;};'use strict';var emlformat=require(_0x125a('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x125a('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x125a('0x2'));var Mustache=require('mustache');var util=require(_0x125a('0x3'));var path=require(_0x125a('0x4'));var sox=require('sox');var csv=require(_0x125a('0x5'));var ejs=require(_0x125a('0x6'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x125a('0x7'));var squel=require(_0x125a('0x8'));var crypto=require(_0x125a('0x9'));var jsforce=require(_0x125a('0xa'));var deskjs=require(_0x125a('0xb'));var toCsv=require(_0x125a('0x5'));var querystring=require(_0x125a('0xc'));var Papa=require('papaparse');var Redis=require(_0x125a('0xd'));var authService=require(_0x125a('0xe'));var qs=require(_0x125a('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x125a('0x10'));var logger=require(_0x125a('0x11'))(_0x125a('0x12'));var utils=require(_0x125a('0x13'));var config=require(_0x125a('0x14'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xacea5c,_0x52580d){_0x52580d=_0x52580d||0xcc;return function(_0x136e4c){if(_0x136e4c){return _0xacea5c[_0x125a('0x15')](_0x52580d);}return _0xacea5c[_0x125a('0x16')](_0x52580d)[_0x125a('0x17')]();};}function respondWithResult(_0x71ffa5,_0x16be02){_0x16be02=_0x16be02||0xc8;return function(_0x7675ca){if(_0x7675ca){return _0x71ffa5['status'](_0x16be02)[_0x125a('0x18')](_0x7675ca);}};}function respondWithFilteredResult(_0x368b75,_0x4dc03e){return function(_0x1519bc){if(_0x1519bc){var _0x410e4d=typeof _0x4dc03e[_0x125a('0x19')]===_0x125a('0x1a')&&typeof _0x4dc03e[_0x125a('0x1b')]===_0x125a('0x1a');var _0x369de2=_0x1519bc[_0x125a('0x1c')];var _0x47afaa=_0x410e4d?0x0:_0x4dc03e[_0x125a('0x19')];var _0x2e430e=_0x410e4d?_0x1519bc[_0x125a('0x1c')]:_0x4dc03e[_0x125a('0x19')]+_0x4dc03e[_0x125a('0x1b')];var _0x178e49;if(_0x2e430e>=_0x369de2){_0x2e430e=_0x369de2;_0x178e49=0xc8;}else{_0x178e49=0xce;}_0x368b75[_0x125a('0x16')](_0x178e49);return _0x368b75[_0x125a('0x1d')](_0x125a('0x1e'),_0x47afaa+'-'+_0x2e430e+'/'+_0x369de2)[_0x125a('0x18')](_0x1519bc);}return null;};}function patchUpdates(_0x468c35){return function(_0x5ebc2c){try{jsonpatch[_0x125a('0x1f')](_0x5ebc2c,_0x468c35,!![]);}catch(_0x3c068b){return BPromise[_0x125a('0x20')](_0x3c068b);}return _0x5ebc2c[_0x125a('0x21')]();};}function saveUpdates(_0x1a32e9,_0x3506f6){return function(_0xa29331){if(_0xa29331){return _0xa29331[_0x125a('0x22')](_0x1a32e9)[_0x125a('0x23')](function(_0x484431){return _0x484431;});}return null;};}function removeEntity(_0x3a9e87,_0x3d12fc){return function(_0x57bc75){if(_0x57bc75){return _0x57bc75[_0x125a('0x24')]()[_0x125a('0x23')](function(){_0x3a9e87[_0x125a('0x16')](0xcc)[_0x125a('0x17')]();});}};}function handleEntityNotFound(_0x4379f1,_0x4c1802){return function(_0x5eeabf){if(!_0x5eeabf){_0x4379f1['sendStatus'](0x194);}return _0x5eeabf;};}function handleError(_0x4277ce,_0x271967){_0x271967=_0x271967||0x1f4;return function(_0x160ab8){logger[_0x125a('0x25')](_0x160ab8['stack']);if(_0x160ab8[_0x125a('0x26')]){delete _0x160ab8[_0x125a('0x26')];}_0x4277ce[_0x125a('0x16')](_0x271967)[_0x125a('0x27')](_0x160ab8);};}exports[_0x125a('0x28')]=function(_0x30e91a,_0x4ba31f){var _0x3c0b29={},_0x11411d={},_0x5e86cc={'count':0x0,'rows':[]};var _0x14bcaa=_[_0x125a('0x29')](db[_0x125a('0x2a')]['rawAttributes'],function(_0x1fb852){return{'name':_0x1fb852['fieldName'],'type':_0x1fb852[_0x125a('0x2b')][_0x125a('0x2c')]};});_0x11411d[_0x125a('0x2d')]=_[_0x125a('0x29')](_0x14bcaa,'name');_0x11411d[_0x125a('0x2e')]=_['keys'](_0x30e91a['query']);_0x11411d[_0x125a('0x2f')]=_[_0x125a('0x30')](_0x11411d['model'],_0x11411d[_0x125a('0x2e')]);_0x3c0b29[_0x125a('0x31')]=_[_0x125a('0x30')](_0x11411d['model'],qs['fields'](_0x30e91a['query'][_0x125a('0x32')]));_0x3c0b29[_0x125a('0x31')]=_0x3c0b29[_0x125a('0x31')]['length']?_0x3c0b29[_0x125a('0x31')]:_0x11411d['model'];if(!_0x30e91a['query'][_0x125a('0x33')]('nolimit')){_0x3c0b29[_0x125a('0x1b')]=qs[_0x125a('0x1b')](_0x30e91a[_0x125a('0x2e')][_0x125a('0x1b')]);_0x3c0b29[_0x125a('0x19')]=qs[_0x125a('0x19')](_0x30e91a[_0x125a('0x2e')]['offset']);}_0x3c0b29[_0x125a('0x34')]=qs[_0x125a('0x35')](_0x30e91a[_0x125a('0x2e')][_0x125a('0x35')]);_0x3c0b29[_0x125a('0x36')]=qs[_0x125a('0x2f')](_[_0x125a('0x37')](_0x30e91a[_0x125a('0x2e')],_0x11411d['filters']),_0x14bcaa);if(_0x30e91a['query'][_0x125a('0x38')]){_0x3c0b29[_0x125a('0x36')]=_['merge'](_0x3c0b29[_0x125a('0x36')],{'$or':_[_0x125a('0x29')](_0x14bcaa,function(_0x260c8d){if(_0x260c8d['type']!=='VIRTUAL'){var _0x3a101c={};_0x3a101c[_0x260c8d[_0x125a('0x26')]]={'$like':'%'+_0x30e91a['query'][_0x125a('0x38')]+'%'};return _0x3a101c;}})});}_0x3c0b29=_[_0x125a('0x39')]({},_0x3c0b29,_0x30e91a[_0x125a('0x3a')]);var _0x43ad32={'where':_0x3c0b29['where']};return db[_0x125a('0x2a')][_0x125a('0x1c')](_0x43ad32)[_0x125a('0x23')](function(_0x3e9683){_0x5e86cc['count']=_0x3e9683;if(_0x30e91a['query'][_0x125a('0x3b')]){_0x3c0b29['include']=[{'all':!![]}];}return db[_0x125a('0x2a')][_0x125a('0x3c')](_0x3c0b29);})[_0x125a('0x23')](function(_0x290783){_0x5e86cc[_0x125a('0x3d')]=_0x290783;return _0x5e86cc;})[_0x125a('0x23')](respondWithFilteredResult(_0x4ba31f,_0x3c0b29))[_0x125a('0x3e')](handleError(_0x4ba31f,null));};exports['show']=function(_0x560dca,_0x852826){var _0x25e287={'raw':![],'where':{'id':_0x560dca[_0x125a('0x3f')]['id']}},_0x4d7c9d={};_0x4d7c9d['model']=_[_0x125a('0x40')](db['AnalyticFieldReport']['rawAttributes']);_0x4d7c9d[_0x125a('0x2e')]=_[_0x125a('0x40')](_0x560dca[_0x125a('0x2e')]);_0x4d7c9d[_0x125a('0x2f')]=_[_0x125a('0x30')](_0x4d7c9d[_0x125a('0x2d')],_0x4d7c9d[_0x125a('0x2e')]);_0x25e287[_0x125a('0x31')]=_['intersection'](_0x4d7c9d[_0x125a('0x2d')],qs['fields'](_0x560dca[_0x125a('0x2e')][_0x125a('0x32')]));_0x25e287[_0x125a('0x31')]=_0x25e287['attributes'][_0x125a('0x41')]?_0x25e287['attributes']:_0x4d7c9d[_0x125a('0x2d')];if(_0x560dca[_0x125a('0x2e')][_0x125a('0x3b')]){_0x25e287[_0x125a('0x42')]=[{'all':!![]}];}_0x25e287=_[_0x125a('0x39')]({},_0x25e287,_0x560dca[_0x125a('0x3a')]);return db[_0x125a('0x2a')][_0x125a('0x43')](_0x25e287)[_0x125a('0x23')](handleEntityNotFound(_0x852826,null))[_0x125a('0x23')](respondWithResult(_0x852826,null))[_0x125a('0x3e')](handleError(_0x852826,null));};exports[_0x125a('0x44')]=function(_0xd5562b,_0x1804b7){return db['AnalyticFieldReport'][_0x125a('0x44')](_0xd5562b[_0x125a('0x45')],{})[_0x125a('0x23')](respondWithResult(_0x1804b7,0xc9))[_0x125a('0x3e')](handleError(_0x1804b7,null));};exports['bulkCreate']=function(_0x22deb9,_0xe3b9a9){return db['AnalyticFieldReport'][_0x125a('0x46')](_0x22deb9[_0x125a('0x45')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0xe3b9a9,0xc9))['catch'](handleError(_0xe3b9a9,null));};exports[_0x125a('0x22')]=function(_0x16202d,_0x446383){if(_0x16202d['body']['id']){delete _0x16202d[_0x125a('0x45')]['id'];}return db[_0x125a('0x2a')][_0x125a('0x43')]({'where':{'id':_0x16202d[_0x125a('0x3f')]['id']}})[_0x125a('0x23')](handleEntityNotFound(_0x446383,null))[_0x125a('0x23')](saveUpdates(_0x16202d[_0x125a('0x45')],null))[_0x125a('0x23')](respondWithResult(_0x446383,null))['catch'](handleError(_0x446383,null));};exports[_0x125a('0x24')]=function(_0x58d3b7,_0x519c6d){return db['AnalyticFieldReport'][_0x125a('0x43')]({'where':{'id':_0x58d3b7[_0x125a('0x3f')]['id']}})['then'](handleEntityNotFound(_0x519c6d,null))[_0x125a('0x23')](removeEntity(_0x519c6d,null))[_0x125a('0x3e')](handleError(_0x519c6d,null));};exports[_0x125a('0x47')]=function(_0xbaecb3,_0x570356){return db[_0x125a('0x2a')][_0x125a('0x24')]({'where':{'id':_0xbaecb3['query'][_0x125a('0x48')]||[]},'raw':![],'individualHooks':!![]})[_0x125a('0x23')](respondWithResult(_0x570356,0xcc))[_0x125a('0x3e')](handleError(_0x570356,null));};exports[_0x125a('0x49')]=function(_0x3f1f88,_0x47b627,_0x3747ab){return db[_0x125a('0x4a')][_0x125a('0x4b')]({'where':{'id':_0x3f1f88[_0x125a('0x3f')]['id']}})[_0x125a('0x23')](handleEntityNotFound(_0x47b627,null))[_0x125a('0x23')](function(_0x12e0aa){if(_0x12e0aa){return db[_0x125a('0x4c')][_0x125a('0x4d')](function(_0x377df4){return db['AnalyticFieldReport'][_0x125a('0x24')]({'where':{'CustomReportId':_0x3f1f88[_0x125a('0x3f')]['id']},'transaction':_0x377df4})['then'](function(_0x114212){var _0x545c5d=_['map'](_0x3f1f88[_0x125a('0x45')],function(_0x1cb4e1){delete _0x1cb4e1['id'];_0x1cb4e1[_0x125a('0x4e')]=_0x3f1f88['params']['id'];return _0x1cb4e1;});return db[_0x125a('0x2a')][_0x125a('0x46')](_0x545c5d,{'transaction':_0x377df4});});})[_0x125a('0x23')](function(){return db[_0x125a('0x2a')][_0x125a('0x3c')]({'where':{'CustomReportId':_0x3f1f88['params']['id']}});});}})[_0x125a('0x23')](respondWithResult(_0x47b627,null))[_0x125a('0x3e')](handleError(_0x47b627,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index b3ec731..4550573 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.model.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4821=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','util','bluebird','request-promise'];(function(_0x197835,_0x467333){var _0x228110=function(_0x105be9){while(--_0x105be9){_0x197835['push'](_0x197835['shift']());}};_0x228110(++_0x467333);}(_0x4821,0x115));var _0x1482=function(_0x112e99,_0x345a74){_0x112e99=_0x112e99-0x0;var _0x5ed545=_0x4821[_0x112e99];return _0x5ed545;};'use strict';var _=require('lodash');var util=require(_0x1482('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x1482('0x1'));var rp=require(_0x1482('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1482('0x3'));var config=require(_0x1482('0x4'));var attributes=require(_0x1482('0x5'));module[_0x1482('0x6')]=function(_0x1a7409,_0x20d40b){return _0x1a7409[_0x1482('0x7')]('AnalyticFieldReport',attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbeb2=['analytics_report_fields','lodash','util','moment','bluebird','request-promise','path','rimraf','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xbeb2,0x175));var _0x2beb=function(_0x473c90,_0x14d680){_0x473c90=_0x473c90-0x0;var _0x5eef4a=_0xbeb2[_0x473c90];return _0x5eef4a;};'use strict';var _=require(_0x2beb('0x0'));var util=require(_0x2beb('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x2beb('0x2'));var BPromise=require(_0x2beb('0x3'));var rp=require(_0x2beb('0x4'));var fs=require('fs');var path=require(_0x2beb('0x5'));var rimraf=require(_0x2beb('0x6'));var config=require('../../config/environment');var attributes=require(_0x2beb('0x7'));module[_0x2beb('0x8')]=function(_0x2dc2f4,_0x28fd50){return _0x2dc2f4[_0x2beb('0x9')](_0x2beb('0xa'),attributes,{'tableName':_0x2beb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index a678900..40626ba 100644
--- a/server/api/analyticFieldReport/analyticFieldReport.rpc.js
+++ b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x830c=['moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','lodash','util'];(function(_0x3951b5,_0xe8505e){var _0x29cca5=function(_0x54662b){while(--_0x54662b){_0x3951b5['push'](_0x3951b5['shift']());}};_0x29cca5(++_0xe8505e);}(_0x830c,0x178));var _0xc830=function(_0x2c6a60,_0x5f4462){_0x2c6a60=_0x2c6a60-0x0;var _0x4ee6b1=_0x830c[_0x2c6a60];return _0x4ee6b1;};'use strict';var _=require(_0xc830('0x0'));var util=require(_0xc830('0x1'));var moment=require(_0xc830('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc830('0x3'));var db=require(_0xc830('0x4'))['db'];var utils=require(_0xc830('0x5'));var logger=require(_0xc830('0x6'))(_0xc830('0x7'));var config=require(_0xc830('0x8'));var jayson=require(_0xc830('0x9'));var client=jayson[_0xc830('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x155b30,_0x52c205,_0x37b0c5){return new BPromise(function(_0x459219,_0x17e8b4){return client[_0xc830('0xb')](_0x155b30,_0x37b0c5)[_0xc830('0xc')](function(_0x3d556c){logger[_0xc830('0xd')](_0xc830('0xe'),_0x52c205,'request\x20sent');logger['debug'](_0xc830('0xf'),_0x52c205,'request\x20sent',JSON[_0xc830('0x10')](_0x3d556c));if(_0x3d556c[_0xc830('0x11')]){if(_0x3d556c[_0xc830('0x11')]['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x52c205,_0x3d556c[_0xc830('0x11')]['message']);return _0x17e8b4(_0x3d556c[_0xc830('0x11')][_0xc830('0x12')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x52c205,_0x3d556c[_0xc830('0x11')][_0xc830('0x12')]);return _0x459219(_0x3d556c['error'][_0xc830('0x12')]);}else{logger[_0xc830('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x52c205,_0xc830('0x13'));_0x459219(_0x3d556c[_0xc830('0x14')]['message']);}})['catch'](function(_0xead54b){logger[_0xc830('0x11')](_0xc830('0xe'),_0x52c205,_0xead54b);_0x17e8b4(_0xead54b);});});}
\ No newline at end of file
+var _0x5c18=['client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0xae4ef3,_0x33fb30){var _0x3b4945=function(_0x15b32f){while(--_0x15b32f){_0xae4ef3['push'](_0xae4ef3['shift']());}};_0x3b4945(++_0x33fb30);}(_0x5c18,0x148));var _0x85c1=function(_0x2a2477,_0x43d8fa){_0x2a2477=_0x2a2477-0x0;var _0x23009c=_0x5c18[_0x2a2477];return _0x23009c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85c1('0x0'));var BPromise=require('bluebird');var rs=require(_0x85c1('0x1'));var fs=require('fs');var Redis=require(_0x85c1('0x2'));var db=require(_0x85c1('0x3'))['db'];var utils=require(_0x85c1('0x4'));var logger=require(_0x85c1('0x5'))(_0x85c1('0x6'));var config=require('../../config/environment');var jayson=require(_0x85c1('0x7'));var client=jayson[_0x85c1('0x8')][_0x85c1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xed02d,_0x2070fc,_0x1e1a1b){return new BPromise(function(_0x46de72,_0xe3ac0e){return client[_0x85c1('0xa')](_0xed02d,_0x1e1a1b)[_0x85c1('0xb')](function(_0x4add1d){logger['info'](_0x85c1('0xc'),_0x2070fc,_0x85c1('0xd'));logger[_0x85c1('0xe')](_0x85c1('0xf'),_0x2070fc,_0x85c1('0xd'),JSON[_0x85c1('0x10')](_0x4add1d));if(_0x4add1d[_0x85c1('0x11')]){if(_0x4add1d[_0x85c1('0x11')]['code']===0x1f4){logger[_0x85c1('0x11')](_0x85c1('0xc'),_0x2070fc,_0x4add1d['error'][_0x85c1('0x12')]);return _0xe3ac0e(_0x4add1d[_0x85c1('0x11')][_0x85c1('0x12')]);}logger[_0x85c1('0x11')](_0x85c1('0xc'),_0x2070fc,_0x4add1d['error']['message']);return _0x46de72(_0x4add1d[_0x85c1('0x11')][_0x85c1('0x12')]);}else{logger[_0x85c1('0x13')](_0x85c1('0xc'),_0x2070fc,'request\x20sent');_0x46de72(_0x4add1d['result'][_0x85c1('0x12')]);}})[_0x85c1('0x14')](function(_0x26177e){logger['error'](_0x85c1('0xc'),_0x2070fc,_0x26177e);_0xe3ac0e(_0x26177e);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 97e7c41..047e535 100644
--- a/server/api/analyticFieldReport/index.js
+++ b/server/api/analyticFieldReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x4288f5,_0xe71961){var _0xc04f3=function(_0x488f7b){while(--_0x488f7b){_0x4288f5['push'](_0x4288f5['shift']());}};_0xc04f3(++_0xe71961);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
+var _0xa9e0=['delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticFieldReport.controller','get','index','/:id','post','/create_many','isAuthenticated','bulkCreate','/:id/create_many','update'];(function(_0x344f35,_0xb9b8ce){var _0x241f0e=function(_0xcc379c){while(--_0xcc379c){_0x344f35['push'](_0x344f35['shift']());}};_0x241f0e(++_0xb9b8ce);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xa9e0[_0x2b10c6];return _0x3789d2;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x0a9e('0x4'));var interaction=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var controller=require(_0x0a9e('0x7'));router[_0x0a9e('0x8')]('/',auth['isAuthenticated'](),controller[_0x0a9e('0x9')]);router[_0x0a9e('0x8')](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x0a9e('0xb')](_0x0a9e('0xc'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xb')](_0x0a9e('0xf'),auth['isAuthenticated'](),controller['addFields']);router['put']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x10')]);router[_0x0a9e('0x11')](_0x0a9e('0x12'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x13')]);router['delete'](_0x0a9e('0xa'),auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x14')]);module[_0x0a9e('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js
index 2e12422..c91bd65 100644
--- a/server/api/analyticMetric/analyticMetric.attributes.js
+++ b/server/api/analyticMetric/analyticMetric.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x74b1=['STRING','sequelize','exports','name'];(function(_0x1749a1,_0x490f8d){var _0x34b7a3=function(_0x58aa80){while(--_0x58aa80){_0x1749a1['push'](_0x1749a1['shift']());}};_0x34b7a3(++_0x490f8d);}(_0x74b1,0xb5));var _0x174b=function(_0x571a17,_0x63fb3d){_0x571a17=_0x571a17-0x0;var _0x3ef337=_0x74b1[_0x571a17];return _0x3ef337;};'use strict';var Sequelize=require(_0x174b('0x0'));module[_0x174b('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x174b('0x2')},'table':{'type':Sequelize[_0x174b('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x174b('0x3')]}};
\ No newline at end of file
+var _0xb67f=['TEXT','exports','STRING','name'];(function(_0x542f0c,_0x224bf1){var _0x2d88e1=function(_0x78dc51){while(--_0x78dc51){_0x542f0c['push'](_0x542f0c['shift']());}};_0x2d88e1(++_0x224bf1);}(_0xb67f,0x12d));var _0xfb67=function(_0x2c59f4,_0x59e7c0){_0x2c59f4=_0x2c59f4-0x0;var _0x1f2b41=_0xb67f[_0x2c59f4];return _0x1f2b41;};'use strict';var Sequelize=require('sequelize');module[_0xfb67('0x0')]={'name':{'type':Sequelize[_0xfb67('0x1')],'allowNull':![],'unique':_0xfb67('0x2')},'table':{'type':Sequelize[_0xfb67('0x1')]},'metric':{'type':Sequelize[_0xfb67('0x3')]},'description':{'type':Sequelize[_0xfb67('0x1')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 4d72915..1fd776d 100644
--- a/server/api/analyticMetric/analyticMetric.controller.js
+++ b/server/api/analyticMetric/analyticMetric.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x5c7f23,_0x207fc7){var _0x509249=function(_0x40fed5){while(--_0x40fed5){_0x5c7f23['push'](_0x5c7f23['shift']());}};_0x509249(++_0x207fc7);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5ac188,_0x163bcf){_0x5ac188=_0x5ac188-0x0;var _0x32fa2f=_0x7fbe[_0x5ac188];return _0x32fa2f;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
+var _0xe14b=['papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','json','apply','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','keys','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','params','eml-format','rimraf','request-promise','moment','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring'];(function(_0x2d4eb7,_0x35a03d){var _0x571698=function(_0x4a01f3){while(--_0x4a01f3){_0x2d4eb7['push'](_0x2d4eb7['shift']());}};_0x571698(++_0x35a03d);}(_0xe14b,0x93));var _0xbe14=function(_0x4641d9,_0x3362db){_0x4641d9=_0x4641d9-0x0;var _0x58b071=_0xe14b[_0x4641d9];return _0x58b071;};'use strict';var emlformat=require(_0xbe14('0x0'));var rimraf=require(_0xbe14('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbe14('0x2'));var moment=require(_0xbe14('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xbe14('0x4'));var util=require('util');var path=require('path');var sox=require(_0xbe14('0x5'));var csv=require(_0xbe14('0x6'));var ejs=require(_0xbe14('0x7'));var fs=require('fs');var fs_extra=require(_0xbe14('0x8'));var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var licenseUtil=require(_0xbe14('0x14'));var db=require(_0xbe14('0x15'))['db'];function respondWithStatusCode(_0x27792f,_0x3b898d){_0x3b898d=_0x3b898d||0xcc;return function(_0x23a730){if(_0x23a730){return _0x27792f[_0xbe14('0x16')](_0x3b898d);}return _0x27792f[_0xbe14('0x17')](_0x3b898d)[_0xbe14('0x18')]();};}function respondWithResult(_0x1e4826,_0x33fd54){_0x33fd54=_0x33fd54||0xc8;return function(_0x813399){if(_0x813399){return _0x1e4826['status'](_0x33fd54)['json'](_0x813399);}};}function respondWithFilteredResult(_0x3f58f5,_0x3dc4a9){return function(_0xf4ac9){if(_0xf4ac9){var _0x37ce4e=typeof _0x3dc4a9['offset']===_0xbe14('0x19')&&typeof _0x3dc4a9[_0xbe14('0x1a')]===_0xbe14('0x19');var _0x123ede=_0xf4ac9[_0xbe14('0x1b')];var _0x29ab73=_0x37ce4e?0x0:_0x3dc4a9[_0xbe14('0x1c')];var _0x5ea1f8=_0x37ce4e?_0xf4ac9[_0xbe14('0x1b')]:_0x3dc4a9[_0xbe14('0x1c')]+_0x3dc4a9[_0xbe14('0x1a')];var _0x433459;if(_0x5ea1f8>=_0x123ede){_0x5ea1f8=_0x123ede;_0x433459=0xc8;}else{_0x433459=0xce;}_0x3f58f5[_0xbe14('0x17')](_0x433459);return _0x3f58f5[_0xbe14('0x1d')]('Content-Range',_0x29ab73+'-'+_0x5ea1f8+'/'+_0x123ede)[_0xbe14('0x1e')](_0xf4ac9);}return null;};}function patchUpdates(_0x4a1bbd){return function(_0x417c8d){try{jsonpatch[_0xbe14('0x1f')](_0x417c8d,_0x4a1bbd,!![]);}catch(_0x188ec4){return BPromise['reject'](_0x188ec4);}return _0x417c8d[_0xbe14('0x20')]();};}function saveUpdates(_0x56d845,_0x3c1c85){return function(_0x56e80c){if(_0x56e80c){return _0x56e80c[_0xbe14('0x21')](_0x56d845)['then'](function(_0x274018){return _0x274018;});}return null;};}function removeEntity(_0x3d3608,_0x505dbd){return function(_0x2da350){if(_0x2da350){return _0x2da350['destroy']()[_0xbe14('0x22')](function(){var _0x4851f8=_0x2da350[_0xbe14('0x23')]({'plain':!![]});var _0x5fa043=_0xbe14('0x24');return db[_0xbe14('0x25')][_0xbe14('0x26')]({'where':{'type':_0x5fa043,'resourceId':_0x4851f8['id']}})[_0xbe14('0x22')](function(){return _0x2da350;});})['then'](function(){_0x3d3608[_0xbe14('0x17')](0xcc)[_0xbe14('0x18')]();});}};}function handleEntityNotFound(_0x391556,_0x169369){return function(_0x5dd475){if(!_0x5dd475){_0x391556[_0xbe14('0x16')](0x194);}return _0x5dd475;};}function handleError(_0x29fc64,_0x59bf34){_0x59bf34=_0x59bf34||0x1f4;return function(_0x3c3613){logger[_0xbe14('0x27')](_0x3c3613[_0xbe14('0x28')]);if(_0x3c3613[_0xbe14('0x29')]){delete _0x3c3613[_0xbe14('0x29')];}_0x29fc64[_0xbe14('0x17')](_0x59bf34)[_0xbe14('0x2a')](_0x3c3613);};}exports[_0xbe14('0x2b')]=function(_0x4168c8,_0x16a159){var _0x40538f={},_0x3bf43c={},_0x39dc0a={'count':0x0,'rows':[]};var _0x10ae36=_[_0xbe14('0x2c')](db[_0xbe14('0x2d')][_0xbe14('0x2e')],function(_0x2ff48e){return{'name':_0x2ff48e[_0xbe14('0x2f')],'type':_0x2ff48e[_0xbe14('0x30')]['key']};});_0x3bf43c[_0xbe14('0x31')]=_['map'](_0x10ae36,'name');_0x3bf43c[_0xbe14('0x32')]=_['keys'](_0x4168c8[_0xbe14('0x32')]);_0x3bf43c[_0xbe14('0x33')]=_['intersection'](_0x3bf43c['model'],_0x3bf43c['query']);_0x40538f[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x3bf43c['model'],qs[_0xbe14('0x36')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x36')]));_0x40538f[_0xbe14('0x34')]=_0x40538f[_0xbe14('0x34')]['length']?_0x40538f['attributes']:_0x3bf43c[_0xbe14('0x31')];if(!_0x4168c8['query']['hasOwnProperty']('nolimit')){_0x40538f[_0xbe14('0x1a')]=qs[_0xbe14('0x1a')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1a')]);_0x40538f[_0xbe14('0x1c')]=qs[_0xbe14('0x1c')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x1c')]);}_0x40538f[_0xbe14('0x37')]=qs[_0xbe14('0x38')](_0x4168c8[_0xbe14('0x32')][_0xbe14('0x38')]);_0x40538f['where']=qs['filters'](_[_0xbe14('0x39')](_0x4168c8[_0xbe14('0x32')],_0x3bf43c[_0xbe14('0x33')]),_0x10ae36);if(_0x4168c8['query'][_0xbe14('0x3a')]){_0x40538f[_0xbe14('0x3b')]=_[_0xbe14('0x3c')](_0x40538f[_0xbe14('0x3b')],{'$or':_[_0xbe14('0x2c')](_0x10ae36,function(_0x25ee1f){if(_0x25ee1f[_0xbe14('0x30')]!==_0xbe14('0x3d')){var _0x1b2608={};_0x1b2608[_0x25ee1f['name']]={'$like':'%'+_0x4168c8[_0xbe14('0x32')][_0xbe14('0x3a')]+'%'};return _0x1b2608;}})});}_0x40538f=_[_0xbe14('0x3c')]({},_0x40538f,_0x4168c8[_0xbe14('0x3e')]);var _0x3287b9={'where':_0x40538f[_0xbe14('0x3b')]};return db['AnalyticMetric'][_0xbe14('0x1b')](_0x3287b9)[_0xbe14('0x22')](function(_0x1220c9){_0x39dc0a[_0xbe14('0x1b')]=_0x1220c9;if(_0x4168c8['query']['includeAll']){_0x40538f[_0xbe14('0x3f')]=[{'all':!![]}];}return db[_0xbe14('0x2d')][_0xbe14('0x40')](_0x40538f);})['then'](function(_0x5d5318){_0x39dc0a[_0xbe14('0x41')]=_0x5d5318;return _0x39dc0a;})['then'](respondWithFilteredResult(_0x16a159,_0x40538f))['catch'](handleError(_0x16a159,null));};exports[_0xbe14('0x42')]=function(_0x1f0355,_0x8216c3){var _0x5051e4={'raw':!![],'where':{'id':_0x1f0355['params']['id']}},_0x558525={};_0x558525[_0xbe14('0x31')]=_[_0xbe14('0x43')](db[_0xbe14('0x2d')]['rawAttributes']);_0x558525[_0xbe14('0x32')]=_[_0xbe14('0x43')](_0x1f0355[_0xbe14('0x32')]);_0x558525[_0xbe14('0x33')]=_['intersection'](_0x558525['model'],_0x558525[_0xbe14('0x32')]);_0x5051e4[_0xbe14('0x34')]=_[_0xbe14('0x35')](_0x558525[_0xbe14('0x31')],qs[_0xbe14('0x36')](_0x1f0355['query']['fields']));_0x5051e4[_0xbe14('0x34')]=_0x5051e4[_0xbe14('0x34')][_0xbe14('0x44')]?_0x5051e4[_0xbe14('0x34')]:_0x558525['model'];if(_0x1f0355[_0xbe14('0x32')][_0xbe14('0x45')]){_0x5051e4['include']=[{'all':!![]}];}_0x5051e4=_[_0xbe14('0x3c')]({},_0x5051e4,_0x1f0355[_0xbe14('0x3e')]);return db[_0xbe14('0x2d')][_0xbe14('0x46')](_0x5051e4)['then'](handleEntityNotFound(_0x8216c3,null))['then'](respondWithResult(_0x8216c3,null))[_0xbe14('0x47')](handleError(_0x8216c3,null));};exports[_0xbe14('0x48')]=function(_0x4a1a37,_0x5acf90){return db[_0xbe14('0x2d')][_0xbe14('0x48')](_0x4a1a37[_0xbe14('0x49')],{})[_0xbe14('0x22')](function(_0xdbc6e1){var _0xd04fd5=_0x4a1a37[_0xbe14('0x4a')]['get']({'plain':!![]});if(!_0xd04fd5)throw new Error(_0xbe14('0x4b'));if(_0xd04fd5[_0xbe14('0x4c')]===_0xbe14('0x4a')){var _0x22b1f8=_0xdbc6e1[_0xbe14('0x23')]({'plain':!![]});var _0x494c32=_0xbe14('0x24');return db[_0xbe14('0x4d')][_0xbe14('0x46')]({'where':{'name':_0x494c32,'userProfileId':_0xd04fd5[_0xbe14('0x4e')]},'raw':!![]})[_0xbe14('0x22')](function(_0x2dbeb1){if(_0x2dbeb1&&_0x2dbeb1['autoAssociation']===0x0){return db['UserProfileResource'][_0xbe14('0x48')]({'name':_0x22b1f8[_0xbe14('0x29')],'resourceId':_0x22b1f8['id'],'type':_0x2dbeb1[_0xbe14('0x29')],'sectionId':_0x2dbeb1['id']},{})['then'](function(){return _0xdbc6e1;});}else{return _0xdbc6e1;}})['catch'](function(_0x44fe0d){logger[_0xbe14('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x44fe0d);throw _0x44fe0d;});}return _0xdbc6e1;})[_0xbe14('0x22')](respondWithResult(_0x5acf90,0xc9))[_0xbe14('0x47')](handleError(_0x5acf90,null));};exports['update']=function(_0x28f995,_0x4a40d2){if(_0x28f995[_0xbe14('0x49')]['id']){delete _0x28f995[_0xbe14('0x49')]['id'];}return db[_0xbe14('0x2d')]['find']({'where':{'id':_0x28f995[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4a40d2,null))['then'](saveUpdates(_0x28f995[_0xbe14('0x49')],null))[_0xbe14('0x22')](respondWithResult(_0x4a40d2,null))[_0xbe14('0x47')](handleError(_0x4a40d2,null));};exports[_0xbe14('0x26')]=function(_0x49322f,_0x4f06a3){return db[_0xbe14('0x2d')][_0xbe14('0x46')]({'where':{'id':_0x49322f[_0xbe14('0x4f')]['id']}})[_0xbe14('0x22')](handleEntityNotFound(_0x4f06a3,null))[_0xbe14('0x22')](removeEntity(_0x4f06a3,null))[_0xbe14('0x47')](handleError(_0x4f06a3,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 0dafe66..5d3ce64 100644
--- a/server/api/analyticMetric/analyticMetric.model.js
+++ b/server/api/analyticMetric/analyticMetric.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf722=['exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0x127277,_0x4cacaf){var _0x23c8ee=function(_0x942e67){while(--_0x942e67){_0x127277['push'](_0x127277['shift']());}};_0x23c8ee(++_0x4cacaf);}(_0xf722,0x18f));var _0x2f72=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xf722[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x2f72('0x0'));var util=require(_0x2f72('0x1'));var logger=require(_0x2f72('0x2'))(_0x2f72('0x3'));var moment=require('moment');var BPromise=require(_0x2f72('0x4'));var rp=require(_0x2f72('0x5'));var fs=require('fs');var path=require(_0x2f72('0x6'));var rimraf=require(_0x2f72('0x7'));var config=require('../../config/environment');var attributes=require(_0x2f72('0x8'));module[_0x2f72('0x9')]=function(_0x334168,_0x537e3d){return _0x334168['define'](_0x2f72('0xa'),attributes,{'tableName':_0x2f72('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5b5a=['exports','define','analytics_metrics','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x5b5a,0xc3));var _0xa5b5=function(_0x20ab51,_0x246894){_0x20ab51=_0x20ab51-0x0;var _0x51a966=_0x5b5a[_0x20ab51];return _0x51a966;};'use strict';var _=require('lodash');var util=require(_0xa5b5('0x0'));var logger=require(_0xa5b5('0x1'))('api');var moment=require(_0xa5b5('0x2'));var BPromise=require(_0xa5b5('0x3'));var rp=require(_0xa5b5('0x4'));var fs=require('fs');var path=require(_0xa5b5('0x5'));var rimraf=require(_0xa5b5('0x6'));var config=require(_0xa5b5('0x7'));var attributes=require(_0xa5b5('0x8'));module[_0xa5b5('0x9')]=function(_0x509b78,_0x33678e){return _0x509b78[_0xa5b5('0xa')]('AnalyticMetric',attributes,{'tableName':_0xa5b5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 7ffa17d..43e438b 100644
--- a/server/api/analyticMetric/analyticMetric.rpc.js
+++ b/server/api/analyticMetric/analyticMetric.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c61=['jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x6a474,_0x3b8732){var _0x4c65a6=function(_0x4a5867){while(--_0x4a5867){_0x6a474['push'](_0x6a474['shift']());}};_0x4c65a6(++_0x3b8732);}(_0x0c61,0xdd));var _0x10c6=function(_0xa79977,_0x4f7f12){_0xa79977=_0xa79977-0x0;var _0x109f10=_0x0c61[_0xa79977];return _0x109f10;};'use strict';var _=require(_0x10c6('0x0'));var util=require(_0x10c6('0x1'));var moment=require(_0x10c6('0x2'));var BPromise=require('bluebird');var rs=require(_0x10c6('0x3'));var fs=require('fs');var Redis=require(_0x10c6('0x4'));var db=require(_0x10c6('0x5'))['db'];var utils=require(_0x10c6('0x6'));var logger=require(_0x10c6('0x7'))(_0x10c6('0x8'));var config=require(_0x10c6('0x9'));var jayson=require(_0x10c6('0xa'));var client=jayson[_0x10c6('0xb')][_0x10c6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x41388c,_0x234031,_0x549930){return new BPromise(function(_0x2125e1,_0x1ce6b6){return client['request'](_0x41388c,_0x549930)[_0x10c6('0xd')](function(_0x35955f){logger[_0x10c6('0xe')](_0x10c6('0xf'),_0x234031,'request\x20sent');logger[_0x10c6('0x10')](_0x10c6('0x11'),_0x234031,'request\x20sent',JSON[_0x10c6('0x12')](_0x35955f));if(_0x35955f[_0x10c6('0x13')]){if(_0x35955f['error']['code']===0x1f4){logger[_0x10c6('0x13')](_0x10c6('0xf'),_0x234031,_0x35955f[_0x10c6('0x13')]['message']);return _0x1ce6b6(_0x35955f[_0x10c6('0x13')]['message']);}logger['error'](_0x10c6('0xf'),_0x234031,_0x35955f[_0x10c6('0x13')][_0x10c6('0x14')]);return _0x2125e1(_0x35955f[_0x10c6('0x13')][_0x10c6('0x14')]);}else{logger['info'](_0x10c6('0xf'),_0x234031,'request\x20sent');_0x2125e1(_0x35955f['result'][_0x10c6('0x14')]);}})['catch'](function(_0x5dd0c0){logger[_0x10c6('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0x234031,_0x5dd0c0);_0x1ce6b6(_0x5dd0c0);});});}
\ No newline at end of file
+var _0x2588=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch'];(function(_0x27f154,_0x2c11d4){var _0x2b3005=function(_0x4c9fda){while(--_0x4c9fda){_0x27f154['push'](_0x27f154['shift']());}};_0x2b3005(++_0x2c11d4);}(_0x2588,0xc8));var _0x8258=function(_0x33ce7f,_0x3cb0a2){_0x33ce7f=_0x33ce7f-0x0;var _0x46b86d=_0x2588[_0x33ce7f];return _0x46b86d;};'use strict';var _=require(_0x8258('0x0'));var util=require(_0x8258('0x1'));var moment=require(_0x8258('0x2'));var BPromise=require(_0x8258('0x3'));var rs=require(_0x8258('0x4'));var fs=require('fs');var Redis=require(_0x8258('0x5'));var db=require(_0x8258('0x6'))['db'];var utils=require(_0x8258('0x7'));var logger=require(_0x8258('0x8'))('rpc');var config=require(_0x8258('0x9'));var jayson=require(_0x8258('0xa'));var client=jayson[_0x8258('0xb')][_0x8258('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x304132,_0x2afdcc,_0x40256e){return new BPromise(function(_0x2e9b1c,_0x5315c1){return client['request'](_0x304132,_0x40256e)[_0x8258('0xd')](function(_0x8ee628){logger[_0x8258('0xe')](_0x8258('0xf'),_0x2afdcc,_0x8258('0x10'));logger[_0x8258('0x11')](_0x8258('0x12'),_0x2afdcc,'request\x20sent',JSON[_0x8258('0x13')](_0x8ee628));if(_0x8ee628['error']){if(_0x8ee628['error'][_0x8258('0x14')]===0x1f4){logger['error'](_0x8258('0xf'),_0x2afdcc,_0x8ee628['error'][_0x8258('0x15')]);return _0x5315c1(_0x8ee628[_0x8258('0x16')][_0x8258('0x15')]);}logger['error'](_0x8258('0xf'),_0x2afdcc,_0x8ee628['error'][_0x8258('0x15')]);return _0x2e9b1c(_0x8ee628[_0x8258('0x16')]['message']);}else{logger[_0x8258('0xe')](_0x8258('0xf'),_0x2afdcc,'request\x20sent');_0x2e9b1c(_0x8ee628[_0x8258('0x17')][_0x8258('0x15')]);}})[_0x8258('0x18')](function(_0x19dd6c){logger[_0x8258('0x16')](_0x8258('0xf'),_0x2afdcc,_0x19dd6c);_0x5315c1(_0x19dd6c);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index 6d1abdc..7e16d7f 100644
--- a/server/api/analyticMetric/index.js
+++ b/server/api/analyticMetric/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x18d6=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x30dfb2,_0x5dfad8){var _0x41dac6=function(_0x3333d0){while(--_0x3333d0){_0x30dfb2['push'](_0x30dfb2['shift']());}};_0x41dac6(++_0x5dfad8);}(_0x18d6,0x166));var _0x618d=function(_0x4e6fb2,_0x3cf23e){_0x4e6fb2=_0x4e6fb2-0x0;var _0x2f1636=_0x18d6[_0x4e6fb2];return _0x2f1636;};'use strict';var multer=require(_0x618d('0x0'));var util=require(_0x618d('0x1'));var path=require('path');var timeout=require(_0x618d('0x2'));var express=require(_0x618d('0x3'));var router=express[_0x618d('0x4')]();var fs_extra=require(_0x618d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x618d('0x6'));var config=require(_0x618d('0x7'));var controller=require('./analyticMetric.controller');router[_0x618d('0x8')]('/',auth['isAuthenticated'](),controller[_0x618d('0x9')]);router[_0x618d('0x8')]('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0xb')]);router[_0x618d('0xc')]('/',auth[_0x618d('0xa')](),controller[_0x618d('0xd')]);router[_0x618d('0xe')](_0x618d('0xf'),auth['isAuthenticated'](),controller[_0x618d('0x10')]);router[_0x618d('0x11')]('/:id',auth[_0x618d('0xa')](),controller[_0x618d('0x12')]);module[_0x618d('0x13')]=router;
\ No newline at end of file
+var _0x3981=['exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','/:id','post','create','put','delete','destroy'];(function(_0x1c0946,_0x1397d0){var _0x486457=function(_0x21b7a3){while(--_0x21b7a3){_0x1c0946['push'](_0x1c0946['shift']());}};_0x486457(++_0x1397d0);}(_0x3981,0x144));var _0x1398=function(_0x590776,_0x843c7e){_0x590776=_0x590776-0x0;var _0x55ad22=_0x3981[_0x590776];return _0x55ad22;};'use strict';var multer=require(_0x1398('0x0'));var util=require('util');var path=require(_0x1398('0x1'));var timeout=require(_0x1398('0x2'));var express=require(_0x1398('0x3'));var router=express[_0x1398('0x4')]();var fs_extra=require(_0x1398('0x5'));var auth=require(_0x1398('0x6'));var interaction=require(_0x1398('0x7'));var config=require(_0x1398('0x8'));var controller=require(_0x1398('0x9'));router[_0x1398('0xa')]('/',auth[_0x1398('0xb')](),controller['index']);router[_0x1398('0xa')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['show']);router[_0x1398('0xd')]('/',auth[_0x1398('0xb')](),controller[_0x1398('0xe')]);router[_0x1398('0xf')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller['update']);router[_0x1398('0x10')](_0x1398('0xc'),auth[_0x1398('0xb')](),controller[_0x1398('0x11')]);module[_0x1398('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 4be8cc8..3daeb74 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.attributes.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb55a=['sequelize','exports'];(function(_0x1bd57f,_0x349a10){var _0x4ed358=function(_0x2d816e){while(--_0x2d816e){_0x1bd57f['push'](_0x1bd57f['shift']());}};_0x4ed358(++_0x349a10);}(_0xb55a,0x184));var _0xab55=function(_0x5a776b,_0x46f785){_0x5a776b=_0x5a776b-0x0;var _0xbbef59=_0xb55a[_0x5a776b];return _0xbbef59;};'use strict';var Sequelize=require(_0xab55('0x0'));module[_0xab55('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0xd98c=['sequelize','exports','TEXT'];(function(_0x3dd0b9,_0x1d6c92){var _0x4c0351=function(_0x2cf6a8){while(--_0x2cf6a8){_0x3dd0b9['push'](_0x3dd0b9['shift']());}};_0x4c0351(++_0x1d6c92);}(_0xd98c,0x168));var _0xcd98=function(_0x20cf58,_0x2bd1a9){_0x20cf58=_0x20cf58-0x0;var _0x5d192b=_0xd98c[_0x20cf58];return _0x5d192b;};'use strict';var Sequelize=require(_0xcd98('0x0'));module[_0xcd98('0x1')]={'tree':{'type':Sequelize[_0xcd98('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index f35443d..04447ff 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.controller.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4793=['save','then','destroy','error','name','send','index','map','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','AnalyticTreeReport','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x4793,0x159));var _0x3479=function(_0x40e86c,_0x4d963c){_0x40e86c=_0x40e86c-0x0;var _0x26555f=_0x4793[_0x40e86c];return _0x26555f;};'use strict';var emlformat=require(_0x3479('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3479('0x1'));var rp=require(_0x3479('0x2'));var moment=require(_0x3479('0x3'));var BPromise=require(_0x3479('0x4'));var Mustache=require(_0x3479('0x5'));var util=require('util');var path=require('path');var sox=require(_0x3479('0x6'));var csv=require(_0x3479('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3479('0x8'));var _=require(_0x3479('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3479('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3479('0x7'));var querystring=require(_0x3479('0xb'));var Papa=require(_0x3479('0xc'));var Redis=require(_0x3479('0xd'));var authService=require(_0x3479('0xe'));var qs=require(_0x3479('0xf'));var as=require(_0x3479('0x10'));var hardwareService=require(_0x3479('0x11'));var logger=require(_0x3479('0x12'))('api');var utils=require(_0x3479('0x13'));var config=require(_0x3479('0x14'));var licenseUtil=require(_0x3479('0x15'));var db=require(_0x3479('0x16'))['db'];function respondWithStatusCode(_0x4f337c,_0x444e9f){_0x444e9f=_0x444e9f||0xcc;return function(_0x410141){if(_0x410141){return _0x4f337c[_0x3479('0x17')](_0x444e9f);}return _0x4f337c['status'](_0x444e9f)[_0x3479('0x18')]();};}function respondWithResult(_0xa69dce,_0x43246f){_0x43246f=_0x43246f||0xc8;return function(_0x3b3da5){if(_0x3b3da5){return _0xa69dce[_0x3479('0x19')](_0x43246f)[_0x3479('0x1a')](_0x3b3da5);}};}function respondWithFilteredResult(_0x3d37fd,_0x16440c){return function(_0x582dd6){if(_0x582dd6){var _0x5cb924=typeof _0x16440c[_0x3479('0x1b')]===_0x3479('0x1c')&&typeof _0x16440c[_0x3479('0x1d')]===_0x3479('0x1c');var _0x3f9c5d=_0x582dd6[_0x3479('0x1e')];var _0x3afa36=_0x5cb924?0x0:_0x16440c[_0x3479('0x1b')];var _0x39b0f2=_0x5cb924?_0x582dd6[_0x3479('0x1e')]:_0x16440c[_0x3479('0x1b')]+_0x16440c[_0x3479('0x1d')];var _0x158eaa;if(_0x39b0f2>=_0x3f9c5d){_0x39b0f2=_0x3f9c5d;_0x158eaa=0xc8;}else{_0x158eaa=0xce;}_0x3d37fd[_0x3479('0x19')](_0x158eaa);return _0x3d37fd[_0x3479('0x1f')](_0x3479('0x20'),_0x3afa36+'-'+_0x39b0f2+'/'+_0x3f9c5d)[_0x3479('0x1a')](_0x582dd6);}return null;};}function patchUpdates(_0x53666d){return function(_0x4de5ca){try{jsonpatch[_0x3479('0x21')](_0x4de5ca,_0x53666d,!![]);}catch(_0x5da660){return BPromise[_0x3479('0x22')](_0x5da660);}return _0x4de5ca[_0x3479('0x23')]();};}function saveUpdates(_0x569d14,_0x12ca2a){return function(_0x35df76){if(_0x35df76){return _0x35df76['update'](_0x569d14)[_0x3479('0x24')](function(_0x4c82ce){return _0x4c82ce;});}return null;};}function removeEntity(_0x3f1287,_0x4d8832){return function(_0xc94ae1){if(_0xc94ae1){return _0xc94ae1[_0x3479('0x25')]()[_0x3479('0x24')](function(){_0x3f1287['status'](0xcc)[_0x3479('0x18')]();});}};}function handleEntityNotFound(_0x1a5b03,_0x54a4ca){return function(_0x3d65f3){if(!_0x3d65f3){_0x1a5b03[_0x3479('0x17')](0x194);}return _0x3d65f3;};}function handleError(_0x50a196,_0x2541c6){_0x2541c6=_0x2541c6||0x1f4;return function(_0x1fc5c3){logger[_0x3479('0x26')](_0x1fc5c3['stack']);if(_0x1fc5c3['name']){delete _0x1fc5c3[_0x3479('0x27')];}_0x50a196[_0x3479('0x19')](_0x2541c6)[_0x3479('0x28')](_0x1fc5c3);};}exports[_0x3479('0x29')]=function(_0x4574e1,_0x314656){var _0x1772af={},_0x411bc9={},_0x49ef36={'count':0x0,'rows':[]};var _0x3a683b=_[_0x3479('0x2a')](db['AnalyticTreeReport'][_0x3479('0x2b')],function(_0x4762c9){return{'name':_0x4762c9[_0x3479('0x2c')],'type':_0x4762c9[_0x3479('0x2d')][_0x3479('0x2e')]};});_0x411bc9['model']=_[_0x3479('0x2a')](_0x3a683b,_0x3479('0x27'));_0x411bc9[_0x3479('0x2f')]=_['keys'](_0x4574e1[_0x3479('0x2f')]);_0x411bc9[_0x3479('0x30')]=_[_0x3479('0x31')](_0x411bc9[_0x3479('0x32')],_0x411bc9['query']);_0x1772af[_0x3479('0x33')]=_[_0x3479('0x31')](_0x411bc9[_0x3479('0x32')],qs[_0x3479('0x34')](_0x4574e1['query'][_0x3479('0x34')]));_0x1772af[_0x3479('0x33')]=_0x1772af[_0x3479('0x33')][_0x3479('0x35')]?_0x1772af['attributes']:_0x411bc9[_0x3479('0x32')];if(!_0x4574e1[_0x3479('0x2f')][_0x3479('0x36')](_0x3479('0x37'))){_0x1772af[_0x3479('0x1d')]=qs[_0x3479('0x1d')](_0x4574e1[_0x3479('0x2f')]['limit']);_0x1772af['offset']=qs['offset'](_0x4574e1[_0x3479('0x2f')][_0x3479('0x1b')]);}_0x1772af[_0x3479('0x38')]=qs[_0x3479('0x39')](_0x4574e1[_0x3479('0x2f')][_0x3479('0x39')]);_0x1772af[_0x3479('0x3a')]=qs[_0x3479('0x30')](_[_0x3479('0x3b')](_0x4574e1[_0x3479('0x2f')],_0x411bc9['filters']),_0x3a683b);if(_0x4574e1['query'][_0x3479('0x3c')]){_0x1772af[_0x3479('0x3a')]=_[_0x3479('0x3d')](_0x1772af['where'],{'$or':_['map'](_0x3a683b,function(_0x524bab){if(_0x524bab[_0x3479('0x2d')]!==_0x3479('0x3e')){var _0x14263c={};_0x14263c[_0x524bab[_0x3479('0x27')]]={'$like':'%'+_0x4574e1[_0x3479('0x2f')]['filter']+'%'};return _0x14263c;}})});}_0x1772af=_[_0x3479('0x3d')]({},_0x1772af,_0x4574e1[_0x3479('0x3f')]);var _0x249253={'where':_0x1772af[_0x3479('0x3a')]};return db[_0x3479('0x40')][_0x3479('0x1e')](_0x249253)['then'](function(_0x4038a5){_0x49ef36[_0x3479('0x1e')]=_0x4038a5;if(_0x4574e1['query'][_0x3479('0x41')]){_0x1772af['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x3479('0x42')](_0x1772af);})['then'](function(_0x27bc47){_0x49ef36[_0x3479('0x43')]=_0x27bc47;return _0x49ef36;})[_0x3479('0x24')](respondWithFilteredResult(_0x314656,_0x1772af))[_0x3479('0x44')](handleError(_0x314656,null));};exports[_0x3479('0x45')]=function(_0x3ab048,_0x49abcb){var _0x3fbbfd={'raw':!![],'where':{'id':_0x3ab048[_0x3479('0x46')]['id']}},_0xf8951a={};_0xf8951a[_0x3479('0x32')]=_['keys'](db['AnalyticTreeReport'][_0x3479('0x2b')]);_0xf8951a[_0x3479('0x2f')]=_['keys'](_0x3ab048['query']);_0xf8951a['filters']=_[_0x3479('0x31')](_0xf8951a['model'],_0xf8951a[_0x3479('0x2f')]);_0x3fbbfd[_0x3479('0x33')]=_[_0x3479('0x31')](_0xf8951a[_0x3479('0x32')],qs[_0x3479('0x34')](_0x3ab048[_0x3479('0x2f')][_0x3479('0x34')]));_0x3fbbfd[_0x3479('0x33')]=_0x3fbbfd[_0x3479('0x33')]['length']?_0x3fbbfd['attributes']:_0xf8951a[_0x3479('0x32')];if(_0x3ab048[_0x3479('0x2f')][_0x3479('0x41')]){_0x3fbbfd[_0x3479('0x47')]=[{'all':!![]}];}_0x3fbbfd=_[_0x3479('0x3d')]({},_0x3fbbfd,_0x3ab048[_0x3479('0x3f')]);return db['AnalyticTreeReport'][_0x3479('0x48')](_0x3fbbfd)['then'](handleEntityNotFound(_0x49abcb,null))[_0x3479('0x24')](respondWithResult(_0x49abcb,null))[_0x3479('0x44')](handleError(_0x49abcb,null));};exports['create']=function(_0x4274a5,_0x8519ec){return db[_0x3479('0x40')][_0x3479('0x49')](_0x4274a5[_0x3479('0x4a')],{})[_0x3479('0x24')](respondWithResult(_0x8519ec,0xc9))[_0x3479('0x44')](handleError(_0x8519ec,null));};exports[_0x3479('0x4b')]=function(_0x5be356,_0x39ffd8){if(_0x5be356['body']['id']){delete _0x5be356['body']['id'];}return db[_0x3479('0x40')]['find']({'where':{'id':_0x5be356['params']['id']}})['then'](handleEntityNotFound(_0x39ffd8,null))[_0x3479('0x24')](saveUpdates(_0x5be356[_0x3479('0x4a')],null))[_0x3479('0x24')](respondWithResult(_0x39ffd8,null))[_0x3479('0x44')](handleError(_0x39ffd8,null));};exports['destroy']=function(_0x1eed14,_0x4ef6fe){return db[_0x3479('0x40')][_0x3479('0x48')]({'where':{'id':_0x1eed14[_0x3479('0x46')]['id']}})[_0x3479('0x24')](handleEntityNotFound(_0x4ef6fe,null))[_0x3479('0x24')](removeEntity(_0x4ef6fe,null))['catch'](handleError(_0x4ef6fe,null));};
\ No newline at end of file
+var _0xcefd=['mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','limit','undefined','count','offset','set','Content-Range','apply','reject','update','error','stack','send','index','map','AnalyticTreeReport','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','VIRTUAL','merge','include','findAll','then','catch','show','params','rawAttributes','includeAll','options','create','body','destroy','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x267ce8,_0x4dd75c){var _0x5877a1=function(_0x1add15){while(--_0x1add15){_0x267ce8['push'](_0x267ce8['shift']());}};_0x5877a1(++_0x4dd75c);}(_0xcefd,0x12a));var _0xdcef=function(_0x19ebef,_0x451d2c){_0x19ebef=_0x19ebef-0x0;var _0x4aac24=_0xcefd[_0x19ebef];return _0x4aac24;};'use strict';var emlformat=require(_0xdcef('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xdcef('0x1'));var jsonpatch=require(_0xdcef('0x2'));var rp=require(_0xdcef('0x3'));var moment=require(_0xdcef('0x4'));var BPromise=require(_0xdcef('0x5'));var Mustache=require(_0xdcef('0x6'));var util=require(_0xdcef('0x7'));var path=require(_0xdcef('0x8'));var sox=require(_0xdcef('0x9'));var csv=require(_0xdcef('0xa'));var ejs=require(_0xdcef('0xb'));var fs=require('fs');var fs_extra=require(_0xdcef('0xc'));var _=require('lodash');var squel=require(_0xdcef('0xd'));var crypto=require(_0xdcef('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdcef('0xf'));var toCsv=require(_0xdcef('0xa'));var querystring=require('querystring');var Papa=require(_0xdcef('0x10'));var Redis=require(_0xdcef('0x11'));var authService=require(_0xdcef('0x12'));var qs=require(_0xdcef('0x13'));var as=require(_0xdcef('0x14'));var hardwareService=require(_0xdcef('0x15'));var logger=require(_0xdcef('0x16'))(_0xdcef('0x17'));var utils=require(_0xdcef('0x18'));var config=require(_0xdcef('0x19'));var licenseUtil=require(_0xdcef('0x1a'));var db=require(_0xdcef('0x1b'))['db'];function respondWithStatusCode(_0x928c5,_0x202695){_0x202695=_0x202695||0xcc;return function(_0x1ef92e){if(_0x1ef92e){return _0x928c5[_0xdcef('0x1c')](_0x202695);}return _0x928c5[_0xdcef('0x1d')](_0x202695)[_0xdcef('0x1e')]();};}function respondWithResult(_0x3a5c92,_0x70db35){_0x70db35=_0x70db35||0xc8;return function(_0x223c07){if(_0x223c07){return _0x3a5c92[_0xdcef('0x1d')](_0x70db35)['json'](_0x223c07);}};}function respondWithFilteredResult(_0x4e61d7,_0x2de880){return function(_0x56c421){if(_0x56c421){var _0x1b7864=typeof _0x2de880['offset']==='undefined'&&typeof _0x2de880[_0xdcef('0x1f')]===_0xdcef('0x20');var _0xdae725=_0x56c421[_0xdcef('0x21')];var _0x142c67=_0x1b7864?0x0:_0x2de880['offset'];var _0x16814d=_0x1b7864?_0x56c421[_0xdcef('0x21')]:_0x2de880[_0xdcef('0x22')]+_0x2de880[_0xdcef('0x1f')];var _0x2986fb;if(_0x16814d>=_0xdae725){_0x16814d=_0xdae725;_0x2986fb=0xc8;}else{_0x2986fb=0xce;}_0x4e61d7[_0xdcef('0x1d')](_0x2986fb);return _0x4e61d7[_0xdcef('0x23')](_0xdcef('0x24'),_0x142c67+'-'+_0x16814d+'/'+_0xdae725)['json'](_0x56c421);}return null;};}function patchUpdates(_0x2d7021){return function(_0x17a6cc){try{jsonpatch[_0xdcef('0x25')](_0x17a6cc,_0x2d7021,!![]);}catch(_0x704da8){return BPromise[_0xdcef('0x26')](_0x704da8);}return _0x17a6cc['save']();};}function saveUpdates(_0x4eee15,_0x35dcca){return function(_0x48e2d3){if(_0x48e2d3){return _0x48e2d3[_0xdcef('0x27')](_0x4eee15)['then'](function(_0x514b5c){return _0x514b5c;});}return null;};}function removeEntity(_0x575d0d,_0x1fb00d){return function(_0x24b36d){if(_0x24b36d){return _0x24b36d['destroy']()['then'](function(){_0x575d0d['status'](0xcc)[_0xdcef('0x1e')]();});}};}function handleEntityNotFound(_0x363a90,_0x497f32){return function(_0x44497e){if(!_0x44497e){_0x363a90[_0xdcef('0x1c')](0x194);}return _0x44497e;};}function handleError(_0x1badec,_0x49a8df){_0x49a8df=_0x49a8df||0x1f4;return function(_0x1edc0e){logger[_0xdcef('0x28')](_0x1edc0e[_0xdcef('0x29')]);if(_0x1edc0e['name']){delete _0x1edc0e['name'];}_0x1badec[_0xdcef('0x1d')](_0x49a8df)[_0xdcef('0x2a')](_0x1edc0e);};}exports[_0xdcef('0x2b')]=function(_0x1c0681,_0x251ca3){var _0x1e5b3f={},_0x107f1b={},_0x183d81={'count':0x0,'rows':[]};var _0x233040=_[_0xdcef('0x2c')](db[_0xdcef('0x2d')]['rawAttributes'],function(_0x4295b7){return{'name':_0x4295b7['fieldName'],'type':_0x4295b7[_0xdcef('0x2e')][_0xdcef('0x2f')]};});_0x107f1b[_0xdcef('0x30')]=_['map'](_0x233040,_0xdcef('0x31'));_0x107f1b[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0x1c0681[_0xdcef('0x32')]);_0x107f1b[_0xdcef('0x34')]=_[_0xdcef('0x35')](_0x107f1b[_0xdcef('0x30')],_0x107f1b[_0xdcef('0x32')]);_0x1e5b3f[_0xdcef('0x36')]=_[_0xdcef('0x35')](_0x107f1b['model'],qs[_0xdcef('0x37')](_0x1c0681[_0xdcef('0x32')]['fields']));_0x1e5b3f['attributes']=_0x1e5b3f[_0xdcef('0x36')][_0xdcef('0x38')]?_0x1e5b3f[_0xdcef('0x36')]:_0x107f1b[_0xdcef('0x30')];if(!_0x1c0681[_0xdcef('0x32')][_0xdcef('0x39')]('nolimit')){_0x1e5b3f[_0xdcef('0x1f')]=qs[_0xdcef('0x1f')](_0x1c0681[_0xdcef('0x32')][_0xdcef('0x1f')]);_0x1e5b3f[_0xdcef('0x22')]=qs[_0xdcef('0x22')](_0x1c0681[_0xdcef('0x32')][_0xdcef('0x22')]);}_0x1e5b3f[_0xdcef('0x3a')]=qs['sort'](_0x1c0681[_0xdcef('0x32')][_0xdcef('0x3b')]);_0x1e5b3f[_0xdcef('0x3c')]=qs[_0xdcef('0x34')](_['pick'](_0x1c0681[_0xdcef('0x32')],_0x107f1b['filters']),_0x233040);if(_0x1c0681[_0xdcef('0x32')]['filter']){_0x1e5b3f[_0xdcef('0x3c')]=_['merge'](_0x1e5b3f[_0xdcef('0x3c')],{'$or':_['map'](_0x233040,function(_0x368e48){if(_0x368e48[_0xdcef('0x2e')]!==_0xdcef('0x3d')){var _0x1f25db={};_0x1f25db[_0x368e48['name']]={'$like':'%'+_0x1c0681[_0xdcef('0x32')]['filter']+'%'};return _0x1f25db;}})});}_0x1e5b3f=_[_0xdcef('0x3e')]({},_0x1e5b3f,_0x1c0681['options']);var _0x3ce371={'where':_0x1e5b3f[_0xdcef('0x3c')]};return db[_0xdcef('0x2d')]['count'](_0x3ce371)['then'](function(_0x275d92){_0x183d81[_0xdcef('0x21')]=_0x275d92;if(_0x1c0681[_0xdcef('0x32')]['includeAll']){_0x1e5b3f[_0xdcef('0x3f')]=[{'all':!![]}];}return db[_0xdcef('0x2d')][_0xdcef('0x40')](_0x1e5b3f);})[_0xdcef('0x41')](function(_0x150753){_0x183d81['rows']=_0x150753;return _0x183d81;})[_0xdcef('0x41')](respondWithFilteredResult(_0x251ca3,_0x1e5b3f))[_0xdcef('0x42')](handleError(_0x251ca3,null));};exports[_0xdcef('0x43')]=function(_0xe83aff,_0x3e6eef){var _0x1c3416={'raw':!![],'where':{'id':_0xe83aff[_0xdcef('0x44')]['id']}},_0x3a0f7d={};_0x3a0f7d[_0xdcef('0x30')]=_[_0xdcef('0x33')](db[_0xdcef('0x2d')][_0xdcef('0x45')]);_0x3a0f7d[_0xdcef('0x32')]=_[_0xdcef('0x33')](_0xe83aff[_0xdcef('0x32')]);_0x3a0f7d[_0xdcef('0x34')]=_[_0xdcef('0x35')](_0x3a0f7d[_0xdcef('0x30')],_0x3a0f7d[_0xdcef('0x32')]);_0x1c3416[_0xdcef('0x36')]=_[_0xdcef('0x35')](_0x3a0f7d['model'],qs[_0xdcef('0x37')](_0xe83aff['query']['fields']));_0x1c3416[_0xdcef('0x36')]=_0x1c3416[_0xdcef('0x36')][_0xdcef('0x38')]?_0x1c3416[_0xdcef('0x36')]:_0x3a0f7d[_0xdcef('0x30')];if(_0xe83aff['query'][_0xdcef('0x46')]){_0x1c3416[_0xdcef('0x3f')]=[{'all':!![]}];}_0x1c3416=_[_0xdcef('0x3e')]({},_0x1c3416,_0xe83aff[_0xdcef('0x47')]);return db[_0xdcef('0x2d')]['find'](_0x1c3416)[_0xdcef('0x41')](handleEntityNotFound(_0x3e6eef,null))[_0xdcef('0x41')](respondWithResult(_0x3e6eef,null))[_0xdcef('0x42')](handleError(_0x3e6eef,null));};exports[_0xdcef('0x48')]=function(_0x3e7cb8,_0x2fbf3f){return db[_0xdcef('0x2d')][_0xdcef('0x48')](_0x3e7cb8[_0xdcef('0x49')],{})[_0xdcef('0x41')](respondWithResult(_0x2fbf3f,0xc9))[_0xdcef('0x42')](handleError(_0x2fbf3f,null));};exports[_0xdcef('0x27')]=function(_0x17b732,_0x35bfaf){if(_0x17b732['body']['id']){delete _0x17b732['body']['id'];}return db['AnalyticTreeReport']['find']({'where':{'id':_0x17b732['params']['id']}})[_0xdcef('0x41')](handleEntityNotFound(_0x35bfaf,null))[_0xdcef('0x41')](saveUpdates(_0x17b732[_0xdcef('0x49')],null))['then'](respondWithResult(_0x35bfaf,null))[_0xdcef('0x42')](handleError(_0x35bfaf,null));};exports[_0xdcef('0x4a')]=function(_0x1f8f54,_0x3f894f){return db[_0xdcef('0x2d')][_0xdcef('0x4b')]({'where':{'id':_0x1f8f54[_0xdcef('0x44')]['id']}})['then'](handleEntityNotFound(_0x3f894f,null))[_0xdcef('0x41')](removeEntity(_0x3f894f,null))[_0xdcef('0x42')](handleError(_0x3f894f,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 5f125cc..4dd0610 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.model.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3946=['request-promise','define','analytics_report_trees','../../config/logger','api','bluebird'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x3946,0x111));var _0x6394=function(_0x27b6e3,_0x3445d1){_0x27b6e3=_0x27b6e3-0x0;var _0x3b2f1a=_0x3946[_0x27b6e3];return _0x3b2f1a;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6394('0x0'))(_0x6394('0x1'));var moment=require('moment');var BPromise=require(_0x6394('0x2'));var rp=require(_0x6394('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x51e3f9,_0x31ea0d){return _0x51e3f9[_0x6394('0x4')]('AnalyticTreeReport',attributes,{'tableName':_0x6394('0x5'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x79fc=['api','moment','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','lodash','util'];(function(_0x208505,_0x241a77){var _0x1a985f=function(_0x4a5110){while(--_0x4a5110){_0x208505['push'](_0x208505['shift']());}};_0x1a985f(++_0x241a77);}(_0x79fc,0x1a5));var _0xc79f=function(_0x38fea3,_0x4601cf){_0x38fea3=_0x38fea3-0x0;var _0x5de2d5=_0x79fc[_0x38fea3];return _0x5de2d5;};'use strict';var _=require(_0xc79f('0x0'));var util=require(_0xc79f('0x1'));var logger=require('../../config/logger')(_0xc79f('0x2'));var moment=require(_0xc79f('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc79f('0x4'));var config=require(_0xc79f('0x5'));var attributes=require(_0xc79f('0x6'));module[_0xc79f('0x7')]=function(_0x7f815b,_0x11fe3c){return _0x7f815b['define'](_0xc79f('0x8'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index 58b1e51..56fad57 100644
--- a/server/api/analyticTreeReport/analyticTreeReport.rpc.js
+++ b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x51812c,_0x4e3782){var _0xe5465b=function(_0x57f41f){while(--_0x57f41f){_0x51812c['push'](_0x51812c['shift']());}};_0xe5465b(++_0x4e3782);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1e4360,_0x930b9b){_0x1e4360=_0x1e4360-0x0;var _0x31e6b4=_0xc4aa[_0x1e4360];return _0x31e6b4;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
+var _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0xee91f1,_0x59e7ce){var _0x477e68=function(_0x4df252){while(--_0x4df252){_0xee91f1['push'](_0xee91f1['shift']());}};_0x477e68(++_0x59e7ce);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xc4aa[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xac4a('0x0'));var util=require(_0xac4a('0x1'));var moment=require(_0xac4a('0x2'));var BPromise=require(_0xac4a('0x3'));var rs=require(_0xac4a('0x4'));var fs=require('fs');var Redis=require(_0xac4a('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xac4a('0x6'));var config=require(_0xac4a('0x7'));var jayson=require(_0xac4a('0x8'));var client=jayson[_0xac4a('0x9')][_0xac4a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15cd34,_0x3ef77c,_0x10525b){return new BPromise(function(_0x5c6179,_0x5b8339){return client[_0xac4a('0xb')](_0x15cd34,_0x10525b)[_0xac4a('0xc')](function(_0x26ec84){logger['info'](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));logger[_0xac4a('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x3ef77c,_0xac4a('0xe'),JSON['stringify'](_0x26ec84));if(_0x26ec84[_0xac4a('0x10')]){if(_0x26ec84['error'][_0xac4a('0x11')]===0x1f4){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84['error'][_0xac4a('0x12')]);return _0x5b8339(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);return _0x5c6179(_0x26ec84[_0xac4a('0x10')][_0xac4a('0x12')]);}else{logger[_0xac4a('0x13')](_0xac4a('0xd'),_0x3ef77c,_0xac4a('0xe'));_0x5c6179(_0x26ec84['result'][_0xac4a('0x12')]);}})[_0xac4a('0x14')](function(_0x23eb66){logger[_0xac4a('0x10')](_0xac4a('0xd'),_0x3ef77c,_0x23eb66);_0x5b8339(_0x23eb66);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index c37e737..1e18548 100644
--- a/server/api/analyticTreeReport/index.js
+++ b/server/api/analyticTreeReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2f9b=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','index','get','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','express','Router'];(function(_0x3d2977,_0x35289d){var _0x39392f=function(_0x5a28ee){while(--_0x5a28ee){_0x3d2977['push'](_0x3d2977['shift']());}};_0x39392f(++_0x35289d);}(_0x2f9b,0x10b));var _0xb2f9=function(_0x3ca095,_0xddb00c){_0x3ca095=_0x3ca095-0x0;var _0x494a59=_0x2f9b[_0x3ca095];return _0x494a59;};'use strict';var multer=require(_0xb2f9('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb2f9('0x1'));var router=express[_0xb2f9('0x2')]();var fs_extra=require(_0xb2f9('0x3'));var auth=require(_0xb2f9('0x4'));var interaction=require(_0xb2f9('0x5'));var config=require(_0xb2f9('0x6'));var controller=require(_0xb2f9('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xb2f9('0x8')]);router[_0xb2f9('0x9')]('/:id',auth[_0xb2f9('0xa')](),controller[_0xb2f9('0xb')]);router['post']('/',auth[_0xb2f9('0xa')](),controller[_0xb2f9('0xc')]);router[_0xb2f9('0xd')]('/:id',auth[_0xb2f9('0xa')](),controller[_0xb2f9('0xe')]);router[_0xb2f9('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb2f9('0x10')]);module[_0xb2f9('0x11')]=router;
\ No newline at end of file
+var _0x1d61=['get','isAuthenticated','index','/:id','put','update','delete','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller'];(function(_0x1af9ac,_0xf22e96){var _0x526b39=function(_0x2e6b51){while(--_0x2e6b51){_0x1af9ac['push'](_0x1af9ac['shift']());}};_0x526b39(++_0xf22e96);}(_0x1d61,0x170));var _0x11d6=function(_0x5cfb27,_0x1c4a9e){_0x5cfb27=_0x5cfb27-0x0;var _0x5a96e3=_0x1d61[_0x5cfb27];return _0x5a96e3;};'use strict';var multer=require(_0x11d6('0x0'));var util=require(_0x11d6('0x1'));var path=require('path');var timeout=require(_0x11d6('0x2'));var express=require(_0x11d6('0x3'));var router=express[_0x11d6('0x4')]();var fs_extra=require(_0x11d6('0x5'));var auth=require(_0x11d6('0x6'));var interaction=require(_0x11d6('0x7'));var config=require(_0x11d6('0x8'));var controller=require(_0x11d6('0x9'));router[_0x11d6('0xa')]('/',auth[_0x11d6('0xb')](),controller[_0x11d6('0xc')]);router[_0x11d6('0xa')](_0x11d6('0xd'),auth[_0x11d6('0xb')](),controller['show']);router['post']('/',auth[_0x11d6('0xb')](),controller['create']);router[_0x11d6('0xe')](_0x11d6('0xd'),auth['isAuthenticated'](),controller[_0x11d6('0xf')]);router[_0x11d6('0x10')](_0x11d6('0xd'),auth[_0x11d6('0xb')](),controller['destroy']);module[_0x11d6('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index 1ff25df..f780c66 100644
--- a/server/api/attachment/attachment.attributes.js
+++ b/server/api/attachment/attachment.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc368=['STRING','exports'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0xc368,0x7b));var _0x8c36=function(_0x4c6bf5,_0x565c2d){_0x4c6bf5=_0x4c6bf5-0x0;var _0x12b2c7=_0xc368[_0x4c6bf5];return _0x12b2c7;};'use strict';var Sequelize=require('sequelize');module[_0x8c36('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x8c36('0x1')]},'type':{'type':Sequelize[_0x8c36('0x1')]}};
\ No newline at end of file
+var _0x6873=['STRING'];(function(_0x1cc06f,_0x53634b){var _0x4956e7=function(_0x452b4a){while(--_0x452b4a){_0x1cc06f['push'](_0x1cc06f['shift']());}};_0x4956e7(++_0x53634b);}(_0x6873,0xac));var _0x3687=function(_0xa041de,_0x3600e2){_0xa041de=_0xa041de-0x0;var _0x1d654c=_0x6873[_0xa041de];return _0x1d654c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3687('0x0')]},'basename':{'type':Sequelize[_0x3687('0x0')]},'type':{'type':Sequelize[_0x3687('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 697cb20..81f3377 100644
--- a/server/api/attachment/attachment.controller.js
+++ b/server/api/attachment/attachment.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd830=['Attachment','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','clone','rawAttributes','get','omit','updatedAt','body','create','update','find','file','originalname','basename','filename','mimetype','download','ChatOfflineMessageId','join','root','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','end','name','send','index','map'];(function(_0x3fec6a,_0x4e1ace){var _0x4f1f30=function(_0x4c6d42){while(--_0x4c6d42){_0x3fec6a['push'](_0x3fec6a['shift']());}};_0x4f1f30(++_0x4e1ace);}(_0xd830,0x130));var _0x0d83=function(_0x201947,_0x2d1a5c){_0x201947=_0x201947-0x0;var _0x56f416=_0xd830[_0x201947];return _0x56f416;};'use strict';var emlformat=require(_0x0d83('0x0'));var rimraf=require(_0x0d83('0x1'));var zipdir=require(_0x0d83('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0d83('0x3'));var moment=require(_0x0d83('0x4'));var BPromise=require(_0x0d83('0x5'));var Mustache=require(_0x0d83('0x6'));var util=require(_0x0d83('0x7'));var path=require(_0x0d83('0x8'));var sox=require(_0x0d83('0x9'));var csv=require(_0x0d83('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x0d83('0xb'));var _=require('lodash');var squel=require(_0x0d83('0xc'));var crypto=require(_0x0d83('0xd'));var jsforce=require(_0x0d83('0xe'));var deskjs=require(_0x0d83('0xf'));var toCsv=require(_0x0d83('0xa'));var querystring=require(_0x0d83('0x10'));var Papa=require(_0x0d83('0x11'));var Redis=require(_0x0d83('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d83('0x13'));var logger=require(_0x0d83('0x14'))(_0x0d83('0x15'));var utils=require(_0x0d83('0x16'));var config=require(_0x0d83('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x0d83('0x18'))['db'];function respondWithStatusCode(_0x79b01f,_0x21350e){_0x21350e=_0x21350e||0xcc;return function(_0x3531fa){if(_0x3531fa){return _0x79b01f[_0x0d83('0x19')](_0x21350e);}return _0x79b01f[_0x0d83('0x1a')](_0x21350e)['end']();};}function respondWithResult(_0x2f90f0,_0x5c2b5f){_0x5c2b5f=_0x5c2b5f||0xc8;return function(_0x377b41){if(_0x377b41){return _0x2f90f0[_0x0d83('0x1a')](_0x5c2b5f)[_0x0d83('0x1b')](_0x377b41);}};}function respondWithFilteredResult(_0x1ad61d,_0x4781ad){return function(_0x10fdbc){if(_0x10fdbc){var _0x27928a=typeof _0x4781ad[_0x0d83('0x1c')]==='undefined'&&typeof _0x4781ad['limit']===_0x0d83('0x1d');var _0x5509b4=_0x10fdbc['count'];var _0x2b6e2a=_0x27928a?0x0:_0x4781ad['offset'];var _0xf1d83c=_0x27928a?_0x10fdbc[_0x0d83('0x1e')]:_0x4781ad['offset']+_0x4781ad[_0x0d83('0x1f')];var _0x39da79;if(_0xf1d83c>=_0x5509b4){_0xf1d83c=_0x5509b4;_0x39da79=0xc8;}else{_0x39da79=0xce;}_0x1ad61d['status'](_0x39da79);return _0x1ad61d[_0x0d83('0x20')](_0x0d83('0x21'),_0x2b6e2a+'-'+_0xf1d83c+'/'+_0x5509b4)[_0x0d83('0x1b')](_0x10fdbc);}return null;};}function patchUpdates(_0x12bcb7){return function(_0x3f2fb8){try{jsonpatch[_0x0d83('0x22')](_0x3f2fb8,_0x12bcb7,!![]);}catch(_0x4bdd40){return BPromise[_0x0d83('0x23')](_0x4bdd40);}return _0x3f2fb8[_0x0d83('0x24')]();};}function saveUpdates(_0x2ab2d6,_0x1171b4){return function(_0x5a0b45){if(_0x5a0b45){return _0x5a0b45['update'](_0x2ab2d6)[_0x0d83('0x25')](function(_0x2f64d6){return _0x2f64d6;});}return null;};}function removeEntity(_0x329364,_0x29d688){return function(_0x29c1c0){if(_0x29c1c0){return _0x29c1c0[_0x0d83('0x26')]()['then'](function(){_0x329364[_0x0d83('0x1a')](0xcc)[_0x0d83('0x27')]();});}};}function handleEntityNotFound(_0x49e3ea,_0x3bb57c){return function(_0x2ff642){if(!_0x2ff642){_0x49e3ea[_0x0d83('0x19')](0x194);}return _0x2ff642;};}function handleError(_0x5da92e,_0x442793){_0x442793=_0x442793||0x1f4;return function(_0x17b154){logger['error'](_0x17b154['stack']);if(_0x17b154['name']){delete _0x17b154[_0x0d83('0x28')];}_0x5da92e[_0x0d83('0x1a')](_0x442793)[_0x0d83('0x29')](_0x17b154);};}exports[_0x0d83('0x2a')]=function(_0x83686a,_0xc69f57){var _0x192947={},_0x561c32={},_0x5c8523={'count':0x0,'rows':[]};var _0x3ba1f1=_[_0x0d83('0x2b')](db[_0x0d83('0x2c')]['rawAttributes'],function(_0x5b55be){return{'name':_0x5b55be['fieldName'],'type':_0x5b55be['type'][_0x0d83('0x2d')]};});_0x561c32[_0x0d83('0x2e')]=_['map'](_0x3ba1f1,_0x0d83('0x28'));_0x561c32['query']=_[_0x0d83('0x2f')](_0x83686a['query']);_0x561c32[_0x0d83('0x30')]=_[_0x0d83('0x31')](_0x561c32['model'],_0x561c32[_0x0d83('0x32')]);_0x192947[_0x0d83('0x33')]=_[_0x0d83('0x31')](_0x561c32[_0x0d83('0x2e')],qs[_0x0d83('0x34')](_0x83686a[_0x0d83('0x32')][_0x0d83('0x34')]));_0x192947[_0x0d83('0x33')]=_0x192947['attributes'][_0x0d83('0x35')]?_0x192947[_0x0d83('0x33')]:_0x561c32[_0x0d83('0x2e')];if(!_0x83686a[_0x0d83('0x32')][_0x0d83('0x36')](_0x0d83('0x37'))){_0x192947['limit']=qs[_0x0d83('0x1f')](_0x83686a[_0x0d83('0x32')][_0x0d83('0x1f')]);_0x192947['offset']=qs[_0x0d83('0x1c')](_0x83686a[_0x0d83('0x32')][_0x0d83('0x1c')]);}_0x192947[_0x0d83('0x38')]=qs['sort'](_0x83686a['query']['sort']);_0x192947[_0x0d83('0x39')]=qs[_0x0d83('0x30')](_['pick'](_0x83686a[_0x0d83('0x32')],_0x561c32[_0x0d83('0x30')]),_0x3ba1f1);if(_0x83686a[_0x0d83('0x32')][_0x0d83('0x3a')]){_0x192947[_0x0d83('0x39')]=_[_0x0d83('0x3b')](_0x192947[_0x0d83('0x39')],{'$or':_[_0x0d83('0x2b')](_0x3ba1f1,function(_0x162c24){if(_0x162c24[_0x0d83('0x3c')]!==_0x0d83('0x3d')){var _0x299ec7={};_0x299ec7[_0x162c24[_0x0d83('0x28')]]={'$like':'%'+_0x83686a[_0x0d83('0x32')][_0x0d83('0x3a')]+'%'};return _0x299ec7;}})});}_0x192947=_['merge']({},_0x192947,_0x83686a[_0x0d83('0x3e')]);var _0x13b0ec={'where':_0x192947[_0x0d83('0x39')]};return db[_0x0d83('0x2c')][_0x0d83('0x1e')](_0x13b0ec)['then'](function(_0x349d06){_0x5c8523[_0x0d83('0x1e')]=_0x349d06;if(_0x83686a['query'][_0x0d83('0x3f')]){_0x192947['include']=[{'all':!![]}];}return db['Attachment'][_0x0d83('0x40')](_0x192947);})[_0x0d83('0x25')](function(_0x5c356f){_0x5c8523[_0x0d83('0x41')]=_0x5c356f;return _0x5c8523;})[_0x0d83('0x25')](respondWithFilteredResult(_0xc69f57,_0x192947))[_0x0d83('0x42')](handleError(_0xc69f57,null));};exports['show']=function(_0x492ee9,_0x584145){var _0x40aee5={'raw':!![],'where':{'id':_0x492ee9[_0x0d83('0x43')]['id']}},_0x1e1915={};_0x1e1915[_0x0d83('0x2e')]=_[_0x0d83('0x2f')](db[_0x0d83('0x2c')]['rawAttributes']);_0x1e1915[_0x0d83('0x32')]=_['keys'](_0x492ee9[_0x0d83('0x32')]);_0x1e1915[_0x0d83('0x30')]=_[_0x0d83('0x31')](_0x1e1915['model'],_0x1e1915[_0x0d83('0x32')]);_0x40aee5[_0x0d83('0x33')]=_[_0x0d83('0x31')](_0x1e1915['model'],qs['fields'](_0x492ee9[_0x0d83('0x32')][_0x0d83('0x34')]));_0x40aee5[_0x0d83('0x33')]=_0x40aee5[_0x0d83('0x33')][_0x0d83('0x35')]?_0x40aee5[_0x0d83('0x33')]:_0x1e1915[_0x0d83('0x2e')];if(_0x492ee9[_0x0d83('0x32')][_0x0d83('0x3f')]){_0x40aee5[_0x0d83('0x44')]=[{'all':!![]}];}_0x40aee5=_[_0x0d83('0x3b')]({},_0x40aee5,_0x492ee9['options']);return db['Attachment']['find'](_0x40aee5)[_0x0d83('0x25')](handleEntityNotFound(_0x584145,null))[_0x0d83('0x25')](respondWithResult(_0x584145,null))[_0x0d83('0x42')](handleError(_0x584145,null));};exports[_0x0d83('0x45')]=function(_0x16dfe9,_0x12339a){var _0x55e67f={'where':{'id':_0x16dfe9[_0x0d83('0x43')]['id']}},_0x5b584a={};_0x5b584a['model']=_[_0x0d83('0x2f')](db[_0x0d83('0x2c')][_0x0d83('0x46')]);_0x55e67f[_0x0d83('0x33')]=_[_0x0d83('0x31')](_0x5b584a[_0x0d83('0x2e')],qs[_0x0d83('0x34')](_0x16dfe9[_0x0d83('0x32')][_0x0d83('0x34')]));_0x55e67f[_0x0d83('0x33')]=_0x55e67f['attributes'][_0x0d83('0x35')]?_0x55e67f[_0x0d83('0x33')]:_0x5b584a['model'];if(_0x16dfe9[_0x0d83('0x32')][_0x0d83('0x3f')]){_0x55e67f[_0x0d83('0x44')]=[{'all':!![]}];}_0x55e67f=_[_0x0d83('0x3b')]({},_0x55e67f,_0x16dfe9[_0x0d83('0x3e')]);return db[_0x0d83('0x2c')]['find'](_0x55e67f)[_0x0d83('0x25')](handleEntityNotFound(_0x12339a,null))[_0x0d83('0x25')](function(_0x36cc1d){if(_0x36cc1d){var _0x19ab96=_0x36cc1d[_0x0d83('0x47')]({'plain':!![]});_0x19ab96=qs[_0x0d83('0x48')](_0x19ab96,['id','createdAt',_0x0d83('0x49')]);_0x16dfe9[_0x0d83('0x4a')]=_['omit'](_0x16dfe9['body'],['id','createdAt','updatedAt']);return db[_0x0d83('0x2c')][_0x0d83('0x4b')](_[_0x0d83('0x3b')](_0x19ab96,_0x16dfe9[_0x0d83('0x4a')]),{'include':_0x16dfe9[_0x0d83('0x32')][_0x0d83('0x3f')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x12339a,0xc9))[_0x0d83('0x42')](handleError(_0x12339a,null));};exports[_0x0d83('0x4c')]=function(_0x31609a,_0x1bfbde){if(_0x31609a[_0x0d83('0x4a')]['id']){delete _0x31609a[_0x0d83('0x4a')]['id'];}return db[_0x0d83('0x2c')]['find']({'where':{'id':_0x31609a[_0x0d83('0x43')]['id']}})[_0x0d83('0x25')](handleEntityNotFound(_0x1bfbde,null))[_0x0d83('0x25')](saveUpdates(_0x31609a[_0x0d83('0x4a')],null))[_0x0d83('0x25')](respondWithResult(_0x1bfbde,null))[_0x0d83('0x42')](handleError(_0x1bfbde,null));};exports[_0x0d83('0x26')]=function(_0x590ce1,_0x24ab1b){return db['Attachment'][_0x0d83('0x4d')]({'where':{'id':_0x590ce1[_0x0d83('0x43')]['id']}})['then'](handleEntityNotFound(_0x24ab1b,null))['then'](removeEntity(_0x24ab1b,null))['catch'](handleError(_0x24ab1b,null));};exports['create']=function(_0x2c058e,_0x280600,_0x4546fc){_0x2c058e[_0x0d83('0x4a')][_0x0d83('0x28')]=_0x2c058e[_0x0d83('0x4e')][_0x0d83('0x4f')];_0x2c058e[_0x0d83('0x4a')][_0x0d83('0x50')]=_0x2c058e[_0x0d83('0x4e')][_0x0d83('0x51')];_0x2c058e['body'][_0x0d83('0x3c')]=_0x2c058e[_0x0d83('0x4e')][_0x0d83('0x52')];return db['Attachment'][_0x0d83('0x4b')](_0x2c058e[_0x0d83('0x4a')])[_0x0d83('0x25')](respondWithResult(_0x280600,0xc9))[_0x0d83('0x42')](handleError(_0x280600,null));};exports[_0x0d83('0x53')]=function(_0x4c3224,_0x2b60f8,_0x933efd){return db[_0x0d83('0x2c')]['findOne']({'where':{'id':_0x4c3224[_0x0d83('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x2b60f8,null))['then'](function(_0x4c56fa){if(_0x4c56fa){var _0x3b8ee6=_0x4c56fa[_0x0d83('0x54')]!==null;var _0x39f7bb=path[_0x0d83('0x55')](config[_0x0d83('0x56')],'server/files/attachments/');if(_0x3b8ee6){_0x39f7bb=path[_0x0d83('0x55')](_0x39f7bb,'offline-chat/');}var _0x301a71=path[_0x0d83('0x55')](_0x39f7bb,_0x4c56fa[_0x0d83('0x50')]);return _0x2b60f8[_0x0d83('0x53')](_0x301a71);}})['catch'](handleError(_0x2b60f8,null));};
\ No newline at end of file
+var _0xa410=['map','filters','intersection','query','fields','attributes','length','nolimit','where','filter','merge','VIRTUAL','Attachment','includeAll','include','findAll','rows','catch','show','params','keys','find','clone','options','omit','updatedAt','body','createdAt','create','file','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','rawAttributes','fieldName','type','key','model'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xa410,0xdd));var _0x0a41=function(_0x4d3374,_0x11350d){_0x4d3374=_0x4d3374-0x0;var _0x1a2d8d=_0xa410[_0x4d3374];return _0x1a2d8d;};'use strict';var emlformat=require(_0x0a41('0x0'));var rimraf=require(_0x0a41('0x1'));var zipdir=require(_0x0a41('0x2'));var jsonpatch=require(_0x0a41('0x3'));var rp=require(_0x0a41('0x4'));var moment=require(_0x0a41('0x5'));var BPromise=require(_0x0a41('0x6'));var Mustache=require('mustache');var util=require(_0x0a41('0x7'));var path=require(_0x0a41('0x8'));var sox=require('sox');var csv=require(_0x0a41('0x9'));var ejs=require(_0x0a41('0xa'));var fs=require('fs');var fs_extra=require(_0x0a41('0xb'));var _=require(_0x0a41('0xc'));var squel=require('squel');var crypto=require(_0x0a41('0xd'));var jsforce=require(_0x0a41('0xe'));var deskjs=require(_0x0a41('0xf'));var toCsv=require(_0x0a41('0x9'));var querystring=require(_0x0a41('0x10'));var Papa=require(_0x0a41('0x11'));var Redis=require(_0x0a41('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0a41('0x13'));var as=require(_0x0a41('0x14'));var hardwareService=require(_0x0a41('0x15'));var logger=require(_0x0a41('0x16'))(_0x0a41('0x17'));var utils=require(_0x0a41('0x18'));var config=require(_0x0a41('0x19'));var licenseUtil=require(_0x0a41('0x1a'));var db=require(_0x0a41('0x1b'))['db'];function respondWithStatusCode(_0x19ce65,_0x3d8a8b){_0x3d8a8b=_0x3d8a8b||0xcc;return function(_0x50fcf6){if(_0x50fcf6){return _0x19ce65[_0x0a41('0x1c')](_0x3d8a8b);}return _0x19ce65[_0x0a41('0x1d')](_0x3d8a8b)[_0x0a41('0x1e')]();};}function respondWithResult(_0x5dac04,_0xb7de30){_0xb7de30=_0xb7de30||0xc8;return function(_0x3f1c1e){if(_0x3f1c1e){return _0x5dac04['status'](_0xb7de30)['json'](_0x3f1c1e);}};}function respondWithFilteredResult(_0x1e6af0,_0x29bdde){return function(_0x28411b){if(_0x28411b){var _0x3b8163=typeof _0x29bdde[_0x0a41('0x1f')]===_0x0a41('0x20')&&typeof _0x29bdde['limit']===_0x0a41('0x20');var _0x384a01=_0x28411b[_0x0a41('0x21')];var _0x3a0945=_0x3b8163?0x0:_0x29bdde[_0x0a41('0x1f')];var _0x1061a7=_0x3b8163?_0x28411b['count']:_0x29bdde[_0x0a41('0x1f')]+_0x29bdde[_0x0a41('0x22')];var _0x2bf93f;if(_0x1061a7>=_0x384a01){_0x1061a7=_0x384a01;_0x2bf93f=0xc8;}else{_0x2bf93f=0xce;}_0x1e6af0[_0x0a41('0x1d')](_0x2bf93f);return _0x1e6af0[_0x0a41('0x23')](_0x0a41('0x24'),_0x3a0945+'-'+_0x1061a7+'/'+_0x384a01)['json'](_0x28411b);}return null;};}function patchUpdates(_0x18c00d){return function(_0x551880){try{jsonpatch[_0x0a41('0x25')](_0x551880,_0x18c00d,!![]);}catch(_0x114672){return BPromise[_0x0a41('0x26')](_0x114672);}return _0x551880[_0x0a41('0x27')]();};}function saveUpdates(_0xa1c68a,_0x306e81){return function(_0xa68f44){if(_0xa68f44){return _0xa68f44[_0x0a41('0x28')](_0xa1c68a)[_0x0a41('0x29')](function(_0xa2d7e8){return _0xa2d7e8;});}return null;};}function removeEntity(_0x169d7b,_0x4dcc64){return function(_0x5be95f){if(_0x5be95f){return _0x5be95f[_0x0a41('0x2a')]()[_0x0a41('0x29')](function(){_0x169d7b[_0x0a41('0x1d')](0xcc)[_0x0a41('0x1e')]();});}};}function handleEntityNotFound(_0x94ef14,_0x28c9b5){return function(_0x5f2a4a){if(!_0x5f2a4a){_0x94ef14[_0x0a41('0x1c')](0x194);}return _0x5f2a4a;};}function handleError(_0x40bb21,_0x3de4a5){_0x3de4a5=_0x3de4a5||0x1f4;return function(_0x12458c){logger[_0x0a41('0x2b')](_0x12458c['stack']);if(_0x12458c['name']){delete _0x12458c[_0x0a41('0x2c')];}_0x40bb21[_0x0a41('0x1d')](_0x3de4a5)[_0x0a41('0x2d')](_0x12458c);};}exports[_0x0a41('0x2e')]=function(_0x8934f0,_0x435375){var _0x2f81fd={},_0x5ff1b4={},_0x33da49={'count':0x0,'rows':[]};var _0x533b7b=_['map'](db['Attachment'][_0x0a41('0x2f')],function(_0x976ea7){return{'name':_0x976ea7[_0x0a41('0x30')],'type':_0x976ea7[_0x0a41('0x31')][_0x0a41('0x32')]};});_0x5ff1b4[_0x0a41('0x33')]=_[_0x0a41('0x34')](_0x533b7b,_0x0a41('0x2c'));_0x5ff1b4['query']=_['keys'](_0x8934f0['query']);_0x5ff1b4[_0x0a41('0x35')]=_[_0x0a41('0x36')](_0x5ff1b4[_0x0a41('0x33')],_0x5ff1b4[_0x0a41('0x37')]);_0x2f81fd['attributes']=_['intersection'](_0x5ff1b4[_0x0a41('0x33')],qs['fields'](_0x8934f0['query'][_0x0a41('0x38')]));_0x2f81fd[_0x0a41('0x39')]=_0x2f81fd[_0x0a41('0x39')][_0x0a41('0x3a')]?_0x2f81fd[_0x0a41('0x39')]:_0x5ff1b4[_0x0a41('0x33')];if(!_0x8934f0[_0x0a41('0x37')]['hasOwnProperty'](_0x0a41('0x3b'))){_0x2f81fd[_0x0a41('0x22')]=qs['limit'](_0x8934f0['query'][_0x0a41('0x22')]);_0x2f81fd[_0x0a41('0x1f')]=qs[_0x0a41('0x1f')](_0x8934f0['query'][_0x0a41('0x1f')]);}_0x2f81fd['order']=qs['sort'](_0x8934f0['query']['sort']);_0x2f81fd[_0x0a41('0x3c')]=qs[_0x0a41('0x35')](_['pick'](_0x8934f0['query'],_0x5ff1b4['filters']),_0x533b7b);if(_0x8934f0[_0x0a41('0x37')][_0x0a41('0x3d')]){_0x2f81fd[_0x0a41('0x3c')]=_[_0x0a41('0x3e')](_0x2f81fd['where'],{'$or':_[_0x0a41('0x34')](_0x533b7b,function(_0xf6d5bd){if(_0xf6d5bd['type']!==_0x0a41('0x3f')){var _0xdaada4={};_0xdaada4[_0xf6d5bd[_0x0a41('0x2c')]]={'$like':'%'+_0x8934f0[_0x0a41('0x37')][_0x0a41('0x3d')]+'%'};return _0xdaada4;}})});}_0x2f81fd=_[_0x0a41('0x3e')]({},_0x2f81fd,_0x8934f0['options']);var _0x342fc6={'where':_0x2f81fd[_0x0a41('0x3c')]};return db[_0x0a41('0x40')][_0x0a41('0x21')](_0x342fc6)['then'](function(_0x1dbcf4){_0x33da49[_0x0a41('0x21')]=_0x1dbcf4;if(_0x8934f0['query'][_0x0a41('0x41')]){_0x2f81fd[_0x0a41('0x42')]=[{'all':!![]}];}return db['Attachment'][_0x0a41('0x43')](_0x2f81fd);})['then'](function(_0x2c1e83){_0x33da49[_0x0a41('0x44')]=_0x2c1e83;return _0x33da49;})[_0x0a41('0x29')](respondWithFilteredResult(_0x435375,_0x2f81fd))[_0x0a41('0x45')](handleError(_0x435375,null));};exports[_0x0a41('0x46')]=function(_0x358b3d,_0x7dde7){var _0x40ff3d={'raw':!![],'where':{'id':_0x358b3d[_0x0a41('0x47')]['id']}},_0x138dbc={};_0x138dbc['model']=_[_0x0a41('0x48')](db['Attachment'][_0x0a41('0x2f')]);_0x138dbc['query']=_['keys'](_0x358b3d[_0x0a41('0x37')]);_0x138dbc[_0x0a41('0x35')]=_[_0x0a41('0x36')](_0x138dbc[_0x0a41('0x33')],_0x138dbc['query']);_0x40ff3d[_0x0a41('0x39')]=_[_0x0a41('0x36')](_0x138dbc[_0x0a41('0x33')],qs[_0x0a41('0x38')](_0x358b3d['query'][_0x0a41('0x38')]));_0x40ff3d[_0x0a41('0x39')]=_0x40ff3d['attributes'][_0x0a41('0x3a')]?_0x40ff3d[_0x0a41('0x39')]:_0x138dbc[_0x0a41('0x33')];if(_0x358b3d[_0x0a41('0x37')][_0x0a41('0x41')]){_0x40ff3d[_0x0a41('0x42')]=[{'all':!![]}];}_0x40ff3d=_[_0x0a41('0x3e')]({},_0x40ff3d,_0x358b3d['options']);return db['Attachment'][_0x0a41('0x49')](_0x40ff3d)['then'](handleEntityNotFound(_0x7dde7,null))[_0x0a41('0x29')](respondWithResult(_0x7dde7,null))[_0x0a41('0x45')](handleError(_0x7dde7,null));};exports[_0x0a41('0x4a')]=function(_0x8360da,_0x18ac99){var _0x3d31a2={'where':{'id':_0x8360da['params']['id']}},_0x51f3e5={};_0x51f3e5['model']=_[_0x0a41('0x48')](db[_0x0a41('0x40')][_0x0a41('0x2f')]);_0x3d31a2['attributes']=_[_0x0a41('0x36')](_0x51f3e5['model'],qs[_0x0a41('0x38')](_0x8360da[_0x0a41('0x37')][_0x0a41('0x38')]));_0x3d31a2[_0x0a41('0x39')]=_0x3d31a2[_0x0a41('0x39')]['length']?_0x3d31a2[_0x0a41('0x39')]:_0x51f3e5[_0x0a41('0x33')];if(_0x8360da['query'][_0x0a41('0x41')]){_0x3d31a2['include']=[{'all':!![]}];}_0x3d31a2=_[_0x0a41('0x3e')]({},_0x3d31a2,_0x8360da[_0x0a41('0x4b')]);return db[_0x0a41('0x40')]['find'](_0x3d31a2)['then'](handleEntityNotFound(_0x18ac99,null))['then'](function(_0xa98666){if(_0xa98666){var _0x5687c0=_0xa98666['get']({'plain':!![]});_0x5687c0=qs[_0x0a41('0x4c')](_0x5687c0,['id','createdAt',_0x0a41('0x4d')]);_0x8360da[_0x0a41('0x4e')]=_[_0x0a41('0x4c')](_0x8360da[_0x0a41('0x4e')],['id',_0x0a41('0x4f'),_0x0a41('0x4d')]);return db[_0x0a41('0x40')][_0x0a41('0x50')](_['merge'](_0x5687c0,_0x8360da[_0x0a41('0x4e')]),{'include':_0x8360da['query'][_0x0a41('0x41')]?[{'all':!![]}]:undefined});}})[_0x0a41('0x29')](respondWithResult(_0x18ac99,0xc9))[_0x0a41('0x45')](handleError(_0x18ac99,null));};exports[_0x0a41('0x28')]=function(_0x3c16ac,_0x435610){if(_0x3c16ac[_0x0a41('0x4e')]['id']){delete _0x3c16ac[_0x0a41('0x4e')]['id'];}return db['Attachment'][_0x0a41('0x49')]({'where':{'id':_0x3c16ac[_0x0a41('0x47')]['id']}})[_0x0a41('0x29')](handleEntityNotFound(_0x435610,null))[_0x0a41('0x29')](saveUpdates(_0x3c16ac[_0x0a41('0x4e')],null))[_0x0a41('0x29')](respondWithResult(_0x435610,null))[_0x0a41('0x45')](handleError(_0x435610,null));};exports[_0x0a41('0x2a')]=function(_0x3ba400,_0xf371a3){return db[_0x0a41('0x40')][_0x0a41('0x49')]({'where':{'id':_0x3ba400[_0x0a41('0x47')]['id']}})['then'](handleEntityNotFound(_0xf371a3,null))[_0x0a41('0x29')](removeEntity(_0xf371a3,null))[_0x0a41('0x45')](handleError(_0xf371a3,null));};exports[_0x0a41('0x50')]=function(_0x206791,_0x2ad972,_0x5c724b){_0x206791[_0x0a41('0x4e')]['name']=_0x206791[_0x0a41('0x51')]['originalname'];_0x206791[_0x0a41('0x4e')][_0x0a41('0x52')]=_0x206791[_0x0a41('0x51')][_0x0a41('0x53')];_0x206791[_0x0a41('0x4e')]['type']=_0x206791[_0x0a41('0x51')][_0x0a41('0x54')];return db[_0x0a41('0x40')][_0x0a41('0x50')](_0x206791[_0x0a41('0x4e')])[_0x0a41('0x29')](respondWithResult(_0x2ad972,0xc9))[_0x0a41('0x45')](handleError(_0x2ad972,null));};exports[_0x0a41('0x55')]=function(_0x3fb9c3,_0x18e947,_0x22020b){return db[_0x0a41('0x40')][_0x0a41('0x56')]({'where':{'id':_0x3fb9c3[_0x0a41('0x47')]['id']},'raw':!![]})[_0x0a41('0x29')](handleEntityNotFound(_0x18e947,null))[_0x0a41('0x29')](function(_0xbc9761){if(_0xbc9761){var _0x4156ad=_0xbc9761[_0x0a41('0x57')]!==null;var _0x452150=path[_0x0a41('0x58')](config[_0x0a41('0x59')],_0x0a41('0x5a'));if(_0x4156ad){_0x452150=path['join'](_0x452150,'offline-chat/');}var _0x2c6ae9=path[_0x0a41('0x58')](_0x452150,_0xbc9761[_0x0a41('0x52')]);return _0x18e947[_0x0a41('0x55')](_0x2c6ae9);}})[_0x0a41('0x45')](handleError(_0x18e947,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 72df8e6..6eff7c1 100644
--- a/server/api/attachment/attachment.model.js
+++ b/server/api/attachment/attachment.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0d33=['rimraf','./attachment.attributes','exports','attachments','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0d33,0x159));var _0x30d3=function(_0x3b7e6f,_0x1565b5){_0x3b7e6f=_0x3b7e6f-0x0;var _0x4873c3=_0x0d33[_0x3b7e6f];return _0x4873c3;};'use strict';var _=require(_0x30d3('0x0'));var util=require(_0x30d3('0x1'));var logger=require(_0x30d3('0x2'))(_0x30d3('0x3'));var moment=require(_0x30d3('0x4'));var BPromise=require(_0x30d3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x30d3('0x6'));var rimraf=require(_0x30d3('0x7'));var config=require('../../config/environment');var attributes=require(_0x30d3('0x8'));module[_0x30d3('0x9')]=function(_0x5e419b,_0x360246){return _0x5e419b['define']('Attachment',attributes,{'tableName':_0x30d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85c2=['util','../../config/logger','bluebird','request-promise','path','rimraf','exports','Attachment','attachments','lodash'];(function(_0x71af84,_0x5f514d){var _0x1d550d=function(_0x17f9f4){while(--_0x17f9f4){_0x71af84['push'](_0x71af84['shift']());}};_0x1d550d(++_0x5f514d);}(_0x85c2,0x77));var _0x285c=function(_0xdc37a1,_0x53ebb9){_0xdc37a1=_0xdc37a1-0x0;var _0x99b4fe=_0x85c2[_0xdc37a1];return _0x99b4fe;};'use strict';var _=require(_0x285c('0x0'));var util=require(_0x285c('0x1'));var logger=require(_0x285c('0x2'))('api');var moment=require('moment');var BPromise=require(_0x285c('0x3'));var rp=require(_0x285c('0x4'));var fs=require('fs');var path=require(_0x285c('0x5'));var rimraf=require(_0x285c('0x6'));var config=require('../../config/environment');var attributes=require('./attachment.attributes');module[_0x285c('0x7')]=function(_0x342d60,_0x191e62){return _0x342d60['define'](_0x285c('0x8'),attributes,{'tableName':_0x285c('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.rpc.js b/server/api/attachment/attachment.rpc.js
index fa064af..46b0d58 100644
--- a/server/api/attachment/attachment.rpc.js
+++ b/server/api/attachment/attachment.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4a47=['debug','Attachment,\x20%s,\x20%s,\x20%s','error','code','message','Attachment,\x20%s,\x20%s','result','catch','CreateAttachment','Attachment','create','options','stringify','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0xca9418,_0x13825d){var _0x2b7ab2=function(_0x4ccd0f){while(--_0x4ccd0f){_0xca9418['push'](_0xca9418['shift']());}};_0x2b7ab2(++_0x13825d);}(_0x4a47,0xb5));var _0x74a4=function(_0x3452eb,_0x44035e){_0x3452eb=_0x3452eb-0x0;var _0x4244fd=_0x4a47[_0x3452eb];return _0x4244fd;};'use strict';var _=require(_0x74a4('0x0'));var util=require(_0x74a4('0x1'));var moment=require(_0x74a4('0x2'));var BPromise=require(_0x74a4('0x3'));var rs=require(_0x74a4('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x74a4('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x74a4('0x6'))(_0x74a4('0x7'));var config=require('../../config/environment');var jayson=require(_0x74a4('0x8'));var client=jayson[_0x74a4('0x9')][_0x74a4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ebaa6,_0x41ef5a,_0x55e8a1){return new BPromise(function(_0x3122ba,_0x58e307){return client[_0x74a4('0xb')](_0x4ebaa6,_0x55e8a1)[_0x74a4('0xc')](function(_0x19f82b){logger[_0x74a4('0xd')]('Attachment,\x20%s,\x20%s',_0x41ef5a,_0x74a4('0xe'));logger[_0x74a4('0xf')](_0x74a4('0x10'),_0x41ef5a,_0x74a4('0xe'),JSON['stringify'](_0x19f82b));if(_0x19f82b[_0x74a4('0x11')]){if(_0x19f82b[_0x74a4('0x11')][_0x74a4('0x12')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x41ef5a,_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);return _0x58e307(_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);}logger[_0x74a4('0x11')](_0x74a4('0x14'),_0x41ef5a,_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);return _0x3122ba(_0x19f82b[_0x74a4('0x11')][_0x74a4('0x13')]);}else{logger[_0x74a4('0xd')](_0x74a4('0x14'),_0x41ef5a,_0x74a4('0xe'));_0x3122ba(_0x19f82b[_0x74a4('0x15')][_0x74a4('0x13')]);}})[_0x74a4('0x16')](function(_0x5d6dad){logger[_0x74a4('0x11')](_0x74a4('0x14'),_0x41ef5a,_0x5d6dad);_0x58e307(_0x5d6dad);});});}exports[_0x74a4('0x17')]=function(_0x2c9130){var _0x55cf53=this;return new Promise(function(_0xf224ef,_0x105998){return db[_0x74a4('0x18')][_0x74a4('0x19')](_0x2c9130['body'],{'raw':_0x2c9130[_0x74a4('0x1a')]?_0x2c9130[_0x74a4('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x74a4('0xc')](function(_0x2d3075){logger['info']('CreateAttachment',_0x2c9130);logger[_0x74a4('0xf')](_0x74a4('0x17'),_0x2c9130,JSON[_0x74a4('0x1b')](_0x2d3075));_0xf224ef(_0x2d3075);})[_0x74a4('0x16')](function(_0x484802){logger[_0x74a4('0x11')]('CreateAttachment',_0x484802['message'],_0x2c9130);_0x105998(_0x55cf53[_0x74a4('0x11')](0x1f4,_0x484802[_0x74a4('0x13')]));});});};
\ No newline at end of file
+var _0xe9ad=['Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','Attachment','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x453695,_0x5d23de){var _0x26b944=function(_0x508765){while(--_0x508765){_0x453695['push'](_0x453695['shift']());}};_0x26b944(++_0x5d23de);}(_0xe9ad,0x82));var _0xde9a=function(_0x114efe,_0x29836c){_0x114efe=_0x114efe-0x0;var _0x1d46ed=_0xe9ad[_0x114efe];return _0x1d46ed;};'use strict';var _=require(_0xde9a('0x0'));var util=require(_0xde9a('0x1'));var moment=require(_0xde9a('0x2'));var BPromise=require(_0xde9a('0x3'));var rs=require(_0xde9a('0x4'));var fs=require('fs');var Redis=require(_0xde9a('0x5'));var db=require(_0xde9a('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xde9a('0x7'))(_0xde9a('0x8'));var config=require(_0xde9a('0x9'));var jayson=require(_0xde9a('0xa'));var client=jayson['client'][_0xde9a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bb666,_0xd47b9c,_0x5d4412){return new BPromise(function(_0x45d4a7,_0x17f89b){return client[_0xde9a('0xc')](_0x2bb666,_0x5d4412)[_0xde9a('0xd')](function(_0x297975){logger[_0xde9a('0xe')](_0xde9a('0xf'),_0xd47b9c,_0xde9a('0x10'));logger[_0xde9a('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0xd47b9c,_0xde9a('0x10'),JSON[_0xde9a('0x12')](_0x297975));if(_0x297975[_0xde9a('0x13')]){if(_0x297975[_0xde9a('0x13')][_0xde9a('0x14')]===0x1f4){logger[_0xde9a('0x13')](_0xde9a('0xf'),_0xd47b9c,_0x297975[_0xde9a('0x13')][_0xde9a('0x15')]);return _0x17f89b(_0x297975['error'][_0xde9a('0x15')]);}logger[_0xde9a('0x13')](_0xde9a('0xf'),_0xd47b9c,_0x297975[_0xde9a('0x13')][_0xde9a('0x15')]);return _0x45d4a7(_0x297975[_0xde9a('0x13')][_0xde9a('0x15')]);}else{logger[_0xde9a('0xe')](_0xde9a('0xf'),_0xd47b9c,_0xde9a('0x10'));_0x45d4a7(_0x297975[_0xde9a('0x16')][_0xde9a('0x15')]);}})[_0xde9a('0x17')](function(_0x39e1d0){logger[_0xde9a('0x13')](_0xde9a('0xf'),_0xd47b9c,_0x39e1d0);_0x17f89b(_0x39e1d0);});});}exports['CreateAttachment']=function(_0x12ba7f){var _0x2714a9=this;return new Promise(function(_0x3b89ef,_0x57613b){return db[_0xde9a('0x18')]['create'](_0x12ba7f[_0xde9a('0x19')],{'raw':_0x12ba7f['options']?_0x12ba7f[_0xde9a('0x1a')][_0xde9a('0x1b')]===undefined?!![]:![]:!![]})[_0xde9a('0xd')](function(_0x4add81){logger[_0xde9a('0xe')](_0xde9a('0x1c'),_0x12ba7f);logger['debug']('CreateAttachment',_0x12ba7f,JSON[_0xde9a('0x12')](_0x4add81));_0x3b89ef(_0x4add81);})[_0xde9a('0x17')](function(_0x56550b){logger[_0xde9a('0x13')](_0xde9a('0x1c'),_0x56550b[_0xde9a('0x15')],_0x12ba7f);_0x57613b(_0x2714a9[_0xde9a('0x13')](0x1f4,_0x56550b[_0xde9a('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index f1ff497..f9e1939 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x5c3ff9,_0x5536bd){var _0x3a72d3=function(_0x3214b0){while(--_0x3214b0){_0x5c3ff9['push'](_0x5c3ff9['shift']());}};_0x3a72d3(++_0x5536bd);}(_0x757a,0xde));var _0xa757=function(_0x2d42fc,_0x21a024){_0x2d42fc=_0x2d42fc-0x0;var _0x2b6712=_0x757a[_0x2d42fc];return _0x2b6712;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x2f7b0a,_0x5bd99c){var _0x8294db=function(_0x397f1c){while(--_0x397f1c){_0x2f7b0a['push'](_0x2f7b0a['shift']());}};_0x8294db(++_0x5bd99c);}(_0xb10b,0x12a));var _0xbb10=function(_0x52b91f,_0x499757){_0x52b91f=_0x52b91f-0x0;var _0x15f8f5=_0xb10b[_0x52b91f];return _0x15f8f5;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 214a5ac..c3deac3 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcc66=['disabled','blocked','blockedAt','online','user','agent','minutes','clearBlockUser','getLicense','status','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../mysqldb','../../config/environment','../../config/logger','api','activedirectory','undefined','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','error','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','blockDuration','then','adSsoEnabled','findOne','name','password','salt'];(function(_0x4fa969,_0x21bf85){var _0x2ebba5=function(_0x487ae0){while(--_0x487ae0){_0x4fa969['push'](_0x4fa969['shift']());}};_0x2ebba5(++_0x21bf85);}(_0xcc66,0x1f4));var _0x6cc6=function(_0xaa8fca,_0x1044ef){_0xaa8fca=_0xaa8fca-0x0;var _0x20d459=_0xcc66[_0xaa8fca];return _0x20d459;};'use strict';var passport=require(_0x6cc6('0x0'));var LocalStrategy=require(_0x6cc6('0x1'))[_0x6cc6('0x2')];var moment=require(_0x6cc6('0x3'));var ActiveDirectory=require(_0x6cc6('0x4'));var BPromise=require(_0x6cc6('0x5'));var util=require(_0x6cc6('0x6'));var db=require(_0x6cc6('0x7'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x6cc6('0x8'));var logger=require(_0x6cc6('0x9'))(_0x6cc6('0xa'));function isActiveDirectoryConfigured(_0x3cb107){var _0x586a8b=![];if(typeof _0x3cb107[_0x6cc6('0xb')]!==_0x6cc6('0xc')){_0x586a8b=_0x3cb107['activedirectory']['baseDN']&&_0x3cb107[_0x6cc6('0xb')]['url']&&_0x3cb107[_0x6cc6('0xb')]['domain'];}return _0x586a8b;}function adAuthenticate(_0xafdf82,_0x32615c,_0x5a3faf){return new BPromise(function(_0x4e7f5b,_0x3e9a0a){try{var _0x3a1236=new ActiveDirectory(_0xafdf82);_0x3a1236[_0x6cc6('0xd')](_0x32615c,_0x5a3faf,function(_0x4b7237,_0x41cbee){if(_0x4b7237){logger['error'](_0x6cc6('0xe'),_0x32615c,util[_0x6cc6('0xf')](_0x4b7237,{'showHidden':![],'depth':null}));_0x3e9a0a(_0x6cc6('0x10'));}else if(!_0x41cbee){logger['error'](_0x6cc6('0x11'),_0x32615c);_0x3e9a0a(_0x6cc6('0x10'));}else{_0x4e7f5b(_0x41cbee);}});}catch(_0x1f2981){_0x3e9a0a(_0x1f2981);}});}function ActiveDirectoryAuthenticate(_0x20a85c,_0x1f9dad,_0x47172e,_0x3ad593){var _0x137742,_0x38c6a8;if(!isActiveDirectoryConfigured(config)){logger[_0x6cc6('0x12')](_0x6cc6('0x13'),_0x1f9dad);return _0x3ad593(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db[_0x6cc6('0x14')]['findOne']({'where':{'id':0x1},'attributes':['adSsoEnabled',_0x6cc6('0x15')],'raw':!![]})[_0x6cc6('0x16')](function(_0x486043){_0x137742=_0x486043;if(!_0x137742[_0x6cc6('0x17')]){logger['error']('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x1f9dad);throw new Error(_0x6cc6('0x10'));}return _0x20a85c[_0x6cc6('0x18')]({'attributes':['id',_0x6cc6('0x19'),_0x6cc6('0x1a'),_0x6cc6('0x1b'),'role',_0x6cc6('0x1c'),_0x6cc6('0x1d'),_0x6cc6('0x1e'),_0x6cc6('0x1f')],'where':{'name':_0x1f9dad,'role':{'$or':['admin',_0x6cc6('0x20'),_0x6cc6('0x21')]},'adSsoEnabled':!![]}});})[_0x6cc6('0x16')](function(_0x61580){if(!_0x61580||_0x61580&&_0x61580[_0x6cc6('0x19')]!==_0x1f9dad){throw new Error(_0x6cc6('0x10'));}_0x38c6a8=_0x61580;var _0x2ee714=_0x38c6a8['name']+'@'+config[_0x6cc6('0xb')]['domain'];return adAuthenticate(config[_0x6cc6('0xb')],_0x2ee714,_0x47172e);})[_0x6cc6('0x16')](function(_0x144c5d){if(_0x38c6a8[_0x6cc6('0x1c')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x137742['blockDuration']>0x0){if(_0x38c6a8['blocked']){if(moment(_0x38c6a8[_0x6cc6('0x1e')])['add'](_0x137742[_0x6cc6('0x15')],_0x6cc6('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x6cc6('0x23')](_0x38c6a8,0x0,![],null)[_0x6cc6('0x16')](function(){return utils[_0x6cc6('0x24')](_0x38c6a8);})[_0x6cc6('0x16')](function(){return _0x3ad593(null,_0x38c6a8);});}else{return utils['getLicense'](_0x38c6a8)[_0x6cc6('0x16')](function(){return _0x3ad593(null,_0x38c6a8);});}}else{return utils['getLicense'](_0x38c6a8)['then'](function(){return _0x3ad593(null,_0x38c6a8);});}})['catch'](function(_0x380957){return _0x3ad593(null,![],_0x380957);});}function handleError(_0x24ebc1,_0x32544c,_0x45b657){return _0x24ebc1[_0x6cc6('0x25')](_0x32544c||0x1f4)['send']({'message':_0x45b657?_0x45b657[_0x6cc6('0x26')]||_0x45b657:''});}exports[_0x6cc6('0x27')]=function(_0x42f73d,_0x46c692,_0x4b3ef2){passport[_0x6cc6('0xd')](_0x6cc6('0x28'),function(_0xad9fe6,_0x18eb96,_0x1602cd){var _0x659b2=_0xad9fe6||_0x1602cd;if(_0x659b2){return handleError(_0x46c692,0x191,_0x659b2);}if(!_0x18eb96){return handleError(_0x46c692,0x194,{'message':_0x6cc6('0x29')});}else{var _0x4da2a7={'payload':{'id':_0x18eb96['id'],'role':_0x18eb96['role']},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x4da2a7)[_0x6cc6('0x16')](function(_0x5d2f84){_0x46c692['json']({'id':_0x18eb96['id'],'token':_0x5d2f84,'statusCall':'','isAlreadyLogged':_0x18eb96['online']});});}})(_0x42f73d,_0x46c692,_0x4b3ef2);};passport[_0x6cc6('0x2a')](_0x6cc6('0x28'),new LocalStrategy({'usernameField':_0x6cc6('0x19'),'passwordField':_0x6cc6('0x1a')},function(_0xc5724,_0x562bc3,_0x3ce9ee){return ActiveDirectoryAuthenticate(db[_0x6cc6('0x2b')],_0xc5724,_0x562bc3,_0x3ce9ee);}));
\ No newline at end of file
+var _0x544f=['online','use','ad-login','User','passport','passport-local','Strategy','activedirectory2','bluebird','util','../../mysqldb','../../config/environment','../../config/logger','api','activedirectory','undefined','baseDN','domain','authenticate','error','inspect','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','findOne','adSsoEnabled','blockDuration','name','password','role','disabled','blocked','blockedAt','admin','user','then','add','clearBlockUser','getLicense','status','send','message','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json'];(function(_0x5ac60c,_0x437c16){var _0x10692a=function(_0x3e1937){while(--_0x3e1937){_0x5ac60c['push'](_0x5ac60c['shift']());}};_0x10692a(++_0x437c16);}(_0x544f,0xbc));var _0xf544=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x544f[_0x29d94e];return _0x106237;};'use strict';var passport=require(_0xf544('0x0'));var LocalStrategy=require(_0xf544('0x1'))[_0xf544('0x2')];var moment=require('moment');var ActiveDirectory=require(_0xf544('0x3'));var BPromise=require(_0xf544('0x4'));var util=require(_0xf544('0x5'));var db=require(_0xf544('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xf544('0x7'));var logger=require(_0xf544('0x8'))(_0xf544('0x9'));function isActiveDirectoryConfigured(_0x1b93c3){var _0x57ff7a=![];if(typeof _0x1b93c3[_0xf544('0xa')]!==_0xf544('0xb')){_0x57ff7a=_0x1b93c3['activedirectory'][_0xf544('0xc')]&&_0x1b93c3[_0xf544('0xa')]['url']&&_0x1b93c3[_0xf544('0xa')][_0xf544('0xd')];}return _0x57ff7a;}function adAuthenticate(_0x547c94,_0x591db2,_0x4f9ff0){return new BPromise(function(_0x15d603,_0x43a691){try{var _0x28ec8e=new ActiveDirectory(_0x547c94);_0x28ec8e[_0xf544('0xe')](_0x591db2,_0x4f9ff0,function(_0x55ffe1,_0x597d8d){if(_0x55ffe1){logger[_0xf544('0xf')]('Error\x20authenticate\x20%s:\x20%s',_0x591db2,util[_0xf544('0x10')](_0x55ffe1,{'showHidden':![],'depth':null}));_0x43a691('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x597d8d){logger[_0xf544('0xf')](_0xf544('0x11'),_0x591db2);_0x43a691(_0xf544('0x12'));}else{_0x15d603(_0x597d8d);}});}catch(_0xb4e95f){_0x43a691(_0xb4e95f);}});}function ActiveDirectoryAuthenticate(_0x13f2b7,_0x240f07,_0x415c48,_0x1ef0fd){var _0x1e1844,_0x2b14e6;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xf544('0x13'),_0x240f07);return _0x1ef0fd(null,![],{'message':_0xf544('0x12')});}return db['Setting'][_0xf544('0x14')]({'where':{'id':0x1},'attributes':[_0xf544('0x15'),_0xf544('0x16')],'raw':!![]})['then'](function(_0x5aee58){_0x1e1844=_0x5aee58;if(!_0x1e1844[_0xf544('0x15')]){logger[_0xf544('0xf')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x240f07);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x13f2b7['findOne']({'attributes':['id',_0xf544('0x17'),_0xf544('0x18'),'salt',_0xf544('0x19'),_0xf544('0x1a'),_0xf544('0x1b'),_0xf544('0x1c'),'online'],'where':{'name':_0x240f07,'role':{'$or':[_0xf544('0x1d'),_0xf544('0x1e'),'agent']},'adSsoEnabled':!![]}});})[_0xf544('0x1f')](function(_0x389223){if(!_0x389223||_0x389223&&_0x389223['name']!==_0x240f07){throw new Error(_0xf544('0x12'));}_0x2b14e6=_0x389223;var _0xb01c23=_0x2b14e6[_0xf544('0x17')]+'@'+config[_0xf544('0xa')]['domain'];return adAuthenticate(config[_0xf544('0xa')],_0xb01c23,_0x415c48);})[_0xf544('0x1f')](function(_0x19e5d7){if(_0x2b14e6[_0xf544('0x1a')]){throw new Error(_0xf544('0x12'));}if(_0x1e1844[_0xf544('0x16')]>0x0){if(_0x2b14e6['blocked']){if(moment(_0x2b14e6[_0xf544('0x1c')])[_0xf544('0x20')](_0x1e1844[_0xf544('0x16')],'minutes')>moment()){throw new Error(_0xf544('0x12'));}return utils[_0xf544('0x21')](_0x2b14e6,0x0,![],null)[_0xf544('0x1f')](function(){return utils['getLicense'](_0x2b14e6);})[_0xf544('0x1f')](function(){return _0x1ef0fd(null,_0x2b14e6);});}else{return utils['getLicense'](_0x2b14e6)[_0xf544('0x1f')](function(){return _0x1ef0fd(null,_0x2b14e6);});}}else{return utils[_0xf544('0x22')](_0x2b14e6)[_0xf544('0x1f')](function(){return _0x1ef0fd(null,_0x2b14e6);});}})['catch'](function(_0x40a14b){return _0x1ef0fd(null,![],_0x40a14b);});}function handleError(_0x4becef,_0x40c35e,_0x4c8728){return _0x4becef[_0xf544('0x23')](_0x40c35e||0x1f4)[_0xf544('0x24')]({'message':_0x4c8728?_0x4c8728[_0xf544('0x25')]||_0x4c8728:''});}exports[_0xf544('0x26')]=function(_0x56a7f2,_0x1495aa,_0x455b67){passport[_0xf544('0xe')]('ad-login',function(_0x19f60e,_0x4c38c3,_0x233c39){var _0x21c20c=_0x19f60e||_0x233c39;if(_0x21c20c){return handleError(_0x1495aa,0x191,_0x21c20c);}if(!_0x4c38c3){return handleError(_0x1495aa,0x194,{'message':_0xf544('0x27')});}else{var _0xfd1308={'payload':{'id':_0x4c38c3['id'],'role':_0x4c38c3[_0xf544('0x19')]},'options':{'expiresIn':0x15180}};return authService[_0xf544('0x28')](_0xfd1308)['then'](function(_0xb4aaa3){_0x1495aa[_0xf544('0x29')]({'id':_0x4c38c3['id'],'token':_0xb4aaa3,'statusCall':'','isAlreadyLogged':_0x4c38c3[_0xf544('0x2a')]});});}})(_0x56a7f2,_0x1495aa,_0x455b67);};passport[_0xf544('0x2b')](_0xf544('0x2c'),new LocalStrategy({'usernameField':_0xf544('0x17'),'passwordField':'password'},function(_0x398374,_0xe2ff09,_0x46c7de){return ActiveDirectoryAuthenticate(db[_0xf544('0x2d')],_0x398374,_0xe2ff09,_0x46c7de);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 4c9e448..37376e4 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd696=['Router','./authActiveDirectory.controller','post','login'];(function(_0x1a8882,_0x7b0f4b){var _0x599a51=function(_0x57b0d4){while(--_0x57b0d4){_0x1a8882['push'](_0x1a8882['shift']());}};_0x599a51(++_0x7b0f4b);}(_0xd696,0x10c));var _0x6d69=function(_0x45862f,_0xf5f0a6){_0x45862f=_0x45862f-0x0;var _0x35b20b=_0xd696[_0x45862f];return _0x35b20b;};'use strict';var express=require('express');var router=express[_0x6d69('0x0')]();var controller=require(_0x6d69('0x1'));router[_0x6d69('0x2')]('/',controller[_0x6d69('0x3')]);module['exports']=router;
\ No newline at end of file
+var _0xd3f0=['exports','express','Router','./authActiveDirectory.controller','login'];(function(_0x10766c,_0x488946){var _0x277a88=function(_0x3294f6){while(--_0x3294f6){_0x10766c['push'](_0x10766c['shift']());}};_0x277a88(++_0x488946);}(_0xd3f0,0xa6));var _0x0d3f=function(_0x18c3c0,_0x3aada9){_0x18c3c0=_0x18c3c0-0x0;var _0x37b4f5=_0xd3f0[_0x18c3c0];return _0x37b4f5;};'use strict';var express=require(_0x0d3f('0x0'));var router=express[_0x0d3f('0x1')]();var controller=require(_0x0d3f('0x2'));router['post']('/',controller[_0x0d3f('0x3')]);module[_0x0d3f('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 3dd0cb3..e7c25ca 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x7a54,0x106));var _0x47a5=function(_0x31005c,_0x113bde){_0x31005c=_0x31005c-0x0;var _0x5e1f9d=_0x7a54[_0x31005c];return _0x5e1f9d;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x7a54,0x106));var _0x47a5=function(_0x12bab6,_0x3f2e71){_0x12bab6=_0x12bab6-0x0;var _0x1dc1d7=_0x7a54[_0x12bab6];return _0x1dc1d7;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index c5197ef..8c6ac54 100644
--- a/server/api/authGoogle/index.js
+++ b/server/api/authGoogle/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5577=['get','login','/callback','callback','setTokenCookie','exports','express','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x5d2803,_0xf375bd){var _0xdcad2c=function(_0x3c3a98){while(--_0x3c3a98){_0x5d2803['push'](_0x5d2803['shift']());}};_0xdcad2c(++_0xf375bd);}(_0x5577,0x1b4));var _0x7557=function(_0x3fd6d7,_0x5391a9){_0x3fd6d7=_0x3fd6d7-0x0;var _0x5a323f=_0x5577[_0x3fd6d7];return _0x5a323f;};'use strict';var express=require(_0x7557('0x0'));var passport=require('passport');var router=express[_0x7557('0x1')]();var controller=require(_0x7557('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x7557('0x3'));router[_0x7557('0x4')]('/',controller[_0x7557('0x5')]);router[_0x7557('0x4')](_0x7557('0x6'),controller[_0x7557('0x7')],authService['isMiddleware'],userController[_0x7557('0x5')],authService[_0x7557('0x8')]);module[_0x7557('0x9')]=router;
\ No newline at end of file
+var _0xd8a1=['isMiddleware','setTokenCookie','passport','Router','../user/user.controller.js','../../components/auth/service','get','login','/callback','callback'];(function(_0x1d6b61,_0x5842fa){var _0x290a2b=function(_0x4be489){while(--_0x4be489){_0x1d6b61['push'](_0x1d6b61['shift']());}};_0x290a2b(++_0x5842fa);}(_0xd8a1,0x174));var _0x1d8a=function(_0xcedc33,_0x2949cc){_0xcedc33=_0xcedc33-0x0;var _0x49c3c7=_0xd8a1[_0xcedc33];return _0x49c3c7;};'use strict';var express=require('express');var passport=require(_0x1d8a('0x0'));var router=express[_0x1d8a('0x1')]();var controller=require('./authGoogle.controller');var userController=require(_0x1d8a('0x2'));var authService=require(_0x1d8a('0x3'));router[_0x1d8a('0x4')]('/',controller[_0x1d8a('0x5')]);router[_0x1d8a('0x4')](_0x1d8a('0x6'),controller[_0x1d8a('0x7')],authService[_0x1d8a('0x8')],userController['login'],authService[_0x1d8a('0x9')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index e63cd54..37903e8 100644
--- a/server/api/authLocal/authLocal.controller.js
+++ b/server/api/authLocal/authLocal.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3f15=['trim','User','This\x20email\x20is\x20not\x20registered.','resetPasswordExpires','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordToken','save','use','util','passport','passport-local','lodash','randomstring','moment','../../config/utils','client','http','Setting','findOne','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','allowedLoginAttempts','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','email','Smtp','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','generate'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3f15,0xb1));var _0x53f1=function(_0x5db5e6,_0x105f6e){_0x5db5e6=_0x5db5e6-0x0;var _0x1adadd=_0x3f15[_0x5db5e6];return _0x1adadd;};'use strict';var util=require(_0x53f1('0x0'));var passport=require(_0x53f1('0x1'));var LocalStrategy=require(_0x53f1('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0x53f1('0x3'));var rs=require(_0x53f1('0x4'));var moment=require(_0x53f1('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x53f1('0x6'));var client=jayson[_0x53f1('0x7')][_0x53f1('0x8')]({'port':0x232b});function localAuthenticate(_0x35e36f,_0x5f2317,_0x1f536e,_0x15dd6b){var _0x2f29e1,_0x1bc198;return db[_0x53f1('0x9')][_0x53f1('0xa')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts','blockDuration'],'raw':!![]})[_0x53f1('0xb')](function(_0x524ac4){_0x2f29e1=_0x524ac4;return _0x35e36f[_0x53f1('0xa')]({'attributes':['id',_0x53f1('0xc'),_0x53f1('0xd'),_0x53f1('0xe'),_0x53f1('0xf'),_0x53f1('0x10'),_0x53f1('0x11'),_0x53f1('0x12'),_0x53f1('0x13')],'where':{'name':_0x5f2317,'role':{'$or':[_0x53f1('0x14'),_0x53f1('0x15'),_0x53f1('0x16')]}}});})[_0x53f1('0xb')](function(_0x1cac16){if(!_0x1cac16||_0x1cac16&&_0x1cac16[_0x53f1('0xc')]!==_0x5f2317){throw new Error(_0x53f1('0x17'));}else{_0x1bc198=_0x1cac16;return _0x1bc198;}})[_0x53f1('0xb')](function(){_0x1bc198['authenticate'](_0x1f536e,function(_0x534b9c,_0x807f67){var _0x1ee04f=_0x1bc198[_0x53f1('0x13')]+0x1;if(_0x534b9c){return _0x15dd6b(_0x534b9c);}else if(!_0x807f67){if(_0x1bc198[_0x53f1('0x10')]){return _0x15dd6b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x2f29e1[_0x53f1('0x18')]>0x0){if(_0x1bc198[_0x53f1('0x11')]){if(_0x2f29e1[_0x53f1('0x19')]>0x0){if(moment(_0x1bc198[_0x53f1('0x12')])[_0x53f1('0x1a')](_0x2f29e1[_0x53f1('0x19')],_0x53f1('0x1b'))>moment()){return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}else{return utils[_0x53f1('0x1c')](_0x1bc198,_0x1ee04f,![],null)['then'](function(){return _0x15dd6b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}}else{if(_0x1ee04f>=_0x2f29e1[_0x53f1('0x18')]){return utils[_0x53f1('0x1c')](_0x1bc198,0x0,!![],moment())['then'](function(){return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});});}else{return utils[_0x53f1('0x1c')](_0x1bc198,_0x1ee04f,![],null)[_0x53f1('0xb')](function(){return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});});}}}else{return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}}else{if(_0x1bc198['disabled']){return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}else if(_0x2f29e1[_0x53f1('0x18')]>0x0){if(_0x1bc198['blocked']){if(_0x2f29e1[_0x53f1('0x19')]>0x0){if(moment(_0x1bc198[_0x53f1('0x12')])[_0x53f1('0x1a')](_0x2f29e1[_0x53f1('0x19')],_0x53f1('0x1b'))>moment()){return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}else{return utils['clearBlockUser'](_0x1bc198,0x0,![],null)['then'](function(){return utils['getLicense'](_0x1bc198);})[_0x53f1('0xb')](function(){return _0x15dd6b(null,_0x1bc198);});}}else{return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}}else{return utils['clearBlockUser'](_0x1bc198,0x0,![],null)[_0x53f1('0xb')](function(){return utils[_0x53f1('0x1d')](_0x1bc198);})[_0x53f1('0xb')](function(){return _0x15dd6b(null,_0x1bc198);})[_0x53f1('0x1e')](function(_0x4e06bf){return _0x15dd6b(null,![],_0x4e06bf);});}}else{if(_0x1bc198[_0x53f1('0x11')]){return _0x15dd6b(null,![],{'message':_0x53f1('0x17')});}else{return utils[_0x53f1('0x1d')](_0x1bc198)[_0x53f1('0xb')](function(){return _0x15dd6b(null,_0x1bc198);});}}}});})[_0x53f1('0x1e')](function(_0x47679a){return _0x15dd6b(null,![],_0x47679a);});}function sendServiceMail(_0x156bd7){return db[_0x53f1('0x1f')][_0x53f1('0x20')]({'where':{'service':!![]},'attributes':['id','name','email'],'include':[{'model':db['MailServerOut'],'as':'Smtp','include':[{'model':db['CloudProvider'],'as':_0x53f1('0x21')}]}]})[_0x53f1('0xb')](function(_0x67eeca){if(!_0x67eeca){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1bff26=_0x67eeca[_0x53f1('0x22')]();var _0xf9ea0c={'account':_0x1bff26,'message':_[_0x53f1('0x23')]({'from':util[_0x53f1('0x24')](_0x53f1('0x25'),_0x67eeca[_0x53f1('0xc')],_0x67eeca[_0x53f1('0x26')]||_0x67eeca[_0x53f1('0x27')][_0x53f1('0x15')])},_0x156bd7)};return client['request'](_0x53f1('0x28'),_0xf9ea0c);})['then'](function(_0x8532ed){if(_0x8532ed[_0x53f1('0x29')]){throw new Error(util[_0x53f1('0x24')](_0x53f1('0x2a'),_0x8532ed[_0x53f1('0x29')][_0x53f1('0x2b')]||JSON[_0x53f1('0x2c')](_0x8532ed[_0x53f1('0x29')])));}return!![];});}function handleError(_0x14215a,_0x141835,_0x3bf0a1){return _0x14215a[_0x53f1('0x2d')](_0x141835||0x1f4)[_0x53f1('0x2e')]({'message':_0x3bf0a1?_0x3bf0a1[_0x53f1('0x2b')]||_0x3bf0a1:''});}exports['login']=function(_0x47e826,_0x1663a7,_0x282697){passport[_0x53f1('0x2f')]('local-login',function(_0x5a5b6a,_0x5064ab,_0x42c062){var _0x32e48d=_0x5a5b6a||_0x42c062;if(_0x32e48d){return handleError(_0x1663a7,0x191,_0x32e48d);}if(!_0x5064ab){return handleError(_0x1663a7,0x194,{'message':_0x53f1('0x30')});}else{var _0x40c99e={'payload':{'id':_0x5064ab['id'],'role':_0x5064ab['role']},'options':{'expiresIn':0x15180}};return authService[_0x53f1('0x31')](_0x40c99e)['then'](function(_0x4ecce1){_0x1663a7['json']({'id':_0x5064ab['id'],'token':_0x4ecce1,'statusCall':'','isAlreadyLogged':_0x5064ab[_0x53f1('0x32')]});});}})(_0x47e826,_0x1663a7,_0x282697);};exports[_0x53f1('0x33')]=function(_0x28cfec,_0x18738d){if(!_0x28cfec[_0x53f1('0x34')][_0x53f1('0x26')]){return handleError(_0x18738d,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0xa7167f=rs[_0x53f1('0x35')]();_0x28cfec[_0x53f1('0x34')][_0x53f1('0x26')]=_0x28cfec[_0x53f1('0x34')][_0x53f1('0x26')][_0x53f1('0x36')]()['toLowerCase']();var _0x5a127e;return db['Setting'][_0x53f1('0xa')]({'where':{'id':0x1},'attributes':[_0x53f1('0x18'),_0x53f1('0x19')],'raw':!![]})[_0x53f1('0xb')](function(_0xa1f0df){_0x5a127e=_0xa1f0df;return db[_0x53f1('0x37')][_0x53f1('0x20')]({'where':{'email':_0x28cfec['body'][_0x53f1('0x26')]}});})['then'](function(_0x299453){if(!_0x299453){throw new Error(_0x53f1('0x38'));}if(_0x299453['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x299453[_0x53f1('0x11')]){if(moment(_0x299453['blockedAt'])[_0x53f1('0x1a')](_0x5a127e[_0x53f1('0x19')],_0x53f1('0x1b'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x299453[_0x53f1('0x11')]=![];_0x299453[_0x53f1('0x12')]=null;}}_0x299453['resetPasswordToken']=_0xa7167f;_0x299453[_0x53f1('0x39')]=Date['now']()+0x36ee80;return _0x299453['save']();})[_0x53f1('0xb')](function(){return sendServiceMail({'to':_0x28cfec['body'][_0x53f1('0x26')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x53f1('0x3a')+_0x53f1('0x3b')+'https://'+_0x28cfec[_0x53f1('0x3c')][_0x53f1('0x3d')]+_0x53f1('0x3e')+_0xa7167f+'\x0a\x0a'+_0x53f1('0x3f')});})[_0x53f1('0xb')](function(){_0x18738d[_0x53f1('0x2d')](0xc8)[_0x53f1('0x2e')]({'message':_0x53f1('0x40')});})[_0x53f1('0x1e')](function(_0x5a38ee){return handleError(_0x18738d,0x1f4,_0x5a38ee);});};exports[_0x53f1('0x41')]=function(_0x1cb712,_0x155399){return db['User'][_0x53f1('0x20')]({'where':{'resetPasswordToken':_0x1cb712[_0x53f1('0x42')][_0x53f1('0x43')],'resetPasswordExpires':{'$gt':Date['now']()}}})['then'](function(_0x3c3a48){if(!_0x3c3a48){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting']['findOne']({'attributes':['id',_0x53f1('0x44'),_0x53f1('0x45'),_0x53f1('0x46')]})[_0x53f1('0xb')](function(_0xa6f722){if(_0xa6f722['securePassword'])authService[_0x53f1('0x47')](_0x1cb712[_0x53f1('0x34')][_0x53f1('0xd')]);if(!_0xa6f722[_0x53f1('0x45')]||!_0x3c3a48[_0x53f1('0x48')])return _0x3c3a48;authService[_0x53f1('0x49')](_0x1cb712[_0x53f1('0x34')][_0x53f1('0xd')],_0x3c3a48[_0x53f1('0x48')],_0xa6f722['passwordHistoryLimit']);return _0x3c3a48;})[_0x53f1('0xb')](function(){_0x3c3a48[_0x53f1('0xd')]=_0x1cb712[_0x53f1('0x34')][_0x53f1('0xd')];_0x3c3a48[_0x53f1('0x4a')]=null;_0x3c3a48[_0x53f1('0x39')]=null;return _0x3c3a48[_0x53f1('0x4b')]();});})[_0x53f1('0xb')](function(){_0x155399[_0x53f1('0x2d')](0xc8)[_0x53f1('0x2e')]({'message':'Password\x20reset!'});})[_0x53f1('0x1e')](function(_0x50f828){return handleError(_0x155399,0x1f4,_0x50f828);});};passport[_0x53f1('0x4c')]('local-login',new LocalStrategy({'usernameField':_0x53f1('0xc'),'passwordField':_0x53f1('0xd')},function(_0x335cb8,_0x41a229,_0x1cf7df){return localAuthenticate(db['User'],_0x335cb8,_0x41a229,_0x1cf7df);}));
\ No newline at end of file
+var _0xa666=['add','getLicense','catch','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','\x22%s\x22\x20<%s>','email','request','SendMail','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','save','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','User','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','loginAttempts','blocked','minutes','clearBlockUser'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0xa666,0xd1));var _0x6a66=function(_0x5cf4ce,_0x2e9d93){_0x5cf4ce=_0x5cf4ce-0x0;var _0x2ee73f=_0xa666[_0x5cf4ce];return _0x2ee73f;};'use strict';var util=require(_0x6a66('0x0'));var passport=require('passport');var LocalStrategy=require(_0x6a66('0x1'))[_0x6a66('0x2')];var jayson=require(_0x6a66('0x3'));var _=require('lodash');var rs=require(_0x6a66('0x4'));var moment=require(_0x6a66('0x5'));var db=require(_0x6a66('0x6'))['db'];var authService=require(_0x6a66('0x7'));var utils=require(_0x6a66('0x8'));var client=jayson[_0x6a66('0x9')][_0x6a66('0xa')]({'port':0x232b});function localAuthenticate(_0x418303,_0x5a8ca7,_0x795d67,_0x4d9b52){var _0x1f2e0f,_0x1816fe;return db[_0x6a66('0xb')][_0x6a66('0xc')]({'where':{'id':0x1},'attributes':[_0x6a66('0xd'),_0x6a66('0xe')],'raw':!![]})[_0x6a66('0xf')](function(_0x50e112){_0x1f2e0f=_0x50e112;return _0x418303[_0x6a66('0xc')]({'attributes':['id',_0x6a66('0x10'),_0x6a66('0x11'),_0x6a66('0x12'),_0x6a66('0x13'),_0x6a66('0x14'),'blocked',_0x6a66('0x15'),'loginAttempts'],'where':{'name':_0x5a8ca7,'role':{'$or':[_0x6a66('0x16'),_0x6a66('0x17'),_0x6a66('0x18')]}}});})[_0x6a66('0xf')](function(_0x402ae2){if(!_0x402ae2||_0x402ae2&&_0x402ae2[_0x6a66('0x10')]!==_0x5a8ca7){throw new Error(_0x6a66('0x19'));}else{_0x1816fe=_0x402ae2;return _0x1816fe;}})[_0x6a66('0xf')](function(){_0x1816fe[_0x6a66('0x1a')](_0x795d67,function(_0x174458,_0x1450c6){var _0x3e0bdc=_0x1816fe[_0x6a66('0x1b')]+0x1;if(_0x174458){return _0x4d9b52(_0x174458);}else if(!_0x1450c6){if(_0x1816fe[_0x6a66('0x14')]){return _0x4d9b52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x1f2e0f[_0x6a66('0xd')]>0x0){if(_0x1816fe[_0x6a66('0x1c')]){if(_0x1f2e0f['blockDuration']>0x0){if(moment(_0x1816fe[_0x6a66('0x15')])['add'](_0x1f2e0f[_0x6a66('0xe')],_0x6a66('0x1d'))>moment()){return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});}else{return utils[_0x6a66('0x1e')](_0x1816fe,_0x3e0bdc,![],null)[_0x6a66('0xf')](function(){return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});});}}else{return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});}}else{if(_0x3e0bdc>=_0x1f2e0f[_0x6a66('0xd')]){return utils[_0x6a66('0x1e')](_0x1816fe,0x0,!![],moment())[_0x6a66('0xf')](function(){return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});});}else{return utils[_0x6a66('0x1e')](_0x1816fe,_0x3e0bdc,![],null)[_0x6a66('0xf')](function(){return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});});}}}else{return _0x4d9b52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x1816fe['disabled']){return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});}else if(_0x1f2e0f[_0x6a66('0xd')]>0x0){if(_0x1816fe['blocked']){if(_0x1f2e0f[_0x6a66('0xe')]>0x0){if(moment(_0x1816fe[_0x6a66('0x15')])[_0x6a66('0x1f')](_0x1f2e0f[_0x6a66('0xe')],_0x6a66('0x1d'))>moment()){return _0x4d9b52(null,![],{'message':_0x6a66('0x19')});}else{return utils[_0x6a66('0x1e')](_0x1816fe,0x0,![],null)[_0x6a66('0xf')](function(){return utils[_0x6a66('0x20')](_0x1816fe);})['then'](function(){return _0x4d9b52(null,_0x1816fe);});}}else{return _0x4d9b52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x6a66('0x1e')](_0x1816fe,0x0,![],null)[_0x6a66('0xf')](function(){return utils[_0x6a66('0x20')](_0x1816fe);})[_0x6a66('0xf')](function(){return _0x4d9b52(null,_0x1816fe);})[_0x6a66('0x21')](function(_0xcb671c){return _0x4d9b52(null,![],_0xcb671c);});}}else{if(_0x1816fe['blocked']){return _0x4d9b52(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x6a66('0x20')](_0x1816fe)[_0x6a66('0xf')](function(){return _0x4d9b52(null,_0x1816fe);});}}}});})[_0x6a66('0x21')](function(_0x4d13da){return _0x4d9b52(null,![],_0x4d13da);});}function sendServiceMail(_0x26a0a4){return db[_0x6a66('0x22')][_0x6a66('0x23')]({'where':{'service':!![]},'attributes':['id',_0x6a66('0x10'),'email'],'include':[{'model':db[_0x6a66('0x24')],'as':_0x6a66('0x25'),'include':[{'model':db[_0x6a66('0x26')],'as':_0x6a66('0x26')}]}]})[_0x6a66('0xf')](function(_0x2a67ef){if(!_0x2a67ef){throw new Error(_0x6a66('0x27'));}var _0x3ed8a1=_0x2a67ef['getSmtpOptions']();var _0x58d3de={'account':_0x3ed8a1,'message':_['merge']({'from':util['format'](_0x6a66('0x28'),_0x2a67ef[_0x6a66('0x10')],_0x2a67ef[_0x6a66('0x29')]||_0x2a67ef[_0x6a66('0x25')][_0x6a66('0x17')])},_0x26a0a4)};return client[_0x6a66('0x2a')](_0x6a66('0x2b'),_0x58d3de);})[_0x6a66('0xf')](function(_0x379298){if(_0x379298[_0x6a66('0x2c')]){throw new Error(util[_0x6a66('0x2d')](_0x6a66('0x2e'),_0x379298[_0x6a66('0x2c')][_0x6a66('0x2f')]||JSON[_0x6a66('0x30')](_0x379298[_0x6a66('0x2c')])));}return!![];});}function handleError(_0x1834cf,_0x5146fb,_0x2e1d86){return _0x1834cf[_0x6a66('0x31')](_0x5146fb||0x1f4)['send']({'message':_0x2e1d86?_0x2e1d86[_0x6a66('0x2f')]||_0x2e1d86:''});}exports[_0x6a66('0x32')]=function(_0x81d6bf,_0x114c3d,_0x40a75c){passport[_0x6a66('0x1a')](_0x6a66('0x33'),function(_0x4fc3ff,_0x3ccb05,_0x71cd94){var _0x2cc0cf=_0x4fc3ff||_0x71cd94;if(_0x2cc0cf){return handleError(_0x114c3d,0x191,_0x2cc0cf);}if(!_0x3ccb05){return handleError(_0x114c3d,0x194,{'message':_0x6a66('0x34')});}else{var _0x2206f6={'payload':{'id':_0x3ccb05['id'],'role':_0x3ccb05[_0x6a66('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x6a66('0x35')](_0x2206f6)['then'](function(_0x2cd514){_0x114c3d[_0x6a66('0x36')]({'id':_0x3ccb05['id'],'token':_0x2cd514,'statusCall':'','isAlreadyLogged':_0x3ccb05['online']});});}})(_0x81d6bf,_0x114c3d,_0x40a75c);};exports[_0x6a66('0x37')]=function(_0x62287a,_0x27feb0){if(!_0x62287a[_0x6a66('0x38')][_0x6a66('0x29')]){return handleError(_0x27feb0,0x1f4,{'message':_0x6a66('0x39')});}var _0x1cb815=rs[_0x6a66('0x3a')]();_0x62287a[_0x6a66('0x38')]['email']=_0x62287a[_0x6a66('0x38')][_0x6a66('0x29')][_0x6a66('0x3b')]()[_0x6a66('0x3c')]();var _0x19e41f;return db['Setting'][_0x6a66('0xc')]({'where':{'id':0x1},'attributes':[_0x6a66('0xd'),'blockDuration'],'raw':!![]})[_0x6a66('0xf')](function(_0x33a123){_0x19e41f=_0x33a123;return db['User'][_0x6a66('0x23')]({'where':{'email':_0x62287a[_0x6a66('0x38')][_0x6a66('0x29')]}});})[_0x6a66('0xf')](function(_0x39bc27){if(!_0x39bc27){throw new Error(_0x6a66('0x3d'));}if(_0x39bc27[_0x6a66('0x14')]){throw new Error(_0x6a66('0x3e'));}if(_0x39bc27[_0x6a66('0x1c')]){if(moment(_0x39bc27[_0x6a66('0x15')])[_0x6a66('0x1f')](_0x19e41f[_0x6a66('0xe')],_0x6a66('0x1d'))>moment()){throw new Error(_0x6a66('0x3f'));}else{_0x39bc27[_0x6a66('0x1c')]=![];_0x39bc27[_0x6a66('0x15')]=null;}}_0x39bc27[_0x6a66('0x40')]=_0x1cb815;_0x39bc27[_0x6a66('0x41')]=Date['now']()+0x36ee80;return _0x39bc27[_0x6a66('0x42')]();})['then'](function(){return sendServiceMail({'to':_0x62287a[_0x6a66('0x38')][_0x6a66('0x29')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'https://'+_0x62287a['headers']['host']+_0x6a66('0x43')+_0x1cb815+'\x0a\x0a'+_0x6a66('0x44')});})[_0x6a66('0xf')](function(){_0x27feb0[_0x6a66('0x31')](0xc8)[_0x6a66('0x45')]({'message':'Reset\x20Email\x20sent!'});})[_0x6a66('0x21')](function(_0x1753c0){return handleError(_0x27feb0,0x1f4,_0x1753c0);});};exports['reset']=function(_0x59f903,_0x4a6cd2){return db[_0x6a66('0x46')][_0x6a66('0x23')]({'where':{'resetPasswordToken':_0x59f903['params']['token'],'resetPasswordExpires':{'$gt':Date[_0x6a66('0x47')]()}}})['then'](function(_0x1d4c48){if(!_0x1d4c48){throw new Error(_0x6a66('0x48'));}return db[_0x6a66('0xb')]['findOne']({'attributes':['id',_0x6a66('0x49'),_0x6a66('0x4a'),_0x6a66('0x4b')]})[_0x6a66('0xf')](function(_0xe80c0a){if(_0xe80c0a['securePassword'])authService[_0x6a66('0x4c')](_0x59f903[_0x6a66('0x38')]['password']);if(!_0xe80c0a[_0x6a66('0x4a')]||!_0x1d4c48[_0x6a66('0x4d')])return _0x1d4c48;authService[_0x6a66('0x4e')](_0x59f903[_0x6a66('0x38')][_0x6a66('0x11')],_0x1d4c48['previousPasswords'],_0xe80c0a[_0x6a66('0x4b')]);return _0x1d4c48;})[_0x6a66('0xf')](function(){_0x1d4c48[_0x6a66('0x11')]=_0x59f903[_0x6a66('0x38')][_0x6a66('0x11')];_0x1d4c48['resetPasswordToken']=null;_0x1d4c48[_0x6a66('0x41')]=null;return _0x1d4c48['save']();});})[_0x6a66('0xf')](function(){_0x4a6cd2[_0x6a66('0x31')](0xc8)['send']({'message':_0x6a66('0x4f')});})['catch'](function(_0x4e1a69){return handleError(_0x4a6cd2,0x1f4,_0x4e1a69);});};passport['use'](_0x6a66('0x33'),new LocalStrategy({'usernameField':_0x6a66('0x10'),'passwordField':_0x6a66('0x11')},function(_0x3121d4,_0x3a86a6,_0x249b6e){return localAuthenticate(db['User'],_0x3121d4,_0x3a86a6,_0x249b6e);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 2d5a867..0c2b112 100644
--- a/server/api/authLocal/index.js
+++ b/server/api/authLocal/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3d41=['/forgot','reset','exports','express','Router','./authLocal.controller','post','login'];(function(_0x3b58e2,_0x4fbf5f){var _0x5a6677=function(_0x1bf45f){while(--_0x1bf45f){_0x3b58e2['push'](_0x3b58e2['shift']());}};_0x5a6677(++_0x4fbf5f);}(_0x3d41,0x1eb));var _0x13d4=function(_0x314a8c,_0x1c2e8d){_0x314a8c=_0x314a8c-0x0;var _0x1d4607=_0x3d41[_0x314a8c];return _0x1d4607;};'use strict';var express=require(_0x13d4('0x0'));var router=express[_0x13d4('0x1')]();var controller=require(_0x13d4('0x2'));router[_0x13d4('0x3')]('/',controller[_0x13d4('0x4')]);router['post'](_0x13d4('0x5'),controller['forgot']);router[_0x13d4('0x3')]('/reset/:token',controller[_0x13d4('0x6')]);module[_0x13d4('0x7')]=router;
\ No newline at end of file
+var _0xd474=['reset','post','login','forgot'];(function(_0x4b0297,_0x3de513){var _0x86b55b=function(_0x3c17da){while(--_0x3c17da){_0x4b0297['push'](_0x4b0297['shift']());}};_0x86b55b(++_0x3de513);}(_0xd474,0x1dd));var _0x4d47=function(_0x3585fb,_0x5df075){_0x3585fb=_0x3585fb-0x0;var _0x48fb79=_0xd474[_0x3585fb];return _0x48fb79;};'use strict';var express=require('express');var router=express['Router']();var controller=require('./authLocal.controller');router[_0x4d47('0x0')]('/',controller[_0x4d47('0x1')]);router['post']('/forgot',controller[_0x4d47('0x2')]);router[_0x4d47('0x0')]('/reset/:token',controller[_0x4d47('0x3')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e53b981..b3c6646 100644
--- a/server/api/automation/automation.attributes.js
+++ b/server/api/automation/automation.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xca30=['exports','STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x38d8e2,_0x48603c){var _0x5afbee=function(_0x2eca5e){while(--_0x2eca5e){_0x38d8e2['push'](_0x38d8e2['shift']());}};_0x5afbee(++_0x48603c);}(_0xca30,0x171));var _0x0ca3=function(_0x54d4a8,_0x585a59){_0x54d4a8=_0x54d4a8-0x0;var _0x3b321b=_0xca30[_0x54d4a8];return _0x3b321b;};'use strict';var Sequelize=require(_0x0ca3('0x0'));module[_0x0ca3('0x1')]={'name':{'type':Sequelize[_0x0ca3('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x0ca3('0x2')]},'description':{'type':Sequelize[_0x0ca3('0x2')]},'status':{'type':Sequelize[_0x0ca3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0ca3('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0xfed9=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfed9,0x1cc));var _0x9fed=function(_0x318309,_0x430ab9){_0x318309=_0x318309-0x0;var _0x4c25ff=_0xfed9[_0x318309];return _0x4c25ff;};'use strict';var Sequelize=require(_0x9fed('0x0'));module[_0x9fed('0x1')]={'name':{'type':Sequelize[_0x9fed('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x9fed('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x9fed('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x9fed('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index 62498a4..b173539 100644
--- a/server/api/automation/automation.controller.js
+++ b/server/api/automation/automation.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xef1a=['omit','ids','order','getConditions','addActions','Action','findOne','getActions','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','undefined','limit','offset','Content-Range','json','apply','reject','save','then','destroy','end','error','stack','send','Automation','rawAttributes','fieldName','type','key','model','map','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','Condition'];(function(_0x3388d8,_0x256024){var _0x2bbe73=function(_0x3c0cb2){while(--_0x3c0cb2){_0x3388d8['push'](_0x3388d8['shift']());}};_0x2bbe73(++_0x256024);}(_0xef1a,0xb0));var _0xaef1=function(_0x2599ff,_0x168b1d){_0x2599ff=_0x2599ff-0x0;var _0x28d485=_0xef1a[_0x2599ff];return _0x28d485;};'use strict';var emlformat=require(_0xaef1('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xaef1('0x1'));var rp=require(_0xaef1('0x2'));var moment=require(_0xaef1('0x3'));var BPromise=require(_0xaef1('0x4'));var Mustache=require(_0xaef1('0x5'));var util=require('util');var path=require(_0xaef1('0x6'));var sox=require(_0xaef1('0x7'));var csv=require(_0xaef1('0x8'));var ejs=require(_0xaef1('0x9'));var fs=require('fs');var fs_extra=require(_0xaef1('0xa'));var _=require(_0xaef1('0xb'));var squel=require(_0xaef1('0xc'));var crypto=require('crypto');var jsforce=require(_0xaef1('0xd'));var deskjs=require(_0xaef1('0xe'));var toCsv=require(_0xaef1('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xaef1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaef1('0x10'));var as=require(_0xaef1('0x11'));var hardwareService=require(_0xaef1('0x12'));var logger=require(_0xaef1('0x13'))(_0xaef1('0x14'));var utils=require('../../config/utils');var config=require(_0xaef1('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xaef1('0x16'))['db'];function respondWithStatusCode(_0x4e2035,_0x5933a4){_0x5933a4=_0x5933a4||0xcc;return function(_0x52beb0){if(_0x52beb0){return _0x4e2035[_0xaef1('0x17')](_0x5933a4);}return _0x4e2035[_0xaef1('0x18')](_0x5933a4)['end']();};}function respondWithResult(_0x528e71,_0x3d006f){_0x3d006f=_0x3d006f||0xc8;return function(_0x43333f){if(_0x43333f){return _0x528e71[_0xaef1('0x18')](_0x3d006f)['json'](_0x43333f);}};}function respondWithFilteredResult(_0x5046f6,_0x443c98){return function(_0x1db188){if(_0x1db188){var _0x1608ef=typeof _0x443c98['offset']===_0xaef1('0x19')&&typeof _0x443c98[_0xaef1('0x1a')]===_0xaef1('0x19');var _0x1e72ab=_0x1db188['count'];var _0x440866=_0x1608ef?0x0:_0x443c98['offset'];var _0x84ecad=_0x1608ef?_0x1db188['count']:_0x443c98[_0xaef1('0x1b')]+_0x443c98[_0xaef1('0x1a')];var _0x4e6e4a;if(_0x84ecad>=_0x1e72ab){_0x84ecad=_0x1e72ab;_0x4e6e4a=0xc8;}else{_0x4e6e4a=0xce;}_0x5046f6[_0xaef1('0x18')](_0x4e6e4a);return _0x5046f6['set'](_0xaef1('0x1c'),_0x440866+'-'+_0x84ecad+'/'+_0x1e72ab)[_0xaef1('0x1d')](_0x1db188);}return null;};}function patchUpdates(_0x1ae5f8){return function(_0x22d9ed){try{jsonpatch[_0xaef1('0x1e')](_0x22d9ed,_0x1ae5f8,!![]);}catch(_0x54f2b7){return BPromise[_0xaef1('0x1f')](_0x54f2b7);}return _0x22d9ed[_0xaef1('0x20')]();};}function saveUpdates(_0x44cb3e,_0x4e0b8d){return function(_0x21b970){if(_0x21b970){return _0x21b970['update'](_0x44cb3e)[_0xaef1('0x21')](function(_0x33cf48){return _0x33cf48;});}return null;};}function removeEntity(_0x2e11f7,_0xd33b58){return function(_0x2b39d9){if(_0x2b39d9){return _0x2b39d9[_0xaef1('0x22')]()['then'](function(){_0x2e11f7[_0xaef1('0x18')](0xcc)[_0xaef1('0x23')]();});}};}function handleEntityNotFound(_0x3237e2,_0xe525b3){return function(_0x110ab3){if(!_0x110ab3){_0x3237e2[_0xaef1('0x17')](0x194);}return _0x110ab3;};}function handleError(_0x2417bb,_0x4e27e7){_0x4e27e7=_0x4e27e7||0x1f4;return function(_0x19b751){logger[_0xaef1('0x24')](_0x19b751[_0xaef1('0x25')]);if(_0x19b751['name']){delete _0x19b751['name'];}_0x2417bb[_0xaef1('0x18')](_0x4e27e7)[_0xaef1('0x26')](_0x19b751);};}exports['index']=function(_0x42b595,_0x1e865e){var _0x4cee6a={},_0x69c3cc={},_0x25b482={'count':0x0,'rows':[]};var _0x13dc7b=_['map'](db[_0xaef1('0x27')][_0xaef1('0x28')],function(_0x26f2e5){return{'name':_0x26f2e5[_0xaef1('0x29')],'type':_0x26f2e5[_0xaef1('0x2a')][_0xaef1('0x2b')]};});_0x69c3cc[_0xaef1('0x2c')]=_[_0xaef1('0x2d')](_0x13dc7b,_0xaef1('0x2e'));_0x69c3cc[_0xaef1('0x2f')]=_[_0xaef1('0x30')](_0x42b595[_0xaef1('0x2f')]);_0x69c3cc[_0xaef1('0x31')]=_[_0xaef1('0x32')](_0x69c3cc['model'],_0x69c3cc['query']);_0x4cee6a[_0xaef1('0x33')]=_[_0xaef1('0x32')](_0x69c3cc[_0xaef1('0x2c')],qs['fields'](_0x42b595[_0xaef1('0x2f')][_0xaef1('0x34')]));_0x4cee6a['attributes']=_0x4cee6a[_0xaef1('0x33')][_0xaef1('0x35')]?_0x4cee6a[_0xaef1('0x33')]:_0x69c3cc[_0xaef1('0x2c')];if(!_0x42b595[_0xaef1('0x2f')][_0xaef1('0x36')](_0xaef1('0x37'))){_0x4cee6a[_0xaef1('0x1a')]=qs[_0xaef1('0x1a')](_0x42b595['query'][_0xaef1('0x1a')]);_0x4cee6a[_0xaef1('0x1b')]=qs['offset'](_0x42b595['query'][_0xaef1('0x1b')]);}_0x4cee6a['order']=qs['sort'](_0x42b595[_0xaef1('0x2f')][_0xaef1('0x38')]);_0x4cee6a[_0xaef1('0x39')]=qs[_0xaef1('0x31')](_[_0xaef1('0x3a')](_0x42b595[_0xaef1('0x2f')],_0x69c3cc[_0xaef1('0x31')]),_0x13dc7b);if(_0x42b595[_0xaef1('0x2f')][_0xaef1('0x3b')]){_0x4cee6a['where']=_[_0xaef1('0x3c')](_0x4cee6a[_0xaef1('0x39')],{'$or':_[_0xaef1('0x2d')](_0x13dc7b,function(_0x4fd37e){if(_0x4fd37e[_0xaef1('0x2a')]!==_0xaef1('0x3d')){var _0x5b1efd={};_0x5b1efd[_0x4fd37e['name']]={'$like':'%'+_0x42b595[_0xaef1('0x2f')][_0xaef1('0x3b')]+'%'};return _0x5b1efd;}})});}_0x4cee6a=_[_0xaef1('0x3c')]({},_0x4cee6a,_0x42b595[_0xaef1('0x3e')]);var _0xbcb3a5={'where':_0x4cee6a['where']};return db[_0xaef1('0x27')][_0xaef1('0x3f')](_0xbcb3a5)['then'](function(_0x368cb5){_0x25b482[_0xaef1('0x3f')]=_0x368cb5;if(_0x42b595[_0xaef1('0x2f')][_0xaef1('0x40')]){_0x4cee6a[_0xaef1('0x41')]=[{'all':!![]}];}return db['Automation'][_0xaef1('0x42')](_0x4cee6a);})['then'](function(_0x3a7fe4){_0x25b482[_0xaef1('0x43')]=_0x3a7fe4;return _0x25b482;})[_0xaef1('0x21')](respondWithFilteredResult(_0x1e865e,_0x4cee6a))[_0xaef1('0x44')](handleError(_0x1e865e,null));};exports[_0xaef1('0x45')]=function(_0x50ace6,_0x1e9679){var _0x5bb926={'raw':![],'where':{'id':_0x50ace6['params']['id']}},_0x90a982={};_0x90a982[_0xaef1('0x2c')]=_[_0xaef1('0x30')](db[_0xaef1('0x27')][_0xaef1('0x28')]);_0x90a982[_0xaef1('0x2f')]=_['keys'](_0x50ace6['query']);_0x90a982[_0xaef1('0x31')]=_['intersection'](_0x90a982[_0xaef1('0x2c')],_0x90a982['query']);_0x5bb926[_0xaef1('0x33')]=_[_0xaef1('0x32')](_0x90a982['model'],qs['fields'](_0x50ace6['query'][_0xaef1('0x34')]));_0x5bb926['attributes']=_0x5bb926[_0xaef1('0x33')][_0xaef1('0x35')]?_0x5bb926[_0xaef1('0x33')]:_0x90a982[_0xaef1('0x2c')];if(_0x50ace6[_0xaef1('0x2f')][_0xaef1('0x40')]){_0x5bb926['include']=[{'all':!![]}];}_0x5bb926=_['merge']({},_0x5bb926,_0x50ace6[_0xaef1('0x3e')]);return db[_0xaef1('0x27')][_0xaef1('0x46')](_0x5bb926)[_0xaef1('0x21')](handleEntityNotFound(_0x1e9679,null))[_0xaef1('0x21')](respondWithResult(_0x1e9679,null))['catch'](handleError(_0x1e9679,null));};exports['create']=function(_0x3c4088,_0x18e86c){return db[_0xaef1('0x27')][_0xaef1('0x47')](_0x3c4088[_0xaef1('0x48')],{})['then'](respondWithResult(_0x18e86c,0xc9))['catch'](handleError(_0x18e86c,null));};exports[_0xaef1('0x49')]=function(_0x2b3a20,_0x3d2633){if(_0x2b3a20[_0xaef1('0x48')]['id']){delete _0x2b3a20[_0xaef1('0x48')]['id'];}return db[_0xaef1('0x27')][_0xaef1('0x46')]({'where':{'id':_0x2b3a20['params']['id']}})[_0xaef1('0x21')](handleEntityNotFound(_0x3d2633,null))['then'](saveUpdates(_0x2b3a20[_0xaef1('0x48')],null))['then'](respondWithResult(_0x3d2633,null))['catch'](handleError(_0x3d2633,null));};exports[_0xaef1('0x22')]=function(_0x564c6c,_0x2cb7ce){return db[_0xaef1('0x27')][_0xaef1('0x46')]({'where':{'id':_0x564c6c[_0xaef1('0x4a')]['id']}})[_0xaef1('0x21')](handleEntityNotFound(_0x2cb7ce,null))[_0xaef1('0x21')](removeEntity(_0x2cb7ce,null))[_0xaef1('0x44')](handleError(_0x2cb7ce,null));};exports['addConditions']=function(_0x163321,_0x438d5e,_0x3ad8a2){return db[_0xaef1('0x4b')][_0xaef1('0x46')]({'where':{'id':_0x163321[_0xaef1('0x4a')]['id']}})['then'](handleEntityNotFound(_0x438d5e,null))['then'](function(_0x53d2bf){if(_0x53d2bf){return _0x53d2bf['addConditions'](_0x163321['body']['ids'],_[_0xaef1('0x4c')](_0x163321[_0xaef1('0x48')],[_0xaef1('0x4d'),'id'])||{});}})[_0xaef1('0x21')](respondWithResult(_0x438d5e,null))[_0xaef1('0x44')](handleError(_0x438d5e,null));};exports['getConditions']=function(_0x1e2545,_0x58301f,_0x2f2cf2){var _0x5dd33d={};var _0x345e54={};var _0x47a26b;var _0xed8fa5;return db[_0xaef1('0x27')]['findOne']({'where':{'id':_0x1e2545['params']['id']}})['then'](handleEntityNotFound(_0x58301f,null))[_0xaef1('0x21')](function(_0x196ef8){if(_0x196ef8){_0x47a26b=_0x196ef8;_0x345e54[_0xaef1('0x2c')]=_['keys'](db[_0xaef1('0x4b')][_0xaef1('0x28')]);_0x345e54[_0xaef1('0x2f')]=_[_0xaef1('0x30')](_0x1e2545[_0xaef1('0x2f')]);_0x345e54[_0xaef1('0x31')]=_[_0xaef1('0x32')](_0x345e54[_0xaef1('0x2c')],_0x345e54['query']);_0x5dd33d[_0xaef1('0x33')]=_['intersection'](_0x345e54[_0xaef1('0x2c')],qs[_0xaef1('0x34')](_0x1e2545[_0xaef1('0x2f')]['fields']));_0x5dd33d['attributes']=_0x5dd33d[_0xaef1('0x33')][_0xaef1('0x35')]?_0x5dd33d[_0xaef1('0x33')]:_0x345e54[_0xaef1('0x2c')];_0x5dd33d[_0xaef1('0x4e')]=qs['sort'](_0x1e2545['query'][_0xaef1('0x38')]);_0x5dd33d[_0xaef1('0x39')]=qs[_0xaef1('0x31')](_[_0xaef1('0x3a')](_0x1e2545[_0xaef1('0x2f')],_0x345e54[_0xaef1('0x31')]));if(_0x1e2545['query'][_0xaef1('0x3b')]){_0x5dd33d['where']=_[_0xaef1('0x3c')](_0x5dd33d[_0xaef1('0x39')],{'$or':_[_0xaef1('0x2d')](_0x5dd33d[_0xaef1('0x33')],function(_0x3950a4){var _0x2a403d={};_0x2a403d[_0x3950a4]={'$like':'%'+_0x1e2545['query'][_0xaef1('0x3b')]+'%'};return _0x2a403d;})});}_0x5dd33d=_[_0xaef1('0x3c')]({},_0x5dd33d,_0x1e2545['options']);return _0x47a26b[_0xaef1('0x4f')](_0x5dd33d);}})[_0xaef1('0x21')](function(_0x365143){if(_0x365143){_0xed8fa5=_0x365143['length'];if(!_0x1e2545[_0xaef1('0x2f')][_0xaef1('0x36')]('nolimit')){_0x5dd33d[_0xaef1('0x1a')]=qs[_0xaef1('0x1a')](_0x1e2545[_0xaef1('0x2f')]['limit']);_0x5dd33d[_0xaef1('0x1b')]=qs[_0xaef1('0x1b')](_0x1e2545[_0xaef1('0x2f')][_0xaef1('0x1b')]);}return _0x47a26b[_0xaef1('0x4f')](_0x5dd33d);}})[_0xaef1('0x21')](function(_0x5b8bfb){if(_0x5b8bfb){return _0x5b8bfb?{'count':_0xed8fa5,'rows':_0x5b8bfb}:null;}})[_0xaef1('0x21')](respondWithResult(_0x58301f,null))[_0xaef1('0x44')](handleError(_0x58301f,null));};exports[_0xaef1('0x50')]=function(_0x4a12fa,_0xd458aa,_0x22e480){return db[_0xaef1('0x51')]['find']({'where':{'id':_0x4a12fa[_0xaef1('0x4a')]['id']}})[_0xaef1('0x21')](handleEntityNotFound(_0xd458aa,null))[_0xaef1('0x21')](function(_0x426e60){if(_0x426e60){return _0x426e60['addActions'](_0x4a12fa[_0xaef1('0x48')][_0xaef1('0x4d')],_[_0xaef1('0x4c')](_0x4a12fa['body'],[_0xaef1('0x4d'),'id'])||{});}})['then'](respondWithResult(_0xd458aa,null))[_0xaef1('0x44')](handleError(_0xd458aa,null));};exports['getActions']=function(_0x575c17,_0x26215b,_0x59c1d2){var _0x9e719e={};var _0x45919e={};var _0x1cd985;var _0x1982de;return db['Automation'][_0xaef1('0x52')]({'where':{'id':_0x575c17[_0xaef1('0x4a')]['id']}})[_0xaef1('0x21')](handleEntityNotFound(_0x26215b,null))['then'](function(_0x4461c6){if(_0x4461c6){_0x1cd985=_0x4461c6;_0x45919e[_0xaef1('0x2c')]=_[_0xaef1('0x30')](db['Action']['rawAttributes']);_0x45919e[_0xaef1('0x2f')]=_[_0xaef1('0x30')](_0x575c17[_0xaef1('0x2f')]);_0x45919e[_0xaef1('0x31')]=_[_0xaef1('0x32')](_0x45919e[_0xaef1('0x2c')],_0x45919e['query']);_0x9e719e[_0xaef1('0x33')]=_['intersection'](_0x45919e['model'],qs['fields'](_0x575c17[_0xaef1('0x2f')][_0xaef1('0x34')]));_0x9e719e['attributes']=_0x9e719e[_0xaef1('0x33')][_0xaef1('0x35')]?_0x9e719e['attributes']:_0x45919e[_0xaef1('0x2c')];_0x9e719e['order']=qs['sort'](_0x575c17[_0xaef1('0x2f')][_0xaef1('0x38')]);_0x9e719e[_0xaef1('0x39')]=qs['filters'](_[_0xaef1('0x3a')](_0x575c17[_0xaef1('0x2f')],_0x45919e[_0xaef1('0x31')]));if(_0x575c17[_0xaef1('0x2f')]['filter']){_0x9e719e[_0xaef1('0x39')]=_[_0xaef1('0x3c')](_0x9e719e[_0xaef1('0x39')],{'$or':_[_0xaef1('0x2d')](_0x9e719e[_0xaef1('0x33')],function(_0x5f4aed){var _0x4f2003={};_0x4f2003[_0x5f4aed]={'$like':'%'+_0x575c17[_0xaef1('0x2f')][_0xaef1('0x3b')]+'%'};return _0x4f2003;})});}_0x9e719e=_[_0xaef1('0x3c')]({},_0x9e719e,_0x575c17[_0xaef1('0x3e')]);return _0x1cd985['getActions'](_0x9e719e);}})[_0xaef1('0x21')](function(_0x5680aa){if(_0x5680aa){_0x1982de=_0x5680aa[_0xaef1('0x35')];if(!_0x575c17['query']['hasOwnProperty'](_0xaef1('0x37'))){_0x9e719e[_0xaef1('0x1a')]=qs[_0xaef1('0x1a')](_0x575c17[_0xaef1('0x2f')][_0xaef1('0x1a')]);_0x9e719e[_0xaef1('0x1b')]=qs[_0xaef1('0x1b')](_0x575c17['query']['offset']);}return _0x1cd985[_0xaef1('0x53')](_0x9e719e);}})['then'](function(_0x5c66e3){if(_0x5c66e3){return _0x5c66e3?{'count':_0x1982de,'rows':_0x5c66e3}:null;}})['then'](respondWithResult(_0x26215b,null))[_0xaef1('0x44')](handleError(_0x26215b,null));};
\ No newline at end of file
+var _0xc00b=['where','merge','options','Automation','include','findAll','rows','catch','params','length','create','body','find','addConditions','ids','omit','getConditions','findOne','order','hasOwnProperty','nolimit','addActions','getActions','Action','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','apply','save','update','then','destroy','end','stack','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','sort','pick','filter'];(function(_0x56f09a,_0x224490){var _0x300555=function(_0x2d0e7f){while(--_0x2d0e7f){_0x56f09a['push'](_0x56f09a['shift']());}};_0x300555(++_0x224490);}(_0xc00b,0x102));var _0xbc00=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0xc00b[_0x3740fe];return _0x55492b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xbc00('0x0'));var zipdir=require(_0xbc00('0x1'));var jsonpatch=require(_0xbc00('0x2'));var rp=require(_0xbc00('0x3'));var moment=require('moment');var BPromise=require(_0xbc00('0x4'));var Mustache=require(_0xbc00('0x5'));var util=require(_0xbc00('0x6'));var path=require('path');var sox=require(_0xbc00('0x7'));var csv=require(_0xbc00('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xbc00('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xbc00('0xa'));var jsforce=require(_0xbc00('0xb'));var deskjs=require(_0xbc00('0xc'));var toCsv=require(_0xbc00('0x8'));var querystring=require(_0xbc00('0xd'));var Papa=require(_0xbc00('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xbc00('0xf'));var hardwareService=require(_0xbc00('0x10'));var logger=require(_0xbc00('0x11'))(_0xbc00('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xbc00('0x13'));var db=require(_0xbc00('0x14'))['db'];function respondWithStatusCode(_0x25b597,_0x43d27b){_0x43d27b=_0x43d27b||0xcc;return function(_0x1eee0d){if(_0x1eee0d){return _0x25b597[_0xbc00('0x15')](_0x43d27b);}return _0x25b597[_0xbc00('0x16')](_0x43d27b)['end']();};}function respondWithResult(_0x49c568,_0x45dba7){_0x45dba7=_0x45dba7||0xc8;return function(_0x4121f5){if(_0x4121f5){return _0x49c568[_0xbc00('0x16')](_0x45dba7)[_0xbc00('0x17')](_0x4121f5);}};}function respondWithFilteredResult(_0x818241,_0x5e2e7b){return function(_0x4adb96){if(_0x4adb96){var _0x50919b=typeof _0x5e2e7b[_0xbc00('0x18')]===_0xbc00('0x19')&&typeof _0x5e2e7b[_0xbc00('0x1a')]==='undefined';var _0x3f4b22=_0x4adb96[_0xbc00('0x1b')];var _0x36ffc8=_0x50919b?0x0:_0x5e2e7b[_0xbc00('0x18')];var _0x3fca31=_0x50919b?_0x4adb96[_0xbc00('0x1b')]:_0x5e2e7b['offset']+_0x5e2e7b[_0xbc00('0x1a')];var _0x51a81e;if(_0x3fca31>=_0x3f4b22){_0x3fca31=_0x3f4b22;_0x51a81e=0xc8;}else{_0x51a81e=0xce;}_0x818241[_0xbc00('0x16')](_0x51a81e);return _0x818241[_0xbc00('0x1c')]('Content-Range',_0x36ffc8+'-'+_0x3fca31+'/'+_0x3f4b22)['json'](_0x4adb96);}return null;};}function patchUpdates(_0x2bd67b){return function(_0x107abf){try{jsonpatch[_0xbc00('0x1d')](_0x107abf,_0x2bd67b,!![]);}catch(_0x391540){return BPromise['reject'](_0x391540);}return _0x107abf[_0xbc00('0x1e')]();};}function saveUpdates(_0x3a5fd3,_0x24769b){return function(_0x4fc942){if(_0x4fc942){return _0x4fc942[_0xbc00('0x1f')](_0x3a5fd3)[_0xbc00('0x20')](function(_0x158062){return _0x158062;});}return null;};}function removeEntity(_0x31690d,_0x301cff){return function(_0x1ea9a0){if(_0x1ea9a0){return _0x1ea9a0[_0xbc00('0x21')]()[_0xbc00('0x20')](function(){_0x31690d[_0xbc00('0x16')](0xcc)[_0xbc00('0x22')]();});}};}function handleEntityNotFound(_0x44aada,_0x2d7a8a){return function(_0x4202df){if(!_0x4202df){_0x44aada[_0xbc00('0x15')](0x194);}return _0x4202df;};}function handleError(_0x59c036,_0x3838f1){_0x3838f1=_0x3838f1||0x1f4;return function(_0x45c7cb){logger['error'](_0x45c7cb[_0xbc00('0x23')]);if(_0x45c7cb['name']){delete _0x45c7cb[_0xbc00('0x24')];}_0x59c036[_0xbc00('0x16')](_0x3838f1)[_0xbc00('0x25')](_0x45c7cb);};}exports[_0xbc00('0x26')]=function(_0x5d302b,_0x2bec88){var _0x40685e={},_0xd69478={},_0x512c67={'count':0x0,'rows':[]};var _0x55b067=_[_0xbc00('0x27')](db['Automation'][_0xbc00('0x28')],function(_0x1eebb3){return{'name':_0x1eebb3[_0xbc00('0x29')],'type':_0x1eebb3[_0xbc00('0x2a')][_0xbc00('0x2b')]};});_0xd69478['model']=_[_0xbc00('0x27')](_0x55b067,_0xbc00('0x24'));_0xd69478[_0xbc00('0x2c')]=_[_0xbc00('0x2d')](_0x5d302b['query']);_0xd69478[_0xbc00('0x2e')]=_[_0xbc00('0x2f')](_0xd69478[_0xbc00('0x30')],_0xd69478[_0xbc00('0x2c')]);_0x40685e[_0xbc00('0x31')]=_['intersection'](_0xd69478['model'],qs[_0xbc00('0x32')](_0x5d302b[_0xbc00('0x2c')][_0xbc00('0x32')]));_0x40685e[_0xbc00('0x31')]=_0x40685e[_0xbc00('0x31')]['length']?_0x40685e[_0xbc00('0x31')]:_0xd69478[_0xbc00('0x30')];if(!_0x5d302b[_0xbc00('0x2c')]['hasOwnProperty']('nolimit')){_0x40685e['limit']=qs[_0xbc00('0x1a')](_0x5d302b[_0xbc00('0x2c')][_0xbc00('0x1a')]);_0x40685e[_0xbc00('0x18')]=qs[_0xbc00('0x18')](_0x5d302b['query'][_0xbc00('0x18')]);}_0x40685e['order']=qs[_0xbc00('0x33')](_0x5d302b[_0xbc00('0x2c')][_0xbc00('0x33')]);_0x40685e['where']=qs[_0xbc00('0x2e')](_[_0xbc00('0x34')](_0x5d302b[_0xbc00('0x2c')],_0xd69478[_0xbc00('0x2e')]),_0x55b067);if(_0x5d302b[_0xbc00('0x2c')][_0xbc00('0x35')]){_0x40685e[_0xbc00('0x36')]=_['merge'](_0x40685e[_0xbc00('0x36')],{'$or':_['map'](_0x55b067,function(_0x558ab5){if(_0x558ab5[_0xbc00('0x2a')]!=='VIRTUAL'){var _0x44f9be={};_0x44f9be[_0x558ab5[_0xbc00('0x24')]]={'$like':'%'+_0x5d302b[_0xbc00('0x2c')][_0xbc00('0x35')]+'%'};return _0x44f9be;}})});}_0x40685e=_[_0xbc00('0x37')]({},_0x40685e,_0x5d302b[_0xbc00('0x38')]);var _0x3bd185={'where':_0x40685e[_0xbc00('0x36')]};return db[_0xbc00('0x39')]['count'](_0x3bd185)[_0xbc00('0x20')](function(_0x5f1ab9){_0x512c67[_0xbc00('0x1b')]=_0x5f1ab9;if(_0x5d302b['query']['includeAll']){_0x40685e[_0xbc00('0x3a')]=[{'all':!![]}];}return db[_0xbc00('0x39')][_0xbc00('0x3b')](_0x40685e);})[_0xbc00('0x20')](function(_0x5cc426){_0x512c67[_0xbc00('0x3c')]=_0x5cc426;return _0x512c67;})['then'](respondWithFilteredResult(_0x2bec88,_0x40685e))[_0xbc00('0x3d')](handleError(_0x2bec88,null));};exports['show']=function(_0x11351f,_0x543a37){var _0x4e8831={'raw':![],'where':{'id':_0x11351f[_0xbc00('0x3e')]['id']}},_0x74a8af={};_0x74a8af[_0xbc00('0x30')]=_[_0xbc00('0x2d')](db[_0xbc00('0x39')][_0xbc00('0x28')]);_0x74a8af[_0xbc00('0x2c')]=_['keys'](_0x11351f[_0xbc00('0x2c')]);_0x74a8af[_0xbc00('0x2e')]=_['intersection'](_0x74a8af[_0xbc00('0x30')],_0x74a8af[_0xbc00('0x2c')]);_0x4e8831[_0xbc00('0x31')]=_[_0xbc00('0x2f')](_0x74a8af[_0xbc00('0x30')],qs[_0xbc00('0x32')](_0x11351f[_0xbc00('0x2c')][_0xbc00('0x32')]));_0x4e8831[_0xbc00('0x31')]=_0x4e8831[_0xbc00('0x31')][_0xbc00('0x3f')]?_0x4e8831[_0xbc00('0x31')]:_0x74a8af[_0xbc00('0x30')];if(_0x11351f[_0xbc00('0x2c')]['includeAll']){_0x4e8831[_0xbc00('0x3a')]=[{'all':!![]}];}_0x4e8831=_[_0xbc00('0x37')]({},_0x4e8831,_0x11351f[_0xbc00('0x38')]);return db['Automation']['find'](_0x4e8831)[_0xbc00('0x20')](handleEntityNotFound(_0x543a37,null))[_0xbc00('0x20')](respondWithResult(_0x543a37,null))[_0xbc00('0x3d')](handleError(_0x543a37,null));};exports['create']=function(_0x82f1f7,_0x16382d){return db[_0xbc00('0x39')][_0xbc00('0x40')](_0x82f1f7[_0xbc00('0x41')],{})[_0xbc00('0x20')](respondWithResult(_0x16382d,0xc9))['catch'](handleError(_0x16382d,null));};exports['update']=function(_0xd66f3e,_0x3e24e3){if(_0xd66f3e[_0xbc00('0x41')]['id']){delete _0xd66f3e[_0xbc00('0x41')]['id'];}return db['Automation'][_0xbc00('0x42')]({'where':{'id':_0xd66f3e[_0xbc00('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3e24e3,null))[_0xbc00('0x20')](saveUpdates(_0xd66f3e[_0xbc00('0x41')],null))[_0xbc00('0x20')](respondWithResult(_0x3e24e3,null))[_0xbc00('0x3d')](handleError(_0x3e24e3,null));};exports['destroy']=function(_0x35a3fb,_0x46e3af){return db['Automation'][_0xbc00('0x42')]({'where':{'id':_0x35a3fb['params']['id']}})[_0xbc00('0x20')](handleEntityNotFound(_0x46e3af,null))[_0xbc00('0x20')](removeEntity(_0x46e3af,null))[_0xbc00('0x3d')](handleError(_0x46e3af,null));};exports[_0xbc00('0x43')]=function(_0x5c9a3d,_0x1a7660,_0x2578d8){return db['Condition'][_0xbc00('0x42')]({'where':{'id':_0x5c9a3d[_0xbc00('0x3e')]['id']}})[_0xbc00('0x20')](handleEntityNotFound(_0x1a7660,null))[_0xbc00('0x20')](function(_0x51509a){if(_0x51509a){return _0x51509a['addConditions'](_0x5c9a3d['body'][_0xbc00('0x44')],_[_0xbc00('0x45')](_0x5c9a3d['body'],[_0xbc00('0x44'),'id'])||{});}})[_0xbc00('0x20')](respondWithResult(_0x1a7660,null))['catch'](handleError(_0x1a7660,null));};exports[_0xbc00('0x46')]=function(_0x3a6a43,_0x43a6ea,_0x7c20f9){var _0x21b692={};var _0x506917={};var _0xb5c2b2;var _0x5d0a33;return db[_0xbc00('0x39')][_0xbc00('0x47')]({'where':{'id':_0x3a6a43[_0xbc00('0x3e')]['id']}})[_0xbc00('0x20')](handleEntityNotFound(_0x43a6ea,null))[_0xbc00('0x20')](function(_0x344c04){if(_0x344c04){_0xb5c2b2=_0x344c04;_0x506917['model']=_[_0xbc00('0x2d')](db['Condition'][_0xbc00('0x28')]);_0x506917[_0xbc00('0x2c')]=_['keys'](_0x3a6a43['query']);_0x506917['filters']=_['intersection'](_0x506917['model'],_0x506917[_0xbc00('0x2c')]);_0x21b692['attributes']=_['intersection'](_0x506917[_0xbc00('0x30')],qs[_0xbc00('0x32')](_0x3a6a43[_0xbc00('0x2c')]['fields']));_0x21b692[_0xbc00('0x31')]=_0x21b692[_0xbc00('0x31')][_0xbc00('0x3f')]?_0x21b692[_0xbc00('0x31')]:_0x506917[_0xbc00('0x30')];_0x21b692[_0xbc00('0x48')]=qs[_0xbc00('0x33')](_0x3a6a43['query'][_0xbc00('0x33')]);_0x21b692[_0xbc00('0x36')]=qs['filters'](_[_0xbc00('0x34')](_0x3a6a43[_0xbc00('0x2c')],_0x506917['filters']));if(_0x3a6a43[_0xbc00('0x2c')][_0xbc00('0x35')]){_0x21b692[_0xbc00('0x36')]=_['merge'](_0x21b692[_0xbc00('0x36')],{'$or':_['map'](_0x21b692[_0xbc00('0x31')],function(_0x57833d){var _0x48eeff={};_0x48eeff[_0x57833d]={'$like':'%'+_0x3a6a43[_0xbc00('0x2c')][_0xbc00('0x35')]+'%'};return _0x48eeff;})});}_0x21b692=_[_0xbc00('0x37')]({},_0x21b692,_0x3a6a43['options']);return _0xb5c2b2['getConditions'](_0x21b692);}})[_0xbc00('0x20')](function(_0x4d9687){if(_0x4d9687){_0x5d0a33=_0x4d9687[_0xbc00('0x3f')];if(!_0x3a6a43['query'][_0xbc00('0x49')](_0xbc00('0x4a'))){_0x21b692['limit']=qs[_0xbc00('0x1a')](_0x3a6a43[_0xbc00('0x2c')]['limit']);_0x21b692[_0xbc00('0x18')]=qs[_0xbc00('0x18')](_0x3a6a43['query'][_0xbc00('0x18')]);}return _0xb5c2b2[_0xbc00('0x46')](_0x21b692);}})['then'](function(_0x575865){if(_0x575865){return _0x575865?{'count':_0x5d0a33,'rows':_0x575865}:null;}})[_0xbc00('0x20')](respondWithResult(_0x43a6ea,null))[_0xbc00('0x3d')](handleError(_0x43a6ea,null));};exports['addActions']=function(_0x397c42,_0x5ef492,_0x37c747){return db['Action'][_0xbc00('0x42')]({'where':{'id':_0x397c42['params']['id']}})[_0xbc00('0x20')](handleEntityNotFound(_0x5ef492,null))['then'](function(_0x5b4177){if(_0x5b4177){return _0x5b4177[_0xbc00('0x4b')](_0x397c42[_0xbc00('0x41')][_0xbc00('0x44')],_[_0xbc00('0x45')](_0x397c42[_0xbc00('0x41')],[_0xbc00('0x44'),'id'])||{});}})[_0xbc00('0x20')](respondWithResult(_0x5ef492,null))[_0xbc00('0x3d')](handleError(_0x5ef492,null));};exports[_0xbc00('0x4c')]=function(_0x24ca71,_0x4edda9,_0x3d784c){var _0xb29f74={};var _0xa12d4={};var _0x457592;var _0x23aee0;return db[_0xbc00('0x39')][_0xbc00('0x47')]({'where':{'id':_0x24ca71[_0xbc00('0x3e')]['id']}})[_0xbc00('0x20')](handleEntityNotFound(_0x4edda9,null))[_0xbc00('0x20')](function(_0x563cbb){if(_0x563cbb){_0x457592=_0x563cbb;_0xa12d4[_0xbc00('0x30')]=_['keys'](db[_0xbc00('0x4d')][_0xbc00('0x28')]);_0xa12d4[_0xbc00('0x2c')]=_['keys'](_0x24ca71[_0xbc00('0x2c')]);_0xa12d4['filters']=_[_0xbc00('0x2f')](_0xa12d4[_0xbc00('0x30')],_0xa12d4[_0xbc00('0x2c')]);_0xb29f74[_0xbc00('0x31')]=_['intersection'](_0xa12d4[_0xbc00('0x30')],qs[_0xbc00('0x32')](_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x32')]));_0xb29f74['attributes']=_0xb29f74[_0xbc00('0x31')]['length']?_0xb29f74['attributes']:_0xa12d4[_0xbc00('0x30')];_0xb29f74['order']=qs['sort'](_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x33')]);_0xb29f74[_0xbc00('0x36')]=qs[_0xbc00('0x2e')](_[_0xbc00('0x34')](_0x24ca71[_0xbc00('0x2c')],_0xa12d4[_0xbc00('0x2e')]));if(_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x35')]){_0xb29f74[_0xbc00('0x36')]=_[_0xbc00('0x37')](_0xb29f74[_0xbc00('0x36')],{'$or':_[_0xbc00('0x27')](_0xb29f74[_0xbc00('0x31')],function(_0x5b7f72){var _0x54b7cb={};_0x54b7cb[_0x5b7f72]={'$like':'%'+_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x35')]+'%'};return _0x54b7cb;})});}_0xb29f74=_[_0xbc00('0x37')]({},_0xb29f74,_0x24ca71[_0xbc00('0x38')]);return _0x457592[_0xbc00('0x4c')](_0xb29f74);}})[_0xbc00('0x20')](function(_0x36483b){if(_0x36483b){_0x23aee0=_0x36483b[_0xbc00('0x3f')];if(!_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x49')](_0xbc00('0x4a'))){_0xb29f74[_0xbc00('0x1a')]=qs[_0xbc00('0x1a')](_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x1a')]);_0xb29f74['offset']=qs[_0xbc00('0x18')](_0x24ca71[_0xbc00('0x2c')][_0xbc00('0x18')]);}return _0x457592[_0xbc00('0x4c')](_0xb29f74);}})[_0xbc00('0x20')](function(_0x201893){if(_0x201893){return _0x201893?{'count':_0x23aee0,'rows':_0x201893}:null;}})[_0xbc00('0x20')](respondWithResult(_0x4edda9,null))[_0xbc00('0x3d')](handleError(_0x4edda9,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index f2302a1..8126c7d 100644
--- a/server/api/automation/automation.model.js
+++ b/server/api/automation/automation.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4caa=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','exports','define','tools_automations'];(function(_0xa2a43,_0x22044d){var _0x5b6d77=function(_0x1c5926){while(--_0x1c5926){_0xa2a43['push'](_0xa2a43['shift']());}};_0x5b6d77(++_0x22044d);}(_0x4caa,0x1ad));var _0xa4ca=function(_0xff9b9d,_0x55eb38){_0xff9b9d=_0xff9b9d-0x0;var _0x267e23=_0x4caa[_0xff9b9d];return _0x267e23;};'use strict';var _=require(_0xa4ca('0x0'));var util=require(_0xa4ca('0x1'));var logger=require(_0xa4ca('0x2'))(_0xa4ca('0x3'));var moment=require('moment');var BPromise=require(_0xa4ca('0x4'));var rp=require(_0xa4ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4ca('0x6'));var config=require(_0xa4ca('0x7'));var attributes=require('./automation.attributes');module[_0xa4ca('0x8')]=function(_0x4c48c4,_0x505edb){return _0x4c48c4[_0xa4ca('0x9')]('Automation',attributes,{'tableName':_0xa4ca('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb583=['moment','bluebird','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util','../../config/logger','api'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0xb583,0x11a));var _0x3b58=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xb583[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x3b58('0x0'));var util=require(_0x3b58('0x1'));var logger=require(_0x3b58('0x2'))(_0x3b58('0x3'));var moment=require(_0x3b58('0x4'));var BPromise=require(_0x3b58('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3b58('0x6'));var attributes=require(_0x3b58('0x7'));module[_0x3b58('0x8')]=function(_0x2d5d97,_0x2af659){return _0x2d5d97[_0x3b58('0x9')]('Automation',attributes,{'tableName':_0x3b58('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index 913d741..417f447 100644
--- a/server/api/automation/automation.rpc.js
+++ b/server/api/automation/automation.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x160f=['http','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x53afe9,_0x2c9f40){var _0x396396=function(_0x1f574d){while(--_0x1f574d){_0x53afe9['push'](_0x53afe9['shift']());}};_0x396396(++_0x2c9f40);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var util=require(_0xf160('0x1'));var moment=require(_0xf160('0x2'));var BPromise=require(_0xf160('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf160('0x4'));var db=require(_0xf160('0x5'))['db'];var utils=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));var config=require(_0xf160('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xf160('0xa')][_0xf160('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49fe49,_0x59440e,_0x41e909){return new BPromise(function(_0x5b76c8,_0x4bf890){return client['request'](_0x49fe49,_0x41e909)[_0xf160('0xc')](function(_0x90608){logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,'request\x20sent');logger['debug'](_0xf160('0xf'),_0x59440e,_0xf160('0x10'),JSON[_0xf160('0x11')](_0x90608));if(_0x90608['error']){if(_0x90608[_0xf160('0x12')][_0xf160('0x13')]===0x1f4){logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')]['message']);return _0x4bf890(_0x90608[_0xf160('0x12')]['message']);}logger[_0xf160('0x12')](_0xf160('0xe'),_0x59440e,_0x90608[_0xf160('0x12')][_0xf160('0x14')]);return _0x5b76c8(_0x90608[_0xf160('0x12')][_0xf160('0x14')]);}else{logger[_0xf160('0xd')](_0xf160('0xe'),_0x59440e,_0xf160('0x10'));_0x5b76c8(_0x90608['result'][_0xf160('0x14')]);}})[_0xf160('0x15')](function(_0x8699a0){logger[_0xf160('0x12')]('Automation,\x20%s,\x20%s',_0x59440e,_0x8699a0);_0x4bf890(_0x8699a0);});});}
\ No newline at end of file
+var _0xb0ee=['../../config/environment','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x54e079,_0x4b35d0){var _0x45eaff=function(_0x4cca2b){while(--_0x4cca2b){_0x54e079['push'](_0x54e079['shift']());}};_0x45eaff(++_0x4b35d0);}(_0xb0ee,0x18f));var _0xeb0e=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0xb0ee[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require(_0xeb0e('0x0'));var moment=require(_0xeb0e('0x1'));var BPromise=require(_0xeb0e('0x2'));var rs=require(_0xeb0e('0x3'));var fs=require('fs');var Redis=require(_0xeb0e('0x4'));var db=require(_0xeb0e('0x5'))['db'];var utils=require(_0xeb0e('0x6'));var logger=require(_0xeb0e('0x7'))(_0xeb0e('0x8'));var config=require(_0xeb0e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xeb0e('0xa')][_0xeb0e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x423095,_0x3e7872,_0x572ee1){return new BPromise(function(_0x3b3c6e,_0x1dcf56){return client[_0xeb0e('0xc')](_0x423095,_0x572ee1)[_0xeb0e('0xd')](function(_0x2b90ba){logger[_0xeb0e('0xe')](_0xeb0e('0xf'),_0x3e7872,_0xeb0e('0x10'));logger[_0xeb0e('0x11')](_0xeb0e('0x12'),_0x3e7872,_0xeb0e('0x10'),JSON[_0xeb0e('0x13')](_0x2b90ba));if(_0x2b90ba[_0xeb0e('0x14')]){if(_0x2b90ba[_0xeb0e('0x14')][_0xeb0e('0x15')]===0x1f4){logger[_0xeb0e('0x14')](_0xeb0e('0xf'),_0x3e7872,_0x2b90ba[_0xeb0e('0x14')]['message']);return _0x1dcf56(_0x2b90ba['error'][_0xeb0e('0x16')]);}logger['error']('Automation,\x20%s,\x20%s',_0x3e7872,_0x2b90ba[_0xeb0e('0x14')][_0xeb0e('0x16')]);return _0x3b3c6e(_0x2b90ba[_0xeb0e('0x14')][_0xeb0e('0x16')]);}else{logger['info'](_0xeb0e('0xf'),_0x3e7872,_0xeb0e('0x10'));_0x3b3c6e(_0x2b90ba['result'][_0xeb0e('0x16')]);}})[_0xeb0e('0x17')](function(_0xa9a9c4){logger[_0xeb0e('0x14')](_0xeb0e('0xf'),_0x3e7872,_0xa9a9c4);_0x1dcf56(_0xa9a9c4);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index dbb5b29..5b05f1e 100644
--- a/server/api/automation/index.js
+++ b/server/api/automation/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb97=['util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','create','addActions','put','update','delete','multer'];(function(_0x543fcd,_0x3c7dc4){var _0xf58b27=function(_0x312fe6){while(--_0x312fe6){_0x543fcd['push'](_0x543fcd['shift']());}};_0xf58b27(++_0x3c7dc4);}(_0xcb97,0x14f));var _0x7cb9=function(_0x230754,_0x68aa94){_0x230754=_0x230754-0x0;var _0x12c3cf=_0xcb97[_0x230754];return _0x12c3cf;};'use strict';var multer=require(_0x7cb9('0x0'));var util=require(_0x7cb9('0x1'));var path=require(_0x7cb9('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x7cb9('0x3'));var auth=require(_0x7cb9('0x4'));var interaction=require(_0x7cb9('0x5'));var config=require(_0x7cb9('0x6'));var controller=require(_0x7cb9('0x7'));router[_0x7cb9('0x8')]('/',auth[_0x7cb9('0x9')](),controller[_0x7cb9('0xa')]);router[_0x7cb9('0x8')](_0x7cb9('0xb'),auth[_0x7cb9('0x9')](),controller[_0x7cb9('0xc')]);router['get'](_0x7cb9('0xd'),auth[_0x7cb9('0x9')](),controller['getConditions']);router['get'](_0x7cb9('0xe'),auth[_0x7cb9('0x9')](),controller['getActions']);router[_0x7cb9('0xf')]('/',auth[_0x7cb9('0x9')](),controller[_0x7cb9('0x10')]);router[_0x7cb9('0xf')](_0x7cb9('0xd'),auth[_0x7cb9('0x9')](),controller['addConditions']);router[_0x7cb9('0xf')](_0x7cb9('0xe'),auth[_0x7cb9('0x9')](),controller[_0x7cb9('0x11')]);router[_0x7cb9('0x12')](_0x7cb9('0xb'),auth[_0x7cb9('0x9')](),controller[_0x7cb9('0x13')]);router[_0x7cb9('0x14')](_0x7cb9('0xb'),auth[_0x7cb9('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xacb8=['addActions','/:id','update','delete','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment','./automation.controller','get','isAuthenticated','index','show','/:id/conditions','getConditions','getActions','post','addConditions','/:id/actions'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xacb8,0x119));var _0x8acb=function(_0x5034cb,_0x322be8){_0x5034cb=_0x5034cb-0x0;var _0x44c8e2=_0xacb8[_0x5034cb];return _0x44c8e2;};'use strict';var multer=require(_0x8acb('0x0'));var util=require('util');var path=require(_0x8acb('0x1'));var timeout=require(_0x8acb('0x2'));var express=require(_0x8acb('0x3'));var router=express['Router']();var fs_extra=require(_0x8acb('0x4'));var auth=require(_0x8acb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x8acb('0x6'));var controller=require(_0x8acb('0x7'));router[_0x8acb('0x8')]('/',auth[_0x8acb('0x9')](),controller[_0x8acb('0xa')]);router[_0x8acb('0x8')]('/:id',auth[_0x8acb('0x9')](),controller[_0x8acb('0xb')]);router[_0x8acb('0x8')](_0x8acb('0xc'),auth[_0x8acb('0x9')](),controller[_0x8acb('0xd')]);router['get']('/:id/actions',auth[_0x8acb('0x9')](),controller[_0x8acb('0xe')]);router[_0x8acb('0xf')]('/',auth[_0x8acb('0x9')](),controller['create']);router[_0x8acb('0xf')](_0x8acb('0xc'),auth['isAuthenticated'](),controller[_0x8acb('0x10')]);router[_0x8acb('0xf')](_0x8acb('0x11'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x12')]);router['put'](_0x8acb('0x13'),auth[_0x8acb('0x9')](),controller[_0x8acb('0x14')]);router[_0x8acb('0x15')](_0x8acb('0x13'),auth[_0x8acb('0x9')](),controller['destroy']);module[_0x8acb('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5816835..0e127fe 100644
--- a/server/api/campaign/campaign.attributes.js
+++ b/server/api/campaign/campaign.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1dd8=['onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','INTEGER','UNSIGNED','Max\x20200\x20calls.','STRING','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never'];(function(_0x43bf1a,_0x42c020){var _0x1b3ad6=function(_0x211a9f){while(--_0x211a9f){_0x43bf1a['push'](_0x43bf1a['shift']());}};_0x1b3ad6(++_0x42c020);}(_0x1dd8,0x13c));var _0x81dd=function(_0x460ea3,_0x42970b){_0x460ea3=_0x460ea3-0x0;var _0x1b6b53=_0x1dd8[_0x460ea3];return _0x1b6b53;};'use strict';var Sequelize=require(_0x81dd('0x0'));module[_0x81dd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x81dd('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x81dd('0x3')](_0x81dd('0x4')),'allowNull':![],'defaultValue':_0x81dd('0x4')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x81dd('0x5')](0x4)[_0x81dd('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x81dd('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x81dd('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x81dd('0x8')]},'dialOriginateTimeout':{'type':Sequelize[_0x81dd('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81dd('0x9')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x81dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81dd('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x81dd('0x5')](0x5)[_0x81dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x81dd('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x81dd('0x5')](0x5)[_0x81dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x81dd('0xe')},'dialTimezone':{'type':Sequelize[_0x81dd('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x81dd('0x8')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x81dd('0xf'),_0x81dd('0x10'),_0x81dd('0x11')),'defaultValue':_0x81dd('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x81dd('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x81dd('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x81dd('0x5')](0x9)[_0x81dd('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x81dd('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x81dd('0x5')](0x9)[_0x81dd('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x81dd('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x81dd('0x5')](0x9)[_0x81dd('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x81dd('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x81dd('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x81dd('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x81dd('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x81dd('0x5')](0x9)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x81dd('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x81dd('0x5')](0x5)[_0x81dd('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x81dd('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x81dd('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x81dd('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x81dd('0x3')](_0x81dd('0x1a'),'ASC'),'defaultValue':_0x81dd('0x1a')},'dialPrefix':{'type':Sequelize[_0x81dd('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x81dd('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81dd('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x81dd('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0x1d')},'dialDropMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81dd('0x1e')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x81dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81dd('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x81dd('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x81dd('0x5')](0x3)[_0x81dd('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x81dd('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x81dd('0x5')](0x5)[_0x81dd('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x81dd('0x24')}};
\ No newline at end of file
+var _0x4463=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','Max\x20200\x20calls.','INTEGER','UNSIGNED'];(function(_0x3a1db7,_0x2138a8){var _0x12acf8=function(_0x263a72){while(--_0x263a72){_0x3a1db7['push'](_0x3a1db7['shift']());}};_0x12acf8(++_0x2138a8);}(_0x4463,0x186));var _0x3446=function(_0x915228,_0x1abb38){_0x915228=_0x915228-0x0;var _0x2cff4f=_0x4463[_0x915228];return _0x2cff4f;};'use strict';var Sequelize=require('sequelize');module[_0x3446('0x0')]={'name':{'type':Sequelize[_0x3446('0x1')],'unique':_0x3446('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x3446('0x3')](_0x3446('0x4')),'allowNull':![],'defaultValue':_0x3446('0x4')},'description':{'type':Sequelize[_0x3446('0x1')]},'active':{'type':Sequelize[_0x3446('0x5')],'defaultValue':0x0,'comment':_0x3446('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x3446('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3446('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3446('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x3446('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0xd')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3446('0x8')](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3446('0x9')],'defaultValue':0x3,'comment':_0x3446('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3446('0x8')](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0x3446('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3446('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3446('0x10'),_0x3446('0x11'),_0x3446('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x3446('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3446('0x8')](0x9)[_0x3446('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3446('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x3446('0x8')](0x9)[_0x3446('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3446('0x8')](0x9)[_0x3446('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3446('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3446('0x8')](0x9)[_0x3446('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3446('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x3446('0x8')](0x9)[_0x3446('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3446('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3446('0x8')](0x9)[_0x3446('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3446('0x17')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x3446('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3446('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x3446('0x8')](0x5)[_0x3446('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3446('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x3446('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3446('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3446('0x3')](_0x3446('0x1b'),'ASC'),'defaultValue':_0x3446('0x1b')},'dialPrefix':{'type':Sequelize[_0x3446('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3446('0x1c')},'dialCutDigit':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3446('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x3446('0x8')](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x3446('0x8')](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0x23')},'dialMachineMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0x24')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0x25')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x3446('0x8')](0x3)[_0x3446('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3446('0x26')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x3446('0x8')](0x5)[_0x3446('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3446('0x27')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index a177dfb..dc68ad5 100644
--- a/server/api/campaign/campaign.controller.js
+++ b/server/api/campaign/campaign.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x641b=['getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cmHopperId','OrderBy','h.id','ci.OrderBY','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','sequelize','removeBlackLists','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','limit','undefined','count','reject','save','update','destroy','then','get','UserProfileResource','end','stack','name','send','index','map','Campaign','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','create','role','user','IvrCampaigns','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','CmHopper','CampaignId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal'];(function(_0x5e55d5,_0x5c36de){var _0x5dba45=function(_0x18bad9){while(--_0x18bad9){_0x5e55d5['push'](_0x5e55d5['shift']());}};_0x5dba45(++_0x5c36de);}(_0x641b,0xca));var _0xb641=function(_0x2005a1,_0x470842){_0x2005a1=_0x2005a1-0x0;var _0x2e5af3=_0x641b[_0x2005a1];return _0x2e5af3;};'use strict';var emlformat=require(_0xb641('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb641('0x1'));var jsonpatch=require(_0xb641('0x2'));var rp=require(_0xb641('0x3'));var moment=require(_0xb641('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xb641('0x5'));var util=require(_0xb641('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb641('0x7'));var ejs=require(_0xb641('0x8'));var fs=require('fs');var fs_extra=require(_0xb641('0x9'));var _=require(_0xb641('0xa'));var squel=require(_0xb641('0xb'));var crypto=require(_0xb641('0xc'));var jsforce=require(_0xb641('0xd'));var deskjs=require(_0xb641('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb641('0xf'));var Papa=require(_0xb641('0x10'));var Redis=require(_0xb641('0x11'));var authService=require(_0xb641('0x12'));var qs=require(_0xb641('0x13'));var as=require(_0xb641('0x14'));var hardwareService=require(_0xb641('0x15'));var logger=require(_0xb641('0x16'))(_0xb641('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xb641('0x18'));var db=require(_0xb641('0x19'))['db'];function respondWithStatusCode(_0x5ea5f4,_0x3289ca){_0x3289ca=_0x3289ca||0xcc;return function(_0x5a1fbb){if(_0x5a1fbb){return _0x5ea5f4[_0xb641('0x1a')](_0x3289ca);}return _0x5ea5f4[_0xb641('0x1b')](_0x3289ca)['end']();};}function respondWithResult(_0x4d8ac7,_0x5484b2){_0x5484b2=_0x5484b2||0xc8;return function(_0x3603c8){if(_0x3603c8){return _0x4d8ac7[_0xb641('0x1b')](_0x5484b2)[_0xb641('0x1c')](_0x3603c8);}};}function respondWithFilteredResult(_0xd9dfd,_0x189d42){return function(_0x482ac3){if(_0x482ac3){var _0x5abb97=typeof _0x189d42[_0xb641('0x1d')]==='undefined'&&typeof _0x189d42[_0xb641('0x1e')]===_0xb641('0x1f');var _0x39886c=_0x482ac3[_0xb641('0x20')];var _0x4a8c1c=_0x5abb97?0x0:_0x189d42['offset'];var _0x329a55=_0x5abb97?_0x482ac3[_0xb641('0x20')]:_0x189d42[_0xb641('0x1d')]+_0x189d42['limit'];var _0x2bb074;if(_0x329a55>=_0x39886c){_0x329a55=_0x39886c;_0x2bb074=0xc8;}else{_0x2bb074=0xce;}_0xd9dfd['status'](_0x2bb074);return _0xd9dfd['set']('Content-Range',_0x4a8c1c+'-'+_0x329a55+'/'+_0x39886c)[_0xb641('0x1c')](_0x482ac3);}return null;};}function patchUpdates(_0x1c4d6c){return function(_0x3d0cae){try{jsonpatch['apply'](_0x3d0cae,_0x1c4d6c,!![]);}catch(_0x22ccdb){return BPromise[_0xb641('0x21')](_0x22ccdb);}return _0x3d0cae[_0xb641('0x22')]();};}function saveUpdates(_0x558739,_0x34d364){return function(_0x1d0b00){if(_0x1d0b00){return _0x1d0b00[_0xb641('0x23')](_0x558739)['then'](function(_0xd99d27){return _0xd99d27;});}return null;};}function removeEntity(_0x56aa9d,_0x51b49b){return function(_0x1fde2b){if(_0x1fde2b){return _0x1fde2b[_0xb641('0x24')]()[_0xb641('0x25')](function(){var _0x178dc3=_0x1fde2b[_0xb641('0x26')]({'plain':!![]});var _0x55c26f='IvrCampaigns';return db[_0xb641('0x27')][_0xb641('0x24')]({'where':{'type':_0x55c26f,'resourceId':_0x178dc3['id']}})[_0xb641('0x25')](function(){return _0x1fde2b;});})[_0xb641('0x25')](function(){_0x56aa9d[_0xb641('0x1b')](0xcc)[_0xb641('0x28')]();});}};}function handleEntityNotFound(_0x3e9b7f,_0x5b9147){return function(_0x1999a2){if(!_0x1999a2){_0x3e9b7f[_0xb641('0x1a')](0x194);}return _0x1999a2;};}function handleError(_0xf8d4fd,_0x360185){_0x360185=_0x360185||0x1f4;return function(_0x3a28ca){logger['error'](_0x3a28ca[_0xb641('0x29')]);if(_0x3a28ca[_0xb641('0x2a')]){delete _0x3a28ca[_0xb641('0x2a')];}_0xf8d4fd[_0xb641('0x1b')](_0x360185)[_0xb641('0x2b')](_0x3a28ca);};}exports[_0xb641('0x2c')]=function(_0x567137,_0x2815d2){var _0x3991d5={},_0x1e1b21={},_0x157ad1={'count':0x0,'rows':[]};var _0x2fa23a=_[_0xb641('0x2d')](db[_0xb641('0x2e')][_0xb641('0x2f')],function(_0x1a2cdd){return{'name':_0x1a2cdd['fieldName'],'type':_0x1a2cdd[_0xb641('0x30')]['key']};});_0x1e1b21[_0xb641('0x31')]=_[_0xb641('0x2d')](_0x2fa23a,_0xb641('0x2a'));_0x1e1b21[_0xb641('0x32')]=_['keys'](_0x567137[_0xb641('0x32')]);_0x1e1b21['filters']=_[_0xb641('0x33')](_0x1e1b21[_0xb641('0x31')],_0x1e1b21[_0xb641('0x32')]);_0x3991d5[_0xb641('0x34')]=_[_0xb641('0x33')](_0x1e1b21['model'],qs[_0xb641('0x35')](_0x567137[_0xb641('0x32')][_0xb641('0x35')]));_0x3991d5[_0xb641('0x34')]=_0x3991d5['attributes'][_0xb641('0x36')]?_0x3991d5[_0xb641('0x34')]:_0x1e1b21[_0xb641('0x31')];if(!_0x567137[_0xb641('0x32')][_0xb641('0x37')](_0xb641('0x38'))){_0x3991d5[_0xb641('0x1e')]=qs[_0xb641('0x1e')](_0x567137[_0xb641('0x32')][_0xb641('0x1e')]);_0x3991d5[_0xb641('0x1d')]=qs['offset'](_0x567137[_0xb641('0x32')][_0xb641('0x1d')]);}_0x3991d5[_0xb641('0x39')]=qs['sort'](_0x567137[_0xb641('0x32')][_0xb641('0x3a')]);_0x3991d5[_0xb641('0x3b')]=qs[_0xb641('0x3c')](_[_0xb641('0x3d')](_0x567137[_0xb641('0x32')],_0x1e1b21[_0xb641('0x3c')]),_0x2fa23a);if(_0x567137['query'][_0xb641('0x3e')]){_0x3991d5[_0xb641('0x3b')]=_[_0xb641('0x3f')](_0x3991d5['where'],{'$or':_[_0xb641('0x2d')](_0x2fa23a,function(_0x4bf855){if(_0x4bf855['type']!==_0xb641('0x40')){var _0x3e09c0={};_0x3e09c0[_0x4bf855[_0xb641('0x2a')]]={'$like':'%'+_0x567137[_0xb641('0x32')]['filter']+'%'};return _0x3e09c0;}})});}_0x3991d5=_[_0xb641('0x3f')]({},_0x3991d5,_0x567137[_0xb641('0x41')]);var _0x82c93a={'where':_0x3991d5[_0xb641('0x3b')]};return db[_0xb641('0x2e')][_0xb641('0x20')](_0x82c93a)['then'](function(_0x387faa){_0x157ad1[_0xb641('0x20')]=_0x387faa;if(_0x567137['query'][_0xb641('0x42')]){_0x3991d5['include']=[{'all':!![]}];}return db[_0xb641('0x2e')][_0xb641('0x43')](_0x3991d5);})['then'](function(_0x570b98){_0x157ad1[_0xb641('0x44')]=_0x570b98;return _0x157ad1;})['then'](respondWithFilteredResult(_0x2815d2,_0x3991d5))[_0xb641('0x45')](handleError(_0x2815d2,null));};exports[_0xb641('0x46')]=function(_0x299d2a,_0x450843){var _0x3cf412={'raw':![],'where':{'id':_0x299d2a[_0xb641('0x47')]['id']}},_0x58d063={};_0x58d063[_0xb641('0x31')]=_[_0xb641('0x48')](db[_0xb641('0x2e')][_0xb641('0x2f')]);_0x58d063['query']=_[_0xb641('0x48')](_0x299d2a[_0xb641('0x32')]);_0x58d063[_0xb641('0x3c')]=_[_0xb641('0x33')](_0x58d063[_0xb641('0x31')],_0x58d063[_0xb641('0x32')]);_0x3cf412[_0xb641('0x34')]=_[_0xb641('0x33')](_0x58d063[_0xb641('0x31')],qs['fields'](_0x299d2a['query'][_0xb641('0x35')]));_0x3cf412[_0xb641('0x34')]=_0x3cf412[_0xb641('0x34')]['length']?_0x3cf412[_0xb641('0x34')]:_0x58d063[_0xb641('0x31')];if(_0x299d2a['query']['includeAll']){_0x3cf412[_0xb641('0x49')]=[{'all':!![]}];}_0x3cf412=_['merge']({},_0x3cf412,_0x299d2a[_0xb641('0x41')]);return db[_0xb641('0x2e')][_0xb641('0x4a')](_0x3cf412)[_0xb641('0x25')](handleEntityNotFound(_0x450843,null))[_0xb641('0x25')](respondWithResult(_0x450843,null))[_0xb641('0x45')](handleError(_0x450843,null));};exports[_0xb641('0x4b')]=function(_0x1e5613,_0xe9c52d){return db[_0xb641('0x2e')]['create'](_0x1e5613['body'],{})[_0xb641('0x25')](function(_0xac9a5f){var _0x2cc415=_0x1e5613['user'][_0xb641('0x26')]({'plain':!![]});if(!_0x2cc415)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2cc415[_0xb641('0x4c')]===_0xb641('0x4d')){var _0x4a1c78=_0xac9a5f[_0xb641('0x26')]({'plain':!![]});var _0x37069b=_0xb641('0x4e');return db[_0xb641('0x4f')][_0xb641('0x4a')]({'where':{'name':_0x37069b,'userProfileId':_0x2cc415[_0xb641('0x50')]},'raw':!![]})[_0xb641('0x25')](function(_0x232256){if(_0x232256&&_0x232256['autoAssociation']===0x0){return db[_0xb641('0x27')][_0xb641('0x4b')]({'name':_0x4a1c78[_0xb641('0x2a')],'resourceId':_0x4a1c78['id'],'type':_0x232256[_0xb641('0x2a')],'sectionId':_0x232256['id']},{})[_0xb641('0x25')](function(){return _0xac9a5f;});}else{return _0xac9a5f;}})[_0xb641('0x45')](function(_0x688ff0){logger[_0xb641('0x51')](_0xb641('0x52'),_0x688ff0);throw _0x688ff0;});}return _0xac9a5f;})[_0xb641('0x25')](respondWithResult(_0xe9c52d,0xc9))[_0xb641('0x45')](handleError(_0xe9c52d,null));};exports[_0xb641('0x53')]=function(_0x20d5dc,_0x3435ab){var _0x2e0e28={'where':{'id':_0x20d5dc['params']['id']}},_0x24105f={};_0x24105f[_0xb641('0x31')]=_[_0xb641('0x48')](db['Campaign'][_0xb641('0x2f')]);_0x2e0e28[_0xb641('0x34')]=_[_0xb641('0x33')](_0x24105f[_0xb641('0x31')],qs['fields'](_0x20d5dc['query'][_0xb641('0x35')]));_0x2e0e28[_0xb641('0x34')]=_0x2e0e28[_0xb641('0x34')][_0xb641('0x36')]?_0x2e0e28[_0xb641('0x34')]:_0x24105f[_0xb641('0x31')];if(_0x20d5dc[_0xb641('0x32')][_0xb641('0x42')]){_0x2e0e28[_0xb641('0x49')]=[{'all':!![]}];}_0x2e0e28=_[_0xb641('0x3f')]({},_0x2e0e28,_0x20d5dc[_0xb641('0x41')]);return db[_0xb641('0x2e')]['find'](_0x2e0e28)[_0xb641('0x25')](handleEntityNotFound(_0x3435ab,null))[_0xb641('0x25')](function(_0x3f4f2a){if(_0x3f4f2a){var _0x140207=_0x3f4f2a[_0xb641('0x26')]({'plain':!![]});_0x140207=qs['omit'](_0x140207,['id',_0xb641('0x54'),_0xb641('0x55')]);_0x20d5dc[_0xb641('0x56')]=_[_0xb641('0x57')](_0x20d5dc[_0xb641('0x56')],['id',_0xb641('0x54'),_0xb641('0x55')]);return db[_0xb641('0x2e')][_0xb641('0x4b')](_['merge'](_0x140207,_0x20d5dc['body']),{'include':_0x20d5dc['query'][_0xb641('0x42')]?[{'all':!![]}]:undefined})[_0xb641('0x25')](function(_0x432366){var _0x4e385d=_0x20d5dc[_0xb641('0x4d')][_0xb641('0x26')]({'plain':!![]});if(!_0x4e385d)throw new Error(_0xb641('0x58'));if(_0x4e385d[_0xb641('0x4c')]===_0xb641('0x4d')){var _0xe183cb=_0x432366['get']({'plain':!![]});var _0x59fdcb=_0xb641('0x4e');return db[_0xb641('0x4f')][_0xb641('0x4a')]({'where':{'name':_0x59fdcb,'userProfileId':_0x4e385d[_0xb641('0x50')]},'raw':!![]})[_0xb641('0x25')](function(_0x1b0a2a){if(_0x1b0a2a&&_0x1b0a2a[_0xb641('0x59')]===0x0){return db[_0xb641('0x27')][_0xb641('0x4b')]({'name':_0xe183cb['name'],'resourceId':_0xe183cb['id'],'type':_0x1b0a2a[_0xb641('0x2a')],'sectionId':_0x1b0a2a['id']},{})['then'](function(){return _0x432366;});}else{return _0x432366;}})[_0xb641('0x45')](function(_0x43f475){logger[_0xb641('0x51')](_0xb641('0x52'),_0x43f475);throw _0x43f475;});}return _0x432366;});}})[_0xb641('0x25')](respondWithResult(_0x3435ab,0xc9))[_0xb641('0x45')](handleError(_0x3435ab,null));};exports[_0xb641('0x23')]=function(_0x1a70bb,_0x3570a7){if(_0x1a70bb['body']['id']){delete _0x1a70bb[_0xb641('0x56')]['id'];}return db[_0xb641('0x2e')][_0xb641('0x4a')]({'where':{'id':_0x1a70bb['params']['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x3570a7,null))[_0xb641('0x25')](saveUpdates(_0x1a70bb[_0xb641('0x56')],null))['then'](respondWithResult(_0x3570a7,null))['catch'](handleError(_0x3570a7,null));};exports['destroy']=function(_0x3a6307,_0xedc83a){return db[_0xb641('0x2e')][_0xb641('0x4a')]({'where':{'id':_0x3a6307['params']['id']}})[_0xb641('0x25')](handleEntityNotFound(_0xedc83a,null))['then'](removeEntity(_0xedc83a,null))[_0xb641('0x45')](handleError(_0xedc83a,null));};exports[_0xb641('0x5a')]=function(_0x5bacd7,_0x500d1c,_0x2458fc){var _0x1645f9={'raw':!![],'where':{}};var _0x5a20b2={};var _0x119180={'count':0x0,'rows':[]};return db['Campaign'][_0xb641('0x5b')]({'where':{'id':_0x5bacd7[_0xb641('0x47')]['id']}})['then'](handleEntityNotFound(_0x500d1c,null))[_0xb641('0x25')](function(_0x3a66b2){if(_0x3a66b2){_0x5a20b2[_0xb641('0x31')]=_['keys'](db[_0xb641('0x5c')][_0xb641('0x2f')]);_0x5a20b2['query']=_[_0xb641('0x48')](_0x5bacd7['query']);_0x5a20b2[_0xb641('0x3c')]=_[_0xb641('0x33')](_0x5a20b2[_0xb641('0x31')],_0x5a20b2[_0xb641('0x32')]);_0x1645f9[_0xb641('0x34')]=_[_0xb641('0x33')](_0x5a20b2[_0xb641('0x31')],qs[_0xb641('0x35')](_0x5bacd7['query']['fields']));_0x1645f9[_0xb641('0x34')]=_0x1645f9['attributes'][_0xb641('0x36')]?_0x1645f9['attributes']:_0x5a20b2[_0xb641('0x31')];if(!_0x5bacd7[_0xb641('0x32')][_0xb641('0x37')](_0xb641('0x38'))){_0x1645f9[_0xb641('0x1e')]=qs[_0xb641('0x1e')](_0x5bacd7[_0xb641('0x32')][_0xb641('0x1e')]);_0x1645f9[_0xb641('0x1d')]=qs[_0xb641('0x1d')](_0x5bacd7[_0xb641('0x32')][_0xb641('0x1d')]);}_0x1645f9[_0xb641('0x39')]=qs['sort'](_0x5bacd7[_0xb641('0x32')]['sort']);_0x1645f9[_0xb641('0x3b')]=qs[_0xb641('0x3c')](_[_0xb641('0x3d')](_0x5bacd7[_0xb641('0x32')],_0x5a20b2[_0xb641('0x3c')]));_0x1645f9[_0xb641('0x3b')][_0xb641('0x5d')]=_0x3a66b2['id'];if(_0x5bacd7[_0xb641('0x32')][_0xb641('0x3e')]){_0x1645f9[_0xb641('0x3b')]=_[_0xb641('0x3f')](_0x1645f9[_0xb641('0x3b')],{'$or':_['map'](_0x1645f9[_0xb641('0x34')],function(_0xaa9c8b){var _0x246286={};_0x246286[_0xaa9c8b]={'$like':'%'+_0x5bacd7[_0xb641('0x32')][_0xb641('0x3e')]+'%'};return _0x246286;})});}_0x1645f9=_[_0xb641('0x3f')]({},_0x1645f9,_0x5bacd7[_0xb641('0x41')]);return db[_0xb641('0x5c')]['count']({'where':_0x1645f9['where']})[_0xb641('0x25')](function(_0x4460a4){_0x119180['count']=_0x4460a4;if(_0x5bacd7[_0xb641('0x32')][_0xb641('0x42')]){_0x1645f9['include']=[{'all':!![]}];}return db['CmHopper'][_0xb641('0x43')](_0x1645f9);})[_0xb641('0x25')](function(_0x3764b2){_0x119180['rows']=_0x3764b2;return _0x119180;});}})['then'](respondWithFilteredResult(_0x500d1c,_0x1645f9))[_0xb641('0x45')](handleError(_0x500d1c,null));};exports[_0xb641('0x5e')]=function(_0x5cc549,_0x1aa366,_0x1efa2b){var _0x3a9590={'raw':!![],'where':{}};var _0x154cc9={};var _0x3a0d8f={'count':0x0,'rows':[]};return db[_0xb641('0x2e')]['findOne']({'where':{'id':_0x5cc549[_0xb641('0x47')]['id']}})['then'](handleEntityNotFound(_0x1aa366,null))[_0xb641('0x25')](function(_0xccef65){if(_0xccef65){_0x154cc9[_0xb641('0x31')]=_['keys'](db[_0xb641('0x5f')]['rawAttributes']);_0x154cc9['query']=_[_0xb641('0x48')](_0x5cc549[_0xb641('0x32')]);_0x154cc9[_0xb641('0x3c')]=_[_0xb641('0x33')](_0x154cc9['model'],_0x154cc9['query']);_0x3a9590[_0xb641('0x34')]=_[_0xb641('0x33')](_0x154cc9[_0xb641('0x31')],qs[_0xb641('0x35')](_0x5cc549[_0xb641('0x32')][_0xb641('0x35')]));_0x3a9590[_0xb641('0x34')]=_0x3a9590[_0xb641('0x34')][_0xb641('0x36')]?_0x3a9590['attributes']:_0x154cc9[_0xb641('0x31')];if(!_0x5cc549['query'][_0xb641('0x37')](_0xb641('0x38'))){_0x3a9590[_0xb641('0x1e')]=qs[_0xb641('0x1e')](_0x5cc549[_0xb641('0x32')][_0xb641('0x1e')]);_0x3a9590[_0xb641('0x1d')]=qs[_0xb641('0x1d')](_0x5cc549[_0xb641('0x32')][_0xb641('0x1d')]);}_0x3a9590[_0xb641('0x39')]=qs[_0xb641('0x3a')](_0x5cc549[_0xb641('0x32')][_0xb641('0x3a')]);_0x3a9590[_0xb641('0x3b')]=qs['filters'](_['pick'](_0x5cc549[_0xb641('0x32')],_0x154cc9['filters']));_0x3a9590['where'][_0xb641('0x5d')]=_0xccef65['id'];if(_0x5cc549[_0xb641('0x32')][_0xb641('0x3e')]){_0x3a9590[_0xb641('0x3b')]=_[_0xb641('0x3f')](_0x3a9590['where'],{'$or':_[_0xb641('0x2d')](_0x3a9590[_0xb641('0x34')],function(_0x108290){var _0x12e32b={};_0x12e32b[_0x108290]={'$like':'%'+_0x5cc549[_0xb641('0x32')]['filter']+'%'};return _0x12e32b;})});}_0x3a9590=_['merge']({},_0x3a9590,_0x5cc549[_0xb641('0x41')]);return db[_0xb641('0x5f')][_0xb641('0x20')]({'where':_0x3a9590[_0xb641('0x3b')]})[_0xb641('0x25')](function(_0x125a8f){_0x3a0d8f[_0xb641('0x20')]=_0x125a8f;if(_0x5cc549[_0xb641('0x32')][_0xb641('0x42')]){_0x3a9590['include']=[{'all':!![]}];}return db[_0xb641('0x5f')][_0xb641('0x43')](_0x3a9590);})[_0xb641('0x25')](function(_0x41a809){_0x3a0d8f['rows']=_0x41a809;return _0x3a0d8f;});}})['then'](respondWithFilteredResult(_0x1aa366,_0x3a9590))[_0xb641('0x45')](handleError(_0x1aa366,null));};exports[_0xb641('0x60')]=function(_0x163e0a,_0x27fcf6,_0x1ec0d0){var _0x5ed630={'raw':!![],'where':{}};var _0x420658={};var _0x266d77={'count':0x0,'rows':[]};return db['Campaign'][_0xb641('0x5b')]({'where':{'id':_0x163e0a[_0xb641('0x47')]['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x27fcf6,null))[_0xb641('0x25')](function(_0x2b65e3){if(_0x2b65e3){_0x420658[_0xb641('0x31')]=_['keys'](db[_0xb641('0x61')][_0xb641('0x2f')]);_0x420658[_0xb641('0x32')]=_['keys'](_0x163e0a['query']);_0x420658[_0xb641('0x3c')]=_[_0xb641('0x33')](_0x420658[_0xb641('0x31')],_0x420658[_0xb641('0x32')]);_0x5ed630[_0xb641('0x34')]=_[_0xb641('0x33')](_0x420658['model'],qs['fields'](_0x163e0a['query'][_0xb641('0x35')]));_0x5ed630[_0xb641('0x34')]=_0x5ed630[_0xb641('0x34')][_0xb641('0x36')]?_0x5ed630[_0xb641('0x34')]:_0x420658[_0xb641('0x31')];if(!_0x163e0a[_0xb641('0x32')][_0xb641('0x37')](_0xb641('0x38'))){_0x5ed630[_0xb641('0x1e')]=qs[_0xb641('0x1e')](_0x163e0a[_0xb641('0x32')][_0xb641('0x1e')]);_0x5ed630[_0xb641('0x1d')]=qs['offset'](_0x163e0a[_0xb641('0x32')]['offset']);}_0x5ed630[_0xb641('0x39')]=qs[_0xb641('0x3a')](_0x163e0a[_0xb641('0x32')][_0xb641('0x3a')]);_0x5ed630[_0xb641('0x3b')]=qs[_0xb641('0x3c')](_[_0xb641('0x3d')](_0x163e0a[_0xb641('0x32')],_0x420658[_0xb641('0x3c')]));_0x5ed630['where'][_0xb641('0x5d')]=_0x2b65e3['id'];if(_0x163e0a['query'][_0xb641('0x3e')]){_0x5ed630[_0xb641('0x3b')]=_[_0xb641('0x3f')](_0x5ed630[_0xb641('0x3b')],{'$or':_[_0xb641('0x2d')](_0x5ed630['attributes'],function(_0x596314){var _0x37a268={};_0x37a268[_0x596314]={'$like':'%'+_0x163e0a['query']['filter']+'%'};return _0x37a268;})});}_0x5ed630=_[_0xb641('0x3f')]({},_0x5ed630,_0x163e0a['options']);return db['CmHopperFinal'][_0xb641('0x20')]({'where':_0x5ed630[_0xb641('0x3b')]})[_0xb641('0x25')](function(_0x2edcb9){_0x266d77[_0xb641('0x20')]=_0x2edcb9;if(_0x163e0a[_0xb641('0x32')][_0xb641('0x42')]){_0x5ed630['include']=[{'all':!![]}];}return db[_0xb641('0x61')][_0xb641('0x43')](_0x5ed630);})[_0xb641('0x25')](function(_0x3fcd56){_0x266d77['rows']=_0x3fcd56;return _0x266d77;});}})[_0xb641('0x25')](respondWithFilteredResult(_0x27fcf6,_0x5ed630))[_0xb641('0x45')](handleError(_0x27fcf6,null));};exports[_0xb641('0x62')]=function(_0x39943a,_0x15bc8d,_0x4c6a50){var _0x2800f9={'raw':!![],'where':{}};var _0x1731c5={};var _0x359b83={'count':0x0,'rows':[]};return db[_0xb641('0x2e')][_0xb641('0x5b')]({'where':{'id':_0x39943a['params']['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x15bc8d,null))[_0xb641('0x25')](function(_0x5bd846){if(_0x5bd846){_0x1731c5['model']=_['keys'](db['CmHopperBlack'][_0xb641('0x2f')]);_0x1731c5[_0xb641('0x32')]=_[_0xb641('0x48')](_0x39943a[_0xb641('0x32')]);_0x1731c5['filters']=_[_0xb641('0x33')](_0x1731c5[_0xb641('0x31')],_0x1731c5[_0xb641('0x32')]);_0x2800f9['attributes']=_[_0xb641('0x33')](_0x1731c5[_0xb641('0x31')],qs[_0xb641('0x35')](_0x39943a[_0xb641('0x32')]['fields']));_0x2800f9[_0xb641('0x34')]=_0x2800f9[_0xb641('0x34')][_0xb641('0x36')]?_0x2800f9[_0xb641('0x34')]:_0x1731c5['model'];if(!_0x39943a[_0xb641('0x32')][_0xb641('0x37')](_0xb641('0x38'))){_0x2800f9[_0xb641('0x1e')]=qs[_0xb641('0x1e')](_0x39943a['query'][_0xb641('0x1e')]);_0x2800f9[_0xb641('0x1d')]=qs[_0xb641('0x1d')](_0x39943a[_0xb641('0x32')][_0xb641('0x1d')]);}_0x2800f9['order']=qs[_0xb641('0x3a')](_0x39943a[_0xb641('0x32')]['sort']);_0x2800f9['where']=qs[_0xb641('0x3c')](_['pick'](_0x39943a['query'],_0x1731c5[_0xb641('0x3c')]));_0x2800f9[_0xb641('0x3b')]['CampaignId']=_0x5bd846['id'];if(_0x39943a[_0xb641('0x32')][_0xb641('0x3e')]){_0x2800f9[_0xb641('0x3b')]=_[_0xb641('0x3f')](_0x2800f9[_0xb641('0x3b')],{'$or':_['map'](_0x2800f9['attributes'],function(_0x3e57e8){var _0xcc0349={};_0xcc0349[_0x3e57e8]={'$like':'%'+_0x39943a[_0xb641('0x32')]['filter']+'%'};return _0xcc0349;})});}_0x2800f9=_[_0xb641('0x3f')]({},_0x2800f9,_0x39943a[_0xb641('0x41')]);return db[_0xb641('0x63')][_0xb641('0x20')]({'where':_0x2800f9[_0xb641('0x3b')]})[_0xb641('0x25')](function(_0x14c9bc){_0x359b83['count']=_0x14c9bc;if(_0x39943a[_0xb641('0x32')]['includeAll']){_0x2800f9[_0xb641('0x49')]=[{'all':!![]}];}return db[_0xb641('0x63')][_0xb641('0x43')](_0x2800f9);})[_0xb641('0x25')](function(_0x830923){_0x359b83[_0xb641('0x44')]=_0x830923;return _0x359b83;});}})[_0xb641('0x25')](respondWithFilteredResult(_0x15bc8d,_0x2800f9))['catch'](handleError(_0x15bc8d,null));};exports[_0xb641('0x64')]=function(_0x40efe3,_0x3474f6,_0x262ac3){var _0x36d785={};var _0x18b95c={};var _0xb1844b;var _0x3a8c5d;return db[_0xb641('0x2e')][_0xb641('0x5b')]({'where':{'id':_0x40efe3['params']['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x3474f6,null))[_0xb641('0x25')](function(_0x49deee){if(_0x49deee){_0xb1844b=_0x49deee;_0x18b95c[_0xb641('0x31')]=_[_0xb641('0x48')](db[_0xb641('0x65')]['rawAttributes']);_0x18b95c[_0xb641('0x32')]=_[_0xb641('0x48')](_0x40efe3[_0xb641('0x32')]);_0x18b95c[_0xb641('0x3c')]=_[_0xb641('0x33')](_0x18b95c['model'],_0x18b95c[_0xb641('0x32')]);_0x36d785['attributes']=_[_0xb641('0x33')](_0x18b95c[_0xb641('0x31')],qs[_0xb641('0x35')](_0x40efe3[_0xb641('0x32')][_0xb641('0x35')]));_0x36d785[_0xb641('0x34')]=_0x36d785[_0xb641('0x34')][_0xb641('0x36')]?_0x36d785[_0xb641('0x34')]:_0x18b95c['model'];_0x36d785[_0xb641('0x39')]=qs['sort'](_0x40efe3[_0xb641('0x32')][_0xb641('0x3a')]);_0x36d785[_0xb641('0x3b')]=qs[_0xb641('0x3c')](_[_0xb641('0x3d')](_0x40efe3['query'],_0x18b95c[_0xb641('0x3c')]));if(_0x40efe3['query']['filter']){_0x36d785['where']=_[_0xb641('0x3f')](_0x36d785[_0xb641('0x3b')],{'$or':_[_0xb641('0x2d')](_0x36d785[_0xb641('0x34')],function(_0x52ed62){var _0x14ad36={};_0x14ad36[_0x52ed62]={'$like':'%'+_0x40efe3['query'][_0xb641('0x3e')]+'%'};return _0x14ad36;})});}_0x36d785=_[_0xb641('0x3f')]({},_0x36d785,_0x40efe3['options']);return _0xb1844b[_0xb641('0x64')](_0x36d785);}})[_0xb641('0x25')](function(_0x15dfe3){if(_0x15dfe3){_0x3a8c5d=_0x15dfe3[_0xb641('0x36')];if(!_0x40efe3['query'][_0xb641('0x37')](_0xb641('0x38'))){_0x36d785[_0xb641('0x1e')]=qs['limit'](_0x40efe3[_0xb641('0x32')][_0xb641('0x1e')]);_0x36d785[_0xb641('0x1d')]=qs['offset'](_0x40efe3['query'][_0xb641('0x1d')]);}return _0xb1844b[_0xb641('0x64')](_0x36d785);}})[_0xb641('0x25')](function(_0x4c29c0){if(_0x4c29c0){return _0x4c29c0?{'count':_0x3a8c5d,'rows':_0x4c29c0}:null;}})[_0xb641('0x25')](respondWithResult(_0x3474f6,null))[_0xb641('0x45')](handleError(_0x3474f6,null));};exports[_0xb641('0x66')]=function(_0x576b7f,_0x3cdb30,_0x5e6f74){var _0x3b4a6b,_0x264362;var _0x296ae8=[];var _0x4470f7=moment()[_0xb641('0x67')](_0xb641('0x68'));return db[_0xb641('0x2e')][_0xb641('0x4a')]({'where':{'id':_0x576b7f[_0xb641('0x47')]['id']}})['then'](handleEntityNotFound(_0x3cdb30,null))[_0xb641('0x25')](function(_0x5e7313){if(_0x5e7313){_0x264362=_0x5e7313;return _0x5e7313[_0xb641('0x66')](_0x576b7f[_0xb641('0x56')][_0xb641('0x69')],_[_0xb641('0x57')](_0x576b7f[_0xb641('0x56')],[_0xb641('0x69'),'id'])||{});}return null;})[_0xb641('0x6a')](function(_0x24c759){var _0x105c3f;var _0x2e38dc;_0x3b4a6b=_0x24c759||[];var _0x24fa34=[];if(_0x24c759){for(var _0x1f30cc=0x0;_0x1f30cc<_0x24c759['length'];_0x1f30cc+=0x1){var _0x11526e=_0x24c759[_0x1f30cc]['get']({'plain':!![]});_0x264362[_0xb641('0x6b')]=_0x576b7f[_0xb641('0x56')][_0xb641('0x6b')]?_0x576b7f[_0xb641('0x56')][_0xb641('0x6b')]:_0x264362['dialCheckDuplicateType'];switch(_0x264362['dialCheckDuplicateType']){case'always':_0x105c3f=squel[_0xb641('0x6c')]()[_0xb641('0x6d')](_0xb641('0x6e'))[_0xb641('0x6f')]([_0xb641('0x70'),_0xb641('0x71'),'ContactId',_0xb641('0x72'),_0xb641('0x5d'),'createdAt','updatedAt'],squel[_0xb641('0x73')]()[_0xb641('0x74')](_0xb641('0x70'),'phone')['field'](_0xb641('0x75'),_0xb641('0x71'))[_0xb641('0x74')]('id',_0xb641('0x76'))[_0xb641('0x74')](_0x11526e[_0xb641('0x77')]['toString'](),_0xb641('0x72'))[_0xb641('0x74')](_0x576b7f['params']['id'][_0xb641('0x78')](),_0xb641('0x5d'))[_0xb641('0x74')]('\x27'+_0x4470f7+'\x27',_0xb641('0x54'))[_0xb641('0x74')]('\x27'+_0x4470f7+'\x27','updatedAt')[_0xb641('0x79')](_0xb641('0x7a'))[_0xb641('0x3b')](_0xb641('0x7b'))[_0xb641('0x3b')](_0xb641('0x7c'),_0x11526e['CmListId'][_0xb641('0x78')]())[_0xb641('0x3b')](_0xb641('0x7d'))[_0xb641('0x3b')](_0xb641('0x7e'),squel[_0xb641('0x73')]()['field'](_0xb641('0x7f'))['from'](_0xb641('0x80'))[_0xb641('0x3b')](_0xb641('0x81'),_0x576b7f[_0xb641('0x47')]['id'][_0xb641('0x78')]()))[_0xb641('0x3b')](_0xb641('0x7e'),squel[_0xb641('0x73')]()[_0xb641('0x74')](_0xb641('0x82'))[_0xb641('0x79')](_0xb641('0x6e'))[_0xb641('0x3b')](_0xb641('0x81'),_0x576b7f['params']['id']['toString']())))['toString']();break;case _0xb641('0x83'):_0x105c3f=squel[_0xb641('0x6c')]()['into'](_0xb641('0x6e'))[_0xb641('0x6f')]([_0xb641('0x70'),_0xb641('0x71'),_0xb641('0x76'),_0xb641('0x72'),_0xb641('0x5d'),_0xb641('0x54'),'updatedAt'],squel['select']()[_0xb641('0x74')](_0xb641('0x70'),_0xb641('0x70'))[_0xb641('0x74')](_0xb641('0x75'),_0xb641('0x71'))[_0xb641('0x74')]('id','ContactId')[_0xb641('0x74')](_0x11526e[_0xb641('0x77')][_0xb641('0x78')](),_0xb641('0x72'))[_0xb641('0x74')](_0x576b7f[_0xb641('0x47')]['id'][_0xb641('0x78')](),_0xb641('0x5d'))['field']('\x27'+_0x4470f7+'\x27','createdAt')['field']('\x27'+_0x4470f7+'\x27',_0xb641('0x55'))[_0xb641('0x79')](_0xb641('0x7a'))[_0xb641('0x3b')](_0xb641('0x7b'))['where'](_0xb641('0x7c'),_0x11526e[_0xb641('0x77')][_0xb641('0x78')]())[_0xb641('0x3b')](_0xb641('0x7d'))[_0xb641('0x3b')](_0xb641('0x7e'),squel[_0xb641('0x73')]()[_0xb641('0x74')](_0xb641('0x82'))[_0xb641('0x79')](_0xb641('0x6e'))['where']('CampaignId\x20=\x20?',_0x576b7f[_0xb641('0x47')]['id'][_0xb641('0x78')]())))[_0xb641('0x78')]();break;default:_0x105c3f=squel[_0xb641('0x6c')]()[_0xb641('0x6d')](_0xb641('0x6e'))['fromQuery']([_0xb641('0x70'),_0xb641('0x71'),_0xb641('0x76'),_0xb641('0x72'),_0xb641('0x5d'),'createdAt','updatedAt'],squel[_0xb641('0x73')]()[_0xb641('0x74')](_0xb641('0x70'),_0xb641('0x70'))[_0xb641('0x74')](_0xb641('0x75'),_0xb641('0x71'))[_0xb641('0x74')]('id',_0xb641('0x76'))[_0xb641('0x74')](_0x11526e['CmListId'][_0xb641('0x78')](),'ListId')['field'](_0x576b7f[_0xb641('0x47')]['id'][_0xb641('0x78')](),_0xb641('0x5d'))[_0xb641('0x74')]('\x27'+_0x4470f7+'\x27',_0xb641('0x54'))[_0xb641('0x74')]('\x27'+_0x4470f7+'\x27','updatedAt')[_0xb641('0x79')](_0xb641('0x7a'))[_0xb641('0x3b')]('deletedAt\x20IS\x20NULL')['where'](_0xb641('0x7c'),_0x11526e['CmListId']['toString']())[_0xb641('0x3b')](_0xb641('0x7d')))[_0xb641('0x78')]();}_0x2e38dc=squel['insert']()[_0xb641('0x6d')]('cm_hopper_additional_phones')['fromQuery']([_0xb641('0x84'),_0xb641('0x71'),_0xb641('0x70'),_0xb641('0x85'),'createdAt',_0xb641('0x55')],squel[_0xb641('0x73')]()['field'](_0xb641('0x86'),'id')[_0xb641('0x74')](_0xb641('0x75'),'scheduledAt')[_0xb641('0x74')]('ci.item',_0xb641('0x70'))[_0xb641('0x74')](_0xb641('0x87'),_0xb641('0x85'))[_0xb641('0x74')]('\x27'+_0x4470f7+'\x27','createdAt')[_0xb641('0x74')]('\x27'+_0x4470f7+'\x27',_0xb641('0x55'))[_0xb641('0x79')](_0xb641('0x88'),'ci')[_0xb641('0x89')]('cm_hopper','h',_0xb641('0x8a'))[_0xb641('0x3b')](_0xb641('0x8b'),_0x11526e['CmListId'][_0xb641('0x78')]())['where'](_0xb641('0x8c'),_0x576b7f[_0xb641('0x47')]['id'][_0xb641('0x78')]())['where'](_0xb641('0x8d'),_0x4470f7))[_0xb641('0x78')]();_0x24fa34[_0xb641('0x8e')](db['sequelize']['query'](_0x105c3f));_0x296ae8['push'](db['sequelize'][_0xb641('0x32')](_0x2e38dc));}return BPromise[_0xb641('0x8f')](_0x24fa34);}})[_0xb641('0x25')](function(){return BPromise[_0xb641('0x8f')](_0x296ae8);})[_0xb641('0x25')](function(){return _0x3b4a6b;})[_0xb641('0x25')](respondWithResult(_0x3cdb30,null))[_0xb641('0x45')](handleError(_0x3cdb30,null));};exports[_0xb641('0x90')]=function(_0x1f31a2,_0x46e64e,_0xe03443){return db['Campaign'][_0xb641('0x4a')]({'where':{'id':_0x1f31a2[_0xb641('0x47')]['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x46e64e,null))[_0xb641('0x25')](function(_0xc5c987){if(_0xc5c987){return _0xc5c987[_0xb641('0x90')](_0x1f31a2[_0xb641('0x32')][_0xb641('0x69')]);}})['then'](function(_0x3b69de){if(_0x3b69de){return db[_0xb641('0x5c')][_0xb641('0x24')]({'where':{'ListId':_0x1f31a2[_0xb641('0x32')][_0xb641('0x69')],'CampaignId':_0x1f31a2[_0xb641('0x47')]['id']}})[_0xb641('0x25')](function(){return _0x3b69de;});}})[_0xb641('0x25')](respondWithStatusCode(_0x46e64e,null))[_0xb641('0x45')](handleError(_0x46e64e,null));};exports['getBlackLists']=function(_0x3fca48,_0xa09415,_0x106a46){var _0x12e3cf={};var _0x59063b={};var _0x294f85;var _0x4cc0a0;return db[_0xb641('0x2e')][_0xb641('0x5b')]({'where':{'id':_0x3fca48[_0xb641('0x47')]['id']}})['then'](handleEntityNotFound(_0xa09415,null))[_0xb641('0x25')](function(_0x349da9){if(_0x349da9){_0x294f85=_0x349da9;_0x59063b[_0xb641('0x31')]=_[_0xb641('0x48')](db[_0xb641('0x65')][_0xb641('0x2f')]);_0x59063b[_0xb641('0x32')]=_[_0xb641('0x48')](_0x3fca48[_0xb641('0x32')]);_0x59063b[_0xb641('0x3c')]=_[_0xb641('0x33')](_0x59063b[_0xb641('0x31')],_0x59063b[_0xb641('0x32')]);_0x12e3cf[_0xb641('0x34')]=_[_0xb641('0x33')](_0x59063b['model'],qs[_0xb641('0x35')](_0x3fca48[_0xb641('0x32')]['fields']));_0x12e3cf['attributes']=_0x12e3cf[_0xb641('0x34')][_0xb641('0x36')]?_0x12e3cf['attributes']:_0x59063b[_0xb641('0x31')];_0x12e3cf['order']=qs[_0xb641('0x3a')](_0x3fca48[_0xb641('0x32')][_0xb641('0x3a')]);_0x12e3cf[_0xb641('0x3b')]=qs['filters'](_[_0xb641('0x3d')](_0x3fca48[_0xb641('0x32')],_0x59063b[_0xb641('0x3c')]));if(_0x3fca48['query'][_0xb641('0x3e')]){_0x12e3cf[_0xb641('0x3b')]=_[_0xb641('0x3f')](_0x12e3cf['where'],{'$or':_['map'](_0x12e3cf[_0xb641('0x34')],function(_0x66883c){var _0x5fdd19={};_0x5fdd19[_0x66883c]={'$like':'%'+_0x3fca48[_0xb641('0x32')]['filter']+'%'};return _0x5fdd19;})});}_0x12e3cf=_[_0xb641('0x3f')]({},_0x12e3cf,_0x3fca48[_0xb641('0x41')]);return _0x294f85[_0xb641('0x91')](_0x12e3cf);}})[_0xb641('0x25')](function(_0x49283a){if(_0x49283a){_0x4cc0a0=_0x49283a[_0xb641('0x36')];if(!_0x3fca48[_0xb641('0x32')]['hasOwnProperty'](_0xb641('0x38'))){_0x12e3cf[_0xb641('0x1e')]=qs['limit'](_0x3fca48[_0xb641('0x32')][_0xb641('0x1e')]);_0x12e3cf[_0xb641('0x1d')]=qs[_0xb641('0x1d')](_0x3fca48[_0xb641('0x32')][_0xb641('0x1d')]);}return _0x294f85[_0xb641('0x91')](_0x12e3cf);}})[_0xb641('0x25')](function(_0x56e865){if(_0x56e865){return _0x56e865?{'count':_0x4cc0a0,'rows':_0x56e865}:null;}})[_0xb641('0x25')](respondWithResult(_0xa09415,null))['catch'](handleError(_0xa09415,null));};exports[_0xb641('0x92')]=function(_0x4f9f6f,_0x27e613,_0x55f3b8){var _0x2a97b3,_0x2f4914;var _0x4c4f5d=[];var _0x17f325=moment()['format'](_0xb641('0x68'));return db[_0xb641('0x2e')][_0xb641('0x4a')]({'where':{'id':_0x4f9f6f['params']['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x27e613,null))['then'](function(_0x3b88dd){if(_0x3b88dd){_0x2f4914=_0x3b88dd;return _0x3b88dd[_0xb641('0x92')](_0x4f9f6f[_0xb641('0x56')][_0xb641('0x69')],_[_0xb641('0x57')](_0x4f9f6f['body'],[_0xb641('0x69'),'id'])||{});}return null;})[_0xb641('0x6a')](function(_0x4b4531){var _0x5a8e51;var _0x481cab;_0x2a97b3=_0x4b4531||[];var _0x18face=[];if(_0x4b4531){for(var _0x42e3af=0x0;_0x42e3af<_0x4b4531[_0xb641('0x36')];_0x42e3af+=0x1){var _0x175127=_0x4b4531[_0x42e3af][_0xb641('0x26')]({'plain':!![]});_0x5a8e51=squel[_0xb641('0x6c')]()[_0xb641('0x6d')](_0xb641('0x93'))[_0xb641('0x6f')](['phone',_0xb641('0x76'),_0xb641('0x72'),_0xb641('0x5d'),_0xb641('0x54'),'updatedAt'],squel[_0xb641('0x73')]()[_0xb641('0x74')]('phone',_0xb641('0x70'))[_0xb641('0x74')]('id',_0xb641('0x76'))[_0xb641('0x74')](_0x175127[_0xb641('0x77')][_0xb641('0x78')](),_0xb641('0x72'))[_0xb641('0x74')](_0x4f9f6f[_0xb641('0x47')]['id'][_0xb641('0x78')](),_0xb641('0x5d'))[_0xb641('0x74')]('NOW()',_0xb641('0x54'))[_0xb641('0x74')]('NOW()',_0xb641('0x55'))[_0xb641('0x79')](_0xb641('0x7a'))[_0xb641('0x3b')](_0xb641('0x7b'))[_0xb641('0x3b')](_0xb641('0x7c'),_0x175127[_0xb641('0x77')][_0xb641('0x78')]())[_0xb641('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xb641('0x78')]();_0x18face['push'](db[_0xb641('0x94')][_0xb641('0x32')](_0x5a8e51));}return BPromise[_0xb641('0x8f')](_0x18face);}})[_0xb641('0x25')](function(){return _0x2a97b3;})['then'](respondWithResult(_0x27e613,null))[_0xb641('0x45')](handleError(_0x27e613,null));};exports[_0xb641('0x95')]=function(_0x27c650,_0x4b75a4,_0x3ed484){return db['Campaign'][_0xb641('0x4a')]({'where':{'id':_0x27c650[_0xb641('0x47')]['id']}})[_0xb641('0x25')](handleEntityNotFound(_0x4b75a4,null))[_0xb641('0x25')](function(_0x195488){if(_0x195488){return _0x195488[_0xb641('0x95')](_0x27c650[_0xb641('0x32')][_0xb641('0x69')]);}})[_0xb641('0x25')](function(_0x3affce){if(_0x3affce){return db[_0xb641('0x63')][_0xb641('0x24')]({'where':{'ListId':_0x27c650[_0xb641('0x32')][_0xb641('0x69')],'CampaignId':_0x27c650[_0xb641('0x47')]['id']}})[_0xb641('0x25')](function(){return _0x3affce;});}})[_0xb641('0x25')](respondWithStatusCode(_0x4b75a4,null))['catch'](handleError(_0x4b75a4,null));};
\ No newline at end of file
+var _0x0d90=['sequelize','all','removeLists','ids','getBlackLists','addBlackLists','YYYY-MM-DD\x20HH:mm:ss','spread','cm_hopper_black','push','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','offset','undefined','count','limit','status','set','json','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','where','pick','filter','merge','VIRTUAL','options','Campaign','includeAll','include','findAll','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','hasOwnProperty','nolimit','order','sort','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CampaignId','CmList','getLists','addLists','format','omit','dialCheckDuplicateType','always','insert','into','cm_hopper','phone','scheduledAt','ListId','select','field','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?'];(function(_0x5ca357,_0x558c33){var _0x5b0287=function(_0xe44927){while(--_0xe44927){_0x5ca357['push'](_0x5ca357['shift']());}};_0x5b0287(++_0x558c33);}(_0x0d90,0xa0));var _0x00d9=function(_0x20fa83,_0x1a38e9){_0x20fa83=_0x20fa83-0x0;var _0x18ab58=_0x0d90[_0x20fa83];return _0x18ab58;};'use strict';var emlformat=require(_0x00d9('0x0'));var rimraf=require(_0x00d9('0x1'));var zipdir=require(_0x00d9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x00d9('0x3'));var moment=require(_0x00d9('0x4'));var BPromise=require(_0x00d9('0x5'));var Mustache=require('mustache');var util=require(_0x00d9('0x6'));var path=require(_0x00d9('0x7'));var sox=require(_0x00d9('0x8'));var csv=require(_0x00d9('0x9'));var ejs=require(_0x00d9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x00d9('0xb'));var squel=require(_0x00d9('0xc'));var crypto=require(_0x00d9('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x00d9('0xe'));var toCsv=require(_0x00d9('0x9'));var querystring=require('querystring');var Papa=require(_0x00d9('0xf'));var Redis=require(_0x00d9('0x10'));var authService=require(_0x00d9('0x11'));var qs=require(_0x00d9('0x12'));var as=require(_0x00d9('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x00d9('0x14'))(_0x00d9('0x15'));var utils=require(_0x00d9('0x16'));var config=require(_0x00d9('0x17'));var licenseUtil=require(_0x00d9('0x18'));var db=require(_0x00d9('0x19'))['db'];function respondWithStatusCode(_0x217b29,_0xca42d8){_0xca42d8=_0xca42d8||0xcc;return function(_0x498346){if(_0x498346){return _0x217b29['sendStatus'](_0xca42d8);}return _0x217b29['status'](_0xca42d8)[_0x00d9('0x1a')]();};}function respondWithResult(_0x3fab95,_0x49f0b0){_0x49f0b0=_0x49f0b0||0xc8;return function(_0x4b0719){if(_0x4b0719){return _0x3fab95['status'](_0x49f0b0)['json'](_0x4b0719);}};}function respondWithFilteredResult(_0x2bf2d8,_0x476d19){return function(_0xccb344){if(_0xccb344){var _0x15206b=typeof _0x476d19[_0x00d9('0x1b')]===_0x00d9('0x1c')&&typeof _0x476d19['limit']===_0x00d9('0x1c');var _0x3bd27d=_0xccb344[_0x00d9('0x1d')];var _0x3fe22e=_0x15206b?0x0:_0x476d19[_0x00d9('0x1b')];var _0x53ddec=_0x15206b?_0xccb344[_0x00d9('0x1d')]:_0x476d19[_0x00d9('0x1b')]+_0x476d19[_0x00d9('0x1e')];var _0x109088;if(_0x53ddec>=_0x3bd27d){_0x53ddec=_0x3bd27d;_0x109088=0xc8;}else{_0x109088=0xce;}_0x2bf2d8[_0x00d9('0x1f')](_0x109088);return _0x2bf2d8[_0x00d9('0x20')]('Content-Range',_0x3fe22e+'-'+_0x53ddec+'/'+_0x3bd27d)[_0x00d9('0x21')](_0xccb344);}return null;};}function patchUpdates(_0x3124e3){return function(_0x163e82){try{jsonpatch['apply'](_0x163e82,_0x3124e3,!![]);}catch(_0x250944){return BPromise[_0x00d9('0x22')](_0x250944);}return _0x163e82['save']();};}function saveUpdates(_0x269cc9,_0x425f97){return function(_0x45007a){if(_0x45007a){return _0x45007a[_0x00d9('0x23')](_0x269cc9)[_0x00d9('0x24')](function(_0x26ab9a){return _0x26ab9a;});}return null;};}function removeEntity(_0x5e7482,_0x571a21){return function(_0x35101a){if(_0x35101a){return _0x35101a['destroy']()[_0x00d9('0x24')](function(){var _0xf06159=_0x35101a[_0x00d9('0x25')]({'plain':!![]});var _0x3542c5=_0x00d9('0x26');return db[_0x00d9('0x27')][_0x00d9('0x28')]({'where':{'type':_0x3542c5,'resourceId':_0xf06159['id']}})[_0x00d9('0x24')](function(){return _0x35101a;});})[_0x00d9('0x24')](function(){_0x5e7482[_0x00d9('0x1f')](0xcc)[_0x00d9('0x1a')]();});}};}function handleEntityNotFound(_0x54f100,_0x1a3989){return function(_0x5c5938){if(!_0x5c5938){_0x54f100[_0x00d9('0x29')](0x194);}return _0x5c5938;};}function handleError(_0x198fb7,_0x134662){_0x134662=_0x134662||0x1f4;return function(_0x2ec808){logger[_0x00d9('0x2a')](_0x2ec808[_0x00d9('0x2b')]);if(_0x2ec808[_0x00d9('0x2c')]){delete _0x2ec808[_0x00d9('0x2c')];}_0x198fb7[_0x00d9('0x1f')](_0x134662)[_0x00d9('0x2d')](_0x2ec808);};}exports[_0x00d9('0x2e')]=function(_0x2bdb60,_0x38eb09){var _0x496c97={},_0x22d89a={},_0x412210={'count':0x0,'rows':[]};var _0x341da1=_[_0x00d9('0x2f')](db['Campaign'][_0x00d9('0x30')],function(_0x2cad65){return{'name':_0x2cad65['fieldName'],'type':_0x2cad65[_0x00d9('0x31')][_0x00d9('0x32')]};});_0x22d89a[_0x00d9('0x33')]=_[_0x00d9('0x2f')](_0x341da1,_0x00d9('0x2c'));_0x22d89a[_0x00d9('0x34')]=_[_0x00d9('0x35')](_0x2bdb60['query']);_0x22d89a[_0x00d9('0x36')]=_[_0x00d9('0x37')](_0x22d89a[_0x00d9('0x33')],_0x22d89a[_0x00d9('0x34')]);_0x496c97[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x22d89a[_0x00d9('0x33')],qs['fields'](_0x2bdb60[_0x00d9('0x34')][_0x00d9('0x39')]));_0x496c97[_0x00d9('0x38')]=_0x496c97[_0x00d9('0x38')][_0x00d9('0x3a')]?_0x496c97[_0x00d9('0x38')]:_0x22d89a[_0x00d9('0x33')];if(!_0x2bdb60[_0x00d9('0x34')]['hasOwnProperty']('nolimit')){_0x496c97[_0x00d9('0x1e')]=qs[_0x00d9('0x1e')](_0x2bdb60[_0x00d9('0x34')]['limit']);_0x496c97[_0x00d9('0x1b')]=qs[_0x00d9('0x1b')](_0x2bdb60[_0x00d9('0x34')][_0x00d9('0x1b')]);}_0x496c97['order']=qs['sort'](_0x2bdb60[_0x00d9('0x34')]['sort']);_0x496c97[_0x00d9('0x3b')]=qs['filters'](_[_0x00d9('0x3c')](_0x2bdb60[_0x00d9('0x34')],_0x22d89a[_0x00d9('0x36')]),_0x341da1);if(_0x2bdb60[_0x00d9('0x34')][_0x00d9('0x3d')]){_0x496c97[_0x00d9('0x3b')]=_[_0x00d9('0x3e')](_0x496c97['where'],{'$or':_[_0x00d9('0x2f')](_0x341da1,function(_0x2029aa){if(_0x2029aa[_0x00d9('0x31')]!==_0x00d9('0x3f')){var _0x1b7c3a={};_0x1b7c3a[_0x2029aa[_0x00d9('0x2c')]]={'$like':'%'+_0x2bdb60[_0x00d9('0x34')]['filter']+'%'};return _0x1b7c3a;}})});}_0x496c97=_[_0x00d9('0x3e')]({},_0x496c97,_0x2bdb60[_0x00d9('0x40')]);var _0x402c42={'where':_0x496c97['where']};return db[_0x00d9('0x41')][_0x00d9('0x1d')](_0x402c42)[_0x00d9('0x24')](function(_0x41e786){_0x412210[_0x00d9('0x1d')]=_0x41e786;if(_0x2bdb60[_0x00d9('0x34')][_0x00d9('0x42')]){_0x496c97[_0x00d9('0x43')]=[{'all':!![]}];}return db['Campaign'][_0x00d9('0x44')](_0x496c97);})[_0x00d9('0x24')](function(_0x40252d){_0x412210['rows']=_0x40252d;return _0x412210;})[_0x00d9('0x24')](respondWithFilteredResult(_0x38eb09,_0x496c97))[_0x00d9('0x45')](handleError(_0x38eb09,null));};exports[_0x00d9('0x46')]=function(_0x2f4eb3,_0x1682d9){var _0x4276b9={'raw':![],'where':{'id':_0x2f4eb3['params']['id']}},_0x2bf5a5={};_0x2bf5a5[_0x00d9('0x33')]=_['keys'](db[_0x00d9('0x41')]['rawAttributes']);_0x2bf5a5[_0x00d9('0x34')]=_[_0x00d9('0x35')](_0x2f4eb3[_0x00d9('0x34')]);_0x2bf5a5['filters']=_[_0x00d9('0x37')](_0x2bf5a5[_0x00d9('0x33')],_0x2bf5a5[_0x00d9('0x34')]);_0x4276b9[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x2bf5a5[_0x00d9('0x33')],qs['fields'](_0x2f4eb3['query']['fields']));_0x4276b9['attributes']=_0x4276b9['attributes'][_0x00d9('0x3a')]?_0x4276b9[_0x00d9('0x38')]:_0x2bf5a5[_0x00d9('0x33')];if(_0x2f4eb3[_0x00d9('0x34')][_0x00d9('0x42')]){_0x4276b9[_0x00d9('0x43')]=[{'all':!![]}];}_0x4276b9=_[_0x00d9('0x3e')]({},_0x4276b9,_0x2f4eb3[_0x00d9('0x40')]);return db['Campaign'][_0x00d9('0x47')](_0x4276b9)['then'](handleEntityNotFound(_0x1682d9,null))[_0x00d9('0x24')](respondWithResult(_0x1682d9,null))['catch'](handleError(_0x1682d9,null));};exports[_0x00d9('0x48')]=function(_0x56c419,_0x21ad43){return db[_0x00d9('0x41')][_0x00d9('0x48')](_0x56c419[_0x00d9('0x49')],{})['then'](function(_0x4ece35){var _0x1c7f00=_0x56c419[_0x00d9('0x4a')][_0x00d9('0x25')]({'plain':!![]});if(!_0x1c7f00)throw new Error(_0x00d9('0x4b'));if(_0x1c7f00[_0x00d9('0x4c')]==='user'){var _0x59b6e3=_0x4ece35[_0x00d9('0x25')]({'plain':!![]});var _0x37fb98='IvrCampaigns';return db['UserProfileSection'][_0x00d9('0x47')]({'where':{'name':_0x37fb98,'userProfileId':_0x1c7f00[_0x00d9('0x4d')]},'raw':!![]})[_0x00d9('0x24')](function(_0x5a367b){if(_0x5a367b&&_0x5a367b[_0x00d9('0x4e')]===0x0){return db[_0x00d9('0x27')][_0x00d9('0x48')]({'name':_0x59b6e3[_0x00d9('0x2c')],'resourceId':_0x59b6e3['id'],'type':_0x5a367b[_0x00d9('0x2c')],'sectionId':_0x5a367b['id']},{})['then'](function(){return _0x4ece35;});}else{return _0x4ece35;}})[_0x00d9('0x45')](function(_0x4dda73){logger[_0x00d9('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4dda73);throw _0x4dda73;});}return _0x4ece35;})[_0x00d9('0x24')](respondWithResult(_0x21ad43,0xc9))[_0x00d9('0x45')](handleError(_0x21ad43,null));};exports['clone']=function(_0x69beda,_0x22898d){var _0x2fa4e8={'where':{'id':_0x69beda[_0x00d9('0x4f')]['id']}},_0x1091cc={};_0x1091cc['model']=_['keys'](db[_0x00d9('0x41')][_0x00d9('0x30')]);_0x2fa4e8[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x1091cc[_0x00d9('0x33')],qs[_0x00d9('0x39')](_0x69beda[_0x00d9('0x34')][_0x00d9('0x39')]));_0x2fa4e8['attributes']=_0x2fa4e8[_0x00d9('0x38')][_0x00d9('0x3a')]?_0x2fa4e8[_0x00d9('0x38')]:_0x1091cc['model'];if(_0x69beda['query'][_0x00d9('0x42')]){_0x2fa4e8[_0x00d9('0x43')]=[{'all':!![]}];}_0x2fa4e8=_[_0x00d9('0x3e')]({},_0x2fa4e8,_0x69beda['options']);return db['Campaign']['find'](_0x2fa4e8)[_0x00d9('0x24')](handleEntityNotFound(_0x22898d,null))[_0x00d9('0x24')](function(_0x2de9a5){if(_0x2de9a5){var _0x34ee8b=_0x2de9a5[_0x00d9('0x25')]({'plain':!![]});_0x34ee8b=qs['omit'](_0x34ee8b,['id',_0x00d9('0x50'),_0x00d9('0x51')]);_0x69beda['body']=_['omit'](_0x69beda[_0x00d9('0x49')],['id',_0x00d9('0x50'),_0x00d9('0x51')]);return db['Campaign'][_0x00d9('0x48')](_[_0x00d9('0x3e')](_0x34ee8b,_0x69beda['body']),{'include':_0x69beda[_0x00d9('0x34')][_0x00d9('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x2e5c91){var _0x2edb62=_0x69beda[_0x00d9('0x4a')][_0x00d9('0x25')]({'plain':!![]});if(!_0x2edb62)throw new Error(_0x00d9('0x4b'));if(_0x2edb62[_0x00d9('0x4c')]===_0x00d9('0x4a')){var _0x19a9ef=_0x2e5c91['get']({'plain':!![]});var _0x503f96=_0x00d9('0x26');return db['UserProfileSection'][_0x00d9('0x47')]({'where':{'name':_0x503f96,'userProfileId':_0x2edb62[_0x00d9('0x4d')]},'raw':!![]})[_0x00d9('0x24')](function(_0x406c49){if(_0x406c49&&_0x406c49[_0x00d9('0x4e')]===0x0){return db[_0x00d9('0x27')][_0x00d9('0x48')]({'name':_0x19a9ef['name'],'resourceId':_0x19a9ef['id'],'type':_0x406c49[_0x00d9('0x2c')],'sectionId':_0x406c49['id']},{})[_0x00d9('0x24')](function(){return _0x2e5c91;});}else{return _0x2e5c91;}})[_0x00d9('0x45')](function(_0x271d0b){logger[_0x00d9('0x2a')](_0x00d9('0x52'),_0x271d0b);throw _0x271d0b;});}return _0x2e5c91;});}})['then'](respondWithResult(_0x22898d,0xc9))['catch'](handleError(_0x22898d,null));};exports[_0x00d9('0x23')]=function(_0x17e874,_0x3884a4){if(_0x17e874[_0x00d9('0x49')]['id']){delete _0x17e874[_0x00d9('0x49')]['id'];}return db['Campaign']['find']({'where':{'id':_0x17e874[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x3884a4,null))['then'](saveUpdates(_0x17e874['body'],null))['then'](respondWithResult(_0x3884a4,null))['catch'](handleError(_0x3884a4,null));};exports['destroy']=function(_0x31aa4c,_0x39dbe2){return db[_0x00d9('0x41')][_0x00d9('0x47')]({'where':{'id':_0x31aa4c[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x39dbe2,null))['then'](removeEntity(_0x39dbe2,null))[_0x00d9('0x45')](handleError(_0x39dbe2,null));};exports[_0x00d9('0x53')]=function(_0x28bd00,_0xe1bc88,_0x4e30c9){var _0x458231={'raw':!![],'where':{}};var _0x1d89bf={};var _0x32ba9d={'count':0x0,'rows':[]};return db['Campaign'][_0x00d9('0x54')]({'where':{'id':_0x28bd00['params']['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0xe1bc88,null))['then'](function(_0x3f65cd){if(_0x3f65cd){_0x1d89bf['model']=_['keys'](db[_0x00d9('0x55')][_0x00d9('0x30')]);_0x1d89bf['query']=_['keys'](_0x28bd00[_0x00d9('0x34')]);_0x1d89bf[_0x00d9('0x36')]=_['intersection'](_0x1d89bf['model'],_0x1d89bf[_0x00d9('0x34')]);_0x458231[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x1d89bf[_0x00d9('0x33')],qs[_0x00d9('0x39')](_0x28bd00[_0x00d9('0x34')][_0x00d9('0x39')]));_0x458231[_0x00d9('0x38')]=_0x458231['attributes'][_0x00d9('0x3a')]?_0x458231['attributes']:_0x1d89bf['model'];if(!_0x28bd00[_0x00d9('0x34')][_0x00d9('0x56')](_0x00d9('0x57'))){_0x458231[_0x00d9('0x1e')]=qs['limit'](_0x28bd00['query'][_0x00d9('0x1e')]);_0x458231[_0x00d9('0x1b')]=qs[_0x00d9('0x1b')](_0x28bd00[_0x00d9('0x34')][_0x00d9('0x1b')]);}_0x458231[_0x00d9('0x58')]=qs[_0x00d9('0x59')](_0x28bd00[_0x00d9('0x34')]['sort']);_0x458231[_0x00d9('0x3b')]=qs[_0x00d9('0x36')](_['pick'](_0x28bd00['query'],_0x1d89bf[_0x00d9('0x36')]));_0x458231[_0x00d9('0x3b')]['CampaignId']=_0x3f65cd['id'];if(_0x28bd00['query'][_0x00d9('0x3d')]){_0x458231['where']=_[_0x00d9('0x3e')](_0x458231['where'],{'$or':_[_0x00d9('0x2f')](_0x458231[_0x00d9('0x38')],function(_0x50d46e){var _0x22d0dc={};_0x22d0dc[_0x50d46e]={'$like':'%'+_0x28bd00['query']['filter']+'%'};return _0x22d0dc;})});}_0x458231=_['merge']({},_0x458231,_0x28bd00[_0x00d9('0x40')]);return db[_0x00d9('0x55')][_0x00d9('0x1d')]({'where':_0x458231[_0x00d9('0x3b')]})[_0x00d9('0x24')](function(_0x146f1d){_0x32ba9d[_0x00d9('0x1d')]=_0x146f1d;if(_0x28bd00[_0x00d9('0x34')][_0x00d9('0x42')]){_0x458231[_0x00d9('0x43')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x458231);})['then'](function(_0xf09637){_0x32ba9d[_0x00d9('0x5a')]=_0xf09637;return _0x32ba9d;});}})[_0x00d9('0x24')](respondWithFilteredResult(_0xe1bc88,_0x458231))[_0x00d9('0x45')](handleError(_0xe1bc88,null));};exports[_0x00d9('0x5b')]=function(_0x5a51d8,_0x555dec,_0x540d3d){var _0x47615b={'raw':!![],'where':{}};var _0x5887a6={};var _0x513641={'count':0x0,'rows':[]};return db['Campaign'][_0x00d9('0x54')]({'where':{'id':_0x5a51d8[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x555dec,null))[_0x00d9('0x24')](function(_0x1c214c){if(_0x1c214c){_0x5887a6[_0x00d9('0x33')]=_[_0x00d9('0x35')](db[_0x00d9('0x5c')][_0x00d9('0x30')]);_0x5887a6[_0x00d9('0x34')]=_['keys'](_0x5a51d8[_0x00d9('0x34')]);_0x5887a6['filters']=_[_0x00d9('0x37')](_0x5887a6['model'],_0x5887a6[_0x00d9('0x34')]);_0x47615b[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x5887a6[_0x00d9('0x33')],qs[_0x00d9('0x39')](_0x5a51d8[_0x00d9('0x34')][_0x00d9('0x39')]));_0x47615b[_0x00d9('0x38')]=_0x47615b[_0x00d9('0x38')]['length']?_0x47615b['attributes']:_0x5887a6[_0x00d9('0x33')];if(!_0x5a51d8['query'][_0x00d9('0x56')]('nolimit')){_0x47615b[_0x00d9('0x1e')]=qs[_0x00d9('0x1e')](_0x5a51d8[_0x00d9('0x34')][_0x00d9('0x1e')]);_0x47615b[_0x00d9('0x1b')]=qs[_0x00d9('0x1b')](_0x5a51d8[_0x00d9('0x34')]['offset']);}_0x47615b['order']=qs[_0x00d9('0x59')](_0x5a51d8[_0x00d9('0x34')][_0x00d9('0x59')]);_0x47615b[_0x00d9('0x3b')]=qs[_0x00d9('0x36')](_[_0x00d9('0x3c')](_0x5a51d8[_0x00d9('0x34')],_0x5887a6[_0x00d9('0x36')]));_0x47615b[_0x00d9('0x3b')]['CampaignId']=_0x1c214c['id'];if(_0x5a51d8[_0x00d9('0x34')][_0x00d9('0x3d')]){_0x47615b[_0x00d9('0x3b')]=_[_0x00d9('0x3e')](_0x47615b['where'],{'$or':_[_0x00d9('0x2f')](_0x47615b['attributes'],function(_0x4dca48){var _0x31c400={};_0x31c400[_0x4dca48]={'$like':'%'+_0x5a51d8[_0x00d9('0x34')][_0x00d9('0x3d')]+'%'};return _0x31c400;})});}_0x47615b=_['merge']({},_0x47615b,_0x5a51d8[_0x00d9('0x40')]);return db[_0x00d9('0x5c')]['count']({'where':_0x47615b['where']})[_0x00d9('0x24')](function(_0x4db569){_0x513641[_0x00d9('0x1d')]=_0x4db569;if(_0x5a51d8[_0x00d9('0x34')][_0x00d9('0x42')]){_0x47615b['include']=[{'all':!![]}];}return db[_0x00d9('0x5c')][_0x00d9('0x44')](_0x47615b);})[_0x00d9('0x24')](function(_0x15a6d1){_0x513641[_0x00d9('0x5a')]=_0x15a6d1;return _0x513641;});}})[_0x00d9('0x24')](respondWithFilteredResult(_0x555dec,_0x47615b))[_0x00d9('0x45')](handleError(_0x555dec,null));};exports[_0x00d9('0x5d')]=function(_0x264419,_0x2d5561,_0x4b34a3){var _0x28bf78={'raw':!![],'where':{}};var _0x3fae3a={};var _0x14ce17={'count':0x0,'rows':[]};return db[_0x00d9('0x41')][_0x00d9('0x54')]({'where':{'id':_0x264419[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x2d5561,null))['then'](function(_0x46c6e2){if(_0x46c6e2){_0x3fae3a[_0x00d9('0x33')]=_['keys'](db[_0x00d9('0x5e')][_0x00d9('0x30')]);_0x3fae3a['query']=_[_0x00d9('0x35')](_0x264419[_0x00d9('0x34')]);_0x3fae3a[_0x00d9('0x36')]=_[_0x00d9('0x37')](_0x3fae3a[_0x00d9('0x33')],_0x3fae3a[_0x00d9('0x34')]);_0x28bf78[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x3fae3a[_0x00d9('0x33')],qs['fields'](_0x264419['query'][_0x00d9('0x39')]));_0x28bf78[_0x00d9('0x38')]=_0x28bf78[_0x00d9('0x38')][_0x00d9('0x3a')]?_0x28bf78[_0x00d9('0x38')]:_0x3fae3a[_0x00d9('0x33')];if(!_0x264419[_0x00d9('0x34')]['hasOwnProperty'](_0x00d9('0x57'))){_0x28bf78[_0x00d9('0x1e')]=qs[_0x00d9('0x1e')](_0x264419[_0x00d9('0x34')][_0x00d9('0x1e')]);_0x28bf78[_0x00d9('0x1b')]=qs['offset'](_0x264419[_0x00d9('0x34')][_0x00d9('0x1b')]);}_0x28bf78[_0x00d9('0x58')]=qs[_0x00d9('0x59')](_0x264419[_0x00d9('0x34')][_0x00d9('0x59')]);_0x28bf78[_0x00d9('0x3b')]=qs['filters'](_[_0x00d9('0x3c')](_0x264419['query'],_0x3fae3a[_0x00d9('0x36')]));_0x28bf78['where']['CampaignId']=_0x46c6e2['id'];if(_0x264419[_0x00d9('0x34')][_0x00d9('0x3d')]){_0x28bf78[_0x00d9('0x3b')]=_['merge'](_0x28bf78[_0x00d9('0x3b')],{'$or':_['map'](_0x28bf78[_0x00d9('0x38')],function(_0x6a8013){var _0x20f6c6={};_0x20f6c6[_0x6a8013]={'$like':'%'+_0x264419[_0x00d9('0x34')][_0x00d9('0x3d')]+'%'};return _0x20f6c6;})});}_0x28bf78=_[_0x00d9('0x3e')]({},_0x28bf78,_0x264419[_0x00d9('0x40')]);return db[_0x00d9('0x5e')][_0x00d9('0x1d')]({'where':_0x28bf78[_0x00d9('0x3b')]})[_0x00d9('0x24')](function(_0xa18c19){_0x14ce17[_0x00d9('0x1d')]=_0xa18c19;if(_0x264419['query'][_0x00d9('0x42')]){_0x28bf78['include']=[{'all':!![]}];}return db[_0x00d9('0x5e')][_0x00d9('0x44')](_0x28bf78);})[_0x00d9('0x24')](function(_0x61fbe9){_0x14ce17['rows']=_0x61fbe9;return _0x14ce17;});}})[_0x00d9('0x24')](respondWithFilteredResult(_0x2d5561,_0x28bf78))[_0x00d9('0x45')](handleError(_0x2d5561,null));};exports[_0x00d9('0x5f')]=function(_0x523395,_0x57af31,_0x31e86b){var _0x45bc1d={'raw':!![],'where':{}};var _0x56e500={};var _0x37c558={'count':0x0,'rows':[]};return db[_0x00d9('0x41')][_0x00d9('0x54')]({'where':{'id':_0x523395['params']['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x57af31,null))[_0x00d9('0x24')](function(_0xb20996){if(_0xb20996){_0x56e500['model']=_[_0x00d9('0x35')](db[_0x00d9('0x60')][_0x00d9('0x30')]);_0x56e500[_0x00d9('0x34')]=_[_0x00d9('0x35')](_0x523395['query']);_0x56e500[_0x00d9('0x36')]=_[_0x00d9('0x37')](_0x56e500[_0x00d9('0x33')],_0x56e500[_0x00d9('0x34')]);_0x45bc1d[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x56e500[_0x00d9('0x33')],qs[_0x00d9('0x39')](_0x523395[_0x00d9('0x34')][_0x00d9('0x39')]));_0x45bc1d[_0x00d9('0x38')]=_0x45bc1d[_0x00d9('0x38')][_0x00d9('0x3a')]?_0x45bc1d[_0x00d9('0x38')]:_0x56e500[_0x00d9('0x33')];if(!_0x523395['query'][_0x00d9('0x56')]('nolimit')){_0x45bc1d[_0x00d9('0x1e')]=qs[_0x00d9('0x1e')](_0x523395[_0x00d9('0x34')][_0x00d9('0x1e')]);_0x45bc1d[_0x00d9('0x1b')]=qs[_0x00d9('0x1b')](_0x523395[_0x00d9('0x34')][_0x00d9('0x1b')]);}_0x45bc1d['order']=qs[_0x00d9('0x59')](_0x523395['query'][_0x00d9('0x59')]);_0x45bc1d['where']=qs[_0x00d9('0x36')](_[_0x00d9('0x3c')](_0x523395[_0x00d9('0x34')],_0x56e500[_0x00d9('0x36')]));_0x45bc1d[_0x00d9('0x3b')][_0x00d9('0x61')]=_0xb20996['id'];if(_0x523395['query'][_0x00d9('0x3d')]){_0x45bc1d['where']=_[_0x00d9('0x3e')](_0x45bc1d['where'],{'$or':_[_0x00d9('0x2f')](_0x45bc1d[_0x00d9('0x38')],function(_0x744ca4){var _0x2fe7df={};_0x2fe7df[_0x744ca4]={'$like':'%'+_0x523395['query']['filter']+'%'};return _0x2fe7df;})});}_0x45bc1d=_[_0x00d9('0x3e')]({},_0x45bc1d,_0x523395[_0x00d9('0x40')]);return db[_0x00d9('0x60')]['count']({'where':_0x45bc1d[_0x00d9('0x3b')]})['then'](function(_0x621a78){_0x37c558[_0x00d9('0x1d')]=_0x621a78;if(_0x523395['query'][_0x00d9('0x42')]){_0x45bc1d['include']=[{'all':!![]}];}return db[_0x00d9('0x60')]['findAll'](_0x45bc1d);})[_0x00d9('0x24')](function(_0x2ab0cf){_0x37c558[_0x00d9('0x5a')]=_0x2ab0cf;return _0x37c558;});}})[_0x00d9('0x24')](respondWithFilteredResult(_0x57af31,_0x45bc1d))[_0x00d9('0x45')](handleError(_0x57af31,null));};exports['getLists']=function(_0x1085f2,_0x4f291b,_0x331cca){var _0x226a10={};var _0x2a78cd={};var _0x5e986e;var _0x6c8672;return db[_0x00d9('0x41')][_0x00d9('0x54')]({'where':{'id':_0x1085f2[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x4f291b,null))[_0x00d9('0x24')](function(_0x210ed9){if(_0x210ed9){_0x5e986e=_0x210ed9;_0x2a78cd[_0x00d9('0x33')]=_[_0x00d9('0x35')](db[_0x00d9('0x62')][_0x00d9('0x30')]);_0x2a78cd['query']=_[_0x00d9('0x35')](_0x1085f2['query']);_0x2a78cd[_0x00d9('0x36')]=_[_0x00d9('0x37')](_0x2a78cd[_0x00d9('0x33')],_0x2a78cd['query']);_0x226a10[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x2a78cd['model'],qs[_0x00d9('0x39')](_0x1085f2[_0x00d9('0x34')]['fields']));_0x226a10['attributes']=_0x226a10[_0x00d9('0x38')][_0x00d9('0x3a')]?_0x226a10[_0x00d9('0x38')]:_0x2a78cd[_0x00d9('0x33')];_0x226a10[_0x00d9('0x58')]=qs[_0x00d9('0x59')](_0x1085f2[_0x00d9('0x34')][_0x00d9('0x59')]);_0x226a10[_0x00d9('0x3b')]=qs[_0x00d9('0x36')](_[_0x00d9('0x3c')](_0x1085f2['query'],_0x2a78cd[_0x00d9('0x36')]));if(_0x1085f2[_0x00d9('0x34')]['filter']){_0x226a10[_0x00d9('0x3b')]=_[_0x00d9('0x3e')](_0x226a10[_0x00d9('0x3b')],{'$or':_['map'](_0x226a10[_0x00d9('0x38')],function(_0x15b449){var _0x9477a8={};_0x9477a8[_0x15b449]={'$like':'%'+_0x1085f2[_0x00d9('0x34')][_0x00d9('0x3d')]+'%'};return _0x9477a8;})});}_0x226a10=_[_0x00d9('0x3e')]({},_0x226a10,_0x1085f2[_0x00d9('0x40')]);return _0x5e986e[_0x00d9('0x63')](_0x226a10);}})[_0x00d9('0x24')](function(_0x397114){if(_0x397114){_0x6c8672=_0x397114[_0x00d9('0x3a')];if(!_0x1085f2[_0x00d9('0x34')]['hasOwnProperty'](_0x00d9('0x57'))){_0x226a10['limit']=qs['limit'](_0x1085f2[_0x00d9('0x34')]['limit']);_0x226a10[_0x00d9('0x1b')]=qs[_0x00d9('0x1b')](_0x1085f2[_0x00d9('0x34')][_0x00d9('0x1b')]);}return _0x5e986e[_0x00d9('0x63')](_0x226a10);}})['then'](function(_0x36119e){if(_0x36119e){return _0x36119e?{'count':_0x6c8672,'rows':_0x36119e}:null;}})['then'](respondWithResult(_0x4f291b,null))[_0x00d9('0x45')](handleError(_0x4f291b,null));};exports[_0x00d9('0x64')]=function(_0x5e165c,_0x2a3c1d,_0x248413){var _0x16c883,_0x16189f;var _0x5b2719=[];var _0x19cbeb=moment()[_0x00d9('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0x00d9('0x47')]({'where':{'id':_0x5e165c['params']['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x2a3c1d,null))[_0x00d9('0x24')](function(_0x2bce2a){if(_0x2bce2a){_0x16189f=_0x2bce2a;return _0x2bce2a[_0x00d9('0x64')](_0x5e165c[_0x00d9('0x49')]['ids'],_[_0x00d9('0x66')](_0x5e165c[_0x00d9('0x49')],['ids','id'])||{});}return null;})['spread'](function(_0x4b2078){var _0x332223;var _0x13986d;_0x16c883=_0x4b2078||[];var _0x23467b=[];if(_0x4b2078){for(var _0x259e79=0x0;_0x259e79<_0x4b2078['length'];_0x259e79+=0x1){var _0x2c9e70=_0x4b2078[_0x259e79]['get']({'plain':!![]});_0x16189f[_0x00d9('0x67')]=_0x5e165c['body']['dialCheckDuplicateType']?_0x5e165c[_0x00d9('0x49')]['dialCheckDuplicateType']:_0x16189f[_0x00d9('0x67')];switch(_0x16189f[_0x00d9('0x67')]){case _0x00d9('0x68'):_0x332223=squel[_0x00d9('0x69')]()[_0x00d9('0x6a')](_0x00d9('0x6b'))['fromQuery']([_0x00d9('0x6c'),_0x00d9('0x6d'),'ContactId',_0x00d9('0x6e'),_0x00d9('0x61'),_0x00d9('0x50'),_0x00d9('0x51')],squel[_0x00d9('0x6f')]()[_0x00d9('0x70')](_0x00d9('0x6c'),_0x00d9('0x6c'))['field'](_0x00d9('0x71'),_0x00d9('0x6d'))[_0x00d9('0x70')]('id',_0x00d9('0x72'))[_0x00d9('0x70')](_0x2c9e70[_0x00d9('0x73')][_0x00d9('0x74')](),_0x00d9('0x6e'))[_0x00d9('0x70')](_0x5e165c['params']['id'][_0x00d9('0x74')](),_0x00d9('0x61'))[_0x00d9('0x70')]('\x27'+_0x19cbeb+'\x27',_0x00d9('0x50'))[_0x00d9('0x70')]('\x27'+_0x19cbeb+'\x27',_0x00d9('0x51'))[_0x00d9('0x75')](_0x00d9('0x76'))[_0x00d9('0x3b')](_0x00d9('0x77'))['where'](_0x00d9('0x78'),_0x2c9e70['CmListId'][_0x00d9('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0x00d9('0x79'),squel[_0x00d9('0x6f')]()[_0x00d9('0x70')]('COALESCE(calleridnum,\x27\x27)')[_0x00d9('0x75')](_0x00d9('0x7a'))[_0x00d9('0x3b')](_0x00d9('0x7b'),_0x5e165c[_0x00d9('0x4f')]['id'][_0x00d9('0x74')]()))['where'](_0x00d9('0x79'),squel['select']()['field'](_0x00d9('0x7c'))[_0x00d9('0x75')](_0x00d9('0x6b'))[_0x00d9('0x3b')](_0x00d9('0x7b'),_0x5e165c[_0x00d9('0x4f')]['id'][_0x00d9('0x74')]())))[_0x00d9('0x74')]();break;case _0x00d9('0x7d'):_0x332223=squel['insert']()[_0x00d9('0x6a')](_0x00d9('0x6b'))[_0x00d9('0x7e')]([_0x00d9('0x6c'),_0x00d9('0x6d'),_0x00d9('0x72'),_0x00d9('0x6e'),'CampaignId',_0x00d9('0x50'),_0x00d9('0x51')],squel[_0x00d9('0x6f')]()[_0x00d9('0x70')](_0x00d9('0x6c'),'phone')[_0x00d9('0x70')](_0x00d9('0x71'),_0x00d9('0x6d'))[_0x00d9('0x70')]('id','ContactId')[_0x00d9('0x70')](_0x2c9e70[_0x00d9('0x73')][_0x00d9('0x74')](),_0x00d9('0x6e'))[_0x00d9('0x70')](_0x5e165c[_0x00d9('0x4f')]['id']['toString'](),'CampaignId')[_0x00d9('0x70')]('\x27'+_0x19cbeb+'\x27',_0x00d9('0x50'))['field']('\x27'+_0x19cbeb+'\x27',_0x00d9('0x51'))[_0x00d9('0x75')](_0x00d9('0x76'))[_0x00d9('0x3b')](_0x00d9('0x77'))['where'](_0x00d9('0x78'),_0x2c9e70[_0x00d9('0x73')][_0x00d9('0x74')]())[_0x00d9('0x3b')](_0x00d9('0x7f'))[_0x00d9('0x3b')](_0x00d9('0x79'),squel[_0x00d9('0x6f')]()[_0x00d9('0x70')](_0x00d9('0x7c'))[_0x00d9('0x75')](_0x00d9('0x6b'))['where'](_0x00d9('0x7b'),_0x5e165c['params']['id'][_0x00d9('0x74')]())))[_0x00d9('0x74')]();break;default:_0x332223=squel[_0x00d9('0x69')]()['into'](_0x00d9('0x6b'))[_0x00d9('0x7e')]([_0x00d9('0x6c'),_0x00d9('0x6d'),_0x00d9('0x72'),_0x00d9('0x6e'),_0x00d9('0x61'),'createdAt',_0x00d9('0x51')],squel['select']()['field']('phone',_0x00d9('0x6c'))[_0x00d9('0x70')](_0x00d9('0x71'),'scheduledAt')[_0x00d9('0x70')]('id',_0x00d9('0x72'))[_0x00d9('0x70')](_0x2c9e70[_0x00d9('0x73')][_0x00d9('0x74')](),_0x00d9('0x6e'))[_0x00d9('0x70')](_0x5e165c[_0x00d9('0x4f')]['id'][_0x00d9('0x74')](),'CampaignId')[_0x00d9('0x70')]('\x27'+_0x19cbeb+'\x27',_0x00d9('0x50'))['field']('\x27'+_0x19cbeb+'\x27',_0x00d9('0x51'))[_0x00d9('0x75')](_0x00d9('0x76'))['where'](_0x00d9('0x77'))[_0x00d9('0x3b')](_0x00d9('0x78'),_0x2c9e70['CmListId'][_0x00d9('0x74')]())['where']('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x13986d=squel[_0x00d9('0x69')]()[_0x00d9('0x6a')](_0x00d9('0x80'))['fromQuery']([_0x00d9('0x81'),_0x00d9('0x6d'),'phone',_0x00d9('0x82'),_0x00d9('0x50'),_0x00d9('0x51')],squel[_0x00d9('0x6f')]()[_0x00d9('0x70')](_0x00d9('0x83'),'id')[_0x00d9('0x70')](_0x00d9('0x71'),'scheduledAt')[_0x00d9('0x70')](_0x00d9('0x84'),'phone')[_0x00d9('0x70')]('ci.OrderBY',_0x00d9('0x82'))[_0x00d9('0x70')]('\x27'+_0x19cbeb+'\x27',_0x00d9('0x50'))[_0x00d9('0x70')]('\x27'+_0x19cbeb+'\x27',_0x00d9('0x51'))[_0x00d9('0x75')](_0x00d9('0x85'),'ci')['join'](_0x00d9('0x6b'),'h',_0x00d9('0x86'))[_0x00d9('0x3b')](_0x00d9('0x87'),_0x2c9e70[_0x00d9('0x73')][_0x00d9('0x74')]())['where'](_0x00d9('0x88'),_0x5e165c[_0x00d9('0x4f')]['id'][_0x00d9('0x74')]())[_0x00d9('0x3b')](_0x00d9('0x89'),_0x19cbeb))[_0x00d9('0x74')]();_0x23467b['push'](db['sequelize'][_0x00d9('0x34')](_0x332223));_0x5b2719['push'](db[_0x00d9('0x8a')][_0x00d9('0x34')](_0x13986d));}return BPromise[_0x00d9('0x8b')](_0x23467b);}})['then'](function(){return BPromise[_0x00d9('0x8b')](_0x5b2719);})[_0x00d9('0x24')](function(){return _0x16c883;})[_0x00d9('0x24')](respondWithResult(_0x2a3c1d,null))['catch'](handleError(_0x2a3c1d,null));};exports['removeLists']=function(_0x419fe5,_0x3e319f,_0x1bf483){return db[_0x00d9('0x41')]['find']({'where':{'id':_0x419fe5[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x3e319f,null))[_0x00d9('0x24')](function(_0x31ab3e){if(_0x31ab3e){return _0x31ab3e[_0x00d9('0x8c')](_0x419fe5[_0x00d9('0x34')][_0x00d9('0x8d')]);}})[_0x00d9('0x24')](function(_0x282ca6){if(_0x282ca6){return db[_0x00d9('0x55')]['destroy']({'where':{'ListId':_0x419fe5[_0x00d9('0x34')][_0x00d9('0x8d')],'CampaignId':_0x419fe5['params']['id']}})[_0x00d9('0x24')](function(){return _0x282ca6;});}})[_0x00d9('0x24')](respondWithStatusCode(_0x3e319f,null))[_0x00d9('0x45')](handleError(_0x3e319f,null));};exports[_0x00d9('0x8e')]=function(_0x42ba89,_0x144359,_0x4c9671){var _0x51c17a={};var _0x1131e5={};var _0x120c7c;var _0x19bcb7;return db['Campaign']['findOne']({'where':{'id':_0x42ba89['params']['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x144359,null))[_0x00d9('0x24')](function(_0x145305){if(_0x145305){_0x120c7c=_0x145305;_0x1131e5['model']=_[_0x00d9('0x35')](db[_0x00d9('0x62')][_0x00d9('0x30')]);_0x1131e5['query']=_['keys'](_0x42ba89[_0x00d9('0x34')]);_0x1131e5['filters']=_[_0x00d9('0x37')](_0x1131e5[_0x00d9('0x33')],_0x1131e5[_0x00d9('0x34')]);_0x51c17a[_0x00d9('0x38')]=_[_0x00d9('0x37')](_0x1131e5[_0x00d9('0x33')],qs[_0x00d9('0x39')](_0x42ba89[_0x00d9('0x34')][_0x00d9('0x39')]));_0x51c17a['attributes']=_0x51c17a[_0x00d9('0x38')][_0x00d9('0x3a')]?_0x51c17a[_0x00d9('0x38')]:_0x1131e5['model'];_0x51c17a[_0x00d9('0x58')]=qs[_0x00d9('0x59')](_0x42ba89[_0x00d9('0x34')][_0x00d9('0x59')]);_0x51c17a['where']=qs[_0x00d9('0x36')](_[_0x00d9('0x3c')](_0x42ba89[_0x00d9('0x34')],_0x1131e5['filters']));if(_0x42ba89[_0x00d9('0x34')]['filter']){_0x51c17a[_0x00d9('0x3b')]=_[_0x00d9('0x3e')](_0x51c17a[_0x00d9('0x3b')],{'$or':_[_0x00d9('0x2f')](_0x51c17a['attributes'],function(_0x3f560a){var _0x141665={};_0x141665[_0x3f560a]={'$like':'%'+_0x42ba89[_0x00d9('0x34')]['filter']+'%'};return _0x141665;})});}_0x51c17a=_[_0x00d9('0x3e')]({},_0x51c17a,_0x42ba89['options']);return _0x120c7c['getBlackLists'](_0x51c17a);}})[_0x00d9('0x24')](function(_0x240f02){if(_0x240f02){_0x19bcb7=_0x240f02[_0x00d9('0x3a')];if(!_0x42ba89['query'][_0x00d9('0x56')](_0x00d9('0x57'))){_0x51c17a[_0x00d9('0x1e')]=qs['limit'](_0x42ba89['query']['limit']);_0x51c17a['offset']=qs[_0x00d9('0x1b')](_0x42ba89[_0x00d9('0x34')]['offset']);}return _0x120c7c[_0x00d9('0x8e')](_0x51c17a);}})[_0x00d9('0x24')](function(_0xd1395){if(_0xd1395){return _0xd1395?{'count':_0x19bcb7,'rows':_0xd1395}:null;}})['then'](respondWithResult(_0x144359,null))[_0x00d9('0x45')](handleError(_0x144359,null));};exports[_0x00d9('0x8f')]=function(_0x5b7ba0,_0x2bc749,_0x206745){var _0x55dbac,_0x9f84a2;var _0x18b6a1=[];var _0x388b25=moment()[_0x00d9('0x65')](_0x00d9('0x90'));return db[_0x00d9('0x41')]['find']({'where':{'id':_0x5b7ba0['params']['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x2bc749,null))[_0x00d9('0x24')](function(_0xfb539d){if(_0xfb539d){_0x9f84a2=_0xfb539d;return _0xfb539d[_0x00d9('0x8f')](_0x5b7ba0[_0x00d9('0x49')]['ids'],_[_0x00d9('0x66')](_0x5b7ba0[_0x00d9('0x49')],[_0x00d9('0x8d'),'id'])||{});}return null;})[_0x00d9('0x91')](function(_0x4cf106){var _0x27647d;var _0x319bcb;_0x55dbac=_0x4cf106||[];var _0x3e27ef=[];if(_0x4cf106){for(var _0x577e93=0x0;_0x577e93<_0x4cf106[_0x00d9('0x3a')];_0x577e93+=0x1){var _0x5c8487=_0x4cf106[_0x577e93]['get']({'plain':!![]});_0x27647d=squel[_0x00d9('0x69')]()[_0x00d9('0x6a')](_0x00d9('0x92'))[_0x00d9('0x7e')]([_0x00d9('0x6c'),'ContactId',_0x00d9('0x6e'),'CampaignId',_0x00d9('0x50'),_0x00d9('0x51')],squel['select']()[_0x00d9('0x70')](_0x00d9('0x6c'),_0x00d9('0x6c'))[_0x00d9('0x70')]('id','ContactId')[_0x00d9('0x70')](_0x5c8487[_0x00d9('0x73')][_0x00d9('0x74')](),'ListId')[_0x00d9('0x70')](_0x5b7ba0[_0x00d9('0x4f')]['id'][_0x00d9('0x74')](),_0x00d9('0x61'))[_0x00d9('0x70')](_0x00d9('0x71'),'createdAt')[_0x00d9('0x70')](_0x00d9('0x71'),_0x00d9('0x51'))[_0x00d9('0x75')](_0x00d9('0x76'))[_0x00d9('0x3b')](_0x00d9('0x77'))['where']('ListId\x20=\x20?',_0x5c8487[_0x00d9('0x73')][_0x00d9('0x74')]())[_0x00d9('0x3b')](_0x00d9('0x7f')))[_0x00d9('0x74')]();_0x3e27ef[_0x00d9('0x93')](db[_0x00d9('0x8a')]['query'](_0x27647d));}return BPromise['all'](_0x3e27ef);}})[_0x00d9('0x24')](function(){return _0x55dbac;})[_0x00d9('0x24')](respondWithResult(_0x2bc749,null))[_0x00d9('0x45')](handleError(_0x2bc749,null));};exports[_0x00d9('0x94')]=function(_0x2be06a,_0x551710,_0x4982bf){return db['Campaign']['find']({'where':{'id':_0x2be06a[_0x00d9('0x4f')]['id']}})[_0x00d9('0x24')](handleEntityNotFound(_0x551710,null))[_0x00d9('0x24')](function(_0x19a1e5){if(_0x19a1e5){return _0x19a1e5[_0x00d9('0x94')](_0x2be06a['query'][_0x00d9('0x8d')]);}})[_0x00d9('0x24')](function(_0x219b80){if(_0x219b80){return db[_0x00d9('0x60')][_0x00d9('0x28')]({'where':{'ListId':_0x2be06a['query'][_0x00d9('0x8d')],'CampaignId':_0x2be06a['params']['id']}})['then'](function(){return _0x219b80;});}})[_0x00d9('0x24')](respondWithStatusCode(_0x551710,null))[_0x00d9('0x45')](handleError(_0x551710,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 44d0bf1..aab47d9 100644
--- a/server/api/campaign/campaign.model.js
+++ b/server/api/campaign/campaign.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0xd16d61,_0x2a7235){var _0x4902fa=function(_0x485208){while(--_0x485208){_0xd16d61['push'](_0xd16d61['shift']());}};_0x4902fa(++_0x2a7235);}(_0x7a54,0x106));var _0x47a5=function(_0x455c50,_0x354129){_0x455c50=_0x455c50-0x0;var _0x3fb191=_0x7a54[_0x455c50];return _0x3fb191;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7a54=['../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x2ef2cf,_0x55b72b){var _0x1ba4a0=function(_0x5131bb){while(--_0x5131bb){_0x2ef2cf['push'](_0x2ef2cf['shift']());}};_0x1ba4a0(++_0x55b72b);}(_0x7a54,0x106));var _0x47a5=function(_0x51a9c8,_0x797974){_0x51a9c8=_0x51a9c8-0x0;var _0x490f2e=_0x7a54[_0x51a9c8];return _0x490f2e;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.rpc.js b/server/api/campaign/campaign.rpc.js
index 477880a..ce6cbdd 100644
--- a/server/api/campaign/campaign.rpc.js
+++ b/server/api/campaign/campaign.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfc1e=['result','GetCampaign','findAll','options','attributes','limit','include','map','model','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x3d523f,_0xf0c784){var _0x22bf42=function(_0x30b638){while(--_0x30b638){_0x3d523f['push'](_0x3d523f['shift']());}};_0x22bf42(++_0xf0c784);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x33a694,_0x9b6640){_0x33a694=_0x33a694-0x0;var _0x41ff01=_0xfc1e[_0x33a694];return _0x41ff01;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xefc1('0x0'));var rs=require(_0xefc1('0x1'));var fs=require('fs');var Redis=require(_0xefc1('0x2'));var db=require(_0xefc1('0x3'))['db'];var utils=require(_0xefc1('0x4'));var logger=require('../../config/logger')(_0xefc1('0x5'));var config=require(_0xefc1('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xefc1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38927c,_0x44d15b,_0x3ff4a7){return new BPromise(function(_0x45bec4,_0x77f637){return client[_0xefc1('0x8')](_0x38927c,_0x3ff4a7)[_0xefc1('0x9')](function(_0x244927){logger[_0xefc1('0xa')](_0xefc1('0xb'),_0x44d15b,'request\x20sent');logger[_0xefc1('0xc')](_0xefc1('0xd'),_0x44d15b,_0xefc1('0xe'),JSON[_0xefc1('0xf')](_0x244927));if(_0x244927[_0xefc1('0x10')]){if(_0x244927[_0xefc1('0x10')][_0xefc1('0x11')]===0x1f4){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x77f637(_0x244927['error'][_0xefc1('0x12')]);}logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);return _0x45bec4(_0x244927[_0xefc1('0x10')][_0xefc1('0x12')]);}else{logger[_0xefc1('0xa')]('Campaign,\x20%s,\x20%s',_0x44d15b,_0xefc1('0xe'));_0x45bec4(_0x244927[_0xefc1('0x13')][_0xefc1('0x12')]);}})['catch'](function(_0x159adb){logger[_0xefc1('0x10')](_0xefc1('0xb'),_0x44d15b,_0x159adb);_0x77f637(_0x159adb);});});}exports[_0xefc1('0x14')]=function(_0x257914){var _0x38923c=this;return new Promise(function(_0x3b5a6e,_0x126052){return db['Campaign'][_0xefc1('0x15')]({'raw':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x257914['options']?_0x257914[_0xefc1('0x16')]['where']||null:null,'attributes':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x17')]||null:null,'limit':_0x257914[_0xefc1('0x16')]?_0x257914['options'][_0xefc1('0x18')]||null:null,'include':_0x257914[_0xefc1('0x16')]?_0x257914[_0xefc1('0x16')][_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x257914[_0xefc1('0x16')]['include'],function(_0x2f4935){return{'model':db[_0x2f4935[_0xefc1('0x1b')]],'as':_0x2f4935['as'],'attributes':_0x2f4935['attributes'],'include':_0x2f4935[_0xefc1('0x19')]?_['map'](_0x2f4935['include'],function(_0x21aa3b){return{'model':db[_0x21aa3b[_0xefc1('0x1b')]],'as':_0x21aa3b['as'],'attributes':_0x21aa3b[_0xefc1('0x17')],'include':_0x21aa3b[_0xefc1('0x19')]?_[_0xefc1('0x1a')](_0x21aa3b[_0xefc1('0x19')],function(_0x538145){return{'model':db[_0x538145['model']],'as':_0x538145['as'],'attributes':_0x538145[_0xefc1('0x17')]};}):[]};}):[]};}):[]:[]})[_0xefc1('0x9')](function(_0x20e438){logger[_0xefc1('0xa')](_0xefc1('0x14'),_0x257914);logger['debug'](_0xefc1('0x14'),_0x257914,JSON[_0xefc1('0xf')](_0x20e438));_0x3b5a6e(_0x20e438);})['catch'](function(_0x486a5b){logger[_0xefc1('0x10')](_0xefc1('0x14'),_0x486a5b[_0xefc1('0x12')],_0x257914);_0x126052(_0x38923c['error'](0x1f4,_0x486a5b[_0xefc1('0x12')]));});});};
\ No newline at end of file
+var _0x38c3=['findAll','options','raw','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetCampaign','Campaign'];(function(_0x2c581d,_0x29c4fd){var _0x16f9fe=function(_0x362415){while(--_0x362415){_0x2c581d['push'](_0x2c581d['shift']());}};_0x16f9fe(++_0x29c4fd);}(_0x38c3,0x13d));var _0x338c=function(_0x1f0724,_0x3a58bf){_0x1f0724=_0x1f0724-0x0;var _0x253ffb=_0x38c3[_0x1f0724];return _0x253ffb;};'use strict';var _=require(_0x338c('0x0'));var util=require(_0x338c('0x1'));var moment=require('moment');var BPromise=require(_0x338c('0x2'));var rs=require(_0x338c('0x3'));var fs=require('fs');var Redis=require(_0x338c('0x4'));var db=require(_0x338c('0x5'))['db'];var utils=require(_0x338c('0x6'));var logger=require(_0x338c('0x7'))('rpc');var config=require(_0x338c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x338c('0x9')][_0x338c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4c021d,_0x39dacd,_0x2864c3){return new BPromise(function(_0x46286d,_0x5f285b){return client[_0x338c('0xb')](_0x4c021d,_0x2864c3)[_0x338c('0xc')](function(_0x212690){logger[_0x338c('0xd')](_0x338c('0xe'),_0x39dacd,_0x338c('0xf'));logger[_0x338c('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x39dacd,_0x338c('0xf'),JSON[_0x338c('0x11')](_0x212690));if(_0x212690['error']){if(_0x212690[_0x338c('0x12')]['code']===0x1f4){logger[_0x338c('0x12')](_0x338c('0xe'),_0x39dacd,_0x212690['error'][_0x338c('0x13')]);return _0x5f285b(_0x212690[_0x338c('0x12')][_0x338c('0x13')]);}logger[_0x338c('0x12')](_0x338c('0xe'),_0x39dacd,_0x212690[_0x338c('0x12')][_0x338c('0x13')]);return _0x46286d(_0x212690[_0x338c('0x12')][_0x338c('0x13')]);}else{logger[_0x338c('0xd')]('Campaign,\x20%s,\x20%s',_0x39dacd,'request\x20sent');_0x46286d(_0x212690[_0x338c('0x14')][_0x338c('0x13')]);}})[_0x338c('0x15')](function(_0x21cbd4){logger['error'](_0x338c('0xe'),_0x39dacd,_0x21cbd4);_0x5f285b(_0x21cbd4);});});}exports[_0x338c('0x16')]=function(_0x3a0784){var _0x307f7b=this;return new Promise(function(_0x190919,_0x3c988a){return db[_0x338c('0x17')][_0x338c('0x18')]({'raw':_0x3a0784[_0x338c('0x19')]?_0x3a0784[_0x338c('0x19')][_0x338c('0x1a')]===undefined?!![]:![]:!![],'where':_0x3a0784[_0x338c('0x19')]?_0x3a0784[_0x338c('0x19')]['where']||null:null,'attributes':_0x3a0784['options']?_0x3a0784[_0x338c('0x19')][_0x338c('0x1b')]||null:null,'limit':_0x3a0784[_0x338c('0x19')]?_0x3a0784[_0x338c('0x19')]['limit']||null:null,'include':_0x3a0784[_0x338c('0x19')]?_0x3a0784['options'][_0x338c('0x1c')]?_[_0x338c('0x1d')](_0x3a0784['options'][_0x338c('0x1c')],function(_0x144db9){return{'model':db[_0x144db9['model']],'as':_0x144db9['as'],'attributes':_0x144db9[_0x338c('0x1b')],'include':_0x144db9[_0x338c('0x1c')]?_[_0x338c('0x1d')](_0x144db9[_0x338c('0x1c')],function(_0x26013d){return{'model':db[_0x26013d[_0x338c('0x1e')]],'as':_0x26013d['as'],'attributes':_0x26013d[_0x338c('0x1b')],'include':_0x26013d[_0x338c('0x1c')]?_[_0x338c('0x1d')](_0x26013d['include'],function(_0x30edb0){return{'model':db[_0x30edb0[_0x338c('0x1e')]],'as':_0x30edb0['as'],'attributes':_0x30edb0[_0x338c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3ae957){logger[_0x338c('0xd')]('GetCampaign',_0x3a0784);logger[_0x338c('0x10')](_0x338c('0x16'),_0x3a0784,JSON[_0x338c('0x11')](_0x3ae957));_0x190919(_0x3ae957);})[_0x338c('0x15')](function(_0x1b7339){logger[_0x338c('0x12')]('GetCampaign',_0x1b7339['message'],_0x3a0784);_0x3c988a(_0x307f7b[_0x338c('0x12')](0x1f4,_0x1b7339[_0x338c('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 407c249..662a43b 100644
--- a/server/api/campaign/index.js
+++ b/server/api/campaign/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1f71=['getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','delete','destroy','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','/:id','show','/:id/hoppers','isAuthenticated'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1f71,0xaa));var _0x11f7=function(_0x5e05d0,_0x3dfc9b){_0x5e05d0=_0x5e05d0-0x0;var _0x82d556=_0x1f71[_0x5e05d0];return _0x82d556;};'use strict';var multer=require('multer');var util=require(_0x11f7('0x0'));var path=require(_0x11f7('0x1'));var timeout=require(_0x11f7('0x2'));var express=require(_0x11f7('0x3'));var router=express[_0x11f7('0x4')]();var fs_extra=require(_0x11f7('0x5'));var auth=require(_0x11f7('0x6'));var interaction=require(_0x11f7('0x7'));var config=require(_0x11f7('0x8'));var controller=require(_0x11f7('0x9'));router[_0x11f7('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0x11f7('0xa')](_0x11f7('0xb'),auth['isAuthenticated'](),controller[_0x11f7('0xc')]);router['get'](_0x11f7('0xd'),auth[_0x11f7('0xe')](),controller[_0x11f7('0xf')]);router['get'](_0x11f7('0x10'),auth['isAuthenticated'](),controller[_0x11f7('0x11')]);router['get'](_0x11f7('0x12'),auth[_0x11f7('0xe')](),controller[_0x11f7('0x13')]);router['get'](_0x11f7('0x14'),auth['isAuthenticated'](),controller[_0x11f7('0x15')]);router[_0x11f7('0xa')]('/:id/lists',auth[_0x11f7('0xe')](),controller[_0x11f7('0x16')]);router['get'](_0x11f7('0x17'),auth[_0x11f7('0xe')](),controller[_0x11f7('0x18')]);router[_0x11f7('0x19')]('/',auth[_0x11f7('0xe')](),controller[_0x11f7('0x1a')]);router['post'](_0x11f7('0x1b'),auth[_0x11f7('0xe')](),controller[_0x11f7('0x1c')]);router[_0x11f7('0x19')]('/:id/lists',auth['isAuthenticated'](),controller[_0x11f7('0x1d')]);router[_0x11f7('0x19')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x11f7('0x1e')]);router[_0x11f7('0x1f')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x11f7('0x20')](_0x11f7('0xb'),auth[_0x11f7('0xe')](),controller[_0x11f7('0x21')]);router[_0x11f7('0x20')]('/:id/lists',auth[_0x11f7('0xe')](),controller[_0x11f7('0x22')]);router[_0x11f7('0x20')](_0x11f7('0x17'),auth[_0x11f7('0xe')](),controller[_0x11f7('0x23')]);module[_0x11f7('0x24')]=router;
\ No newline at end of file
+var _0x00a6=['delete','destroy','removeLists','removeBlackLists','exports','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','get','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','getBlackLists','post','/:id/clone','clone','addLists','addBlackLists','put','update'];(function(_0x47ca39,_0x199e16){var _0x2a24a0=function(_0x470879){while(--_0x470879){_0x47ca39['push'](_0x47ca39['shift']());}};_0x2a24a0(++_0x199e16);}(_0x00a6,0x1a5));var _0x600a=function(_0x2266eb,_0xd0524b){_0x2266eb=_0x2266eb-0x0;var _0x28f8c5=_0x00a6[_0x2266eb];return _0x28f8c5;};'use strict';var multer=require('multer');var util=require(_0x600a('0x0'));var path=require(_0x600a('0x1'));var timeout=require(_0x600a('0x2'));var express=require(_0x600a('0x3'));var router=express['Router']();var fs_extra=require(_0x600a('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x600a('0x5'));var config=require(_0x600a('0x6'));var controller=require(_0x600a('0x7'));router['get']('/',auth[_0x600a('0x8')](),controller['index']);router[_0x600a('0x9')]('/:id',auth[_0x600a('0x8')](),controller[_0x600a('0xa')]);router[_0x600a('0x9')](_0x600a('0xb'),auth[_0x600a('0x8')](),controller[_0x600a('0xc')]);router[_0x600a('0x9')]('/:id/hopper_histories',auth[_0x600a('0x8')](),controller['getHopperHistories']);router['get'](_0x600a('0xd'),auth[_0x600a('0x8')](),controller[_0x600a('0xe')]);router[_0x600a('0x9')](_0x600a('0xf'),auth[_0x600a('0x8')](),controller[_0x600a('0x10')]);router[_0x600a('0x9')](_0x600a('0x11'),auth[_0x600a('0x8')](),controller['getLists']);router[_0x600a('0x9')](_0x600a('0x12'),auth[_0x600a('0x8')](),controller[_0x600a('0x13')]);router[_0x600a('0x14')]('/',auth[_0x600a('0x8')](),controller['create']);router[_0x600a('0x14')](_0x600a('0x15'),auth[_0x600a('0x8')](),controller[_0x600a('0x16')]);router['post'](_0x600a('0x11'),auth[_0x600a('0x8')](),controller[_0x600a('0x17')]);router[_0x600a('0x14')](_0x600a('0x12'),auth[_0x600a('0x8')](),controller[_0x600a('0x18')]);router[_0x600a('0x19')]('/:id',auth['isAuthenticated'](),controller[_0x600a('0x1a')]);router[_0x600a('0x1b')]('/:id',auth[_0x600a('0x8')](),controller[_0x600a('0x1c')]);router['delete'](_0x600a('0x11'),auth['isAuthenticated'](),controller[_0x600a('0x1d')]);router['delete'](_0x600a('0x12'),auth[_0x600a('0x8')](),controller[_0x600a('0x1e')]);module[_0x600a('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index ee775e3..c25d1d3 100644
--- a/server/api/cannedAnswer/cannedAnswer.attributes.js
+++ b/server/api/cannedAnswer/cannedAnswer.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x08bc=['TEXT','medium','STRING','getDataValue','key','sequelize','exports'];(function(_0x48788c,_0x22c6cf){var _0x111b0f=function(_0x4087db){while(--_0x4087db){_0x48788c['push'](_0x48788c['shift']());}};_0x111b0f(++_0x22c6cf);}(_0x08bc,0x140));var _0xc08b=function(_0x10c51f,_0x11270f){_0x10c51f=_0x10c51f-0x0;var _0x56a0cd=_0x08bc[_0x10c51f];return _0x56a0cd;};'use strict';var Sequelize=require(_0xc08b('0x0'));module[_0xc08b('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0xc08b('0x2')],'length':_0xc08b('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xc08b('0x4')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc08b('0x5')](_0xc08b('0x6'));}}};
\ No newline at end of file
+var _0x6e08=['sequelize','STRING','TEXT','getDataValue','key'];(function(_0x575eba,_0xfb5aab){var _0x2a0c37=function(_0x420d48){while(--_0x420d48){_0x575eba['push'](_0x575eba['shift']());}};_0x2a0c37(++_0xfb5aab);}(_0x6e08,0x10e));var _0x86e0=function(_0x5e6487,_0x2718b8){_0x5e6487=_0x5e6487-0x0;var _0x70c092=_0x6e08[_0x5e6487];return _0x70c092;};'use strict';var Sequelize=require(_0x86e0('0x0'));module['exports']={'key':{'type':Sequelize[_0x86e0('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0x86e0('0x2')],'length':'medium','allowNull':![]},'description':{'type':Sequelize[_0x86e0('0x1')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x86e0('0x3')](_0x86e0('0x4'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 88c1a78..481ccc5 100644
--- a/server/api/cannedAnswer/cannedAnswer.controller.js
+++ b/server/api/cannedAnswer/cannedAnswer.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x85dc=['sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','update','then','destroy','CannedAnswers','UserProfileResource','error','stack','name','index','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','merge','filter','options','includeAll','include','catch','rawAttributes','intersection','CannedAnswer','find','body','params','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x364d6c,_0x21025d){var _0x55156d=function(_0x4fe817){while(--_0x4fe817){_0x364d6c['push'](_0x364d6c['shift']());}};_0x55156d(++_0x21025d);}(_0x85dc,0x93));var _0xc85d=function(_0x563234,_0x129043){_0x563234=_0x563234-0x0;var _0x1e9d85=_0x85dc[_0x563234];return _0x1e9d85;};'use strict';var emlformat=require(_0xc85d('0x0'));var rimraf=require(_0xc85d('0x1'));var zipdir=require(_0xc85d('0x2'));var jsonpatch=require(_0xc85d('0x3'));var rp=require(_0xc85d('0x4'));var moment=require(_0xc85d('0x5'));var BPromise=require(_0xc85d('0x6'));var Mustache=require('mustache');var util=require(_0xc85d('0x7'));var path=require('path');var sox=require(_0xc85d('0x8'));var csv=require(_0xc85d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc85d('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xc85d('0xb'));var jsforce=require(_0xc85d('0xc'));var deskjs=require(_0xc85d('0xd'));var toCsv=require(_0xc85d('0x9'));var querystring=require(_0xc85d('0xe'));var Papa=require(_0xc85d('0xf'));var Redis=require('ioredis');var authService=require(_0xc85d('0x10'));var qs=require(_0xc85d('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc85d('0x12'));var logger=require(_0xc85d('0x13'))(_0xc85d('0x14'));var utils=require(_0xc85d('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xc85d('0x16'))['db'];function respondWithStatusCode(_0x56c045,_0x5e8a12){_0x5e8a12=_0x5e8a12||0xcc;return function(_0x317595){if(_0x317595){return _0x56c045[_0xc85d('0x17')](_0x5e8a12);}return _0x56c045['status'](_0x5e8a12)[_0xc85d('0x18')]();};}function respondWithResult(_0x2dc079,_0x414d31){_0x414d31=_0x414d31||0xc8;return function(_0x1fb974){if(_0x1fb974){return _0x2dc079[_0xc85d('0x19')](_0x414d31)[_0xc85d('0x1a')](_0x1fb974);}};}function respondWithFilteredResult(_0x73fada,_0x354e0b){return function(_0x4ae4f0){if(_0x4ae4f0){var _0x5739bd=typeof _0x354e0b[_0xc85d('0x1b')]===_0xc85d('0x1c')&&typeof _0x354e0b[_0xc85d('0x1d')]===_0xc85d('0x1c');var _0x291731=_0x4ae4f0[_0xc85d('0x1e')];var _0x3a6f5a=_0x5739bd?0x0:_0x354e0b[_0xc85d('0x1b')];var _0x4d0cc5=_0x5739bd?_0x4ae4f0[_0xc85d('0x1e')]:_0x354e0b['offset']+_0x354e0b[_0xc85d('0x1d')];var _0x5870fd;if(_0x4d0cc5>=_0x291731){_0x4d0cc5=_0x291731;_0x5870fd=0xc8;}else{_0x5870fd=0xce;}_0x73fada['status'](_0x5870fd);return _0x73fada[_0xc85d('0x1f')](_0xc85d('0x20'),_0x3a6f5a+'-'+_0x4d0cc5+'/'+_0x291731)['json'](_0x4ae4f0);}return null;};}function patchUpdates(_0x45b7eb){return function(_0x49a23e){try{jsonpatch[_0xc85d('0x21')](_0x49a23e,_0x45b7eb,!![]);}catch(_0x240d6c){return BPromise['reject'](_0x240d6c);}return _0x49a23e['save']();};}function saveUpdates(_0x6fd74e,_0x196176){return function(_0x4a5bac){if(_0x4a5bac){return _0x4a5bac[_0xc85d('0x22')](_0x6fd74e)[_0xc85d('0x23')](function(_0x32e799){return _0x32e799;});}return null;};}function removeEntity(_0x861cb9,_0x3dfe94){return function(_0x3451a3){if(_0x3451a3){return _0x3451a3[_0xc85d('0x24')]()[_0xc85d('0x23')](function(){var _0x479902=_0x3451a3['get']({'plain':!![]});var _0x186eb0=_0xc85d('0x25');return db[_0xc85d('0x26')][_0xc85d('0x24')]({'where':{'type':_0x186eb0,'resourceId':_0x479902['id']}})['then'](function(){return _0x3451a3;});})['then'](function(){_0x861cb9[_0xc85d('0x19')](0xcc)[_0xc85d('0x18')]();});}};}function handleEntityNotFound(_0x327a5a,_0x1b96c2){return function(_0x1313ea){if(!_0x1313ea){_0x327a5a[_0xc85d('0x17')](0x194);}return _0x1313ea;};}function handleError(_0xa88aed,_0x2f8adf){_0x2f8adf=_0x2f8adf||0x1f4;return function(_0x1f60df){logger[_0xc85d('0x27')](_0x1f60df[_0xc85d('0x28')]);if(_0x1f60df[_0xc85d('0x29')]){delete _0x1f60df[_0xc85d('0x29')];}_0xa88aed[_0xc85d('0x19')](_0x2f8adf)['send'](_0x1f60df);};}exports[_0xc85d('0x2a')]=function(_0x3f9a21,_0x338e50){var _0x176c6a={},_0x236331={},_0x2bd00d={'count':0x0,'rows':[]};var _0x4d972f=_[_0xc85d('0x2b')](db['CannedAnswer']['rawAttributes'],function(_0x5058d1){return{'name':_0x5058d1[_0xc85d('0x2c')],'type':_0x5058d1[_0xc85d('0x2d')][_0xc85d('0x2e')]};});_0x236331[_0xc85d('0x2f')]=_['map'](_0x4d972f,_0xc85d('0x29'));_0x236331[_0xc85d('0x30')]=_[_0xc85d('0x31')](_0x3f9a21[_0xc85d('0x30')]);_0x236331[_0xc85d('0x32')]=_['intersection'](_0x236331[_0xc85d('0x2f')],_0x236331[_0xc85d('0x30')]);_0x176c6a[_0xc85d('0x33')]=_['intersection'](_0x236331[_0xc85d('0x2f')],qs[_0xc85d('0x34')](_0x3f9a21[_0xc85d('0x30')][_0xc85d('0x34')]));_0x176c6a['attributes']=_0x176c6a['attributes'][_0xc85d('0x35')]?_0x176c6a[_0xc85d('0x33')]:_0x236331[_0xc85d('0x2f')];if(!_0x3f9a21['query'][_0xc85d('0x36')]('nolimit')){_0x176c6a[_0xc85d('0x1d')]=qs['limit'](_0x3f9a21['query'][_0xc85d('0x1d')]);_0x176c6a[_0xc85d('0x1b')]=qs[_0xc85d('0x1b')](_0x3f9a21[_0xc85d('0x30')][_0xc85d('0x1b')]);}_0x176c6a[_0xc85d('0x37')]=qs[_0xc85d('0x38')](_0x3f9a21[_0xc85d('0x30')][_0xc85d('0x38')]);_0x176c6a[_0xc85d('0x39')]=qs['filters'](_['pick'](_0x3f9a21[_0xc85d('0x30')],_0x236331[_0xc85d('0x32')]),_0x4d972f);if(_0x3f9a21['query']['filter']){_0x176c6a[_0xc85d('0x39')]=_[_0xc85d('0x3a')](_0x176c6a[_0xc85d('0x39')],{'$or':[{'key':{'$like':'%'+_0x3f9a21['query'][_0xc85d('0x3b')]+'%'}},{'value':{'$like':'%'+_0x3f9a21[_0xc85d('0x30')][_0xc85d('0x3b')]+'%'}}]});}_0x176c6a=_[_0xc85d('0x3a')]({},_0x176c6a,_0x3f9a21[_0xc85d('0x3c')]);var _0x18241c={'where':_0x176c6a[_0xc85d('0x39')]};return db['CannedAnswer'][_0xc85d('0x1e')](_0x18241c)['then'](function(_0x589563){_0x2bd00d[_0xc85d('0x1e')]=_0x589563;if(_0x3f9a21[_0xc85d('0x30')][_0xc85d('0x3d')]){_0x176c6a[_0xc85d('0x3e')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x176c6a);})[_0xc85d('0x23')](function(_0x1248c3){_0x2bd00d['rows']=_0x1248c3;return _0x2bd00d;})[_0xc85d('0x23')](respondWithFilteredResult(_0x338e50,_0x176c6a))[_0xc85d('0x3f')](handleError(_0x338e50,null));};exports['show']=function(_0x2398af,_0x251ace){var _0x5af0d4={'raw':!![],'where':{'id':_0x2398af['params']['id']}},_0x1d7d0c={};_0x1d7d0c['model']=_[_0xc85d('0x31')](db['CannedAnswer'][_0xc85d('0x40')]);_0x1d7d0c[_0xc85d('0x30')]=_[_0xc85d('0x31')](_0x2398af[_0xc85d('0x30')]);_0x1d7d0c[_0xc85d('0x32')]=_[_0xc85d('0x41')](_0x1d7d0c[_0xc85d('0x2f')],_0x1d7d0c[_0xc85d('0x30')]);_0x5af0d4[_0xc85d('0x33')]=_[_0xc85d('0x41')](_0x1d7d0c[_0xc85d('0x2f')],qs[_0xc85d('0x34')](_0x2398af[_0xc85d('0x30')]['fields']));_0x5af0d4[_0xc85d('0x33')]=_0x5af0d4[_0xc85d('0x33')][_0xc85d('0x35')]?_0x5af0d4[_0xc85d('0x33')]:_0x1d7d0c[_0xc85d('0x2f')];if(_0x2398af[_0xc85d('0x30')][_0xc85d('0x3d')]){_0x5af0d4['include']=[{'all':!![]}];}_0x5af0d4=_[_0xc85d('0x3a')]({},_0x5af0d4,_0x2398af[_0xc85d('0x3c')]);return db[_0xc85d('0x42')][_0xc85d('0x43')](_0x5af0d4)['then'](handleEntityNotFound(_0x251ace,null))[_0xc85d('0x23')](respondWithResult(_0x251ace,null))[_0xc85d('0x3f')](handleError(_0x251ace,null));};exports[_0xc85d('0x22')]=function(_0x2ab943,_0x5218a3){if(_0x2ab943[_0xc85d('0x44')]['id']){delete _0x2ab943[_0xc85d('0x44')]['id'];}return db['CannedAnswer'][_0xc85d('0x43')]({'where':{'id':_0x2ab943[_0xc85d('0x45')]['id']}})[_0xc85d('0x23')](handleEntityNotFound(_0x5218a3,null))[_0xc85d('0x23')](saveUpdates(_0x2ab943[_0xc85d('0x44')],null))[_0xc85d('0x23')](respondWithResult(_0x5218a3,null))[_0xc85d('0x3f')](handleError(_0x5218a3,null));};exports[_0xc85d('0x24')]=function(_0x524d90,_0x299f25){return db[_0xc85d('0x42')][_0xc85d('0x43')]({'where':{'id':_0x524d90['params']['id']}})[_0xc85d('0x23')](handleEntityNotFound(_0x299f25,null))['then'](removeEntity(_0x299f25,null))['catch'](handleError(_0x299f25,null));};exports[_0xc85d('0x46')]=function(_0x3885b6,_0x49a056){var _0x70b656={'key':_0x3885b6['body']['key']};if(_0x3885b6[_0xc85d('0x44')]['MailAccountId']){_0x70b656[_0xc85d('0x47')]=_0x3885b6[_0xc85d('0x44')][_0xc85d('0x47')];}else if(_0x3885b6['body']['SmsAccountId']){_0x70b656['SmsAccountId']=_0x3885b6[_0xc85d('0x44')][_0xc85d('0x48')];}else if(_0x3885b6[_0xc85d('0x44')][_0xc85d('0x49')]){_0x70b656[_0xc85d('0x49')]=_0x3885b6[_0xc85d('0x44')][_0xc85d('0x49')];}else if(_0x3885b6[_0xc85d('0x44')]['ChatWebsiteId']){_0x70b656[_0xc85d('0x4a')]=_0x3885b6['body'][_0xc85d('0x4a')];}return db['CannedAnswer'][_0xc85d('0x43')]({'where':_0x70b656})[_0xc85d('0x23')](function(_0x102a8d){if(_0x102a8d){throw new db[(_0xc85d('0x4b'))][(_0xc85d('0x4c'))](_0xc85d('0x4d'));}return db[_0xc85d('0x42')]['create'](_0x3885b6[_0xc85d('0x44')]);})[_0xc85d('0x23')](function(_0x14d3d3){var _0x2d6e7c=_0x3885b6[_0xc85d('0x4e')][_0xc85d('0x4f')]({'plain':!![]});if(!_0x2d6e7c)throw new Error(_0xc85d('0x50'));if(_0x2d6e7c['role']===_0xc85d('0x4e')){var _0x2a80dd=_0x14d3d3[_0xc85d('0x4f')]({'plain':!![]});return db[_0xc85d('0x51')][_0xc85d('0x43')]({'where':{'name':_0xc85d('0x25'),'userProfileId':_0x2d6e7c[_0xc85d('0x52')]},'raw':!![]})[_0xc85d('0x23')](function(_0x501793){if(_0x501793&&_0x501793[_0xc85d('0x53')]===0x0){return db['UserProfileResource'][_0xc85d('0x46')]({'name':_0x2a80dd[_0xc85d('0x29')],'resourceId':_0x2a80dd['id'],'type':_0x501793[_0xc85d('0x29')],'sectionId':_0x501793['id']},{})[_0xc85d('0x23')](function(){return _0x14d3d3;});}else{return _0x14d3d3;}})[_0xc85d('0x3f')](function(_0x361a6f){logger[_0xc85d('0x27')](_0xc85d('0x54'),_0x361a6f);throw _0x361a6f;});}return _0x14d3d3;})[_0xc85d('0x23')](respondWithResult(_0x49a056,0xc9))['catch'](handleError(_0x49a056,null));};
\ No newline at end of file
+var _0xe1c4=['include','findAll','rows','catch','show','params','rawAttributes','fields','length','includeAll','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','get','CannedAnswers','UserProfileResource','sendStatus','name','send','index','CannedAnswer','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options'];(function(_0x20bee5,_0x52defe){var _0x116c5d=function(_0xa84a23){while(--_0xa84a23){_0x20bee5['push'](_0x20bee5['shift']());}};_0x116c5d(++_0x52defe);}(_0xe1c4,0x7e));var _0x4e1c=function(_0x32e919,_0x4fd27c){_0x32e919=_0x32e919-0x0;var _0x2fc4cb=_0xe1c4[_0x32e919];return _0x2fc4cb;};'use strict';var emlformat=require(_0x4e1c('0x0'));var rimraf=require(_0x4e1c('0x1'));var zipdir=require(_0x4e1c('0x2'));var jsonpatch=require(_0x4e1c('0x3'));var rp=require(_0x4e1c('0x4'));var moment=require(_0x4e1c('0x5'));var BPromise=require(_0x4e1c('0x6'));var Mustache=require(_0x4e1c('0x7'));var util=require(_0x4e1c('0x8'));var path=require(_0x4e1c('0x9'));var sox=require(_0x4e1c('0xa'));var csv=require(_0x4e1c('0xb'));var ejs=require(_0x4e1c('0xc'));var fs=require('fs');var fs_extra=require(_0x4e1c('0xd'));var _=require(_0x4e1c('0xe'));var squel=require(_0x4e1c('0xf'));var crypto=require(_0x4e1c('0x10'));var jsforce=require(_0x4e1c('0x11'));var deskjs=require(_0x4e1c('0x12'));var toCsv=require('to-csv');var querystring=require(_0x4e1c('0x13'));var Papa=require(_0x4e1c('0x14'));var Redis=require('ioredis');var authService=require(_0x4e1c('0x15'));var qs=require(_0x4e1c('0x16'));var as=require(_0x4e1c('0x17'));var hardwareService=require(_0x4e1c('0x18'));var logger=require(_0x4e1c('0x19'))(_0x4e1c('0x1a'));var utils=require(_0x4e1c('0x1b'));var config=require(_0x4e1c('0x1c'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20c2c5,_0x10b503){_0x10b503=_0x10b503||0xcc;return function(_0x3b055c){if(_0x3b055c){return _0x20c2c5['sendStatus'](_0x10b503);}return _0x20c2c5['status'](_0x10b503)[_0x4e1c('0x1d')]();};}function respondWithResult(_0x5d4743,_0x23b5eb){_0x23b5eb=_0x23b5eb||0xc8;return function(_0x5c542d){if(_0x5c542d){return _0x5d4743[_0x4e1c('0x1e')](_0x23b5eb)[_0x4e1c('0x1f')](_0x5c542d);}};}function respondWithFilteredResult(_0x30569b,_0x57e748){return function(_0x3fdcb5){if(_0x3fdcb5){var _0x28c091=typeof _0x57e748[_0x4e1c('0x20')]==='undefined'&&typeof _0x57e748[_0x4e1c('0x21')]===_0x4e1c('0x22');var _0x35a4b0=_0x3fdcb5['count'];var _0x4a2989=_0x28c091?0x0:_0x57e748[_0x4e1c('0x20')];var _0x479e6c=_0x28c091?_0x3fdcb5[_0x4e1c('0x23')]:_0x57e748[_0x4e1c('0x20')]+_0x57e748[_0x4e1c('0x21')];var _0x126f82;if(_0x479e6c>=_0x35a4b0){_0x479e6c=_0x35a4b0;_0x126f82=0xc8;}else{_0x126f82=0xce;}_0x30569b[_0x4e1c('0x1e')](_0x126f82);return _0x30569b[_0x4e1c('0x24')](_0x4e1c('0x25'),_0x4a2989+'-'+_0x479e6c+'/'+_0x35a4b0)['json'](_0x3fdcb5);}return null;};}function patchUpdates(_0x5c72c5){return function(_0x5283c7){try{jsonpatch['apply'](_0x5283c7,_0x5c72c5,!![]);}catch(_0x8025c4){return BPromise[_0x4e1c('0x26')](_0x8025c4);}return _0x5283c7[_0x4e1c('0x27')]();};}function saveUpdates(_0x1b2493,_0x2b123e){return function(_0x33a71e){if(_0x33a71e){return _0x33a71e[_0x4e1c('0x28')](_0x1b2493)['then'](function(_0x374001){return _0x374001;});}return null;};}function removeEntity(_0x95b347,_0x5b07e2){return function(_0x213e0a){if(_0x213e0a){return _0x213e0a[_0x4e1c('0x29')]()[_0x4e1c('0x2a')](function(){var _0x2c0479=_0x213e0a[_0x4e1c('0x2b')]({'plain':!![]});var _0x5d8370=_0x4e1c('0x2c');return db[_0x4e1c('0x2d')][_0x4e1c('0x29')]({'where':{'type':_0x5d8370,'resourceId':_0x2c0479['id']}})[_0x4e1c('0x2a')](function(){return _0x213e0a;});})['then'](function(){_0x95b347[_0x4e1c('0x1e')](0xcc)[_0x4e1c('0x1d')]();});}};}function handleEntityNotFound(_0x470052,_0x39cbb1){return function(_0x739837){if(!_0x739837){_0x470052[_0x4e1c('0x2e')](0x194);}return _0x739837;};}function handleError(_0x4ce326,_0x13c676){_0x13c676=_0x13c676||0x1f4;return function(_0x2ce04c){logger['error'](_0x2ce04c['stack']);if(_0x2ce04c[_0x4e1c('0x2f')]){delete _0x2ce04c['name'];}_0x4ce326['status'](_0x13c676)[_0x4e1c('0x30')](_0x2ce04c);};}exports[_0x4e1c('0x31')]=function(_0x59d4ab,_0x23813c){var _0x20076b={},_0x46ecc4={},_0x2ad0f6={'count':0x0,'rows':[]};var _0x2b4b24=_['map'](db[_0x4e1c('0x32')]['rawAttributes'],function(_0x437e03){return{'name':_0x437e03[_0x4e1c('0x33')],'type':_0x437e03[_0x4e1c('0x34')][_0x4e1c('0x35')]};});_0x46ecc4[_0x4e1c('0x36')]=_[_0x4e1c('0x37')](_0x2b4b24,'name');_0x46ecc4[_0x4e1c('0x38')]=_[_0x4e1c('0x39')](_0x59d4ab[_0x4e1c('0x38')]);_0x46ecc4[_0x4e1c('0x3a')]=_['intersection'](_0x46ecc4['model'],_0x46ecc4[_0x4e1c('0x38')]);_0x20076b[_0x4e1c('0x3b')]=_[_0x4e1c('0x3c')](_0x46ecc4[_0x4e1c('0x36')],qs['fields'](_0x59d4ab[_0x4e1c('0x38')]['fields']));_0x20076b['attributes']=_0x20076b[_0x4e1c('0x3b')]['length']?_0x20076b[_0x4e1c('0x3b')]:_0x46ecc4['model'];if(!_0x59d4ab[_0x4e1c('0x38')][_0x4e1c('0x3d')](_0x4e1c('0x3e'))){_0x20076b[_0x4e1c('0x21')]=qs[_0x4e1c('0x21')](_0x59d4ab[_0x4e1c('0x38')][_0x4e1c('0x21')]);_0x20076b[_0x4e1c('0x20')]=qs[_0x4e1c('0x20')](_0x59d4ab[_0x4e1c('0x38')][_0x4e1c('0x20')]);}_0x20076b[_0x4e1c('0x3f')]=qs[_0x4e1c('0x40')](_0x59d4ab[_0x4e1c('0x38')]['sort']);_0x20076b[_0x4e1c('0x41')]=qs['filters'](_[_0x4e1c('0x42')](_0x59d4ab['query'],_0x46ecc4[_0x4e1c('0x3a')]),_0x2b4b24);if(_0x59d4ab[_0x4e1c('0x38')]['filter']){_0x20076b[_0x4e1c('0x41')]=_[_0x4e1c('0x43')](_0x20076b[_0x4e1c('0x41')],{'$or':[{'key':{'$like':'%'+_0x59d4ab[_0x4e1c('0x38')][_0x4e1c('0x44')]+'%'}},{'value':{'$like':'%'+_0x59d4ab['query'][_0x4e1c('0x44')]+'%'}}]});}_0x20076b=_[_0x4e1c('0x43')]({},_0x20076b,_0x59d4ab[_0x4e1c('0x45')]);var _0x1d49f2={'where':_0x20076b[_0x4e1c('0x41')]};return db[_0x4e1c('0x32')][_0x4e1c('0x23')](_0x1d49f2)[_0x4e1c('0x2a')](function(_0x1efe18){_0x2ad0f6[_0x4e1c('0x23')]=_0x1efe18;if(_0x59d4ab[_0x4e1c('0x38')]['includeAll']){_0x20076b[_0x4e1c('0x46')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4e1c('0x47')](_0x20076b);})[_0x4e1c('0x2a')](function(_0x305aa6){_0x2ad0f6[_0x4e1c('0x48')]=_0x305aa6;return _0x2ad0f6;})[_0x4e1c('0x2a')](respondWithFilteredResult(_0x23813c,_0x20076b))[_0x4e1c('0x49')](handleError(_0x23813c,null));};exports[_0x4e1c('0x4a')]=function(_0x1cfefd,_0x145a9c){var _0x2bb029={'raw':!![],'where':{'id':_0x1cfefd[_0x4e1c('0x4b')]['id']}},_0x339913={};_0x339913[_0x4e1c('0x36')]=_['keys'](db[_0x4e1c('0x32')][_0x4e1c('0x4c')]);_0x339913[_0x4e1c('0x38')]=_['keys'](_0x1cfefd[_0x4e1c('0x38')]);_0x339913[_0x4e1c('0x3a')]=_[_0x4e1c('0x3c')](_0x339913['model'],_0x339913[_0x4e1c('0x38')]);_0x2bb029[_0x4e1c('0x3b')]=_[_0x4e1c('0x3c')](_0x339913[_0x4e1c('0x36')],qs[_0x4e1c('0x4d')](_0x1cfefd[_0x4e1c('0x38')][_0x4e1c('0x4d')]));_0x2bb029[_0x4e1c('0x3b')]=_0x2bb029[_0x4e1c('0x3b')][_0x4e1c('0x4e')]?_0x2bb029[_0x4e1c('0x3b')]:_0x339913[_0x4e1c('0x36')];if(_0x1cfefd['query'][_0x4e1c('0x4f')]){_0x2bb029[_0x4e1c('0x46')]=[{'all':!![]}];}_0x2bb029=_[_0x4e1c('0x43')]({},_0x2bb029,_0x1cfefd['options']);return db[_0x4e1c('0x32')][_0x4e1c('0x50')](_0x2bb029)[_0x4e1c('0x2a')](handleEntityNotFound(_0x145a9c,null))[_0x4e1c('0x2a')](respondWithResult(_0x145a9c,null))['catch'](handleError(_0x145a9c,null));};exports['update']=function(_0x5129ab,_0x5d0010){if(_0x5129ab['body']['id']){delete _0x5129ab[_0x4e1c('0x51')]['id'];}return db['CannedAnswer'][_0x4e1c('0x50')]({'where':{'id':_0x5129ab[_0x4e1c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5d0010,null))[_0x4e1c('0x2a')](saveUpdates(_0x5129ab[_0x4e1c('0x51')],null))[_0x4e1c('0x2a')](respondWithResult(_0x5d0010,null))[_0x4e1c('0x49')](handleError(_0x5d0010,null));};exports[_0x4e1c('0x29')]=function(_0x176608,_0xb8b3b6){return db[_0x4e1c('0x32')][_0x4e1c('0x50')]({'where':{'id':_0x176608[_0x4e1c('0x4b')]['id']}})[_0x4e1c('0x2a')](handleEntityNotFound(_0xb8b3b6,null))[_0x4e1c('0x2a')](removeEntity(_0xb8b3b6,null))[_0x4e1c('0x49')](handleError(_0xb8b3b6,null));};exports[_0x4e1c('0x52')]=function(_0x3234ba,_0x6d79f5){var _0x22b98d={'key':_0x3234ba[_0x4e1c('0x51')][_0x4e1c('0x35')]};if(_0x3234ba['body'][_0x4e1c('0x53')]){_0x22b98d['MailAccountId']=_0x3234ba[_0x4e1c('0x51')][_0x4e1c('0x53')];}else if(_0x3234ba[_0x4e1c('0x51')]['SmsAccountId']){_0x22b98d['SmsAccountId']=_0x3234ba['body'][_0x4e1c('0x54')];}else if(_0x3234ba['body'][_0x4e1c('0x55')]){_0x22b98d[_0x4e1c('0x55')]=_0x3234ba[_0x4e1c('0x51')][_0x4e1c('0x55')];}else if(_0x3234ba[_0x4e1c('0x51')][_0x4e1c('0x56')]){_0x22b98d[_0x4e1c('0x56')]=_0x3234ba['body'][_0x4e1c('0x56')];}return db[_0x4e1c('0x32')][_0x4e1c('0x50')]({'where':_0x22b98d})['then'](function(_0x20cc04){if(_0x20cc04){throw new db[(_0x4e1c('0x57'))][(_0x4e1c('0x58'))](_0x4e1c('0x59'));}return db[_0x4e1c('0x32')][_0x4e1c('0x52')](_0x3234ba[_0x4e1c('0x51')]);})[_0x4e1c('0x2a')](function(_0x2c9e08){var _0x5be6e8=_0x3234ba[_0x4e1c('0x5a')][_0x4e1c('0x2b')]({'plain':!![]});if(!_0x5be6e8)throw new Error(_0x4e1c('0x5b'));if(_0x5be6e8[_0x4e1c('0x5c')]===_0x4e1c('0x5a')){var _0x40cfd3=_0x2c9e08['get']({'plain':!![]});return db[_0x4e1c('0x5d')][_0x4e1c('0x50')]({'where':{'name':'CannedAnswers','userProfileId':_0x5be6e8[_0x4e1c('0x5e')]},'raw':!![]})[_0x4e1c('0x2a')](function(_0x4472f4){if(_0x4472f4&&_0x4472f4[_0x4e1c('0x5f')]===0x0){return db[_0x4e1c('0x2d')][_0x4e1c('0x52')]({'name':_0x40cfd3[_0x4e1c('0x2f')],'resourceId':_0x40cfd3['id'],'type':_0x4472f4[_0x4e1c('0x2f')],'sectionId':_0x4472f4['id']},{})[_0x4e1c('0x2a')](function(){return _0x2c9e08;});}else{return _0x2c9e08;}})[_0x4e1c('0x49')](function(_0x3f20cd){logger[_0x4e1c('0x60')](_0x4e1c('0x61'),_0x3f20cd);throw _0x3f20cd;});}return _0x2c9e08;})[_0x4e1c('0x2a')](respondWithResult(_0x6d79f5,0xc9))[_0x4e1c('0x49')](handleError(_0x6d79f5,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index b2278ea..8119fac 100644
--- a/server/api/cannedAnswer/cannedAnswer.model.js
+++ b/server/api/cannedAnswer/cannedAnswer.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x65b0=['../../config/logger','moment','bluebird','rimraf','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0x65b0,0x18f));var _0x065b=function(_0x9f1282,_0x1576cb){_0x9f1282=_0x9f1282-0x0;var _0x2cd1f3=_0x65b0[_0x9f1282];return _0x2cd1f3;};'use strict';var _=require('lodash');var util=require(_0x065b('0x0'));var logger=require(_0x065b('0x1'))('api');var moment=require(_0x065b('0x2'));var BPromise=require(_0x065b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x065b('0x4'));var config=require('../../config/environment');var attributes=require(_0x065b('0x5'));module[_0x065b('0x6')]=function(_0x47136a,_0x1b9f46){return _0x47136a['define'](_0x065b('0x7'),attributes,{'tableName':_0x065b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x065b('0x9')});};
\ No newline at end of file
+var _0x6fbb=['rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4','lodash','moment','bluebird','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x6fbb,0x13b));var _0xb6fb=function(_0x1315e2,_0xd8ae26){_0x1315e2=_0x1315e2-0x0;var _0x45dbe6=_0x6fbb[_0x1315e2];return _0x45dbe6;};'use strict';var _=require(_0xb6fb('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xb6fb('0x1'));var BPromise=require(_0xb6fb('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb6fb('0x3'));var rimraf=require(_0xb6fb('0x4'));var config=require(_0xb6fb('0x5'));var attributes=require(_0xb6fb('0x6'));module['exports']=function(_0x5807e7,_0x27b7ca){return _0x5807e7[_0xb6fb('0x7')](_0xb6fb('0x8'),attributes,{'tableName':_0xb6fb('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb6fb('0xa'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 59a1cd4..fd8e3b4 100644
--- a/server/api/cannedAnswer/cannedAnswer.rpc.js
+++ b/server/api/cannedAnswer/cannedAnswer.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x1a9322,_0x4e3755){var _0x277f3f=function(_0x15f266){while(--_0x15f266){_0x1a9322['push'](_0x1a9322['shift']());}};_0x277f3f(++_0x4e3755);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
+var _0xa9e0=['http','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x63608c,_0x41dfdb){var _0x3977f8=function(_0x1788a5){while(--_0x1788a5){_0x63608c['push'](_0x63608c['shift']());}};_0x3977f8(++_0x41dfdb);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 67231b4..f0b8306 100644
--- a/server/api/cannedAnswer/index.js
+++ b/server/api/cannedAnswer/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd743=['../../config/environment','./cannedAnswer.controller','get','index','/:id','show','isAuthenticated','create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service'];(function(_0xc8e56e,_0x27450a){var _0x3e44b3=function(_0x547533){while(--_0x547533){_0xc8e56e['push'](_0xc8e56e['shift']());}};_0x3e44b3(++_0x27450a);}(_0xd743,0x1ce));var _0x3d74=function(_0x450aa1,_0x370a37){_0x450aa1=_0x450aa1-0x0;var _0xeadef4=_0xd743[_0x450aa1];return _0xeadef4;};'use strict';var multer=require(_0x3d74('0x0'));var util=require(_0x3d74('0x1'));var path=require('path');var timeout=require(_0x3d74('0x2'));var express=require(_0x3d74('0x3'));var router=express[_0x3d74('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x3d74('0x5'));var config=require(_0x3d74('0x6'));var controller=require(_0x3d74('0x7'));router[_0x3d74('0x8')]('/',auth['isAuthenticated'](),controller[_0x3d74('0x9')]);router[_0x3d74('0x8')](_0x3d74('0xa'),auth['isAuthenticated'](),controller[_0x3d74('0xb')]);router['post']('/',auth[_0x3d74('0xc')](),controller[_0x3d74('0xd')]);router['put']('/:id',auth[_0x3d74('0xc')](),controller[_0x3d74('0xe')]);router[_0x3d74('0xf')](_0x3d74('0xa'),auth[_0x3d74('0xc')](),controller[_0x3d74('0x10')]);module[_0x3d74('0x11')]=router;
\ No newline at end of file
+var _0x883d=['path','connect-timeout','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x201920,_0x23a42e){var _0x11ca83=function(_0x14cde0){while(--_0x14cde0){_0x201920['push'](_0x201920['shift']());}};_0x11ca83(++_0x23a42e);}(_0x883d,0x18a));var _0xd883=function(_0x46a40a,_0x2e4db2){_0x46a40a=_0x46a40a-0x0;var _0xe9f4ea=_0x883d[_0x46a40a];return _0xe9f4ea;};'use strict';var multer=require(_0xd883('0x0'));var util=require(_0xd883('0x1'));var path=require(_0xd883('0x2'));var timeout=require(_0xd883('0x3'));var express=require('express');var router=express[_0xd883('0x4')]();var fs_extra=require(_0xd883('0x5'));var auth=require(_0xd883('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd883('0x7'));router[_0xd883('0x8')]('/',auth[_0xd883('0x9')](),controller['index']);router['get'](_0xd883('0xa'),auth[_0xd883('0x9')](),controller[_0xd883('0xb')]);router[_0xd883('0xc')]('/',auth[_0xd883('0x9')](),controller[_0xd883('0xd')]);router[_0xd883('0xe')]('/:id',auth[_0xd883('0x9')](),controller['update']);router[_0xd883('0xf')]('/:id',auth[_0xd883('0x9')](),controller[_0xd883('0x10')]);module[_0xd883('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4780510..6420cfc 100644
--- a/server/api/cdr/cdr.attributes.js
+++ b/server/api/cdr/cdr.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0f61=['INTEGER','exports','STRING'];(function(_0x579f17,_0x1984cb){var _0x25e10e=function(_0x34d900){while(--_0x34d900){_0x579f17['push'](_0x579f17['shift']());}};_0x25e10e(++_0x1984cb);}(_0x0f61,0xa6));var _0x10f6=function(_0x24d95b,_0x3a25a7){_0x24d95b=_0x24d95b-0x0;var _0x876fc5=_0x0f61[_0x24d95b];return _0x876fc5;};'use strict';var Sequelize=require('sequelize');module[_0x10f6('0x0')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x10f6('0x1')]},'src':{'type':Sequelize[_0x10f6('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x10f6('0x1')]},'channel':{'type':Sequelize[_0x10f6('0x1')]},'dstchannel':{'type':Sequelize[_0x10f6('0x1')]},'lastapp':{'type':Sequelize[_0x10f6('0x1')]},'lastdata':{'type':Sequelize[_0x10f6('0x1')]},'duration':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x10f6('0x1')]},'amaflags':{'type':Sequelize[_0x10f6('0x2')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x10f6('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x10f6('0x1')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x10f6('0x1')]},'peeraccount':{'type':Sequelize[_0x10f6('0x1')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x10f6('0x1')]}};
\ No newline at end of file
+var _0x7846=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x15d4d7,_0x906f5a){var _0x321017=function(_0x13517e){while(--_0x13517e){_0x15d4d7['push'](_0x15d4d7['shift']());}};_0x321017(++_0x906f5a);}(_0x7846,0xf4));var _0x6784=function(_0x5a27e8,_0x492a2f){_0x5a27e8=_0x5a27e8-0x0;var _0x4e38f7=_0x7846[_0x5a27e8];return _0x4e38f7;};'use strict';var Sequelize=require('sequelize');module[_0x6784('0x0')]={'calldate':{'type':Sequelize[_0x6784('0x1')],'allowNull':![],'defaultValue':_0x6784('0x2')},'clid':{'type':Sequelize[_0x6784('0x3')]},'src':{'type':Sequelize[_0x6784('0x3')]},'dst':{'type':Sequelize[_0x6784('0x3')]},'dcontext':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x6784('0x3')]},'dstchannel':{'type':Sequelize[_0x6784('0x3')]},'lastapp':{'type':Sequelize[_0x6784('0x3')]},'lastdata':{'type':Sequelize[_0x6784('0x3')]},'duration':{'type':Sequelize[_0x6784('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x6784('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x6784('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize[_0x6784('0x3')]},'uniqueid':{'type':Sequelize[_0x6784('0x3')]},'linkedid':{'type':Sequelize[_0x6784('0x3')]},'sequence':{'type':Sequelize[_0x6784('0x3')]},'peeraccount':{'type':Sequelize[_0x6784('0x3')]},'type':{'type':Sequelize[_0x6784('0x3')]},'tag':{'type':Sequelize[_0x6784('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index fc8d2d7..fff470d 100644
--- a/server/api/cdr/cdr.controller.js
+++ b/server/api/cdr/cdr.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8085=['name','send','index','map','Cdr','fieldName','type','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','length','catch','body','find','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','reject','save','update','then','destroy','error','stack'];(function(_0x52c6ec,_0x401b11){var _0x47813e=function(_0x11a6c2){while(--_0x11a6c2){_0x52c6ec['push'](_0x52c6ec['shift']());}};_0x47813e(++_0x401b11);}(_0x8085,0x71));var _0x5808=function(_0x5e4563,_0x3ff918){_0x5e4563=_0x5e4563-0x0;var _0x8d1bf5=_0x8085[_0x5e4563];return _0x8d1bf5;};'use strict';var emlformat=require(_0x5808('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5808('0x1'));var rp=require(_0x5808('0x2'));var moment=require(_0x5808('0x3'));var BPromise=require(_0x5808('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5808('0x5'));var sox=require(_0x5808('0x6'));var csv=require('to-csv');var ejs=require(_0x5808('0x7'));var fs=require('fs');var fs_extra=require(_0x5808('0x8'));var _=require(_0x5808('0x9'));var squel=require(_0x5808('0xa'));var crypto=require(_0x5808('0xb'));var jsforce=require(_0x5808('0xc'));var deskjs=require(_0x5808('0xd'));var toCsv=require(_0x5808('0xe'));var querystring=require(_0x5808('0xf'));var Papa=require(_0x5808('0x10'));var Redis=require(_0x5808('0x11'));var authService=require(_0x5808('0x12'));var qs=require(_0x5808('0x13'));var as=require(_0x5808('0x14'));var hardwareService=require(_0x5808('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x5808('0x16'));var config=require(_0x5808('0x17'));var licenseUtil=require(_0x5808('0x18'));var db=require(_0x5808('0x19'))['db'];function respondWithStatusCode(_0xab4f46,_0x19be03){_0x19be03=_0x19be03||0xcc;return function(_0x10572d){if(_0x10572d){return _0xab4f46['sendStatus'](_0x19be03);}return _0xab4f46['status'](_0x19be03)[_0x5808('0x1a')]();};}function respondWithResult(_0x19252b,_0x3582d6){_0x3582d6=_0x3582d6||0xc8;return function(_0x3e7c09){if(_0x3e7c09){return _0x19252b[_0x5808('0x1b')](_0x3582d6)[_0x5808('0x1c')](_0x3e7c09);}};}function respondWithFilteredResult(_0x299b22,_0x2af9da){return function(_0x1dda8d){if(_0x1dda8d){var _0x46dd8a=typeof _0x2af9da[_0x5808('0x1d')]==='undefined'&&typeof _0x2af9da[_0x5808('0x1e')]==='undefined';var _0x406e65=_0x1dda8d[_0x5808('0x1f')];var _0x3bf0ee=_0x46dd8a?0x0:_0x2af9da['offset'];var _0x9e58d4=_0x46dd8a?_0x1dda8d[_0x5808('0x1f')]:_0x2af9da['offset']+_0x2af9da['limit'];var _0x3c7c02;if(_0x9e58d4>=_0x406e65){_0x9e58d4=_0x406e65;_0x3c7c02=0xc8;}else{_0x3c7c02=0xce;}_0x299b22['status'](_0x3c7c02);return _0x299b22[_0x5808('0x20')](_0x5808('0x21'),_0x3bf0ee+'-'+_0x9e58d4+'/'+_0x406e65)[_0x5808('0x1c')](_0x1dda8d);}return null;};}function patchUpdates(_0xaac16a){return function(_0x578d70){try{jsonpatch['apply'](_0x578d70,_0xaac16a,!![]);}catch(_0xe82ad0){return BPromise[_0x5808('0x22')](_0xe82ad0);}return _0x578d70[_0x5808('0x23')]();};}function saveUpdates(_0x39bca3,_0x409337){return function(_0x33b583){if(_0x33b583){return _0x33b583[_0x5808('0x24')](_0x39bca3)[_0x5808('0x25')](function(_0x3a575e){return _0x3a575e;});}return null;};}function removeEntity(_0x4e1dfc,_0x5b5175){return function(_0x130590){if(_0x130590){return _0x130590[_0x5808('0x26')]()['then'](function(){_0x4e1dfc['status'](0xcc)[_0x5808('0x1a')]();});}};}function handleEntityNotFound(_0x467500,_0x1dddbd){return function(_0x4a4d05){if(!_0x4a4d05){_0x467500['sendStatus'](0x194);}return _0x4a4d05;};}function handleError(_0x24ee0f,_0x2c2cb5){_0x2c2cb5=_0x2c2cb5||0x1f4;return function(_0x27c991){logger[_0x5808('0x27')](_0x27c991[_0x5808('0x28')]);if(_0x27c991['name']){delete _0x27c991[_0x5808('0x29')];}_0x24ee0f[_0x5808('0x1b')](_0x2c2cb5)[_0x5808('0x2a')](_0x27c991);};}exports[_0x5808('0x2b')]=function(_0x28c1eb,_0x19ac63){var _0x1117ac={},_0x4ad6d8={},_0x560e83={'count':0x0,'rows':[]};var _0x4f6342=_[_0x5808('0x2c')](db[_0x5808('0x2d')]['rawAttributes'],function(_0x3faa07){return{'name':_0x3faa07[_0x5808('0x2e')],'type':_0x3faa07[_0x5808('0x2f')][_0x5808('0x30')]};});_0x4ad6d8[_0x5808('0x31')]=_[_0x5808('0x2c')](_0x4f6342,'name');_0x4ad6d8[_0x5808('0x32')]=_[_0x5808('0x33')](_0x28c1eb[_0x5808('0x32')]);_0x4ad6d8['filters']=_['intersection'](_0x4ad6d8[_0x5808('0x31')],_0x4ad6d8['query']);_0x1117ac[_0x5808('0x34')]=_[_0x5808('0x35')](_0x4ad6d8['model'],qs[_0x5808('0x36')](_0x28c1eb[_0x5808('0x32')]['fields']));_0x1117ac['attributes']=_0x1117ac[_0x5808('0x34')]['length']?_0x1117ac[_0x5808('0x34')]:_0x4ad6d8['model'];if(!_0x28c1eb[_0x5808('0x32')][_0x5808('0x37')](_0x5808('0x38'))){_0x1117ac['limit']=qs[_0x5808('0x1e')](_0x28c1eb['query'][_0x5808('0x1e')]);_0x1117ac['offset']=qs['offset'](_0x28c1eb[_0x5808('0x32')][_0x5808('0x1d')]);}_0x1117ac[_0x5808('0x39')]=qs['sort'](_0x28c1eb['query'][_0x5808('0x3a')]);_0x1117ac[_0x5808('0x3b')]=qs['filters'](_[_0x5808('0x3c')](_0x28c1eb[_0x5808('0x32')],_0x4ad6d8[_0x5808('0x3d')]),_0x4f6342);if(_0x28c1eb['query'][_0x5808('0x3e')]){_0x1117ac[_0x5808('0x3b')]=_[_0x5808('0x3f')](_0x1117ac['where'],{'$or':_[_0x5808('0x2c')](_0x4f6342,function(_0x12a045){if(_0x12a045['type']!=='VIRTUAL'){var _0x477278={};_0x477278[_0x12a045['name']]={'$like':'%'+_0x28c1eb[_0x5808('0x32')][_0x5808('0x3e')]+'%'};return _0x477278;}})});}_0x1117ac=_[_0x5808('0x3f')]({},_0x1117ac,_0x28c1eb[_0x5808('0x40')]);var _0x21fc36={'where':_0x1117ac['where']};return db['Cdr'][_0x5808('0x1f')](_0x21fc36)[_0x5808('0x25')](function(_0x402b4e){_0x560e83['count']=_0x402b4e;if(_0x28c1eb[_0x5808('0x32')][_0x5808('0x41')]){_0x1117ac[_0x5808('0x42')]=[{'all':!![]}];}return db[_0x5808('0x2d')][_0x5808('0x43')](_0x1117ac);})['then'](function(_0x1130c8){_0x560e83[_0x5808('0x44')]=_0x1130c8;return _0x560e83;})[_0x5808('0x25')](respondWithFilteredResult(_0x19ac63,_0x1117ac))['catch'](handleError(_0x19ac63,null));};exports[_0x5808('0x45')]=function(_0x287e07,_0xc62608){var _0x5e1230={'raw':!![],'where':{'id':_0x287e07[_0x5808('0x46')]['id']}},_0x5dcb50={};_0x5dcb50[_0x5808('0x31')]=_[_0x5808('0x33')](db[_0x5808('0x2d')][_0x5808('0x47')]);_0x5dcb50[_0x5808('0x32')]=_[_0x5808('0x33')](_0x287e07[_0x5808('0x32')]);_0x5dcb50[_0x5808('0x3d')]=_[_0x5808('0x35')](_0x5dcb50[_0x5808('0x31')],_0x5dcb50[_0x5808('0x32')]);_0x5e1230[_0x5808('0x34')]=_['intersection'](_0x5dcb50['model'],qs[_0x5808('0x36')](_0x287e07[_0x5808('0x32')][_0x5808('0x36')]));_0x5e1230[_0x5808('0x34')]=_0x5e1230[_0x5808('0x34')][_0x5808('0x48')]?_0x5e1230[_0x5808('0x34')]:_0x5dcb50['model'];if(_0x287e07[_0x5808('0x32')]['includeAll']){_0x5e1230[_0x5808('0x42')]=[{'all':!![]}];}_0x5e1230=_['merge']({},_0x5e1230,_0x287e07[_0x5808('0x40')]);return db['Cdr']['find'](_0x5e1230)['then'](handleEntityNotFound(_0xc62608,null))[_0x5808('0x25')](respondWithResult(_0xc62608,null))[_0x5808('0x49')](handleError(_0xc62608,null));};exports['create']=function(_0x46c8ed,_0x4568d0){return db[_0x5808('0x2d')]['create'](_0x46c8ed[_0x5808('0x4a')],{})['then'](respondWithResult(_0x4568d0,0xc9))[_0x5808('0x49')](handleError(_0x4568d0,null));};exports[_0x5808('0x24')]=function(_0x13fe11,_0x5cc977){if(_0x13fe11[_0x5808('0x4a')]['id']){delete _0x13fe11[_0x5808('0x4a')]['id'];}return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x13fe11['params']['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x5cc977,null))[_0x5808('0x25')](saveUpdates(_0x13fe11[_0x5808('0x4a')],null))[_0x5808('0x25')](respondWithResult(_0x5cc977,null))[_0x5808('0x49')](handleError(_0x5cc977,null));};exports[_0x5808('0x26')]=function(_0x5572f3,_0x23d2fe){return db[_0x5808('0x2d')][_0x5808('0x4b')]({'where':{'id':_0x5572f3[_0x5808('0x46')]['id']}})[_0x5808('0x25')](handleEntityNotFound(_0x23d2fe,null))['then'](removeEntity(_0x23d2fe,null))[_0x5808('0x49')](handleError(_0x23d2fe,null));};exports[_0x5808('0x4c')]=function(_0xc2c5d7,_0x44ff0a){return db[_0x5808('0x2d')][_0x5808('0x4c')]()['then'](respondWithResult(_0x44ff0a,null))[_0x5808('0x49')](handleError(_0x44ff0a,null));};
\ No newline at end of file
+var _0xee14=['params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','Cdr','includeAll','include','findAll','rows','catch','find','create','body'];(function(_0x1b8689,_0x3df511){var _0x1a153e=function(_0x6d7e5c){while(--_0x6d7e5c){_0x1b8689['push'](_0x1b8689['shift']());}};_0x1a153e(++_0x3df511);}(_0xee14,0x13a));var _0x4ee1=function(_0x10eade,_0x176c3a){_0x10eade=_0x10eade-0x0;var _0x19ab06=_0xee14[_0x10eade];return _0x19ab06;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4ee1('0x0'));var jsonpatch=require(_0x4ee1('0x1'));var rp=require(_0x4ee1('0x2'));var moment=require(_0x4ee1('0x3'));var BPromise=require(_0x4ee1('0x4'));var Mustache=require(_0x4ee1('0x5'));var util=require(_0x4ee1('0x6'));var path=require(_0x4ee1('0x7'));var sox=require(_0x4ee1('0x8'));var csv=require('to-csv');var ejs=require(_0x4ee1('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x4ee1('0xa'));var squel=require(_0x4ee1('0xb'));var crypto=require(_0x4ee1('0xc'));var jsforce=require(_0x4ee1('0xd'));var deskjs=require(_0x4ee1('0xe'));var toCsv=require(_0x4ee1('0xf'));var querystring=require('querystring');var Papa=require(_0x4ee1('0x10'));var Redis=require(_0x4ee1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4ee1('0x12'));var as=require(_0x4ee1('0x13'));var hardwareService=require(_0x4ee1('0x14'));var logger=require(_0x4ee1('0x15'))('api');var utils=require(_0x4ee1('0x16'));var config=require(_0x4ee1('0x17'));var licenseUtil=require(_0x4ee1('0x18'));var db=require(_0x4ee1('0x19'))['db'];function respondWithStatusCode(_0x2f864e,_0x174427){_0x174427=_0x174427||0xcc;return function(_0x5616d6){if(_0x5616d6){return _0x2f864e[_0x4ee1('0x1a')](_0x174427);}return _0x2f864e[_0x4ee1('0x1b')](_0x174427)[_0x4ee1('0x1c')]();};}function respondWithResult(_0x24a915,_0x46d2c2){_0x46d2c2=_0x46d2c2||0xc8;return function(_0x1c342a){if(_0x1c342a){return _0x24a915[_0x4ee1('0x1b')](_0x46d2c2)[_0x4ee1('0x1d')](_0x1c342a);}};}function respondWithFilteredResult(_0xb7eafd,_0x4e3490){return function(_0x2f9194){if(_0x2f9194){var _0x38008f=typeof _0x4e3490[_0x4ee1('0x1e')]===_0x4ee1('0x1f')&&typeof _0x4e3490[_0x4ee1('0x20')]===_0x4ee1('0x1f');var _0x2eff91=_0x2f9194[_0x4ee1('0x21')];var _0x360056=_0x38008f?0x0:_0x4e3490[_0x4ee1('0x1e')];var _0x274de5=_0x38008f?_0x2f9194['count']:_0x4e3490[_0x4ee1('0x1e')]+_0x4e3490[_0x4ee1('0x20')];var _0x173388;if(_0x274de5>=_0x2eff91){_0x274de5=_0x2eff91;_0x173388=0xc8;}else{_0x173388=0xce;}_0xb7eafd[_0x4ee1('0x1b')](_0x173388);return _0xb7eafd[_0x4ee1('0x22')](_0x4ee1('0x23'),_0x360056+'-'+_0x274de5+'/'+_0x2eff91)['json'](_0x2f9194);}return null;};}function patchUpdates(_0x8a631f){return function(_0x333e96){try{jsonpatch[_0x4ee1('0x24')](_0x333e96,_0x8a631f,!![]);}catch(_0x3f0d59){return BPromise[_0x4ee1('0x25')](_0x3f0d59);}return _0x333e96[_0x4ee1('0x26')]();};}function saveUpdates(_0x328f21,_0x40fd98){return function(_0x1dc1a8){if(_0x1dc1a8){return _0x1dc1a8[_0x4ee1('0x27')](_0x328f21)['then'](function(_0x53d43f){return _0x53d43f;});}return null;};}function removeEntity(_0x14110c,_0x459e2e){return function(_0xaf87e7){if(_0xaf87e7){return _0xaf87e7[_0x4ee1('0x28')]()[_0x4ee1('0x29')](function(){_0x14110c[_0x4ee1('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5cc0b5,_0x442c71){return function(_0x28b7e1){if(!_0x28b7e1){_0x5cc0b5['sendStatus'](0x194);}return _0x28b7e1;};}function handleError(_0x35900d,_0x213db8){_0x213db8=_0x213db8||0x1f4;return function(_0x36654c){logger[_0x4ee1('0x2a')](_0x36654c[_0x4ee1('0x2b')]);if(_0x36654c[_0x4ee1('0x2c')]){delete _0x36654c[_0x4ee1('0x2c')];}_0x35900d['status'](_0x213db8)[_0x4ee1('0x2d')](_0x36654c);};}exports['index']=function(_0x4746c2,_0x4ec408){var _0x3dc870={},_0x1d91be={},_0x59a34e={'count':0x0,'rows':[]};var _0x13944c=_[_0x4ee1('0x2e')](db['Cdr'][_0x4ee1('0x2f')],function(_0x5b3792){return{'name':_0x5b3792[_0x4ee1('0x30')],'type':_0x5b3792[_0x4ee1('0x31')][_0x4ee1('0x32')]};});_0x1d91be[_0x4ee1('0x33')]=_[_0x4ee1('0x2e')](_0x13944c,'name');_0x1d91be[_0x4ee1('0x34')]=_[_0x4ee1('0x35')](_0x4746c2[_0x4ee1('0x34')]);_0x1d91be[_0x4ee1('0x36')]=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],_0x1d91be['query']);_0x3dc870['attributes']=_[_0x4ee1('0x37')](_0x1d91be[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x4746c2['query'][_0x4ee1('0x38')]));_0x3dc870[_0x4ee1('0x39')]=_0x3dc870[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x3dc870[_0x4ee1('0x39')]:_0x1d91be[_0x4ee1('0x33')];if(!_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3b')](_0x4ee1('0x3c'))){_0x3dc870[_0x4ee1('0x20')]=qs[_0x4ee1('0x20')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x20')]);_0x3dc870['offset']=qs[_0x4ee1('0x1e')](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x1e')]);}_0x3dc870['order']=qs['sort'](_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3d')]);_0x3dc870[_0x4ee1('0x3e')]=qs[_0x4ee1('0x36')](_['pick'](_0x4746c2[_0x4ee1('0x34')],_0x1d91be[_0x4ee1('0x36')]),_0x13944c);if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]){_0x3dc870[_0x4ee1('0x3e')]=_[_0x4ee1('0x40')](_0x3dc870[_0x4ee1('0x3e')],{'$or':_[_0x4ee1('0x2e')](_0x13944c,function(_0x59b5cc){if(_0x59b5cc[_0x4ee1('0x31')]!==_0x4ee1('0x41')){var _0x345003={};_0x345003[_0x59b5cc[_0x4ee1('0x2c')]]={'$like':'%'+_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x3f')]+'%'};return _0x345003;}})});}_0x3dc870=_['merge']({},_0x3dc870,_0x4746c2[_0x4ee1('0x42')]);var _0x37176a={'where':_0x3dc870[_0x4ee1('0x3e')]};return db[_0x4ee1('0x43')][_0x4ee1('0x21')](_0x37176a)[_0x4ee1('0x29')](function(_0x3f0d8b){_0x59a34e[_0x4ee1('0x21')]=_0x3f0d8b;if(_0x4746c2[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x3dc870[_0x4ee1('0x45')]=[{'all':!![]}];}return db[_0x4ee1('0x43')][_0x4ee1('0x46')](_0x3dc870);})['then'](function(_0x3b3bed){_0x59a34e[_0x4ee1('0x47')]=_0x3b3bed;return _0x59a34e;})['then'](respondWithFilteredResult(_0x4ec408,_0x3dc870))[_0x4ee1('0x48')](handleError(_0x4ec408,null));};exports['show']=function(_0x174167,_0x52ebc0){var _0x14c333={'raw':!![],'where':{'id':_0x174167['params']['id']}},_0xc7580c={};_0xc7580c[_0x4ee1('0x33')]=_[_0x4ee1('0x35')](db[_0x4ee1('0x43')][_0x4ee1('0x2f')]);_0xc7580c['query']=_[_0x4ee1('0x35')](_0x174167[_0x4ee1('0x34')]);_0xc7580c[_0x4ee1('0x36')]=_['intersection'](_0xc7580c['model'],_0xc7580c[_0x4ee1('0x34')]);_0x14c333[_0x4ee1('0x39')]=_[_0x4ee1('0x37')](_0xc7580c[_0x4ee1('0x33')],qs[_0x4ee1('0x38')](_0x174167['query']['fields']));_0x14c333[_0x4ee1('0x39')]=_0x14c333[_0x4ee1('0x39')][_0x4ee1('0x3a')]?_0x14c333[_0x4ee1('0x39')]:_0xc7580c['model'];if(_0x174167[_0x4ee1('0x34')][_0x4ee1('0x44')]){_0x14c333['include']=[{'all':!![]}];}_0x14c333=_[_0x4ee1('0x40')]({},_0x14c333,_0x174167[_0x4ee1('0x42')]);return db[_0x4ee1('0x43')][_0x4ee1('0x49')](_0x14c333)[_0x4ee1('0x29')](handleEntityNotFound(_0x52ebc0,null))[_0x4ee1('0x29')](respondWithResult(_0x52ebc0,null))[_0x4ee1('0x48')](handleError(_0x52ebc0,null));};exports[_0x4ee1('0x4a')]=function(_0x390051,_0x4ebb28){return db['Cdr'][_0x4ee1('0x4a')](_0x390051[_0x4ee1('0x4b')],{})[_0x4ee1('0x29')](respondWithResult(_0x4ebb28,0xc9))[_0x4ee1('0x48')](handleError(_0x4ebb28,null));};exports['update']=function(_0x35edf5,_0x3c66d1){if(_0x35edf5[_0x4ee1('0x4b')]['id']){delete _0x35edf5[_0x4ee1('0x4b')]['id'];}return db[_0x4ee1('0x43')]['find']({'where':{'id':_0x35edf5[_0x4ee1('0x4c')]['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x3c66d1,null))[_0x4ee1('0x29')](saveUpdates(_0x35edf5['body'],null))[_0x4ee1('0x29')](respondWithResult(_0x3c66d1,null))['catch'](handleError(_0x3c66d1,null));};exports[_0x4ee1('0x28')]=function(_0x5a1114,_0x30a1cd){return db['Cdr'][_0x4ee1('0x49')]({'where':{'id':_0x5a1114['params']['id']}})[_0x4ee1('0x29')](handleEntityNotFound(_0x30a1cd,null))[_0x4ee1('0x29')](removeEntity(_0x30a1cd,null))[_0x4ee1('0x48')](handleError(_0x30a1cd,null));};exports['describe']=function(_0x3368ed,_0x4118d7){return db[_0x4ee1('0x43')][_0x4ee1('0x4d')]()[_0x4ee1('0x29')](respondWithResult(_0x4118d7,null))[_0x4ee1('0x48')](handleError(_0x4118d7,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 14baa66..3eed475 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x1e2dc5,_0x4f7353){var _0x1d881d=function(_0x4e8ab4){while(--_0x4e8ab4){_0x1e2dc5['push'](_0x1e2dc5['shift']());}};_0x1d881d(++_0x4f7353);}(_0x9957,0x93));var _0x7995=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9957[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x438380,_0x15b3e7){var _0x50ba87=function(_0x4fa67d){while(--_0x4fa67d){_0x438380['push'](_0x438380['shift']());}};_0x50ba87(++_0x15b3e7);}(_0x7a54,0x106));var _0x47a5=function(_0x5502f0,_0x312d7f){_0x5502f0=_0x5502f0-0x0;var _0x5b84af=_0x7a54[_0x5502f0];return _0x5b84af;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index e10dbbc..abd4feb 100644
--- a/server/api/cdr/cdr.rpc.js
+++ b/server/api/cdr/cdr.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x59d4=['../../config/logger','../../config/environment','client','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4e0e8f,_0x1f9544){var _0x4f2799=function(_0x1637df){while(--_0x1637df){_0x4e0e8f['push'](_0x4e0e8f['shift']());}};_0x4f2799(++_0x1f9544);}(_0x59d4,0x1b1));var _0x459d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x59d4[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x459d('0x0'));var util=require(_0x459d('0x1'));var moment=require('moment');var BPromise=require(_0x459d('0x2'));var rs=require(_0x459d('0x3'));var fs=require('fs');var Redis=require(_0x459d('0x4'));var db=require(_0x459d('0x5'))['db'];var utils=require(_0x459d('0x6'));var logger=require(_0x459d('0x7'))('rpc');var config=require(_0x459d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x459d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9adc,_0x45c701,_0x19f1c3){return new BPromise(function(_0x390938,_0x4b6cbd){return client[_0x459d('0xa')](_0x1f9adc,_0x19f1c3)[_0x459d('0xb')](function(_0x5dd0a3){logger[_0x459d('0xc')](_0x459d('0xd'),_0x45c701,_0x459d('0xe'));logger[_0x459d('0xf')](_0x459d('0x10'),_0x45c701,_0x459d('0xe'),JSON[_0x459d('0x11')](_0x5dd0a3));if(_0x5dd0a3[_0x459d('0x12')]){if(_0x5dd0a3['error']['code']===0x1f4){logger[_0x459d('0x12')](_0x459d('0xd'),_0x45c701,_0x5dd0a3[_0x459d('0x12')][_0x459d('0x13')]);return _0x4b6cbd(_0x5dd0a3[_0x459d('0x12')][_0x459d('0x13')]);}logger[_0x459d('0x12')]('Cdr,\x20%s,\x20%s',_0x45c701,_0x5dd0a3[_0x459d('0x12')][_0x459d('0x13')]);return _0x390938(_0x5dd0a3[_0x459d('0x12')][_0x459d('0x13')]);}else{logger[_0x459d('0xc')](_0x459d('0xd'),_0x45c701,_0x459d('0xe'));_0x390938(_0x5dd0a3[_0x459d('0x14')][_0x459d('0x13')]);}})[_0x459d('0x15')](function(_0x2c2390){logger[_0x459d('0x12')](_0x459d('0xd'),_0x45c701,_0x2c2390);_0x4b6cbd(_0x2c2390);});});}
\ No newline at end of file
+var _0xab44=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x1f706a,_0x3b6032){var _0x190572=function(_0x47fbe0){while(--_0x47fbe0){_0x1f706a['push'](_0x1f706a['shift']());}};_0x190572(++_0x3b6032);}(_0xab44,0xcb));var _0x4ab4=function(_0x2cf042,_0x32342f){_0x2cf042=_0x2cf042-0x0;var _0x204543=_0xab44[_0x2cf042];return _0x204543;};'use strict';var _=require(_0x4ab4('0x0'));var util=require(_0x4ab4('0x1'));var moment=require(_0x4ab4('0x2'));var BPromise=require('bluebird');var rs=require(_0x4ab4('0x3'));var fs=require('fs');var Redis=require(_0x4ab4('0x4'));var db=require(_0x4ab4('0x5'))['db'];var utils=require(_0x4ab4('0x6'));var logger=require(_0x4ab4('0x7'))(_0x4ab4('0x8'));var config=require(_0x4ab4('0x9'));var jayson=require(_0x4ab4('0xa'));var client=jayson[_0x4ab4('0xb')][_0x4ab4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x20ed69,_0x1160db,_0x941b25){return new BPromise(function(_0x16d9a5,_0x468267){return client[_0x4ab4('0xd')](_0x20ed69,_0x941b25)[_0x4ab4('0xe')](function(_0x4fac5e){logger['info'](_0x4ab4('0xf'),_0x1160db,_0x4ab4('0x10'));logger[_0x4ab4('0x11')](_0x4ab4('0x12'),_0x1160db,_0x4ab4('0x10'),JSON[_0x4ab4('0x13')](_0x4fac5e));if(_0x4fac5e[_0x4ab4('0x14')]){if(_0x4fac5e[_0x4ab4('0x14')][_0x4ab4('0x15')]===0x1f4){logger[_0x4ab4('0x14')]('Cdr,\x20%s,\x20%s',_0x1160db,_0x4fac5e[_0x4ab4('0x14')][_0x4ab4('0x16')]);return _0x468267(_0x4fac5e[_0x4ab4('0x14')]['message']);}logger[_0x4ab4('0x14')](_0x4ab4('0xf'),_0x1160db,_0x4fac5e[_0x4ab4('0x14')][_0x4ab4('0x16')]);return _0x16d9a5(_0x4fac5e['error']['message']);}else{logger[_0x4ab4('0x17')](_0x4ab4('0xf'),_0x1160db,_0x4ab4('0x10'));_0x16d9a5(_0x4fac5e[_0x4ab4('0x18')][_0x4ab4('0x16')]);}})[_0x4ab4('0x19')](function(_0x46c71f){logger[_0x4ab4('0x14')](_0x4ab4('0xf'),_0x1160db,_0x46c71f);_0x468267(_0x46c71f);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 6285871..b11f7f7 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x25c2e9,_0x3d4f7d){var _0x3769b3=function(_0x5e0dd6){while(--_0x5e0dd6){_0x25c2e9['push'](_0x25c2e9['shift']());}};_0x3769b3(++_0x3d4f7d);}(_0xb10b,0x12a));var _0xbb10=function(_0x41da6,_0x42431b){_0x41da6=_0x41da6-0x0;var _0x282340=_0xb10b[_0x41da6];return _0x282340;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x1b8c71,_0x41d8ab){var _0x539905=function(_0x395edd){while(--_0x395edd){_0x1b8c71['push'](_0x1b8c71['shift']());}};_0x539905(++_0x41d8ab);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js
index 0904d15..84e50ad 100644
--- a/server/api/chatApplication/chatApplication.attributes.js
+++ b/server/api/chatApplication/chatApplication.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bc7=['INTEGER','STRING','noop','TEXT','*,*,*,*','sequelize'];(function(_0x22c291,_0xddc5ae){var _0x2bb430=function(_0x47eb52){while(--_0x47eb52){_0x22c291['push'](_0x22c291['shift']());}};_0x2bb430(++_0xddc5ae);}(_0x3bc7,0x95));var _0x73bc=function(_0x172ec3,_0x5e1d72){_0x172ec3=_0x172ec3-0x0;var _0x3d6538=_0x3bc7[_0x172ec3];return _0x3d6538;};'use strict';var Sequelize=require(_0x73bc('0x0'));module['exports']={'priority':{'type':Sequelize[_0x73bc('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x73bc('0x2')],'allowNull':![],'defaultValue':_0x73bc('0x3')},'appdata':{'type':Sequelize[_0x73bc('0x4')]()},'description':{'type':Sequelize[_0x73bc('0x2')]},'interval':{'type':Sequelize[_0x73bc('0x2')],'defaultValue':_0x73bc('0x5')}};
\ No newline at end of file
+var _0x8d59=['STRING','noop','TEXT','exports'];(function(_0x1af7ab,_0x39a461){var _0x211f82=function(_0x50975b){while(--_0x50975b){_0x1af7ab['push'](_0x1af7ab['shift']());}};_0x211f82(++_0x39a461);}(_0x8d59,0xab));var _0x98d5=function(_0x3305f1,_0x14ddc2){_0x3305f1=_0x3305f1-0x0;var _0x4d2661=_0x8d59[_0x3305f1];return _0x4d2661;};'use strict';var Sequelize=require('sequelize');module[_0x98d5('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x98d5('0x1')],'allowNull':![],'defaultValue':_0x98d5('0x2')},'appdata':{'type':Sequelize[_0x98d5('0x3')]()},'description':{'type':Sequelize[_0x98d5('0x1')]},'interval':{'type':Sequelize[_0x98d5('0x1')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index ea33760..37cb581 100644
--- a/server/api/chatApplication/chatApplication.controller.js
+++ b/server/api/chatApplication/chatApplication.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xc820=['save','update','then','destroy','sendStatus','name','send','show','model','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','ChatApplication','params','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','offset','limit','undefined','Content-Range','apply'];(function(_0x5180c3,_0x4b35f7){var _0x55c975=function(_0x4746cb){while(--_0x4746cb){_0x5180c3['push'](_0x5180c3['shift']());}};_0x55c975(++_0x4b35f7);}(_0xc820,0x13f));var _0x0c82=function(_0x1bbd90,_0x1fcc86){_0x1bbd90=_0x1bbd90-0x0;var _0x5eab8a=_0xc820[_0x1bbd90];return _0x5eab8a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0c82('0x0'));var zipdir=require(_0x0c82('0x1'));var jsonpatch=require(_0x0c82('0x2'));var rp=require(_0x0c82('0x3'));var moment=require(_0x0c82('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0c82('0x5'));var util=require('util');var path=require(_0x0c82('0x6'));var sox=require(_0x0c82('0x7'));var csv=require(_0x0c82('0x8'));var ejs=require(_0x0c82('0x9'));var fs=require('fs');var fs_extra=require(_0x0c82('0xa'));var _=require(_0x0c82('0xb'));var squel=require(_0x0c82('0xc'));var crypto=require(_0x0c82('0xd'));var jsforce=require(_0x0c82('0xe'));var deskjs=require(_0x0c82('0xf'));var toCsv=require(_0x0c82('0x8'));var querystring=require(_0x0c82('0x10'));var Papa=require(_0x0c82('0x11'));var Redis=require(_0x0c82('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x0c82('0x13'));var as=require(_0x0c82('0x14'));var hardwareService=require(_0x0c82('0x15'));var logger=require(_0x0c82('0x16'))(_0x0c82('0x17'));var utils=require(_0x0c82('0x18'));var config=require(_0x0c82('0x19'));var licenseUtil=require(_0x0c82('0x1a'));var db=require(_0x0c82('0x1b'))['db'];function respondWithStatusCode(_0x1e8188,_0x505706){_0x505706=_0x505706||0xcc;return function(_0xc9a01b){if(_0xc9a01b){return _0x1e8188['sendStatus'](_0x505706);}return _0x1e8188['status'](_0x505706)[_0x0c82('0x1c')]();};}function respondWithResult(_0x9074e7,_0x3e1ff8){_0x3e1ff8=_0x3e1ff8||0xc8;return function(_0x1bf511){if(_0x1bf511){return _0x9074e7[_0x0c82('0x1d')](_0x3e1ff8)['json'](_0x1bf511);}};}function respondWithFilteredResult(_0x4610e5,_0x17376c){return function(_0x693427){if(_0x693427){var _0x54caf2=typeof _0x17376c[_0x0c82('0x1e')]==='undefined'&&typeof _0x17376c[_0x0c82('0x1f')]===_0x0c82('0x20');var _0xc12162=_0x693427['count'];var _0x53d28f=_0x54caf2?0x0:_0x17376c[_0x0c82('0x1e')];var _0x3dbfd1=_0x54caf2?_0x693427['count']:_0x17376c[_0x0c82('0x1e')]+_0x17376c['limit'];var _0x2f8ecb;if(_0x3dbfd1>=_0xc12162){_0x3dbfd1=_0xc12162;_0x2f8ecb=0xc8;}else{_0x2f8ecb=0xce;}_0x4610e5[_0x0c82('0x1d')](_0x2f8ecb);return _0x4610e5['set'](_0x0c82('0x21'),_0x53d28f+'-'+_0x3dbfd1+'/'+_0xc12162)['json'](_0x693427);}return null;};}function patchUpdates(_0x3ec9aa){return function(_0x55e106){try{jsonpatch[_0x0c82('0x22')](_0x55e106,_0x3ec9aa,!![]);}catch(_0x13a61d){return BPromise['reject'](_0x13a61d);}return _0x55e106[_0x0c82('0x23')]();};}function saveUpdates(_0x1eb3d3,_0x8a6e02){return function(_0x4a4a04){if(_0x4a4a04){return _0x4a4a04[_0x0c82('0x24')](_0x1eb3d3)[_0x0c82('0x25')](function(_0xaa834){return _0xaa834;});}return null;};}function removeEntity(_0x1d2691,_0x514993){return function(_0x2bcc7f){if(_0x2bcc7f){return _0x2bcc7f[_0x0c82('0x26')]()[_0x0c82('0x25')](function(){_0x1d2691[_0x0c82('0x1d')](0xcc)[_0x0c82('0x1c')]();});}};}function handleEntityNotFound(_0x1ba2bd,_0x807d12){return function(_0x590553){if(!_0x590553){_0x1ba2bd[_0x0c82('0x27')](0x194);}return _0x590553;};}function handleError(_0x1c29f9,_0x4e7f33){_0x4e7f33=_0x4e7f33||0x1f4;return function(_0x17031f){logger['error'](_0x17031f['stack']);if(_0x17031f[_0x0c82('0x28')]){delete _0x17031f[_0x0c82('0x28')];}_0x1c29f9[_0x0c82('0x1d')](_0x4e7f33)[_0x0c82('0x29')](_0x17031f);};}exports[_0x0c82('0x2a')]=function(_0x16e074,_0x4c58e1){var _0x206283={'raw':!![],'where':{'id':_0x16e074['params']['id']}},_0x5ab0c7={};_0x5ab0c7[_0x0c82('0x2b')]=_['keys'](db['ChatApplication'][_0x0c82('0x2c')]);_0x5ab0c7['query']=_['keys'](_0x16e074[_0x0c82('0x2d')]);_0x5ab0c7[_0x0c82('0x2e')]=_[_0x0c82('0x2f')](_0x5ab0c7[_0x0c82('0x2b')],_0x5ab0c7[_0x0c82('0x2d')]);_0x206283[_0x0c82('0x30')]=_[_0x0c82('0x2f')](_0x5ab0c7[_0x0c82('0x2b')],qs[_0x0c82('0x31')](_0x16e074[_0x0c82('0x2d')][_0x0c82('0x31')]));_0x206283[_0x0c82('0x30')]=_0x206283['attributes']['length']?_0x206283[_0x0c82('0x30')]:_0x5ab0c7[_0x0c82('0x2b')];if(_0x16e074[_0x0c82('0x2d')][_0x0c82('0x32')]){_0x206283[_0x0c82('0x33')]=[{'all':!![]}];}_0x206283=_[_0x0c82('0x34')]({},_0x206283,_0x16e074[_0x0c82('0x35')]);return db['ChatApplication'][_0x0c82('0x36')](_0x206283)[_0x0c82('0x25')](handleEntityNotFound(_0x4c58e1,null))['then'](respondWithResult(_0x4c58e1,null))[_0x0c82('0x37')](handleError(_0x4c58e1,null));};exports['update']=function(_0x4f4303,_0x14c044){if(_0x4f4303['body']['id']){delete _0x4f4303['body']['id'];}return db[_0x0c82('0x38')][_0x0c82('0x36')]({'where':{'id':_0x4f4303[_0x0c82('0x39')]['id']}})[_0x0c82('0x25')](handleEntityNotFound(_0x14c044,null))[_0x0c82('0x25')](saveUpdates(_0x4f4303[_0x0c82('0x3a')],null))['then'](respondWithResult(_0x14c044,null))['catch'](handleError(_0x14c044,null));};exports[_0x0c82('0x26')]=function(_0x32597d,_0x3ad3a7){return db['ChatApplication'][_0x0c82('0x36')]({'where':{'id':_0x32597d[_0x0c82('0x39')]['id']}})['then'](handleEntityNotFound(_0x3ad3a7,null))[_0x0c82('0x25')](removeEntity(_0x3ad3a7,null))[_0x0c82('0x37')](handleError(_0x3ad3a7,null));};
\ No newline at end of file
+var _0x49ac=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','count','set','Content-Range','reject','update','destroy','error','stack','name','params','model','ChatApplication','rawAttributes','keys','query','attributes','intersection','fields','length','include','find','then','catch','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse'];(function(_0x9e3125,_0x58a28a){var _0x1c433b=function(_0x4e961a){while(--_0x4e961a){_0x9e3125['push'](_0x9e3125['shift']());}};_0x1c433b(++_0x58a28a);}(_0x49ac,0x19e));var _0xc49a=function(_0x2af053,_0x4f6d28){_0x2af053=_0x2af053-0x0;var _0x4b4001=_0x49ac[_0x2af053];return _0x4b4001;};'use strict';var emlformat=require(_0xc49a('0x0'));var rimraf=require(_0xc49a('0x1'));var zipdir=require(_0xc49a('0x2'));var jsonpatch=require(_0xc49a('0x3'));var rp=require(_0xc49a('0x4'));var moment=require(_0xc49a('0x5'));var BPromise=require(_0xc49a('0x6'));var Mustache=require(_0xc49a('0x7'));var util=require(_0xc49a('0x8'));var path=require(_0xc49a('0x9'));var sox=require(_0xc49a('0xa'));var csv=require('to-csv');var ejs=require(_0xc49a('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc49a('0xc'));var squel=require(_0xc49a('0xd'));var crypto=require(_0xc49a('0xe'));var jsforce=require(_0xc49a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xc49a('0x10'));var querystring=require('querystring');var Papa=require(_0xc49a('0x11'));var Redis=require('ioredis');var authService=require(_0xc49a('0x12'));var qs=require(_0xc49a('0x13'));var as=require(_0xc49a('0x14'));var hardwareService=require(_0xc49a('0x15'));var logger=require(_0xc49a('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xc49a('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xc49a('0x18'))['db'];function respondWithStatusCode(_0x3fe60b,_0x5a656c){_0x5a656c=_0x5a656c||0xcc;return function(_0x18b30e){if(_0x18b30e){return _0x3fe60b[_0xc49a('0x19')](_0x5a656c);}return _0x3fe60b[_0xc49a('0x1a')](_0x5a656c)['end']();};}function respondWithResult(_0x5dff88,_0x5872fc){_0x5872fc=_0x5872fc||0xc8;return function(_0x2e3519){if(_0x2e3519){return _0x5dff88[_0xc49a('0x1a')](_0x5872fc)[_0xc49a('0x1b')](_0x2e3519);}};}function respondWithFilteredResult(_0x14dd30,_0x45d5d1){return function(_0x33e530){if(_0x33e530){var _0xbb89d0=typeof _0x45d5d1[_0xc49a('0x1c')]==='undefined'&&typeof _0x45d5d1[_0xc49a('0x1d')]==='undefined';var _0x4e4228=_0x33e530[_0xc49a('0x1e')];var _0x34a424=_0xbb89d0?0x0:_0x45d5d1[_0xc49a('0x1c')];var _0x189400=_0xbb89d0?_0x33e530[_0xc49a('0x1e')]:_0x45d5d1[_0xc49a('0x1c')]+_0x45d5d1[_0xc49a('0x1d')];var _0x329811;if(_0x189400>=_0x4e4228){_0x189400=_0x4e4228;_0x329811=0xc8;}else{_0x329811=0xce;}_0x14dd30['status'](_0x329811);return _0x14dd30[_0xc49a('0x1f')](_0xc49a('0x20'),_0x34a424+'-'+_0x189400+'/'+_0x4e4228)[_0xc49a('0x1b')](_0x33e530);}return null;};}function patchUpdates(_0x302d31){return function(_0xc1d93c){try{jsonpatch['apply'](_0xc1d93c,_0x302d31,!![]);}catch(_0xefd77c){return BPromise[_0xc49a('0x21')](_0xefd77c);}return _0xc1d93c['save']();};}function saveUpdates(_0x3ffbcd,_0x230b19){return function(_0x8e95d){if(_0x8e95d){return _0x8e95d[_0xc49a('0x22')](_0x3ffbcd)['then'](function(_0x2e1c1e){return _0x2e1c1e;});}return null;};}function removeEntity(_0xf0dd34,_0x1d08c6){return function(_0x2e7061){if(_0x2e7061){return _0x2e7061[_0xc49a('0x23')]()['then'](function(){_0xf0dd34[_0xc49a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x502591,_0x4096c5){return function(_0x41e0dc){if(!_0x41e0dc){_0x502591[_0xc49a('0x19')](0x194);}return _0x41e0dc;};}function handleError(_0x2fcafb,_0x10ca48){_0x10ca48=_0x10ca48||0x1f4;return function(_0x4130b5){logger[_0xc49a('0x24')](_0x4130b5[_0xc49a('0x25')]);if(_0x4130b5['name']){delete _0x4130b5[_0xc49a('0x26')];}_0x2fcafb[_0xc49a('0x1a')](_0x10ca48)['send'](_0x4130b5);};}exports['show']=function(_0x50a40c,_0x3f68ba){var _0x189249={'raw':!![],'where':{'id':_0x50a40c[_0xc49a('0x27')]['id']}},_0x5e079c={};_0x5e079c[_0xc49a('0x28')]=_['keys'](db[_0xc49a('0x29')][_0xc49a('0x2a')]);_0x5e079c['query']=_[_0xc49a('0x2b')](_0x50a40c[_0xc49a('0x2c')]);_0x5e079c['filters']=_['intersection'](_0x5e079c['model'],_0x5e079c[_0xc49a('0x2c')]);_0x189249[_0xc49a('0x2d')]=_[_0xc49a('0x2e')](_0x5e079c[_0xc49a('0x28')],qs['fields'](_0x50a40c['query'][_0xc49a('0x2f')]));_0x189249[_0xc49a('0x2d')]=_0x189249[_0xc49a('0x2d')][_0xc49a('0x30')]?_0x189249[_0xc49a('0x2d')]:_0x5e079c['model'];if(_0x50a40c[_0xc49a('0x2c')]['includeAll']){_0x189249[_0xc49a('0x31')]=[{'all':!![]}];}_0x189249=_['merge']({},_0x189249,_0x50a40c['options']);return db[_0xc49a('0x29')][_0xc49a('0x32')](_0x189249)[_0xc49a('0x33')](handleEntityNotFound(_0x3f68ba,null))['then'](respondWithResult(_0x3f68ba,null))[_0xc49a('0x34')](handleError(_0x3f68ba,null));};exports['update']=function(_0x568eb6,_0x409f7e){if(_0x568eb6['body']['id']){delete _0x568eb6[_0xc49a('0x35')]['id'];}return db['ChatApplication'][_0xc49a('0x32')]({'where':{'id':_0x568eb6['params']['id']}})[_0xc49a('0x33')](handleEntityNotFound(_0x409f7e,null))[_0xc49a('0x33')](saveUpdates(_0x568eb6[_0xc49a('0x35')],null))[_0xc49a('0x33')](respondWithResult(_0x409f7e,null))[_0xc49a('0x34')](handleError(_0x409f7e,null));};exports[_0xc49a('0x23')]=function(_0x2ca27e,_0x1e7a64){return db[_0xc49a('0x29')][_0xc49a('0x32')]({'where':{'id':_0x2ca27e[_0xc49a('0x27')]['id']}})['then'](handleEntityNotFound(_0x1e7a64,null))[_0xc49a('0x33')](removeEntity(_0x1e7a64,null))[_0xc49a('0x34')](handleError(_0x1e7a64,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 55fe8aa..08ff3fa 100644
--- a/server/api/chatApplication/chatApplication.model.js
+++ b/server/api/chatApplication/chatApplication.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6149=['request-promise','path','rimraf','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','../../config/logger','moment','bluebird'];(function(_0x369151,_0x179f72){var _0x4292d5=function(_0x330422){while(--_0x330422){_0x369151['push'](_0x369151['shift']());}};_0x4292d5(++_0x179f72);}(_0x6149,0x165));var _0x9614=function(_0x39627c,_0x9f634c){_0x39627c=_0x39627c-0x0;var _0x7d31fd=_0x6149[_0x39627c];return _0x7d31fd;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9614('0x0'))('api');var moment=require(_0x9614('0x1'));var BPromise=require(_0x9614('0x2'));var rp=require(_0x9614('0x3'));var fs=require('fs');var path=require(_0x9614('0x4'));var rimraf=require(_0x9614('0x5'));var config=require('../../config/environment');var attributes=require(_0x9614('0x6'));module[_0x9614('0x7')]=function(_0x2db4c2,_0x5786e2){return _0x2db4c2[_0x9614('0x8')](_0x9614('0x9'),attributes,{'tableName':_0x9614('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9614('0xb')});};
\ No newline at end of file
+var _0xdd04=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','ChatApplication','chat_applications','utf8mb4'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xdd04,0xde));var _0x4dd0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdd04[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4dd0('0x0'));var logger=require(_0x4dd0('0x1'))(_0x4dd0('0x2'));var moment=require(_0x4dd0('0x3'));var BPromise=require(_0x4dd0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4dd0('0x5'));var rimraf=require(_0x4dd0('0x6'));var config=require(_0x4dd0('0x7'));var attributes=require('./chatApplication.attributes');module[_0x4dd0('0x8')]=function(_0x35d489,_0x12bb71){return _0x35d489['define'](_0x4dd0('0x9'),attributes,{'tableName':_0x4dd0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4dd0('0xb'),'collate':_0x4dd0('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 7f6cd52..bcfbb2b 100644
--- a/server/api/chatApplication/chatApplication.rpc.js
+++ b/server/api/chatApplication/chatApplication.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe852=['code','message','result','catch','lodash','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x24032a,_0x5ae490){var _0x4ed184=function(_0x5a837e){while(--_0x5a837e){_0x24032a['push'](_0x24032a['shift']());}};_0x4ed184(++_0x5ae490);}(_0xe852,0x15a));var _0x2e85=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xe852[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x2e85('0x0'));var util=require('util');var moment=require(_0x2e85('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2e85('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2e85('0x3'));var logger=require(_0x2e85('0x4'))(_0x2e85('0x5'));var config=require(_0x2e85('0x6'));var jayson=require(_0x2e85('0x7'));var client=jayson[_0x2e85('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x31ec20,_0x1f068e,_0x59e36b){return new BPromise(function(_0x2b324b,_0x4855fc){return client[_0x2e85('0x9')](_0x31ec20,_0x59e36b)['then'](function(_0x2694d4){logger[_0x2e85('0xa')](_0x2e85('0xb'),_0x1f068e,_0x2e85('0xc'));logger['debug']('ChatApplication,\x20%s,\x20%s,\x20%s',_0x1f068e,_0x2e85('0xc'),JSON[_0x2e85('0xd')](_0x2694d4));if(_0x2694d4[_0x2e85('0xe')]){if(_0x2694d4['error'][_0x2e85('0xf')]===0x1f4){logger[_0x2e85('0xe')](_0x2e85('0xb'),_0x1f068e,_0x2694d4['error'][_0x2e85('0x10')]);return _0x4855fc(_0x2694d4[_0x2e85('0xe')][_0x2e85('0x10')]);}logger[_0x2e85('0xe')](_0x2e85('0xb'),_0x1f068e,_0x2694d4[_0x2e85('0xe')][_0x2e85('0x10')]);return _0x2b324b(_0x2694d4[_0x2e85('0xe')][_0x2e85('0x10')]);}else{logger[_0x2e85('0xa')]('ChatApplication,\x20%s,\x20%s',_0x1f068e,_0x2e85('0xc'));_0x2b324b(_0x2694d4[_0x2e85('0x11')][_0x2e85('0x10')]);}})[_0x2e85('0x12')](function(_0x32fe99){logger[_0x2e85('0xe')](_0x2e85('0xb'),_0x1f068e,_0x32fe99);_0x4855fc(_0x32fe99);});});}
\ No newline at end of file
+var _0xa784=['then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request'];(function(_0x3a6382,_0x212303){var _0x36370e=function(_0x377f21){while(--_0x377f21){_0x3a6382['push'](_0x3a6382['shift']());}};_0x36370e(++_0x212303);}(_0xa784,0x106));var _0x4a78=function(_0x456b3d,_0x2c8742){_0x456b3d=_0x456b3d-0x0;var _0x3b5ca1=_0xa784[_0x456b3d];return _0x3b5ca1;};'use strict';var _=require(_0x4a78('0x0'));var util=require(_0x4a78('0x1'));var moment=require('moment');var BPromise=require(_0x4a78('0x2'));var rs=require(_0x4a78('0x3'));var fs=require('fs');var Redis=require(_0x4a78('0x4'));var db=require(_0x4a78('0x5'))['db'];var utils=require(_0x4a78('0x6'));var logger=require(_0x4a78('0x7'))(_0x4a78('0x8'));var config=require('../../config/environment');var jayson=require(_0x4a78('0x9'));var client=jayson[_0x4a78('0xa')][_0x4a78('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x28c434,_0x2d3f80,_0x101cdb){return new BPromise(function(_0x86ae4e,_0x343ea8){return client[_0x4a78('0xc')](_0x28c434,_0x101cdb)[_0x4a78('0xd')](function(_0x17b3c6){logger[_0x4a78('0xe')]('ChatApplication,\x20%s,\x20%s',_0x2d3f80,_0x4a78('0xf'));logger[_0x4a78('0x10')](_0x4a78('0x11'),_0x2d3f80,_0x4a78('0xf'),JSON[_0x4a78('0x12')](_0x17b3c6));if(_0x17b3c6[_0x4a78('0x13')]){if(_0x17b3c6[_0x4a78('0x13')][_0x4a78('0x14')]===0x1f4){logger[_0x4a78('0x13')](_0x4a78('0x15'),_0x2d3f80,_0x17b3c6['error']['message']);return _0x343ea8(_0x17b3c6['error'][_0x4a78('0x16')]);}logger['error'](_0x4a78('0x15'),_0x2d3f80,_0x17b3c6[_0x4a78('0x13')][_0x4a78('0x16')]);return _0x86ae4e(_0x17b3c6[_0x4a78('0x13')]['message']);}else{logger[_0x4a78('0xe')](_0x4a78('0x15'),_0x2d3f80,_0x4a78('0xf'));_0x86ae4e(_0x17b3c6[_0x4a78('0x17')][_0x4a78('0x16')]);}})[_0x4a78('0x18')](function(_0x17a969){logger[_0x4a78('0x13')](_0x4a78('0x15'),_0x2d3f80,_0x17a969);_0x343ea8(_0x17a969);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index c37f4b5..42f3a2e 100644
--- a/server/api/chatApplication/index.js
+++ b/server/api/chatApplication/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2ded=['/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','show','put'];(function(_0x2485b9,_0xd499c9){var _0x262a7d=function(_0x146fc4){while(--_0x146fc4){_0x2485b9['push'](_0x2485b9['shift']());}};_0x262a7d(++_0xd499c9);}(_0x2ded,0xde));var _0xd2de=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2ded[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd2de('0x0'));var util=require(_0xd2de('0x1'));var path=require(_0xd2de('0x2'));var timeout=require('connect-timeout');var express=require(_0xd2de('0x3'));var router=express[_0xd2de('0x4')]();var fs_extra=require(_0xd2de('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xd2de('0x6'));var config=require(_0xd2de('0x7'));var controller=require(_0xd2de('0x8'));router[_0xd2de('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xd2de('0xa')]);router[_0xd2de('0xb')](_0xd2de('0xc'),auth[_0xd2de('0xd')](),controller[_0xd2de('0xe')]);router[_0xd2de('0xf')](_0xd2de('0xc'),auth[_0xd2de('0xd')](),controller[_0xd2de('0x10')]);module[_0xd2de('0x11')]=router;
\ No newline at end of file
+var _0xca11=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','path','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get'];(function(_0x45a611,_0x5579d0){var _0x23b017=function(_0x5eaf72){while(--_0x5eaf72){_0x45a611['push'](_0x45a611['shift']());}};_0x23b017(++_0x5579d0);}(_0xca11,0xb2));var _0x1ca1=function(_0x4d4149,_0x1595d1){_0x4d4149=_0x4d4149-0x0;var _0x3e12e2=_0xca11[_0x4d4149];return _0x3e12e2;};'use strict';var multer=require(_0x1ca1('0x0'));var util=require('util');var path=require(_0x1ca1('0x1'));var timeout=require('connect-timeout');var express=require(_0x1ca1('0x2'));var router=express[_0x1ca1('0x3')]();var fs_extra=require(_0x1ca1('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x1ca1('0x5'));var config=require(_0x1ca1('0x6'));var controller=require(_0x1ca1('0x7'));router[_0x1ca1('0x8')](_0x1ca1('0x9'),auth[_0x1ca1('0xa')](),controller[_0x1ca1('0xb')]);router[_0x1ca1('0xc')](_0x1ca1('0x9'),auth[_0x1ca1('0xa')](),controller[_0x1ca1('0xd')]);router[_0x1ca1('0xe')](_0x1ca1('0x9'),auth[_0x1ca1('0xa')](),controller[_0x1ca1('0xf')]);module[_0x1ca1('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 173dad0..14f84cc 100644
--- a/server/api/chatGroup/chatGroup.attributes.js
+++ b/server/api/chatGroup/chatGroup.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5ff9=['sequelize','exports','STRING','BOOLEAN'];(function(_0x41b52f,_0x2741c6){var _0x5957da=function(_0x598b21){while(--_0x598b21){_0x41b52f['push'](_0x41b52f['shift']());}};_0x5957da(++_0x2741c6);}(_0x5ff9,0xa0));var _0x95ff=function(_0x514039,_0x40c05b){_0x514039=_0x514039-0x0;var _0x492b6b=_0x5ff9[_0x514039];return _0x492b6b;};'use strict';var Sequelize=require(_0x95ff('0x0'));module[_0x95ff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x95ff('0x2')]},'write':{'type':Sequelize[_0x95ff('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xf194=['exports','STRING','BOOLEAN'];(function(_0x27badd,_0x5c094a){var _0x36eb0a=function(_0xa0de58){while(--_0xa0de58){_0x27badd['push'](_0x27badd['shift']());}};_0x36eb0a(++_0x5c094a);}(_0xf194,0x19b));var _0x4f19=function(_0x2d65d0,_0x42a091){_0x2d65d0=_0x2d65d0-0x0;var _0x51ea74=_0xf194[_0x2d65d0];return _0x51ea74;};'use strict';var Sequelize=require('sequelize');module[_0x4f19('0x0')]={'name':{'type':Sequelize[_0x4f19('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x4f19('0x1')]},'write':{'type':Sequelize[_0x4f19('0x2')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 42feca4..f8d5369 100644
--- a/server/api/chatGroup/chatGroup.controller.js
+++ b/server/api/chatGroup/chatGroup.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0773=['removeMembers','addMessage','getMessages','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','./chatGroup.socket','register','sendStatus','status','end','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatGroup','includeAll','include','rows','show','params','find','create','catch','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','ids','getMembers','findOne','User'];(function(_0x586115,_0x283bd2){var _0x221bac=function(_0x2f1aed){while(--_0x2f1aed){_0x586115['push'](_0x586115['shift']());}};_0x221bac(++_0x283bd2);}(_0x0773,0x12d));var _0x3077=function(_0x14086d,_0x26c278){_0x14086d=_0x14086d-0x0;var _0x48c470=_0x0773[_0x14086d];return _0x48c470;};'use strict';var emlformat=require(_0x3077('0x0'));var rimraf=require(_0x3077('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3077('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3077('0x3'));var Mustache=require(_0x3077('0x4'));var util=require(_0x3077('0x5'));var path=require(_0x3077('0x6'));var sox=require(_0x3077('0x7'));var csv=require(_0x3077('0x8'));var ejs=require(_0x3077('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3077('0xa'));var squel=require(_0x3077('0xb'));var crypto=require(_0x3077('0xc'));var jsforce=require(_0x3077('0xd'));var deskjs=require(_0x3077('0xe'));var toCsv=require(_0x3077('0x8'));var querystring=require(_0x3077('0xf'));var Papa=require(_0x3077('0x10'));var Redis=require('ioredis');var authService=require(_0x3077('0x11'));var qs=require(_0x3077('0x12'));var as=require(_0x3077('0x13'));var hardwareService=require(_0x3077('0x14'));var logger=require(_0x3077('0x15'))(_0x3077('0x16'));var utils=require('../../config/utils');var config=require(_0x3077('0x17'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];config[_0x3077('0x18')]=_[_0x3077('0x19')](config[_0x3077('0x18')],{'host':_0x3077('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3077('0x18')]));require(_0x3077('0x1b'))[_0x3077('0x1c')](socket);function respondWithStatusCode(_0x28be17,_0x2af731){_0x2af731=_0x2af731||0xcc;return function(_0x2e68d9){if(_0x2e68d9){return _0x28be17[_0x3077('0x1d')](_0x2af731);}return _0x28be17[_0x3077('0x1e')](_0x2af731)[_0x3077('0x1f')]();};}function respondWithResult(_0x1c98a8,_0x4a1d29){_0x4a1d29=_0x4a1d29||0xc8;return function(_0x394a7f){if(_0x394a7f){return _0x1c98a8[_0x3077('0x1e')](_0x4a1d29)[_0x3077('0x20')](_0x394a7f);}};}function respondWithFilteredResult(_0x451f81,_0x29c910){return function(_0x2f4b98){if(_0x2f4b98){var _0x5bcb3d=typeof _0x29c910[_0x3077('0x21')]===_0x3077('0x22')&&typeof _0x29c910['limit']===_0x3077('0x22');var _0x474499=_0x2f4b98[_0x3077('0x23')];var _0xd81168=_0x5bcb3d?0x0:_0x29c910[_0x3077('0x21')];var _0x3fc2ba=_0x5bcb3d?_0x2f4b98[_0x3077('0x23')]:_0x29c910['offset']+_0x29c910[_0x3077('0x24')];var _0x9df460;if(_0x3fc2ba>=_0x474499){_0x3fc2ba=_0x474499;_0x9df460=0xc8;}else{_0x9df460=0xce;}_0x451f81['status'](_0x9df460);return _0x451f81['set']('Content-Range',_0xd81168+'-'+_0x3fc2ba+'/'+_0x474499)['json'](_0x2f4b98);}return null;};}function patchUpdates(_0x75eaa){return function(_0x177254){try{jsonpatch[_0x3077('0x25')](_0x177254,_0x75eaa,!![]);}catch(_0x3bb171){return BPromise[_0x3077('0x26')](_0x3bb171);}return _0x177254[_0x3077('0x27')]();};}function saveUpdates(_0xed1020,_0x171033){return function(_0x5bab40){if(_0x5bab40){return _0x5bab40[_0x3077('0x28')](_0xed1020)[_0x3077('0x29')](function(_0x486725){return _0x486725;});}return null;};}function removeEntity(_0x4e1afc,_0x364527){return function(_0x3c3064){if(_0x3c3064){return _0x3c3064[_0x3077('0x2a')]()[_0x3077('0x29')](function(){_0x4e1afc[_0x3077('0x1e')](0xcc)[_0x3077('0x1f')]();});}};}function handleEntityNotFound(_0x7945a9,_0x6e8101){return function(_0xbcc741){if(!_0xbcc741){_0x7945a9['sendStatus'](0x194);}return _0xbcc741;};}function handleError(_0x1c2731,_0x3c2dc8){_0x3c2dc8=_0x3c2dc8||0x1f4;return function(_0x2f4f77){logger['error'](_0x2f4f77[_0x3077('0x2b')]);if(_0x2f4f77[_0x3077('0x2c')]){delete _0x2f4f77[_0x3077('0x2c')];}_0x1c2731[_0x3077('0x1e')](_0x3c2dc8)[_0x3077('0x2d')](_0x2f4f77);};}exports[_0x3077('0x2e')]=function(_0x5d96aa,_0x578514){var _0xe04264={},_0x8d34dc={},_0x336f67={'count':0x0,'rows':[]};var _0x8e68a9=_[_0x3077('0x2f')](db['ChatGroup'][_0x3077('0x30')],function(_0x156c04){return{'name':_0x156c04[_0x3077('0x31')],'type':_0x156c04['type'][_0x3077('0x32')]};});_0x8d34dc[_0x3077('0x33')]=_[_0x3077('0x2f')](_0x8e68a9,_0x3077('0x2c'));_0x8d34dc[_0x3077('0x34')]=_[_0x3077('0x35')](_0x5d96aa[_0x3077('0x34')]);_0x8d34dc[_0x3077('0x36')]=_[_0x3077('0x37')](_0x8d34dc['model'],_0x8d34dc[_0x3077('0x34')]);_0xe04264[_0x3077('0x38')]=_[_0x3077('0x37')](_0x8d34dc['model'],qs[_0x3077('0x39')](_0x5d96aa[_0x3077('0x34')][_0x3077('0x39')]));_0xe04264[_0x3077('0x38')]=_0xe04264[_0x3077('0x38')][_0x3077('0x3a')]?_0xe04264[_0x3077('0x38')]:_0x8d34dc[_0x3077('0x33')];if(!_0x5d96aa[_0x3077('0x34')][_0x3077('0x3b')](_0x3077('0x3c'))){_0xe04264[_0x3077('0x24')]=qs[_0x3077('0x24')](_0x5d96aa[_0x3077('0x34')]['limit']);_0xe04264[_0x3077('0x21')]=qs[_0x3077('0x21')](_0x5d96aa[_0x3077('0x34')]['offset']);}_0xe04264[_0x3077('0x3d')]=qs[_0x3077('0x3e')](_0x5d96aa[_0x3077('0x34')][_0x3077('0x3e')]);_0xe04264[_0x3077('0x3f')]=qs['filters'](_[_0x3077('0x40')](_0x5d96aa['query'],_0x8d34dc['filters']),_0x8e68a9);if(_0x5d96aa[_0x3077('0x34')][_0x3077('0x41')]){_0xe04264[_0x3077('0x3f')]=_[_0x3077('0x42')](_0xe04264['where'],{'$or':_['map'](_0x8e68a9,function(_0x293423){if(_0x293423[_0x3077('0x43')]!==_0x3077('0x44')){var _0x479dc9={};_0x479dc9[_0x293423[_0x3077('0x2c')]]={'$like':'%'+_0x5d96aa[_0x3077('0x34')][_0x3077('0x41')]+'%'};return _0x479dc9;}})});}_0xe04264=_[_0x3077('0x42')]({},_0xe04264,_0x5d96aa[_0x3077('0x45')]);var _0xca7342={'where':_0xe04264['where']};return db[_0x3077('0x46')]['count'](_0xca7342)[_0x3077('0x29')](function(_0xd09e1){_0x336f67[_0x3077('0x23')]=_0xd09e1;if(_0x5d96aa['query'][_0x3077('0x47')]){_0xe04264[_0x3077('0x48')]=[{'all':!![]}];}return db[_0x3077('0x46')]['findAll'](_0xe04264);})[_0x3077('0x29')](function(_0x2f114c){_0x336f67[_0x3077('0x49')]=_0x2f114c;return _0x336f67;})[_0x3077('0x29')](respondWithFilteredResult(_0x578514,_0xe04264))['catch'](handleError(_0x578514,null));};exports[_0x3077('0x4a')]=function(_0x467638,_0x5b75e3){var _0x289049={'raw':!![],'where':{'id':_0x467638[_0x3077('0x4b')]['id']}},_0x276964={};_0x276964['model']=_[_0x3077('0x35')](db[_0x3077('0x46')][_0x3077('0x30')]);_0x276964[_0x3077('0x34')]=_[_0x3077('0x35')](_0x467638[_0x3077('0x34')]);_0x276964[_0x3077('0x36')]=_[_0x3077('0x37')](_0x276964[_0x3077('0x33')],_0x276964[_0x3077('0x34')]);_0x289049[_0x3077('0x38')]=_[_0x3077('0x37')](_0x276964[_0x3077('0x33')],qs[_0x3077('0x39')](_0x467638[_0x3077('0x34')]['fields']));_0x289049[_0x3077('0x38')]=_0x289049[_0x3077('0x38')][_0x3077('0x3a')]?_0x289049[_0x3077('0x38')]:_0x276964[_0x3077('0x33')];if(_0x467638[_0x3077('0x34')][_0x3077('0x47')]){_0x289049[_0x3077('0x48')]=[{'all':!![]}];}_0x289049=_[_0x3077('0x42')]({},_0x289049,_0x467638['options']);return db[_0x3077('0x46')][_0x3077('0x4c')](_0x289049)['then'](handleEntityNotFound(_0x5b75e3,null))['then'](respondWithResult(_0x5b75e3,null))['catch'](handleError(_0x5b75e3,null));};exports[_0x3077('0x4d')]=function(_0x1bf81d,_0x56e17a){return db[_0x3077('0x46')]['create'](_0x1bf81d['body'],{})['then'](respondWithResult(_0x56e17a,0xc9))[_0x3077('0x4e')](handleError(_0x56e17a,null));};exports[_0x3077('0x28')]=function(_0x40af6d,_0x37f250){if(_0x40af6d[_0x3077('0x4f')]['id']){delete _0x40af6d[_0x3077('0x4f')]['id'];}return db['ChatGroup'][_0x3077('0x4c')]({'where':{'id':_0x40af6d[_0x3077('0x4b')]['id']}})[_0x3077('0x29')](handleEntityNotFound(_0x37f250,null))[_0x3077('0x29')](saveUpdates(_0x40af6d[_0x3077('0x4f')],null))[_0x3077('0x29')](respondWithResult(_0x37f250,null))[_0x3077('0x4e')](handleError(_0x37f250,null));};exports['destroy']=function(_0xd62ab3,_0x13c50e){return db[_0x3077('0x46')][_0x3077('0x4c')]({'where':{'id':_0xd62ab3[_0x3077('0x4b')]['id']}})['then'](handleEntityNotFound(_0x13c50e,null))['then'](removeEntity(_0x13c50e,null))[_0x3077('0x4e')](handleError(_0x13c50e,null));};exports[_0x3077('0x50')]=function(_0x5d8224,_0x8c7907){return db['ChatGroup'][_0x3077('0x50')]()[_0x3077('0x29')](respondWithResult(_0x8c7907,null))[_0x3077('0x4e')](handleError(_0x8c7907,null));};exports[_0x3077('0x51')]=function(_0x78fd8f,_0x3e7a2a,_0x450228){return db[_0x3077('0x52')]['count']({'where':{'ChatGroupId':_0x78fd8f['params']['id'],'ToId':_0x78fd8f[_0x3077('0x53')]['id'],'read':![]}})['then'](function(_0x45e3a5){return{'id':_[_0x3077('0x54')](_0x78fd8f[_0x3077('0x4b')]['id']),'count':_0x45e3a5};})['then'](respondWithResult(_0x3e7a2a,null))[_0x3077('0x4e')](handleError(_0x3e7a2a,null));};exports[_0x3077('0x55')]=function(_0x2d3cb6,_0x264852,_0x48b206){return db[_0x3077('0x46')][_0x3077('0x4c')]({'where':{'id':_0x2d3cb6[_0x3077('0x4b')]['id']}})['then'](handleEntityNotFound(_0x264852,null))['then'](function(_0x21e186){if(_0x21e186){return _0x21e186[_0x3077('0x55')](_0x2d3cb6[_0x3077('0x4f')]['ids'],_[_0x3077('0x56')](_0x2d3cb6['body'],[_0x3077('0x57'),'id'])||{});}})[_0x3077('0x29')](respondWithResult(_0x264852,null))[_0x3077('0x4e')](handleError(_0x264852,null));};exports[_0x3077('0x58')]=function(_0x1d4c75,_0x2c5a23,_0x3aa2fd){var _0x48d4a3={};var _0x21c834={};var _0x4b626d;var _0x432eeb;return db[_0x3077('0x46')][_0x3077('0x59')]({'where':{'id':_0x1d4c75[_0x3077('0x4b')]['id']}})[_0x3077('0x29')](handleEntityNotFound(_0x2c5a23,null))['then'](function(_0x3dc98a){if(_0x3dc98a){_0x4b626d=_0x3dc98a;_0x21c834['model']=_[_0x3077('0x35')](db[_0x3077('0x5a')]['rawAttributes']);_0x21c834[_0x3077('0x34')]=_[_0x3077('0x35')](_0x1d4c75[_0x3077('0x34')]);_0x21c834[_0x3077('0x36')]=_[_0x3077('0x37')](_0x21c834['model'],_0x21c834['query']);_0x48d4a3['attributes']=_[_0x3077('0x37')](_0x21c834['model'],qs[_0x3077('0x39')](_0x1d4c75[_0x3077('0x34')][_0x3077('0x39')]));_0x48d4a3[_0x3077('0x38')]=_0x48d4a3[_0x3077('0x38')]['length']?_0x48d4a3[_0x3077('0x38')]:_0x21c834['model'];_0x48d4a3[_0x3077('0x3d')]=qs['sort'](_0x1d4c75[_0x3077('0x34')][_0x3077('0x3e')]);_0x48d4a3[_0x3077('0x3f')]=qs[_0x3077('0x36')](_[_0x3077('0x40')](_0x1d4c75[_0x3077('0x34')],_0x21c834[_0x3077('0x36')]));if(_0x1d4c75[_0x3077('0x34')][_0x3077('0x41')]){_0x48d4a3['where']=_[_0x3077('0x42')](_0x48d4a3[_0x3077('0x3f')],{'$or':_[_0x3077('0x2f')](_0x48d4a3[_0x3077('0x38')],function(_0x33e6ed){var _0x486afc={};_0x486afc[_0x33e6ed]={'$like':'%'+_0x1d4c75['query']['filter']+'%'};return _0x486afc;})});}_0x48d4a3=_[_0x3077('0x42')]({},_0x48d4a3,_0x1d4c75[_0x3077('0x45')]);return _0x4b626d['getMembers'](_0x48d4a3);}})[_0x3077('0x29')](function(_0x2d7558){if(_0x2d7558){_0x432eeb=_0x2d7558[_0x3077('0x3a')];if(!_0x1d4c75['query']['hasOwnProperty'](_0x3077('0x3c'))){_0x48d4a3[_0x3077('0x24')]=qs[_0x3077('0x24')](_0x1d4c75['query'][_0x3077('0x24')]);_0x48d4a3[_0x3077('0x21')]=qs['offset'](_0x1d4c75['query'][_0x3077('0x21')]);}return _0x4b626d['getMembers'](_0x48d4a3);}})[_0x3077('0x29')](function(_0x299ef1){if(_0x299ef1){return _0x299ef1?{'count':_0x432eeb,'rows':_0x299ef1}:null;}})[_0x3077('0x29')](respondWithResult(_0x2c5a23,null))[_0x3077('0x4e')](handleError(_0x2c5a23,null));};exports['removeMembers']=function(_0x5f1042,_0x17d2f5,_0x905fb7){return db['ChatGroup'][_0x3077('0x4c')]({'where':{'id':_0x5f1042[_0x3077('0x4b')]['id']}})['then'](handleEntityNotFound(_0x17d2f5,null))[_0x3077('0x29')](function(_0x4806b5){if(_0x4806b5){return _0x4806b5[_0x3077('0x5b')](_0x5f1042[_0x3077('0x34')][_0x3077('0x57')]);}})['then'](respondWithStatusCode(_0x17d2f5,null))['catch'](handleError(_0x17d2f5,null));};exports[_0x3077('0x5c')]=function(_0x501656,_0x2ae1b3,_0xf1938a){if(_0x501656['body']['id']){delete _0x501656[_0x3077('0x4f')]['id'];}return db['ChatGroup'][_0x3077('0x4c')]({'where':{'id':_0x501656[_0x3077('0x4b')]['id']}})[_0x3077('0x29')](handleEntityNotFound(_0x2ae1b3,null))[_0x3077('0x29')](function(_0x410ad3){if(_0x410ad3){_0x501656[_0x3077('0x4f')]['ChatGroupId']=_0x410ad3['id'];return db[_0x3077('0x52')]['create'](_0x501656[_0x3077('0x4f')]);}})[_0x3077('0x29')](respondWithResult(_0x2ae1b3,null))[_0x3077('0x4e')](handleError(_0x2ae1b3,null));};exports[_0x3077('0x5d')]=function(_0x3a2596,_0x44d555,_0x5d831f){var _0x43c638={};var _0x9356ef={};var _0x20cc8f;var _0x3a89f2;return db[_0x3077('0x46')]['findOne']({'where':{'id':_0x3a2596['params']['id']}})[_0x3077('0x29')](handleEntityNotFound(_0x44d555,null))[_0x3077('0x29')](function(_0x24753a){if(_0x24753a){_0x20cc8f=_0x24753a;_0x9356ef['model']=_['keys'](db[_0x3077('0x52')][_0x3077('0x30')]);_0x9356ef[_0x3077('0x34')]=_[_0x3077('0x35')](_0x3a2596[_0x3077('0x34')]);_0x9356ef[_0x3077('0x36')]=_[_0x3077('0x37')](_0x9356ef['model'],_0x9356ef['query']);_0x43c638['attributes']=_[_0x3077('0x37')](_0x9356ef['model'],qs[_0x3077('0x39')](_0x3a2596[_0x3077('0x34')][_0x3077('0x39')]));_0x43c638[_0x3077('0x38')]=_0x43c638[_0x3077('0x38')][_0x3077('0x3a')]?_0x43c638[_0x3077('0x38')]:_0x9356ef[_0x3077('0x33')];_0x43c638[_0x3077('0x3d')]=qs[_0x3077('0x3e')](_0x3a2596[_0x3077('0x34')][_0x3077('0x3e')]);_0x43c638[_0x3077('0x3f')]=qs[_0x3077('0x36')](_[_0x3077('0x40')](_0x3a2596[_0x3077('0x34')],_0x9356ef['filters']));if(_0x3a2596['query']['filter']){_0x43c638[_0x3077('0x3f')]=_['merge'](_0x43c638['where'],{'$or':_['map'](_0x43c638[_0x3077('0x38')],function(_0x5d215a){var _0x4bd5bb={};_0x4bd5bb[_0x5d215a]={'$like':'%'+_0x3a2596['query'][_0x3077('0x41')]+'%'};return _0x4bd5bb;})});}if(_0x3a2596[_0x3077('0x34')][_0x3077('0x5e')]){var _0x5f5533=_0x3a2596[_0x3077('0x34')][_0x3077('0x5e')][_0x3077('0x5f')](',');var _0x28dd2e={};_0x28dd2e[_0x5f5533[0x0]]={'$gte':moment(_0x5f5533[0x1])[_0x3077('0x60')](_0x3077('0x61'))};_0x43c638[_0x3077('0x3f')]=_['merge'](_0x43c638['where'],_0x28dd2e);}_0x43c638=_[_0x3077('0x42')]({},_0x43c638,_0x3a2596[_0x3077('0x45')]);return _0x20cc8f[_0x3077('0x5d')](_0x43c638);}})[_0x3077('0x29')](function(_0x5a8582){if(_0x5a8582){_0x3a89f2=_0x5a8582[_0x3077('0x3a')];if(!_0x3a2596[_0x3077('0x34')][_0x3077('0x3b')](_0x3077('0x3c'))){_0x43c638['limit']=qs[_0x3077('0x24')](_0x3a2596[_0x3077('0x34')][_0x3077('0x24')]);_0x43c638['offset']=qs['offset'](_0x3a2596['query']['offset']);}return _0x20cc8f['getMessages'](_0x43c638);}})['then'](function(_0x91232f){if(_0x91232f){return _0x91232f?{'count':_0x3a89f2,'rows':_0x91232f}:null;}})['then'](respondWithResult(_0x44d555,null))['catch'](handleError(_0x44d555,null));};
\ No newline at end of file
+var _0x41c5=['attributes','fields','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','update','describe','ChatInternalMessage','toInteger','addMembers','ids','omit','getMembers','User','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','request-promise','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','undefined','count','set','then','destroy','end','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','key','query','keys','intersection','model'];(function(_0x2c4103,_0x14b7ad){var _0x297bf7=function(_0x35262a){while(--_0x35262a){_0x2c4103['push'](_0x2c4103['shift']());}};_0x297bf7(++_0x14b7ad);}(_0x41c5,0x13c));var _0x541c=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x41c5[_0x4b369d];return _0x571a98;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x541c('0x0'));var moment=require(_0x541c('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x541c('0x2'));var util=require(_0x541c('0x3'));var path=require(_0x541c('0x4'));var sox=require(_0x541c('0x5'));var csv=require('to-csv');var ejs=require(_0x541c('0x6'));var fs=require('fs');var fs_extra=require(_0x541c('0x7'));var _=require(_0x541c('0x8'));var squel=require('squel');var crypto=require(_0x541c('0x9'));var jsforce=require(_0x541c('0xa'));var deskjs=require(_0x541c('0xb'));var toCsv=require(_0x541c('0xc'));var querystring=require(_0x541c('0xd'));var Papa=require(_0x541c('0xe'));var Redis=require(_0x541c('0xf'));var authService=require(_0x541c('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x541c('0x11'));var hardwareService=require(_0x541c('0x12'));var logger=require('../../config/logger')(_0x541c('0x13'));var utils=require(_0x541c('0x14'));var config=require(_0x541c('0x15'));var licenseUtil=require(_0x541c('0x16'));var db=require('../../mysqldb')['db'];config[_0x541c('0x17')]=_[_0x541c('0x18')](config[_0x541c('0x17')],{'host':_0x541c('0x19'),'port':0x18eb});var socket=require(_0x541c('0x1a'))(new Redis(config[_0x541c('0x17')]));require('./chatGroup.socket')[_0x541c('0x1b')](socket);function respondWithStatusCode(_0x45210b,_0x1990d9){_0x1990d9=_0x1990d9||0xcc;return function(_0x1b378e){if(_0x1b378e){return _0x45210b['sendStatus'](_0x1990d9);}return _0x45210b[_0x541c('0x1c')](_0x1990d9)['end']();};}function respondWithResult(_0x46ece3,_0x36eadc){_0x36eadc=_0x36eadc||0xc8;return function(_0x2be819){if(_0x2be819){return _0x46ece3[_0x541c('0x1c')](_0x36eadc)[_0x541c('0x1d')](_0x2be819);}};}function respondWithFilteredResult(_0x180851,_0x4bcaa2){return function(_0x40cbd4){if(_0x40cbd4){var _0x4f8e68=typeof _0x4bcaa2[_0x541c('0x1e')]==='undefined'&&typeof _0x4bcaa2[_0x541c('0x1f')]===_0x541c('0x20');var _0x32c988=_0x40cbd4['count'];var _0x1852d7=_0x4f8e68?0x0:_0x4bcaa2[_0x541c('0x1e')];var _0x2272ef=_0x4f8e68?_0x40cbd4[_0x541c('0x21')]:_0x4bcaa2['offset']+_0x4bcaa2[_0x541c('0x1f')];var _0x38a233;if(_0x2272ef>=_0x32c988){_0x2272ef=_0x32c988;_0x38a233=0xc8;}else{_0x38a233=0xce;}_0x180851['status'](_0x38a233);return _0x180851[_0x541c('0x22')]('Content-Range',_0x1852d7+'-'+_0x2272ef+'/'+_0x32c988)[_0x541c('0x1d')](_0x40cbd4);}return null;};}function patchUpdates(_0x5167a5){return function(_0x4d97ca){try{jsonpatch['apply'](_0x4d97ca,_0x5167a5,!![]);}catch(_0x1a9c44){return BPromise['reject'](_0x1a9c44);}return _0x4d97ca['save']();};}function saveUpdates(_0x5905fa,_0x104fd0){return function(_0x2c3f11){if(_0x2c3f11){return _0x2c3f11['update'](_0x5905fa)[_0x541c('0x23')](function(_0x6ff9fa){return _0x6ff9fa;});}return null;};}function removeEntity(_0x3b5a6d,_0x5a682e){return function(_0xe28dd8){if(_0xe28dd8){return _0xe28dd8[_0x541c('0x24')]()['then'](function(){_0x3b5a6d[_0x541c('0x1c')](0xcc)[_0x541c('0x25')]();});}};}function handleEntityNotFound(_0x375909,_0x1db232){return function(_0x403ae0){if(!_0x403ae0){_0x375909['sendStatus'](0x194);}return _0x403ae0;};}function handleError(_0x352ce8,_0x2f6429){_0x2f6429=_0x2f6429||0x1f4;return function(_0x1b9996){logger[_0x541c('0x26')](_0x1b9996[_0x541c('0x27')]);if(_0x1b9996['name']){delete _0x1b9996[_0x541c('0x28')];}_0x352ce8[_0x541c('0x1c')](_0x2f6429)[_0x541c('0x29')](_0x1b9996);};}exports[_0x541c('0x2a')]=function(_0x2a1717,_0x142db1){var _0x28d309={},_0x3a735c={},_0x44d2f0={'count':0x0,'rows':[]};var _0x3aaa48=_[_0x541c('0x2b')](db[_0x541c('0x2c')][_0x541c('0x2d')],function(_0x534230){return{'name':_0x534230[_0x541c('0x2e')],'type':_0x534230['type'][_0x541c('0x2f')]};});_0x3a735c['model']=_[_0x541c('0x2b')](_0x3aaa48,_0x541c('0x28'));_0x3a735c[_0x541c('0x30')]=_[_0x541c('0x31')](_0x2a1717[_0x541c('0x30')]);_0x3a735c['filters']=_[_0x541c('0x32')](_0x3a735c[_0x541c('0x33')],_0x3a735c[_0x541c('0x30')]);_0x28d309[_0x541c('0x34')]=_['intersection'](_0x3a735c[_0x541c('0x33')],qs[_0x541c('0x35')](_0x2a1717['query'][_0x541c('0x35')]));_0x28d309['attributes']=_0x28d309[_0x541c('0x34')]['length']?_0x28d309[_0x541c('0x34')]:_0x3a735c[_0x541c('0x33')];if(!_0x2a1717[_0x541c('0x30')]['hasOwnProperty']('nolimit')){_0x28d309[_0x541c('0x1f')]=qs[_0x541c('0x1f')](_0x2a1717['query'][_0x541c('0x1f')]);_0x28d309['offset']=qs[_0x541c('0x1e')](_0x2a1717[_0x541c('0x30')]['offset']);}_0x28d309[_0x541c('0x36')]=qs[_0x541c('0x37')](_0x2a1717['query'][_0x541c('0x37')]);_0x28d309[_0x541c('0x38')]=qs[_0x541c('0x39')](_[_0x541c('0x3a')](_0x2a1717[_0x541c('0x30')],_0x3a735c[_0x541c('0x39')]),_0x3aaa48);if(_0x2a1717['query'][_0x541c('0x3b')]){_0x28d309[_0x541c('0x38')]=_[_0x541c('0x3c')](_0x28d309['where'],{'$or':_[_0x541c('0x2b')](_0x3aaa48,function(_0x33c727){if(_0x33c727['type']!==_0x541c('0x3d')){var _0xcdb40={};_0xcdb40[_0x33c727['name']]={'$like':'%'+_0x2a1717[_0x541c('0x30')][_0x541c('0x3b')]+'%'};return _0xcdb40;}})});}_0x28d309=_['merge']({},_0x28d309,_0x2a1717['options']);var _0x3a1243={'where':_0x28d309[_0x541c('0x38')]};return db[_0x541c('0x2c')][_0x541c('0x21')](_0x3a1243)[_0x541c('0x23')](function(_0x2c277f){_0x44d2f0[_0x541c('0x21')]=_0x2c277f;if(_0x2a1717[_0x541c('0x30')][_0x541c('0x3e')]){_0x28d309[_0x541c('0x3f')]=[{'all':!![]}];}return db['ChatGroup'][_0x541c('0x40')](_0x28d309);})[_0x541c('0x23')](function(_0x27cff8){_0x44d2f0[_0x541c('0x41')]=_0x27cff8;return _0x44d2f0;})[_0x541c('0x23')](respondWithFilteredResult(_0x142db1,_0x28d309))[_0x541c('0x42')](handleError(_0x142db1,null));};exports[_0x541c('0x43')]=function(_0x19f0de,_0x26fc3f){var _0x2505b1={'raw':!![],'where':{'id':_0x19f0de[_0x541c('0x44')]['id']}},_0x46d0b8={};_0x46d0b8[_0x541c('0x33')]=_[_0x541c('0x31')](db[_0x541c('0x2c')]['rawAttributes']);_0x46d0b8[_0x541c('0x30')]=_[_0x541c('0x31')](_0x19f0de[_0x541c('0x30')]);_0x46d0b8[_0x541c('0x39')]=_[_0x541c('0x32')](_0x46d0b8[_0x541c('0x33')],_0x46d0b8['query']);_0x2505b1[_0x541c('0x34')]=_[_0x541c('0x32')](_0x46d0b8[_0x541c('0x33')],qs[_0x541c('0x35')](_0x19f0de[_0x541c('0x30')][_0x541c('0x35')]));_0x2505b1['attributes']=_0x2505b1[_0x541c('0x34')][_0x541c('0x45')]?_0x2505b1['attributes']:_0x46d0b8[_0x541c('0x33')];if(_0x19f0de['query'][_0x541c('0x3e')]){_0x2505b1['include']=[{'all':!![]}];}_0x2505b1=_[_0x541c('0x3c')]({},_0x2505b1,_0x19f0de[_0x541c('0x46')]);return db[_0x541c('0x2c')][_0x541c('0x47')](_0x2505b1)['then'](handleEntityNotFound(_0x26fc3f,null))[_0x541c('0x23')](respondWithResult(_0x26fc3f,null))[_0x541c('0x42')](handleError(_0x26fc3f,null));};exports[_0x541c('0x48')]=function(_0x114f64,_0x442c70){return db[_0x541c('0x2c')][_0x541c('0x48')](_0x114f64[_0x541c('0x49')],{})[_0x541c('0x23')](respondWithResult(_0x442c70,0xc9))[_0x541c('0x42')](handleError(_0x442c70,null));};exports[_0x541c('0x4a')]=function(_0x2d5335,_0x480693){if(_0x2d5335[_0x541c('0x49')]['id']){delete _0x2d5335[_0x541c('0x49')]['id'];}return db['ChatGroup'][_0x541c('0x47')]({'where':{'id':_0x2d5335[_0x541c('0x44')]['id']}})[_0x541c('0x23')](handleEntityNotFound(_0x480693,null))[_0x541c('0x23')](saveUpdates(_0x2d5335[_0x541c('0x49')],null))['then'](respondWithResult(_0x480693,null))[_0x541c('0x42')](handleError(_0x480693,null));};exports[_0x541c('0x24')]=function(_0x4024d7,_0xb31ec8){return db[_0x541c('0x2c')][_0x541c('0x47')]({'where':{'id':_0x4024d7[_0x541c('0x44')]['id']}})[_0x541c('0x23')](handleEntityNotFound(_0xb31ec8,null))['then'](removeEntity(_0xb31ec8,null))[_0x541c('0x42')](handleError(_0xb31ec8,null));};exports[_0x541c('0x4b')]=function(_0x51002d,_0x1fbc05){return db[_0x541c('0x2c')][_0x541c('0x4b')]()[_0x541c('0x23')](respondWithResult(_0x1fbc05,null))[_0x541c('0x42')](handleError(_0x1fbc05,null));};exports['getUnread']=function(_0x23608b,_0x1df95a,_0x506b9b){return db[_0x541c('0x4c')][_0x541c('0x21')]({'where':{'ChatGroupId':_0x23608b[_0x541c('0x44')]['id'],'ToId':_0x23608b['user']['id'],'read':![]}})[_0x541c('0x23')](function(_0x42b379){return{'id':_[_0x541c('0x4d')](_0x23608b['params']['id']),'count':_0x42b379};})[_0x541c('0x23')](respondWithResult(_0x1df95a,null))[_0x541c('0x42')](handleError(_0x1df95a,null));};exports[_0x541c('0x4e')]=function(_0xc453ba,_0x2aac28,_0x3e58da){return db[_0x541c('0x2c')][_0x541c('0x47')]({'where':{'id':_0xc453ba[_0x541c('0x44')]['id']}})[_0x541c('0x23')](handleEntityNotFound(_0x2aac28,null))[_0x541c('0x23')](function(_0xfba927){if(_0xfba927){return _0xfba927[_0x541c('0x4e')](_0xc453ba[_0x541c('0x49')][_0x541c('0x4f')],_[_0x541c('0x50')](_0xc453ba[_0x541c('0x49')],[_0x541c('0x4f'),'id'])||{});}})['then'](respondWithResult(_0x2aac28,null))[_0x541c('0x42')](handleError(_0x2aac28,null));};exports[_0x541c('0x51')]=function(_0x41aabf,_0x479215,_0x1ac413){var _0x479591={};var _0x4f2f23={};var _0x177b6c;var _0x575ec5;return db[_0x541c('0x2c')]['findOne']({'where':{'id':_0x41aabf[_0x541c('0x44')]['id']}})[_0x541c('0x23')](handleEntityNotFound(_0x479215,null))[_0x541c('0x23')](function(_0x50176d){if(_0x50176d){_0x177b6c=_0x50176d;_0x4f2f23[_0x541c('0x33')]=_[_0x541c('0x31')](db[_0x541c('0x52')][_0x541c('0x2d')]);_0x4f2f23[_0x541c('0x30')]=_[_0x541c('0x31')](_0x41aabf[_0x541c('0x30')]);_0x4f2f23[_0x541c('0x39')]=_[_0x541c('0x32')](_0x4f2f23[_0x541c('0x33')],_0x4f2f23['query']);_0x479591[_0x541c('0x34')]=_[_0x541c('0x32')](_0x4f2f23[_0x541c('0x33')],qs[_0x541c('0x35')](_0x41aabf[_0x541c('0x30')][_0x541c('0x35')]));_0x479591[_0x541c('0x34')]=_0x479591[_0x541c('0x34')][_0x541c('0x45')]?_0x479591[_0x541c('0x34')]:_0x4f2f23[_0x541c('0x33')];_0x479591[_0x541c('0x36')]=qs[_0x541c('0x37')](_0x41aabf[_0x541c('0x30')][_0x541c('0x37')]);_0x479591[_0x541c('0x38')]=qs['filters'](_[_0x541c('0x3a')](_0x41aabf[_0x541c('0x30')],_0x4f2f23['filters']));if(_0x41aabf[_0x541c('0x30')]['filter']){_0x479591[_0x541c('0x38')]=_[_0x541c('0x3c')](_0x479591[_0x541c('0x38')],{'$or':_['map'](_0x479591[_0x541c('0x34')],function(_0xe39da5){var _0x321601={};_0x321601[_0xe39da5]={'$like':'%'+_0x41aabf['query'][_0x541c('0x3b')]+'%'};return _0x321601;})});}_0x479591=_[_0x541c('0x3c')]({},_0x479591,_0x41aabf[_0x541c('0x46')]);return _0x177b6c[_0x541c('0x51')](_0x479591);}})[_0x541c('0x23')](function(_0x4573cc){if(_0x4573cc){_0x575ec5=_0x4573cc[_0x541c('0x45')];if(!_0x41aabf[_0x541c('0x30')][_0x541c('0x53')](_0x541c('0x54'))){_0x479591[_0x541c('0x1f')]=qs[_0x541c('0x1f')](_0x41aabf[_0x541c('0x30')]['limit']);_0x479591[_0x541c('0x1e')]=qs[_0x541c('0x1e')](_0x41aabf[_0x541c('0x30')][_0x541c('0x1e')]);}return _0x177b6c['getMembers'](_0x479591);}})[_0x541c('0x23')](function(_0x1607ab){if(_0x1607ab){return _0x1607ab?{'count':_0x575ec5,'rows':_0x1607ab}:null;}})[_0x541c('0x23')](respondWithResult(_0x479215,null))[_0x541c('0x42')](handleError(_0x479215,null));};exports[_0x541c('0x55')]=function(_0x349c3e,_0x5f2b6c,_0x1c476f){return db['ChatGroup'][_0x541c('0x47')]({'where':{'id':_0x349c3e[_0x541c('0x44')]['id']}})[_0x541c('0x23')](handleEntityNotFound(_0x5f2b6c,null))[_0x541c('0x23')](function(_0x47e897){if(_0x47e897){return _0x47e897[_0x541c('0x55')](_0x349c3e[_0x541c('0x30')][_0x541c('0x4f')]);}})[_0x541c('0x23')](respondWithStatusCode(_0x5f2b6c,null))['catch'](handleError(_0x5f2b6c,null));};exports[_0x541c('0x56')]=function(_0x407090,_0x5bbaae,_0x1acb85){if(_0x407090[_0x541c('0x49')]['id']){delete _0x407090['body']['id'];}return db[_0x541c('0x2c')][_0x541c('0x47')]({'where':{'id':_0x407090[_0x541c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5bbaae,null))[_0x541c('0x23')](function(_0x167383){if(_0x167383){_0x407090[_0x541c('0x49')][_0x541c('0x57')]=_0x167383['id'];return db[_0x541c('0x4c')][_0x541c('0x48')](_0x407090['body']);}})[_0x541c('0x23')](respondWithResult(_0x5bbaae,null))['catch'](handleError(_0x5bbaae,null));};exports[_0x541c('0x58')]=function(_0x508423,_0x326065,_0x4c1d5c){var _0x34af03={};var _0x3a6db8={};var _0xadff38;var _0x1126ce;return db['ChatGroup']['findOne']({'where':{'id':_0x508423[_0x541c('0x44')]['id']}})[_0x541c('0x23')](handleEntityNotFound(_0x326065,null))[_0x541c('0x23')](function(_0x15c049){if(_0x15c049){_0xadff38=_0x15c049;_0x3a6db8[_0x541c('0x33')]=_['keys'](db[_0x541c('0x4c')][_0x541c('0x2d')]);_0x3a6db8['query']=_['keys'](_0x508423['query']);_0x3a6db8[_0x541c('0x39')]=_['intersection'](_0x3a6db8[_0x541c('0x33')],_0x3a6db8[_0x541c('0x30')]);_0x34af03[_0x541c('0x34')]=_[_0x541c('0x32')](_0x3a6db8[_0x541c('0x33')],qs[_0x541c('0x35')](_0x508423[_0x541c('0x30')][_0x541c('0x35')]));_0x34af03['attributes']=_0x34af03[_0x541c('0x34')][_0x541c('0x45')]?_0x34af03[_0x541c('0x34')]:_0x3a6db8['model'];_0x34af03[_0x541c('0x36')]=qs['sort'](_0x508423[_0x541c('0x30')]['sort']);_0x34af03[_0x541c('0x38')]=qs[_0x541c('0x39')](_[_0x541c('0x3a')](_0x508423[_0x541c('0x30')],_0x3a6db8[_0x541c('0x39')]));if(_0x508423['query'][_0x541c('0x3b')]){_0x34af03[_0x541c('0x38')]=_[_0x541c('0x3c')](_0x34af03[_0x541c('0x38')],{'$or':_[_0x541c('0x2b')](_0x34af03[_0x541c('0x34')],function(_0x57fcd8){var _0x1ad737={};_0x1ad737[_0x57fcd8]={'$like':'%'+_0x508423[_0x541c('0x30')][_0x541c('0x3b')]+'%'};return _0x1ad737;})});}if(_0x508423[_0x541c('0x30')][_0x541c('0x59')]){var _0x21d787=_0x508423[_0x541c('0x30')]['$gte']['split'](',');var _0x1320f6={};_0x1320f6[_0x21d787[0x0]]={'$gte':moment(_0x21d787[0x1])[_0x541c('0x5a')](_0x541c('0x5b'))};_0x34af03[_0x541c('0x38')]=_[_0x541c('0x3c')](_0x34af03[_0x541c('0x38')],_0x1320f6);}_0x34af03=_[_0x541c('0x3c')]({},_0x34af03,_0x508423['options']);return _0xadff38[_0x541c('0x58')](_0x34af03);}})[_0x541c('0x23')](function(_0x559f20){if(_0x559f20){_0x1126ce=_0x559f20['length'];if(!_0x508423['query'][_0x541c('0x53')]('nolimit')){_0x34af03[_0x541c('0x1f')]=qs['limit'](_0x508423[_0x541c('0x30')][_0x541c('0x1f')]);_0x34af03['offset']=qs[_0x541c('0x1e')](_0x508423[_0x541c('0x30')][_0x541c('0x1e')]);}return _0xadff38[_0x541c('0x58')](_0x34af03);}})[_0x541c('0x23')](function(_0x51ca8d){if(_0x51ca8d){return _0x51ca8d?{'count':_0x1126ce,'rows':_0x51ca8d}:null;}})['then'](respondWithResult(_0x326065,null))[_0x541c('0x42')](handleError(_0x326065,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index e3a7db3..0805654 100644
--- a/server/api/chatGroup/chatGroup.events.js
+++ b/server/api/chatGroup/chatGroup.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x50c1=['save','remove','emit','hasOwnProperty','exports','events','ChatGroup'];(function(_0x426d33,_0x2cfb45){var _0x279c96=function(_0x2d9673){while(--_0x2d9673){_0x426d33['push'](_0x426d33['shift']());}};_0x279c96(++_0x2cfb45);}(_0x50c1,0x171));var _0x150c=function(_0x20e149,_0x20036d){_0x20e149=_0x20e149-0x0;var _0x20f8aa=_0x50c1[_0x20e149];return _0x20f8aa;};'use strict';var EventEmitter=require(_0x150c('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x150c('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x150c('0x2'),'afterUpdate':'update','afterDestroy':_0x150c('0x3')};function emitEvent(_0x57e7ca){return function(_0x1f8076,_0x47ef37,_0x446fe1){ChatGroupEvents['emit'](_0x57e7ca+':'+_0x1f8076['id'],_0x1f8076);ChatGroupEvents[_0x150c('0x4')](_0x57e7ca,_0x1f8076);_0x446fe1(null);};}for(var e in events){if(events[_0x150c('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x150c('0x6')]=ChatGroupEvents;
\ No newline at end of file
+var _0x36d4=['exports','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x36d4,0x17d));var _0x436d=function(_0x4f4521,_0x14ac9e){_0x4f4521=_0x4f4521-0x0;var _0x1294da=_0x36d4[_0x4f4521];return _0x1294da;};'use strict';var EventEmitter=require(_0x436d('0x0'));var ChatGroup=require(_0x436d('0x1'))['db'][_0x436d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x436d('0x3')](0x0);var events={'afterCreate':_0x436d('0x4'),'afterUpdate':_0x436d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x296d0a){return function(_0x29af36,_0x201144,_0x8250e6){ChatGroupEvents[_0x436d('0x6')](_0x296d0a+':'+_0x29af36['id'],_0x29af36);ChatGroupEvents['emit'](_0x296d0a,_0x29af36);_0x8250e6(null);};}for(var e in events){if(events[_0x436d('0x7')](e)){var event=events[e];ChatGroup[_0x436d('0x8')](e,emitEvent(event));}}module[_0x436d('0x9')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 99208d7..2cfdfd2 100644
--- a/server/api/chatGroup/chatGroup.model.js
+++ b/server/api/chatGroup/chatGroup.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1a0f=['lodash','util','../../config/logger','api','moment','bluebird','path','./chatGroup.attributes','exports','define','ChatGroup','chat_groups'];(function(_0x14bacc,_0x40fe93){var _0x47367b=function(_0x17d337){while(--_0x17d337){_0x14bacc['push'](_0x14bacc['shift']());}};_0x47367b(++_0x40fe93);}(_0x1a0f,0x6c));var _0xf1a0=function(_0x38ac0c,_0x5b11ec){_0x38ac0c=_0x38ac0c-0x0;var _0x173e56=_0x1a0f[_0x38ac0c];return _0x173e56;};'use strict';var _=require(_0xf1a0('0x0'));var util=require(_0xf1a0('0x1'));var logger=require(_0xf1a0('0x2'))(_0xf1a0('0x3'));var moment=require(_0xf1a0('0x4'));var BPromise=require(_0xf1a0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf1a0('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf1a0('0x7'));module[_0xf1a0('0x8')]=function(_0x115c85,_0x41dc21){return _0x115c85[_0xf1a0('0x9')](_0xf1a0('0xa'),attributes,{'tableName':_0xf1a0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xaabb=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','chat_groups','lodash','api'];(function(_0x39ffbc,_0x25eaba){var _0x26be80=function(_0x2370b7){while(--_0x2370b7){_0x39ffbc['push'](_0x39ffbc['shift']());}};_0x26be80(++_0x25eaba);}(_0xaabb,0x1ea));var _0xbaab=function(_0x193d1a,_0x249662){_0x193d1a=_0x193d1a-0x0;var _0x35399a=_0xaabb[_0x193d1a];return _0x35399a;};'use strict';var _=require(_0xbaab('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbaab('0x1'));var moment=require(_0xbaab('0x2'));var BPromise=require(_0xbaab('0x3'));var rp=require(_0xbaab('0x4'));var fs=require('fs');var path=require(_0xbaab('0x5'));var rimraf=require(_0xbaab('0x6'));var config=require(_0xbaab('0x7'));var attributes=require(_0xbaab('0x8'));module[_0xbaab('0x9')]=function(_0x21d786,_0x5e2af7){return _0x21d786['define'](_0xbaab('0xa'),attributes,{'tableName':_0xbaab('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js
index ebdedf6..a36898f 100644
--- a/server/api/chatGroup/chatGroup.rpc.js
+++ b/server/api/chatGroup/chatGroup.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0bde=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','bluebird','randomstring'];(function(_0x171c8b,_0xea7a5c){var _0x2ccd5f=function(_0x4cad54){while(--_0x4cad54){_0x171c8b['push'](_0x171c8b['shift']());}};_0x2ccd5f(++_0xea7a5c);}(_0x0bde,0xe7));var _0xe0bd=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0bde[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var moment=require('moment');var BPromise=require(_0xe0bd('0x1'));var rs=require(_0xe0bd('0x2'));var fs=require('fs');var Redis=require(_0xe0bd('0x3'));var db=require(_0xe0bd('0x4'))['db'];var utils=require(_0xe0bd('0x5'));var logger=require('../../config/logger')(_0xe0bd('0x6'));var config=require(_0xe0bd('0x7'));var jayson=require(_0xe0bd('0x8'));var client=jayson[_0xe0bd('0x9')][_0xe0bd('0xa')]({'port':0x232a});config[_0xe0bd('0xb')]=_[_0xe0bd('0xc')](config['redis'],{'host':_0xe0bd('0xd'),'port':0x18eb});var socket=require(_0xe0bd('0xe'))(new Redis(config[_0xe0bd('0xb')]));require(_0xe0bd('0xf'))[_0xe0bd('0x10')](socket);function respondWithRpcPromise(_0x3c47c4,_0x475265,_0x58d892){return new BPromise(function(_0x561b74,_0x595dac){return client['request'](_0x3c47c4,_0x58d892)[_0xe0bd('0x11')](function(_0x5e2a24){logger['info'](_0xe0bd('0x12'),_0x475265,_0xe0bd('0x13'));logger['debug'](_0xe0bd('0x14'),_0x475265,'request\x20sent',JSON[_0xe0bd('0x15')](_0x5e2a24));if(_0x5e2a24[_0xe0bd('0x16')]){if(_0x5e2a24[_0xe0bd('0x16')][_0xe0bd('0x17')]===0x1f4){logger[_0xe0bd('0x16')](_0xe0bd('0x12'),_0x475265,_0x5e2a24[_0xe0bd('0x16')][_0xe0bd('0x18')]);return _0x595dac(_0x5e2a24['error']['message']);}logger['error'](_0xe0bd('0x12'),_0x475265,_0x5e2a24[_0xe0bd('0x16')][_0xe0bd('0x18')]);return _0x561b74(_0x5e2a24[_0xe0bd('0x16')][_0xe0bd('0x18')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0x475265,_0xe0bd('0x13'));_0x561b74(_0x5e2a24['result'][_0xe0bd('0x18')]);}})[_0xe0bd('0x19')](function(_0xec158d){logger[_0xe0bd('0x16')]('ChatGroup,\x20%s,\x20%s',_0x475265,_0xec158d);_0x595dac(_0xec158d);});});}
\ No newline at end of file
+var _0x5d55=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4d44aa,_0x213c9f){var _0x18460c=function(_0x5568b7){while(--_0x5568b7){_0x4d44aa['push'](_0x4d44aa['shift']());}};_0x18460c(++_0x213c9f);}(_0x5d55,0x1a4));var _0x55d5=function(_0x2509bd,_0x3de0d4){_0x2509bd=_0x2509bd-0x0;var _0xf6ce81=_0x5d55[_0x2509bd];return _0xf6ce81;};'use strict';var _=require('lodash');var util=require(_0x55d5('0x0'));var moment=require('moment');var BPromise=require(_0x55d5('0x1'));var rs=require(_0x55d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55d5('0x3'))['db'];var utils=require(_0x55d5('0x4'));var logger=require(_0x55d5('0x5'))('rpc');var config=require(_0x55d5('0x6'));var jayson=require(_0x55d5('0x7'));var client=jayson[_0x55d5('0x8')][_0x55d5('0x9')]({'port':0x232a});config[_0x55d5('0xa')]=_[_0x55d5('0xb')](config[_0x55d5('0xa')],{'host':_0x55d5('0xc'),'port':0x18eb});var socket=require(_0x55d5('0xd'))(new Redis(config['redis']));require(_0x55d5('0xe'))[_0x55d5('0xf')](socket);function respondWithRpcPromise(_0x448938,_0x64f70a,_0xdac85){return new BPromise(function(_0x4db860,_0x45569e){return client['request'](_0x448938,_0xdac85)[_0x55d5('0x10')](function(_0x21d7c0){logger[_0x55d5('0x11')](_0x55d5('0x12'),_0x64f70a,_0x55d5('0x13'));logger['debug'](_0x55d5('0x14'),_0x64f70a,_0x55d5('0x13'),JSON[_0x55d5('0x15')](_0x21d7c0));if(_0x21d7c0['error']){if(_0x21d7c0[_0x55d5('0x16')]['code']===0x1f4){logger[_0x55d5('0x16')](_0x55d5('0x12'),_0x64f70a,_0x21d7c0[_0x55d5('0x16')][_0x55d5('0x17')]);return _0x45569e(_0x21d7c0['error'][_0x55d5('0x17')]);}logger[_0x55d5('0x16')](_0x55d5('0x12'),_0x64f70a,_0x21d7c0['error'][_0x55d5('0x17')]);return _0x4db860(_0x21d7c0['error'][_0x55d5('0x17')]);}else{logger['info'](_0x55d5('0x12'),_0x64f70a,_0x55d5('0x13'));_0x4db860(_0x21d7c0['result'][_0x55d5('0x17')]);}})[_0x55d5('0x18')](function(_0x2c0324){logger[_0x55d5('0x16')]('ChatGroup,\x20%s,\x20%s',_0x64f70a,_0x2c0324);_0x45569e(_0x2c0324);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e470bd8..56d51d7 100644
--- a/server/api/chatGroup/chatGroup.socket.js
+++ b/server/api/chatGroup/chatGroup.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa55a=['update','emit','register','length','chatGroup:','save','remove'];(function(_0x257d22,_0x3fc88b){var _0x43d194=function(_0xad8fe){while(--_0xad8fe){_0x257d22['push'](_0x257d22['shift']());}};_0x43d194(++_0x3fc88b);}(_0xa55a,0x1a9));var _0xaa55=function(_0x4d6406,_0x5c0b07){_0x4d6406=_0x4d6406-0x0;var _0x1f53cd=_0xa55a[_0x4d6406];return _0x1f53cd;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xaa55('0x0'),_0xaa55('0x1'),_0xaa55('0x2')];function createListener(_0x42e1f0,_0x52724c){return function(_0x693cd){_0x52724c[_0xaa55('0x3')](_0x42e1f0,_0x693cd);};}function removeListener(_0x57a5e2,_0x1aa136){return function(){ChatGroupEvents['removeListener'](_0x57a5e2,_0x1aa136);};}exports[_0xaa55('0x4')]=function(_0x1d3eb9){for(var _0x34027d=0x0,_0x3299e3=events[_0xaa55('0x5')];_0x34027d<_0x3299e3;_0x34027d++){var _0xdd10e7=events[_0x34027d];var _0x665d9a=createListener(_0xaa55('0x6')+_0xdd10e7,_0x1d3eb9);ChatGroupEvents['on'](_0xdd10e7,_0x665d9a);}};
\ No newline at end of file
+var _0xaa10=['register','./chatGroup.events','save','remove','update','removeListener'];(function(_0x21b9da,_0x5d09d4){var _0x46c544=function(_0x5c73b9){while(--_0x5c73b9){_0x21b9da['push'](_0x21b9da['shift']());}};_0x46c544(++_0x5d09d4);}(_0xaa10,0xfd));var _0x0aa1=function(_0x24cb64,_0x5f4f1b){_0x24cb64=_0x24cb64-0x0;var _0x33cc93=_0xaa10[_0x24cb64];return _0x33cc93;};'use strict';var ChatGroupEvents=require(_0x0aa1('0x0'));var events=[_0x0aa1('0x1'),_0x0aa1('0x2'),_0x0aa1('0x3')];function createListener(_0x5a5f94,_0x1d54d8){return function(_0x4cfb10){_0x1d54d8['emit'](_0x5a5f94,_0x4cfb10);};}function removeListener(_0x58945e,_0x39a297){return function(){ChatGroupEvents[_0x0aa1('0x4')](_0x58945e,_0x39a297);};}exports[_0x0aa1('0x5')]=function(_0x417325){for(var _0x5c48e4=0x0,_0x50068f=events['length'];_0x5c48e4<_0x50068f;_0x5c48e4++){var _0x45e5ec=events[_0x5c48e4];var _0x3c20d0=createListener('chatGroup:'+_0x45e5ec,_0x417325);ChatGroupEvents['on'](_0x45e5ec,_0x3c20d0);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index fa3b4ec..7c12e06 100644
--- a/server/api/chatGroup/index.js
+++ b/server/api/chatGroup/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xecb8=['show','/:id/unread','getUnread','/:id/members','/:id/messages','getMessages','post','create','put','update','delete','destroy','removeMembers','exports','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatGroup.controller','get','isAuthenticated','/:id'];(function(_0x3cc732,_0x2799cf){var _0x1fca7f=function(_0x37a6e5){while(--_0x37a6e5){_0x3cc732['push'](_0x3cc732['shift']());}};_0x1fca7f(++_0x2799cf);}(_0xecb8,0xb6));var _0x8ecb=function(_0x2d28dd,_0x10b362){_0x2d28dd=_0x2d28dd-0x0;var _0x6c1ec6=_0xecb8[_0x2d28dd];return _0x6c1ec6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8ecb('0x0'));var timeout=require(_0x8ecb('0x1'));var express=require(_0x8ecb('0x2'));var router=express[_0x8ecb('0x3')]();var fs_extra=require(_0x8ecb('0x4'));var auth=require(_0x8ecb('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x8ecb('0x6'));router[_0x8ecb('0x7')]('/',auth[_0x8ecb('0x8')](),controller['index']);router['get']('/describe',auth[_0x8ecb('0x8')](),controller['describe']);router[_0x8ecb('0x7')](_0x8ecb('0x9'),auth[_0x8ecb('0x8')](),controller[_0x8ecb('0xa')]);router['get'](_0x8ecb('0xb'),auth[_0x8ecb('0x8')](),controller[_0x8ecb('0xc')]);router[_0x8ecb('0x7')](_0x8ecb('0xd'),auth[_0x8ecb('0x8')](),controller['getMembers']);router[_0x8ecb('0x7')](_0x8ecb('0xe'),auth['isAuthenticated'](),controller[_0x8ecb('0xf')]);router[_0x8ecb('0x10')]('/',auth[_0x8ecb('0x8')](),controller[_0x8ecb('0x11')]);router[_0x8ecb('0x10')](_0x8ecb('0xd'),auth[_0x8ecb('0x8')](),controller['addMembers']);router[_0x8ecb('0x10')]('/:id/messages',auth[_0x8ecb('0x8')](),controller['addMessage']);router[_0x8ecb('0x12')](_0x8ecb('0x9'),auth[_0x8ecb('0x8')](),controller[_0x8ecb('0x13')]);router[_0x8ecb('0x14')]('/:id',auth[_0x8ecb('0x8')](),controller[_0x8ecb('0x15')]);router[_0x8ecb('0x14')](_0x8ecb('0xd'),auth['isAuthenticated'](),controller[_0x8ecb('0x16')]);module[_0x8ecb('0x17')]=router;
\ No newline at end of file
+var _0x790a=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','/describe','describe','/:id','/:id/unread','getMembers','/:id/messages','getMessages','post','addMembers','put','update','destroy','delete','removeMembers','multer','path'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x790a,0x14e));var _0xa790=function(_0x5489c4,_0x1e7a17){_0x5489c4=_0x5489c4-0x0;var _0x2c4624=_0x790a[_0x5489c4];return _0x2c4624;};'use strict';var multer=require(_0xa790('0x0'));var util=require('util');var path=require(_0xa790('0x1'));var timeout=require(_0xa790('0x2'));var express=require('express');var router=express[_0xa790('0x3')]();var fs_extra=require(_0xa790('0x4'));var auth=require(_0xa790('0x5'));var interaction=require(_0xa790('0x6'));var config=require('../../config/environment');var controller=require(_0xa790('0x7'));router[_0xa790('0x8')]('/',auth[_0xa790('0x9')](),controller['index']);router[_0xa790('0x8')](_0xa790('0xa'),auth[_0xa790('0x9')](),controller[_0xa790('0xb')]);router[_0xa790('0x8')](_0xa790('0xc'),auth[_0xa790('0x9')](),controller['show']);router[_0xa790('0x8')](_0xa790('0xd'),auth[_0xa790('0x9')](),controller['getUnread']);router[_0xa790('0x8')]('/:id/members',auth[_0xa790('0x9')](),controller[_0xa790('0xe')]);router['get'](_0xa790('0xf'),auth[_0xa790('0x9')](),controller[_0xa790('0x10')]);router[_0xa790('0x11')]('/',auth[_0xa790('0x9')](),controller['create']);router[_0xa790('0x11')]('/:id/members',auth[_0xa790('0x9')](),controller[_0xa790('0x12')]);router[_0xa790('0x11')](_0xa790('0xf'),auth[_0xa790('0x9')](),controller['addMessage']);router[_0xa790('0x13')]('/:id',auth[_0xa790('0x9')](),controller[_0xa790('0x14')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa790('0x15')]);router[_0xa790('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0xa790('0x17')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f4e0398..843d7fc 100644
--- a/server/api/chatInteraction/chatInteraction.attributes.js
+++ b/server/api/chatInteraction/chatInteraction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2952=['DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','TEXT','STRING'];(function(_0x55d289,_0x27ec2a){var _0x2d11e9=function(_0x55b6a7){while(--_0x55b6a7){_0x55d289['push'](_0x55d289['shift']());}};_0x2d11e9(++_0x27ec2a);}(_0x2952,0x158));var _0x2295=function(_0x346737,_0x3e6081){_0x346737=_0x346737-0x0;var _0x1ade2e=_0x2952[_0x346737];return _0x1ade2e;};'use strict';var Sequelize=require(_0x2295('0x0'));module[_0x2295('0x1')]={'closed':{'type':Sequelize[_0x2295('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x2295('0x3')]},'ratingType':{'type':Sequelize[_0x2295('0x4')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x2295('0x5')]},'mailTranscript':{'type':Sequelize[_0x2295('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2295('0x7')]},'disposition':{'type':Sequelize[_0x2295('0x6')]},'secondDisposition':{'type':Sequelize[_0x2295('0x6')]},'thirdDisposition':{'type':Sequelize[_0x2295('0x6')]},'note':{'type':Sequelize[_0x2295('0x6')]},'browserName':{'type':Sequelize[_0x2295('0x6')]},'browserVersion':{'type':Sequelize[_0x2295('0x6')]},'osName':{'type':Sequelize[_0x2295('0x6')]},'osVersion':{'type':Sequelize[_0x2295('0x6')]},'deviceModel':{'type':Sequelize[_0x2295('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x2295('0x5')]},'customerIp':{'type':Sequelize[_0x2295('0x6')]},'formData':{'type':Sequelize[_0x2295('0x5')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2295('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x2295('0x4')]('in',_0x2295('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0x2295('0x6')]},'vidaooSessionId':{'type':Sequelize[_0x2295('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0x2295('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1129=['thumb','TEXT','STRING','long','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM','star'];(function(_0xea343d,_0x311197){var _0x2c6e9c=function(_0x454bd6){while(--_0x454bd6){_0xea343d['push'](_0xea343d['shift']());}};_0x2c6e9c(++_0x311197);}(_0x1129,0xf6));var _0x9112=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1129[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9112('0x0'));module[_0x9112('0x1')]={'closed':{'type':Sequelize[_0x9112('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x9112('0x3')]},'ratingType':{'type':Sequelize[_0x9112('0x4')](_0x9112('0x5'),_0x9112('0x6')),'defaultValue':_0x9112('0x5')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x9112('0x7')]},'mailTranscript':{'type':Sequelize[_0x9112('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x9112('0x8')]},'secondDisposition':{'type':Sequelize['STRING']},'thirdDisposition':{'type':Sequelize[_0x9112('0x8')]},'note':{'type':Sequelize[_0x9112('0x8')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x9112('0x8')]},'osName':{'type':Sequelize[_0x9112('0x8')]},'osVersion':{'type':Sequelize[_0x9112('0x8')]},'deviceModel':{'type':Sequelize[_0x9112('0x8')]},'deviceVendor':{'type':Sequelize[_0x9112('0x8')]},'deviceType':{'type':Sequelize[_0x9112('0x8')]},'referer':{'type':Sequelize[_0x9112('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x9112('0x7')](_0x9112('0x9'))},'read1stAt':{'type':Sequelize[_0x9112('0xa')]},'lastMsgAt':{'type':Sequelize[_0x9112('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x9112('0x4')]('in',_0x9112('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x9112('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x9112('0x2')],'defaultValue':![]},'queueId':{'type':Sequelize[_0x9112('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 6fba5e4..ff6d740 100644
--- a/server/api/chatInteraction/chatInteraction.controller.js
+++ b/server/api/chatInteraction/chatInteraction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb69b=['account','index','map','ChatInteraction','fieldName','type','findAll','chat','query','user','catch','show','params','model','keys','filters','intersection','attributes','fields','length','includeAll','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','vidaooNote','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','Attachment','attachmentDownload','json','ChatOfflineMessageId','offline-chat/','basename','download','close','mailTranscript','join','root','server/files/chat/upload/','format','now','User','CmContact','ContactId','Messages','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','%s%d','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','rawAttributes','hasOwnProperty','nolimit','order','sort','pick','where','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','count','include','rows','getMyMessages','ChatInteractionId','secret','includeAgent','push','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','files','server','attachments','Contact','firstName','read','Account','get','mkdirSync','Chat','Owner','N.A.','toString','closedAt','osName','customerIp','customerPort','tail','pipe','createWriteStream','lastName','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','request-promise','bluebird','mustache','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','status','offset','undefined','limit','set','Content-Range','update','destroy','sendStatus','stack','name','send','render','merge','contact','agent','interaction'];(function(_0x116d1f,_0x229ba8){var _0x52c253=function(_0x325a05){while(--_0x325a05){_0x116d1f['push'](_0x116d1f['shift']());}};_0x52c253(++_0x229ba8);}(_0xb69b,0x174));var _0xbb69=function(_0x2b5caa,_0xc7b7e4){_0x2b5caa=_0x2b5caa-0x0;var _0x515030=_0xb69b[_0x2b5caa];return _0x515030;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xbb69('0x0'));var rp=require(_0xbb69('0x1'));var moment=require('moment');var BPromise=require(_0xbb69('0x2'));var Mustache=require(_0xbb69('0x3'));var util=require(_0xbb69('0x4'));var path=require(_0xbb69('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0xbb69('0x6'));var interaction=require(_0xbb69('0x7'));var qs=require(_0xbb69('0x8'));var pdf=require(_0xbb69('0x9'));var logger=require(_0xbb69('0xa'))(_0xbb69('0xb'));var config=require('../../config/environment');var db=require(_0xbb69('0xc'))['db'];config[_0xbb69('0xd')]=_[_0xbb69('0xe')](config[_0xbb69('0xd')],{'host':_0xbb69('0xf'),'port':0x18eb});var socket=require(_0xbb69('0x10'))(new Redis(config[_0xbb69('0xd')]));require(_0xbb69('0x11'))[_0xbb69('0x12')](socket);var jayson=require(_0xbb69('0x13'));var client=jayson[_0xbb69('0x14')]['http']({'port':0x232b});var client9004=jayson[_0xbb69('0x14')][_0xbb69('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2c98d6,_0x266ae3,_0x428bf7,_0x4f9a85){return new BPromise(function(_0x878f7e,_0x217449){var _0x27d3a7=_0x4f9a85||client;return _0x27d3a7[_0xbb69('0x16')](_0x2c98d6,_0x428bf7)[_0xbb69('0x17')](function(_0x5383d3){logger[_0xbb69('0x18')](_0xbb69('0x19'),_0x266ae3,_0xbb69('0x1a'));logger[_0xbb69('0x1b')](_0xbb69('0x1c'),_0x266ae3,_0xbb69('0x1a'),JSON['stringify'](_0x5383d3));if(_0x5383d3['error']){if(_0x5383d3[_0xbb69('0x1d')][_0xbb69('0x1e')]===0x1f4){logger[_0xbb69('0x1d')]('ChatInteraction,\x20%s,\x20%s',_0x266ae3,_0x5383d3[_0xbb69('0x1d')][_0xbb69('0x1f')]);return _0x217449(_0x5383d3[_0xbb69('0x1d')][_0xbb69('0x1f')]);}logger['error'](_0xbb69('0x19'),_0x266ae3,_0x5383d3[_0xbb69('0x1d')][_0xbb69('0x1f')]);return _0x878f7e(_0x5383d3[_0xbb69('0x1d')]['message']);}else{logger[_0xbb69('0x18')](_0xbb69('0x19'),_0x266ae3,'request\x20sent');_0x878f7e(_0x5383d3[_0xbb69('0x20')][_0xbb69('0x1f')]);}})['catch'](function(_0x1b69c3){logger[_0xbb69('0x1d')](_0xbb69('0x19'),_0x266ae3,_0x1b69c3);_0x217449(_0x1b69c3);});});}function respondWithStatusCode(_0x1fe4f4,_0x5d2e52){_0x5d2e52=_0x5d2e52||0xcc;return function(_0x24cae0){if(_0x24cae0){return _0x1fe4f4['sendStatus'](_0x5d2e52);}return _0x1fe4f4[_0xbb69('0x21')](_0x5d2e52)['end']();};}function respondWithResult(_0x245997,_0x1488a2){_0x1488a2=_0x1488a2||0xc8;return function(_0x33b313){if(_0x33b313){return _0x245997['status'](_0x1488a2)['json'](_0x33b313);}};}function respondWithFilteredResult(_0x6f314,_0x291058){return function(_0x520ac3){if(_0x520ac3){var _0x3c05af=typeof _0x291058[_0xbb69('0x22')]===_0xbb69('0x23')&&typeof _0x291058['limit']==='undefined';var _0x3aadf3=_0x520ac3['count'];var _0x4cb188=_0x3c05af?0x0:_0x291058['offset'];var _0x4d60fa=_0x3c05af?_0x520ac3['count']:_0x291058[_0xbb69('0x22')]+_0x291058[_0xbb69('0x24')];var _0x2ecdc1;if(_0x4d60fa>=_0x3aadf3){_0x4d60fa=_0x3aadf3;_0x2ecdc1=0xc8;}else{_0x2ecdc1=0xce;}_0x6f314[_0xbb69('0x21')](_0x2ecdc1);return _0x6f314[_0xbb69('0x25')](_0xbb69('0x26'),_0x4cb188+'-'+_0x4d60fa+'/'+_0x3aadf3)['json'](_0x520ac3);}return null;};}function saveUpdates(_0xcb5fd5){return function(_0xe8f1b0){if(_0xe8f1b0){return _0xe8f1b0[_0xbb69('0x27')](_0xcb5fd5)[_0xbb69('0x17')](function(_0x49cc11){return _0x49cc11;});}return null;};}function removeEntity(_0x136de5){return function(_0xaf0d04){if(_0xaf0d04){return _0xaf0d04[_0xbb69('0x28')]()[_0xbb69('0x17')](function(){_0x136de5[_0xbb69('0x21')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3a3e31){return function(_0x5772dd){if(!_0x5772dd){_0x3a3e31[_0xbb69('0x29')](0x194);}return _0x5772dd;};}function handleError(_0x5ac2f7,_0x52af56){_0x52af56=_0x52af56||0x1f4;return function(_0x475c43){logger[_0xbb69('0x1d')](_0x475c43[_0xbb69('0x2a')]);if(_0x475c43[_0xbb69('0x2b')]){delete _0x475c43[_0xbb69('0x2b')];}_0x5ac2f7[_0xbb69('0x21')](_0x52af56)[_0xbb69('0x2c')](_0x475c43);};}function getMustacheRender(_0x125d6b,_0x536dbe){return Mustache[_0xbb69('0x2d')](_0x125d6b,_[_0xbb69('0x2e')](_0x536dbe['body'],{'contact':_0x536dbe[_0xbb69('0x2f')],'message':_0x536dbe[_0xbb69('0x1f')],'agent':_0x536dbe[_0xbb69('0x30')],'interaction':_0x536dbe[_0xbb69('0x31')],'account':_0x536dbe[_0xbb69('0x32')]}))||'';}exports[_0xbb69('0x33')]=function(_0x1f37ae,_0x5367f7){var _0x35034a={};var _0x197f62=_[_0xbb69('0x34')](db[_0xbb69('0x35')]['rawAttributes'],function(_0x4c3111){return{'name':_0x4c3111[_0xbb69('0x36')],'type':_0x4c3111[_0xbb69('0x37')]['key']};});_0x35034a=qs['getOptions'](_0x197f62,_0x1f37ae);return interaction[_0xbb69('0x38')](_0xbb69('0x39'),_0x1f37ae[_0xbb69('0x3a')],_0x1f37ae[_0xbb69('0x3b')],_0x35034a,_0x197f62)[_0xbb69('0x17')](respondWithFilteredResult(_0x5367f7,_0x35034a))[_0xbb69('0x3c')](handleError(_0x5367f7,null));};exports[_0xbb69('0x3d')]=function(_0x3969c9,_0x537f8f){var _0x1340a4={'raw':![],'where':{'id':_0x3969c9[_0xbb69('0x3e')]['id']}},_0x37ff61={};_0x37ff61[_0xbb69('0x3f')]=_[_0xbb69('0x40')](db[_0xbb69('0x35')]['rawAttributes']);_0x37ff61[_0xbb69('0x3a')]=_[_0xbb69('0x40')](_0x3969c9['query']);_0x37ff61[_0xbb69('0x41')]=_[_0xbb69('0x42')](_0x37ff61['model'],_0x37ff61[_0xbb69('0x3a')]);_0x1340a4[_0xbb69('0x43')]=_[_0xbb69('0x42')](_0x37ff61[_0xbb69('0x3f')],qs[_0xbb69('0x44')](_0x3969c9[_0xbb69('0x3a')][_0xbb69('0x44')]));_0x1340a4[_0xbb69('0x43')]=_0x1340a4[_0xbb69('0x43')][_0xbb69('0x45')]?_0x1340a4[_0xbb69('0x43')]:_0x37ff61['model'];if(_0x3969c9['query'][_0xbb69('0x46')]){_0x1340a4['include']=[{'all':!![]}];}_0x1340a4=_[_0xbb69('0x2e')]({},_0x1340a4,_0x3969c9[_0xbb69('0x47')]);return db[_0xbb69('0x35')][_0xbb69('0x48')](_0x1340a4)['then'](handleEntityNotFound(_0x537f8f,null))[_0xbb69('0x17')](respondWithResult(_0x537f8f,null))['catch'](handleError(_0x537f8f,null));};exports[_0xbb69('0x49')]=function(_0xeae3fb,_0x1969f6){return db[_0xbb69('0x35')]['create'](_0xeae3fb[_0xbb69('0x4a')],{})[_0xbb69('0x17')](respondWithResult(_0x1969f6,0xc9))[_0xbb69('0x3c')](handleError(_0x1969f6,null));};exports[_0xbb69('0x27')]=function(_0x1095d4,_0x5ced34){if(_0x1095d4[_0xbb69('0x4a')]['id']){delete _0x1095d4[_0xbb69('0x4a')]['id'];}return db[_0xbb69('0x35')]['find']({'where':{'id':_0x1095d4[_0xbb69('0x3e')]['id']}})[_0xbb69('0x17')](handleEntityNotFound(_0x5ced34,null))[_0xbb69('0x17')](saveUpdates(_0x1095d4[_0xbb69('0x4a')],null))[_0xbb69('0x17')](respondWithResult(_0x5ced34,null))['catch'](handleError(_0x5ced34,null));};exports[_0xbb69('0x28')]=function(_0xcadf7b,_0x546734){return db[_0xbb69('0x35')][_0xbb69('0x48')]({'where':{'id':_0xcadf7b[_0xbb69('0x3e')]['id']}})['then'](handleEntityNotFound(_0x546734,null))[_0xbb69('0x17')](removeEntity(_0x546734,null))[_0xbb69('0x3c')](handleError(_0x546734,null));};exports[_0xbb69('0x4b')]=function(_0x331c30,_0x1de92c){return db[_0xbb69('0x35')]['describe']()[_0xbb69('0x17')](respondWithResult(_0x1de92c,null))[_0xbb69('0x3c')](handleError(_0x1de92c,null));};exports[_0xbb69('0x4c')]=function(_0x3b033f,_0x24b31e){var _0x4ea942=_0x3b033f['params']['id'];var _0x5a6640;var _0x46e907;var _0x3c1c33;return db[_0xbb69('0x35')][_0xbb69('0x4d')]({'where':{'id':_0x4ea942}})[_0xbb69('0x17')](function(_0x4aefef){_0x5a6640=_0x4aefef;return db[_0xbb69('0x4e')][_0xbb69('0x4d')]({'where':{'id':_0x4aefef[_0xbb69('0x4f')]},'attributes':['id',_0xbb69('0x50'),_0xbb69('0x51'),_0xbb69('0x52'),'vidaooNote',_0xbb69('0x53')],'raw':!![]});})['then'](function(_0x4c46d9){if(_0x4c46d9&&_0x4c46d9[_0xbb69('0x50')]&&_0x4c46d9[_0xbb69('0x51')]){_0x46e907=_0x4c46d9;var _0x124287={'interaction':{'id':_0x4ea942},'agent':{'id':_0x3b033f[_0xbb69('0x3b')]['id'],'name':_0x3b033f['user'][_0xbb69('0x2b')],'fullname':_0x3b033f[_0xbb69('0x3b')][_0xbb69('0x54')],'email':_0x3b033f[_0xbb69('0x3b')][_0xbb69('0x55')]},'contact':_0x3b033f['body'][_0xbb69('0x2f')],'account':_0x3b033f[_0xbb69('0x4a')][_0xbb69('0x32')]};var _0x42f874={'rejectUnauthorized':![],'method':_0xbb69('0x56'),'url':_0xbb69('0x57'),'headers':{'X-APIKEY':_0x4c46d9['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3b033f[_0xbb69('0x3b')][_0xbb69('0x55')]],'buttons':null,'topic':_0x46e907[_0xbb69('0x52')],'note':_[_0xbb69('0x58')](_0x46e907[_0xbb69('0x59')])?null:getMustacheRender(_0x46e907[_0xbb69('0x59')],_0x124287),'metadata':null},'redirect':_0xbb69('0x5a'),'json':!![]};try{if(!_['isNull'](_0x46e907[_0xbb69('0x53')])){var _0x4c591b=getMustacheRender(_0x46e907[_0xbb69('0x53')],_0x124287);var _0x374755=JSON[_0xbb69('0x5b')](_0x4c591b);_0x42f874[_0xbb69('0x4a')][_0xbb69('0x5c')]=_0x374755;}}catch(_0x28ea56){throw new db[(_0xbb69('0x5d'))][(_0xbb69('0x5e'))](_0xbb69('0x5f'));}return rp(_0x42f874);}else{throw new db['Sequelize'][(_0xbb69('0x5e'))]('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0x304084){_0x3c1c33=_0x304084;if(_0x3c1c33['id']){var _0x1d9638={'body':_0x3c1c33['join_url'],'ChatWebsiteId':_0x46e907['id'],'ChatInteractionId':_0x5a6640['id'],'direction':_0xbb69('0x60'),'UserId':_0x3b033f['user']['id']};return db[_0xbb69('0x61')][_0xbb69('0x49')](_0x1d9638,{});}else{throw new db[(_0xbb69('0x5d'))][(_0xbb69('0x5e'))](_0xbb69('0x62'));}})['then'](function(){return _0x5a6640[_0xbb69('0x63')]({'vidaooSessionId':_0x3c1c33['id']});})['then'](respondWithResult(_0x24b31e,null))[_0xbb69('0x3c')](handleError(_0x24b31e,null));};exports[_0xbb69('0x64')]=function(_0x248dca,_0x438470){if(_0x248dca['body']['id']){delete _0x248dca[_0xbb69('0x4a')]['id'];}return db[_0xbb69('0x35')][_0xbb69('0x48')]({'where':{'id':_0x248dca[_0xbb69('0x3e')]['id']},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xbb69('0x17')](handleEntityNotFound(_0x438470,null))[_0xbb69('0x17')](saveUpdates(_0x248dca[_0xbb69('0x4a')],null))['then'](respondWithResult(_0x438470,null))[_0xbb69('0x3c')](handleError(_0x438470,null));};exports[_0xbb69('0x65')]=function(_0x5aae0a,_0x14dac0){if(_0x5aae0a['body']['id']){delete _0x5aae0a[_0xbb69('0x4a')]['id'];}return db[_0xbb69('0x35')]['find']({'where':{'id':_0x5aae0a[_0xbb69('0x3e')]['id']}})['then'](function(_0x35d073){if(!_0x35d073){logger[_0xbb69('0x1d')](_0xbb69('0x66'),'abandon',0x194,_0xbb69('0x67'));_0x14dac0[_0xbb69('0x29')](0x194);}else{if(_0x35d073[_0xbb69('0x68')]){throw new db[(_0xbb69('0x5d'))][(_0xbb69('0x5e'))](_0xbb69('0x69'));}}return _0x35d073;})[_0xbb69('0x17')](function(_0x5aa1cc){if(_0x5aa1cc){return _0x5aa1cc[_0xbb69('0x27')]({'closed':_0x5aae0a['body'][_0xbb69('0x6a')],'disposition':_0x5aae0a[_0xbb69('0x4a')][_0xbb69('0x6b')]})['then'](function(_0x88da7){return _0x88da7;});}})[_0xbb69('0x17')](function(){return respondWithRpcPromise(_0xbb69('0x6c'),'abandon',_0x5aae0a['body'],client9004);})[_0xbb69('0x17')](respondWithResult(_0x14dac0,null))[_0xbb69('0x3c')](handleError(_0x14dac0,null));};exports[_0xbb69('0x6d')]=function(_0x4be592,_0x139593){_0x4be592[_0xbb69('0x4a')][_0xbb69('0x2b')]=_0x4be592[_0xbb69('0x6e')][_0xbb69('0x6f')];_0x4be592[_0xbb69('0x4a')]['basename']=_0x4be592[_0xbb69('0x6e')]['filename'];_0x4be592[_0xbb69('0x4a')]['type']=_0x4be592[_0xbb69('0x6e')]['mimetype'];return db[_0xbb69('0x70')]['create'](_0x4be592['body'])[_0xbb69('0x17')](respondWithResult(_0x139593,0xc9))['catch'](handleError(_0x139593,null));};exports[_0xbb69('0x71')]=function(_0x30e4a9,_0x4c9874){return db['ChatInteraction']['findOne']({'where':{'id':_0x30e4a9['params']['id']},'raw':!![]})[_0xbb69('0x17')](handleEntityNotFound(_0x4c9874,null))['then'](function(_0x35abe4){if(_0x35abe4){if(_0x35abe4[_0xbb69('0x6a')]){return _0x4c9874[_0xbb69('0x21')](0x193)[_0xbb69('0x72')]({'status':0x193,'message':'Unauthorized'});}return db[_0xbb69('0x70')][_0xbb69('0x4d')]({'where':{'id':_0x30e4a9[_0xbb69('0x3a')]['attachId']},'raw':!![]})[_0xbb69('0x17')](handleEntityNotFound(_0x4c9874,null));}})[_0xbb69('0x17')](function(_0x337cdb){if(_0x337cdb){var _0x2ff842=_0x337cdb[_0xbb69('0x73')]!==null;var _0x2c1ae1=path['join'](config['root'],'server/files/attachments/');if(_0x2ff842){_0x2c1ae1=path['join'](_0x2c1ae1,_0xbb69('0x74'));}var _0xba7922=path['join'](_0x2c1ae1,_0x337cdb[_0xbb69('0x75')]);return _0x4c9874[_0xbb69('0x76')](_0xba7922);}})[_0xbb69('0x3c')](handleError(_0x4c9874,null));};exports[_0xbb69('0x77')]=function(_0xeccc85,_0x53a7dd){var _0x5ad7cf=null;var _0x284bde=null;var _0x4b8c14=null;if(_0xeccc85[_0xbb69('0x4a')]['id']){delete _0xeccc85[_0xbb69('0x4a')]['id'];}if(_0xeccc85[_0xbb69('0x4a')][_0xbb69('0x78')]){_0x4b8c14=path[_0xbb69('0x79')](config[_0xbb69('0x7a')],_0xbb69('0x7b'),util[_0xbb69('0x7c')]('transcript-%s.txt',Date[_0xbb69('0x7d')]()));_0xeccc85[_0xbb69('0x4a')]['pathTranscript']=_0x4b8c14;}return db[_0xbb69('0x35')][_0xbb69('0x48')]({'where':{'id':_0xeccc85[_0xbb69('0x3e')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db['User'],'as':_0xbb69('0x7e')}]}]})[_0xbb69('0x17')](handleEntityNotFound(_0x53a7dd,null))[_0xbb69('0x17')](saveUpdates(_0xeccc85[_0xbb69('0x4a')],null))[_0xbb69('0x17')](function(_0xfd7465){if(_0xfd7465){_0x5ad7cf=_0xfd7465;return db[_0xbb69('0x4e')][_0xbb69('0x48')]({'where':{'id':_0x5ad7cf[_0xbb69('0x4f')]}});}})[_0xbb69('0x17')](function(_0x54644e){if(_0x54644e){_0x284bde=_0x54644e;return db[_0xbb69('0x7f')]['find']({'where':{'id':_0x5ad7cf[_0xbb69('0x80')]}});}})[_0xbb69('0x17')](function(_0x4a3689){if(_0x4a3689){if(_0x4b8c14){var _0x1f1493=null;for(var _0x44212c=0x1;_0x44212c<_0x5ad7cf[_0xbb69('0x81')]['length'];++_0x44212c){_0x1f1493=_0x5ad7cf[_0xbb69('0x81')][_0x44212c];var _0x37882d=_0x1f1493['UserId']?util[_0xbb69('0x7c')]('%s%d',_0x284bde[_0xbb69('0x82')],_0x1f1493[_0xbb69('0x68')]):_0xbb69('0x83');var _0x4754b9=_0xeccc85[_0xbb69('0x4a')][_0xbb69('0x84')]||util[_0xbb69('0x7c')]('%s%d',_0xbb69('0x85'),_0x1f1493['ContactId']);switch(_0x284bde[_0xbb69('0x86')]){case _0xbb69('0x87'):_0x37882d=_0x1f1493[_0xbb69('0x68')]?util[_0xbb69('0x7c')](_0xbb69('0x88'),_0x284bde[_0xbb69('0x82')],_0x1f1493['UserId']):'System';break;case _0xbb69('0x89'):_0x37882d=_0x1f1493[_0xbb69('0x68')]?_0x1f1493[_0xbb69('0x7e')][_0xbb69('0x8a')]||_0x1f1493['User'][_0xbb69('0x54')]:_0xbb69('0x83');break;case _0xbb69('0x8b'):_0x37882d=_0x1f1493['UserId']?_0x1f1493[_0xbb69('0x7e')][_0xbb69('0x54')]:_0xbb69('0x83');break;default:_0x37882d=_0x1f1493[_0xbb69('0x68')]?util['format']('%s%d',_0x284bde[_0xbb69('0x82')],_0x1f1493[_0xbb69('0x68')]):_0xbb69('0x83');}var _0x324ae1=util[_0xbb69('0x7c')](_0xbb69('0x8c'),moment(_0x1f1493[_0xbb69('0x8d')])[_0xbb69('0x7c')](_0xbb69('0x8e')),_0x1f1493[_0xbb69('0x8f')]==='in'?_0x4754b9:_0x37882d,_0x1f1493['body']);if(!_0x1f1493['secret']){fs[_0xbb69('0x90')](_0x4b8c14,_0x324ae1);}}return db[_0xbb69('0x91')][_0xbb69('0x4d')]({'where':{'service':!![]},'include':[{'model':db[_0xbb69('0x92')],'as':_0xbb69('0x93'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xbb69('0x17')](function(_0x253d12){if(!_0x253d12||!_0x253d12[_0xbb69('0x93')]||!_0xeccc85[_0xbb69('0x4a')])return _0x5ad7cf;var _0x159d9a=_0x253d12[_0xbb69('0x94')]();return respondWithRpcPromise(_0xbb69('0x95'),_0xbb69('0x96'),{'account':_0x159d9a,'message':{'from':util[_0xbb69('0x7c')](_0xbb69('0x97'),_0x253d12['name'],_0x253d12[_0xbb69('0x55')]||_0x253d12['Smtp']['user']),'to':_0xeccc85[_0xbb69('0x4a')][_0xbb69('0x78')],'subject':_0xbb69('0x98'),'text':util['format'](_0xbb69('0x99'),_0xeccc85[_0xbb69('0x4a')][_0xbb69('0x78')]),'attachments':[{'path':_0x4b8c14}]}})['then'](function(){return _0x5ad7cf;})[_0xbb69('0x3c')](function(_0x36a719){logger['error'](_0x36a719);});})['then'](respondWithStatusCode(_0x53a7dd,0xc8))[_0xbb69('0x3c')](handleError(_0x53a7dd,null));};exports[_0xbb69('0x9a')]=function(_0x41c1e2,_0x36c887){return db['ChatMessage']['find']({'where':{'id':_0x41c1e2[_0xbb69('0x3e')]['id']}})[_0xbb69('0x17')](handleEntityNotFound(_0x36c887,null))['then'](function(_0x851c22){if(_0x851c22){return _0x851c22[_0xbb69('0x9a')](_0x41c1e2[_0xbb69('0x4a')][_0xbb69('0x9b')],_[_0xbb69('0x9c')](_0x41c1e2[_0xbb69('0x4a')],[_0xbb69('0x9b'),'id'])||{});}})[_0xbb69('0x17')](respondWithResult(_0x36c887,null))[_0xbb69('0x3c')](handleError(_0x36c887,null));};exports['getMessages']=function(_0x15f413,_0x48fe8c){var _0x5303d9={'raw':![],'where':{}};var _0x23c9d4={};var _0x490433={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xbb69('0x4d')]({'where':{'id':_0x15f413[_0xbb69('0x3e')]['id']}})['then'](handleEntityNotFound(_0x48fe8c,null))[_0xbb69('0x17')](function(_0x421efc){if(_0x421efc){_0x23c9d4[_0xbb69('0x3f')]=_['keys'](db[_0xbb69('0x61')][_0xbb69('0x9d')]);_0x23c9d4[_0xbb69('0x3a')]=_[_0xbb69('0x40')](_0x15f413[_0xbb69('0x3a')]);_0x23c9d4[_0xbb69('0x41')]=_[_0xbb69('0x42')](_0x23c9d4[_0xbb69('0x3f')],_0x23c9d4[_0xbb69('0x3a')]);_0x5303d9[_0xbb69('0x43')]=_[_0xbb69('0x42')](_0x23c9d4[_0xbb69('0x3f')],qs[_0xbb69('0x44')](_0x15f413[_0xbb69('0x3a')][_0xbb69('0x44')]));_0x5303d9[_0xbb69('0x43')]=_0x5303d9[_0xbb69('0x43')]['length']?_0x5303d9['attributes']:_0x23c9d4['model'];if(!_0x15f413[_0xbb69('0x3a')][_0xbb69('0x9e')](_0xbb69('0x9f'))){_0x5303d9[_0xbb69('0x24')]=qs[_0xbb69('0x24')](_0x15f413[_0xbb69('0x3a')]['limit']);_0x5303d9['offset']=qs[_0xbb69('0x22')](_0x15f413[_0xbb69('0x3a')][_0xbb69('0x22')]);}_0x5303d9[_0xbb69('0xa0')]=qs[_0xbb69('0xa1')](_0x15f413['query'][_0xbb69('0xa1')]);_0x5303d9['where']=qs[_0xbb69('0x41')](_[_0xbb69('0xa2')](_0x15f413[_0xbb69('0x3a')],_0x23c9d4[_0xbb69('0x41')]));_0x5303d9[_0xbb69('0xa3')]['ChatInteractionId']=_0x421efc['id'];if(_0x15f413[_0xbb69('0x3a')][_0xbb69('0xa4')]){_0x5303d9[_0xbb69('0xa3')]=_['merge'](_0x5303d9['where'],{'$or':_['map'](_0x5303d9[_0xbb69('0x43')],function(_0x234b94){var _0x462310={};_0x462310[_0x234b94]={'$like':'%'+_0x15f413[_0xbb69('0x3a')]['filter']+'%'};return _0x462310;})});}if(_0x15f413['query'][_0xbb69('0xa5')]){var _0x6ce241=_0x15f413['query'][_0xbb69('0xa5')][_0xbb69('0xa6')](',');var _0x4dbe9a={};_0x4dbe9a[_0x6ce241[0x0]]={'$gte':moment(_0x6ce241[0x1])[_0xbb69('0x7c')](_0xbb69('0xa7'))};_0x5303d9[_0xbb69('0xa3')]=_[_0xbb69('0x2e')](_0x5303d9[_0xbb69('0xa3')],_0x4dbe9a);}_0x5303d9=_[_0xbb69('0x2e')]({},_0x5303d9,_0x15f413[_0xbb69('0x47')]);return db[_0xbb69('0x61')][_0xbb69('0xa8')]({'where':_0x5303d9[_0xbb69('0xa3')]})['then'](function(_0x38ab20){_0x490433[_0xbb69('0xa8')]=_0x38ab20;if(_0x15f413['query'][_0xbb69('0x46')]){_0x5303d9[_0xbb69('0xa9')]=[{'all':!![]}];}return db[_0xbb69('0x61')][_0xbb69('0x38')](_0x5303d9);})['then'](function(_0x2aefad){_0x490433[_0xbb69('0xaa')]=_0x2aefad;return _0x490433;});}})[_0xbb69('0x17')](respondWithFilteredResult(_0x48fe8c,_0x5303d9))['catch'](handleError(_0x48fe8c,null));};exports[_0xbb69('0xab')]=function(_0x43afb3,_0x5241de){var _0x2b08e9={'where':{}},_0x49d20e={},_0x3ff0d5={'count':0x0,'rows':[]};return db[_0xbb69('0x35')][_0xbb69('0x4d')]({'where':{'id':_0x43afb3[_0xbb69('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5241de,null))[_0xbb69('0x17')](function(_0x260269){if(_0x260269){_0x49d20e[_0xbb69('0x3f')]=_['keys'](db[_0xbb69('0x61')]['rawAttributes']);_0x49d20e[_0xbb69('0x3a')]=_['keys'](_0x43afb3[_0xbb69('0x3a')]);_0x49d20e[_0xbb69('0x41')]=_[_0xbb69('0x42')](_0x49d20e[_0xbb69('0x3f')],_0x49d20e[_0xbb69('0x3a')]);_0x2b08e9[_0xbb69('0x43')]=_[_0xbb69('0x42')](_0x49d20e[_0xbb69('0x3f')],qs[_0xbb69('0x44')](_0x43afb3[_0xbb69('0x3a')][_0xbb69('0x44')]));_0x2b08e9[_0xbb69('0x43')]=_0x2b08e9['attributes'][_0xbb69('0x45')]?_0x2b08e9[_0xbb69('0x43')]:_0x49d20e[_0xbb69('0x3f')];if(!_0x43afb3[_0xbb69('0x3a')][_0xbb69('0x9e')](_0xbb69('0x9f'))){_0x2b08e9[_0xbb69('0x24')]=qs[_0xbb69('0x24')](_0x43afb3[_0xbb69('0x3a')][_0xbb69('0x24')]);_0x2b08e9['offset']=qs[_0xbb69('0x22')](_0x43afb3['query']['offset']);}_0x2b08e9['order']=qs[_0xbb69('0xa1')](_0x43afb3[_0xbb69('0x3a')]['sort']);_0x2b08e9['where']=qs['filters'](_[_0xbb69('0xa2')](_0x43afb3[_0xbb69('0x3a')],_0x49d20e[_0xbb69('0x41')]));_0x2b08e9['where'][_0xbb69('0xac')]=_0x260269['id'];if(_0x43afb3[_0xbb69('0x3a')][_0xbb69('0xa4')]){_0x2b08e9[_0xbb69('0xa3')]=_[_0xbb69('0x2e')](_0x2b08e9[_0xbb69('0xa3')],{'$or':_[_0xbb69('0x34')](_0x2b08e9[_0xbb69('0x43')],function(_0xcdf0b6){var _0x3f6e03={};_0x3f6e03[_0xcdf0b6]={'$like':'%'+_0x43afb3[_0xbb69('0x3a')][_0xbb69('0xa4')]+'%'};return _0x3f6e03;})});}_0x2b08e9[_0xbb69('0xa3')][_0xbb69('0xad')]=![];if(_0x43afb3[_0xbb69('0x3a')]['id']){_0x2b08e9[_0xbb69('0xa3')]['id']={'$gt':_0x43afb3[_0xbb69('0x3a')]['id']};}_0x2b08e9=_['merge']({},_0x2b08e9,_0x43afb3[_0xbb69('0x47')]);return db['ChatMessage']['count']({'where':_0x2b08e9['where']})[_0xbb69('0x17')](function(_0xaad9a9){_0x3ff0d5['count']=_0xaad9a9;_0x2b08e9[_0xbb69('0xa9')]=[];if(_0x43afb3[_0xbb69('0x3a')][_0xbb69('0xae')]){_0x2b08e9[_0xbb69('0xa9')][_0xbb69('0xaf')]({'model':db[_0xbb69('0x7e')],'as':_0xbb69('0x7e'),'attributes':['id','fullname',_0xbb69('0x8a')]});}if(_0x43afb3[_0xbb69('0x3a')][_0xbb69('0x46')]){_0x2b08e9['include']=[{'all':!![]}];}return db[_0xbb69('0x61')][_0xbb69('0x38')](_0x2b08e9);})['then'](function(_0x49b867){_0x3ff0d5[_0xbb69('0xaa')]=_0x49b867;return _0x3ff0d5;});}})['then'](respondWithFilteredResult(_0x5241de,_0x2b08e9))[_0xbb69('0x3c')](handleError(_0x5241de,null));};exports[_0xbb69('0xb0')]=function(_0x125519,_0x3b6c13){return db[_0xbb69('0x35')]['find']({'where':{'id':_0x125519[_0xbb69('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3b6c13,null))['then'](function(_0x23022b){if(_0x23022b){return _0x23022b[_0xbb69('0xb1')](_0x125519[_0xbb69('0x4a')][_0xbb69('0x9b')],_[_0xbb69('0x9c')](_0x125519[_0xbb69('0x4a')],['ids','id'])||{})['spread'](function(){return db[_0xbb69('0xb2')][_0xbb69('0x38')]({'attributes':['id','name',_0xbb69('0xb3')],'where':{'id':_0x125519[_0xbb69('0x4a')][_0xbb69('0x9b')]}});})[_0xbb69('0x17')](function(_0x54100b){socket[_0xbb69('0xb4')](_0xbb69('0xb5'),{'id':Number(_0x125519[_0xbb69('0x3e')]['id']),'tags':_0x54100b||[]});return{'id':Number(_0x125519[_0xbb69('0x3e')]['id']),'tags':_0x54100b||[]};});}})[_0xbb69('0x17')](respondWithResult(_0x3b6c13,null))['catch'](handleError(_0x3b6c13,null));};exports[_0xbb69('0xb6')]=function(_0x74d7c6,_0x404938){return db[_0xbb69('0x35')]['find']({'where':{'id':_0x74d7c6[_0xbb69('0x3e')]['id']}})['then'](handleEntityNotFound(_0x404938,null))['then'](function(_0x41b0e5){if(_0x41b0e5){return _0x41b0e5['removeTags'](_0x74d7c6[_0xbb69('0x3a')]['ids']);}})[_0xbb69('0x17')](respondWithStatusCode(_0x404938,null))[_0xbb69('0x3c')](handleError(_0x404938,null));};exports[_0xbb69('0x76')]=function(_0x38bfd,_0x10d44b){var _0x87f1f6=moment()[_0xbb69('0xb7')]()['toString']();var _0x31f30b=path['join'](config[_0xbb69('0x7a')],'server',_0xbb69('0xb8'),'tmp');var _0x2c4dd1=path[_0xbb69('0x79')](config[_0xbb69('0x7a')],_0xbb69('0xb9'),'files',_0xbb69('0xba'));var _0x2b3bb4=path['join'](_0x31f30b,_0x87f1f6);var _0xdc21c=util['format']('transcript-%d-%s.zip',_0x38bfd[_0xbb69('0x3e')]['id'],_0x87f1f6);var _0x3fb95d=path[_0xbb69('0x79')](_0x31f30b,_0xdc21c);var _0x35b64c=[];_0x35b64c[_0xbb69('0xaf')]({'model':db[_0xbb69('0x7e')],'as':'User','attributes':['id',_0xbb69('0x54')],'raw':!![]});_0x35b64c[_0xbb69('0xaf')]({'model':db['CmContact'],'as':_0xbb69('0xbb'),'attributes':['id',_0xbb69('0xbc'),'lastName'],'raw':!![]});if(_0x38bfd[_0xbb69('0x3a')][_0xbb69('0xba')]){_0x35b64c[_0xbb69('0xaf')]({'model':db['Attachment'],'as':_0xbb69('0x70'),'raw':!![]});}var _0x3543e4=[{'model':db[_0xbb69('0x61')],'as':_0xbb69('0x81'),'attributes':['id',_0xbb69('0x4a'),'createdAt',_0xbb69('0x8f'),'secret',_0xbb69('0xbd')],'include':_0x35b64c}];_0x3543e4[_0xbb69('0xaf')]({'model':db[_0xbb69('0x4e')],'as':_0xbb69('0xbe'),'attributes':['id',_0xbb69('0x2b')]});_0x3543e4[_0xbb69('0xaf')]({'model':db[_0xbb69('0x7e')],'as':'Owner','attributes':['id',_0xbb69('0x54')]});return db[_0xbb69('0x35')][_0xbb69('0x48')]({'where':{'id':_0x38bfd[_0xbb69('0x3e')]['id']},'include':_0x3543e4})[_0xbb69('0x17')](handleEntityNotFound(_0x10d44b,null))[_0xbb69('0x17')](function(_0x126c09){if(_0x126c09){var _0x3cb750=_0x126c09[_0xbb69('0xbf')]({'plain':!![]});fs[_0xbb69('0xc0')](_0x2b3bb4);var _0x9f72bc={'channel':_0xbb69('0xc1'),'account':_0x3cb750['Account'][_0xbb69('0x2b')],'agent':_0x3cb750[_0xbb69('0xc2')]?_0x3cb750[_0xbb69('0xc2')]['fullname']:_0xbb69('0xc3'),'createdAt':moment(_0x3cb750[_0xbb69('0x8d')])[_0xbb69('0x7c')](_0xbb69('0xa7'))[_0xbb69('0xc4')](),'closedAt':_0x3cb750[_0xbb69('0x6a')]?moment(_0x3cb750[_0xbb69('0xc5')])['format'](_0xbb69('0xa7'))[_0xbb69('0xc4')]():'','disposition':_0x3cb750[_0xbb69('0x6b')],'chatInfo':{'browser':_0x3cb750['browserName'],'os':_0x3cb750[_0xbb69('0xc6')],'referer':_0x3cb750['referer'],'customerIp':_0x3cb750[_0xbb69('0xc7')],'customerPort':_0x3cb750['customerPort']?_0x3cb750[_0xbb69('0xc8')]:_0xbb69('0xc3')},'messages':_(_0x3cb750[_0xbb69('0x81')])[_0xbb69('0xc9')]()[_0xbb69('0xa4')]({'secret':![]})['map'](function(_0x1072c2){if(_0x1072c2[_0xbb69('0x70')]){var _0xd997d6=path[_0xbb69('0x79')](_0x2c4dd1,_0x1072c2[_0xbb69('0x70')][_0xbb69('0x75')]);if(fs['existsSync'](_0xd997d6)){fs['createReadStream'](_0xd997d6)[_0xbb69('0xca')](fs[_0xbb69('0xcb')](path[_0xbb69('0x79')](_0x2b3bb4,_0x1072c2['Attachment'][_0xbb69('0x75')])));}}return{'date':moment(_0x1072c2['createdAt'])[_0xbb69('0x7c')](_0xbb69('0xa7'))[_0xbb69('0xc4')](),'sender':_0x1072c2[_0xbb69('0x8f')]===_0xbb69('0x60')?_0x1072c2[_0xbb69('0x7e')]?_0x1072c2['User'][_0xbb69('0x54')]:'System':_0x1072c2[_0xbb69('0xbb')][_0xbb69('0xbc')]+(_0x1072c2[_0xbb69('0xbb')][_0xbb69('0xcc')]?'\x20'+_0x1072c2[_0xbb69('0xbb')]['lastName']:''),'body':_0x1072c2[_0xbb69('0x70')]?_0x1072c2[_0xbb69('0x70')]['basename']:_0x1072c2[_0xbb69('0x4a')],'direction':_0x1072c2['direction']===_0xbb69('0x60')?'A':'C','secret':_0x1072c2[_0xbb69('0xad')],'read':_0x1072c2['read'],'attachment':_0x1072c2[_0xbb69('0x70')]};})[_0xbb69('0xcd')]()};return ejs['renderFile'](path[_0xbb69('0x79')](config['root'],_0xbb69('0xb9'),'views',_0xbb69('0xce')),{'interaction':_0x9f72bc})[_0xbb69('0x17')](function(_0x3ae7){var _0x1d33bc=path[_0xbb69('0x79')](_0x2b3bb4,_0xbb69('0xcf')+_0x3cb750['id']+'-'+_0x87f1f6+_0xbb69('0xd0'));var _0x16f1e2={'path':_0x1d33bc,'channel':'Chat','interactionId':_0x3cb750['id']};return pdf[_0xbb69('0xd1')](_0x3ae7,_0x16f1e2);})[_0xbb69('0x17')](function(){return new Promise(function(_0xcefef2,_0xdf41c6){zipdir(_0x2b3bb4,{'saveTo':_0x3fb95d},function(_0x35c8b0,_0x35c4e1){if(_0x35c8b0)return _0xdf41c6(_0x35c8b0);return _0xcefef2(_0x35c4e1);});})[_0xbb69('0x17')](function(){return new BPromise(function(_0x459645,_0x94b53){rimraf(_0x2b3bb4,function(_0x44bbd0){if(_0x44bbd0)_0x94b53(_0x44bbd0);return _0x459645();});});})['then'](function(){return _0x10d44b['download'](_0x3fb95d,_0xdc21c,function(_0x345462){if(_0x345462){logger[_0xbb69('0x1d')]('err',_0x345462);}else{fs[_0xbb69('0xd2')](_0x3fb95d);}});});});}else{return _0x10d44b[_0xbb69('0x29')](0xc8);}})[_0xbb69('0x3c')](handleError(_0x10d44b,null));};
\ No newline at end of file
+var _0x3a01=['attachmentDownload','closed','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','format','transcript-%s.txt','now','pathTranscript','Messages','User','ChatWebsite','ChatWebsiteId','ContactId','agentAlias','System','%s%d','agentIdentifier','website_alias','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','order','sort','where','pick','ChatInteractionId','filter','map','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rows','hasOwnProperty','includeAgent','addTags','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','tmp','attachments','transcript-%d-%s.zip','push','firstName','lastName','read','Account','Owner','Chat','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','tail','basename','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','moment','bluebird','util','path','ejs','lodash','../../components/export/pdf','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','stack','name','send','render','merge','contact','account','index','ChatInteraction','rawAttributes','key','getOptions','findAll','chat','query','user','params','keys','intersection','model','attributes','fields','length','includeAll','include','options','find','create','body','describe','createVidaooSession','findOne','vidaooNote','vidaooMetadata','vidaooEscalation','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooApiKey','isNull','follow','parse','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','UserId','AbandonInteraction','attachmentUpload','file','originalname','type','Attachment'];(function(_0xfcddad,_0x58b6f6){var _0x3317d1=function(_0xe99a55){while(--_0xe99a55){_0xfcddad['push'](_0xfcddad['shift']());}};_0x3317d1(++_0x58b6f6);}(_0x3a01,0x12f));var _0x13a0=function(_0x494950,_0x3857cc){_0x494950=_0x494950-0x0;var _0x17df80=_0x3a01[_0x494950];return _0x17df80;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x13a0('0x0'));var moment=require(_0x13a0('0x1'));var BPromise=require(_0x13a0('0x2'));var Mustache=require('mustache');var util=require(_0x13a0('0x3'));var path=require(_0x13a0('0x4'));var ejs=require(_0x13a0('0x5'));var fs=require('fs');var _=require(_0x13a0('0x6'));var Redis=require('ioredis');var interaction=require('../../components/interaction/service');var qs=require('../../components/parsers/qs');var pdf=require(_0x13a0('0x7'));var logger=require(_0x13a0('0x8'))('api');var config=require(_0x13a0('0x9'));var db=require('../../mysqldb')['db'];config[_0x13a0('0xa')]=_[_0x13a0('0xb')](config[_0x13a0('0xa')],{'host':_0x13a0('0xc'),'port':0x18eb});var socket=require(_0x13a0('0xd'))(new Redis(config[_0x13a0('0xa')]));require('./chatInteraction.socket')[_0x13a0('0xe')](socket);var jayson=require(_0x13a0('0xf'));var client=jayson[_0x13a0('0x10')]['http']({'port':0x232b});var client9004=jayson[_0x13a0('0x10')][_0x13a0('0x11')]({'port':0x232c});function respondWithRpcPromise(_0x4ed0fe,_0x48a762,_0x1a5edd,_0x190347){return new BPromise(function(_0x495afb,_0x307429){var _0x54b6b5=_0x190347||client;return _0x54b6b5[_0x13a0('0x12')](_0x4ed0fe,_0x1a5edd)[_0x13a0('0x13')](function(_0x1331d0){logger[_0x13a0('0x14')](_0x13a0('0x15'),_0x48a762,_0x13a0('0x16'));logger[_0x13a0('0x17')](_0x13a0('0x18'),_0x48a762,_0x13a0('0x16'),JSON[_0x13a0('0x19')](_0x1331d0));if(_0x1331d0[_0x13a0('0x1a')]){if(_0x1331d0['error'][_0x13a0('0x1b')]===0x1f4){logger[_0x13a0('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x48a762,_0x1331d0[_0x13a0('0x1a')][_0x13a0('0x1c')]);return _0x307429(_0x1331d0[_0x13a0('0x1a')][_0x13a0('0x1c')]);}logger[_0x13a0('0x1a')](_0x13a0('0x15'),_0x48a762,_0x1331d0['error']['message']);return _0x495afb(_0x1331d0['error'][_0x13a0('0x1c')]);}else{logger['info'](_0x13a0('0x15'),_0x48a762,_0x13a0('0x16'));_0x495afb(_0x1331d0['result'][_0x13a0('0x1c')]);}})[_0x13a0('0x1d')](function(_0x3d00bb){logger[_0x13a0('0x1a')](_0x13a0('0x15'),_0x48a762,_0x3d00bb);_0x307429(_0x3d00bb);});});}function respondWithStatusCode(_0x3f3c4f,_0x1dcca6){_0x1dcca6=_0x1dcca6||0xcc;return function(_0x292daa){if(_0x292daa){return _0x3f3c4f[_0x13a0('0x1e')](_0x1dcca6);}return _0x3f3c4f[_0x13a0('0x1f')](_0x1dcca6)[_0x13a0('0x20')]();};}function respondWithResult(_0x2660c9,_0x2d5387){_0x2d5387=_0x2d5387||0xc8;return function(_0x351077){if(_0x351077){return _0x2660c9[_0x13a0('0x1f')](_0x2d5387)[_0x13a0('0x21')](_0x351077);}};}function respondWithFilteredResult(_0x1cae53,_0x498426){return function(_0x1da541){if(_0x1da541){var _0x5bb1a4=typeof _0x498426[_0x13a0('0x22')]===_0x13a0('0x23')&&typeof _0x498426['limit']===_0x13a0('0x23');var _0x374fb0=_0x1da541[_0x13a0('0x24')];var _0x481f45=_0x5bb1a4?0x0:_0x498426['offset'];var _0x4d1129=_0x5bb1a4?_0x1da541[_0x13a0('0x24')]:_0x498426[_0x13a0('0x22')]+_0x498426[_0x13a0('0x25')];var _0x34944e;if(_0x4d1129>=_0x374fb0){_0x4d1129=_0x374fb0;_0x34944e=0xc8;}else{_0x34944e=0xce;}_0x1cae53[_0x13a0('0x1f')](_0x34944e);return _0x1cae53[_0x13a0('0x26')](_0x13a0('0x27'),_0x481f45+'-'+_0x4d1129+'/'+_0x374fb0)[_0x13a0('0x21')](_0x1da541);}return null;};}function saveUpdates(_0x1928f3){return function(_0x1eec92){if(_0x1eec92){return _0x1eec92[_0x13a0('0x28')](_0x1928f3)['then'](function(_0x47a42b){return _0x47a42b;});}return null;};}function removeEntity(_0x345bab){return function(_0x11f57c){if(_0x11f57c){return _0x11f57c[_0x13a0('0x29')]()[_0x13a0('0x13')](function(){_0x345bab['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x373c3c){return function(_0x22c155){if(!_0x22c155){_0x373c3c['sendStatus'](0x194);}return _0x22c155;};}function handleError(_0x5c478a,_0x105c82){_0x105c82=_0x105c82||0x1f4;return function(_0x373d7b){logger['error'](_0x373d7b[_0x13a0('0x2a')]);if(_0x373d7b[_0x13a0('0x2b')]){delete _0x373d7b['name'];}_0x5c478a[_0x13a0('0x1f')](_0x105c82)[_0x13a0('0x2c')](_0x373d7b);};}function getMustacheRender(_0x66ef3a,_0x539d5a){return Mustache[_0x13a0('0x2d')](_0x66ef3a,_[_0x13a0('0x2e')](_0x539d5a['body'],{'contact':_0x539d5a[_0x13a0('0x2f')],'message':_0x539d5a[_0x13a0('0x1c')],'agent':_0x539d5a['agent'],'interaction':_0x539d5a['interaction'],'account':_0x539d5a[_0x13a0('0x30')]}))||'';}exports[_0x13a0('0x31')]=function(_0x2357af,_0x16fb7d){var _0x36cc40={};var _0x1d45e1=_['map'](db[_0x13a0('0x32')][_0x13a0('0x33')],function(_0x3d3d8a){return{'name':_0x3d3d8a['fieldName'],'type':_0x3d3d8a['type'][_0x13a0('0x34')]};});_0x36cc40=qs[_0x13a0('0x35')](_0x1d45e1,_0x2357af);return interaction[_0x13a0('0x36')](_0x13a0('0x37'),_0x2357af[_0x13a0('0x38')],_0x2357af[_0x13a0('0x39')],_0x36cc40,_0x1d45e1)[_0x13a0('0x13')](respondWithFilteredResult(_0x16fb7d,_0x36cc40))[_0x13a0('0x1d')](handleError(_0x16fb7d,null));};exports['show']=function(_0x150195,_0x35d4bd){var _0x1536b2={'raw':![],'where':{'id':_0x150195[_0x13a0('0x3a')]['id']}},_0x1d6132={};_0x1d6132['model']=_[_0x13a0('0x3b')](db[_0x13a0('0x32')][_0x13a0('0x33')]);_0x1d6132[_0x13a0('0x38')]=_['keys'](_0x150195[_0x13a0('0x38')]);_0x1d6132['filters']=_[_0x13a0('0x3c')](_0x1d6132[_0x13a0('0x3d')],_0x1d6132[_0x13a0('0x38')]);_0x1536b2[_0x13a0('0x3e')]=_[_0x13a0('0x3c')](_0x1d6132[_0x13a0('0x3d')],qs[_0x13a0('0x3f')](_0x150195['query'][_0x13a0('0x3f')]));_0x1536b2['attributes']=_0x1536b2[_0x13a0('0x3e')][_0x13a0('0x40')]?_0x1536b2[_0x13a0('0x3e')]:_0x1d6132[_0x13a0('0x3d')];if(_0x150195[_0x13a0('0x38')][_0x13a0('0x41')]){_0x1536b2[_0x13a0('0x42')]=[{'all':!![]}];}_0x1536b2=_[_0x13a0('0x2e')]({},_0x1536b2,_0x150195[_0x13a0('0x43')]);return db[_0x13a0('0x32')][_0x13a0('0x44')](_0x1536b2)[_0x13a0('0x13')](handleEntityNotFound(_0x35d4bd,null))[_0x13a0('0x13')](respondWithResult(_0x35d4bd,null))['catch'](handleError(_0x35d4bd,null));};exports[_0x13a0('0x45')]=function(_0x9f77b1,_0x2255dd){return db[_0x13a0('0x32')][_0x13a0('0x45')](_0x9f77b1[_0x13a0('0x46')],{})[_0x13a0('0x13')](respondWithResult(_0x2255dd,0xc9))[_0x13a0('0x1d')](handleError(_0x2255dd,null));};exports[_0x13a0('0x28')]=function(_0x56704e,_0xe4b584){if(_0x56704e['body']['id']){delete _0x56704e[_0x13a0('0x46')]['id'];}return db['ChatInteraction'][_0x13a0('0x44')]({'where':{'id':_0x56704e[_0x13a0('0x3a')]['id']}})[_0x13a0('0x13')](handleEntityNotFound(_0xe4b584,null))[_0x13a0('0x13')](saveUpdates(_0x56704e[_0x13a0('0x46')],null))[_0x13a0('0x13')](respondWithResult(_0xe4b584,null))[_0x13a0('0x1d')](handleError(_0xe4b584,null));};exports['destroy']=function(_0x4dbb42,_0x4b9818){return db[_0x13a0('0x32')][_0x13a0('0x44')]({'where':{'id':_0x4dbb42[_0x13a0('0x3a')]['id']}})[_0x13a0('0x13')](handleEntityNotFound(_0x4b9818,null))[_0x13a0('0x13')](removeEntity(_0x4b9818,null))[_0x13a0('0x1d')](handleError(_0x4b9818,null));};exports[_0x13a0('0x47')]=function(_0x421dde,_0x2b9eee){return db['ChatInteraction'][_0x13a0('0x47')]()[_0x13a0('0x13')](respondWithResult(_0x2b9eee,null))['catch'](handleError(_0x2b9eee,null));};exports[_0x13a0('0x48')]=function(_0x2b6833,_0x18456d){var _0x58063a=_0x2b6833['params']['id'];var _0x7b680;var _0x3e8c44;var _0x16578d;return db[_0x13a0('0x32')][_0x13a0('0x49')]({'where':{'id':_0x58063a}})[_0x13a0('0x13')](function(_0x5753ed){_0x7b680=_0x5753ed;return db['ChatWebsite'][_0x13a0('0x49')]({'where':{'id':_0x5753ed['ChatWebsiteId']},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0x13a0('0x4a'),_0x13a0('0x4b')],'raw':!![]});})[_0x13a0('0x13')](function(_0xda943c){if(_0xda943c&&_0xda943c['vidaooApiKey']&&_0xda943c[_0x13a0('0x4c')]){_0x3e8c44=_0xda943c;var _0x12391b={'interaction':{'id':_0x58063a},'agent':{'id':_0x2b6833[_0x13a0('0x39')]['id'],'name':_0x2b6833[_0x13a0('0x39')][_0x13a0('0x2b')],'fullname':_0x2b6833['user'][_0x13a0('0x4d')],'email':_0x2b6833[_0x13a0('0x39')][_0x13a0('0x4e')]},'contact':_0x2b6833['body'][_0x13a0('0x2f')],'account':_0x2b6833[_0x13a0('0x46')][_0x13a0('0x30')]};var _0x19dedb={'rejectUnauthorized':![],'method':_0x13a0('0x4f'),'url':_0x13a0('0x50'),'headers':{'X-APIKEY':_0xda943c[_0x13a0('0x51')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x2b6833[_0x13a0('0x39')][_0x13a0('0x4e')]],'buttons':null,'topic':_0x3e8c44['vidaooTopic'],'note':_[_0x13a0('0x52')](_0x3e8c44['vidaooNote'])?null:getMustacheRender(_0x3e8c44[_0x13a0('0x4a')],_0x12391b),'metadata':null},'redirect':_0x13a0('0x53'),'json':!![]};try{if(!_[_0x13a0('0x52')](_0x3e8c44['vidaooMetadata'])){var _0x2041d1=getMustacheRender(_0x3e8c44[_0x13a0('0x4b')],_0x12391b);var _0x637c55=JSON[_0x13a0('0x54')](_0x2041d1);_0x19dedb[_0x13a0('0x46')][_0x13a0('0x55')]=_0x637c55;}}catch(_0x3d9c64){throw new db[(_0x13a0('0x56'))][(_0x13a0('0x57'))](_0x13a0('0x58'));}return rp(_0x19dedb);}else{throw new db[(_0x13a0('0x56'))][(_0x13a0('0x57'))](_0x13a0('0x59'));}})[_0x13a0('0x13')](function(_0x55f50e){_0x16578d=_0x55f50e;if(_0x16578d['id']){var _0x34bceb={'body':_0x16578d[_0x13a0('0x5a')],'ChatWebsiteId':_0x3e8c44['id'],'ChatInteractionId':_0x7b680['id'],'direction':_0x13a0('0x5b'),'UserId':_0x2b6833[_0x13a0('0x39')]['id']};return db[_0x13a0('0x5c')][_0x13a0('0x45')](_0x34bceb,{});}else{throw new db['Sequelize'][(_0x13a0('0x57'))](_0x13a0('0x5d'));}})[_0x13a0('0x13')](function(){return _0x7b680[_0x13a0('0x5e')]({'vidaooSessionId':_0x16578d['id']});})['then'](respondWithResult(_0x18456d,null))[_0x13a0('0x1d')](handleError(_0x18456d,null));};exports[_0x13a0('0x5f')]=function(_0x299f15,_0x28edf2){if(_0x299f15[_0x13a0('0x46')]['id']){delete _0x299f15[_0x13a0('0x46')]['id'];}return db['ChatInteraction'][_0x13a0('0x44')]({'where':{'id':_0x299f15[_0x13a0('0x3a')]['id']},'include':[{'model':db[_0x13a0('0x60')],'as':_0x13a0('0x61')}]})['then'](handleEntityNotFound(_0x28edf2,null))[_0x13a0('0x13')](saveUpdates(_0x299f15[_0x13a0('0x46')],null))[_0x13a0('0x13')](respondWithResult(_0x28edf2,null))['catch'](handleError(_0x28edf2,null));};exports[_0x13a0('0x62')]=function(_0x514d45,_0x1ffa56){if(_0x514d45[_0x13a0('0x46')]['id']){delete _0x514d45['body']['id'];}return db[_0x13a0('0x32')]['find']({'where':{'id':_0x514d45[_0x13a0('0x3a')]['id']}})[_0x13a0('0x13')](function(_0x1820d5){if(!_0x1820d5){logger[_0x13a0('0x1a')](_0x13a0('0x63'),'abandon',0x194,'entity\x20not\x20found');_0x1ffa56[_0x13a0('0x1e')](0x194);}else{if(_0x1820d5[_0x13a0('0x64')]){throw new db[(_0x13a0('0x56'))][(_0x13a0('0x57'))]('Interaction\x20already\x20assigned');}}return _0x1820d5;})['then'](function(_0x47f481){if(_0x47f481){return _0x47f481[_0x13a0('0x28')]({'closed':_0x514d45['body']['closed'],'disposition':_0x514d45['body']['disposition']})[_0x13a0('0x13')](function(_0xb70d87){return _0xb70d87;});}})[_0x13a0('0x13')](function(){return respondWithRpcPromise(_0x13a0('0x65'),'abandon',_0x514d45[_0x13a0('0x46')],client9004);})[_0x13a0('0x13')](respondWithResult(_0x1ffa56,null))[_0x13a0('0x1d')](handleError(_0x1ffa56,null));};exports[_0x13a0('0x66')]=function(_0x921843,_0x232120){_0x921843['body'][_0x13a0('0x2b')]=_0x921843[_0x13a0('0x67')][_0x13a0('0x68')];_0x921843[_0x13a0('0x46')]['basename']=_0x921843[_0x13a0('0x67')]['filename'];_0x921843[_0x13a0('0x46')][_0x13a0('0x69')]=_0x921843[_0x13a0('0x67')]['mimetype'];return db[_0x13a0('0x6a')][_0x13a0('0x45')](_0x921843[_0x13a0('0x46')])[_0x13a0('0x13')](respondWithResult(_0x232120,0xc9))[_0x13a0('0x1d')](handleError(_0x232120,null));};exports[_0x13a0('0x6b')]=function(_0x329fb3,_0x314f5c){return db['ChatInteraction'][_0x13a0('0x49')]({'where':{'id':_0x329fb3[_0x13a0('0x3a')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x314f5c,null))[_0x13a0('0x13')](function(_0x4bd172){if(_0x4bd172){if(_0x4bd172[_0x13a0('0x6c')]){return _0x314f5c[_0x13a0('0x1f')](0x193)[_0x13a0('0x21')]({'status':0x193,'message':_0x13a0('0x6d')});}return db[_0x13a0('0x6a')]['findOne']({'where':{'id':_0x329fb3['query']['attachId']},'raw':!![]})[_0x13a0('0x13')](handleEntityNotFound(_0x314f5c,null));}})[_0x13a0('0x13')](function(_0x4e32bc){if(_0x4e32bc){var _0x40a5c5=_0x4e32bc[_0x13a0('0x6e')]!==null;var _0x1c47c2=path[_0x13a0('0x6f')](config[_0x13a0('0x70')],_0x13a0('0x71'));if(_0x40a5c5){_0x1c47c2=path[_0x13a0('0x6f')](_0x1c47c2,_0x13a0('0x72'));}var _0x120aaf=path[_0x13a0('0x6f')](_0x1c47c2,_0x4e32bc['basename']);return _0x314f5c[_0x13a0('0x73')](_0x120aaf);}})['catch'](handleError(_0x314f5c,null));};exports[_0x13a0('0x74')]=function(_0x2ba043,_0x2a86c3){var _0x1be34f=null;var _0x5466a1=null;var _0x1166a5=null;if(_0x2ba043[_0x13a0('0x46')]['id']){delete _0x2ba043[_0x13a0('0x46')]['id'];}if(_0x2ba043[_0x13a0('0x46')][_0x13a0('0x75')]){_0x1166a5=path[_0x13a0('0x6f')](config['root'],'server/files/chat/upload/',util[_0x13a0('0x76')](_0x13a0('0x77'),Date[_0x13a0('0x78')]()));_0x2ba043[_0x13a0('0x46')][_0x13a0('0x79')]=_0x1166a5;}return db[_0x13a0('0x32')][_0x13a0('0x44')]({'where':{'id':_0x2ba043['params']['id']},'include':[{'model':db[_0x13a0('0x5c')],'as':_0x13a0('0x7a'),'include':[{'model':db['User'],'as':_0x13a0('0x7b')}]}]})[_0x13a0('0x13')](handleEntityNotFound(_0x2a86c3,null))['then'](saveUpdates(_0x2ba043[_0x13a0('0x46')],null))[_0x13a0('0x13')](function(_0x8b6d76){if(_0x8b6d76){_0x1be34f=_0x8b6d76;return db[_0x13a0('0x7c')][_0x13a0('0x44')]({'where':{'id':_0x1be34f[_0x13a0('0x7d')]}});}})[_0x13a0('0x13')](function(_0x535cb4){if(_0x535cb4){_0x5466a1=_0x535cb4;return db[_0x13a0('0x60')][_0x13a0('0x44')]({'where':{'id':_0x1be34f[_0x13a0('0x7e')]}});}})['then'](function(_0x5b0491){if(_0x5b0491){if(_0x1166a5){var _0x181f08=null;for(var _0x19c445=0x1;_0x19c445<_0x1be34f[_0x13a0('0x7a')][_0x13a0('0x40')];++_0x19c445){_0x181f08=_0x1be34f[_0x13a0('0x7a')][_0x19c445];var _0x2b40f1=_0x181f08[_0x13a0('0x64')]?util[_0x13a0('0x76')]('%s%d',_0x5466a1[_0x13a0('0x7f')],_0x181f08['UserId']):_0x13a0('0x80');var _0x3522f4=_0x2ba043[_0x13a0('0x46')]['customer']||util[_0x13a0('0x76')](_0x13a0('0x81'),'Visitor',_0x181f08['ContactId']);switch(_0x5466a1[_0x13a0('0x82')]){case _0x13a0('0x83'):_0x2b40f1=_0x181f08['UserId']?util[_0x13a0('0x76')](_0x13a0('0x81'),_0x5466a1[_0x13a0('0x7f')],_0x181f08['UserId']):_0x13a0('0x80');break;case _0x13a0('0x84'):_0x2b40f1=_0x181f08[_0x13a0('0x64')]?_0x181f08[_0x13a0('0x7b')][_0x13a0('0x85')]||_0x181f08['User'][_0x13a0('0x4d')]:_0x13a0('0x80');break;case'agent_fullname':_0x2b40f1=_0x181f08[_0x13a0('0x64')]?_0x181f08[_0x13a0('0x7b')][_0x13a0('0x4d')]:_0x13a0('0x80');break;default:_0x2b40f1=_0x181f08[_0x13a0('0x64')]?util[_0x13a0('0x76')]('%s%d',_0x5466a1[_0x13a0('0x7f')],_0x181f08[_0x13a0('0x64')]):'System';}var _0x3d1e1f=util['format'](_0x13a0('0x86'),moment(_0x181f08[_0x13a0('0x87')])[_0x13a0('0x76')](_0x13a0('0x88')),_0x181f08[_0x13a0('0x89')]==='in'?_0x3522f4:_0x2b40f1,_0x181f08[_0x13a0('0x46')]);if(!_0x181f08[_0x13a0('0x8a')]){fs[_0x13a0('0x8b')](_0x1166a5,_0x3d1e1f);}}return db['MailAccount'][_0x13a0('0x49')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0x13a0('0x13')](function(_0x9d9aa8){if(!_0x9d9aa8||!_0x9d9aa8[_0x13a0('0x8c')]||!_0x2ba043[_0x13a0('0x46')])return _0x1be34f;var _0x345d9e=_0x9d9aa8[_0x13a0('0x8d')]();return respondWithRpcPromise(_0x13a0('0x8e'),_0x13a0('0x8f'),{'account':_0x345d9e,'message':{'from':util['format'](_0x13a0('0x90'),_0x9d9aa8[_0x13a0('0x2b')],_0x9d9aa8['email']||_0x9d9aa8['Smtp'][_0x13a0('0x39')]),'to':_0x2ba043[_0x13a0('0x46')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format'](_0x13a0('0x91'),_0x2ba043[_0x13a0('0x46')][_0x13a0('0x75')]),'attachments':[{'path':_0x1166a5}]}})[_0x13a0('0x13')](function(){return _0x1be34f;})['catch'](function(_0x337abe){logger[_0x13a0('0x1a')](_0x337abe);});})[_0x13a0('0x13')](respondWithStatusCode(_0x2a86c3,0xc8))['catch'](handleError(_0x2a86c3,null));};exports['addMessage']=function(_0xa95053,_0x2ed4fd){return db[_0x13a0('0x5c')]['find']({'where':{'id':_0xa95053[_0x13a0('0x3a')]['id']}})[_0x13a0('0x13')](handleEntityNotFound(_0x2ed4fd,null))[_0x13a0('0x13')](function(_0x17da83){if(_0x17da83){return _0x17da83[_0x13a0('0x92')](_0xa95053[_0x13a0('0x46')][_0x13a0('0x93')],_[_0x13a0('0x94')](_0xa95053['body'],[_0x13a0('0x93'),'id'])||{});}})['then'](respondWithResult(_0x2ed4fd,null))['catch'](handleError(_0x2ed4fd,null));};exports[_0x13a0('0x95')]=function(_0xd6268,_0x19cb49){var _0x5c6e8b={'raw':![],'where':{}};var _0x3b8e87={};var _0x249d1c={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x13a0('0x49')]({'where':{'id':_0xd6268['params']['id']}})[_0x13a0('0x13')](handleEntityNotFound(_0x19cb49,null))['then'](function(_0xbafd5a){if(_0xbafd5a){_0x3b8e87[_0x13a0('0x3d')]=_[_0x13a0('0x3b')](db[_0x13a0('0x5c')]['rawAttributes']);_0x3b8e87[_0x13a0('0x38')]=_[_0x13a0('0x3b')](_0xd6268[_0x13a0('0x38')]);_0x3b8e87[_0x13a0('0x96')]=_['intersection'](_0x3b8e87['model'],_0x3b8e87[_0x13a0('0x38')]);_0x5c6e8b[_0x13a0('0x3e')]=_[_0x13a0('0x3c')](_0x3b8e87['model'],qs[_0x13a0('0x3f')](_0xd6268[_0x13a0('0x38')]['fields']));_0x5c6e8b['attributes']=_0x5c6e8b[_0x13a0('0x3e')][_0x13a0('0x40')]?_0x5c6e8b[_0x13a0('0x3e')]:_0x3b8e87[_0x13a0('0x3d')];if(!_0xd6268[_0x13a0('0x38')]['hasOwnProperty']('nolimit')){_0x5c6e8b[_0x13a0('0x25')]=qs[_0x13a0('0x25')](_0xd6268[_0x13a0('0x38')][_0x13a0('0x25')]);_0x5c6e8b['offset']=qs['offset'](_0xd6268[_0x13a0('0x38')]['offset']);}_0x5c6e8b[_0x13a0('0x97')]=qs['sort'](_0xd6268[_0x13a0('0x38')][_0x13a0('0x98')]);_0x5c6e8b[_0x13a0('0x99')]=qs['filters'](_[_0x13a0('0x9a')](_0xd6268['query'],_0x3b8e87[_0x13a0('0x96')]));_0x5c6e8b[_0x13a0('0x99')][_0x13a0('0x9b')]=_0xbafd5a['id'];if(_0xd6268['query'][_0x13a0('0x9c')]){_0x5c6e8b[_0x13a0('0x99')]=_[_0x13a0('0x2e')](_0x5c6e8b[_0x13a0('0x99')],{'$or':_[_0x13a0('0x9d')](_0x5c6e8b[_0x13a0('0x3e')],function(_0x371672){var _0x1888a3={};_0x1888a3[_0x371672]={'$like':'%'+_0xd6268['query']['filter']+'%'};return _0x1888a3;})});}if(_0xd6268['query'][_0x13a0('0x9e')]){var _0x3936d2=_0xd6268[_0x13a0('0x38')][_0x13a0('0x9e')][_0x13a0('0x9f')](',');var _0x27693b={};_0x27693b[_0x3936d2[0x0]]={'$gte':moment(_0x3936d2[0x1])['format'](_0x13a0('0xa0'))};_0x5c6e8b['where']=_[_0x13a0('0x2e')](_0x5c6e8b[_0x13a0('0x99')],_0x27693b);}_0x5c6e8b=_[_0x13a0('0x2e')]({},_0x5c6e8b,_0xd6268[_0x13a0('0x43')]);return db['ChatMessage']['count']({'where':_0x5c6e8b['where']})['then'](function(_0x16244b){_0x249d1c[_0x13a0('0x24')]=_0x16244b;if(_0xd6268[_0x13a0('0x38')][_0x13a0('0x41')]){_0x5c6e8b[_0x13a0('0x42')]=[{'all':!![]}];}return db[_0x13a0('0x5c')][_0x13a0('0x36')](_0x5c6e8b);})[_0x13a0('0x13')](function(_0x146200){_0x249d1c[_0x13a0('0xa1')]=_0x146200;return _0x249d1c;});}})[_0x13a0('0x13')](respondWithFilteredResult(_0x19cb49,_0x5c6e8b))[_0x13a0('0x1d')](handleError(_0x19cb49,null));};exports['getMyMessages']=function(_0x5dc376,_0x107b1f){var _0x5c0f8b={'where':{}},_0xe3f784={},_0x35e40b={'count':0x0,'rows':[]};return db[_0x13a0('0x32')][_0x13a0('0x49')]({'where':{'id':_0x5dc376[_0x13a0('0x3a')]['id']}})['then'](handleEntityNotFound(_0x107b1f,null))[_0x13a0('0x13')](function(_0x52f496){if(_0x52f496){_0xe3f784[_0x13a0('0x3d')]=_[_0x13a0('0x3b')](db[_0x13a0('0x5c')][_0x13a0('0x33')]);_0xe3f784[_0x13a0('0x38')]=_[_0x13a0('0x3b')](_0x5dc376['query']);_0xe3f784[_0x13a0('0x96')]=_[_0x13a0('0x3c')](_0xe3f784[_0x13a0('0x3d')],_0xe3f784[_0x13a0('0x38')]);_0x5c0f8b['attributes']=_[_0x13a0('0x3c')](_0xe3f784[_0x13a0('0x3d')],qs[_0x13a0('0x3f')](_0x5dc376[_0x13a0('0x38')][_0x13a0('0x3f')]));_0x5c0f8b[_0x13a0('0x3e')]=_0x5c0f8b[_0x13a0('0x3e')]['length']?_0x5c0f8b[_0x13a0('0x3e')]:_0xe3f784[_0x13a0('0x3d')];if(!_0x5dc376[_0x13a0('0x38')][_0x13a0('0xa2')]('nolimit')){_0x5c0f8b[_0x13a0('0x25')]=qs[_0x13a0('0x25')](_0x5dc376['query'][_0x13a0('0x25')]);_0x5c0f8b[_0x13a0('0x22')]=qs[_0x13a0('0x22')](_0x5dc376[_0x13a0('0x38')]['offset']);}_0x5c0f8b[_0x13a0('0x97')]=qs[_0x13a0('0x98')](_0x5dc376['query']['sort']);_0x5c0f8b[_0x13a0('0x99')]=qs[_0x13a0('0x96')](_[_0x13a0('0x9a')](_0x5dc376[_0x13a0('0x38')],_0xe3f784['filters']));_0x5c0f8b[_0x13a0('0x99')]['ChatInteractionId']=_0x52f496['id'];if(_0x5dc376[_0x13a0('0x38')][_0x13a0('0x9c')]){_0x5c0f8b['where']=_[_0x13a0('0x2e')](_0x5c0f8b[_0x13a0('0x99')],{'$or':_[_0x13a0('0x9d')](_0x5c0f8b[_0x13a0('0x3e')],function(_0x285aaf){var _0xc9b210={};_0xc9b210[_0x285aaf]={'$like':'%'+_0x5dc376[_0x13a0('0x38')][_0x13a0('0x9c')]+'%'};return _0xc9b210;})});}_0x5c0f8b[_0x13a0('0x99')]['secret']=![];if(_0x5dc376[_0x13a0('0x38')]['id']){_0x5c0f8b[_0x13a0('0x99')]['id']={'$gt':_0x5dc376['query']['id']};}_0x5c0f8b=_[_0x13a0('0x2e')]({},_0x5c0f8b,_0x5dc376['options']);return db[_0x13a0('0x5c')][_0x13a0('0x24')]({'where':_0x5c0f8b[_0x13a0('0x99')]})[_0x13a0('0x13')](function(_0x2e4fe0){_0x35e40b[_0x13a0('0x24')]=_0x2e4fe0;_0x5c0f8b[_0x13a0('0x42')]=[];if(_0x5dc376['query'][_0x13a0('0xa3')]){_0x5c0f8b['include']['push']({'model':db[_0x13a0('0x7b')],'as':_0x13a0('0x7b'),'attributes':['id','fullname',_0x13a0('0x85')]});}if(_0x5dc376[_0x13a0('0x38')][_0x13a0('0x41')]){_0x5c0f8b[_0x13a0('0x42')]=[{'all':!![]}];}return db[_0x13a0('0x5c')][_0x13a0('0x36')](_0x5c0f8b);})[_0x13a0('0x13')](function(_0x46149a){_0x35e40b['rows']=_0x46149a;return _0x35e40b;});}})['then'](respondWithFilteredResult(_0x107b1f,_0x5c0f8b))['catch'](handleError(_0x107b1f,null));};exports[_0x13a0('0xa4')]=function(_0x5d9ffd,_0x1dd539){return db[_0x13a0('0x32')][_0x13a0('0x44')]({'where':{'id':_0x5d9ffd[_0x13a0('0x3a')]['id']}})[_0x13a0('0x13')](handleEntityNotFound(_0x1dd539,null))['then'](function(_0x3a65d6){if(_0x3a65d6){return _0x3a65d6[_0x13a0('0xa5')](_0x5d9ffd['body'][_0x13a0('0x93')],_[_0x13a0('0x94')](_0x5d9ffd[_0x13a0('0x46')],['ids','id'])||{})[_0x13a0('0xa6')](function(){return db['Tag'][_0x13a0('0x36')]({'attributes':['id',_0x13a0('0x2b'),_0x13a0('0xa7')],'where':{'id':_0x5d9ffd[_0x13a0('0x46')][_0x13a0('0x93')]}});})[_0x13a0('0x13')](function(_0x3ad0fa){socket[_0x13a0('0xa8')](_0x13a0('0xa9'),{'id':Number(_0x5d9ffd[_0x13a0('0x3a')]['id']),'tags':_0x3ad0fa||[]});return{'id':Number(_0x5d9ffd[_0x13a0('0x3a')]['id']),'tags':_0x3ad0fa||[]};});}})['then'](respondWithResult(_0x1dd539,null))[_0x13a0('0x1d')](handleError(_0x1dd539,null));};exports[_0x13a0('0xaa')]=function(_0x20ca90,_0x4a46fd){return db['ChatInteraction'][_0x13a0('0x44')]({'where':{'id':_0x20ca90[_0x13a0('0x3a')]['id']}})[_0x13a0('0x13')](handleEntityNotFound(_0x4a46fd,null))[_0x13a0('0x13')](function(_0x205e3b){if(_0x205e3b){return _0x205e3b['removeTags'](_0x20ca90[_0x13a0('0x38')]['ids']);}})[_0x13a0('0x13')](respondWithStatusCode(_0x4a46fd,null))[_0x13a0('0x1d')](handleError(_0x4a46fd,null));};exports[_0x13a0('0x73')]=function(_0x1e58fa,_0x2854a0){var _0x414257=moment()[_0x13a0('0xab')]()[_0x13a0('0xac')]();var _0x17f996=path[_0x13a0('0x6f')](config[_0x13a0('0x70')],_0x13a0('0xad'),'files',_0x13a0('0xae'));var _0x1c478b=path[_0x13a0('0x6f')](config[_0x13a0('0x70')],_0x13a0('0xad'),'files',_0x13a0('0xaf'));var _0x1e8f77=path['join'](_0x17f996,_0x414257);var _0x16fa6a=util[_0x13a0('0x76')](_0x13a0('0xb0'),_0x1e58fa[_0x13a0('0x3a')]['id'],_0x414257);var _0x93c21f=path[_0x13a0('0x6f')](_0x17f996,_0x16fa6a);var _0x45e34c=[];_0x45e34c['push']({'model':db[_0x13a0('0x7b')],'as':_0x13a0('0x7b'),'attributes':['id',_0x13a0('0x4d')],'raw':!![]});_0x45e34c[_0x13a0('0xb1')]({'model':db[_0x13a0('0x60')],'as':'Contact','attributes':['id',_0x13a0('0xb2'),_0x13a0('0xb3')],'raw':!![]});if(_0x1e58fa[_0x13a0('0x38')][_0x13a0('0xaf')]){_0x45e34c[_0x13a0('0xb1')]({'model':db[_0x13a0('0x6a')],'as':'Attachment','raw':!![]});}var _0x515f63=[{'model':db[_0x13a0('0x5c')],'as':_0x13a0('0x7a'),'attributes':['id','body',_0x13a0('0x87'),_0x13a0('0x89'),_0x13a0('0x8a'),_0x13a0('0xb4')],'include':_0x45e34c}];_0x515f63[_0x13a0('0xb1')]({'model':db[_0x13a0('0x7c')],'as':_0x13a0('0xb5'),'attributes':['id',_0x13a0('0x2b')]});_0x515f63[_0x13a0('0xb1')]({'model':db[_0x13a0('0x7b')],'as':_0x13a0('0xb6'),'attributes':['id',_0x13a0('0x4d')]});return db[_0x13a0('0x32')]['find']({'where':{'id':_0x1e58fa[_0x13a0('0x3a')]['id']},'include':_0x515f63})[_0x13a0('0x13')](handleEntityNotFound(_0x2854a0,null))['then'](function(_0x40f897){if(_0x40f897){var _0x17168b=_0x40f897['get']({'plain':!![]});fs['mkdirSync'](_0x1e8f77);var _0x2f3252={'channel':_0x13a0('0xb7'),'account':_0x17168b[_0x13a0('0xb5')][_0x13a0('0x2b')],'agent':_0x17168b['Owner']?_0x17168b[_0x13a0('0xb6')]['fullname']:_0x13a0('0xb8'),'createdAt':moment(_0x17168b[_0x13a0('0x87')])[_0x13a0('0x76')](_0x13a0('0xa0'))['toString'](),'closedAt':_0x17168b[_0x13a0('0x6c')]?moment(_0x17168b[_0x13a0('0xb9')])[_0x13a0('0x76')](_0x13a0('0xa0'))[_0x13a0('0xac')]():'','disposition':_0x17168b['disposition'],'chatInfo':{'browser':_0x17168b[_0x13a0('0xba')],'os':_0x17168b[_0x13a0('0xbb')],'referer':_0x17168b[_0x13a0('0xbc')],'customerIp':_0x17168b[_0x13a0('0xbd')],'customerPort':_0x17168b['customerPort']?_0x17168b[_0x13a0('0xbe')]:_0x13a0('0xb8')},'messages':_(_0x17168b[_0x13a0('0x7a')])[_0x13a0('0xbf')]()[_0x13a0('0x9c')]({'secret':![]})[_0x13a0('0x9d')](function(_0x2dda2d){if(_0x2dda2d[_0x13a0('0x6a')]){var _0x26c424=path[_0x13a0('0x6f')](_0x1c478b,_0x2dda2d[_0x13a0('0x6a')][_0x13a0('0xc0')]);if(fs[_0x13a0('0xc1')](_0x26c424)){fs[_0x13a0('0xc2')](_0x26c424)[_0x13a0('0xc3')](fs[_0x13a0('0xc4')](path['join'](_0x1e8f77,_0x2dda2d[_0x13a0('0x6a')][_0x13a0('0xc0')])));}}return{'date':moment(_0x2dda2d[_0x13a0('0x87')])[_0x13a0('0x76')](_0x13a0('0xa0'))['toString'](),'sender':_0x2dda2d[_0x13a0('0x89')]===_0x13a0('0x5b')?_0x2dda2d[_0x13a0('0x7b')]?_0x2dda2d['User'][_0x13a0('0x4d')]:'System':_0x2dda2d['Contact'][_0x13a0('0xb2')]+(_0x2dda2d[_0x13a0('0x61')][_0x13a0('0xb3')]?'\x20'+_0x2dda2d[_0x13a0('0x61')][_0x13a0('0xb3')]:''),'body':_0x2dda2d[_0x13a0('0x6a')]?_0x2dda2d[_0x13a0('0x6a')][_0x13a0('0xc0')]:_0x2dda2d[_0x13a0('0x46')],'direction':_0x2dda2d[_0x13a0('0x89')]==='out'?'A':'C','secret':_0x2dda2d[_0x13a0('0x8a')],'read':_0x2dda2d['read'],'attachment':_0x2dda2d['Attachment']};})[_0x13a0('0xc5')]()};return ejs[_0x13a0('0xc6')](path['join'](config['root'],'server',_0x13a0('0xc7'),'downloadInteraction.ejs'),{'interaction':_0x2f3252})['then'](function(_0x3926a7){var _0xfe5f81=path[_0x13a0('0x6f')](_0x1e8f77,_0x13a0('0xc8')+_0x17168b['id']+'-'+_0x414257+_0x13a0('0xc9'));var _0x2b5697={'path':_0xfe5f81,'channel':'Chat','interactionId':_0x17168b['id']};return pdf[_0x13a0('0xca')](_0x3926a7,_0x2b5697);})['then'](function(){return new Promise(function(_0x153da8,_0x390cb2){zipdir(_0x1e8f77,{'saveTo':_0x93c21f},function(_0x4a67ee,_0x572e31){if(_0x4a67ee)return _0x390cb2(_0x4a67ee);return _0x153da8(_0x572e31);});})[_0x13a0('0x13')](function(){return new BPromise(function(_0x82152e,_0x3494d3){rimraf(_0x1e8f77,function(_0x38f833){if(_0x38f833)_0x3494d3(_0x38f833);return _0x82152e();});});})[_0x13a0('0x13')](function(){return _0x2854a0[_0x13a0('0x73')](_0x93c21f,_0x16fa6a,function(_0x458a04){if(_0x458a04){logger[_0x13a0('0x1a')](_0x13a0('0xcb'),_0x458a04);}else{fs[_0x13a0('0xcc')](_0x93c21f);}});});});}else{return _0x2854a0['sendStatus'](0xc8);}})[_0x13a0('0x1d')](handleError(_0x2854a0,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 29392b8..3756919 100644
--- a/server/api/chatInteraction/chatInteraction.events.js
+++ b/server/api/chatInteraction/chatInteraction.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x25b0=['Users','map','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x25b0,0x171));var _0x025b=function(_0x2fdce0,_0x496242){_0x2fdce0=_0x2fdce0-0x0;var _0x36f07e=_0x25b0[_0x2fdce0];return _0x36f07e;};'use strict';var EventEmitter=require(_0x025b('0x0'));var ChatInteraction=require(_0x025b('0x1'))['db'][_0x025b('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x025b('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x025b('0x4')](0x0);var events={'afterCreate':_0x025b('0x5'),'afterUpdate':_0x025b('0x6'),'afterDestroy':_0x025b('0x7')};function emitEvent(_0x3faa4a){return function(_0x30b4f8,_0x4daa26,_0x48ea27){_0x30b4f8[_0x025b('0x8')]({'attributes':['id'],'raw':!![]})[_0x025b('0x9')](function(_0x20866b){_0x30b4f8[_0x025b('0xa')](_0x025b('0xb'),_0x20866b[_0x025b('0xc')](function(_0x58d850){return{'id':_0x58d850['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x30b4f8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x33866e){_0x30b4f8[_0x025b('0xa')](_0x025b('0xd'),_0x33866e[_0x025b('0xe')]);ChatInteractionEvents[_0x025b('0xf')](_0x3faa4a+':'+_0x30b4f8['id'],_0x30b4f8);ChatInteractionEvents['emit'](_0x3faa4a,_0x30b4f8);_0x48ea27(null);})[_0x025b('0x10')](_0x48ea27(null));};}for(var e in events){if(events[_0x025b('0x11')](e)){var event=events[e];ChatInteraction[_0x025b('0x12')](e,emitEvent(event));}}module[_0x025b('0x13')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x0a42=['setDataValue','unreadMessages','length','emit','catch','events','../../mysqldb','ChatMessage','setMaxListeners','remove','getUsers','then','Users','map','findAll'];(function(_0x5affdd,_0xe6a38d){var _0xbbf06=function(_0x5ec3cf){while(--_0x5ec3cf){_0x5affdd['push'](_0x5affdd['shift']());}};_0xbbf06(++_0xe6a38d);}(_0x0a42,0x18b));var _0x20a4=function(_0x9a5233,_0x5a24f8){_0x9a5233=_0x9a5233-0x0;var _0x1185a8=_0x0a42[_0x9a5233];return _0x1185a8;};'use strict';var EventEmitter=require(_0x20a4('0x0'));var ChatInteraction=require('../../mysqldb')['db']['ChatInteraction'];var ChatMessage=require(_0x20a4('0x1'))['db'][_0x20a4('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x20a4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x20a4('0x4')};function emitEvent(_0x3bb8ec){return function(_0x5504a3,_0x22801d,_0xdf5a5e){_0x5504a3[_0x20a4('0x5')]({'attributes':['id'],'raw':!![]})[_0x20a4('0x6')](function(_0x6f41ee){_0x5504a3['setDataValue'](_0x20a4('0x7'),_0x6f41ee[_0x20a4('0x8')](function(_0x4d968c){return{'id':_0x4d968c['id']};}));return ChatMessage[_0x20a4('0x9')]({'where':{'ChatInteractionId':_0x5504a3['id'],'direction':'in','read':![]},'raw':!![]});})[_0x20a4('0x6')](function(_0x135ee7){_0x5504a3[_0x20a4('0xa')](_0x20a4('0xb'),_0x135ee7[_0x20a4('0xc')]);ChatInteractionEvents['emit'](_0x3bb8ec+':'+_0x5504a3['id'],_0x5504a3);ChatInteractionEvents[_0x20a4('0xd')](_0x3bb8ec,_0x5504a3);_0xdf5a5e(null);})[_0x20a4('0xe')](_0xdf5a5e(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 1ca8484..ac63f93 100644
--- a/server/api/chatInteraction/chatInteraction.model.js
+++ b/server/api/chatInteraction/chatInteraction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0c61=['bluebird','request-promise','path','./chatInteraction.attributes','exports','define','ChatInteraction','changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api'];(function(_0x4e471c,_0x59adec){var _0x3bcb52=function(_0x48aa67){while(--_0x48aa67){_0x4e471c['push'](_0x4e471c['shift']());}};_0x3bcb52(++_0x59adec);}(_0x0c61,0xfd));var _0x10c6=function(_0x33554b,_0x48162b){_0x33554b=_0x33554b-0x0;var _0x256954=_0x0c61[_0x33554b];return _0x256954;};'use strict';var _=require(_0x10c6('0x0'));var util=require('util');var logger=require(_0x10c6('0x1'))(_0x10c6('0x2'));var moment=require('moment');var BPromise=require(_0x10c6('0x3'));var rp=require(_0x10c6('0x4'));var fs=require('fs');var path=require(_0x10c6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x10c6('0x6'));module[_0x10c6('0x7')]=function(_0x520de2,_0x5eb94c){return _0x520de2[_0x10c6('0x8')](_0x10c6('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2578c7,_0x45312f,_0x4f58f6){if(_0x2578c7[_0x10c6('0xa')](_0x10c6('0xb'))){_0x2578c7[_0x10c6('0xc')]=moment()[_0x10c6('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x4f58f6(null,_0x2578c7);}},'charset':_0x10c6('0xe'),'collate':_0x10c6('0xf')});};
\ No newline at end of file
+var _0xf52f=['ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','../../config/logger','moment','request-promise','path','../../config/environment','./chatInteraction.attributes','exports','define'];(function(_0xedf695,_0x40a10e){var _0x40ceda=function(_0x6e3a9a){while(--_0x6e3a9a){_0xedf695['push'](_0xedf695['shift']());}};_0x40ceda(++_0x40a10e);}(_0xf52f,0x1b2));var _0xff52=function(_0x1f8a2a,_0x906b0f){_0x1f8a2a=_0x1f8a2a-0x0;var _0x4dcaa7=_0xf52f[_0x1f8a2a];return _0x4dcaa7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xff52('0x0'))('api');var moment=require(_0xff52('0x1'));var BPromise=require('bluebird');var rp=require(_0xff52('0x2'));var fs=require('fs');var path=require(_0xff52('0x3'));var rimraf=require('rimraf');var config=require(_0xff52('0x4'));var attributes=require(_0xff52('0x5'));module[_0xff52('0x6')]=function(_0x32ca50,_0x18e315){return _0x32ca50[_0xff52('0x7')](_0xff52('0x8'),attributes,{'tableName':_0xff52('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x308647,_0x4a4050,_0x9f0bde){if(_0x308647[_0xff52('0xa')](_0xff52('0xb'))){_0x308647[_0xff52('0xc')]=moment()[_0xff52('0xd')](_0xff52('0xe'));}_0x9f0bde(null,_0x308647);}},'charset':_0xff52('0xf'),'collate':_0xff52('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index 0e2c9c9..0b9fcec 100644
--- a/server/api/chatInteraction/chatInteraction.rpc.js
+++ b/server/api/chatInteraction/chatInteraction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x31ce=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','code','error','message','catch','UpdateChatInteraction','update','body','options','raw','where','attributes','limit','AddTagsToChatInteraction','addTags','omit','AddTags','util','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x576170,_0x1712ae){var _0x397c70=function(_0x2eb9de){while(--_0x2eb9de){_0x576170['push'](_0x576170['shift']());}};_0x397c70(++_0x1712ae);}(_0x31ce,0xaf));var _0xe31c=function(_0x18daeb,_0x1b8ff3){_0x18daeb=_0x18daeb-0x0;var _0x425a30=_0x31ce[_0x18daeb];return _0x425a30;};'use strict';var _=require('lodash');var util=require(_0xe31c('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe31c('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe31c('0x2'))['db'];var utils=require(_0xe31c('0x3'));var logger=require(_0xe31c('0x4'))(_0xe31c('0x5'));var config=require(_0xe31c('0x6'));var jayson=require(_0xe31c('0x7'));var client=jayson[_0xe31c('0x8')][_0xe31c('0x9')]({'port':0x232a});config[_0xe31c('0xa')]=_[_0xe31c('0xb')](config[_0xe31c('0xa')],{'host':_0xe31c('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xe31c('0xa')]));require(_0xe31c('0xd'))[_0xe31c('0xe')](socket);function respondWithRpcPromise(_0x367b1b,_0x29ee72,_0x43dc29){return new BPromise(function(_0x193258,_0x2b8a19){return client['request'](_0x367b1b,_0x43dc29)[_0xe31c('0xf')](function(_0x219d3b){logger[_0xe31c('0x10')](_0xe31c('0x11'),_0x29ee72,'request\x20sent');logger[_0xe31c('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x29ee72,_0xe31c('0x13'),JSON['stringify'](_0x219d3b));if(_0x219d3b['error']){if(_0x219d3b['error'][_0xe31c('0x14')]===0x1f4){logger['error'](_0xe31c('0x11'),_0x29ee72,_0x219d3b[_0xe31c('0x15')][_0xe31c('0x16')]);return _0x2b8a19(_0x219d3b[_0xe31c('0x15')][_0xe31c('0x16')]);}logger[_0xe31c('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x29ee72,_0x219d3b[_0xe31c('0x15')]['message']);return _0x193258(_0x219d3b[_0xe31c('0x15')]['message']);}else{logger[_0xe31c('0x10')](_0xe31c('0x11'),_0x29ee72,'request\x20sent');_0x193258(_0x219d3b['result']['message']);}})[_0xe31c('0x17')](function(_0x3069ab){logger[_0xe31c('0x15')](_0xe31c('0x11'),_0x29ee72,_0x3069ab);_0x2b8a19(_0x3069ab);});});}exports[_0xe31c('0x18')]=function(_0x10e673){var _0x55587b=this;return new Promise(function(_0x39a8bf,_0x2bae8c){return db['ChatInteraction'][_0xe31c('0x19')](_0x10e673[_0xe31c('0x1a')],{'raw':_0x10e673[_0xe31c('0x1b')]?_0x10e673[_0xe31c('0x1b')][_0xe31c('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10e673[_0xe31c('0x1b')]?_0x10e673[_0xe31c('0x1b')][_0xe31c('0x1d')]||null:null,'attributes':_0x10e673[_0xe31c('0x1b')]?_0x10e673['options'][_0xe31c('0x1e')]||null:null,'limit':_0x10e673[_0xe31c('0x1b')]?_0x10e673[_0xe31c('0x1b')][_0xe31c('0x1f')]||null:null})[_0xe31c('0xf')](function(_0x2acb60){logger[_0xe31c('0x10')](_0xe31c('0x18'),_0x10e673);logger[_0xe31c('0x12')](_0xe31c('0x18'),_0x10e673,JSON['stringify'](_0x2acb60));_0x39a8bf(_0x2acb60);})['catch'](function(_0x345ae2){logger[_0xe31c('0x15')](_0xe31c('0x18'),_0x345ae2['message'],_0x10e673);_0x2bae8c(_0x55587b[_0xe31c('0x15')](0x1f4,_0x345ae2[_0xe31c('0x16')]));});});};exports[_0xe31c('0x20')]=function(_0x139e53){return new Promise(function(_0x37abd6,_0x2a7f47){return db['ChatInteraction']['find']({'where':_0x139e53[_0xe31c('0x1b')]?_0x139e53['options']['where']||null:null})[_0xe31c('0xf')](function(_0x210006){if(_0x210006){return _0x210006[_0xe31c('0x21')](_0x139e53[_0xe31c('0x1a')]['ids'],_[_0xe31c('0x22')](_0x139e53[_0xe31c('0x1a')],['ids','id'])||{});}})['spread'](function(_0x31e51d){logger[_0xe31c('0x10')]('AddTags',_0x139e53);logger[_0xe31c('0x12')](_0xe31c('0x23'),_0x139e53,JSON['stringify'](_0x31e51d));_0x37abd6(_0x31e51d);})['catch'](function(_0x478a7d){logger[_0xe31c('0x15')]('AddTags',_0x478a7d[_0xe31c('0x16')],_0x139e53);_0x2a7f47(_this[_0xe31c('0x15')](0x1f4,_0x478a7d['message']));});});};
\ No newline at end of file
+var _0x2cb9=['AddTags','stringify','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','request','then','request\x20sent','debug','code','ChatInteraction,\x20%s,\x20%s','error','message','info','result','ChatInteraction','options','raw','where','attributes','UpdateChatInteraction','catch','AddTagsToChatInteraction','find','body','omit'];(function(_0x9d14e3,_0x5a6072){var _0x19bf32=function(_0x19da07){while(--_0x19da07){_0x9d14e3['push'](_0x9d14e3['shift']());}};_0x19bf32(++_0x5a6072);}(_0x2cb9,0xb1));var _0x92cb=function(_0x5788c6,_0x1c4789){_0x5788c6=_0x5788c6-0x0;var _0x106973=_0x2cb9[_0x5788c6];return _0x106973;};'use strict';var _=require(_0x92cb('0x0'));var util=require(_0x92cb('0x1'));var moment=require(_0x92cb('0x2'));var BPromise=require('bluebird');var rs=require(_0x92cb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x92cb('0x4'));var logger=require(_0x92cb('0x5'))(_0x92cb('0x6'));var config=require(_0x92cb('0x7'));var jayson=require(_0x92cb('0x8'));var client=jayson['client'][_0x92cb('0x9')]({'port':0x232a});config[_0x92cb('0xa')]=_['defaults'](config[_0x92cb('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x92cb('0xb'))(new Redis(config[_0x92cb('0xa')]));require('./chatInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x39e96b,_0x3bbd97,_0x27fb4a){return new BPromise(function(_0x5d08f6,_0x1bffb4){return client[_0x92cb('0xc')](_0x39e96b,_0x27fb4a)[_0x92cb('0xd')](function(_0x2767a1){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x3bbd97,_0x92cb('0xe'));logger[_0x92cb('0xf')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3bbd97,_0x92cb('0xe'),JSON['stringify'](_0x2767a1));if(_0x2767a1['error']){if(_0x2767a1['error'][_0x92cb('0x10')]===0x1f4){logger['error'](_0x92cb('0x11'),_0x3bbd97,_0x2767a1[_0x92cb('0x12')][_0x92cb('0x13')]);return _0x1bffb4(_0x2767a1[_0x92cb('0x12')][_0x92cb('0x13')]);}logger[_0x92cb('0x12')](_0x92cb('0x11'),_0x3bbd97,_0x2767a1[_0x92cb('0x12')][_0x92cb('0x13')]);return _0x5d08f6(_0x2767a1[_0x92cb('0x12')][_0x92cb('0x13')]);}else{logger[_0x92cb('0x14')](_0x92cb('0x11'),_0x3bbd97,'request\x20sent');_0x5d08f6(_0x2767a1[_0x92cb('0x15')][_0x92cb('0x13')]);}})['catch'](function(_0x485a4d){logger[_0x92cb('0x12')]('ChatInteraction,\x20%s,\x20%s',_0x3bbd97,_0x485a4d);_0x1bffb4(_0x485a4d);});});}exports['UpdateChatInteraction']=function(_0x2023c1){var _0x4b303c=this;return new Promise(function(_0x4a0200,_0xff2ea){return db[_0x92cb('0x16')]['update'](_0x2023c1['body'],{'raw':_0x2023c1[_0x92cb('0x17')]?_0x2023c1[_0x92cb('0x17')][_0x92cb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2023c1[_0x92cb('0x17')]?_0x2023c1[_0x92cb('0x17')][_0x92cb('0x19')]||null:null,'attributes':_0x2023c1['options']?_0x2023c1[_0x92cb('0x17')][_0x92cb('0x1a')]||null:null,'limit':_0x2023c1[_0x92cb('0x17')]?_0x2023c1[_0x92cb('0x17')]['limit']||null:null})[_0x92cb('0xd')](function(_0x57dc51){logger[_0x92cb('0x14')](_0x92cb('0x1b'),_0x2023c1);logger[_0x92cb('0xf')](_0x92cb('0x1b'),_0x2023c1,JSON['stringify'](_0x57dc51));_0x4a0200(_0x57dc51);})[_0x92cb('0x1c')](function(_0x5e75c0){logger[_0x92cb('0x12')](_0x92cb('0x1b'),_0x5e75c0[_0x92cb('0x13')],_0x2023c1);_0xff2ea(_0x4b303c[_0x92cb('0x12')](0x1f4,_0x5e75c0[_0x92cb('0x13')]));});});};exports[_0x92cb('0x1d')]=function(_0x14cdcf){return new Promise(function(_0x25deaa,_0xafc9fa){return db[_0x92cb('0x16')][_0x92cb('0x1e')]({'where':_0x14cdcf[_0x92cb('0x17')]?_0x14cdcf[_0x92cb('0x17')][_0x92cb('0x19')]||null:null})['then'](function(_0x1d79aa){if(_0x1d79aa){return _0x1d79aa['addTags'](_0x14cdcf[_0x92cb('0x1f')]['ids'],_[_0x92cb('0x20')](_0x14cdcf['body'],['ids','id'])||{});}})['spread'](function(_0x493a10){logger[_0x92cb('0x14')]('AddTags',_0x14cdcf);logger[_0x92cb('0xf')](_0x92cb('0x21'),_0x14cdcf,JSON[_0x92cb('0x22')](_0x493a10));_0x25deaa(_0x493a10);})[_0x92cb('0x1c')](function(_0x4efc79){logger[_0x92cb('0x12')](_0x92cb('0x21'),_0x4efc79[_0x92cb('0x13')],_0x14cdcf);_0xafc9fa(_this['error'](0x1f4,_0x4efc79[_0x92cb('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index b518ad6..a10ff8d 100644
--- a/server/api/chatInteraction/chatInteraction.socket.js
+++ b/server/api/chatInteraction/chatInteraction.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf12b=['save','update','emit','removeListener','length','chatInteraction:','./chatInteraction.events'];(function(_0x2040e3,_0x58adb2){var _0x781add=function(_0x4b0423){while(--_0x4b0423){_0x2040e3['push'](_0x2040e3['shift']());}};_0x781add(++_0x58adb2);}(_0xf12b,0x133));var _0xbf12=function(_0x414a4e,_0x2441b2){_0x414a4e=_0x414a4e-0x0;var _0x5e4e15=_0xf12b[_0x414a4e];return _0x5e4e15;};'use strict';var ChatInteractionEvents=require(_0xbf12('0x0'));var events=[_0xbf12('0x1'),'remove',_0xbf12('0x2')];function createListener(_0x1ca3a9,_0x2d3f25){return function(_0x559e65){_0x2d3f25[_0xbf12('0x3')](_0x1ca3a9,_0x559e65);};}function removeListener(_0x370724,_0x3a0949){return function(){ChatInteractionEvents[_0xbf12('0x4')](_0x370724,_0x3a0949);};}exports['register']=function(_0x2853ad){for(var _0x45d4ee=0x0,_0x4bd615=events[_0xbf12('0x5')];_0x45d4ee<_0x4bd615;_0x45d4ee++){var _0x4190c1=events[_0x45d4ee];var _0x1c26ca=createListener(_0xbf12('0x6')+_0x4190c1,_0x2853ad);ChatInteractionEvents['on'](_0x4190c1,_0x1c26ca);}};
\ No newline at end of file
+var _0x68f8=['remove','update','emit','removeListener','register','length','chatInteraction:','./chatInteraction.events','save'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0x68f8,0x10c));var _0x868f=function(_0x1214d9,_0x2ef96b){_0x1214d9=_0x1214d9-0x0;var _0x482309=_0x68f8[_0x1214d9];return _0x482309;};'use strict';var ChatInteractionEvents=require(_0x868f('0x0'));var events=[_0x868f('0x1'),_0x868f('0x2'),_0x868f('0x3')];function createListener(_0x22b2e7,_0x1f4f09){return function(_0x4d894f){_0x1f4f09[_0x868f('0x4')](_0x22b2e7,_0x4d894f);};}function removeListener(_0x4f4e58,_0x22dae1){return function(){ChatInteractionEvents[_0x868f('0x5')](_0x4f4e58,_0x22dae1);};}exports[_0x868f('0x6')]=function(_0x37d706){for(var _0x3f7e54=0x0,_0x535a8e=events[_0x868f('0x7')];_0x3f7e54<_0x535a8e;_0x3f7e54++){var _0x3d14a9=events[_0x3f7e54];var _0x3cd26f=createListener(_0x868f('0x8')+_0x3d14a9,_0x37d706);ChatInteractionEvents['on'](_0x3d14a9,_0x3cd26f);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index c202e20..ad7b531 100644
--- a/server/api/chatInteraction/index.js
+++ b/server/api/chatInteraction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfb8d=['addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','destroy','removeTags','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','isAuthenticated','index','get','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','createVidaooSession','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','chatinteraction:addtags'];(function(_0x3de4f8,_0x336c7d){var _0x3d81fc=function(_0x53b9f9){while(--_0x53b9f9){_0x3de4f8['push'](_0x3de4f8['shift']());}};_0x3d81fc(++_0x336c7d);}(_0xfb8d,0x19c));var _0xdfb8=function(_0x4b3547,_0x7898aa){_0x4b3547=_0x4b3547-0x0;var _0x1394c8=_0xfb8d[_0x4b3547];return _0x1394c8;};'use strict';var multer=require(_0xdfb8('0x0'));var util=require(_0xdfb8('0x1'));var path=require('path');var timeout=require(_0xdfb8('0x2'));var express=require('express');var router=express[_0xdfb8('0x3')]();var fs_extra=require(_0xdfb8('0x4'));var auth=require(_0xdfb8('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdfb8('0x6'));var controller=require(_0xdfb8('0x7'));router['get']('/',auth[_0xdfb8('0x8')](),controller[_0xdfb8('0x9')]);router[_0xdfb8('0xa')](_0xdfb8('0xb'),auth[_0xdfb8('0x8')](),controller['describe']);router[_0xdfb8('0xa')](_0xdfb8('0xc'),auth[_0xdfb8('0xd')](),controller[_0xdfb8('0xe')]);router[_0xdfb8('0xa')](_0xdfb8('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0xdfb8('0x8')](),controller[_0xdfb8('0x10')]);router['get'](_0xdfb8('0x11'),auth[_0xdfb8('0xd')](),controller[_0xdfb8('0x12')]);router[_0xdfb8('0xa')](_0xdfb8('0x13'),auth['isAuthenticated'](),controller[_0xdfb8('0x14')]);router[_0xdfb8('0x15')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdfb8('0x15')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0xdfb8('0x16')]);var upload=multer({'storage':multer[_0xdfb8('0x17')]({'destination':function(_0x3edb0d,_0x229d04,_0x3bc909){_0x3bc909(null,path[_0xdfb8('0x18')](config[_0xdfb8('0x19')],_0xdfb8('0x1a')));},'filename':function(_0x41a288,_0x466a5b,_0x5516ec){_0x5516ec(null,util['format'](_0xdfb8('0x1b'),Date[_0xdfb8('0x1c')](),_0x466a5b[_0xdfb8('0x1d')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xdfb8('0x1e'),upload['single'](_0xdfb8('0x1f')),controller[_0xdfb8('0x20')]);router[_0xdfb8('0x15')](_0xdfb8('0x21'),auth['isChatInteractionAuthorized'](),controller[_0xdfb8('0x22')]);router[_0xdfb8('0x15')](_0xdfb8('0x23'),auth[_0xdfb8('0x8')](),interaction['tracked'](_0xdfb8('0x24'),_0xdfb8('0x25')),controller[_0xdfb8('0x26')]);router[_0xdfb8('0x27')]('/:id',auth[_0xdfb8('0x8')](),interaction[_0xdfb8('0x28')](_0xdfb8('0x24'),_0xdfb8('0x29')),controller[_0xdfb8('0x2a')]);router[_0xdfb8('0x27')](_0xdfb8('0x2b'),controller[_0xdfb8('0x2c')]);router[_0xdfb8('0x27')](_0xdfb8('0x2d'),auth[_0xdfb8('0xd')](),controller['abandon']);router[_0xdfb8('0x27')](_0xdfb8('0x2e'),controller['close']);router['delete'](_0xdfb8('0xc'),auth['isAuthenticated'](),interaction[_0xdfb8('0x28')](_0xdfb8('0x24'),'chatinteraction:destroy'),controller[_0xdfb8('0x2f')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0xdfb8('0x30')]);module[_0xdfb8('0x31')]=router;
\ No newline at end of file
+var _0xf09f=['delete','removeTags','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','/:id','isChatInteractionAuthorized','show','attachmentDownload','/:id/messages','getMyMessages','/:id/download','download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','single','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','update','/:id/custom_update','customUpdate','/:id/close','close','destroy'];(function(_0x1e868b,_0x3f6482){var _0x3a1c61=function(_0x51dc89){while(--_0x51dc89){_0x1e868b['push'](_0x1e868b['shift']());}};_0x3a1c61(++_0x3f6482);}(_0xf09f,0x1ed));var _0xff09=function(_0x372aba,_0x107bbe){_0x372aba=_0x372aba-0x0;var _0xf92f2d=_0xf09f[_0x372aba];return _0xf92f2d;};'use strict';var multer=require(_0xff09('0x0'));var util=require('util');var path=require(_0xff09('0x1'));var timeout=require(_0xff09('0x2'));var express=require(_0xff09('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xff09('0x4'));var interaction=require(_0xff09('0x5'));var config=require(_0xff09('0x6'));var controller=require(_0xff09('0x7'));router[_0xff09('0x8')]('/',auth['isAuthenticated'](),controller[_0xff09('0x9')]);router[_0xff09('0x8')](_0xff09('0xa'),auth[_0xff09('0xb')](),controller['describe']);router[_0xff09('0x8')](_0xff09('0xc'),auth[_0xff09('0xd')](),controller[_0xff09('0xe')]);router[_0xff09('0x8')]('/:id/attachment_download',auth[_0xff09('0xd')](),controller[_0xff09('0xf')]);router['get'](_0xff09('0x10'),auth[_0xff09('0xb')](),controller['getMessages']);router[_0xff09('0x8')]('/:id/my_messages',auth[_0xff09('0xd')](),controller[_0xff09('0x11')]);router[_0xff09('0x8')](_0xff09('0x12'),auth['isAuthenticated'](),controller[_0xff09('0x13')]);router[_0xff09('0x14')]('/',auth[_0xff09('0xb')](),controller[_0xff09('0x15')]);router[_0xff09('0x14')](_0xff09('0x16'),auth['isAuthenticated'](),controller[_0xff09('0x17')]);var upload=multer({'storage':multer[_0xff09('0x18')]({'destination':function(_0x5c83a6,_0x2364fe,_0x59df77){_0x59df77(null,path[_0xff09('0x19')](config[_0xff09('0x1a')],_0xff09('0x1b')));},'filename':function(_0x5cf3b2,_0x2e9b77,_0x47ce6b){_0x47ce6b(null,util[_0xff09('0x1c')](_0xff09('0x1d'),Date[_0xff09('0x1e')](),_0x2e9b77[_0xff09('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xff09('0x14')](_0xff09('0x20'),upload[_0xff09('0x21')]('file'),controller['attachmentUpload']);router[_0xff09('0x14')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0xff09('0x14')](_0xff09('0x22'),auth[_0xff09('0xb')](),interaction['tracked'](_0xff09('0x23'),_0xff09('0x24')),controller[_0xff09('0x25')]);router[_0xff09('0x26')](_0xff09('0xc'),auth[_0xff09('0xb')](),interaction[_0xff09('0x27')](_0xff09('0x23'),'chatinteraction:update'),controller[_0xff09('0x28')]);router[_0xff09('0x26')](_0xff09('0x29'),controller[_0xff09('0x2a')]);router[_0xff09('0x26')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller['abandon']);router[_0xff09('0x26')](_0xff09('0x2b'),controller[_0xff09('0x2c')]);router['delete'](_0xff09('0xc'),auth[_0xff09('0xb')](),interaction[_0xff09('0x27')](_0xff09('0x23'),'chatinteraction:destroy'),controller[_0xff09('0x2d')]);router[_0xff09('0x2e')](_0xff09('0x22'),auth[_0xff09('0xb')](),controller[_0xff09('0x2f')]);module[_0xff09('0x30')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 483aeac..4c50f23 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.attributes.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe250=['TEXT','BOOLEAN','sequelize','exports'];(function(_0x598bbb,_0x3a78b6){var _0x16d8c3=function(_0x1d468d){while(--_0x1d468d){_0x598bbb['push'](_0x598bbb['shift']());}};_0x16d8c3(++_0x3a78b6);}(_0xe250,0xa2));var _0x0e25=function(_0x406254,_0x5bbe66){_0x406254=_0x406254-0x0;var _0x2d0d40=_0xe250[_0x406254];return _0x2d0d40;};'use strict';var Sequelize=require(_0x0e25('0x0'));module[_0x0e25('0x1')]={'body':{'type':Sequelize[_0x0e25('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0e25('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xbf11=['sequelize','exports','medium','BOOLEAN'];(function(_0x50fb37,_0x2f0f72){var _0x1212ee=function(_0x4079b4){while(--_0x4079b4){_0x50fb37['push'](_0x50fb37['shift']());}};_0x1212ee(++_0x2f0f72);}(_0xbf11,0x1f4));var _0x1bf1=function(_0x5ae5f7,_0x57076b){_0x5ae5f7=_0x5ae5f7-0x0;var _0x190b76=_0xbf11[_0x5ae5f7];return _0x190b76;};'use strict';var Sequelize=require(_0x1bf1('0x0'));module[_0x1bf1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x1bf1('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x1bf1('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 9dd1f0b..8da8eac 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.controller.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x965f=['FromId','ToId','-createdAt','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','reject','then','destroy','error','name','index','map','ChatInternalMessage','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','length','options','create','body','update','find','describe','get','messages','lastMessageAt','createdAt','User','agent','user','fullname','role','userpic','internal','online','lastLoginAt','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','autoAssociation','isEmpty','push'];(function(_0x285f75,_0x29a0fe){var _0x4da0d2=function(_0x471933){while(--_0x471933){_0x285f75['push'](_0x285f75['shift']());}};_0x4da0d2(++_0x29a0fe);}(_0x965f,0x13e));var _0xf965=function(_0x5e9b7e,_0x4b1959){_0x5e9b7e=_0x5e9b7e-0x0;var _0x2c03c6=_0x965f[_0x5e9b7e];return _0x2c03c6;};'use strict';var emlformat=require(_0xf965('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf965('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf965('0x2'));var moment=require(_0xf965('0x3'));var BPromise=require(_0xf965('0x4'));var Mustache=require(_0xf965('0x5'));var util=require(_0xf965('0x6'));var path=require(_0xf965('0x7'));var sox=require(_0xf965('0x8'));var csv=require(_0xf965('0x9'));var ejs=require(_0xf965('0xa'));var fs=require('fs');var fs_extra=require(_0xf965('0xb'));var _=require(_0xf965('0xc'));var squel=require(_0xf965('0xd'));var crypto=require(_0xf965('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xf965('0xf'));var toCsv=require(_0xf965('0x9'));var querystring=require(_0xf965('0x10'));var Papa=require(_0xf965('0x11'));var Redis=require(_0xf965('0x12'));var authService=require(_0xf965('0x13'));var qs=require(_0xf965('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf965('0x15'));var logger=require('../../config/logger')(_0xf965('0x16'));var utils=require('../../config/utils');var config=require(_0xf965('0x17'));var licenseUtil=require(_0xf965('0x18'));var db=require(_0xf965('0x19'))['db'];config[_0xf965('0x1a')]=_[_0xf965('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf965('0x1c'))(new Redis(config[_0xf965('0x1a')]));require(_0xf965('0x1d'))[_0xf965('0x1e')](socket);function respondWithStatusCode(_0x43ec67,_0x466bfd){_0x466bfd=_0x466bfd||0xcc;return function(_0x2a953f){if(_0x2a953f){return _0x43ec67[_0xf965('0x1f')](_0x466bfd);}return _0x43ec67[_0xf965('0x20')](_0x466bfd)[_0xf965('0x21')]();};}function respondWithResult(_0x2a477a,_0x3c91ef){_0x3c91ef=_0x3c91ef||0xc8;return function(_0x348b8d){if(_0x348b8d){return _0x2a477a['status'](_0x3c91ef)['json'](_0x348b8d);}};}function respondWithFilteredResult(_0x570548,_0x4642fd){return function(_0x358e5f){if(_0x358e5f){var _0x533fe6=typeof _0x4642fd[_0xf965('0x22')]===_0xf965('0x23')&&typeof _0x4642fd['limit']==='undefined';var _0x1c6f91=_0x358e5f[_0xf965('0x24')];var _0x52ef10=_0x533fe6?0x0:_0x4642fd[_0xf965('0x22')];var _0x2ca178=_0x533fe6?_0x358e5f[_0xf965('0x24')]:_0x4642fd[_0xf965('0x22')]+_0x4642fd[_0xf965('0x25')];var _0x1f66ca;if(_0x2ca178>=_0x1c6f91){_0x2ca178=_0x1c6f91;_0x1f66ca=0xc8;}else{_0x1f66ca=0xce;}_0x570548[_0xf965('0x20')](_0x1f66ca);return _0x570548['set'](_0xf965('0x26'),_0x52ef10+'-'+_0x2ca178+'/'+_0x1c6f91)[_0xf965('0x27')](_0x358e5f);}return null;};}function patchUpdates(_0x218f34){return function(_0x1dd4ee){try{jsonpatch['apply'](_0x1dd4ee,_0x218f34,!![]);}catch(_0x5b062a){return BPromise[_0xf965('0x28')](_0x5b062a);}return _0x1dd4ee['save']();};}function saveUpdates(_0x545fa6,_0x578293){return function(_0x420388){if(_0x420388){return _0x420388['update'](_0x545fa6)[_0xf965('0x29')](function(_0x14b5fb){return _0x14b5fb;});}return null;};}function removeEntity(_0x545095,_0x5f292c){return function(_0x3e3354){if(_0x3e3354){return _0x3e3354[_0xf965('0x2a')]()[_0xf965('0x29')](function(){_0x545095[_0xf965('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x361421,_0x353dcc){return function(_0x560033){if(!_0x560033){_0x361421[_0xf965('0x1f')](0x194);}return _0x560033;};}function handleError(_0x956e7b,_0x4cdef9){_0x4cdef9=_0x4cdef9||0x1f4;return function(_0x3d45d8){logger[_0xf965('0x2b')](_0x3d45d8['stack']);if(_0x3d45d8[_0xf965('0x2c')]){delete _0x3d45d8['name'];}_0x956e7b[_0xf965('0x20')](_0x4cdef9)['send'](_0x3d45d8);};}exports[_0xf965('0x2d')]=function(_0x486730,_0x52fa39){var _0x39a786={},_0x35650e={},_0x25e9c5={'count':0x0,'rows':[]};var _0x2d5545=_[_0xf965('0x2e')](db[_0xf965('0x2f')][_0xf965('0x30')],function(_0x57e75a){return{'name':_0x57e75a['fieldName'],'type':_0x57e75a[_0xf965('0x31')][_0xf965('0x32')]};});_0x35650e[_0xf965('0x33')]=_[_0xf965('0x2e')](_0x2d5545,_0xf965('0x2c'));_0x35650e[_0xf965('0x34')]=_['keys'](_0x486730[_0xf965('0x34')]);_0x35650e[_0xf965('0x35')]=_['intersection'](_0x35650e[_0xf965('0x33')],_0x35650e[_0xf965('0x34')]);_0x39a786['attributes']=_[_0xf965('0x36')](_0x35650e['model'],qs[_0xf965('0x37')](_0x486730[_0xf965('0x34')][_0xf965('0x37')]));_0x39a786[_0xf965('0x38')]=_0x39a786['attributes']['length']?_0x39a786[_0xf965('0x38')]:_0x35650e['model'];if(!_0x486730[_0xf965('0x34')][_0xf965('0x39')](_0xf965('0x3a'))){_0x39a786['limit']=qs[_0xf965('0x25')](_0x486730[_0xf965('0x34')][_0xf965('0x25')]);_0x39a786[_0xf965('0x22')]=qs['offset'](_0x486730[_0xf965('0x34')][_0xf965('0x22')]);}_0x39a786[_0xf965('0x3b')]=qs[_0xf965('0x3c')](_0x486730[_0xf965('0x34')][_0xf965('0x3c')]);_0x39a786[_0xf965('0x3d')]=qs[_0xf965('0x35')](_[_0xf965('0x3e')](_0x486730['query'],_0x35650e['filters']),_0x2d5545);if(_0x486730[_0xf965('0x34')][_0xf965('0x3f')]){_0x39a786[_0xf965('0x3d')]=_[_0xf965('0x40')](_0x39a786[_0xf965('0x3d')],{'$or':_[_0xf965('0x2e')](_0x2d5545,function(_0x12801e){if(_0x12801e['type']!==_0xf965('0x41')){var _0x39c385={};_0x39c385[_0x12801e[_0xf965('0x2c')]]={'$like':'%'+_0x486730['query']['filter']+'%'};return _0x39c385;}})});}_0x39a786=_[_0xf965('0x40')]({},_0x39a786,_0x486730['options']);var _0x22633a={'where':_0x39a786[_0xf965('0x3d')]};return db[_0xf965('0x2f')][_0xf965('0x24')](_0x22633a)['then'](function(_0x3e04f6){_0x25e9c5[_0xf965('0x24')]=_0x3e04f6;if(_0x486730['query'][_0xf965('0x42')]){_0x39a786[_0xf965('0x43')]=[{'all':!![]}];}return db[_0xf965('0x2f')][_0xf965('0x44')](_0x39a786);})[_0xf965('0x29')](function(_0x47ac54){_0x25e9c5[_0xf965('0x45')]=_0x47ac54;return _0x25e9c5;})['then'](respondWithFilteredResult(_0x52fa39,_0x39a786))[_0xf965('0x46')](handleError(_0x52fa39,null));};exports['show']=function(_0x20e197,_0x43cadd){var _0x39ad8c={'raw':!![],'where':{'id':_0x20e197[_0xf965('0x47')]['id']}},_0x347fbb={};_0x347fbb[_0xf965('0x33')]=_[_0xf965('0x48')](db['ChatInternalMessage'][_0xf965('0x30')]);_0x347fbb[_0xf965('0x34')]=_[_0xf965('0x48')](_0x20e197[_0xf965('0x34')]);_0x347fbb[_0xf965('0x35')]=_[_0xf965('0x36')](_0x347fbb['model'],_0x347fbb[_0xf965('0x34')]);_0x39ad8c[_0xf965('0x38')]=_[_0xf965('0x36')](_0x347fbb[_0xf965('0x33')],qs[_0xf965('0x37')](_0x20e197['query']['fields']));_0x39ad8c[_0xf965('0x38')]=_0x39ad8c['attributes'][_0xf965('0x49')]?_0x39ad8c[_0xf965('0x38')]:_0x347fbb[_0xf965('0x33')];if(_0x20e197[_0xf965('0x34')]['includeAll']){_0x39ad8c[_0xf965('0x43')]=[{'all':!![]}];}_0x39ad8c=_[_0xf965('0x40')]({},_0x39ad8c,_0x20e197[_0xf965('0x4a')]);return db[_0xf965('0x2f')]['find'](_0x39ad8c)[_0xf965('0x29')](handleEntityNotFound(_0x43cadd,null))['then'](respondWithResult(_0x43cadd,null))[_0xf965('0x46')](handleError(_0x43cadd,null));};exports[_0xf965('0x4b')]=function(_0x4b64bb,_0x35d32c){return db[_0xf965('0x2f')][_0xf965('0x4b')](_0x4b64bb[_0xf965('0x4c')],{})['then'](respondWithResult(_0x35d32c,0xc9))[_0xf965('0x46')](handleError(_0x35d32c,null));};exports[_0xf965('0x4d')]=function(_0x4960ea,_0x6d91cb){if(_0x4960ea[_0xf965('0x4c')]['id']){delete _0x4960ea['body']['id'];}return db['ChatInternalMessage'][_0xf965('0x4e')]({'where':{'id':_0x4960ea[_0xf965('0x47')]['id']}})[_0xf965('0x29')](handleEntityNotFound(_0x6d91cb,null))[_0xf965('0x29')](saveUpdates(_0x4960ea[_0xf965('0x4c')],null))['then'](respondWithResult(_0x6d91cb,null))[_0xf965('0x46')](handleError(_0x6d91cb,null));};exports[_0xf965('0x2a')]=function(_0x1af4bc,_0x292816){return db[_0xf965('0x2f')][_0xf965('0x4e')]({'where':{'id':_0x1af4bc[_0xf965('0x47')]['id']}})[_0xf965('0x29')](handleEntityNotFound(_0x292816,null))[_0xf965('0x29')](removeEntity(_0x292816,null))[_0xf965('0x46')](handleError(_0x292816,null));};exports[_0xf965('0x4f')]=function(_0x3fd464,_0x12b959){return db[_0xf965('0x2f')][_0xf965('0x4f')]()['then'](respondWithResult(_0x12b959,null))[_0xf965('0x46')](handleError(_0x12b959,null));};function wrapUser(_0x4d2547){return function(_0x2a9f32){var _0x2d941a=_0x4d2547[_0xf965('0x50')]({'plain':!![]});_0x2d941a[_0xf965('0x51')]=[];if(_0x2a9f32){_0x2d941a[_0xf965('0x52')]=_0x2a9f32[_0xf965('0x53')];_0x2d941a['lastMessage']=_0x2a9f32;}else{_0x2d941a[_0xf965('0x52')]=moment(0x0)['format']('YYYY-MM-DD\x20HH:mm:ss');_0x2d941a['lastMessage']={};}return _0x2d941a;};}exports['getUsers']=function(_0x38ce5c,_0x751fec,_0x4fd125){var _0x3eb676=[];return db[_0xf965('0x54')][_0xf965('0x44')]({'where':{'role':[_0xf965('0x55'),'admin',_0xf965('0x56')]},'attributes':['id',_0xf965('0x57'),_0xf965('0x2c'),_0xf965('0x58'),_0xf965('0x59'),_0xf965('0x5a'),_0xf965('0x5b'),_0xf965('0x5c'),'allowmessenger','showWebBar'],'order':qs['sort'](_0xf965('0x5d')),'include':[{'model':db[_0xf965('0x5e')],'as':_0xf965('0x5f'),'attributes':['id','name',_0xf965('0x31')],'through':{'attributes':[]}}]})[_0xf965('0x29')](function(_0x48cc9e){if(_0x48cc9e){var _0x1c9cf6=_0x38ce5c[_0xf965('0x56')][_0xf965('0x50')]({'plain':!![]});if(!_0x1c9cf6)throw new Error(_0xf965('0x60'));if(_0x1c9cf6['role']===_0xf965('0x56')){return db[_0xf965('0x61')][_0xf965('0x4e')]({'where':{'name':_0xf965('0x62'),'userProfileId':_0x1c9cf6['userProfileId']},'raw':!![]})['then'](function(_0x24849d){if(_0x24849d){if(_0x24849d[_0xf965('0x63')]===0x0){return db['UserProfileResource'][_0xf965('0x44')]({'where':{'sectionId':_0x24849d['id']},'raw':!![]})[_0xf965('0x29')](function(_0x11b469){var _0x2e7047=[];if(_[_0xf965('0x64')](_0x11b469)){_0x2e7047=_['filter'](_0x48cc9e,function(_0xa2cefe){if(_0xa2cefe['role']!=='agent'){return _0xa2cefe;}});return _0x2e7047;}else{for(var _0x1ada38=0x0;_0x1ada38<_0x48cc9e['length'];_0x1ada38++){var _0x291d3e=_0x48cc9e[_0x1ada38];if(_0x291d3e[_0xf965('0x58')]===_0xf965('0x55')){var _0x5e6b95=_[_0xf965('0x4e')](_0x11b469,function(_0x519a93){return _0x519a93['resourceId']===_0x291d3e['id'];});if(_0x5e6b95)_0x2e7047[_0xf965('0x65')](_0x291d3e);}else{_0x2e7047[_0xf965('0x65')](_0x291d3e);}}return _0x2e7047;}});}else{return _0x48cc9e;}}else{var _0x3e594e=_[_0xf965('0x3f')](_0x48cc9e,function(_0x1c9e77){if(_0x1c9e77['role']!==_0xf965('0x55')){return _0x1c9e77;}});return _0x3e594e;}});}else{return _0x48cc9e;}}})[_0xf965('0x29')](function(_0x209654){var _0x321c69=[];if(_0x209654){_0x3eb676=_0x209654;for(var _0x4bd5b2=0x0;_0x4bd5b2<_0x209654[_0xf965('0x49')];_0x4bd5b2+=0x1){_0x3eb676[_0x4bd5b2][_0xf965('0x51')]=[];_0x321c69['push'](db[_0xf965('0x2f')][_0xf965('0x4e')]({'where':{'FromId':[_0x38ce5c[_0xf965('0x56')]['id'],_0x209654[_0x4bd5b2]['id']],'ToId':[_0x38ce5c['user']['id'],_0x209654[_0x4bd5b2]['id']],'ChatGroupId':null},'attributes':['id',_0xf965('0x53'),_0xf965('0x66'),_0xf965('0x67'),'read',_0xf965('0x4c')],'order':qs[_0xf965('0x3c')](_0xf965('0x68')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xf965('0x29')](wrapUser(_0x209654[_0x4bd5b2])));}return BPromise['all'](_0x321c69);}return[];})[_0xf965('0x29')](function(_0x278125){return{'rows':_0x278125,'count':_0x278125[_0xf965('0x49')]};})[_0xf965('0x29')](respondWithResult(_0x751fec,null))[_0xf965('0x46')](handleError(_0x751fec,null));};
\ No newline at end of file
+var _0xfa0e=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','end','status','json','offset','undefined','count','limit','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','user','fullname','userpic','internal','online','lastLoginAt','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','agent','resourceId','push','FromId','ToId','read','-createdAt'];(function(_0x22ef5a,_0x255279){var _0x5c6589=function(_0x1f5b45){while(--_0x1f5b45){_0x22ef5a['push'](_0x22ef5a['shift']());}};_0x5c6589(++_0x255279);}(_0xfa0e,0x72));var _0xefa0=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xfa0e[_0x122ef9];return _0x42fba0;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xefa0('0x0'));var jsonpatch=require(_0xefa0('0x1'));var rp=require(_0xefa0('0x2'));var moment=require(_0xefa0('0x3'));var BPromise=require(_0xefa0('0x4'));var Mustache=require(_0xefa0('0x5'));var util=require(_0xefa0('0x6'));var path=require(_0xefa0('0x7'));var sox=require(_0xefa0('0x8'));var csv=require(_0xefa0('0x9'));var ejs=require(_0xefa0('0xa'));var fs=require('fs');var fs_extra=require(_0xefa0('0xb'));var _=require(_0xefa0('0xc'));var squel=require('squel');var crypto=require(_0xefa0('0xd'));var jsforce=require(_0xefa0('0xe'));var deskjs=require(_0xefa0('0xf'));var toCsv=require(_0xefa0('0x9'));var querystring=require(_0xefa0('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xefa0('0x11'));var as=require(_0xefa0('0x12'));var hardwareService=require(_0xefa0('0x13'));var logger=require(_0xefa0('0x14'))(_0xefa0('0x15'));var utils=require('../../config/utils');var config=require(_0xefa0('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xefa0('0x17'))['db'];config['redis']=_['defaults'](config[_0xefa0('0x18')],{'host':_0xefa0('0x19'),'port':0x18eb});var socket=require(_0xefa0('0x1a'))(new Redis(config[_0xefa0('0x18')]));require(_0xefa0('0x1b'))['register'](socket);function respondWithStatusCode(_0x1538c0,_0x2eff3c){_0x2eff3c=_0x2eff3c||0xcc;return function(_0x17fecd){if(_0x17fecd){return _0x1538c0['sendStatus'](_0x2eff3c);}return _0x1538c0['status'](_0x2eff3c)[_0xefa0('0x1c')]();};}function respondWithResult(_0x518b1a,_0x5189b6){_0x5189b6=_0x5189b6||0xc8;return function(_0x227725){if(_0x227725){return _0x518b1a[_0xefa0('0x1d')](_0x5189b6)[_0xefa0('0x1e')](_0x227725);}};}function respondWithFilteredResult(_0x3359ac,_0x4203fa){return function(_0xd80a69){if(_0xd80a69){var _0x5be6a9=typeof _0x4203fa[_0xefa0('0x1f')]===_0xefa0('0x20')&&typeof _0x4203fa['limit']===_0xefa0('0x20');var _0x160045=_0xd80a69[_0xefa0('0x21')];var _0x51e8ba=_0x5be6a9?0x0:_0x4203fa[_0xefa0('0x1f')];var _0x36ddac=_0x5be6a9?_0xd80a69[_0xefa0('0x21')]:_0x4203fa[_0xefa0('0x1f')]+_0x4203fa[_0xefa0('0x22')];var _0x3576d3;if(_0x36ddac>=_0x160045){_0x36ddac=_0x160045;_0x3576d3=0xc8;}else{_0x3576d3=0xce;}_0x3359ac[_0xefa0('0x1d')](_0x3576d3);return _0x3359ac['set']('Content-Range',_0x51e8ba+'-'+_0x36ddac+'/'+_0x160045)[_0xefa0('0x1e')](_0xd80a69);}return null;};}function patchUpdates(_0x3a88b2){return function(_0x5bdbea){try{jsonpatch[_0xefa0('0x23')](_0x5bdbea,_0x3a88b2,!![]);}catch(_0x5b557f){return BPromise[_0xefa0('0x24')](_0x5b557f);}return _0x5bdbea[_0xefa0('0x25')]();};}function saveUpdates(_0x616b36,_0x428825){return function(_0x201d27){if(_0x201d27){return _0x201d27[_0xefa0('0x26')](_0x616b36)[_0xefa0('0x27')](function(_0x6844ba){return _0x6844ba;});}return null;};}function removeEntity(_0x199884,_0x1f9d50){return function(_0x1f3536){if(_0x1f3536){return _0x1f3536[_0xefa0('0x28')]()[_0xefa0('0x27')](function(){_0x199884[_0xefa0('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x25e345,_0x150261){return function(_0x5c2019){if(!_0x5c2019){_0x25e345[_0xefa0('0x29')](0x194);}return _0x5c2019;};}function handleError(_0x1b8c72,_0x198b80){_0x198b80=_0x198b80||0x1f4;return function(_0x55294c){logger[_0xefa0('0x2a')](_0x55294c[_0xefa0('0x2b')]);if(_0x55294c[_0xefa0('0x2c')]){delete _0x55294c[_0xefa0('0x2c')];}_0x1b8c72['status'](_0x198b80)[_0xefa0('0x2d')](_0x55294c);};}exports['index']=function(_0x8fd451,_0x57bc02){var _0xa7ea4={},_0x5ba955={},_0x3db37b={'count':0x0,'rows':[]};var _0xf4bc6f=_[_0xefa0('0x2e')](db['ChatInternalMessage'][_0xefa0('0x2f')],function(_0x2ecfca){return{'name':_0x2ecfca[_0xefa0('0x30')],'type':_0x2ecfca[_0xefa0('0x31')][_0xefa0('0x32')]};});_0x5ba955['model']=_[_0xefa0('0x2e')](_0xf4bc6f,_0xefa0('0x2c'));_0x5ba955[_0xefa0('0x33')]=_[_0xefa0('0x34')](_0x8fd451[_0xefa0('0x33')]);_0x5ba955[_0xefa0('0x35')]=_[_0xefa0('0x36')](_0x5ba955[_0xefa0('0x37')],_0x5ba955[_0xefa0('0x33')]);_0xa7ea4[_0xefa0('0x38')]=_[_0xefa0('0x36')](_0x5ba955[_0xefa0('0x37')],qs['fields'](_0x8fd451[_0xefa0('0x33')][_0xefa0('0x39')]));_0xa7ea4[_0xefa0('0x38')]=_0xa7ea4[_0xefa0('0x38')][_0xefa0('0x3a')]?_0xa7ea4['attributes']:_0x5ba955[_0xefa0('0x37')];if(!_0x8fd451[_0xefa0('0x33')][_0xefa0('0x3b')](_0xefa0('0x3c'))){_0xa7ea4['limit']=qs[_0xefa0('0x22')](_0x8fd451[_0xefa0('0x33')][_0xefa0('0x22')]);_0xa7ea4['offset']=qs[_0xefa0('0x1f')](_0x8fd451['query']['offset']);}_0xa7ea4[_0xefa0('0x3d')]=qs[_0xefa0('0x3e')](_0x8fd451['query']['sort']);_0xa7ea4[_0xefa0('0x3f')]=qs[_0xefa0('0x35')](_['pick'](_0x8fd451[_0xefa0('0x33')],_0x5ba955[_0xefa0('0x35')]),_0xf4bc6f);if(_0x8fd451[_0xefa0('0x33')][_0xefa0('0x40')]){_0xa7ea4[_0xefa0('0x3f')]=_[_0xefa0('0x41')](_0xa7ea4[_0xefa0('0x3f')],{'$or':_[_0xefa0('0x2e')](_0xf4bc6f,function(_0x15b771){if(_0x15b771[_0xefa0('0x31')]!==_0xefa0('0x42')){var _0xf88178={};_0xf88178[_0x15b771['name']]={'$like':'%'+_0x8fd451['query'][_0xefa0('0x40')]+'%'};return _0xf88178;}})});}_0xa7ea4=_[_0xefa0('0x41')]({},_0xa7ea4,_0x8fd451[_0xefa0('0x43')]);var _0x488a20={'where':_0xa7ea4[_0xefa0('0x3f')]};return db[_0xefa0('0x44')]['count'](_0x488a20)['then'](function(_0x160bcf){_0x3db37b[_0xefa0('0x21')]=_0x160bcf;if(_0x8fd451[_0xefa0('0x33')][_0xefa0('0x45')]){_0xa7ea4[_0xefa0('0x46')]=[{'all':!![]}];}return db[_0xefa0('0x44')][_0xefa0('0x47')](_0xa7ea4);})[_0xefa0('0x27')](function(_0x2d69aa){_0x3db37b[_0xefa0('0x48')]=_0x2d69aa;return _0x3db37b;})['then'](respondWithFilteredResult(_0x57bc02,_0xa7ea4))[_0xefa0('0x49')](handleError(_0x57bc02,null));};exports[_0xefa0('0x4a')]=function(_0x3e713f,_0x45cfec){var _0x4cd370={'raw':!![],'where':{'id':_0x3e713f[_0xefa0('0x4b')]['id']}},_0x2ec706={};_0x2ec706['model']=_[_0xefa0('0x34')](db['ChatInternalMessage'][_0xefa0('0x2f')]);_0x2ec706[_0xefa0('0x33')]=_[_0xefa0('0x34')](_0x3e713f[_0xefa0('0x33')]);_0x2ec706[_0xefa0('0x35')]=_[_0xefa0('0x36')](_0x2ec706[_0xefa0('0x37')],_0x2ec706['query']);_0x4cd370[_0xefa0('0x38')]=_['intersection'](_0x2ec706[_0xefa0('0x37')],qs[_0xefa0('0x39')](_0x3e713f[_0xefa0('0x33')][_0xefa0('0x39')]));_0x4cd370[_0xefa0('0x38')]=_0x4cd370[_0xefa0('0x38')][_0xefa0('0x3a')]?_0x4cd370['attributes']:_0x2ec706[_0xefa0('0x37')];if(_0x3e713f[_0xefa0('0x33')][_0xefa0('0x45')]){_0x4cd370[_0xefa0('0x46')]=[{'all':!![]}];}_0x4cd370=_['merge']({},_0x4cd370,_0x3e713f[_0xefa0('0x43')]);return db['ChatInternalMessage'][_0xefa0('0x4c')](_0x4cd370)[_0xefa0('0x27')](handleEntityNotFound(_0x45cfec,null))['then'](respondWithResult(_0x45cfec,null))[_0xefa0('0x49')](handleError(_0x45cfec,null));};exports[_0xefa0('0x4d')]=function(_0x3732f5,_0x6007cf){return db[_0xefa0('0x44')][_0xefa0('0x4d')](_0x3732f5[_0xefa0('0x4e')],{})[_0xefa0('0x27')](respondWithResult(_0x6007cf,0xc9))[_0xefa0('0x49')](handleError(_0x6007cf,null));};exports[_0xefa0('0x26')]=function(_0x26bc25,_0x11808a){if(_0x26bc25[_0xefa0('0x4e')]['id']){delete _0x26bc25[_0xefa0('0x4e')]['id'];}return db[_0xefa0('0x44')]['find']({'where':{'id':_0x26bc25['params']['id']}})[_0xefa0('0x27')](handleEntityNotFound(_0x11808a,null))[_0xefa0('0x27')](saveUpdates(_0x26bc25['body'],null))[_0xefa0('0x27')](respondWithResult(_0x11808a,null))['catch'](handleError(_0x11808a,null));};exports[_0xefa0('0x28')]=function(_0x52a99e,_0x1fd2ba){return db['ChatInternalMessage'][_0xefa0('0x4c')]({'where':{'id':_0x52a99e[_0xefa0('0x4b')]['id']}})[_0xefa0('0x27')](handleEntityNotFound(_0x1fd2ba,null))[_0xefa0('0x27')](removeEntity(_0x1fd2ba,null))[_0xefa0('0x49')](handleError(_0x1fd2ba,null));};exports['describe']=function(_0x4a7ede,_0x22195a){return db['ChatInternalMessage'][_0xefa0('0x4f')]()[_0xefa0('0x27')](respondWithResult(_0x22195a,null))[_0xefa0('0x49')](handleError(_0x22195a,null));};function wrapUser(_0xc1f119){return function(_0xa14dc2){var _0x157b23=_0xc1f119[_0xefa0('0x50')]({'plain':!![]});_0x157b23[_0xefa0('0x51')]=[];if(_0xa14dc2){_0x157b23[_0xefa0('0x52')]=_0xa14dc2[_0xefa0('0x53')];_0x157b23[_0xefa0('0x54')]=_0xa14dc2;}else{_0x157b23[_0xefa0('0x52')]=moment(0x0)[_0xefa0('0x55')](_0xefa0('0x56'));_0x157b23['lastMessage']={};}return _0x157b23;};}exports[_0xefa0('0x57')]=function(_0x16f037,_0x1ca499,_0x3b8fc0){var _0x19d390=[];return db[_0xefa0('0x58')]['findAll']({'where':{'role':['agent','admin',_0xefa0('0x59')]},'attributes':['id',_0xefa0('0x5a'),_0xefa0('0x2c'),'role',_0xefa0('0x5b'),_0xefa0('0x5c'),_0xefa0('0x5d'),_0xefa0('0x5e'),'allowmessenger',_0xefa0('0x5f')],'order':qs[_0xefa0('0x3e')](_0xefa0('0x60')),'include':[{'model':db[_0xefa0('0x61')],'as':_0xefa0('0x62'),'attributes':['id',_0xefa0('0x2c'),_0xefa0('0x31')],'through':{'attributes':[]}}]})[_0xefa0('0x27')](function(_0x5c643d){if(_0x5c643d){var _0x3ec4e1=_0x16f037['user']['get']({'plain':!![]});if(!_0x3ec4e1)throw new Error(_0xefa0('0x63'));if(_0x3ec4e1[_0xefa0('0x64')]===_0xefa0('0x59')){return db[_0xefa0('0x65')]['find']({'where':{'name':_0xefa0('0x66'),'userProfileId':_0x3ec4e1[_0xefa0('0x67')]},'raw':!![]})[_0xefa0('0x27')](function(_0x3aa931){if(_0x3aa931){if(_0x3aa931[_0xefa0('0x68')]===0x0){return db[_0xefa0('0x69')][_0xefa0('0x47')]({'where':{'sectionId':_0x3aa931['id']},'raw':!![]})['then'](function(_0x5136f1){var _0x35b54b=[];if(_[_0xefa0('0x6a')](_0x5136f1)){_0x35b54b=_['filter'](_0x5c643d,function(_0x2b3b4b){if(_0x2b3b4b['role']!==_0xefa0('0x6b')){return _0x2b3b4b;}});return _0x35b54b;}else{for(var _0x4d1180=0x0;_0x4d1180<_0x5c643d[_0xefa0('0x3a')];_0x4d1180++){var _0x2bc90a=_0x5c643d[_0x4d1180];if(_0x2bc90a[_0xefa0('0x64')]===_0xefa0('0x6b')){var _0xf68592=_['find'](_0x5136f1,function(_0x301503){return _0x301503[_0xefa0('0x6c')]===_0x2bc90a['id'];});if(_0xf68592)_0x35b54b['push'](_0x2bc90a);}else{_0x35b54b['push'](_0x2bc90a);}}return _0x35b54b;}});}else{return _0x5c643d;}}else{var _0x1ae9c0=_[_0xefa0('0x40')](_0x5c643d,function(_0x5c3243){if(_0x5c3243[_0xefa0('0x64')]!=='agent'){return _0x5c3243;}});return _0x1ae9c0;}});}else{return _0x5c643d;}}})[_0xefa0('0x27')](function(_0x54f83c){var _0x1de083=[];if(_0x54f83c){_0x19d390=_0x54f83c;for(var _0x27b43e=0x0;_0x27b43e<_0x54f83c['length'];_0x27b43e+=0x1){_0x19d390[_0x27b43e][_0xefa0('0x51')]=[];_0x1de083[_0xefa0('0x6d')](db[_0xefa0('0x44')][_0xefa0('0x4c')]({'where':{'FromId':[_0x16f037[_0xefa0('0x59')]['id'],_0x54f83c[_0x27b43e]['id']],'ToId':[_0x16f037[_0xefa0('0x59')]['id'],_0x54f83c[_0x27b43e]['id']],'ChatGroupId':null},'attributes':['id',_0xefa0('0x53'),_0xefa0('0x6e'),_0xefa0('0x6f'),_0xefa0('0x70'),_0xefa0('0x4e')],'order':qs[_0xefa0('0x3e')](_0xefa0('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xefa0('0x27')](wrapUser(_0x54f83c[_0x27b43e])));}return BPromise['all'](_0x1de083);}return[];})[_0xefa0('0x27')](function(_0x1d306b){return{'rows':_0x1d306b,'count':_0x1d306b[_0xefa0('0x3a')]};})['then'](respondWithResult(_0x1ca499,null))['catch'](handleError(_0x1ca499,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 24e6f5d..4f4faf7 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.events.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4ead=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x7de0fb,_0x1ba300){var _0x358bd8=function(_0x5a4ae3){while(--_0x5a4ae3){_0x7de0fb['push'](_0x7de0fb['shift']());}};_0x358bd8(++_0x1ba300);}(_0x4ead,0x19b));var _0xd4ea=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0x4ead[_0x45c48f];return _0xaf5037;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xd4ea('0x0'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd4ea('0x1')](0x0);var events={'afterCreate':_0xd4ea('0x2'),'afterUpdate':_0xd4ea('0x3'),'afterDestroy':_0xd4ea('0x4')};function emitEvent(_0x142ebe){return function(_0x12ff31,_0x520d61,_0x46600a){ChatInternalMessageEvents[_0xd4ea('0x5')](_0x142ebe+':'+_0x12ff31['id'],_0x12ff31);ChatInternalMessageEvents[_0xd4ea('0x5')](_0x142ebe,_0x12ff31);_0x46600a(null);};}for(var e in events){if(events[_0xd4ea('0x6')](e)){var event=events[e];ChatInternalMessage[_0xd4ea('0x7')](e,emitEvent(event));}}module[_0xd4ea('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xc759=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x44c159,_0x276fa0){var _0x5c804d=function(_0xed23c9){while(--_0xed23c9){_0x44c159['push'](_0x44c159['shift']());}};_0x5c804d(++_0x276fa0);}(_0xc759,0xa0));var _0x9c75=function(_0x4c8957,_0x3a6069){_0x4c8957=_0x4c8957-0x0;var _0x2fac66=_0xc759[_0x4c8957];return _0x2fac66;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x9c75('0x0'))['db'][_0x9c75('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x9c75('0x2')](0x0);var events={'afterCreate':_0x9c75('0x3'),'afterUpdate':'update','afterDestroy':_0x9c75('0x4')};function emitEvent(_0x1650fb){return function(_0x3ba338,_0x4efc3d,_0x540d2b){ChatInternalMessageEvents[_0x9c75('0x5')](_0x1650fb+':'+_0x3ba338['id'],_0x3ba338);ChatInternalMessageEvents[_0x9c75('0x5')](_0x1650fb,_0x3ba338);_0x540d2b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x9c75('0x6')](e,emitEvent(event));}}module[_0x9c75('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 03316cd..f6227bd 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.model.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a54=['ChatInternalMessage','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0x10316a,_0x125dc8){var _0x36ac2e=function(_0x140e35){while(--_0x140e35){_0x10316a['push'](_0x10316a['shift']());}};_0x36ac2e(++_0x125dc8);}(_0x5a54,0x1a6));var _0x45a5=function(_0x5c330e,_0x224bbe){_0x5c330e=_0x5c330e-0x0;var _0x23b0d8=_0x5a54[_0x5c330e];return _0x23b0d8;};'use strict';var _=require(_0x45a5('0x0'));var util=require(_0x45a5('0x1'));var logger=require(_0x45a5('0x2'))(_0x45a5('0x3'));var moment=require(_0x45a5('0x4'));var BPromise=require(_0x45a5('0x5'));var rp=require(_0x45a5('0x6'));var fs=require('fs');var path=require(_0x45a5('0x7'));var rimraf=require(_0x45a5('0x8'));var config=require(_0x45a5('0x9'));var attributes=require('./chatInternalMessage.attributes');module[_0x45a5('0xa')]=function(_0x3e0df4,_0x1575f1){return _0x3e0df4[_0x45a5('0xb')](_0x45a5('0xc'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x45a5('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xdccf=['moment','bluebird','path','rimraf','./chatInternalMessage.attributes','exports','define','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','api'];(function(_0x4a7302,_0x139ce7){var _0x4a2f36=function(_0x545fcb){while(--_0x545fcb){_0x4a7302['push'](_0x4a7302['shift']());}};_0x4a2f36(++_0x139ce7);}(_0xdccf,0x71));var _0xfdcc=function(_0xa1afdd,_0x545768){_0xa1afdd=_0xa1afdd-0x0;var _0x4a9722=_0xdccf[_0xa1afdd];return _0x4a9722;};'use strict';var _=require(_0xfdcc('0x0'));var util=require(_0xfdcc('0x1'));var logger=require(_0xfdcc('0x2'))(_0xfdcc('0x3'));var moment=require(_0xfdcc('0x4'));var BPromise=require(_0xfdcc('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfdcc('0x6'));var rimraf=require(_0xfdcc('0x7'));var config=require('../../config/environment');var attributes=require(_0xfdcc('0x8'));module[_0xfdcc('0x9')]=function(_0x1c5582,_0x560eb2){return _0x1c5582[_0xfdcc('0xa')]('ChatInternalMessage',attributes,{'tableName':_0xfdcc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xfdcc('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 2108dc0..b8687cb 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.rpc.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b78=['request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s'];(function(_0x335914,_0x13fae1){var _0x102a1d=function(_0x2130de){while(--_0x2130de){_0x335914['push'](_0x335914['shift']());}};_0x102a1d(++_0x13fae1);}(_0x0b78,0x1ad));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var moment=require('moment');var BPromise=require(_0x80b7('0x2'));var rs=require(_0x80b7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x80b7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x80b7('0x5'))(_0x80b7('0x6'));var config=require(_0x80b7('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x80b7('0x8')]({'port':0x232a});config['redis']=_[_0x80b7('0x9')](config[_0x80b7('0xa')],{'host':_0x80b7('0xb'),'port':0x18eb});var socket=require(_0x80b7('0xc'))(new Redis(config['redis']));require(_0x80b7('0xd'))[_0x80b7('0xe')](socket);function respondWithRpcPromise(_0x374c52,_0x5176b2,_0x467f38){return new BPromise(function(_0x522a21,_0x2b1a00){return client[_0x80b7('0xf')](_0x374c52,_0x467f38)[_0x80b7('0x10')](function(_0x7b971b){logger[_0x80b7('0x11')](_0x80b7('0x12'),_0x5176b2,_0x80b7('0x13'));logger[_0x80b7('0x14')](_0x80b7('0x15'),_0x5176b2,_0x80b7('0x13'),JSON[_0x80b7('0x16')](_0x7b971b));if(_0x7b971b['error']){if(_0x7b971b[_0x80b7('0x17')][_0x80b7('0x18')]===0x1f4){logger['error'](_0x80b7('0x12'),_0x5176b2,_0x7b971b[_0x80b7('0x17')]['message']);return _0x2b1a00(_0x7b971b[_0x80b7('0x17')][_0x80b7('0x19')]);}logger[_0x80b7('0x17')](_0x80b7('0x12'),_0x5176b2,_0x7b971b[_0x80b7('0x17')][_0x80b7('0x19')]);return _0x522a21(_0x7b971b[_0x80b7('0x17')][_0x80b7('0x19')]);}else{logger[_0x80b7('0x11')](_0x80b7('0x12'),_0x5176b2,'request\x20sent');_0x522a21(_0x7b971b[_0x80b7('0x1a')][_0x80b7('0x19')]);}})[_0x80b7('0x1b')](function(_0x125c47){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0x5176b2,_0x125c47);_0x2b1a00(_0x125c47);});});}
\ No newline at end of file
+var _0x5b7f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x30903f,_0x2588a0){var _0x28ef6c=function(_0x31d549){while(--_0x31d549){_0x30903f['push'](_0x30903f['shift']());}};_0x28ef6c(++_0x2588a0);}(_0x5b7f,0x8c));var _0xf5b7=function(_0x400fae,_0x297cd4){_0x400fae=_0x400fae-0x0;var _0x572441=_0x5b7f[_0x400fae];return _0x572441;};'use strict';var _=require(_0xf5b7('0x0'));var util=require(_0xf5b7('0x1'));var moment=require(_0xf5b7('0x2'));var BPromise=require(_0xf5b7('0x3'));var rs=require(_0xf5b7('0x4'));var fs=require('fs');var Redis=require(_0xf5b7('0x5'));var db=require(_0xf5b7('0x6'))['db'];var utils=require(_0xf5b7('0x7'));var logger=require(_0xf5b7('0x8'))(_0xf5b7('0x9'));var config=require(_0xf5b7('0xa'));var jayson=require(_0xf5b7('0xb'));var client=jayson[_0xf5b7('0xc')][_0xf5b7('0xd')]({'port':0x232a});config[_0xf5b7('0xe')]=_[_0xf5b7('0xf')](config[_0xf5b7('0xe')],{'host':_0xf5b7('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0xf5b7('0x11')](socket);function respondWithRpcPromise(_0x15f7f8,_0x2e3315,_0x4595c1){return new BPromise(function(_0x299eba,_0x3d2a12){return client[_0xf5b7('0x12')](_0x15f7f8,_0x4595c1)[_0xf5b7('0x13')](function(_0x43da63){logger[_0xf5b7('0x14')](_0xf5b7('0x15'),_0x2e3315,_0xf5b7('0x16'));logger['debug'](_0xf5b7('0x17'),_0x2e3315,_0xf5b7('0x16'),JSON[_0xf5b7('0x18')](_0x43da63));if(_0x43da63[_0xf5b7('0x19')]){if(_0x43da63[_0xf5b7('0x19')]['code']===0x1f4){logger[_0xf5b7('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x2e3315,_0x43da63['error']['message']);return _0x3d2a12(_0x43da63['error'][_0xf5b7('0x1a')]);}logger[_0xf5b7('0x19')](_0xf5b7('0x15'),_0x2e3315,_0x43da63[_0xf5b7('0x19')][_0xf5b7('0x1a')]);return _0x299eba(_0x43da63['error'][_0xf5b7('0x1a')]);}else{logger[_0xf5b7('0x14')](_0xf5b7('0x15'),_0x2e3315,_0xf5b7('0x16'));_0x299eba(_0x43da63[_0xf5b7('0x1b')][_0xf5b7('0x1a')]);}})['catch'](function(_0x2d112f){logger[_0xf5b7('0x19')](_0xf5b7('0x15'),_0x2e3315,_0x2d112f);_0x3d2a12(_0x2d112f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index e396695..01d6b59 100644
--- a/server/api/chatInternalMessage/chatInternalMessage.socket.js
+++ b/server/api/chatInternalMessage/chatInternalMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9eeb=['remove','update','register','length','./chatInternalMessage.events','save'];(function(_0x2f6aea,_0x12b87b){var _0x481fbe=function(_0x434fc4){while(--_0x434fc4){_0x2f6aea['push'](_0x2f6aea['shift']());}};_0x481fbe(++_0x12b87b);}(_0x9eeb,0x7c));var _0xb9ee=function(_0xf0588a,_0x5cb015){_0xf0588a=_0xf0588a-0x0;var _0x50396c=_0x9eeb[_0xf0588a];return _0x50396c;};'use strict';var ChatInternalMessageEvents=require(_0xb9ee('0x0'));var events=[_0xb9ee('0x1'),_0xb9ee('0x2'),_0xb9ee('0x3')];function createListener(_0x48ef04,_0x1b3ab0){return function(_0x39e146){_0x1b3ab0['emit'](_0x48ef04,_0x39e146);};}function removeListener(_0x5171e6,_0x686346){return function(){ChatInternalMessageEvents['removeListener'](_0x5171e6,_0x686346);};}exports[_0xb9ee('0x4')]=function(_0x3c5e8f){for(var _0x385c48=0x0,_0x3a9316=events[_0xb9ee('0x5')];_0x385c48<_0x3a9316;_0x385c48++){var _0x2a9f29=events[_0x385c48];var _0x7fb741=createListener('chatInternalMessage:'+_0x2a9f29,_0x3c5e8f);ChatInternalMessageEvents['on'](_0x2a9f29,_0x7fb741);}};
\ No newline at end of file
+var _0xbdca=['register','length','chatInternalMessage:','./chatInternalMessage.events','save','update','emit','removeListener'];(function(_0x329ca7,_0x29a097){var _0x4dfe68=function(_0x2db944){while(--_0x2db944){_0x329ca7['push'](_0x329ca7['shift']());}};_0x4dfe68(++_0x29a097);}(_0xbdca,0x173));var _0xabdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbdca[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInternalMessageEvents=require(_0xabdc('0x0'));var events=[_0xabdc('0x1'),'remove',_0xabdc('0x2')];function createListener(_0x23c6e9,_0x3aefc4){return function(_0x799584){_0x3aefc4[_0xabdc('0x3')](_0x23c6e9,_0x799584);};}function removeListener(_0x59f816,_0x2d2241){return function(){ChatInternalMessageEvents[_0xabdc('0x4')](_0x59f816,_0x2d2241);};}exports[_0xabdc('0x5')]=function(_0x2e515c){for(var _0x3369da=0x0,_0x46b423=events[_0xabdc('0x6')];_0x3369da<_0x46b423;_0x3369da++){var _0x3cacec=events[_0x3369da];var _0x277984=createListener(_0xabdc('0x7')+_0x3cacec,_0x2e515c);ChatInternalMessageEvents['on'](_0x3cacec,_0x277984);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index bf00c8c..c795bd3 100644
--- a/server/api/chatInternalMessage/index.js
+++ b/server/api/chatInternalMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x00ab=['update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./chatInternalMessage.controller','get','/describe','isAuthenticated','describe','/users','getUsers','/:id','show','post'];(function(_0x483d7d,_0x49047c){var _0x5357dc=function(_0x48d42b){while(--_0x48d42b){_0x483d7d['push'](_0x483d7d['shift']());}};_0x5357dc(++_0x49047c);}(_0x00ab,0x1e3));var _0xb00a=function(_0x319dd2,_0x21aa1c){_0x319dd2=_0x319dd2-0x0;var _0x5c5a7b=_0x00ab[_0x319dd2];return _0x5c5a7b;};'use strict';var multer=require(_0xb00a('0x0'));var util=require(_0xb00a('0x1'));var path=require(_0xb00a('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00a('0x3'));var router=express[_0xb00a('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0xb00a('0x5'));var interaction=require(_0xb00a('0x6'));var config=require('../../config/environment');var controller=require(_0xb00a('0x7'));router[_0xb00a('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb00a('0x8')](_0xb00a('0x9'),auth[_0xb00a('0xa')](),controller[_0xb00a('0xb')]);router['get'](_0xb00a('0xc'),auth[_0xb00a('0xa')](),controller[_0xb00a('0xd')]);router[_0xb00a('0x8')](_0xb00a('0xe'),auth[_0xb00a('0xa')](),controller[_0xb00a('0xf')]);router[_0xb00a('0x10')]('/',auth[_0xb00a('0xa')](),controller['create']);router['put']('/:id',controller[_0xb00a('0x11')]);router['delete'](_0xb00a('0xe'),auth[_0xb00a('0xa')](),controller[_0xb00a('0x12')]);module[_0xb00a('0x13')]=router;
\ No newline at end of file
+var _0x653f=['index','/users','getUsers','post','create','update','delete','/:id','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated'];(function(_0x7386c6,_0x19dc06){var _0x2a20a7=function(_0x1b6ec3){while(--_0x1b6ec3){_0x7386c6['push'](_0x7386c6['shift']());}};_0x2a20a7(++_0x19dc06);}(_0x653f,0xbe));var _0xf653=function(_0x8262d1,_0x298925){_0x8262d1=_0x8262d1-0x0;var _0x2a58f1=_0x653f[_0x8262d1];return _0x2a58f1;};'use strict';var multer=require('multer');var util=require(_0xf653('0x0'));var path=require('path');var timeout=require(_0xf653('0x1'));var express=require('express');var router=express[_0xf653('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xf653('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xf653('0x4'));var controller=require(_0xf653('0x5'));router[_0xf653('0x6')]('/',auth[_0xf653('0x7')](),controller[_0xf653('0x8')]);router[_0xf653('0x6')]('/describe',auth[_0xf653('0x7')](),controller['describe']);router[_0xf653('0x6')](_0xf653('0x9'),auth[_0xf653('0x7')](),controller[_0xf653('0xa')]);router[_0xf653('0x6')]('/:id',auth[_0xf653('0x7')](),controller['show']);router[_0xf653('0xb')]('/',auth[_0xf653('0x7')](),controller[_0xf653('0xc')]);router['put']('/:id',controller[_0xf653('0xd')]);router[_0xf653('0xe')](_0xf653('0xf'),auth[_0xf653('0x7')](),controller[_0xf653('0x10')]);module[_0xf653('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 9de0c2c..299a29e 100644
--- a/server/api/chatMessage/chatMessage.attributes.js
+++ b/server/api/chatMessage/chatMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0447=['ENUM','out','DATE','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x4604ad,_0x2c516e){var _0x3ed8ef=function(_0x2cb13e){while(--_0x2cb13e){_0x4604ad['push'](_0x4604ad['shift']());}};_0x3ed8ef(++_0x2c516e);}(_0x0447,0x8b));var _0x7044=function(_0x326b39,_0x4143c9){_0x326b39=_0x326b39-0x0;var _0x5b62d1=_0x0447[_0x326b39];return _0x5b62d1;};'use strict';var Sequelize=require(_0x7044('0x0'));module[_0x7044('0x1')]={'body':{'type':Sequelize[_0x7044('0x2')](_0x7044('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7044('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x7044('0x5')]('in',_0x7044('0x6')),'defaultValue':_0x7044('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x7044('0x7')]},'providerName':{'type':Sequelize[_0x7044('0x8')]},'providerResponse':{'type':Sequelize[_0x7044('0x2')]}};
\ No newline at end of file
+var _0x8c7a=['sequelize','medium','BOOLEAN','ENUM','out','STRING','TEXT'];(function(_0x1e500e,_0x2c9d74){var _0x10dc5e=function(_0x354423){while(--_0x354423){_0x1e500e['push'](_0x1e500e['shift']());}};_0x10dc5e(++_0x2c9d74);}(_0x8c7a,0x8c));var _0xa8c7=function(_0x3a2ad5,_0xdd11fa){_0x3a2ad5=_0x3a2ad5-0x0;var _0x358ff3=_0x8c7a[_0x3a2ad5];return _0x358ff3;};'use strict';var Sequelize=require(_0xa8c7('0x0'));module['exports']={'body':{'type':Sequelize['TEXT'](_0xa8c7('0x1')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0xa8c7('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa8c7('0x3')]('in',_0xa8c7('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xa8c7('0x5')]},'providerResponse':{'type':Sequelize[_0xa8c7('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 3d8316e..9f82652 100644
--- a/server/api/chatMessage/chatMessage.controller.js
+++ b/server/api/chatMessage/chatMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb108=['QueryTypes','SELECT','contact','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','EventManager','parse','formData','chat','role','RejectMessage','User','event','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','options','include','findAll','rows','show','params','rawAttributes','create','body','describe','../../config/logger','chat-interactions','accept','read','readAt','format','UserId','agent','find','get','ChatInteraction','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','stringify','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize'];(function(_0x372f55,_0x452d0a){var _0x2074f4=function(_0x344ff0){while(--_0x344ff0){_0x372f55['push'](_0x372f55['shift']());}};_0x2074f4(++_0x452d0a);}(_0xb108,0x11e));var _0x8b10=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xb108[_0x3e5086];return _0xfeb102;};'use strict';var emlformat=require(_0x8b10('0x0'));var rimraf=require(_0x8b10('0x1'));var zipdir=require(_0x8b10('0x2'));var jsonpatch=require(_0x8b10('0x3'));var rp=require(_0x8b10('0x4'));var moment=require(_0x8b10('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b10('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8b10('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8b10('0x8'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x8b10('0x9'));var jsforce=require(_0x8b10('0xa'));var deskjs=require(_0x8b10('0xb'));var toCsv=require(_0x8b10('0x7'));var querystring=require(_0x8b10('0xc'));var Papa=require(_0x8b10('0xd'));var Redis=require(_0x8b10('0xe'));var authService=require(_0x8b10('0xf'));var qs=require(_0x8b10('0x10'));var as=require(_0x8b10('0x11'));var hardwareService=require(_0x8b10('0x12'));var logger=require('../../config/logger')(_0x8b10('0x13'));var utils=require('../../config/utils');var config=require(_0x8b10('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x8b10('0x15'))['db'];config[_0x8b10('0x16')]=_[_0x8b10('0x17')](config[_0x8b10('0x16')],{'host':_0x8b10('0x18'),'port':0x18eb});var socket=require(_0x8b10('0x19'))(new Redis(config[_0x8b10('0x16')]));require(_0x8b10('0x1a'))[_0x8b10('0x1b')](socket);var jayson=require(_0x8b10('0x1c'));var client=jayson[_0x8b10('0x1d')][_0x8b10('0x1e')]({'port':0x232c});var client9002=jayson[_0x8b10('0x1d')][_0x8b10('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x3cacec,_0xbb59ca,_0x2334e1,_0x28bb27){return new BPromise(function(_0x16e68e,_0x478cf1){var _0x5c096f=_0x28bb27||client;return _0x5c096f[_0x8b10('0x1f')](_0x3cacec,_0x2334e1)[_0x8b10('0x20')](function(_0x451ac1){logger[_0x8b10('0x21')](_0x8b10('0x22'),_0xbb59ca,_0x8b10('0x23'));logger[_0x8b10('0x24')](_0x8b10('0x25'),_0xbb59ca,_0x8b10('0x23'),JSON['stringify'](_0x451ac1));if(_0x451ac1[_0x8b10('0x26')]){if(_0x451ac1[_0x8b10('0x26')][_0x8b10('0x27')]===0x1f4){logger[_0x8b10('0x26')]('ChatMessage,\x20%s,\x20%s',_0xbb59ca,_0x451ac1[_0x8b10('0x26')][_0x8b10('0x28')]);return _0x478cf1(_0x451ac1[_0x8b10('0x26')]['message']);}logger[_0x8b10('0x26')](_0x8b10('0x22'),_0xbb59ca,_0x451ac1[_0x8b10('0x26')][_0x8b10('0x28')]);return _0x16e68e(_0x451ac1[_0x8b10('0x26')]['message']);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0xbb59ca,_0x8b10('0x23'));_0x16e68e(_0x451ac1[_0x8b10('0x29')]['message']);}})[_0x8b10('0x2a')](function(_0x4c8218){logger[_0x8b10('0x26')](_0x8b10('0x22'),_0xbb59ca,_0x4c8218);_0x478cf1(_0x4c8218);});});}function respondWithStatusCode(_0x4b5f07,_0x364860){_0x364860=_0x364860||0xcc;return function(_0x4b3247){if(_0x4b3247){return _0x4b5f07[_0x8b10('0x2b')](_0x364860);}return _0x4b5f07[_0x8b10('0x2c')](_0x364860)[_0x8b10('0x2d')]();};}function respondWithResult(_0x4b2e91,_0x184922){_0x184922=_0x184922||0xc8;return function(_0x354a13){if(_0x354a13){return _0x4b2e91['status'](_0x184922)[_0x8b10('0x2e')](_0x354a13);}};}function respondWithFilteredResult(_0x397752,_0x1afb9a){return function(_0x3afd26){if(_0x3afd26){var _0x30bace=typeof _0x1afb9a[_0x8b10('0x2f')]==='undefined'&&typeof _0x1afb9a[_0x8b10('0x30')]===_0x8b10('0x31');var _0x51223b=_0x3afd26['count'];var _0xbd6481=_0x30bace?0x0:_0x1afb9a[_0x8b10('0x2f')];var _0xf57714=_0x30bace?_0x3afd26[_0x8b10('0x32')]:_0x1afb9a[_0x8b10('0x2f')]+_0x1afb9a[_0x8b10('0x30')];var _0x1c19c4;if(_0xf57714>=_0x51223b){_0xf57714=_0x51223b;_0x1c19c4=0xc8;}else{_0x1c19c4=0xce;}_0x397752['status'](_0x1c19c4);return _0x397752['set'](_0x8b10('0x33'),_0xbd6481+'-'+_0xf57714+'/'+_0x51223b)['json'](_0x3afd26);}return null;};}function patchUpdates(_0x4a10c2){return function(_0x544c72){try{jsonpatch[_0x8b10('0x34')](_0x544c72,_0x4a10c2,!![]);}catch(_0xaceafb){return BPromise[_0x8b10('0x35')](_0xaceafb);}return _0x544c72[_0x8b10('0x36')]();};}function saveUpdates(_0x35982f,_0x549b02){return function(_0x22fa8b){if(_0x22fa8b){return _0x22fa8b[_0x8b10('0x37')](_0x35982f)[_0x8b10('0x20')](function(_0x16495b){return _0x16495b;});}return null;};}function removeEntity(_0x2806d3,_0x31101f){return function(_0x2e03bc){if(_0x2e03bc){return _0x2e03bc[_0x8b10('0x38')]()[_0x8b10('0x20')](function(){_0x2806d3[_0x8b10('0x2c')](0xcc)[_0x8b10('0x2d')]();});}};}function handleEntityNotFound(_0x1edbfc,_0x47e00d){return function(_0x3d6b4f){if(!_0x3d6b4f){_0x1edbfc['sendStatus'](0x194);}return _0x3d6b4f;};}function handleError(_0x24547b,_0x435530){_0x435530=_0x435530||0x1f4;return function(_0x1899c2){logger[_0x8b10('0x26')](_0x1899c2[_0x8b10('0x39')]);if(_0x1899c2[_0x8b10('0x3a')]){delete _0x1899c2[_0x8b10('0x3a')];}_0x24547b[_0x8b10('0x2c')](_0x435530)[_0x8b10('0x3b')](_0x1899c2);};}exports[_0x8b10('0x3c')]=function(_0x201d40,_0x37db3b){var _0x2158bd={},_0x4ae5ec={},_0x44a9d4={'count':0x0,'rows':[]};var _0x586890=_[_0x8b10('0x3d')](db[_0x8b10('0x3e')]['rawAttributes'],function(_0x436c80){return{'name':_0x436c80[_0x8b10('0x3f')],'type':_0x436c80[_0x8b10('0x40')][_0x8b10('0x41')]};});_0x4ae5ec[_0x8b10('0x42')]=_[_0x8b10('0x3d')](_0x586890,_0x8b10('0x3a'));_0x4ae5ec[_0x8b10('0x43')]=_[_0x8b10('0x44')](_0x201d40['query']);_0x4ae5ec[_0x8b10('0x45')]=_[_0x8b10('0x46')](_0x4ae5ec['model'],_0x4ae5ec['query']);_0x2158bd['attributes']=_[_0x8b10('0x46')](_0x4ae5ec[_0x8b10('0x42')],qs['fields'](_0x201d40[_0x8b10('0x43')][_0x8b10('0x47')]));_0x2158bd[_0x8b10('0x48')]=_0x2158bd[_0x8b10('0x48')][_0x8b10('0x49')]?_0x2158bd[_0x8b10('0x48')]:_0x4ae5ec[_0x8b10('0x42')];if(!_0x201d40[_0x8b10('0x43')][_0x8b10('0x4a')]('nolimit')){_0x2158bd['limit']=qs[_0x8b10('0x30')](_0x201d40['query']['limit']);_0x2158bd['offset']=qs[_0x8b10('0x2f')](_0x201d40[_0x8b10('0x43')][_0x8b10('0x2f')]);}_0x2158bd['order']=qs[_0x8b10('0x4b')](_0x201d40[_0x8b10('0x43')]['sort']);_0x2158bd[_0x8b10('0x4c')]=qs['filters'](_[_0x8b10('0x4d')](_0x201d40[_0x8b10('0x43')],_0x4ae5ec[_0x8b10('0x45')]),_0x586890);if(_0x201d40[_0x8b10('0x43')][_0x8b10('0x4e')]){_0x2158bd[_0x8b10('0x4c')]=_[_0x8b10('0x4f')](_0x2158bd[_0x8b10('0x4c')],{'$or':_[_0x8b10('0x3d')](_0x586890,function(_0x35fb49){if(_0x35fb49['type']!=='VIRTUAL'){var _0xa1a656={};_0xa1a656[_0x35fb49[_0x8b10('0x3a')]]={'$like':'%'+_0x201d40[_0x8b10('0x43')][_0x8b10('0x4e')]+'%'};return _0xa1a656;}})});}_0x2158bd=_[_0x8b10('0x4f')]({},_0x2158bd,_0x201d40[_0x8b10('0x50')]);var _0x5e3f4c={'where':_0x2158bd[_0x8b10('0x4c')]};return db[_0x8b10('0x3e')][_0x8b10('0x32')](_0x5e3f4c)[_0x8b10('0x20')](function(_0x358a67){_0x44a9d4[_0x8b10('0x32')]=_0x358a67;if(_0x201d40[_0x8b10('0x43')]['includeAll']){_0x2158bd[_0x8b10('0x51')]=[{'all':!![]}];}return db[_0x8b10('0x3e')][_0x8b10('0x52')](_0x2158bd);})[_0x8b10('0x20')](function(_0x595855){_0x44a9d4[_0x8b10('0x53')]=_0x595855;return _0x44a9d4;})[_0x8b10('0x20')](respondWithFilteredResult(_0x37db3b,_0x2158bd))['catch'](handleError(_0x37db3b,null));};exports[_0x8b10('0x54')]=function(_0x3eb930,_0x27cc42){var _0x4b2182={'raw':!![],'where':{'id':_0x3eb930[_0x8b10('0x55')]['id']}},_0x329c4e={};_0x329c4e['model']=_['keys'](db[_0x8b10('0x3e')][_0x8b10('0x56')]);_0x329c4e[_0x8b10('0x43')]=_[_0x8b10('0x44')](_0x3eb930[_0x8b10('0x43')]);_0x329c4e[_0x8b10('0x45')]=_[_0x8b10('0x46')](_0x329c4e[_0x8b10('0x42')],_0x329c4e[_0x8b10('0x43')]);_0x4b2182[_0x8b10('0x48')]=_[_0x8b10('0x46')](_0x329c4e[_0x8b10('0x42')],qs[_0x8b10('0x47')](_0x3eb930['query'][_0x8b10('0x47')]));_0x4b2182['attributes']=_0x4b2182[_0x8b10('0x48')][_0x8b10('0x49')]?_0x4b2182['attributes']:_0x329c4e[_0x8b10('0x42')];if(_0x3eb930['query']['includeAll']){_0x4b2182[_0x8b10('0x51')]=[{'all':!![]}];}_0x4b2182=_['merge']({},_0x4b2182,_0x3eb930[_0x8b10('0x50')]);return db[_0x8b10('0x3e')]['find'](_0x4b2182)[_0x8b10('0x20')](handleEntityNotFound(_0x27cc42,null))[_0x8b10('0x20')](respondWithResult(_0x27cc42,null))[_0x8b10('0x2a')](handleError(_0x27cc42,null));};exports['create']=function(_0x75f2ea,_0xe8666b){return db[_0x8b10('0x3e')][_0x8b10('0x57')](_0x75f2ea[_0x8b10('0x58')],{})[_0x8b10('0x20')](respondWithResult(_0xe8666b,0xc9))[_0x8b10('0x2a')](handleError(_0xe8666b,null));};exports[_0x8b10('0x37')]=function(_0x53b07c,_0x13520b){if(_0x53b07c['body']['id']){delete _0x53b07c[_0x8b10('0x58')]['id'];}return db[_0x8b10('0x3e')]['find']({'where':{'id':_0x53b07c[_0x8b10('0x55')]['id']}})[_0x8b10('0x20')](handleEntityNotFound(_0x13520b,null))['then'](saveUpdates(_0x53b07c['body'],null))[_0x8b10('0x20')](respondWithResult(_0x13520b,null))['catch'](handleError(_0x13520b,null));};exports[_0x8b10('0x38')]=function(_0x16d2a0,_0x211259){return db[_0x8b10('0x3e')]['find']({'where':{'id':_0x16d2a0[_0x8b10('0x55')]['id']}})[_0x8b10('0x20')](handleEntityNotFound(_0x211259,null))[_0x8b10('0x20')](removeEntity(_0x211259,null))[_0x8b10('0x2a')](handleError(_0x211259,null));};exports[_0x8b10('0x59')]=function(_0x233c43,_0x1b9c10){return db[_0x8b10('0x3e')]['describe']()[_0x8b10('0x20')](respondWithResult(_0x1b9c10,null))['catch'](handleError(_0x1b9c10,null));};var interaction_log=require(_0x8b10('0x5a'))(_0x8b10('0x5b'));exports[_0x8b10('0x5c')]=function(_0x50e916,_0x5e5436,_0x2a17b8){var _0x30dc52={'agent':{},'channel':'chat'};if(_0x50e916[_0x8b10('0x58')]['id']){delete _0x50e916[_0x8b10('0x58')]['id'];}_0x50e916[_0x8b10('0x58')][_0x8b10('0x5d')]=!![];_0x50e916['body'][_0x8b10('0x5e')]=moment()[_0x8b10('0x5f')]('YYYY-MM-DD\x20HH:mm:ss');_0x50e916['body']['UserId']=_0x50e916[_0x8b10('0x58')][_0x8b10('0x60')]||_0x50e916['user']['id'];_0x30dc52[_0x8b10('0x61')]['id']=_0x50e916[_0x8b10('0x58')][_0x8b10('0x60')];return db[_0x8b10('0x3e')][_0x8b10('0x62')]({'where':{'id':_0x50e916[_0x8b10('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x5e5436,null))['then'](saveUpdates(_0x50e916[_0x8b10('0x58')],null))[_0x8b10('0x20')](function(_0x336657){if(_0x336657){_0x30dc52[_0x8b10('0x28')]=_0x336657[_0x8b10('0x63')]({'plain':!![]});return db[_0x8b10('0x64')][_0x8b10('0x62')]({'where':{'id':_0x336657['ChatInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x5e5436,null))['then'](function(_0x54a7a8){if(_0x54a7a8){return _0x54a7a8[_0x8b10('0x37')]({'UserId':_0x50e916[_0x8b10('0x58')][_0x8b10('0x60')],'read1stAt':_[_0x8b10('0x65')](_0x54a7a8['read1stAt'])?moment()[_0x8b10('0x5f')](_0x8b10('0x66')):undefined});}return null;})['then'](function(_0x116f63){if(_0x116f63){_0x30dc52[_0x8b10('0x67')]=_0x116f63[_0x8b10('0x63')]({'plain':!![]});interaction_log[_0x8b10('0x21')](_0x8b10('0x68'),_0x50e916[_0x8b10('0x69')]['id'],_0x50e916['user'][_0x8b10('0x3a')],_0x50e916[_0x8b10('0x69')]['role'],_0x30dc52[_0x8b10('0x67')]['id'],_0x50e916[_0x8b10('0x58')]?JSON[_0x8b10('0x6a')](_0x50e916[_0x8b10('0x58')]):_0x8b10('0x6b'));return respondWithRpcPromise(_0x8b10('0x6c'),'acceptMessage',_0x30dc52);}return null;})[_0x8b10('0x20')](function(_0x2eab26){var _0x33b7f7=_0x8b10('0x6d')+_0x2eab26[_0x8b10('0x28')][_0x8b10('0x6e')];return db[_0x8b10('0x6f')][_0x8b10('0x43')](_0x33b7f7,{'type':db[_0x8b10('0x70')][_0x8b10('0x71')][_0x8b10('0x72')],'raw':!![]})[_0x8b10('0x20')](function(_0x4130be){return _0x4130be;});})[_0x8b10('0x20')](function(_0x3cb152){if(_0x3cb152){_0x30dc52[_0x8b10('0x28')][_0x8b10('0x73')]=_0x3cb152[0x0];if(!_0x50e916[_0x8b10('0x58')]['UserId'])return;return db['User'][_0x8b10('0x62')]({'where':{'id':_0x50e916[_0x8b10('0x58')]['UserId'],'role':_0x8b10('0x61')},'attributes':['id',_0x8b10('0x3a'),_0x8b10('0x74'),_0x8b10('0x75'),_0x8b10('0x76')],'raw':!![]});}return null;})['then'](function(_0x2ed8d9){if(!_0x2ed8d9)return null;_0x30dc52[_0x8b10('0x28')][_0x8b10('0x61')]=_0x2ed8d9;return _0x30dc52;})['then'](function(_0x1d7712){if(_0x1d7712){if(_0x50e916[_0x8b10('0x58')][_0x8b10('0x77')]){_0x30dc52[_0x8b10('0x28')][_0x8b10('0x78')]=util[_0x8b10('0x5f')](_0x8b10('0x79'),_0x50e916[_0x8b10('0x69')][_0x8b10('0x3a')]);_0x30dc52[_0x8b10('0x28')][_0x8b10('0x7a')]=_0x30dc52[_0x8b10('0x7a')];_0x30dc52[_0x8b10('0x28')][_0x8b10('0x7b')]=_0x30dc52[_0x8b10('0x7a')];_0x30dc52[_0x8b10('0x28')]['event']='accept';return respondWithRpcPromise(_0x8b10('0x7c'),_0x8b10('0x7c'),{'event':'acceptmessage','message':_[_0x8b10('0x4f')](_0x30dc52[_0x8b10('0x28')],JSON[_0x8b10('0x7d')](_0x30dc52[_0x8b10('0x67')][_0x8b10('0x7e')]))},client9002)[_0x8b10('0x20')](function(){return _0x30dc52;});}return _0x30dc52;}return null;})[_0x8b10('0x20')](respondWithResult(_0x5e5436,null))[_0x8b10('0x2a')](handleError(_0x5e5436,null));};var interaction_log=require(_0x8b10('0x5a'))(_0x8b10('0x5b'));exports[_0x8b10('0x35')]=function(_0x4bab6d,_0x10daa6,_0x7d1814){var _0x32c009={'agent':{},'channel':_0x8b10('0x7f')};if(_0x4bab6d['body']['id']){delete _0x4bab6d['body']['id'];}_0x4bab6d[_0x8b10('0x58')][_0x8b10('0x60')]=_0x4bab6d[_0x8b10('0x58')][_0x8b10('0x60')]||_0x4bab6d['user']['id'];_0x32c009['agent']['id']=_0x4bab6d['body']['UserId'];return db[_0x8b10('0x3e')]['find']({'where':{'id':_0x4bab6d[_0x8b10('0x55')]['id'],'UserId':null}})[_0x8b10('0x20')](handleEntityNotFound(_0x10daa6,null))[_0x8b10('0x20')](function(_0x248205){if(_0x248205){_0x32c009[_0x8b10('0x28')]=_0x248205['get']({'plain':!![]});return db[_0x8b10('0x64')][_0x8b10('0x62')]({'where':{'id':_0x248205['ChatInteractionId']}});}return null;})[_0x8b10('0x20')](handleEntityNotFound(_0x10daa6,null))['then'](function(_0x5129c0){if(_0x5129c0){_0x32c009['interaction']=_0x5129c0['get']({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4bab6d[_0x8b10('0x69')]['id'],_0x4bab6d[_0x8b10('0x69')][_0x8b10('0x3a')],_0x4bab6d[_0x8b10('0x69')][_0x8b10('0x80')],_0x32c009[_0x8b10('0x67')]['id'],_0x4bab6d[_0x8b10('0x58')]?JSON['stringify'](_0x4bab6d[_0x8b10('0x58')]):_0x8b10('0x6b'));return respondWithRpcPromise(_0x8b10('0x81'),'rejectMessage',_0x32c009);}return null;})[_0x8b10('0x20')](function(_0x44cc6d){var _0x312dee=_0x8b10('0x6d')+_0x44cc6d[_0x8b10('0x28')]['ContactId'];return db['sequelize']['query'](_0x312dee,{'type':db[_0x8b10('0x70')][_0x8b10('0x71')][_0x8b10('0x72')],'raw':!![]})[_0x8b10('0x20')](function(_0x4013f4){return _0x4013f4;});})[_0x8b10('0x20')](function(_0xcb3d6d){if(_0xcb3d6d){_0x32c009[_0x8b10('0x28')][_0x8b10('0x73')]=_0xcb3d6d[0x0];if(!_0x4bab6d[_0x8b10('0x58')][_0x8b10('0x60')])return;return db[_0x8b10('0x82')][_0x8b10('0x62')]({'where':{'id':_0x4bab6d['body']['UserId'],'role':'agent'},'attributes':['id',_0x8b10('0x3a'),'fullname','email',_0x8b10('0x76')],'raw':!![]});}return null;})[_0x8b10('0x20')](function(_0x51511c){if(!_0x51511c)return null;_0x32c009['message'][_0x8b10('0x61')]=_0x51511c;return _0x32c009;})[_0x8b10('0x20')](function(_0x54e970){if(_0x54e970){_0x54e970['message'][_0x8b10('0x78')]=util['format'](_0x8b10('0x79'),_0x4bab6d['user'][_0x8b10('0x3a')]);_0x54e970[_0x8b10('0x28')][_0x8b10('0x7a')]=_0x32c009[_0x8b10('0x7a')];_0x54e970[_0x8b10('0x28')][_0x8b10('0x7b')]=_0x32c009[_0x8b10('0x7a')];_0x54e970['message'][_0x8b10('0x83')]=_0x8b10('0x35');respondWithRpcPromise('EventManager',_0x8b10('0x7c'),{'event':_0x8b10('0x84'),'message':_[_0x8b10('0x4f')](_0x32c009['message'],JSON[_0x8b10('0x7d')](_0x32c009[_0x8b10('0x67')][_0x8b10('0x7e')]))},client9002);return _0x32c009;}return null;})['then'](respondWithResult(_0x10daa6,null))['catch'](handleError(_0x10daa6,null));};
\ No newline at end of file
+var _0xf795=['type','VIRTUAL','ChatMessage','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','create','update','body','find','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','user','agent','UserId','get','ChatInteraction','ChatInteractionId','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','QueryTypes','User','email','internal','manual','SIP/%s','channel','event','EventManager','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT','contact','fullname','rejectmessage','parse','eml-format','rimraf','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','jayson/promise','client','request','then','info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','destroy','name','send','index','map','fieldName','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge'];(function(_0x185622,_0x235cd2){var _0x419976=function(_0xbb6d1e){while(--_0xbb6d1e){_0x185622['push'](_0x185622['shift']());}};_0x419976(++_0x235cd2);}(_0xf795,0x13c));var _0x5f79=function(_0x282442,_0x135555){_0x282442=_0x282442-0x0;var _0xf97807=_0xf795[_0x282442];return _0xf97807;};'use strict';var emlformat=require(_0x5f79('0x0'));var rimraf=require(_0x5f79('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5f79('0x2'));var BPromise=require(_0x5f79('0x3'));var Mustache=require('mustache');var util=require(_0x5f79('0x4'));var path=require(_0x5f79('0x5'));var sox=require(_0x5f79('0x6'));var csv=require('to-csv');var ejs=require(_0x5f79('0x7'));var fs=require('fs');var fs_extra=require(_0x5f79('0x8'));var _=require(_0x5f79('0x9'));var squel=require('squel');var crypto=require(_0x5f79('0xa'));var jsforce=require(_0x5f79('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x5f79('0xc'));var authService=require(_0x5f79('0xd'));var qs=require(_0x5f79('0xe'));var as=require(_0x5f79('0xf'));var hardwareService=require(_0x5f79('0x10'));var logger=require(_0x5f79('0x11'))(_0x5f79('0x12'));var utils=require(_0x5f79('0x13'));var config=require(_0x5f79('0x14'));var licenseUtil=require(_0x5f79('0x15'));var db=require(_0x5f79('0x16'))['db'];config[_0x5f79('0x17')]=_['defaults'](config[_0x5f79('0x17')],{'host':_0x5f79('0x18'),'port':0x18eb});var socket=require(_0x5f79('0x19'))(new Redis(config[_0x5f79('0x17')]));require('./chatMessage.socket')[_0x5f79('0x1a')](socket);var jayson=require(_0x5f79('0x1b'));var client=jayson[_0x5f79('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x5f79('0x1c')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1ffccf,_0x78db14,_0x29d53b,_0xbf7e61){return new BPromise(function(_0x19c3a2,_0x4aaec5){var _0x26724e=_0xbf7e61||client;return _0x26724e[_0x5f79('0x1d')](_0x1ffccf,_0x29d53b)[_0x5f79('0x1e')](function(_0x4b9c0d){logger[_0x5f79('0x1f')](_0x5f79('0x20'),_0x78db14,'request\x20sent');logger[_0x5f79('0x21')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x78db14,'request\x20sent',JSON[_0x5f79('0x22')](_0x4b9c0d));if(_0x4b9c0d[_0x5f79('0x23')]){if(_0x4b9c0d[_0x5f79('0x23')][_0x5f79('0x24')]===0x1f4){logger[_0x5f79('0x23')]('ChatMessage,\x20%s,\x20%s',_0x78db14,_0x4b9c0d['error'][_0x5f79('0x25')]);return _0x4aaec5(_0x4b9c0d[_0x5f79('0x23')]['message']);}logger[_0x5f79('0x23')]('ChatMessage,\x20%s,\x20%s',_0x78db14,_0x4b9c0d['error'][_0x5f79('0x25')]);return _0x19c3a2(_0x4b9c0d[_0x5f79('0x23')][_0x5f79('0x25')]);}else{logger[_0x5f79('0x1f')]('ChatMessage,\x20%s,\x20%s',_0x78db14,_0x5f79('0x26'));_0x19c3a2(_0x4b9c0d[_0x5f79('0x27')][_0x5f79('0x25')]);}})[_0x5f79('0x28')](function(_0x231dcf){logger[_0x5f79('0x23')](_0x5f79('0x20'),_0x78db14,_0x231dcf);_0x4aaec5(_0x231dcf);});});}function respondWithStatusCode(_0x2d9ff1,_0x4d239f){_0x4d239f=_0x4d239f||0xcc;return function(_0x42a639){if(_0x42a639){return _0x2d9ff1[_0x5f79('0x29')](_0x4d239f);}return _0x2d9ff1[_0x5f79('0x2a')](_0x4d239f)[_0x5f79('0x2b')]();};}function respondWithResult(_0x10cf7f,_0x50238c){_0x50238c=_0x50238c||0xc8;return function(_0x2a727c){if(_0x2a727c){return _0x10cf7f[_0x5f79('0x2a')](_0x50238c)[_0x5f79('0x2c')](_0x2a727c);}};}function respondWithFilteredResult(_0x529d0a,_0x3181ec){return function(_0x51db67){if(_0x51db67){var _0x5e9921=typeof _0x3181ec[_0x5f79('0x2d')]===_0x5f79('0x2e')&&typeof _0x3181ec[_0x5f79('0x2f')]==='undefined';var _0xe5bd87=_0x51db67[_0x5f79('0x30')];var _0x3d2867=_0x5e9921?0x0:_0x3181ec[_0x5f79('0x2d')];var _0x2cc015=_0x5e9921?_0x51db67['count']:_0x3181ec[_0x5f79('0x2d')]+_0x3181ec[_0x5f79('0x2f')];var _0x276448;if(_0x2cc015>=_0xe5bd87){_0x2cc015=_0xe5bd87;_0x276448=0xc8;}else{_0x276448=0xce;}_0x529d0a[_0x5f79('0x2a')](_0x276448);return _0x529d0a[_0x5f79('0x31')](_0x5f79('0x32'),_0x3d2867+'-'+_0x2cc015+'/'+_0xe5bd87)['json'](_0x51db67);}return null;};}function patchUpdates(_0x458196){return function(_0x519a28){try{jsonpatch[_0x5f79('0x33')](_0x519a28,_0x458196,!![]);}catch(_0x588bd3){return BPromise[_0x5f79('0x34')](_0x588bd3);}return _0x519a28[_0x5f79('0x35')]();};}function saveUpdates(_0x2b5d8a,_0x4183dd){return function(_0x2b5b22){if(_0x2b5b22){return _0x2b5b22['update'](_0x2b5d8a)[_0x5f79('0x1e')](function(_0x185db1){return _0x185db1;});}return null;};}function removeEntity(_0x20a080,_0x5d2424){return function(_0x5b1831){if(_0x5b1831){return _0x5b1831[_0x5f79('0x36')]()['then'](function(){_0x20a080[_0x5f79('0x2a')](0xcc)[_0x5f79('0x2b')]();});}};}function handleEntityNotFound(_0xe74aad,_0x409280){return function(_0x2d8d31){if(!_0x2d8d31){_0xe74aad[_0x5f79('0x29')](0x194);}return _0x2d8d31;};}function handleError(_0x1dc831,_0x123a4e){_0x123a4e=_0x123a4e||0x1f4;return function(_0x5358c3){logger[_0x5f79('0x23')](_0x5358c3['stack']);if(_0x5358c3[_0x5f79('0x37')]){delete _0x5358c3[_0x5f79('0x37')];}_0x1dc831[_0x5f79('0x2a')](_0x123a4e)[_0x5f79('0x38')](_0x5358c3);};}exports[_0x5f79('0x39')]=function(_0xdbf48b,_0x391ea8){var _0x3c9539={},_0x2b804f={},_0xdedbc9={'count':0x0,'rows':[]};var _0x189acf=_[_0x5f79('0x3a')](db['ChatMessage']['rawAttributes'],function(_0x162d66){return{'name':_0x162d66[_0x5f79('0x3b')],'type':_0x162d66['type']['key']};});_0x2b804f['model']=_[_0x5f79('0x3a')](_0x189acf,_0x5f79('0x37'));_0x2b804f[_0x5f79('0x3c')]=_['keys'](_0xdbf48b[_0x5f79('0x3c')]);_0x2b804f['filters']=_[_0x5f79('0x3d')](_0x2b804f[_0x5f79('0x3e')],_0x2b804f[_0x5f79('0x3c')]);_0x3c9539[_0x5f79('0x3f')]=_[_0x5f79('0x3d')](_0x2b804f[_0x5f79('0x3e')],qs[_0x5f79('0x40')](_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x40')]));_0x3c9539[_0x5f79('0x3f')]=_0x3c9539[_0x5f79('0x3f')][_0x5f79('0x41')]?_0x3c9539[_0x5f79('0x3f')]:_0x2b804f[_0x5f79('0x3e')];if(!_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x42')]('nolimit')){_0x3c9539[_0x5f79('0x2f')]=qs[_0x5f79('0x2f')](_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x2f')]);_0x3c9539[_0x5f79('0x2d')]=qs[_0x5f79('0x2d')](_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x2d')]);}_0x3c9539[_0x5f79('0x43')]=qs[_0x5f79('0x44')](_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x44')]);_0x3c9539[_0x5f79('0x45')]=qs[_0x5f79('0x46')](_[_0x5f79('0x47')](_0xdbf48b[_0x5f79('0x3c')],_0x2b804f[_0x5f79('0x46')]),_0x189acf);if(_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x48')]){_0x3c9539[_0x5f79('0x45')]=_[_0x5f79('0x49')](_0x3c9539[_0x5f79('0x45')],{'$or':_['map'](_0x189acf,function(_0x44f820){if(_0x44f820[_0x5f79('0x4a')]!==_0x5f79('0x4b')){var _0x140593={};_0x140593[_0x44f820[_0x5f79('0x37')]]={'$like':'%'+_0xdbf48b[_0x5f79('0x3c')]['filter']+'%'};return _0x140593;}})});}_0x3c9539=_[_0x5f79('0x49')]({},_0x3c9539,_0xdbf48b['options']);var _0x170521={'where':_0x3c9539[_0x5f79('0x45')]};return db[_0x5f79('0x4c')]['count'](_0x170521)[_0x5f79('0x1e')](function(_0x3c6c33){_0xdedbc9[_0x5f79('0x30')]=_0x3c6c33;if(_0xdbf48b[_0x5f79('0x3c')][_0x5f79('0x4d')]){_0x3c9539[_0x5f79('0x4e')]=[{'all':!![]}];}return db[_0x5f79('0x4c')][_0x5f79('0x4f')](_0x3c9539);})['then'](function(_0x39a872){_0xdedbc9[_0x5f79('0x50')]=_0x39a872;return _0xdedbc9;})['then'](respondWithFilteredResult(_0x391ea8,_0x3c9539))['catch'](handleError(_0x391ea8,null));};exports[_0x5f79('0x51')]=function(_0x5f2bb9,_0x497296){var _0x565275={'raw':!![],'where':{'id':_0x5f2bb9[_0x5f79('0x52')]['id']}},_0x14b751={};_0x14b751[_0x5f79('0x3e')]=_[_0x5f79('0x53')](db[_0x5f79('0x4c')][_0x5f79('0x54')]);_0x14b751[_0x5f79('0x3c')]=_[_0x5f79('0x53')](_0x5f2bb9[_0x5f79('0x3c')]);_0x14b751[_0x5f79('0x46')]=_[_0x5f79('0x3d')](_0x14b751[_0x5f79('0x3e')],_0x14b751[_0x5f79('0x3c')]);_0x565275[_0x5f79('0x3f')]=_[_0x5f79('0x3d')](_0x14b751[_0x5f79('0x3e')],qs[_0x5f79('0x40')](_0x5f2bb9[_0x5f79('0x3c')][_0x5f79('0x40')]));_0x565275[_0x5f79('0x3f')]=_0x565275[_0x5f79('0x3f')][_0x5f79('0x41')]?_0x565275[_0x5f79('0x3f')]:_0x14b751[_0x5f79('0x3e')];if(_0x5f2bb9[_0x5f79('0x3c')][_0x5f79('0x4d')]){_0x565275['include']=[{'all':!![]}];}_0x565275=_[_0x5f79('0x49')]({},_0x565275,_0x5f2bb9[_0x5f79('0x55')]);return db[_0x5f79('0x4c')]['find'](_0x565275)[_0x5f79('0x1e')](handleEntityNotFound(_0x497296,null))[_0x5f79('0x1e')](respondWithResult(_0x497296,null))[_0x5f79('0x28')](handleError(_0x497296,null));};exports[_0x5f79('0x56')]=function(_0x2a5d8c,_0x478a5f){return db[_0x5f79('0x4c')]['create'](_0x2a5d8c['body'],{})[_0x5f79('0x1e')](respondWithResult(_0x478a5f,0xc9))[_0x5f79('0x28')](handleError(_0x478a5f,null));};exports[_0x5f79('0x57')]=function(_0x249290,_0x553ede){if(_0x249290[_0x5f79('0x58')]['id']){delete _0x249290['body']['id'];}return db['ChatMessage'][_0x5f79('0x59')]({'where':{'id':_0x249290[_0x5f79('0x52')]['id']}})[_0x5f79('0x1e')](handleEntityNotFound(_0x553ede,null))[_0x5f79('0x1e')](saveUpdates(_0x249290[_0x5f79('0x58')],null))[_0x5f79('0x1e')](respondWithResult(_0x553ede,null))['catch'](handleError(_0x553ede,null));};exports['destroy']=function(_0x5aba28,_0x46c1aa){return db['ChatMessage'][_0x5f79('0x59')]({'where':{'id':_0x5aba28[_0x5f79('0x52')]['id']}})[_0x5f79('0x1e')](handleEntityNotFound(_0x46c1aa,null))['then'](removeEntity(_0x46c1aa,null))[_0x5f79('0x28')](handleError(_0x46c1aa,null));};exports[_0x5f79('0x5a')]=function(_0x17248f,_0x38b2da){return db[_0x5f79('0x4c')][_0x5f79('0x5a')]()[_0x5f79('0x1e')](respondWithResult(_0x38b2da,null))['catch'](handleError(_0x38b2da,null));};var interaction_log=require(_0x5f79('0x11'))(_0x5f79('0x5b'));exports[_0x5f79('0x5c')]=function(_0xa19b7c,_0x3ef882,_0x526374){var _0x33d097={'agent':{},'channel':_0x5f79('0x5d')};if(_0xa19b7c['body']['id']){delete _0xa19b7c[_0x5f79('0x58')]['id'];}_0xa19b7c[_0x5f79('0x58')]['read']=!![];_0xa19b7c[_0x5f79('0x58')][_0x5f79('0x5e')]=moment()[_0x5f79('0x5f')](_0x5f79('0x60'));_0xa19b7c[_0x5f79('0x58')]['UserId']=_0xa19b7c[_0x5f79('0x58')]['UserId']||_0xa19b7c[_0x5f79('0x61')]['id'];_0x33d097[_0x5f79('0x62')]['id']=_0xa19b7c[_0x5f79('0x58')][_0x5f79('0x63')];return db[_0x5f79('0x4c')][_0x5f79('0x59')]({'where':{'id':_0xa19b7c[_0x5f79('0x52')]['id'],'UserId':null}})[_0x5f79('0x1e')](handleEntityNotFound(_0x3ef882,null))['then'](saveUpdates(_0xa19b7c['body'],null))[_0x5f79('0x1e')](function(_0x1a5115){if(_0x1a5115){_0x33d097[_0x5f79('0x25')]=_0x1a5115[_0x5f79('0x64')]({'plain':!![]});return db[_0x5f79('0x65')][_0x5f79('0x59')]({'where':{'id':_0x1a5115[_0x5f79('0x66')]}});}return null;})[_0x5f79('0x1e')](handleEntityNotFound(_0x3ef882,null))[_0x5f79('0x1e')](function(_0x161e85){if(_0x161e85){return _0x161e85['update']({'UserId':_0xa19b7c['body'][_0x5f79('0x63')],'read1stAt':_['isNil'](_0x161e85[_0x5f79('0x67')])?moment()[_0x5f79('0x5f')](_0x5f79('0x60')):undefined});}return null;})[_0x5f79('0x1e')](function(_0x5db50a){if(_0x5db50a){_0x33d097['interaction']=_0x5db50a['get']({'plain':!![]});interaction_log[_0x5f79('0x1f')](_0x5f79('0x68'),_0xa19b7c[_0x5f79('0x61')]['id'],_0xa19b7c[_0x5f79('0x61')][_0x5f79('0x37')],_0xa19b7c[_0x5f79('0x61')][_0x5f79('0x69')],_0x33d097[_0x5f79('0x6a')]['id'],_0xa19b7c[_0x5f79('0x58')]?JSON[_0x5f79('0x22')](_0xa19b7c[_0x5f79('0x58')]):_0x5f79('0x6b'));return respondWithRpcPromise('AcceptMessage',_0x5f79('0x6c'),_0x33d097);}return null;})[_0x5f79('0x1e')](function(_0x5bdaf6){var _0x324c0e=_0x5f79('0x6d')+_0x5bdaf6[_0x5f79('0x25')][_0x5f79('0x6e')];return db['sequelize'][_0x5f79('0x3c')](_0x324c0e,{'type':db[_0x5f79('0x6f')][_0x5f79('0x70')]['SELECT'],'raw':!![]})[_0x5f79('0x1e')](function(_0x57b409){return _0x57b409;});})['then'](function(_0xcf1076){if(_0xcf1076){_0x33d097[_0x5f79('0x25')]['contact']=_0xcf1076[0x0];if(!_0xa19b7c[_0x5f79('0x58')][_0x5f79('0x63')])return;return db[_0x5f79('0x71')][_0x5f79('0x59')]({'where':{'id':_0xa19b7c[_0x5f79('0x58')][_0x5f79('0x63')],'role':_0x5f79('0x62')},'attributes':['id','name','fullname',_0x5f79('0x72'),_0x5f79('0x73')],'raw':!![]});}return null;})[_0x5f79('0x1e')](function(_0x4e0ab2){if(!_0x4e0ab2)return null;_0x33d097['message'][_0x5f79('0x62')]=_0x4e0ab2;return _0x33d097;})[_0x5f79('0x1e')](function(_0x18d89f){if(_0x18d89f){if(_0xa19b7c[_0x5f79('0x58')][_0x5f79('0x74')]){_0x33d097[_0x5f79('0x25')]['interface']=util[_0x5f79('0x5f')](_0x5f79('0x75'),_0xa19b7c[_0x5f79('0x61')][_0x5f79('0x37')]);_0x33d097['message'][_0x5f79('0x76')]=_0x33d097[_0x5f79('0x76')];_0x33d097[_0x5f79('0x25')]['motionChannel']=_0x33d097[_0x5f79('0x76')];_0x33d097['message'][_0x5f79('0x77')]=_0x5f79('0x5c');return respondWithRpcPromise('EventManager',_0x5f79('0x78'),{'event':'acceptmessage','message':_[_0x5f79('0x49')](_0x33d097[_0x5f79('0x25')],JSON['parse'](_0x33d097[_0x5f79('0x6a')][_0x5f79('0x79')]))},client9002)[_0x5f79('0x1e')](function(){return _0x33d097;});}return _0x33d097;}return null;})['then'](respondWithResult(_0x3ef882,null))[_0x5f79('0x28')](handleError(_0x3ef882,null));};var interaction_log=require(_0x5f79('0x11'))(_0x5f79('0x5b'));exports[_0x5f79('0x34')]=function(_0x202c44,_0xe035fe,_0x2cf189){var _0x4056a9={'agent':{},'channel':_0x5f79('0x5d')};if(_0x202c44[_0x5f79('0x58')]['id']){delete _0x202c44['body']['id'];}_0x202c44[_0x5f79('0x58')]['UserId']=_0x202c44[_0x5f79('0x58')][_0x5f79('0x63')]||_0x202c44[_0x5f79('0x61')]['id'];_0x4056a9[_0x5f79('0x62')]['id']=_0x202c44[_0x5f79('0x58')][_0x5f79('0x63')];return db['ChatMessage'][_0x5f79('0x59')]({'where':{'id':_0x202c44[_0x5f79('0x52')]['id'],'UserId':null}})[_0x5f79('0x1e')](handleEntityNotFound(_0xe035fe,null))[_0x5f79('0x1e')](function(_0x2e30b0){if(_0x2e30b0){_0x4056a9[_0x5f79('0x25')]=_0x2e30b0[_0x5f79('0x64')]({'plain':!![]});return db[_0x5f79('0x65')][_0x5f79('0x59')]({'where':{'id':_0x2e30b0[_0x5f79('0x66')]}});}return null;})['then'](handleEntityNotFound(_0xe035fe,null))[_0x5f79('0x1e')](function(_0x209549){if(_0x209549){_0x4056a9['interaction']=_0x209549[_0x5f79('0x64')]({'plain':!![]});interaction_log['info'](_0x5f79('0x7a'),_0x202c44[_0x5f79('0x61')]['id'],_0x202c44[_0x5f79('0x61')]['name'],_0x202c44['user']['role'],_0x4056a9[_0x5f79('0x6a')]['id'],_0x202c44['body']?JSON['stringify'](_0x202c44[_0x5f79('0x58')]):_0x5f79('0x6b'));return respondWithRpcPromise(_0x5f79('0x7b'),_0x5f79('0x7c'),_0x4056a9);}return null;})['then'](function(_0x5e824d){var _0x23b78e=_0x5f79('0x6d')+_0x5e824d[_0x5f79('0x25')]['ContactId'];return db['sequelize']['query'](_0x23b78e,{'type':db['Sequelize']['QueryTypes'][_0x5f79('0x7d')],'raw':!![]})[_0x5f79('0x1e')](function(_0x9fccae){return _0x9fccae;});})[_0x5f79('0x1e')](function(_0x41c357){if(_0x41c357){_0x4056a9[_0x5f79('0x25')][_0x5f79('0x7e')]=_0x41c357[0x0];if(!_0x202c44[_0x5f79('0x58')]['UserId'])return;return db[_0x5f79('0x71')][_0x5f79('0x59')]({'where':{'id':_0x202c44[_0x5f79('0x58')][_0x5f79('0x63')],'role':_0x5f79('0x62')},'attributes':['id',_0x5f79('0x37'),_0x5f79('0x7f'),'email',_0x5f79('0x73')],'raw':!![]});}return null;})['then'](function(_0x28c0f0){if(!_0x28c0f0)return null;_0x4056a9[_0x5f79('0x25')]['agent']=_0x28c0f0;return _0x4056a9;})[_0x5f79('0x1e')](function(_0x28a143){if(_0x28a143){_0x28a143['message']['interface']=util['format'](_0x5f79('0x75'),_0x202c44['user'][_0x5f79('0x37')]);_0x28a143[_0x5f79('0x25')][_0x5f79('0x76')]=_0x4056a9['channel'];_0x28a143[_0x5f79('0x25')]['motionChannel']=_0x4056a9[_0x5f79('0x76')];_0x28a143['message']['event']='reject';respondWithRpcPromise(_0x5f79('0x78'),_0x5f79('0x78'),{'event':_0x5f79('0x80'),'message':_[_0x5f79('0x49')](_0x4056a9[_0x5f79('0x25')],JSON[_0x5f79('0x81')](_0x4056a9[_0x5f79('0x6a')][_0x5f79('0x79')]))},client9002);return _0x4056a9;}return null;})[_0x5f79('0x1e')](respondWithResult(_0xe035fe,null))[_0x5f79('0x28')](handleError(_0xe035fe,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 84a65ee..77f2574 100644
--- a/server/api/chatMessage/chatMessage.events.js
+++ b/server/api/chatMessage/chatMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xacf0=['update','emit','hook','exports','../../mysqldb','ChatMessage','setMaxListeners'];(function(_0x87dd0e,_0x390eec){var _0x3f6891=function(_0x23b531){while(--_0x23b531){_0x87dd0e['push'](_0x87dd0e['shift']());}};_0x3f6891(++_0x390eec);}(_0xacf0,0x185));var _0x0acf=function(_0x278fa6,_0x59feac){_0x278fa6=_0x278fa6-0x0;var _0x262a91=_0xacf0[_0x278fa6];return _0x262a91;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0x0acf('0x0'))['db'][_0x0acf('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0acf('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0acf('0x3'),'afterDestroy':'remove'};function emitEvent(_0x502457){return function(_0x503f91,_0x3ee6da,_0x340b4e){ChatMessageEvents[_0x0acf('0x4')](_0x502457+':'+_0x503f91['id'],_0x503f91);ChatMessageEvents[_0x0acf('0x4')](_0x502457,_0x503f91);_0x340b4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x0acf('0x5')](e,emitEvent(event));}}module[_0x0acf('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x3213=['hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit'];(function(_0x483260,_0x3c7ba3){var _0x3db1a2=function(_0x4c358d){while(--_0x4c358d){_0x483260['push'](_0x483260['shift']());}};_0x3db1a2(++_0x3c7ba3);}(_0x3213,0x124));var _0x3321=function(_0x3685e9,_0x100b3a){_0x3685e9=_0x3685e9-0x0;var _0x2164a5=_0x3213[_0x3685e9];return _0x2164a5;};'use strict';var EventEmitter=require(_0x3321('0x0'));var ChatMessage=require(_0x3321('0x1'))['db'][_0x3321('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x3321('0x3')](0x0);var events={'afterCreate':_0x3321('0x4'),'afterUpdate':_0x3321('0x5'),'afterDestroy':_0x3321('0x6')};function emitEvent(_0x58562b){return function(_0xad6e2b,_0x25d056,_0x5ade3e){ChatMessageEvents[_0x3321('0x7')](_0x58562b+':'+_0xad6e2b['id'],_0xad6e2b);ChatMessageEvents[_0x3321('0x7')](_0x58562b,_0xad6e2b);_0x5ade3e(null);};}for(var e in events){if(events[_0x3321('0x8')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x3321('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 6a553b5..bb0e4ab 100644
--- a/server/api/chatMessage/chatMessage.model.js
+++ b/server/api/chatMessage/chatMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3bd5=['UserId','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','toLowerCase','error','utf8mb4','lodash','util','api','moment','bluebird','request-promise','path','./chatMessage.attributes','exports','ChatMessage','fti_chat_messages','FULLTEXT','models','get','direction','out','secret','isNil'];(function(_0x27c24b,_0x335de8){var _0x2237bf=function(_0x5cab96){while(--_0x5cab96){_0x27c24b['push'](_0x27c24b['shift']());}};_0x2237bf(++_0x335de8);}(_0x3bd5,0x13e));var _0x53bd=function(_0xa102e6,_0x3e557c){_0xa102e6=_0xa102e6-0x0;var _0xa7d73d=_0x3bd5[_0xa102e6];return _0xa7d73d;};'use strict';var _=require(_0x53bd('0x0'));var util=require(_0x53bd('0x1'));var logger=require('../../config/logger')(_0x53bd('0x2'));var moment=require(_0x53bd('0x3'));var BPromise=require(_0x53bd('0x4'));var rp=require(_0x53bd('0x5'));var fs=require('fs');var path=require(_0x53bd('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x53bd('0x7'));module[_0x53bd('0x8')]=function(_0x471fea,_0x2f999f){return _0x471fea['define'](_0x53bd('0x9'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x53bd('0xa'),'fields':['body'],'type':_0x53bd('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x49de07,_0x331b50,_0x100203){var _0x3e327c=_0x471fea[_0x53bd('0xc')];var _0x464a2d=_0x49de07[_0x53bd('0xd')]({'plain':!![]});if(_0x464a2d[_0x53bd('0xe')]['toLowerCase']()==='in'||_0x464a2d[_0x53bd('0xe')]['toLowerCase']()===_0x53bd('0xf')&&!_0x464a2d[_0x53bd('0x10')]&&!_[_0x53bd('0x11')](_0x464a2d[_0x53bd('0x12')])){_0x3e327c[_0x53bd('0x13')][_0x53bd('0x14')]({'where':{'id':_0x464a2d[_0x53bd('0x15')]}})[_0x53bd('0x16')](function(_0x35d237){if(_0x35d237){_0x35d237[_0x53bd('0x17')]({'lastMsgAt':_0x464a2d[_0x53bd('0x18')],'lastMsgDirection':_0x464a2d[_0x53bd('0xe')][_0x53bd('0x19')]()});}})['catch'](function(_0x59172a){console[_0x53bd('0x1a')](_0x59172a);});}_0x100203();}},'charset':_0x53bd('0x1b'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x0bc7=['toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x0bc7,0x1dc));var _0x70bc=function(_0x20bb15,_0x537275){_0x20bb15=_0x20bb15-0x0;var _0x2814df=_0x0bc7[_0x20bb15];return _0x2814df;};'use strict';var _=require(_0x70bc('0x0'));var util=require(_0x70bc('0x1'));var logger=require(_0x70bc('0x2'))(_0x70bc('0x3'));var moment=require(_0x70bc('0x4'));var BPromise=require('bluebird');var rp=require(_0x70bc('0x5'));var fs=require('fs');var path=require(_0x70bc('0x6'));var rimraf=require(_0x70bc('0x7'));var config=require(_0x70bc('0x8'));var attributes=require(_0x70bc('0x9'));module[_0x70bc('0xa')]=function(_0x606c5c,_0x3a874b){return _0x606c5c['define'](_0x70bc('0xb'),attributes,{'tableName':_0x70bc('0xc'),'paranoid':![],'indexes':[{'name':_0x70bc('0xd'),'fields':[_0x70bc('0xe')],'type':_0x70bc('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3f4e3a,_0x3d1d5e,_0x18b395){var _0x53b5a3=_0x606c5c[_0x70bc('0x10')];var _0x1fed2b=_0x3f4e3a[_0x70bc('0x11')]({'plain':!![]});if(_0x1fed2b[_0x70bc('0x12')][_0x70bc('0x13')]()==='in'||_0x1fed2b['direction'][_0x70bc('0x13')]()===_0x70bc('0x14')&&!_0x1fed2b[_0x70bc('0x15')]&&!_[_0x70bc('0x16')](_0x1fed2b[_0x70bc('0x17')])){_0x53b5a3[_0x70bc('0x18')][_0x70bc('0x19')]({'where':{'id':_0x1fed2b[_0x70bc('0x1a')]}})['then'](function(_0x128c5c){if(_0x128c5c){_0x128c5c[_0x70bc('0x1b')]({'lastMsgAt':_0x1fed2b[_0x70bc('0x1c')],'lastMsgDirection':_0x1fed2b[_0x70bc('0x12')][_0x70bc('0x13')]()});}})[_0x70bc('0x1d')](function(_0x45c6ba){console[_0x70bc('0x1e')](_0x45c6ba);});}_0x18b395();}},'charset':_0x70bc('0x1f'),'collate':_0x70bc('0x20')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 63f1b34..7f3b373 100644
--- a/server/api/chatMessage/chatMessage.rpc.js
+++ b/server/api/chatMessage/chatMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x071a=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','ChatMessage','body','raw','CreateChatMessage','util','moment','bluebird'];(function(_0x2145bf,_0x440573){var _0x528116=function(_0x49ac96){while(--_0x49ac96){_0x2145bf['push'](_0x2145bf['shift']());}};_0x528116(++_0x440573);}(_0x071a,0x1af));var _0xa071=function(_0x434339,_0x2abf5e){_0x434339=_0x434339-0x0;var _0x507ca6=_0x071a[_0x434339];return _0x507ca6;};'use strict';var _=require('lodash');var util=require(_0xa071('0x0'));var moment=require(_0xa071('0x1'));var BPromise=require(_0xa071('0x2'));var rs=require(_0xa071('0x3'));var fs=require('fs');var Redis=require(_0xa071('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa071('0x5'));var logger=require(_0xa071('0x6'))(_0xa071('0x7'));var config=require('../../config/environment');var jayson=require(_0xa071('0x8'));var client=jayson[_0xa071('0x9')][_0xa071('0xa')]({'port':0x232a});config['redis']=_[_0xa071('0xb')](config[_0xa071('0xc')],{'host':_0xa071('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa071('0xc')]));require(_0xa071('0xe'))[_0xa071('0xf')](socket);function respondWithRpcPromise(_0x48dca2,_0x443cb4,_0x4aca3f){return new BPromise(function(_0x5400eb,_0x499bce){return client['request'](_0x48dca2,_0x4aca3f)[_0xa071('0x10')](function(_0x1cdc16){logger[_0xa071('0x11')](_0xa071('0x12'),_0x443cb4,_0xa071('0x13'));logger[_0xa071('0x14')](_0xa071('0x15'),_0x443cb4,_0xa071('0x13'),JSON[_0xa071('0x16')](_0x1cdc16));if(_0x1cdc16[_0xa071('0x17')]){if(_0x1cdc16[_0xa071('0x17')][_0xa071('0x18')]===0x1f4){logger[_0xa071('0x17')]('ChatMessage,\x20%s,\x20%s',_0x443cb4,_0x1cdc16[_0xa071('0x17')][_0xa071('0x19')]);return _0x499bce(_0x1cdc16[_0xa071('0x17')][_0xa071('0x19')]);}logger[_0xa071('0x17')]('ChatMessage,\x20%s,\x20%s',_0x443cb4,_0x1cdc16[_0xa071('0x17')][_0xa071('0x19')]);return _0x5400eb(_0x1cdc16[_0xa071('0x17')][_0xa071('0x19')]);}else{logger['info'](_0xa071('0x12'),_0x443cb4,'request\x20sent');_0x5400eb(_0x1cdc16['result'][_0xa071('0x19')]);}})[_0xa071('0x1a')](function(_0x50486c){logger[_0xa071('0x17')](_0xa071('0x12'),_0x443cb4,_0x50486c);_0x499bce(_0x50486c);});});}exports['CreateChatMessage']=function(_0x9609ed){var _0x31b9fc=this;return new Promise(function(_0x140703,_0x2ef6db){return db[_0xa071('0x1b')]['create'](_0x9609ed[_0xa071('0x1c')],{'raw':_0x9609ed['options']?_0x9609ed['options'][_0xa071('0x1d')]===undefined?!![]:![]:!![]})[_0xa071('0x10')](function(_0x2e6972){logger['info'](_0xa071('0x1e'),_0x9609ed);logger['debug']('CreateChatMessage',_0x9609ed,JSON['stringify'](_0x2e6972));_0x140703(_0x2e6972);})['catch'](function(_0x513216){logger[_0xa071('0x17')](_0xa071('0x1e'),_0x513216[_0xa071('0x19')],_0x9609ed);_0x2ef6db(_0x31b9fc[_0xa071('0x17')](0x1f4,_0x513216[_0xa071('0x19')]));});});};
\ No newline at end of file
+var _0x8c15=['options','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','create','body'];(function(_0x168ded,_0x34f11b){var _0x838b5f=function(_0x182ce4){while(--_0x182ce4){_0x168ded['push'](_0x168ded['shift']());}};_0x838b5f(++_0x34f11b);}(_0x8c15,0x1d1));var _0x58c1=function(_0x5a3f6f,_0x1491d6){_0x5a3f6f=_0x5a3f6f-0x0;var _0x3cefe7=_0x8c15[_0x5a3f6f];return _0x3cefe7;};'use strict';var _=require(_0x58c1('0x0'));var util=require('util');var moment=require(_0x58c1('0x1'));var BPromise=require(_0x58c1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x58c1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x58c1('0x4'));var logger=require(_0x58c1('0x5'))(_0x58c1('0x6'));var config=require('../../config/environment');var jayson=require(_0x58c1('0x7'));var client=jayson[_0x58c1('0x8')][_0x58c1('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x58c1('0xa')]));require(_0x58c1('0xb'))[_0x58c1('0xc')](socket);function respondWithRpcPromise(_0x5b41f0,_0xac92b5,_0x3a5e9a){return new BPromise(function(_0x8f27d0,_0x3ebabd){return client[_0x58c1('0xd')](_0x5b41f0,_0x3a5e9a)[_0x58c1('0xe')](function(_0x352f5d){logger[_0x58c1('0xf')](_0x58c1('0x10'),_0xac92b5,_0x58c1('0x11'));logger[_0x58c1('0x12')](_0x58c1('0x13'),_0xac92b5,_0x58c1('0x11'),JSON[_0x58c1('0x14')](_0x352f5d));if(_0x352f5d['error']){if(_0x352f5d[_0x58c1('0x15')]['code']===0x1f4){logger[_0x58c1('0x15')]('ChatMessage,\x20%s,\x20%s',_0xac92b5,_0x352f5d[_0x58c1('0x15')][_0x58c1('0x16')]);return _0x3ebabd(_0x352f5d[_0x58c1('0x15')]['message']);}logger[_0x58c1('0x15')](_0x58c1('0x10'),_0xac92b5,_0x352f5d[_0x58c1('0x15')][_0x58c1('0x16')]);return _0x8f27d0(_0x352f5d['error']['message']);}else{logger['info'](_0x58c1('0x10'),_0xac92b5,_0x58c1('0x11'));_0x8f27d0(_0x352f5d[_0x58c1('0x17')][_0x58c1('0x16')]);}})[_0x58c1('0x18')](function(_0x3b3e09){logger[_0x58c1('0x15')]('ChatMessage,\x20%s,\x20%s',_0xac92b5,_0x3b3e09);_0x3ebabd(_0x3b3e09);});});}exports[_0x58c1('0x19')]=function(_0x345ff9){var _0xa045a4=this;return new Promise(function(_0x260963,_0x85b2c6){return db['ChatMessage'][_0x58c1('0x1a')](_0x345ff9[_0x58c1('0x1b')],{'raw':_0x345ff9[_0x58c1('0x1c')]?_0x345ff9['options']['raw']===undefined?!![]:![]:!![]})[_0x58c1('0xe')](function(_0x241c4f){logger[_0x58c1('0xf')](_0x58c1('0x19'),_0x345ff9);logger[_0x58c1('0x12')](_0x58c1('0x19'),_0x345ff9,JSON[_0x58c1('0x14')](_0x241c4f));_0x260963(_0x241c4f);})[_0x58c1('0x18')](function(_0x223443){logger[_0x58c1('0x15')]('CreateChatMessage',_0x223443[_0x58c1('0x16')],_0x345ff9);_0x85b2c6(_0xa045a4[_0x58c1('0x15')](0x1f4,_0x223443[_0x58c1('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 6c82b26..9582cf7 100644
--- a/server/api/chatMessage/chatMessage.socket.js
+++ b/server/api/chatMessage/chatMessage.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x689c=['emit','length','chatMessage:','remove','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x689c,0x9e));var _0xc689=function(_0x42a72e,_0x5182d5){_0x42a72e=_0x42a72e-0x0;var _0x1d513a=_0x689c[_0x42a72e];return _0x1d513a;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=['save',_0xc689('0x0'),_0xc689('0x1')];function createListener(_0x91491e,_0xe6811d){return function(_0x44533d){_0xe6811d[_0xc689('0x2')](_0x91491e,_0x44533d);};}function removeListener(_0x4b863b,_0x3d106f){return function(){ChatMessageEvents['removeListener'](_0x4b863b,_0x3d106f);};}exports['register']=function(_0x3a4916){for(var _0x28ce4c=0x0,_0x2b9f8a=events[_0xc689('0x3')];_0x28ce4c<_0x2b9f8a;_0x28ce4c++){var _0x2e7400=events[_0x28ce4c];var _0x57f82f=createListener(_0xc689('0x4')+_0x2e7400,_0x3a4916);ChatMessageEvents['on'](_0x2e7400,_0x57f82f);}};
\ No newline at end of file
+var _0x64f5=['removeListener','register','length','chatMessage:','./chatMessage.events','emit'];(function(_0x57a402,_0x40596b){var _0x753a36=function(_0x13b76b){while(--_0x13b76b){_0x57a402['push'](_0x57a402['shift']());}};_0x753a36(++_0x40596b);}(_0x64f5,0x17e));var _0x564f=function(_0x1a18cc,_0x8dd51b){_0x1a18cc=_0x1a18cc-0x0;var _0x15e226=_0x64f5[_0x1a18cc];return _0x15e226;};'use strict';var ChatMessageEvents=require(_0x564f('0x0'));var events=['save','remove','update'];function createListener(_0x39903b,_0x493091){return function(_0x2e7142){_0x493091[_0x564f('0x1')](_0x39903b,_0x2e7142);};}function removeListener(_0x59c424,_0x2607d6){return function(){ChatMessageEvents[_0x564f('0x2')](_0x59c424,_0x2607d6);};}exports[_0x564f('0x3')]=function(_0x72b009){for(var _0x4bbedf=0x0,_0x4d3dae=events[_0x564f('0x4')];_0x4bbedf<_0x4d3dae;_0x4bbedf++){var _0x28db5a=events[_0x4bbedf];var _0x275bd6=createListener(_0x564f('0x5')+_0x28db5a,_0x72b009);ChatMessageEvents['on'](_0x28db5a,_0x275bd6);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 812d270..1fef776 100644
--- a/server/api/chatMessage/index.js
+++ b/server/api/chatMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5037=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','chat','chatmessage:create','create','update','put','/:id/accept','accept','/:id/reject','delete'];(function(_0x5de532,_0x2941c4){var _0x4e9192=function(_0x548a81){while(--_0x548a81){_0x5de532['push'](_0x5de532['shift']());}};_0x4e9192(++_0x2941c4);}(_0x5037,0x1cb));var _0x7503=function(_0xe72a4,_0x287cf9){_0xe72a4=_0xe72a4-0x0;var _0x909bc2=_0x5037[_0xe72a4];return _0x909bc2;};'use strict';var multer=require(_0x7503('0x0'));var util=require(_0x7503('0x1'));var path=require(_0x7503('0x2'));var timeout=require(_0x7503('0x3'));var express=require(_0x7503('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x7503('0x5'));var interaction=require(_0x7503('0x6'));var config=require(_0x7503('0x7'));var controller=require(_0x7503('0x8'));router['get']('/',auth[_0x7503('0x9')](),controller[_0x7503('0xa')]);router[_0x7503('0xb')](_0x7503('0xc'),auth[_0x7503('0x9')](),controller[_0x7503('0xd')]);router[_0x7503('0xb')](_0x7503('0xe'),auth[_0x7503('0x9')](),controller[_0x7503('0xf')]);router[_0x7503('0x10')]('/',auth[_0x7503('0x9')](),interaction[_0x7503('0x11')](_0x7503('0x12'),_0x7503('0x13')),controller[_0x7503('0x14')]);router['put'](_0x7503('0xe'),controller[_0x7503('0x15')]);router[_0x7503('0x16')](_0x7503('0x17'),auth['isAuthenticated'](),controller[_0x7503('0x18')]);router[_0x7503('0x16')](_0x7503('0x19'),auth[_0x7503('0x9')](),controller['reject']);router[_0x7503('0x1a')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x78a8=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe','show','post','tracked','chat','put','/:id','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util'];(function(_0x5d99bb,_0x10e04b){var _0xdfe846=function(_0x2e3377){while(--_0x2e3377){_0x5d99bb['push'](_0x5d99bb['shift']());}};_0xdfe846(++_0x10e04b);}(_0x78a8,0x136));var _0x878a=function(_0x40063b,_0x934e64){_0x40063b=_0x40063b-0x0;var _0x2ea58b=_0x78a8[_0x40063b];return _0x2ea58b;};'use strict';var multer=require(_0x878a('0x0'));var util=require(_0x878a('0x1'));var path=require('path');var timeout=require(_0x878a('0x2'));var express=require(_0x878a('0x3'));var router=express[_0x878a('0x4')]();var fs_extra=require(_0x878a('0x5'));var auth=require(_0x878a('0x6'));var interaction=require(_0x878a('0x7'));var config=require(_0x878a('0x8'));var controller=require(_0x878a('0x9'));router[_0x878a('0xa')]('/',auth[_0x878a('0xb')](),controller[_0x878a('0xc')]);router[_0x878a('0xa')](_0x878a('0xd'),auth[_0x878a('0xb')](),controller['describe']);router['get']('/:id',auth[_0x878a('0xb')](),controller[_0x878a('0xe')]);router[_0x878a('0xf')]('/',auth[_0x878a('0xb')](),interaction[_0x878a('0x10')](_0x878a('0x11'),'chatmessage:create'),controller['create']);router[_0x878a('0x12')](_0x878a('0x13'),controller[_0x878a('0x14')]);router[_0x878a('0x12')](_0x878a('0x15'),auth[_0x878a('0xb')](),controller[_0x878a('0x16')]);router[_0x878a('0x12')](_0x878a('0x17'),auth[_0x878a('0xb')](),controller['reject']);router[_0x878a('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x878a('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index b0abaf5..d3ef90d 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4817f9,_0x4070d1){_0x4817f9=_0x4817f9-0x0;var _0x2dcfa6=_0x0b0e[_0x4817f9];return _0x2dcfa6;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x98eefc,_0x59e26d){var _0x4bfc79=function(_0x358670){while(--_0x358670){_0x98eefc['push'](_0x98eefc['shift']());}};_0x4bfc79(++_0x59e26d);}(_0xadb5,0xad));var _0x5adb=function(_0x25e58c,_0x1453e6){_0x25e58c=_0x25e58c-0x0;var _0x213ef5=_0xadb5[_0x25e58c];return _0x213ef5;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 59a2613..dea61a2 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x521929,_0x479be5){var _0x632436=function(_0x288290){while(--_0x288290){_0x521929['push'](_0x521929['shift']());}};_0x632436(++_0x479be5);}(_0x7a54,0x106));var _0x47a5=function(_0x167c0d,_0x2b1aca){_0x167c0d=_0x167c0d-0x0;var _0x53cad3=_0x7a54[_0x167c0d];return _0x53cad3;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
+var _0x9957=['sendStatus','status','json','undefined','count','offset','limit','set','Content-Range','reject','save','then','destroy','error','name','send','index','fieldName','type','key','model','map','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','ChatOfflineMessage','findAll','rows','show','rawAttributes','includeAll','include','find','create','catch','body','params','Attachment','forEach','join','root','server','files','attachments','basename','existsSync','remove','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb'];(function(_0x5e1fa3,_0x35f103){var _0x3b2771=function(_0x496434){while(--_0x496434){_0x5e1fa3['push'](_0x5e1fa3['shift']());}};_0x3b2771(++_0x35f103);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 14c1e5a..510b59b 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x430a=['remove','emit','hasOwnProperty','hook','exports','events','ChatOfflineMessage','setMaxListeners','save','update'];(function(_0x3c149f,_0x2cb990){var _0x73c3fb=function(_0x25e3a1){while(--_0x25e3a1){_0x3c149f['push'](_0x3c149f['shift']());}};_0x73c3fb(++_0x2cb990);}(_0x430a,0xaf));var _0xa430=function(_0x53c699,_0x2eb707){_0x53c699=_0x53c699-0x0;var _0x35dbb0=_0x430a[_0x53c699];return _0x35dbb0;};'use strict';var EventEmitter=require(_0xa430('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa430('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa430('0x2')](0x0);var events={'afterCreate':_0xa430('0x3'),'afterUpdate':_0xa430('0x4'),'afterDestroy':_0xa430('0x5')};function emitEvent(_0x59ffea){return function(_0x5be567,_0x5dbc29,_0x4aa979){ChatOfflineMessageEvents[_0xa430('0x6')](_0x59ffea+':'+_0x5be567['id'],_0x5be567);ChatOfflineMessageEvents[_0xa430('0x6')](_0x59ffea,_0x5be567);_0x4aa979(null);};}for(var e in events){if(events[_0xa430('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xa430('0x8')](e,emitEvent(event));}}module[_0xa430('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x8be8=['save','update','remove','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners'];(function(_0x407a9b,_0x40f99e){var _0x5d3446=function(_0x488de2){while(--_0x488de2){_0x407a9b['push'](_0x407a9b['shift']());}};_0x5d3446(++_0x40f99e);}(_0x8be8,0xf6));var _0x88be=function(_0x1a193a,_0xca4f48){_0x1a193a=_0x1a193a-0x0;var _0x2d5806=_0x8be8[_0x1a193a];return _0x2d5806;};'use strict';var EventEmitter=require(_0x88be('0x0'));var ChatOfflineMessage=require(_0x88be('0x1'))['db'][_0x88be('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x88be('0x3')](0x0);var events={'afterCreate':_0x88be('0x4'),'afterUpdate':_0x88be('0x5'),'afterDestroy':_0x88be('0x6')};function emitEvent(_0x3a60b8){return function(_0x1d256d,_0x4caaef,_0x142ac3){ChatOfflineMessageEvents['emit'](_0x3a60b8+':'+_0x1d256d['id'],_0x1d256d);ChatOfflineMessageEvents[_0x88be('0x7')](_0x3a60b8,_0x1d256d);_0x142ac3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x88be('0x8')](e,emitEvent(event));}}module[_0x88be('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index a6c1aa7..de62074 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.model.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2cc1=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2cc1,0xff));var _0x12cc=function(_0x4dcac4,_0x10e48a){_0x4dcac4=_0x4dcac4-0x0;var _0x2a238d=_0x2cc1[_0x4dcac4];return _0x2a238d;};'use strict';var attributes=require(_0x12cc('0x0'));module[_0x12cc('0x1')]=function(_0x5ca102){return _0x5ca102[_0x12cc('0x2')](_0x12cc('0x3'),attributes,{'tableName':_0x12cc('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x12cc('0x5')});};
\ No newline at end of file
+var _0x84e8=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages'];(function(_0x16c467,_0x53d6fa){var _0x22db4f=function(_0x498d3f){while(--_0x498d3f){_0x16c467['push'](_0x16c467['shift']());}};_0x22db4f(++_0x53d6fa);}(_0x84e8,0x18d));var _0x884e=function(_0x5846e6,_0x22af18){_0x5846e6=_0x5846e6-0x0;var _0xae42ad=_0x84e8[_0x5846e6];return _0xae42ad;};'use strict';var attributes=require(_0x884e('0x0'));module['exports']=function(_0x19950e){return _0x19950e['define'](_0x884e('0x1'),attributes,{'tableName':_0x884e('0x2'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x884e('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index bc1685b..ce0a971 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6dd1=['debug','stringify','error','code','message','info','request\x20sent','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x1af0e5,_0x152990){var _0x3c444a=function(_0x3b3d13){while(--_0x3b3d13){_0x1af0e5['push'](_0x1af0e5['shift']());}};_0x3c444a(++_0x152990);}(_0x6dd1,0x111));var _0x16dd=function(_0xd34cda,_0x166dc7){_0xd34cda=_0xd34cda-0x0;var _0x210016=_0x6dd1[_0xd34cda];return _0x210016;};'use strict';var _=require(_0x16dd('0x0'));var util=require('util');var moment=require(_0x16dd('0x1'));var BPromise=require(_0x16dd('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x16dd('0x3'));var db=require(_0x16dd('0x4'))['db'];var utils=require(_0x16dd('0x5'));var logger=require(_0x16dd('0x6'))(_0x16dd('0x7'));var config=require(_0x16dd('0x8'));var jayson=require(_0x16dd('0x9'));var client=jayson[_0x16dd('0xa')][_0x16dd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f532c,_0x589f69,_0x5ad29a){return new BPromise(function(_0x490566,_0x41bca0){return client[_0x16dd('0xc')](_0x4f532c,_0x5ad29a)[_0x16dd('0xd')](function(_0x19595a){logger['info'](_0x16dd('0xe'),_0x589f69,'request\x20sent');logger[_0x16dd('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x589f69,'request\x20sent',JSON[_0x16dd('0x10')](_0x19595a));if(_0x19595a[_0x16dd('0x11')]){if(_0x19595a['error'][_0x16dd('0x12')]===0x1f4){logger[_0x16dd('0x11')](_0x16dd('0xe'),_0x589f69,_0x19595a['error'][_0x16dd('0x13')]);return _0x41bca0(_0x19595a[_0x16dd('0x11')][_0x16dd('0x13')]);}logger[_0x16dd('0x11')](_0x16dd('0xe'),_0x589f69,_0x19595a['error']['message']);return _0x490566(_0x19595a[_0x16dd('0x11')]['message']);}else{logger[_0x16dd('0x14')](_0x16dd('0xe'),_0x589f69,_0x16dd('0x15'));_0x490566(_0x19595a[_0x16dd('0x16')][_0x16dd('0x13')]);}})[_0x16dd('0x17')](function(_0x17a646){logger[_0x16dd('0x11')]('ChatOfflineMessage,\x20%s,\x20%s',_0x589f69,_0x17a646);_0x41bca0(_0x17a646);});});}
\ No newline at end of file
+var _0x5f1e=['moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','info','result','catch','util'];(function(_0x5ae0d4,_0x13619c){var _0x4ab006=function(_0x34c85e){while(--_0x34c85e){_0x5ae0d4['push'](_0x5ae0d4['shift']());}};_0x4ab006(++_0x13619c);}(_0x5f1e,0x71));var _0xe5f1=function(_0x54cc08,_0x38d3ef){_0x54cc08=_0x54cc08-0x0;var _0x28989a=_0x5f1e[_0x54cc08];return _0x28989a;};'use strict';var _=require('lodash');var util=require(_0xe5f1('0x0'));var moment=require(_0xe5f1('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe5f1('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5f1('0x3'));var logger=require(_0xe5f1('0x4'))(_0xe5f1('0x5'));var config=require(_0xe5f1('0x6'));var jayson=require(_0xe5f1('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e66cb,_0x485e10,_0x339fd2){return new BPromise(function(_0x1eea62,_0x365065){return client['request'](_0x4e66cb,_0x339fd2)[_0xe5f1('0x8')](function(_0x344014){logger['info']('ChatOfflineMessage,\x20%s,\x20%s',_0x485e10,_0xe5f1('0x9'));logger[_0xe5f1('0xa')](_0xe5f1('0xb'),_0x485e10,_0xe5f1('0x9'),JSON['stringify'](_0x344014));if(_0x344014[_0xe5f1('0xc')]){if(_0x344014[_0xe5f1('0xc')][_0xe5f1('0xd')]===0x1f4){logger[_0xe5f1('0xc')](_0xe5f1('0xe'),_0x485e10,_0x344014[_0xe5f1('0xc')][_0xe5f1('0xf')]);return _0x365065(_0x344014[_0xe5f1('0xc')][_0xe5f1('0xf')]);}logger[_0xe5f1('0xc')](_0xe5f1('0xe'),_0x485e10,_0x344014['error']['message']);return _0x1eea62(_0x344014[_0xe5f1('0xc')]['message']);}else{logger[_0xe5f1('0x10')](_0xe5f1('0xe'),_0x485e10,_0xe5f1('0x9'));_0x1eea62(_0x344014[_0xe5f1('0x11')][_0xe5f1('0xf')]);}})[_0xe5f1('0x12')](function(_0x29f33a){logger[_0xe5f1('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x485e10,_0x29f33a);_0x365065(_0x29f33a);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 385c99f..0560dd0 100644
--- a/server/api/chatOfflineMessage/index.js
+++ b/server/api/chatOfflineMessage/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xa5a7=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','post','create','put','/:id','exports'];(function(_0xf4d05e,_0x5f1796){var _0x16aea9=function(_0x22e99d){while(--_0x22e99d){_0xf4d05e['push'](_0xf4d05e['shift']());}};_0x16aea9(++_0x5f1796);}(_0xa5a7,0x143));var _0x7a5a=function(_0x3ba5e5,_0x1fbf79){_0x3ba5e5=_0x3ba5e5-0x0;var _0x3e9579=_0xa5a7[_0x3ba5e5];return _0x3e9579;};'use strict';var multer=require(_0x7a5a('0x0'));var util=require(_0x7a5a('0x1'));var path=require(_0x7a5a('0x2'));var timeout=require(_0x7a5a('0x3'));var express=require(_0x7a5a('0x4'));var router=express[_0x7a5a('0x5')]();var fs_extra=require(_0x7a5a('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x7a5a('0x7'));var config=require(_0x7a5a('0x8'));var controller=require(_0x7a5a('0x9'));router[_0x7a5a('0xa')]('/',auth[_0x7a5a('0xb')](),controller[_0x7a5a('0xc')]);router['get']('/describe',auth[_0x7a5a('0xb')](),controller[_0x7a5a('0xd')]);router[_0x7a5a('0xa')]('/:id',auth[_0x7a5a('0xb')](),controller['show']);router[_0x7a5a('0xe')]('/',auth['isAuthenticated'](),controller[_0x7a5a('0xf')]);router[_0x7a5a('0x10')](_0x7a5a('0x11'),auth[_0x7a5a('0xb')](),controller['update']);router['delete']('/:id',auth[_0x7a5a('0xb')](),controller['destroy']);module[_0x7a5a('0x12')]=router;
\ No newline at end of file
+var _0xdc9f=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','post','create'];(function(_0x4bbb4,_0x46d3a6){var _0x528527=function(_0x5d5b60){while(--_0x5d5b60){_0x4bbb4['push'](_0x4bbb4['shift']());}};_0x528527(++_0x46d3a6);}(_0xdc9f,0x1b9));var _0xfdc9=function(_0x451b73,_0x1259a4){_0x451b73=_0x451b73-0x0;var _0x5142a8=_0xdc9f[_0x451b73];return _0x5142a8;};'use strict';var multer=require(_0xfdc9('0x0'));var util=require(_0xfdc9('0x1'));var path=require(_0xfdc9('0x2'));var timeout=require(_0xfdc9('0x3'));var express=require(_0xfdc9('0x4'));var router=express[_0xfdc9('0x5')]();var fs_extra=require(_0xfdc9('0x6'));var auth=require(_0xfdc9('0x7'));var interaction=require(_0xfdc9('0x8'));var config=require(_0xfdc9('0x9'));var controller=require(_0xfdc9('0xa'));router[_0xfdc9('0xb')]('/',auth[_0xfdc9('0xc')](),controller[_0xfdc9('0xd')]);router[_0xfdc9('0xb')](_0xfdc9('0xe'),auth[_0xfdc9('0xc')](),controller[_0xfdc9('0xf')]);router['get']('/:id',auth[_0xfdc9('0xc')](),controller[_0xfdc9('0x10')]);router[_0xfdc9('0x11')]('/',auth[_0xfdc9('0xc')](),controller[_0xfdc9('0x12')]);router['put'](_0xfdc9('0x13'),auth[_0xfdc9('0xc')](),controller['update']);router[_0xfdc9('0x14')]('/:id',auth[_0xfdc9('0xc')](),controller[_0xfdc9('0x15')]);module[_0xfdc9('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 35be8bb..992dec0 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.attributes.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6d4a=['STRING','ENUM','mouseOver','timeout','INTEGER','exports'];(function(_0x4bf953,_0x51dc7f){var _0x319f8f=function(_0xd1c3f9){while(--_0xd1c3f9){_0x4bf953['push'](_0x4bf953['shift']());}};_0x319f8f(++_0x51dc7f);}(_0x6d4a,0x173));var _0xa6d4=function(_0x473999,_0x244df9){_0x473999=_0x473999-0x0;var _0x38116c=_0x6d4a[_0x473999];return _0x38116c;};'use strict';var Sequelize=require('sequelize');module[_0xa6d4('0x0')]={'name':{'type':Sequelize[_0xa6d4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa6d4('0x2')](_0xa6d4('0x3'),_0xa6d4('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xa6d4('0x5')]}};
\ No newline at end of file
+var _0x088a=['exports','STRING','ENUM','mouseOver','timeout','INTEGER'];(function(_0x326273,_0xfa5842){var _0x32f10c=function(_0x192366){while(--_0x192366){_0x326273['push'](_0x326273['shift']());}};_0x32f10c(++_0xfa5842);}(_0x088a,0x120));var _0xa088=function(_0x1c8222,_0x13db80){_0x1c8222=_0x1c8222-0x0;var _0x4f0256=_0x088a[_0x1c8222];return _0x4f0256;};'use strict';var Sequelize=require('sequelize');module[_0xa088('0x0')]={'name':{'type':Sequelize[_0xa088('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xa088('0x2')](_0xa088('0x3'),_0xa088('0x4')),'defaultValue':_0xa088('0x3')},'selector':{'type':Sequelize[_0xa088('0x1')]},'timeout':{'type':Sequelize[_0xa088('0x5')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index e86b76d..fd20403 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.controller.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x535f=['request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','reject','save','update','then','destroy','error','stack','name','send','params','model','ChatProactiveAction','query','keys','filters','intersection','fields','attributes','length','options','find','catch','create','body','rimraf','zip-dir'];(function(_0x4fd82a,_0x29d9d5){var _0x21d2a8=function(_0x11f85f){while(--_0x11f85f){_0x4fd82a['push'](_0x4fd82a['shift']());}};_0x21d2a8(++_0x29d9d5);}(_0x535f,0x111));var _0xf535=function(_0x378549,_0x3abf7a){_0x378549=_0x378549-0x0;var _0x4fde3b=_0x535f[_0x378549];return _0x4fde3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf535('0x0'));var zipdir=require(_0xf535('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf535('0x2'));var moment=require(_0xf535('0x3'));var BPromise=require(_0xf535('0x4'));var Mustache=require(_0xf535('0x5'));var util=require('util');var path=require(_0xf535('0x6'));var sox=require(_0xf535('0x7'));var csv=require(_0xf535('0x8'));var ejs=require(_0xf535('0x9'));var fs=require('fs');var fs_extra=require(_0xf535('0xa'));var _=require(_0xf535('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf535('0xc'));var deskjs=require(_0xf535('0xd'));var toCsv=require(_0xf535('0x8'));var querystring=require('querystring');var Papa=require(_0xf535('0xe'));var Redis=require(_0xf535('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf535('0x10'));var hardwareService=require(_0xf535('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf535('0x12'));var config=require(_0xf535('0x13'));var licenseUtil=require(_0xf535('0x14'));var db=require(_0xf535('0x15'))['db'];function respondWithStatusCode(_0x471d53,_0x5e4cbd){_0x5e4cbd=_0x5e4cbd||0xcc;return function(_0x11928e){if(_0x11928e){return _0x471d53[_0xf535('0x16')](_0x5e4cbd);}return _0x471d53[_0xf535('0x17')](_0x5e4cbd)[_0xf535('0x18')]();};}function respondWithResult(_0x46792d,_0x338f06){_0x338f06=_0x338f06||0xc8;return function(_0x183049){if(_0x183049){return _0x46792d[_0xf535('0x17')](_0x338f06)[_0xf535('0x19')](_0x183049);}};}function respondWithFilteredResult(_0xb52d7f,_0xc3db30){return function(_0x4dacbb){if(_0x4dacbb){var _0x938e7f=typeof _0xc3db30[_0xf535('0x1a')]===_0xf535('0x1b')&&typeof _0xc3db30[_0xf535('0x1c')]===_0xf535('0x1b');var _0x1fb901=_0x4dacbb[_0xf535('0x1d')];var _0x33a8c3=_0x938e7f?0x0:_0xc3db30[_0xf535('0x1a')];var _0x477c1d=_0x938e7f?_0x4dacbb['count']:_0xc3db30[_0xf535('0x1a')]+_0xc3db30[_0xf535('0x1c')];var _0x6f757f;if(_0x477c1d>=_0x1fb901){_0x477c1d=_0x1fb901;_0x6f757f=0xc8;}else{_0x6f757f=0xce;}_0xb52d7f[_0xf535('0x17')](_0x6f757f);return _0xb52d7f['set'](_0xf535('0x1e'),_0x33a8c3+'-'+_0x477c1d+'/'+_0x1fb901)[_0xf535('0x19')](_0x4dacbb);}return null;};}function patchUpdates(_0x5c45bf){return function(_0x4ff009){try{jsonpatch['apply'](_0x4ff009,_0x5c45bf,!![]);}catch(_0x12f5d0){return BPromise[_0xf535('0x1f')](_0x12f5d0);}return _0x4ff009[_0xf535('0x20')]();};}function saveUpdates(_0x5e0ff4,_0x5b4980){return function(_0x438cb1){if(_0x438cb1){return _0x438cb1[_0xf535('0x21')](_0x5e0ff4)[_0xf535('0x22')](function(_0x16bd23){return _0x16bd23;});}return null;};}function removeEntity(_0x138cbd,_0x273ad0){return function(_0x358c91){if(_0x358c91){return _0x358c91[_0xf535('0x23')]()[_0xf535('0x22')](function(){_0x138cbd[_0xf535('0x17')](0xcc)[_0xf535('0x18')]();});}};}function handleEntityNotFound(_0x5b3917,_0x44ce19){return function(_0x28e761){if(!_0x28e761){_0x5b3917[_0xf535('0x16')](0x194);}return _0x28e761;};}function handleError(_0x46ce43,_0x407c5b){_0x407c5b=_0x407c5b||0x1f4;return function(_0x1250a0){logger[_0xf535('0x24')](_0x1250a0[_0xf535('0x25')]);if(_0x1250a0[_0xf535('0x26')]){delete _0x1250a0[_0xf535('0x26')];}_0x46ce43[_0xf535('0x17')](_0x407c5b)[_0xf535('0x27')](_0x1250a0);};}exports['show']=function(_0x5d1887,_0x47151e){var _0x12a94a={'raw':!![],'where':{'id':_0x5d1887[_0xf535('0x28')]['id']}},_0xfba892={};_0xfba892[_0xf535('0x29')]=_['keys'](db[_0xf535('0x2a')]['rawAttributes']);_0xfba892[_0xf535('0x2b')]=_[_0xf535('0x2c')](_0x5d1887[_0xf535('0x2b')]);_0xfba892[_0xf535('0x2d')]=_[_0xf535('0x2e')](_0xfba892[_0xf535('0x29')],_0xfba892[_0xf535('0x2b')]);_0x12a94a['attributes']=_[_0xf535('0x2e')](_0xfba892[_0xf535('0x29')],qs[_0xf535('0x2f')](_0x5d1887[_0xf535('0x2b')][_0xf535('0x2f')]));_0x12a94a[_0xf535('0x30')]=_0x12a94a[_0xf535('0x30')][_0xf535('0x31')]?_0x12a94a[_0xf535('0x30')]:_0xfba892['model'];if(_0x5d1887[_0xf535('0x2b')]['includeAll']){_0x12a94a['include']=[{'all':!![]}];}_0x12a94a=_['merge']({},_0x12a94a,_0x5d1887[_0xf535('0x32')]);return db[_0xf535('0x2a')][_0xf535('0x33')](_0x12a94a)['then'](handleEntityNotFound(_0x47151e,null))[_0xf535('0x22')](respondWithResult(_0x47151e,null))[_0xf535('0x34')](handleError(_0x47151e,null));};exports[_0xf535('0x35')]=function(_0x38f421,_0xc24fb0){return db[_0xf535('0x2a')]['create'](_0x38f421['body'],{})['then'](respondWithResult(_0xc24fb0,0xc9))['catch'](handleError(_0xc24fb0,null));};exports['update']=function(_0x4a1b36,_0x538e9f){if(_0x4a1b36['body']['id']){delete _0x4a1b36[_0xf535('0x36')]['id'];}return db[_0xf535('0x2a')]['find']({'where':{'id':_0x4a1b36[_0xf535('0x28')]['id']}})[_0xf535('0x22')](handleEntityNotFound(_0x538e9f,null))['then'](saveUpdates(_0x4a1b36[_0xf535('0x36')],null))[_0xf535('0x22')](respondWithResult(_0x538e9f,null))[_0xf535('0x34')](handleError(_0x538e9f,null));};exports['destroy']=function(_0x6fcb30,_0x241685){return db[_0xf535('0x2a')][_0xf535('0x33')]({'where':{'id':_0x6fcb30['params']['id']}})[_0xf535('0x22')](handleEntityNotFound(_0x241685,null))[_0xf535('0x22')](removeEntity(_0x241685,null))[_0xf535('0x34')](handleError(_0x241685,null));};
\ No newline at end of file
+var _0x6dc0=['create','body','catch','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','fs-extra','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','json','offset','undefined','count','set','apply','update','then','destroy','end','error','stack','name','model','keys','ChatProactiveAction','rawAttributes','query','filters','attributes','intersection','fields','includeAll','include','merge','options','find'];(function(_0x27f355,_0x4fd1cb){var _0x4972e8=function(_0x15adb7){while(--_0x15adb7){_0x27f355['push'](_0x27f355['shift']());}};_0x4972e8(++_0x4fd1cb);}(_0x6dc0,0x18c));var _0x06dc=function(_0x22f20b,_0x22ef2a){_0x22f20b=_0x22f20b-0x0;var _0x1b3f11=_0x6dc0[_0x22f20b];return _0x1b3f11;};'use strict';var emlformat=require(_0x06dc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x06dc('0x1'));var jsonpatch=require(_0x06dc('0x2'));var rp=require(_0x06dc('0x3'));var moment=require(_0x06dc('0x4'));var BPromise=require(_0x06dc('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x06dc('0x6'));var sox=require(_0x06dc('0x7'));var csv=require('to-csv');var ejs=require(_0x06dc('0x8'));var fs=require('fs');var fs_extra=require(_0x06dc('0x9'));var _=require('lodash');var squel=require(_0x06dc('0xa'));var crypto=require('crypto');var jsforce=require(_0x06dc('0xb'));var deskjs=require(_0x06dc('0xc'));var toCsv=require(_0x06dc('0xd'));var querystring=require(_0x06dc('0xe'));var Papa=require(_0x06dc('0xf'));var Redis=require('ioredis');var authService=require(_0x06dc('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x06dc('0x11'));var hardwareService=require(_0x06dc('0x12'));var logger=require('../../config/logger')(_0x06dc('0x13'));var utils=require(_0x06dc('0x14'));var config=require(_0x06dc('0x15'));var licenseUtil=require(_0x06dc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ce891,_0x3ffc60){_0x3ffc60=_0x3ffc60||0xcc;return function(_0x387c19){if(_0x387c19){return _0x3ce891[_0x06dc('0x17')](_0x3ffc60);}return _0x3ce891[_0x06dc('0x18')](_0x3ffc60)['end']();};}function respondWithResult(_0x17129d,_0xfc22f0){_0xfc22f0=_0xfc22f0||0xc8;return function(_0x9806ef){if(_0x9806ef){return _0x17129d[_0x06dc('0x18')](_0xfc22f0)[_0x06dc('0x19')](_0x9806ef);}};}function respondWithFilteredResult(_0x44a252,_0x42414d){return function(_0x592cb7){if(_0x592cb7){var _0xc2eb3c=typeof _0x42414d[_0x06dc('0x1a')]===_0x06dc('0x1b')&&typeof _0x42414d['limit']===_0x06dc('0x1b');var _0x46a57c=_0x592cb7[_0x06dc('0x1c')];var _0x32a5ae=_0xc2eb3c?0x0:_0x42414d[_0x06dc('0x1a')];var _0x1dd929=_0xc2eb3c?_0x592cb7[_0x06dc('0x1c')]:_0x42414d[_0x06dc('0x1a')]+_0x42414d['limit'];var _0x2d5e70;if(_0x1dd929>=_0x46a57c){_0x1dd929=_0x46a57c;_0x2d5e70=0xc8;}else{_0x2d5e70=0xce;}_0x44a252['status'](_0x2d5e70);return _0x44a252[_0x06dc('0x1d')]('Content-Range',_0x32a5ae+'-'+_0x1dd929+'/'+_0x46a57c)[_0x06dc('0x19')](_0x592cb7);}return null;};}function patchUpdates(_0x461b34){return function(_0x1a231b){try{jsonpatch[_0x06dc('0x1e')](_0x1a231b,_0x461b34,!![]);}catch(_0x15d32b){return BPromise['reject'](_0x15d32b);}return _0x1a231b['save']();};}function saveUpdates(_0x591cc3,_0x4dd262){return function(_0x4ab33b){if(_0x4ab33b){return _0x4ab33b[_0x06dc('0x1f')](_0x591cc3)[_0x06dc('0x20')](function(_0x4cee44){return _0x4cee44;});}return null;};}function removeEntity(_0x288d03,_0x411d8f){return function(_0xb6335b){if(_0xb6335b){return _0xb6335b[_0x06dc('0x21')]()['then'](function(){_0x288d03[_0x06dc('0x18')](0xcc)[_0x06dc('0x22')]();});}};}function handleEntityNotFound(_0x3851d5,_0x29d4bf){return function(_0x20f761){if(!_0x20f761){_0x3851d5['sendStatus'](0x194);}return _0x20f761;};}function handleError(_0x53f9a3,_0x2b517c){_0x2b517c=_0x2b517c||0x1f4;return function(_0x387818){logger[_0x06dc('0x23')](_0x387818[_0x06dc('0x24')]);if(_0x387818['name']){delete _0x387818[_0x06dc('0x25')];}_0x53f9a3[_0x06dc('0x18')](_0x2b517c)['send'](_0x387818);};}exports['show']=function(_0x1cf29b,_0x6b3c0c){var _0x4a3e76={'raw':!![],'where':{'id':_0x1cf29b['params']['id']}},_0x46c89b={};_0x46c89b[_0x06dc('0x26')]=_[_0x06dc('0x27')](db[_0x06dc('0x28')][_0x06dc('0x29')]);_0x46c89b[_0x06dc('0x2a')]=_[_0x06dc('0x27')](_0x1cf29b[_0x06dc('0x2a')]);_0x46c89b[_0x06dc('0x2b')]=_['intersection'](_0x46c89b[_0x06dc('0x26')],_0x46c89b[_0x06dc('0x2a')]);_0x4a3e76[_0x06dc('0x2c')]=_[_0x06dc('0x2d')](_0x46c89b[_0x06dc('0x26')],qs[_0x06dc('0x2e')](_0x1cf29b[_0x06dc('0x2a')][_0x06dc('0x2e')]));_0x4a3e76['attributes']=_0x4a3e76['attributes']['length']?_0x4a3e76[_0x06dc('0x2c')]:_0x46c89b[_0x06dc('0x26')];if(_0x1cf29b['query'][_0x06dc('0x2f')]){_0x4a3e76[_0x06dc('0x30')]=[{'all':!![]}];}_0x4a3e76=_[_0x06dc('0x31')]({},_0x4a3e76,_0x1cf29b[_0x06dc('0x32')]);return db[_0x06dc('0x28')][_0x06dc('0x33')](_0x4a3e76)['then'](handleEntityNotFound(_0x6b3c0c,null))[_0x06dc('0x20')](respondWithResult(_0x6b3c0c,null))['catch'](handleError(_0x6b3c0c,null));};exports[_0x06dc('0x34')]=function(_0x51fd61,_0x5f216a){return db['ChatProactiveAction'][_0x06dc('0x34')](_0x51fd61[_0x06dc('0x35')],{})[_0x06dc('0x20')](respondWithResult(_0x5f216a,0xc9))[_0x06dc('0x36')](handleError(_0x5f216a,null));};exports['update']=function(_0x51d2e5,_0x463a56){if(_0x51d2e5[_0x06dc('0x35')]['id']){delete _0x51d2e5['body']['id'];}return db[_0x06dc('0x28')][_0x06dc('0x33')]({'where':{'id':_0x51d2e5[_0x06dc('0x37')]['id']}})['then'](handleEntityNotFound(_0x463a56,null))[_0x06dc('0x20')](saveUpdates(_0x51d2e5[_0x06dc('0x35')],null))['then'](respondWithResult(_0x463a56,null))[_0x06dc('0x36')](handleError(_0x463a56,null));};exports['destroy']=function(_0x4d1e6e,_0x3688ad){return db[_0x06dc('0x28')]['find']({'where':{'id':_0x4d1e6e['params']['id']}})[_0x06dc('0x20')](handleEntityNotFound(_0x3688ad,null))[_0x06dc('0x20')](removeEntity(_0x3688ad,null))['catch'](handleError(_0x3688ad,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 29c6030..7de8f06 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.model.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb73d=['ChatProactiveAction','chat_proactive_actions','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatProactiveAction.attributes','exports','define'];(function(_0x458214,_0x338c28){var _0x11bc59=function(_0x2729ea){while(--_0x2729ea){_0x458214['push'](_0x458214['shift']());}};_0x11bc59(++_0x338c28);}(_0xb73d,0x13a));var _0xdb73=function(_0x6cfbf6,_0x594cf1){_0x6cfbf6=_0x6cfbf6-0x0;var _0x537202=_0xb73d[_0x6cfbf6];return _0x537202;};'use strict';var _=require('lodash');var util=require(_0xdb73('0x0'));var logger=require(_0xdb73('0x1'))(_0xdb73('0x2'));var moment=require(_0xdb73('0x3'));var BPromise=require(_0xdb73('0x4'));var rp=require(_0xdb73('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdb73('0x6'));var config=require('../../config/environment');var attributes=require(_0xdb73('0x7'));module[_0xdb73('0x8')]=function(_0x227eb8,_0x279b1b){return _0x227eb8[_0xdb73('0x9')](_0xdb73('0xa'),attributes,{'tableName':_0xdb73('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x129b=['util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions'];(function(_0x2d41b9,_0xc4ceef){var _0x3709d3=function(_0xdfef4){while(--_0xdfef4){_0x2d41b9['push'](_0x2d41b9['shift']());}};_0x3709d3(++_0xc4ceef);}(_0x129b,0x104));var _0xb129=function(_0x79a6e8,_0x1c2b24){_0x79a6e8=_0x79a6e8-0x0;var _0xeeb993=_0x129b[_0x79a6e8];return _0xeeb993;};'use strict';var _=require('lodash');var util=require(_0xb129('0x0'));var logger=require(_0xb129('0x1'))(_0xb129('0x2'));var moment=require(_0xb129('0x3'));var BPromise=require('bluebird');var rp=require(_0xb129('0x4'));var fs=require('fs');var path=require(_0xb129('0x5'));var rimraf=require(_0xb129('0x6'));var config=require(_0xb129('0x7'));var attributes=require(_0xb129('0x8'));module[_0xb129('0x9')]=function(_0x5194f9,_0x443af0){return _0x5194f9[_0xb129('0xa')](_0xb129('0xb'),attributes,{'tableName':_0xb129('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index 6b91e55..489d8cf 100644
--- a/server/api/chatProactiveAction/chatProactiveAction.rpc.js
+++ b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xf4d4=['then','info','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xf4d4,0x1af));var _0x4f4d=function(_0x5ca965,_0x494dba){_0x5ca965=_0x5ca965-0x0;var _0x2361b6=_0xf4d4[_0x5ca965];return _0x2361b6;};'use strict';var _=require(_0x4f4d('0x0'));var util=require('util');var moment=require(_0x4f4d('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f4d('0x2'));var db=require(_0x4f4d('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4f4d('0x4'))(_0x4f4d('0x5'));var config=require('../../config/environment');var jayson=require(_0x4f4d('0x6'));var client=jayson[_0x4f4d('0x7')][_0x4f4d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5356f3,_0x46ae2e,_0x1e7b1b){return new BPromise(function(_0x3f6bf9,_0x36bafe){return client['request'](_0x5356f3,_0x1e7b1b)[_0x4f4d('0x9')](function(_0x25cf38){logger[_0x4f4d('0xa')]('ChatProactiveAction,\x20%s,\x20%s',_0x46ae2e,_0x4f4d('0xb'));logger[_0x4f4d('0xc')](_0x4f4d('0xd'),_0x46ae2e,_0x4f4d('0xb'),JSON['stringify'](_0x25cf38));if(_0x25cf38[_0x4f4d('0xe')]){if(_0x25cf38['error'][_0x4f4d('0xf')]===0x1f4){logger[_0x4f4d('0xe')](_0x4f4d('0x10'),_0x46ae2e,_0x25cf38[_0x4f4d('0xe')][_0x4f4d('0x11')]);return _0x36bafe(_0x25cf38[_0x4f4d('0xe')]['message']);}logger[_0x4f4d('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x46ae2e,_0x25cf38['error']['message']);return _0x3f6bf9(_0x25cf38[_0x4f4d('0xe')]['message']);}else{logger[_0x4f4d('0xa')](_0x4f4d('0x10'),_0x46ae2e,_0x4f4d('0xb'));_0x3f6bf9(_0x25cf38[_0x4f4d('0x12')][_0x4f4d('0x11')]);}})[_0x4f4d('0x13')](function(_0x19d2ac){logger[_0x4f4d('0xe')](_0x4f4d('0x10'),_0x46ae2e,_0x19d2ac);_0x36bafe(_0x19d2ac);});});}
\ No newline at end of file
+var _0x0e2b=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis'];(function(_0x32a84b,_0x231fb6){var _0x3c60dd=function(_0x42ed6a){while(--_0x42ed6a){_0x32a84b['push'](_0x32a84b['shift']());}};_0x3c60dd(++_0x231fb6);}(_0x0e2b,0x122));var _0xb0e2=function(_0x2693ee,_0x3d725b){_0x2693ee=_0x2693ee-0x0;var _0x3d391a=_0x0e2b[_0x2693ee];return _0x3d391a;};'use strict';var _=require(_0xb0e2('0x0'));var util=require('util');var moment=require(_0xb0e2('0x1'));var BPromise=require('bluebird');var rs=require(_0xb0e2('0x2'));var fs=require('fs');var Redis=require(_0xb0e2('0x3'));var db=require(_0xb0e2('0x4'))['db'];var utils=require(_0xb0e2('0x5'));var logger=require('../../config/logger')(_0xb0e2('0x6'));var config=require('../../config/environment');var jayson=require(_0xb0e2('0x7'));var client=jayson[_0xb0e2('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a4272,_0x2bf753,_0x14f11f){return new BPromise(function(_0x179a75,_0x5dbc0f){return client[_0xb0e2('0x9')](_0x5a4272,_0x14f11f)[_0xb0e2('0xa')](function(_0xbb3023){logger['info'](_0xb0e2('0xb'),_0x2bf753,_0xb0e2('0xc'));logger[_0xb0e2('0xd')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2bf753,'request\x20sent',JSON[_0xb0e2('0xe')](_0xbb3023));if(_0xbb3023[_0xb0e2('0xf')]){if(_0xbb3023[_0xb0e2('0xf')][_0xb0e2('0x10')]===0x1f4){logger['error'](_0xb0e2('0xb'),_0x2bf753,_0xbb3023[_0xb0e2('0xf')][_0xb0e2('0x11')]);return _0x5dbc0f(_0xbb3023[_0xb0e2('0xf')][_0xb0e2('0x11')]);}logger[_0xb0e2('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x2bf753,_0xbb3023[_0xb0e2('0xf')][_0xb0e2('0x11')]);return _0x179a75(_0xbb3023[_0xb0e2('0xf')][_0xb0e2('0x11')]);}else{logger[_0xb0e2('0x12')](_0xb0e2('0xb'),_0x2bf753,_0xb0e2('0xc'));_0x179a75(_0xbb3023[_0xb0e2('0x13')][_0xb0e2('0x11')]);}})[_0xb0e2('0x14')](function(_0x396be7){logger[_0xb0e2('0xf')](_0xb0e2('0xb'),_0x2bf753,_0x396be7);_0x5dbc0f(_0x396be7);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 8168569..130b395 100644
--- a/server/api/chatProactiveAction/index.js
+++ b/server/api/chatProactiveAction/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb4c7=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','show','create'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x25404c,_0x447c31){_0x25404c=_0x25404c-0x0;var _0x43b777=_0xb4c7[_0x25404c];return _0x43b777;};'use strict';var multer=require(_0x7b4c('0x0'));var util=require(_0x7b4c('0x1'));var path=require(_0x7b4c('0x2'));var timeout=require(_0x7b4c('0x3'));var express=require(_0x7b4c('0x4'));var router=express['Router']();var fs_extra=require(_0x7b4c('0x5'));var auth=require(_0x7b4c('0x6'));var interaction=require(_0x7b4c('0x7'));var config=require(_0x7b4c('0x8'));var controller=require(_0x7b4c('0x9'));router['get'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xc')]);router['post']('/',auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xd')]);router['put'](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0xe')]);router[_0x7b4c('0xf')](_0x7b4c('0xa'),auth[_0x7b4c('0xb')](),controller[_0x7b4c('0x10')]);module[_0x7b4c('0x11')]=router;
\ No newline at end of file
+var _0x1cb9=['get','/:id','isAuthenticated','show','post','create','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatProactiveAction.controller'];(function(_0x1e8402,_0x3ca008){var _0x5f07a2=function(_0x2cdcdf){while(--_0x2cdcdf){_0x1e8402['push'](_0x1e8402['shift']());}};_0x5f07a2(++_0x3ca008);}(_0x1cb9,0x14e));var _0x91cb=function(_0x4815cc,_0x22728e){_0x4815cc=_0x4815cc-0x0;var _0x6dc82a=_0x1cb9[_0x4815cc];return _0x6dc82a;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0xb')]);router[_0x91cb('0xc')]('/',auth['isAuthenticated'](),controller[_0x91cb('0xd')]);router['put'](_0x91cb('0x9'),auth['isAuthenticated'](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0x9'),auth[_0x91cb('0xa')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 85f2feb..35d5abc 100644
--- a/server/api/chatQueue/chatQueue.attributes.js
+++ b/server/api/chatQueue/chatQueue.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3e54=['name','STRING','INTEGER','ENUM','roundrobin','sequelize','exports'];(function(_0x465a0c,_0x19d4d5){var _0x1e202e=function(_0x27bd8a){while(--_0x27bd8a){_0x465a0c['push'](_0x465a0c['shift']());}};_0x1e202e(++_0x19d4d5);}(_0x3e54,0x178));var _0x43e5=function(_0x37fcdd,_0x1f3094){_0x37fcdd=_0x37fcdd-0x0;var _0x25da0f=_0x3e54[_0x37fcdd];return _0x25da0f;};'use strict';var Sequelize=require(_0x43e5('0x0'));module[_0x43e5('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x43e5('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x43e5('0x3')]},'timeout':{'type':Sequelize[_0x43e5('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x43e5('0x5')]('rrmemory','beepall',_0x43e5('0x6'))}};
\ No newline at end of file
+var _0xf8d0=['STRING','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0xa993c2,_0x5d7109){var _0x43deb1=function(_0x293375){while(--_0x293375){_0xa993c2['push'](_0xa993c2['shift']());}};_0x43deb1(++_0x5d7109);}(_0xf8d0,0x1bb));var _0x0f8d=function(_0x59ce56,_0x56e4dd){_0x59ce56=_0x59ce56-0x0;var _0x4f7764=_0xf8d0[_0x59ce56];return _0x4f7764;};'use strict';var Sequelize=require(_0x0f8d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x0f8d('0x1')]},'timeout':{'type':Sequelize[_0x0f8d('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x0f8d('0x3'),_0x0f8d('0x4'),_0x0f8d('0x5'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 98f6c4e..dffc79f 100644
--- a/server/api/chatQueue/chatQueue.controller.js
+++ b/server/api/chatQueue/chatQueue.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3249=['order','sort','pick','ChatQueueId','filter','options','findAll','findAndCountAll','UserId','agent','chatPause','updatedAt','format','SIP','getTeams','findOne','Team','addTeams','ids','User','Agents','online','find','sequelize','transaction','each','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','TeamId','includes','all','union','compact','value','removeAgents','forEach','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','hasOwnProperty','bluebird','util','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','offset','undefined','limit','count','set','ChatQueues','UserProfileResource','destroy','then','error','stack','name','send','map','rawAttributes','type','getOptions','where','ChatQueue','include','query','rows','catch','params','model','keys','intersection','fields','attributes','length','includeAll','merge','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','UserChatQueue','filters','nolimit'];(function(_0x164f0b,_0x12d07e){var _0x3ce70e=function(_0x1e42c1){while(--_0x1e42c1){_0x164f0b['push'](_0x164f0b['shift']());}};_0x3ce70e(++_0x12d07e);}(_0x3249,0x1a0));var _0x9324=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x3249[_0xbf8ebe];return _0x1e25e8;};'use strict';var BPromise=require(_0x9324('0x0'));var util=require(_0x9324('0x1'));var _=require(_0x9324('0x2'));var squel=require(_0x9324('0x3'));var Redis=require(_0x9324('0x4'));var qs=require(_0x9324('0x5'));var logger=require(_0x9324('0x6'))(_0x9324('0x7'));var config=require(_0x9324('0x8'));var db=require(_0x9324('0x9'))['db'];config[_0x9324('0xa')]=_[_0x9324('0xb')](config[_0x9324('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x9324('0xc'))(new Redis(config[_0x9324('0xa')]));require('./chatQueue.socket')[_0x9324('0xd')](socket);function respondWithStatusCode(_0x106dbf,_0x2f8491){_0x2f8491=_0x2f8491||0xcc;return function(_0x4ffabf){if(_0x4ffabf){return _0x106dbf[_0x9324('0xe')](_0x2f8491);}return _0x106dbf[_0x9324('0xf')](_0x2f8491)[_0x9324('0x10')]();};}function respondWithResult(_0x528005,_0x219067){_0x219067=_0x219067||0xc8;return function(_0x20484b){if(_0x20484b){return _0x528005[_0x9324('0xf')](_0x219067)[_0x9324('0x11')](_0x20484b);}};}function respondWithFilteredResult(_0x40e06e,_0x35bbf4){return function(_0x114e44){if(_0x114e44){var _0x50c3bc=typeof _0x35bbf4[_0x9324('0x12')]===_0x9324('0x13')&&typeof _0x35bbf4[_0x9324('0x14')]==='undefined';var _0x20d1aa=_0x114e44['count'];var _0x2846e1=_0x50c3bc?0x0:_0x35bbf4[_0x9324('0x12')];var _0x3c4443=_0x50c3bc?_0x114e44[_0x9324('0x15')]:_0x35bbf4[_0x9324('0x12')]+_0x35bbf4[_0x9324('0x14')];var _0x1195a3;if(_0x3c4443>=_0x20d1aa){_0x3c4443=_0x20d1aa;_0x1195a3=0xc8;}else{_0x1195a3=0xce;}_0x40e06e[_0x9324('0xf')](_0x1195a3);return _0x40e06e[_0x9324('0x16')]('Content-Range',_0x2846e1+'-'+_0x3c4443+'/'+_0x20d1aa)[_0x9324('0x11')](_0x114e44);}return null;};}function saveUpdates(_0xd9f7f6){return function(_0x1fadce){if(_0x1fadce){return _0x1fadce['update'](_0xd9f7f6)['then'](function(_0x54aba5){return _0x54aba5;});}return null;};}function removeEntity(_0x1f988b){return function(_0xb43306){if(_0xb43306){return _0xb43306['destroy']()['then'](function(){var _0x3e7e66=_0xb43306['get']({'plain':!![]});var _0x5a7300=_0x9324('0x17');return db[_0x9324('0x18')][_0x9324('0x19')]({'where':{'type':_0x5a7300,'resourceId':_0x3e7e66['id']}})[_0x9324('0x1a')](function(){return _0xb43306;});})[_0x9324('0x1a')](function(){_0x1f988b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x295194){return function(_0x747b66){if(!_0x747b66){_0x295194['sendStatus'](0x194);}return _0x747b66;};}function handleError(_0x5ed906,_0x670c93){_0x670c93=_0x670c93||0x1f4;return function(_0x566111){logger[_0x9324('0x1b')](_0x566111[_0x9324('0x1c')]);if(_0x566111[_0x9324('0x1d')]){delete _0x566111[_0x9324('0x1d')];}_0x5ed906[_0x9324('0xf')](_0x670c93)[_0x9324('0x1e')](_0x566111);};}exports['index']=function(_0x37ab3e,_0x299a7a){var _0x20cc75={};var _0xe8e0f9={'count':0x0,'rows':[]};var _0x19d859=_[_0x9324('0x1f')](db['ChatQueue'][_0x9324('0x20')],function(_0x31d567){return{'name':_0x31d567['fieldName'],'type':_0x31d567[_0x9324('0x21')]['key']};});_0x20cc75=qs[_0x9324('0x22')](_0x19d859,_0x37ab3e);var _0x12fe52={'where':_0x20cc75[_0x9324('0x23')]};return db[_0x9324('0x24')][_0x9324('0x15')](_0x12fe52)['then'](function(_0x53ab59){_0xe8e0f9[_0x9324('0x15')]=_0x53ab59;_0x20cc75[_0x9324('0x25')]=qs[_0x9324('0x25')](_0x37ab3e[_0x9324('0x26')]);return db[_0x9324('0x24')]['findAll'](_0x20cc75);})[_0x9324('0x1a')](function(_0x2c4795){_0xe8e0f9[_0x9324('0x27')]=_0x2c4795;return _0xe8e0f9;})[_0x9324('0x1a')](respondWithFilteredResult(_0x299a7a,_0x20cc75))[_0x9324('0x28')](handleError(_0x299a7a,null));};exports['show']=function(_0x2972e6,_0x38eaac){var _0x21db6c={'raw':!![],'where':{'id':_0x2972e6[_0x9324('0x29')]['id']}},_0x522f50={};_0x522f50[_0x9324('0x2a')]=_[_0x9324('0x2b')](db[_0x9324('0x24')]['rawAttributes']);_0x522f50['query']=_['keys'](_0x2972e6[_0x9324('0x26')]);_0x522f50['filters']=_[_0x9324('0x2c')](_0x522f50[_0x9324('0x2a')],_0x522f50[_0x9324('0x26')]);_0x21db6c['attributes']=_[_0x9324('0x2c')](_0x522f50[_0x9324('0x2a')],qs[_0x9324('0x2d')](_0x2972e6['query'][_0x9324('0x2d')]));_0x21db6c['attributes']=_0x21db6c[_0x9324('0x2e')][_0x9324('0x2f')]?_0x21db6c[_0x9324('0x2e')]:_0x522f50[_0x9324('0x2a')];if(_0x2972e6[_0x9324('0x26')][_0x9324('0x30')]){_0x21db6c[_0x9324('0x25')]=[{'all':!![]}];}_0x21db6c=_[_0x9324('0x31')]({},_0x21db6c,_0x2972e6['options']);return db[_0x9324('0x24')]['find'](_0x21db6c)[_0x9324('0x1a')](handleEntityNotFound(_0x38eaac,null))[_0x9324('0x1a')](respondWithResult(_0x38eaac,null))[_0x9324('0x28')](handleError(_0x38eaac,null));};exports[_0x9324('0x32')]=function(_0x65c307,_0x3a8736){return db['ChatQueue'][_0x9324('0x32')](_0x65c307['body'],{})[_0x9324('0x1a')](function(_0x312a7d){var _0x21ae82=_0x65c307['user'][_0x9324('0x33')]({'plain':!![]});if(!_0x21ae82)throw new Error(_0x9324('0x34'));if(_0x21ae82[_0x9324('0x35')]===_0x9324('0x36')){var _0x4df713=_0x312a7d['get']({'plain':!![]});var _0x4c89d1='ChatQueues';return db['UserProfileSection']['find']({'where':{'name':_0x4c89d1,'userProfileId':_0x21ae82[_0x9324('0x37')]},'raw':!![]})['then'](function(_0x26d020){if(_0x26d020&&_0x26d020[_0x9324('0x38')]===0x0){return db[_0x9324('0x18')][_0x9324('0x32')]({'name':_0x4df713[_0x9324('0x1d')],'resourceId':_0x4df713['id'],'type':_0x26d020[_0x9324('0x1d')],'sectionId':_0x26d020['id']},{})[_0x9324('0x1a')](function(){return _0x312a7d;});}else{return _0x312a7d;}})[_0x9324('0x28')](function(_0x1443b1){logger[_0x9324('0x1b')](_0x9324('0x39'),_0x1443b1);throw _0x1443b1;});}return _0x312a7d;})[_0x9324('0x1a')](respondWithResult(_0x3a8736,0xc9))[_0x9324('0x28')](handleError(_0x3a8736,null));};exports['update']=function(_0x2520ab,_0x1a0fe9){if(_0x2520ab['body']['id']){delete _0x2520ab[_0x9324('0x3a')]['id'];}return db[_0x9324('0x24')]['find']({'where':{'id':_0x2520ab[_0x9324('0x29')]['id']}})['then'](handleEntityNotFound(_0x1a0fe9,null))[_0x9324('0x1a')](saveUpdates(_0x2520ab[_0x9324('0x3a')],null))[_0x9324('0x1a')](respondWithResult(_0x1a0fe9,null))[_0x9324('0x28')](handleError(_0x1a0fe9,null));};exports[_0x9324('0x19')]=function(_0x490f76,_0x1210a7){return db[_0x9324('0x24')]['find']({'where':{'id':_0x490f76[_0x9324('0x29')]['id']}})[_0x9324('0x1a')](handleEntityNotFound(_0x1210a7,null))[_0x9324('0x1a')](removeEntity(_0x1210a7,null))[_0x9324('0x28')](handleError(_0x1210a7,null));};exports[_0x9324('0x3b')]=function(_0x60c7f4,_0x7b7482){return db[_0x9324('0x24')][_0x9324('0x3b')]()['then'](respondWithResult(_0x7b7482,null))[_0x9324('0x28')](handleError(_0x7b7482,null));};exports[_0x9324('0x3c')]=function(_0x3d29a0,_0x5aa6db){var _0x8a8786={'raw':!![],'where':{}},_0x24f376={},_0x5f5204;return db[_0x9324('0x24')]['findOne']({'where':{'id':_0x3d29a0[_0x9324('0x29')]['id']}})['then'](handleEntityNotFound(_0x5aa6db,null))[_0x9324('0x1a')](function(_0x3266cc){if(_0x3266cc){_0x5f5204=_0x3266cc['get']({'plain':!![]});_0x24f376[_0x9324('0x2a')]=_[_0x9324('0x2b')](db[_0x9324('0x3d')]['rawAttributes']);_0x24f376[_0x9324('0x26')]=_[_0x9324('0x2b')](_0x3d29a0[_0x9324('0x26')]);_0x24f376[_0x9324('0x3e')]=_['intersection'](_0x24f376[_0x9324('0x2a')],_0x24f376['query']);_0x8a8786[_0x9324('0x2e')]=_['intersection'](_0x24f376[_0x9324('0x2a')],qs['fields'](_0x3d29a0['query']['fields']));_0x8a8786['attributes']=_0x8a8786[_0x9324('0x2e')][_0x9324('0x2f')]?_0x8a8786[_0x9324('0x2e')]:_0x24f376[_0x9324('0x2a')];if(!_0x3d29a0[_0x9324('0x26')]['hasOwnProperty'](_0x9324('0x3f'))){_0x8a8786[_0x9324('0x14')]=qs[_0x9324('0x14')](_0x3d29a0['query'][_0x9324('0x14')]);_0x8a8786[_0x9324('0x12')]=qs[_0x9324('0x12')](_0x3d29a0[_0x9324('0x26')]['offset']);}_0x8a8786[_0x9324('0x40')]=qs[_0x9324('0x41')](_0x3d29a0[_0x9324('0x26')]['sort']);_0x8a8786[_0x9324('0x23')]=qs[_0x9324('0x3e')](_[_0x9324('0x42')](_0x3d29a0['query'],_0x24f376[_0x9324('0x3e')]));_0x8a8786[_0x9324('0x23')][_0x9324('0x43')]=_0x3266cc['id'];if(_0x3d29a0['query'][_0x9324('0x44')]){_0x8a8786[_0x9324('0x23')]=_[_0x9324('0x31')](_0x8a8786[_0x9324('0x23')],{'$or':_[_0x9324('0x1f')](_0x8a8786[_0x9324('0x2e')],function(_0x2a4ee5){var _0x58be51={};_0x58be51[_0x2a4ee5]={'$like':'%'+_0x3d29a0[_0x9324('0x26')][_0x9324('0x44')]+'%'};return _0x58be51;})});}_0x8a8786=_[_0x9324('0x31')]({},_0x8a8786,_0x3d29a0[_0x9324('0x45')]);return db[_0x9324('0x3d')][_0x9324('0x46')](_0x8a8786);}})[_0x9324('0x1a')](function(_0x405d1a){if(_0x405d1a){return db['User'][_0x9324('0x47')]({'where':{'id':_[_0x9324('0x1f')](_0x405d1a,_0x9324('0x48')),'role':_0x9324('0x49')},'attributes':['id',_0x9324('0x1d'),_0x9324('0x4a'),_0x9324('0x4b'),'createdAt']});}})[_0x9324('0x1a')](function(_0x35abf7){if(_0x35abf7){return{'count':_0x35abf7[_0x9324('0x15')],'rows':_['map'](_0x35abf7[_0x9324('0x27')],function(_0x135a19){return{'membername':_0x135a19[_0x9324('0x1d')],'UserId':_0x135a19['id'],'queue_name':_0x5f5204['name'],'ChatQueueId':_0x5f5204['id'],'interface':util[_0x9324('0x4c')]('%s/%s',_0x9324('0x4d'),_0x135a19[_0x9324('0x1d')]),'penalty':0x0,'paused':_0x135a19[_0x9324('0x4a')],'createdAt':_0x135a19['createdAt'],'updatedAt':_0x135a19['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x9324('0x1a')](respondWithFilteredResult(_0x5aa6db,_0x8a8786))[_0x9324('0x28')](handleError(_0x5aa6db,null));};exports[_0x9324('0x4e')]=function(_0x349cf4,_0x494074){var _0x2b5a82={};var _0x542b81={};var _0x235313;var _0x3d0c9d;return db[_0x9324('0x24')][_0x9324('0x4f')]({'where':{'id':_0x349cf4[_0x9324('0x29')]['id']}})['then'](handleEntityNotFound(_0x494074,null))['then'](function(_0x4347a2){if(_0x4347a2){_0x235313=_0x4347a2;_0x542b81[_0x9324('0x2a')]=_[_0x9324('0x2b')](db[_0x9324('0x50')][_0x9324('0x20')]);_0x542b81['query']=_[_0x9324('0x2b')](_0x349cf4[_0x9324('0x26')]);_0x542b81[_0x9324('0x3e')]=_[_0x9324('0x2c')](_0x542b81['model'],_0x542b81[_0x9324('0x26')]);_0x2b5a82[_0x9324('0x2e')]=_['intersection'](_0x542b81['model'],qs[_0x9324('0x2d')](_0x349cf4['query'][_0x9324('0x2d')]));_0x2b5a82['attributes']=_0x2b5a82[_0x9324('0x2e')][_0x9324('0x2f')]?_0x2b5a82['attributes']:_0x542b81[_0x9324('0x2a')];_0x2b5a82['order']=qs[_0x9324('0x41')](_0x349cf4[_0x9324('0x26')][_0x9324('0x41')]);_0x2b5a82['where']=qs['filters'](_[_0x9324('0x42')](_0x349cf4[_0x9324('0x26')],_0x542b81['filters']));if(_0x349cf4['query'][_0x9324('0x44')]){_0x2b5a82[_0x9324('0x23')]=_[_0x9324('0x31')](_0x2b5a82[_0x9324('0x23')],{'$or':_['map'](_0x2b5a82['attributes'],function(_0x15f0f7){var _0x463a3d={};_0x463a3d[_0x15f0f7]={'$like':'%'+_0x349cf4[_0x9324('0x26')][_0x9324('0x44')]+'%'};return _0x463a3d;})});}_0x2b5a82=_['merge']({},_0x2b5a82,_0x349cf4[_0x9324('0x45')]);return _0x235313[_0x9324('0x4e')](_0x2b5a82);}})[_0x9324('0x1a')](function(_0x41d49b){if(_0x41d49b){_0x3d0c9d=_0x41d49b[_0x9324('0x2f')];if(!_0x349cf4['query']['hasOwnProperty'](_0x9324('0x3f'))){_0x2b5a82[_0x9324('0x14')]=qs[_0x9324('0x14')](_0x349cf4[_0x9324('0x26')]['limit']);_0x2b5a82[_0x9324('0x12')]=qs[_0x9324('0x12')](_0x349cf4['query'][_0x9324('0x12')]);}return _0x235313[_0x9324('0x4e')](_0x2b5a82);}})[_0x9324('0x1a')](function(_0x2f1f16){if(_0x2f1f16){return _0x2f1f16?{'count':_0x3d0c9d,'rows':_0x2f1f16}:null;}})['then'](respondWithResult(_0x494074,null))[_0x9324('0x28')](handleError(_0x494074,null));};exports[_0x9324('0x51')]=function(_0x510aec,_0x2d20e2){var _0x376dac=_0x510aec[_0x9324('0x3a')][_0x9324('0x52')];return db[_0x9324('0x50')]['findAll']({'where':{'id':_0x376dac},'attributes':['id'],'include':[{'model':db[_0x9324('0x53')],'as':_0x9324('0x54'),'attributes':['id',_0x9324('0x1d'),_0x9324('0x55'),'voicePause','interface'],'raw':!![]}]})['then'](function(_0x29607b){if(_0x29607b){var _0x30a533=_['flatMap'](_0x29607b,function(_0x1c9312){var _0x2d9d53=_0x1c9312[_0x9324('0x33')]({'plain':!![]});return _0x2d9d53['Agents'];});return db['ChatQueue'][_0x9324('0x56')]({'where':{'id':_0x510aec[_0x9324('0x29')]['id']}})['then'](function(_0x46a54c){return db[_0x9324('0x57')][_0x9324('0x58')](function(_0x37e26a){return _0x46a54c[_0x9324('0x51')](_0x376dac,{'transaction':_0x37e26a})[_0x9324('0x1a')](function(){return BPromise[_0x9324('0x59')](_0x30a533,function(_0x54aebf){return db[_0x9324('0x3d')]['findOrCreate']({'where':{'UserId':_0x54aebf['id'],'ChatQueueId':_0x510aec[_0x9324('0x29')]['id']},'transaction':_0x37e26a});});})['then'](function(){_0x30a533['forEach'](function(_0x3e734c){socket[_0x9324('0x5a')](_0x9324('0x5b'),{'UserId':_0x3e734c['id'],'ChatQueueId':_0x46a54c['id']});});});});});}})[_0x9324('0x1a')](respondWithStatusCode(_0x2d20e2,null))[_0x9324('0x28')](handleError(_0x2d20e2,null));};exports[_0x9324('0x5c')]=function(_0x479380,_0x7abee8){return db[_0x9324('0x50')][_0x9324('0x46')]({'where':{'id':_0x479380[_0x9324('0x26')][_0x9324('0x52')]},'attributes':['id'],'include':[{'model':db[_0x9324('0x53')],'as':_0x9324('0x54'),'attributes':['id'],'raw':!![]}]})[_0x9324('0x1a')](handleEntityNotFound(_0x7abee8,null))[_0x9324('0x1a')](function(_0x42270e){var _0x1fa1e4=_[_0x9324('0x1f')](_0x42270e,'id');var _0x26525e=[];var _0x4b303f=[];var _0x2dc333=squel[_0x9324('0x5d')]();_0x2dc333[_0x9324('0x5e')](_0x9324('0x5f'))[_0x9324('0x60')](_0x9324('0x61'),'tq')[_0x9324('0x62')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x9324('0x23')](_0x9324('0x63'),_0x479380[_0x9324('0x29')]['id']);for(var _0xce04f1=0x0;_0xce04f1<_0x42270e[_0x9324('0x2f')];_0xce04f1+=0x1){let _0x57bb62=_0x42270e[_0xce04f1];for(var _0x478b21=0x0;_0x478b21<_0x57bb62[_0x9324('0x54')][_0x9324('0x2f')];_0x478b21+=0x1){let _0x932447=_0x57bb62[_0x9324('0x54')][_0x478b21];var _0x44f57c=_0x2dc333[_0x9324('0x64')]();_0x44f57c['where'](_0x9324('0x65'),_0x932447['id']);_0x4b303f[_0x9324('0x66')](db[_0x9324('0x57')][_0x9324('0x26')](_0x44f57c[_0x9324('0x67')](),{'type':db[_0x9324('0x57')]['QueryTypes']['SELECT']})['then'](function(_0x5f30a5){if(_0x5f30a5[_0x9324('0x2f')]===0x1){return _0x932447['id'];}else{var _0x54af56=_[_0x9324('0x68')](_[_0x9324('0x1f')](_0x5f30a5,_0x9324('0x69')),function(_0x2a8314){return _[_0x9324('0x6a')](_0x1fa1e4,_0x2a8314);});if(_0x54af56){return _0x932447['id'];}}}));}}return BPromise[_0x9324('0x6b')](_0x4b303f)[_0x9324('0x1a')](function(_0x61cab5){_0x26525e=_(_0x26525e)[_0x9324('0x6c')](_0x61cab5)[_0x9324('0x6d')]()[_0x9324('0x6e')]();return db[_0x9324('0x24')][_0x9324('0x56')]({'where':{'id':_0x479380[_0x9324('0x29')]['id']}})[_0x9324('0x1a')](function(_0x6524dd){return db['sequelize'][_0x9324('0x58')](function(_0x3c1ff8){return _0x6524dd[_0x9324('0x5c')](_0x479380[_0x9324('0x26')][_0x9324('0x52')],{'transaction':_0x3c1ff8})[_0x9324('0x1a')](function(){if(!_['isEmpty'](_0x26525e)){return _0x6524dd[_0x9324('0x6f')](_0x26525e,{'transaction':_0x3c1ff8});}})['then'](function(){_0x26525e[_0x9324('0x70')](function(_0x511be1){socket[_0x9324('0x5a')](_0x9324('0x71'),{'UserId':_0x511be1,'ChatQueueId':_0x6524dd['id']});});});});});});})[_0x9324('0x1a')](respondWithStatusCode(_0x7abee8,null))[_0x9324('0x28')](handleError(_0x7abee8,null));};exports[_0x9324('0x72')]=function(_0xa677e1,_0x4f1f2a){return db['ChatQueue'][_0x9324('0x56')]({'where':{'id':_0xa677e1[_0x9324('0x29')]['id']}})['then'](handleEntityNotFound(_0x4f1f2a,null))[_0x9324('0x1a')](function(_0x5a27bc){if(_0x5a27bc){return _0x5a27bc['addAgents'](_0xa677e1['body']['ids'],_[_0x9324('0x73')](_0xa677e1['body'],['ids','id'])||{})[_0x9324('0x74')](function(_0x28006b){for(var _0x160c91=0x0;_0x160c91<_0xa677e1['body'][_0x9324('0x52')]['length'];_0x160c91+=0x1){socket[_0x9324('0x5a')](_0x9324('0x5b'),{'UserId':Number(_0xa677e1['body'][_0x9324('0x52')][_0x160c91]),'ChatQueueId':Number(_0xa677e1['params']['id'])});}return _0x28006b;});}})['then'](respondWithResult(_0x4f1f2a,null))['catch'](handleError(_0x4f1f2a,null));};exports['removeAgents']=function(_0x5345a5,_0x38ae2c){return db[_0x9324('0x24')][_0x9324('0x56')]({'where':{'id':_0x5345a5[_0x9324('0x29')]['id']}})[_0x9324('0x1a')](handleEntityNotFound(_0x38ae2c,null))[_0x9324('0x1a')](function(_0x52d052){if(_0x52d052){return _0x52d052[_0x9324('0x6f')](_0x5345a5['query']['ids'])[_0x9324('0x1a')](function(){if(_[_0x9324('0x75')](_0x5345a5[_0x9324('0x26')]['ids'])){for(var _0x4a4b9a=0x0;_0x4a4b9a<_0x5345a5['query']['ids'][_0x9324('0x2f')];_0x4a4b9a+=0x1){socket[_0x9324('0x5a')](_0x9324('0x71'),{'UserId':Number(_0x5345a5['query'][_0x9324('0x52')][_0x4a4b9a]),'ChatQueueId':Number(_0x5345a5[_0x9324('0x29')]['id'])});}}else{socket[_0x9324('0x5a')]('userChatQueue:remove',{'UserId':Number(_0x5345a5['query'][_0x9324('0x52')]),'ChatQueueId':Number(_0x5345a5['params']['id'])});}});}})[_0x9324('0x1a')](respondWithStatusCode(_0x38ae2c,null))[_0x9324('0x28')](handleError(_0x38ae2c,null));};exports[_0x9324('0x76')]=function(_0x1efb5b,_0x38e205){var _0x2c0523={};var _0x5bb583={};var _0x355030;var _0x297d1e;return db[_0x9324('0x24')][_0x9324('0x4f')]({'where':{'id':_0x1efb5b[_0x9324('0x29')]['id']}})[_0x9324('0x1a')](handleEntityNotFound(_0x38e205,null))[_0x9324('0x1a')](function(_0x24092b){if(_0x24092b){_0x355030=_0x24092b;_0x5bb583[_0x9324('0x2a')]=_[_0x9324('0x2b')](db[_0x9324('0x53')][_0x9324('0x20')]);_0x5bb583[_0x9324('0x26')]=_[_0x9324('0x2b')](_0x1efb5b[_0x9324('0x26')]);_0x5bb583['filters']=_[_0x9324('0x2c')](_0x5bb583[_0x9324('0x2a')],_0x5bb583[_0x9324('0x26')]);_0x2c0523[_0x9324('0x2e')]=_['intersection'](_0x5bb583['model'],qs[_0x9324('0x2d')](_0x1efb5b[_0x9324('0x26')][_0x9324('0x2d')]));_0x2c0523[_0x9324('0x2e')]=_0x2c0523[_0x9324('0x2e')][_0x9324('0x2f')]?_0x2c0523['attributes']:_0x5bb583['model'];_0x2c0523['order']=qs[_0x9324('0x41')](_0x1efb5b[_0x9324('0x26')]['sort']);_0x2c0523[_0x9324('0x23')]=qs[_0x9324('0x3e')](_[_0x9324('0x42')](_0x1efb5b['query'],_0x5bb583['filters']));if(_0x1efb5b[_0x9324('0x26')][_0x9324('0x44')]){_0x2c0523[_0x9324('0x23')]=_[_0x9324('0x31')](_0x2c0523[_0x9324('0x23')],{'$or':_[_0x9324('0x1f')](_0x2c0523[_0x9324('0x2e')],function(_0x5033ce){var _0x5b2884={};_0x5b2884[_0x5033ce]={'$like':'%'+_0x1efb5b[_0x9324('0x26')]['filter']+'%'};return _0x5b2884;})});}_0x2c0523=_[_0x9324('0x31')]({},_0x2c0523,_0x1efb5b[_0x9324('0x45')]);return _0x355030[_0x9324('0x76')](_0x2c0523);}})[_0x9324('0x1a')](function(_0x47272b){if(_0x47272b){_0x297d1e=_0x47272b[_0x9324('0x2f')];if(!_0x1efb5b[_0x9324('0x26')][_0x9324('0x77')](_0x9324('0x3f'))){_0x2c0523[_0x9324('0x14')]=qs[_0x9324('0x14')](_0x1efb5b[_0x9324('0x26')][_0x9324('0x14')]);_0x2c0523[_0x9324('0x12')]=qs[_0x9324('0x12')](_0x1efb5b[_0x9324('0x26')][_0x9324('0x12')]);}return _0x355030[_0x9324('0x76')](_0x2c0523);}})['then'](function(_0x5df533){if(_0x5df533){return _0x5df533?{'count':_0x297d1e,'rows':_0x5df533}:null;}})['then'](respondWithResult(_0x38e205,null))['catch'](handleError(_0x38e205,null));};
\ No newline at end of file
+var _0xa1a0=['length','includeAll','merge','find','create','body','user','get','role','ChatQueues','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','filters','order','where','options','UserChatQueue','findAll','User','findAndCountAll','UserId','agent','chatPause','updatedAt','SIP','createdAt','getTeams','sort','pick','filter','hasOwnProperty','nolimit','addTeams','ids','Agents','online','interface','flatMap','each','findOrCreate','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','push','sequelize','SELECT','every','TeamId','union','compact','value','transaction','forEach','addAgents','spread','removeAgents','userChatQueue:remove','getAgents','bluebird','lodash','squel','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket','register','sendStatus','status','offset','undefined','limit','count','set','json','update','then','destroy','UserProfileResource','end','error','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','key','getOptions','include','query','rows','catch','params','model','keys','intersection','fields','attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa1a0,0xbc));var _0x0a1a=function(_0x54e856,_0x313d5c){_0x54e856=_0x54e856-0x0;var _0x124873=_0xa1a0[_0x54e856];return _0x124873;};'use strict';var BPromise=require(_0x0a1a('0x0'));var util=require('util');var _=require(_0x0a1a('0x1'));var squel=require(_0x0a1a('0x2'));var Redis=require(_0x0a1a('0x3'));var qs=require(_0x0a1a('0x4'));var logger=require(_0x0a1a('0x5'))(_0x0a1a('0x6'));var config=require(_0x0a1a('0x7'));var db=require(_0x0a1a('0x8'))['db'];config['redis']=_[_0x0a1a('0x9')](config[_0x0a1a('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a1a('0xb'))(new Redis(config['redis']));require(_0x0a1a('0xc'))[_0x0a1a('0xd')](socket);function respondWithStatusCode(_0x925f28,_0x2992ec){_0x2992ec=_0x2992ec||0xcc;return function(_0x1f48c3){if(_0x1f48c3){return _0x925f28[_0x0a1a('0xe')](_0x2992ec);}return _0x925f28[_0x0a1a('0xf')](_0x2992ec)['end']();};}function respondWithResult(_0x5b8744,_0x5c4c8a){_0x5c4c8a=_0x5c4c8a||0xc8;return function(_0x2c5deb){if(_0x2c5deb){return _0x5b8744['status'](_0x5c4c8a)['json'](_0x2c5deb);}};}function respondWithFilteredResult(_0x522582,_0x21acf1){return function(_0x1b6f71){if(_0x1b6f71){var _0x4b8411=typeof _0x21acf1[_0x0a1a('0x10')]===_0x0a1a('0x11')&&typeof _0x21acf1[_0x0a1a('0x12')]===_0x0a1a('0x11');var _0x587860=_0x1b6f71[_0x0a1a('0x13')];var _0xbc8d39=_0x4b8411?0x0:_0x21acf1[_0x0a1a('0x10')];var _0x3011ae=_0x4b8411?_0x1b6f71['count']:_0x21acf1[_0x0a1a('0x10')]+_0x21acf1[_0x0a1a('0x12')];var _0x3ee676;if(_0x3011ae>=_0x587860){_0x3011ae=_0x587860;_0x3ee676=0xc8;}else{_0x3ee676=0xce;}_0x522582['status'](_0x3ee676);return _0x522582[_0x0a1a('0x14')]('Content-Range',_0xbc8d39+'-'+_0x3011ae+'/'+_0x587860)[_0x0a1a('0x15')](_0x1b6f71);}return null;};}function saveUpdates(_0x1ce9a0){return function(_0x4a0dad){if(_0x4a0dad){return _0x4a0dad[_0x0a1a('0x16')](_0x1ce9a0)[_0x0a1a('0x17')](function(_0x2f7831){return _0x2f7831;});}return null;};}function removeEntity(_0x3888a6){return function(_0x3cbfa2){if(_0x3cbfa2){return _0x3cbfa2[_0x0a1a('0x18')]()['then'](function(){var _0x82f13f=_0x3cbfa2['get']({'plain':!![]});var _0x3dbe66='ChatQueues';return db[_0x0a1a('0x19')][_0x0a1a('0x18')]({'where':{'type':_0x3dbe66,'resourceId':_0x82f13f['id']}})[_0x0a1a('0x17')](function(){return _0x3cbfa2;});})[_0x0a1a('0x17')](function(){_0x3888a6['status'](0xcc)[_0x0a1a('0x1a')]();});}};}function handleEntityNotFound(_0x43885e){return function(_0x4fcf6a){if(!_0x4fcf6a){_0x43885e[_0x0a1a('0xe')](0x194);}return _0x4fcf6a;};}function handleError(_0x1f31c4,_0x58fea6){_0x58fea6=_0x58fea6||0x1f4;return function(_0x29dba6){logger[_0x0a1a('0x1b')](_0x29dba6['stack']);if(_0x29dba6[_0x0a1a('0x1c')]){delete _0x29dba6[_0x0a1a('0x1c')];}_0x1f31c4[_0x0a1a('0xf')](_0x58fea6)[_0x0a1a('0x1d')](_0x29dba6);};}exports[_0x0a1a('0x1e')]=function(_0x504f7e,_0x1c090a){var _0x1b1b11={};var _0x354dde={'count':0x0,'rows':[]};var _0x2a31c6=_[_0x0a1a('0x1f')](db[_0x0a1a('0x20')][_0x0a1a('0x21')],function(_0x33dae3){return{'name':_0x33dae3[_0x0a1a('0x22')],'type':_0x33dae3[_0x0a1a('0x23')][_0x0a1a('0x24')]};});_0x1b1b11=qs[_0x0a1a('0x25')](_0x2a31c6,_0x504f7e);var _0x1461f8={'where':_0x1b1b11['where']};return db[_0x0a1a('0x20')]['count'](_0x1461f8)[_0x0a1a('0x17')](function(_0x47d597){_0x354dde[_0x0a1a('0x13')]=_0x47d597;_0x1b1b11[_0x0a1a('0x26')]=qs[_0x0a1a('0x26')](_0x504f7e[_0x0a1a('0x27')]);return db[_0x0a1a('0x20')]['findAll'](_0x1b1b11);})[_0x0a1a('0x17')](function(_0x5948e7){_0x354dde[_0x0a1a('0x28')]=_0x5948e7;return _0x354dde;})[_0x0a1a('0x17')](respondWithFilteredResult(_0x1c090a,_0x1b1b11))[_0x0a1a('0x29')](handleError(_0x1c090a,null));};exports['show']=function(_0xef457c,_0x39562a){var _0x464d80={'raw':!![],'where':{'id':_0xef457c[_0x0a1a('0x2a')]['id']}},_0x3edf40={};_0x3edf40[_0x0a1a('0x2b')]=_[_0x0a1a('0x2c')](db['ChatQueue'][_0x0a1a('0x21')]);_0x3edf40[_0x0a1a('0x27')]=_[_0x0a1a('0x2c')](_0xef457c[_0x0a1a('0x27')]);_0x3edf40['filters']=_[_0x0a1a('0x2d')](_0x3edf40[_0x0a1a('0x2b')],_0x3edf40[_0x0a1a('0x27')]);_0x464d80['attributes']=_[_0x0a1a('0x2d')](_0x3edf40['model'],qs['fields'](_0xef457c[_0x0a1a('0x27')][_0x0a1a('0x2e')]));_0x464d80[_0x0a1a('0x2f')]=_0x464d80[_0x0a1a('0x2f')][_0x0a1a('0x30')]?_0x464d80[_0x0a1a('0x2f')]:_0x3edf40[_0x0a1a('0x2b')];if(_0xef457c[_0x0a1a('0x27')][_0x0a1a('0x31')]){_0x464d80[_0x0a1a('0x26')]=[{'all':!![]}];}_0x464d80=_[_0x0a1a('0x32')]({},_0x464d80,_0xef457c['options']);return db[_0x0a1a('0x20')][_0x0a1a('0x33')](_0x464d80)[_0x0a1a('0x17')](handleEntityNotFound(_0x39562a,null))[_0x0a1a('0x17')](respondWithResult(_0x39562a,null))[_0x0a1a('0x29')](handleError(_0x39562a,null));};exports[_0x0a1a('0x34')]=function(_0x417932,_0x2ea716){return db['ChatQueue'][_0x0a1a('0x34')](_0x417932[_0x0a1a('0x35')],{})['then'](function(_0xef275b){var _0x4317c2=_0x417932[_0x0a1a('0x36')][_0x0a1a('0x37')]({'plain':!![]});if(!_0x4317c2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4317c2[_0x0a1a('0x38')]===_0x0a1a('0x36')){var _0x20bd01=_0xef275b['get']({'plain':!![]});var _0x1357d4=_0x0a1a('0x39');return db[_0x0a1a('0x3a')][_0x0a1a('0x33')]({'where':{'name':_0x1357d4,'userProfileId':_0x4317c2[_0x0a1a('0x3b')]},'raw':!![]})['then'](function(_0x3f79fe){if(_0x3f79fe&&_0x3f79fe[_0x0a1a('0x3c')]===0x0){return db[_0x0a1a('0x19')]['create']({'name':_0x20bd01['name'],'resourceId':_0x20bd01['id'],'type':_0x3f79fe[_0x0a1a('0x1c')],'sectionId':_0x3f79fe['id']},{})[_0x0a1a('0x17')](function(){return _0xef275b;});}else{return _0xef275b;}})[_0x0a1a('0x29')](function(_0xd998a9){logger[_0x0a1a('0x1b')](_0x0a1a('0x3d'),_0xd998a9);throw _0xd998a9;});}return _0xef275b;})[_0x0a1a('0x17')](respondWithResult(_0x2ea716,0xc9))[_0x0a1a('0x29')](handleError(_0x2ea716,null));};exports[_0x0a1a('0x16')]=function(_0x52f34c,_0x2ebb75){if(_0x52f34c[_0x0a1a('0x35')]['id']){delete _0x52f34c[_0x0a1a('0x35')]['id'];}return db[_0x0a1a('0x20')][_0x0a1a('0x33')]({'where':{'id':_0x52f34c['params']['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x2ebb75,null))[_0x0a1a('0x17')](saveUpdates(_0x52f34c[_0x0a1a('0x35')],null))[_0x0a1a('0x17')](respondWithResult(_0x2ebb75,null))[_0x0a1a('0x29')](handleError(_0x2ebb75,null));};exports[_0x0a1a('0x18')]=function(_0x4e979a,_0x5b5843){return db[_0x0a1a('0x20')][_0x0a1a('0x33')]({'where':{'id':_0x4e979a[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x5b5843,null))[_0x0a1a('0x17')](removeEntity(_0x5b5843,null))[_0x0a1a('0x29')](handleError(_0x5b5843,null));};exports[_0x0a1a('0x3e')]=function(_0x1b45f9,_0x2fa5e8){return db[_0x0a1a('0x20')][_0x0a1a('0x3e')]()[_0x0a1a('0x17')](respondWithResult(_0x2fa5e8,null))[_0x0a1a('0x29')](handleError(_0x2fa5e8,null));};exports[_0x0a1a('0x3f')]=function(_0x2132e2,_0x54a503){var _0x39339d={'raw':!![],'where':{}},_0x577c24={},_0x43ae94;return db['ChatQueue'][_0x0a1a('0x40')]({'where':{'id':_0x2132e2[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x54a503,null))[_0x0a1a('0x17')](function(_0x229092){if(_0x229092){_0x43ae94=_0x229092[_0x0a1a('0x37')]({'plain':!![]});_0x577c24[_0x0a1a('0x2b')]=_[_0x0a1a('0x2c')](db['UserChatQueue'][_0x0a1a('0x21')]);_0x577c24[_0x0a1a('0x27')]=_[_0x0a1a('0x2c')](_0x2132e2[_0x0a1a('0x27')]);_0x577c24[_0x0a1a('0x41')]=_[_0x0a1a('0x2d')](_0x577c24['model'],_0x577c24[_0x0a1a('0x27')]);_0x39339d[_0x0a1a('0x2f')]=_[_0x0a1a('0x2d')](_0x577c24[_0x0a1a('0x2b')],qs['fields'](_0x2132e2[_0x0a1a('0x27')][_0x0a1a('0x2e')]));_0x39339d[_0x0a1a('0x2f')]=_0x39339d[_0x0a1a('0x2f')][_0x0a1a('0x30')]?_0x39339d['attributes']:_0x577c24[_0x0a1a('0x2b')];if(!_0x2132e2[_0x0a1a('0x27')]['hasOwnProperty']('nolimit')){_0x39339d[_0x0a1a('0x12')]=qs[_0x0a1a('0x12')](_0x2132e2[_0x0a1a('0x27')][_0x0a1a('0x12')]);_0x39339d[_0x0a1a('0x10')]=qs[_0x0a1a('0x10')](_0x2132e2[_0x0a1a('0x27')][_0x0a1a('0x10')]);}_0x39339d[_0x0a1a('0x42')]=qs['sort'](_0x2132e2['query']['sort']);_0x39339d[_0x0a1a('0x43')]=qs[_0x0a1a('0x41')](_['pick'](_0x2132e2[_0x0a1a('0x27')],_0x577c24['filters']));_0x39339d['where']['ChatQueueId']=_0x229092['id'];if(_0x2132e2['query']['filter']){_0x39339d[_0x0a1a('0x43')]=_[_0x0a1a('0x32')](_0x39339d[_0x0a1a('0x43')],{'$or':_['map'](_0x39339d['attributes'],function(_0x7e07c6){var _0x7c3a2e={};_0x7c3a2e[_0x7e07c6]={'$like':'%'+_0x2132e2[_0x0a1a('0x27')]['filter']+'%'};return _0x7c3a2e;})});}_0x39339d=_[_0x0a1a('0x32')]({},_0x39339d,_0x2132e2[_0x0a1a('0x44')]);return db[_0x0a1a('0x45')][_0x0a1a('0x46')](_0x39339d);}})[_0x0a1a('0x17')](function(_0x592498){if(_0x592498){return db[_0x0a1a('0x47')][_0x0a1a('0x48')]({'where':{'id':_[_0x0a1a('0x1f')](_0x592498,_0x0a1a('0x49')),'role':_0x0a1a('0x4a')},'attributes':['id',_0x0a1a('0x1c'),_0x0a1a('0x4b'),_0x0a1a('0x4c'),'createdAt']});}})[_0x0a1a('0x17')](function(_0x55504d){if(_0x55504d){return{'count':_0x55504d[_0x0a1a('0x13')],'rows':_[_0x0a1a('0x1f')](_0x55504d[_0x0a1a('0x28')],function(_0x287beb){return{'membername':_0x287beb['name'],'UserId':_0x287beb['id'],'queue_name':_0x43ae94[_0x0a1a('0x1c')],'ChatQueueId':_0x43ae94['id'],'interface':util['format']('%s/%s',_0x0a1a('0x4d'),_0x287beb[_0x0a1a('0x1c')]),'penalty':0x0,'paused':_0x287beb[_0x0a1a('0x4b')],'createdAt':_0x287beb[_0x0a1a('0x4e')],'updatedAt':_0x287beb[_0x0a1a('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0a1a('0x17')](respondWithFilteredResult(_0x54a503,_0x39339d))['catch'](handleError(_0x54a503,null));};exports[_0x0a1a('0x4f')]=function(_0x1ab902,_0x5635ec){var _0x8f535={};var _0x3ba14e={};var _0x30f2ca;var _0x2b5aff;return db[_0x0a1a('0x20')][_0x0a1a('0x40')]({'where':{'id':_0x1ab902[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x5635ec,null))['then'](function(_0x137c64){if(_0x137c64){_0x30f2ca=_0x137c64;_0x3ba14e[_0x0a1a('0x2b')]=_[_0x0a1a('0x2c')](db['Team'][_0x0a1a('0x21')]);_0x3ba14e[_0x0a1a('0x27')]=_[_0x0a1a('0x2c')](_0x1ab902[_0x0a1a('0x27')]);_0x3ba14e[_0x0a1a('0x41')]=_[_0x0a1a('0x2d')](_0x3ba14e['model'],_0x3ba14e[_0x0a1a('0x27')]);_0x8f535[_0x0a1a('0x2f')]=_[_0x0a1a('0x2d')](_0x3ba14e[_0x0a1a('0x2b')],qs[_0x0a1a('0x2e')](_0x1ab902['query'][_0x0a1a('0x2e')]));_0x8f535[_0x0a1a('0x2f')]=_0x8f535[_0x0a1a('0x2f')][_0x0a1a('0x30')]?_0x8f535[_0x0a1a('0x2f')]:_0x3ba14e[_0x0a1a('0x2b')];_0x8f535[_0x0a1a('0x42')]=qs[_0x0a1a('0x50')](_0x1ab902[_0x0a1a('0x27')]['sort']);_0x8f535[_0x0a1a('0x43')]=qs[_0x0a1a('0x41')](_[_0x0a1a('0x51')](_0x1ab902[_0x0a1a('0x27')],_0x3ba14e[_0x0a1a('0x41')]));if(_0x1ab902[_0x0a1a('0x27')][_0x0a1a('0x52')]){_0x8f535[_0x0a1a('0x43')]=_['merge'](_0x8f535['where'],{'$or':_[_0x0a1a('0x1f')](_0x8f535[_0x0a1a('0x2f')],function(_0x5cf2ce){var _0x49ee10={};_0x49ee10[_0x5cf2ce]={'$like':'%'+_0x1ab902[_0x0a1a('0x27')]['filter']+'%'};return _0x49ee10;})});}_0x8f535=_[_0x0a1a('0x32')]({},_0x8f535,_0x1ab902[_0x0a1a('0x44')]);return _0x30f2ca['getTeams'](_0x8f535);}})[_0x0a1a('0x17')](function(_0x353d37){if(_0x353d37){_0x2b5aff=_0x353d37['length'];if(!_0x1ab902[_0x0a1a('0x27')][_0x0a1a('0x53')](_0x0a1a('0x54'))){_0x8f535[_0x0a1a('0x12')]=qs[_0x0a1a('0x12')](_0x1ab902[_0x0a1a('0x27')][_0x0a1a('0x12')]);_0x8f535[_0x0a1a('0x10')]=qs[_0x0a1a('0x10')](_0x1ab902[_0x0a1a('0x27')]['offset']);}return _0x30f2ca['getTeams'](_0x8f535);}})['then'](function(_0x26981f){if(_0x26981f){return _0x26981f?{'count':_0x2b5aff,'rows':_0x26981f}:null;}})[_0x0a1a('0x17')](respondWithResult(_0x5635ec,null))['catch'](handleError(_0x5635ec,null));};exports[_0x0a1a('0x55')]=function(_0x580f9c,_0x5232d3){var _0x2fbcf8=_0x580f9c[_0x0a1a('0x35')][_0x0a1a('0x56')];return db['Team'][_0x0a1a('0x46')]({'where':{'id':_0x2fbcf8},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0a1a('0x57'),'attributes':['id',_0x0a1a('0x1c'),_0x0a1a('0x58'),'voicePause',_0x0a1a('0x59')],'raw':!![]}]})[_0x0a1a('0x17')](function(_0x41a3c5){if(_0x41a3c5){var _0x2606b1=_[_0x0a1a('0x5a')](_0x41a3c5,function(_0x303295){var _0x421d80=_0x303295[_0x0a1a('0x37')]({'plain':!![]});return _0x421d80[_0x0a1a('0x57')];});return db['ChatQueue'][_0x0a1a('0x33')]({'where':{'id':_0x580f9c[_0x0a1a('0x2a')]['id']}})['then'](function(_0x348949){return db['sequelize']['transaction'](function(_0x18c13c){return _0x348949['addTeams'](_0x2fbcf8,{'transaction':_0x18c13c})[_0x0a1a('0x17')](function(){return BPromise[_0x0a1a('0x5b')](_0x2606b1,function(_0x5c6915){return db[_0x0a1a('0x45')][_0x0a1a('0x5c')]({'where':{'UserId':_0x5c6915['id'],'ChatQueueId':_0x580f9c[_0x0a1a('0x2a')]['id']},'transaction':_0x18c13c});});})[_0x0a1a('0x17')](function(){_0x2606b1['forEach'](function(_0x3da386){socket[_0x0a1a('0x5d')](_0x0a1a('0x5e'),{'UserId':_0x3da386['id'],'ChatQueueId':_0x348949['id']});});});});});}})['then'](respondWithStatusCode(_0x5232d3,null))['catch'](handleError(_0x5232d3,null));};exports[_0x0a1a('0x5f')]=function(_0x5bfd66,_0x21a39e){return db['Team'][_0x0a1a('0x46')]({'where':{'id':_0x5bfd66['query'][_0x0a1a('0x56')]},'attributes':['id'],'include':[{'model':db[_0x0a1a('0x47')],'as':_0x0a1a('0x57'),'attributes':['id'],'raw':!![]}]})[_0x0a1a('0x17')](handleEntityNotFound(_0x21a39e,null))['then'](function(_0xcb64ad){var _0x483965=_[_0x0a1a('0x1f')](_0xcb64ad,'id');var _0x422a11=[];var _0xc01c21=[];var _0x168e4=squel[_0x0a1a('0x60')]();_0x168e4[_0x0a1a('0x61')](_0x0a1a('0x62'))['from']('team_has_chat_queues','tq')[_0x0a1a('0x63')](_0x0a1a('0x64'),'ut',_0x0a1a('0x65'))[_0x0a1a('0x43')](_0x0a1a('0x66'),_0x5bfd66[_0x0a1a('0x2a')]['id']);for(var _0x2a6579=0x0;_0x2a6579<_0xcb64ad[_0x0a1a('0x30')];_0x2a6579+=0x1){let _0x19caeb=_0xcb64ad[_0x2a6579];for(var _0x8c9ab6=0x0;_0x8c9ab6<_0x19caeb[_0x0a1a('0x57')][_0x0a1a('0x30')];_0x8c9ab6+=0x1){let _0x408f08=_0x19caeb[_0x0a1a('0x57')][_0x8c9ab6];var _0x1e2781=_0x168e4['clone']();_0x1e2781[_0x0a1a('0x43')]('ut.UserId\x20=\x20?',_0x408f08['id']);_0xc01c21[_0x0a1a('0x67')](db[_0x0a1a('0x68')]['query'](_0x1e2781['toString'](),{'type':db[_0x0a1a('0x68')]['QueryTypes'][_0x0a1a('0x69')]})[_0x0a1a('0x17')](function(_0x2e2677){if(_0x2e2677['length']===0x1){return _0x408f08['id'];}else{var _0x3ba3d6=_[_0x0a1a('0x6a')](_[_0x0a1a('0x1f')](_0x2e2677,_0x0a1a('0x6b')),function(_0x272224){return _['includes'](_0x483965,_0x272224);});if(_0x3ba3d6){return _0x408f08['id'];}}}));}}return BPromise['all'](_0xc01c21)[_0x0a1a('0x17')](function(_0x3d4993){_0x422a11=_(_0x422a11)[_0x0a1a('0x6c')](_0x3d4993)[_0x0a1a('0x6d')]()[_0x0a1a('0x6e')]();return db[_0x0a1a('0x20')][_0x0a1a('0x33')]({'where':{'id':_0x5bfd66[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](function(_0x1fb2b5){return db[_0x0a1a('0x68')][_0x0a1a('0x6f')](function(_0x1406dd){return _0x1fb2b5[_0x0a1a('0x5f')](_0x5bfd66['query']['ids'],{'transaction':_0x1406dd})['then'](function(){if(!_['isEmpty'](_0x422a11)){return _0x1fb2b5['removeAgents'](_0x422a11,{'transaction':_0x1406dd});}})[_0x0a1a('0x17')](function(){_0x422a11[_0x0a1a('0x70')](function(_0x3f27ba){socket[_0x0a1a('0x5d')]('userChatQueue:remove',{'UserId':_0x3f27ba,'ChatQueueId':_0x1fb2b5['id']});});});});});});})[_0x0a1a('0x17')](respondWithStatusCode(_0x21a39e,null))['catch'](handleError(_0x21a39e,null));};exports[_0x0a1a('0x71')]=function(_0x570c12,_0x3f6ec6){return db[_0x0a1a('0x20')][_0x0a1a('0x33')]({'where':{'id':_0x570c12[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x3f6ec6,null))['then'](function(_0x5bb06c){if(_0x5bb06c){return _0x5bb06c[_0x0a1a('0x71')](_0x570c12[_0x0a1a('0x35')][_0x0a1a('0x56')],_['omit'](_0x570c12['body'],[_0x0a1a('0x56'),'id'])||{})[_0x0a1a('0x72')](function(_0x18325a){for(var _0x3749f1=0x0;_0x3749f1<_0x570c12['body'][_0x0a1a('0x56')][_0x0a1a('0x30')];_0x3749f1+=0x1){socket[_0x0a1a('0x5d')](_0x0a1a('0x5e'),{'UserId':Number(_0x570c12[_0x0a1a('0x35')][_0x0a1a('0x56')][_0x3749f1]),'ChatQueueId':Number(_0x570c12['params']['id'])});}return _0x18325a;});}})[_0x0a1a('0x17')](respondWithResult(_0x3f6ec6,null))[_0x0a1a('0x29')](handleError(_0x3f6ec6,null));};exports[_0x0a1a('0x73')]=function(_0x202b1a,_0x2b18c2){return db[_0x0a1a('0x20')][_0x0a1a('0x33')]({'where':{'id':_0x202b1a[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x2b18c2,null))[_0x0a1a('0x17')](function(_0xac9afb){if(_0xac9afb){return _0xac9afb[_0x0a1a('0x73')](_0x202b1a[_0x0a1a('0x27')][_0x0a1a('0x56')])['then'](function(){if(_['isArray'](_0x202b1a['query'][_0x0a1a('0x56')])){for(var _0x1f7e15=0x0;_0x1f7e15<_0x202b1a['query']['ids'][_0x0a1a('0x30')];_0x1f7e15+=0x1){socket['emit']('userChatQueue:remove',{'UserId':Number(_0x202b1a[_0x0a1a('0x27')][_0x0a1a('0x56')][_0x1f7e15]),'ChatQueueId':Number(_0x202b1a[_0x0a1a('0x2a')]['id'])});}}else{socket[_0x0a1a('0x5d')](_0x0a1a('0x74'),{'UserId':Number(_0x202b1a[_0x0a1a('0x27')][_0x0a1a('0x56')]),'ChatQueueId':Number(_0x202b1a[_0x0a1a('0x2a')]['id'])});}});}})[_0x0a1a('0x17')](respondWithStatusCode(_0x2b18c2,null))[_0x0a1a('0x29')](handleError(_0x2b18c2,null));};exports[_0x0a1a('0x75')]=function(_0x287f29,_0x5a5e24){var _0x276a73={};var _0x12839c={};var _0xa56a27;var _0x5cc3d1;return db[_0x0a1a('0x20')]['findOne']({'where':{'id':_0x287f29[_0x0a1a('0x2a')]['id']}})[_0x0a1a('0x17')](handleEntityNotFound(_0x5a5e24,null))[_0x0a1a('0x17')](function(_0x2e9b4b){if(_0x2e9b4b){_0xa56a27=_0x2e9b4b;_0x12839c[_0x0a1a('0x2b')]=_[_0x0a1a('0x2c')](db['User'][_0x0a1a('0x21')]);_0x12839c[_0x0a1a('0x27')]=_['keys'](_0x287f29[_0x0a1a('0x27')]);_0x12839c[_0x0a1a('0x41')]=_['intersection'](_0x12839c['model'],_0x12839c['query']);_0x276a73[_0x0a1a('0x2f')]=_[_0x0a1a('0x2d')](_0x12839c[_0x0a1a('0x2b')],qs[_0x0a1a('0x2e')](_0x287f29[_0x0a1a('0x27')]['fields']));_0x276a73[_0x0a1a('0x2f')]=_0x276a73['attributes'][_0x0a1a('0x30')]?_0x276a73[_0x0a1a('0x2f')]:_0x12839c[_0x0a1a('0x2b')];_0x276a73[_0x0a1a('0x42')]=qs[_0x0a1a('0x50')](_0x287f29[_0x0a1a('0x27')]['sort']);_0x276a73['where']=qs[_0x0a1a('0x41')](_['pick'](_0x287f29[_0x0a1a('0x27')],_0x12839c['filters']));if(_0x287f29[_0x0a1a('0x27')][_0x0a1a('0x52')]){_0x276a73[_0x0a1a('0x43')]=_[_0x0a1a('0x32')](_0x276a73[_0x0a1a('0x43')],{'$or':_[_0x0a1a('0x1f')](_0x276a73[_0x0a1a('0x2f')],function(_0xebc424){var _0x3532bf={};_0x3532bf[_0xebc424]={'$like':'%'+_0x287f29['query'][_0x0a1a('0x52')]+'%'};return _0x3532bf;})});}_0x276a73=_[_0x0a1a('0x32')]({},_0x276a73,_0x287f29[_0x0a1a('0x44')]);return _0xa56a27[_0x0a1a('0x75')](_0x276a73);}})[_0x0a1a('0x17')](function(_0x1c0408){if(_0x1c0408){_0x5cc3d1=_0x1c0408[_0x0a1a('0x30')];if(!_0x287f29['query'][_0x0a1a('0x53')]('nolimit')){_0x276a73[_0x0a1a('0x12')]=qs['limit'](_0x287f29[_0x0a1a('0x27')][_0x0a1a('0x12')]);_0x276a73[_0x0a1a('0x10')]=qs[_0x0a1a('0x10')](_0x287f29[_0x0a1a('0x27')][_0x0a1a('0x10')]);}return _0xa56a27[_0x0a1a('0x75')](_0x276a73);}})['then'](function(_0x3ad13c){if(_0x3ad13c){return _0x3ad13c?{'count':_0x5cc3d1,'rows':_0x3ad13c}:null;}})[_0x0a1a('0x17')](respondWithResult(_0x5a5e24,null))['catch'](handleError(_0x5a5e24,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index a423144..52d7bd3 100644
--- a/server/api/chatQueue/chatQueue.events.js
+++ b/server/api/chatQueue/chatQueue.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb24=['remove','emit','hook','exports','events','../../mysqldb','ChatQueue','update'];(function(_0xd1fa3,_0x28f704){var _0x3ec57e=function(_0x2c68d4){while(--_0x2c68d4){_0xd1fa3['push'](_0xd1fa3['shift']());}};_0x3ec57e(++_0x28f704);}(_0xcb24,0x94));var _0x4cb2=function(_0xae8a4d,_0x37da44){_0xae8a4d=_0xae8a4d-0x0;var _0x34289f=_0xcb24[_0xae8a4d];return _0x34289f;};'use strict';var EventEmitter=require(_0x4cb2('0x0'));var ChatQueue=require(_0x4cb2('0x1'))['db'][_0x4cb2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x4cb2('0x3'),'afterDestroy':_0x4cb2('0x4')};function emitEvent(_0x417a6b){return function(_0x29d26e,_0x44dcd5,_0x3839ac){ChatQueueEvents['emit'](_0x417a6b+':'+_0x29d26e['id'],_0x29d26e);ChatQueueEvents[_0x4cb2('0x5')](_0x417a6b,_0x29d26e);_0x3839ac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x4cb2('0x6')](e,emitEvent(event));}}module[_0x4cb2('0x7')]=ChatQueueEvents;
\ No newline at end of file
+var _0xab73=['events','../../mysqldb','ChatQueue','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x394ce5,_0x679d25){var _0x39c13d=function(_0xce4c26){while(--_0xce4c26){_0x394ce5['push'](_0x394ce5['shift']());}};_0x39c13d(++_0x679d25);}(_0xab73,0x1a4));var _0x3ab7=function(_0x139da8,_0x93f0c0){_0x139da8=_0x139da8-0x0;var _0x466083=_0xab73[_0x139da8];return _0x466083;};'use strict';var EventEmitter=require(_0x3ab7('0x0'));var ChatQueue=require(_0x3ab7('0x1'))['db'][_0x3ab7('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x3ab7('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x3ab7('0x4'),'afterDestroy':_0x3ab7('0x5')};function emitEvent(_0x548fda){return function(_0x416339,_0x3fc3bd,_0xda3a5b){ChatQueueEvents[_0x3ab7('0x6')](_0x548fda+':'+_0x416339['id'],_0x416339);ChatQueueEvents[_0x3ab7('0x6')](_0x548fda,_0x416339);_0xda3a5b(null);};}for(var e in events){if(events[_0x3ab7('0x7')](e)){var event=events[e];ChatQueue[_0x3ab7('0x8')](e,emitEvent(event));}}module[_0x3ab7('0x9')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index d8b23c2..6060f66 100644
--- a/server/api/chatQueue/chatQueue.model.js
+++ b/server/api/chatQueue/chatQueue.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2d31=['ChatQueue','chat_queues','lodash','api','moment','bluebird','request-promise','path','rimraf','./chatQueue.attributes','exports'];(function(_0x49331c,_0x5a0f4d){var _0x200932=function(_0x4e231c){while(--_0x4e231c){_0x49331c['push'](_0x49331c['shift']());}};_0x200932(++_0x5a0f4d);}(_0x2d31,0x91));var _0x12d3=function(_0x12a554,_0x3d7ef8){_0x12a554=_0x12a554-0x0;var _0x244ba0=_0x2d31[_0x12a554];return _0x244ba0;};'use strict';var _=require(_0x12d3('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x12d3('0x1'));var moment=require(_0x12d3('0x2'));var BPromise=require(_0x12d3('0x3'));var rp=require(_0x12d3('0x4'));var fs=require('fs');var path=require(_0x12d3('0x5'));var rimraf=require(_0x12d3('0x6'));var config=require('../../config/environment');var attributes=require(_0x12d3('0x7'));module[_0x12d3('0x8')]=function(_0x3c5b73,_0x5258bf){return _0x3c5b73['define'](_0x12d3('0x9'),attributes,{'tableName':_0x12d3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8012=['rimraf','../../config/environment','./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2fc113,_0x45ec6e){var _0x5144ce=function(_0x47fd29){while(--_0x47fd29){_0x2fc113['push'](_0x2fc113['shift']());}};_0x5144ce(++_0x45ec6e);}(_0x8012,0x156));var _0x2801=function(_0x9fd887,_0x47f76c){_0x9fd887=_0x9fd887-0x0;var _0x1a54ab=_0x8012[_0x9fd887];return _0x1a54ab;};'use strict';var _=require(_0x2801('0x0'));var util=require(_0x2801('0x1'));var logger=require(_0x2801('0x2'))(_0x2801('0x3'));var moment=require(_0x2801('0x4'));var BPromise=require(_0x2801('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x2801('0x6'));var config=require(_0x2801('0x7'));var attributes=require(_0x2801('0x8'));module[_0x2801('0x9')]=function(_0x56c170,_0x438ea2){return _0x56c170['define'](_0x2801('0xa'),attributes,{'tableName':_0x2801('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js
index fa8a8b8..735a7b6 100644
--- a/server/api/chatQueue/chatQueue.rpc.js
+++ b/server/api/chatQueue/chatQueue.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x15f9=['client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetChatQueue','findAll','options','raw','attributes','limit','include','map','stringify','ShowChatQueue','find','where','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x15f9,0xf7));var _0x915f=function(_0x44e0c4,_0x5b59f7){_0x44e0c4=_0x44e0c4-0x0;var _0x556148=_0x15f9[_0x44e0c4];return _0x556148;};'use strict';var _=require(_0x915f('0x0'));var util=require(_0x915f('0x1'));var moment=require(_0x915f('0x2'));var BPromise=require(_0x915f('0x3'));var rs=require(_0x915f('0x4'));var fs=require('fs');var Redis=require(_0x915f('0x5'));var db=require(_0x915f('0x6'))['db'];var utils=require(_0x915f('0x7'));var logger=require(_0x915f('0x8'))('rpc');var config=require(_0x915f('0x9'));var jayson=require(_0x915f('0xa'));var client=jayson[_0x915f('0xb')][_0x915f('0xc')]({'port':0x232a});config['redis']=_[_0x915f('0xd')](config[_0x915f('0xe')],{'host':_0x915f('0xf'),'port':0x18eb});var socket=require(_0x915f('0x10'))(new Redis(config['redis']));require(_0x915f('0x11'))[_0x915f('0x12')](socket);function respondWithRpcPromise(_0x57daf8,_0x5da141,_0x3d038f){return new BPromise(function(_0x3746f9,_0x1b125c){return client[_0x915f('0x13')](_0x57daf8,_0x3d038f)[_0x915f('0x14')](function(_0x340a91){logger[_0x915f('0x15')](_0x915f('0x16'),_0x5da141,_0x915f('0x17'));logger[_0x915f('0x18')](_0x915f('0x19'),_0x5da141,_0x915f('0x17'),JSON['stringify'](_0x340a91));if(_0x340a91[_0x915f('0x1a')]){if(_0x340a91[_0x915f('0x1a')][_0x915f('0x1b')]===0x1f4){logger[_0x915f('0x1a')]('ChatQueue,\x20%s,\x20%s',_0x5da141,_0x340a91[_0x915f('0x1a')]['message']);return _0x1b125c(_0x340a91[_0x915f('0x1a')][_0x915f('0x1c')]);}logger['error'](_0x915f('0x16'),_0x5da141,_0x340a91[_0x915f('0x1a')]['message']);return _0x3746f9(_0x340a91[_0x915f('0x1a')][_0x915f('0x1c')]);}else{logger[_0x915f('0x15')]('ChatQueue,\x20%s,\x20%s',_0x5da141,_0x915f('0x17'));_0x3746f9(_0x340a91['result'][_0x915f('0x1c')]);}})[_0x915f('0x1d')](function(_0x4c04c8){logger[_0x915f('0x1a')](_0x915f('0x16'),_0x5da141,_0x4c04c8);_0x1b125c(_0x4c04c8);});});}exports[_0x915f('0x1e')]=function(_0x67e37f){var _0x15d065=this;return new Promise(function(_0x2d65c6,_0x2ba00c){return db['ChatQueue'][_0x915f('0x1f')]({'raw':_0x67e37f[_0x915f('0x20')]?_0x67e37f['options'][_0x915f('0x21')]===undefined?!![]:![]:!![],'where':_0x67e37f[_0x915f('0x20')]?_0x67e37f[_0x915f('0x20')]['where']||null:null,'attributes':_0x67e37f[_0x915f('0x20')]?_0x67e37f[_0x915f('0x20')][_0x915f('0x22')]||null:null,'limit':_0x67e37f[_0x915f('0x20')]?_0x67e37f[_0x915f('0x20')][_0x915f('0x23')]||null:null,'include':_0x67e37f['options']?_0x67e37f[_0x915f('0x20')][_0x915f('0x24')]?_[_0x915f('0x25')](_0x67e37f[_0x915f('0x20')][_0x915f('0x24')],function(_0x1a19e1){return{'model':db[_0x1a19e1['model']],'as':_0x1a19e1['as'],'attributes':_0x1a19e1[_0x915f('0x22')],'include':_0x1a19e1['include']?_['map'](_0x1a19e1[_0x915f('0x24')],function(_0x4ef141){return{'model':db[_0x4ef141['model']],'as':_0x4ef141['as'],'attributes':_0x4ef141[_0x915f('0x22')],'include':_0x4ef141[_0x915f('0x24')]?_[_0x915f('0x25')](_0x4ef141[_0x915f('0x24')],function(_0x5a5ee2){return{'model':db[_0x5a5ee2['model']],'as':_0x5a5ee2['as'],'attributes':_0x5a5ee2[_0x915f('0x22')]};}):[]};}):[]};}):[]:[]})[_0x915f('0x14')](function(_0x258b09){logger[_0x915f('0x15')](_0x915f('0x1e'),_0x67e37f);logger[_0x915f('0x18')]('GetChatQueue',_0x67e37f,JSON[_0x915f('0x26')](_0x258b09));_0x2d65c6(_0x258b09);})['catch'](function(_0x3cc1e0){logger['error'](_0x915f('0x1e'),_0x3cc1e0[_0x915f('0x1c')],_0x67e37f);_0x2ba00c(_0x15d065[_0x915f('0x1a')](0x1f4,_0x3cc1e0[_0x915f('0x1c')]));});});};exports[_0x915f('0x27')]=function(_0x2aac98){var _0x4ca577=this;return new Promise(function(_0x122388,_0x5c0c3){return db['ChatQueue'][_0x915f('0x28')]({'raw':_0x2aac98['options']?_0x2aac98[_0x915f('0x20')][_0x915f('0x21')]===undefined?!![]:![]:!![],'where':_0x2aac98[_0x915f('0x20')]?_0x2aac98[_0x915f('0x20')][_0x915f('0x29')]||null:null,'attributes':_0x2aac98['options']?_0x2aac98[_0x915f('0x20')][_0x915f('0x22')]||null:null,'include':_0x2aac98[_0x915f('0x20')]?_0x2aac98['options'][_0x915f('0x24')]?_[_0x915f('0x25')](_0x2aac98[_0x915f('0x20')][_0x915f('0x24')],function(_0xddfaf1){return{'model':db[_0xddfaf1[_0x915f('0x2a')]],'as':_0xddfaf1['as'],'attributes':_0xddfaf1['attributes'],'include':_0xddfaf1[_0x915f('0x24')]?_['map'](_0xddfaf1[_0x915f('0x24')],function(_0x49e1a8){return{'model':db[_0x49e1a8[_0x915f('0x2a')]],'as':_0x49e1a8['as'],'attributes':_0x49e1a8[_0x915f('0x22')],'include':_0x49e1a8[_0x915f('0x24')]?_['map'](_0x49e1a8[_0x915f('0x24')],function(_0x1f8558){return{'model':db[_0x1f8558[_0x915f('0x2a')]],'as':_0x1f8558['as'],'attributes':_0x1f8558['attributes']};}):[]};}):[]};}):[]:[]})[_0x915f('0x14')](function(_0x2af883){logger['info'](_0x915f('0x27'),_0x2aac98);logger['debug'](_0x915f('0x27'),_0x2aac98,JSON[_0x915f('0x26')](_0x2af883));_0x122388(_0x2af883);})[_0x915f('0x1d')](function(_0x43472f){logger['error'](_0x915f('0x27'),_0x43472f[_0x915f('0x1c')],_0x2aac98);_0x5c0c3(_0x4ca577[_0x915f('0x1a')](0x1f4,_0x43472f[_0x915f('0x1c')]));});});};
\ No newline at end of file
+var _0xd523=['debug','find','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','ChatQueue,\x20%s,\x20%s','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','code','error','message','info','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model'];(function(_0x27b7d2,_0x56c091){var _0x3ef6be=function(_0x6e8a35){while(--_0x6e8a35){_0x27b7d2['push'](_0x27b7d2['shift']());}};_0x3ef6be(++_0x56c091);}(_0xd523,0x153));var _0x3d52=function(_0x5ecedf,_0x4e9c48){_0x5ecedf=_0x5ecedf-0x0;var _0x2804c8=_0xd523[_0x5ecedf];return _0x2804c8;};'use strict';var _=require(_0x3d52('0x0'));var util=require(_0x3d52('0x1'));var moment=require(_0x3d52('0x2'));var BPromise=require(_0x3d52('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d52('0x4'));var db=require(_0x3d52('0x5'))['db'];var utils=require(_0x3d52('0x6'));var logger=require('../../config/logger')(_0x3d52('0x7'));var config=require(_0x3d52('0x8'));var jayson=require(_0x3d52('0x9'));var client=jayson[_0x3d52('0xa')]['http']({'port':0x232a});config['redis']=_[_0x3d52('0xb')](config[_0x3d52('0xc')],{'host':_0x3d52('0xd'),'port':0x18eb});var socket=require(_0x3d52('0xe'))(new Redis(config[_0x3d52('0xc')]));require(_0x3d52('0xf'))[_0x3d52('0x10')](socket);function respondWithRpcPromise(_0x2d966e,_0x30ee09,_0x4a5a9a){return new BPromise(function(_0x46c2e6,_0x873de6){return client[_0x3d52('0x11')](_0x2d966e,_0x4a5a9a)[_0x3d52('0x12')](function(_0x2675d2){logger['info'](_0x3d52('0x13'),_0x30ee09,'request\x20sent');logger['debug'](_0x3d52('0x14'),_0x30ee09,_0x3d52('0x15'),JSON['stringify'](_0x2675d2));if(_0x2675d2['error']){if(_0x2675d2['error'][_0x3d52('0x16')]===0x1f4){logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);return _0x873de6(_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);}logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);return _0x46c2e6(_0x2675d2[_0x3d52('0x17')][_0x3d52('0x18')]);}else{logger[_0x3d52('0x19')](_0x3d52('0x13'),_0x30ee09,'request\x20sent');_0x46c2e6(_0x2675d2[_0x3d52('0x1a')][_0x3d52('0x18')]);}})[_0x3d52('0x1b')](function(_0x54a514){logger[_0x3d52('0x17')](_0x3d52('0x13'),_0x30ee09,_0x54a514);_0x873de6(_0x54a514);});});}exports[_0x3d52('0x1c')]=function(_0x534fc4){var _0x34e160=this;return new Promise(function(_0x326a74,_0x1163c5){return db[_0x3d52('0x1d')][_0x3d52('0x1e')]({'raw':_0x534fc4[_0x3d52('0x1f')]?_0x534fc4[_0x3d52('0x1f')][_0x3d52('0x20')]===undefined?!![]:![]:!![],'where':_0x534fc4['options']?_0x534fc4[_0x3d52('0x1f')][_0x3d52('0x21')]||null:null,'attributes':_0x534fc4[_0x3d52('0x1f')]?_0x534fc4['options'][_0x3d52('0x22')]||null:null,'limit':_0x534fc4[_0x3d52('0x1f')]?_0x534fc4[_0x3d52('0x1f')][_0x3d52('0x23')]||null:null,'include':_0x534fc4[_0x3d52('0x1f')]?_0x534fc4[_0x3d52('0x1f')][_0x3d52('0x24')]?_[_0x3d52('0x25')](_0x534fc4[_0x3d52('0x1f')][_0x3d52('0x24')],function(_0x1ef6db){return{'model':db[_0x1ef6db['model']],'as':_0x1ef6db['as'],'attributes':_0x1ef6db[_0x3d52('0x22')],'include':_0x1ef6db[_0x3d52('0x24')]?_[_0x3d52('0x25')](_0x1ef6db[_0x3d52('0x24')],function(_0x490ce5){return{'model':db[_0x490ce5['model']],'as':_0x490ce5['as'],'attributes':_0x490ce5[_0x3d52('0x22')],'include':_0x490ce5[_0x3d52('0x24')]?_[_0x3d52('0x25')](_0x490ce5['include'],function(_0x209cca){return{'model':db[_0x209cca[_0x3d52('0x26')]],'as':_0x209cca['as'],'attributes':_0x209cca[_0x3d52('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3d52('0x12')](function(_0x5deee2){logger[_0x3d52('0x19')](_0x3d52('0x1c'),_0x534fc4);logger[_0x3d52('0x27')](_0x3d52('0x1c'),_0x534fc4,JSON['stringify'](_0x5deee2));_0x326a74(_0x5deee2);})[_0x3d52('0x1b')](function(_0x5a7455){logger[_0x3d52('0x17')](_0x3d52('0x1c'),_0x5a7455[_0x3d52('0x18')],_0x534fc4);_0x1163c5(_0x34e160['error'](0x1f4,_0x5a7455[_0x3d52('0x18')]));});});};exports['ShowChatQueue']=function(_0x2dd85f){var _0x4c0273=this;return new Promise(function(_0x56ac79,_0x2fc78d){return db[_0x3d52('0x1d')][_0x3d52('0x28')]({'raw':_0x2dd85f[_0x3d52('0x1f')]?_0x2dd85f[_0x3d52('0x1f')][_0x3d52('0x20')]===undefined?!![]:![]:!![],'where':_0x2dd85f[_0x3d52('0x1f')]?_0x2dd85f[_0x3d52('0x1f')][_0x3d52('0x21')]||null:null,'attributes':_0x2dd85f['options']?_0x2dd85f[_0x3d52('0x1f')][_0x3d52('0x22')]||null:null,'include':_0x2dd85f[_0x3d52('0x1f')]?_0x2dd85f[_0x3d52('0x1f')]['include']?_[_0x3d52('0x25')](_0x2dd85f[_0x3d52('0x1f')]['include'],function(_0x3f8bb6){return{'model':db[_0x3f8bb6['model']],'as':_0x3f8bb6['as'],'attributes':_0x3f8bb6[_0x3d52('0x22')],'include':_0x3f8bb6[_0x3d52('0x24')]?_[_0x3d52('0x25')](_0x3f8bb6['include'],function(_0x2798a7){return{'model':db[_0x2798a7['model']],'as':_0x2798a7['as'],'attributes':_0x2798a7[_0x3d52('0x22')],'include':_0x2798a7[_0x3d52('0x24')]?_[_0x3d52('0x25')](_0x2798a7['include'],function(_0x50dbd8){return{'model':db[_0x50dbd8[_0x3d52('0x26')]],'as':_0x50dbd8['as'],'attributes':_0x50dbd8[_0x3d52('0x22')]};}):[]};}):[]};}):[]:[]})[_0x3d52('0x12')](function(_0x5a3492){logger[_0x3d52('0x19')](_0x3d52('0x29'),_0x2dd85f);logger[_0x3d52('0x27')](_0x3d52('0x29'),_0x2dd85f,JSON['stringify'](_0x5a3492));_0x56ac79(_0x5a3492);})[_0x3d52('0x1b')](function(_0x4dc059){logger['error'](_0x3d52('0x29'),_0x4dc059['message'],_0x2dd85f);_0x2fc78d(_0x4c0273[_0x3d52('0x17')](0x1f4,_0x4dc059['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 8d9b4a3..d9925fd 100644
--- a/server/api/chatQueue/chatQueue.socket.js
+++ b/server/api/chatQueue/chatQueue.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x70e0=['chatQueue:','./chatQueue.events','save','remove','emit','removeListener'];(function(_0x533ae4,_0x126df2){var _0x19e750=function(_0x3f9606){while(--_0x3f9606){_0x533ae4['push'](_0x533ae4['shift']());}};_0x19e750(++_0x126df2);}(_0x70e0,0x17b));var _0x070e=function(_0xdc5573,_0x24a7fc){_0xdc5573=_0xdc5573-0x0;var _0x2abe75=_0x70e0[_0xdc5573];return _0x2abe75;};'use strict';var ChatQueueEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){ChatQueueEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);ChatQueueEvents['on'](_0x35ab0c,_0x1e11f0);}};
\ No newline at end of file
+var _0x5636=['save','emit','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x53e592,_0x16ce15){var _0x425070=function(_0x2fe5aa){while(--_0x2fe5aa){_0x53e592['push'](_0x53e592['shift']());}};_0x425070(++_0x16ce15);}(_0x5636,0x102));var _0x6563=function(_0x271586,_0x2c84f5){_0x271586=_0x271586-0x0;var _0x59c8a6=_0x5636[_0x271586];return _0x59c8a6;};'use strict';var ChatQueueEvents=require(_0x6563('0x0'));var events=[_0x6563('0x1'),'remove','update'];function createListener(_0x579d5c,_0x44872c){return function(_0x3a95f7){_0x44872c[_0x6563('0x2')](_0x579d5c,_0x3a95f7);};}function removeListener(_0x4ac653,_0x166a58){return function(){ChatQueueEvents[_0x6563('0x3')](_0x4ac653,_0x166a58);};}exports[_0x6563('0x4')]=function(_0x39792f){for(var _0x29f687=0x0,_0x193942=events[_0x6563('0x5')];_0x29f687<_0x193942;_0x29f687++){var _0x2d57d5=events[_0x29f687];var _0x2d0d5b=createListener(_0x6563('0x6')+_0x2d57d5,_0x39792f);ChatQueueEvents['on'](_0x2d57d5,_0x2d0d5b);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 2582dee..eadb40c 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x36b77a,_0x2ef645){var _0x451707=function(_0x4159b4){while(--_0x4159b4){_0x36b77a['push'](_0x36b77a['shift']());}};_0x451707(++_0x2ef645);}(_0x7217,0x19e));var _0x7721=function(_0x5783f4,_0x4a9e0a){_0x5783f4=_0x5783f4-0x0;var _0x28e380=_0x7217[_0x5783f4];return _0x28e380;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
+var _0x9957=['connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','/:id','delete','destroy','/:id/teams','removeTeams','multer','util','path'];(function(_0x5d3ab6,_0x31296e){var _0x52bbf=function(_0xd94d34){while(--_0xd94d34){_0x5d3ab6['push'](_0x5d3ab6['shift']());}};_0x52bbf(++_0x31296e);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var multer=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var path=require(_0x7995('0x2'));var timeout=require(_0x7995('0x3'));var express=require('express');var router=express[_0x7995('0x4')]();var fs_extra=require(_0x7995('0x5'));var auth=require(_0x7995('0x6'));var interaction=require(_0x7995('0x7'));var config=require('../../config/environment');var controller=require(_0x7995('0x8'));router[_0x7995('0x9')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0xb')]);router[_0x7995('0x9')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0x9')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0xe')]);router[_0x7995('0x9')](_0x7995('0xf'),auth[_0x7995('0xa')](),controller[_0x7995('0x10')]);router[_0x7995('0x9')]('/:id/teams',auth[_0x7995('0xa')](),controller[_0x7995('0x11')]);router['get'](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')]('/',auth[_0x7995('0xa')](),controller[_0x7995('0x15')]);router[_0x7995('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x7995('0x16')]);router[_0x7995('0x14')](_0x7995('0x12'),auth[_0x7995('0xa')](),controller[_0x7995('0x17')]);router[_0x7995('0x18')](_0x7995('0x19'),auth[_0x7995('0xa')](),controller['update']);router[_0x7995('0x1a')]('/:id',auth[_0x7995('0xa')](),controller[_0x7995('0x1b')]);router[_0x7995('0x1a')](_0x7995('0x1c'),auth[_0x7995('0xa')](),controller[_0x7995('0x1d')]);router['delete']('/:id/users',auth[_0x7995('0xa')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 331a8ec..4ac4ed3 100644
--- a/server/api/chatQueueReport/chatQueueReport.attributes.js
+++ b/server/api/chatQueueReport/chatQueueReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x709e=['DATE','moment','sequelize','exports','STRING'];(function(_0x3853ac,_0x37152d){var _0x43d0de=function(_0x1a3889){while(--_0x1a3889){_0x3853ac['push'](_0x3853ac['shift']());}};_0x43d0de(++_0x37152d);}(_0x709e,0xab));var _0xe709=function(_0x58e610,_0x3acc22){_0x58e610=_0x58e610-0x0;var _0x253abd=_0x709e[_0x58e610];return _0x253abd;};'use strict';var moment=require(_0xe709('0x0'));var Sequelize=require(_0xe709('0x1'));module[_0xe709('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe709('0x3')]},'joinAt':{'type':Sequelize[_0xe709('0x4')]},'leaveAt':{'type':Sequelize[_0xe709('0x4')]},'acceptAt':{'type':Sequelize[_0xe709('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe709('0x3')]}};
\ No newline at end of file
+var _0x6873=['DATE','exports','STRING'];(function(_0x12c3f8,_0x4df4ea){var _0x4bb87b=function(_0x1886c0){while(--_0x1886c0){_0x12c3f8['push'](_0x12c3f8['shift']());}};_0x4bb87b(++_0x4df4ea);}(_0x6873,0xac));var _0x3687=function(_0x4bfcbe,_0x4630f5){_0x4bfcbe=_0x4bfcbe-0x0;var _0x5b65e6=_0x6873[_0x4bfcbe];return _0x5b65e6;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x3687('0x0')]={'uniqueid':{'type':Sequelize[_0x3687('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x3687('0x1')]},'joinAt':{'type':Sequelize[_0x3687('0x2')]},'leaveAt':{'type':Sequelize[_0x3687('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x3687('0x2')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e1289df..008158d 100644
--- a/server/api/chatQueueReport/chatQueueReport.controller.js
+++ b/server/api/chatQueueReport/chatQueueReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1fcc=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','reject','save','then','destroy','error','stack','name','send','map','ChatQueueReport','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','order','sort','filters','pick','where','merge','VIRTUAL','filter','options','include','rows','show','params','rawAttributes','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','fast-json-patch'];(function(_0x338251,_0x5422de){var _0x3d6a8f=function(_0x33b311){while(--_0x33b311){_0x338251['push'](_0x338251['shift']());}};_0x3d6a8f(++_0x5422de);}(_0x1fcc,0x125));var _0xc1fc=function(_0x2db667,_0x193cf5){_0x2db667=_0x2db667-0x0;var _0x83ff9=_0x1fcc[_0x2db667];return _0x83ff9;};'use strict';var emlformat=require(_0xc1fc('0x0'));var rimraf=require(_0xc1fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc1fc('0x2'));var rp=require(_0xc1fc('0x3'));var moment=require(_0xc1fc('0x4'));var BPromise=require(_0xc1fc('0x5'));var Mustache=require(_0xc1fc('0x6'));var util=require(_0xc1fc('0x7'));var path=require(_0xc1fc('0x8'));var sox=require('sox');var csv=require(_0xc1fc('0x9'));var ejs=require(_0xc1fc('0xa'));var fs=require('fs');var fs_extra=require(_0xc1fc('0xb'));var _=require('lodash');var squel=require(_0xc1fc('0xc'));var crypto=require(_0xc1fc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc1fc('0xe'));var toCsv=require(_0xc1fc('0x9'));var querystring=require('querystring');var Papa=require(_0xc1fc('0xf'));var Redis=require('ioredis');var authService=require(_0xc1fc('0x10'));var qs=require(_0xc1fc('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc1fc('0x12'));var logger=require(_0xc1fc('0x13'))(_0xc1fc('0x14'));var utils=require(_0xc1fc('0x15'));var config=require(_0xc1fc('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xc1fc('0x17'))['db'];function respondWithStatusCode(_0x10d1d3,_0x354393){_0x354393=_0x354393||0xcc;return function(_0x55c62b){if(_0x55c62b){return _0x10d1d3[_0xc1fc('0x18')](_0x354393);}return _0x10d1d3[_0xc1fc('0x19')](_0x354393)[_0xc1fc('0x1a')]();};}function respondWithResult(_0x52b0bb,_0x2a8519){_0x2a8519=_0x2a8519||0xc8;return function(_0x338ca8){if(_0x338ca8){return _0x52b0bb[_0xc1fc('0x19')](_0x2a8519)[_0xc1fc('0x1b')](_0x338ca8);}};}function respondWithFilteredResult(_0x232bc2,_0xd04a31){return function(_0x476bcf){if(_0x476bcf){var _0x427326=typeof _0xd04a31[_0xc1fc('0x1c')]===_0xc1fc('0x1d')&&typeof _0xd04a31['limit']===_0xc1fc('0x1d');var _0x5626d6=_0x476bcf['count'];var _0x6c0e26=_0x427326?0x0:_0xd04a31[_0xc1fc('0x1c')];var _0x3fba13=_0x427326?_0x476bcf[_0xc1fc('0x1e')]:_0xd04a31[_0xc1fc('0x1c')]+_0xd04a31[_0xc1fc('0x1f')];var _0x28e2d2;if(_0x3fba13>=_0x5626d6){_0x3fba13=_0x5626d6;_0x28e2d2=0xc8;}else{_0x28e2d2=0xce;}_0x232bc2[_0xc1fc('0x19')](_0x28e2d2);return _0x232bc2[_0xc1fc('0x20')]('Content-Range',_0x6c0e26+'-'+_0x3fba13+'/'+_0x5626d6)[_0xc1fc('0x1b')](_0x476bcf);}return null;};}function patchUpdates(_0x36122b){return function(_0x56b0f3){try{jsonpatch['apply'](_0x56b0f3,_0x36122b,!![]);}catch(_0x36345c){return BPromise[_0xc1fc('0x21')](_0x36345c);}return _0x56b0f3[_0xc1fc('0x22')]();};}function saveUpdates(_0x528900,_0x474c8f){return function(_0x54d500){if(_0x54d500){return _0x54d500['update'](_0x528900)[_0xc1fc('0x23')](function(_0x8b5912){return _0x8b5912;});}return null;};}function removeEntity(_0x34aaa4,_0x3aacf2){return function(_0x214ddd){if(_0x214ddd){return _0x214ddd[_0xc1fc('0x24')]()['then'](function(){_0x34aaa4[_0xc1fc('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27723f,_0x38fd5c){return function(_0x489f41){if(!_0x489f41){_0x27723f[_0xc1fc('0x18')](0x194);}return _0x489f41;};}function handleError(_0x2d6f4a,_0x281d16){_0x281d16=_0x281d16||0x1f4;return function(_0x23594f){logger[_0xc1fc('0x25')](_0x23594f[_0xc1fc('0x26')]);if(_0x23594f['name']){delete _0x23594f[_0xc1fc('0x27')];}_0x2d6f4a[_0xc1fc('0x19')](_0x281d16)[_0xc1fc('0x28')](_0x23594f);};}exports['index']=function(_0xf45540,_0x47ad51){var _0x3c0da5={},_0x1977a4={},_0x11afe8={'count':0x0,'rows':[]};var _0x16d15c=_[_0xc1fc('0x29')](db[_0xc1fc('0x2a')]['rawAttributes'],function(_0x39f60d){return{'name':_0x39f60d['fieldName'],'type':_0x39f60d[_0xc1fc('0x2b')][_0xc1fc('0x2c')]};});_0x1977a4['model']=_['map'](_0x16d15c,_0xc1fc('0x27'));_0x1977a4['query']=_[_0xc1fc('0x2d')](_0xf45540[_0xc1fc('0x2e')]);_0x1977a4['filters']=_[_0xc1fc('0x2f')](_0x1977a4['model'],_0x1977a4[_0xc1fc('0x2e')]);_0x3c0da5[_0xc1fc('0x30')]=_['intersection'](_0x1977a4[_0xc1fc('0x31')],qs[_0xc1fc('0x32')](_0xf45540['query'][_0xc1fc('0x32')]));_0x3c0da5[_0xc1fc('0x30')]=_0x3c0da5['attributes'][_0xc1fc('0x33')]?_0x3c0da5['attributes']:_0x1977a4['model'];if(!_0xf45540[_0xc1fc('0x2e')][_0xc1fc('0x34')]('nolimit')){_0x3c0da5[_0xc1fc('0x1f')]=qs[_0xc1fc('0x1f')](_0xf45540[_0xc1fc('0x2e')][_0xc1fc('0x1f')]);_0x3c0da5[_0xc1fc('0x1c')]=qs[_0xc1fc('0x1c')](_0xf45540[_0xc1fc('0x2e')][_0xc1fc('0x1c')]);}_0x3c0da5[_0xc1fc('0x35')]=qs['sort'](_0xf45540['query'][_0xc1fc('0x36')]);_0x3c0da5['where']=qs[_0xc1fc('0x37')](_[_0xc1fc('0x38')](_0xf45540[_0xc1fc('0x2e')],_0x1977a4[_0xc1fc('0x37')]),_0x16d15c);if(_0xf45540['query']['filter']){_0x3c0da5[_0xc1fc('0x39')]=_[_0xc1fc('0x3a')](_0x3c0da5[_0xc1fc('0x39')],{'$or':_[_0xc1fc('0x29')](_0x16d15c,function(_0x722d12){if(_0x722d12[_0xc1fc('0x2b')]!==_0xc1fc('0x3b')){var _0x142e53={};_0x142e53[_0x722d12['name']]={'$like':'%'+_0xf45540['query'][_0xc1fc('0x3c')]+'%'};return _0x142e53;}})});}_0x3c0da5=_['merge']({},_0x3c0da5,_0xf45540[_0xc1fc('0x3d')]);var _0x493831={'where':_0x3c0da5[_0xc1fc('0x39')]};return db['ChatQueueReport']['count'](_0x493831)[_0xc1fc('0x23')](function(_0x46b18d){_0x11afe8[_0xc1fc('0x1e')]=_0x46b18d;if(_0xf45540['query']['includeAll']){_0x3c0da5[_0xc1fc('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport']['findAll'](_0x3c0da5);})[_0xc1fc('0x23')](function(_0x2366d1){_0x11afe8[_0xc1fc('0x3f')]=_0x2366d1;return _0x11afe8;})['then'](respondWithFilteredResult(_0x47ad51,_0x3c0da5))['catch'](handleError(_0x47ad51,null));};exports[_0xc1fc('0x40')]=function(_0x2e48c1,_0x38fe43){var _0x43017d={'raw':!![],'where':{'id':_0x2e48c1[_0xc1fc('0x41')]['id']}},_0x3fcd72={};_0x3fcd72[_0xc1fc('0x31')]=_[_0xc1fc('0x2d')](db[_0xc1fc('0x2a')][_0xc1fc('0x42')]);_0x3fcd72[_0xc1fc('0x2e')]=_['keys'](_0x2e48c1[_0xc1fc('0x2e')]);_0x3fcd72[_0xc1fc('0x37')]=_[_0xc1fc('0x2f')](_0x3fcd72[_0xc1fc('0x31')],_0x3fcd72[_0xc1fc('0x2e')]);_0x43017d[_0xc1fc('0x30')]=_[_0xc1fc('0x2f')](_0x3fcd72['model'],qs[_0xc1fc('0x32')](_0x2e48c1[_0xc1fc('0x2e')][_0xc1fc('0x32')]));_0x43017d[_0xc1fc('0x30')]=_0x43017d[_0xc1fc('0x30')][_0xc1fc('0x33')]?_0x43017d[_0xc1fc('0x30')]:_0x3fcd72[_0xc1fc('0x31')];if(_0x2e48c1['query'][_0xc1fc('0x43')]){_0x43017d[_0xc1fc('0x3e')]=[{'all':!![]}];}_0x43017d=_[_0xc1fc('0x3a')]({},_0x43017d,_0x2e48c1[_0xc1fc('0x3d')]);return db['ChatQueueReport'][_0xc1fc('0x44')](_0x43017d)[_0xc1fc('0x23')](handleEntityNotFound(_0x38fe43,null))[_0xc1fc('0x23')](respondWithResult(_0x38fe43,null))[_0xc1fc('0x45')](handleError(_0x38fe43,null));};exports[_0xc1fc('0x46')]=function(_0x3b4b8d,_0xe76f74){return db[_0xc1fc('0x2a')][_0xc1fc('0x46')](_0x3b4b8d[_0xc1fc('0x47')],{})[_0xc1fc('0x23')](respondWithResult(_0xe76f74,0xc9))['catch'](handleError(_0xe76f74,null));};exports[_0xc1fc('0x48')]=function(_0x1ca680,_0x89bf6a){if(_0x1ca680[_0xc1fc('0x47')]['id']){delete _0x1ca680['body']['id'];}return db['ChatQueueReport'][_0xc1fc('0x44')]({'where':{'id':_0x1ca680['params']['id']}})['then'](handleEntityNotFound(_0x89bf6a,null))[_0xc1fc('0x23')](saveUpdates(_0x1ca680['body'],null))[_0xc1fc('0x23')](respondWithResult(_0x89bf6a,null))[_0xc1fc('0x45')](handleError(_0x89bf6a,null));};exports['destroy']=function(_0x2930ff,_0x48669c){return db[_0xc1fc('0x2a')]['find']({'where':{'id':_0x2930ff[_0xc1fc('0x41')]['id']}})[_0xc1fc('0x23')](handleEntityNotFound(_0x48669c,null))[_0xc1fc('0x23')](removeEntity(_0x48669c,null))[_0xc1fc('0x45')](handleError(_0x48669c,null));};exports[_0xc1fc('0x49')]=function(_0x36b48e,_0x40fd56){return db[_0xc1fc('0x2a')][_0xc1fc('0x49')]()['then'](respondWithResult(_0x40fd56,null))[_0xc1fc('0x45')](handleError(_0x40fd56,null));};
\ No newline at end of file
+var _0xee4a=['options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','limit','count','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','index','ChatQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x266141,_0x302df6){var _0x3439d8=function(_0x436cfa){while(--_0x436cfa){_0x266141['push'](_0x266141['shift']());}};_0x3439d8(++_0x302df6);}(_0xee4a,0x9e));var _0xaee4=function(_0x4973b2,_0x49e35a){_0x4973b2=_0x4973b2-0x0;var _0x57499d=_0xee4a[_0x4973b2];return _0x57499d;};'use strict';var emlformat=require(_0xaee4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaee4('0x1'));var jsonpatch=require(_0xaee4('0x2'));var rp=require(_0xaee4('0x3'));var moment=require('moment');var BPromise=require(_0xaee4('0x4'));var Mustache=require('mustache');var util=require(_0xaee4('0x5'));var path=require('path');var sox=require(_0xaee4('0x6'));var csv=require('to-csv');var ejs=require(_0xaee4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xaee4('0x8'));var squel=require(_0xaee4('0x9'));var crypto=require(_0xaee4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xaee4('0xb'));var toCsv=require(_0xaee4('0xc'));var querystring=require('querystring');var Papa=require(_0xaee4('0xd'));var Redis=require(_0xaee4('0xe'));var authService=require(_0xaee4('0xf'));var qs=require(_0xaee4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaee4('0x11'));var utils=require(_0xaee4('0x12'));var config=require(_0xaee4('0x13'));var licenseUtil=require(_0xaee4('0x14'));var db=require(_0xaee4('0x15'))['db'];function respondWithStatusCode(_0x1db3f7,_0x19fab2){_0x19fab2=_0x19fab2||0xcc;return function(_0x32d70e){if(_0x32d70e){return _0x1db3f7['sendStatus'](_0x19fab2);}return _0x1db3f7['status'](_0x19fab2)[_0xaee4('0x16')]();};}function respondWithResult(_0x47b2ed,_0x4ecbd8){_0x4ecbd8=_0x4ecbd8||0xc8;return function(_0x2a3d88){if(_0x2a3d88){return _0x47b2ed[_0xaee4('0x17')](_0x4ecbd8)[_0xaee4('0x18')](_0x2a3d88);}};}function respondWithFilteredResult(_0x457963,_0xd47f9e){return function(_0x3aaaf9){if(_0x3aaaf9){var _0x225f34=typeof _0xd47f9e[_0xaee4('0x19')]==='undefined'&&typeof _0xd47f9e[_0xaee4('0x1a')]==='undefined';var _0x552297=_0x3aaaf9[_0xaee4('0x1b')];var _0x632c0f=_0x225f34?0x0:_0xd47f9e[_0xaee4('0x19')];var _0x45bdf2=_0x225f34?_0x3aaaf9[_0xaee4('0x1b')]:_0xd47f9e['offset']+_0xd47f9e[_0xaee4('0x1a')];var _0x251e0d;if(_0x45bdf2>=_0x552297){_0x45bdf2=_0x552297;_0x251e0d=0xc8;}else{_0x251e0d=0xce;}_0x457963['status'](_0x251e0d);return _0x457963[_0xaee4('0x1c')](_0xaee4('0x1d'),_0x632c0f+'-'+_0x45bdf2+'/'+_0x552297)['json'](_0x3aaaf9);}return null;};}function patchUpdates(_0x506725){return function(_0x4e93e7){try{jsonpatch[_0xaee4('0x1e')](_0x4e93e7,_0x506725,!![]);}catch(_0x31a89d){return BPromise[_0xaee4('0x1f')](_0x31a89d);}return _0x4e93e7['save']();};}function saveUpdates(_0x5cafaf,_0x14091f){return function(_0x5ddf54){if(_0x5ddf54){return _0x5ddf54[_0xaee4('0x20')](_0x5cafaf)[_0xaee4('0x21')](function(_0x58fb83){return _0x58fb83;});}return null;};}function removeEntity(_0x204704,_0x3297e4){return function(_0x1fc4fa){if(_0x1fc4fa){return _0x1fc4fa[_0xaee4('0x22')]()[_0xaee4('0x21')](function(){_0x204704[_0xaee4('0x17')](0xcc)[_0xaee4('0x16')]();});}};}function handleEntityNotFound(_0xcee4c7,_0x406e15){return function(_0x46e629){if(!_0x46e629){_0xcee4c7[_0xaee4('0x23')](0x194);}return _0x46e629;};}function handleError(_0x3ff17c,_0x39c088){_0x39c088=_0x39c088||0x1f4;return function(_0x32bc01){logger[_0xaee4('0x24')](_0x32bc01['stack']);if(_0x32bc01[_0xaee4('0x25')]){delete _0x32bc01[_0xaee4('0x25')];}_0x3ff17c[_0xaee4('0x17')](_0x39c088)['send'](_0x32bc01);};}exports[_0xaee4('0x26')]=function(_0x272747,_0x2388a6){var _0x4a7f3a={},_0x2dbf6f={},_0x41fc45={'count':0x0,'rows':[]};var _0x5c2819=_['map'](db[_0xaee4('0x27')][_0xaee4('0x28')],function(_0x43899d){return{'name':_0x43899d[_0xaee4('0x29')],'type':_0x43899d[_0xaee4('0x2a')]['key']};});_0x2dbf6f[_0xaee4('0x2b')]=_[_0xaee4('0x2c')](_0x5c2819,_0xaee4('0x25'));_0x2dbf6f[_0xaee4('0x2d')]=_[_0xaee4('0x2e')](_0x272747[_0xaee4('0x2d')]);_0x2dbf6f[_0xaee4('0x2f')]=_['intersection'](_0x2dbf6f[_0xaee4('0x2b')],_0x2dbf6f[_0xaee4('0x2d')]);_0x4a7f3a['attributes']=_[_0xaee4('0x30')](_0x2dbf6f['model'],qs[_0xaee4('0x31')](_0x272747['query'][_0xaee4('0x31')]));_0x4a7f3a[_0xaee4('0x32')]=_0x4a7f3a[_0xaee4('0x32')][_0xaee4('0x33')]?_0x4a7f3a['attributes']:_0x2dbf6f[_0xaee4('0x2b')];if(!_0x272747[_0xaee4('0x2d')][_0xaee4('0x34')](_0xaee4('0x35'))){_0x4a7f3a[_0xaee4('0x1a')]=qs['limit'](_0x272747[_0xaee4('0x2d')][_0xaee4('0x1a')]);_0x4a7f3a[_0xaee4('0x19')]=qs[_0xaee4('0x19')](_0x272747[_0xaee4('0x2d')]['offset']);}_0x4a7f3a[_0xaee4('0x36')]=qs[_0xaee4('0x37')](_0x272747[_0xaee4('0x2d')]['sort']);_0x4a7f3a[_0xaee4('0x38')]=qs[_0xaee4('0x2f')](_[_0xaee4('0x39')](_0x272747['query'],_0x2dbf6f[_0xaee4('0x2f')]),_0x5c2819);if(_0x272747['query'][_0xaee4('0x3a')]){_0x4a7f3a[_0xaee4('0x38')]=_[_0xaee4('0x3b')](_0x4a7f3a['where'],{'$or':_[_0xaee4('0x2c')](_0x5c2819,function(_0x33df65){if(_0x33df65[_0xaee4('0x2a')]!==_0xaee4('0x3c')){var _0x3bc51f={};_0x3bc51f[_0x33df65[_0xaee4('0x25')]]={'$like':'%'+_0x272747['query'][_0xaee4('0x3a')]+'%'};return _0x3bc51f;}})});}_0x4a7f3a=_['merge']({},_0x4a7f3a,_0x272747[_0xaee4('0x3d')]);var _0xb65357={'where':_0x4a7f3a[_0xaee4('0x38')]};return db['ChatQueueReport'][_0xaee4('0x1b')](_0xb65357)[_0xaee4('0x21')](function(_0x18a8a4){_0x41fc45[_0xaee4('0x1b')]=_0x18a8a4;if(_0x272747['query'][_0xaee4('0x3e')]){_0x4a7f3a[_0xaee4('0x3f')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xaee4('0x40')](_0x4a7f3a);})[_0xaee4('0x21')](function(_0x5bd19e){_0x41fc45[_0xaee4('0x41')]=_0x5bd19e;return _0x41fc45;})['then'](respondWithFilteredResult(_0x2388a6,_0x4a7f3a))[_0xaee4('0x42')](handleError(_0x2388a6,null));};exports[_0xaee4('0x43')]=function(_0x37ced3,_0x48c077){var _0x30558d={'raw':!![],'where':{'id':_0x37ced3[_0xaee4('0x44')]['id']}},_0xc3a85f={};_0xc3a85f['model']=_[_0xaee4('0x2e')](db['ChatQueueReport'][_0xaee4('0x28')]);_0xc3a85f['query']=_['keys'](_0x37ced3[_0xaee4('0x2d')]);_0xc3a85f['filters']=_['intersection'](_0xc3a85f[_0xaee4('0x2b')],_0xc3a85f[_0xaee4('0x2d')]);_0x30558d['attributes']=_[_0xaee4('0x30')](_0xc3a85f[_0xaee4('0x2b')],qs[_0xaee4('0x31')](_0x37ced3[_0xaee4('0x2d')][_0xaee4('0x31')]));_0x30558d[_0xaee4('0x32')]=_0x30558d[_0xaee4('0x32')][_0xaee4('0x33')]?_0x30558d[_0xaee4('0x32')]:_0xc3a85f[_0xaee4('0x2b')];if(_0x37ced3['query'][_0xaee4('0x3e')]){_0x30558d[_0xaee4('0x3f')]=[{'all':!![]}];}_0x30558d=_[_0xaee4('0x3b')]({},_0x30558d,_0x37ced3[_0xaee4('0x3d')]);return db[_0xaee4('0x27')][_0xaee4('0x45')](_0x30558d)[_0xaee4('0x21')](handleEntityNotFound(_0x48c077,null))[_0xaee4('0x21')](respondWithResult(_0x48c077,null))[_0xaee4('0x42')](handleError(_0x48c077,null));};exports[_0xaee4('0x46')]=function(_0x159aee,_0x143d29){return db['ChatQueueReport'][_0xaee4('0x46')](_0x159aee[_0xaee4('0x47')],{})[_0xaee4('0x21')](respondWithResult(_0x143d29,0xc9))[_0xaee4('0x42')](handleError(_0x143d29,null));};exports[_0xaee4('0x20')]=function(_0x11980b,_0x11fcc7){if(_0x11980b['body']['id']){delete _0x11980b[_0xaee4('0x47')]['id'];}return db[_0xaee4('0x27')][_0xaee4('0x45')]({'where':{'id':_0x11980b[_0xaee4('0x44')]['id']}})['then'](handleEntityNotFound(_0x11fcc7,null))[_0xaee4('0x21')](saveUpdates(_0x11980b[_0xaee4('0x47')],null))[_0xaee4('0x21')](respondWithResult(_0x11fcc7,null))['catch'](handleError(_0x11fcc7,null));};exports['destroy']=function(_0x4608de,_0x42cfd6){return db[_0xaee4('0x27')]['find']({'where':{'id':_0x4608de['params']['id']}})[_0xaee4('0x21')](handleEntityNotFound(_0x42cfd6,null))[_0xaee4('0x21')](removeEntity(_0x42cfd6,null))['catch'](handleError(_0x42cfd6,null));};exports[_0xaee4('0x48')]=function(_0x5d5a8d,_0x5628eb){return db[_0xaee4('0x27')][_0xaee4('0x48')]()[_0xaee4('0x21')](respondWithResult(_0x5628eb,null))[_0xaee4('0x42')](handleError(_0x5628eb,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 7ccb1e6..d333f02 100644
--- a/server/api/chatQueueReport/chatQueueReport.model.js
+++ b/server/api/chatQueueReport/chatQueueReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x3f542e,_0x38a004){var _0x3a6a12=function(_0x1c3a87){while(--_0x1c3a87){_0x3f542e['push'](_0x3f542e['shift']());}};_0x3a6a12(++_0x38a004);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x152449,_0x49f41d){_0x152449=_0x152449-0x0;var _0x5b58b2=_0xcb91[_0x152449];return _0x5b58b2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0xcb91=['path','rimraf','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','../../config/logger','api','moment','bluebird'];(function(_0x149659,_0x4de741){var _0x5d0ab5=function(_0xc1720c){while(--_0xc1720c){_0x149659['push'](_0x149659['shift']());}};_0x5d0ab5(++_0x4de741);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x2d994d,_0x168a27){_0x2d994d=_0x2d994d-0x0;var _0xd54be4=_0xcb91[_0x2d994d];return _0xd54be4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1cb9('0x0'))(_0x1cb9('0x1'));var moment=require(_0x1cb9('0x2'));var BPromise=require(_0x1cb9('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1cb9('0x4'));var rimraf=require(_0x1cb9('0x5'));var config=require('../../config/environment');var attributes=require(_0x1cb9('0x6'));module[_0x1cb9('0x7')]=function(_0x53ffbd,_0x226b69){return _0x53ffbd[_0x1cb9('0x8')]('ChatQueueReport',attributes,{'tableName':_0x1cb9('0x9'),'paranoid':![],'indexes':[{'name':_0x1cb9('0xa'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index f2d5ae9..b55cba4 100644
--- a/server/api/chatQueueReport/chatQueueReport.rpc.js
+++ b/server/api/chatQueueReport/chatQueueReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8fb=['../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','message','ChatQueueReport,\x20%s,\x20%s','result','catch','CreateChatQueueReport','ChatQueueReport','options','raw','debug','UpdateChatQueueReport','update','body','where','attributes','limit','stringify','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x439cc8,_0x3469fe){var _0x47e4b0=function(_0xe86034){while(--_0xe86034){_0x439cc8['push'](_0x439cc8['shift']());}};_0x47e4b0(++_0x3469fe);}(_0xd8fb,0x79));var _0xbd8f=function(_0x182b51,_0x455b54){_0x182b51=_0x182b51-0x0;var _0x102ee6=_0xd8fb[_0x182b51];return _0x102ee6;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require('moment');var BPromise=require(_0xbd8f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd8f('0x3'))['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))(_0xbd8f('0x6'));var config=require(_0xbd8f('0x7'));var jayson=require(_0xbd8f('0x8'));var client=jayson[_0xbd8f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x541cc6,_0x35a18f,_0x1435da){return new BPromise(function(_0x1da2ab,_0x34e83f){return client[_0xbd8f('0xa')](_0x541cc6,_0x1435da)[_0xbd8f('0xb')](function(_0x2cc18f){logger[_0xbd8f('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0x35a18f,_0xbd8f('0xd'));logger['debug'](_0xbd8f('0xe'),_0x35a18f,_0xbd8f('0xd'),JSON['stringify'](_0x2cc18f));if(_0x2cc18f[_0xbd8f('0xf')]){if(_0x2cc18f[_0xbd8f('0xf')]['code']===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x35a18f,_0x2cc18f[_0xbd8f('0xf')][_0xbd8f('0x10')]);return _0x34e83f(_0x2cc18f[_0xbd8f('0xf')][_0xbd8f('0x10')]);}logger[_0xbd8f('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x35a18f,_0x2cc18f[_0xbd8f('0xf')][_0xbd8f('0x10')]);return _0x1da2ab(_0x2cc18f[_0xbd8f('0xf')]['message']);}else{logger['info'](_0xbd8f('0x11'),_0x35a18f,'request\x20sent');_0x1da2ab(_0x2cc18f[_0xbd8f('0x12')][_0xbd8f('0x10')]);}})[_0xbd8f('0x13')](function(_0x4ece3d){logger[_0xbd8f('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x35a18f,_0x4ece3d);_0x34e83f(_0x4ece3d);});});}exports[_0xbd8f('0x14')]=function(_0xcf50e0){var _0x4ac8bd=this;return new Promise(function(_0x1c3c2c,_0x4c7176){return db[_0xbd8f('0x15')]['create'](_0xcf50e0['body'],{'raw':_0xcf50e0[_0xbd8f('0x16')]?_0xcf50e0['options'][_0xbd8f('0x17')]===undefined?!![]:![]:!![]})[_0xbd8f('0xb')](function(_0x58faae){logger['info'](_0xbd8f('0x14'),_0xcf50e0);logger[_0xbd8f('0x18')](_0xbd8f('0x14'),_0xcf50e0,JSON['stringify'](_0x58faae));_0x1c3c2c(_0x58faae);})[_0xbd8f('0x13')](function(_0x38d697){logger['error'](_0xbd8f('0x14'),_0x38d697[_0xbd8f('0x10')],_0xcf50e0);_0x4c7176(_0x4ac8bd[_0xbd8f('0xf')](0x1f4,_0x38d697[_0xbd8f('0x10')]));});});};exports[_0xbd8f('0x19')]=function(_0x214310){var _0x28c1a1=this;return new Promise(function(_0x2209da,_0x5198e8){return db[_0xbd8f('0x15')][_0xbd8f('0x1a')](_0x214310[_0xbd8f('0x1b')],{'raw':_0x214310[_0xbd8f('0x16')]?_0x214310[_0xbd8f('0x16')][_0xbd8f('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x214310[_0xbd8f('0x16')]?_0x214310['options'][_0xbd8f('0x1c')]||null:null,'attributes':_0x214310['options']?_0x214310[_0xbd8f('0x16')][_0xbd8f('0x1d')]||null:null,'limit':_0x214310['options']?_0x214310[_0xbd8f('0x16')][_0xbd8f('0x1e')]||null:null})[_0xbd8f('0xb')](function(_0x364906){logger['info'](_0xbd8f('0x19'),_0x214310);logger['debug'](_0xbd8f('0x19'),_0x214310,JSON[_0xbd8f('0x1f')](_0x364906));_0x2209da(_0x364906);})[_0xbd8f('0x13')](function(_0x5b0092){logger['error'](_0xbd8f('0x19'),_0x5b0092[_0xbd8f('0x10')],_0x214310);_0x5198e8(_0x28c1a1['error'](0x1f4,_0x5b0092[_0xbd8f('0x10')]));});});};
\ No newline at end of file
+var _0x85d4=['limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatQueueReport,\x20%s,\x20%s','result','catch','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','UpdateChatQueueReport','where','attributes'];(function(_0x134192,_0x36adc5){var _0x3cd080=function(_0x134371){while(--_0x134371){_0x134192['push'](_0x134192['shift']());}};_0x3cd080(++_0x36adc5);}(_0x85d4,0x121));var _0x485d=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x85d4[_0x422905];return _0x33dc6c;};'use strict';var _=require(_0x485d('0x0'));var util=require(_0x485d('0x1'));var moment=require(_0x485d('0x2'));var BPromise=require(_0x485d('0x3'));var rs=require(_0x485d('0x4'));var fs=require('fs');var Redis=require(_0x485d('0x5'));var db=require(_0x485d('0x6'))['db'];var utils=require(_0x485d('0x7'));var logger=require('../../config/logger')(_0x485d('0x8'));var config=require(_0x485d('0x9'));var jayson=require(_0x485d('0xa'));var client=jayson[_0x485d('0xb')][_0x485d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2f4c45,_0x531dc9,_0x5ed9cf){return new BPromise(function(_0x1d332e,_0x4ef048){return client[_0x485d('0xd')](_0x2f4c45,_0x5ed9cf)[_0x485d('0xe')](function(_0x4cb8f6){logger[_0x485d('0xf')]('ChatQueueReport,\x20%s,\x20%s',_0x531dc9,'request\x20sent');logger[_0x485d('0x10')](_0x485d('0x11'),_0x531dc9,_0x485d('0x12'),JSON[_0x485d('0x13')](_0x4cb8f6));if(_0x4cb8f6[_0x485d('0x14')]){if(_0x4cb8f6[_0x485d('0x14')][_0x485d('0x15')]===0x1f4){logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x531dc9,_0x4cb8f6[_0x485d('0x14')][_0x485d('0x16')]);return _0x4ef048(_0x4cb8f6[_0x485d('0x14')][_0x485d('0x16')]);}logger[_0x485d('0x14')](_0x485d('0x17'),_0x531dc9,_0x4cb8f6[_0x485d('0x14')][_0x485d('0x16')]);return _0x1d332e(_0x4cb8f6['error'][_0x485d('0x16')]);}else{logger[_0x485d('0xf')](_0x485d('0x17'),_0x531dc9,'request\x20sent');_0x1d332e(_0x4cb8f6[_0x485d('0x18')][_0x485d('0x16')]);}})[_0x485d('0x19')](function(_0x4a747f){logger[_0x485d('0x14')]('ChatQueueReport,\x20%s,\x20%s',_0x531dc9,_0x4a747f);_0x4ef048(_0x4a747f);});});}exports['CreateChatQueueReport']=function(_0x11bb1c){var _0x5c6008=this;return new Promise(function(_0x8de5e5,_0x5f348c){return db[_0x485d('0x1a')][_0x485d('0x1b')](_0x11bb1c[_0x485d('0x1c')],{'raw':_0x11bb1c[_0x485d('0x1d')]?_0x11bb1c[_0x485d('0x1d')][_0x485d('0x1e')]===undefined?!![]:![]:!![]})[_0x485d('0xe')](function(_0x45e2bd){logger[_0x485d('0xf')](_0x485d('0x1f'),_0x11bb1c);logger['debug'](_0x485d('0x1f'),_0x11bb1c,JSON[_0x485d('0x13')](_0x45e2bd));_0x8de5e5(_0x45e2bd);})['catch'](function(_0x35c169){logger[_0x485d('0x14')](_0x485d('0x1f'),_0x35c169[_0x485d('0x16')],_0x11bb1c);_0x5f348c(_0x5c6008[_0x485d('0x14')](0x1f4,_0x35c169[_0x485d('0x16')]));});});};exports[_0x485d('0x20')]=function(_0x11ad29){var _0x1dc77d=this;return new Promise(function(_0x44e604,_0x54f801){return db['ChatQueueReport']['update'](_0x11ad29['body'],{'raw':_0x11ad29[_0x485d('0x1d')]?_0x11ad29[_0x485d('0x1d')][_0x485d('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11ad29[_0x485d('0x1d')]?_0x11ad29['options'][_0x485d('0x21')]||null:null,'attributes':_0x11ad29['options']?_0x11ad29[_0x485d('0x1d')][_0x485d('0x22')]||null:null,'limit':_0x11ad29[_0x485d('0x1d')]?_0x11ad29[_0x485d('0x1d')][_0x485d('0x23')]||null:null})['then'](function(_0x56a07b){logger[_0x485d('0xf')](_0x485d('0x20'),_0x11ad29);logger[_0x485d('0x10')](_0x485d('0x20'),_0x11ad29,JSON[_0x485d('0x13')](_0x56a07b));_0x44e604(_0x56a07b);})[_0x485d('0x19')](function(_0xe6884c){logger['error'](_0x485d('0x20'),_0xe6884c['message'],_0x11ad29);_0x54f801(_0x1dc77d[_0x485d('0x14')](0x1f4,_0xe6884c[_0x485d('0x16')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 79bae23..7709089 100644
--- a/server/api/chatQueueReport/index.js
+++ b/server/api/chatQueueReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x3c5a=['/describe','describe','/:id','show','create','put','update','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x50a1f6,_0x3cb02a){var _0x70d3f3=function(_0x392b9a){while(--_0x392b9a){_0x50a1f6['push'](_0x50a1f6['shift']());}};_0x70d3f3(++_0x3cb02a);}(_0x3c5a,0x109));var _0xa3c5=function(_0x16ea87,_0x378d8b){_0x16ea87=_0x16ea87-0x0;var _0x6e7b1c=_0x3c5a[_0x16ea87];return _0x6e7b1c;};'use strict';var multer=require('multer');var util=require(_0xa3c5('0x0'));var path=require('path');var timeout=require(_0xa3c5('0x1'));var express=require('express');var router=express[_0xa3c5('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xa3c5('0x3'));var interaction=require(_0xa3c5('0x4'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router[_0xa3c5('0x5')]('/',auth[_0xa3c5('0x6')](),controller['index']);router[_0xa3c5('0x5')](_0xa3c5('0x7'),auth[_0xa3c5('0x6')](),controller[_0xa3c5('0x8')]);router[_0xa3c5('0x5')](_0xa3c5('0x9'),auth[_0xa3c5('0x6')](),controller[_0xa3c5('0xa')]);router['post']('/',auth[_0xa3c5('0x6')](),controller[_0xa3c5('0xb')]);router[_0xa3c5('0xc')](_0xa3c5('0x9'),auth[_0xa3c5('0x6')](),controller[_0xa3c5('0xd')]);router[_0xa3c5('0xe')](_0xa3c5('0x9'),auth[_0xa3c5('0x6')](),controller[_0xa3c5('0xf')]);module[_0xa3c5('0x10')]=router;
\ No newline at end of file
+var _0xc214=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','/describe','describe','show','create','put','update','/:id','util'];(function(_0x5251b4,_0x31dd9c){var _0x3fc1d5=function(_0xa9650f){while(--_0xa9650f){_0x5251b4['push'](_0x5251b4['shift']());}};_0x3fc1d5(++_0x31dd9c);}(_0xc214,0x1b9));var _0x4c21=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0xc214[_0x231e16];return _0x570a7c;};'use strict';var multer=require('multer');var util=require(_0x4c21('0x0'));var path=require(_0x4c21('0x1'));var timeout=require(_0x4c21('0x2'));var express=require(_0x4c21('0x3'));var router=express[_0x4c21('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x4c21('0x5'));var interaction=require(_0x4c21('0x6'));var config=require('../../config/environment');var controller=require(_0x4c21('0x7'));router[_0x4c21('0x8')]('/',auth[_0x4c21('0x9')](),controller['index']);router[_0x4c21('0x8')](_0x4c21('0xa'),auth[_0x4c21('0x9')](),controller[_0x4c21('0xb')]);router[_0x4c21('0x8')]('/:id',auth[_0x4c21('0x9')](),controller[_0x4c21('0xc')]);router['post']('/',auth[_0x4c21('0x9')](),controller[_0x4c21('0xd')]);router[_0x4c21('0xe')]('/:id',auth[_0x4c21('0x9')](),controller[_0x4c21('0xf')]);router['delete'](_0x4c21('0x10'),auth[_0x4c21('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 525ef54..cfd2c2a 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x43bd37,_0x500e36){var _0x546999=function(_0x25885d){while(--_0x25885d){_0x43bd37['push'](_0x43bd37['shift']());}};_0x546999(++_0x500e36);}(_0xaa88,0x137));var _0x8aa8=function(_0x2abaae,_0x29fd8b){_0x2abaae=_0x2abaae-0x0;var _0x5b5745=_0xaa88[_0x2abaae];return _0x5b5745;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x1c8cc6,_0x411e5c){var _0x522936=function(_0x38d044){while(--_0x38d044){_0x1c8cc6['push'](_0x1c8cc6['shift']());}};_0x522936(++_0x411e5c);}(_0x9bde,0xe1));var _0xe9bd=function(_0x559c7e,_0x2b2694){_0x559c7e=_0x559c7e-0x0;var _0xb8ea03=_0x9bde[_0x559c7e];return _0xb8ea03;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 2b57293..f7a019c 100644
--- a/server/api/chatTransferReport/chatTransferReport.controller.js
+++ b/server/api/chatTransferReport/chatTransferReport.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5194=['filter','options','ChatTransferReport','then','includeAll','include','rows','catch','show','keys','create','body','find','params','destroy','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','lodash','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/license/util','../../mysqldb','end','json','offset','undefined','limit','count','status','Content-Range','apply','reject','save','update','sendStatus','error','name','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL'];(function(_0x571a36,_0x5936f2){var _0x4dd68e=function(_0x12d4c7){while(--_0x12d4c7){_0x571a36['push'](_0x571a36['shift']());}};_0x4dd68e(++_0x5936f2);}(_0x5194,0x173));var _0x4519=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5194[_0x8c43de];return _0xa6591b;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4519('0x0'));var jsonpatch=require(_0x4519('0x1'));var rp=require(_0x4519('0x2'));var moment=require(_0x4519('0x3'));var BPromise=require(_0x4519('0x4'));var Mustache=require(_0x4519('0x5'));var util=require(_0x4519('0x6'));var path=require(_0x4519('0x7'));var sox=require(_0x4519('0x8'));var csv=require('to-csv');var ejs=require(_0x4519('0x9'));var fs=require('fs');var fs_extra=require(_0x4519('0xa'));var _=require(_0x4519('0xb'));var squel=require(_0x4519('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4519('0xd'));var querystring=require(_0x4519('0xe'));var Papa=require(_0x4519('0xf'));var Redis=require('ioredis');var authService=require(_0x4519('0x10'));var qs=require(_0x4519('0x11'));var as=require(_0x4519('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4519('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x4519('0x14'));var db=require(_0x4519('0x15'))['db'];function respondWithStatusCode(_0x19a957,_0x41fc25){_0x41fc25=_0x41fc25||0xcc;return function(_0x2c9b8e){if(_0x2c9b8e){return _0x19a957['sendStatus'](_0x41fc25);}return _0x19a957['status'](_0x41fc25)[_0x4519('0x16')]();};}function respondWithResult(_0x1d19f4,_0x37e98a){_0x37e98a=_0x37e98a||0xc8;return function(_0xdf2815){if(_0xdf2815){return _0x1d19f4['status'](_0x37e98a)[_0x4519('0x17')](_0xdf2815);}};}function respondWithFilteredResult(_0x4ca561,_0x42468f){return function(_0x1b0fc9){if(_0x1b0fc9){var _0x51fe35=typeof _0x42468f[_0x4519('0x18')]===_0x4519('0x19')&&typeof _0x42468f[_0x4519('0x1a')]==='undefined';var _0xc10171=_0x1b0fc9['count'];var _0x447c02=_0x51fe35?0x0:_0x42468f[_0x4519('0x18')];var _0x144f42=_0x51fe35?_0x1b0fc9[_0x4519('0x1b')]:_0x42468f['offset']+_0x42468f['limit'];var _0x1cbea4;if(_0x144f42>=_0xc10171){_0x144f42=_0xc10171;_0x1cbea4=0xc8;}else{_0x1cbea4=0xce;}_0x4ca561[_0x4519('0x1c')](_0x1cbea4);return _0x4ca561['set'](_0x4519('0x1d'),_0x447c02+'-'+_0x144f42+'/'+_0xc10171)['json'](_0x1b0fc9);}return null;};}function patchUpdates(_0x2fb298){return function(_0x5a1ca3){try{jsonpatch[_0x4519('0x1e')](_0x5a1ca3,_0x2fb298,!![]);}catch(_0x2d4021){return BPromise[_0x4519('0x1f')](_0x2d4021);}return _0x5a1ca3[_0x4519('0x20')]();};}function saveUpdates(_0x1ac5ed,_0x2304a2){return function(_0x3cfef3){if(_0x3cfef3){return _0x3cfef3[_0x4519('0x21')](_0x1ac5ed)['then'](function(_0x2f9777){return _0x2f9777;});}return null;};}function removeEntity(_0x5a8a47,_0x284cce){return function(_0x2bcfe1){if(_0x2bcfe1){return _0x2bcfe1['destroy']()['then'](function(){_0x5a8a47[_0x4519('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18eb0e,_0x4cfc12){return function(_0x52b630){if(!_0x52b630){_0x18eb0e[_0x4519('0x22')](0x194);}return _0x52b630;};}function handleError(_0x53a32b,_0x4e2fe7){_0x4e2fe7=_0x4e2fe7||0x1f4;return function(_0x3865ec){logger[_0x4519('0x23')](_0x3865ec['stack']);if(_0x3865ec[_0x4519('0x24')]){delete _0x3865ec['name'];}_0x53a32b[_0x4519('0x1c')](_0x4e2fe7)['send'](_0x3865ec);};}exports['index']=function(_0x1061d5,_0x435850){var _0x2631d5={},_0x20d837={},_0x17561b={'count':0x0,'rows':[]};var _0x1cb41e=_[_0x4519('0x25')](db['ChatTransferReport']['rawAttributes'],function(_0x387b3e){return{'name':_0x387b3e[_0x4519('0x26')],'type':_0x387b3e[_0x4519('0x27')][_0x4519('0x28')]};});_0x20d837[_0x4519('0x29')]=_[_0x4519('0x25')](_0x1cb41e,_0x4519('0x24'));_0x20d837[_0x4519('0x2a')]=_['keys'](_0x1061d5[_0x4519('0x2a')]);_0x20d837[_0x4519('0x2b')]=_[_0x4519('0x2c')](_0x20d837['model'],_0x20d837[_0x4519('0x2a')]);_0x2631d5[_0x4519('0x2d')]=_[_0x4519('0x2c')](_0x20d837[_0x4519('0x29')],qs[_0x4519('0x2e')](_0x1061d5[_0x4519('0x2a')][_0x4519('0x2e')]));_0x2631d5['attributes']=_0x2631d5[_0x4519('0x2d')][_0x4519('0x2f')]?_0x2631d5[_0x4519('0x2d')]:_0x20d837[_0x4519('0x29')];if(!_0x1061d5['query'][_0x4519('0x30')](_0x4519('0x31'))){_0x2631d5[_0x4519('0x1a')]=qs[_0x4519('0x1a')](_0x1061d5[_0x4519('0x2a')][_0x4519('0x1a')]);_0x2631d5[_0x4519('0x18')]=qs['offset'](_0x1061d5[_0x4519('0x2a')][_0x4519('0x18')]);}_0x2631d5['order']=qs['sort'](_0x1061d5[_0x4519('0x2a')][_0x4519('0x32')]);_0x2631d5[_0x4519('0x33')]=qs[_0x4519('0x2b')](_[_0x4519('0x34')](_0x1061d5[_0x4519('0x2a')],_0x20d837[_0x4519('0x2b')]),_0x1cb41e);if(_0x1061d5[_0x4519('0x2a')]['filter']){_0x2631d5[_0x4519('0x33')]=_[_0x4519('0x35')](_0x2631d5[_0x4519('0x33')],{'$or':_['map'](_0x1cb41e,function(_0x2fa3c5){if(_0x2fa3c5[_0x4519('0x27')]!==_0x4519('0x36')){var _0x1ad8bb={};_0x1ad8bb[_0x2fa3c5[_0x4519('0x24')]]={'$like':'%'+_0x1061d5[_0x4519('0x2a')][_0x4519('0x37')]+'%'};return _0x1ad8bb;}})});}_0x2631d5=_['merge']({},_0x2631d5,_0x1061d5[_0x4519('0x38')]);var _0x1168c6={'where':_0x2631d5[_0x4519('0x33')]};return db[_0x4519('0x39')][_0x4519('0x1b')](_0x1168c6)[_0x4519('0x3a')](function(_0x2f0928){_0x17561b[_0x4519('0x1b')]=_0x2f0928;if(_0x1061d5[_0x4519('0x2a')][_0x4519('0x3b')]){_0x2631d5[_0x4519('0x3c')]=[{'all':!![]}];}return db[_0x4519('0x39')]['findAll'](_0x2631d5);})[_0x4519('0x3a')](function(_0x4cfbb5){_0x17561b[_0x4519('0x3d')]=_0x4cfbb5;return _0x17561b;})[_0x4519('0x3a')](respondWithFilteredResult(_0x435850,_0x2631d5))[_0x4519('0x3e')](handleError(_0x435850,null));};exports[_0x4519('0x3f')]=function(_0x39cb7d,_0x16b2fa){var _0x59a27b={'raw':!![],'where':{'id':_0x39cb7d['params']['id']}},_0x2be4b5={};_0x2be4b5[_0x4519('0x29')]=_['keys'](db[_0x4519('0x39')]['rawAttributes']);_0x2be4b5[_0x4519('0x2a')]=_[_0x4519('0x40')](_0x39cb7d['query']);_0x2be4b5[_0x4519('0x2b')]=_['intersection'](_0x2be4b5['model'],_0x2be4b5[_0x4519('0x2a')]);_0x59a27b[_0x4519('0x2d')]=_[_0x4519('0x2c')](_0x2be4b5['model'],qs['fields'](_0x39cb7d[_0x4519('0x2a')]['fields']));_0x59a27b['attributes']=_0x59a27b['attributes'][_0x4519('0x2f')]?_0x59a27b[_0x4519('0x2d')]:_0x2be4b5[_0x4519('0x29')];if(_0x39cb7d[_0x4519('0x2a')][_0x4519('0x3b')]){_0x59a27b[_0x4519('0x3c')]=[{'all':!![]}];}_0x59a27b=_['merge']({},_0x59a27b,_0x39cb7d['options']);return db[_0x4519('0x39')]['find'](_0x59a27b)['then'](handleEntityNotFound(_0x16b2fa,null))[_0x4519('0x3a')](respondWithResult(_0x16b2fa,null))[_0x4519('0x3e')](handleError(_0x16b2fa,null));};exports[_0x4519('0x41')]=function(_0x5491a6,_0x5bbca7){return db[_0x4519('0x39')][_0x4519('0x41')](_0x5491a6[_0x4519('0x42')],{})[_0x4519('0x3a')](respondWithResult(_0x5bbca7,0xc9))[_0x4519('0x3e')](handleError(_0x5bbca7,null));};exports[_0x4519('0x21')]=function(_0x4b8dac,_0x2ebca7){if(_0x4b8dac['body']['id']){delete _0x4b8dac['body']['id'];}return db[_0x4519('0x39')][_0x4519('0x43')]({'where':{'id':_0x4b8dac[_0x4519('0x44')]['id']}})['then'](handleEntityNotFound(_0x2ebca7,null))[_0x4519('0x3a')](saveUpdates(_0x4b8dac[_0x4519('0x42')],null))['then'](respondWithResult(_0x2ebca7,null))['catch'](handleError(_0x2ebca7,null));};exports[_0x4519('0x45')]=function(_0x11ec0e,_0x364bb1){return db[_0x4519('0x39')][_0x4519('0x43')]({'where':{'id':_0x11ec0e['params']['id']}})[_0x4519('0x3a')](handleEntityNotFound(_0x364bb1,null))[_0x4519('0x3a')](removeEntity(_0x364bb1,null))['catch'](handleError(_0x364bb1,null));};exports[_0x4519('0x46')]=function(_0x1b800b,_0x132b8f){return db[_0x4519('0x39')][_0x4519('0x46')]()[_0x4519('0x3a')](respondWithResult(_0x132b8f,null))[_0x4519('0x3e')](handleError(_0x132b8f,null));};
\ No newline at end of file
+var _0xe590=['to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','undefined','limit','offset','status','apply','save','update','then','stack','name','send','map','ChatTransferReport','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','catch','show','params','keys','rawAttributes','includeAll','options','find','create','body','describe','rimraf','request-promise','moment','bluebird','mustache','util','path'];(function(_0x71089a,_0x275273){var _0x28718e=function(_0x176424){while(--_0x176424){_0x71089a['push'](_0x71089a['shift']());}};_0x28718e(++_0x275273);}(_0xe590,0xce));var _0x0e59=function(_0x2e778b,_0x44be20){_0x2e778b=_0x2e778b-0x0;var _0x532e92=_0xe590[_0x2e778b];return _0x532e92;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e59('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0e59('0x1'));var moment=require(_0x0e59('0x2'));var BPromise=require(_0x0e59('0x3'));var Mustache=require(_0x0e59('0x4'));var util=require(_0x0e59('0x5'));var path=require(_0x0e59('0x6'));var sox=require('sox');var csv=require(_0x0e59('0x7'));var ejs=require(_0x0e59('0x8'));var fs=require('fs');var fs_extra=require(_0x0e59('0x9'));var _=require(_0x0e59('0xa'));var squel=require(_0x0e59('0xb'));var crypto=require(_0x0e59('0xc'));var jsforce=require(_0x0e59('0xd'));var deskjs=require(_0x0e59('0xe'));var toCsv=require(_0x0e59('0x7'));var querystring=require(_0x0e59('0xf'));var Papa=require(_0x0e59('0x10'));var Redis=require(_0x0e59('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0e59('0x12'))(_0x0e59('0x13'));var utils=require('../../config/utils');var config=require(_0x0e59('0x14'));var licenseUtil=require(_0x0e59('0x15'));var db=require(_0x0e59('0x16'))['db'];function respondWithStatusCode(_0x175143,_0x543d31){_0x543d31=_0x543d31||0xcc;return function(_0x53c9a1){if(_0x53c9a1){return _0x175143[_0x0e59('0x17')](_0x543d31);}return _0x175143['status'](_0x543d31)[_0x0e59('0x18')]();};}function respondWithResult(_0x54d7a0,_0x17b465){_0x17b465=_0x17b465||0xc8;return function(_0x4ef248){if(_0x4ef248){return _0x54d7a0['status'](_0x17b465)[_0x0e59('0x19')](_0x4ef248);}};}function respondWithFilteredResult(_0x707ba2,_0x224835){return function(_0x24db32){if(_0x24db32){var _0x632b41=typeof _0x224835['offset']===_0x0e59('0x1a')&&typeof _0x224835[_0x0e59('0x1b')]===_0x0e59('0x1a');var _0x491955=_0x24db32['count'];var _0x58bf04=_0x632b41?0x0:_0x224835[_0x0e59('0x1c')];var _0x51ad11=_0x632b41?_0x24db32['count']:_0x224835[_0x0e59('0x1c')]+_0x224835[_0x0e59('0x1b')];var _0x1596c7;if(_0x51ad11>=_0x491955){_0x51ad11=_0x491955;_0x1596c7=0xc8;}else{_0x1596c7=0xce;}_0x707ba2[_0x0e59('0x1d')](_0x1596c7);return _0x707ba2['set']('Content-Range',_0x58bf04+'-'+_0x51ad11+'/'+_0x491955)[_0x0e59('0x19')](_0x24db32);}return null;};}function patchUpdates(_0x30dc55){return function(_0x327ca0){try{jsonpatch[_0x0e59('0x1e')](_0x327ca0,_0x30dc55,!![]);}catch(_0x51353c){return BPromise['reject'](_0x51353c);}return _0x327ca0[_0x0e59('0x1f')]();};}function saveUpdates(_0x1246ad,_0x2f9266){return function(_0x22b96b){if(_0x22b96b){return _0x22b96b[_0x0e59('0x20')](_0x1246ad)['then'](function(_0x13cc01){return _0x13cc01;});}return null;};}function removeEntity(_0x492270,_0x13410c){return function(_0x53c715){if(_0x53c715){return _0x53c715['destroy']()[_0x0e59('0x21')](function(){_0x492270['status'](0xcc)[_0x0e59('0x18')]();});}};}function handleEntityNotFound(_0x2d1091,_0x50d2ab){return function(_0x43959e){if(!_0x43959e){_0x2d1091['sendStatus'](0x194);}return _0x43959e;};}function handleError(_0x2d9615,_0x539470){_0x539470=_0x539470||0x1f4;return function(_0x4b0518){logger['error'](_0x4b0518[_0x0e59('0x22')]);if(_0x4b0518[_0x0e59('0x23')]){delete _0x4b0518[_0x0e59('0x23')];}_0x2d9615['status'](_0x539470)[_0x0e59('0x24')](_0x4b0518);};}exports['index']=function(_0x5ebbfc,_0x1d4112){var _0x1c51a9={},_0x23a539={},_0x4a1608={'count':0x0,'rows':[]};var _0x2c0499=_[_0x0e59('0x25')](db[_0x0e59('0x26')]['rawAttributes'],function(_0x2fdad5){return{'name':_0x2fdad5[_0x0e59('0x27')],'type':_0x2fdad5[_0x0e59('0x28')]['key']};});_0x23a539[_0x0e59('0x29')]=_[_0x0e59('0x25')](_0x2c0499,_0x0e59('0x23'));_0x23a539[_0x0e59('0x2a')]=_['keys'](_0x5ebbfc[_0x0e59('0x2a')]);_0x23a539[_0x0e59('0x2b')]=_[_0x0e59('0x2c')](_0x23a539['model'],_0x23a539[_0x0e59('0x2a')]);_0x1c51a9[_0x0e59('0x2d')]=_[_0x0e59('0x2c')](_0x23a539['model'],qs[_0x0e59('0x2e')](_0x5ebbfc[_0x0e59('0x2a')]['fields']));_0x1c51a9[_0x0e59('0x2d')]=_0x1c51a9[_0x0e59('0x2d')][_0x0e59('0x2f')]?_0x1c51a9[_0x0e59('0x2d')]:_0x23a539['model'];if(!_0x5ebbfc[_0x0e59('0x2a')][_0x0e59('0x30')](_0x0e59('0x31'))){_0x1c51a9[_0x0e59('0x1b')]=qs['limit'](_0x5ebbfc[_0x0e59('0x2a')][_0x0e59('0x1b')]);_0x1c51a9[_0x0e59('0x1c')]=qs[_0x0e59('0x1c')](_0x5ebbfc['query'][_0x0e59('0x1c')]);}_0x1c51a9[_0x0e59('0x32')]=qs[_0x0e59('0x33')](_0x5ebbfc['query'][_0x0e59('0x33')]);_0x1c51a9[_0x0e59('0x34')]=qs[_0x0e59('0x2b')](_[_0x0e59('0x35')](_0x5ebbfc[_0x0e59('0x2a')],_0x23a539['filters']),_0x2c0499);if(_0x5ebbfc['query'][_0x0e59('0x36')]){_0x1c51a9[_0x0e59('0x34')]=_[_0x0e59('0x37')](_0x1c51a9[_0x0e59('0x34')],{'$or':_[_0x0e59('0x25')](_0x2c0499,function(_0x3b17fe){if(_0x3b17fe[_0x0e59('0x28')]!==_0x0e59('0x38')){var _0x1b5652={};_0x1b5652[_0x3b17fe[_0x0e59('0x23')]]={'$like':'%'+_0x5ebbfc[_0x0e59('0x2a')]['filter']+'%'};return _0x1b5652;}})});}_0x1c51a9=_[_0x0e59('0x37')]({},_0x1c51a9,_0x5ebbfc['options']);var _0x371f8a={'where':_0x1c51a9[_0x0e59('0x34')]};return db[_0x0e59('0x26')][_0x0e59('0x39')](_0x371f8a)[_0x0e59('0x21')](function(_0x2097a8){_0x4a1608[_0x0e59('0x39')]=_0x2097a8;if(_0x5ebbfc[_0x0e59('0x2a')]['includeAll']){_0x1c51a9[_0x0e59('0x3a')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x0e59('0x3b')](_0x1c51a9);})['then'](function(_0x2ae3c4){_0x4a1608['rows']=_0x2ae3c4;return _0x4a1608;})[_0x0e59('0x21')](respondWithFilteredResult(_0x1d4112,_0x1c51a9))[_0x0e59('0x3c')](handleError(_0x1d4112,null));};exports[_0x0e59('0x3d')]=function(_0x3bd73a,_0x42c0b0){var _0x2024ee={'raw':!![],'where':{'id':_0x3bd73a[_0x0e59('0x3e')]['id']}},_0x305525={};_0x305525[_0x0e59('0x29')]=_[_0x0e59('0x3f')](db[_0x0e59('0x26')][_0x0e59('0x40')]);_0x305525[_0x0e59('0x2a')]=_[_0x0e59('0x3f')](_0x3bd73a[_0x0e59('0x2a')]);_0x305525[_0x0e59('0x2b')]=_['intersection'](_0x305525[_0x0e59('0x29')],_0x305525['query']);_0x2024ee[_0x0e59('0x2d')]=_[_0x0e59('0x2c')](_0x305525[_0x0e59('0x29')],qs[_0x0e59('0x2e')](_0x3bd73a[_0x0e59('0x2a')][_0x0e59('0x2e')]));_0x2024ee[_0x0e59('0x2d')]=_0x2024ee[_0x0e59('0x2d')][_0x0e59('0x2f')]?_0x2024ee[_0x0e59('0x2d')]:_0x305525[_0x0e59('0x29')];if(_0x3bd73a[_0x0e59('0x2a')][_0x0e59('0x41')]){_0x2024ee[_0x0e59('0x3a')]=[{'all':!![]}];}_0x2024ee=_[_0x0e59('0x37')]({},_0x2024ee,_0x3bd73a[_0x0e59('0x42')]);return db['ChatTransferReport'][_0x0e59('0x43')](_0x2024ee)['then'](handleEntityNotFound(_0x42c0b0,null))[_0x0e59('0x21')](respondWithResult(_0x42c0b0,null))[_0x0e59('0x3c')](handleError(_0x42c0b0,null));};exports[_0x0e59('0x44')]=function(_0x34df2a,_0x1a5c8c){return db[_0x0e59('0x26')]['create'](_0x34df2a[_0x0e59('0x45')],{})['then'](respondWithResult(_0x1a5c8c,0xc9))[_0x0e59('0x3c')](handleError(_0x1a5c8c,null));};exports[_0x0e59('0x20')]=function(_0x2fe446,_0x46f385){if(_0x2fe446['body']['id']){delete _0x2fe446[_0x0e59('0x45')]['id'];}return db[_0x0e59('0x26')][_0x0e59('0x43')]({'where':{'id':_0x2fe446[_0x0e59('0x3e')]['id']}})['then'](handleEntityNotFound(_0x46f385,null))[_0x0e59('0x21')](saveUpdates(_0x2fe446[_0x0e59('0x45')],null))[_0x0e59('0x21')](respondWithResult(_0x46f385,null))[_0x0e59('0x3c')](handleError(_0x46f385,null));};exports['destroy']=function(_0x41480a,_0x21db48){return db['ChatTransferReport'][_0x0e59('0x43')]({'where':{'id':_0x41480a[_0x0e59('0x3e')]['id']}})[_0x0e59('0x21')](handleEntityNotFound(_0x21db48,null))[_0x0e59('0x21')](removeEntity(_0x21db48,null))[_0x0e59('0x3c')](handleError(_0x21db48,null));};exports[_0x0e59('0x46')]=function(_0xc9a109,_0x561fdf){return db[_0x0e59('0x26')][_0x0e59('0x46')]()['then'](respondWithResult(_0x561fdf,null))[_0x0e59('0x3c')](handleError(_0x561fdf,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 8e2214f..ccbdb8e 100644
--- a/server/api/chatTransferReport/chatTransferReport.model.js
+++ b/server/api/chatTransferReport/chatTransferReport.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbf51=['util','../../config/logger','api','bluebird','request-promise','rimraf','./chatTransferReport.attributes','define','ChatTransferReport','uniqueid','lodash'];(function(_0x22df76,_0x56676e){var _0x32eda9=function(_0x3f7c47){while(--_0x3f7c47){_0x22df76['push'](_0x22df76['shift']());}};_0x32eda9(++_0x56676e);}(_0xbf51,0xc5));var _0x1bf5=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0xbf51[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x1bf5('0x0'));var util=require(_0x1bf5('0x1'));var logger=require(_0x1bf5('0x2'))(_0x1bf5('0x3'));var moment=require('moment');var BPromise=require(_0x1bf5('0x4'));var rp=require(_0x1bf5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1bf5('0x6'));var config=require('../../config/environment');var attributes=require(_0x1bf5('0x7'));module['exports']=function(_0x532690,_0xeb0ad4){return _0x532690[_0x1bf5('0x8')](_0x1bf5('0x9'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x1bf5('0xa'),'fields':[_0x1bf5('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x3fd4=['util','../../config/logger','path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x3fd4,0xf1));var _0x43fd=function(_0x1aa428,_0x43643f){_0x1aa428=_0x1aa428-0x0;var _0x5c8d13=_0x3fd4[_0x1aa428];return _0x5c8d13;};'use strict';var _=require(_0x43fd('0x0'));var util=require(_0x43fd('0x1'));var logger=require(_0x43fd('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43fd('0x3'));var rimraf=require(_0x43fd('0x4'));var config=require('../../config/environment');var attributes=require(_0x43fd('0x5'));module[_0x43fd('0x6')]=function(_0x1f0e20,_0x33481e){return _0x1f0e20[_0x43fd('0x7')](_0x43fd('0x8'),attributes,{'tableName':_0x43fd('0x9'),'paranoid':![],'indexes':[{'name':_0x43fd('0xa'),'fields':[_0x43fd('0xa')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index a357615..e3f063f 100644
--- a/server/api/chatTransferReport/chatTransferReport.rpc.js
+++ b/server/api/chatTransferReport/chatTransferReport.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x4b6e=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4b6e,0x14a));var _0xe4b6=function(_0x2abf7f,_0x23b05a){_0x2abf7f=_0x2abf7f-0x0;var _0x248bce=_0x4b6e[_0x2abf7f];return _0x248bce;};'use strict';var _=require(_0xe4b6('0x0'));var util=require(_0xe4b6('0x1'));var moment=require(_0xe4b6('0x2'));var BPromise=require('bluebird');var rs=require(_0xe4b6('0x3'));var fs=require('fs');var Redis=require(_0xe4b6('0x4'));var db=require(_0xe4b6('0x5'))['db'];var utils=require(_0xe4b6('0x6'));var logger=require(_0xe4b6('0x7'))(_0xe4b6('0x8'));var config=require(_0xe4b6('0x9'));var jayson=require(_0xe4b6('0xa'));var client=jayson[_0xe4b6('0xb')][_0xe4b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6d42a,_0x11b109,_0x4d9492){return new BPromise(function(_0x2ab13d,_0x4798f1){return client[_0xe4b6('0xd')](_0xe6d42a,_0x4d9492)[_0xe4b6('0xe')](function(_0x50641d){logger[_0xe4b6('0xf')](_0xe4b6('0x10'),_0x11b109,_0xe4b6('0x11'));logger['debug'](_0xe4b6('0x12'),_0x11b109,'request\x20sent',JSON['stringify'](_0x50641d));if(_0x50641d[_0xe4b6('0x13')]){if(_0x50641d['error'][_0xe4b6('0x14')]===0x1f4){logger[_0xe4b6('0x13')](_0xe4b6('0x10'),_0x11b109,_0x50641d[_0xe4b6('0x13')][_0xe4b6('0x15')]);return _0x4798f1(_0x50641d[_0xe4b6('0x13')][_0xe4b6('0x15')]);}logger[_0xe4b6('0x13')](_0xe4b6('0x10'),_0x11b109,_0x50641d[_0xe4b6('0x13')][_0xe4b6('0x15')]);return _0x2ab13d(_0x50641d[_0xe4b6('0x13')][_0xe4b6('0x15')]);}else{logger[_0xe4b6('0xf')](_0xe4b6('0x10'),_0x11b109,_0xe4b6('0x11'));_0x2ab13d(_0x50641d[_0xe4b6('0x16')][_0xe4b6('0x15')]);}})[_0xe4b6('0x17')](function(_0x592bb6){logger[_0xe4b6('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x11b109,_0x592bb6);_0x4798f1(_0x592bb6);});});}
\ No newline at end of file
+var _0xb53f=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','code','error','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then'];(function(_0x551229,_0x5c98c5){var _0x41a38c=function(_0xa593e4){while(--_0xa593e4){_0x551229['push'](_0x551229['shift']());}};_0x41a38c(++_0x5c98c5);}(_0xb53f,0x195));var _0xfb53=function(_0x58bfa6,_0x3dfc0b){_0x58bfa6=_0x58bfa6-0x0;var _0x2a215b=_0xb53f[_0x58bfa6];return _0x2a215b;};'use strict';var _=require(_0xfb53('0x0'));var util=require(_0xfb53('0x1'));var moment=require(_0xfb53('0x2'));var BPromise=require(_0xfb53('0x3'));var rs=require(_0xfb53('0x4'));var fs=require('fs');var Redis=require(_0xfb53('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xfb53('0x6'));var logger=require(_0xfb53('0x7'))('rpc');var config=require(_0xfb53('0x8'));var jayson=require(_0xfb53('0x9'));var client=jayson['client'][_0xfb53('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48dddc,_0x3f3252,_0x7f71e4){return new BPromise(function(_0x1a1cc6,_0x5a0a73){return client[_0xfb53('0xb')](_0x48dddc,_0x7f71e4)[_0xfb53('0xc')](function(_0x13e46a){logger['info'](_0xfb53('0xd'),_0x3f3252,'request\x20sent');logger['debug']('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x3f3252,_0xfb53('0xe'),JSON['stringify'](_0x13e46a));if(_0x13e46a['error']){if(_0x13e46a['error'][_0xfb53('0xf')]===0x1f4){logger[_0xfb53('0x10')](_0xfb53('0xd'),_0x3f3252,_0x13e46a[_0xfb53('0x10')][_0xfb53('0x11')]);return _0x5a0a73(_0x13e46a[_0xfb53('0x10')][_0xfb53('0x11')]);}logger[_0xfb53('0x10')]('ChatTransferReport,\x20%s,\x20%s',_0x3f3252,_0x13e46a[_0xfb53('0x10')]['message']);return _0x1a1cc6(_0x13e46a[_0xfb53('0x10')][_0xfb53('0x11')]);}else{logger[_0xfb53('0x12')](_0xfb53('0xd'),_0x3f3252,_0xfb53('0xe'));_0x1a1cc6(_0x13e46a['result'][_0xfb53('0x11')]);}})['catch'](function(_0x321828){logger[_0xfb53('0x10')](_0xfb53('0xd'),_0x3f3252,_0x321828);_0x5a0a73(_0x321828);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 91d8afd..baf83e9 100644
--- a/server/api/chatTransferReport/index.js
+++ b/server/api/chatTransferReport/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8098=['destroy','exports','multer','util','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put'];(function(_0x503205,_0x2bd7df){var _0x4e328e=function(_0x2794a5){while(--_0x2794a5){_0x503205['push'](_0x503205['shift']());}};_0x4e328e(++_0x2bd7df);}(_0x8098,0x1a4));var _0x8809=function(_0x5ab878,_0x1ad99f){_0x5ab878=_0x5ab878-0x0;var _0x1c01af=_0x8098[_0x5ab878];return _0x1c01af;};'use strict';var multer=require(_0x8809('0x0'));var util=require(_0x8809('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8809('0x2'));var router=express['Router']();var fs_extra=require(_0x8809('0x3'));var auth=require(_0x8809('0x4'));var interaction=require(_0x8809('0x5'));var config=require(_0x8809('0x6'));var controller=require(_0x8809('0x7'));router[_0x8809('0x8')]('/',auth[_0x8809('0x9')](),controller[_0x8809('0xa')]);router['get'](_0x8809('0xb'),auth['isAuthenticated'](),controller[_0x8809('0xc')]);router[_0x8809('0x8')](_0x8809('0xd'),auth[_0x8809('0x9')](),controller[_0x8809('0xe')]);router[_0x8809('0xf')]('/',auth[_0x8809('0x9')](),controller['create']);router[_0x8809('0x10')](_0x8809('0xd'),auth[_0x8809('0x9')](),controller['update']);router['delete'](_0x8809('0xd'),auth[_0x8809('0x9')](),controller[_0x8809('0x11')]);module[_0x8809('0x12')]=router;
\ No newline at end of file
+var _0x433d=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated','get','/:id','post'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x433d,0x140));var _0xd433=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0x433d[_0xf91841];return _0x4b9c44;};'use strict';var multer=require(_0xd433('0x0'));var util=require(_0xd433('0x1'));var path=require('path');var timeout=require(_0xd433('0x2'));var express=require(_0xd433('0x3'));var router=express[_0xd433('0x4')]();var fs_extra=require(_0xd433('0x5'));var auth=require(_0xd433('0x6'));var interaction=require(_0xd433('0x7'));var config=require(_0xd433('0x8'));var controller=require(_0xd433('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xd433('0xa')]);router['get'](_0xd433('0xb'),auth[_0xd433('0xc')](),controller['describe']);router[_0xd433('0xd')](_0xd433('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xd433('0xf')]('/',auth[_0xd433('0xc')](),controller[_0xd433('0x10')]);router['put']('/:id',auth[_0xd433('0xc')](),controller[_0xd433('0x11')]);router[_0xd433('0x12')](_0xd433('0xe'),auth['isAuthenticated'](),controller[_0xd433('0x13')]);module[_0xd433('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 43a5555..9fc7be2 100644
--- a/server/api/chatWebsite/chatWebsite.attributes.js
+++ b/server/api/chatWebsite/chatWebsite.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9682=['System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','thumb','star','stringify','input','text','name','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','getDataValue','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa'];(function(_0x15262e,_0x30da53){var _0xdd1576=function(_0x508c5f){while(--_0x508c5f){_0x15262e['push'](_0x15262e['shift']());}};_0xdd1576(++_0x30da53);}(_0x9682,0xa6));var _0x2968=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9682[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x2968('0x0'));var rs=require('randomstring');module[_0x2968('0x1')]={'name':{'type':Sequelize[_0x2968('0x2')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x2968('0x3')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x2968('0x4')},'key':{'type':Sequelize[_0x2968('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2968('0x5')},'customerAlias':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x2968('0x2')],'allowNull':![],'defaultValue':_0x2968('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2968('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x2968('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x2968('0x2')],'allowNull':![],'defaultValue':_0x2968('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x2968('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x2968('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x2968('0xa')](_0x2968('0xb'),_0x2968('0xc')),'defaultValue':_0x2968('0xb')},'header_online':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0xd')},'start_chat_button':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x2968('0xf')},'header_offline':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize[_0x2968('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x2968('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x2968('0x10')]},'closingQuestion':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x11')},'formSubmitFailureMessage':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x12')},'noteTitle':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x13')},'closingMessageButton':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0xf')},'skipMessageButton':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x14')},'conditionAgreement':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x15')},'ratingType':{'type':Sequelize[_0x2968('0xa')]('star',_0x2968('0x16')),'defaultValue':_0x2968('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x2968('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x2968('0x10')],'defaultValue':function(){return JSON[_0x2968('0x18')]({'items':[{'type':_0x2968('0x19'),'variable':null,'config':{'placeholder':'name','type':_0x2968('0x1a'),'required':!![]},'props':{'title':_0x2968('0x1b'),'helpText':''}},{'type':_0x2968('0x19'),'props':{'title':_0x2968('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON['parse'](this['getDataValue'](_0x2968('0x1c'))):{};},'set':function(_0x56485e){return this[_0x2968('0x1d')]('onlineForm',JSON[_0x2968('0x18')](_0x56485e));}},'offlineForm':{'type':Sequelize[_0x2968('0x10')],'defaultValue':function(){return JSON[_0x2968('0x18')]({'items':[{'type':_0x2968('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x2968('0x4')},'variable':null},{'type':_0x2968('0x1e'),'config':{'placeholder':'Comments'},'props':{'title':_0x2968('0x1f'),'helpText':_0x2968('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x2968('0x21')](_0x2968('0x22'))?JSON[_0x2968('0x23')](this[_0x2968('0x21')](_0x2968('0x22'))):{};},'set':function(_0x58d138){return this[_0x2968('0x1d')]('offlineForm',JSON[_0x2968('0x18')](_0x58d138));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x2968('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x2968('0x2')]},'forwardOffline':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x2968('0x2')]},'waitingTitle':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x2968('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x27')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x28')},'skipUnmanaged':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x14')},'sendUnmanaged':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x2968('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x2968('0x2')]},'notificationTemplate':{'type':Sequelize[_0x2968('0x10')],'defaultValue':function(){return _0x2968('0x29');}},'notificationSound':{'type':Sequelize[_0x2968('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x2968('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x2968('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x2968('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x2968('0x2')],'defaultValue':_0x2968('0x2c')},'defaultTitle':{'type':Sequelize[_0x2968('0x2')]},'customerAvatar':{'type':Sequelize[_0x2968('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x2968('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x2968('0x2')],'allowNull':![],'defaultValue':_0x2968('0x2d'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2968('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2968('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x2968('0x2e')},'systemAvatar':{'type':Sequelize[_0x2968('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x2968('0x8')],'comment':_0x2968('0x2f')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x2968('0x30'),'set':function(_0xf5d5d9){if(!_0xf5d5d9)this[_0x2968('0x1d')](_0x2968('0x31'),null);this[_0x2968('0x1d')](_0x2968('0x32'),_0xf5d5d9);}},'vidaooEscalation':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x2968('0x2')]},'vidaooTopic':{'type':Sequelize[_0x2968('0x2')],'allowNull':![],'defaultValue':_0x2968('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x2968('0x34');}},'vidaooMetadata':{'type':Sequelize[_0x2968('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x2968('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x2968('0x10')]}};
\ No newline at end of file
+var _0xf1d6=['Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','star','TEXT','stringify','name','text','input','email','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','randomstring','STRING','address','Agent','#011F6A','#ffffff','BOOLEAN','rounded','Chat','Send','Contact\x20us','INTEGER','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message'];(function(_0x5ae088,_0x3753c9){var _0x6c837d=function(_0x3ce749){while(--_0x3ce749){_0x5ae088['push'](_0x5ae088['shift']());}};_0x6c837d(++_0x3753c9);}(_0xf1d6,0x1cc));var _0x6f1d=function(_0x54c916,_0x1fb338){_0x54c916=_0x54c916-0x0;var _0x332fc5=_0xf1d6[_0x54c916];return _0x332fc5;};'use strict';var Sequelize=require('sequelize');var rs=require(_0x6f1d('0x0'));module['exports']={'name':{'type':Sequelize[_0x6f1d('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x6f1d('0x2')},'description':{'type':Sequelize[_0x6f1d('0x1')]},'mapKey':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'email'},'key':{'type':Sequelize[_0x6f1d('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6f1d('0x3')},'customerAlias':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f1d('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6f1d('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x6f1d('0x1')],'allowNull':![],'defaultValue':_0x6f1d('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x6f1d('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize[_0x6f1d('0x1')]},'animation':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x6f1d('0x7'),'squared'),'defaultValue':_0x6f1d('0x7')},'header_online':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x8')},'offline_chat_button':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x9')},'header_offline':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0xa')},'download_transcript':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6f1d('0xb')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0xc')},'defaultWhiteLabel':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0xf')},'noteTitle':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x10')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6f1d('0x11')},'closingMessageButton':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x6f1d('0x13')},'ratingType':{'type':Sequelize[_0x6f1d('0x14')](_0x6f1d('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6f1d('0x16')],'defaultValue':function(){return JSON[_0x6f1d('0x17')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x6f1d('0x18'),'type':_0x6f1d('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x6f1d('0x1a'),'props':{'title':_0x6f1d('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x6f1d('0x1b'),'type':_0x6f1d('0x1b')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6f1d('0x1c')]('onlineForm')?JSON[_0x6f1d('0x1d')](this['getDataValue'](_0x6f1d('0x1e'))):{};},'set':function(_0x230421){return this[_0x6f1d('0x1f')](_0x6f1d('0x1e'),JSON[_0x6f1d('0x17')](_0x230421));}},'offlineForm':{'type':Sequelize[_0x6f1d('0x16')],'defaultValue':function(){return JSON[_0x6f1d('0x17')]({'items':[{'type':_0x6f1d('0x1a'),'props':{'title':_0x6f1d('0x1b'),'helpText':''},'config':{'required':!![],'placeholder':_0x6f1d('0x1b'),'type':_0x6f1d('0x1b')},'variable':null},{'type':_0x6f1d('0x20'),'config':{'placeholder':_0x6f1d('0x21')},'props':{'title':_0x6f1d('0x21'),'helpText':_0x6f1d('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x6f1d('0x1c')](_0x6f1d('0x23'))?JSON[_0x6f1d('0x1d')](this['getDataValue']('offlineForm')):{};},'set':function(_0x5a8b42){return this[_0x6f1d('0x1f')](_0x6f1d('0x23'),JSON[_0x6f1d('0x17')](_0x5a8b42));}},'token':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':function(){return rs[_0x6f1d('0x24')]();}},'autoclose':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6f1d('0x1')]},'forwardOffline':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6f1d('0x1')]},'waitingTitle':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x25')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x6f1d('0x26')},'offlineMessageSubject':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x27')},'offlineMessageBody':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x29')},'skipUnmanaged':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6f1d('0x16')]},'showAgentAvatar':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x6f1d('0x16')],'defaultValue':function(){return _0x6f1d('0x2a');}},'notificationSound':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6f1d('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x6f1d('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x2c')},'verticalAlignment':{'type':Sequelize[_0x6f1d('0xb')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x2d')},'messagesAlignment':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':_0x6f1d('0x2e')},'defaultTitle':{'type':Sequelize[_0x6f1d('0x1')]},'customerAvatar':{'type':Sequelize[_0x6f1d('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6f1d('0xb')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6f1d('0x2f'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6f1d('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6f1d('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6f1d('0x30')},'systemAvatar':{'type':Sequelize[_0x6f1d('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x6f1d('0xb')],'comment':_0x6f1d('0x31')},'mandatoryDisposition':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x591a98){if(!_0x591a98)this[_0x6f1d('0x1f')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x6f1d('0x32'),_0x591a98);}},'vidaooEscalation':{'type':Sequelize[_0x6f1d('0x6')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x6f1d('0x1')]},'vidaooTopic':{'type':Sequelize[_0x6f1d('0x1')],'allowNull':![],'defaultValue':_0x6f1d('0x33')},'vidaooNote':{'type':Sequelize[_0x6f1d('0x1')],'defaultValue':function(){return _0x6f1d('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x6f1d('0x16')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index e0f4696..6c76916 100644
--- a/server/api/chatWebsite/chatWebsite.controller.js
+++ b/server/api/chatWebsite/chatWebsite.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x946f=['account','applications','orderBy','asc','defaults','contact','threadId','ChatInteraction','externalUrl','ContactId','interaction','firstName','messageId','created','autoclose','unmanaged','*,*,*,*','ChatMessage','User','UserId','unshift','agent','waitForTheAssignedAgent','queueId','queue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','originalname','mimetype','server','attachments','sequelize','transaction','Attachment','bulkCreate','findOne','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','sendMail','\x22%s\x22\x20<%s>','Smtp','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','email','Chat','NotifyMailAccount','offline-chat','remove','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','getLicense','increment','chatLicenseExceeded','utf8','URL','address','3.5.0','remote','headers','x-real-ip','connection','remoteAddress','virtual','alignment','color','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','ChatApplication','findAndCountAll','priority','stack','getApplications','chatProactiveAction','addProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','querystring','html-to-text','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../errors/api','APINotFoundError','handleError','redis','localhost','socket.io-emitter','client','http','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','undefined','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','end','name','send','getSnippet','timezone','format','iftime\x20%s,%s','iftime\x20%s','interval','indexOf','true','OFFLINE','inspect','Interval','Intervals','all','some','user-agent-parser','setUA','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','lastName','browser','%s\x20%s','version','unknown','device','model','vendor','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','key','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','includeAll','include','rows','show','merge','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','params','addDisposition','ChatWebsiteId','Disposition','getDispositions','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','custom','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','isNil','server/files/images/avatars/','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','describe','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread'];(function(_0x51ad6d,_0x1096a5){var _0x1d28f1=function(_0x529b8e){while(--_0x529b8e){_0x51ad6d['push'](_0x51ad6d['shift']());}};_0x1d28f1(++_0x1096a5);}(_0x946f,0x7c));var _0xf946=function(_0x27e90c,_0x5d91b3){_0x27e90c=_0x27e90c-0x0;var _0x2510bd=_0x946f[_0x27e90c];return _0x2510bd;};'use strict';var Mustache=require(_0xf946('0x0'));var util=require(_0xf946('0x1'));var path=require(_0xf946('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var querystring=require(_0xf946('0x3'));var htmlToText=require(_0xf946('0x4'));var Redis=require(_0xf946('0x5'));var jayson=require(_0xf946('0x6'));var url=require(_0xf946('0x7'));var qs=require(_0xf946('0x8'));var logger=require(_0xf946('0x9'))('api');var config=require('../../config/environment');var APIOutOfIntervalError=require(_0xf946('0xa'))['APIOutOfIntervalError'];var APINotFoundError=require(_0xf946('0xa'))[_0xf946('0xb')];var APIHandleError=require(_0xf946('0xa'))[_0xf946('0xc')];var db=require('../../mysqldb')['db'];config[_0xf946('0xd')]=_['defaults'](config[_0xf946('0xd')],{'host':_0xf946('0xe'),'port':0x18eb});var socket=require(_0xf946('0xf'))(new Redis(config['redis']));require('./chatWebsite.socket')['register'](socket);var client=jayson[_0xf946('0x10')][_0xf946('0x11')]({'port':0x232c});var client9002=jayson[_0xf946('0x10')]['http']({'port':0x232a});var client9003=jayson[_0xf946('0x10')][_0xf946('0x11')]({'port':0x232b});var client9001=jayson[_0xf946('0x10')][_0xf946('0x11')]({'port':0x2329});function respondWithRpcPromise(_0x186ff4,_0x380275,_0x5d2f97,_0x1f369d){return new Promise(function(_0x1a67ff,_0x576ff9){var _0x542bc8=_0x1f369d||client;return _0x542bc8['request'](_0x186ff4,_0x5d2f97)[_0xf946('0x12')](function(_0x5d9c4b){logger['info'](_0xf946('0x13'),_0x380275,_0xf946('0x14'));logger[_0xf946('0x15')](_0xf946('0x16'),_0x380275,_0xf946('0x14'),JSON[_0xf946('0x17')](_0x5d9c4b));if(_0x5d9c4b[_0xf946('0x18')]){if(_0x5d9c4b[_0xf946('0x18')][_0xf946('0x19')]===0x1f4){logger[_0xf946('0x18')]('ChatWebsite,\x20%s,\x20%s',_0x380275,_0x5d9c4b['error'][_0xf946('0x1a')]);return _0x576ff9(_0x5d9c4b[_0xf946('0x18')][_0xf946('0x1a')]);}logger[_0xf946('0x18')](_0xf946('0x13'),_0x380275,_0x5d9c4b['error']['message']);return _0x1a67ff(_0x5d9c4b['error'][_0xf946('0x1a')]);}else{logger[_0xf946('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x380275,'request\x20sent');_0x1a67ff(_0x5d9c4b[_0xf946('0x1c')]['message']);}})[_0xf946('0x1d')](function(_0x475101){logger['error'](_0xf946('0x13'),_0x380275,_0x475101);_0x576ff9(_0x475101);});});}function respondWithStatusCode(_0x1352f3,_0x2519e8){_0x2519e8=_0x2519e8||0xcc;return function(_0x16afa1){if(_0x16afa1){return _0x1352f3[_0xf946('0x1e')](_0x2519e8);}return _0x1352f3[_0xf946('0x1f')](_0x2519e8)['end']();};}function respondWithResult(_0x4539e8,_0x282dbd){_0x282dbd=_0x282dbd||0xc8;return function(_0x3b53d9){if(_0x3b53d9){return _0x4539e8['status'](_0x282dbd)[_0xf946('0x20')](_0x3b53d9);}};}function respondWithFilteredResult(_0x16f203,_0x6dbe9c){return function(_0x46e377){if(_0x46e377){var _0x7a39f2=typeof _0x6dbe9c['offset']===_0xf946('0x21')&&typeof _0x6dbe9c[_0xf946('0x22')]===_0xf946('0x21');var _0x21ed78=_0x46e377['count'];var _0x22cc3b=_0x7a39f2?0x0:_0x6dbe9c['offset'];var _0x5bfce3=_0x7a39f2?_0x46e377[_0xf946('0x23')]:_0x6dbe9c[_0xf946('0x24')]+_0x6dbe9c['limit'];var _0x48af09;if(_0x5bfce3>=_0x21ed78){_0x5bfce3=_0x21ed78;_0x48af09=0xc8;}else{_0x48af09=0xce;}_0x16f203['status'](_0x48af09);return _0x16f203[_0xf946('0x25')](_0xf946('0x26'),_0x22cc3b+'-'+_0x5bfce3+'/'+_0x21ed78)[_0xf946('0x20')](_0x46e377);}return null;};}function saveUpdates(_0x281c55){return function(_0x27bfbf){if(_0x27bfbf){return _0x27bfbf[_0xf946('0x27')](_0x281c55)[_0xf946('0x12')](function(_0xd15426){return _0xd15426;});}return null;};}function removeEntity(_0x3b0428){return function(_0x4baff7){if(_0x4baff7){return _0x4baff7[_0xf946('0x28')]()['then'](function(){var _0x416459=_0x4baff7[_0xf946('0x29')]({'plain':!![]});var _0xa7feba=_0xf946('0x2a');return db[_0xf946('0x2b')][_0xf946('0x28')]({'where':{'type':_0xa7feba,'resourceId':_0x416459['id']}})[_0xf946('0x12')](function(){return _0x4baff7;});})['then'](function(){_0x3b0428[_0xf946('0x1f')](0xcc)[_0xf946('0x2c')]();});}};}function handleEntityNotFound(_0x1b987e){return function(_0x5e2c1a){if(!_0x5e2c1a){_0x1b987e['sendStatus'](0x194);}return _0x5e2c1a;};}function handleError(_0x196789,_0x229b15){_0x229b15=_0x229b15||0x1f4;return function(_0x3904ee){logger[_0xf946('0x18')](_0x3904ee['stack']);if(_0x3904ee[_0xf946('0x2d')]){delete _0x3904ee[_0xf946('0x2d')];}_0x196789[_0xf946('0x1f')](_0x229b15)[_0xf946('0x2e')](_0x3904ee);};}function iftimePromise(_0x26965b,_0x30b790){return respondWithRpcPromise('Command',_0xf946('0x2f'),{'command':_0x30b790[_0xf946('0x30')]?util[_0xf946('0x31')](_0xf946('0x32'),_0x26965b['interval'],_0x30b790['timezone']):util[_0xf946('0x31')](_0xf946('0x33'),_0x26965b[_0xf946('0x34')])},client9002)[_0xf946('0x12')](function(_0x344da8){var _0x31cc94=_0x344da8&&_0x344da8[_0xf946('0x35')](_0xf946('0x36'))>=0x0?!![]:![];logger[_0xf946('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x30b790['id'],_0x26965b['id'],_0x26965b['interval'],_0x31cc94?'ONLINE':_0xf946('0x37'),_0x30b790[_0xf946('0x30')]?_0x30b790[_0xf946('0x30')]:'No\x20timezone');return _0x31cc94;})[_0xf946('0x1d')](function(_0x544db5){logger[_0xf946('0x18')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x30b790['id'],_0x26965b['id'],_0x26965b['interval'],util[_0xf946('0x38')](_0x544db5,{'showHidden':![],'depth':null}),_0x30b790[_0xf946('0x30')]?_0x30b790[_0xf946('0x30')]:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0xd27031){var _0x556eca=_['map'](_0xd27031[_0xf946('0x39')][_0xf946('0x3a')],function(_0x277d39){var _0x55261e=_0x277d39[_0xf946('0x29')]({'plain':!![]});return iftimePromise(_0x55261e,_0xd27031);});return Promise[_0xf946('0x3b')](_0x556eca)[_0xf946('0x12')](function(_0x288087){return _[_0xf946('0x3c')](_0x288087);});}function createInteractionObject(_0x5052fd,_0x2a40bc,_0x170889,_0x41a3ae){var _0x3a7280=require(_0xf946('0x3d'));var _0xdbbb9e=new _0x3a7280();var _0x2712bc=_0xdbbb9e[_0xf946('0x3e')](_0x170889[_0xf946('0x3f')])[_0xf946('0x40')]();var _0x33e65c=_0x2a40bc['customerIp'];if(_0x170889[_0xf946('0x41')]){_0x33e65c=_0x170889['cf-connecting-ip'];}else if(_0x170889[_0xf946('0x42')]){_0x33e65c=_[_0xf946('0x43')](_0x170889[_0xf946('0x42')][_0xf946('0x44')](','));}return{'ContactId':_0x41a3ae['id'],'ChatWebsiteId':_0x5052fd,'from':(_0x41a3ae['firstName']||'')+'\x20'+(_0x41a3ae[_0xf946('0x45')]||''),'customerIp':_0x33e65c,'customerPort':_0x170889['x-real-port']?_0x170889['x-real-port']:null,'referer':_0x2a40bc['referer'],'browserName':_0x2712bc[_0xf946('0x46')]['name']&&_0x2712bc['browser']['version']?util[_0xf946('0x31')](_0xf946('0x47'),_0x2712bc[_0xf946('0x46')]['name'],_0x2712bc[_0xf946('0x46')][_0xf946('0x48')]):_0xf946('0x49'),'browserVersion':_0x2712bc[_0xf946('0x46')][_0xf946('0x48')]||'unknown','osName':util[_0xf946('0x31')](_0xf946('0x47'),_0x2712bc['os']['name'],_0x2712bc['os'][_0xf946('0x48')]),'osVersion':_0x2712bc['os'][_0xf946('0x48')],'deviceModel':_0x2712bc[_0xf946('0x4a')][_0xf946('0x4b')]&&_0x2712bc['device']['vendor']?util[_0xf946('0x31')]('%s\x20%s\x20%s',_0x2712bc[_0xf946('0x4a')]['model'],_0x2712bc[_0xf946('0x4a')][_0xf946('0x4c')],_0x2712bc['device']['type']):null,'deviceVendor':_0x2712bc[_0xf946('0x4a')]['vendor'],'deviceType':_0x2712bc[_0xf946('0x4a')]['type'],'formData':JSON[_0xf946('0x17')](_0x2a40bc)};}exports['index']=function(_0x3fdf38,_0x562d79){var _0x4b9cc5={'include':[{'model':db[_0xf946('0x4d')],'as':_0xf946('0x4e')}]},_0x32e812={},_0x4ba7ca={'count':0x0,'rows':[]};var _0x576f2b=_[_0xf946('0x4f')](db[_0xf946('0x50')][_0xf946('0x51')],function(_0x20ca96){return{'name':_0x20ca96[_0xf946('0x52')],'type':_0x20ca96['type'][_0xf946('0x53')]};});_0x32e812[_0xf946('0x4b')]=_['map'](_0x576f2b,_0xf946('0x2d'));_0x32e812['query']=_[_0xf946('0x54')](_0x3fdf38['query']);_0x32e812[_0xf946('0x55')]=_[_0xf946('0x56')](_0x32e812['model'],_0x32e812[_0xf946('0x57')]);_0x4b9cc5[_0xf946('0x58')]=_[_0xf946('0x56')](_0x32e812[_0xf946('0x4b')],qs['fields'](_0x3fdf38[_0xf946('0x57')][_0xf946('0x59')]));_0x4b9cc5[_0xf946('0x58')]=_0x4b9cc5[_0xf946('0x58')][_0xf946('0x5a')]?_0x4b9cc5[_0xf946('0x58')]:_0x32e812[_0xf946('0x4b')];if(!_0x3fdf38[_0xf946('0x57')][_0xf946('0x5b')](_0xf946('0x5c'))){_0x4b9cc5[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x3fdf38[_0xf946('0x57')][_0xf946('0x22')]);_0x4b9cc5['offset']=qs['offset'](_0x3fdf38['query'][_0xf946('0x24')]);}_0x4b9cc5[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x3fdf38[_0xf946('0x57')]['sort']);_0x4b9cc5[_0xf946('0x5f')]=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x3fdf38[_0xf946('0x57')],_0x32e812['filters']),_0x576f2b);if(_0x3fdf38['query'][_0xf946('0x61')]){_0x4b9cc5[_0xf946('0x5f')]=_['merge'](_0x4b9cc5['where'],{'$or':_['map'](_0x576f2b,function(_0x546c95){if(_0x546c95[_0xf946('0x62')]!==_0xf946('0x63')){var _0x302acd={};_0x302acd[_0x546c95[_0xf946('0x2d')]]={'$like':'%'+_0x3fdf38[_0xf946('0x57')][_0xf946('0x61')]+'%'};return _0x302acd;}})});}_0x4b9cc5=_['merge']({},_0x4b9cc5,_0x3fdf38['options']);var _0x388a58={'where':_0x4b9cc5[_0xf946('0x5f')]};return db['ChatWebsite'][_0xf946('0x23')](_0x388a58)[_0xf946('0x12')](function(_0x571189){_0x4ba7ca[_0xf946('0x23')]=_0x571189;if(_0x3fdf38['query'][_0xf946('0x64')]){_0x4b9cc5[_0xf946('0x65')]=[{'all':!![]}];}return db[_0xf946('0x50')]['findAll'](_0x4b9cc5);})[_0xf946('0x12')](function(_0x16492e){_0x4ba7ca[_0xf946('0x66')]=_0x16492e;return _0x4ba7ca;})[_0xf946('0x12')](respondWithFilteredResult(_0x562d79,_0x4b9cc5))[_0xf946('0x1d')](handleError(_0x562d79,null));};exports[_0xf946('0x67')]=function(_0x362a2e,_0x307f5c){var _0x23d760={'raw':![],'where':{'id':_0x362a2e['params']['id']},'include':[{'model':db[_0xf946('0x4d')],'as':_0xf946('0x4e')}]},_0x3f72cc={};_0x3f72cc[_0xf946('0x4b')]=_[_0xf946('0x54')](db[_0xf946('0x50')][_0xf946('0x51')]);_0x3f72cc[_0xf946('0x57')]=_[_0xf946('0x54')](_0x362a2e[_0xf946('0x57')]);_0x3f72cc[_0xf946('0x55')]=_[_0xf946('0x56')](_0x3f72cc[_0xf946('0x4b')],_0x3f72cc[_0xf946('0x57')]);_0x23d760[_0xf946('0x58')]=_['intersection'](_0x3f72cc[_0xf946('0x4b')],qs[_0xf946('0x59')](_0x362a2e[_0xf946('0x57')][_0xf946('0x59')]));_0x23d760['attributes']=_0x23d760[_0xf946('0x58')][_0xf946('0x5a')]?_0x23d760[_0xf946('0x58')]:_0x3f72cc[_0xf946('0x4b')];if(_0x362a2e[_0xf946('0x57')][_0xf946('0x64')]){_0x23d760[_0xf946('0x65')]=[{'all':!![]}];}_0x23d760=_[_0xf946('0x68')]({},_0x23d760,_0x362a2e[_0xf946('0x69')]);return db[_0xf946('0x50')][_0xf946('0x6a')](_0x23d760)['then'](handleEntityNotFound(_0x307f5c,null))[_0xf946('0x12')](respondWithResult(_0x307f5c,null))[_0xf946('0x1d')](handleError(_0x307f5c,null));};exports['create']=function(_0x2a6cf3,_0x40514f){return db[_0xf946('0x50')][_0xf946('0x6b')](_0x2a6cf3[_0xf946('0x6c')],{})[_0xf946('0x12')](function(_0x902d6b){var _0xcee220=_0x2a6cf3[_0xf946('0x6d')][_0xf946('0x29')]({'plain':!![]});if(!_0xcee220)throw new Error(_0xf946('0x6e'));if(_0xcee220[_0xf946('0x6f')]===_0xf946('0x6d')){var _0x312704=_0x902d6b[_0xf946('0x29')]({'plain':!![]});var _0x573534=_0xf946('0x2a');return db['UserProfileSection'][_0xf946('0x6a')]({'where':{'name':_0x573534,'userProfileId':_0xcee220[_0xf946('0x70')]},'raw':!![]})['then'](function(_0x33c9d3){if(_0x33c9d3&&_0x33c9d3[_0xf946('0x71')]===0x0){return db[_0xf946('0x2b')][_0xf946('0x6b')]({'name':_0x312704[_0xf946('0x2d')],'resourceId':_0x312704['id'],'type':_0x33c9d3[_0xf946('0x2d')],'sectionId':_0x33c9d3['id']},{})['then'](function(){return _0x902d6b;});}else{return _0x902d6b;}})['catch'](function(_0x58e3){logger[_0xf946('0x18')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58e3);throw _0x58e3;});}return _0x902d6b;})[_0xf946('0x12')](respondWithResult(_0x40514f,0xc9))['catch'](handleError(_0x40514f,null));};exports[_0xf946('0x27')]=function(_0x49ecea,_0x15e182){if(_0x49ecea[_0xf946('0x6c')]['id']){delete _0x49ecea[_0xf946('0x6c')]['id'];}return db[_0xf946('0x50')]['find']({'where':{'id':_0x49ecea[_0xf946('0x72')]['id']},'include':[{'model':db[_0xf946('0x4d')],'as':'mandatoryDispositionPause'}]})[_0xf946('0x12')](handleEntityNotFound(_0x15e182,null))[_0xf946('0x12')](saveUpdates(_0x49ecea['body'],null))[_0xf946('0x12')](respondWithResult(_0x15e182,null))['catch'](handleError(_0x15e182,null));};exports['destroy']=function(_0x37abc0,_0x5b35e9){return db['ChatWebsite'][_0xf946('0x6a')]({'where':{'id':_0x37abc0[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x5b35e9,null))[_0xf946('0x12')](removeEntity(_0x5b35e9,null))[_0xf946('0x1d')](handleError(_0x5b35e9,null));};exports['describe']=function(_0x3d7147,_0x257e78){return db[_0xf946('0x50')]['describe']()[_0xf946('0x12')](respondWithResult(_0x257e78,null))['catch'](handleError(_0x257e78,null));};exports[_0xf946('0x73')]=function(_0x7ec009,_0x1865fc){if(_0x7ec009['body']['id']){delete _0x7ec009['body']['id'];}return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0x7ec009['params']['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x1865fc,null))[_0xf946('0x12')](function(_0x1bf24a){if(_0x1bf24a){_0x7ec009[_0xf946('0x6c')][_0xf946('0x74')]=_0x1bf24a['id'];return db[_0xf946('0x75')][_0xf946('0x6b')](_0x7ec009[_0xf946('0x6c')]);}})[_0xf946('0x12')](respondWithResult(_0x1865fc,null))[_0xf946('0x1d')](handleError(_0x1865fc,null));};exports[_0xf946('0x76')]=function(_0x35b007,_0x13f886){var _0x54315a={'raw':![],'where':{}};var _0x33d7b9={};var _0x3b44a9={'count':0x0,'rows':[]};return db[_0xf946('0x50')]['findOne']({'where':{'id':_0x35b007[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x13f886,null))[_0xf946('0x12')](function(_0x5e9354){if(_0x5e9354){_0x33d7b9[_0xf946('0x4b')]=_[_0xf946('0x54')](db[_0xf946('0x75')][_0xf946('0x51')]);_0x33d7b9['query']=_[_0xf946('0x54')](_0x35b007['query']);_0x33d7b9[_0xf946('0x55')]=_[_0xf946('0x56')](_0x33d7b9['model'],_0x33d7b9[_0xf946('0x57')]);_0x54315a['attributes']=_[_0xf946('0x56')](_0x33d7b9[_0xf946('0x4b')],qs['fields'](_0x35b007[_0xf946('0x57')][_0xf946('0x59')]));_0x54315a[_0xf946('0x58')]=_0x54315a[_0xf946('0x58')][_0xf946('0x5a')]?_0x54315a[_0xf946('0x58')]:_0x33d7b9[_0xf946('0x4b')];if(!_0x35b007[_0xf946('0x57')][_0xf946('0x5b')](_0xf946('0x5c'))){_0x54315a['limit']=qs[_0xf946('0x22')](_0x35b007[_0xf946('0x57')][_0xf946('0x22')]);_0x54315a[_0xf946('0x24')]=qs['offset'](_0x35b007[_0xf946('0x57')][_0xf946('0x24')]);}_0x54315a[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x35b007[_0xf946('0x57')][_0xf946('0x5e')]);_0x54315a['where']=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x35b007[_0xf946('0x57')],_0x33d7b9[_0xf946('0x55')]));_0x54315a['where']['ChatWebsiteId']=_0x5e9354['id'];if(_0x35b007['query'][_0xf946('0x61')]){_0x54315a['where']=_[_0xf946('0x68')](_0x54315a[_0xf946('0x5f')],{'$or':_['map'](_0x54315a['attributes'],function(_0x88a8f){var _0x50a3f4={};_0x50a3f4[_0x88a8f]={'$like':'%'+_0x35b007[_0xf946('0x57')][_0xf946('0x61')]+'%'};return _0x50a3f4;})});}_0x54315a=_[_0xf946('0x68')]({},_0x54315a,_0x35b007[_0xf946('0x69')]);return db['Disposition'][_0xf946('0x23')]({'where':_0x54315a[_0xf946('0x5f')]})[_0xf946('0x12')](function(_0x4a8502){_0x3b44a9[_0xf946('0x23')]=_0x4a8502;if(_0x35b007[_0xf946('0x57')][_0xf946('0x64')]){_0x54315a[_0xf946('0x65')]=[{'all':!![]}];}return db[_0xf946('0x75')]['findAll'](_0x54315a);})[_0xf946('0x12')](function(_0x731301){_0x3b44a9[_0xf946('0x66')]=_0x731301;return _0x3b44a9;});}})[_0xf946('0x12')](respondWithFilteredResult(_0x13f886,_0x54315a))[_0xf946('0x1d')](handleError(_0x13f886,null));};exports[_0xf946('0x77')]=function(_0x396f08,_0x58df0c){return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0x396f08['params']['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x58df0c,null))[_0xf946('0x12')](function(_0x1cd5e5){if(_0x1cd5e5){return _0x1cd5e5['removeDispositions'](_0x396f08[_0xf946('0x57')][_0xf946('0x78')]);}})[_0xf946('0x12')](respondWithStatusCode(_0x58df0c,null))[_0xf946('0x1d')](handleError(_0x58df0c,null));};exports[_0xf946('0x79')]=function(_0xf8c437,_0x5840c2){if(_0xf8c437[_0xf946('0x6c')]['id']){delete _0xf8c437[_0xf946('0x6c')]['id'];}return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0xf8c437[_0xf946('0x72')]['id']}})['then'](handleEntityNotFound(_0x5840c2,null))['then'](function(_0x1c37dc){if(_0x1c37dc){_0xf8c437[_0xf946('0x6c')][_0xf946('0x74')]=_0x1c37dc['id'];return db[_0xf946('0x7a')][_0xf946('0x6b')](_0xf8c437[_0xf946('0x6c')]);}})['then'](respondWithResult(_0x5840c2,null))[_0xf946('0x1d')](handleError(_0x5840c2,null));};exports[_0xf946('0x7b')]=function(_0x42b6ed,_0x21f998){var _0x34a9a4={'raw':![],'where':{}};var _0x2c58f3={};var _0x7fdcd7={'count':0x0,'rows':[]};return db[_0xf946('0x50')]['findOne']({'where':{'id':_0x42b6ed[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x21f998,null))[_0xf946('0x12')](function(_0x3043f0){if(_0x3043f0){_0x2c58f3[_0xf946('0x4b')]=_['keys'](db[_0xf946('0x7a')][_0xf946('0x51')]);_0x2c58f3[_0xf946('0x57')]=_[_0xf946('0x54')](_0x42b6ed[_0xf946('0x57')]);_0x2c58f3[_0xf946('0x55')]=_[_0xf946('0x56')](_0x2c58f3[_0xf946('0x4b')],_0x2c58f3['query']);_0x34a9a4[_0xf946('0x58')]=_[_0xf946('0x56')](_0x2c58f3[_0xf946('0x4b')],qs[_0xf946('0x59')](_0x42b6ed[_0xf946('0x57')][_0xf946('0x59')]));_0x34a9a4[_0xf946('0x58')]=_0x34a9a4[_0xf946('0x58')]['length']?_0x34a9a4[_0xf946('0x58')]:_0x2c58f3[_0xf946('0x4b')];if(!_0x42b6ed[_0xf946('0x57')][_0xf946('0x5b')](_0xf946('0x5c'))){_0x34a9a4[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x42b6ed[_0xf946('0x57')][_0xf946('0x22')]);_0x34a9a4[_0xf946('0x24')]=qs[_0xf946('0x24')](_0x42b6ed[_0xf946('0x57')][_0xf946('0x24')]);}_0x34a9a4[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x42b6ed['query']['sort']);_0x34a9a4[_0xf946('0x5f')]=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x42b6ed[_0xf946('0x57')],_0x2c58f3[_0xf946('0x55')]));_0x34a9a4[_0xf946('0x5f')][_0xf946('0x74')]=_0x3043f0['id'];if(_0x42b6ed['query'][_0xf946('0x61')]){_0x34a9a4[_0xf946('0x5f')]=_[_0xf946('0x68')](_0x34a9a4[_0xf946('0x5f')],{'$or':_[_0xf946('0x4f')](_0x34a9a4[_0xf946('0x58')],function(_0x55bdf3){var _0x559f6e={};_0x559f6e[_0x55bdf3]={'$like':'%'+_0x42b6ed[_0xf946('0x57')][_0xf946('0x61')]+'%'};return _0x559f6e;})});}_0x34a9a4=_[_0xf946('0x68')]({},_0x34a9a4,_0x42b6ed[_0xf946('0x69')]);return db[_0xf946('0x7a')][_0xf946('0x23')]({'where':_0x34a9a4['where']})[_0xf946('0x12')](function(_0x1a7aa3){_0x7fdcd7[_0xf946('0x23')]=_0x1a7aa3;if(_0x42b6ed[_0xf946('0x57')][_0xf946('0x64')]){_0x34a9a4[_0xf946('0x65')]=[{'all':!![]}];}return db['CannedAnswer'][_0xf946('0x7c')](_0x34a9a4);})[_0xf946('0x12')](function(_0xcd1f02){_0x7fdcd7['rows']=_0xcd1f02;return _0x7fdcd7;});}})[_0xf946('0x12')](respondWithFilteredResult(_0x21f998,_0x34a9a4))[_0xf946('0x1d')](handleError(_0x21f998,null));};exports[_0xf946('0x7d')]=function(_0xe3a91b,_0x2f82c3){return db[_0xf946('0x50')]['find']({'where':{'id':_0xe3a91b[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x2f82c3,null))['then'](function(_0x1b91fe){if(_0x1b91fe){return _0x1b91fe[_0xf946('0x7d')](_0xe3a91b['query'][_0xf946('0x78')]);}})[_0xf946('0x12')](respondWithStatusCode(_0x2f82c3,null))[_0xf946('0x1d')](handleError(_0x2f82c3,null));};exports[_0xf946('0x7e')]=function(_0x9bb56a,_0x21293b){_0x9bb56a[_0xf946('0x6c')][_0xf946('0x7f')]=_0x9bb56a[_0xf946('0x80')][_0xf946('0x81')];return db[_0xf946('0x50')]['find']({'where':{'id':_0x9bb56a[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x21293b,null))[_0xf946('0x12')](saveUpdates(_0x9bb56a['body'],null))[_0xf946('0x12')](respondWithResult(_0x21293b,null))['catch'](handleError(_0x21293b,null));};exports[_0xf946('0x82')]=function(_0x4ada9e,_0x380843){_0x4ada9e[_0xf946('0x6c')][_0xf946('0x83')]=_0x4ada9e['file'][_0xf946('0x81')];return db['ChatWebsite'][_0xf946('0x6a')]({'where':{'id':_0x4ada9e[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x380843,null))['then'](saveUpdates(_0x4ada9e[_0xf946('0x6c')],null))[_0xf946('0x12')](respondWithResult(_0x380843,null))[_0xf946('0x1d')](handleError(_0x380843,null));};exports['addCustomerAvatar']=function(_0x443f4a,_0x2d50da){_0x443f4a[_0xf946('0x6c')][_0xf946('0x84')]=_0x443f4a[_0xf946('0x80')]['filename'];return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0x443f4a[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x2d50da,null))['then'](saveUpdates(_0x443f4a['body'],null))[_0xf946('0x12')](respondWithResult(_0x2d50da,null))[_0xf946('0x1d')](handleError(_0x2d50da,null));};exports[_0xf946('0x85')]=function(_0x993429,_0x2428af){_0x993429['body'][_0xf946('0x86')]=_0x993429[_0xf946('0x80')][_0xf946('0x81')];return db['ChatWebsite'][_0xf946('0x6a')]({'where':{'id':_0x993429[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x2428af,null))[_0xf946('0x12')](saveUpdates(_0x993429['body'],null))[_0xf946('0x12')](respondWithResult(_0x2428af,null))[_0xf946('0x1d')](handleError(_0x2428af,null));};exports[_0xf946('0x87')]=function(_0x501159,_0x5e837e){var _0xf293e9=path[_0xf946('0x88')](config[_0xf946('0x89')],'server/files/images/logos/default_logo.svg');var _0x1c39db={'where':{'id':_0x501159[_0xf946('0x72')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x2c3bd5=![];return require(_0xf946('0x8a'))['getLicense']()['then'](function(_0x30d300){if(_0x30d300){_0x2c3bd5=_0x30d300[_0xf946('0x8b')];}})[_0xf946('0x12')](function(){return db[_0xf946('0x50')]['find'](_0x1c39db);})['then'](handleEntityNotFound(_0x5e837e,null))[_0xf946('0x12')](function(_0x1f45f7){if(_0x1f45f7){if(!_['isNil'](_0x1f45f7[_0xf946('0x7f')])){if(fs[_0xf946('0x8c')](path['join'](config[_0xf946('0x89')],'server/files/images/logos/',_0x1f45f7['sitepic']))&&_0x2c3bd5){_0xf293e9=path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0x8d'),_0x1f45f7[_0xf946('0x7f')]);}}return _0x5e837e['download'](_0xf293e9);}})[_0xf946('0x1d')](handleError(_0x5e837e,null));};exports[_0xf946('0x8e')]=function(_0x4ecc1b,_0x2ab23a){var _0x4ca273=path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0x8f'));var _0x37cbff={'where':{'id':_0x4ecc1b[_0xf946('0x72')]['id']},'attributes':['id',_0xf946('0x83')],'raw':!![]};return db[_0xf946('0x50')]['find'](_0x37cbff)['then'](handleEntityNotFound(_0x2ab23a,null))[_0xf946('0x12')](function(_0x9182d5){if(_0x9182d5){if(!_[_0xf946('0x90')](_0x9182d5[_0xf946('0x83')])){if(fs[_0xf946('0x8c')](path[_0xf946('0x88')](config['root'],'server/files/images/avatars/',_0x9182d5[_0xf946('0x83')]))){_0x4ca273=path[_0xf946('0x88')](config['root'],_0xf946('0x91'),_0x9182d5[_0xf946('0x83')]);}}return _0x2ab23a[_0xf946('0x92')](_0x4ca273);}})['catch'](handleError(_0x2ab23a,null));};exports[_0xf946('0x93')]=function(_0x26d15e,_0x2611a2){var _0x106a9d=path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0x94'));var _0x3d4ffc={'where':{'id':_0x26d15e[_0xf946('0x72')]['id']},'attributes':['id',_0xf946('0x84'),_0xf946('0x95')],'raw':!![]};return db[_0xf946('0x50')][_0xf946('0x6a')](_0x3d4ffc)['then'](handleEntityNotFound(_0x2611a2,null))[_0xf946('0x12')](function(_0xf9ee52){if(_0xf9ee52){if(!_[_0xf946('0x90')](_0xf9ee52[_0xf946('0x84')])){if(fs[_0xf946('0x8c')](path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0x91'),_0xf9ee52[_0xf946('0x84')]))&&_0xf9ee52[_0xf946('0x95')]){_0x106a9d=path[_0xf946('0x88')](config['root'],_0xf946('0x91'),_0xf9ee52[_0xf946('0x84')]);}}return _0x2611a2[_0xf946('0x92')](_0x106a9d);}})[_0xf946('0x1d')](handleError(_0x2611a2,null));};exports['getSystemAvatar']=function(_0x52faca,_0x1cef30){var _0xfe5998=path['join'](config['root'],_0xf946('0x96'));var _0x29cac2={'where':{'id':_0x52faca[_0xf946('0x72')]['id']},'attributes':['id',_0xf946('0x86')],'raw':!![]};return db[_0xf946('0x50')]['find'](_0x29cac2)[_0xf946('0x12')](handleEntityNotFound(_0x1cef30,null))[_0xf946('0x12')](function(_0x2e777e){if(_0x2e777e){if(!_[_0xf946('0x90')](_0x2e777e[_0xf946('0x86')])){if(fs[_0xf946('0x8c')](path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0x91'),_0x2e777e[_0xf946('0x86')]))){_0xfe5998=path['join'](config['root'],_0xf946('0x91'),_0x2e777e[_0xf946('0x86')]);}}return _0x1cef30['download'](_0xfe5998);}})[_0xf946('0x1d')](handleError(_0x1cef30,null));};exports[_0xf946('0x97')]=function(_0x1efe28,_0x3eca39){var _0x5e734f={'body':_0x1efe28['body'],'channel':_0xf946('0x98')};var _0x4d4e3c=[];var _0x4899a2=[];var _0x4b45c4={};var _0x41639c=![];return db[_0xf946('0x99')][_0xf946('0x9a')]()['then'](function(_0x1115b0){if(!_0x1115b0){throw new db[(_0xf946('0x9b'))]['ValidationError'](_0xf946('0x9c'));}_0x4d4e3c=_[_0xf946('0x9d')](_['keys'](_0x1115b0),[_0xf946('0x9e'),'updatedAt']);_0x4899a2=_[_0xf946('0x9d')](_[_0xf946('0x54')](_0x1115b0),[_0xf946('0x9e'),_0xf946('0x9f'),_0xf946('0xa0'),_0xf946('0xa1')]);if(_0x1efe28[_0xf946('0x6c')]['id']){delete _0x1efe28['body']['id'];}if(_[_0xf946('0x90')](_0x1efe28['body'][_0xf946('0xa2')])){throw new db['Sequelize'][(_0xf946('0xa3'))](_0xf946('0xa4'));}if(_['isNil'](_0x1efe28[_0xf946('0x6c')][_0xf946('0x6c')])||_0x1efe28['body']['body']===''){throw new db[(_0xf946('0x9b'))][(_0xf946('0xa3'))](_0xf946('0xa5'));}if(_[_0xf946('0x90')](_0x1efe28['body'][_0xf946('0xa6')])){throw new db[(_0xf946('0x9b'))]['ValidationError'](_0xf946('0xa7')+_0x4899a2);}if(!_[_0xf946('0xa8')](_0x4899a2,_0x1efe28[_0xf946('0x6c')][_0xf946('0xa6')])){throw new db[(_0xf946('0x9b'))][(_0xf946('0xa3'))](_0xf946('0xa9')+_0x4899a2);}_0x4b45c4[_0x1efe28[_0xf946('0x6c')][_0xf946('0xa6')]]=_0x1efe28[_0xf946('0x6c')][_0xf946('0xa2')];})[_0xf946('0x12')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1efe28[_0xf946('0x72')]['id']},'include':[{'model':db[_0xf946('0xaa')],'as':_0xf946('0xab'),'include':[{'model':db[_0xf946('0x99')],'as':_0xf946('0xac'),'where':_0x4b45c4,'limit':0x1,'order':[['updatedAt',_0xf946('0xad')]]}]},{'model':db['ChatApplication'],'as':_0xf946('0xae')},{'model':db[_0xf946('0x39')],'as':'Interval','include':[{'model':db[_0xf946('0x39')],'as':_0xf946('0x3a'),'attributes':['id',_0xf946('0x34')],'raw':!![]}]}]});})[_0xf946('0x12')](function(_0x49f3f9){if(!_0x49f3f9)throw new APINotFoundError(util[_0xf946('0x31')](_0xf946('0xaf'),_0x1efe28[_0xf946('0x72')]['id']));if(!_0x49f3f9[_0xf946('0x39')]||!_0x49f3f9[_0xf946('0x39')][_0xf946('0x3a')])return[_0x49f3f9,!![]];return[_0x49f3f9,checkWebsiteIntervals(_0x49f3f9)];})[_0xf946('0xb0')](function(_0x2f3ca5,_0x422846){if(!_0x422846)throw new APIOutOfIntervalError();if(!_0x2f3ca5[_0xf946('0xab')])return;_0x5e734f[_0xf946('0xb1')]=_0x2f3ca5;_0x5e734f['list']=_0x2f3ca5[_0xf946('0xab')];_0x5e734f[_0xf946('0xb2')]=_[_0xf946('0xb3')](_0x2f3ca5[_0xf946('0xae')],['priority'],[_0xf946('0xb4')]);if(_0x5e734f['account'][_0xf946('0xae')]){delete _0x5e734f[_0xf946('0xb1')][_0xf946('0xae')];}if(_0x5e734f[_0xf946('0xb1')][_0xf946('0xab')]&&_0x5e734f[_0xf946('0xb1')][_0xf946('0xab')][_0xf946('0xac')]['length']){return _0x5e734f[_0xf946('0xb1')]['List'][_0xf946('0xac')][0x0];}var _0x2eb375=_[_0xf946('0xb5')](_0x1efe28[_0xf946('0x6c')],{'firstName':_0x1efe28['body'][_0xf946('0xa2')],'ListId':_0x2f3ca5[_0xf946('0xa1')]});_0x2eb375[_0x1efe28[_0xf946('0x6c')][_0xf946('0xa6')]]=_0x1efe28['body'][_0xf946('0xa2')];return db['CmContact'][_0xf946('0x6b')](_0x2eb375,{'fields':_0x4d4e3c,'raw':!![]});})[_0xf946('0x12')](function(_0x34d1a9){_0x5e734f[_0xf946('0xb6')]=_0x34d1a9;var _0x7078df=createInteractionObject(_0x1efe28[_0xf946('0x72')]['id'],_0x1efe28[_0xf946('0x6c')],_0x1efe28['headers'],_0x34d1a9);var _0x177d5b={'ChatWebsiteId':_0x1efe28[_0xf946('0x72')]['id'],'closed':![]};if(_0x1efe28[_0xf946('0x6c')][_0xf946('0xb7')]){_0x177d5b['threadId']=_0x1efe28[_0xf946('0x6c')][_0xf946('0xb7')];return db[_0xf946('0xb8')][_0xf946('0x6a')]({'where':_0x177d5b})['then'](function(_0x27eb09){if(_0x27eb09){_0x41639c=!![];return _0x27eb09;}_0x7078df['threadId']=_0x1efe28[_0xf946('0x6c')]['threadId'];_0x7078df[_0xf946('0xb9')]=_0x1efe28[_0xf946('0x6c')][_0xf946('0xb9')];return db['ChatInteraction'][_0xf946('0x6b')](_0x7078df);});}_0x177d5b[_0xf946('0xba')]=_0x34d1a9['id'];if(_0x1efe28[_0xf946('0x6c')][_0xf946('0xbb')]&&_0x1efe28[_0xf946('0x6c')][_0xf946('0xbb')]['id']){_0x177d5b['id']=_0x1efe28[_0xf946('0x6c')][_0xf946('0xbb')]['id'];return db['ChatInteraction'][_0xf946('0x6a')]({'where':_0x177d5b})[_0xf946('0x12')](function(_0x71d818){if(_0x71d818){_0x41639c=!![];return _0x71d818;}return db[_0xf946('0xb8')][_0xf946('0x6b')](_0x7078df);});}return db[_0xf946('0xb8')][_0xf946('0x6b')](_0x7078df);})[_0xf946('0x12')](function(_0x512ca8){if(!_0x41639c)return _0x512ca8;var _0x335b3d={'from':(_0x5e734f[_0xf946('0xb6')][_0xf946('0xbc')]||'')+'\x20'+(_0x5e734f[_0xf946('0xb6')][_0xf946('0x45')]||'')};if(_0x1efe28[_0xf946('0x6c')][_0xf946('0xb7')]&&_0x1efe28['body']['messageId']&&_0x1efe28['body']['threadId']!=_0x1efe28[_0xf946('0x6c')]['messageId']){_0x335b3d[_0xf946('0xb7')]=_0x1efe28[_0xf946('0x6c')][_0xf946('0xbd')];}return _0x512ca8['update'](_0x335b3d);})[_0xf946('0x12')](function(_0x262ec3){_0x5e734f[_0xf946('0xbb')]=_0x262ec3[_0xf946('0x29')]({'plain':!![]});_0x5e734f[_0xf946('0xbb')][_0xf946('0xbe')]=!_0x41639c;if(_0x5e734f[_0xf946('0xbb')]['created']){if(_0x5e734f[_0xf946('0xb1')][_0xf946('0xbf')]){_0x5e734f[_0xf946('0xb2')]['push']({'id':0x0,'priority':_0x5e734f[_0xf946('0xb2')][_0xf946('0x5a')]+0x1,'app':'close','appdata':_0xf946('0xc0'),'interval':_0xf946('0xc1')});}}return db[_0xf946('0xc2')][_0xf946('0x6b')]({'body':_0x1efe28[_0xf946('0x6c')][_0xf946('0x6c')],'ChatWebsiteId':_0x1efe28['params']['id'],'ChatInteractionId':_0x262ec3['id'],'direction':'in','ContactId':_0x5e734f['contact']['id'],'AttachmentId':_0x1efe28[_0xf946('0x6c')]['AttachmentId']});})[_0xf946('0x12')](function(_0x14e616){_0x5e734f['message']=_0x14e616;if(!_0x5e734f[_0xf946('0xbb')]['UserId']){return;}return db[_0xf946('0xc3')][_0xf946('0x6a')]({'attributes':['id',_0xf946('0x2d')],'where':{'id':_0x5e734f[_0xf946('0xbb')][_0xf946('0xc4')]}});})[_0xf946('0x12')](function(_0x238bea){if(_0x238bea){_0x5e734f[_0xf946('0xb2')][_0xf946('0xc5')]({'id':0x0,'priority':0x0,'app':_0xf946('0xc6'),'appdata':_0x238bea[_0xf946('0x2d')]+','+(_0x5e734f[_0xf946('0xb1')][_0xf946('0xc7')]||0xa),'interval':_0xf946('0xc1')});_0x5e734f['forcedOwnership']=!![];}if(!_0x5e734f['interaction'][_0xf946('0xc8')]){return;}return db['ChatQueue'][_0xf946('0x6a')]({'attributes':['id',_0xf946('0x2d')],'where':{'id':_0x5e734f[_0xf946('0xbb')][_0xf946('0xc8')]}});})[_0xf946('0x12')](function(_0x2a52d0){if(_0x2a52d0){_0x5e734f[_0xf946('0xb2')]['unshift']({'id':0x0,'priority':0x1,'app':_0xf946('0xc9'),'appdata':_0x2a52d0[_0xf946('0x2d')]+','+(_0x5e734f[_0xf946('0xb1')][_0xf946('0xca')]||0x12c),'interval':_0xf946('0xc1')});}return respondWithRpcPromise(_0xf946('0xcb'),_0xf946('0xcc'),_0x5e734f);})[_0xf946('0x12')](function(_0xb42079){respondWithRpcPromise('EventManager',_0xf946('0xcd'),{'event':'notify','message':_0xb42079},client9002);return _0xb42079;})[_0xf946('0x12')](respondWithResult(_0x3eca39,null))[_0xf946('0x1d')](APIHandleError(_0x3eca39));};exports[_0xf946('0xce')]=function(_0x1d2abd,_0x34c997){var _0x41fc11,_0x3c04b4,_0x1f852c;var _0x312495=[];var _0x283934={};var _0x5baaa3=_0x1d2abd[_0xf946('0xcf')]||[];var _0x1c4db2=[];var _0x1bb8dc;return db['CmContact'][_0xf946('0x9a')]()['then'](function(_0x4e9d36){if(!_0x4e9d36){throw new db[(_0xf946('0x9b'))]['ValidationError']('no\x20available\x20attributes');}_0x312495=_[_0xf946('0x9d')](_[_0xf946('0x54')](_0x4e9d36),['createdAt',_0xf946('0x9f'),_0xf946('0xa0'),_0xf946('0xa1')]);if(_0x1d2abd['body']['id']){delete _0x1d2abd[_0xf946('0x6c')]['id'];}if(_[_0xf946('0x90')](_0x1d2abd[_0xf946('0x6c')][_0xf946('0xa2')])){throw _0x34c997['status'](0x1f4)[_0xf946('0x2e')](new db['Sequelize'][(_0xf946('0xa3'))]('from\x20is\x20mandatory'));}if(_[_0xf946('0x90')](_0x1d2abd['body'][_0xf946('0x6c')])||_0x1d2abd['body']['body']===''){throw _0x34c997[_0xf946('0x1f')](0x1f4)[_0xf946('0x2e')](new db[(_0xf946('0x9b'))]['ValidationError'](_0xf946('0xa5')));}if(_[_0xf946('0x90')](_0x1d2abd[_0xf946('0x6c')]['mapKeyOffline'])){throw _0x34c997[_0xf946('0x1f')](0x1f4)['send'](new db[(_0xf946('0x9b'))]['ValidationError'](_0xf946('0xd0')+_0x312495));}if(!_['includes'](_0x312495,_0x1d2abd['body']['mapKeyOffline'])){throw _0x34c997[_0xf946('0x1f')](0x1f4)['send'](new db[(_0xf946('0x9b'))][(_0xf946('0xa3'))](_0xf946('0xd1')+_0x312495));}_0x283934[_0x1d2abd[_0xf946('0x6c')][_0xf946('0xd2')]]=_0x1d2abd[_0xf946('0x6c')][_0xf946('0xa2')];})[_0xf946('0x12')](function(){return db['ChatWebsite'][_0xf946('0x6a')]({'where':{'id':_0x1d2abd[_0xf946('0x72')]['id']},'include':[{'model':db[_0xf946('0xaa')],'as':'List'},{'model':db[_0xf946('0xd3')],'as':_0xf946('0xd3')}]});})[_0xf946('0x12')](handleEntityNotFound(_0x34c997,null))[_0xf946('0x12')](function(_0x3b8613){if(_0x3b8613&&_0x3b8613[_0xf946('0xab')]){_0x3c04b4=_0x3b8613;var _0x50ba84=_[_0xf946('0xb5')](_0x1d2abd['body'],{'firstName':_0x1d2abd['body'][_0xf946('0xa2')],'phone':_0x1d2abd[_0xf946('0x6c')][_0xf946('0xa2')],'ListId':_0x3b8613[_0xf946('0xa1')]});_0x50ba84[_0x1d2abd[_0xf946('0x6c')][_0xf946('0xd2')]]=_0x1d2abd['body'][_0xf946('0xa2')];return db[_0xf946('0x99')][_0xf946('0xd4')]({'where':_0x283934,'defaults':_0x50ba84});}})[_0xf946('0xb0')](function(_0x14d26b){if(_0x14d26b){_0x1f852c=_0x14d26b;var _0x2ba746=fs[_0xf946('0xd5')](path['join'](config['root'],_0xf946('0xd6')),'utf8');var _0x286067=ejs[_0xf946('0xd7')](_0x2ba746,{'body':_[_0xf946('0xd8')](_0x1d2abd[_0xf946('0x6c')][_0xf946('0x6c')]),'bodyTitle':_0x3c04b4['offlineMessageBody']});return db['ChatOfflineMessage']['create']({'body':_0x286067,'plainBody':htmlToText['fromString'](_0x286067),'ContactId':_0x14d26b['id'],'ChatWebsiteId':_0x3c04b4['id']});}})['then'](function(_0x2f85fa){_0x1bb8dc=_0x2f85fa;if(_0x5baaa3[_0xf946('0x5a')]){var _0x2a8a8c=_0x5baaa3[_0xf946('0x4f')](function(_0x4dfcf5){return{'name':_0x4dfcf5[_0xf946('0xd9')],'basename':_0x4dfcf5['filename'],'type':_0x4dfcf5[_0xf946('0xda')],'ChatOfflineMessageId':_0x2f85fa['id']};});_0x1c4db2=_0x2a8a8c['map'](_0x35f4d4=>{var _0x398d61={'filename':_0x35f4d4[_0xf946('0x2d')],'path':path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0xdb'),_0xf946('0xcf'),_0xf946('0xdc'),'offline-chat',_0x35f4d4['basename'])};return _0x398d61;});if(!_0x3c04b4['openNewInteraction']){return db[_0xf946('0xdd')][_0xf946('0xde')](function(_0x44de7b){return db[_0xf946('0xdf')][_0xf946('0xe0')](_0x2a8a8c,{'transaction':_0x44de7b});});}}})[_0xf946('0x12')](function(){if(_0x1bb8dc){_0x41fc11=_0x1bb8dc;return db[_0xf946('0xd3')][_0xf946('0xe1')]({'where':{'service':!![]},'include':[{'model':db[_0xf946('0xe2')],'as':'Smtp','raw':!![],'include':[{'model':db[_0xf946('0xe3')],'as':_0xf946('0xe3'),'raw':!![]}]}]});}})[_0xf946('0x12')](function(_0x255382){if(_0x255382&&_0x255382['Smtp']&&_0x3c04b4[_0xf946('0xe4')]&&_0x3c04b4[_0xf946('0xe5')]){var _0x3c2f57=_0x255382['getSmtpOptions']();return respondWithRpcPromise('SendMail',_0xf946('0xe6'),{'account':_0x3c2f57,'message':{'from':util[_0xf946('0x31')](_0xf946('0xe7'),_0x255382['name'],_0x255382['email']||_0x255382[_0xf946('0xe8')][_0xf946('0x6d')]),'to':_0x3c04b4['forwardOfflineAddress'],'subject':_0x3c04b4[_0xf946('0xe9')],'html':_0x41fc11[_0xf946('0x6c')],'attachments':_0x1c4db2}},client9003)[_0xf946('0x12')](function(){return _0x41fc11;})[_0xf946('0x1d')](function(_0x455263){logger[_0xf946('0x18')](_0x455263);});}})[_0xf946('0x12')](function(){if(_0x3c04b4&&_0x3c04b4['openNewInteraction']&&_0x3c04b4[_0xf946('0xea')]){var _0x1a4f6f=[];if(_0x5baaa3[_0xf946('0x5a')]){_0x1a4f6f=_0x5baaa3[_0xf946('0x4f')](function(_0x5298a5){return{'name':_0x5298a5[_0xf946('0xd9')],'basename':_0x5298a5[_0xf946('0x81')],'type':_0x5298a5['mimetype'],'ChatOfflineMessageId':_0x1bb8dc['id']};});}var _0x2bf776;if(!_[_0xf946('0x90')](_0x3c04b4[_0xf946('0xeb')])){var _0x54e9c6=_[_0xf946('0x4f')](_0x1d2abd[_0xf946('0x6c')],function(_0x5ea64f){return _0x5ea64f;});var _0x4a42fb=_[_0xf946('0xec')](_0x54e9c6)[0x0];var _0x2f3201=_['mapValues'](_0x4a42fb,function(_0x307d98){return _0x307d98;});_0x2bf776=_0x2f3201[0x1][_0x3c04b4['subjectOffline']];}var _0x3ba675={'from':_0x1f852c['email'],'firstName':_0x1f852c[_0xf946('0xbc')],'lastName':_0x1f852c[_0xf946('0x45')],'mapKey':'email','message':{'from':_0x1f852c[_0xf946('0xed')],'to':_0x3c04b4[_0xf946('0xd3')][_0xf946('0xed')],'cc':'','subject':_['isNil'](_0x2bf776)?_0x3c04b4[_0xf946('0xe9')]:_0x2bf776,'messageId':'','sentAt':new Date(),'attach':_0x1a4f6f[_0xf946('0x5a')],'attachments':_0x1a4f6f,'originChannel':_0xf946('0xee'),'ChatWebsiteId':_0x3c04b4['id'],'ChatOfflineMessageId':_0x41fc11['id'],'originTo':_0x3c04b4[_0xf946('0xd3')][_0xf946('0xed')]},'body':_0x41fc11[_0xf946('0x6c')]};var _0x3f517={'account':{'id':_0x3c04b4[_0xf946('0xea')]},'body':_0x3ba675,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0xf946('0xef'),'notifyMail',_0x3f517,client9001)['then'](function(){return _0x41fc11;})[_0xf946('0x1d')](function(_0xbd7d17){logger[_0xf946('0x18')](_0xbd7d17);});}return;})[_0xf946('0x12')](function(){if(_0x41fc11){return _0x41fc11;}})['then'](respondWithResult(_0x34c997,null))[_0xf946('0x1d')](function(){for(var _0x5d3d93 of _0x5baaa3){var _0x52bfa5=path[_0xf946('0x88')](config[_0xf946('0x89')],_0xf946('0xdb'),_0xf946('0xcf'),_0xf946('0xdc'),_0xf946('0xf0'),_0x5d3d93[_0xf946('0x81')]);fs_extra[_0xf946('0xf1')](_0x52bfa5)[_0xf946('0x1d')](function(_0x3a79ed){logger['error']('Could\x20not\x20remove\x20attachment\x20file',_0x52bfa5,_0x3a79ed);});}});};exports[_0xf946('0xf2')]=function(_0x534bcc,_0x1d3d3d){return db['ChatInteraction']['find']({'where':{'id':_0x534bcc[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x1d3d3d,null))[_0xf946('0x12')](function(_0x534caf){if(_0x534caf){return _0x534caf[_0xf946('0xf2')](_0x534bcc[_0xf946('0x6c')][_0xf946('0x78')],_[_0xf946('0xf3')](_0x534bcc['body'],[_0xf946('0x78'),'id'])||{});}})[_0xf946('0x12')](respondWithResult(_0x1d3d3d,null))[_0xf946('0x1d')](handleError(_0x1d3d3d,null));};exports[_0xf946('0xf4')]=function(_0x17d065,_0x43985){var _0x2d20c1={'raw':![],'where':{}};var _0x354414={};var _0x505834={'count':0x0,'rows':[]};return db[_0xf946('0x50')][_0xf946('0xe1')]({'where':{'id':_0x17d065['params']['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x43985,null))[_0xf946('0x12')](function(_0x3c0cde){if(_0x3c0cde){_0x354414[_0xf946('0x4b')]=_['keys'](db['ChatInteraction'][_0xf946('0x51')]);_0x354414[_0xf946('0x57')]=_[_0xf946('0x54')](_0x17d065['query']);_0x354414[_0xf946('0x55')]=_[_0xf946('0x56')](_0x354414['model'],_0x354414['query']);_0x2d20c1[_0xf946('0x58')]=_[_0xf946('0x56')](_0x354414[_0xf946('0x4b')],qs['fields'](_0x17d065[_0xf946('0x57')][_0xf946('0x59')]));_0x2d20c1[_0xf946('0x58')]=_0x2d20c1['attributes'][_0xf946('0x5a')]?_0x2d20c1['attributes']:_0x354414[_0xf946('0x4b')];if(!_0x17d065[_0xf946('0x57')][_0xf946('0x5b')](_0xf946('0x5c'))){_0x2d20c1[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x17d065[_0xf946('0x57')][_0xf946('0x22')]);_0x2d20c1[_0xf946('0x24')]=qs['offset'](_0x17d065[_0xf946('0x57')]['offset']);}_0x2d20c1[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x17d065[_0xf946('0x57')][_0xf946('0x5e')]);_0x2d20c1[_0xf946('0x5f')]=qs['filters'](_[_0xf946('0x60')](_0x17d065[_0xf946('0x57')],_0x354414[_0xf946('0x55')]));_0x2d20c1['where']['ChatWebsiteId']=_0x3c0cde['id'];if(_0x17d065['query']['filter']){_0x2d20c1['where']=_[_0xf946('0x68')](_0x2d20c1[_0xf946('0x5f')],{'$or':_['map'](_0x2d20c1[_0xf946('0x58')],function(_0x53bce0){var _0x2a5c6e={};_0x2a5c6e[_0x53bce0]={'$like':'%'+_0x17d065['query'][_0xf946('0x61')]+'%'};return _0x2a5c6e;})});}_0x2d20c1=_['merge']({},_0x2d20c1,_0x17d065[_0xf946('0x69')]);return db[_0xf946('0xb8')][_0xf946('0x23')]({'where':_0x2d20c1['where']})[_0xf946('0x12')](function(_0x5e9f48){_0x505834[_0xf946('0x23')]=_0x5e9f48;if(_0x17d065['query'][_0xf946('0x64')]){_0x2d20c1[_0xf946('0x65')]=[{'model':db[_0xf946('0x99')],'as':_0xf946('0xf5'),'required':![]},{'model':db[_0xf946('0xc3')],'as':_0xf946('0xf6'),'attributes':[_0xf946('0x2d'),_0xf946('0xf7'),_0xf946('0xf8')],'required':![]},{'model':db[_0xf946('0xf9')],'as':_0xf946('0xfa'),'attributes':['id','name','color'],'where':_0x17d065[_0xf946('0x57')][_0xf946('0xfb')]?{'id':_0x17d065['query'][_0xf946('0xfb')]}:undefined,'required':_0x17d065[_0xf946('0x57')][_0xf946('0xfb')]?!![]:![]}];}return db[_0xf946('0xb8')][_0xf946('0x7c')](_0x2d20c1);})['then'](function(_0x63e018){_0x505834[_0xf946('0x66')]=_0x63e018;return _0x505834;});}})['then'](respondWithFilteredResult(_0x43985,_0x2d20c1))[_0xf946('0x1d')](handleError(_0x43985,null));};exports[_0xf946('0x2f')]=function(_0x25a6c7,_0x114ca2){var _0x22ddf6=0x0;var _0x186e2c=0x0;var _0x3fd2f9=![];var _0x489b60;var _0x42a673;return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0x25a6c7[_0xf946('0x72')]['id']},'include':[{'model':db[_0xf946('0x39')],'as':_0xf946('0x39'),'include':[{'model':db[_0xf946('0x39')],'as':_0xf946('0x3a'),'attributes':['id',_0xf946('0x34')]}]}]})['then'](handleEntityNotFound(_0x114ca2,null))[_0xf946('0x12')](function(_0x46c4e5){if(_0x46c4e5){_0x489b60=_0x46c4e5;return _0x46c4e5['getProactiveActions']({'raw':!![]});}})[_0xf946('0x12')](function(_0x5e03d4){if(_0x489b60){if(_0x5e03d4){_0x42a673=_0x5e03d4;}}return require('../../config/license/util')[_0xf946('0xfc')]();})[_0xf946('0x12')](function(_0x5ae739){if(_0x5ae739){_0x186e2c=_0x5ae739['virtual'];_0x3fd2f9=_0x5ae739['custom'];}})[_0xf946('0x12')](function(){return db[_0xf946('0xb8')][_0xf946('0x23')]({'where':{'closed':![]}});})['then'](function(_0x4ccb23){_0x22ddf6=_0x4ccb23;if(_0x186e2c&&_0x4ccb23>_0x186e2c){return db['License'][_0xf946('0xe1')]({'where':{'id':0x1}})[_0xf946('0x12')](function(_0x22fddc){if(_0x22fddc){_0x22fddc[_0xf946('0xfd')](_0xf946('0xfe'));}});}})[_0xf946('0x12')](function(){if(!_0x489b60[_0xf946('0x39')]||!_0x489b60[_0xf946('0x39')][_0xf946('0x3a')])return!![];return checkWebsiteIntervals(_0x489b60);})[_0xf946('0x12')](function(_0x43cebe){var _0x20ab20=fs[_0xf946('0xd5')](path[_0xf946('0x88')](config[_0xf946('0x89')],'server/files/chat/iframe.ejs'),_0xf946('0xff'));var _0x2e6b2b=new url[(_0xf946('0x100'))](_0x489b60[_0xf946('0x101')])['origin'];var _0x4a41c0=_0xf946('0x102');var _0x2e1cea=![];var _0x15f8ec={'chatVersion':_0x4a41c0,'chatWebsiteAddressOrigin':_0x2e6b2b,'remote':_0x489b60[_0xf946('0x103')],'query':querystring[_0xf946('0x17')](_[_0xf946('0x68')](_0x489b60[_0xf946('0x29')]({'plain':!![]}),{'customerIp':_0x25a6c7[_0xf946('0x104')][_0xf946('0x42')]||_0x25a6c7[_0xf946('0x104')][_0xf946('0x105')]||_0x25a6c7[_0xf946('0x106')][_0xf946('0x107')]||_0x25a6c7['ip'],'referer':_0x25a6c7[_0xf946('0x104')]['referer'],'openedInteractions':_0x22ddf6,'maxInteractions':_0x186e2c,'virtual':_0x3fd2f9[_0xf946('0x108')],'online':_0x43cebe,'custom':_0x3fd2f9}))['replace'](/'/g,'\x5c\x27')};_0x114ca2[_0xf946('0x2e')](ejs[_0xf946('0xd7')](Mustache['render'](_0x20ab20,_0x15f8ec),{'proactiveActions':_0x42a673,'alignment':_0x489b60[_0xf946('0x109')],'verticalAlignment':_0x489b60['verticalAlignment'],'div_color':_0x489b60[_0xf946('0x10a')],'labelText':_0x489b60[_0xf946('0x10b')],'text_color':_0x489b60[_0xf946('0x10c')],'text_button_color':_0x489b60[_0xf946('0x10d')],'button_color':_0x489b60[_0xf946('0x10e')],'background_color':_0x489b60[_0xf946('0x10f')],'hideWhenOffline':_0x489b60[_0xf946('0x110')],'intervalId':_0x489b60[_0xf946('0x111')],'isDevelopment':_0x2e1cea,'chatVersion':_0x4a41c0}));})['catch'](handleError(_0x114ca2,null));};exports[_0xf946('0x112')]=function(_0x43e0dc,_0xbe8c52){var _0x244e74=_0x43e0dc[_0xf946('0x72')]['id'];var _0x52fbbf=_0x43e0dc['body'];var _0x7a280e=0xc8;var _0x4d4891=null;return db['sequelize'][_0xf946('0xde')]({'isolationLevel':db['sequelize'][_0xf946('0x113')][_0xf946('0x114')][_0xf946('0x115')]},function(_0xb2702a){return db[_0xf946('0x50')][_0xf946('0xe1')]({'where':{'id':_0x244e74},'transaction':_0xb2702a})[_0xf946('0x12')](function(_0x5dc834){if(_0x5dc834){return db[_0xf946('0x116')][_0xf946('0x28')]({'where':{'ChatWebsiteId':_0x244e74},'transaction':_0xb2702a})[_0xf946('0x12')](function(){var _0x249471=_[_0xf946('0x4f')](_0x52fbbf,function(_0x4d47c8){_0x4d47c8[_0xf946('0x74')]=_0x244e74;return _0x4d47c8;});return db['ChatApplication'][_0xf946('0xe0')](_0x249471,{'transaction':_0xb2702a});});}else{_0x7a280e=0x194;_0x4d4891=[];}});})[_0xf946('0x12')](function(){if(_0x7a280e!==0x194){return db['ChatApplication'][_0xf946('0x117')]({'where':{'ChatWebsiteId':_0x244e74},'order':_0xf946('0x118')})[_0xf946('0x12')](function(_0x11549d){_0x4d4891=_0x11549d;});}})['catch'](function(_0x383856){_0x7a280e=0x1f4;logger[_0xf946('0x18')](_0x383856[_0xf946('0x119')]);if(_0x383856[_0xf946('0x2d')]){delete _0x383856['name'];}_0x4d4891=_0x383856;})['finally'](function(){if(_0x4d4891===null){_0xbe8c52['sendStatus'](_0x7a280e);}else{if(_0x7a280e===0x1f4){_0xbe8c52[_0xf946('0x1f')](_0x7a280e)[_0xf946('0x2e')](_0x4d4891);}else{_0xbe8c52[_0xf946('0x1f')](_0x7a280e)[_0xf946('0x20')](_0x4d4891);}}});};exports['getApplications']=function(_0x4c9c12,_0x4c3905){var _0x49dcac={};var _0x2e5f48={};var _0x913394;var _0x47179d;return db[_0xf946('0x50')][_0xf946('0xe1')]({'where':{'id':_0x4c9c12[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x4c3905,null))[_0xf946('0x12')](function(_0x40fd7b){if(_0x40fd7b){_0x913394=_0x40fd7b;_0x2e5f48[_0xf946('0x4b')]=_['keys'](db[_0xf946('0x116')][_0xf946('0x51')]);_0x2e5f48[_0xf946('0x57')]=_[_0xf946('0x54')](_0x4c9c12[_0xf946('0x57')]);_0x2e5f48[_0xf946('0x55')]=_['intersection'](_0x2e5f48[_0xf946('0x4b')],_0x2e5f48['query']);_0x49dcac[_0xf946('0x58')]=_[_0xf946('0x56')](_0x2e5f48['model'],qs[_0xf946('0x59')](_0x4c9c12[_0xf946('0x57')][_0xf946('0x59')]));_0x49dcac[_0xf946('0x58')]=_0x49dcac[_0xf946('0x58')][_0xf946('0x5a')]?_0x49dcac[_0xf946('0x58')]:_0x2e5f48[_0xf946('0x4b')];_0x49dcac[_0xf946('0x5d')]=qs['sort'](_0x4c9c12[_0xf946('0x57')][_0xf946('0x5e')]);_0x49dcac[_0xf946('0x5f')]=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x4c9c12[_0xf946('0x57')],_0x2e5f48[_0xf946('0x55')]));if(_0x4c9c12[_0xf946('0x57')]['filter']){_0x49dcac['where']=_[_0xf946('0x68')](_0x49dcac[_0xf946('0x5f')],{'$or':_[_0xf946('0x4f')](_0x49dcac[_0xf946('0x58')],function(_0x54e13d){var _0x3046a4={};_0x3046a4[_0x54e13d]={'$like':'%'+_0x4c9c12[_0xf946('0x57')][_0xf946('0x61')]+'%'};return _0x3046a4;})});}_0x49dcac=_[_0xf946('0x68')]({},_0x49dcac,_0x4c9c12[_0xf946('0x69')]);return _0x913394[_0xf946('0x11a')](_0x49dcac);}})[_0xf946('0x12')](function(_0x9866bc){if(_0x9866bc){_0x47179d=_0x9866bc[_0xf946('0x5a')];if(!_0x4c9c12['query'][_0xf946('0x5b')](_0xf946('0x5c'))){_0x49dcac[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x4c9c12[_0xf946('0x57')][_0xf946('0x22')]);_0x49dcac['offset']=qs[_0xf946('0x24')](_0x4c9c12['query'][_0xf946('0x24')]);}return _0x913394[_0xf946('0x11a')](_0x49dcac);}})[_0xf946('0x12')](function(_0x36fb6f){if(_0x36fb6f){return _0x36fb6f?{'count':_0x47179d,'rows':_0x36fb6f}:null;}})[_0xf946('0x12')](respondWithResult(_0x4c3905,null))[_0xf946('0x1d')](handleError(_0x4c3905,null));};exports['addProactiveActions']=function(_0x59d486,_0x317660){return db[_0xf946('0x11b')][_0xf946('0x6a')]({'where':{'id':_0x59d486[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x317660,null))['then'](function(_0x4df85e){if(_0x4df85e){return _0x4df85e[_0xf946('0x11c')](_0x59d486['body'][_0xf946('0x78')],_[_0xf946('0xf3')](_0x59d486[_0xf946('0x6c')],[_0xf946('0x78'),'id'])||{});}})[_0xf946('0x12')](respondWithResult(_0x317660,null))['catch'](handleError(_0x317660,null));};exports['getProactiveActions']=function(_0x49f9ab,_0x45f150){var _0x13a1ff={};var _0xffafa6={};var _0x5c0dad;var _0x185792;return db[_0xf946('0x50')]['findOne']({'where':{'id':_0x49f9ab[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x45f150,null))['then'](function(_0xfd4977){if(_0xfd4977){_0x5c0dad=_0xfd4977;_0xffafa6[_0xf946('0x4b')]=_[_0xf946('0x54')](db[_0xf946('0x11d')][_0xf946('0x51')]);_0xffafa6['query']=_[_0xf946('0x54')](_0x49f9ab[_0xf946('0x57')]);_0xffafa6['filters']=_['intersection'](_0xffafa6[_0xf946('0x4b')],_0xffafa6[_0xf946('0x57')]);_0x13a1ff[_0xf946('0x58')]=_[_0xf946('0x56')](_0xffafa6['model'],qs[_0xf946('0x59')](_0x49f9ab['query'][_0xf946('0x59')]));_0x13a1ff['attributes']=_0x13a1ff[_0xf946('0x58')][_0xf946('0x5a')]?_0x13a1ff[_0xf946('0x58')]:_0xffafa6[_0xf946('0x4b')];_0x13a1ff[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x49f9ab[_0xf946('0x57')][_0xf946('0x5e')]);_0x13a1ff[_0xf946('0x5f')]=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x49f9ab['query'],_0xffafa6[_0xf946('0x55')]));if(_0x49f9ab[_0xf946('0x57')][_0xf946('0x61')]){_0x13a1ff[_0xf946('0x5f')]=_['merge'](_0x13a1ff['where'],{'$or':_['map'](_0x13a1ff[_0xf946('0x58')],function(_0x193051){var _0x721712={};_0x721712[_0x193051]={'$like':'%'+_0x49f9ab['query']['filter']+'%'};return _0x721712;})});}_0x13a1ff=_['merge']({},_0x13a1ff,_0x49f9ab[_0xf946('0x69')]);return _0x5c0dad['getProactiveActions'](_0x13a1ff);}})[_0xf946('0x12')](function(_0x295e7d){if(_0x295e7d){_0x185792=_0x295e7d[_0xf946('0x5a')];if(!_0x49f9ab[_0xf946('0x57')][_0xf946('0x5b')](_0xf946('0x5c'))){_0x13a1ff[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x49f9ab[_0xf946('0x57')]['limit']);_0x13a1ff[_0xf946('0x24')]=qs[_0xf946('0x24')](_0x49f9ab[_0xf946('0x57')][_0xf946('0x24')]);}return _0x5c0dad['getProactiveActions'](_0x13a1ff);}})[_0xf946('0x12')](function(_0x4fe9b8){if(_0x4fe9b8){return _0x4fe9b8?{'count':_0x185792,'rows':_0x4fe9b8}:null;}})[_0xf946('0x12')](respondWithResult(_0x45f150,null))[_0xf946('0x1d')](handleError(_0x45f150,null));};exports['getFields']=function(_0x1c9a6c,_0x18db1d){var _0x2225a9=_0x1c9a6c['query'][_0xf946('0x11e')]===_0xf946('0x11f')?_0xf946('0x120'):_0xf946('0x121');return db['ChatWebsite']['find']({'attributes':['id',_0x2225a9],'where':{'id':_0x1c9a6c[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x18db1d,null))[_0xf946('0x12')](function(_0x53cf4a){if(_0x53cf4a){var _0x49db16=_0x53cf4a[_0x2225a9];var _0x537962=_0x49db16&&_0x49db16[_0xf946('0x122')]?_0x49db16['items']:[];_0x18db1d[_0xf946('0x2e')]({'fromKey':_[_0xf946('0x90')](_0x49db16[_0xf946('0x123')])?undefined:_0x49db16[_0xf946('0x123')],'count':_0x537962[_0xf946('0x5a')],'rows':_0x537962});}})[_0xf946('0x1d')](handleError(_0x18db1d,null));};exports[_0xf946('0x124')]=function(_0x5770f9,_0x4d0e12){var _0x1fa156={'raw':![],'where':{}};var _0x888bcd={};var _0x1739a8={'count':0x0,'rows':[]};return db[_0xf946('0x50')][_0xf946('0xe1')]({'where':{'id':_0x5770f9[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x4d0e12,null))['then'](function(_0x7cba72){if(_0x7cba72){_0x888bcd[_0xf946('0x4b')]=_['keys'](db[_0xf946('0x125')]['rawAttributes']);_0x888bcd['query']=_[_0xf946('0x54')](_0x5770f9[_0xf946('0x57')]);_0x888bcd[_0xf946('0x55')]=_[_0xf946('0x56')](_0x888bcd['model'],_0x888bcd[_0xf946('0x57')]);_0x1fa156[_0xf946('0x58')]=_[_0xf946('0x56')](_0x888bcd[_0xf946('0x4b')],qs[_0xf946('0x59')](_0x5770f9[_0xf946('0x57')][_0xf946('0x59')]));_0x1fa156[_0xf946('0x58')]=_0x1fa156[_0xf946('0x58')]['length']?_0x1fa156[_0xf946('0x58')]:_0x888bcd[_0xf946('0x4b')];if(!_0x5770f9[_0xf946('0x57')][_0xf946('0x5b')](_0xf946('0x5c'))){_0x1fa156[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x5770f9[_0xf946('0x57')][_0xf946('0x22')]);_0x1fa156[_0xf946('0x24')]=qs[_0xf946('0x24')](_0x5770f9[_0xf946('0x57')][_0xf946('0x24')]);}_0x1fa156[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x5770f9[_0xf946('0x57')][_0xf946('0x5e')]);_0x1fa156[_0xf946('0x5f')]=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x5770f9[_0xf946('0x57')],_0x888bcd[_0xf946('0x55')]));_0x1fa156[_0xf946('0x5f')]['ChatWebsiteId']=_0x7cba72['id'];if(_0x5770f9['query'][_0xf946('0x61')]){_0x1fa156['where']=_[_0xf946('0x68')](_0x1fa156[_0xf946('0x5f')],{'$or':_['map'](_0x1fa156[_0xf946('0x58')],function(_0x229c9f){var _0x31b5af={};_0x31b5af[_0x229c9f]={'$like':'%'+_0x5770f9[_0xf946('0x57')][_0xf946('0x61')]+'%'};return _0x31b5af;})});}_0x1fa156=_[_0xf946('0x68')]({},_0x1fa156,_0x5770f9[_0xf946('0x69')]);return db[_0xf946('0x125')][_0xf946('0x23')]({'where':_0x1fa156[_0xf946('0x5f')]})[_0xf946('0x12')](function(_0x30cd1e){_0x1739a8[_0xf946('0x23')]=_0x30cd1e;if(_0x5770f9[_0xf946('0x57')][_0xf946('0x64')]){_0x1fa156['include']=[{'all':!![]}];}else{_0x1fa156[_0xf946('0x65')]=[{'model':db[_0xf946('0x99')],'as':_0xf946('0xf5'),'required':![]},{'model':db[_0xf946('0xdf')],'as':'Attachments','required':![]}];}return db[_0xf946('0x125')][_0xf946('0x7c')](_0x1fa156);})[_0xf946('0x12')](function(_0x162ad2){_0x1739a8[_0xf946('0x66')]=_0x162ad2;return _0x1739a8;});}})[_0xf946('0x12')](respondWithFilteredResult(_0x4d0e12,_0x1fa156))['catch'](handleError(_0x4d0e12,null));};exports[_0xf946('0x126')]=function(_0x410900,_0x356976){return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0x410900[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x356976,null))[_0xf946('0x12')](function(_0x354275){if(_0x354275){return _0x354275['addAgents'](_0x410900[_0xf946('0x6c')][_0xf946('0x78')],_[_0xf946('0xf3')](_0x410900[_0xf946('0x6c')],[_0xf946('0x78'),'id'])||{})[_0xf946('0xb0')](function(_0x5d5f0e){for(var _0x42234e=0x0;_0x42234e<_0x410900[_0xf946('0x6c')][_0xf946('0x78')][_0xf946('0x5a')];_0x42234e+=0x1){socket[_0xf946('0x127')](_0xf946('0x128'),{'UserId':Number(_0x410900[_0xf946('0x6c')][_0xf946('0x78')][_0x42234e]),'ChatWebsiteId':Number(_0x410900[_0xf946('0x72')]['id'])});}return _0x5d5f0e;});}})[_0xf946('0x12')](respondWithResult(_0x356976,null))[_0xf946('0x1d')](handleError(_0x356976,null));};exports[_0xf946('0x129')]=function(_0x51cb65,_0x467cdd){return db[_0xf946('0x50')][_0xf946('0x6a')]({'where':{'id':_0x51cb65[_0xf946('0x72')]['id']}})['then'](handleEntityNotFound(_0x467cdd,null))[_0xf946('0x12')](function(_0x3680fa){if(_0x3680fa){return _0x3680fa[_0xf946('0x129')](_0x51cb65['query']['ids'])[_0xf946('0x12')](function(){if(_[_0xf946('0x12a')](_0x51cb65[_0xf946('0x57')][_0xf946('0x78')])){for(var _0x59306f=0x0;_0x59306f<_0x51cb65['query']['ids'][_0xf946('0x5a')];_0x59306f+=0x1){socket[_0xf946('0x127')](_0xf946('0x12b'),{'UserId':Number(_0x51cb65[_0xf946('0x57')][_0xf946('0x78')][_0x59306f]),'ChatWebsiteId':Number(_0x51cb65[_0xf946('0x72')]['id'])});}}else{socket[_0xf946('0x127')]('userChatWebsite:remove',{'UserId':Number(_0x51cb65[_0xf946('0x57')][_0xf946('0x78')]),'ChatWebsiteId':Number(_0x51cb65[_0xf946('0x72')]['id'])});}});}})[_0xf946('0x12')](respondWithStatusCode(_0x467cdd,null))[_0xf946('0x1d')](handleError(_0x467cdd,null));};exports['getAgents']=function(_0x2360ea,_0x1d92c3){var _0x411124={};var _0x4efd41={};var _0x4d00a5;var _0x79c392;return db[_0xf946('0x50')][_0xf946('0xe1')]({'where':{'id':_0x2360ea[_0xf946('0x72')]['id']}})[_0xf946('0x12')](handleEntityNotFound(_0x1d92c3,null))[_0xf946('0x12')](function(_0x42a61f){if(_0x42a61f){_0x4d00a5=_0x42a61f;_0x4efd41[_0xf946('0x4b')]=_[_0xf946('0x54')](db['User'][_0xf946('0x51')]);_0x4efd41[_0xf946('0x57')]=_['keys'](_0x2360ea[_0xf946('0x57')]);_0x4efd41[_0xf946('0x55')]=_[_0xf946('0x56')](_0x4efd41['model'],_0x4efd41[_0xf946('0x57')]);_0x411124[_0xf946('0x58')]=_[_0xf946('0x56')](_0x4efd41[_0xf946('0x4b')],qs[_0xf946('0x59')](_0x2360ea[_0xf946('0x57')][_0xf946('0x59')]));_0x411124[_0xf946('0x58')]=_0x411124[_0xf946('0x58')][_0xf946('0x5a')]?_0x411124['attributes']:_0x4efd41['model'];_0x411124[_0xf946('0x5d')]=qs[_0xf946('0x5e')](_0x2360ea[_0xf946('0x57')]['sort']);_0x411124['where']=qs[_0xf946('0x55')](_[_0xf946('0x60')](_0x2360ea[_0xf946('0x57')],_0x4efd41[_0xf946('0x55')]));if(_0x2360ea[_0xf946('0x57')][_0xf946('0x61')]){_0x411124['where']=_[_0xf946('0x68')](_0x411124['where'],{'$or':_[_0xf946('0x4f')](_0x411124[_0xf946('0x58')],function(_0x543c5d){var _0xb7b34d={};_0xb7b34d[_0x543c5d]={'$like':'%'+_0x2360ea[_0xf946('0x57')][_0xf946('0x61')]+'%'};return _0xb7b34d;})});}_0x411124=_[_0xf946('0x68')]({},_0x411124,_0x2360ea[_0xf946('0x69')]);return _0x4d00a5[_0xf946('0x12c')](_0x411124);}})[_0xf946('0x12')](function(_0x1fb179){if(_0x1fb179){_0x79c392=_0x1fb179[_0xf946('0x5a')];if(!_0x2360ea[_0xf946('0x57')][_0xf946('0x5b')]('nolimit')){_0x411124[_0xf946('0x22')]=qs[_0xf946('0x22')](_0x2360ea[_0xf946('0x57')][_0xf946('0x22')]);_0x411124[_0xf946('0x24')]=qs['offset'](_0x2360ea[_0xf946('0x57')][_0xf946('0x24')]);}return _0x4d00a5['getAgents'](_0x411124);}})[_0xf946('0x12')](function(_0x28c21a){if(_0x28c21a){return _0x28c21a?{'count':_0x79c392,'rows':_0x28c21a}:null;}})[_0xf946('0x12')](respondWithResult(_0x1d92c3,null))[_0xf946('0x1d')](handleError(_0x1d92c3,null));};
\ No newline at end of file
+var _0x97a8=['ids','addLogo','filename','agentAvatar','file','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','custom','isNil','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','asc','Contacts','headers','threadId','externalUrl','ChatInteraction','ContactId','interaction','contact','lastName','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','waitForTheAssignedAgent','queueId','ChatQueue','queue','waitForTheAssignedQueue','startRouting','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','files','basename','transaction','Attachment','bulkCreate','MailAccount','MailServerOut','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','Smtp','user','offlineMessageSubject','subjectOffline','toPairsIn','email','MailAccountId','NotifyMailAccount','attachments','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','getProactiveActions','getLicense','virtual','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','origin','3.5.0','remote','x-real-ip','connection','remoteAddress','referer','replace','render','alignment','labelText','textButtonColor','color_button','backgroundColor','IntervalId','sequelize','Transaction','findAndCountAll','priority','json','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','mustache','util','ejs','fs-extra','querystring','ioredis','jayson/promise','url','../../components/parsers/qs','../../config/logger','../../config/environment','../../errors/api','APIOutOfIntervalError','APINotFoundError','handleError','redis','defaults','localhost','./chatWebsite.socket','client','http','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','offset','limit','count','status','set','then','destroy','ChatWebsites','stack','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','map','Interval','Intervals','get','all','some','user-agent-parser','user-agent','getResult','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','browser','version','%s\x20%s','unknown','device','vendor','type','index','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','query','keys','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','findAll','rows','show','Pause','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','UserProfileResource','update','params','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','length','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers'];(function(_0x6beff7,_0x5432ed){var _0x2489fd=function(_0x595ee8){while(--_0x595ee8){_0x6beff7['push'](_0x6beff7['shift']());}};_0x2489fd(++_0x5432ed);}(_0x97a8,0x1df));var _0x897a=function(_0x36b9a6,_0x264956){_0x36b9a6=_0x36b9a6-0x0;var _0x3177a9=_0x97a8[_0x36b9a6];return _0x3177a9;};'use strict';var Mustache=require(_0x897a('0x0'));var util=require(_0x897a('0x1'));var path=require('path');var ejs=require(_0x897a('0x2'));var fs=require('fs');var fs_extra=require(_0x897a('0x3'));var _=require('lodash');var querystring=require(_0x897a('0x4'));var htmlToText=require('html-to-text');var Redis=require(_0x897a('0x5'));var jayson=require(_0x897a('0x6'));var url=require(_0x897a('0x7'));var qs=require(_0x897a('0x8'));var logger=require(_0x897a('0x9'))('api');var config=require(_0x897a('0xa'));var APIOutOfIntervalError=require(_0x897a('0xb'))[_0x897a('0xc')];var APINotFoundError=require(_0x897a('0xb'))[_0x897a('0xd')];var APIHandleError=require(_0x897a('0xb'))[_0x897a('0xe')];var db=require('../../mysqldb')['db'];config[_0x897a('0xf')]=_[_0x897a('0x10')](config['redis'],{'host':_0x897a('0x11'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x897a('0xf')]));require(_0x897a('0x12'))['register'](socket);var client=jayson[_0x897a('0x13')][_0x897a('0x14')]({'port':0x232c});var client9002=jayson[_0x897a('0x13')][_0x897a('0x14')]({'port':0x232a});var client9003=jayson['client'][_0x897a('0x14')]({'port':0x232b});var client9001=jayson[_0x897a('0x13')][_0x897a('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x29f282,_0x449ea2,_0x2d9b60,_0x48f7cf){return new Promise(function(_0x23018e,_0x1eeb2a){var _0x148b08=_0x48f7cf||client;return _0x148b08['request'](_0x29f282,_0x2d9b60)['then'](function(_0x35dd46){logger[_0x897a('0x15')](_0x897a('0x16'),_0x449ea2,_0x897a('0x17'));logger['debug'](_0x897a('0x18'),_0x449ea2,_0x897a('0x17'),JSON[_0x897a('0x19')](_0x35dd46));if(_0x35dd46[_0x897a('0x1a')]){if(_0x35dd46[_0x897a('0x1a')][_0x897a('0x1b')]===0x1f4){logger['error'](_0x897a('0x16'),_0x449ea2,_0x35dd46[_0x897a('0x1a')][_0x897a('0x1c')]);return _0x1eeb2a(_0x35dd46[_0x897a('0x1a')]['message']);}logger[_0x897a('0x1a')]('ChatWebsite,\x20%s,\x20%s',_0x449ea2,_0x35dd46[_0x897a('0x1a')][_0x897a('0x1c')]);return _0x23018e(_0x35dd46[_0x897a('0x1a')][_0x897a('0x1c')]);}else{logger[_0x897a('0x15')](_0x897a('0x16'),_0x449ea2,_0x897a('0x17'));_0x23018e(_0x35dd46['result'][_0x897a('0x1c')]);}})[_0x897a('0x1d')](function(_0x3de768){logger[_0x897a('0x1a')](_0x897a('0x16'),_0x449ea2,_0x3de768);_0x1eeb2a(_0x3de768);});});}function respondWithStatusCode(_0x3a60f2,_0x1ea766){_0x1ea766=_0x1ea766||0xcc;return function(_0x17f449){if(_0x17f449){return _0x3a60f2[_0x897a('0x1e')](_0x1ea766);}return _0x3a60f2['status'](_0x1ea766)[_0x897a('0x1f')]();};}function respondWithResult(_0x444f80,_0x557281){_0x557281=_0x557281||0xc8;return function(_0x4be4ff){if(_0x4be4ff){return _0x444f80['status'](_0x557281)['json'](_0x4be4ff);}};}function respondWithFilteredResult(_0xc9d7b6,_0x4e5b43){return function(_0x5d8673){if(_0x5d8673){var _0x302cb8=typeof _0x4e5b43[_0x897a('0x20')]==='undefined'&&typeof _0x4e5b43[_0x897a('0x21')]==='undefined';var _0x254ed3=_0x5d8673[_0x897a('0x22')];var _0x32704a=_0x302cb8?0x0:_0x4e5b43[_0x897a('0x20')];var _0x4d65e9=_0x302cb8?_0x5d8673[_0x897a('0x22')]:_0x4e5b43[_0x897a('0x20')]+_0x4e5b43[_0x897a('0x21')];var _0x310540;if(_0x4d65e9>=_0x254ed3){_0x4d65e9=_0x254ed3;_0x310540=0xc8;}else{_0x310540=0xce;}_0xc9d7b6[_0x897a('0x23')](_0x310540);return _0xc9d7b6[_0x897a('0x24')]('Content-Range',_0x32704a+'-'+_0x4d65e9+'/'+_0x254ed3)['json'](_0x5d8673);}return null;};}function saveUpdates(_0x355b12){return function(_0x4d4282){if(_0x4d4282){return _0x4d4282['update'](_0x355b12)[_0x897a('0x25')](function(_0x2c7ec9){return _0x2c7ec9;});}return null;};}function removeEntity(_0x300346){return function(_0x2cc06e){if(_0x2cc06e){return _0x2cc06e[_0x897a('0x26')]()[_0x897a('0x25')](function(){var _0x46de45=_0x2cc06e['get']({'plain':!![]});var _0x4e61e7=_0x897a('0x27');return db['UserProfileResource'][_0x897a('0x26')]({'where':{'type':_0x4e61e7,'resourceId':_0x46de45['id']}})['then'](function(){return _0x2cc06e;});})[_0x897a('0x25')](function(){_0x300346[_0x897a('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x236290){return function(_0x23b201){if(!_0x23b201){_0x236290[_0x897a('0x1e')](0x194);}return _0x23b201;};}function handleError(_0x18f61d,_0x771280){_0x771280=_0x771280||0x1f4;return function(_0x52de93){logger[_0x897a('0x1a')](_0x52de93[_0x897a('0x28')]);if(_0x52de93[_0x897a('0x29')]){delete _0x52de93[_0x897a('0x29')];}_0x18f61d[_0x897a('0x23')](_0x771280)[_0x897a('0x2a')](_0x52de93);};}function iftimePromise(_0x2ce145,_0x17b4b7){return respondWithRpcPromise(_0x897a('0x2b'),_0x897a('0x2c'),{'command':_0x17b4b7[_0x897a('0x2d')]?util[_0x897a('0x2e')](_0x897a('0x2f'),_0x2ce145[_0x897a('0x30')],_0x17b4b7[_0x897a('0x2d')]):util[_0x897a('0x2e')](_0x897a('0x31'),_0x2ce145[_0x897a('0x30')])},client9002)[_0x897a('0x25')](function(_0x246791){var _0x5a608d=_0x246791&&_0x246791[_0x897a('0x32')]('true')>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x17b4b7['id'],_0x2ce145['id'],_0x2ce145[_0x897a('0x30')],_0x5a608d?_0x897a('0x33'):'OFFLINE',_0x17b4b7[_0x897a('0x2d')]?_0x17b4b7[_0x897a('0x2d')]:_0x897a('0x34'));return _0x5a608d;})['catch'](function(_0xfa3444){logger['error'](_0x897a('0x35'),_0x17b4b7['id'],_0x2ce145['id'],_0x2ce145[_0x897a('0x30')],util[_0x897a('0x36')](_0xfa3444,{'showHidden':![],'depth':null}),_0x17b4b7[_0x897a('0x2d')]?_0x17b4b7['timezone']:_0x897a('0x34'));return![];});}function checkWebsiteIntervals(_0x227157){var _0x20b668=_[_0x897a('0x37')](_0x227157[_0x897a('0x38')][_0x897a('0x39')],function(_0x3f24a7){var _0x17ff7f=_0x3f24a7[_0x897a('0x3a')]({'plain':!![]});return iftimePromise(_0x17ff7f,_0x227157);});return Promise[_0x897a('0x3b')](_0x20b668)[_0x897a('0x25')](function(_0x38052c){return _[_0x897a('0x3c')](_0x38052c);});}function createInteractionObject(_0x2143a4,_0x55425a,_0x84a770,_0x2f448c){var _0x40e8ca=require(_0x897a('0x3d'));var _0x33688c=new _0x40e8ca();var _0x46b652=_0x33688c['setUA'](_0x84a770[_0x897a('0x3e')])[_0x897a('0x3f')]();var _0x14ebc6=_0x55425a['customerIp'];if(_0x84a770['cf-connecting-ip']){_0x14ebc6=_0x84a770[_0x897a('0x40')];}else if(_0x84a770[_0x897a('0x41')]){_0x14ebc6=_[_0x897a('0x42')](_0x84a770[_0x897a('0x41')][_0x897a('0x43')](','));}return{'ContactId':_0x2f448c['id'],'ChatWebsiteId':_0x2143a4,'from':(_0x2f448c[_0x897a('0x44')]||'')+'\x20'+(_0x2f448c['lastName']||''),'customerIp':_0x14ebc6,'customerPort':_0x84a770[_0x897a('0x45')]?_0x84a770[_0x897a('0x45')]:null,'referer':_0x55425a['referer'],'browserName':_0x46b652[_0x897a('0x46')][_0x897a('0x29')]&&_0x46b652[_0x897a('0x46')][_0x897a('0x47')]?util[_0x897a('0x2e')](_0x897a('0x48'),_0x46b652['browser'][_0x897a('0x29')],_0x46b652[_0x897a('0x46')][_0x897a('0x47')]):_0x897a('0x49'),'browserVersion':_0x46b652[_0x897a('0x46')]['version']||'unknown','osName':util[_0x897a('0x2e')]('%s\x20%s',_0x46b652['os'][_0x897a('0x29')],_0x46b652['os'][_0x897a('0x47')]),'osVersion':_0x46b652['os'][_0x897a('0x47')],'deviceModel':_0x46b652['device']['model']&&_0x46b652[_0x897a('0x4a')][_0x897a('0x4b')]?util[_0x897a('0x2e')]('%s\x20%s\x20%s',_0x46b652[_0x897a('0x4a')]['model'],_0x46b652[_0x897a('0x4a')][_0x897a('0x4b')],_0x46b652[_0x897a('0x4a')][_0x897a('0x4c')]):null,'deviceVendor':_0x46b652[_0x897a('0x4a')][_0x897a('0x4b')],'deviceType':_0x46b652['device'][_0x897a('0x4c')],'formData':JSON[_0x897a('0x19')](_0x55425a)};}exports[_0x897a('0x4d')]=function(_0x54d134,_0x1c123b){var _0x2af123={'include':[{'model':db['Pause'],'as':_0x897a('0x4e')}]},_0x254cc0={},_0x57f20f={'count':0x0,'rows':[]};var _0x3fb463=_[_0x897a('0x37')](db[_0x897a('0x4f')][_0x897a('0x50')],function(_0x3c3932){return{'name':_0x3c3932[_0x897a('0x51')],'type':_0x3c3932[_0x897a('0x4c')]['key']};});_0x254cc0['model']=_[_0x897a('0x37')](_0x3fb463,_0x897a('0x29'));_0x254cc0[_0x897a('0x52')]=_[_0x897a('0x53')](_0x54d134[_0x897a('0x52')]);_0x254cc0[_0x897a('0x54')]=_[_0x897a('0x55')](_0x254cc0['model'],_0x254cc0[_0x897a('0x52')]);_0x2af123[_0x897a('0x56')]=_[_0x897a('0x55')](_0x254cc0[_0x897a('0x57')],qs[_0x897a('0x58')](_0x54d134[_0x897a('0x52')][_0x897a('0x58')]));_0x2af123[_0x897a('0x56')]=_0x2af123[_0x897a('0x56')]['length']?_0x2af123[_0x897a('0x56')]:_0x254cc0[_0x897a('0x57')];if(!_0x54d134[_0x897a('0x52')][_0x897a('0x59')](_0x897a('0x5a'))){_0x2af123['limit']=qs['limit'](_0x54d134['query'][_0x897a('0x21')]);_0x2af123[_0x897a('0x20')]=qs[_0x897a('0x20')](_0x54d134[_0x897a('0x52')]['offset']);}_0x2af123[_0x897a('0x5b')]=qs[_0x897a('0x5c')](_0x54d134['query'][_0x897a('0x5c')]);_0x2af123[_0x897a('0x5d')]=qs['filters'](_[_0x897a('0x5e')](_0x54d134['query'],_0x254cc0[_0x897a('0x54')]),_0x3fb463);if(_0x54d134[_0x897a('0x52')]['filter']){_0x2af123[_0x897a('0x5d')]=_[_0x897a('0x5f')](_0x2af123[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x3fb463,function(_0x5f5a2f){if(_0x5f5a2f[_0x897a('0x4c')]!==_0x897a('0x60')){var _0x557a46={};_0x557a46[_0x5f5a2f['name']]={'$like':'%'+_0x54d134['query'][_0x897a('0x61')]+'%'};return _0x557a46;}})});}_0x2af123=_[_0x897a('0x5f')]({},_0x2af123,_0x54d134[_0x897a('0x62')]);var _0x29c33c={'where':_0x2af123[_0x897a('0x5d')]};return db[_0x897a('0x4f')]['count'](_0x29c33c)[_0x897a('0x25')](function(_0x2d200f){_0x57f20f[_0x897a('0x22')]=_0x2d200f;if(_0x54d134[_0x897a('0x52')]['includeAll']){_0x2af123['include']=[{'all':!![]}];}return db[_0x897a('0x4f')][_0x897a('0x63')](_0x2af123);})[_0x897a('0x25')](function(_0x523bf7){_0x57f20f[_0x897a('0x64')]=_0x523bf7;return _0x57f20f;})['then'](respondWithFilteredResult(_0x1c123b,_0x2af123))[_0x897a('0x1d')](handleError(_0x1c123b,null));};exports[_0x897a('0x65')]=function(_0x531aaf,_0x5a659c){var _0x26a329={'raw':![],'where':{'id':_0x531aaf['params']['id']},'include':[{'model':db[_0x897a('0x66')],'as':_0x897a('0x4e')}]},_0x42e7b2={};_0x42e7b2['model']=_[_0x897a('0x53')](db['ChatWebsite'][_0x897a('0x50')]);_0x42e7b2[_0x897a('0x52')]=_[_0x897a('0x53')](_0x531aaf[_0x897a('0x52')]);_0x42e7b2[_0x897a('0x54')]=_[_0x897a('0x55')](_0x42e7b2[_0x897a('0x57')],_0x42e7b2[_0x897a('0x52')]);_0x26a329[_0x897a('0x56')]=_[_0x897a('0x55')](_0x42e7b2['model'],qs['fields'](_0x531aaf[_0x897a('0x52')][_0x897a('0x58')]));_0x26a329['attributes']=_0x26a329[_0x897a('0x56')]['length']?_0x26a329[_0x897a('0x56')]:_0x42e7b2['model'];if(_0x531aaf[_0x897a('0x52')][_0x897a('0x67')]){_0x26a329[_0x897a('0x68')]=[{'all':!![]}];}_0x26a329=_['merge']({},_0x26a329,_0x531aaf[_0x897a('0x62')]);return db[_0x897a('0x4f')]['find'](_0x26a329)[_0x897a('0x25')](handleEntityNotFound(_0x5a659c,null))[_0x897a('0x25')](respondWithResult(_0x5a659c,null))[_0x897a('0x1d')](handleError(_0x5a659c,null));};exports[_0x897a('0x69')]=function(_0x507fc2,_0x5a11f5){return db[_0x897a('0x4f')][_0x897a('0x69')](_0x507fc2[_0x897a('0x6a')],{})[_0x897a('0x25')](function(_0x543a0a){var _0x265a31=_0x507fc2['user'][_0x897a('0x3a')]({'plain':!![]});if(!_0x265a31)throw new Error(_0x897a('0x6b'));if(_0x265a31[_0x897a('0x6c')]==='user'){var _0x233327=_0x543a0a[_0x897a('0x3a')]({'plain':!![]});var _0x56e7e4='ChatWebsites';return db['UserProfileSection'][_0x897a('0x6d')]({'where':{'name':_0x56e7e4,'userProfileId':_0x265a31[_0x897a('0x6e')]},'raw':!![]})[_0x897a('0x25')](function(_0x5a0134){if(_0x5a0134&&_0x5a0134[_0x897a('0x6f')]===0x0){return db[_0x897a('0x70')][_0x897a('0x69')]({'name':_0x233327[_0x897a('0x29')],'resourceId':_0x233327['id'],'type':_0x5a0134[_0x897a('0x29')],'sectionId':_0x5a0134['id']},{})[_0x897a('0x25')](function(){return _0x543a0a;});}else{return _0x543a0a;}})[_0x897a('0x1d')](function(_0x32e98e){logger[_0x897a('0x1a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x32e98e);throw _0x32e98e;});}return _0x543a0a;})[_0x897a('0x25')](respondWithResult(_0x5a11f5,0xc9))['catch'](handleError(_0x5a11f5,null));};exports[_0x897a('0x71')]=function(_0x191036,_0x3eef87){if(_0x191036[_0x897a('0x6a')]['id']){delete _0x191036[_0x897a('0x6a')]['id'];}return db['ChatWebsite'][_0x897a('0x6d')]({'where':{'id':_0x191036['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x3eef87,null))['then'](saveUpdates(_0x191036[_0x897a('0x6a')],null))['then'](respondWithResult(_0x3eef87,null))[_0x897a('0x1d')](handleError(_0x3eef87,null));};exports[_0x897a('0x26')]=function(_0xd1dc19,_0x1c5a11){return db['ChatWebsite'][_0x897a('0x6d')]({'where':{'id':_0xd1dc19[_0x897a('0x72')]['id']}})['then'](handleEntityNotFound(_0x1c5a11,null))[_0x897a('0x25')](removeEntity(_0x1c5a11,null))[_0x897a('0x1d')](handleError(_0x1c5a11,null));};exports[_0x897a('0x73')]=function(_0x2ce11c,_0x38f70e){return db[_0x897a('0x4f')][_0x897a('0x73')]()[_0x897a('0x25')](respondWithResult(_0x38f70e,null))[_0x897a('0x1d')](handleError(_0x38f70e,null));};exports[_0x897a('0x74')]=function(_0x19e9d7,_0x2ede0a){if(_0x19e9d7[_0x897a('0x6a')]['id']){delete _0x19e9d7[_0x897a('0x6a')]['id'];}return db[_0x897a('0x4f')]['find']({'where':{'id':_0x19e9d7[_0x897a('0x72')]['id']}})['then'](handleEntityNotFound(_0x2ede0a,null))[_0x897a('0x25')](function(_0x3e46b9){if(_0x3e46b9){_0x19e9d7[_0x897a('0x6a')][_0x897a('0x75')]=_0x3e46b9['id'];return db[_0x897a('0x76')][_0x897a('0x69')](_0x19e9d7[_0x897a('0x6a')]);}})[_0x897a('0x25')](respondWithResult(_0x2ede0a,null))['catch'](handleError(_0x2ede0a,null));};exports[_0x897a('0x77')]=function(_0x30d54a,_0x8514ea){var _0x2da941={'raw':![],'where':{}};var _0x2ddfb7={};var _0x180616={'count':0x0,'rows':[]};return db[_0x897a('0x4f')][_0x897a('0x78')]({'where':{'id':_0x30d54a[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x8514ea,null))[_0x897a('0x25')](function(_0x32497a){if(_0x32497a){_0x2ddfb7[_0x897a('0x57')]=_[_0x897a('0x53')](db['Disposition']['rawAttributes']);_0x2ddfb7[_0x897a('0x52')]=_['keys'](_0x30d54a[_0x897a('0x52')]);_0x2ddfb7[_0x897a('0x54')]=_['intersection'](_0x2ddfb7[_0x897a('0x57')],_0x2ddfb7['query']);_0x2da941[_0x897a('0x56')]=_[_0x897a('0x55')](_0x2ddfb7[_0x897a('0x57')],qs[_0x897a('0x58')](_0x30d54a[_0x897a('0x52')][_0x897a('0x58')]));_0x2da941[_0x897a('0x56')]=_0x2da941[_0x897a('0x56')][_0x897a('0x79')]?_0x2da941['attributes']:_0x2ddfb7[_0x897a('0x57')];if(!_0x30d54a[_0x897a('0x52')]['hasOwnProperty'](_0x897a('0x5a'))){_0x2da941['limit']=qs[_0x897a('0x21')](_0x30d54a['query'][_0x897a('0x21')]);_0x2da941[_0x897a('0x20')]=qs['offset'](_0x30d54a['query'][_0x897a('0x20')]);}_0x2da941[_0x897a('0x5b')]=qs['sort'](_0x30d54a[_0x897a('0x52')][_0x897a('0x5c')]);_0x2da941['where']=qs[_0x897a('0x54')](_[_0x897a('0x5e')](_0x30d54a[_0x897a('0x52')],_0x2ddfb7['filters']));_0x2da941[_0x897a('0x5d')][_0x897a('0x75')]=_0x32497a['id'];if(_0x30d54a['query'][_0x897a('0x61')]){_0x2da941[_0x897a('0x5d')]=_['merge'](_0x2da941[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x2da941['attributes'],function(_0x4848ab){var _0x5f1d6a={};_0x5f1d6a[_0x4848ab]={'$like':'%'+_0x30d54a[_0x897a('0x52')][_0x897a('0x61')]+'%'};return _0x5f1d6a;})});}_0x2da941=_[_0x897a('0x5f')]({},_0x2da941,_0x30d54a['options']);return db['Disposition']['count']({'where':_0x2da941[_0x897a('0x5d')]})[_0x897a('0x25')](function(_0x116478){_0x180616[_0x897a('0x22')]=_0x116478;if(_0x30d54a[_0x897a('0x52')]['includeAll']){_0x2da941[_0x897a('0x68')]=[{'all':!![]}];}return db[_0x897a('0x76')][_0x897a('0x63')](_0x2da941);})[_0x897a('0x25')](function(_0x494804){_0x180616[_0x897a('0x64')]=_0x494804;return _0x180616;});}})[_0x897a('0x25')](respondWithFilteredResult(_0x8514ea,_0x2da941))[_0x897a('0x1d')](handleError(_0x8514ea,null));};exports[_0x897a('0x7a')]=function(_0x57d168,_0x529aca){return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x57d168[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x529aca,null))[_0x897a('0x25')](function(_0x4c6e34){if(_0x4c6e34){return _0x4c6e34[_0x897a('0x7a')](_0x57d168[_0x897a('0x52')]['ids']);}})[_0x897a('0x25')](respondWithStatusCode(_0x529aca,null))[_0x897a('0x1d')](handleError(_0x529aca,null));};exports[_0x897a('0x7b')]=function(_0x3eb9f3,_0x2942cf){if(_0x3eb9f3[_0x897a('0x6a')]['id']){delete _0x3eb9f3[_0x897a('0x6a')]['id'];}return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x3eb9f3['params']['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x2942cf,null))['then'](function(_0x504380){if(_0x504380){_0x3eb9f3[_0x897a('0x6a')][_0x897a('0x75')]=_0x504380['id'];return db[_0x897a('0x7c')][_0x897a('0x69')](_0x3eb9f3['body']);}})[_0x897a('0x25')](respondWithResult(_0x2942cf,null))[_0x897a('0x1d')](handleError(_0x2942cf,null));};exports[_0x897a('0x7d')]=function(_0x3ee4c9,_0x317d2c){var _0x2741b7={'raw':![],'where':{}};var _0xd0bffc={};var _0x26e797={'count':0x0,'rows':[]};return db[_0x897a('0x4f')][_0x897a('0x78')]({'where':{'id':_0x3ee4c9[_0x897a('0x72')]['id']}})['then'](handleEntityNotFound(_0x317d2c,null))[_0x897a('0x25')](function(_0x42c6e1){if(_0x42c6e1){_0xd0bffc[_0x897a('0x57')]=_[_0x897a('0x53')](db[_0x897a('0x7c')][_0x897a('0x50')]);_0xd0bffc['query']=_[_0x897a('0x53')](_0x3ee4c9['query']);_0xd0bffc['filters']=_[_0x897a('0x55')](_0xd0bffc[_0x897a('0x57')],_0xd0bffc[_0x897a('0x52')]);_0x2741b7[_0x897a('0x56')]=_[_0x897a('0x55')](_0xd0bffc['model'],qs[_0x897a('0x58')](_0x3ee4c9[_0x897a('0x52')]['fields']));_0x2741b7[_0x897a('0x56')]=_0x2741b7[_0x897a('0x56')][_0x897a('0x79')]?_0x2741b7['attributes']:_0xd0bffc[_0x897a('0x57')];if(!_0x3ee4c9[_0x897a('0x52')][_0x897a('0x59')](_0x897a('0x5a'))){_0x2741b7['limit']=qs['limit'](_0x3ee4c9['query'][_0x897a('0x21')]);_0x2741b7['offset']=qs[_0x897a('0x20')](_0x3ee4c9[_0x897a('0x52')][_0x897a('0x20')]);}_0x2741b7[_0x897a('0x5b')]=qs[_0x897a('0x5c')](_0x3ee4c9[_0x897a('0x52')][_0x897a('0x5c')]);_0x2741b7[_0x897a('0x5d')]=qs[_0x897a('0x54')](_[_0x897a('0x5e')](_0x3ee4c9['query'],_0xd0bffc[_0x897a('0x54')]));_0x2741b7['where'][_0x897a('0x75')]=_0x42c6e1['id'];if(_0x3ee4c9['query'][_0x897a('0x61')]){_0x2741b7[_0x897a('0x5d')]=_[_0x897a('0x5f')](_0x2741b7[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x2741b7[_0x897a('0x56')],function(_0x3e82f0){var _0x356340={};_0x356340[_0x3e82f0]={'$like':'%'+_0x3ee4c9[_0x897a('0x52')][_0x897a('0x61')]+'%'};return _0x356340;})});}_0x2741b7=_['merge']({},_0x2741b7,_0x3ee4c9['options']);return db[_0x897a('0x7c')][_0x897a('0x22')]({'where':_0x2741b7['where']})[_0x897a('0x25')](function(_0x529d22){_0x26e797[_0x897a('0x22')]=_0x529d22;if(_0x3ee4c9['query'][_0x897a('0x67')]){_0x2741b7[_0x897a('0x68')]=[{'all':!![]}];}return db[_0x897a('0x7c')][_0x897a('0x63')](_0x2741b7);})[_0x897a('0x25')](function(_0x5ee43a){_0x26e797[_0x897a('0x64')]=_0x5ee43a;return _0x26e797;});}})[_0x897a('0x25')](respondWithFilteredResult(_0x317d2c,_0x2741b7))[_0x897a('0x1d')](handleError(_0x317d2c,null));};exports[_0x897a('0x7e')]=function(_0x1e3bee,_0x5cc65d){return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x1e3bee[_0x897a('0x72')]['id']}})['then'](handleEntityNotFound(_0x5cc65d,null))[_0x897a('0x25')](function(_0x1acbf4){if(_0x1acbf4){return _0x1acbf4[_0x897a('0x7e')](_0x1e3bee[_0x897a('0x52')][_0x897a('0x7f')]);}})['then'](respondWithStatusCode(_0x5cc65d,null))['catch'](handleError(_0x5cc65d,null));};exports[_0x897a('0x80')]=function(_0x1a2f9c,_0x214f7d){_0x1a2f9c[_0x897a('0x6a')]['sitepic']=_0x1a2f9c['file'][_0x897a('0x81')];return db[_0x897a('0x4f')]['find']({'where':{'id':_0x1a2f9c[_0x897a('0x72')]['id']}})['then'](handleEntityNotFound(_0x214f7d,null))[_0x897a('0x25')](saveUpdates(_0x1a2f9c[_0x897a('0x6a')],null))[_0x897a('0x25')](respondWithResult(_0x214f7d,null))[_0x897a('0x1d')](handleError(_0x214f7d,null));};exports['addAvatar']=function(_0x396ffd,_0x191957){_0x396ffd[_0x897a('0x6a')][_0x897a('0x82')]=_0x396ffd[_0x897a('0x83')]['filename'];return db['ChatWebsite'][_0x897a('0x6d')]({'where':{'id':_0x396ffd[_0x897a('0x72')]['id']}})['then'](handleEntityNotFound(_0x191957,null))['then'](saveUpdates(_0x396ffd[_0x897a('0x6a')],null))['then'](respondWithResult(_0x191957,null))[_0x897a('0x1d')](handleError(_0x191957,null));};exports[_0x897a('0x84')]=function(_0xa92936,_0x9634b2){_0xa92936['body'][_0x897a('0x85')]=_0xa92936[_0x897a('0x83')][_0x897a('0x81')];return db[_0x897a('0x4f')]['find']({'where':{'id':_0xa92936[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x9634b2,null))[_0x897a('0x25')](saveUpdates(_0xa92936[_0x897a('0x6a')],null))[_0x897a('0x25')](respondWithResult(_0x9634b2,null))[_0x897a('0x1d')](handleError(_0x9634b2,null));};exports[_0x897a('0x86')]=function(_0x5d0d6c,_0x4c1839){_0x5d0d6c[_0x897a('0x6a')][_0x897a('0x87')]=_0x5d0d6c[_0x897a('0x83')][_0x897a('0x81')];return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x5d0d6c[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x4c1839,null))['then'](saveUpdates(_0x5d0d6c[_0x897a('0x6a')],null))[_0x897a('0x25')](respondWithResult(_0x4c1839,null))[_0x897a('0x1d')](handleError(_0x4c1839,null));};exports[_0x897a('0x88')]=function(_0x1795f2,_0xa91d31){var _0x5ca3fa=path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x8b'));var _0x4dbbbb={'where':{'id':_0x1795f2[_0x897a('0x72')]['id']},'attributes':['id',_0x897a('0x8c')],'raw':!![]};var _0x1d9fde=![];return require(_0x897a('0x8d'))['getLicense']()['then'](function(_0x505856){if(_0x505856){_0x1d9fde=_0x505856[_0x897a('0x8e')];}})[_0x897a('0x25')](function(){return db[_0x897a('0x4f')][_0x897a('0x6d')](_0x4dbbbb);})[_0x897a('0x25')](handleEntityNotFound(_0xa91d31,null))[_0x897a('0x25')](function(_0x202190){if(_0x202190){if(!_[_0x897a('0x8f')](_0x202190[_0x897a('0x8c')])){if(fs['existsSync'](path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x90'),_0x202190[_0x897a('0x8c')]))&&_0x1d9fde){_0x5ca3fa=path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x90'),_0x202190['sitepic']);}}return _0xa91d31[_0x897a('0x91')](_0x5ca3fa);}})[_0x897a('0x1d')](handleError(_0xa91d31,null));};exports[_0x897a('0x92')]=function(_0x44ebfa,_0x4c3981){var _0x393b77=path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x93'));var _0x5a868c={'where':{'id':_0x44ebfa[_0x897a('0x72')]['id']},'attributes':['id',_0x897a('0x82')],'raw':!![]};return db[_0x897a('0x4f')][_0x897a('0x6d')](_0x5a868c)[_0x897a('0x25')](handleEntityNotFound(_0x4c3981,null))[_0x897a('0x25')](function(_0x308ae7){if(_0x308ae7){if(!_[_0x897a('0x8f')](_0x308ae7['agentAvatar'])){if(fs[_0x897a('0x94')](path['join'](config[_0x897a('0x8a')],_0x897a('0x95'),_0x308ae7['agentAvatar']))){_0x393b77=path[_0x897a('0x89')](config['root'],_0x897a('0x95'),_0x308ae7[_0x897a('0x82')]);}}return _0x4c3981[_0x897a('0x91')](_0x393b77);}})[_0x897a('0x1d')](handleError(_0x4c3981,null));};exports[_0x897a('0x96')]=function(_0x57c929,_0x4a6d74){var _0x472489=path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x97'));var _0x534a40={'where':{'id':_0x57c929['params']['id']},'attributes':['id',_0x897a('0x85'),_0x897a('0x98')],'raw':!![]};return db[_0x897a('0x4f')]['find'](_0x534a40)[_0x897a('0x25')](handleEntityNotFound(_0x4a6d74,null))[_0x897a('0x25')](function(_0x231ccd){if(_0x231ccd){if(!_['isNil'](_0x231ccd[_0x897a('0x85')])){if(fs[_0x897a('0x94')](path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x95'),_0x231ccd[_0x897a('0x85')]))&&_0x231ccd['showCustomerAvatar']){_0x472489=path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0x95'),_0x231ccd[_0x897a('0x85')]);}}return _0x4a6d74[_0x897a('0x91')](_0x472489);}})[_0x897a('0x1d')](handleError(_0x4a6d74,null));};exports[_0x897a('0x99')]=function(_0x2821e9,_0x46f122){var _0x3df72e=path['join'](config[_0x897a('0x8a')],_0x897a('0x9a'));var _0xddff2b={'where':{'id':_0x2821e9[_0x897a('0x72')]['id']},'attributes':['id',_0x897a('0x87')],'raw':!![]};return db[_0x897a('0x4f')][_0x897a('0x6d')](_0xddff2b)['then'](handleEntityNotFound(_0x46f122,null))[_0x897a('0x25')](function(_0x563586){if(_0x563586){if(!_[_0x897a('0x8f')](_0x563586[_0x897a('0x87')])){if(fs[_0x897a('0x94')](path['join'](config[_0x897a('0x8a')],_0x897a('0x95'),_0x563586[_0x897a('0x87')]))){_0x3df72e=path[_0x897a('0x89')](config['root'],_0x897a('0x95'),_0x563586[_0x897a('0x87')]);}}return _0x46f122['download'](_0x3df72e);}})[_0x897a('0x1d')](handleError(_0x46f122,null));};exports[_0x897a('0x9b')]=function(_0x2ed71a,_0x5ccf3a){var _0x28371b={'body':_0x2ed71a['body'],'channel':_0x897a('0x9c')};var _0x3027d8=[];var _0xcea4fe=[];var _0x33d1f2={};var _0x1458bc=![];return db[_0x897a('0x9d')][_0x897a('0x73')]()['then'](function(_0x2e4d52){if(!_0x2e4d52){throw new db[(_0x897a('0x9e'))][(_0x897a('0x9f'))](_0x897a('0xa0'));}_0x3027d8=_[_0x897a('0xa1')](_['keys'](_0x2e4d52),[_0x897a('0xa2'),'updatedAt']);_0xcea4fe=_[_0x897a('0xa1')](_[_0x897a('0x53')](_0x2e4d52),[_0x897a('0xa2'),_0x897a('0xa3'),_0x897a('0xa4'),_0x897a('0xa5')]);if(_0x2ed71a[_0x897a('0x6a')]['id']){delete _0x2ed71a[_0x897a('0x6a')]['id'];}if(_[_0x897a('0x8f')](_0x2ed71a['body']['from'])){throw new db[(_0x897a('0x9e'))][(_0x897a('0x9f'))](_0x897a('0xa6'));}if(_[_0x897a('0x8f')](_0x2ed71a[_0x897a('0x6a')][_0x897a('0x6a')])||_0x2ed71a[_0x897a('0x6a')]['body']===''){throw new db[(_0x897a('0x9e'))][(_0x897a('0x9f'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x897a('0x8f')](_0x2ed71a[_0x897a('0x6a')]['mapKey'])){throw new db[(_0x897a('0x9e'))]['ValidationError'](_0x897a('0xa7')+_0xcea4fe);}if(!_[_0x897a('0xa8')](_0xcea4fe,_0x2ed71a[_0x897a('0x6a')][_0x897a('0xa9')])){throw new db['Sequelize'][(_0x897a('0x9f'))](_0x897a('0xaa')+_0xcea4fe);}_0x33d1f2[_0x2ed71a['body'][_0x897a('0xa9')]]=_0x2ed71a[_0x897a('0x6a')][_0x897a('0xab')];})['then'](function(){return db[_0x897a('0x4f')]['find']({'where':{'id':_0x2ed71a[_0x897a('0x72')]['id']},'include':[{'model':db[_0x897a('0xac')],'as':_0x897a('0xad'),'include':[{'model':db[_0x897a('0x9d')],'as':'Contacts','where':_0x33d1f2,'limit':0x1,'order':[[_0x897a('0xa3'),_0x897a('0xae')]]}]},{'model':db[_0x897a('0xaf')],'as':_0x897a('0xb0')},{'model':db[_0x897a('0x38')],'as':_0x897a('0x38'),'include':[{'model':db[_0x897a('0x38')],'as':_0x897a('0x39'),'attributes':['id',_0x897a('0x30')],'raw':!![]}]}]});})[_0x897a('0x25')](function(_0x694c0){if(!_0x694c0)throw new APINotFoundError(util['format'](_0x897a('0xb1'),_0x2ed71a[_0x897a('0x72')]['id']));if(!_0x694c0[_0x897a('0x38')]||!_0x694c0[_0x897a('0x38')][_0x897a('0x39')])return[_0x694c0,!![]];return[_0x694c0,checkWebsiteIntervals(_0x694c0)];})[_0x897a('0xb2')](function(_0x5942eb,_0x3f5a9e){if(!_0x3f5a9e)throw new APIOutOfIntervalError();if(!_0x5942eb[_0x897a('0xad')])return;_0x28371b[_0x897a('0xb3')]=_0x5942eb;_0x28371b[_0x897a('0xb4')]=_0x5942eb[_0x897a('0xad')];_0x28371b[_0x897a('0xb5')]=_[_0x897a('0xb6')](_0x5942eb['Applications'],['priority'],[_0x897a('0xb7')]);if(_0x28371b['account']['Applications']){delete _0x28371b[_0x897a('0xb3')][_0x897a('0xb0')];}if(_0x28371b[_0x897a('0xb3')][_0x897a('0xad')]&&_0x28371b[_0x897a('0xb3')]['List'][_0x897a('0xb8')]['length']){return _0x28371b[_0x897a('0xb3')][_0x897a('0xad')][_0x897a('0xb8')][0x0];}var _0x1e6d24=_['defaults'](_0x2ed71a[_0x897a('0x6a')],{'firstName':_0x2ed71a[_0x897a('0x6a')][_0x897a('0xab')],'ListId':_0x5942eb[_0x897a('0xa5')]});_0x1e6d24[_0x2ed71a[_0x897a('0x6a')][_0x897a('0xa9')]]=_0x2ed71a[_0x897a('0x6a')]['from'];return db[_0x897a('0x9d')][_0x897a('0x69')](_0x1e6d24,{'fields':_0x3027d8,'raw':!![]});})[_0x897a('0x25')](function(_0x4d5fb2){_0x28371b['contact']=_0x4d5fb2;var _0x894daf=createInteractionObject(_0x2ed71a['params']['id'],_0x2ed71a['body'],_0x2ed71a[_0x897a('0xb9')],_0x4d5fb2);var _0x32e93e={'ChatWebsiteId':_0x2ed71a[_0x897a('0x72')]['id'],'closed':![]};if(_0x2ed71a[_0x897a('0x6a')][_0x897a('0xba')]){_0x32e93e[_0x897a('0xba')]=_0x2ed71a[_0x897a('0x6a')][_0x897a('0xba')];return db['ChatInteraction'][_0x897a('0x6d')]({'where':_0x32e93e})[_0x897a('0x25')](function(_0x4cb7cc){if(_0x4cb7cc){_0x1458bc=!![];return _0x4cb7cc;}_0x894daf[_0x897a('0xba')]=_0x2ed71a['body']['threadId'];_0x894daf['externalUrl']=_0x2ed71a[_0x897a('0x6a')][_0x897a('0xbb')];return db[_0x897a('0xbc')][_0x897a('0x69')](_0x894daf);});}_0x32e93e[_0x897a('0xbd')]=_0x4d5fb2['id'];if(_0x2ed71a[_0x897a('0x6a')]['interaction']&&_0x2ed71a[_0x897a('0x6a')][_0x897a('0xbe')]['id']){_0x32e93e['id']=_0x2ed71a[_0x897a('0x6a')]['interaction']['id'];return db[_0x897a('0xbc')][_0x897a('0x6d')]({'where':_0x32e93e})[_0x897a('0x25')](function(_0x4170e){if(_0x4170e){_0x1458bc=!![];return _0x4170e;}return db['ChatInteraction'][_0x897a('0x69')](_0x894daf);});}return db['ChatInteraction']['create'](_0x894daf);})[_0x897a('0x25')](function(_0x1806c5){if(!_0x1458bc)return _0x1806c5;var _0x23b91c={'from':(_0x28371b[_0x897a('0xbf')]['firstName']||'')+'\x20'+(_0x28371b[_0x897a('0xbf')][_0x897a('0xc0')]||'')};if(_0x2ed71a[_0x897a('0x6a')]['threadId']&&_0x2ed71a[_0x897a('0x6a')][_0x897a('0xc1')]&&_0x2ed71a[_0x897a('0x6a')][_0x897a('0xba')]!=_0x2ed71a[_0x897a('0x6a')][_0x897a('0xc1')]){_0x23b91c[_0x897a('0xba')]=_0x2ed71a[_0x897a('0x6a')]['messageId'];}return _0x1806c5[_0x897a('0x71')](_0x23b91c);})[_0x897a('0x25')](function(_0x59e966){_0x28371b['interaction']=_0x59e966[_0x897a('0x3a')]({'plain':!![]});_0x28371b['interaction'][_0x897a('0xc2')]=!_0x1458bc;if(_0x28371b['interaction'][_0x897a('0xc2')]){if(_0x28371b[_0x897a('0xb3')][_0x897a('0xc3')]){_0x28371b[_0x897a('0xb5')][_0x897a('0xc4')]({'id':0x0,'priority':_0x28371b[_0x897a('0xb5')]['length']+0x1,'app':_0x897a('0xc5'),'appdata':'unmanaged','interval':_0x897a('0xc6')});}}return db[_0x897a('0xc7')][_0x897a('0x69')]({'body':_0x2ed71a[_0x897a('0x6a')][_0x897a('0x6a')],'ChatWebsiteId':_0x2ed71a[_0x897a('0x72')]['id'],'ChatInteractionId':_0x59e966['id'],'direction':'in','ContactId':_0x28371b[_0x897a('0xbf')]['id'],'AttachmentId':_0x2ed71a[_0x897a('0x6a')][_0x897a('0xc8')]});})['then'](function(_0x2b87b3){_0x28371b[_0x897a('0x1c')]=_0x2b87b3;if(!_0x28371b[_0x897a('0xbe')]['UserId']){return;}return db[_0x897a('0xc9')][_0x897a('0x6d')]({'attributes':['id',_0x897a('0x29')],'where':{'id':_0x28371b[_0x897a('0xbe')][_0x897a('0xca')]}});})[_0x897a('0x25')](function(_0x26149c){if(_0x26149c){_0x28371b[_0x897a('0xb5')][_0x897a('0xcb')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x26149c[_0x897a('0x29')]+','+(_0x28371b[_0x897a('0xb3')][_0x897a('0xcc')]||0xa),'interval':'*,*,*,*'});_0x28371b['forcedOwnership']=!![];}if(!_0x28371b[_0x897a('0xbe')][_0x897a('0xcd')]){return;}return db[_0x897a('0xce')][_0x897a('0x6d')]({'attributes':['id',_0x897a('0x29')],'where':{'id':_0x28371b[_0x897a('0xbe')][_0x897a('0xcd')]}});})[_0x897a('0x25')](function(_0x361c9a){if(_0x361c9a){_0x28371b[_0x897a('0xb5')][_0x897a('0xcb')]({'id':0x0,'priority':0x1,'app':_0x897a('0xcf'),'appdata':_0x361c9a[_0x897a('0x29')]+','+(_0x28371b[_0x897a('0xb3')][_0x897a('0xd0')]||0x12c),'interval':_0x897a('0xc6')});}return respondWithRpcPromise('Start',_0x897a('0xd1'),_0x28371b);})[_0x897a('0x25')](function(_0x2ed300){respondWithRpcPromise(_0x897a('0xd2'),_0x897a('0xd2'),{'event':_0x897a('0x9b'),'message':_0x2ed300},client9002);return _0x2ed300;})[_0x897a('0x25')](respondWithResult(_0x5ccf3a,null))[_0x897a('0x1d')](APIHandleError(_0x5ccf3a));};exports[_0x897a('0xd3')]=function(_0x1edb47,_0x42d1b5){var _0x227f23,_0x2045ce,_0x2349e3;var _0x5926fd=[];var _0x2ee5d9={};var _0x45e36d=_0x1edb47['files']||[];var _0xa90bc5=[];var _0x260bdb;return db[_0x897a('0x9d')][_0x897a('0x73')]()[_0x897a('0x25')](function(_0x7a6ceb){if(!_0x7a6ceb){throw new db[(_0x897a('0x9e'))][(_0x897a('0x9f'))](_0x897a('0xa0'));}_0x5926fd=_[_0x897a('0xa1')](_[_0x897a('0x53')](_0x7a6ceb),['createdAt',_0x897a('0xa3'),_0x897a('0xa4'),_0x897a('0xa5')]);if(_0x1edb47['body']['id']){delete _0x1edb47[_0x897a('0x6a')]['id'];}if(_[_0x897a('0x8f')](_0x1edb47[_0x897a('0x6a')][_0x897a('0xab')])){throw _0x42d1b5['status'](0x1f4)[_0x897a('0x2a')](new db[(_0x897a('0x9e'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x897a('0x8f')](_0x1edb47[_0x897a('0x6a')]['body'])||_0x1edb47[_0x897a('0x6a')][_0x897a('0x6a')]===''){throw _0x42d1b5[_0x897a('0x23')](0x1f4)[_0x897a('0x2a')](new db[(_0x897a('0x9e'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x897a('0x8f')](_0x1edb47[_0x897a('0x6a')][_0x897a('0xd4')])){throw _0x42d1b5[_0x897a('0x23')](0x1f4)['send'](new db['Sequelize'][(_0x897a('0x9f'))](_0x897a('0xd5')+_0x5926fd));}if(!_[_0x897a('0xa8')](_0x5926fd,_0x1edb47[_0x897a('0x6a')][_0x897a('0xd4')])){throw _0x42d1b5[_0x897a('0x23')](0x1f4)['send'](new db['Sequelize'][(_0x897a('0x9f'))](_0x897a('0xd6')+_0x5926fd));}_0x2ee5d9[_0x1edb47[_0x897a('0x6a')][_0x897a('0xd4')]]=_0x1edb47[_0x897a('0x6a')][_0x897a('0xab')];})[_0x897a('0x25')](function(){return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x1edb47[_0x897a('0x72')]['id']},'include':[{'model':db[_0x897a('0xac')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x897a('0x25')](handleEntityNotFound(_0x42d1b5,null))[_0x897a('0x25')](function(_0x1ba1cd){if(_0x1ba1cd&&_0x1ba1cd[_0x897a('0xad')]){_0x2045ce=_0x1ba1cd;var _0x6fa20f=_['defaults'](_0x1edb47[_0x897a('0x6a')],{'firstName':_0x1edb47['body'][_0x897a('0xab')],'phone':_0x1edb47[_0x897a('0x6a')][_0x897a('0xab')],'ListId':_0x1ba1cd[_0x897a('0xa5')]});_0x6fa20f[_0x1edb47['body'][_0x897a('0xd4')]]=_0x1edb47[_0x897a('0x6a')][_0x897a('0xab')];return db[_0x897a('0x9d')]['findOrCreate']({'where':_0x2ee5d9,'defaults':_0x6fa20f});}})[_0x897a('0xb2')](function(_0x47d47e){if(_0x47d47e){_0x2349e3=_0x47d47e;var _0x42f80e=fs['readFileSync'](path[_0x897a('0x89')](config[_0x897a('0x8a')],_0x897a('0xd7')),'utf8');var _0x542366=ejs['render'](_0x42f80e,{'body':_[_0x897a('0xd8')](_0x1edb47['body'][_0x897a('0x6a')]),'bodyTitle':_0x2045ce[_0x897a('0xd9')]});return db[_0x897a('0xda')][_0x897a('0x69')]({'body':_0x542366,'plainBody':htmlToText[_0x897a('0xdb')](_0x542366),'ContactId':_0x47d47e['id'],'ChatWebsiteId':_0x2045ce['id']});}})[_0x897a('0x25')](function(_0x4712ca){_0x260bdb=_0x4712ca;if(_0x45e36d['length']){var _0x1233a8=_0x45e36d[_0x897a('0x37')](function(_0x4d6a69){return{'name':_0x4d6a69[_0x897a('0xdc')],'basename':_0x4d6a69[_0x897a('0x81')],'type':_0x4d6a69[_0x897a('0xdd')],'ChatOfflineMessageId':_0x4712ca['id']};});_0xa90bc5=_0x1233a8[_0x897a('0x37')](_0x16c884=>{var _0x30037a={'filename':_0x16c884[_0x897a('0x29')],'path':path['join'](config[_0x897a('0x8a')],_0x897a('0xde'),_0x897a('0xdf'),'attachments','offline-chat',_0x16c884[_0x897a('0xe0')])};return _0x30037a;});if(!_0x2045ce['openNewInteraction']){return db['sequelize'][_0x897a('0xe1')](function(_0x1acf98){return db[_0x897a('0xe2')][_0x897a('0xe3')](_0x1233a8,{'transaction':_0x1acf98});});}}})['then'](function(){if(_0x260bdb){_0x227f23=_0x260bdb;return db[_0x897a('0xe4')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x897a('0xe5')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x897a('0xe6')],'as':_0x897a('0xe6'),'raw':!![]}]}]});}})[_0x897a('0x25')](function(_0x1b57f8){if(_0x1b57f8&&_0x1b57f8['Smtp']&&_0x2045ce[_0x897a('0xe7')]&&_0x2045ce[_0x897a('0xe8')]){var _0x412604=_0x1b57f8[_0x897a('0xe9')]();return respondWithRpcPromise('SendMail',_0x897a('0xea'),{'account':_0x412604,'message':{'from':util[_0x897a('0x2e')](_0x897a('0xeb'),_0x1b57f8['name'],_0x1b57f8['email']||_0x1b57f8[_0x897a('0xec')][_0x897a('0xed')]),'to':_0x2045ce[_0x897a('0xe8')],'subject':_0x2045ce[_0x897a('0xee')],'html':_0x227f23['body'],'attachments':_0xa90bc5}},client9003)['then'](function(){return _0x227f23;})[_0x897a('0x1d')](function(_0x3a1083){logger[_0x897a('0x1a')](_0x3a1083);});}})[_0x897a('0x25')](function(){if(_0x2045ce&&_0x2045ce['openNewInteraction']&&_0x2045ce['MailAccountId']){var _0xc1fa2=[];if(_0x45e36d['length']){_0xc1fa2=_0x45e36d[_0x897a('0x37')](function(_0x2640f5){return{'name':_0x2640f5[_0x897a('0xdc')],'basename':_0x2640f5[_0x897a('0x81')],'type':_0x2640f5[_0x897a('0xdd')],'ChatOfflineMessageId':_0x260bdb['id']};});}var _0x4e56a6;if(!_['isNil'](_0x2045ce[_0x897a('0xef')])){var _0xb56f81=_[_0x897a('0x37')](_0x1edb47[_0x897a('0x6a')],function(_0x14a967){return _0x14a967;});var _0x39137a=_[_0x897a('0xf0')](_0xb56f81)[0x0];var _0x9f20fc=_['mapValues'](_0x39137a,function(_0xa473b3){return _0xa473b3;});_0x4e56a6=_0x9f20fc[0x1][_0x2045ce[_0x897a('0xef')]];}var _0x2394c3={'from':_0x2349e3[_0x897a('0xf1')],'firstName':_0x2349e3[_0x897a('0x44')],'lastName':_0x2349e3['lastName'],'mapKey':'email','message':{'from':_0x2349e3[_0x897a('0xf1')],'to':_0x2045ce[_0x897a('0xe4')]['email'],'cc':'','subject':_[_0x897a('0x8f')](_0x4e56a6)?_0x2045ce[_0x897a('0xee')]:_0x4e56a6,'messageId':'','sentAt':new Date(),'attach':_0xc1fa2[_0x897a('0x79')],'attachments':_0xc1fa2,'originChannel':'Chat','ChatWebsiteId':_0x2045ce['id'],'ChatOfflineMessageId':_0x227f23['id'],'originTo':_0x2045ce['MailAccount'][_0x897a('0xf1')]},'body':_0x227f23[_0x897a('0x6a')]};var _0x325ce4={'account':{'id':_0x2045ce[_0x897a('0xf2')]},'body':_0x2394c3,'log':_0x897a('0xf3')};return respondWithRpcPromise(_0x897a('0xf3'),'notifyMail',_0x325ce4,client9001)[_0x897a('0x25')](function(){return _0x227f23;})['catch'](function(_0x2d8023){logger[_0x897a('0x1a')](_0x2d8023);});}return;})[_0x897a('0x25')](function(){if(_0x227f23){return _0x227f23;}})['then'](respondWithResult(_0x42d1b5,null))['catch'](function(){for(var _0x205bdd of _0x45e36d){var _0x41c063=path[_0x897a('0x89')](config['root'],_0x897a('0xde'),_0x897a('0xdf'),_0x897a('0xf4'),'offline-chat',_0x205bdd['filename']);fs_extra[_0x897a('0xf5')](_0x41c063)[_0x897a('0x1d')](function(_0x1a3d52){logger[_0x897a('0x1a')](_0x897a('0xf6'),_0x41c063,_0x1a3d52);});}});};exports[_0x897a('0xf7')]=function(_0x401ea8,_0x2d1a3a){return db[_0x897a('0xbc')][_0x897a('0x6d')]({'where':{'id':_0x401ea8[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x2d1a3a,null))[_0x897a('0x25')](function(_0xa0486e){if(_0xa0486e){return _0xa0486e[_0x897a('0xf7')](_0x401ea8[_0x897a('0x6a')][_0x897a('0x7f')],_[_0x897a('0xf8')](_0x401ea8[_0x897a('0x6a')],['ids','id'])||{});}})[_0x897a('0x25')](respondWithResult(_0x2d1a3a,null))[_0x897a('0x1d')](handleError(_0x2d1a3a,null));};exports[_0x897a('0xf9')]=function(_0x3b5d60,_0x2780d8){var _0x2c76e3={'raw':![],'where':{}};var _0x20e8cc={};var _0x4b93f0={'count':0x0,'rows':[]};return db[_0x897a('0x4f')]['findOne']({'where':{'id':_0x3b5d60[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x2780d8,null))[_0x897a('0x25')](function(_0x3bae7c){if(_0x3bae7c){_0x20e8cc[_0x897a('0x57')]=_[_0x897a('0x53')](db[_0x897a('0xbc')][_0x897a('0x50')]);_0x20e8cc[_0x897a('0x52')]=_['keys'](_0x3b5d60[_0x897a('0x52')]);_0x20e8cc[_0x897a('0x54')]=_[_0x897a('0x55')](_0x20e8cc['model'],_0x20e8cc[_0x897a('0x52')]);_0x2c76e3[_0x897a('0x56')]=_[_0x897a('0x55')](_0x20e8cc['model'],qs[_0x897a('0x58')](_0x3b5d60[_0x897a('0x52')]['fields']));_0x2c76e3[_0x897a('0x56')]=_0x2c76e3[_0x897a('0x56')][_0x897a('0x79')]?_0x2c76e3[_0x897a('0x56')]:_0x20e8cc['model'];if(!_0x3b5d60[_0x897a('0x52')]['hasOwnProperty']('nolimit')){_0x2c76e3[_0x897a('0x21')]=qs[_0x897a('0x21')](_0x3b5d60['query']['limit']);_0x2c76e3[_0x897a('0x20')]=qs[_0x897a('0x20')](_0x3b5d60[_0x897a('0x52')][_0x897a('0x20')]);}_0x2c76e3['order']=qs['sort'](_0x3b5d60['query'][_0x897a('0x5c')]);_0x2c76e3[_0x897a('0x5d')]=qs[_0x897a('0x54')](_['pick'](_0x3b5d60[_0x897a('0x52')],_0x20e8cc[_0x897a('0x54')]));_0x2c76e3['where'][_0x897a('0x75')]=_0x3bae7c['id'];if(_0x3b5d60[_0x897a('0x52')][_0x897a('0x61')]){_0x2c76e3[_0x897a('0x5d')]=_['merge'](_0x2c76e3[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x2c76e3[_0x897a('0x56')],function(_0x128fec){var _0x240fc5={};_0x240fc5[_0x128fec]={'$like':'%'+_0x3b5d60[_0x897a('0x52')][_0x897a('0x61')]+'%'};return _0x240fc5;})});}_0x2c76e3=_['merge']({},_0x2c76e3,_0x3b5d60[_0x897a('0x62')]);return db[_0x897a('0xbc')][_0x897a('0x22')]({'where':_0x2c76e3[_0x897a('0x5d')]})[_0x897a('0x25')](function(_0x4e1dfa){_0x4b93f0[_0x897a('0x22')]=_0x4e1dfa;if(_0x3b5d60['query'][_0x897a('0x67')]){_0x2c76e3[_0x897a('0x68')]=[{'model':db[_0x897a('0x9d')],'as':_0x897a('0xfa'),'required':![]},{'model':db['User'],'as':_0x897a('0xfb'),'attributes':[_0x897a('0x29'),_0x897a('0xfc'),_0x897a('0xfd')],'required':![]},{'model':db[_0x897a('0xfe')],'as':_0x897a('0xff'),'attributes':['id','name',_0x897a('0x100')],'where':_0x3b5d60[_0x897a('0x52')][_0x897a('0x101')]?{'id':_0x3b5d60[_0x897a('0x52')][_0x897a('0x101')]}:undefined,'required':_0x3b5d60[_0x897a('0x52')][_0x897a('0x101')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x2c76e3);})[_0x897a('0x25')](function(_0x4dc7e6){_0x4b93f0[_0x897a('0x64')]=_0x4dc7e6;return _0x4b93f0;});}})[_0x897a('0x25')](respondWithFilteredResult(_0x2780d8,_0x2c76e3))[_0x897a('0x1d')](handleError(_0x2780d8,null));};exports[_0x897a('0x2c')]=function(_0x149a74,_0x408436){var _0x320fea=0x0;var _0x45e907=0x0;var _0xd55688=![];var _0xb303bf;var _0x426c05;return db[_0x897a('0x4f')]['find']({'where':{'id':_0x149a74['params']['id']},'include':[{'model':db[_0x897a('0x38')],'as':_0x897a('0x38'),'include':[{'model':db[_0x897a('0x38')],'as':_0x897a('0x39'),'attributes':['id','interval']}]}]})[_0x897a('0x25')](handleEntityNotFound(_0x408436,null))[_0x897a('0x25')](function(_0x3c7d67){if(_0x3c7d67){_0xb303bf=_0x3c7d67;return _0x3c7d67[_0x897a('0x102')]({'raw':!![]});}})[_0x897a('0x25')](function(_0x461b97){if(_0xb303bf){if(_0x461b97){_0x426c05=_0x461b97;}}return require(_0x897a('0x8d'))[_0x897a('0x103')]();})[_0x897a('0x25')](function(_0x2a8c86){if(_0x2a8c86){_0x45e907=_0x2a8c86[_0x897a('0x104')];_0xd55688=_0x2a8c86[_0x897a('0x8e')];}})[_0x897a('0x25')](function(){return db['ChatInteraction'][_0x897a('0x22')]({'where':{'closed':![]}});})[_0x897a('0x25')](function(_0x3c95b9){_0x320fea=_0x3c95b9;if(_0x45e907&&_0x3c95b9>_0x45e907){return db[_0x897a('0x105')][_0x897a('0x78')]({'where':{'id':0x1}})[_0x897a('0x25')](function(_0x2301fe){if(_0x2301fe){_0x2301fe[_0x897a('0x106')](_0x897a('0x107'));}});}})[_0x897a('0x25')](function(){if(!_0xb303bf[_0x897a('0x38')]||!_0xb303bf[_0x897a('0x38')][_0x897a('0x39')])return!![];return checkWebsiteIntervals(_0xb303bf);})['then'](function(_0x482515){var _0x45801a=fs['readFileSync'](path[_0x897a('0x89')](config['root'],_0x897a('0x108')),_0x897a('0x109'));var _0x29e8ae=new url['URL'](_0xb303bf['address'])[_0x897a('0x10a')];var _0x5bec77=_0x897a('0x10b');var _0x48e439=![];var _0x255071={'chatVersion':_0x5bec77,'chatWebsiteAddressOrigin':_0x29e8ae,'remote':_0xb303bf[_0x897a('0x10c')],'query':querystring[_0x897a('0x19')](_['merge'](_0xb303bf['get']({'plain':!![]}),{'customerIp':_0x149a74[_0x897a('0xb9')]['x-forwarded-for']||_0x149a74['headers'][_0x897a('0x10d')]||_0x149a74[_0x897a('0x10e')][_0x897a('0x10f')]||_0x149a74['ip'],'referer':_0x149a74['headers'][_0x897a('0x110')],'openedInteractions':_0x320fea,'maxInteractions':_0x45e907,'virtual':_0xd55688[_0x897a('0x104')],'online':_0x482515,'custom':_0xd55688}))[_0x897a('0x111')](/'/g,'\x5c\x27')};_0x408436[_0x897a('0x2a')](ejs[_0x897a('0x112')](Mustache[_0x897a('0x112')](_0x45801a,_0x255071),{'proactiveActions':_0x426c05,'alignment':_0xb303bf[_0x897a('0x113')],'verticalAlignment':_0xb303bf['verticalAlignment'],'div_color':_0xb303bf[_0x897a('0x100')],'labelText':_0xb303bf[_0x897a('0x114')],'text_color':_0xb303bf['textColor'],'text_button_color':_0xb303bf[_0x897a('0x115')],'button_color':_0xb303bf[_0x897a('0x116')],'background_color':_0xb303bf[_0x897a('0x117')],'hideWhenOffline':_0xb303bf['hideWhenOffline'],'intervalId':_0xb303bf[_0x897a('0x118')],'isDevelopment':_0x48e439,'chatVersion':_0x5bec77}));})['catch'](handleError(_0x408436,null));};exports['addApplications']=function(_0x594516,_0x1106fd){var _0x471cd3=_0x594516[_0x897a('0x72')]['id'];var _0x2e952a=_0x594516['body'];var _0x4e5a10=0xc8;var _0x1aa08b=null;return db[_0x897a('0x119')]['transaction']({'isolationLevel':db['sequelize'][_0x897a('0x11a')]['ISOLATION_LEVELS']['READ_COMMITTED']},function(_0x10b868){return db['ChatWebsite'][_0x897a('0x78')]({'where':{'id':_0x471cd3},'transaction':_0x10b868})['then'](function(_0x52723b){if(_0x52723b){return db[_0x897a('0xaf')][_0x897a('0x26')]({'where':{'ChatWebsiteId':_0x471cd3},'transaction':_0x10b868})['then'](function(){var _0x497abe=_[_0x897a('0x37')](_0x2e952a,function(_0x5e4a6c){_0x5e4a6c[_0x897a('0x75')]=_0x471cd3;return _0x5e4a6c;});return db['ChatApplication'][_0x897a('0xe3')](_0x497abe,{'transaction':_0x10b868});});}else{_0x4e5a10=0x194;_0x1aa08b=[];}});})[_0x897a('0x25')](function(){if(_0x4e5a10!==0x194){return db[_0x897a('0xaf')][_0x897a('0x11b')]({'where':{'ChatWebsiteId':_0x471cd3},'order':_0x897a('0x11c')})['then'](function(_0xaaa310){_0x1aa08b=_0xaaa310;});}})[_0x897a('0x1d')](function(_0x1aa6de){_0x4e5a10=0x1f4;logger[_0x897a('0x1a')](_0x1aa6de['stack']);if(_0x1aa6de[_0x897a('0x29')]){delete _0x1aa6de[_0x897a('0x29')];}_0x1aa08b=_0x1aa6de;})['finally'](function(){if(_0x1aa08b===null){_0x1106fd[_0x897a('0x1e')](_0x4e5a10);}else{if(_0x4e5a10===0x1f4){_0x1106fd[_0x897a('0x23')](_0x4e5a10)['send'](_0x1aa08b);}else{_0x1106fd[_0x897a('0x23')](_0x4e5a10)[_0x897a('0x11d')](_0x1aa08b);}}});};exports[_0x897a('0x11e')]=function(_0x1357ec,_0xf72f13){var _0x1bdfd6={};var _0x2633ba={};var _0x195e1f;var _0x4b1a2a;return db['ChatWebsite']['findOne']({'where':{'id':_0x1357ec['params']['id']}})['then'](handleEntityNotFound(_0xf72f13,null))[_0x897a('0x25')](function(_0x8e4b93){if(_0x8e4b93){_0x195e1f=_0x8e4b93;_0x2633ba[_0x897a('0x57')]=_[_0x897a('0x53')](db[_0x897a('0xaf')][_0x897a('0x50')]);_0x2633ba[_0x897a('0x52')]=_[_0x897a('0x53')](_0x1357ec[_0x897a('0x52')]);_0x2633ba[_0x897a('0x54')]=_[_0x897a('0x55')](_0x2633ba['model'],_0x2633ba[_0x897a('0x52')]);_0x1bdfd6[_0x897a('0x56')]=_['intersection'](_0x2633ba[_0x897a('0x57')],qs[_0x897a('0x58')](_0x1357ec['query'][_0x897a('0x58')]));_0x1bdfd6[_0x897a('0x56')]=_0x1bdfd6[_0x897a('0x56')]['length']?_0x1bdfd6[_0x897a('0x56')]:_0x2633ba[_0x897a('0x57')];_0x1bdfd6[_0x897a('0x5b')]=qs['sort'](_0x1357ec[_0x897a('0x52')][_0x897a('0x5c')]);_0x1bdfd6[_0x897a('0x5d')]=qs[_0x897a('0x54')](_[_0x897a('0x5e')](_0x1357ec[_0x897a('0x52')],_0x2633ba[_0x897a('0x54')]));if(_0x1357ec[_0x897a('0x52')]['filter']){_0x1bdfd6[_0x897a('0x5d')]=_[_0x897a('0x5f')](_0x1bdfd6[_0x897a('0x5d')],{'$or':_['map'](_0x1bdfd6[_0x897a('0x56')],function(_0x21e218){var _0x5784a3={};_0x5784a3[_0x21e218]={'$like':'%'+_0x1357ec[_0x897a('0x52')][_0x897a('0x61')]+'%'};return _0x5784a3;})});}_0x1bdfd6=_[_0x897a('0x5f')]({},_0x1bdfd6,_0x1357ec[_0x897a('0x62')]);return _0x195e1f['getApplications'](_0x1bdfd6);}})[_0x897a('0x25')](function(_0x3418fa){if(_0x3418fa){_0x4b1a2a=_0x3418fa[_0x897a('0x79')];if(!_0x1357ec[_0x897a('0x52')]['hasOwnProperty'](_0x897a('0x5a'))){_0x1bdfd6[_0x897a('0x21')]=qs[_0x897a('0x21')](_0x1357ec[_0x897a('0x52')][_0x897a('0x21')]);_0x1bdfd6[_0x897a('0x20')]=qs['offset'](_0x1357ec[_0x897a('0x52')][_0x897a('0x20')]);}return _0x195e1f[_0x897a('0x11e')](_0x1bdfd6);}})[_0x897a('0x25')](function(_0x3de532){if(_0x3de532){return _0x3de532?{'count':_0x4b1a2a,'rows':_0x3de532}:null;}})[_0x897a('0x25')](respondWithResult(_0xf72f13,null))['catch'](handleError(_0xf72f13,null));};exports[_0x897a('0x11f')]=function(_0x169fce,_0x2f2504){return db[_0x897a('0x120')][_0x897a('0x6d')]({'where':{'id':_0x169fce[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x2f2504,null))[_0x897a('0x25')](function(_0x1181e6){if(_0x1181e6){return _0x1181e6[_0x897a('0x11f')](_0x169fce['body'][_0x897a('0x7f')],_[_0x897a('0xf8')](_0x169fce[_0x897a('0x6a')],[_0x897a('0x7f'),'id'])||{});}})[_0x897a('0x25')](respondWithResult(_0x2f2504,null))['catch'](handleError(_0x2f2504,null));};exports[_0x897a('0x102')]=function(_0x231e65,_0x27a61c){var _0x288762={};var _0x5a3538={};var _0x4162d5;var _0x3991f6;return db['ChatWebsite'][_0x897a('0x78')]({'where':{'id':_0x231e65[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x27a61c,null))['then'](function(_0xa61322){if(_0xa61322){_0x4162d5=_0xa61322;_0x5a3538[_0x897a('0x57')]=_[_0x897a('0x53')](db[_0x897a('0x121')]['rawAttributes']);_0x5a3538[_0x897a('0x52')]=_['keys'](_0x231e65[_0x897a('0x52')]);_0x5a3538['filters']=_[_0x897a('0x55')](_0x5a3538[_0x897a('0x57')],_0x5a3538[_0x897a('0x52')]);_0x288762['attributes']=_['intersection'](_0x5a3538[_0x897a('0x57')],qs[_0x897a('0x58')](_0x231e65[_0x897a('0x52')][_0x897a('0x58')]));_0x288762['attributes']=_0x288762[_0x897a('0x56')][_0x897a('0x79')]?_0x288762[_0x897a('0x56')]:_0x5a3538[_0x897a('0x57')];_0x288762[_0x897a('0x5b')]=qs[_0x897a('0x5c')](_0x231e65['query'][_0x897a('0x5c')]);_0x288762[_0x897a('0x5d')]=qs['filters'](_[_0x897a('0x5e')](_0x231e65['query'],_0x5a3538[_0x897a('0x54')]));if(_0x231e65[_0x897a('0x52')][_0x897a('0x61')]){_0x288762['where']=_[_0x897a('0x5f')](_0x288762[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x288762['attributes'],function(_0x204970){var _0x389d50={};_0x389d50[_0x204970]={'$like':'%'+_0x231e65[_0x897a('0x52')][_0x897a('0x61')]+'%'};return _0x389d50;})});}_0x288762=_[_0x897a('0x5f')]({},_0x288762,_0x231e65[_0x897a('0x62')]);return _0x4162d5[_0x897a('0x102')](_0x288762);}})[_0x897a('0x25')](function(_0x1b18a5){if(_0x1b18a5){_0x3991f6=_0x1b18a5['length'];if(!_0x231e65[_0x897a('0x52')][_0x897a('0x59')](_0x897a('0x5a'))){_0x288762[_0x897a('0x21')]=qs['limit'](_0x231e65[_0x897a('0x52')][_0x897a('0x21')]);_0x288762[_0x897a('0x20')]=qs[_0x897a('0x20')](_0x231e65[_0x897a('0x52')][_0x897a('0x20')]);}return _0x4162d5[_0x897a('0x102')](_0x288762);}})['then'](function(_0xa7b4d8){if(_0xa7b4d8){return _0xa7b4d8?{'count':_0x3991f6,'rows':_0xa7b4d8}:null;}})[_0x897a('0x25')](respondWithResult(_0x27a61c,null))[_0x897a('0x1d')](handleError(_0x27a61c,null));};exports[_0x897a('0x122')]=function(_0x31e4f3,_0x3ab77c){var _0x1ba583=_0x31e4f3['query'][_0x897a('0x123')]===_0x897a('0x124')?_0x897a('0x125'):'onlineForm';return db[_0x897a('0x4f')]['find']({'attributes':['id',_0x1ba583],'where':{'id':_0x31e4f3[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x3ab77c,null))[_0x897a('0x25')](function(_0x491dae){if(_0x491dae){var _0xd77e61=_0x491dae[_0x1ba583];var _0x5874ca=_0xd77e61&&_0xd77e61[_0x897a('0x126')]?_0xd77e61[_0x897a('0x126')]:[];_0x3ab77c[_0x897a('0x2a')]({'fromKey':_[_0x897a('0x8f')](_0xd77e61[_0x897a('0x127')])?undefined:_0xd77e61[_0x897a('0x127')],'count':_0x5874ca[_0x897a('0x79')],'rows':_0x5874ca});}})['catch'](handleError(_0x3ab77c,null));};exports[_0x897a('0x128')]=function(_0x5917a6,_0x103d25){var _0x46bbe0={'raw':![],'where':{}};var _0x2d92f7={};var _0x4c6648={'count':0x0,'rows':[]};return db[_0x897a('0x4f')][_0x897a('0x78')]({'where':{'id':_0x5917a6[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x103d25,null))[_0x897a('0x25')](function(_0x5806c8){if(_0x5806c8){_0x2d92f7[_0x897a('0x57')]=_[_0x897a('0x53')](db[_0x897a('0xda')][_0x897a('0x50')]);_0x2d92f7['query']=_[_0x897a('0x53')](_0x5917a6[_0x897a('0x52')]);_0x2d92f7[_0x897a('0x54')]=_[_0x897a('0x55')](_0x2d92f7[_0x897a('0x57')],_0x2d92f7[_0x897a('0x52')]);_0x46bbe0[_0x897a('0x56')]=_[_0x897a('0x55')](_0x2d92f7['model'],qs[_0x897a('0x58')](_0x5917a6['query']['fields']));_0x46bbe0[_0x897a('0x56')]=_0x46bbe0[_0x897a('0x56')][_0x897a('0x79')]?_0x46bbe0[_0x897a('0x56')]:_0x2d92f7['model'];if(!_0x5917a6[_0x897a('0x52')][_0x897a('0x59')](_0x897a('0x5a'))){_0x46bbe0[_0x897a('0x21')]=qs['limit'](_0x5917a6['query'][_0x897a('0x21')]);_0x46bbe0['offset']=qs[_0x897a('0x20')](_0x5917a6[_0x897a('0x52')][_0x897a('0x20')]);}_0x46bbe0[_0x897a('0x5b')]=qs['sort'](_0x5917a6[_0x897a('0x52')][_0x897a('0x5c')]);_0x46bbe0[_0x897a('0x5d')]=qs[_0x897a('0x54')](_[_0x897a('0x5e')](_0x5917a6[_0x897a('0x52')],_0x2d92f7['filters']));_0x46bbe0[_0x897a('0x5d')][_0x897a('0x75')]=_0x5806c8['id'];if(_0x5917a6[_0x897a('0x52')]['filter']){_0x46bbe0[_0x897a('0x5d')]=_[_0x897a('0x5f')](_0x46bbe0[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x46bbe0[_0x897a('0x56')],function(_0x909717){var _0x2d8b3d={};_0x2d8b3d[_0x909717]={'$like':'%'+_0x5917a6[_0x897a('0x52')]['filter']+'%'};return _0x2d8b3d;})});}_0x46bbe0=_[_0x897a('0x5f')]({},_0x46bbe0,_0x5917a6[_0x897a('0x62')]);return db[_0x897a('0xda')][_0x897a('0x22')]({'where':_0x46bbe0[_0x897a('0x5d')]})['then'](function(_0x483bbb){_0x4c6648['count']=_0x483bbb;if(_0x5917a6[_0x897a('0x52')][_0x897a('0x67')]){_0x46bbe0['include']=[{'all':!![]}];}else{_0x46bbe0['include']=[{'model':db[_0x897a('0x9d')],'as':_0x897a('0xfa'),'required':![]},{'model':db[_0x897a('0xe2')],'as':_0x897a('0x129'),'required':![]}];}return db[_0x897a('0xda')][_0x897a('0x63')](_0x46bbe0);})[_0x897a('0x25')](function(_0x1f5d9){_0x4c6648['rows']=_0x1f5d9;return _0x4c6648;});}})[_0x897a('0x25')](respondWithFilteredResult(_0x103d25,_0x46bbe0))[_0x897a('0x1d')](handleError(_0x103d25,null));};exports[_0x897a('0x12a')]=function(_0x4516cb,_0x2bca3a){return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x4516cb[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x2bca3a,null))[_0x897a('0x25')](function(_0x1b88e7){if(_0x1b88e7){return _0x1b88e7[_0x897a('0x12a')](_0x4516cb[_0x897a('0x6a')][_0x897a('0x7f')],_[_0x897a('0xf8')](_0x4516cb[_0x897a('0x6a')],[_0x897a('0x7f'),'id'])||{})[_0x897a('0xb2')](function(_0x164f7b){for(var _0x335749=0x0;_0x335749<_0x4516cb[_0x897a('0x6a')][_0x897a('0x7f')][_0x897a('0x79')];_0x335749+=0x1){socket[_0x897a('0x12b')](_0x897a('0x12c'),{'UserId':Number(_0x4516cb['body'][_0x897a('0x7f')][_0x335749]),'ChatWebsiteId':Number(_0x4516cb['params']['id'])});}return _0x164f7b;});}})['then'](respondWithResult(_0x2bca3a,null))[_0x897a('0x1d')](handleError(_0x2bca3a,null));};exports['removeAgents']=function(_0x4351ec,_0xb70288){return db[_0x897a('0x4f')][_0x897a('0x6d')]({'where':{'id':_0x4351ec[_0x897a('0x72')]['id']}})[_0x897a('0x25')](handleEntityNotFound(_0xb70288,null))[_0x897a('0x25')](function(_0x1cae52){if(_0x1cae52){return _0x1cae52[_0x897a('0x12d')](_0x4351ec['query'][_0x897a('0x7f')])[_0x897a('0x25')](function(){if(_['isArray'](_0x4351ec[_0x897a('0x52')][_0x897a('0x7f')])){for(var _0x7b1789=0x0;_0x7b1789<_0x4351ec[_0x897a('0x52')][_0x897a('0x7f')]['length'];_0x7b1789+=0x1){socket[_0x897a('0x12b')](_0x897a('0x12e'),{'UserId':Number(_0x4351ec['query'][_0x897a('0x7f')][_0x7b1789]),'ChatWebsiteId':Number(_0x4351ec[_0x897a('0x72')]['id'])});}}else{socket['emit'](_0x897a('0x12e'),{'UserId':Number(_0x4351ec[_0x897a('0x52')][_0x897a('0x7f')]),'ChatWebsiteId':Number(_0x4351ec[_0x897a('0x72')]['id'])});}});}})['then'](respondWithStatusCode(_0xb70288,null))[_0x897a('0x1d')](handleError(_0xb70288,null));};exports['getAgents']=function(_0x1906f0,_0x26dfbd){var _0x104b45={};var _0x8eaff9={};var _0x2321c1;var _0x1e49e7;return db[_0x897a('0x4f')]['findOne']({'where':{'id':_0x1906f0['params']['id']}})[_0x897a('0x25')](handleEntityNotFound(_0x26dfbd,null))[_0x897a('0x25')](function(_0x1837ff){if(_0x1837ff){_0x2321c1=_0x1837ff;_0x8eaff9['model']=_[_0x897a('0x53')](db['User'][_0x897a('0x50')]);_0x8eaff9[_0x897a('0x52')]=_[_0x897a('0x53')](_0x1906f0[_0x897a('0x52')]);_0x8eaff9['filters']=_['intersection'](_0x8eaff9[_0x897a('0x57')],_0x8eaff9[_0x897a('0x52')]);_0x104b45[_0x897a('0x56')]=_[_0x897a('0x55')](_0x8eaff9[_0x897a('0x57')],qs['fields'](_0x1906f0[_0x897a('0x52')][_0x897a('0x58')]));_0x104b45[_0x897a('0x56')]=_0x104b45['attributes']['length']?_0x104b45[_0x897a('0x56')]:_0x8eaff9[_0x897a('0x57')];_0x104b45[_0x897a('0x5b')]=qs['sort'](_0x1906f0[_0x897a('0x52')]['sort']);_0x104b45['where']=qs[_0x897a('0x54')](_[_0x897a('0x5e')](_0x1906f0[_0x897a('0x52')],_0x8eaff9[_0x897a('0x54')]));if(_0x1906f0[_0x897a('0x52')][_0x897a('0x61')]){_0x104b45['where']=_[_0x897a('0x5f')](_0x104b45[_0x897a('0x5d')],{'$or':_[_0x897a('0x37')](_0x104b45[_0x897a('0x56')],function(_0x448637){var _0x30420d={};_0x30420d[_0x448637]={'$like':'%'+_0x1906f0['query'][_0x897a('0x61')]+'%'};return _0x30420d;})});}_0x104b45=_[_0x897a('0x5f')]({},_0x104b45,_0x1906f0[_0x897a('0x62')]);return _0x2321c1['getAgents'](_0x104b45);}})['then'](function(_0x8256a3){if(_0x8256a3){_0x1e49e7=_0x8256a3[_0x897a('0x79')];if(!_0x1906f0[_0x897a('0x52')]['hasOwnProperty'](_0x897a('0x5a'))){_0x104b45[_0x897a('0x21')]=qs[_0x897a('0x21')](_0x1906f0[_0x897a('0x52')][_0x897a('0x21')]);_0x104b45[_0x897a('0x20')]=qs[_0x897a('0x20')](_0x1906f0[_0x897a('0x52')][_0x897a('0x20')]);}return _0x2321c1['getAgents'](_0x104b45);}})[_0x897a('0x25')](function(_0x30b2ad){if(_0x30b2ad){return _0x30b2ad?{'count':_0x1e49e7,'rows':_0x30b2ad}:null;}})[_0x897a('0x25')](respondWithResult(_0x26dfbd,null))[_0x897a('0x1d')](handleError(_0x26dfbd,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 3bfd3c0..5917c52 100644
--- a/server/api/chatWebsite/chatWebsite.events.js
+++ b/server/api/chatWebsite/chatWebsite.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8098=['hasOwnProperty','hook','ChatWebsite','setMaxListeners','save','update','remove','emit'];(function(_0x554129,_0x2c3d20){var _0x4de573=function(_0x4d1b9b){while(--_0x4d1b9b){_0x554129['push'](_0x554129['shift']());}};_0x4de573(++_0x2c3d20);}(_0x8098,0x1ba));var _0x8809=function(_0x450aeb,_0x94d48c){_0x450aeb=_0x450aeb-0x0;var _0x491819=_0x8098[_0x450aeb];return _0x491819;};'use strict';var EventEmitter=require('events');var ChatWebsite=require('../../mysqldb')['db'][_0x8809('0x0')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8809('0x1')](0x0);var events={'afterCreate':_0x8809('0x2'),'afterUpdate':_0x8809('0x3'),'afterDestroy':_0x8809('0x4')};function emitEvent(_0x4b0838){return function(_0x2bb438,_0x1d7425,_0x13c03d){ChatWebsiteEvents[_0x8809('0x5')](_0x4b0838+':'+_0x2bb438['id'],_0x2bb438);ChatWebsiteEvents['emit'](_0x4b0838,_0x2bb438);_0x13c03d(null);};}for(var e in events){if(events[_0x8809('0x6')](e)){var event=events[e];ChatWebsite[_0x8809('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa8a8=['update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x324edb,_0x5f0d60){var _0x79d90c=function(_0x1c1a70){while(--_0x1c1a70){_0x324edb['push'](_0x324edb['shift']());}};_0x79d90c(++_0x5f0d60);}(_0xa8a8,0xec));var _0x8a8a=function(_0x69859f,_0x15bc92){_0x69859f=_0x69859f-0x0;var _0x197a59=_0xa8a8[_0x69859f];return _0x197a59;};'use strict';var EventEmitter=require(_0x8a8a('0x0'));var ChatWebsite=require(_0x8a8a('0x1'))['db'][_0x8a8a('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x8a8a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8a8a('0x4'),'afterDestroy':_0x8a8a('0x5')};function emitEvent(_0xf11a08){return function(_0x3ed1de,_0x45515d,_0x1cecd4){ChatWebsiteEvents[_0x8a8a('0x6')](_0xf11a08+':'+_0x3ed1de['id'],_0x3ed1de);ChatWebsiteEvents[_0x8a8a('0x6')](_0xf11a08,_0x3ed1de);_0x1cecd4(null);};}for(var e in events){if(events[_0x8a8a('0x7')](e)){var event=events[e];ChatWebsite[_0x8a8a('0x8')](e,emitEvent(event));}}module[_0x8a8a('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 6e1ead2..038a06a 100644
--- a/server/api/chatWebsite/chatWebsite.model.js
+++ b/server/api/chatWebsite/chatWebsite.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x6222=['../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x334841,_0x2bbc4c){var _0x5beb4b=function(_0x4bea72){while(--_0x4bea72){_0x334841['push'](_0x334841['shift']());}};_0x5beb4b(++_0x2bbc4c);}(_0x6222,0x7d));var _0x2622=function(_0x113f3c,_0xbbf92a){_0x113f3c=_0x113f3c-0x0;var _0x4b7380=_0x6222[_0x113f3c];return _0x4b7380;};'use strict';var _=require(_0x2622('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x2622('0x1'));var moment=require(_0x2622('0x2'));var BPromise=require(_0x2622('0x3'));var rp=require(_0x2622('0x4'));var fs=require('fs');var path=require(_0x2622('0x5'));var rimraf=require(_0x2622('0x6'));var config=require(_0x2622('0x7'));var attributes=require(_0x2622('0x8'));module['exports']=function(_0x50cf25,_0x1c2f4f){return _0x50cf25[_0x2622('0x9')]('ChatWebsite',attributes,{'tableName':_0x2622('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6808=['../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x1b7368,_0x3286ed){var _0x25d54c=function(_0x2366da){while(--_0x2366da){_0x1b7368['push'](_0x1b7368['shift']());}};_0x25d54c(++_0x3286ed);}(_0x6808,0x1a6));var _0x8680=function(_0x55107e,_0x210c83){_0x55107e=_0x55107e-0x0;var _0x118ef9=_0x6808[_0x55107e];return _0x118ef9;};'use strict';var _=require('lodash');var util=require(_0x8680('0x0'));var logger=require(_0x8680('0x1'))(_0x8680('0x2'));var moment=require(_0x8680('0x3'));var BPromise=require(_0x8680('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8680('0x5'));var rimraf=require(_0x8680('0x6'));var config=require(_0x8680('0x7'));var attributes=require(_0x8680('0x8'));module['exports']=function(_0x578350,_0xd7143c){return _0x578350['define'](_0x8680('0x9'),attributes,{'tableName':_0x8680('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index 8309f1f..d90506e 100644
--- a/server/api/chatWebsite/chatWebsite.rpc.js
+++ b/server/api/chatWebsite/chatWebsite.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x2045=['redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5029fa,_0x4d1e7d){var _0x395dfb=function(_0x453e01){while(--_0x453e01){_0x5029fa['push'](_0x5029fa['shift']());}};_0x395dfb(++_0x4d1e7d);}(_0x2045,0x72));var _0x5204=function(_0x27889f,_0x4809b9){_0x27889f=_0x27889f-0x0;var _0x201713=_0x2045[_0x27889f];return _0x201713;};'use strict';var _=require(_0x5204('0x0'));var util=require(_0x5204('0x1'));var moment=require(_0x5204('0x2'));var BPromise=require(_0x5204('0x3'));var rs=require(_0x5204('0x4'));var fs=require('fs');var Redis=require(_0x5204('0x5'));var db=require(_0x5204('0x6'))['db'];var utils=require(_0x5204('0x7'));var logger=require(_0x5204('0x8'))(_0x5204('0x9'));var config=require(_0x5204('0xa'));var jayson=require(_0x5204('0xb'));var client=jayson[_0x5204('0xc')][_0x5204('0xd')]({'port':0x232a});config[_0x5204('0xe')]=_[_0x5204('0xf')](config[_0x5204('0xe')],{'host':_0x5204('0x10'),'port':0x18eb});var socket=require(_0x5204('0x11'))(new Redis(config[_0x5204('0xe')]));require('./chatWebsite.socket')[_0x5204('0x12')](socket);function respondWithRpcPromise(_0x92f99c,_0x23de2f,_0x46c538){return new BPromise(function(_0x4728ee,_0x13d858){return client[_0x5204('0x13')](_0x92f99c,_0x46c538)[_0x5204('0x14')](function(_0x3c05f2){logger[_0x5204('0x15')](_0x5204('0x16'),_0x23de2f,'request\x20sent');logger[_0x5204('0x17')](_0x5204('0x18'),_0x23de2f,_0x5204('0x19'),JSON[_0x5204('0x1a')](_0x3c05f2));if(_0x3c05f2[_0x5204('0x1b')]){if(_0x3c05f2['error'][_0x5204('0x1c')]===0x1f4){logger[_0x5204('0x1b')](_0x5204('0x16'),_0x23de2f,_0x3c05f2[_0x5204('0x1b')][_0x5204('0x1d')]);return _0x13d858(_0x3c05f2[_0x5204('0x1b')][_0x5204('0x1d')]);}logger[_0x5204('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x23de2f,_0x3c05f2[_0x5204('0x1b')][_0x5204('0x1d')]);return _0x4728ee(_0x3c05f2[_0x5204('0x1b')][_0x5204('0x1d')]);}else{logger[_0x5204('0x15')](_0x5204('0x16'),_0x23de2f,'request\x20sent');_0x4728ee(_0x3c05f2[_0x5204('0x1e')][_0x5204('0x1d')]);}})[_0x5204('0x1f')](function(_0xba7154){logger[_0x5204('0x1b')]('ChatWebsite,\x20%s,\x20%s',_0x23de2f,_0xba7154);_0x13d858(_0xba7154);});});}
\ No newline at end of file
+var _0xd060=['../../config/utils','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x2219ac,_0x129a88){var _0x158bbb=function(_0x113671){while(--_0x113671){_0x2219ac['push'](_0x2219ac['shift']());}};_0x158bbb(++_0x129a88);}(_0xd060,0x6e));var _0x0d06=function(_0x484ab4,_0x56be12){_0x484ab4=_0x484ab4-0x0;var _0x253428=_0xd060[_0x484ab4];return _0x253428;};'use strict';var _=require(_0x0d06('0x0'));var util=require(_0x0d06('0x1'));var moment=require(_0x0d06('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d06('0x3'));var fs=require('fs');var Redis=require(_0x0d06('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d06('0x5'));var logger=require('../../config/logger')(_0x0d06('0x6'));var config=require(_0x0d06('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0d06('0x8')]['http']({'port':0x232a});config[_0x0d06('0x9')]=_[_0x0d06('0xa')](config[_0x0d06('0x9')],{'host':_0x0d06('0xb'),'port':0x18eb});var socket=require(_0x0d06('0xc'))(new Redis(config[_0x0d06('0x9')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0xbee78e,_0x3ebd52,_0x3d53be){return new BPromise(function(_0x109250,_0xbdca7b){return client['request'](_0xbee78e,_0x3d53be)['then'](function(_0x96209e){logger[_0x0d06('0xd')](_0x0d06('0xe'),_0x3ebd52,_0x0d06('0xf'));logger[_0x0d06('0x10')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x3ebd52,_0x0d06('0xf'),JSON[_0x0d06('0x11')](_0x96209e));if(_0x96209e[_0x0d06('0x12')]){if(_0x96209e[_0x0d06('0x12')][_0x0d06('0x13')]===0x1f4){logger[_0x0d06('0x12')](_0x0d06('0xe'),_0x3ebd52,_0x96209e[_0x0d06('0x12')][_0x0d06('0x14')]);return _0xbdca7b(_0x96209e['error']['message']);}logger[_0x0d06('0x12')](_0x0d06('0xe'),_0x3ebd52,_0x96209e[_0x0d06('0x12')]['message']);return _0x109250(_0x96209e[_0x0d06('0x12')][_0x0d06('0x14')]);}else{logger[_0x0d06('0xd')]('ChatWebsite,\x20%s,\x20%s',_0x3ebd52,_0x0d06('0xf'));_0x109250(_0x96209e[_0x0d06('0x15')][_0x0d06('0x14')]);}})[_0x0d06('0x16')](function(_0x1f9df9){logger[_0x0d06('0x12')](_0x0d06('0xe'),_0x3ebd52,_0x1f9df9);_0xbdca7b(_0x1f9df9);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index e6f1d24..7ea1c02 100644
--- a/server/api/chatWebsite/chatWebsite.socket.js
+++ b/server/api/chatWebsite/chatWebsite.socket.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x8bcd=['length','chatWebsite:','./chatWebsite.events','remove','update','emit','removeListener'];(function(_0x39ab14,_0x1c6d59){var _0x5a661e=function(_0x39297e){while(--_0x39297e){_0x39ab14['push'](_0x39ab14['shift']());}};_0x5a661e(++_0x1c6d59);}(_0x8bcd,0x1d7));var _0xd8bc=function(_0x486461,_0xa44925){_0x486461=_0x486461-0x0;var _0x50fda4=_0x8bcd[_0x486461];return _0x50fda4;};'use strict';var ChatWebsiteEvents=require(_0xd8bc('0x0'));var events=['save',_0xd8bc('0x1'),_0xd8bc('0x2')];function createListener(_0x3226f7,_0x28055d){return function(_0x570d0f){_0x28055d[_0xd8bc('0x3')](_0x3226f7,_0x570d0f);};}function removeListener(_0xf6fe9e,_0x2e0b8c){return function(){ChatWebsiteEvents[_0xd8bc('0x4')](_0xf6fe9e,_0x2e0b8c);};}exports['register']=function(_0x3b1789){for(var _0x4b64a5=0x0,_0x3558e3=events[_0xd8bc('0x5')];_0x4b64a5<_0x3558e3;_0x4b64a5++){var _0x3190dd=events[_0x4b64a5];var _0x5a0e77=createListener(_0xd8bc('0x6')+_0x3190dd,_0x3b1789);ChatWebsiteEvents['on'](_0x3190dd,_0x5a0e77);}};
\ No newline at end of file
+var _0xf131=['emit','register','chatWebsite:','./chatWebsite.events','save','update'];(function(_0x45fc6a,_0x166adb){var _0x14bcfd=function(_0x3ba718){while(--_0x3ba718){_0x45fc6a['push'](_0x45fc6a['shift']());}};_0x14bcfd(++_0x166adb);}(_0xf131,0x1ad));var _0x1f13=function(_0x13077c,_0x51c626){_0x13077c=_0x13077c-0x0;var _0x470b57=_0xf131[_0x13077c];return _0x470b57;};'use strict';var ChatWebsiteEvents=require(_0x1f13('0x0'));var events=[_0x1f13('0x1'),'remove',_0x1f13('0x2')];function createListener(_0x265310,_0x570d54){return function(_0x527c67){_0x570d54[_0x1f13('0x3')](_0x265310,_0x527c67);};}function removeListener(_0x257a56,_0xf5d8ba){return function(){ChatWebsiteEvents['removeListener'](_0x257a56,_0xf5d8ba);};}exports[_0x1f13('0x4')]=function(_0x3c8aed){for(var _0x5f45fb=0x0,_0x38b297=events['length'];_0x5f45fb<_0x38b297;_0x5f45fb++){var _0x19fc0d=events[_0x5f45fb];var _0x1d8f32=createListener(_0x1f13('0x5')+_0x19fc0d,_0x3c8aed);ChatWebsiteEvents['on'](_0x19fc0d,_0x1d8f32);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c090003..67fe81a 100644
--- a/server/api/chatWebsite/index.js
+++ b/server/api/chatWebsite/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xfde9=['file','addLogo','server/files/images/avatars/','addAvatar','addCustomerAvatar','format','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','replace','extname','/:id/offline','any','offline','addInteraction','addProactiveActions','addAgents','put','update','destroy','delete','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','diskStorage','join','root','%s-%s','now','originalname','single'];(function(_0x30927f,_0x1a6b55){var _0x4dd593=function(_0x515645){while(--_0x515645){_0x30927f['push'](_0x30927f['shift']());}};_0x4dd593(++_0x1a6b55);}(_0xfde9,0x14b));var _0x9fde=function(_0xa3fadc,_0xd1e16){_0xa3fadc=_0xa3fadc-0x0;var _0x23ecb8=_0xfde9[_0xa3fadc];return _0x23ecb8;};'use strict';var multer=require(_0x9fde('0x0'));var util=require('util');var path=require(_0x9fde('0x1'));var timeout=require(_0x9fde('0x2'));var express=require(_0x9fde('0x3'));var router=express[_0x9fde('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9fde('0x5'));var interaction=require(_0x9fde('0x6'));var config=require('../../config/environment');var controller=require(_0x9fde('0x7'));router[_0x9fde('0x8')]('/',auth['isAuthenticated'](),controller[_0x9fde('0x9')]);router[_0x9fde('0x8')]('/describe',auth[_0x9fde('0xa')](),controller[_0x9fde('0xb')]);router[_0x9fde('0x8')](_0x9fde('0xc'),auth[_0x9fde('0xa')](),controller[_0x9fde('0xd')]);router['get']('/:id/dispositions',auth['isAuthenticated'](),controller[_0x9fde('0xe')]);router[_0x9fde('0x8')](_0x9fde('0xf'),auth[_0x9fde('0xa')](),controller['getAnswers']);router[_0x9fde('0x8')](_0x9fde('0x10'),controller[_0x9fde('0x11')]);router[_0x9fde('0x8')](_0x9fde('0x12'),controller[_0x9fde('0x13')]);router['get'](_0x9fde('0x14'),controller[_0x9fde('0x15')]);router['get'](_0x9fde('0x16'),controller[_0x9fde('0x17')]);router[_0x9fde('0x8')](_0x9fde('0x18'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x19')]);router['get'](_0x9fde('0x1a'),controller['getSnippet']);router['get'](_0x9fde('0x1b'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x1c')]);router['get'](_0x9fde('0x1d'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x1e')]);router[_0x9fde('0x8')](_0x9fde('0x1f'),controller[_0x9fde('0x20')]);router[_0x9fde('0x8')](_0x9fde('0x21'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x22')]);router[_0x9fde('0x8')](_0x9fde('0x23'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x24')]);router[_0x9fde('0x25')]('/',auth[_0x9fde('0xa')](),controller[_0x9fde('0x26')]);router['post'](_0x9fde('0x27'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x28')]);router[_0x9fde('0x25')]('/:id/canned_answers',auth[_0x9fde('0xa')](),controller[_0x9fde('0x29')]);var upload=multer({'storage':multer[_0x9fde('0x2a')]({'destination':function(_0x5474ad,_0x4dcd6e,_0x372af3){_0x372af3(null,path[_0x9fde('0x2b')](config[_0x9fde('0x2c')],'server/files/images/logos/'));},'filename':function(_0x23d517,_0x1de365,_0x2bc344){_0x2bc344(null,util['format'](_0x9fde('0x2d'),Date[_0x9fde('0x2e')](),_0x1de365[_0x9fde('0x2f')]));}})});router[_0x9fde('0x25')]('/:id/logo',upload[_0x9fde('0x30')](_0x9fde('0x31')),controller[_0x9fde('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2023c2,_0x2fe1b8,_0x385d5f){_0x385d5f(null,path[_0x9fde('0x2b')](config['root'],_0x9fde('0x33')));},'filename':function(_0x3be884,_0x1c4a1a,_0x94781){_0x94781(null,util['format'](_0x9fde('0x2d'),Date[_0x9fde('0x2e')](),_0x1c4a1a['originalname']));}})});router[_0x9fde('0x25')](_0x9fde('0x12'),upload[_0x9fde('0x30')](_0x9fde('0x31')),controller[_0x9fde('0x34')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3eebc3,_0x32868d,_0x4e2d92){_0x4e2d92(null,path[_0x9fde('0x2b')](config[_0x9fde('0x2c')],_0x9fde('0x33')));},'filename':function(_0x54b839,_0x31de10,_0x2edcea){_0x2edcea(null,util['format'](_0x9fde('0x2d'),Date[_0x9fde('0x2e')](),_0x31de10[_0x9fde('0x2f')]));}})});router[_0x9fde('0x25')](_0x9fde('0x14'),upload['single'](_0x9fde('0x31')),controller[_0x9fde('0x35')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x30eec4,_0x1d9abe,_0x497486){_0x497486(null,path[_0x9fde('0x2b')](config[_0x9fde('0x2c')],_0x9fde('0x33')));},'filename':function(_0x55a3b7,_0x5e72ad,_0x3d1849){_0x3d1849(null,util[_0x9fde('0x36')]('%s-%s',Date['now'](),_0x5e72ad[_0x9fde('0x2f')]));}})});router['post'](_0x9fde('0x16'),upload[_0x9fde('0x30')](_0x9fde('0x31')),controller[_0x9fde('0x37')]);router[_0x9fde('0x25')](_0x9fde('0x38'),controller[_0x9fde('0x39')]);const offlineUploadMulter=multer({'storage':multer[_0x9fde('0x2a')]({'destination':function(_0x42098f,_0x30a574,_0x37e64d){const _0x47f426=path[_0x9fde('0x2b')](config[_0x9fde('0x2c')],_0x9fde('0x3a'),_0x9fde('0x3b'),_0x9fde('0x3c'));fs_extra['ensureDir'](_0x47f426,function(){_0x37e64d(null,_0x47f426);});},'filename':function(_0x2921c4,_0x464981,_0x41dc8a){const _0x55ca8e=_0x464981[_0x9fde('0x2f')][_0x9fde('0x3d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x524a54=path[_0x9fde('0x3e')](_0x55ca8e);const _0x40f2a1=Date[_0x9fde('0x2e')]()+'-'+_0x55ca8e['replace'](_0x524a54,'')+_0x524a54;_0x41dc8a(null,_0x40f2a1);}})});router[_0x9fde('0x25')](_0x9fde('0x3f'),offlineUploadMulter[_0x9fde('0x40')](),controller[_0x9fde('0x41')]);router['post'](_0x9fde('0x18'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x42')]);router[_0x9fde('0x25')]('/:id/applications',auth[_0x9fde('0xa')](),controller['addApplications']);router[_0x9fde('0x25')](_0x9fde('0x1d'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x43')]);router[_0x9fde('0x25')](_0x9fde('0x23'),auth['isAuthenticated'](),controller[_0x9fde('0x44')]);router[_0x9fde('0x45')](_0x9fde('0xc'),auth['isAuthenticated'](),controller[_0x9fde('0x46')]);router['delete'](_0x9fde('0xc'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x47')]);router[_0x9fde('0x48')](_0x9fde('0x27'),auth[_0x9fde('0xa')](),controller['removeDispositions']);router['delete']('/:id/canned_answers',auth[_0x9fde('0xa')](),controller[_0x9fde('0x49')]);router[_0x9fde('0x48')](_0x9fde('0x23'),auth[_0x9fde('0xa')](),controller[_0x9fde('0x4a')]);module[_0x9fde('0x4b')]=router;
\ No newline at end of file
+var _0xc328=['getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','join','server/files/images/logos/','format','%s-%s','now','originalname','single','diskStorage','root','server/files/images/avatars/','file','addAvatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','extname','/:id/offline','any','offline','/:id/interactions','addApplications','addAgents','put','update','delete','destroy','removeDispositions','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','index','isAuthenticated','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','getProactiveActions','/:id/fields'];(function(_0x3cc983,_0x40ed52){var _0x145328=function(_0xb608){while(--_0xb608){_0x3cc983['push'](_0x3cc983['shift']());}};_0x145328(++_0x40ed52);}(_0xc328,0xb3));var _0x8c32=function(_0x56fa5c,_0x46b71e){_0x56fa5c=_0x56fa5c-0x0;var _0x5cf91b=_0xc328[_0x56fa5c];return _0x5cf91b;};'use strict';var multer=require('multer');var util=require(_0x8c32('0x0'));var path=require(_0x8c32('0x1'));var timeout=require(_0x8c32('0x2'));var express=require('express');var router=express[_0x8c32('0x3')]();var fs_extra=require(_0x8c32('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x8c32('0x5'));var config=require(_0x8c32('0x6'));var controller=require(_0x8c32('0x7'));router[_0x8c32('0x8')]('/',auth['isAuthenticated'](),controller[_0x8c32('0x9')]);router[_0x8c32('0x8')]('/describe',auth[_0x8c32('0xa')](),controller[_0x8c32('0xb')]);router[_0x8c32('0x8')](_0x8c32('0xc'),auth[_0x8c32('0xa')](),controller[_0x8c32('0xd')]);router[_0x8c32('0x8')](_0x8c32('0xe'),auth[_0x8c32('0xa')](),controller['getDispositions']);router[_0x8c32('0x8')](_0x8c32('0xf'),auth['isAuthenticated'](),controller[_0x8c32('0x10')]);router['get']('/:id/logo',controller['getLogo']);router['get'](_0x8c32('0x11'),controller[_0x8c32('0x12')]);router[_0x8c32('0x8')](_0x8c32('0x13'),controller[_0x8c32('0x14')]);router[_0x8c32('0x8')](_0x8c32('0x15'),controller['getSystemAvatar']);router[_0x8c32('0x8')]('/:id/interactions',auth[_0x8c32('0xa')](),controller[_0x8c32('0x16')]);router[_0x8c32('0x8')](_0x8c32('0x17'),controller['getSnippet']);router[_0x8c32('0x8')](_0x8c32('0x18'),auth[_0x8c32('0xa')](),controller['getApplications']);router[_0x8c32('0x8')](_0x8c32('0x19'),auth[_0x8c32('0xa')](),controller[_0x8c32('0x1a')]);router['get'](_0x8c32('0x1b'),controller[_0x8c32('0x1c')]);router['get'](_0x8c32('0x1d'),auth['isAuthenticated'](),controller[_0x8c32('0x1e')]);router[_0x8c32('0x8')](_0x8c32('0x1f'),auth['isAuthenticated'](),controller[_0x8c32('0x20')]);router[_0x8c32('0x21')]('/',auth[_0x8c32('0xa')](),controller[_0x8c32('0x22')]);router[_0x8c32('0x21')](_0x8c32('0xe'),auth[_0x8c32('0xa')](),controller[_0x8c32('0x23')]);router[_0x8c32('0x21')]('/:id/canned_answers',auth[_0x8c32('0xa')](),controller['addAnswer']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e504e,_0x395a8f,_0x215bee){_0x215bee(null,path[_0x8c32('0x24')](config['root'],_0x8c32('0x25')));},'filename':function(_0x3927d3,_0x4795e1,_0x3b0125){_0x3b0125(null,util[_0x8c32('0x26')](_0x8c32('0x27'),Date[_0x8c32('0x28')](),_0x4795e1[_0x8c32('0x29')]));}})});router['post']('/:id/logo',upload[_0x8c32('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x8c32('0x2b')]({'destination':function(_0x58ad71,_0x3ff9fc,_0x1ab7e6){_0x1ab7e6(null,path[_0x8c32('0x24')](config[_0x8c32('0x2c')],_0x8c32('0x2d')));},'filename':function(_0x22c11f,_0x3421fd,_0x23b5e8){_0x23b5e8(null,util[_0x8c32('0x26')]('%s-%s',Date[_0x8c32('0x28')](),_0x3421fd[_0x8c32('0x29')]));}})});router['post'](_0x8c32('0x11'),upload[_0x8c32('0x2a')](_0x8c32('0x2e')),controller[_0x8c32('0x2f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x579115,_0x23e4dd,_0x282154){_0x282154(null,path[_0x8c32('0x24')](config[_0x8c32('0x2c')],_0x8c32('0x2d')));},'filename':function(_0xe9c800,_0x93ea81,_0x5f31a4){_0x5f31a4(null,util[_0x8c32('0x26')](_0x8c32('0x27'),Date[_0x8c32('0x28')](),_0x93ea81[_0x8c32('0x29')]));}})});router[_0x8c32('0x21')]('/:id/customer_avatar',upload[_0x8c32('0x2a')](_0x8c32('0x2e')),controller[_0x8c32('0x30')]);var upload=multer({'storage':multer[_0x8c32('0x2b')]({'destination':function(_0x2bd086,_0x1fdb48,_0x5aedc6){_0x5aedc6(null,path['join'](config[_0x8c32('0x2c')],_0x8c32('0x2d')));},'filename':function(_0x28476a,_0x301428,_0x26e9d4){_0x26e9d4(null,util[_0x8c32('0x26')](_0x8c32('0x27'),Date['now'](),_0x301428[_0x8c32('0x29')]));}})});router['post'](_0x8c32('0x15'),upload[_0x8c32('0x2a')](_0x8c32('0x2e')),controller[_0x8c32('0x31')]);router[_0x8c32('0x21')](_0x8c32('0x32'),controller[_0x8c32('0x33')]);const offlineUploadMulter=multer({'storage':multer[_0x8c32('0x2b')]({'destination':function(_0x1b0cf8,_0x5ec1ec,_0x46728a){const _0x52cfc9=path[_0x8c32('0x24')](config[_0x8c32('0x2c')],_0x8c32('0x34'),_0x8c32('0x35'),_0x8c32('0x36'));fs_extra[_0x8c32('0x37')](_0x52cfc9,function(){_0x46728a(null,_0x52cfc9);});},'filename':function(_0x2d0ec7,_0x409d21,_0x40cde1){const _0x1c3a35=_0x409d21['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x275a19=path[_0x8c32('0x38')](_0x1c3a35);const _0x5b3201=Date[_0x8c32('0x28')]()+'-'+_0x1c3a35['replace'](_0x275a19,'')+_0x275a19;_0x40cde1(null,_0x5b3201);}})});router['post'](_0x8c32('0x39'),offlineUploadMulter[_0x8c32('0x3a')](),controller[_0x8c32('0x3b')]);router[_0x8c32('0x21')](_0x8c32('0x3c'),auth[_0x8c32('0xa')](),controller['addInteraction']);router['post'](_0x8c32('0x18'),auth[_0x8c32('0xa')](),controller[_0x8c32('0x3d')]);router[_0x8c32('0x21')](_0x8c32('0x19'),auth[_0x8c32('0xa')](),controller['addProactiveActions']);router['post'](_0x8c32('0x1f'),auth['isAuthenticated'](),controller[_0x8c32('0x3e')]);router[_0x8c32('0x3f')]('/:id',auth['isAuthenticated'](),controller[_0x8c32('0x40')]);router[_0x8c32('0x41')](_0x8c32('0xc'),auth[_0x8c32('0xa')](),controller[_0x8c32('0x42')]);router['delete'](_0x8c32('0xe'),auth[_0x8c32('0xa')](),controller[_0x8c32('0x43')]);router[_0x8c32('0x41')](_0x8c32('0xf'),auth[_0x8c32('0xa')](),controller['removeAnswers']);router[_0x8c32('0x41')](_0x8c32('0x1f'),auth[_0x8c32('0xa')](),controller['removeAgents']);module[_0x8c32('0x44')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index d518e78..f773f84 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xdd9c=['app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','isAuthenticated','exports','beaver-logger/server','../config/environment','Router','env','production'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0xdd9c,0x14d));var _0xcdd9=function(_0x7ca77d,_0x3ad1ed){_0x7ca77d=_0x7ca77d-0x0;var _0x40e85b=_0xdd9c[_0x7ca77d];return _0x40e85b;};var beaverLogger=require(_0xcdd9('0x0'));var express=require('express');var auth=require('../components/auth/service');var config=require(_0xcdd9('0x1'));var router=express[_0xcdd9('0x2')]();var isProduction=config[_0xcdd9('0x3')]===_0xcdd9('0x4')||![];function clientSideLogs(_0x34ce9f,_0x59a70a,_0xccfb39){var _0x5b5f41=_0x34ce9f[_0xcdd9('0x5')][_0xcdd9('0x6')](_0xcdd9('0x7'));if(!_0x5b5f41){throw new Error(_0xcdd9('0x8'));}return beaverLogger[_0xcdd9('0x9')]({'uri':_0xcdd9('0xa'),'logger':_0x5b5f41,'enableCors':!isProduction})(_0x34ce9f,_0x59a70a,_0xccfb39);}router['use'](auth[_0xcdd9('0xb')](),clientSideLogs);module[_0xcdd9('0xc')]=router;
\ No newline at end of file
+var _0x6010=['exports','beaver-logger/server','express','../config/environment','Router','env','app','Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','isAuthenticated'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6010,0x145));var _0x0601=function(_0x5b59f5,_0x36bf1a){_0x5b59f5=_0x5b59f5-0x0;var _0x484a52=_0x6010[_0x5b59f5];return _0x484a52;};var beaverLogger=require(_0x0601('0x0'));var express=require(_0x0601('0x1'));var auth=require('../components/auth/service');var config=require(_0x0601('0x2'));var router=express[_0x0601('0x3')]();var isProduction=config[_0x0601('0x4')]==='production'||![];function clientSideLogs(_0x568dc0,_0x118501,_0x89186c){var _0x4351db=_0x568dc0[_0x0601('0x5')]['get']('client-side-logger');if(!_0x4351db){throw new Error(_0x0601('0x6'));}return beaverLogger[_0x0601('0x7')]({'uri':_0x0601('0x8'),'logger':_0x4351db,'enableCors':!isProduction})(_0x568dc0,_0x118501,_0x89186c);}router[_0x0601('0x9')](auth[_0x0601('0xa')](),clientSideLogs);module[_0x0601('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 41b7f8a..068a9d7 100644
--- a/server/api/cloudProvider/cloudProvider.attributes.js
+++ b/server/api/cloudProvider/cloudProvider.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5e0d=['MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret'];(function(_0xa0bad7,_0x145b2e){var _0x50ab20=function(_0x80b2eb){while(--_0x80b2eb){_0xa0bad7['push'](_0xa0bad7['shift']());}};_0x50ab20(++_0x145b2e);}(_0x5e0d,0x145));var _0xd5e0=function(_0x4e93a9,_0x413f30){_0x4e93a9=_0x4e93a9-0x0;var _0x43013c=_0x5e0d[_0x4e93a9];return _0x43013c;};'use strict';var Sequelize=require(_0xd5e0('0x0'));module[_0xd5e0('0x1')]={'name':{'type':Sequelize[_0xd5e0('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd5e0('0x3')](_0xd5e0('0x4'),_0xd5e0('0x5'),_0xd5e0('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xd5e0('0x7'),'Dynamics365')},'data1':{'type':Sequelize[_0xd5e0('0x2')],'comment':_0xd5e0('0x8')},'data2':{'type':Sequelize[_0xd5e0('0x2')],'comment':_0xd5e0('0x9')},'data3':{'type':Sequelize[_0xd5e0('0x2')],'comment':_0xd5e0('0xa')},'data4':{'type':Sequelize[_0xd5e0('0x2')],'comment':_0xd5e0('0xb')},'data5':{'type':Sequelize['TEXT'],'comment':_0xd5e0('0xc')},'data6':{'type':Sequelize[_0xd5e0('0xd')],'comment':_0xd5e0('0xe')},'data7':{'type':Sequelize['TEXT'],'comment':_0xd5e0('0xf')}};
\ No newline at end of file
+var _0xb841=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM','AmazonAWS','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x43c8d9,_0x750f46){var _0x3eb896=function(_0x2ae674){while(--_0x2ae674){_0x43c8d9['push'](_0x43c8d9['shift']());}};_0x3eb896(++_0x750f46);}(_0xb841,0x17b));var _0x1b84=function(_0x34dd30,_0x20f106){_0x34dd30=_0x34dd30-0x0;var _0x2b1f5d=_0xb841[_0x34dd30];return _0x2b1f5d;};'use strict';var Sequelize=require(_0x1b84('0x0'));module[_0x1b84('0x1')]={'name':{'type':Sequelize[_0x1b84('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x1b84('0x3')](_0x1b84('0x4'),'Google',_0x1b84('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x1b84('0x6'),_0x1b84('0x7'))},'data1':{'type':Sequelize[_0x1b84('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize['STRING'],'comment':_0x1b84('0x8')},'data3':{'type':Sequelize[_0x1b84('0x2')],'comment':_0x1b84('0x9')},'data4':{'type':Sequelize[_0x1b84('0x2')],'comment':_0x1b84('0xa')},'data5':{'type':Sequelize[_0x1b84('0xb')],'comment':_0x1b84('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0x1b84('0xd')},'data7':{'type':Sequelize[_0x1b84('0xb')],'comment':_0x1b84('0xe')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index d03b90a..f14dc25 100644
--- a/server/api/cloudProvider/cloudProvider.controller.js
+++ b/server/api/cloudProvider/cloudProvider.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91a9=['Unable\x20to\x20validate\x20id_token','del','code','access_token','data6','refresh_token','update','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','../../mysqldb','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','then','destroy','stack','name','send','padEnd','slice','index','map','CloudProvider','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','findAll','decryptString','data3','show','fields','include','options','find','service','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','rawAttributes','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','MicrosoftAzure','encryptString','params','oauth2MicrosoftAuthorize','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','error','state','Invalid\x20state\x20parameter','from','toString','ascii','parse','oauth2Claims'];(function(_0x527bf7,_0x326b0b){var _0xf96393=function(_0x3e9455){while(--_0x3e9455){_0x527bf7['push'](_0x527bf7['shift']());}};_0xf96393(++_0x326b0b);}(_0x91a9,0x190));var _0x991a=function(_0x1dc1b1,_0x11b2f2){_0x1dc1b1=_0x1dc1b1-0x0;var _0x22e85a=_0x91a9[_0x1dc1b1];return _0x22e85a;};'use strict';var _=require('lodash');var Redis=require(_0x991a('0x0'));var qs=require(_0x991a('0x1'));var encryptor=require(_0x991a('0x2'));var config=require('../../config/environment');var logger=require(_0x991a('0x3'))(_0x991a('0x4'));var db=require(_0x991a('0x5'))['db'];var oauth=require(_0x991a('0x6'));config[_0x991a('0x7')]=_[_0x991a('0x8')](config['redis'],{'host':_0x991a('0x9'),'port':0x18eb});var socket=require(_0x991a('0xa'))(new Redis(config[_0x991a('0x7')]));var redis=new Redis(config[_0x991a('0x7')]);function respondWithStatusCode(_0x5a9a11,_0x5b8871){_0x5b8871=_0x5b8871||0xcc;return function(_0x1f0c1f){if(_0x1f0c1f){return _0x5a9a11[_0x991a('0xb')](_0x5b8871);}return _0x5a9a11[_0x991a('0xc')](_0x5b8871)[_0x991a('0xd')]();};}function respondWithResult(_0x54e05e,_0x45e877){_0x45e877=_0x45e877||0xc8;return function(_0x546bb7){if(_0x546bb7){return _0x54e05e[_0x991a('0xc')](_0x45e877)[_0x991a('0xe')](_0x546bb7);}};}function respondWithFilteredResult(_0x146732,_0x56ebf8){return function(_0x4a2f43){if(_0x4a2f43){var _0x580be8=typeof _0x56ebf8[_0x991a('0xf')]==='undefined'&&typeof _0x56ebf8[_0x991a('0x10')]===_0x991a('0x11');var _0x221ac3=_0x4a2f43[_0x991a('0x12')];var _0x579912=_0x580be8?0x0:_0x56ebf8['offset'];var _0x2188a9=_0x580be8?_0x4a2f43[_0x991a('0x12')]:_0x56ebf8['offset']+_0x56ebf8[_0x991a('0x10')];var _0x5df7ee;if(_0x2188a9>=_0x221ac3){_0x2188a9=_0x221ac3;_0x5df7ee=0xc8;}else{_0x5df7ee=0xce;}_0x146732['status'](_0x5df7ee);return _0x146732[_0x991a('0x13')](_0x991a('0x14'),_0x579912+'-'+_0x2188a9+'/'+_0x221ac3)[_0x991a('0xe')](_0x4a2f43);}return null;};}function saveUpdates(_0x32cab2){return function(_0x10c6bd){if(_0x10c6bd){return _0x10c6bd['update'](_0x32cab2)[_0x991a('0x15')](function(_0x3f0219){return _0x3f0219;});}return null;};}function removeEntity(_0x34d1a0){return function(_0xcfdd7f){if(_0xcfdd7f){return _0xcfdd7f[_0x991a('0x16')]()[_0x991a('0x15')](function(){_0x34d1a0[_0x991a('0xc')](0xcc)[_0x991a('0xd')]();});}};}function handleEntityNotFound(_0x19706c){return function(_0x3c6956){if(!_0x3c6956){_0x19706c['sendStatus'](0x194);}return _0x3c6956;};}function handleError(_0x27e288,_0x2264d4){_0x2264d4=_0x2264d4||0x1f4;return function(_0x2f43e2){logger['error'](_0x2f43e2[_0x991a('0x17')]);if(_0x2f43e2[_0x991a('0x18')]){delete _0x2f43e2[_0x991a('0x18')];}_0x27e288[_0x991a('0xc')](_0x2264d4)[_0x991a('0x19')](_0x2f43e2);};}function maskClientSecret(_0x188bba){return _[_0x991a('0x1a')](_0x188bba[_0x991a('0x1b')](0x0,0x3),0x14,'*');}exports[_0x991a('0x1c')]=function(_0x1a7074,_0x4c5303){var _0x58d0a2={},_0x486021={},_0x2a4be5={'count':0x0,'rows':[]};var _0x1a205b=_[_0x991a('0x1d')](db[_0x991a('0x1e')]['rawAttributes'],function(_0x5e285a){return{'name':_0x5e285a['fieldName'],'type':_0x5e285a[_0x991a('0x1f')]['key']};});_0x486021[_0x991a('0x20')]=_[_0x991a('0x1d')](_0x1a205b,_0x991a('0x18'));_0x486021[_0x991a('0x21')]=_[_0x991a('0x22')](_0x1a7074[_0x991a('0x21')]);_0x486021[_0x991a('0x23')]=_[_0x991a('0x24')](_0x486021[_0x991a('0x20')],_0x486021[_0x991a('0x21')]);_0x58d0a2[_0x991a('0x25')]=_['intersection'](_0x486021['model'],qs['fields'](_0x1a7074[_0x991a('0x21')]['fields']));_0x58d0a2[_0x991a('0x25')]=_0x58d0a2[_0x991a('0x25')][_0x991a('0x26')]?_0x58d0a2[_0x991a('0x25')]:_0x486021[_0x991a('0x20')];if(!_0x1a7074[_0x991a('0x21')][_0x991a('0x27')](_0x991a('0x28'))){_0x58d0a2['limit']=qs['limit'](_0x1a7074[_0x991a('0x21')][_0x991a('0x10')]);_0x58d0a2['offset']=qs[_0x991a('0xf')](_0x1a7074[_0x991a('0x21')]['offset']);}_0x58d0a2[_0x991a('0x29')]=qs[_0x991a('0x2a')](_0x1a7074[_0x991a('0x21')]['sort']);_0x58d0a2['where']=qs[_0x991a('0x23')](_[_0x991a('0x2b')](_0x1a7074[_0x991a('0x21')],_0x486021[_0x991a('0x23')]),_0x1a205b);if(_0x1a7074[_0x991a('0x21')]['filter']){_0x58d0a2[_0x991a('0x2c')]=_[_0x991a('0x2d')](_0x58d0a2[_0x991a('0x2c')],{'$or':_[_0x991a('0x1d')](_0x1a205b,function(_0x23f1af){if(_0x23f1af[_0x991a('0x1f')]!==_0x991a('0x2e')){var _0x2a083e={};_0x2a083e[_0x23f1af[_0x991a('0x18')]]={'$like':'%'+_0x1a7074[_0x991a('0x21')]['filter']+'%'};return _0x2a083e;}})});}_0x58d0a2=_[_0x991a('0x2d')]({},_0x58d0a2,_0x1a7074['options']);var _0x5874df={'where':_0x58d0a2['where']};return db[_0x991a('0x1e')][_0x991a('0x12')](_0x5874df)[_0x991a('0x15')](function(_0xb8211a){_0x2a4be5['count']=_0xb8211a;if(_0x1a7074['query']['includeAll']){_0x58d0a2['include']=[{'all':!![]}];}return db[_0x991a('0x1e')][_0x991a('0x2f')](_0x58d0a2);})[_0x991a('0x15')](function(_0x6beaab){_0x2a4be5['rows']=_[_0x991a('0x1d')](_0x6beaab,function(_0x45638c){if(_0x45638c['service']==='MicrosoftAzure'){var _0x829557=encryptor[_0x991a('0x30')](_0x45638c['data3']);_0x45638c[_0x991a('0x31')]=maskClientSecret(_0x829557);}return _0x45638c;});return _0x2a4be5;})[_0x991a('0x15')](respondWithFilteredResult(_0x4c5303,_0x58d0a2))['catch'](handleError(_0x4c5303,null));};exports[_0x991a('0x32')]=function(_0x4c0235,_0x4e8c22){var _0x5378b3={'raw':!![],'where':{'id':_0x4c0235['params']['id']}},_0x2fcde3={};_0x2fcde3[_0x991a('0x20')]=_['keys'](db['CloudProvider']['rawAttributes']);_0x2fcde3[_0x991a('0x21')]=_[_0x991a('0x22')](_0x4c0235[_0x991a('0x21')]);_0x2fcde3[_0x991a('0x23')]=_[_0x991a('0x24')](_0x2fcde3[_0x991a('0x20')],_0x2fcde3[_0x991a('0x21')]);_0x5378b3[_0x991a('0x25')]=_[_0x991a('0x24')](_0x2fcde3['model'],qs[_0x991a('0x33')](_0x4c0235['query'][_0x991a('0x33')]));_0x5378b3['attributes']=_0x5378b3[_0x991a('0x25')][_0x991a('0x26')]?_0x5378b3[_0x991a('0x25')]:_0x2fcde3[_0x991a('0x20')];if(_0x4c0235[_0x991a('0x21')]['includeAll']){_0x5378b3[_0x991a('0x34')]=[{'all':!![]}];}_0x5378b3=_['merge']({},_0x5378b3,_0x4c0235[_0x991a('0x35')]);return db[_0x991a('0x1e')][_0x991a('0x36')](_0x5378b3)[_0x991a('0x15')](handleEntityNotFound(_0x4e8c22,null))[_0x991a('0x15')](function(_0x5a3641){if(_0x5a3641[_0x991a('0x37')]==='MicrosoftAzure'){var _0x5c1e99=encryptor['decryptString'](_0x5a3641[_0x991a('0x31')]);_0x5a3641[_0x991a('0x31')]=maskClientSecret(_0x5c1e99);}return _0x5a3641;})['then'](respondWithResult(_0x4e8c22,null))[_0x991a('0x38')](handleError(_0x4e8c22,null));};exports[_0x991a('0x39')]=function(_0x56d2bf,_0x350179){if(!_0x56d2bf[_0x991a('0x3a')][_0x991a('0x18')])throw new Error(_0x991a('0x3b'));if(!_0x56d2bf[_0x991a('0x3a')][_0x991a('0x37')])throw new Error(_0x991a('0x3c'));var _0x4d103b=db[_0x991a('0x1e')][_0x991a('0x3d')]['service'][_0x991a('0x3e')];if(!_0x4d103b['includes'](_0x56d2bf[_0x991a('0x3a')]['service']))throw new Error(_0x991a('0x3f')+_0x4d103b[_0x991a('0x40')](',\x20'));if(_0x56d2bf[_0x991a('0x3a')][_0x991a('0x37')]===_0x991a('0x41')&&_0x56d2bf[_0x991a('0x3a')][_0x991a('0x31')]){_0x56d2bf['body'][_0x991a('0x31')]=encryptor[_0x991a('0x42')](_0x56d2bf[_0x991a('0x3a')]['data3']);}return db[_0x991a('0x1e')][_0x991a('0x39')](_0x56d2bf[_0x991a('0x3a')],{})[_0x991a('0x15')](respondWithResult(_0x350179,0xc9))['catch'](handleError(_0x350179,null));};exports['update']=function(_0x1f3fc3,_0x179ad0){if(_0x1f3fc3['body']['id']){delete _0x1f3fc3[_0x991a('0x3a')]['id'];}return db['CloudProvider']['find']({'where':{'id':_0x1f3fc3[_0x991a('0x43')]['id']}})[_0x991a('0x15')](handleEntityNotFound(_0x179ad0,null))[_0x991a('0x15')](function(_0x41e41e){if(_0x41e41e[_0x991a('0x37')]==='MicrosoftAzure'&&_0x1f3fc3[_0x991a('0x3a')][_0x991a('0x31')]){_0x1f3fc3[_0x991a('0x3a')][_0x991a('0x31')]=encryptor['encryptString'](_0x1f3fc3[_0x991a('0x3a')][_0x991a('0x31')]);}return _0x41e41e;})[_0x991a('0x15')](saveUpdates(_0x1f3fc3['body'],null))[_0x991a('0x15')](respondWithResult(_0x179ad0,null))[_0x991a('0x38')](handleError(_0x179ad0,null));};exports[_0x991a('0x16')]=function(_0x34f9d0,_0x409caf){return db[_0x991a('0x1e')][_0x991a('0x36')]({'where':{'id':_0x34f9d0[_0x991a('0x43')]['id']}})[_0x991a('0x15')](handleEntityNotFound(_0x409caf,null))['then'](removeEntity(_0x409caf,null))['catch'](handleError(_0x409caf,null));};exports[_0x991a('0x44')]=function(_0x4c529f,_0x4c6252){return db[_0x991a('0x1e')]['findOne']({'where':{'id':_0x4c529f[_0x991a('0x43')]['id']},'raw':!![]})[_0x991a('0x15')](function(_0x57fad0){if(!_0x57fad0)return _0x4c6252[_0x991a('0xb')](0x194);return{'url':oauth[_0x991a('0x45')](_0x57fad0,_0x4c529f[_0x991a('0x46')]['id'])};})[_0x991a('0x15')](respondWithResult(_0x4c6252,null))[_0x991a('0x38')](handleError(_0x4c6252,null));};exports[_0x991a('0x47')]=function(_0x5609a0,_0x2f9ab7){var _0x318f62=_0x5609a0[_0x991a('0x3a')];var _0x9d53ed;var _0x2105bc;if(_0x318f62[_0x991a('0x48')])throw _0x318f62;redis['get'](_0x318f62[_0x991a('0x49')])[_0x991a('0x15')](function(_0x46d9cd){if(!_0x46d9cd)throw new Error(_0x991a('0x4a'));_0x9d53ed=JSON['parse'](_0x46d9cd);var _0x3255c7=Buffer[_0x991a('0x4b')](_0x318f62[_0x991a('0x49')],'base64')[_0x991a('0x4c')](_0x991a('0x4d'));_0x2105bc=JSON[_0x991a('0x4e')](_0x3255c7);if(!oauth['isValidIdToken'](_0x318f62['id_token'],_0x9d53ed[_0x991a('0x4f')]))throw new Error(_0x991a('0x50'));redis[_0x991a('0x51')](_0x318f62[_0x991a('0x49')]);return oauth['getOauth2MicrosoftAccessToken'](_0x318f62[_0x991a('0x52')],_0x9d53ed);})[_0x991a('0x15')](function(_0x349256){_0x9d53ed['data5']=_0x349256[_0x991a('0x53')];_0x9d53ed[_0x991a('0x54')]=_0x349256[_0x991a('0x55')];return db[_0x991a('0x1e')][_0x991a('0x56')]({'data5':_0x9d53ed[_0x991a('0x57')],'data6':_0x9d53ed[_0x991a('0x54')]},{'where':{'id':_0x9d53ed['id']}});})[_0x991a('0x15')](function(){oauth[_0x991a('0x58')](_0x9d53ed);socket[_0x991a('0x59')](_0x991a('0x5a'),{'id':_0x2105bc['id']});return;})[_0x991a('0x15')](respondWithStatusCode(_0x2f9ab7,null))[_0x991a('0x38')](function(_0x5a56fc){if(_0x2105bc){socket['emit'](_0x991a('0x5b'),{'id':_0x2105bc['id']});}if(!_0x9d53ed){logger['error'](_0x991a('0x5c'),_0x5a56fc);return _0x2f9ab7[_0x991a('0xc')](0x1f4)['send'](_0x5a56fc[_0x991a('0x5d')]);}logger[_0x991a('0x48')](_0x991a('0x5e'),_0x9d53ed['id'],JSON[_0x991a('0x5f')](_0x5a56fc));});};
\ No newline at end of file
+var _0x47ee=['sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','service','MicrosoftAzure','data3','catch','show','params','length','find','decryptString','create','body','Name\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','join','encryptString','destroy','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','startRefreshInterval','emit','microsoftAuthorization:success','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','limit','undefined','count','offset','set','update','then','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order'];(function(_0x3dacf8,_0x4d6188){var _0x9cb0fa=function(_0x1098bd){while(--_0x1098bd){_0x3dacf8['push'](_0x3dacf8['shift']());}};_0x9cb0fa(++_0x4d6188);}(_0x47ee,0x148));var _0xe47e=function(_0x4f1210,_0x4ab68a){_0x4f1210=_0x4f1210-0x0;var _0x5c24ed=_0x47ee[_0x4f1210];return _0x5c24ed;};'use strict';var _=require(_0xe47e('0x0'));var Redis=require('ioredis');var qs=require(_0xe47e('0x1'));var encryptor=require(_0xe47e('0x2'));var config=require('../../config/environment');var logger=require(_0xe47e('0x3'))(_0xe47e('0x4'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xe47e('0x5')]=_[_0xe47e('0x6')](config['redis'],{'host':_0xe47e('0x7'),'port':0x18eb});var socket=require(_0xe47e('0x8'))(new Redis(config[_0xe47e('0x5')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x1f3aab,_0x2bdf09){_0x2bdf09=_0x2bdf09||0xcc;return function(_0x57cd75){if(_0x57cd75){return _0x1f3aab[_0xe47e('0x9')](_0x2bdf09);}return _0x1f3aab[_0xe47e('0xa')](_0x2bdf09)[_0xe47e('0xb')]();};}function respondWithResult(_0x1f4058,_0x483751){_0x483751=_0x483751||0xc8;return function(_0x19952f){if(_0x19952f){return _0x1f4058[_0xe47e('0xa')](_0x483751)['json'](_0x19952f);}};}function respondWithFilteredResult(_0x2e1024,_0x53abff){return function(_0x2092c5){if(_0x2092c5){var _0x23c29c=typeof _0x53abff['offset']==='undefined'&&typeof _0x53abff[_0xe47e('0xc')]===_0xe47e('0xd');var _0x2985db=_0x2092c5[_0xe47e('0xe')];var _0x5c1b04=_0x23c29c?0x0:_0x53abff[_0xe47e('0xf')];var _0x5abd16=_0x23c29c?_0x2092c5[_0xe47e('0xe')]:_0x53abff[_0xe47e('0xf')]+_0x53abff[_0xe47e('0xc')];var _0x2675c0;if(_0x5abd16>=_0x2985db){_0x5abd16=_0x2985db;_0x2675c0=0xc8;}else{_0x2675c0=0xce;}_0x2e1024[_0xe47e('0xa')](_0x2675c0);return _0x2e1024[_0xe47e('0x10')]('Content-Range',_0x5c1b04+'-'+_0x5abd16+'/'+_0x2985db)['json'](_0x2092c5);}return null;};}function saveUpdates(_0x3c92ce){return function(_0x507bcc){if(_0x507bcc){return _0x507bcc[_0xe47e('0x11')](_0x3c92ce)[_0xe47e('0x12')](function(_0x27b27d){return _0x27b27d;});}return null;};}function removeEntity(_0x481660){return function(_0x257d43){if(_0x257d43){return _0x257d43['destroy']()['then'](function(){_0x481660[_0xe47e('0xa')](0xcc)[_0xe47e('0xb')]();});}};}function handleEntityNotFound(_0x1c8d0d){return function(_0x16c08b){if(!_0x16c08b){_0x1c8d0d[_0xe47e('0x9')](0x194);}return _0x16c08b;};}function handleError(_0x494c7e,_0x3fdc1c){_0x3fdc1c=_0x3fdc1c||0x1f4;return function(_0x2403e7){logger[_0xe47e('0x13')](_0x2403e7['stack']);if(_0x2403e7['name']){delete _0x2403e7[_0xe47e('0x14')];}_0x494c7e[_0xe47e('0xa')](_0x3fdc1c)[_0xe47e('0x15')](_0x2403e7);};}function maskClientSecret(_0x33edbf){return _[_0xe47e('0x16')](_0x33edbf[_0xe47e('0x17')](0x0,0x3),0x14,'*');}exports[_0xe47e('0x18')]=function(_0xb9e661,_0x13ccdb){var _0x1b34fa={},_0x2b7342={},_0x526c11={'count':0x0,'rows':[]};var _0x252a44=_[_0xe47e('0x19')](db[_0xe47e('0x1a')][_0xe47e('0x1b')],function(_0x1ec852){return{'name':_0x1ec852[_0xe47e('0x1c')],'type':_0x1ec852[_0xe47e('0x1d')][_0xe47e('0x1e')]};});_0x2b7342[_0xe47e('0x1f')]=_[_0xe47e('0x19')](_0x252a44,_0xe47e('0x14'));_0x2b7342[_0xe47e('0x20')]=_[_0xe47e('0x21')](_0xb9e661[_0xe47e('0x20')]);_0x2b7342[_0xe47e('0x22')]=_[_0xe47e('0x23')](_0x2b7342['model'],_0x2b7342[_0xe47e('0x20')]);_0x1b34fa[_0xe47e('0x24')]=_[_0xe47e('0x23')](_0x2b7342[_0xe47e('0x1f')],qs['fields'](_0xb9e661[_0xe47e('0x20')][_0xe47e('0x25')]));_0x1b34fa[_0xe47e('0x24')]=_0x1b34fa['attributes']['length']?_0x1b34fa[_0xe47e('0x24')]:_0x2b7342[_0xe47e('0x1f')];if(!_0xb9e661[_0xe47e('0x20')][_0xe47e('0x26')]('nolimit')){_0x1b34fa[_0xe47e('0xc')]=qs[_0xe47e('0xc')](_0xb9e661[_0xe47e('0x20')]['limit']);_0x1b34fa[_0xe47e('0xf')]=qs[_0xe47e('0xf')](_0xb9e661[_0xe47e('0x20')][_0xe47e('0xf')]);}_0x1b34fa[_0xe47e('0x27')]=qs[_0xe47e('0x28')](_0xb9e661[_0xe47e('0x20')][_0xe47e('0x28')]);_0x1b34fa[_0xe47e('0x29')]=qs[_0xe47e('0x22')](_[_0xe47e('0x2a')](_0xb9e661['query'],_0x2b7342[_0xe47e('0x22')]),_0x252a44);if(_0xb9e661[_0xe47e('0x20')][_0xe47e('0x2b')]){_0x1b34fa['where']=_['merge'](_0x1b34fa[_0xe47e('0x29')],{'$or':_[_0xe47e('0x19')](_0x252a44,function(_0x338026){if(_0x338026['type']!==_0xe47e('0x2c')){var _0x50075e={};_0x50075e[_0x338026[_0xe47e('0x14')]]={'$like':'%'+_0xb9e661[_0xe47e('0x20')][_0xe47e('0x2b')]+'%'};return _0x50075e;}})});}_0x1b34fa=_[_0xe47e('0x2d')]({},_0x1b34fa,_0xb9e661[_0xe47e('0x2e')]);var _0x4c4f68={'where':_0x1b34fa[_0xe47e('0x29')]};return db[_0xe47e('0x1a')][_0xe47e('0xe')](_0x4c4f68)['then'](function(_0x4e7a4d){_0x526c11[_0xe47e('0xe')]=_0x4e7a4d;if(_0xb9e661[_0xe47e('0x20')][_0xe47e('0x2f')]){_0x1b34fa[_0xe47e('0x30')]=[{'all':!![]}];}return db[_0xe47e('0x1a')]['findAll'](_0x1b34fa);})[_0xe47e('0x12')](function(_0x3e05aa){_0x526c11[_0xe47e('0x31')]=_[_0xe47e('0x19')](_0x3e05aa,function(_0x260478){if(_0x260478[_0xe47e('0x32')]===_0xe47e('0x33')){var _0x4d08b0=encryptor['decryptString'](_0x260478[_0xe47e('0x34')]);_0x260478[_0xe47e('0x34')]=maskClientSecret(_0x4d08b0);}return _0x260478;});return _0x526c11;})[_0xe47e('0x12')](respondWithFilteredResult(_0x13ccdb,_0x1b34fa))[_0xe47e('0x35')](handleError(_0x13ccdb,null));};exports[_0xe47e('0x36')]=function(_0x1973f6,_0x540de5){var _0x232ba0={'raw':!![],'where':{'id':_0x1973f6[_0xe47e('0x37')]['id']}},_0x184be0={};_0x184be0[_0xe47e('0x1f')]=_[_0xe47e('0x21')](db[_0xe47e('0x1a')][_0xe47e('0x1b')]);_0x184be0[_0xe47e('0x20')]=_[_0xe47e('0x21')](_0x1973f6[_0xe47e('0x20')]);_0x184be0['filters']=_['intersection'](_0x184be0[_0xe47e('0x1f')],_0x184be0[_0xe47e('0x20')]);_0x232ba0[_0xe47e('0x24')]=_['intersection'](_0x184be0[_0xe47e('0x1f')],qs['fields'](_0x1973f6[_0xe47e('0x20')][_0xe47e('0x25')]));_0x232ba0[_0xe47e('0x24')]=_0x232ba0[_0xe47e('0x24')][_0xe47e('0x38')]?_0x232ba0[_0xe47e('0x24')]:_0x184be0[_0xe47e('0x1f')];if(_0x1973f6[_0xe47e('0x20')][_0xe47e('0x2f')]){_0x232ba0[_0xe47e('0x30')]=[{'all':!![]}];}_0x232ba0=_[_0xe47e('0x2d')]({},_0x232ba0,_0x1973f6[_0xe47e('0x2e')]);return db[_0xe47e('0x1a')][_0xe47e('0x39')](_0x232ba0)[_0xe47e('0x12')](handleEntityNotFound(_0x540de5,null))[_0xe47e('0x12')](function(_0x1392a0){if(_0x1392a0[_0xe47e('0x32')]==='MicrosoftAzure'){var _0x1a9552=encryptor[_0xe47e('0x3a')](_0x1392a0[_0xe47e('0x34')]);_0x1392a0[_0xe47e('0x34')]=maskClientSecret(_0x1a9552);}return _0x1392a0;})[_0xe47e('0x12')](respondWithResult(_0x540de5,null))[_0xe47e('0x35')](handleError(_0x540de5,null));};exports[_0xe47e('0x3b')]=function(_0x363aeb,_0x5f0881){if(!_0x363aeb[_0xe47e('0x3c')][_0xe47e('0x14')])throw new Error(_0xe47e('0x3d'));if(!_0x363aeb[_0xe47e('0x3c')][_0xe47e('0x32')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x382830=db[_0xe47e('0x1a')][_0xe47e('0x1b')][_0xe47e('0x32')][_0xe47e('0x3e')];if(!_0x382830['includes'](_0x363aeb['body'][_0xe47e('0x32')]))throw new Error(_0xe47e('0x3f')+_0x382830[_0xe47e('0x40')](',\x20'));if(_0x363aeb[_0xe47e('0x3c')][_0xe47e('0x32')]===_0xe47e('0x33')&&_0x363aeb['body'][_0xe47e('0x34')]){_0x363aeb[_0xe47e('0x3c')]['data3']=encryptor['encryptString'](_0x363aeb['body']['data3']);}return db[_0xe47e('0x1a')]['create'](_0x363aeb[_0xe47e('0x3c')],{})[_0xe47e('0x12')](respondWithResult(_0x5f0881,0xc9))[_0xe47e('0x35')](handleError(_0x5f0881,null));};exports['update']=function(_0x59faf1,_0x1d6357){if(_0x59faf1[_0xe47e('0x3c')]['id']){delete _0x59faf1[_0xe47e('0x3c')]['id'];}return db[_0xe47e('0x1a')][_0xe47e('0x39')]({'where':{'id':_0x59faf1[_0xe47e('0x37')]['id']}})['then'](handleEntityNotFound(_0x1d6357,null))[_0xe47e('0x12')](function(_0x3529c5){if(_0x3529c5[_0xe47e('0x32')]===_0xe47e('0x33')&&_0x59faf1[_0xe47e('0x3c')][_0xe47e('0x34')]){_0x59faf1[_0xe47e('0x3c')][_0xe47e('0x34')]=encryptor[_0xe47e('0x41')](_0x59faf1[_0xe47e('0x3c')][_0xe47e('0x34')]);}return _0x3529c5;})[_0xe47e('0x12')](saveUpdates(_0x59faf1['body'],null))[_0xe47e('0x12')](respondWithResult(_0x1d6357,null))[_0xe47e('0x35')](handleError(_0x1d6357,null));};exports[_0xe47e('0x42')]=function(_0x3dbb65,_0x222bb5){return db['CloudProvider']['find']({'where':{'id':_0x3dbb65[_0xe47e('0x37')]['id']}})[_0xe47e('0x12')](handleEntityNotFound(_0x222bb5,null))[_0xe47e('0x12')](removeEntity(_0x222bb5,null))[_0xe47e('0x35')](handleError(_0x222bb5,null));};exports[_0xe47e('0x43')]=function(_0x3067ad,_0x2842f2){return db[_0xe47e('0x1a')][_0xe47e('0x44')]({'where':{'id':_0x3067ad[_0xe47e('0x37')]['id']},'raw':!![]})[_0xe47e('0x12')](function(_0xeb692e){if(!_0xeb692e)return _0x2842f2[_0xe47e('0x9')](0x194);return{'url':oauth[_0xe47e('0x45')](_0xeb692e,_0x3067ad['user']['id'])};})[_0xe47e('0x12')](respondWithResult(_0x2842f2,null))[_0xe47e('0x35')](handleError(_0x2842f2,null));};exports[_0xe47e('0x46')]=function(_0x8468b4,_0x32b0c1){var _0x293007=_0x8468b4[_0xe47e('0x3c')];var _0x5e463d;var _0x4e1ce9;if(_0x293007[_0xe47e('0x13')])throw _0x293007;redis[_0xe47e('0x47')](_0x293007[_0xe47e('0x48')])['then'](function(_0x36dd16){if(!_0x36dd16)throw new Error(_0xe47e('0x49'));_0x5e463d=JSON[_0xe47e('0x4a')](_0x36dd16);var _0x14864c=Buffer[_0xe47e('0x4b')](_0x293007[_0xe47e('0x48')],_0xe47e('0x4c'))[_0xe47e('0x4d')]('ascii');_0x4e1ce9=JSON[_0xe47e('0x4a')](_0x14864c);if(!oauth['isValidIdToken'](_0x293007[_0xe47e('0x4e')],_0x5e463d[_0xe47e('0x4f')]))throw new Error(_0xe47e('0x50'));redis[_0xe47e('0x51')](_0x293007[_0xe47e('0x48')]);return oauth[_0xe47e('0x52')](_0x293007[_0xe47e('0x53')],_0x5e463d);})[_0xe47e('0x12')](function(_0x34b825){_0x5e463d[_0xe47e('0x54')]=_0x34b825['access_token'];_0x5e463d[_0xe47e('0x55')]=_0x34b825[_0xe47e('0x56')];return db[_0xe47e('0x1a')][_0xe47e('0x11')]({'data5':_0x5e463d[_0xe47e('0x54')],'data6':_0x5e463d[_0xe47e('0x55')]},{'where':{'id':_0x5e463d['id']}});})['then'](function(){oauth[_0xe47e('0x57')](_0x5e463d);socket[_0xe47e('0x58')](_0xe47e('0x59'),{'id':_0x4e1ce9['id']});return;})[_0xe47e('0x12')](respondWithStatusCode(_0x32b0c1,null))[_0xe47e('0x35')](function(_0x73b466){if(_0x4e1ce9){socket[_0xe47e('0x58')]('microsoftAuthorization:error',{'id':_0x4e1ce9['id']});}if(!_0x5e463d){logger[_0xe47e('0x13')]('Invalid\x20authentication\x20state\x20parameter',_0x73b466);return _0x32b0c1[_0xe47e('0xa')](0x1f4)[_0xe47e('0x15')](_0x73b466[_0xe47e('0x5a')]);}logger[_0xe47e('0x13')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x5e463d['id'],JSON[_0xe47e('0x5b')](_0x73b466));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 422f336..a194245 100644
--- a/server/api/cloudProvider/cloudProvider.model.js
+++ b/server/api/cloudProvider/cloudProvider.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x53ed=['./cloudProvider.attributes','exports','define','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x2f6c84,_0x2d0559){var _0x2d686f=function(_0x12641c){while(--_0x12641c){_0x2f6c84['push'](_0x2f6c84['shift']());}};_0x2d686f(++_0x2d0559);}(_0x53ed,0x1b4));var _0xd53e=function(_0x164274,_0x478d54){_0x164274=_0x164274-0x0;var _0x3a31e9=_0x53ed[_0x164274];return _0x3a31e9;};'use strict';var _=require(_0xd53e('0x0'));var util=require(_0xd53e('0x1'));var logger=require(_0xd53e('0x2'))(_0xd53e('0x3'));var moment=require('moment');var BPromise=require(_0xd53e('0x4'));var rp=require(_0xd53e('0x5'));var fs=require('fs');var path=require(_0xd53e('0x6'));var rimraf=require(_0xd53e('0x7'));var config=require('../../config/environment');var attributes=require(_0xd53e('0x8'));module[_0xd53e('0x9')]=function(_0x39c7aa,_0x170445){return _0x39c7aa[_0xd53e('0xa')]('CloudProvider',attributes,{'tableName':_0xd53e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb458=['../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x169b6d,_0x1580d0){var _0x3b3a31=function(_0x3cb6f9){while(--_0x3cb6f9){_0x169b6d['push'](_0x169b6d['shift']());}};_0x3b3a31(++_0x1580d0);}(_0xb458,0xca));var _0x8b45=function(_0x46b392,_0x59e8bd){_0x46b392=_0x46b392-0x0;var _0x30963a=_0xb458[_0x46b392];return _0x30963a;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))(_0x8b45('0x3'));var moment=require('moment');var BPromise=require(_0x8b45('0x4'));var rp=require(_0x8b45('0x5'));var fs=require('fs');var path=require(_0x8b45('0x6'));var rimraf=require(_0x8b45('0x7'));var config=require(_0x8b45('0x8'));var attributes=require(_0x8b45('0x9'));module[_0x8b45('0xa')]=function(_0x35680c,_0x2a5b3c){return _0x35680c[_0x8b45('0xb')](_0x8b45('0xc'),attributes,{'tableName':_0x8b45('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index acbd29c..44db2f6 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xe19a=['bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','ioredis','util','../../config/environment','../../config/schedule/cloud-provider','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','email','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','push','data7','/.default','join','Outlook365','Dynamics365','replace','{TENANT_ID}','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','response_type','response_mode','form_post','state','nonce','prompt','login','map','key','value','oauth2Claims','decode','iss','audience','isAfter','unix','exp','then','data3','findOne','refresh_token','data6','data4','decryptString','POST','data5','access_token','CloudProvider','update','catch','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','intervals'];(function(_0x5b24a5,_0x35591c){var _0x51736d=function(_0x4d6b48){while(--_0x4d6b48){_0x5b24a5['push'](_0x5b24a5['shift']());}};_0x51736d(++_0x35591c);}(_0xe19a,0xa3));var _0xae19=function(_0x42774c,_0x54b775){_0x42774c=_0x42774c-0x0;var _0x167bbf=_0xe19a[_0x42774c];return _0x167bbf;};'use strict';var _=require(_0xae19('0x0'));var crypto=require(_0xae19('0x1'));var jwt=require(_0xae19('0x2'));var moment=require(_0xae19('0x3'));var Redis=require(_0xae19('0x4'));var rp=require('request-promise');var util=require(_0xae19('0x5'));var encryptor=require('../../components/encryptor');var config=require(_0xae19('0x6'));var logger=require('../../config/logger')('api');var schedule=require(_0xae19('0x7'));var db=require(_0xae19('0x8'))['db'];config['redis']=_[_0xae19('0x9')](config[_0xae19('0xa')],{'host':_0xae19('0xb'),'port':0x18eb});var redis=new Redis(config[_0xae19('0xa')]);var MICROSOFT_AUTH_URL=_0xae19('0xc');var AZURE_AUTH_SCOPES={'Outlook365':[_0xae19('0xd'),'profile',_0xae19('0xe'),'offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All',_0xae19('0xf'),_0xae19('0x10')],'Dynamics365':[_0xae19('0xd'),_0xae19('0x11')]};var MICROSOFT_AUTH_ENDPOINT=_0xae19('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0xae19('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x114180){var _0x540c2a=_['map'](AZURE_AUTH_SCOPES[_0x114180[_0xae19('0x14')]]);if(_0x114180[_0xae19('0x14')]==='Dynamics365')_0x540c2a[_0xae19('0x15')](_0x114180[_0xae19('0x16')]+_0xae19('0x17'));return _0x540c2a[_0xae19('0x18')]('\x20');}function getAccessTokenScope(_0x148755){if(_0x148755['type']===_0xae19('0x19'))return'https://outlook.office365.com/IMAP.AccessAsUser.All';if(_0x148755[_0xae19('0x14')]===_0xae19('0x1a'))return _0x148755[_0xae19('0x16')]+_0xae19('0x17');}function generateMicrosoftAuthorizationUrl(_0x4dac1f,_0x57168f){var _0x29558d=MICROSOFT_AUTH_URL[_0xae19('0x1b')](_0xae19('0x1c'),_0x4dac1f[_0xae19('0x1d')]);var _0x5992b8=[_0xae19('0x1e'),_0xae19('0x1f')];var _0xc49353=Buffer[_0xae19('0x20')](JSON[_0xae19('0x21')]({'id':_0x57168f}))[_0xae19('0x22')](_0xae19('0x23'));var _0x10d500=crypto[_0xae19('0x24')](0x10)[_0xae19('0x22')](_0xae19('0x25'));var _0x33fde3=getAuthorizationScopes(_0x4dac1f);var _0xfc2670=[{'key':'client_id','value':_0x4dac1f[_0xae19('0x26')]},{'key':_0xae19('0x27'),'value':encodeURIComponent(_0x5992b8[_0xae19('0x18')]('\x20'))},{'key':'redirect_uri','value':_0x4dac1f['data4']},{'key':_0xae19('0x28'),'value':_0xae19('0x29')},{'key':'scope','value':encodeURIComponent(_0x33fde3)},{'key':_0xae19('0x2a'),'value':_0xc49353},{'key':_0xae19('0x2b'),'value':_0x10d500},{'key':_0xae19('0x2c'),'value':_0xae19('0x2d')}];var _0x116eea=_0x29558d+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0xae19('0x2e')](_0xfc2670,function(_0x1ce0eb){return _0x1ce0eb[_0xae19('0x2f')]+'='+_0x1ce0eb[_0xae19('0x30')];})[_0xae19('0x18')]('&');_0x4dac1f[_0xae19('0x31')]={'issuer':_0x29558d[_0xae19('0x1b')]('oauth2/',''),'audience':_0x4dac1f[_0xae19('0x26')],'state':_0xc49353,'nonce':_0x10d500};redis['set'](_0xc49353,JSON[_0xae19('0x21')](_0x4dac1f));return _0x116eea;}function isValidIdToken(_0x2a8eef,_0x40f431){try{var _0x44db46=jwt[_0xae19('0x32')](_0x2a8eef,{'complete':!![]});var _0x573f85=_0x44db46['payload'];if(_0x573f85[_0xae19('0x33')]!==_0x40f431['issuer'])return![];if(_0x573f85['aud']!==_0x40f431[_0xae19('0x34')])return![];if(_0x573f85[_0xae19('0x2b')]!==_0x40f431[_0xae19('0x2b')])return![];if(moment()[_0xae19('0x35')](moment[_0xae19('0x36')](_0x573f85[_0xae19('0x37')])))return![];return!![];}catch(_0x4f1c8e){throw _0x4f1c8e;}}function refreshOauth2MicrosoftAccessToken(_0x1d97f0){return Promise['resolve']()[_0xae19('0x38')](function(){if(_0x1d97f0[_0xae19('0x39')])return _0x1d97f0;return db['CloudProvider'][_0xae19('0x3a')]({'where':{'id':_0x1d97f0['id']},'raw':!![]});})[_0xae19('0x38')](function(_0x161a9f){var _0x596b72={'grant_type':_0xae19('0x3b'),'refresh_token':_0x161a9f[_0xae19('0x3c')],'scope':getAccessTokenScope(_0x161a9f),'redirect_uri':_0x161a9f[_0xae19('0x3d')],'client_id':_0x161a9f[_0xae19('0x26')],'client_secret':encryptor[_0xae19('0x3e')](_0x161a9f['data3'])};var _0x5e9d84={'method':_0xae19('0x3f'),'uri':MICROSOFT_AUTH_URL[_0xae19('0x1b')](_0xae19('0x1c'),_0x161a9f[_0xae19('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x596b72,'json':!![]};return rp(_0x5e9d84);})[_0xae19('0x38')](function(_0x42709a){_0x1d97f0[_0xae19('0x40')]=_0x42709a[_0xae19('0x41')];_0x1d97f0[_0xae19('0x3c')]=_0x42709a[_0xae19('0x3b')];return db[_0xae19('0x42')][_0xae19('0x43')]({'data5':_0x1d97f0[_0xae19('0x40')],'data6':_0x1d97f0[_0xae19('0x3c')]},{'where':{'id':_0x1d97f0['id']}});})['then'](function(){return _0x1d97f0;})[_0xae19('0x44')](function(_0x2b7750){logger['error'](_0xae19('0x45'),_0x1d97f0['id'],_0x2b7750);});}function getOauth2MicrosoftAccessToken(_0x394409,_0x576e61){var _0x12cc8c={'grant_type':'authorization_code','code':_0x394409,'scope':getAccessTokenScope(_0x576e61),'redirect_uri':_0x576e61[_0xae19('0x3d')],'client_id':_0x576e61[_0xae19('0x26')],'client_secret':encryptor['decryptString'](_0x576e61[_0xae19('0x39')])};var _0x163e54={'method':_0xae19('0x3f'),'uri':MICROSOFT_AUTH_URL['replace'](_0xae19('0x1c'),_0x576e61['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x12cc8c,'json':!![]};return rp(_0x163e54);}function startRefreshInterval(_0x56019a){var _0x37dfaf=schedule[_0xae19('0x46')];if(_0x37dfaf[_0x56019a['id']])clearInterval(_0x37dfaf[_0x56019a['id']]);_0x37dfaf[_0x56019a['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xae19('0x47')](this,{'id':_0x56019a['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xae19('0x46')]=_0x37dfaf;}function startAllRefreshIntervals(){return db[_0xae19('0x42')][_0xae19('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xae19('0x38')](function(_0x1f4c82){var _0x222512=_0x1f4c82[_0xae19('0x2e')](function(_0x59b75b){return refreshOauth2MicrosoftAccessToken(_0x59b75b)[_0xae19('0x38')](function(_0x1436d8){startRefreshInterval(_0x1436d8);});});return Promise[_0xae19('0x49')](_0x222512);})[_0xae19('0x44')](function(_0x2e64be){var _0x3c47b7=_0x2e64be?util[_0xae19('0x4a')](_0x2e64be,{'showHidden':![],'depth':null}):'';logger[_0xae19('0x4b')](_0xae19('0x4c'),_0x3c47b7);});}module[_0xae19('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x8c48=['isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','data6','data4','decryptString','access_token','refresh_token','data5','catch','authorization_code','POST','bind','intervals','findAll','inspect','exports','lodash','crypto','moment','ioredis','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','localhost','openid','profile','email','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/authorize','map','type','Dynamics365','push','data7','/.default','join','replace','{TENANT_ID}','data2','code','id_token','from','toString','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','scope','state','prompt','login','value','oauth2/','set','decode','payload','iss','issuer','aud','audience'];(function(_0x2bd631,_0x34146e){var _0xfe899a=function(_0x54e093){while(--_0x54e093){_0x2bd631['push'](_0x2bd631['shift']());}};_0xfe899a(++_0x34146e);}(_0x8c48,0xac));var _0x88c4=function(_0x359c24,_0x1328c9){_0x359c24=_0x359c24-0x0;var _0x3d1984=_0x8c48[_0x359c24];return _0x3d1984;};'use strict';var _=require(_0x88c4('0x0'));var crypto=require(_0x88c4('0x1'));var jwt=require('jsonwebtoken');var moment=require(_0x88c4('0x2'));var Redis=require(_0x88c4('0x3'));var rp=require(_0x88c4('0x4'));var util=require('util');var encryptor=require(_0x88c4('0x5'));var config=require(_0x88c4('0x6'));var logger=require(_0x88c4('0x7'))(_0x88c4('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require('../../mysqldb')['db'];config[_0x88c4('0x9')]=_[_0x88c4('0xa')](config['redis'],{'host':_0x88c4('0xb'),'port':0x18eb});var redis=new Redis(config[_0x88c4('0x9')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x88c4('0xc'),_0x88c4('0xd'),_0x88c4('0xe'),'offline_access',_0x88c4('0xf'),_0x88c4('0x10'),_0x88c4('0x11')],'Dynamics365':['openid','offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x88c4('0x12');var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x2e3fe8){var _0x3144f6=_[_0x88c4('0x13')](AZURE_AUTH_SCOPES[_0x2e3fe8['type']]);if(_0x2e3fe8[_0x88c4('0x14')]===_0x88c4('0x15'))_0x3144f6[_0x88c4('0x16')](_0x2e3fe8[_0x88c4('0x17')]+_0x88c4('0x18'));return _0x3144f6[_0x88c4('0x19')]('\x20');}function getAccessTokenScope(_0x2fefbe){if(_0x2fefbe[_0x88c4('0x14')]==='Outlook365')return _0x88c4('0xf');if(_0x2fefbe[_0x88c4('0x14')]===_0x88c4('0x15'))return _0x2fefbe[_0x88c4('0x17')]+_0x88c4('0x18');}function generateMicrosoftAuthorizationUrl(_0xc389f6,_0x9b4870){var _0x31ffc8=MICROSOFT_AUTH_URL[_0x88c4('0x1a')](_0x88c4('0x1b'),_0xc389f6[_0x88c4('0x1c')]);var _0x5defcb=[_0x88c4('0x1d'),_0x88c4('0x1e')];var _0x1543c7=Buffer[_0x88c4('0x1f')](JSON['stringify']({'id':_0x9b4870}))[_0x88c4('0x20')]('base64');var _0x174cbc=crypto[_0x88c4('0x21')](0x10)[_0x88c4('0x20')](_0x88c4('0x22'));var _0x58e30f=getAuthorizationScopes(_0xc389f6);var _0x4efd51=[{'key':_0x88c4('0x23'),'value':_0xc389f6[_0x88c4('0x24')]},{'key':_0x88c4('0x25'),'value':encodeURIComponent(_0x5defcb[_0x88c4('0x19')]('\x20'))},{'key':_0x88c4('0x26'),'value':_0xc389f6['data4']},{'key':_0x88c4('0x27'),'value':'form_post'},{'key':_0x88c4('0x28'),'value':encodeURIComponent(_0x58e30f)},{'key':_0x88c4('0x29'),'value':_0x1543c7},{'key':'nonce','value':_0x174cbc},{'key':_0x88c4('0x2a'),'value':_0x88c4('0x2b')}];var _0x4efe04=_0x31ffc8+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4efd51,function(_0x494789){return _0x494789['key']+'='+_0x494789[_0x88c4('0x2c')];})[_0x88c4('0x19')]('&');_0xc389f6['oauth2Claims']={'issuer':_0x31ffc8['replace'](_0x88c4('0x2d'),''),'audience':_0xc389f6[_0x88c4('0x24')],'state':_0x1543c7,'nonce':_0x174cbc};redis[_0x88c4('0x2e')](_0x1543c7,JSON['stringify'](_0xc389f6));return _0x4efe04;}function isValidIdToken(_0x2ecb1c,_0x49b3e8){try{var _0x271535=jwt[_0x88c4('0x2f')](_0x2ecb1c,{'complete':!![]});var _0x3dee13=_0x271535[_0x88c4('0x30')];if(_0x3dee13[_0x88c4('0x31')]!==_0x49b3e8[_0x88c4('0x32')])return![];if(_0x3dee13[_0x88c4('0x33')]!==_0x49b3e8[_0x88c4('0x34')])return![];if(_0x3dee13['nonce']!==_0x49b3e8['nonce'])return![];if(moment()[_0x88c4('0x35')](moment[_0x88c4('0x36')](_0x3dee13[_0x88c4('0x37')])))return![];return!![];}catch(_0x27d587){throw _0x27d587;}}function refreshOauth2MicrosoftAccessToken(_0x490c59){return Promise[_0x88c4('0x38')]()[_0x88c4('0x39')](function(){if(_0x490c59[_0x88c4('0x3a')])return _0x490c59;return db[_0x88c4('0x3b')][_0x88c4('0x3c')]({'where':{'id':_0x490c59['id']},'raw':!![]});})['then'](function(_0x4ce586){var _0x8b0cce={'grant_type':'refresh_token','refresh_token':_0x4ce586[_0x88c4('0x3d')],'scope':getAccessTokenScope(_0x4ce586),'redirect_uri':_0x4ce586[_0x88c4('0x3e')],'client_id':_0x4ce586[_0x88c4('0x24')],'client_secret':encryptor[_0x88c4('0x3f')](_0x4ce586[_0x88c4('0x3a')])};var _0x196a5f={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x88c4('0x1a')](_0x88c4('0x1b'),_0x4ce586[_0x88c4('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x8b0cce,'json':!![]};return rp(_0x196a5f);})[_0x88c4('0x39')](function(_0x3934d4){_0x490c59['data5']=_0x3934d4[_0x88c4('0x40')];_0x490c59[_0x88c4('0x3d')]=_0x3934d4[_0x88c4('0x41')];return db[_0x88c4('0x3b')]['update']({'data5':_0x490c59[_0x88c4('0x42')],'data6':_0x490c59[_0x88c4('0x3d')]},{'where':{'id':_0x490c59['id']}});})[_0x88c4('0x39')](function(){return _0x490c59;})[_0x88c4('0x43')](function(_0x4a1aa0){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x490c59['id'],_0x4a1aa0);});}function getOauth2MicrosoftAccessToken(_0x55d5d8,_0x4d510f){var _0x321026={'grant_type':_0x88c4('0x44'),'code':_0x55d5d8,'scope':getAccessTokenScope(_0x4d510f),'redirect_uri':_0x4d510f[_0x88c4('0x3e')],'client_id':_0x4d510f[_0x88c4('0x24')],'client_secret':encryptor['decryptString'](_0x4d510f['data3'])};var _0x4de286={'method':_0x88c4('0x45'),'uri':MICROSOFT_AUTH_URL[_0x88c4('0x1a')]('{TENANT_ID}',_0x4d510f[_0x88c4('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x321026,'json':!![]};return rp(_0x4de286);}function startRefreshInterval(_0x2488dc){var _0x6c198e=schedule['intervals'];if(_0x6c198e[_0x2488dc['id']])clearInterval(_0x6c198e[_0x2488dc['id']]);_0x6c198e[_0x2488dc['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x88c4('0x46')](this,{'id':_0x2488dc['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x88c4('0x47')]=_0x6c198e;}function startAllRefreshIntervals(){return db[_0x88c4('0x3b')][_0x88c4('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x88c4('0x39')](function(_0x2cbad8){var _0x3c6e3e=_0x2cbad8[_0x88c4('0x13')](function(_0x160033){return refreshOauth2MicrosoftAccessToken(_0x160033)[_0x88c4('0x39')](function(_0x16775c){startRefreshInterval(_0x16775c);});});return Promise['all'](_0x3c6e3e);})['catch'](function(_0x17b89f){var _0x5bc925=_0x17b89f?util[_0x88c4('0x49')](_0x17b89f,{'showHidden':![],'depth':null}):'';logger['error']('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x5bc925);});}module[_0x88c4('0x4a')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 0377c66..843b2ed 100644
--- a/server/api/cloudProvider/cloudProvider.rpc.js
+++ b/server/api/cloudProvider/cloudProvider.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x09d2=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x479e5e,_0x81eb82){var _0x1066ba=function(_0xb84d29){while(--_0xb84d29){_0x479e5e['push'](_0x479e5e['shift']());}};_0x1066ba(++_0x81eb82);}(_0x09d2,0x1d2));var _0x209d=function(_0x5aa687,_0x13ac13){_0x5aa687=_0x5aa687-0x0;var _0x37f63e=_0x09d2[_0x5aa687];return _0x37f63e;};'use strict';var _=require(_0x209d('0x0'));var util=require(_0x209d('0x1'));var moment=require(_0x209d('0x2'));var BPromise=require(_0x209d('0x3'));var rs=require(_0x209d('0x4'));var fs=require('fs');var Redis=require(_0x209d('0x5'));var db=require(_0x209d('0x6'))['db'];var utils=require(_0x209d('0x7'));var logger=require(_0x209d('0x8'))(_0x209d('0x9'));var config=require('../../config/environment');var jayson=require(_0x209d('0xa'));var client=jayson[_0x209d('0xb')][_0x209d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x204ab9,_0xc141e6,_0x5b460d){return new BPromise(function(_0x49cd7a,_0x306753){return client[_0x209d('0xd')](_0x204ab9,_0x5b460d)[_0x209d('0xe')](function(_0x48c52d){logger[_0x209d('0xf')]('CloudProvider,\x20%s,\x20%s',_0xc141e6,_0x209d('0x10'));logger[_0x209d('0x11')](_0x209d('0x12'),_0xc141e6,_0x209d('0x10'),JSON[_0x209d('0x13')](_0x48c52d));if(_0x48c52d[_0x209d('0x14')]){if(_0x48c52d[_0x209d('0x14')][_0x209d('0x15')]===0x1f4){logger[_0x209d('0x14')](_0x209d('0x16'),_0xc141e6,_0x48c52d[_0x209d('0x14')][_0x209d('0x17')]);return _0x306753(_0x48c52d['error'][_0x209d('0x17')]);}logger[_0x209d('0x14')](_0x209d('0x16'),_0xc141e6,_0x48c52d['error']['message']);return _0x49cd7a(_0x48c52d[_0x209d('0x14')]['message']);}else{logger['info'](_0x209d('0x16'),_0xc141e6,_0x209d('0x10'));_0x49cd7a(_0x48c52d[_0x209d('0x18')]['message']);}})[_0x209d('0x19')](function(_0xe0721){logger[_0x209d('0x14')](_0x209d('0x16'),_0xc141e6,_0xe0721);_0x306753(_0xe0721);});});}
\ No newline at end of file
+var _0x3fc6=['http','request','then','CloudProvider,\x20%s,\x20%s','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x2cc0b3,_0x120bf1){var _0x1667ef=function(_0x3abcb4){while(--_0x3abcb4){_0x2cc0b3['push'](_0x2cc0b3['shift']());}};_0x1667ef(++_0x120bf1);}(_0x3fc6,0x115));var _0x63fc=function(_0x4b8b88,_0x2a81b8){_0x4b8b88=_0x4b8b88-0x0;var _0x79c20=_0x3fc6[_0x4b8b88];return _0x79c20;};'use strict';var _=require(_0x63fc('0x0'));var util=require('util');var moment=require(_0x63fc('0x1'));var BPromise=require(_0x63fc('0x2'));var rs=require(_0x63fc('0x3'));var fs=require('fs');var Redis=require(_0x63fc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x63fc('0x5'));var logger=require(_0x63fc('0x6'))(_0x63fc('0x7'));var config=require('../../config/environment');var jayson=require(_0x63fc('0x8'));var client=jayson['client'][_0x63fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1c7f72,_0x3e8157,_0x571ab6){return new BPromise(function(_0x3ec832,_0xffe000){return client[_0x63fc('0xa')](_0x1c7f72,_0x571ab6)[_0x63fc('0xb')](function(_0x32749b){logger['info'](_0x63fc('0xc'),_0x3e8157,'request\x20sent');logger['debug'](_0x63fc('0xd'),_0x3e8157,_0x63fc('0xe'),JSON[_0x63fc('0xf')](_0x32749b));if(_0x32749b[_0x63fc('0x10')]){if(_0x32749b[_0x63fc('0x10')][_0x63fc('0x11')]===0x1f4){logger[_0x63fc('0x10')](_0x63fc('0xc'),_0x3e8157,_0x32749b['error'][_0x63fc('0x12')]);return _0xffe000(_0x32749b[_0x63fc('0x10')][_0x63fc('0x12')]);}logger['error'](_0x63fc('0xc'),_0x3e8157,_0x32749b[_0x63fc('0x10')][_0x63fc('0x12')]);return _0x3ec832(_0x32749b['error'][_0x63fc('0x12')]);}else{logger[_0x63fc('0x13')](_0x63fc('0xc'),_0x3e8157,_0x63fc('0xe'));_0x3ec832(_0x32749b[_0x63fc('0x14')][_0x63fc('0x12')]);}})[_0x63fc('0x15')](function(_0x19a3f2){logger[_0x63fc('0x10')](_0x63fc('0xc'),_0x3e8157,_0x19a3f2);_0xffe000(_0x19a3f2);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index bc07e8d..1b4972f 100644
--- a/server/api/cloudProvider/index.js
+++ b/server/api/cloudProvider/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5f66=['index','post','/:id','update','delete','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback','Router','./cloudProvider.controller','get','isAuthenticated'];(function(_0x2381db,_0x4ff285){var _0x17ba66=function(_0x2d874a){while(--_0x2d874a){_0x2381db['push'](_0x2381db['shift']());}};_0x17ba66(++_0x4ff285);}(_0x5f66,0x1a0));var _0x65f6=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0x5f66[_0x4154a6];return _0x3b2786;};'use strict';var express=require('express');var router=express[_0x65f6('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x65f6('0x1'));router[_0x65f6('0x2')]('/',auth[_0x65f6('0x3')](),controller[_0x65f6('0x4')]);router[_0x65f6('0x2')]('/:id',auth[_0x65f6('0x3')](),controller['show']);router[_0x65f6('0x5')]('/',auth[_0x65f6('0x3')](),controller['create']);router['put'](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller[_0x65f6('0x7')]);router[_0x65f6('0x8')](_0x65f6('0x6'),auth[_0x65f6('0x3')](),controller['destroy']);router['get'](_0x65f6('0x9'),auth[_0x65f6('0x3')](),controller[_0x65f6('0xa')]);router[_0x65f6('0x5')]('/oauth2/microsoft/callback',controller[_0x65f6('0xb')]);module['exports']=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x3f555b,_0x5bc688){var _0x112df6=function(_0x509f47){while(--_0x509f47){_0x3f555b['push'](_0x3f555b['shift']());}};_0x112df6(++_0x5bc688);}(_0x2ef3,0xba));var _0x32ef=function(_0x31a414,_0x24d750){_0x31a414=_0x31a414-0x0;var _0x2584d4=_0x2ef3[_0x31a414];return _0x2584d4;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index b3f51a8..f8f0197 100644
--- a/server/api/cmCompany/cmCompany.attributes.js
+++ b/server/api/cmCompany/cmCompany.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7284=['STRING','name','exports'];(function(_0x31cf5b,_0x3405c7){var _0x3f8bc6=function(_0xc41e88){while(--_0xc41e88){_0x31cf5b['push'](_0x31cf5b['shift']());}};_0x3f8bc6(++_0x3405c7);}(_0x7284,0xe6));var _0x4728=function(_0x12e476,_0x1878a0){_0x12e476=_0x12e476-0x0;var _0x31c3d3=_0x7284[_0x12e476];return _0x31c3d3;};'use strict';var Sequelize=require('sequelize');module[_0x4728('0x0')]={'name':{'type':Sequelize[_0x4728('0x1')],'unique':_0x4728('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4728('0x1')]},'companyId':{'type':Sequelize[_0x4728('0x1')]},'website':{'type':Sequelize[_0x4728('0x1')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4728('0x1')]},'type':{'type':Sequelize[_0x4728('0x1')]},'street':{'type':Sequelize[_0x4728('0x1')]},'postalCode':{'type':Sequelize[_0x4728('0x1')]},'city':{'type':Sequelize[_0x4728('0x1')]},'country':{'type':Sequelize[_0x4728('0x1')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4728('0x1')]},'sStreet':{'type':Sequelize[_0x4728('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4728('0x1')]},'sCountry':{'type':Sequelize[_0x4728('0x1')]},'description':{'type':Sequelize[_0x4728('0x1')]}};
\ No newline at end of file
+var _0xb30b=['name','exports','STRING'];(function(_0x528733,_0x26f73a){var _0x68a7b4=function(_0xc89351){while(--_0xc89351){_0x528733['push'](_0x528733['shift']());}};_0x68a7b4(++_0x26f73a);}(_0xb30b,0xf4));var _0xbb30=function(_0x33ae87,_0x1389c2){_0x33ae87=_0x33ae87-0x0;var _0x408461=_0xb30b[_0x33ae87];return _0x408461;};'use strict';var Sequelize=require('sequelize');module[_0xbb30('0x0')]={'name':{'type':Sequelize[_0xbb30('0x1')],'unique':_0xbb30('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbb30('0x1')]},'companyId':{'type':Sequelize[_0xbb30('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xbb30('0x1')]},'fax':{'type':Sequelize[_0xbb30('0x1')]},'type':{'type':Sequelize[_0xbb30('0x1')]},'street':{'type':Sequelize[_0xbb30('0x1')]},'postalCode':{'type':Sequelize[_0xbb30('0x1')]},'city':{'type':Sequelize[_0xbb30('0x1')]},'country':{'type':Sequelize[_0xbb30('0x1')]},'email':{'type':Sequelize[_0xbb30('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbb30('0x1')]},'sStreet':{'type':Sequelize[_0xbb30('0x1')]},'sPostalCode':{'type':Sequelize[_0xbb30('0x1')]},'sCity':{'type':Sequelize[_0xbb30('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xbb30('0x1')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index cf2c6a1..aaf475b 100644
--- a/server/api/cmCompany/cmCompany.controller.js
+++ b/server/api/cmCompany/cmCompany.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5a20=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','fields','length','attributes','hasOwnProperty','order','sort','where','pick','filter','merge','map','options','include','findAll','rows','catch','params','rawAttributes','includeAll','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addContacts','ids','omit','findOne','getContacts','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x4e2322,_0x455fc9){var _0x35a55b=function(_0x38396d){while(--_0x38396d){_0x4e2322['push'](_0x4e2322['shift']());}};_0x35a55b(++_0x455fc9);}(_0x5a20,0xfd));var _0x05a2=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x5a20[_0x3fcc20];return _0x15d3ce;};'use strict';var emlformat=require(_0x05a2('0x0'));var rimraf=require(_0x05a2('0x1'));var zipdir=require(_0x05a2('0x2'));var jsonpatch=require(_0x05a2('0x3'));var rp=require('request-promise');var moment=require(_0x05a2('0x4'));var BPromise=require(_0x05a2('0x5'));var Mustache=require('mustache');var util=require(_0x05a2('0x6'));var path=require(_0x05a2('0x7'));var sox=require(_0x05a2('0x8'));var csv=require(_0x05a2('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x05a2('0xa'));var _=require(_0x05a2('0xb'));var squel=require(_0x05a2('0xc'));var crypto=require(_0x05a2('0xd'));var jsforce=require(_0x05a2('0xe'));var deskjs=require(_0x05a2('0xf'));var toCsv=require(_0x05a2('0x9'));var querystring=require(_0x05a2('0x10'));var Papa=require(_0x05a2('0x11'));var Redis=require(_0x05a2('0x12'));var authService=require(_0x05a2('0x13'));var qs=require(_0x05a2('0x14'));var as=require(_0x05a2('0x15'));var hardwareService=require(_0x05a2('0x16'));var logger=require(_0x05a2('0x17'))(_0x05a2('0x18'));var utils=require(_0x05a2('0x19'));var config=require(_0x05a2('0x1a'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c6f7b,_0x1e0ee2){_0x1e0ee2=_0x1e0ee2||0xcc;return function(_0x5a2b66){if(_0x5a2b66){return _0x3c6f7b['sendStatus'](_0x1e0ee2);}return _0x3c6f7b[_0x05a2('0x1b')](_0x1e0ee2)[_0x05a2('0x1c')]();};}function respondWithResult(_0x325781,_0x24879e){_0x24879e=_0x24879e||0xc8;return function(_0x2fd67c){if(_0x2fd67c){return _0x325781[_0x05a2('0x1b')](_0x24879e)[_0x05a2('0x1d')](_0x2fd67c);}};}function respondWithFilteredResult(_0x3bc984,_0x42e141){return function(_0x3f19e4){if(_0x3f19e4){var _0x4129a2=typeof _0x42e141[_0x05a2('0x1e')]===_0x05a2('0x1f')&&typeof _0x42e141['limit']===_0x05a2('0x1f');var _0x4fa824=_0x3f19e4[_0x05a2('0x20')];var _0x4cc114=_0x4129a2?0x0:_0x42e141[_0x05a2('0x1e')];var _0x5821bf=_0x4129a2?_0x3f19e4[_0x05a2('0x20')]:_0x42e141[_0x05a2('0x1e')]+_0x42e141[_0x05a2('0x21')];var _0x9d33a3;if(_0x5821bf>=_0x4fa824){_0x5821bf=_0x4fa824;_0x9d33a3=0xc8;}else{_0x9d33a3=0xce;}_0x3bc984['status'](_0x9d33a3);return _0x3bc984[_0x05a2('0x22')](_0x05a2('0x23'),_0x4cc114+'-'+_0x5821bf+'/'+_0x4fa824)[_0x05a2('0x1d')](_0x3f19e4);}return null;};}function patchUpdates(_0x5243e0){return function(_0x3c6317){try{jsonpatch[_0x05a2('0x24')](_0x3c6317,_0x5243e0,!![]);}catch(_0x1f78da){return BPromise[_0x05a2('0x25')](_0x1f78da);}return _0x3c6317['save']();};}function saveUpdates(_0x55f44a,_0x4a63ec){return function(_0x4c7aa9){if(_0x4c7aa9){return _0x4c7aa9['update'](_0x55f44a)[_0x05a2('0x26')](function(_0x173c47){return _0x173c47;});}return null;};}function removeEntity(_0x31e86b,_0x3a732c){return function(_0x2160e3){if(_0x2160e3){return _0x2160e3[_0x05a2('0x27')]()['then'](function(){var _0x27c7eb=_0x2160e3[_0x05a2('0x28')]({'plain':!![]});var _0x2cd140='Companies';return db[_0x05a2('0x29')]['destroy']({'where':{'type':_0x2cd140,'resourceId':_0x27c7eb['id']}})['then'](function(){return _0x2160e3;});})[_0x05a2('0x26')](function(){_0x31e86b[_0x05a2('0x1b')](0xcc)[_0x05a2('0x1c')]();});}};}function handleEntityNotFound(_0x3edc22,_0xbf67ff){return function(_0x44b5ff){if(!_0x44b5ff){_0x3edc22[_0x05a2('0x2a')](0x194);}return _0x44b5ff;};}function handleError(_0x28989b,_0x539058){_0x539058=_0x539058||0x1f4;return function(_0x4e362e){logger[_0x05a2('0x2b')](_0x4e362e[_0x05a2('0x2c')]);if(_0x4e362e[_0x05a2('0x2d')]){delete _0x4e362e[_0x05a2('0x2d')];}_0x28989b[_0x05a2('0x1b')](_0x539058)['send'](_0x4e362e);};}exports[_0x05a2('0x2e')]=function(_0x3b6480,_0x28d23b){var _0x1ff812={},_0x5e2d12={},_0x18e280={'count':0x0,'rows':[]};return db[_0x05a2('0x2f')][_0x05a2('0x30')]()['then'](function(_0x1a32af){_0x5e2d12[_0x05a2('0x31')]=_[_0x05a2('0x32')](_0x1a32af);_0x5e2d12[_0x05a2('0x33')]=_[_0x05a2('0x32')](_0x3b6480['query']);_0x5e2d12[_0x05a2('0x34')]=_[_0x05a2('0x35')](_0x5e2d12['model'],_0x5e2d12['query']);_0x1ff812['attributes']=_[_0x05a2('0x35')](_0x5e2d12[_0x05a2('0x31')],qs['fields'](_0x3b6480['query'][_0x05a2('0x36')]));_0x1ff812['attributes']=_0x1ff812['attributes'][_0x05a2('0x37')]?_0x1ff812[_0x05a2('0x38')]:_0x5e2d12[_0x05a2('0x31')];if(!_0x3b6480[_0x05a2('0x33')][_0x05a2('0x39')]('nolimit')){_0x1ff812[_0x05a2('0x21')]=qs[_0x05a2('0x21')](_0x3b6480['query'][_0x05a2('0x21')]);_0x1ff812[_0x05a2('0x1e')]=qs[_0x05a2('0x1e')](_0x3b6480['query'][_0x05a2('0x1e')]);}_0x1ff812[_0x05a2('0x3a')]=qs[_0x05a2('0x3b')](_0x3b6480[_0x05a2('0x33')]['sort']);_0x1ff812[_0x05a2('0x3c')]=qs[_0x05a2('0x34')](_[_0x05a2('0x3d')](_0x3b6480[_0x05a2('0x33')],_0x5e2d12[_0x05a2('0x34')]),_0x1a32af);if(_0x3b6480[_0x05a2('0x33')][_0x05a2('0x3e')]){_0x1ff812['where']=_[_0x05a2('0x3f')](_0x1ff812[_0x05a2('0x3c')],{'$or':_[_0x05a2('0x40')](_0x1ff812['attributes'],function(_0x2f0257){var _0x2ec751={};_0x2ec751[_0x2f0257]={'$like':'%'+_0x3b6480[_0x05a2('0x33')][_0x05a2('0x3e')]+'%'};return _0x2ec751;})});}_0x1ff812=_[_0x05a2('0x3f')]({},_0x1ff812,_0x3b6480[_0x05a2('0x41')]);var _0x30dc25={'where':_0x1ff812[_0x05a2('0x3c')]};return db[_0x05a2('0x2f')][_0x05a2('0x20')](_0x30dc25)[_0x05a2('0x26')](function(_0x1e2f3f){_0x18e280[_0x05a2('0x20')]=_0x1e2f3f;if(_0x3b6480[_0x05a2('0x33')]['includeAll']){_0x1ff812[_0x05a2('0x42')]=[{'all':!![]}];}return db['CmCompany'][_0x05a2('0x43')](_0x1ff812);})[_0x05a2('0x26')](function(_0x264da3){_0x18e280[_0x05a2('0x44')]=_0x264da3;return _0x18e280;})['then'](respondWithFilteredResult(_0x28d23b,_0x1ff812))['catch'](handleError(_0x28d23b,null));})[_0x05a2('0x45')](handleError(_0x28d23b,null));};exports['show']=function(_0x1bd145,_0x540b61){var _0x5af3df={'raw':![],'where':{'id':_0x1bd145[_0x05a2('0x46')]['id']}},_0x4b8b19={};_0x4b8b19[_0x05a2('0x31')]=_[_0x05a2('0x32')](db[_0x05a2('0x2f')][_0x05a2('0x47')]);_0x4b8b19[_0x05a2('0x33')]=_['keys'](_0x1bd145[_0x05a2('0x33')]);_0x4b8b19[_0x05a2('0x34')]=_['intersection'](_0x4b8b19[_0x05a2('0x31')],_0x4b8b19[_0x05a2('0x33')]);_0x5af3df[_0x05a2('0x38')]=_['intersection'](_0x4b8b19[_0x05a2('0x31')],qs[_0x05a2('0x36')](_0x1bd145['query'][_0x05a2('0x36')]));_0x5af3df['attributes']=_0x5af3df[_0x05a2('0x38')]['length']?_0x5af3df['attributes']:_0x4b8b19[_0x05a2('0x31')];if(_0x1bd145[_0x05a2('0x33')][_0x05a2('0x48')]){_0x5af3df[_0x05a2('0x42')]=[{'all':!![]}];}_0x5af3df=_[_0x05a2('0x3f')]({},_0x5af3df,_0x1bd145['options']);return db[_0x05a2('0x2f')]['find'](_0x5af3df)[_0x05a2('0x26')](handleEntityNotFound(_0x540b61,null))[_0x05a2('0x26')](respondWithResult(_0x540b61,null))[_0x05a2('0x45')](handleError(_0x540b61,null));};exports[_0x05a2('0x49')]=function(_0x5f1b43,_0x58f5bf){return db['CmCompany'][_0x05a2('0x49')](_0x5f1b43[_0x05a2('0x4a')],{})['then'](function(_0x1252a8){var _0x3cdc52=_0x5f1b43['user'][_0x05a2('0x28')]({'plain':!![]});if(!_0x3cdc52)throw new Error(_0x05a2('0x4b'));if(_0x3cdc52[_0x05a2('0x4c')]==='user'){var _0x150ddf=_0x1252a8['get']({'plain':!![]});var _0x373a27=_0x05a2('0x4d');return db[_0x05a2('0x4e')][_0x05a2('0x4f')]({'where':{'name':_0x373a27,'userProfileId':_0x3cdc52[_0x05a2('0x50')]},'raw':!![]})[_0x05a2('0x26')](function(_0x18a6fc){if(_0x18a6fc&&_0x18a6fc[_0x05a2('0x51')]===0x0){return db[_0x05a2('0x29')]['create']({'name':_0x150ddf['name'],'resourceId':_0x150ddf['id'],'type':_0x18a6fc[_0x05a2('0x2d')],'sectionId':_0x18a6fc['id']},{})[_0x05a2('0x26')](function(){return _0x1252a8;});}else{return _0x1252a8;}})[_0x05a2('0x45')](function(_0x1f7eb7){logger[_0x05a2('0x2b')](_0x05a2('0x52'),_0x1f7eb7);throw _0x1f7eb7;});}return _0x1252a8;})[_0x05a2('0x26')](respondWithResult(_0x58f5bf,0xc9))[_0x05a2('0x45')](handleError(_0x58f5bf,null));};exports[_0x05a2('0x53')]=function(_0x1a1206,_0x1b8385){if(_0x1a1206[_0x05a2('0x4a')]['id']){delete _0x1a1206[_0x05a2('0x4a')]['id'];}return db[_0x05a2('0x2f')][_0x05a2('0x4f')]({'where':{'id':_0x1a1206[_0x05a2('0x46')]['id']}})[_0x05a2('0x26')](handleEntityNotFound(_0x1b8385,null))[_0x05a2('0x26')](saveUpdates(_0x1a1206[_0x05a2('0x4a')],null))[_0x05a2('0x26')](respondWithResult(_0x1b8385,null))[_0x05a2('0x45')](handleError(_0x1b8385,null));};exports[_0x05a2('0x27')]=function(_0x26abbe,_0x22a579){return db[_0x05a2('0x2f')][_0x05a2('0x4f')]({'where':{'id':_0x26abbe[_0x05a2('0x46')]['id']}})[_0x05a2('0x26')](handleEntityNotFound(_0x22a579,null))[_0x05a2('0x26')](removeEntity(_0x22a579,null))[_0x05a2('0x45')](handleError(_0x22a579,null));};exports['describe']=function(_0x170ac2,_0x1e35d3){return db[_0x05a2('0x2f')]['describe']()[_0x05a2('0x26')](respondWithResult(_0x1e35d3,null))[_0x05a2('0x45')](handleError(_0x1e35d3,null));};exports[_0x05a2('0x54')]=function(_0x10fa43,_0x5e2be9,_0x44486f){return db['CmContact'][_0x05a2('0x4f')]({'where':{'id':_0x10fa43[_0x05a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x5e2be9,null))[_0x05a2('0x26')](function(_0x3e9ff6){if(_0x3e9ff6){return _0x3e9ff6['addContacts'](_0x10fa43[_0x05a2('0x4a')][_0x05a2('0x55')],_[_0x05a2('0x56')](_0x10fa43[_0x05a2('0x4a')],[_0x05a2('0x55'),'id'])||{});}})[_0x05a2('0x26')](respondWithResult(_0x5e2be9,null))['catch'](handleError(_0x5e2be9,null));};exports['getContacts']=function(_0x31f9c0,_0x255633,_0x1dd808){var _0xdae087={};var _0x17e81d={};var _0xf75f1b;var _0x52163c;return db[_0x05a2('0x2f')][_0x05a2('0x57')]({'where':{'id':_0x31f9c0[_0x05a2('0x46')]['id']}})['then'](handleEntityNotFound(_0x255633,null))[_0x05a2('0x26')](function(_0x5b48e2){if(_0x5b48e2){_0xf75f1b=_0x5b48e2;_0x17e81d[_0x05a2('0x31')]=_[_0x05a2('0x32')](db['CmContact']['rawAttributes']);_0x17e81d[_0x05a2('0x33')]=_[_0x05a2('0x32')](_0x31f9c0['query']);_0x17e81d[_0x05a2('0x34')]=_[_0x05a2('0x35')](_0x17e81d[_0x05a2('0x31')],_0x17e81d['query']);_0xdae087[_0x05a2('0x38')]=_[_0x05a2('0x35')](_0x17e81d['model'],qs['fields'](_0x31f9c0[_0x05a2('0x33')]['fields']));_0xdae087['attributes']=_0xdae087[_0x05a2('0x38')]['length']?_0xdae087[_0x05a2('0x38')]:_0x17e81d[_0x05a2('0x31')];_0xdae087[_0x05a2('0x3a')]=qs[_0x05a2('0x3b')](_0x31f9c0[_0x05a2('0x33')][_0x05a2('0x3b')]);_0xdae087['where']=qs[_0x05a2('0x34')](_[_0x05a2('0x3d')](_0x31f9c0[_0x05a2('0x33')],_0x17e81d[_0x05a2('0x34')]));if(_0x31f9c0['query']['filter']){_0xdae087[_0x05a2('0x3c')]=_[_0x05a2('0x3f')](_0xdae087['where'],{'$or':_[_0x05a2('0x40')](_0xdae087[_0x05a2('0x38')],function(_0x4f8b6e){var _0x3ab254={};_0x3ab254[_0x4f8b6e]={'$like':'%'+_0x31f9c0[_0x05a2('0x33')]['filter']+'%'};return _0x3ab254;})});}_0xdae087=_[_0x05a2('0x3f')]({},_0xdae087,_0x31f9c0['options']);return _0xf75f1b[_0x05a2('0x58')](_0xdae087);}})[_0x05a2('0x26')](function(_0x52eba3){if(_0x52eba3){_0x52163c=_0x52eba3[_0x05a2('0x37')];if(!_0x31f9c0[_0x05a2('0x33')][_0x05a2('0x39')](_0x05a2('0x59'))){_0xdae087[_0x05a2('0x21')]=qs[_0x05a2('0x21')](_0x31f9c0[_0x05a2('0x33')]['limit']);_0xdae087[_0x05a2('0x1e')]=qs['offset'](_0x31f9c0[_0x05a2('0x33')][_0x05a2('0x1e')]);}return _0xf75f1b[_0x05a2('0x58')](_0xdae087);}})['then'](function(_0x38729b){if(_0x38729b){return _0x38729b?{'count':_0x52163c,'rows':_0x38729b}:null;}})[_0x05a2('0x26')](respondWithResult(_0x255633,null))['catch'](handleError(_0x255633,null));};
\ No newline at end of file
+var _0x8436=['length','hasOwnProperty','nolimit','sort','where','pick','filters','merge','filter','options','findAll','rows','catch','show','params','rawAttributes','intersection','includeAll','create','role','user','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addContacts','CmContact','ids','getContacts','findOne','map','eml-format','zip-dir','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','UserProfileResource','destroy','error','name','send','index','CmCompany','describe','model','keys','query','attributes','fields'];(function(_0x5a3bfa,_0x1bf7c9){var _0x5e3af4=function(_0x34d24e){while(--_0x34d24e){_0x5a3bfa['push'](_0x5a3bfa['shift']());}};_0x5e3af4(++_0x1bf7c9);}(_0x8436,0x1c9));var _0x6843=function(_0x19d7da,_0x2a79ca){_0x19d7da=_0x19d7da-0x0;var _0x34ee5d=_0x8436[_0x19d7da];return _0x34ee5d;};'use strict';var emlformat=require(_0x6843('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6843('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6843('0x2'));var moment=require(_0x6843('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x6843('0x4'));var util=require('util');var path=require(_0x6843('0x5'));var sox=require(_0x6843('0x6'));var csv=require(_0x6843('0x7'));var ejs=require(_0x6843('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6843('0x9'));var squel=require(_0x6843('0xa'));var crypto=require(_0x6843('0xb'));var jsforce=require(_0x6843('0xc'));var deskjs=require(_0x6843('0xd'));var toCsv=require(_0x6843('0x7'));var querystring=require(_0x6843('0xe'));var Papa=require('papaparse');var Redis=require(_0x6843('0xf'));var authService=require(_0x6843('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x6843('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6843('0x12'))(_0x6843('0x13'));var utils=require(_0x6843('0x14'));var config=require(_0x6843('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6843('0x16'))['db'];function respondWithStatusCode(_0x31ffd6,_0x22daee){_0x22daee=_0x22daee||0xcc;return function(_0x2fe741){if(_0x2fe741){return _0x31ffd6[_0x6843('0x17')](_0x22daee);}return _0x31ffd6[_0x6843('0x18')](_0x22daee)[_0x6843('0x19')]();};}function respondWithResult(_0x3d0c13,_0x38cc5d){_0x38cc5d=_0x38cc5d||0xc8;return function(_0x3a8ed0){if(_0x3a8ed0){return _0x3d0c13[_0x6843('0x18')](_0x38cc5d)[_0x6843('0x1a')](_0x3a8ed0);}};}function respondWithFilteredResult(_0x215097,_0x22558c){return function(_0x3890d0){if(_0x3890d0){var _0x1e5772=typeof _0x22558c[_0x6843('0x1b')]===_0x6843('0x1c')&&typeof _0x22558c[_0x6843('0x1d')]==='undefined';var _0x3e4120=_0x3890d0[_0x6843('0x1e')];var _0x3f0dcf=_0x1e5772?0x0:_0x22558c[_0x6843('0x1b')];var _0x3d18ba=_0x1e5772?_0x3890d0[_0x6843('0x1e')]:_0x22558c[_0x6843('0x1b')]+_0x22558c[_0x6843('0x1d')];var _0x4234d9;if(_0x3d18ba>=_0x3e4120){_0x3d18ba=_0x3e4120;_0x4234d9=0xc8;}else{_0x4234d9=0xce;}_0x215097[_0x6843('0x18')](_0x4234d9);return _0x215097[_0x6843('0x1f')](_0x6843('0x20'),_0x3f0dcf+'-'+_0x3d18ba+'/'+_0x3e4120)[_0x6843('0x1a')](_0x3890d0);}return null;};}function patchUpdates(_0x518fad){return function(_0x542d77){try{jsonpatch[_0x6843('0x21')](_0x542d77,_0x518fad,!![]);}catch(_0x1c0a0d){return BPromise[_0x6843('0x22')](_0x1c0a0d);}return _0x542d77[_0x6843('0x23')]();};}function saveUpdates(_0x10c7ea,_0x3ef757){return function(_0x5744a6){if(_0x5744a6){return _0x5744a6[_0x6843('0x24')](_0x10c7ea)[_0x6843('0x25')](function(_0x4eb9c0){return _0x4eb9c0;});}return null;};}function removeEntity(_0x397960,_0x112093){return function(_0x2dbdae){if(_0x2dbdae){return _0x2dbdae['destroy']()[_0x6843('0x25')](function(){var _0x54b275=_0x2dbdae[_0x6843('0x26')]({'plain':!![]});var _0x40dbd6=_0x6843('0x27');return db[_0x6843('0x28')][_0x6843('0x29')]({'where':{'type':_0x40dbd6,'resourceId':_0x54b275['id']}})[_0x6843('0x25')](function(){return _0x2dbdae;});})['then'](function(){_0x397960['status'](0xcc)[_0x6843('0x19')]();});}};}function handleEntityNotFound(_0xb0ef18,_0xea42a8){return function(_0x56cf32){if(!_0x56cf32){_0xb0ef18['sendStatus'](0x194);}return _0x56cf32;};}function handleError(_0x1b5dde,_0xdbd543){_0xdbd543=_0xdbd543||0x1f4;return function(_0x244de0){logger[_0x6843('0x2a')](_0x244de0['stack']);if(_0x244de0[_0x6843('0x2b')]){delete _0x244de0[_0x6843('0x2b')];}_0x1b5dde['status'](_0xdbd543)[_0x6843('0x2c')](_0x244de0);};}exports[_0x6843('0x2d')]=function(_0x540bb5,_0x25c830){var _0x20ef8e={},_0x87b787={},_0x502358={'count':0x0,'rows':[]};return db[_0x6843('0x2e')][_0x6843('0x2f')]()[_0x6843('0x25')](function(_0x977a5e){_0x87b787[_0x6843('0x30')]=_[_0x6843('0x31')](_0x977a5e);_0x87b787[_0x6843('0x32')]=_[_0x6843('0x31')](_0x540bb5['query']);_0x87b787['filters']=_['intersection'](_0x87b787[_0x6843('0x30')],_0x87b787[_0x6843('0x32')]);_0x20ef8e[_0x6843('0x33')]=_['intersection'](_0x87b787[_0x6843('0x30')],qs[_0x6843('0x34')](_0x540bb5[_0x6843('0x32')][_0x6843('0x34')]));_0x20ef8e[_0x6843('0x33')]=_0x20ef8e['attributes'][_0x6843('0x35')]?_0x20ef8e['attributes']:_0x87b787[_0x6843('0x30')];if(!_0x540bb5[_0x6843('0x32')][_0x6843('0x36')](_0x6843('0x37'))){_0x20ef8e[_0x6843('0x1d')]=qs[_0x6843('0x1d')](_0x540bb5[_0x6843('0x32')][_0x6843('0x1d')]);_0x20ef8e[_0x6843('0x1b')]=qs[_0x6843('0x1b')](_0x540bb5['query'][_0x6843('0x1b')]);}_0x20ef8e['order']=qs[_0x6843('0x38')](_0x540bb5[_0x6843('0x32')][_0x6843('0x38')]);_0x20ef8e[_0x6843('0x39')]=qs['filters'](_[_0x6843('0x3a')](_0x540bb5['query'],_0x87b787[_0x6843('0x3b')]),_0x977a5e);if(_0x540bb5[_0x6843('0x32')]['filter']){_0x20ef8e['where']=_[_0x6843('0x3c')](_0x20ef8e[_0x6843('0x39')],{'$or':_['map'](_0x20ef8e[_0x6843('0x33')],function(_0x54a314){var _0x4d91d4={};_0x4d91d4[_0x54a314]={'$like':'%'+_0x540bb5[_0x6843('0x32')][_0x6843('0x3d')]+'%'};return _0x4d91d4;})});}_0x20ef8e=_[_0x6843('0x3c')]({},_0x20ef8e,_0x540bb5[_0x6843('0x3e')]);var _0x216205={'where':_0x20ef8e[_0x6843('0x39')]};return db[_0x6843('0x2e')][_0x6843('0x1e')](_0x216205)['then'](function(_0x4d0427){_0x502358[_0x6843('0x1e')]=_0x4d0427;if(_0x540bb5[_0x6843('0x32')]['includeAll']){_0x20ef8e['include']=[{'all':!![]}];}return db[_0x6843('0x2e')][_0x6843('0x3f')](_0x20ef8e);})['then'](function(_0x502d7c){_0x502358[_0x6843('0x40')]=_0x502d7c;return _0x502358;})[_0x6843('0x25')](respondWithFilteredResult(_0x25c830,_0x20ef8e))[_0x6843('0x41')](handleError(_0x25c830,null));})[_0x6843('0x41')](handleError(_0x25c830,null));};exports[_0x6843('0x42')]=function(_0x4f8396,_0x1b442f){var _0x2550d6={'raw':![],'where':{'id':_0x4f8396[_0x6843('0x43')]['id']}},_0x4400e3={};_0x4400e3['model']=_[_0x6843('0x31')](db[_0x6843('0x2e')][_0x6843('0x44')]);_0x4400e3['query']=_[_0x6843('0x31')](_0x4f8396[_0x6843('0x32')]);_0x4400e3[_0x6843('0x3b')]=_[_0x6843('0x45')](_0x4400e3[_0x6843('0x30')],_0x4400e3[_0x6843('0x32')]);_0x2550d6[_0x6843('0x33')]=_[_0x6843('0x45')](_0x4400e3[_0x6843('0x30')],qs[_0x6843('0x34')](_0x4f8396[_0x6843('0x32')][_0x6843('0x34')]));_0x2550d6[_0x6843('0x33')]=_0x2550d6[_0x6843('0x33')]['length']?_0x2550d6[_0x6843('0x33')]:_0x4400e3[_0x6843('0x30')];if(_0x4f8396['query'][_0x6843('0x46')]){_0x2550d6['include']=[{'all':!![]}];}_0x2550d6=_[_0x6843('0x3c')]({},_0x2550d6,_0x4f8396[_0x6843('0x3e')]);return db[_0x6843('0x2e')]['find'](_0x2550d6)[_0x6843('0x25')](handleEntityNotFound(_0x1b442f,null))['then'](respondWithResult(_0x1b442f,null))[_0x6843('0x41')](handleError(_0x1b442f,null));};exports[_0x6843('0x47')]=function(_0x5eb8b6,_0x455463){return db[_0x6843('0x2e')][_0x6843('0x47')](_0x5eb8b6['body'],{})[_0x6843('0x25')](function(_0x483f8a){var _0x106a67=_0x5eb8b6['user'][_0x6843('0x26')]({'plain':!![]});if(!_0x106a67)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x106a67[_0x6843('0x48')]===_0x6843('0x49')){var _0x214912=_0x483f8a[_0x6843('0x26')]({'plain':!![]});var _0x59fef5='Companies';return db[_0x6843('0x4a')][_0x6843('0x4b')]({'where':{'name':_0x59fef5,'userProfileId':_0x106a67['userProfileId']},'raw':!![]})[_0x6843('0x25')](function(_0x4adf02){if(_0x4adf02&&_0x4adf02[_0x6843('0x4c')]===0x0){return db['UserProfileResource'][_0x6843('0x47')]({'name':_0x214912['name'],'resourceId':_0x214912['id'],'type':_0x4adf02[_0x6843('0x2b')],'sectionId':_0x4adf02['id']},{})[_0x6843('0x25')](function(){return _0x483f8a;});}else{return _0x483f8a;}})[_0x6843('0x41')](function(_0x1a6f8d){logger[_0x6843('0x2a')](_0x6843('0x4d'),_0x1a6f8d);throw _0x1a6f8d;});}return _0x483f8a;})[_0x6843('0x25')](respondWithResult(_0x455463,0xc9))[_0x6843('0x41')](handleError(_0x455463,null));};exports['update']=function(_0x3b75e9,_0x3583f8){if(_0x3b75e9[_0x6843('0x4e')]['id']){delete _0x3b75e9[_0x6843('0x4e')]['id'];}return db[_0x6843('0x2e')][_0x6843('0x4b')]({'where':{'id':_0x3b75e9[_0x6843('0x43')]['id']}})['then'](handleEntityNotFound(_0x3583f8,null))['then'](saveUpdates(_0x3b75e9[_0x6843('0x4e')],null))['then'](respondWithResult(_0x3583f8,null))[_0x6843('0x41')](handleError(_0x3583f8,null));};exports[_0x6843('0x29')]=function(_0x3947de,_0x1f69fc){return db['CmCompany'][_0x6843('0x4b')]({'where':{'id':_0x3947de[_0x6843('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f69fc,null))[_0x6843('0x25')](removeEntity(_0x1f69fc,null))['catch'](handleError(_0x1f69fc,null));};exports[_0x6843('0x2f')]=function(_0x6e3d3b,_0x5a7b40){return db[_0x6843('0x2e')][_0x6843('0x2f')]()[_0x6843('0x25')](respondWithResult(_0x5a7b40,null))[_0x6843('0x41')](handleError(_0x5a7b40,null));};exports[_0x6843('0x4f')]=function(_0x5792a9,_0x357503,_0x16dc3e){return db[_0x6843('0x50')]['find']({'where':{'id':_0x5792a9['params']['id']}})[_0x6843('0x25')](handleEntityNotFound(_0x357503,null))[_0x6843('0x25')](function(_0x1d1fbe){if(_0x1d1fbe){return _0x1d1fbe[_0x6843('0x4f')](_0x5792a9[_0x6843('0x4e')][_0x6843('0x51')],_['omit'](_0x5792a9[_0x6843('0x4e')],[_0x6843('0x51'),'id'])||{});}})[_0x6843('0x25')](respondWithResult(_0x357503,null))[_0x6843('0x41')](handleError(_0x357503,null));};exports[_0x6843('0x52')]=function(_0xc80dc6,_0x5cd61c,_0x58aacd){var _0x25883f={};var _0x62e093={};var _0x525dec;var _0x269a87;return db[_0x6843('0x2e')][_0x6843('0x53')]({'where':{'id':_0xc80dc6[_0x6843('0x43')]['id']}})[_0x6843('0x25')](handleEntityNotFound(_0x5cd61c,null))['then'](function(_0x5105ea){if(_0x5105ea){_0x525dec=_0x5105ea;_0x62e093[_0x6843('0x30')]=_['keys'](db[_0x6843('0x50')]['rawAttributes']);_0x62e093['query']=_[_0x6843('0x31')](_0xc80dc6[_0x6843('0x32')]);_0x62e093[_0x6843('0x3b')]=_[_0x6843('0x45')](_0x62e093[_0x6843('0x30')],_0x62e093[_0x6843('0x32')]);_0x25883f[_0x6843('0x33')]=_[_0x6843('0x45')](_0x62e093[_0x6843('0x30')],qs[_0x6843('0x34')](_0xc80dc6['query']['fields']));_0x25883f[_0x6843('0x33')]=_0x25883f['attributes'][_0x6843('0x35')]?_0x25883f[_0x6843('0x33')]:_0x62e093[_0x6843('0x30')];_0x25883f['order']=qs[_0x6843('0x38')](_0xc80dc6[_0x6843('0x32')][_0x6843('0x38')]);_0x25883f[_0x6843('0x39')]=qs[_0x6843('0x3b')](_[_0x6843('0x3a')](_0xc80dc6['query'],_0x62e093[_0x6843('0x3b')]));if(_0xc80dc6['query'][_0x6843('0x3d')]){_0x25883f[_0x6843('0x39')]=_[_0x6843('0x3c')](_0x25883f[_0x6843('0x39')],{'$or':_[_0x6843('0x54')](_0x25883f[_0x6843('0x33')],function(_0x485f3a){var _0x2c412e={};_0x2c412e[_0x485f3a]={'$like':'%'+_0xc80dc6['query'][_0x6843('0x3d')]+'%'};return _0x2c412e;})});}_0x25883f=_['merge']({},_0x25883f,_0xc80dc6['options']);return _0x525dec['getContacts'](_0x25883f);}})[_0x6843('0x25')](function(_0x2f62d4){if(_0x2f62d4){_0x269a87=_0x2f62d4[_0x6843('0x35')];if(!_0xc80dc6[_0x6843('0x32')]['hasOwnProperty'](_0x6843('0x37'))){_0x25883f['limit']=qs[_0x6843('0x1d')](_0xc80dc6[_0x6843('0x32')]['limit']);_0x25883f[_0x6843('0x1b')]=qs[_0x6843('0x1b')](_0xc80dc6[_0x6843('0x32')][_0x6843('0x1b')]);}return _0x525dec[_0x6843('0x52')](_0x25883f);}})['then'](function(_0x3b621d){if(_0x3b621d){return _0x3b621d?{'count':_0x269a87,'rows':_0x3b621d}:null;}})[_0x6843('0x25')](respondWithResult(_0x5cd61c,null))[_0x6843('0x41')](handleError(_0x5cd61c,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index 9ba974a..774826c 100644
--- a/server/api/cmCompany/cmCompany.model.js
+++ b/server/api/cmCompany/cmCompany.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x5feb=['cm_companies','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports','define'];(function(_0x3ff085,_0x27c92e){var _0x2b68c3=function(_0x37811e){while(--_0x37811e){_0x3ff085['push'](_0x3ff085['shift']());}};_0x2b68c3(++_0x27c92e);}(_0x5feb,0x139));var _0xb5fe=function(_0x4b6a01,_0x386039){_0x4b6a01=_0x4b6a01-0x0;var _0xc374a3=_0x5feb[_0x4b6a01];return _0xc374a3;};'use strict';var _=require(_0xb5fe('0x0'));var util=require(_0xb5fe('0x1'));var logger=require(_0xb5fe('0x2'))('api');var moment=require(_0xb5fe('0x3'));var BPromise=require(_0xb5fe('0x4'));var rp=require(_0xb5fe('0x5'));var fs=require('fs');var path=require(_0xb5fe('0x6'));var rimraf=require(_0xb5fe('0x7'));var config=require(_0xb5fe('0x8'));var attributes=require(_0xb5fe('0x9'));module[_0xb5fe('0xa')]=function(_0x267309,_0x32961d){return _0x267309[_0xb5fe('0xb')]('CmCompany',attributes,{'tableName':_0xb5fe('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x85ff=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','exports'];(function(_0x484475,_0x5953ad){var _0x595d7f=function(_0x19ef55){while(--_0x19ef55){_0x484475['push'](_0x484475['shift']());}};_0x595d7f(++_0x5953ad);}(_0x85ff,0x139));var _0xf85f=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x85ff[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xf85f('0x0'));var util=require(_0xf85f('0x1'));var logger=require(_0xf85f('0x2'))(_0xf85f('0x3'));var moment=require(_0xf85f('0x4'));var BPromise=require(_0xf85f('0x5'));var rp=require(_0xf85f('0x6'));var fs=require('fs');var path=require(_0xf85f('0x7'));var rimraf=require(_0xf85f('0x8'));var config=require(_0xf85f('0x9'));var attributes=require(_0xf85f('0xa'));module[_0xf85f('0xb')]=function(_0x5b0a60,_0x4eb39b){return _0x5b0a60['define']('CmCompany',attributes,{'tableName':_0xf85f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js
index 887aff8..2c9cce2 100644
--- a/server/api/cmCompany/cmCompany.rpc.js
+++ b/server/api/cmCompany/cmCompany.rpc.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x91f5=['bluebird','ioredis','../../config/utils','rpc','jayson/promise','client','request','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment'];(function(_0x15f5bc,_0x4433bf){var _0x3b9832=function(_0x51cfc6){while(--_0x51cfc6){_0x15f5bc['push'](_0x15f5bc['shift']());}};_0x3b9832(++_0x4433bf);}(_0x91f5,0x162));var _0x591f=function(_0x3835d3,_0x2510f5){_0x3835d3=_0x3835d3-0x0;var _0x3c028e=_0x91f5[_0x3835d3];return _0x3c028e;};'use strict';var _=require(_0x591f('0x0'));var util=require(_0x591f('0x1'));var moment=require(_0x591f('0x2'));var BPromise=require(_0x591f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x591f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x591f('0x5'));var logger=require('../../config/logger')(_0x591f('0x6'));var config=require('../../config/environment');var jayson=require(_0x591f('0x7'));var client=jayson[_0x591f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59c465,_0x448453,_0xb34a1f){return new BPromise(function(_0x55d3f7,_0xc21929){return client[_0x591f('0x9')](_0x59c465,_0xb34a1f)['then'](function(_0x5cb3cc){logger['info']('CmCompany,\x20%s,\x20%s',_0x448453,_0x591f('0xa'));logger[_0x591f('0xb')](_0x591f('0xc'),_0x448453,_0x591f('0xa'),JSON[_0x591f('0xd')](_0x5cb3cc));if(_0x5cb3cc[_0x591f('0xe')]){if(_0x5cb3cc[_0x591f('0xe')][_0x591f('0xf')]===0x1f4){logger[_0x591f('0xe')](_0x591f('0x10'),_0x448453,_0x5cb3cc['error'][_0x591f('0x11')]);return _0xc21929(_0x5cb3cc[_0x591f('0xe')][_0x591f('0x11')]);}logger['error']('CmCompany,\x20%s,\x20%s',_0x448453,_0x5cb3cc[_0x591f('0xe')][_0x591f('0x11')]);return _0x55d3f7(_0x5cb3cc[_0x591f('0xe')]['message']);}else{logger[_0x591f('0x12')](_0x591f('0x10'),_0x448453,_0x591f('0xa'));_0x55d3f7(_0x5cb3cc[_0x591f('0x13')][_0x591f('0x11')]);}})[_0x591f('0x14')](function(_0x24313e){logger[_0x591f('0xe')](_0x591f('0x10'),_0x448453,_0x24313e);_0xc21929(_0x24313e);});});}
\ No newline at end of file
+var _0xa194=['CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info'];(function(_0x5e81ea,_0x2c6893){var _0x4c19ed=function(_0x21ee0f){while(--_0x21ee0f){_0x5e81ea['push'](_0x5e81ea['shift']());}};_0x4c19ed(++_0x2c6893);}(_0xa194,0x198));var _0x4a19=function(_0xc00b74,_0xccb10d){_0xc00b74=_0xc00b74-0x0;var _0xa991c5=_0xa194[_0xc00b74];return _0xa991c5;};'use strict';var _=require(_0x4a19('0x0'));var util=require('util');var moment=require(_0x4a19('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a19('0x2'));var fs=require('fs');var Redis=require(_0x4a19('0x3'));var db=require(_0x4a19('0x4'))['db'];var utils=require(_0x4a19('0x5'));var logger=require('../../config/logger')(_0x4a19('0x6'));var config=require(_0x4a19('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x4a19('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4d6e66,_0x2aa3be,_0x1fd72e){return new BPromise(function(_0x246ee9,_0x1333ee){return client[_0x4a19('0x9')](_0x4d6e66,_0x1fd72e)[_0x4a19('0xa')](function(_0x1bdc2c){logger[_0x4a19('0xb')](_0x4a19('0xc'),_0x2aa3be,_0x4a19('0xd'));logger[_0x4a19('0xe')](_0x4a19('0xf'),_0x2aa3be,_0x4a19('0xd'),JSON[_0x4a19('0x10')](_0x1bdc2c));if(_0x1bdc2c[_0x4a19('0x11')]){if(_0x1bdc2c[_0x4a19('0x11')]['code']===0x1f4){logger[_0x4a19('0x11')](_0x4a19('0xc'),_0x2aa3be,_0x1bdc2c[_0x4a19('0x11')][_0x4a19('0x12')]);return _0x1333ee(_0x1bdc2c['error'][_0x4a19('0x12')]);}logger[_0x4a19('0x11')](_0x4a19('0xc'),_0x2aa3be,_0x1bdc2c['error'][_0x4a19('0x12')]);return _0x246ee9(_0x1bdc2c[_0x4a19('0x11')][_0x4a19('0x12')]);}else{logger[_0x4a19('0xb')](_0x4a19('0xc'),_0x2aa3be,'request\x20sent');_0x246ee9(_0x1bdc2c[_0x4a19('0x13')]['message']);}})[_0x4a19('0x14')](function(_0x1656ff){logger['error'](_0x4a19('0xc'),_0x2aa3be,_0x1656ff);_0x1333ee(_0x1656ff);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 3870a51..501df8a 100644
--- a/server/api/cmCompany/index.js
+++ b/server/api/cmCompany/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbab3=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','addContacts','update','destroy','exports','multer','path','connect-timeout','Router'];(function(_0x9c3c24,_0x4972dd){var _0x4b51e9=function(_0x38574e){while(--_0x38574e){_0x9c3c24['push'](_0x9c3c24['shift']());}};_0x4b51e9(++_0x4972dd);}(_0xbab3,0x1f4));var _0x3bab=function(_0x5a3cf0,_0x160a68){_0x5a3cf0=_0x5a3cf0-0x0;var _0x5a64ee=_0xbab3[_0x5a3cf0];return _0x5a64ee;};'use strict';var multer=require(_0x3bab('0x0'));var util=require('util');var path=require(_0x3bab('0x1'));var timeout=require(_0x3bab('0x2'));var express=require('express');var router=express[_0x3bab('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x3bab('0x4'));var interaction=require(_0x3bab('0x5'));var config=require(_0x3bab('0x6'));var controller=require('./cmCompany.controller');router[_0x3bab('0x7')]('/',auth[_0x3bab('0x8')](),controller[_0x3bab('0x9')]);router['get']('/describe',auth[_0x3bab('0x8')](),controller[_0x3bab('0xa')]);router['get'](_0x3bab('0xb'),auth['isAuthenticated'](),controller[_0x3bab('0xc')]);router[_0x3bab('0x7')](_0x3bab('0xd'),auth['isAuthenticated'](),controller[_0x3bab('0xe')]);router[_0x3bab('0xf')]('/',auth[_0x3bab('0x8')](),controller[_0x3bab('0x10')]);router[_0x3bab('0xf')](_0x3bab('0xd'),auth[_0x3bab('0x8')](),controller[_0x3bab('0x11')]);router['put'](_0x3bab('0xb'),auth[_0x3bab('0x8')](),controller[_0x3bab('0x12')]);router['delete'](_0x3bab('0xb'),auth['isAuthenticated'](),controller[_0x3bab('0x13')]);module[_0x3bab('0x14')]=router;
\ No newline at end of file
+var _0xc838=['get','isAuthenticated','index','describe','/:id','show','/:id/contacts','getContacts','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller'];(function(_0x475637,_0x4f613a){var _0xe26048=function(_0xd0575e){while(--_0xd0575e){_0x475637['push'](_0x475637['shift']());}};_0xe26048(++_0x4f613a);}(_0xc838,0xbd));var _0x8c83=function(_0x244aa1,_0x7da15f){_0x244aa1=_0x244aa1-0x0;var _0x208578=_0xc838[_0x244aa1];return _0x208578;};'use strict';var multer=require(_0x8c83('0x0'));var util=require(_0x8c83('0x1'));var path=require(_0x8c83('0x2'));var timeout=require(_0x8c83('0x3'));var express=require(_0x8c83('0x4'));var router=express[_0x8c83('0x5')]();var fs_extra=require(_0x8c83('0x6'));var auth=require(_0x8c83('0x7'));var interaction=require(_0x8c83('0x8'));var config=require(_0x8c83('0x9'));var controller=require(_0x8c83('0xa'));router[_0x8c83('0xb')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0xd')]);router[_0x8c83('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x8c83('0xe')]);router['get'](_0x8c83('0xf'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x10')]);router[_0x8c83('0xb')](_0x8c83('0x11'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x12')]);router[_0x8c83('0x13')]('/',auth[_0x8c83('0xc')](),controller[_0x8c83('0x14')]);router[_0x8c83('0x13')]('/:id/contacts',auth[_0x8c83('0xc')](),controller['addContacts']);router['put'](_0x8c83('0xf'),auth['isAuthenticated'](),controller[_0x8c83('0x15')]);router[_0x8c83('0x16')](_0x8c83('0xf'),auth[_0x8c83('0xc')](),controller[_0x8c83('0x17')]);module[_0x8c83('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 4251f5e..e49ad6a 100644
--- a/server/api/cmContact/cmContact.attributes.js
+++ b/server/api/cmContact/cmContact.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x1798=['lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED','DATE','NOW'];(function(_0x40a812,_0x46c78f){var _0x44c655=function(_0x1b7c35){while(--_0x1b7c35){_0x40a812['push'](_0x40a812['shift']());}};_0x44c655(++_0x46c78f);}(_0x1798,0x1f0));var _0x8179=function(_0xb9bec0,_0x3f8a92){_0xb9bec0=_0xb9bec0-0x0;var _0x2d0f42=_0x1798[_0xb9bec0];return _0x2d0f42;};'use strict';var _=require(_0x8179('0x0'));var Sequelize=require(_0x8179('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x8179('0x2')]},'street':{'type':Sequelize[_0x8179('0x2')]},'postalCode':{'type':Sequelize[_0x8179('0x2')]},'city':{'type':Sequelize[_0x8179('0x2')]},'country':{'type':Sequelize[_0x8179('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8179('0x3')]},'phone':{'type':Sequelize[_0x8179('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x8179('0x2')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0x8179('0x2')]},'facebook':{'type':Sequelize[_0x8179('0x2')]},'fb_data':{'type':Sequelize[_0x8179('0x2')]},'twitter':{'type':Sequelize[_0x8179('0x2')]},'skype':{'type':Sequelize[_0x8179('0x2')]},'teams':{'type':Sequelize[_0x8179('0x2')]},'viber':{'type':Sequelize[_0x8179('0x2')]},'line':{'type':Sequelize[_0x8179('0x2')]},'wechat':{'type':Sequelize[_0x8179('0x2')]},'telegram':{'type':Sequelize[_0x8179('0x2')]},'UserId':{'type':Sequelize[_0x8179('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x8179('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8179('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x8179('0x6')],'defaultValue':Sequelize[_0x8179('0x7')]},'dialTimezone':{'type':Sequelize[_0x8179('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xc775=['INTEGER','lodash','sequelize','exports','STRING','TEXT'];(function(_0x53d172,_0x46611b){var _0x1bd0a2=function(_0x19fb52){while(--_0x19fb52){_0x53d172['push'](_0x53d172['shift']());}};_0x1bd0a2(++_0x46611b);}(_0xc775,0x97));var _0x5c77=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xc775[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x5c77('0x0'));var Sequelize=require(_0x5c77('0x1'));module[_0x5c77('0x2')]={'firstName':{'type':Sequelize[_0x5c77('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x5c77('0x3')]},'city':{'type':Sequelize[_0x5c77('0x3')]},'country':{'type':Sequelize[_0x5c77('0x3')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c77('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x5c77('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x5c77('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x5c77('0x3')]},'fb_data':{'type':Sequelize[_0x5c77('0x3')]},'twitter':{'type':Sequelize[_0x5c77('0x3')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0x5c77('0x3')]},'viber':{'type':Sequelize[_0x5c77('0x3')]},'line':{'type':Sequelize[_0x5c77('0x3')]},'wechat':{'type':Sequelize[_0x5c77('0x3')]},'telegram':{'type':Sequelize[_0x5c77('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize[_0x5c77('0x3')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize['STRING']},'utcOffset':{'type':Sequelize[_0x5c77('0x5')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 1503129..b9ce6fa 100644
--- a/server/api/cmContact/cmContact.controller.js
+++ b/server/api/cmContact/cmContact.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd690=['`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','CmHopperAdditionalPhone','getAdditionalPhones','PHONE','literal','duplicateAdditionalPhones','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','getHoppers','ContactId','includeAll','include','getHopperHistories','rows','getHopperFinals','getJscriptySessions','No\x20ListId\x20specified','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','0777','child_process','fork','../../components/import/cm/csv','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','import','User','agent','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','whatsapp','voice','-createdAt','resolve','channel','includes','Invalid\x20channel','parse','isValid','callerid','starttime','endtime','duration','note','createdAt','userDisposition','fullname','DESC','range','findAndCountAll','startCase','Website','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','UserId','color','browserName','customerIp','deviceModel','osName','ratingMessage','ratingType','ratingValue','referer','subject','substatus','openchannel','Owner','flatten','sortBy','reverse','value','bluebird','path','lodash','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','socket.io-emitter','./cmContact.socket','register','status','json','limit','undefined','count','offset','set','Content-Range','update','then','end','stack','name','index','getOptions','findAll','user','catch','destroy','find','describe','CmContact','tags','length','keys','startsWith','cf_','columnName','query','CmCustomField','displayName','alias','custom','type','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','hasOwnProperty','body','from','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','where','$or','push','ListId','findOrCreate','spread','contact','all','show','tag','params','ContactItemType','ItemType','sequelize','Phones.OrderBy','$and','omit','format','cf_%d','pickBy','map','isEmpty','table','cm_contacts','setFields','id\x20=\x20?','phone','getTags','findOne','model','Tag','rawAttributes','intersection','fields','attributes','order','sort','filters','pick','filter','merge','options','nolimit','setTags','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopper','item'];(function(_0xd8813a,_0x315766){var _0x487db6=function(_0x538ca9){while(--_0x538ca9){_0xd8813a['push'](_0xd8813a['shift']());}};_0x487db6(++_0x315766);}(_0xd690,0x166));var _0x0d69=function(_0x43efcb,_0x2f209a){_0x43efcb=_0x43efcb-0x0;var _0x28b8d0=_0xd690[_0x43efcb];return _0x28b8d0;};'use strict';var moment=require('moment');var BPromise=require(_0x0d69('0x0'));var util=require('util');var path=require(_0x0d69('0x1'));var fs=require('fs');var _=require(_0x0d69('0x2'));var squel=require('squel');var Papa=require('papaparse');var Redis=require(_0x0d69('0x3'));var contacts=require(_0x0d69('0x4'));var qs=require(_0x0d69('0x5'));var logger=require(_0x0d69('0x6'))(_0x0d69('0x7'));var config=require(_0x0d69('0x8'));var shared=require(_0x0d69('0x9'));var db=require(_0x0d69('0xa'))['db'];config[_0x0d69('0xb')]=_[_0x0d69('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x0d69('0xd'))(new Redis(config[_0x0d69('0xb')]));require(_0x0d69('0xe'))[_0x0d69('0xf')](socket);function respondWithResult(_0x452d52,_0x4ea563){_0x4ea563=_0x4ea563||0xc8;return function(_0x28ac98){if(_0x28ac98){return _0x452d52[_0x0d69('0x10')](_0x4ea563)[_0x0d69('0x11')](_0x28ac98);}};}function respondWithFilteredResult(_0x215445,_0x14111d){return function(_0x2e6dcc){if(_0x2e6dcc){var _0x332e96=typeof _0x14111d['offset']==='undefined'&&typeof _0x14111d[_0x0d69('0x12')]===_0x0d69('0x13');var _0x3b2d53=_0x2e6dcc[_0x0d69('0x14')];var _0x573bcf=_0x332e96?0x0:_0x14111d['offset'];var _0x5776dd=_0x332e96?_0x2e6dcc[_0x0d69('0x14')]:_0x14111d[_0x0d69('0x15')]+_0x14111d[_0x0d69('0x12')];var _0x2acf7;if(_0x5776dd>=_0x3b2d53){_0x5776dd=_0x3b2d53;_0x2acf7=0xc8;}else{_0x2acf7=0xce;}_0x215445[_0x0d69('0x10')](_0x2acf7);return _0x215445[_0x0d69('0x16')](_0x0d69('0x17'),_0x573bcf+'-'+_0x5776dd+'/'+_0x3b2d53)[_0x0d69('0x11')](_0x2e6dcc);}return null;};}function saveUpdates(_0x509621){return function(_0x232303){if(_0x232303){return _0x232303[_0x0d69('0x18')](_0x509621)[_0x0d69('0x19')](function(_0x16e887){return _0x16e887;});}return null;};}function removeEntity(_0x15e5d0){return function(_0x370255){if(_0x370255){return _0x370255['destroy']()[_0x0d69('0x19')](function(){_0x15e5d0[_0x0d69('0x10')](0xcc)[_0x0d69('0x1a')]();});}};}function handleEntityNotFound(_0x4334a0){return function(_0x3baa2e){if(!_0x3baa2e){_0x4334a0['sendStatus'](0x194);}return _0x3baa2e;};}function handleError(_0x56fc7a,_0x369d2c){_0x369d2c=_0x369d2c||0x1f4;return function(_0x5ad57b){logger['error'](_0x5ad57b[_0x0d69('0x1b')]);if(_0x5ad57b[_0x0d69('0x1c')]){delete _0x5ad57b[_0x0d69('0x1c')];}_0x56fc7a['status'](_0x369d2c)['send'](_0x5ad57b);};}exports[_0x0d69('0x1d')]=function(_0x1980c3,_0x592111){var _0x4ae85f={};return contacts['describe']()[_0x0d69('0x19')](function(_0x2aeaa4){_0x4ae85f=qs[_0x0d69('0x1e')](_0x2aeaa4,_0x1980c3);return contacts[_0x0d69('0x1f')](_0x1980c3['query'],_0x1980c3[_0x0d69('0x20')],_0x4ae85f,_0x2aeaa4);})[_0x0d69('0x19')](respondWithFilteredResult(_0x592111,_0x4ae85f))[_0x0d69('0x21')](handleError(_0x592111,null));};exports[_0x0d69('0x22')]=function(_0xf9b893,_0x151811){return db['CmContact'][_0x0d69('0x23')]({'where':{'id':_0xf9b893['params']['id']}})['then'](handleEntityNotFound(_0x151811,null))[_0x0d69('0x19')](removeEntity(_0x151811,null))[_0x0d69('0x21')](handleError(_0x151811,null));};exports[_0x0d69('0x24')]=function(_0x58a0b0,_0x283f39){return db[_0x0d69('0x25')][_0x0d69('0x24')]()['then'](function(_0x42c707){delete _0x42c707[_0x0d69('0x26')];for(var _0x290c00=0x0;_0x290c00
'];(function(_0x2b45b5,_0x474458){var _0x1d9c06=function(_0x9a3264){while(--_0x9a3264){_0x2b45b5['push'](_0x2b45b5['shift']());}};_0x1d9c06(++_0x474458);}(_0x4016,0xeb));var _0x6401=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x4016[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x6401('0x0'));var moment=require('moment');var random=require(_0x6401('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x6401('0x2'));var tnef=require(_0x6401('0x3'));var logger=require(_0x6401('0x4'))(_0x6401('0x5'));var config=require('../../../config/environment');function getAddress(_0x217e13){var _0x315be4=_['head'](_0x217e13[_0x6401('0x6')]);return _0x315be4&&_0x315be4[_0x6401('0x7')]?_0x315be4[_0x6401('0x7')]:'anonymous'+random[_0x6401('0x8')](0x6)+'@xcally.com';}function getFirstName(_0x163955){var _0x135494=_['head'](_0x163955['value']);if(_0x135494&&_0x135494['name']){if(_0x135494[_0x6401('0x9')]==_0x135494[_0x6401('0x7')]){return _0x135494['name'][_0x6401('0xa')](0x0,_0x135494[_0x6401('0x9')][_0x6401('0xb')]('@'));}var _0x122ab6=_0x135494[_0x6401('0x9')]['split'](/\s+/);return _0x122ab6[_0x6401('0xc')]>0x1?_0x122ab6[_0x6401('0xd')](0x0,-0x1)[_0x6401('0xe')]('\x20'):_0x135494[_0x6401('0x9')];}return _0x6401('0xf');}function getLastName(_0x379417){var _0x388b44=_[_0x6401('0x10')](_0x379417['value']);if(_0x388b44&&_0x388b44['name']){var _0x40b3a2=_0x388b44[_0x6401('0x9')][_0x6401('0x11')](/\s+/);return _0x40b3a2['length']>0x1?_0x40b3a2[_0x6401('0x12')]():'';}return'';}function getMails(_0x18b233,_0x1a03ad){var _0x3832b0='';for(var _0x20bcc8=0x0;_0x20bcc8<_0x1a03ad[_0x6401('0x6')][_0x6401('0xc')];_0x20bcc8+=0x1){if(_0x1a03ad[_0x6401('0x6')][_0x20bcc8][_0x6401('0x7')]!==_0x18b233){if(!_[_0x6401('0x13')](_0x3832b0)){_0x3832b0+=',';}_0x3832b0+=_0x1a03ad[_0x6401('0x6')][_0x20bcc8]['name']||_0x1a03ad[_0x6401('0x6')][_0x20bcc8][_0x6401('0x7')]||'';_0x3832b0+='\x20<';_0x3832b0+=_0x1a03ad[_0x6401('0x6')][_0x20bcc8][_0x6401('0x7')]?_0x1a03ad['value'][_0x20bcc8][_0x6401('0x7')]:'anonymous'+random[_0x6401('0x8')](0x6)+_0x6401('0x14');_0x3832b0+='>';}}return _0x3832b0;}function parseEmail(_0x380843,_0x4e11a8,_0x5e0586){if(_0x4e11a8[_0x6401('0x15')]){var _0x375f68=/