From: Andrea Amorese
Date: Thu, 23 Sep 2021 08:05:10 +0000 (+0200)
Subject: Built motion from commit d770e63b.|2.5.35
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=6ee16ea2a030629eec3032c9c551f5e989f37f6f;p=motion2.git
Built motion from commit d770e63b.|2.5.35
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 054a201..8b7881a 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-23T07:50:02.114Z",
+ "time": "2021-09-23T07:58:14.930Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 15a69e4..ca18e1a 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2021-09-23T07:50:02.114Z",
+ "time": "2021-09-23T07:58:14.930Z",
"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 24ee8c7..0198b99 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 _0x6b1b=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','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)]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration'];(function(_0x3c4a6a,_0x231751){var _0x52f15c=function(_0x34fc69){while(--_0x34fc69){_0x3c4a6a['push'](_0x3c4a6a['shift']());}};_0x52f15c(++_0x231751);}(_0x6b1b,0x1e7));var _0xb6b1=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x6b1b[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0xb6b1('0x0')]={'name':{'type':Sequelize[_0xb6b1('0x1')],'get':function(_0x446608){return this['getDataValue'](_0xb6b1('0x2'));}},'action':{'type':Sequelize[_0xb6b1('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0xb6b1('0x4'),_0xb6b1('0x5'),_0xb6b1('0x6'),_0xb6b1('0x7'),_0xb6b1('0x8'),_0xb6b1('0x9'),_0xb6b1('0xa'),_0xb6b1('0xb')]],'msg':_0xb6b1('0xc')}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0xb6b1('0x3')](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['STRING'](0x1000),'comment':_0xb6b1('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0xb6b1('0xe')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize['STRING'](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth]'},'data6':{'type':Sequelize[_0xb6b1('0x3')],'comments':_0xb6b1('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0xb6b1('0x10')}};
\ No newline at end of file
+var _0x4317=['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]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','action','STRING','contactManager','integration','motionbar','jscripty','bot'];(function(_0x265a85,_0x28374d){var _0xd35f61=function(_0x1fff20){while(--_0x1fff20){_0x265a85['push'](_0x265a85['shift']());}};_0xd35f61(++_0x28374d);}(_0x4317,0x7c));var _0x7431=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x4317[_0x5ddb1c];return _0x354adc;};'use strict';var Sequelize=require('sequelize');module[_0x7431('0x0')]={'name':{'type':Sequelize[_0x7431('0x1')],'get':function(_0x1ad054){return this['getDataValue'](_0x7431('0x2'));}},'action':{'type':Sequelize[_0x7431('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x7431('0x4'),_0x7431('0x5'),_0x7431('0x6'),_0x7431('0x7'),'urlForward','browser',_0x7431('0x8'),_0x7431('0x9')]],'msg':_0x7431('0xa')}},'comment':_0x7431('0xa')},'data1':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xb')},'data2':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xc')},'data3':{'type':Sequelize[_0x7431('0x3')](0x1000),'comment':_0x7431('0xd')},'data4':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xe')},'data5':{'type':Sequelize[_0x7431('0x3')](0x1000),'comments':_0x7431('0xf')},'data6':{'type':Sequelize[_0x7431('0x3')],'comments':_0x7431('0x10')},'data7':{'type':Sequelize[_0x7431('0x11')],'comments':_0x7431('0x12')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 16da602..e6c08ff 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 _0xe2df=['send','body','find','params','then','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','error','stack','name'];(function(_0x2adc31,_0x15c7df){var _0x398402=function(_0x42b0d9){while(--_0x42b0d9){_0x2adc31['push'](_0x2adc31['shift']());}};_0x398402(++_0x15c7df);}(_0xe2df,0x17e));var _0xfe2d=function(_0x1cd866,_0x3c4535){_0x1cd866=_0x1cd866-0x0;var _0x14cb3b=_0xe2df[_0x1cd866];return _0x14cb3b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xfe2d('0x0'));var zipdir=require(_0xfe2d('0x1'));var jsonpatch=require(_0xfe2d('0x2'));var rp=require(_0xfe2d('0x3'));var moment=require(_0xfe2d('0x4'));var BPromise=require(_0xfe2d('0x5'));var Mustache=require(_0xfe2d('0x6'));var util=require(_0xfe2d('0x7'));var path=require(_0xfe2d('0x8'));var sox=require(_0xfe2d('0x9'));var csv=require(_0xfe2d('0xa'));var ejs=require(_0xfe2d('0xb'));var fs=require('fs');var fs_extra=require(_0xfe2d('0xc'));var _=require('lodash');var squel=require(_0xfe2d('0xd'));var crypto=require('crypto');var jsforce=require(_0xfe2d('0xe'));var deskjs=require(_0xfe2d('0xf'));var toCsv=require(_0xfe2d('0xa'));var querystring=require(_0xfe2d('0x10'));var Papa=require(_0xfe2d('0x11'));var Redis=require(_0xfe2d('0x12'));var authService=require(_0xfe2d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xfe2d('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe2d('0x15'))(_0xfe2d('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xfe2d('0x17'));var db=require(_0xfe2d('0x18'))['db'];function respondWithStatusCode(_0x534d7e,_0x3fe121){_0x3fe121=_0x3fe121||0xcc;return function(_0x475f49){if(_0x475f49){return _0x534d7e['sendStatus'](_0x3fe121);}return _0x534d7e[_0xfe2d('0x19')](_0x3fe121)['end']();};}function respondWithResult(_0x33f4b0,_0x400ae4){_0x400ae4=_0x400ae4||0xc8;return function(_0x3813d8){if(_0x3813d8){return _0x33f4b0['status'](_0x400ae4)[_0xfe2d('0x1a')](_0x3813d8);}};}function respondWithFilteredResult(_0x8e979d,_0x1d2cdc){return function(_0x4b016e){if(_0x4b016e){var _0x487b1f=typeof _0x1d2cdc[_0xfe2d('0x1b')]===_0xfe2d('0x1c')&&typeof _0x1d2cdc[_0xfe2d('0x1d')]==='undefined';var _0x57efbd=_0x4b016e[_0xfe2d('0x1e')];var _0x2e09d5=_0x487b1f?0x0:_0x1d2cdc[_0xfe2d('0x1b')];var _0x76f014=_0x487b1f?_0x4b016e[_0xfe2d('0x1e')]:_0x1d2cdc['offset']+_0x1d2cdc[_0xfe2d('0x1d')];var _0x3346bd;if(_0x76f014>=_0x57efbd){_0x76f014=_0x57efbd;_0x3346bd=0xc8;}else{_0x3346bd=0xce;}_0x8e979d['status'](_0x3346bd);return _0x8e979d[_0xfe2d('0x1f')](_0xfe2d('0x20'),_0x2e09d5+'-'+_0x76f014+'/'+_0x57efbd)['json'](_0x4b016e);}return null;};}function patchUpdates(_0x5d139c){return function(_0x514105){try{jsonpatch[_0xfe2d('0x21')](_0x514105,_0x5d139c,!![]);}catch(_0x866835){return BPromise[_0xfe2d('0x22')](_0x866835);}return _0x514105[_0xfe2d('0x23')]();};}function saveUpdates(_0x345409,_0x544258){return function(_0x4090f6){if(_0x4090f6){return _0x4090f6[_0xfe2d('0x24')](_0x345409)['then'](function(_0x3fa059){return _0x3fa059;});}return null;};}function removeEntity(_0x1a0962,_0x3a20d7){return function(_0x3abcc5){if(_0x3abcc5){return _0x3abcc5[_0xfe2d('0x25')]()['then'](function(){_0x1a0962[_0xfe2d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x10ea8d,_0x2d6d2f){return function(_0x106419){if(!_0x106419){_0x10ea8d['sendStatus'](0x194);}return _0x106419;};}function handleError(_0x5f52b9,_0x3b63f3){_0x3b63f3=_0x3b63f3||0x1f4;return function(_0x1f9047){logger[_0xfe2d('0x26')](_0x1f9047[_0xfe2d('0x27')]);if(_0x1f9047['name']){delete _0x1f9047[_0xfe2d('0x28')];}_0x5f52b9[_0xfe2d('0x19')](_0x3b63f3)[_0xfe2d('0x29')](_0x1f9047);};}exports[_0xfe2d('0x24')]=function(_0x32d0df,_0x569f8d){if(_0x32d0df[_0xfe2d('0x2a')]['id']){delete _0x32d0df[_0xfe2d('0x2a')]['id'];}return db['Action'][_0xfe2d('0x2b')]({'where':{'id':_0x32d0df[_0xfe2d('0x2c')]['id']}})[_0xfe2d('0x2d')](handleEntityNotFound(_0x569f8d,null))[_0xfe2d('0x2d')](saveUpdates(_0x32d0df[_0xfe2d('0x2a')],null))['then'](respondWithResult(_0x569f8d,null))[_0xfe2d('0x2e')](handleError(_0x569f8d,null));};exports[_0xfe2d('0x25')]=function(_0x5b4de1,_0x35a97a){return db['Action'][_0xfe2d('0x2b')]({'where':{'id':_0x5b4de1['params']['id']}})[_0xfe2d('0x2d')](handleEntityNotFound(_0x35a97a,null))[_0xfe2d('0x2d')](removeEntity(_0x35a97a,null))['catch'](handleError(_0x35a97a,null));};
\ No newline at end of file
+var _0x2f40=['lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','set','reject','save','update','destroy','then','error','stack','name','body','find','catch','Action','params','rimraf','zip-dir','fast-json-patch','moment','util','sox','to-csv','ejs'];(function(_0x8854f2,_0x79542c){var _0x38505d=function(_0x5af02b){while(--_0x5af02b){_0x8854f2['push'](_0x8854f2['shift']());}};_0x38505d(++_0x79542c);}(_0x2f40,0x172));var _0x02f4=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x2f40[_0x5447fd];return _0x15b28a;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x02f4('0x0'));var zipdir=require(_0x02f4('0x1'));var jsonpatch=require(_0x02f4('0x2'));var rp=require('request-promise');var moment=require(_0x02f4('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x02f4('0x4'));var path=require('path');var sox=require(_0x02f4('0x5'));var csv=require(_0x02f4('0x6'));var ejs=require(_0x02f4('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x02f4('0x8'));var squel=require(_0x02f4('0x9'));var crypto=require('crypto');var jsforce=require(_0x02f4('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x02f4('0x6'));var querystring=require(_0x02f4('0xb'));var Papa=require(_0x02f4('0xc'));var Redis=require(_0x02f4('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x02f4('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x02f4('0xf'));var logger=require('../../config/logger')(_0x02f4('0x10'));var utils=require(_0x02f4('0x11'));var config=require(_0x02f4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x02f4('0x13'))['db'];function respondWithStatusCode(_0x5cd62b,_0x1c069d){_0x1c069d=_0x1c069d||0xcc;return function(_0xafe7d3){if(_0xafe7d3){return _0x5cd62b[_0x02f4('0x14')](_0x1c069d);}return _0x5cd62b[_0x02f4('0x15')](_0x1c069d)[_0x02f4('0x16')]();};}function respondWithResult(_0xa4b49b,_0x65239){_0x65239=_0x65239||0xc8;return function(_0x2ca339){if(_0x2ca339){return _0xa4b49b[_0x02f4('0x15')](_0x65239)[_0x02f4('0x17')](_0x2ca339);}};}function respondWithFilteredResult(_0x2017de,_0x37733d){return function(_0x3a7f49){if(_0x3a7f49){var _0x4db4f3=typeof _0x37733d['offset']===_0x02f4('0x18')&&typeof _0x37733d['limit']==='undefined';var _0x542934=_0x3a7f49[_0x02f4('0x19')];var _0x4da85c=_0x4db4f3?0x0:_0x37733d[_0x02f4('0x1a')];var _0x5ddd77=_0x4db4f3?_0x3a7f49['count']:_0x37733d[_0x02f4('0x1a')]+_0x37733d[_0x02f4('0x1b')];var _0x59a0f9;if(_0x5ddd77>=_0x542934){_0x5ddd77=_0x542934;_0x59a0f9=0xc8;}else{_0x59a0f9=0xce;}_0x2017de[_0x02f4('0x15')](_0x59a0f9);return _0x2017de[_0x02f4('0x1c')]('Content-Range',_0x4da85c+'-'+_0x5ddd77+'/'+_0x542934)[_0x02f4('0x17')](_0x3a7f49);}return null;};}function patchUpdates(_0x2ee0fb){return function(_0x127bd6){try{jsonpatch['apply'](_0x127bd6,_0x2ee0fb,!![]);}catch(_0x4612f2){return BPromise[_0x02f4('0x1d')](_0x4612f2);}return _0x127bd6[_0x02f4('0x1e')]();};}function saveUpdates(_0xdd84c,_0x4b7ccf){return function(_0x194e21){if(_0x194e21){return _0x194e21[_0x02f4('0x1f')](_0xdd84c)['then'](function(_0x1cedbc){return _0x1cedbc;});}return null;};}function removeEntity(_0x46d77d,_0xf71cd0){return function(_0x237fe2){if(_0x237fe2){return _0x237fe2[_0x02f4('0x20')]()[_0x02f4('0x21')](function(){_0x46d77d[_0x02f4('0x15')](0xcc)[_0x02f4('0x16')]();});}};}function handleEntityNotFound(_0x16812c,_0x5a501f){return function(_0xa1c370){if(!_0xa1c370){_0x16812c[_0x02f4('0x14')](0x194);}return _0xa1c370;};}function handleError(_0x53a184,_0x369a95){_0x369a95=_0x369a95||0x1f4;return function(_0x570a5d){logger[_0x02f4('0x22')](_0x570a5d[_0x02f4('0x23')]);if(_0x570a5d[_0x02f4('0x24')]){delete _0x570a5d[_0x02f4('0x24')];}_0x53a184[_0x02f4('0x15')](_0x369a95)['send'](_0x570a5d);};}exports['update']=function(_0x38b3e5,_0x156d8d){if(_0x38b3e5[_0x02f4('0x25')]['id']){delete _0x38b3e5['body']['id'];}return db['Action'][_0x02f4('0x26')]({'where':{'id':_0x38b3e5['params']['id']}})[_0x02f4('0x21')](handleEntityNotFound(_0x156d8d,null))[_0x02f4('0x21')](saveUpdates(_0x38b3e5[_0x02f4('0x25')],null))[_0x02f4('0x21')](respondWithResult(_0x156d8d,null))[_0x02f4('0x27')](handleError(_0x156d8d,null));};exports[_0x02f4('0x20')]=function(_0x2724a4,_0x5eba52){return db[_0x02f4('0x28')]['find']({'where':{'id':_0x2724a4[_0x02f4('0x29')]['id']}})['then'](handleEntityNotFound(_0x5eba52,null))[_0x02f4('0x21')](removeEntity(_0x5eba52,null))[_0x02f4('0x27')](handleError(_0x5eba52,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 5869a09..b79df7a 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 _0xd67b=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','lodash'];(function(_0x3f13f0,_0x3352a5){var _0x2970dd=function(_0x333f43){while(--_0x333f43){_0x3f13f0['push'](_0x3f13f0['shift']());}};_0x2970dd(++_0x3352a5);}(_0xd67b,0x1df));var _0xbd67=function(_0x21f231,_0x4e7334){_0x21f231=_0x21f231-0x0;var _0x478a31=_0xd67b[_0x21f231];return _0x478a31;};'use strict';var _=require(_0xbd67('0x0'));var util=require(_0xbd67('0x1'));var logger=require(_0xbd67('0x2'))(_0xbd67('0x3'));var moment=require(_0xbd67('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xbd67('0x5'));var rimraf=require(_0xbd67('0x6'));var config=require(_0xbd67('0x7'));var attributes=require(_0xbd67('0x8'));module[_0xbd67('0x9')]=function(_0x20b285,_0x103a04){return _0x20b285[_0xbd67('0xa')](_0xbd67('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2dac=['define','Action','tools_actions','util','../../config/logger','moment','bluebird','request-promise','./action.attributes','exports'];(function(_0x5ff5c9,_0x3213de){var _0x23e4a8=function(_0x1ebd48){while(--_0x1ebd48){_0x5ff5c9['push'](_0x5ff5c9['shift']());}};_0x23e4a8(++_0x3213de);}(_0x2dac,0x107));var _0xc2da=function(_0x1f99c9,_0xb440a4){_0x1f99c9=_0x1f99c9-0x0;var _0x5d0fff=_0x2dac[_0x1f99c9];return _0x5d0fff;};'use strict';var _=require('lodash');var util=require(_0xc2da('0x0'));var logger=require(_0xc2da('0x1'))('api');var moment=require(_0xc2da('0x2'));var BPromise=require(_0xc2da('0x3'));var rp=require(_0xc2da('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc2da('0x5'));module[_0xc2da('0x6')]=function(_0x2affd3,_0x3c879c){return _0x2affd3[_0xc2da('0x7')](_0xc2da('0x8'),attributes,{'tableName':_0xc2da('0x9'),'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 1df5487..36387eb 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 _0xc4aa=['moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','then','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','lodash','util'];(function(_0x53cead,_0x2008a9){var _0x2f5841=function(_0x58afe8){while(--_0x58afe8){_0x53cead['push'](_0x53cead['shift']());}};_0x2f5841(++_0x2008a9);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xc4aa[_0x3b0731];return _0x4204d7;};'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')]('Action,\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 _0x5fab=['../../config/environment','jayson/promise','client','request','then','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4c8fa9,_0x2a1337){var _0x192648=function(_0x6c8436){while(--_0x6c8436){_0x4c8fa9['push'](_0x4c8fa9['shift']());}};_0x192648(++_0x2a1337);}(_0x5fab,0x177));var _0xb5fa=function(_0x5d9a85,_0x55221e){_0x5d9a85=_0x5d9a85-0x0;var _0x1ef8aa=_0x5fab[_0x5d9a85];return _0x1ef8aa;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d70f6,_0x2e3804,_0x1aec3e){return new BPromise(function(_0x9c7bce,_0x56d018){return client[_0xb5fa('0xc')](_0x5d70f6,_0x1aec3e)[_0xb5fa('0xd')](function(_0x2cf4a5){logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x2e3804,_0xb5fa('0xe'),JSON[_0xb5fa('0x11')](_0x2cf4a5));if(_0x2cf4a5[_0xb5fa('0x12')]){if(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x13')]===0x1f4){logger[_0xb5fa('0x12')]('Action,\x20%s,\x20%s',_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x56d018(_0x2cf4a5['error'][_0xb5fa('0x14')]);}logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);return _0x9c7bce(_0x2cf4a5[_0xb5fa('0x12')][_0xb5fa('0x14')]);}else{logger['info']('Action,\x20%s,\x20%s',_0x2e3804,_0xb5fa('0xe'));_0x9c7bce(_0x2cf4a5[_0xb5fa('0x16')][_0xb5fa('0x14')]);}})[_0xb5fa('0x17')](function(_0x56fe10){logger['error'](_0xb5fa('0x15'),_0x2e3804,_0x56fe10);_0x56d018(_0x56fe10);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index abae83b..fcefa22 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 _0x7def=['destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./action.controller','put','isAuthenticated','update','delete','/:id'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x7def,0x167));var _0xf7de=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0x7def[_0x51c819];return _0x15c5d2;};'use strict';var multer=require(_0xf7de('0x0'));var util=require(_0xf7de('0x1'));var path=require(_0xf7de('0x2'));var timeout=require(_0xf7de('0x3'));var express=require(_0xf7de('0x4'));var router=express[_0xf7de('0x5')]();var fs_extra=require(_0xf7de('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xf7de('0x7'));var config=require(_0xf7de('0x8'));var controller=require(_0xf7de('0x9'));router[_0xf7de('0xa')]('/:id',auth[_0xf7de('0xb')](),controller[_0xf7de('0xc')]);router[_0xf7de('0xd')](_0xf7de('0xe'),auth[_0xf7de('0xb')](),controller[_0xf7de('0xf')]);module[_0xf7de('0x10')]=router;
\ No newline at end of file
+var _0x922d=['../../components/auth/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','exports','util','path','connect-timeout','Router'];(function(_0x1d24eb,_0x12295b){var _0x1dc576=function(_0x4d5770){while(--_0x4d5770){_0x1d24eb['push'](_0x1d24eb['shift']());}};_0x1dc576(++_0x12295b);}(_0x922d,0xf8));var _0xd922=function(_0x27d16e,_0x461295){_0x27d16e=_0x27d16e-0x0;var _0x4005ac=_0x922d[_0x27d16e];return _0x4005ac;};'use strict';var multer=require('multer');var util=require(_0xd922('0x0'));var path=require(_0xd922('0x1'));var timeout=require(_0xd922('0x2'));var express=require('express');var router=express[_0xd922('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xd922('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd922('0x5'));var controller=require(_0xd922('0x6'));router[_0xd922('0x7')](_0xd922('0x8'),auth[_0xd922('0x9')](),controller[_0xd922('0xa')]);router['delete'](_0xd922('0x8'),auth[_0xd922('0x9')](),controller['destroy']);module[_0xd922('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index b7b7480..0beac28 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 _0x3eea=['STRING','TEXT','sequelize'];(function(_0x36fbf3,_0x32aace){var _0x1536e2=function(_0x547d3a){while(--_0x547d3a){_0x36fbf3['push'](_0x36fbf3['shift']());}};_0x1536e2(++_0x32aace);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x3e6091,_0x49c232){_0x3e6091=_0x3e6091-0x0;var _0x35f9bb=_0x3eea[_0x3e6091];return _0x35f9bb;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'name':{'type':Sequelize[_0xa3ee('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xa3ee('0x1')]},'parent':{'type':Sequelize[_0xa3ee('0x1')]},'table':{'type':Sequelize[_0xa3ee('0x1')]},'conditions':{'type':Sequelize[_0xa3ee('0x2')]},'joins':{'type':Sequelize[_0xa3ee('0x2')]}};
\ No newline at end of file
+var _0x7dfd=['STRING','TEXT','sequelize','exports'];(function(_0x1a9d8c,_0x8eb138){var _0x42f058=function(_0x35b9df){while(--_0x35b9df){_0x1a9d8c['push'](_0x1a9d8c['shift']());}};_0x42f058(++_0x8eb138);}(_0x7dfd,0x1c2));var _0xd7df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7dfd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xd7df('0x0'));module[_0xd7df('0x1')]={'name':{'type':Sequelize[_0xd7df('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xd7df('0x2')]},'parent':{'type':Sequelize[_0xd7df('0x2')]},'table':{'type':Sequelize[_0xd7df('0x2')]},'conditions':{'type':Sequelize[_0xd7df('0x3')]},'joins':{'type':Sequelize[_0xd7df('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 1ea1ff4..38fe857 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 _0xbb6a=['fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','body','params','preview','join','left_join','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','joins','parse','includes','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SUM(%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','value','Sequelize','ValidationErrorItem','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','fork','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','apply','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','map','AnalyticCustomReport'];(function(_0x2d8db5,_0x3c9c8d){var _0xdc5579=function(_0x36f14f){while(--_0x36f14f){_0x2d8db5['push'](_0x2d8db5['shift']());}};_0xdc5579(++_0x3c9c8d);}(_0xbb6a,0x76));var _0xabb6=function(_0x59a549,_0x2fe2bb){_0x59a549=_0x59a549-0x0;var _0x12adbe=_0xbb6a[_0x59a549];return _0x12adbe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xabb6('0x0'));var jsonpatch=require(_0xabb6('0x1'));var rp=require(_0xabb6('0x2'));var moment=require(_0xabb6('0x3'));var BPromise=require(_0xabb6('0x4'));var Mustache=require(_0xabb6('0x5'));var util=require(_0xabb6('0x6'));var path=require(_0xabb6('0x7'));var sox=require(_0xabb6('0x8'));var csv=require(_0xabb6('0x9'));var ejs=require(_0xabb6('0xa'));var fs=require('fs');var fs_extra=require(_0xabb6('0xb'));var _=require(_0xabb6('0xc'));var squel=require('squel');var crypto=require(_0xabb6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xabb6('0xe'));var toCsv=require(_0xabb6('0x9'));var querystring=require('querystring');var Papa=require(_0xabb6('0xf'));var Redis=require(_0xabb6('0x10'));var authService=require(_0xabb6('0x11'));var qs=require(_0xabb6('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xabb6('0x13'));var logger=require(_0xabb6('0x14'))(_0xabb6('0x15'));var utils=require(_0xabb6('0x16'));var config=require(_0xabb6('0x17'));var licenseUtil=require(_0xabb6('0x18'));var db=require(_0xabb6('0x19'))['db'];var dbH=require(_0xabb6('0x19'))[_0xabb6('0x1a')];function respondWithStatusCode(_0x3865d4,_0x13ffa8){_0x13ffa8=_0x13ffa8||0xcc;return function(_0x1f8a32){if(_0x1f8a32){return _0x3865d4[_0xabb6('0x1b')](_0x13ffa8);}return _0x3865d4[_0xabb6('0x1c')](_0x13ffa8)[_0xabb6('0x1d')]();};}function respondWithResult(_0x176080,_0x5ca099){_0x5ca099=_0x5ca099||0xc8;return function(_0x28742d){if(_0x28742d){return _0x176080[_0xabb6('0x1c')](_0x5ca099)[_0xabb6('0x1e')](_0x28742d);}};}function respondWithFilteredResult(_0x4bc452,_0x1d2a15){return function(_0xcf99e){if(_0xcf99e){var _0x3b28a6=typeof _0x1d2a15[_0xabb6('0x1f')]===_0xabb6('0x20')&&typeof _0x1d2a15[_0xabb6('0x21')]==='undefined';var _0x4b9435=_0xcf99e['count'];var _0x52bfa1=_0x3b28a6?0x0:_0x1d2a15['offset'];var _0x2c3e44=_0x3b28a6?_0xcf99e[_0xabb6('0x22')]:_0x1d2a15[_0xabb6('0x1f')]+_0x1d2a15[_0xabb6('0x21')];var _0x170280;if(_0x2c3e44>=_0x4b9435){_0x2c3e44=_0x4b9435;_0x170280=0xc8;}else{_0x170280=0xce;}_0x4bc452[_0xabb6('0x1c')](_0x170280);return _0x4bc452['set']('Content-Range',_0x52bfa1+'-'+_0x2c3e44+'/'+_0x4b9435)[_0xabb6('0x1e')](_0xcf99e);}return null;};}function patchUpdates(_0xb1c764){return function(_0x1dee8c){try{jsonpatch[_0xabb6('0x23')](_0x1dee8c,_0xb1c764,!![]);}catch(_0x338c77){return BPromise['reject'](_0x338c77);}return _0x1dee8c[_0xabb6('0x24')]();};}function saveUpdates(_0x28687e,_0x43ebf4){return function(_0x4589de){if(_0x4589de){return _0x4589de[_0xabb6('0x25')](_0x28687e)[_0xabb6('0x26')](function(_0x2cf653){return _0x2cf653;});}return null;};}function removeEntity(_0x1a2070,_0x57dd15){return function(_0x18e777){if(_0x18e777){return _0x18e777[_0xabb6('0x27')]()[_0xabb6('0x26')](function(){var _0x1bb094=_0x18e777[_0xabb6('0x28')]({'plain':!![]});var _0x412549=_0xabb6('0x29');return db[_0xabb6('0x2a')]['destroy']({'where':{'type':_0x412549,'resourceId':_0x1bb094['id']}})[_0xabb6('0x26')](function(){return _0x18e777;});})['then'](function(){_0x1a2070['status'](0xcc)[_0xabb6('0x1d')]();});}};}function handleEntityNotFound(_0x17ec1f,_0x500e3e){return function(_0x1eb2c9){if(!_0x1eb2c9){_0x17ec1f[_0xabb6('0x1b')](0x194);}return _0x1eb2c9;};}function handleError(_0x7ee2b,_0x2453ca){_0x2453ca=_0x2453ca||0x1f4;return function(_0x584a8f){logger[_0xabb6('0x2b')](_0x584a8f[_0xabb6('0x2c')]);if(_0x584a8f[_0xabb6('0x2d')]){delete _0x584a8f[_0xabb6('0x2d')];}_0x7ee2b['status'](_0x2453ca)['send'](_0x584a8f);};}exports['index']=function(_0x3a2af5,_0x4cc486){var _0x5ab922={},_0x3895a2={},_0x4ccbdd={'count':0x0,'rows':[]};var _0x51562d=_[_0xabb6('0x2e')](db[_0xabb6('0x2f')]['rawAttributes'],function(_0xf8008f){return{'name':_0xf8008f[_0xabb6('0x30')],'type':_0xf8008f['type'][_0xabb6('0x31')]};});_0x3895a2[_0xabb6('0x32')]=_[_0xabb6('0x2e')](_0x51562d,'name');_0x3895a2[_0xabb6('0x33')]=_['keys'](_0x3a2af5[_0xabb6('0x33')]);_0x3895a2['filters']=_[_0xabb6('0x34')](_0x3895a2[_0xabb6('0x32')],_0x3895a2[_0xabb6('0x33')]);_0x5ab922[_0xabb6('0x35')]=_[_0xabb6('0x34')](_0x3895a2[_0xabb6('0x32')],qs['fields'](_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x36')]));_0x5ab922[_0xabb6('0x35')]=_0x5ab922[_0xabb6('0x35')][_0xabb6('0x37')]?_0x5ab922['attributes']:_0x3895a2[_0xabb6('0x32')];if(!_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x38')](_0xabb6('0x39'))){_0x5ab922[_0xabb6('0x21')]=qs[_0xabb6('0x21')](_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x21')]);_0x5ab922[_0xabb6('0x1f')]=qs['offset'](_0x3a2af5['query'][_0xabb6('0x1f')]);}_0x5ab922[_0xabb6('0x3a')]=qs[_0xabb6('0x3b')](_0x3a2af5['query']['sort']);_0x5ab922[_0xabb6('0x3c')]=qs[_0xabb6('0x3d')](_['pick'](_0x3a2af5['query'],_0x3895a2[_0xabb6('0x3d')]),_0x51562d);if(_0x3a2af5[_0xabb6('0x33')]['filter']){_0x5ab922[_0xabb6('0x3c')]=_[_0xabb6('0x3e')](_0x5ab922['where'],{'$or':_[_0xabb6('0x2e')](_0x51562d,function(_0x5f04ad){if(_0x5f04ad[_0xabb6('0x3f')]!==_0xabb6('0x40')){var _0x16f46a={};_0x16f46a[_0x5f04ad[_0xabb6('0x2d')]]={'$like':'%'+_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x41')]+'%'};return _0x16f46a;}})});}_0x5ab922=_[_0xabb6('0x3e')]({},_0x5ab922,_0x3a2af5[_0xabb6('0x42')]);var _0xe36be6={'where':_0x5ab922[_0xabb6('0x3c')]};return db[_0xabb6('0x2f')][_0xabb6('0x22')](_0xe36be6)[_0xabb6('0x26')](function(_0x340323){_0x4ccbdd[_0xabb6('0x22')]=_0x340323;if(_0x3a2af5[_0xabb6('0x33')][_0xabb6('0x43')]){_0x5ab922[_0xabb6('0x44')]=[{'all':!![]}];}return db[_0xabb6('0x2f')][_0xabb6('0x45')](_0x5ab922);})[_0xabb6('0x26')](function(_0x24f7e8){_0x4ccbdd[_0xabb6('0x46')]=_0x24f7e8;return _0x4ccbdd;})[_0xabb6('0x26')](respondWithFilteredResult(_0x4cc486,_0x5ab922))[_0xabb6('0x47')](handleError(_0x4cc486,null));};exports[_0xabb6('0x48')]=function(_0x4d25c9,_0x3bbdb1){var _0x1e8fc5={'raw':![],'where':{'id':_0x4d25c9['params']['id']}},_0x4cdf25={};_0x4cdf25['model']=_[_0xabb6('0x49')](db[_0xabb6('0x2f')][_0xabb6('0x4a')]);_0x4cdf25[_0xabb6('0x33')]=_[_0xabb6('0x49')](_0x4d25c9[_0xabb6('0x33')]);_0x4cdf25['filters']=_[_0xabb6('0x34')](_0x4cdf25[_0xabb6('0x32')],_0x4cdf25[_0xabb6('0x33')]);_0x1e8fc5['attributes']=_['intersection'](_0x4cdf25[_0xabb6('0x32')],qs['fields'](_0x4d25c9[_0xabb6('0x33')][_0xabb6('0x36')]));_0x1e8fc5[_0xabb6('0x35')]=_0x1e8fc5[_0xabb6('0x35')][_0xabb6('0x37')]?_0x1e8fc5['attributes']:_0x4cdf25['model'];if(_0x4d25c9['query'][_0xabb6('0x43')]){_0x1e8fc5[_0xabb6('0x44')]=[{'all':!![]}];}_0x1e8fc5=_['merge']({},_0x1e8fc5,_0x4d25c9[_0xabb6('0x42')]);return db['AnalyticCustomReport'][_0xabb6('0x4b')](_0x1e8fc5)[_0xabb6('0x26')](handleEntityNotFound(_0x3bbdb1,null))['then'](respondWithResult(_0x3bbdb1,null))[_0xabb6('0x47')](handleError(_0x3bbdb1,null));};exports[_0xabb6('0x4c')]=function(_0x5caa0c,_0x5f3a43){return db[_0xabb6('0x2f')][_0xabb6('0x4c')](_0x5caa0c['body'],{})[_0xabb6('0x26')](function(_0x551cf9){var _0x5ab6e3=_0x5caa0c[_0xabb6('0x4d')][_0xabb6('0x28')]({'plain':!![]});if(!_0x5ab6e3)throw new Error(_0xabb6('0x4e'));if(_0x5ab6e3[_0xabb6('0x4f')]===_0xabb6('0x4d')){var _0x33a313=_0x551cf9[_0xabb6('0x28')]({'plain':!![]});var _0x3a4b64=_0xabb6('0x50');return db[_0xabb6('0x51')][_0xabb6('0x4b')]({'where':{'name':_0x3a4b64,'userProfileId':_0x5ab6e3[_0xabb6('0x52')]},'raw':!![]})[_0xabb6('0x26')](function(_0x3d6905){if(_0x3d6905&&_0x3d6905['autoAssociation']===0x0){return db[_0xabb6('0x2a')][_0xabb6('0x4c')]({'name':_0x33a313[_0xabb6('0x2d')],'resourceId':_0x33a313['id'],'type':_0xabb6('0x29'),'sectionId':_0x3d6905['id']},{})[_0xabb6('0x26')](function(){return _0x551cf9;});}else{return _0x551cf9;}})[_0xabb6('0x47')](function(_0x12f84a){logger[_0xabb6('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x12f84a);throw _0x12f84a;});}return _0x551cf9;})[_0xabb6('0x26')](respondWithResult(_0x5f3a43,0xc9))[_0xabb6('0x47')](handleError(_0x5f3a43,null));};exports[_0xabb6('0x25')]=function(_0x5155ea,_0x116c15){if(_0x5155ea[_0xabb6('0x53')]['id']){delete _0x5155ea['body']['id'];}return db[_0xabb6('0x2f')]['find']({'where':{'id':_0x5155ea[_0xabb6('0x54')]['id']}})[_0xabb6('0x26')](handleEntityNotFound(_0x116c15,null))[_0xabb6('0x26')](saveUpdates(_0x5155ea['body'],null))[_0xabb6('0x26')](respondWithResult(_0x116c15,null))[_0xabb6('0x47')](handleError(_0x116c15,null));};exports[_0xabb6('0x27')]=function(_0x51531d,_0x55fe73){return db[_0xabb6('0x2f')]['find']({'where':{'id':_0x51531d[_0xabb6('0x54')]['id']}})['then'](handleEntityNotFound(_0x55fe73,null))[_0xabb6('0x26')](removeEntity(_0x55fe73,null))['catch'](handleError(_0x55fe73,null));};exports[_0xabb6('0x55')]=function(_0x5a5c01,_0x1657bf){var _0x563cb3=0xa;var _0x10e5d7=[_0xabb6('0x56'),_0xabb6('0x57'),_0xabb6('0x58'),_0xabb6('0x59')];var _0x69d028={'SUM':'SUM(%s)','COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':'MAX(%s)','MIN':_0xabb6('0x5c'),'AVG':_0xabb6('0x5d'),'GROUP_CONCAT':_0xabb6('0x5e'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x521107={'SEC_TO_TIME':_0xabb6('0x5f'),'DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xabb6('0x61')};var _0x48d827=function(_0x229ebb){return!_['includes']([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x229ebb);};var _0x2d812f=function(_0x287ab4){if(!_0x287ab4||!_0x287ab4[_0xabb6('0x66')][_0xabb6('0x37')]){return'';}for(var _0x28decd='(',_0x21afe9=0x0;_0x21afe9<_0x287ab4[_0xabb6('0x66')][_0xabb6('0x37')];_0x21afe9+=0x1){_0x21afe9>0x0&&(_0x28decd+='\x20'+_0x287ab4[_0xabb6('0x67')]+'\x20');_0x28decd+=_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x68')]?_0x2d812f(_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x68')]):_0x287ab4['rules'][_0x21afe9][_0xabb6('0x69')]+'\x20'+_0x287ab4['rules'][_0x21afe9][_0xabb6('0x6a')]+(_0x48d827(_0x287ab4[_0xabb6('0x66')][_0x21afe9][_0xabb6('0x6a')])?'\x20'+_0x287ab4[_0xabb6('0x66')][_0x21afe9]['value']:'');}return _0x28decd+')';};var _0xff4341={'where':{'id':_0x5a5c01[_0xabb6('0x54')]['id']}},_0x35278c,_0x5a147a,_0x58082,_0x1fafe0,_0x5e8954;_0xff4341=_[_0xabb6('0x3e')]({},_0xff4341,_0x5a5c01[_0xabb6('0x42')]);return db[_0xabb6('0x2f')]['find'](_0xff4341)[_0xabb6('0x26')](function(_0x3dc26b){if(_0x3dc26b){_0x35278c=_0x3dc26b;return _0x3dc26b[_0xabb6('0x6b')]();}return null;})[_0xabb6('0x26')](function(_0x65d12c){if(_0x65d12c){if(!_0x65d12c[_0xabb6('0x37')]){throw new db['Sequelize']['ValidationErrorItem'](_0xabb6('0x6c'),0x193);}_0x5a147a=_0x65d12c;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x2cbbb8){if(_0x2cbbb8){_0x58082=_[_0xabb6('0x6e')](_0x2cbbb8,'id');var _0x4228e7;var _0x50aae4=squel[_0xabb6('0x6f')]();_0x50aae4[_0xabb6('0x70')](_0x35278c[_0xabb6('0x71')]);for(var _0x59e268=0x0;_0x59e268<_0x5a147a[_0xabb6('0x37')];_0x59e268+=0x1){_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x72')]?_0x58082[_0x5a147a[_0x59e268][_0xabb6('0x72')]][_0xabb6('0x73')]:_0x5a147a[_0x59e268][_0xabb6('0x69')];_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x74')]?_[_0xabb6('0x75')](_0x69d028[_0x5a147a[_0x59e268]['function']],'%s',_0x4228e7):_0x4228e7;_0x4228e7=_0x5a147a[_0x59e268][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x521107[_0x5a147a[_0x59e268][_0xabb6('0x76')]],'%s',_0x4228e7):_0x4228e7;if(_0x5a147a[_0x59e268][_0xabb6('0x77')]){_0x50aae4['group'](_0x4228e7);}_0x5a147a[_0x59e268][_0xabb6('0x78')]&&_0x50aae4[_0xabb6('0x3a')](_0x4228e7,_0x5a147a[_0x59e268][_0xabb6('0x78')]==='DESC'?![]:!![]);_0x50aae4[_0xabb6('0x69')](_0x4228e7,_0x5a147a[_0x59e268]['alias']||_0x4228e7);}if(_0x35278c[_0xabb6('0x79')]){_0x35278c[_0xabb6('0x79')]=JSON[_0xabb6('0x7a')](_0x35278c[_0xabb6('0x79')]);for(var _0x3d7a5e=0x0;_0x3d7a5e<_0x35278c[_0xabb6('0x79')]['length'];_0x3d7a5e+=0x1){if(_0x35278c[_0xabb6('0x79')][_0x3d7a5e]['type']&&_[_0xabb6('0x7b')](_0x10e5d7,_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x3f')])&&_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7c')]&&_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7d')]&&_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7e')]){_0x50aae4[_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x3f')]](_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7d')],null,util[_0xabb6('0x76')](_0xabb6('0x7f'),_0x35278c[_0xabb6('0x71')],_0x35278c['joins'][_0x3d7a5e][_0xabb6('0x7c')],_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7d')],_0x35278c[_0xabb6('0x79')][_0x3d7a5e][_0xabb6('0x7e')]));}}}if(_0x35278c[_0xabb6('0x80')]){_0x35278c[_0xabb6('0x80')]=JSON[_0xabb6('0x7a')](_0x35278c[_0xabb6('0x80')]);_0x50aae4[_0xabb6('0x3c')](_0x2d812f(_0x35278c['conditions']['group']));}_0x5e8954=_0x50aae4[_0xabb6('0x81')]();_0x50aae4[_0xabb6('0x21')](_0x563cb3);_0x50aae4['offset'](0x0);logger[_0xabb6('0x82')](_0xabb6('0x83'),_0x50aae4[_0xabb6('0x84')]());return dbH[_0xabb6('0x85')]['query'](_0x50aae4['toString'](),{'type':dbH[_0xabb6('0x85')][_0xabb6('0x86')]['SELECT']});}})[_0xabb6('0x26')](respondWithResult(_0x1657bf,null))['catch'](handleError(_0x1657bf,null));};function runReport(_0x13dd0d,_0x51e7aa,_0x14ee7f){var _0x1e0e37=_0x51e7aa[_0xabb6('0x2d')];var _0x4682ad=0xa;var _0x2208f3=[_0xabb6('0x56'),'left_join',_0xabb6('0x58'),_0xabb6('0x59')];var _0x17b2d6={'SUM':_0xabb6('0x87'),'COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':_0xabb6('0x88'),'MIN':_0xabb6('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xabb6('0x5e'),'GROUP_CONCAT ASC':_0xabb6('0x89'),'GROUP_CONCAT DESC':_0xabb6('0x8a')};var _0x301792={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':_0xabb6('0x8b'),'UNIX_TIMESTAMP':_0xabb6('0x61')};var _0x1a8fd9=function(_0x46227a){return!_[_0xabb6('0x7b')]([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x46227a);};var _0x22bb93=function(_0x2e77f8){if(!_0x2e77f8||!_0x2e77f8['rules'][_0xabb6('0x37')]){return'';}for(var _0x263242='(',_0x20dab3=0x0;_0x20dab3<_0x2e77f8['rules']['length'];_0x20dab3+=0x1){_0x20dab3>0x0&&(_0x263242+='\x20'+_0x2e77f8[_0xabb6('0x67')]+'\x20');_0x263242+=_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x68')]?_0x22bb93(_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x68')]):_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x69')]+'\x20'+_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x6a')]+(_0x1a8fd9(_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x6a')])?'\x20'+_0x2e77f8[_0xabb6('0x66')][_0x20dab3][_0xabb6('0x8c')]:'');}return _0x263242+')';};var _0x38525e={'where':{'id':_0x13dd0d['id']}},_0x55c104,_0x4cfdf7,_0x290630,_0x5a8126,_0x24cdcf;_0x38525e=_[_0xabb6('0x3e')]({},_0x38525e,_0x14ee7f);return db[_0xabb6('0x2f')][_0xabb6('0x4b')](_0x38525e)[_0xabb6('0x26')](function(_0x4a3e79){if(_0x4a3e79){_0x55c104=_0x4a3e79;return _0x4a3e79['getFields']();}return null;})[_0xabb6('0x26')](function(_0x2d60dd){if(_0x2d60dd){if(!_0x2d60dd[_0xabb6('0x37')]){throw new db[(_0xabb6('0x8d'))][(_0xabb6('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x4cfdf7=_0x2d60dd;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x4d5100){if(_0x4d5100){_0x290630=_['keyBy'](_0x4d5100,'id');var _0x1abfed;var _0x533e48=squel['select']();_0x533e48[_0xabb6('0x70')](_0x55c104[_0xabb6('0x71')]);for(var _0x49f087=0x0;_0x49f087<_0x4cfdf7[_0xabb6('0x37')];_0x49f087+=0x1){_0x1abfed=_0x4cfdf7[_0x49f087][_0xabb6('0x72')]?_0x290630[_0x4cfdf7[_0x49f087]['MetricId']][_0xabb6('0x73')]:_0x4cfdf7[_0x49f087][_0xabb6('0x69')];_0x1abfed=_0x4cfdf7[_0x49f087]['function']?_[_0xabb6('0x75')](_0x17b2d6[_0x4cfdf7[_0x49f087][_0xabb6('0x74')]],'%s',_0x1abfed):_0x1abfed;_0x1abfed=_0x4cfdf7[_0x49f087][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x301792[_0x4cfdf7[_0x49f087]['format']],'%s',_0x1abfed):_0x1abfed;if(_0x4cfdf7[_0x49f087][_0xabb6('0x77')]){_0x533e48[_0xabb6('0x68')](_0x1abfed);}_0x4cfdf7[_0x49f087][_0xabb6('0x78')]&&_0x533e48[_0xabb6('0x3a')](_0x1abfed,_0x4cfdf7[_0x49f087][_0xabb6('0x78')]===_0xabb6('0x8f')?![]:!![]);_0x533e48['field'](_0x1abfed,_0x4cfdf7[_0x49f087][_0xabb6('0x90')]||_0x1abfed);}if(_0x55c104[_0xabb6('0x79')]){_0x55c104['joins']=JSON[_0xabb6('0x7a')](_0x55c104['joins']);for(var _0x13c778=0x0;_0x13c778<_0x55c104[_0xabb6('0x79')][_0xabb6('0x37')];_0x13c778+=0x1){if(_0x55c104['joins'][_0x13c778][_0xabb6('0x3f')]&&_[_0xabb6('0x7b')](_0x2208f3,_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x3f')])&&_0x55c104[_0xabb6('0x79')][_0x13c778]['parentKey']&&_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')]&&_0x55c104[_0xabb6('0x79')][_0x13c778]['foreignKey']){_0x533e48[_0x55c104[_0xabb6('0x79')][_0x13c778]['type']](_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')],null,util['format'](_0xabb6('0x7f'),_0x55c104['table'],_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7c')],_0x55c104[_0xabb6('0x79')][_0x13c778][_0xabb6('0x7d')],_0x55c104['joins'][_0x13c778]['foreignKey']));}}}if(_0x55c104['conditions']){_0x55c104['conditions']=JSON[_0xabb6('0x7a')](_0x55c104[_0xabb6('0x80')]);_0x533e48[_0xabb6('0x3c')](_0x22bb93(_0x55c104[_0xabb6('0x80')][_0xabb6('0x68')]));}_0x24cdcf=_0x533e48[_0xabb6('0x81')]();_0x533e48['limit'](_0x4682ad);_0x533e48[_0xabb6('0x1f')](0x0);return;}})[_0xabb6('0x26')](function(){if(_0x51e7aa[_0xabb6('0x91')]===_0xabb6('0x92')){return null;}var _0x7ed58=_[_0xabb6('0x3e')](_0x51e7aa,{'name':_0x51e7aa[_0xabb6('0x93')]||_0x51e7aa[_0xabb6('0x2d')]||_0x55c104[_0xabb6('0x2d')],'basename':_0x1e0e37,'savename':util[_0xabb6('0x76')](_0xabb6('0x94'),_0x51e7aa[_0xabb6('0x2d')]||_0x55c104['name'],require(_0xabb6('0x95'))[_0xabb6('0x96')](0x4),_0x51e7aa[_0xabb6('0x91')]||_0xabb6('0x97')),'reportId':_0x55c104['id'],'reportType':_0xabb6('0x98')});return db[_0xabb6('0x99')][_0xabb6('0x4c')](_0x7ed58,{'raw':!![]});})[_0xabb6('0x26')](function(_0x12a477){if(_0x55c104[_0xabb6('0x71')]===_0xabb6('0x9a')){_0x24cdcf[_0xabb6('0x3c')](_0x55c104[_0xabb6('0x71')]+_0xabb6('0x9b'),_0x51e7aa[_0xabb6('0x9c')],_0x51e7aa[_0xabb6('0x9d')]);}else{_0x24cdcf[_0xabb6('0x3c')](_0x55c104[_0xabb6('0x71')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x51e7aa[_0xabb6('0x9c')],_0x51e7aa[_0xabb6('0x9d')]);}if(_0x12a477){logger[_0xabb6('0x9e')]('Run\x20Query:',_0x24cdcf[_0xabb6('0x84')]());require('child_process')[_0xabb6('0x9f')](path['join'](__dirname,_0xabb6('0xa0'),_0x12a477[_0xabb6('0x91')]),[_0x12a477['id'],_0x24cdcf[_0xabb6('0x84')](),path['join'](__dirname,'../../files/reports',_0x12a477[_0xabb6('0xa1')]),_0x1e0e37]);return _0x12a477;}else{var _0x20d476=squel[_0xabb6('0x6f')]();_0x20d476[_0xabb6('0x70')]('('+_0x24cdcf['toString']()+')',_0xabb6('0xa2'));_0x20d476['field'](_0xabb6('0xa3'),'count');_0x24cdcf[_0xabb6('0x21')](_0x51e7aa[_0xabb6('0x21')]||_0x4682ad);_0x24cdcf[_0xabb6('0x1f')](_0x51e7aa[_0xabb6('0x1f')]||0x0);return dbH['sequelize'][_0xabb6('0x33')](_0x20d476[_0xabb6('0x84')](),{'type':dbH[_0xabb6('0x85')]['QueryTypes'][_0xabb6('0xa4')]})[_0xabb6('0x26')](function(_0xbae63c){if(!_0xbae63c['length']){_0x5a8126=0x0;}else{_0x5a8126=_0xbae63c[0x0][_0xabb6('0x22')]||0x0;}return dbH[_0xabb6('0x85')]['query'](_0x24cdcf[_0xabb6('0x84')](),{'type':dbH[_0xabb6('0x85')][_0xabb6('0x86')]['SELECT']});})['then'](function(_0x415c79){return{'rows':_0x415c79||[],'count':_0x5a8126};});}});}exports[_0xabb6('0xa5')]=function(_0x58c749,_0x2770ba){return runReport(_0x58c749[_0xabb6('0x54')],_0x58c749[_0xabb6('0x33')],_0x58c749[_0xabb6('0x42')])['then'](respondWithResult(_0x2770ba,null))['catch'](handleError(_0x2770ba,null));};exports['runReport']=runReport;exports[_0xabb6('0x33')]=function(_0x335a51,_0x2909a5){var _0x12ce4a=0xa;var _0x23a2e3=[_0xabb6('0x56'),_0xabb6('0x57'),_0xabb6('0x58'),'cross_join'];var _0x14aa93={'SUM':'SUM(%s)','COUNT':_0xabb6('0x5a'),'COUNT DISTINCT':_0xabb6('0x5b'),'MAX':_0xabb6('0x88'),'MIN':_0xabb6('0x5c'),'AVG':_0xabb6('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xabb6('0x89'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5167f0={'SEC_TO_TIME':_0xabb6('0x5f'),'DATE':'DATE(%s)','HOUR':_0xabb6('0x60'),'ROUND':_0xabb6('0x8b'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xeb75dc=function(_0x17a559){return!_[_0xabb6('0x7b')]([_0xabb6('0x62'),_0xabb6('0x63'),_0xabb6('0x64'),_0xabb6('0x65')],_0x17a559);};var _0x31e38c=function(_0xee97b2){if(!_0xee97b2||!_0xee97b2[_0xabb6('0x66')][_0xabb6('0x37')]){return'';}for(var _0x20c29f='(',_0x40ad57=0x0;_0x40ad57<_0xee97b2[_0xabb6('0x66')][_0xabb6('0x37')];_0x40ad57+=0x1){_0x40ad57>0x0&&(_0x20c29f+='\x20'+_0xee97b2[_0xabb6('0x67')]+'\x20');_0x20c29f+=_0xee97b2['rules'][_0x40ad57][_0xabb6('0x68')]?_0x31e38c(_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x68')]):_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x69')]+'\x20'+_0xee97b2['rules'][_0x40ad57][_0xabb6('0x6a')]+(_0xeb75dc(_0xee97b2['rules'][_0x40ad57][_0xabb6('0x6a')])?'\x20'+_0xee97b2[_0xabb6('0x66')][_0x40ad57][_0xabb6('0x8c')]:'');}return _0x20c29f+')';};var _0x3fc505={'where':{'id':_0x335a51[_0xabb6('0x54')]['id']}},_0x8f95a3,_0x52b61e,_0x565781,_0xe73ec,_0x14a4fe;_0x3fc505=_[_0xabb6('0x3e')]({},_0x3fc505,_0x335a51[_0xabb6('0x42')]);return db[_0xabb6('0x2f')]['find'](_0x3fc505)[_0xabb6('0x26')](function(_0x23d11e){if(_0x23d11e){_0x8f95a3=_0x23d11e;return _0x23d11e['getFields']();}return null;})[_0xabb6('0x26')](function(_0x116564){if(_0x116564){if(!_0x116564[_0xabb6('0x37')]){throw new db[(_0xabb6('0x8d'))]['ValidationErrorItem'](_0xabb6('0x6c'),0x193);}_0x52b61e=_0x116564;return db[_0xabb6('0x6d')][_0xabb6('0x45')]({'raw':!![]});}return null;})[_0xabb6('0x26')](function(_0x102d7e){if(_0x102d7e){_0x565781=_['keyBy'](_0x102d7e,'id');var _0x4d5393;var _0x5c6244=squel[_0xabb6('0x6f')]();_0x5c6244[_0xabb6('0x70')](_0x8f95a3[_0xabb6('0x71')]);for(var _0x3db458=0x0;_0x3db458<_0x52b61e[_0xabb6('0x37')];_0x3db458+=0x1){_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x72')]?_0x565781[_0x52b61e[_0x3db458][_0xabb6('0x72')]][_0xabb6('0x73')]:_0x52b61e[_0x3db458]['field'];_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x74')]?_[_0xabb6('0x75')](_0x14aa93[_0x52b61e[_0x3db458][_0xabb6('0x74')]],'%s',_0x4d5393):_0x4d5393;_0x4d5393=_0x52b61e[_0x3db458][_0xabb6('0x76')]?_[_0xabb6('0x75')](_0x5167f0[_0x52b61e[_0x3db458][_0xabb6('0x76')]],'%s',_0x4d5393):_0x4d5393;if(_0x52b61e[_0x3db458][_0xabb6('0x77')]){_0x5c6244[_0xabb6('0x68')](_0x4d5393);}_0x52b61e[_0x3db458][_0xabb6('0x78')]&&_0x5c6244[_0xabb6('0x3a')](_0x4d5393,_0x52b61e[_0x3db458][_0xabb6('0x78')]===_0xabb6('0x8f')?![]:!![]);_0x5c6244[_0xabb6('0x69')](_0x4d5393,_0x52b61e[_0x3db458]['alias']||_0x4d5393);}if(_0x8f95a3[_0xabb6('0x79')]){_0x8f95a3['joins']=JSON['parse'](_0x8f95a3[_0xabb6('0x79')]);for(var _0x39b5ab=0x0;_0x39b5ab<_0x8f95a3[_0xabb6('0x79')][_0xabb6('0x37')];_0x39b5ab+=0x1){if(_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')]&&_[_0xabb6('0x7b')](_0x23a2e3,_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')])&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7c')]&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7d')]&&_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7e')]){_0x5c6244[_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x3f')]](_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7d')],null,util[_0xabb6('0x76')]('%s.%s\x20=\x20%s.%s',_0x8f95a3[_0xabb6('0x71')],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7c')],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab]['foreignTable'],_0x8f95a3[_0xabb6('0x79')][_0x39b5ab][_0xabb6('0x7e')]));}}}if(_0x8f95a3[_0xabb6('0x80')]){_0x8f95a3[_0xabb6('0x80')]=JSON['parse'](_0x8f95a3[_0xabb6('0x80')]);_0x5c6244[_0xabb6('0x3c')](_0x31e38c(_0x8f95a3[_0xabb6('0x80')][_0xabb6('0x68')]));}_0x14a4fe=_0x5c6244[_0xabb6('0x81')]();_0x5c6244['limit'](_0x12ce4a);_0x5c6244[_0xabb6('0x1f')](0x0);logger['debug']('Limited\x20Query:',_0x5c6244[_0xabb6('0x84')]());return dbH[_0xabb6('0x85')]['query'](_0x5c6244['toString'](),{'type':dbH[_0xabb6('0x85')]['QueryTypes'][_0xabb6('0xa4')]});}})[_0xabb6('0x26')](function(){return{'sql':_0x14a4fe[_0xabb6('0x84')]()};})[_0xabb6('0x26')](respondWithResult(_0x2909a5,null))[_0xabb6('0x47')](handleError(_0x2909a5,null));};
\ No newline at end of file
+var _0x6f70=['VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','rawAttributes','include','create','body','user','role','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','field','alias','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','table','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','value','getFields','output','web','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','params','runReport','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/license/util','../../mysqldb','dbH','sendStatus','status','offset','undefined','count','limit','set','json','apply','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','end','error','name','send','index','map','AnalyticCustomReport','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','type'];(function(_0x2396a9,_0x448c2e){var _0x4deb7a=function(_0x1a1e3a){while(--_0x1a1e3a){_0x2396a9['push'](_0x2396a9['shift']());}};_0x4deb7a(++_0x448c2e);}(_0x6f70,0x110));var _0x06f7=function(_0x17b08b,_0x11e6cc){_0x17b08b=_0x17b08b-0x0;var _0x39853e=_0x6f70[_0x17b08b];return _0x39853e;};'use strict';var emlformat=require(_0x06f7('0x0'));var rimraf=require(_0x06f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x06f7('0x2'));var rp=require('request-promise');var moment=require(_0x06f7('0x3'));var BPromise=require(_0x06f7('0x4'));var Mustache=require(_0x06f7('0x5'));var util=require(_0x06f7('0x6'));var path=require('path');var sox=require(_0x06f7('0x7'));var csv=require(_0x06f7('0x8'));var ejs=require(_0x06f7('0x9'));var fs=require('fs');var fs_extra=require(_0x06f7('0xa'));var _=require(_0x06f7('0xb'));var squel=require(_0x06f7('0xc'));var crypto=require(_0x06f7('0xd'));var jsforce=require(_0x06f7('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x06f7('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x06f7('0x10'));var hardwareService=require(_0x06f7('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x06f7('0x12'));var config=require('../../config/environment');var licenseUtil=require(_0x06f7('0x13'));var db=require('../../mysqldb')['db'];var dbH=require(_0x06f7('0x14'))[_0x06f7('0x15')];function respondWithStatusCode(_0x2da6a7,_0xac42da){_0xac42da=_0xac42da||0xcc;return function(_0x11ddba){if(_0x11ddba){return _0x2da6a7[_0x06f7('0x16')](_0xac42da);}return _0x2da6a7[_0x06f7('0x17')](_0xac42da)['end']();};}function respondWithResult(_0x15cf8d,_0x28a6ab){_0x28a6ab=_0x28a6ab||0xc8;return function(_0x475f65){if(_0x475f65){return _0x15cf8d[_0x06f7('0x17')](_0x28a6ab)['json'](_0x475f65);}};}function respondWithFilteredResult(_0x5e2c8a,_0x50a8b3){return function(_0x1732d7){if(_0x1732d7){var _0x369e12=typeof _0x50a8b3[_0x06f7('0x18')]===_0x06f7('0x19')&&typeof _0x50a8b3['limit']===_0x06f7('0x19');var _0x58f2e9=_0x1732d7[_0x06f7('0x1a')];var _0x731f19=_0x369e12?0x0:_0x50a8b3[_0x06f7('0x18')];var _0x193200=_0x369e12?_0x1732d7[_0x06f7('0x1a')]:_0x50a8b3[_0x06f7('0x18')]+_0x50a8b3[_0x06f7('0x1b')];var _0x2872f5;if(_0x193200>=_0x58f2e9){_0x193200=_0x58f2e9;_0x2872f5=0xc8;}else{_0x2872f5=0xce;}_0x5e2c8a[_0x06f7('0x17')](_0x2872f5);return _0x5e2c8a[_0x06f7('0x1c')]('Content-Range',_0x731f19+'-'+_0x193200+'/'+_0x58f2e9)[_0x06f7('0x1d')](_0x1732d7);}return null;};}function patchUpdates(_0x24c34b){return function(_0xfb1e60){try{jsonpatch[_0x06f7('0x1e')](_0xfb1e60,_0x24c34b,!![]);}catch(_0x3776b8){return BPromise[_0x06f7('0x1f')](_0x3776b8);}return _0xfb1e60[_0x06f7('0x20')]();};}function saveUpdates(_0x40afa7,_0x18a6f0){return function(_0x5712cc){if(_0x5712cc){return _0x5712cc[_0x06f7('0x21')](_0x40afa7)[_0x06f7('0x22')](function(_0x3b7e36){return _0x3b7e36;});}return null;};}function removeEntity(_0x5b6d24,_0x22c207){return function(_0x2a2359){if(_0x2a2359){return _0x2a2359[_0x06f7('0x23')]()['then'](function(){var _0x4fbb4c=_0x2a2359[_0x06f7('0x24')]({'plain':!![]});var _0x35ea80=_0x06f7('0x25');return db[_0x06f7('0x26')][_0x06f7('0x23')]({'where':{'type':_0x35ea80,'resourceId':_0x4fbb4c['id']}})[_0x06f7('0x22')](function(){return _0x2a2359;});})[_0x06f7('0x22')](function(){_0x5b6d24[_0x06f7('0x17')](0xcc)[_0x06f7('0x27')]();});}};}function handleEntityNotFound(_0x23de7d,_0x417269){return function(_0x3a5b2d){if(!_0x3a5b2d){_0x23de7d['sendStatus'](0x194);}return _0x3a5b2d;};}function handleError(_0x5a6c70,_0x2b7f4e){_0x2b7f4e=_0x2b7f4e||0x1f4;return function(_0xb05cb7){logger[_0x06f7('0x28')](_0xb05cb7['stack']);if(_0xb05cb7[_0x06f7('0x29')]){delete _0xb05cb7[_0x06f7('0x29')];}_0x5a6c70['status'](_0x2b7f4e)[_0x06f7('0x2a')](_0xb05cb7);};}exports[_0x06f7('0x2b')]=function(_0x1644fc,_0x38bf98){var _0x599523={},_0x3dddb6={},_0x101953={'count':0x0,'rows':[]};var _0x3842da=_[_0x06f7('0x2c')](db[_0x06f7('0x2d')]['rawAttributes'],function(_0x2a7aae){return{'name':_0x2a7aae['fieldName'],'type':_0x2a7aae['type'][_0x06f7('0x2e')]};});_0x3dddb6['model']=_[_0x06f7('0x2c')](_0x3842da,'name');_0x3dddb6[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x1644fc['query']);_0x3dddb6['filters']=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],_0x3dddb6[_0x06f7('0x2f')]);_0x599523[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x3dddb6[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x599523['attributes']=_0x599523[_0x06f7('0x33')][_0x06f7('0x35')]?_0x599523['attributes']:_0x3dddb6[_0x06f7('0x32')];if(!_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x36')](_0x06f7('0x37'))){_0x599523[_0x06f7('0x1b')]=qs[_0x06f7('0x1b')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x1b')]);_0x599523[_0x06f7('0x18')]=qs['offset'](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x18')]);}_0x599523['order']=qs[_0x06f7('0x38')](_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x38')]);_0x599523[_0x06f7('0x39')]=qs[_0x06f7('0x3a')](_[_0x06f7('0x3b')](_0x1644fc['query'],_0x3dddb6[_0x06f7('0x3a')]),_0x3842da);if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]){_0x599523[_0x06f7('0x39')]=_['merge'](_0x599523['where'],{'$or':_[_0x06f7('0x2c')](_0x3842da,function(_0x556582){if(_0x556582[_0x06f7('0x3d')]!==_0x06f7('0x3e')){var _0x46f107={};_0x46f107[_0x556582['name']]={'$like':'%'+_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x3c')]+'%'};return _0x46f107;}})});}_0x599523=_[_0x06f7('0x3f')]({},_0x599523,_0x1644fc[_0x06f7('0x40')]);var _0x3f2c8d={'where':_0x599523[_0x06f7('0x39')]};return db['AnalyticCustomReport'][_0x06f7('0x1a')](_0x3f2c8d)[_0x06f7('0x22')](function(_0x18e23c){_0x101953[_0x06f7('0x1a')]=_0x18e23c;if(_0x1644fc[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x599523['include']=[{'all':!![]}];}return db[_0x06f7('0x2d')][_0x06f7('0x42')](_0x599523);})['then'](function(_0x4d3b25){_0x101953[_0x06f7('0x43')]=_0x4d3b25;return _0x101953;})[_0x06f7('0x22')](respondWithFilteredResult(_0x38bf98,_0x599523))[_0x06f7('0x44')](handleError(_0x38bf98,null));};exports[_0x06f7('0x45')]=function(_0x325f82,_0x441887){var _0x1824a4={'raw':![],'where':{'id':_0x325f82['params']['id']}},_0x48c4ff={};_0x48c4ff[_0x06f7('0x32')]=_[_0x06f7('0x30')](db['AnalyticCustomReport'][_0x06f7('0x46')]);_0x48c4ff[_0x06f7('0x2f')]=_[_0x06f7('0x30')](_0x325f82[_0x06f7('0x2f')]);_0x48c4ff[_0x06f7('0x3a')]=_['intersection'](_0x48c4ff['model'],_0x48c4ff[_0x06f7('0x2f')]);_0x1824a4[_0x06f7('0x33')]=_[_0x06f7('0x31')](_0x48c4ff[_0x06f7('0x32')],qs[_0x06f7('0x34')](_0x325f82[_0x06f7('0x2f')][_0x06f7('0x34')]));_0x1824a4[_0x06f7('0x33')]=_0x1824a4[_0x06f7('0x33')][_0x06f7('0x35')]?_0x1824a4['attributes']:_0x48c4ff[_0x06f7('0x32')];if(_0x325f82[_0x06f7('0x2f')][_0x06f7('0x41')]){_0x1824a4[_0x06f7('0x47')]=[{'all':!![]}];}_0x1824a4=_[_0x06f7('0x3f')]({},_0x1824a4,_0x325f82[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x1824a4)[_0x06f7('0x22')](handleEntityNotFound(_0x441887,null))[_0x06f7('0x22')](respondWithResult(_0x441887,null))[_0x06f7('0x44')](handleError(_0x441887,null));};exports[_0x06f7('0x48')]=function(_0x4c85fd,_0x449ddb){return db[_0x06f7('0x2d')][_0x06f7('0x48')](_0x4c85fd[_0x06f7('0x49')],{})[_0x06f7('0x22')](function(_0x4f60ef){var _0x10e3f3=_0x4c85fd[_0x06f7('0x4a')][_0x06f7('0x24')]({'plain':!![]});if(!_0x10e3f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10e3f3[_0x06f7('0x4b')]===_0x06f7('0x4a')){var _0x4a0095=_0x4f60ef['get']({'plain':!![]});var _0x14ea54='Reports';return db[_0x06f7('0x4c')][_0x06f7('0x4d')]({'where':{'name':_0x14ea54,'userProfileId':_0x10e3f3['userProfileId']},'raw':!![]})['then'](function(_0x2546ad){if(_0x2546ad&&_0x2546ad[_0x06f7('0x4e')]===0x0){return db[_0x06f7('0x26')][_0x06f7('0x48')]({'name':_0x4a0095[_0x06f7('0x29')],'resourceId':_0x4a0095['id'],'type':_0x06f7('0x25'),'sectionId':_0x2546ad['id']},{})[_0x06f7('0x22')](function(){return _0x4f60ef;});}else{return _0x4f60ef;}})[_0x06f7('0x44')](function(_0x4f71a7){logger[_0x06f7('0x28')](_0x06f7('0x4f'),_0x4f71a7);throw _0x4f71a7;});}return _0x4f60ef;})[_0x06f7('0x22')](respondWithResult(_0x449ddb,0xc9))[_0x06f7('0x44')](handleError(_0x449ddb,null));};exports['update']=function(_0x44e755,_0x36ccfd){if(_0x44e755[_0x06f7('0x49')]['id']){delete _0x44e755['body']['id'];}return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x44e755['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x36ccfd,null))[_0x06f7('0x22')](saveUpdates(_0x44e755[_0x06f7('0x49')],null))[_0x06f7('0x22')](respondWithResult(_0x36ccfd,null))[_0x06f7('0x44')](handleError(_0x36ccfd,null));};exports[_0x06f7('0x23')]=function(_0x5572a3,_0x2e5f48){return db[_0x06f7('0x2d')][_0x06f7('0x4d')]({'where':{'id':_0x5572a3['params']['id']}})[_0x06f7('0x22')](handleEntityNotFound(_0x2e5f48,null))[_0x06f7('0x22')](removeEntity(_0x2e5f48,null))[_0x06f7('0x44')](handleError(_0x2e5f48,null));};exports['preview']=function(_0x5b9049,_0x154ad4){var _0x5cd840=0xa;var _0x217283=['join',_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x41518d={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4f9733={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x5112b7=function(_0x4b9aae){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x4b9aae);};var _0x5666ab=function(_0x17bb46){if(!_0x17bb46||!_0x17bb46[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x38df88='(',_0xfcd92a=0x0;_0xfcd92a<_0x17bb46['rules'][_0x06f7('0x35')];_0xfcd92a+=0x1){_0xfcd92a>0x0&&(_0x38df88+='\x20'+_0x17bb46[_0x06f7('0x61')]+'\x20');_0x38df88+=_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['group']?_0x5666ab(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x62')]):_0x17bb46['rules'][_0xfcd92a]['field']+'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')]+(_0x5112b7(_0x17bb46[_0x06f7('0x60')][_0xfcd92a][_0x06f7('0x63')])?'\x20'+_0x17bb46[_0x06f7('0x60')][_0xfcd92a]['value']:'');}return _0x38df88+')';};var _0xa43de5={'where':{'id':_0x5b9049['params']['id']}},_0x6113b4,_0x3b6eb1,_0xb6aead,_0x3f86f5,_0x5b364c;_0xa43de5=_[_0x06f7('0x3f')]({},_0xa43de5,_0x5b9049[_0x06f7('0x40')]);return db[_0x06f7('0x2d')][_0x06f7('0x4d')](_0xa43de5)[_0x06f7('0x22')](function(_0x5d0c4a){if(_0x5d0c4a){_0x6113b4=_0x5d0c4a;return _0x5d0c4a['getFields']();}return null;})[_0x06f7('0x22')](function(_0x4cff49){if(_0x4cff49){if(!_0x4cff49[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))](_0x06f7('0x66'),0x193);}_0x3b6eb1=_0x4cff49;return db[_0x06f7('0x67')]['findAll']({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x262237){if(_0x262237){_0xb6aead=_[_0x06f7('0x68')](_0x262237,'id');var _0x3e2be6;var _0x655f62=squel[_0x06f7('0x69')]();_0x655f62[_0x06f7('0x6a')](_0x6113b4['table']);for(var _0x9465c6=0x0;_0x9465c6<_0x3b6eb1[_0x06f7('0x35')];_0x9465c6+=0x1){_0x3e2be6=_0x3b6eb1[_0x9465c6]['MetricId']?_0xb6aead[_0x3b6eb1[_0x9465c6][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x3b6eb1[_0x9465c6]['field'];_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x41518d[_0x3b6eb1[_0x9465c6]['function']],'%s',_0x3e2be6):_0x3e2be6;_0x3e2be6=_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]?_['replace'](_0x4f9733[_0x3b6eb1[_0x9465c6][_0x06f7('0x6f')]],'%s',_0x3e2be6):_0x3e2be6;if(_0x3b6eb1[_0x9465c6][_0x06f7('0x70')]){_0x655f62['group'](_0x3e2be6);}_0x3b6eb1[_0x9465c6][_0x06f7('0x71')]&&_0x655f62[_0x06f7('0x72')](_0x3e2be6,_0x3b6eb1[_0x9465c6]['orderBy']===_0x06f7('0x73')?![]:!![]);_0x655f62[_0x06f7('0x74')](_0x3e2be6,_0x3b6eb1[_0x9465c6][_0x06f7('0x75')]||_0x3e2be6);}if(_0x6113b4[_0x06f7('0x76')]){_0x6113b4[_0x06f7('0x76')]=JSON['parse'](_0x6113b4[_0x06f7('0x76')]);for(var _0x187d3e=0x0;_0x187d3e<_0x6113b4[_0x06f7('0x76')][_0x06f7('0x35')];_0x187d3e+=0x1){if(_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x217283,_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')])&&_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')]&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignTable']&&_0x6113b4[_0x06f7('0x76')][_0x187d3e]['foreignKey']){_0x655f62[_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x3d')]](_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x6113b4[_0x06f7('0x7a')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x77')],_0x6113b4['joins'][_0x187d3e][_0x06f7('0x78')],_0x6113b4[_0x06f7('0x76')][_0x187d3e][_0x06f7('0x7b')]));}}}if(_0x6113b4['conditions']){_0x6113b4[_0x06f7('0x7c')]=JSON[_0x06f7('0x7d')](_0x6113b4[_0x06f7('0x7c')]);_0x655f62['where'](_0x5666ab(_0x6113b4[_0x06f7('0x7c')][_0x06f7('0x62')]));}_0x5b364c=_0x655f62[_0x06f7('0x7e')]();_0x655f62[_0x06f7('0x1b')](_0x5cd840);_0x655f62['offset'](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x655f62[_0x06f7('0x81')]());return dbH['sequelize'][_0x06f7('0x2f')](_0x655f62[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]});}})[_0x06f7('0x22')](respondWithResult(_0x154ad4,null))[_0x06f7('0x44')](handleError(_0x154ad4,null));};function runReport(_0x1c0dbf,_0x5cd68e,_0x169ead){var _0x1bb74d=_0x5cd68e[_0x06f7('0x29')];var _0x38e044=0xa;var _0x46b999=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x3ae88f={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':_0x06f7('0x55'),'MAX':_0x06f7('0x86'),'MIN':_0x06f7('0x87'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x51f50a={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':_0x06f7('0x8a'),'HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x282a3b=function(_0x58150b){return!_[_0x06f7('0x5b')](['IS\x20NULL',_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x58150b);};var _0x1b07e0=function(_0x361c1f){if(!_0x361c1f||!_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x386aa9='(',_0x44d669=0x0;_0x44d669<_0x361c1f[_0x06f7('0x60')][_0x06f7('0x35')];_0x44d669+=0x1){_0x44d669>0x0&&(_0x386aa9+='\x20'+_0x361c1f[_0x06f7('0x61')]+'\x20');_0x386aa9+=_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]?_0x1b07e0(_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x62')]):_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x74')]+'\x20'+_0x361c1f['rules'][_0x44d669][_0x06f7('0x63')]+(_0x282a3b(_0x361c1f['rules'][_0x44d669]['condition'])?'\x20'+_0x361c1f[_0x06f7('0x60')][_0x44d669][_0x06f7('0x8c')]:'');}return _0x386aa9+')';};var _0x30f1f0={'where':{'id':_0x1c0dbf['id']}},_0x246a1f,_0x502709,_0x469963,_0x361080,_0x1eaa8b;_0x30f1f0=_[_0x06f7('0x3f')]({},_0x30f1f0,_0x169ead);return db['AnalyticCustomReport'][_0x06f7('0x4d')](_0x30f1f0)['then'](function(_0x5b66a4){if(_0x5b66a4){_0x246a1f=_0x5b66a4;return _0x5b66a4[_0x06f7('0x8d')]();}return null;})[_0x06f7('0x22')](function(_0x4e8332){if(_0x4e8332){if(!_0x4e8332[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x502709=_0x4e8332;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x185ad8){if(_0x185ad8){_0x469963=_[_0x06f7('0x68')](_0x185ad8,'id');var _0x528a76;var _0x33bfe8=squel[_0x06f7('0x69')]();_0x33bfe8['from'](_0x246a1f[_0x06f7('0x7a')]);for(var _0x131931=0x0;_0x131931<_0x502709[_0x06f7('0x35')];_0x131931+=0x1){_0x528a76=_0x502709[_0x131931][_0x06f7('0x6b')]?_0x469963[_0x502709[_0x131931]['MetricId']][_0x06f7('0x6c')]:_0x502709[_0x131931][_0x06f7('0x74')];_0x528a76=_0x502709[_0x131931][_0x06f7('0x6d')]?_['replace'](_0x3ae88f[_0x502709[_0x131931][_0x06f7('0x6d')]],'%s',_0x528a76):_0x528a76;_0x528a76=_0x502709[_0x131931]['format']?_['replace'](_0x51f50a[_0x502709[_0x131931][_0x06f7('0x6f')]],'%s',_0x528a76):_0x528a76;if(_0x502709[_0x131931][_0x06f7('0x70')]){_0x33bfe8['group'](_0x528a76);}_0x502709[_0x131931]['orderBy']&&_0x33bfe8[_0x06f7('0x72')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x33bfe8[_0x06f7('0x74')](_0x528a76,_0x502709[_0x131931][_0x06f7('0x75')]||_0x528a76);}if(_0x246a1f['joins']){_0x246a1f[_0x06f7('0x76')]=JSON['parse'](_0x246a1f[_0x06f7('0x76')]);for(var _0x486c30=0x0;_0x486c30<_0x246a1f[_0x06f7('0x76')]['length'];_0x486c30+=0x1){if(_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x46b999,_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x3d')])&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')]&&_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x7b')]){_0x33bfe8[_0x246a1f[_0x06f7('0x76')][_0x486c30]['type']](_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x246a1f[_0x06f7('0x7a')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x77')],_0x246a1f[_0x06f7('0x76')][_0x486c30][_0x06f7('0x78')],_0x246a1f[_0x06f7('0x76')][_0x486c30]['foreignKey']));}}}if(_0x246a1f[_0x06f7('0x7c')]){_0x246a1f['conditions']=JSON['parse'](_0x246a1f['conditions']);_0x33bfe8['where'](_0x1b07e0(_0x246a1f[_0x06f7('0x7c')]['group']));}_0x1eaa8b=_0x33bfe8[_0x06f7('0x7e')]();_0x33bfe8[_0x06f7('0x1b')](_0x38e044);_0x33bfe8[_0x06f7('0x18')](0x0);return;}})[_0x06f7('0x22')](function(){if(_0x5cd68e[_0x06f7('0x8e')]===_0x06f7('0x8f')){return null;}var _0x5acaeb=_['merge'](_0x5cd68e,{'name':_0x5cd68e['fullPath']||_0x5cd68e[_0x06f7('0x29')]||_0x246a1f[_0x06f7('0x29')],'basename':_0x1bb74d,'savename':util[_0x06f7('0x6f')](_0x06f7('0x90'),_0x5cd68e['name']||_0x246a1f[_0x06f7('0x29')],require(_0x06f7('0x91'))[_0x06f7('0x92')](0x4),_0x5cd68e[_0x06f7('0x8e')]||_0x06f7('0x93')),'reportId':_0x246a1f['id'],'reportType':_0x06f7('0x94')});return db[_0x06f7('0x95')][_0x06f7('0x48')](_0x5acaeb,{'raw':!![]});})[_0x06f7('0x22')](function(_0x49e97e){if(_0x246a1f[_0x06f7('0x7a')]===_0x06f7('0x96')){_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x97'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e['endDate']);}else{_0x1eaa8b[_0x06f7('0x39')](_0x246a1f[_0x06f7('0x7a')]+_0x06f7('0x99'),_0x5cd68e[_0x06f7('0x98')],_0x5cd68e[_0x06f7('0x9a')]);}if(_0x49e97e){logger[_0x06f7('0x9b')](_0x06f7('0x9c'),_0x1eaa8b[_0x06f7('0x81')]());require(_0x06f7('0x9d'))[_0x06f7('0x9e')](path['join'](__dirname,_0x06f7('0x9f'),_0x49e97e[_0x06f7('0x8e')]),[_0x49e97e['id'],_0x1eaa8b[_0x06f7('0x81')](),path['join'](__dirname,_0x06f7('0xa0'),_0x49e97e[_0x06f7('0xa1')]),_0x1bb74d]);return _0x49e97e;}else{var _0x2b315f=squel[_0x06f7('0x69')]();_0x2b315f[_0x06f7('0x6a')]('('+_0x1eaa8b['toString']()+')',_0x06f7('0xa2'));_0x2b315f['field'](_0x06f7('0xa3'),_0x06f7('0x1a'));_0x1eaa8b[_0x06f7('0x1b')](_0x5cd68e[_0x06f7('0x1b')]||_0x38e044);_0x1eaa8b[_0x06f7('0x18')](_0x5cd68e[_0x06f7('0x18')]||0x0);return dbH['sequelize'][_0x06f7('0x2f')](_0x2b315f[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')][_0x06f7('0x84')]})['then'](function(_0x1873d3){if(!_0x1873d3[_0x06f7('0x35')]){_0x361080=0x0;}else{_0x361080=_0x1873d3[0x0][_0x06f7('0x1a')]||0x0;}return dbH[_0x06f7('0x82')]['query'](_0x1eaa8b[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')]['QueryTypes'][_0x06f7('0x84')]});})['then'](function(_0x4d82c4){return{'rows':_0x4d82c4||[],'count':_0x361080};});}});}exports[_0x06f7('0xa4')]=function(_0x8ae404,_0x12daf7){return runReport(_0x8ae404[_0x06f7('0xa5')],_0x8ae404[_0x06f7('0x2f')],_0x8ae404[_0x06f7('0x40')])[_0x06f7('0x22')](respondWithResult(_0x12daf7,null))[_0x06f7('0x44')](handleError(_0x12daf7,null));};exports[_0x06f7('0xa6')]=runReport;exports['query']=function(_0x3e2c25,_0x5efe03){var _0x2de4ec=0xa;var _0x21bddb=[_0x06f7('0x85'),_0x06f7('0x50'),_0x06f7('0x51'),_0x06f7('0x52')];var _0x457c31={'SUM':_0x06f7('0x53'),'COUNT':_0x06f7('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x06f7('0x86'),'MIN':'MIN(%s)','AVG':_0x06f7('0x56'),'GROUP_CONCAT':_0x06f7('0x88'),'GROUP_CONCAT ASC':_0x06f7('0x57'),'GROUP_CONCAT DESC':_0x06f7('0x89')};var _0x568888={'SEC_TO_TIME':_0x06f7('0x58'),'DATE':'DATE(%s)','HOUR':_0x06f7('0x8b'),'ROUND':_0x06f7('0x59'),'UNIX_TIMESTAMP':_0x06f7('0x5a')};var _0x4592c7=function(_0x21d1d){return!_[_0x06f7('0x5b')]([_0x06f7('0x5c'),_0x06f7('0x5d'),_0x06f7('0x5e'),_0x06f7('0x5f')],_0x21d1d);};var _0x5cc7a1=function(_0x1ecc4c){if(!_0x1ecc4c||!_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')]){return'';}for(var _0x447abd='(',_0x466a05=0x0;_0x466a05<_0x1ecc4c[_0x06f7('0x60')][_0x06f7('0x35')];_0x466a05+=0x1){_0x466a05>0x0&&(_0x447abd+='\x20'+_0x1ecc4c[_0x06f7('0x61')]+'\x20');_0x447abd+=_0x1ecc4c['rules'][_0x466a05]['group']?_0x5cc7a1(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x62')]):_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x74')]+'\x20'+_0x1ecc4c['rules'][_0x466a05]['condition']+(_0x4592c7(_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x63')])?'\x20'+_0x1ecc4c['rules'][_0x466a05][_0x06f7('0x8c')]:'');}return _0x447abd+')';};var _0x239735={'where':{'id':_0x3e2c25[_0x06f7('0xa5')]['id']}},_0x2d206f,_0x5bf1be,_0x18c530,_0xa7d33d,_0x501379;_0x239735=_[_0x06f7('0x3f')]({},_0x239735,_0x3e2c25[_0x06f7('0x40')]);return db[_0x06f7('0x2d')]['find'](_0x239735)[_0x06f7('0x22')](function(_0x221bf9){if(_0x221bf9){_0x2d206f=_0x221bf9;return _0x221bf9['getFields']();}return null;})[_0x06f7('0x22')](function(_0x37ef56){if(_0x37ef56){if(!_0x37ef56[_0x06f7('0x35')]){throw new db[(_0x06f7('0x64'))][(_0x06f7('0x65'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5bf1be=_0x37ef56;return db[_0x06f7('0x67')][_0x06f7('0x42')]({'raw':!![]});}return null;})[_0x06f7('0x22')](function(_0x4b1ab4){if(_0x4b1ab4){_0x18c530=_['keyBy'](_0x4b1ab4,'id');var _0x4bae37;var _0x4afb22=squel['select']();_0x4afb22[_0x06f7('0x6a')](_0x2d206f['table']);for(var _0x392f04=0x0;_0x392f04<_0x5bf1be[_0x06f7('0x35')];_0x392f04+=0x1){_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6b')]?_0x18c530[_0x5bf1be[_0x392f04][_0x06f7('0x6b')]][_0x06f7('0x6c')]:_0x5bf1be[_0x392f04][_0x06f7('0x74')];_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6d')]?_[_0x06f7('0x6e')](_0x457c31[_0x5bf1be[_0x392f04][_0x06f7('0x6d')]],'%s',_0x4bae37):_0x4bae37;_0x4bae37=_0x5bf1be[_0x392f04][_0x06f7('0x6f')]?_['replace'](_0x568888[_0x5bf1be[_0x392f04][_0x06f7('0x6f')]],'%s',_0x4bae37):_0x4bae37;if(_0x5bf1be[_0x392f04][_0x06f7('0x70')]){_0x4afb22['group'](_0x4bae37);}_0x5bf1be[_0x392f04][_0x06f7('0x71')]&&_0x4afb22['order'](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x71')]===_0x06f7('0x73')?![]:!![]);_0x4afb22[_0x06f7('0x74')](_0x4bae37,_0x5bf1be[_0x392f04][_0x06f7('0x75')]||_0x4bae37);}if(_0x2d206f[_0x06f7('0x76')]){_0x2d206f[_0x06f7('0x76')]=JSON['parse'](_0x2d206f[_0x06f7('0x76')]);for(var _0x47ac66=0x0;_0x47ac66<_0x2d206f[_0x06f7('0x76')][_0x06f7('0x35')];_0x47ac66+=0x1){if(_0x2d206f['joins'][_0x47ac66][_0x06f7('0x3d')]&&_[_0x06f7('0x5b')](_0x21bddb,_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')])&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x77')]&&_0x2d206f['joins'][_0x47ac66][_0x06f7('0x78')]&&_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]){_0x4afb22[_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x3d')]](_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],null,util[_0x06f7('0x6f')](_0x06f7('0x79'),_0x2d206f[_0x06f7('0x7a')],_0x2d206f['joins'][_0x47ac66][_0x06f7('0x77')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x78')],_0x2d206f[_0x06f7('0x76')][_0x47ac66][_0x06f7('0x7b')]));}}}if(_0x2d206f[_0x06f7('0x7c')]){_0x2d206f['conditions']=JSON[_0x06f7('0x7d')](_0x2d206f[_0x06f7('0x7c')]);_0x4afb22['where'](_0x5cc7a1(_0x2d206f[_0x06f7('0x7c')]['group']));}_0x501379=_0x4afb22['clone']();_0x4afb22[_0x06f7('0x1b')](_0x2de4ec);_0x4afb22[_0x06f7('0x18')](0x0);logger[_0x06f7('0x7f')](_0x06f7('0x80'),_0x4afb22[_0x06f7('0x81')]());return dbH[_0x06f7('0x82')]['query'](_0x4afb22[_0x06f7('0x81')](),{'type':dbH[_0x06f7('0x82')][_0x06f7('0x83')]['SELECT']});}})[_0x06f7('0x22')](function(){return{'sql':_0x501379[_0x06f7('0x81')]()};})[_0x06f7('0x22')](respondWithResult(_0x5efe03,null))[_0x06f7('0x44')](handleError(_0x5efe03,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 785d5ec..7cbed83 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 _0xb0d7=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','moment','request-promise'];(function(_0x26ccb4,_0x1d89dd){var _0x59c549=function(_0x412a4b){while(--_0x412a4b){_0x26ccb4['push'](_0x26ccb4['shift']());}};_0x59c549(++_0x1d89dd);}(_0xb0d7,0xb0));var _0x7b0d=function(_0x512535,_0x4fe5ff){_0x512535=_0x512535-0x0;var _0x1f1ed6=_0xb0d7[_0x512535];return _0x1f1ed6;};'use strict';var _=require(_0x7b0d('0x0'));var util=require('util');var logger=require(_0x7b0d('0x1'))('api');var moment=require(_0x7b0d('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b0d('0x3'));var fs=require('fs');var path=require(_0x7b0d('0x4'));var rimraf=require(_0x7b0d('0x5'));var config=require(_0x7b0d('0x6'));var attributes=require(_0x7b0d('0x7'));module[_0x7b0d('0x8')]=function(_0x42803d,_0x5e8329){return _0x42803d[_0x7b0d('0x9')](_0x7b0d('0xa'),attributes,{'tableName':_0x7b0d('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x28f9=['analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','AnalyticCustomReport'];(function(_0x183964,_0x2dd9ac){var _0x311d8f=function(_0x1b8f9b){while(--_0x1b8f9b){_0x183964['push'](_0x183964['shift']());}};_0x311d8f(++_0x2dd9ac);}(_0x28f9,0x7a));var _0x928f=function(_0x158db6,_0x1ea45d){_0x158db6=_0x158db6-0x0;var _0x200753=_0x28f9[_0x158db6];return _0x200753;};'use strict';var _=require('lodash');var util=require(_0x928f('0x0'));var logger=require(_0x928f('0x1'))(_0x928f('0x2'));var moment=require(_0x928f('0x3'));var BPromise=require(_0x928f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x928f('0x5'));var rimraf=require(_0x928f('0x6'));var config=require(_0x928f('0x7'));var attributes=require('./analyticCustomReport.attributes');module[_0x928f('0x8')]=function(_0x59794b,_0x1772f3){return _0x59794b['define'](_0x928f('0x9'),attributes,{'tableName':_0x928f('0xa'),'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 bf3dd10..b2d78f1 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 _0x6259=['request','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x6259,0x199));var _0x9625=function(_0x567f56,_0x49dd75){_0x567f56=_0x567f56-0x0;var _0x55df17=_0x6259[_0x567f56];return _0x55df17;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9625('0x0'));var BPromise=require(_0x9625('0x1'));var rs=require(_0x9625('0x2'));var fs=require('fs');var Redis=require(_0x9625('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9625('0x4'))(_0x9625('0x5'));var config=require(_0x9625('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x9625('0x7')][_0x9625('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x243c4e,_0x21cefa,_0x4e9c6d){return new BPromise(function(_0x19272a,_0x391a19){return client[_0x9625('0x9')](_0x243c4e,_0x4e9c6d)['then'](function(_0x16fc99){logger['info'](_0x9625('0xa'),_0x21cefa,'request\x20sent');logger[_0x9625('0xb')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x21cefa,_0x9625('0xc'),JSON[_0x9625('0xd')](_0x16fc99));if(_0x16fc99['error']){if(_0x16fc99[_0x9625('0xe')][_0x9625('0xf')]===0x1f4){logger[_0x9625('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x21cefa,_0x16fc99[_0x9625('0xe')][_0x9625('0x10')]);return _0x391a19(_0x16fc99[_0x9625('0xe')][_0x9625('0x10')]);}logger[_0x9625('0xe')](_0x9625('0xa'),_0x21cefa,_0x16fc99[_0x9625('0xe')]['message']);return _0x19272a(_0x16fc99['error'][_0x9625('0x10')]);}else{logger[_0x9625('0x11')](_0x9625('0xa'),_0x21cefa,'request\x20sent');_0x19272a(_0x16fc99['result'][_0x9625('0x10')]);}})[_0x9625('0x12')](function(_0x333ef9){logger[_0x9625('0xe')](_0x9625('0xa'),_0x21cefa,_0x333ef9);_0x391a19(_0x333ef9);});});}
\ No newline at end of file
+var _0xf6bd=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client'];(function(_0x206794,_0x26fd02){var _0x38a75b=function(_0x208082){while(--_0x208082){_0x206794['push'](_0x206794['shift']());}};_0x38a75b(++_0x26fd02);}(_0xf6bd,0x7b));var _0xdf6b=function(_0x4a8418,_0x39078a){_0x4a8418=_0x4a8418-0x0;var _0x390174=_0xf6bd[_0x4a8418];return _0x390174;};'use strict';var _=require('lodash');var util=require(_0xdf6b('0x0'));var moment=require(_0xdf6b('0x1'));var BPromise=require(_0xdf6b('0x2'));var rs=require(_0xdf6b('0x3'));var fs=require('fs');var Redis=require(_0xdf6b('0x4'));var db=require(_0xdf6b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdf6b('0x6'))(_0xdf6b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdf6b('0x8')][_0xdf6b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36cbd0,_0x2b31b8,_0x388f1a){return new BPromise(function(_0x1bbbb6,_0x63dc28){return client[_0xdf6b('0xa')](_0x36cbd0,_0x388f1a)[_0xdf6b('0xb')](function(_0x97aee1){logger[_0xdf6b('0xc')](_0xdf6b('0xd'),_0x2b31b8,_0xdf6b('0xe'));logger[_0xdf6b('0xf')](_0xdf6b('0x10'),_0x2b31b8,'request\x20sent',JSON[_0xdf6b('0x11')](_0x97aee1));if(_0x97aee1['error']){if(_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x13')]===0x1f4){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x97aee1[_0xdf6b('0x12')][_0xdf6b('0x14')]);return _0x63dc28(_0x97aee1['error'][_0xdf6b('0x14')]);}logger[_0xdf6b('0x12')](_0xdf6b('0xd'),_0x2b31b8,_0x97aee1[_0xdf6b('0x12')]['message']);return _0x1bbbb6(_0x97aee1['error'][_0xdf6b('0x14')]);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0xdf6b('0xe'));_0x1bbbb6(_0x97aee1['result']['message']);}})[_0xdf6b('0x15')](function(_0x45bc66){logger[_0xdf6b('0x12')]('AnalyticCustomReport,\x20%s,\x20%s',_0x2b31b8,_0x45bc66);_0x63dc28(_0x45bc66);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 0ad56c1..82cd0f6 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 _0x276b=['util','connect-timeout','fs-extra','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','/:id','show','/:id/run','run','post','create','update','delete','destroy','exports','multer'];(function(_0x420f46,_0x389a33){var _0x5992f9=function(_0x298ab9){while(--_0x298ab9){_0x420f46['push'](_0x420f46['shift']());}};_0x5992f9(++_0x389a33);}(_0x276b,0x10d));var _0xb276=function(_0x9290a4,_0x59eba5){_0x9290a4=_0x9290a4-0x0;var _0x2fff5d=_0x276b[_0x9290a4];return _0x2fff5d;};'use strict';var multer=require(_0xb276('0x0'));var util=require(_0xb276('0x1'));var path=require('path');var timeout=require(_0xb276('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xb276('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xb276('0x4'));var controller=require(_0xb276('0x5'));router[_0xb276('0x6')]('/',auth[_0xb276('0x7')](),controller['index']);router[_0xb276('0x6')](_0xb276('0x8'),auth[_0xb276('0x7')](),controller[_0xb276('0x9')]);router[_0xb276('0x6')]('/:id/preview',auth['isAuthenticated'](),controller['preview']);router[_0xb276('0x6')](_0xb276('0xa'),auth['isAuthenticated'](),controller[_0xb276('0xb')]);router['get']('/:id/query',auth[_0xb276('0x7')](),controller['query']);router[_0xb276('0xc')]('/',auth[_0xb276('0x7')](),controller[_0xb276('0xd')]);router['put'](_0xb276('0x8'),auth[_0xb276('0x7')](),controller[_0xb276('0xe')]);router[_0xb276('0xf')](_0xb276('0x8'),auth['isAuthenticated'](),controller[_0xb276('0x10')]);module[_0xb276('0x11')]=router;
\ No newline at end of file
+var _0x4cc8=['/:id','get','/:id/preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','isAuthenticated','index'];(function(_0x4030ee,_0x41fadd){var _0x27f309=function(_0x506771){while(--_0x506771){_0x4030ee['push'](_0x4030ee['shift']());}};_0x27f309(++_0x41fadd);}(_0x4cc8,0x157));var _0x84cc=function(_0x178ddb,_0x44c400){_0x178ddb=_0x178ddb-0x0;var _0x12ce4c=_0x4cc8[_0x178ddb];return _0x12ce4c;};'use strict';var multer=require(_0x84cc('0x0'));var util=require(_0x84cc('0x1'));var path=require(_0x84cc('0x2'));var timeout=require(_0x84cc('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x84cc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x84cc('0x5'));var controller=require(_0x84cc('0x6'));router['get']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x8')]);router['get'](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller['show']);router[_0x84cc('0xa')](_0x84cc('0xb'),auth[_0x84cc('0x7')](),controller['preview']);router[_0x84cc('0xa')](_0x84cc('0xc'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xd')]);router[_0x84cc('0xa')](_0x84cc('0xe'),auth[_0x84cc('0x7')](),controller[_0x84cc('0xf')]);router['post']('/',auth[_0x84cc('0x7')](),controller[_0x84cc('0x10')]);router[_0x84cc('0x11')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x12')]);router[_0x84cc('0x13')](_0x84cc('0x9'),auth[_0x84cc('0x7')](),controller[_0x84cc('0x14')]);module[_0x84cc('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 0631435..4b89ece 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 _0x814b=['STRING','TEXT','sequelize','exports'];(function(_0x281633,_0xa6166a){var _0x4de759=function(_0x400a42){while(--_0x400a42){_0x281633['push'](_0x281633['shift']());}};_0x4de759(++_0xa6166a);}(_0x814b,0x1a2));var _0xb814=function(_0x12e73c,_0x2cbe1d){_0x12e73c=_0x12e73c-0x0;var _0x4c41cb=_0x814b[_0x12e73c];return _0x4c41cb;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xb814('0x2')]},'parent':{'type':Sequelize[_0xb814('0x2')]},'table':{'type':Sequelize[_0xb814('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xb814('0x3')]}};
\ No newline at end of file
+var _0x7da7=['TEXT','sequelize','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7da7,0x10d));var _0x77da=function(_0x3c4062,_0x3767fc){_0x3c4062=_0x3c4062-0x0;var _0x3f5bf3=_0x7da7[_0x3c4062];return _0x3f5bf3;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'name':{'type':Sequelize[_0x77da('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x77da('0x2')]},'conditions':{'type':Sequelize[_0x77da('0x3')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index d9e5851..4c4c1fa 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 _0x31f0=['fullPath','%s-%s.%s','randomstring','generate','default','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','../../components/export/','../../files/reports','countTable','COUNT(*)','run','runReport','DATE(%s)','keyBy','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','save','then','get','DefaultReports','destroy','error','name','send','index','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','options','include','findAll','rows','catch','params','length','find','create','user','role','Reports','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','preview','join','left_join','right_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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','function','replace','format','orderBy','DESC','field','alias','parse','joins','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','COUNT(DISTINCT\x20%s)','AVG(%s)','HOUR(%s)','ROUND(%s)','IS\x20NOT\x20NULL','getFields','MetricId','metric','groupBy','output','web'];(function(_0x540954,_0x52ee3a){var _0x3f94d6=function(_0x15ff99){while(--_0x15ff99){_0x540954['push'](_0x540954['shift']());}};_0x3f94d6(++_0x52ee3a);}(_0x31f0,0xb7));var _0x031f=function(_0x12794e,_0x340e2e){_0x12794e=_0x12794e-0x0;var _0x1e9570=_0x31f0[_0x12794e];return _0x1e9570;};'use strict';var emlformat=require(_0x031f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x031f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x031f('0x2'));var moment=require(_0x031f('0x3'));var BPromise=require(_0x031f('0x4'));var Mustache=require(_0x031f('0x5'));var util=require('util');var path=require(_0x031f('0x6'));var sox=require(_0x031f('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x031f('0x8'));var squel=require('squel');var crypto=require(_0x031f('0x9'));var jsforce=require(_0x031f('0xa'));var deskjs=require(_0x031f('0xb'));var toCsv=require(_0x031f('0xc'));var querystring=require('querystring');var Papa=require(_0x031f('0xd'));var Redis=require(_0x031f('0xe'));var authService=require(_0x031f('0xf'));var qs=require(_0x031f('0x10'));var as=require(_0x031f('0x11'));var hardwareService=require(_0x031f('0x12'));var logger=require(_0x031f('0x13'))(_0x031f('0x14'));var utils=require('../../config/utils');var config=require(_0x031f('0x15'));var licenseUtil=require(_0x031f('0x16'));var db=require(_0x031f('0x17'))['db'];var dbH=require(_0x031f('0x17'))[_0x031f('0x18')];function respondWithStatusCode(_0x405896,_0x1c230d){_0x1c230d=_0x1c230d||0xcc;return function(_0x5d0457){if(_0x5d0457){return _0x405896[_0x031f('0x19')](_0x1c230d);}return _0x405896[_0x031f('0x1a')](_0x1c230d)[_0x031f('0x1b')]();};}function respondWithResult(_0x2e3dfe,_0x2ea549){_0x2ea549=_0x2ea549||0xc8;return function(_0x57f9c0){if(_0x57f9c0){return _0x2e3dfe['status'](_0x2ea549)[_0x031f('0x1c')](_0x57f9c0);}};}function respondWithFilteredResult(_0x3a10aa,_0xe4fc1d){return function(_0x286177){if(_0x286177){var _0x5196b1=typeof _0xe4fc1d[_0x031f('0x1d')]===_0x031f('0x1e')&&typeof _0xe4fc1d['limit']===_0x031f('0x1e');var _0x535e70=_0x286177[_0x031f('0x1f')];var _0x5f2199=_0x5196b1?0x0:_0xe4fc1d[_0x031f('0x1d')];var _0xaa155=_0x5196b1?_0x286177[_0x031f('0x1f')]:_0xe4fc1d[_0x031f('0x1d')]+_0xe4fc1d[_0x031f('0x20')];var _0x2825ef;if(_0xaa155>=_0x535e70){_0xaa155=_0x535e70;_0x2825ef=0xc8;}else{_0x2825ef=0xce;}_0x3a10aa[_0x031f('0x1a')](_0x2825ef);return _0x3a10aa[_0x031f('0x21')](_0x031f('0x22'),_0x5f2199+'-'+_0xaa155+'/'+_0x535e70)['json'](_0x286177);}return null;};}function patchUpdates(_0xf72793){return function(_0x33926c){try{jsonpatch[_0x031f('0x23')](_0x33926c,_0xf72793,!![]);}catch(_0x4d6706){return BPromise['reject'](_0x4d6706);}return _0x33926c[_0x031f('0x24')]();};}function saveUpdates(_0x4d0f92,_0x3472a2){return function(_0x57f6c4){if(_0x57f6c4){return _0x57f6c4['update'](_0x4d0f92)['then'](function(_0x971691){return _0x971691;});}return null;};}function removeEntity(_0x12c406,_0x2920cd){return function(_0x4c8126){if(_0x4c8126){return _0x4c8126['destroy']()[_0x031f('0x25')](function(){var _0x5a64c0=_0x4c8126[_0x031f('0x26')]({'plain':!![]});var _0x1f5a14=_0x031f('0x27');return db['UserProfileResource'][_0x031f('0x28')]({'where':{'type':_0x1f5a14,'resourceId':_0x5a64c0['id']}})[_0x031f('0x25')](function(){return _0x4c8126;});})['then'](function(){_0x12c406[_0x031f('0x1a')](0xcc)[_0x031f('0x1b')]();});}};}function handleEntityNotFound(_0x2403e9,_0x5395ea){return function(_0xa308b){if(!_0xa308b){_0x2403e9[_0x031f('0x19')](0x194);}return _0xa308b;};}function handleError(_0xb6ed6c,_0xaf5bea){_0xaf5bea=_0xaf5bea||0x1f4;return function(_0xfaa36){logger[_0x031f('0x29')](_0xfaa36['stack']);if(_0xfaa36[_0x031f('0x2a')]){delete _0xfaa36[_0x031f('0x2a')];}_0xb6ed6c[_0x031f('0x1a')](_0xaf5bea)[_0x031f('0x2b')](_0xfaa36);};}exports[_0x031f('0x2c')]=function(_0x2d24f0,_0x378692){var _0x87dc07={},_0x2034ac={},_0xfc4a89={'count':0x0,'rows':[]};var _0x2cf3a8=_['map'](db[_0x031f('0x2d')][_0x031f('0x2e')],function(_0xb3a6bd){return{'name':_0xb3a6bd[_0x031f('0x2f')],'type':_0xb3a6bd[_0x031f('0x30')][_0x031f('0x31')]};});_0x2034ac[_0x031f('0x32')]=_[_0x031f('0x33')](_0x2cf3a8,_0x031f('0x2a'));_0x2034ac[_0x031f('0x34')]=_[_0x031f('0x35')](_0x2d24f0[_0x031f('0x34')]);_0x2034ac[_0x031f('0x36')]=_['intersection'](_0x2034ac[_0x031f('0x32')],_0x2034ac[_0x031f('0x34')]);_0x87dc07['attributes']=_[_0x031f('0x37')](_0x2034ac[_0x031f('0x32')],qs['fields'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x38')]));_0x87dc07[_0x031f('0x39')]=_0x87dc07[_0x031f('0x39')]['length']?_0x87dc07['attributes']:_0x2034ac[_0x031f('0x32')];if(!_0x2d24f0['query'][_0x031f('0x3a')](_0x031f('0x3b'))){_0x87dc07[_0x031f('0x20')]=qs['limit'](_0x2d24f0['query'][_0x031f('0x20')]);_0x87dc07['offset']=qs['offset'](_0x2d24f0[_0x031f('0x34')][_0x031f('0x1d')]);}_0x87dc07[_0x031f('0x3c')]=qs[_0x031f('0x3d')](_0x2d24f0[_0x031f('0x34')][_0x031f('0x3d')]);_0x87dc07[_0x031f('0x3e')]=qs['filters'](_[_0x031f('0x3f')](_0x2d24f0[_0x031f('0x34')],_0x2034ac[_0x031f('0x36')]),_0x2cf3a8);if(_0x2d24f0[_0x031f('0x34')]['filter']){_0x87dc07[_0x031f('0x3e')]=_[_0x031f('0x40')](_0x87dc07[_0x031f('0x3e')],{'$or':_['map'](_0x2cf3a8,function(_0x24ec95){if(_0x24ec95[_0x031f('0x30')]!=='VIRTUAL'){var _0x36bafa={};_0x36bafa[_0x24ec95[_0x031f('0x2a')]]={'$like':'%'+_0x2d24f0['query']['filter']+'%'};return _0x36bafa;}})});}_0x87dc07=_[_0x031f('0x40')]({},_0x87dc07,_0x2d24f0[_0x031f('0x41')]);var _0x9efbc4={'where':_0x87dc07[_0x031f('0x3e')]};return db[_0x031f('0x2d')][_0x031f('0x1f')](_0x9efbc4)[_0x031f('0x25')](function(_0x5a212c){_0xfc4a89[_0x031f('0x1f')]=_0x5a212c;if(_0x2d24f0[_0x031f('0x34')]['includeAll']){_0x87dc07[_0x031f('0x42')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0x031f('0x43')](_0x87dc07);})[_0x031f('0x25')](function(_0x56dd24){_0xfc4a89[_0x031f('0x44')]=_0x56dd24;return _0xfc4a89;})[_0x031f('0x25')](respondWithFilteredResult(_0x378692,_0x87dc07))[_0x031f('0x45')](handleError(_0x378692,null));};exports['show']=function(_0x98747f,_0x213e1c){var _0x1d3324={'raw':!![],'where':{'id':_0x98747f[_0x031f('0x46')]['id']}},_0x2a6cba={};_0x2a6cba[_0x031f('0x32')]=_[_0x031f('0x35')](db[_0x031f('0x2d')][_0x031f('0x2e')]);_0x2a6cba['query']=_[_0x031f('0x35')](_0x98747f[_0x031f('0x34')]);_0x2a6cba[_0x031f('0x36')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],_0x2a6cba[_0x031f('0x34')]);_0x1d3324[_0x031f('0x39')]=_[_0x031f('0x37')](_0x2a6cba[_0x031f('0x32')],qs['fields'](_0x98747f[_0x031f('0x34')]['fields']));_0x1d3324['attributes']=_0x1d3324[_0x031f('0x39')][_0x031f('0x47')]?_0x1d3324[_0x031f('0x39')]:_0x2a6cba[_0x031f('0x32')];if(_0x98747f[_0x031f('0x34')]['includeAll']){_0x1d3324[_0x031f('0x42')]=[{'all':!![]}];}_0x1d3324=_[_0x031f('0x40')]({},_0x1d3324,_0x98747f[_0x031f('0x41')]);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0x1d3324)[_0x031f('0x25')](handleEntityNotFound(_0x213e1c,null))[_0x031f('0x25')](respondWithResult(_0x213e1c,null))[_0x031f('0x45')](handleError(_0x213e1c,null));};exports[_0x031f('0x49')]=function(_0x12d28e,_0x5caeb5){return db['AnalyticDefaultReport'][_0x031f('0x49')](_0x12d28e['body'],{})[_0x031f('0x25')](function(_0x3bba44){var _0x5a29e0=_0x12d28e[_0x031f('0x4a')]['get']({'plain':!![]});if(!_0x5a29e0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5a29e0[_0x031f('0x4b')]==='user'){var _0x16bade=_0x3bba44['get']({'plain':!![]});var _0x11bf43=_0x031f('0x4c');return db['UserProfileSection'][_0x031f('0x48')]({'where':{'name':_0x11bf43,'userProfileId':_0x5a29e0[_0x031f('0x4d')]},'raw':!![]})['then'](function(_0x46471a){if(_0x46471a&&_0x46471a['autoAssociation']===0x0){return db[_0x031f('0x4e')]['create']({'name':_0x16bade[_0x031f('0x2a')],'resourceId':_0x16bade['id'],'type':_0x031f('0x27'),'sectionId':_0x46471a['id']},{})[_0x031f('0x25')](function(){return _0x3bba44;});}else{return _0x3bba44;}})[_0x031f('0x45')](function(_0x691a68){logger['error'](_0x031f('0x4f'),_0x691a68);throw _0x691a68;});}return _0x3bba44;})['then'](respondWithResult(_0x5caeb5,0xc9))[_0x031f('0x45')](handleError(_0x5caeb5,null));};exports[_0x031f('0x50')]=function(_0x4d49f8,_0x1f9c55){if(_0x4d49f8[_0x031f('0x51')]['id']){delete _0x4d49f8['body']['id'];}return db[_0x031f('0x2d')][_0x031f('0x48')]({'where':{'id':_0x4d49f8[_0x031f('0x46')]['id']}})['then'](handleEntityNotFound(_0x1f9c55,null))[_0x031f('0x25')](saveUpdates(_0x4d49f8['body'],null))[_0x031f('0x25')](respondWithResult(_0x1f9c55,null))['catch'](handleError(_0x1f9c55,null));};exports[_0x031f('0x28')]=function(_0x561a2b,_0xa52a54){return db[_0x031f('0x2d')]['find']({'where':{'id':_0x561a2b['params']['id']}})[_0x031f('0x25')](handleEntityNotFound(_0xa52a54,null))[_0x031f('0x25')](removeEntity(_0xa52a54,null))['catch'](handleError(_0xa52a54,null));};exports[_0x031f('0x52')]=function(_0xb44c73,_0x255003){var _0x286d4e=0xa;var _0x21a89d=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),'cross_join'];var _0xe452c2={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x031f('0x58'),'MIN':_0x031f('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x198e2e={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x031f('0x5d')};var _0xcf8b7=function(_0x4a7fbb){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),'IS\x20NOT\x20NULL',_0x031f('0x60'),_0x031f('0x61')],_0x4a7fbb);};var _0x451c71=function(_0x22d211){if(!_0x22d211||!_0x22d211[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x2ddf15='(',_0x4527e5=0x0;_0x4527e5<_0x22d211[_0x031f('0x62')]['length'];_0x4527e5+=0x1){_0x4527e5>0x0&&(_0x2ddf15+='\x20'+_0x22d211[_0x031f('0x63')]+'\x20');_0x2ddf15+=_0x22d211['rules'][_0x4527e5][_0x031f('0x64')]?_0x451c71(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x64')]):_0x22d211['rules'][_0x4527e5]['field']+'\x20'+_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')]+(_0xcf8b7(_0x22d211[_0x031f('0x62')][_0x4527e5][_0x031f('0x65')])?'\x20'+_0x22d211['rules'][_0x4527e5][_0x031f('0x66')]:'');}return _0x2ddf15+')';};var _0x5a181c={'where':{'id':_0xb44c73[_0x031f('0x46')]['id']}},_0x478982,_0x2179ee,_0x534bae,_0x50d618,_0x71e67;_0x5a181c=_[_0x031f('0x40')]({},_0x5a181c,_0xb44c73[_0x031f('0x41')]);return db[_0x031f('0x2d')]['find'](_0x5a181c)['then'](function(_0x214eec){if(_0x214eec){_0x478982=_0x214eec;return _0x214eec['getFields']();}return null;})[_0x031f('0x25')](function(_0xa921b2){if(_0xa921b2){if(!_0xa921b2['length']){throw new db[(_0x031f('0x67'))][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2179ee=_0xa921b2;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5bea08){if(_0x5bea08){_0x534bae=_['keyBy'](_0x5bea08,'id');var _0x3bcc7e;var _0x232b62=squel[_0x031f('0x6b')]();_0x232b62[_0x031f('0x6c')](_0x478982[_0x031f('0x6d')]);for(var _0x26fa57=0x0;_0x26fa57<_0x2179ee[_0x031f('0x47')];_0x26fa57+=0x1){_0x3bcc7e=_0x2179ee[_0x26fa57]['MetricId']?_0x534bae[_0x2179ee[_0x26fa57]['MetricId']]['metric']:_0x2179ee[_0x26fa57]['field'];_0x3bcc7e=_0x2179ee[_0x26fa57][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xe452c2[_0x2179ee[_0x26fa57][_0x031f('0x6e')]],'%s',_0x3bcc7e):_0x3bcc7e;_0x3bcc7e=_0x2179ee[_0x26fa57]['format']?_[_0x031f('0x6f')](_0x198e2e[_0x2179ee[_0x26fa57][_0x031f('0x70')]],'%s',_0x3bcc7e):_0x3bcc7e;if(_0x2179ee[_0x26fa57]['groupBy']){_0x232b62[_0x031f('0x64')](_0x3bcc7e);}_0x2179ee[_0x26fa57][_0x031f('0x71')]&&_0x232b62[_0x031f('0x3c')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x232b62[_0x031f('0x73')](_0x3bcc7e,_0x2179ee[_0x26fa57][_0x031f('0x74')]||_0x3bcc7e);}if(_0x478982['joins']){_0x478982['joins']=JSON[_0x031f('0x75')](_0x478982['joins']);for(var _0x2ed9c1=0x0;_0x2ed9c1<_0x478982['joins'][_0x031f('0x47')];_0x2ed9c1+=0x1){if(_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]&&_['includes'](_0x21a89d,_0x478982[_0x031f('0x76')][_0x2ed9c1]['type'])&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x77')]&&_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable']&&_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]){_0x232b62[_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x30')]](_0x478982[_0x031f('0x76')][_0x2ed9c1]['foreignTable'],null,util['format'](_0x031f('0x79'),_0x478982[_0x031f('0x6d')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x77')],_0x478982['joins'][_0x2ed9c1][_0x031f('0x7a')],_0x478982[_0x031f('0x76')][_0x2ed9c1][_0x031f('0x78')]));}}}if(_0x478982[_0x031f('0x7b')]){_0x478982['conditions']=JSON[_0x031f('0x75')](_0x478982[_0x031f('0x7b')]);_0x232b62[_0x031f('0x3e')](_0x451c71(_0x478982['conditions'][_0x031f('0x64')]));}_0x71e67=_0x232b62[_0x031f('0x7c')]();_0x232b62['limit'](_0x286d4e);_0x232b62[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x232b62[_0x031f('0x7f')]());return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232b62[_0x031f('0x7f')](),{'type':dbH['sequelize'][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](respondWithResult(_0x255003,null))['catch'](handleError(_0x255003,null));};function runReport(_0x4f4aff,_0x26de7c,_0x5bd344){var _0x54f02d=_0x26de7c[_0x031f('0x2a')];var _0x184bbd=0xa;var _0x1c8055=[_0x031f('0x53'),_0x031f('0x54'),_0x031f('0x55'),_0x031f('0x83')];var _0x32c626={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':_0x031f('0x59'),'AVG':_0x031f('0x85'),'GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x6970f5={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x031f('0x86'),'ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x510bb6=function(_0x3cfaa4){return!_[_0x031f('0x5e')]([_0x031f('0x5f'),_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x3cfaa4);};var _0x5e0853=function(_0x263658){if(!_0x263658||!_0x263658[_0x031f('0x62')]['length']){return'';}for(var _0x25ea89='(',_0x2f2e96=0x0;_0x2f2e96<_0x263658[_0x031f('0x62')][_0x031f('0x47')];_0x2f2e96+=0x1){_0x2f2e96>0x0&&(_0x25ea89+='\x20'+_0x263658[_0x031f('0x63')]+'\x20');_0x25ea89+=_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x64')]?_0x5e0853(_0x263658['rules'][_0x2f2e96][_0x031f('0x64')]):_0x263658['rules'][_0x2f2e96][_0x031f('0x73')]+'\x20'+_0x263658[_0x031f('0x62')][_0x2f2e96][_0x031f('0x65')]+(_0x510bb6(_0x263658['rules'][_0x2f2e96]['condition'])?'\x20'+_0x263658['rules'][_0x2f2e96][_0x031f('0x66')]:'');}return _0x25ea89+')';};var _0xee744={'where':{'id':_0x4f4aff['id']}},_0x8f0afd,_0x2985fe,_0x290f82,_0x307246,_0x232aa0;_0xee744=_['merge']({},_0xee744,_0x5bd344);return db['AnalyticDefaultReport'][_0x031f('0x48')](_0xee744)[_0x031f('0x25')](function(_0x54d86e){if(_0x54d86e){_0x8f0afd=_0x54d86e;return _0x54d86e[_0x031f('0x89')]();}return null;})['then'](function(_0x1c31d5){if(_0x1c31d5){if(!_0x1c31d5[_0x031f('0x47')]){throw new db['Sequelize'][(_0x031f('0x68'))](_0x031f('0x69'),0x193);}_0x2985fe=_0x1c31d5;return db['AnalyticMetric'][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x1b588e){if(_0x1b588e){_0x290f82=_['keyBy'](_0x1b588e,'id');var _0xa9b5e2;var _0x31504b=squel[_0x031f('0x6b')]();_0x31504b[_0x031f('0x6c')](_0x8f0afd[_0x031f('0x6d')]);for(var _0x2b3326=0x0;_0x2b3326<_0x2985fe['length'];_0x2b3326+=0x1){_0xa9b5e2=_0x2985fe[_0x2b3326][_0x031f('0x8a')]?_0x290f82[_0x2985fe[_0x2b3326][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x2985fe[_0x2b3326][_0x031f('0x73')];_0xa9b5e2=_0x2985fe[_0x2b3326]['function']?_[_0x031f('0x6f')](_0x32c626[_0x2985fe[_0x2b3326][_0x031f('0x6e')]],'%s',_0xa9b5e2):_0xa9b5e2;_0xa9b5e2=_0x2985fe[_0x2b3326]['format']?_[_0x031f('0x6f')](_0x6970f5[_0x2985fe[_0x2b3326][_0x031f('0x70')]],'%s',_0xa9b5e2):_0xa9b5e2;if(_0x2985fe[_0x2b3326][_0x031f('0x8c')]){_0x31504b[_0x031f('0x64')](_0xa9b5e2);}_0x2985fe[_0x2b3326][_0x031f('0x71')]&&_0x31504b[_0x031f('0x3c')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x31504b[_0x031f('0x73')](_0xa9b5e2,_0x2985fe[_0x2b3326][_0x031f('0x74')]||_0xa9b5e2);}if(_0x8f0afd[_0x031f('0x76')]){_0x8f0afd[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x76')]);for(var _0x2433ce=0x0;_0x2433ce<_0x8f0afd['joins'][_0x031f('0x47')];_0x2433ce+=0x1){if(_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0x1c8055,_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')])&&_0x8f0afd['joins'][_0x2433ce]['parentKey']&&_0x8f0afd['joins'][_0x2433ce][_0x031f('0x7a')]&&_0x8f0afd[_0x031f('0x76')][_0x2433ce]['foreignKey']){_0x31504b[_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x30')]](_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],null,util['format'](_0x031f('0x79'),_0x8f0afd[_0x031f('0x6d')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x77')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x7a')],_0x8f0afd[_0x031f('0x76')][_0x2433ce][_0x031f('0x78')]));}}}if(_0x8f0afd[_0x031f('0x7b')]){_0x8f0afd[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x8f0afd[_0x031f('0x7b')]);_0x31504b['where'](_0x5e0853(_0x8f0afd[_0x031f('0x7b')][_0x031f('0x64')]));}_0x232aa0=_0x31504b['clone']();_0x31504b[_0x031f('0x20')](_0x184bbd);_0x31504b[_0x031f('0x1d')](0x0);return;}})['then'](function(){if(_0x26de7c[_0x031f('0x8d')]===_0x031f('0x8e')){return null;}var _0x1ade73=_[_0x031f('0x40')](_0x26de7c,{'name':_0x26de7c[_0x031f('0x8f')]||_0x26de7c[_0x031f('0x2a')]||_0x8f0afd[_0x031f('0x2a')],'basename':_0x54f02d,'savename':util[_0x031f('0x70')](_0x031f('0x90'),_0x26de7c['name']||_0x8f0afd[_0x031f('0x2a')],require(_0x031f('0x91'))[_0x031f('0x92')](0x4),_0x26de7c['output']||'csv'),'reportId':_0x8f0afd['id'],'reportType':_0x031f('0x93')});return db['AnalyticExtractedReport'][_0x031f('0x49')](_0x1ade73,{'raw':!![]});})[_0x031f('0x25')](function(_0x4a96f2){if(_0x8f0afd[_0x031f('0x6d')]===_0x031f('0x94')){_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x95'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}else{_0x232aa0[_0x031f('0x3e')](_0x8f0afd[_0x031f('0x6d')]+_0x031f('0x98'),_0x26de7c[_0x031f('0x96')],_0x26de7c[_0x031f('0x97')]);}if(_0x4a96f2){logger[_0x031f('0x99')]('Run\x20Query:',_0x232aa0['toString']());require(_0x031f('0x9a'))['fork'](path[_0x031f('0x53')](__dirname,_0x031f('0x9b'),_0x4a96f2[_0x031f('0x8d')]),[_0x4a96f2['id'],_0x232aa0['toString'](),path[_0x031f('0x53')](__dirname,_0x031f('0x9c'),_0x4a96f2['savename']),_0x54f02d]);return _0x4a96f2;}else{var _0x185085=squel[_0x031f('0x6b')]();_0x185085[_0x031f('0x6c')]('('+_0x232aa0[_0x031f('0x7f')]()+')',_0x031f('0x9d'));_0x185085[_0x031f('0x73')](_0x031f('0x9e'),'count');_0x232aa0[_0x031f('0x20')](_0x26de7c[_0x031f('0x20')]||_0x184bbd);_0x232aa0[_0x031f('0x1d')](_0x26de7c[_0x031f('0x1d')]||0x0);return dbH['sequelize']['query'](_0x185085[_0x031f('0x7f')](),{'type':dbH['sequelize']['QueryTypes'][_0x031f('0x82')]})['then'](function(_0x579ade){if(!_0x579ade[_0x031f('0x47')]){_0x307246=0x0;}else{_0x307246=_0x579ade[0x0][_0x031f('0x1f')]||0x0;}return dbH[_0x031f('0x80')][_0x031f('0x34')](_0x232aa0[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')]['QueryTypes'][_0x031f('0x82')]});})[_0x031f('0x25')](function(_0x52a3f0){return{'rows':_0x52a3f0||[],'count':_0x307246};});}});}exports[_0x031f('0x9f')]=function(_0x355e1a,_0x30c32f){return runReport(_0x355e1a[_0x031f('0x46')],_0x355e1a['query'],_0x355e1a['options'])['then'](respondWithResult(_0x30c32f,null))[_0x031f('0x45')](handleError(_0x30c32f,null));};exports[_0x031f('0xa0')]=runReport;exports[_0x031f('0x34')]=function(_0x3ec98a,_0x3ed663){var _0xac324f=0xa;var _0xcf0af9=[_0x031f('0x53'),_0x031f('0x54'),'right_join',_0x031f('0x83')];var _0xde544e={'SUM':_0x031f('0x56'),'COUNT':_0x031f('0x57'),'COUNT DISTINCT':_0x031f('0x84'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x031f('0x5a'),'GROUP_CONCAT ASC':_0x031f('0x5b'),'GROUP_CONCAT DESC':_0x031f('0x5c')};var _0x84cd0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x031f('0xa1'),'HOUR':'HOUR(%s)','ROUND':_0x031f('0x87'),'UNIX_TIMESTAMP':_0x031f('0x5d')};var _0x24aff3=function(_0x35a1f1){return!_[_0x031f('0x5e')](['IS\x20NULL',_0x031f('0x88'),_0x031f('0x60'),_0x031f('0x61')],_0x35a1f1);};var _0x3cb099=function(_0x4a4d8f){if(!_0x4a4d8f||!_0x4a4d8f[_0x031f('0x62')][_0x031f('0x47')]){return'';}for(var _0x578201='(',_0xdbf09f=0x0;_0xdbf09f<_0x4a4d8f['rules'][_0x031f('0x47')];_0xdbf09f+=0x1){_0xdbf09f>0x0&&(_0x578201+='\x20'+_0x4a4d8f[_0x031f('0x63')]+'\x20');_0x578201+=_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x64')]?_0x3cb099(_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['group']):_0x4a4d8f[_0x031f('0x62')][_0xdbf09f]['field']+'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x65')]+(_0x24aff3(_0x4a4d8f['rules'][_0xdbf09f][_0x031f('0x65')])?'\x20'+_0x4a4d8f[_0x031f('0x62')][_0xdbf09f][_0x031f('0x66')]:'');}return _0x578201+')';};var _0x123b4d={'where':{'id':_0x3ec98a['params']['id']}},_0x3f80b5,_0x53cd67,_0x516f11,_0x50cdb2,_0x2e9a3b;_0x123b4d=_[_0x031f('0x40')]({},_0x123b4d,_0x3ec98a[_0x031f('0x41')]);return db[_0x031f('0x2d')][_0x031f('0x48')](_0x123b4d)[_0x031f('0x25')](function(_0x53911d){if(_0x53911d){_0x3f80b5=_0x53911d;return _0x53911d[_0x031f('0x89')]();}return null;})['then'](function(_0x30fa18){if(_0x30fa18){if(!_0x30fa18[_0x031f('0x47')]){throw new db[(_0x031f('0x67'))]['ValidationErrorItem'](_0x031f('0x69'),0x193);}_0x53cd67=_0x30fa18;return db[_0x031f('0x6a')][_0x031f('0x43')]({'raw':!![]});}return null;})[_0x031f('0x25')](function(_0x5b092c){if(_0x5b092c){_0x516f11=_[_0x031f('0xa2')](_0x5b092c,'id');var _0x7b8699;var _0x14a497=squel[_0x031f('0x6b')]();_0x14a497[_0x031f('0x6c')](_0x3f80b5[_0x031f('0x6d')]);for(var _0x59fd9a=0x0;_0x59fd9a<_0x53cd67[_0x031f('0x47')];_0x59fd9a+=0x1){_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x8a')]?_0x516f11[_0x53cd67[_0x59fd9a][_0x031f('0x8a')]][_0x031f('0x8b')]:_0x53cd67[_0x59fd9a][_0x031f('0x73')];_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x6e')]?_[_0x031f('0x6f')](_0xde544e[_0x53cd67[_0x59fd9a]['function']],'%s',_0x7b8699):_0x7b8699;_0x7b8699=_0x53cd67[_0x59fd9a][_0x031f('0x70')]?_[_0x031f('0x6f')](_0x84cd0c[_0x53cd67[_0x59fd9a][_0x031f('0x70')]],'%s',_0x7b8699):_0x7b8699;if(_0x53cd67[_0x59fd9a][_0x031f('0x8c')]){_0x14a497[_0x031f('0x64')](_0x7b8699);}_0x53cd67[_0x59fd9a]['orderBy']&&_0x14a497[_0x031f('0x3c')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x71')]===_0x031f('0x72')?![]:!![]);_0x14a497[_0x031f('0x73')](_0x7b8699,_0x53cd67[_0x59fd9a][_0x031f('0x74')]||_0x7b8699);}if(_0x3f80b5['joins']){_0x3f80b5[_0x031f('0x76')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x76')]);for(var _0x110747=0x0;_0x110747<_0x3f80b5[_0x031f('0x76')]['length'];_0x110747+=0x1){if(_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]&&_[_0x031f('0x5e')](_0xcf0af9,_0x3f80b5['joins'][_0x110747][_0x031f('0x30')])&&_0x3f80b5['joins'][_0x110747][_0x031f('0x77')]&&_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')]&&_0x3f80b5[_0x031f('0x76')][_0x110747]['foreignKey']){_0x14a497[_0x3f80b5['joins'][_0x110747][_0x031f('0x30')]](_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x7a')],null,util[_0x031f('0x70')]('%s.%s\x20=\x20%s.%s',_0x3f80b5[_0x031f('0x6d')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x77')],_0x3f80b5['joins'][_0x110747][_0x031f('0x7a')],_0x3f80b5[_0x031f('0x76')][_0x110747][_0x031f('0x78')]));}}}if(_0x3f80b5['conditions']){_0x3f80b5[_0x031f('0x7b')]=JSON[_0x031f('0x75')](_0x3f80b5[_0x031f('0x7b')]);_0x14a497[_0x031f('0x3e')](_0x3cb099(_0x3f80b5[_0x031f('0x7b')]['group']));}_0x2e9a3b=_0x14a497[_0x031f('0x7c')]();_0x14a497[_0x031f('0x20')](_0xac324f);_0x14a497[_0x031f('0x1d')](0x0);logger[_0x031f('0x7d')](_0x031f('0x7e'),_0x14a497[_0x031f('0x7f')]());return dbH['sequelize']['query'](_0x14a497[_0x031f('0x7f')](),{'type':dbH[_0x031f('0x80')][_0x031f('0x81')][_0x031f('0x82')]});}})[_0x031f('0x25')](function(){return{'sql':_0x2e9a3b[_0x031f('0x7f')]()};})[_0x031f('0x25')](respondWithResult(_0x3ed663,null))['catch'](handleError(_0x3ed663,null));};
\ No newline at end of file
+var _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 4dc7a6c..bbc4632 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 _0x5e6d=['exports','AnalyticDefaultReport','analytics_default_reports','lodash','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes'];(function(_0x32f1e6,_0x4789d0){var _0x1600bc=function(_0x53180a){while(--_0x53180a){_0x32f1e6['push'](_0x32f1e6['shift']());}};_0x1600bc(++_0x4789d0);}(_0x5e6d,0xb7));var _0xd5e6=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0x5e6d[_0x7e2eb0];return _0xd92de4;};'use strict';var _=require(_0xd5e6('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd5e6('0x1'));var BPromise=require(_0xd5e6('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd5e6('0x3'));var rimraf=require(_0xd5e6('0x4'));var config=require(_0xd5e6('0x5'));var attributes=require(_0xd5e6('0x6'));module[_0xd5e6('0x7')]=function(_0x4e62b8,_0x38a386){return _0x4e62b8['define'](_0xd5e6('0x8'),attributes,{'tableName':_0xd5e6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xbdf0=['bluebird','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','analytics_default_reports','lodash','api','moment'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xbdf0,0x15b));var _0x0bdf=function(_0x18cfc7,_0x27371b){_0x18cfc7=_0x18cfc7-0x0;var _0x3d0e73=_0xbdf0[_0x18cfc7];return _0x3d0e73;};'use strict';var _=require(_0x0bdf('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x0bdf('0x1'));var moment=require(_0x0bdf('0x2'));var BPromise=require(_0x0bdf('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0bdf('0x4'));var rimraf=require('rimraf');var config=require(_0x0bdf('0x5'));var attributes=require(_0x0bdf('0x6'));module[_0x0bdf('0x7')]=function(_0x49fa94,_0x4a4c72){return _0x49fa94[_0x0bdf('0x8')]('AnalyticDefaultReport',attributes,{'tableName':_0x0bdf('0x9'),'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 b6424c3..57f9b09 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 _0x9faa=['../../config/utils','../../config/logger','rpc','../../config/environment','client','then','AnalyticDefaultReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x314d37,_0xa23154){var _0x584bff=function(_0x1e9df2){while(--_0x1e9df2){_0x314d37['push'](_0x314d37['shift']());}};_0x584bff(++_0xa23154);}(_0x9faa,0x162));var _0xa9fa=function(_0x4e23b3,_0x37a56a){_0x4e23b3=_0x4e23b3-0x0;var _0xd888fc=_0x9faa[_0x4e23b3];return _0xd888fc;};'use strict';var _=require(_0xa9fa('0x0'));var util=require(_0xa9fa('0x1'));var moment=require(_0xa9fa('0x2'));var BPromise=require(_0xa9fa('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa9fa('0x4'));var db=require(_0xa9fa('0x5'))['db'];var utils=require(_0xa9fa('0x6'));var logger=require(_0xa9fa('0x7'))(_0xa9fa('0x8'));var config=require(_0xa9fa('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa9fa('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3d53ce,_0x2ff72e,_0x3e33fe){return new BPromise(function(_0x4211d2,_0x133cf3){return client['request'](_0x3d53ce,_0x3e33fe)[_0xa9fa('0xb')](function(_0x995e83){logger['info'](_0xa9fa('0xc'),_0x2ff72e,'request\x20sent');logger[_0xa9fa('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x2ff72e,'request\x20sent',JSON[_0xa9fa('0xe')](_0x995e83));if(_0x995e83['error']){if(_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x10')]===0x1f4){logger[_0xa9fa('0xf')](_0xa9fa('0xc'),_0x2ff72e,_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x11')]);return _0x133cf3(_0x995e83['error'][_0xa9fa('0x11')]);}logger['error'](_0xa9fa('0xc'),_0x2ff72e,_0x995e83['error'][_0xa9fa('0x11')]);return _0x4211d2(_0x995e83[_0xa9fa('0xf')][_0xa9fa('0x11')]);}else{logger['info'](_0xa9fa('0xc'),_0x2ff72e,_0xa9fa('0x12'));_0x4211d2(_0x995e83[_0xa9fa('0x13')][_0xa9fa('0x11')]);}})['catch'](function(_0x385403){logger[_0xa9fa('0xf')](_0xa9fa('0xc'),_0x2ff72e,_0x385403);_0x133cf3(_0x385403);});});}
\ No newline at end of file
+var _0x31d9=['stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x31d9,0x1d4));var _0x931d=function(_0x48795e,_0x46c47d){_0x48795e=_0x48795e-0x0;var _0xeed653=_0x31d9[_0x48795e];return _0xeed653;};'use strict';var _=require(_0x931d('0x0'));var util=require(_0x931d('0x1'));var moment=require(_0x931d('0x2'));var BPromise=require(_0x931d('0x3'));var rs=require(_0x931d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x931d('0x5'));var logger=require(_0x931d('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x931d('0x7'));var client=jayson[_0x931d('0x8')][_0x931d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x95c99c,_0x101c36,_0x5878df){return new BPromise(function(_0x530efe,_0x34e66d){return client[_0x931d('0xa')](_0x95c99c,_0x5878df)[_0x931d('0xb')](function(_0x3a24eb){logger[_0x931d('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x101c36,_0x931d('0xd'));logger['debug'](_0x931d('0xe'),_0x101c36,_0x931d('0xd'),JSON[_0x931d('0xf')](_0x3a24eb));if(_0x3a24eb[_0x931d('0x10')]){if(_0x3a24eb[_0x931d('0x10')][_0x931d('0x11')]===0x1f4){logger['error'](_0x931d('0x12'),_0x101c36,_0x3a24eb[_0x931d('0x10')]['message']);return _0x34e66d(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x3a24eb['error'][_0x931d('0x13')]);return _0x530efe(_0x3a24eb[_0x931d('0x10')][_0x931d('0x13')]);}else{logger['info'](_0x931d('0x12'),_0x101c36,_0x931d('0xd'));_0x530efe(_0x3a24eb[_0x931d('0x14')][_0x931d('0x13')]);}})['catch'](function(_0x1a50d5){logger[_0x931d('0x10')](_0x931d('0x12'),_0x101c36,_0x1a50d5);_0x34e66d(_0x1a50d5);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index ba1493d..9c6bcf2 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 _0x20f2=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x15cf4d,_0xec4698){var _0x544525=function(_0x584650){while(--_0x584650){_0x15cf4d['push'](_0x15cf4d['shift']());}};_0x544525(++_0xec4698);}(_0x20f2,0x1e6));var _0x220f=function(_0x39d090,_0x3295ca){_0x39d090=_0x39d090-0x0;var _0x255242=_0x20f2[_0x39d090];return _0x255242;};'use strict';var multer=require(_0x220f('0x0'));var util=require(_0x220f('0x1'));var path=require(_0x220f('0x2'));var timeout=require(_0x220f('0x3'));var express=require(_0x220f('0x4'));var router=express[_0x220f('0x5')]();var fs_extra=require(_0x220f('0x6'));var auth=require(_0x220f('0x7'));var interaction=require(_0x220f('0x8'));var config=require(_0x220f('0x9'));var controller=require(_0x220f('0xa'));router[_0x220f('0xb')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0xd')]);router[_0x220f('0xb')](_0x220f('0xe'),auth['isAuthenticated'](),controller[_0x220f('0xf')]);router[_0x220f('0xb')](_0x220f('0x10'),auth[_0x220f('0xc')](),controller[_0x220f('0x11')]);router[_0x220f('0xb')](_0x220f('0x12'),auth[_0x220f('0xc')](),controller[_0x220f('0x13')]);router[_0x220f('0xb')](_0x220f('0x14'),auth[_0x220f('0xc')](),controller[_0x220f('0x15')]);router[_0x220f('0x16')]('/',auth[_0x220f('0xc')](),controller[_0x220f('0x17')]);router[_0x220f('0x18')]('/:id',auth[_0x220f('0xc')](),controller[_0x220f('0x19')]);router[_0x220f('0x1a')](_0x220f('0xe'),auth[_0x220f('0xc')](),controller[_0x220f('0x1b')]);module[_0x220f('0x1c')]=router;
\ No newline at end of file
+var _0x3311=['multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','run','/:id/query','post','create','put','update','delete','destroy','exports'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x3311,0x1d4));var _0x1331=function(_0x2c9841,_0x1a7e07){_0x2c9841=_0x2c9841-0x0;var _0x4f5641=_0x3311[_0x2c9841];return _0x4f5641;};'use strict';var multer=require(_0x1331('0x0'));var util=require(_0x1331('0x1'));var path=require(_0x1331('0x2'));var timeout=require(_0x1331('0x3'));var express=require(_0x1331('0x4'));var router=express[_0x1331('0x5')]();var fs_extra=require(_0x1331('0x6'));var auth=require(_0x1331('0x7'));var interaction=require(_0x1331('0x8'));var config=require(_0x1331('0x9'));var controller=require(_0x1331('0xa'));router[_0x1331('0xb')]('/',auth[_0x1331('0xc')](),controller[_0x1331('0xd')]);router[_0x1331('0xb')](_0x1331('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x1331('0xb')](_0x1331('0xf'),auth[_0x1331('0xc')](),controller[_0x1331('0x10')]);router[_0x1331('0xb')]('/:id/run',auth[_0x1331('0xc')](),controller[_0x1331('0x11')]);router[_0x1331('0xb')](_0x1331('0x12'),auth[_0x1331('0xc')](),controller['query']);router[_0x1331('0x13')]('/',auth['isAuthenticated'](),controller[_0x1331('0x14')]);router[_0x1331('0x15')](_0x1331('0xe'),auth[_0x1331('0xc')](),controller[_0x1331('0x16')]);router[_0x1331('0x17')](_0x1331('0xe'),auth['isAuthenticated'](),controller[_0x1331('0x18')]);module[_0x1331('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index fadab89..19791f1 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 _0x98ac=['UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x2787c5,_0x422f0b){var _0x1b53c5=function(_0x398028){while(--_0x398028){_0x2787c5['push'](_0x2787c5['shift']());}};_0x1b53c5(++_0x422f0b);}(_0x98ac,0x151));var _0xc98a=function(_0x2f6bb7,_0x539abe){_0x2f6bb7=_0x2f6bb7-0x0;var _0x84133c=_0x98ac[_0x2f6bb7];return _0x84133c;};'use strict';var Sequelize=require(_0xc98a('0x0'));var moment=require(_0xc98a('0x1'));module[_0xc98a('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xc98a('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0xc98a('0x4')](_0xc98a('0x5'),_0xc98a('0x6'),_0xc98a('0x7')),'allowNull':![],'defaultValue':_0xc98a('0x5')},'savename':{'type':Sequelize[_0xc98a('0x3')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xc98a('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xc98a('0x9')},'type':{'type':Sequelize['ENUM'](_0xc98a('0xa'),_0xc98a('0xb')),'allowNull':![],'defaultValue':_0xc98a('0xa')},'reportId':{'type':Sequelize[_0xc98a('0xc')](0xb)[_0xc98a('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x2e14=['xlsx','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','ENUM','csv','pdf'];(function(_0x5e6352,_0x3232f5){var _0x1e6f46=function(_0x4f2729){while(--_0x4f2729){_0x5e6352['push'](_0x5e6352['shift']());}};_0x1e6f46(++_0x3232f5);}(_0x2e14,0x77));var _0x42e1=function(_0x3356c5,_0x20a150){_0x3356c5=_0x3356c5-0x0;var _0x556859=_0x2e14[_0x3356c5];return _0x556859;};'use strict';var Sequelize=require(_0x42e1('0x0'));var moment=require(_0x42e1('0x1'));module[_0x42e1('0x2')]={'name':{'type':Sequelize[_0x42e1('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0x5'),_0x42e1('0x6'),_0x42e1('0x7')),'allowNull':![],'defaultValue':_0x42e1('0x5')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x42e1('0x8')]},'endDate':{'type':Sequelize[_0x42e1('0x8')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x42e1('0x9')},'type':{'type':Sequelize[_0x42e1('0x4')](_0x42e1('0xa'),_0x42e1('0xb')),'allowNull':![],'defaultValue':_0x42e1('0xa')},'reportId':{'type':Sequelize[_0x42e1('0xc')](0xb)[_0x42e1('0xd')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 8c9d3ec..bb9c873 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 _0x9b7c=['output','existsSync','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','server/files/reports','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','save','update','then','destroy','get','ExtractedReports','UserProfileResource','error','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','options','includeAll','AnalyticExtractedReport','findAll','catch','show','params','body','user','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','basename','savename'];(function(_0x52965d,_0x487353){var _0x43f259=function(_0x4c326c){while(--_0x4c326c){_0x52965d['push'](_0x52965d['shift']());}};_0x43f259(++_0x487353);}(_0x9b7c,0x177));var _0xc9b7=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x9b7c[_0x29db36];return _0x234e87;};'use strict';var emlformat=require(_0xc9b7('0x0'));var rimraf=require(_0xc9b7('0x1'));var zipdir=require(_0xc9b7('0x2'));var jsonpatch=require(_0xc9b7('0x3'));var rp=require(_0xc9b7('0x4'));var moment=require('moment');var BPromise=require(_0xc9b7('0x5'));var Mustache=require(_0xc9b7('0x6'));var util=require('util');var path=require(_0xc9b7('0x7'));var sox=require('sox');var csv=require(_0xc9b7('0x8'));var ejs=require(_0xc9b7('0x9'));var fs=require('fs');var fs_extra=require(_0xc9b7('0xa'));var _=require('lodash');var squel=require(_0xc9b7('0xb'));var crypto=require(_0xc9b7('0xc'));var jsforce=require(_0xc9b7('0xd'));var deskjs=require(_0xc9b7('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc9b7('0xf'));var Redis=require('ioredis');var authService=require(_0xc9b7('0x10'));var qs=require(_0xc9b7('0x11'));var as=require(_0xc9b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc9b7('0x13'))(_0xc9b7('0x14'));var utils=require(_0xc9b7('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc9b7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2e2eb7,_0x5c255f){_0x5c255f=_0x5c255f||0xcc;return function(_0x4ff09b){if(_0x4ff09b){return _0x2e2eb7[_0xc9b7('0x17')](_0x5c255f);}return _0x2e2eb7[_0xc9b7('0x18')](_0x5c255f)[_0xc9b7('0x19')]();};}function respondWithResult(_0x27d818,_0x4f6b24){_0x4f6b24=_0x4f6b24||0xc8;return function(_0xe88b40){if(_0xe88b40){return _0x27d818[_0xc9b7('0x18')](_0x4f6b24)[_0xc9b7('0x1a')](_0xe88b40);}};}function respondWithFilteredResult(_0x29b8ee,_0x2c987c){return function(_0x4888e0){if(_0x4888e0){var _0x459f0e=typeof _0x2c987c[_0xc9b7('0x1b')]==='undefined'&&typeof _0x2c987c[_0xc9b7('0x1c')]===_0xc9b7('0x1d');var _0x197e23=_0x4888e0['count'];var _0x4ad468=_0x459f0e?0x0:_0x2c987c[_0xc9b7('0x1b')];var _0x13c3d4=_0x459f0e?_0x4888e0[_0xc9b7('0x1e')]:_0x2c987c[_0xc9b7('0x1b')]+_0x2c987c[_0xc9b7('0x1c')];var _0x476fb8;if(_0x13c3d4>=_0x197e23){_0x13c3d4=_0x197e23;_0x476fb8=0xc8;}else{_0x476fb8=0xce;}_0x29b8ee[_0xc9b7('0x18')](_0x476fb8);return _0x29b8ee['set'](_0xc9b7('0x1f'),_0x4ad468+'-'+_0x13c3d4+'/'+_0x197e23)['json'](_0x4888e0);}return null;};}function patchUpdates(_0x132e55){return function(_0x379d2b){try{jsonpatch[_0xc9b7('0x20')](_0x379d2b,_0x132e55,!![]);}catch(_0x3da26f){return BPromise[_0xc9b7('0x21')](_0x3da26f);}return _0x379d2b[_0xc9b7('0x22')]();};}function saveUpdates(_0x11df9e,_0x2f00bc){return function(_0x197e20){if(_0x197e20){return _0x197e20[_0xc9b7('0x23')](_0x11df9e)[_0xc9b7('0x24')](function(_0xe4eb8d){return _0xe4eb8d;});}return null;};}function removeEntity(_0x5db1c2,_0xf06d77){return function(_0x5326df){if(_0x5326df){return _0x5326df[_0xc9b7('0x25')]()[_0xc9b7('0x24')](function(){var _0x321a6e=_0x5326df[_0xc9b7('0x26')]({'plain':!![]});var _0x3de78d=_0xc9b7('0x27');return db[_0xc9b7('0x28')]['destroy']({'where':{'type':_0x3de78d,'resourceId':_0x321a6e['id']}})[_0xc9b7('0x24')](function(){return _0x5326df;});})[_0xc9b7('0x24')](function(){_0x5db1c2['status'](0xcc)[_0xc9b7('0x19')]();});}};}function handleEntityNotFound(_0x1d0e9f,_0x2bf2f1){return function(_0x2712e0){if(!_0x2712e0){_0x1d0e9f['sendStatus'](0x194);}return _0x2712e0;};}function handleError(_0x1e95dd,_0x508700){_0x508700=_0x508700||0x1f4;return function(_0x31546f){logger[_0xc9b7('0x29')](_0x31546f['stack']);if(_0x31546f[_0xc9b7('0x2a')]){delete _0x31546f[_0xc9b7('0x2a')];}_0x1e95dd[_0xc9b7('0x18')](_0x508700)[_0xc9b7('0x2b')](_0x31546f);};}exports[_0xc9b7('0x2c')]=function(_0x1cb9de,_0x468d94){var _0x13be7f={},_0x3d0f7f={},_0x44e27d={'count':0x0,'rows':[]};var _0x49bcf0=_[_0xc9b7('0x2d')](db['AnalyticExtractedReport'][_0xc9b7('0x2e')],function(_0x1cea0c){return{'name':_0x1cea0c[_0xc9b7('0x2f')],'type':_0x1cea0c[_0xc9b7('0x30')][_0xc9b7('0x31')]};});_0x3d0f7f['model']=_[_0xc9b7('0x2d')](_0x49bcf0,_0xc9b7('0x2a'));_0x3d0f7f['query']=_[_0xc9b7('0x32')](_0x1cb9de[_0xc9b7('0x33')]);_0x3d0f7f['filters']=_[_0xc9b7('0x34')](_0x3d0f7f['model'],_0x3d0f7f[_0xc9b7('0x33')]);_0x13be7f[_0xc9b7('0x35')]=_[_0xc9b7('0x34')](_0x3d0f7f[_0xc9b7('0x36')],qs[_0xc9b7('0x37')](_0x1cb9de[_0xc9b7('0x33')]['fields']));_0x13be7f[_0xc9b7('0x35')]=_0x13be7f['attributes'][_0xc9b7('0x38')]?_0x13be7f[_0xc9b7('0x35')]:_0x3d0f7f[_0xc9b7('0x36')];if(!_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x39')](_0xc9b7('0x3a'))){_0x13be7f[_0xc9b7('0x1c')]=qs[_0xc9b7('0x1c')](_0x1cb9de[_0xc9b7('0x33')]['limit']);_0x13be7f[_0xc9b7('0x1b')]=qs[_0xc9b7('0x1b')](_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x1b')]);}_0x13be7f['order']=qs[_0xc9b7('0x3b')](_0x1cb9de['query'][_0xc9b7('0x3b')]);_0x13be7f[_0xc9b7('0x3c')]=qs[_0xc9b7('0x3d')](_['pick'](_0x1cb9de[_0xc9b7('0x33')],_0x3d0f7f[_0xc9b7('0x3d')]),_0x49bcf0);if(_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x3e')]){_0x13be7f[_0xc9b7('0x3c')]=_[_0xc9b7('0x3f')](_0x13be7f[_0xc9b7('0x3c')],{'$or':_[_0xc9b7('0x2d')](_0x49bcf0,function(_0x5604ee){if(_0x5604ee[_0xc9b7('0x30')]!=='VIRTUAL'){var _0x3e3263={};_0x3e3263[_0x5604ee[_0xc9b7('0x2a')]]={'$like':'%'+_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x3e')]+'%'};return _0x3e3263;}})});}_0x13be7f=_['merge']({},_0x13be7f,_0x1cb9de[_0xc9b7('0x40')]);var _0x36c649={'where':_0x13be7f[_0xc9b7('0x3c')]};return db['AnalyticExtractedReport'][_0xc9b7('0x1e')](_0x36c649)[_0xc9b7('0x24')](function(_0x11f64e){_0x44e27d['count']=_0x11f64e;if(_0x1cb9de[_0xc9b7('0x33')][_0xc9b7('0x41')]){_0x13be7f['include']=[{'all':!![]}];}return db[_0xc9b7('0x42')][_0xc9b7('0x43')](_0x13be7f);})[_0xc9b7('0x24')](function(_0x2914c2){_0x44e27d['rows']=_0x2914c2;return _0x44e27d;})['then'](respondWithFilteredResult(_0x468d94,_0x13be7f))[_0xc9b7('0x44')](handleError(_0x468d94,null));};exports[_0xc9b7('0x45')]=function(_0x52e090,_0x22df15){var _0x32afae={'raw':!![],'where':{'id':_0x52e090[_0xc9b7('0x46')]['id']}},_0x15b98a={};_0x15b98a[_0xc9b7('0x36')]=_[_0xc9b7('0x32')](db[_0xc9b7('0x42')][_0xc9b7('0x2e')]);_0x15b98a[_0xc9b7('0x33')]=_[_0xc9b7('0x32')](_0x52e090[_0xc9b7('0x33')]);_0x15b98a['filters']=_[_0xc9b7('0x34')](_0x15b98a[_0xc9b7('0x36')],_0x15b98a['query']);_0x32afae[_0xc9b7('0x35')]=_[_0xc9b7('0x34')](_0x15b98a[_0xc9b7('0x36')],qs[_0xc9b7('0x37')](_0x52e090['query'][_0xc9b7('0x37')]));_0x32afae[_0xc9b7('0x35')]=_0x32afae['attributes']['length']?_0x32afae[_0xc9b7('0x35')]:_0x15b98a[_0xc9b7('0x36')];if(_0x52e090['query'][_0xc9b7('0x41')]){_0x32afae['include']=[{'all':!![]}];}_0x32afae=_['merge']({},_0x32afae,_0x52e090[_0xc9b7('0x40')]);return db['AnalyticExtractedReport']['find'](_0x32afae)[_0xc9b7('0x24')](handleEntityNotFound(_0x22df15,null))['then'](respondWithResult(_0x22df15,null))[_0xc9b7('0x44')](handleError(_0x22df15,null));};exports['create']=function(_0x5be96a,_0x277c09){return db['AnalyticExtractedReport']['create'](_0x5be96a[_0xc9b7('0x47')],{})['then'](function(_0x173cf3){var _0x57d125=_0x5be96a['user'][_0xc9b7('0x26')]({'plain':!![]});if(!_0x57d125)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57d125['role']===_0xc9b7('0x48')){var _0x440792=_0x173cf3[_0xc9b7('0x26')]({'plain':!![]});var _0x371cf3='ExtractedReports';return db['UserProfileSection']['find']({'where':{'name':_0x371cf3,'userProfileId':_0x57d125[_0xc9b7('0x49')]},'raw':!![]})['then'](function(_0x256bd5){if(_0x256bd5&&_0x256bd5[_0xc9b7('0x4a')]===0x0){return db[_0xc9b7('0x28')][_0xc9b7('0x4b')]({'name':_0x440792[_0xc9b7('0x2a')],'resourceId':_0x440792['id'],'type':_0x256bd5[_0xc9b7('0x2a')],'sectionId':_0x256bd5['id']},{})['then'](function(){return _0x173cf3;});}else{return _0x173cf3;}})[_0xc9b7('0x44')](function(_0x12d941){logger[_0xc9b7('0x29')](_0xc9b7('0x4c'),_0x12d941);throw _0x12d941;});}return _0x173cf3;})['then'](respondWithResult(_0x277c09,0xc9))[_0xc9b7('0x44')](handleError(_0x277c09,null));};exports['update']=function(_0x2080b6,_0x521bcf){if(_0x2080b6[_0xc9b7('0x47')]['id']){delete _0x2080b6[_0xc9b7('0x47')]['id'];}return db[_0xc9b7('0x42')][_0xc9b7('0x4d')]({'where':{'id':_0x2080b6[_0xc9b7('0x46')]['id']}})[_0xc9b7('0x24')](handleEntityNotFound(_0x521bcf,null))[_0xc9b7('0x24')](saveUpdates(_0x2080b6['body'],null))['then'](respondWithResult(_0x521bcf,null))['catch'](handleError(_0x521bcf,null));};exports[_0xc9b7('0x25')]=function(_0x38d3bb,_0x3c927d){return db[_0xc9b7('0x42')]['find']({'where':{'id':_0x38d3bb[_0xc9b7('0x46')]['id']}})[_0xc9b7('0x24')](handleEntityNotFound(_0x3c927d,null))[_0xc9b7('0x24')](removeEntity(_0x3c927d,null))[_0xc9b7('0x44')](handleError(_0x3c927d,null));};exports['download']=function(_0x224bc3,_0x3a5663,_0x123899){return db[_0xc9b7('0x42')][_0xc9b7('0x4d')]({'where':{'id':_0x224bc3[_0xc9b7('0x46')]['id']},'attributes':[_0xc9b7('0x2a'),_0xc9b7('0x4e'),_0xc9b7('0x4f'),_0xc9b7('0x50')],'raw':!![]})[_0xc9b7('0x24')](handleEntityNotFound(_0x3a5663,null))[_0xc9b7('0x24')](function(_0x388782){if(_0x388782){if(!fs[_0xc9b7('0x51')](path['join'](config['root'],'server/files/reports',_0x388782[_0xc9b7('0x4f')]))){throw new db[(_0xc9b7('0x52'))][(_0xc9b7('0x53'))](_0xc9b7('0x54'));}if(_0x224bc3[_0xc9b7('0x33')][_0xc9b7('0x55')]){return _0x3a5663[_0xc9b7('0x17')](0xc8);}return _0x3a5663[_0xc9b7('0x56')](path['join'](config[_0xc9b7('0x57')],_0xc9b7('0x58'),_0x388782[_0xc9b7('0x4f')]),util[_0xc9b7('0x59')]('%s.%s',_0x388782['basename']||_0x388782[_0xc9b7('0x2a')],_0x388782['output'][_0xc9b7('0x5a')]()));}})['catch'](handleError(_0x3a5663,null));};
\ No newline at end of file
+var _0xdfe8=['exists','format','basename','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','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','../../config/license/util','../../mysqldb','sendStatus','end','status','json','undefined','limit','offset','count','set','Content-Range','apply','save','update','destroy','then','get','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','keys','find','catch','create','body','user','role','ExtractedReports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','join','root','server/files/reports','ValidationError'];(function(_0x5598ed,_0x366268){var _0x5368a4=function(_0x308473){while(--_0x308473){_0x5598ed['push'](_0x5598ed['shift']());}};_0x5368a4(++_0x366268);}(_0xdfe8,0x66));var _0x8dfe=function(_0x77d286,_0x1ddc6d){_0x77d286=_0x77d286-0x0;var _0x5446a5=_0xdfe8[_0x77d286];return _0x5446a5;};'use strict';var emlformat=require(_0x8dfe('0x0'));var rimraf=require(_0x8dfe('0x1'));var zipdir=require(_0x8dfe('0x2'));var jsonpatch=require(_0x8dfe('0x3'));var rp=require(_0x8dfe('0x4'));var moment=require(_0x8dfe('0x5'));var BPromise=require(_0x8dfe('0x6'));var Mustache=require(_0x8dfe('0x7'));var util=require(_0x8dfe('0x8'));var path=require(_0x8dfe('0x9'));var sox=require('sox');var csv=require(_0x8dfe('0xa'));var ejs=require(_0x8dfe('0xb'));var fs=require('fs');var fs_extra=require(_0x8dfe('0xc'));var _=require('lodash');var squel=require(_0x8dfe('0xd'));var crypto=require(_0x8dfe('0xe'));var jsforce=require(_0x8dfe('0xf'));var deskjs=require(_0x8dfe('0x10'));var toCsv=require(_0x8dfe('0xa'));var querystring=require(_0x8dfe('0x11'));var Papa=require(_0x8dfe('0x12'));var Redis=require('ioredis');var authService=require(_0x8dfe('0x13'));var qs=require(_0x8dfe('0x14'));var as=require(_0x8dfe('0x15'));var hardwareService=require(_0x8dfe('0x16'));var logger=require(_0x8dfe('0x17'))(_0x8dfe('0x18'));var utils=require(_0x8dfe('0x19'));var config=require(_0x8dfe('0x1a'));var licenseUtil=require(_0x8dfe('0x1b'));var db=require(_0x8dfe('0x1c'))['db'];function respondWithStatusCode(_0x3304e5,_0x5aa0b8){_0x5aa0b8=_0x5aa0b8||0xcc;return function(_0x45d203){if(_0x45d203){return _0x3304e5[_0x8dfe('0x1d')](_0x5aa0b8);}return _0x3304e5['status'](_0x5aa0b8)[_0x8dfe('0x1e')]();};}function respondWithResult(_0x2da34a,_0x1e9898){_0x1e9898=_0x1e9898||0xc8;return function(_0x4f1142){if(_0x4f1142){return _0x2da34a[_0x8dfe('0x1f')](_0x1e9898)[_0x8dfe('0x20')](_0x4f1142);}};}function respondWithFilteredResult(_0x194071,_0x164337){return function(_0x146846){if(_0x146846){var _0x3b8f5a=typeof _0x164337['offset']===_0x8dfe('0x21')&&typeof _0x164337[_0x8dfe('0x22')]===_0x8dfe('0x21');var _0x2ee5a1=_0x146846['count'];var _0x2b61ba=_0x3b8f5a?0x0:_0x164337[_0x8dfe('0x23')];var _0xc6d867=_0x3b8f5a?_0x146846[_0x8dfe('0x24')]:_0x164337[_0x8dfe('0x23')]+_0x164337[_0x8dfe('0x22')];var _0x2aad52;if(_0xc6d867>=_0x2ee5a1){_0xc6d867=_0x2ee5a1;_0x2aad52=0xc8;}else{_0x2aad52=0xce;}_0x194071['status'](_0x2aad52);return _0x194071[_0x8dfe('0x25')](_0x8dfe('0x26'),_0x2b61ba+'-'+_0xc6d867+'/'+_0x2ee5a1)['json'](_0x146846);}return null;};}function patchUpdates(_0xaa9b2f){return function(_0x5b33a0){try{jsonpatch[_0x8dfe('0x27')](_0x5b33a0,_0xaa9b2f,!![]);}catch(_0x2aeb06){return BPromise['reject'](_0x2aeb06);}return _0x5b33a0[_0x8dfe('0x28')]();};}function saveUpdates(_0x19c20a,_0x13f561){return function(_0x57b5d9){if(_0x57b5d9){return _0x57b5d9[_0x8dfe('0x29')](_0x19c20a)['then'](function(_0x54a31e){return _0x54a31e;});}return null;};}function removeEntity(_0x50b245,_0x2cb868){return function(_0x3c1694){if(_0x3c1694){return _0x3c1694[_0x8dfe('0x2a')]()[_0x8dfe('0x2b')](function(){var _0x576cef=_0x3c1694[_0x8dfe('0x2c')]({'plain':!![]});var _0x5098b8='ExtractedReports';return db[_0x8dfe('0x2d')]['destroy']({'where':{'type':_0x5098b8,'resourceId':_0x576cef['id']}})['then'](function(){return _0x3c1694;});})['then'](function(){_0x50b245['status'](0xcc)[_0x8dfe('0x1e')]();});}};}function handleEntityNotFound(_0x9a507d,_0x1e4d05){return function(_0x4f1859){if(!_0x4f1859){_0x9a507d[_0x8dfe('0x1d')](0x194);}return _0x4f1859;};}function handleError(_0x21ea6c,_0x50da9f){_0x50da9f=_0x50da9f||0x1f4;return function(_0x51d892){logger[_0x8dfe('0x2e')](_0x51d892['stack']);if(_0x51d892['name']){delete _0x51d892[_0x8dfe('0x2f')];}_0x21ea6c[_0x8dfe('0x1f')](_0x50da9f)[_0x8dfe('0x30')](_0x51d892);};}exports[_0x8dfe('0x31')]=function(_0x57e48a,_0x567ffa){var _0x37e59b={},_0x390068={},_0xdb23ab={'count':0x0,'rows':[]};var _0x448717=_[_0x8dfe('0x32')](db[_0x8dfe('0x33')][_0x8dfe('0x34')],function(_0x46d250){return{'name':_0x46d250[_0x8dfe('0x35')],'type':_0x46d250[_0x8dfe('0x36')][_0x8dfe('0x37')]};});_0x390068[_0x8dfe('0x38')]=_[_0x8dfe('0x32')](_0x448717,'name');_0x390068[_0x8dfe('0x39')]=_['keys'](_0x57e48a[_0x8dfe('0x39')]);_0x390068[_0x8dfe('0x3a')]=_['intersection'](_0x390068[_0x8dfe('0x38')],_0x390068[_0x8dfe('0x39')]);_0x37e59b[_0x8dfe('0x3b')]=_[_0x8dfe('0x3c')](_0x390068[_0x8dfe('0x38')],qs[_0x8dfe('0x3d')](_0x57e48a[_0x8dfe('0x39')]['fields']));_0x37e59b['attributes']=_0x37e59b[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0x37e59b[_0x8dfe('0x3b')]:_0x390068[_0x8dfe('0x38')];if(!_0x57e48a['query'][_0x8dfe('0x3f')](_0x8dfe('0x40'))){_0x37e59b['limit']=qs[_0x8dfe('0x22')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x22')]);_0x37e59b[_0x8dfe('0x23')]=qs[_0x8dfe('0x23')](_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x23')]);}_0x37e59b['order']=qs['sort'](_0x57e48a[_0x8dfe('0x39')]['sort']);_0x37e59b['where']=qs[_0x8dfe('0x3a')](_[_0x8dfe('0x41')](_0x57e48a[_0x8dfe('0x39')],_0x390068[_0x8dfe('0x3a')]),_0x448717);if(_0x57e48a[_0x8dfe('0x39')][_0x8dfe('0x42')]){_0x37e59b[_0x8dfe('0x43')]=_[_0x8dfe('0x44')](_0x37e59b[_0x8dfe('0x43')],{'$or':_['map'](_0x448717,function(_0x134959){if(_0x134959['type']!==_0x8dfe('0x45')){var _0x3e956b={};_0x3e956b[_0x134959[_0x8dfe('0x2f')]]={'$like':'%'+_0x57e48a['query']['filter']+'%'};return _0x3e956b;}})});}_0x37e59b=_[_0x8dfe('0x44')]({},_0x37e59b,_0x57e48a[_0x8dfe('0x46')]);var _0x153510={'where':_0x37e59b['where']};return db['AnalyticExtractedReport'][_0x8dfe('0x24')](_0x153510)[_0x8dfe('0x2b')](function(_0x1aacaf){_0xdb23ab[_0x8dfe('0x24')]=_0x1aacaf;if(_0x57e48a['query'][_0x8dfe('0x47')]){_0x37e59b[_0x8dfe('0x48')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x37e59b);})[_0x8dfe('0x2b')](function(_0xac7a89){_0xdb23ab[_0x8dfe('0x49')]=_0xac7a89;return _0xdb23ab;})[_0x8dfe('0x2b')](respondWithFilteredResult(_0x567ffa,_0x37e59b))['catch'](handleError(_0x567ffa,null));};exports['show']=function(_0x1233e9,_0x148a3b){var _0xde276={'raw':!![],'where':{'id':_0x1233e9['params']['id']}},_0x48323c={};_0x48323c['model']=_[_0x8dfe('0x4a')](db[_0x8dfe('0x33')]['rawAttributes']);_0x48323c[_0x8dfe('0x39')]=_[_0x8dfe('0x4a')](_0x1233e9[_0x8dfe('0x39')]);_0x48323c[_0x8dfe('0x3a')]=_[_0x8dfe('0x3c')](_0x48323c[_0x8dfe('0x38')],_0x48323c['query']);_0xde276['attributes']=_[_0x8dfe('0x3c')](_0x48323c['model'],qs[_0x8dfe('0x3d')](_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x3d')]));_0xde276[_0x8dfe('0x3b')]=_0xde276[_0x8dfe('0x3b')][_0x8dfe('0x3e')]?_0xde276[_0x8dfe('0x3b')]:_0x48323c['model'];if(_0x1233e9[_0x8dfe('0x39')][_0x8dfe('0x47')]){_0xde276[_0x8dfe('0x48')]=[{'all':!![]}];}_0xde276=_['merge']({},_0xde276,_0x1233e9[_0x8dfe('0x46')]);return db[_0x8dfe('0x33')][_0x8dfe('0x4b')](_0xde276)[_0x8dfe('0x2b')](handleEntityNotFound(_0x148a3b,null))[_0x8dfe('0x2b')](respondWithResult(_0x148a3b,null))[_0x8dfe('0x4c')](handleError(_0x148a3b,null));};exports[_0x8dfe('0x4d')]=function(_0x22ab6f,_0x2b5390){return db[_0x8dfe('0x33')][_0x8dfe('0x4d')](_0x22ab6f[_0x8dfe('0x4e')],{})[_0x8dfe('0x2b')](function(_0x2d5990){var _0x3210cd=_0x22ab6f[_0x8dfe('0x4f')]['get']({'plain':!![]});if(!_0x3210cd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3210cd[_0x8dfe('0x50')]==='user'){var _0x3c41fb=_0x2d5990['get']({'plain':!![]});var _0x17070d=_0x8dfe('0x51');return db[_0x8dfe('0x52')][_0x8dfe('0x4b')]({'where':{'name':_0x17070d,'userProfileId':_0x3210cd['userProfileId']},'raw':!![]})[_0x8dfe('0x2b')](function(_0x373d98){if(_0x373d98&&_0x373d98[_0x8dfe('0x53')]===0x0){return db[_0x8dfe('0x2d')][_0x8dfe('0x4d')]({'name':_0x3c41fb[_0x8dfe('0x2f')],'resourceId':_0x3c41fb['id'],'type':_0x373d98[_0x8dfe('0x2f')],'sectionId':_0x373d98['id']},{})[_0x8dfe('0x2b')](function(){return _0x2d5990;});}else{return _0x2d5990;}})['catch'](function(_0x4e2b05){logger['error'](_0x8dfe('0x54'),_0x4e2b05);throw _0x4e2b05;});}return _0x2d5990;})[_0x8dfe('0x2b')](respondWithResult(_0x2b5390,0xc9))[_0x8dfe('0x4c')](handleError(_0x2b5390,null));};exports[_0x8dfe('0x29')]=function(_0x5023f3,_0x85233d){if(_0x5023f3[_0x8dfe('0x4e')]['id']){delete _0x5023f3['body']['id'];}return db[_0x8dfe('0x33')][_0x8dfe('0x4b')]({'where':{'id':_0x5023f3[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x85233d,null))[_0x8dfe('0x2b')](saveUpdates(_0x5023f3[_0x8dfe('0x4e')],null))[_0x8dfe('0x2b')](respondWithResult(_0x85233d,null))['catch'](handleError(_0x85233d,null));};exports[_0x8dfe('0x2a')]=function(_0x1b9907,_0x59fba9){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x1b9907[_0x8dfe('0x55')]['id']}})[_0x8dfe('0x2b')](handleEntityNotFound(_0x59fba9,null))['then'](removeEntity(_0x59fba9,null))[_0x8dfe('0x4c')](handleError(_0x59fba9,null));};exports[_0x8dfe('0x56')]=function(_0x970dda,_0x213cd0,_0x34362f){return db['AnalyticExtractedReport'][_0x8dfe('0x4b')]({'where':{'id':_0x970dda['params']['id']},'attributes':[_0x8dfe('0x2f'),'basename',_0x8dfe('0x57'),_0x8dfe('0x58')],'raw':!![]})[_0x8dfe('0x2b')](handleEntityNotFound(_0x213cd0,null))[_0x8dfe('0x2b')](function(_0x26a8d9){if(_0x26a8d9){if(!fs[_0x8dfe('0x59')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9[_0x8dfe('0x57')]))){throw new db['Sequelize'][(_0x8dfe('0x5d'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x970dda[_0x8dfe('0x39')][_0x8dfe('0x5e')]){return _0x213cd0[_0x8dfe('0x1d')](0xc8);}return _0x213cd0[_0x8dfe('0x56')](path[_0x8dfe('0x5a')](config[_0x8dfe('0x5b')],_0x8dfe('0x5c'),_0x26a8d9['savename']),util[_0x8dfe('0x5f')]('%s.%s',_0x26a8d9[_0x8dfe('0x60')]||_0x26a8d9['name'],_0x26a8d9[_0x8dfe('0x58')][_0x8dfe('0x61')]()));}})[_0x8dfe('0x4c')](handleError(_0x213cd0,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index df26b16..5d1511a 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 _0xf4f3=['analytics_extracted_reports','../../config/logger','api','moment','bluebird','rimraf','./analyticExtractedReport.attributes','exports'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xf4f3,0x159));var _0x3f4f=function(_0x2e0621,_0x396248){_0x2e0621=_0x2e0621-0x0;var _0x21aee4=_0xf4f3[_0x2e0621];return _0x21aee4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f4f('0x0'))(_0x3f4f('0x1'));var moment=require(_0x3f4f('0x2'));var BPromise=require(_0x3f4f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x3f4f('0x4'));var config=require('../../config/environment');var attributes=require(_0x3f4f('0x5'));module[_0x3f4f('0x6')]=function(_0x690e13,_0x585862){return _0x690e13['define']('AnalyticExtractedReport',attributes,{'tableName':_0x3f4f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xacec=['request-promise','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger','api','moment'];(function(_0x3a3a46,_0x111874){var _0xe4acdb=function(_0x44b041){while(--_0x44b041){_0x3a3a46['push'](_0x3a3a46['shift']());}};_0xe4acdb(++_0x111874);}(_0xacec,0x88));var _0xcace=function(_0x3bd4e5,_0x33854f){_0x3bd4e5=_0x3bd4e5-0x0;var _0x2d1522=_0xacec[_0x3bd4e5];return _0x2d1522;};'use strict';var _=require(_0xcace('0x0'));var util=require('util');var logger=require(_0xcace('0x1'))(_0xcace('0x2'));var moment=require(_0xcace('0x3'));var BPromise=require('bluebird');var rp=require(_0xcace('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcace('0x5'));var config=require('../../config/environment');var attributes=require(_0xcace('0x6'));module['exports']=function(_0x491f14,_0x24dd13){return _0x491f14[_0xcace('0x7')](_0xcace('0x8'),attributes,{'tableName':_0xcace('0x9'),'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 c9426ea..09f29b3 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 _0x0046=['jayson/promise','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x1cb936,_0xd24a3e){var _0x1fee35=function(_0x841d6e){while(--_0x841d6e){_0x1cb936['push'](_0x1cb936['shift']());}};_0x1fee35(++_0xd24a3e);}(_0x0046,0x14f));var _0x6004=function(_0x4b2d37,_0x2589c1){_0x4b2d37=_0x4b2d37-0x0;var _0x2350d3=_0x0046[_0x4b2d37];return _0x2350d3;};'use strict';var _=require(_0x6004('0x0'));var util=require(_0x6004('0x1'));var moment=require(_0x6004('0x2'));var BPromise=require(_0x6004('0x3'));var rs=require(_0x6004('0x4'));var fs=require('fs');var Redis=require(_0x6004('0x5'));var db=require(_0x6004('0x6'))['db'];var utils=require(_0x6004('0x7'));var logger=require('../../config/logger')(_0x6004('0x8'));var config=require(_0x6004('0x9'));var jayson=require(_0x6004('0xa'));var client=jayson[_0x6004('0xb')][_0x6004('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x352969,_0xcae766,_0x50a55d){return new BPromise(function(_0x1d95c7,_0xfa757d){return client['request'](_0x352969,_0x50a55d)[_0x6004('0xd')](function(_0x4429dd){logger[_0x6004('0xe')](_0x6004('0xf'),_0xcae766,'request\x20sent');logger[_0x6004('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0xcae766,'request\x20sent',JSON[_0x6004('0x11')](_0x4429dd));if(_0x4429dd[_0x6004('0x12')]){if(_0x4429dd[_0x6004('0x12')][_0x6004('0x13')]===0x1f4){logger[_0x6004('0x12')](_0x6004('0xf'),_0xcae766,_0x4429dd[_0x6004('0x12')]['message']);return _0xfa757d(_0x4429dd[_0x6004('0x12')][_0x6004('0x14')]);}logger[_0x6004('0x12')](_0x6004('0xf'),_0xcae766,_0x4429dd[_0x6004('0x12')][_0x6004('0x14')]);return _0x1d95c7(_0x4429dd[_0x6004('0x12')]['message']);}else{logger[_0x6004('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcae766,'request\x20sent');_0x1d95c7(_0x4429dd[_0x6004('0x15')][_0x6004('0x14')]);}})[_0x6004('0x16')](function(_0x311263){logger[_0x6004('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0xcae766,_0x311263);_0xfa757d(_0x311263);});});}
\ No newline at end of file
+var _0x6633=['stringify','error','code','message','info','result','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s'];(function(_0x498334,_0x27b6fe){var _0x13bb70=function(_0x4087b1){while(--_0x4087b1){_0x498334['push'](_0x498334['shift']());}};_0x13bb70(++_0x27b6fe);}(_0x6633,0xfd));var _0x3663=function(_0x1990f0,_0x427550){_0x1990f0=_0x1990f0-0x0;var _0x4b3cf7=_0x6633[_0x1990f0];return _0x4b3cf7;};'use strict';var _=require(_0x3663('0x0'));var util=require(_0x3663('0x1'));var moment=require(_0x3663('0x2'));var BPromise=require(_0x3663('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3663('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3663('0x5'))(_0x3663('0x6'));var config=require(_0x3663('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3663('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51604b,_0x47f3ad,_0x47f2a6){return new BPromise(function(_0x5c97fb,_0x418ba7){return client['request'](_0x51604b,_0x47f2a6)[_0x3663('0x9')](function(_0x1352e7){logger['info'](_0x3663('0xa'),_0x47f3ad,_0x3663('0xb'));logger['debug'](_0x3663('0xc'),_0x47f3ad,_0x3663('0xb'),JSON[_0x3663('0xd')](_0x1352e7));if(_0x1352e7['error']){if(_0x1352e7[_0x3663('0xe')][_0x3663('0xf')]===0x1f4){logger['error'](_0x3663('0xa'),_0x47f3ad,_0x1352e7[_0x3663('0xe')]['message']);return _0x418ba7(_0x1352e7['error'][_0x3663('0x10')]);}logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);return _0x5c97fb(_0x1352e7[_0x3663('0xe')][_0x3663('0x10')]);}else{logger[_0x3663('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x3663('0xb'));_0x5c97fb(_0x1352e7[_0x3663('0x12')][_0x3663('0x10')]);}})['catch'](function(_0x4e8086){logger[_0x3663('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x47f3ad,_0x4e8086);_0x418ba7(_0x4e8086);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 57c7d08..930ec1d 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 _0x6c0b=['fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x4c2f17,_0x5c6821){var _0x20919e=function(_0x31eef7){while(--_0x31eef7){_0x4c2f17['push'](_0x4c2f17['shift']());}};_0x20919e(++_0x5c6821);}(_0x6c0b,0x12e));var _0xb6c0=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x6c0b[_0x489b87];return _0x1823b6;};'use strict';var multer=require(_0xb6c0('0x0'));var util=require(_0xb6c0('0x1'));var path=require(_0xb6c0('0x2'));var timeout=require(_0xb6c0('0x3'));var express=require(_0xb6c0('0x4'));var router=express[_0xb6c0('0x5')]();var fs_extra=require(_0xb6c0('0x6'));var auth=require(_0xb6c0('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb6c0('0x8'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xa')]);router[_0xb6c0('0xb')](_0xb6c0('0xc'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xd')]);router[_0xb6c0('0xb')](_0xb6c0('0xe'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0xf')]);router[_0xb6c0('0x10')]('/',auth[_0xb6c0('0x9')](),controller[_0xb6c0('0x11')]);router[_0xb6c0('0x12')](_0xb6c0('0xc'),auth[_0xb6c0('0x9')](),controller[_0xb6c0('0x13')]);router[_0xb6c0('0x14')](_0xb6c0('0xc'),auth['isAuthenticated'](),controller[_0xb6c0('0x15')]);module['exports']=router;
\ No newline at end of file
+var _0xf43c=['/:id','delete','destroy','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','post','create'];(function(_0x2e5fe4,_0x2889b8){var _0x1be065=function(_0x1e9cf5){while(--_0x1e9cf5){_0x2e5fe4['push'](_0x2e5fe4['shift']());}};_0x1be065(++_0x2889b8);}(_0xf43c,0xa4));var _0xcf43=function(_0x440178,_0x519854){_0x440178=_0x440178-0x0;var _0x22aa42=_0xf43c[_0x440178];return _0x22aa42;};'use strict';var multer=require(_0xcf43('0x0'));var util=require(_0xcf43('0x1'));var path=require(_0xcf43('0x2'));var timeout=require(_0xcf43('0x3'));var express=require('express');var router=express[_0xcf43('0x4')]();var fs_extra=require(_0xcf43('0x5'));var auth=require(_0xcf43('0x6'));var interaction=require(_0xcf43('0x7'));var config=require(_0xcf43('0x8'));var controller=require(_0xcf43('0x9'));router[_0xcf43('0xa')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xc')]);router[_0xcf43('0xa')]('/:id',auth[_0xcf43('0xb')](),controller[_0xcf43('0xd')]);router['get']('/:id/download',auth[_0xcf43('0xb')](),controller['download']);router[_0xcf43('0xe')]('/',auth[_0xcf43('0xb')](),controller[_0xcf43('0xf')]);router['put'](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller['update']);router[_0xcf43('0x11')](_0xcf43('0x10'),auth[_0xcf43('0xb')](),controller[_0xcf43('0x12')]);module[_0xcf43('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 8f30612..19a520d 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 _0xa3af=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x525bcf,_0x86ae27){var _0xd63d2f=function(_0x426a23){while(--_0x426a23){_0x525bcf['push'](_0x525bcf['shift']());}};_0xd63d2f(++_0x86ae27);}(_0xa3af,0x185));var _0xfa3a=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa3af[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0xfa3a('0x0'));module[_0xfa3a('0x1')]={'field':{'type':Sequelize[_0xfa3a('0x2')]},'alias':{'type':Sequelize[_0xfa3a('0x3')]},'function':{'type':Sequelize[_0xfa3a('0x3')]},'format':{'type':Sequelize[_0xfa3a('0x3')]},'groupBy':{'type':Sequelize[_0xfa3a('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfa3a('0x3')]},'custom':{'type':Sequelize[_0xfa3a('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x0467=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x1c83c0,_0x196063){var _0x24a775=function(_0x5e0b6b){while(--_0x5e0b6b){_0x1c83c0['push'](_0x1c83c0['shift']());}};_0x24a775(++_0x196063);}(_0x0467,0x153));var _0x7046=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0467[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7046('0x0'));module[_0x7046('0x1')]={'field':{'type':Sequelize[_0x7046('0x2')]},'alias':{'type':Sequelize[_0x7046('0x3')]},'function':{'type':Sequelize[_0x7046('0x3')]},'format':{'type':Sequelize[_0x7046('0x3')]},'groupBy':{'type':Sequelize[_0x7046('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x7046('0x3')]},'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 3b6ed10..93264f7 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 _0x5139=['sort','filters','pick','filter','merge','where','map','options','includeAll','include','findAll','catch','params','length','create','bulkCreate','body','destroy','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','reject','save','update','then','error','stack','name','index','AnalyticFieldReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit'];(function(_0x44e114,_0x23db9d){var _0xd10546=function(_0xc9853a){while(--_0xc9853a){_0x44e114['push'](_0x44e114['shift']());}};_0xd10546(++_0x23db9d);}(_0x5139,0xaf));var _0x9513=function(_0x5d329b,_0x15387a){_0x5d329b=_0x5d329b-0x0;var _0x21eefb=_0x5139[_0x5d329b];return _0x21eefb;};'use strict';var emlformat=require(_0x9513('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9513('0x1'));var jsonpatch=require(_0x9513('0x2'));var rp=require(_0x9513('0x3'));var moment=require('moment');var BPromise=require(_0x9513('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x9513('0x5'));var csv=require(_0x9513('0x6'));var ejs=require(_0x9513('0x7'));var fs=require('fs');var fs_extra=require(_0x9513('0x8'));var _=require(_0x9513('0x9'));var squel=require(_0x9513('0xa'));var crypto=require(_0x9513('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x9513('0xc'));var toCsv=require(_0x9513('0x6'));var querystring=require(_0x9513('0xd'));var Papa=require(_0x9513('0xe'));var Redis=require('ioredis');var authService=require(_0x9513('0xf'));var qs=require(_0x9513('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9513('0x11'));var utils=require(_0x9513('0x12'));var config=require(_0x9513('0x13'));var licenseUtil=require(_0x9513('0x14'));var db=require(_0x9513('0x15'))['db'];function respondWithStatusCode(_0x57978d,_0x1de524){_0x1de524=_0x1de524||0xcc;return function(_0x2448d7){if(_0x2448d7){return _0x57978d[_0x9513('0x16')](_0x1de524);}return _0x57978d[_0x9513('0x17')](_0x1de524)[_0x9513('0x18')]();};}function respondWithResult(_0xb9ef77,_0x545c89){_0x545c89=_0x545c89||0xc8;return function(_0x23401e){if(_0x23401e){return _0xb9ef77['status'](_0x545c89)[_0x9513('0x19')](_0x23401e);}};}function respondWithFilteredResult(_0x38b964,_0x2c938f){return function(_0x633e99){if(_0x633e99){var _0x5d498c=typeof _0x2c938f[_0x9513('0x1a')]==='undefined'&&typeof _0x2c938f[_0x9513('0x1b')]===_0x9513('0x1c');var _0x358fc6=_0x633e99[_0x9513('0x1d')];var _0x50070b=_0x5d498c?0x0:_0x2c938f[_0x9513('0x1a')];var _0x390fdd=_0x5d498c?_0x633e99[_0x9513('0x1d')]:_0x2c938f[_0x9513('0x1a')]+_0x2c938f[_0x9513('0x1b')];var _0x4f36ac;if(_0x390fdd>=_0x358fc6){_0x390fdd=_0x358fc6;_0x4f36ac=0xc8;}else{_0x4f36ac=0xce;}_0x38b964[_0x9513('0x17')](_0x4f36ac);return _0x38b964['set']('Content-Range',_0x50070b+'-'+_0x390fdd+'/'+_0x358fc6)[_0x9513('0x19')](_0x633e99);}return null;};}function patchUpdates(_0x5dee6a){return function(_0x8fd092){try{jsonpatch['apply'](_0x8fd092,_0x5dee6a,!![]);}catch(_0xef9c91){return BPromise[_0x9513('0x1e')](_0xef9c91);}return _0x8fd092[_0x9513('0x1f')]();};}function saveUpdates(_0x3ecd88,_0x90203c){return function(_0x1202f2){if(_0x1202f2){return _0x1202f2[_0x9513('0x20')](_0x3ecd88)[_0x9513('0x21')](function(_0x158fa5){return _0x158fa5;});}return null;};}function removeEntity(_0x1fb750,_0x2a8aad){return function(_0x5cd34b){if(_0x5cd34b){return _0x5cd34b['destroy']()[_0x9513('0x21')](function(){_0x1fb750[_0x9513('0x17')](0xcc)[_0x9513('0x18')]();});}};}function handleEntityNotFound(_0x4d391a,_0x9afd2f){return function(_0x481d0f){if(!_0x481d0f){_0x4d391a[_0x9513('0x16')](0x194);}return _0x481d0f;};}function handleError(_0x19969c,_0x6b1a45){_0x6b1a45=_0x6b1a45||0x1f4;return function(_0x1fe9e9){logger[_0x9513('0x22')](_0x1fe9e9[_0x9513('0x23')]);if(_0x1fe9e9[_0x9513('0x24')]){delete _0x1fe9e9[_0x9513('0x24')];}_0x19969c[_0x9513('0x17')](_0x6b1a45)['send'](_0x1fe9e9);};}exports[_0x9513('0x25')]=function(_0x326d4b,_0x15d4fd){var _0x247190={},_0x46cafb={},_0x151f2c={'count':0x0,'rows':[]};var _0x3a6bec=_['map'](db[_0x9513('0x26')]['rawAttributes'],function(_0x28f1c3){return{'name':_0x28f1c3[_0x9513('0x27')],'type':_0x28f1c3[_0x9513('0x28')][_0x9513('0x29')]};});_0x46cafb['model']=_['map'](_0x3a6bec,_0x9513('0x24'));_0x46cafb[_0x9513('0x2a')]=_[_0x9513('0x2b')](_0x326d4b['query']);_0x46cafb['filters']=_[_0x9513('0x2c')](_0x46cafb[_0x9513('0x2d')],_0x46cafb[_0x9513('0x2a')]);_0x247190['attributes']=_['intersection'](_0x46cafb['model'],qs[_0x9513('0x2e')](_0x326d4b[_0x9513('0x2a')][_0x9513('0x2e')]));_0x247190[_0x9513('0x2f')]=_0x247190['attributes']['length']?_0x247190[_0x9513('0x2f')]:_0x46cafb['model'];if(!_0x326d4b[_0x9513('0x2a')][_0x9513('0x30')](_0x9513('0x31'))){_0x247190['limit']=qs[_0x9513('0x1b')](_0x326d4b[_0x9513('0x2a')][_0x9513('0x1b')]);_0x247190['offset']=qs[_0x9513('0x1a')](_0x326d4b[_0x9513('0x2a')]['offset']);}_0x247190['order']=qs[_0x9513('0x32')](_0x326d4b['query'][_0x9513('0x32')]);_0x247190['where']=qs[_0x9513('0x33')](_[_0x9513('0x34')](_0x326d4b[_0x9513('0x2a')],_0x46cafb[_0x9513('0x33')]),_0x3a6bec);if(_0x326d4b['query'][_0x9513('0x35')]){_0x247190['where']=_[_0x9513('0x36')](_0x247190[_0x9513('0x37')],{'$or':_[_0x9513('0x38')](_0x3a6bec,function(_0x1c0068){if(_0x1c0068[_0x9513('0x28')]!=='VIRTUAL'){var _0x23761b={};_0x23761b[_0x1c0068[_0x9513('0x24')]]={'$like':'%'+_0x326d4b[_0x9513('0x2a')]['filter']+'%'};return _0x23761b;}})});}_0x247190=_[_0x9513('0x36')]({},_0x247190,_0x326d4b[_0x9513('0x39')]);var _0x31de2d={'where':_0x247190[_0x9513('0x37')]};return db['AnalyticFieldReport'][_0x9513('0x1d')](_0x31de2d)[_0x9513('0x21')](function(_0xc92ca4){_0x151f2c[_0x9513('0x1d')]=_0xc92ca4;if(_0x326d4b[_0x9513('0x2a')][_0x9513('0x3a')]){_0x247190[_0x9513('0x3b')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9513('0x3c')](_0x247190);})[_0x9513('0x21')](function(_0x334c1f){_0x151f2c['rows']=_0x334c1f;return _0x151f2c;})[_0x9513('0x21')](respondWithFilteredResult(_0x15d4fd,_0x247190))[_0x9513('0x3d')](handleError(_0x15d4fd,null));};exports['show']=function(_0xc38fe3,_0x16f78c){var _0x52ec04={'raw':![],'where':{'id':_0xc38fe3[_0x9513('0x3e')]['id']}},_0x16c1e6={};_0x16c1e6[_0x9513('0x2d')]=_[_0x9513('0x2b')](db[_0x9513('0x26')]['rawAttributes']);_0x16c1e6[_0x9513('0x2a')]=_[_0x9513('0x2b')](_0xc38fe3[_0x9513('0x2a')]);_0x16c1e6[_0x9513('0x33')]=_[_0x9513('0x2c')](_0x16c1e6[_0x9513('0x2d')],_0x16c1e6[_0x9513('0x2a')]);_0x52ec04[_0x9513('0x2f')]=_[_0x9513('0x2c')](_0x16c1e6[_0x9513('0x2d')],qs[_0x9513('0x2e')](_0xc38fe3[_0x9513('0x2a')]['fields']));_0x52ec04[_0x9513('0x2f')]=_0x52ec04[_0x9513('0x2f')][_0x9513('0x3f')]?_0x52ec04[_0x9513('0x2f')]:_0x16c1e6[_0x9513('0x2d')];if(_0xc38fe3[_0x9513('0x2a')][_0x9513('0x3a')]){_0x52ec04[_0x9513('0x3b')]=[{'all':!![]}];}_0x52ec04=_[_0x9513('0x36')]({},_0x52ec04,_0xc38fe3[_0x9513('0x39')]);return db[_0x9513('0x26')]['find'](_0x52ec04)[_0x9513('0x21')](handleEntityNotFound(_0x16f78c,null))['then'](respondWithResult(_0x16f78c,null))['catch'](handleError(_0x16f78c,null));};exports[_0x9513('0x40')]=function(_0xbc6bc,_0x5887bc){return db[_0x9513('0x26')][_0x9513('0x40')](_0xbc6bc['body'],{})[_0x9513('0x21')](respondWithResult(_0x5887bc,0xc9))[_0x9513('0x3d')](handleError(_0x5887bc,null));};exports['bulkCreate']=function(_0x142835,_0x5a85d9){return db['AnalyticFieldReport'][_0x9513('0x41')](_0x142835[_0x9513('0x42')],{'raw':![],'individualHooks':!![]})[_0x9513('0x21')](respondWithResult(_0x5a85d9,0xc9))[_0x9513('0x3d')](handleError(_0x5a85d9,null));};exports[_0x9513('0x20')]=function(_0x37535b,_0x2f29f4){if(_0x37535b[_0x9513('0x42')]['id']){delete _0x37535b[_0x9513('0x42')]['id'];}return db[_0x9513('0x26')]['find']({'where':{'id':_0x37535b[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0x2f29f4,null))['then'](saveUpdates(_0x37535b[_0x9513('0x42')],null))[_0x9513('0x21')](respondWithResult(_0x2f29f4,null))[_0x9513('0x3d')](handleError(_0x2f29f4,null));};exports[_0x9513('0x43')]=function(_0x56aef5,_0x12649c){return db[_0x9513('0x26')][_0x9513('0x44')]({'where':{'id':_0x56aef5[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0x12649c,null))[_0x9513('0x21')](removeEntity(_0x12649c,null))[_0x9513('0x3d')](handleError(_0x12649c,null));};exports[_0x9513('0x45')]=function(_0xb1a10c,_0x4907ad){return db[_0x9513('0x26')]['destroy']({'where':{'id':_0xb1a10c[_0x9513('0x2a')][_0x9513('0x46')]||[]},'raw':![],'individualHooks':!![]})[_0x9513('0x21')](respondWithResult(_0x4907ad,0xcc))[_0x9513('0x3d')](handleError(_0x4907ad,null));};exports[_0x9513('0x47')]=function(_0x2497cc,_0xc37475,_0x4e36d2){return db[_0x9513('0x48')][_0x9513('0x49')]({'where':{'id':_0x2497cc[_0x9513('0x3e')]['id']}})[_0x9513('0x21')](handleEntityNotFound(_0xc37475,null))['then'](function(_0x435a1d){if(_0x435a1d){return db[_0x9513('0x4a')]['transaction'](function(_0xa61c4e){return db[_0x9513('0x26')][_0x9513('0x43')]({'where':{'CustomReportId':_0x2497cc[_0x9513('0x3e')]['id']},'transaction':_0xa61c4e})[_0x9513('0x21')](function(_0x4bf9c8){var _0x28097a=_[_0x9513('0x38')](_0x2497cc['body'],function(_0x1c1961){delete _0x1c1961['id'];_0x1c1961['CustomReportId']=_0x2497cc[_0x9513('0x3e')]['id'];return _0x1c1961;});return db[_0x9513('0x26')][_0x9513('0x41')](_0x28097a,{'transaction':_0xa61c4e});});})[_0x9513('0x21')](function(){return db['AnalyticFieldReport']['findAll']({'where':{'CustomReportId':_0x2497cc[_0x9513('0x3e')]['id']}});});}})['then'](respondWithResult(_0xc37475,null))[_0x9513('0x3d')](handleError(_0xc37475,null));};
\ No newline at end of file
+var _0xe30f=['length','order','sort','filter','where','merge','VIRTUAL','options','AnalyticFieldReport','includeAll','include','findAll','rows','show','params','catch','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','eml-format','zip-dir','moment','bluebird','util','path','sox','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','offset','undefined','limit','count','status','Content-Range','json','apply','reject','update','destroy','then','stack','name','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe30f,0x15c));var _0xfe30=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xe30f[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0xfe30('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfe30('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe30('0x2'));var BPromise=require(_0xfe30('0x3'));var Mustache=require('mustache');var util=require(_0xfe30('0x4'));var path=require(_0xfe30('0x5'));var sox=require(_0xfe30('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfe30('0x7'));var _=require(_0xfe30('0x8'));var squel=require(_0xfe30('0x9'));var crypto=require(_0xfe30('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xfe30('0xb'));var toCsv=require(_0xfe30('0xc'));var querystring=require(_0xfe30('0xd'));var Papa=require('papaparse');var Redis=require(_0xfe30('0xe'));var authService=require(_0xfe30('0xf'));var qs=require(_0xfe30('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe30('0x11'));var logger=require(_0xfe30('0x12'))('api');var utils=require(_0xfe30('0x13'));var config=require(_0xfe30('0x14'));var licenseUtil=require(_0xfe30('0x15'));var db=require(_0xfe30('0x16'))['db'];function respondWithStatusCode(_0xd0f76f,_0x10710f){_0x10710f=_0x10710f||0xcc;return function(_0x2f17a1){if(_0x2f17a1){return _0xd0f76f[_0xfe30('0x17')](_0x10710f);}return _0xd0f76f['status'](_0x10710f)[_0xfe30('0x18')]();};}function respondWithResult(_0x3c52ed,_0x23638b){_0x23638b=_0x23638b||0xc8;return function(_0xfb5124){if(_0xfb5124){return _0x3c52ed['status'](_0x23638b)['json'](_0xfb5124);}};}function respondWithFilteredResult(_0x1e43ca,_0x47fbd6){return function(_0xdbc826){if(_0xdbc826){var _0x410fe3=typeof _0x47fbd6[_0xfe30('0x19')]===_0xfe30('0x1a')&&typeof _0x47fbd6[_0xfe30('0x1b')]===_0xfe30('0x1a');var _0x143144=_0xdbc826[_0xfe30('0x1c')];var _0x21b5ed=_0x410fe3?0x0:_0x47fbd6[_0xfe30('0x19')];var _0x47e21c=_0x410fe3?_0xdbc826['count']:_0x47fbd6['offset']+_0x47fbd6['limit'];var _0xe4dae4;if(_0x47e21c>=_0x143144){_0x47e21c=_0x143144;_0xe4dae4=0xc8;}else{_0xe4dae4=0xce;}_0x1e43ca[_0xfe30('0x1d')](_0xe4dae4);return _0x1e43ca['set'](_0xfe30('0x1e'),_0x21b5ed+'-'+_0x47e21c+'/'+_0x143144)[_0xfe30('0x1f')](_0xdbc826);}return null;};}function patchUpdates(_0x133a4d){return function(_0x2b85d9){try{jsonpatch[_0xfe30('0x20')](_0x2b85d9,_0x133a4d,!![]);}catch(_0x34ea1d){return BPromise[_0xfe30('0x21')](_0x34ea1d);}return _0x2b85d9['save']();};}function saveUpdates(_0x946589,_0x5d6be6){return function(_0x34800a){if(_0x34800a){return _0x34800a[_0xfe30('0x22')](_0x946589)['then'](function(_0x5fe62){return _0x5fe62;});}return null;};}function removeEntity(_0x5f1acd,_0x354006){return function(_0x152a39){if(_0x152a39){return _0x152a39[_0xfe30('0x23')]()[_0xfe30('0x24')](function(){_0x5f1acd[_0xfe30('0x1d')](0xcc)[_0xfe30('0x18')]();});}};}function handleEntityNotFound(_0x4763bd,_0x54e3ce){return function(_0x5a6d02){if(!_0x5a6d02){_0x4763bd[_0xfe30('0x17')](0x194);}return _0x5a6d02;};}function handleError(_0x26682a,_0x295040){_0x295040=_0x295040||0x1f4;return function(_0x57b8a6){logger['error'](_0x57b8a6[_0xfe30('0x25')]);if(_0x57b8a6[_0xfe30('0x26')]){delete _0x57b8a6[_0xfe30('0x26')];}_0x26682a[_0xfe30('0x1d')](_0x295040)['send'](_0x57b8a6);};}exports[_0xfe30('0x27')]=function(_0x5bf253,_0x5646c2){var _0x16747e={},_0x22878d={},_0x35326c={'count':0x0,'rows':[]};var _0x426c6e=_[_0xfe30('0x28')](db['AnalyticFieldReport'][_0xfe30('0x29')],function(_0x4a80c1){return{'name':_0x4a80c1[_0xfe30('0x2a')],'type':_0x4a80c1[_0xfe30('0x2b')][_0xfe30('0x2c')]};});_0x22878d['model']=_[_0xfe30('0x28')](_0x426c6e,_0xfe30('0x26'));_0x22878d['query']=_[_0xfe30('0x2d')](_0x5bf253['query']);_0x22878d[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x22878d[_0xfe30('0x30')],_0x22878d[_0xfe30('0x31')]);_0x16747e[_0xfe30('0x32')]=_['intersection'](_0x22878d['model'],qs['fields'](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x33')]));_0x16747e[_0xfe30('0x32')]=_0x16747e[_0xfe30('0x32')][_0xfe30('0x34')]?_0x16747e[_0xfe30('0x32')]:_0x22878d[_0xfe30('0x30')];if(!_0x5bf253[_0xfe30('0x31')]['hasOwnProperty']('nolimit')){_0x16747e[_0xfe30('0x1b')]=qs[_0xfe30('0x1b')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x1b')]);_0x16747e[_0xfe30('0x19')]=qs[_0xfe30('0x19')](_0x5bf253[_0xfe30('0x31')][_0xfe30('0x19')]);}_0x16747e[_0xfe30('0x35')]=qs[_0xfe30('0x36')](_0x5bf253[_0xfe30('0x31')]['sort']);_0x16747e['where']=qs[_0xfe30('0x2e')](_['pick'](_0x5bf253[_0xfe30('0x31')],_0x22878d['filters']),_0x426c6e);if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x37')]){_0x16747e[_0xfe30('0x38')]=_[_0xfe30('0x39')](_0x16747e['where'],{'$or':_[_0xfe30('0x28')](_0x426c6e,function(_0x99a5d9){if(_0x99a5d9[_0xfe30('0x2b')]!==_0xfe30('0x3a')){var _0x5e657b={};_0x5e657b[_0x99a5d9['name']]={'$like':'%'+_0x5bf253['query'][_0xfe30('0x37')]+'%'};return _0x5e657b;}})});}_0x16747e=_[_0xfe30('0x39')]({},_0x16747e,_0x5bf253[_0xfe30('0x3b')]);var _0x4b81ac={'where':_0x16747e[_0xfe30('0x38')]};return db[_0xfe30('0x3c')]['count'](_0x4b81ac)[_0xfe30('0x24')](function(_0x92c9b4){_0x35326c[_0xfe30('0x1c')]=_0x92c9b4;if(_0x5bf253[_0xfe30('0x31')][_0xfe30('0x3d')]){_0x16747e[_0xfe30('0x3e')]=[{'all':!![]}];}return db[_0xfe30('0x3c')][_0xfe30('0x3f')](_0x16747e);})[_0xfe30('0x24')](function(_0x500310){_0x35326c[_0xfe30('0x40')]=_0x500310;return _0x35326c;})[_0xfe30('0x24')](respondWithFilteredResult(_0x5646c2,_0x16747e))['catch'](handleError(_0x5646c2,null));};exports[_0xfe30('0x41')]=function(_0x19663a,_0x3cd371){var _0x19f813={'raw':![],'where':{'id':_0x19663a[_0xfe30('0x42')]['id']}},_0x33a11b={};_0x33a11b[_0xfe30('0x30')]=_[_0xfe30('0x2d')](db[_0xfe30('0x3c')][_0xfe30('0x29')]);_0x33a11b['query']=_[_0xfe30('0x2d')](_0x19663a['query']);_0x33a11b[_0xfe30('0x2e')]=_[_0xfe30('0x2f')](_0x33a11b['model'],_0x33a11b[_0xfe30('0x31')]);_0x19f813[_0xfe30('0x32')]=_[_0xfe30('0x2f')](_0x33a11b[_0xfe30('0x30')],qs['fields'](_0x19663a[_0xfe30('0x31')]['fields']));_0x19f813[_0xfe30('0x32')]=_0x19f813['attributes']['length']?_0x19f813[_0xfe30('0x32')]:_0x33a11b[_0xfe30('0x30')];if(_0x19663a['query'][_0xfe30('0x3d')]){_0x19f813['include']=[{'all':!![]}];}_0x19f813=_['merge']({},_0x19f813,_0x19663a[_0xfe30('0x3b')]);return db[_0xfe30('0x3c')]['find'](_0x19f813)['then'](handleEntityNotFound(_0x3cd371,null))[_0xfe30('0x24')](respondWithResult(_0x3cd371,null))[_0xfe30('0x43')](handleError(_0x3cd371,null));};exports[_0xfe30('0x44')]=function(_0x4e6dff,_0x2ce642){return db[_0xfe30('0x3c')][_0xfe30('0x44')](_0x4e6dff[_0xfe30('0x45')],{})[_0xfe30('0x24')](respondWithResult(_0x2ce642,0xc9))[_0xfe30('0x43')](handleError(_0x2ce642,null));};exports[_0xfe30('0x46')]=function(_0x187486,_0x2c9500){return db[_0xfe30('0x3c')][_0xfe30('0x46')](_0x187486[_0xfe30('0x45')],{'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x2c9500,0xc9))[_0xfe30('0x43')](handleError(_0x2c9500,null));};exports[_0xfe30('0x22')]=function(_0x2f5f25,_0x43d682){if(_0x2f5f25[_0xfe30('0x45')]['id']){delete _0x2f5f25[_0xfe30('0x45')]['id'];}return db[_0xfe30('0x3c')][_0xfe30('0x47')]({'where':{'id':_0x2f5f25[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x43d682,null))[_0xfe30('0x24')](saveUpdates(_0x2f5f25['body'],null))['then'](respondWithResult(_0x43d682,null))[_0xfe30('0x43')](handleError(_0x43d682,null));};exports[_0xfe30('0x23')]=function(_0x3d535d,_0x1871c1){return db['AnalyticFieldReport'][_0xfe30('0x47')]({'where':{'id':_0x3d535d[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1871c1,null))[_0xfe30('0x24')](removeEntity(_0x1871c1,null))[_0xfe30('0x43')](handleError(_0x1871c1,null));};exports[_0xfe30('0x48')]=function(_0x211514,_0x1f29ad){return db['AnalyticFieldReport'][_0xfe30('0x23')]({'where':{'id':_0x211514[_0xfe30('0x31')][_0xfe30('0x49')]||[]},'raw':![],'individualHooks':!![]})[_0xfe30('0x24')](respondWithResult(_0x1f29ad,0xcc))['catch'](handleError(_0x1f29ad,null));};exports[_0xfe30('0x4a')]=function(_0xc61b6f,_0x1b9631,_0x2f6299){return db[_0xfe30('0x4b')][_0xfe30('0x4c')]({'where':{'id':_0xc61b6f[_0xfe30('0x42')]['id']}})[_0xfe30('0x24')](handleEntityNotFound(_0x1b9631,null))['then'](function(_0x2ef5ab){if(_0x2ef5ab){return db[_0xfe30('0x4d')][_0xfe30('0x4e')](function(_0x5527ba){return db[_0xfe30('0x3c')]['destroy']({'where':{'CustomReportId':_0xc61b6f['params']['id']},'transaction':_0x5527ba})['then'](function(_0x40180e){var _0x54cd13=_['map'](_0xc61b6f['body'],function(_0x15f216){delete _0x15f216['id'];_0x15f216[_0xfe30('0x4f')]=_0xc61b6f[_0xfe30('0x42')]['id'];return _0x15f216;});return db['AnalyticFieldReport'][_0xfe30('0x46')](_0x54cd13,{'transaction':_0x5527ba});});})['then'](function(){return db['AnalyticFieldReport'][_0xfe30('0x3f')]({'where':{'CustomReportId':_0xc61b6f[_0xfe30('0x42')]['id']}});});}})[_0xfe30('0x24')](respondWithResult(_0x1b9631,null))[_0xfe30('0x43')](handleError(_0x1b9631,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 127b43f..aef0bf5 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 _0x9060=['../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5270ee,_0x4fe7a3){var _0x21fecb=function(_0x3602be){while(--_0x3602be){_0x5270ee['push'](_0x5270ee['shift']());}};_0x21fecb(++_0x4fe7a3);}(_0x9060,0x130));var _0x0906=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0x9060[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0x0906('0x0'));var util=require('util');var logger=require(_0x0906('0x1'))(_0x0906('0x2'));var moment=require(_0x0906('0x3'));var BPromise=require(_0x0906('0x4'));var rp=require(_0x0906('0x5'));var fs=require('fs');var path=require(_0x0906('0x6'));var rimraf=require(_0x0906('0x7'));var config=require(_0x0906('0x8'));var attributes=require(_0x0906('0x9'));module['exports']=function(_0x1a4f22,_0x53007c){return _0x1a4f22['define'](_0x0906('0xa'),attributes,{'tableName':_0x0906('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x77bb=['api','request-promise','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger'];(function(_0x27fe0f,_0x39cb63){var _0x28b7d3=function(_0x52be6f){while(--_0x52be6f){_0x27fe0f['push'](_0x27fe0f['shift']());}};_0x28b7d3(++_0x39cb63);}(_0x77bb,0xbb));var _0xb77b=function(_0x145cf3,_0x3bf0da){_0x145cf3=_0x145cf3-0x0;var _0x5db0bf=_0x77bb[_0x145cf3];return _0x5db0bf;};'use strict';var _=require(_0xb77b('0x0'));var util=require(_0xb77b('0x1'));var logger=require(_0xb77b('0x2'))(_0xb77b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb77b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xb77b('0x5'));var attributes=require(_0xb77b('0x6'));module[_0xb77b('0x7')]=function(_0x41d3f6,_0x276c50){return _0x41d3f6['define'](_0xb77b('0x8'),attributes,{'tableName':_0xb77b('0x9'),'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 deb2187..edb6004 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 _0xba47=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x26a3f9,_0x275fe9){var _0x37a62f=function(_0x2f078f){while(--_0x2f078f){_0x26a3f9['push'](_0x26a3f9['shift']());}};_0x37a62f(++_0x275fe9);}(_0xba47,0xa8));var _0x7ba4=function(_0x533d3c,_0x326c9f){_0x533d3c=_0x533d3c-0x0;var _0x4cd573=_0xba47[_0x533d3c];return _0x4cd573;};'use strict';var _=require(_0x7ba4('0x0'));var util=require(_0x7ba4('0x1'));var moment=require(_0x7ba4('0x2'));var BPromise=require(_0x7ba4('0x3'));var rs=require(_0x7ba4('0x4'));var fs=require('fs');var Redis=require(_0x7ba4('0x5'));var db=require(_0x7ba4('0x6'))['db'];var utils=require(_0x7ba4('0x7'));var logger=require('../../config/logger')(_0x7ba4('0x8'));var config=require(_0x7ba4('0x9'));var jayson=require(_0x7ba4('0xa'));var client=jayson[_0x7ba4('0xb')][_0x7ba4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ed4f1,_0x4db0cc,_0x48a42b){return new BPromise(function(_0x52db60,_0x4571a4){return client[_0x7ba4('0xd')](_0x3ed4f1,_0x48a42b)[_0x7ba4('0xe')](function(_0x22f14f){logger[_0x7ba4('0xf')](_0x7ba4('0x10'),_0x4db0cc,_0x7ba4('0x11'));logger[_0x7ba4('0x12')](_0x7ba4('0x13'),_0x4db0cc,_0x7ba4('0x11'),JSON[_0x7ba4('0x14')](_0x22f14f));if(_0x22f14f[_0x7ba4('0x15')]){if(_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x16')]===0x1f4){logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);return _0x4571a4(_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);}logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x22f14f[_0x7ba4('0x15')][_0x7ba4('0x17')]);return _0x52db60(_0x22f14f['error'][_0x7ba4('0x17')]);}else{logger['info'](_0x7ba4('0x10'),_0x4db0cc,'request\x20sent');_0x52db60(_0x22f14f[_0x7ba4('0x18')][_0x7ba4('0x17')]);}})[_0x7ba4('0x19')](function(_0x21c035){logger[_0x7ba4('0x15')](_0x7ba4('0x10'),_0x4db0cc,_0x21c035);_0x4571a4(_0x21c035);});});}
\ No newline at end of file
+var _0xfeca=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x3007b2,_0x4d0027){var _0x4597a9=function(_0x493679){while(--_0x493679){_0x3007b2['push'](_0x3007b2['shift']());}};_0x4597a9(++_0x4d0027);}(_0xfeca,0xf4));var _0xafec=function(_0x1866b7,_0x243cf7){_0x1866b7=_0x1866b7-0x0;var _0x5a0a82=_0xfeca[_0x1866b7];return _0x5a0a82;};'use strict';var _=require(_0xafec('0x0'));var util=require(_0xafec('0x1'));var moment=require(_0xafec('0x2'));var BPromise=require(_0xafec('0x3'));var rs=require(_0xafec('0x4'));var fs=require('fs');var Redis=require(_0xafec('0x5'));var db=require(_0xafec('0x6'))['db'];var utils=require(_0xafec('0x7'));var logger=require('../../config/logger')(_0xafec('0x8'));var config=require(_0xafec('0x9'));var jayson=require(_0xafec('0xa'));var client=jayson[_0xafec('0xb')][_0xafec('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d9b88,_0x4080ea,_0x1248e9){return new BPromise(function(_0x1561be,_0xf6561b){return client[_0xafec('0xd')](_0x1d9b88,_0x1248e9)['then'](function(_0xe7c737){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0xafec('0xe'));logger['debug'](_0xafec('0xf'),_0x4080ea,_0xafec('0xe'),JSON[_0xafec('0x10')](_0xe7c737));if(_0xe7c737[_0xafec('0x11')]){if(_0xe7c737[_0xafec('0x11')][_0xafec('0x12')]===0x1f4){logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737['error']['message']);return _0xf6561b(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}logger['error'](_0xafec('0x13'),_0x4080ea,_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);return _0x1561be(_0xe7c737[_0xafec('0x11')][_0xafec('0x14')]);}else{logger[_0xafec('0x15')](_0xafec('0x13'),_0x4080ea,_0xafec('0xe'));_0x1561be(_0xe7c737[_0xafec('0x16')]['message']);}})[_0xafec('0x17')](function(_0x5331dc){logger[_0xafec('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4080ea,_0x5331dc);_0xf6561b(_0x5331dc);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index f31ff61..38d837c 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(_0x185ca0,_0x548954){var _0x40f97c=function(_0x356a64){while(--_0x356a64){_0x185ca0['push'](_0x185ca0['shift']());}};_0x40f97c(++_0x548954);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'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(_0x974a42,_0x509392){var _0x1b801c=function(_0x37bb44){while(--_0x37bb44){_0x974a42['push'](_0x974a42['shift']());}};_0x1b801c(++_0x509392);}(_0xa9e0,0x123));var _0x0a9e=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xa9e0[_0x481bf7];return _0x461787;};'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 d96cfed..7b97241 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 _0x37e9=['name','TEXT','sequelize','exports','STRING'];(function(_0x33396e,_0x4412a2){var _0x3be463=function(_0x306fb3){while(--_0x306fb3){_0x33396e['push'](_0x33396e['shift']());}};_0x3be463(++_0x4412a2);}(_0x37e9,0x1e7));var _0x937e=function(_0x11d477,_0x20cb6f){_0x11d477=_0x11d477-0x0;var _0x38d88e=_0x37e9[_0x11d477];return _0x38d88e;};'use strict';var Sequelize=require(_0x937e('0x0'));module[_0x937e('0x1')]={'name':{'type':Sequelize[_0x937e('0x2')],'allowNull':![],'unique':_0x937e('0x3')},'table':{'type':Sequelize[_0x937e('0x2')]},'metric':{'type':Sequelize[_0x937e('0x4')]},'description':{'type':Sequelize[_0x937e('0x2')]}};
\ No newline at end of file
+var _0xd757=['name','sequelize','exports','STRING'];(function(_0x187e2c,_0x1f0899){var _0x214c94=function(_0x51325c){while(--_0x51325c){_0x187e2c['push'](_0x187e2c['shift']());}};_0x214c94(++_0x1f0899);}(_0xd757,0x1e5));var _0x7d75=function(_0x46c6b5,_0x23f130){_0x46c6b5=_0x46c6b5-0x0;var _0x429113=_0xd757[_0x46c6b5];return _0x429113;};'use strict';var Sequelize=require(_0x7d75('0x0'));module[_0x7d75('0x1')]={'name':{'type':Sequelize[_0x7d75('0x2')],'allowNull':![],'unique':_0x7d75('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x7d75('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 3535f3b..1564b10 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 _0x9a19=['AnalyticMetric','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','find','body','user','UserProfileSection','autoAssociation','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','save','then','destroy','get','Metrics','stack','name','send','index','map'];(function(_0x5b03a6,_0x192292){var _0x5900fa=function(_0x6d8a00){while(--_0x6d8a00){_0x5b03a6['push'](_0x5b03a6['shift']());}};_0x5900fa(++_0x192292);}(_0x9a19,0x114));var _0x99a1=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x9a19[_0xbb14db];return _0x36bed7;};'use strict';var emlformat=require(_0x99a1('0x0'));var rimraf=require(_0x99a1('0x1'));var zipdir=require(_0x99a1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x99a1('0x3'));var moment=require(_0x99a1('0x4'));var BPromise=require(_0x99a1('0x5'));var Mustache=require(_0x99a1('0x6'));var util=require(_0x99a1('0x7'));var path=require(_0x99a1('0x8'));var sox=require(_0x99a1('0x9'));var csv=require(_0x99a1('0xa'));var ejs=require(_0x99a1('0xb'));var fs=require('fs');var fs_extra=require(_0x99a1('0xc'));var _=require(_0x99a1('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x99a1('0xe'));var toCsv=require(_0x99a1('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x99a1('0xf'));var authService=require(_0x99a1('0x10'));var qs=require(_0x99a1('0x11'));var as=require(_0x99a1('0x12'));var hardwareService=require(_0x99a1('0x13'));var logger=require('../../config/logger')(_0x99a1('0x14'));var utils=require(_0x99a1('0x15'));var config=require(_0x99a1('0x16'));var licenseUtil=require(_0x99a1('0x17'));var db=require(_0x99a1('0x18'))['db'];function respondWithStatusCode(_0x1bc7aa,_0x2ff655){_0x2ff655=_0x2ff655||0xcc;return function(_0x532f56){if(_0x532f56){return _0x1bc7aa[_0x99a1('0x19')](_0x2ff655);}return _0x1bc7aa[_0x99a1('0x1a')](_0x2ff655)[_0x99a1('0x1b')]();};}function respondWithResult(_0x47815e,_0xe1a1f){_0xe1a1f=_0xe1a1f||0xc8;return function(_0x3c9ef4){if(_0x3c9ef4){return _0x47815e[_0x99a1('0x1a')](_0xe1a1f)['json'](_0x3c9ef4);}};}function respondWithFilteredResult(_0x2d81ed,_0x3e45d4){return function(_0x1bb464){if(_0x1bb464){var _0x3d40cc=typeof _0x3e45d4[_0x99a1('0x1c')]===_0x99a1('0x1d')&&typeof _0x3e45d4[_0x99a1('0x1e')]==='undefined';var _0x4f049c=_0x1bb464[_0x99a1('0x1f')];var _0xbf62f1=_0x3d40cc?0x0:_0x3e45d4[_0x99a1('0x1c')];var _0x1fcd00=_0x3d40cc?_0x1bb464[_0x99a1('0x1f')]:_0x3e45d4[_0x99a1('0x1c')]+_0x3e45d4[_0x99a1('0x1e')];var _0x3cd62c;if(_0x1fcd00>=_0x4f049c){_0x1fcd00=_0x4f049c;_0x3cd62c=0xc8;}else{_0x3cd62c=0xce;}_0x2d81ed[_0x99a1('0x1a')](_0x3cd62c);return _0x2d81ed[_0x99a1('0x20')](_0x99a1('0x21'),_0xbf62f1+'-'+_0x1fcd00+'/'+_0x4f049c)['json'](_0x1bb464);}return null;};}function patchUpdates(_0x3023a1){return function(_0x20007e){try{jsonpatch['apply'](_0x20007e,_0x3023a1,!![]);}catch(_0x38435b){return BPromise['reject'](_0x38435b);}return _0x20007e[_0x99a1('0x22')]();};}function saveUpdates(_0x2927b0,_0x2d6f20){return function(_0x2d3b82){if(_0x2d3b82){return _0x2d3b82['update'](_0x2927b0)[_0x99a1('0x23')](function(_0x1268a7){return _0x1268a7;});}return null;};}function removeEntity(_0x483c17,_0x44df2d){return function(_0x5b5dfa){if(_0x5b5dfa){return _0x5b5dfa[_0x99a1('0x24')]()[_0x99a1('0x23')](function(){var _0x179597=_0x5b5dfa[_0x99a1('0x25')]({'plain':!![]});var _0x3c813=_0x99a1('0x26');return db['UserProfileResource'][_0x99a1('0x24')]({'where':{'type':_0x3c813,'resourceId':_0x179597['id']}})['then'](function(){return _0x5b5dfa;});})['then'](function(){_0x483c17[_0x99a1('0x1a')](0xcc)[_0x99a1('0x1b')]();});}};}function handleEntityNotFound(_0xa6799b,_0x15a0b6){return function(_0x25d560){if(!_0x25d560){_0xa6799b[_0x99a1('0x19')](0x194);}return _0x25d560;};}function handleError(_0x183037,_0x549645){_0x549645=_0x549645||0x1f4;return function(_0xf41b0d){logger['error'](_0xf41b0d[_0x99a1('0x27')]);if(_0xf41b0d[_0x99a1('0x28')]){delete _0xf41b0d[_0x99a1('0x28')];}_0x183037['status'](_0x549645)[_0x99a1('0x29')](_0xf41b0d);};}exports[_0x99a1('0x2a')]=function(_0x5718b9,_0x37514e){var _0x1434a0={},_0x36aa34={},_0x303d1e={'count':0x0,'rows':[]};var _0x2a5b8c=_[_0x99a1('0x2b')](db[_0x99a1('0x2c')][_0x99a1('0x2d')],function(_0x52da8d){return{'name':_0x52da8d['fieldName'],'type':_0x52da8d[_0x99a1('0x2e')]['key']};});_0x36aa34[_0x99a1('0x2f')]=_[_0x99a1('0x2b')](_0x2a5b8c,'name');_0x36aa34[_0x99a1('0x30')]=_[_0x99a1('0x31')](_0x5718b9[_0x99a1('0x30')]);_0x36aa34[_0x99a1('0x32')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],_0x36aa34[_0x99a1('0x30')]);_0x1434a0[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x36aa34[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1434a0[_0x99a1('0x34')]=_0x1434a0['attributes']['length']?_0x1434a0[_0x99a1('0x34')]:_0x36aa34[_0x99a1('0x2f')];if(!_0x5718b9[_0x99a1('0x30')][_0x99a1('0x36')](_0x99a1('0x37'))){_0x1434a0[_0x99a1('0x1e')]=qs[_0x99a1('0x1e')](_0x5718b9['query'][_0x99a1('0x1e')]);_0x1434a0[_0x99a1('0x1c')]=qs['offset'](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x1c')]);}_0x1434a0[_0x99a1('0x38')]=qs[_0x99a1('0x39')](_0x5718b9[_0x99a1('0x30')][_0x99a1('0x39')]);_0x1434a0[_0x99a1('0x3a')]=qs[_0x99a1('0x32')](_[_0x99a1('0x3b')](_0x5718b9[_0x99a1('0x30')],_0x36aa34[_0x99a1('0x32')]),_0x2a5b8c);if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]){_0x1434a0['where']=_['merge'](_0x1434a0['where'],{'$or':_[_0x99a1('0x2b')](_0x2a5b8c,function(_0x169df7){if(_0x169df7[_0x99a1('0x2e')]!==_0x99a1('0x3d')){var _0x40613a={};_0x40613a[_0x169df7['name']]={'$like':'%'+_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3c')]+'%'};return _0x40613a;}})});}_0x1434a0=_[_0x99a1('0x3e')]({},_0x1434a0,_0x5718b9['options']);var _0x49be37={'where':_0x1434a0[_0x99a1('0x3a')]};return db[_0x99a1('0x2c')][_0x99a1('0x1f')](_0x49be37)['then'](function(_0x6c4cb){_0x303d1e[_0x99a1('0x1f')]=_0x6c4cb;if(_0x5718b9[_0x99a1('0x30')][_0x99a1('0x3f')]){_0x1434a0[_0x99a1('0x40')]=[{'all':!![]}];}return db[_0x99a1('0x2c')][_0x99a1('0x41')](_0x1434a0);})[_0x99a1('0x23')](function(_0x1c4ce4){_0x303d1e[_0x99a1('0x42')]=_0x1c4ce4;return _0x303d1e;})['then'](respondWithFilteredResult(_0x37514e,_0x1434a0))[_0x99a1('0x43')](handleError(_0x37514e,null));};exports[_0x99a1('0x44')]=function(_0x3d5373,_0x50d38b){var _0x1beed2={'raw':!![],'where':{'id':_0x3d5373[_0x99a1('0x45')]['id']}},_0x51536d={};_0x51536d[_0x99a1('0x2f')]=_[_0x99a1('0x31')](db[_0x99a1('0x2c')][_0x99a1('0x2d')]);_0x51536d[_0x99a1('0x30')]=_['keys'](_0x3d5373[_0x99a1('0x30')]);_0x51536d['filters']=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],_0x51536d[_0x99a1('0x30')]);_0x1beed2[_0x99a1('0x34')]=_[_0x99a1('0x33')](_0x51536d[_0x99a1('0x2f')],qs[_0x99a1('0x35')](_0x3d5373[_0x99a1('0x30')][_0x99a1('0x35')]));_0x1beed2[_0x99a1('0x34')]=_0x1beed2[_0x99a1('0x34')]['length']?_0x1beed2[_0x99a1('0x34')]:_0x51536d[_0x99a1('0x2f')];if(_0x3d5373['query'][_0x99a1('0x3f')]){_0x1beed2[_0x99a1('0x40')]=[{'all':!![]}];}_0x1beed2=_[_0x99a1('0x3e')]({},_0x1beed2,_0x3d5373[_0x99a1('0x46')]);return db[_0x99a1('0x2c')][_0x99a1('0x47')](_0x1beed2)[_0x99a1('0x23')](handleEntityNotFound(_0x50d38b,null))['then'](respondWithResult(_0x50d38b,null))[_0x99a1('0x43')](handleError(_0x50d38b,null));};exports['create']=function(_0x1d4d3f,_0x269798){return db['AnalyticMetric']['create'](_0x1d4d3f[_0x99a1('0x48')],{})[_0x99a1('0x23')](function(_0x462c15){var _0x4519fb=_0x1d4d3f[_0x99a1('0x49')]['get']({'plain':!![]});if(!_0x4519fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4519fb['role']===_0x99a1('0x49')){var _0x4ae90e=_0x462c15[_0x99a1('0x25')]({'plain':!![]});var _0x30fdfb=_0x99a1('0x26');return db[_0x99a1('0x4a')][_0x99a1('0x47')]({'where':{'name':_0x30fdfb,'userProfileId':_0x4519fb['userProfileId']},'raw':!![]})[_0x99a1('0x23')](function(_0x22bfd8){if(_0x22bfd8&&_0x22bfd8[_0x99a1('0x4b')]===0x0){return db['UserProfileResource'][_0x99a1('0x4c')]({'name':_0x4ae90e['name'],'resourceId':_0x4ae90e['id'],'type':_0x22bfd8['name'],'sectionId':_0x22bfd8['id']},{})[_0x99a1('0x23')](function(){return _0x462c15;});}else{return _0x462c15;}})[_0x99a1('0x43')](function(_0x1dd17b){logger[_0x99a1('0x4d')](_0x99a1('0x4e'),_0x1dd17b);throw _0x1dd17b;});}return _0x462c15;})[_0x99a1('0x23')](respondWithResult(_0x269798,0xc9))[_0x99a1('0x43')](handleError(_0x269798,null));};exports[_0x99a1('0x4f')]=function(_0x16641e,_0x53e9eb){if(_0x16641e[_0x99a1('0x48')]['id']){delete _0x16641e['body']['id'];}return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x16641e['params']['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x53e9eb,null))[_0x99a1('0x23')](saveUpdates(_0x16641e[_0x99a1('0x48')],null))[_0x99a1('0x23')](respondWithResult(_0x53e9eb,null))[_0x99a1('0x43')](handleError(_0x53e9eb,null));};exports[_0x99a1('0x24')]=function(_0x157c49,_0x1a5658){return db[_0x99a1('0x2c')][_0x99a1('0x47')]({'where':{'id':_0x157c49[_0x99a1('0x45')]['id']}})[_0x99a1('0x23')](handleEntityNotFound(_0x1a5658,null))['then'](removeEntity(_0x1a5658,null))['catch'](handleError(_0x1a5658,null));};
\ No newline at end of file
+var _0xdc97=['mustache','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','update','then','get','destroy','sendStatus','error','stack','name','send','AnalyticMetric','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','length','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','findAll','rows','catch','params','keys','fields','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Metrics','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','eml-format','rimraf','zip-dir','request-promise','bluebird'];(function(_0x55279e,_0x52184e){var _0x2690c6=function(_0x2269c0){while(--_0x2269c0){_0x55279e['push'](_0x55279e['shift']());}};_0x2690c6(++_0x52184e);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2f00d7,_0x80b5e9){_0x2f00d7=_0x2f00d7-0x0;var _0x49a48f=_0xdc97[_0x2f00d7];return _0x49a48f;};'use strict';var emlformat=require(_0x7dc9('0x0'));var rimraf=require(_0x7dc9('0x1'));var zipdir=require(_0x7dc9('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7dc9('0x3'));var moment=require('moment');var BPromise=require(_0x7dc9('0x4'));var Mustache=require(_0x7dc9('0x5'));var util=require('util');var path=require(_0x7dc9('0x6'));var sox=require(_0x7dc9('0x7'));var csv=require(_0x7dc9('0x8'));var ejs=require(_0x7dc9('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7dc9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7dc9('0xb'));var deskjs=require(_0x7dc9('0xc'));var toCsv=require(_0x7dc9('0x8'));var querystring=require(_0x7dc9('0xd'));var Papa=require(_0x7dc9('0xe'));var Redis=require('ioredis');var authService=require(_0x7dc9('0xf'));var qs=require(_0x7dc9('0x10'));var as=require(_0x7dc9('0x11'));var hardwareService=require(_0x7dc9('0x12'));var logger=require(_0x7dc9('0x13'))(_0x7dc9('0x14'));var utils=require(_0x7dc9('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x599ef1,_0x94c75a){_0x94c75a=_0x94c75a||0xcc;return function(_0x14e5db){if(_0x14e5db){return _0x599ef1['sendStatus'](_0x94c75a);}return _0x599ef1[_0x7dc9('0x16')](_0x94c75a)[_0x7dc9('0x17')]();};}function respondWithResult(_0xaadf2,_0xf37bc7){_0xf37bc7=_0xf37bc7||0xc8;return function(_0x31d43d){if(_0x31d43d){return _0xaadf2[_0x7dc9('0x16')](_0xf37bc7)['json'](_0x31d43d);}};}function respondWithFilteredResult(_0x3a54f2,_0x278191){return function(_0x1b0aa1){if(_0x1b0aa1){var _0x442819=typeof _0x278191[_0x7dc9('0x18')]===_0x7dc9('0x19')&&typeof _0x278191[_0x7dc9('0x1a')]===_0x7dc9('0x19');var _0x4778d5=_0x1b0aa1['count'];var _0x22577e=_0x442819?0x0:_0x278191['offset'];var _0x1f5906=_0x442819?_0x1b0aa1[_0x7dc9('0x1b')]:_0x278191['offset']+_0x278191[_0x7dc9('0x1a')];var _0x3b738a;if(_0x1f5906>=_0x4778d5){_0x1f5906=_0x4778d5;_0x3b738a=0xc8;}else{_0x3b738a=0xce;}_0x3a54f2[_0x7dc9('0x16')](_0x3b738a);return _0x3a54f2[_0x7dc9('0x1c')](_0x7dc9('0x1d'),_0x22577e+'-'+_0x1f5906+'/'+_0x4778d5)[_0x7dc9('0x1e')](_0x1b0aa1);}return null;};}function patchUpdates(_0x2dad65){return function(_0x2895f5){try{jsonpatch[_0x7dc9('0x1f')](_0x2895f5,_0x2dad65,!![]);}catch(_0x2b38d6){return BPromise['reject'](_0x2b38d6);}return _0x2895f5['save']();};}function saveUpdates(_0x12954f,_0x5981e2){return function(_0x596e0f){if(_0x596e0f){return _0x596e0f[_0x7dc9('0x20')](_0x12954f)[_0x7dc9('0x21')](function(_0x5e9525){return _0x5e9525;});}return null;};}function removeEntity(_0xffc080,_0x43d31f){return function(_0x41110a){if(_0x41110a){return _0x41110a['destroy']()[_0x7dc9('0x21')](function(){var _0x1e3a8d=_0x41110a[_0x7dc9('0x22')]({'plain':!![]});var _0x55a482='Metrics';return db['UserProfileResource'][_0x7dc9('0x23')]({'where':{'type':_0x55a482,'resourceId':_0x1e3a8d['id']}})[_0x7dc9('0x21')](function(){return _0x41110a;});})['then'](function(){_0xffc080['status'](0xcc)[_0x7dc9('0x17')]();});}};}function handleEntityNotFound(_0x5afb7d,_0x2d22eb){return function(_0x1c690b){if(!_0x1c690b){_0x5afb7d[_0x7dc9('0x24')](0x194);}return _0x1c690b;};}function handleError(_0x3e4102,_0xa2aaa9){_0xa2aaa9=_0xa2aaa9||0x1f4;return function(_0x450124){logger[_0x7dc9('0x25')](_0x450124[_0x7dc9('0x26')]);if(_0x450124[_0x7dc9('0x27')]){delete _0x450124[_0x7dc9('0x27')];}_0x3e4102[_0x7dc9('0x16')](_0xa2aaa9)[_0x7dc9('0x28')](_0x450124);};}exports['index']=function(_0x4e929c,_0x513dd6){var _0x49a4a5={},_0x4a68f0={},_0x553a03={'count':0x0,'rows':[]};var _0x58c4e8=_['map'](db[_0x7dc9('0x29')][_0x7dc9('0x2a')],function(_0x29dcef){return{'name':_0x29dcef[_0x7dc9('0x2b')],'type':_0x29dcef[_0x7dc9('0x2c')][_0x7dc9('0x2d')]};});_0x4a68f0['model']=_['map'](_0x58c4e8,'name');_0x4a68f0[_0x7dc9('0x2e')]=_['keys'](_0x4e929c[_0x7dc9('0x2e')]);_0x4a68f0[_0x7dc9('0x2f')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],_0x4a68f0[_0x7dc9('0x2e')]);_0x49a4a5[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0x4a68f0[_0x7dc9('0x31')],qs['fields'](_0x4e929c[_0x7dc9('0x2e')]['fields']));_0x49a4a5[_0x7dc9('0x32')]=_0x49a4a5[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x49a4a5[_0x7dc9('0x32')]:_0x4a68f0['model'];if(!_0x4e929c[_0x7dc9('0x2e')]['hasOwnProperty'](_0x7dc9('0x34'))){_0x49a4a5['limit']=qs['limit'](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x1a')]);_0x49a4a5[_0x7dc9('0x18')]=qs[_0x7dc9('0x18')](_0x4e929c['query'][_0x7dc9('0x18')]);}_0x49a4a5[_0x7dc9('0x35')]=qs[_0x7dc9('0x36')](_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x36')]);_0x49a4a5[_0x7dc9('0x37')]=qs[_0x7dc9('0x2f')](_[_0x7dc9('0x38')](_0x4e929c[_0x7dc9('0x2e')],_0x4a68f0[_0x7dc9('0x2f')]),_0x58c4e8);if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]){_0x49a4a5['where']=_[_0x7dc9('0x3a')](_0x49a4a5[_0x7dc9('0x37')],{'$or':_[_0x7dc9('0x3b')](_0x58c4e8,function(_0xfd2612){if(_0xfd2612['type']!==_0x7dc9('0x3c')){var _0x89db0e={};_0x89db0e[_0xfd2612[_0x7dc9('0x27')]]={'$like':'%'+_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x39')]+'%'};return _0x89db0e;}})});}_0x49a4a5=_[_0x7dc9('0x3a')]({},_0x49a4a5,_0x4e929c['options']);var _0x553230={'where':_0x49a4a5[_0x7dc9('0x37')]};return db[_0x7dc9('0x29')]['count'](_0x553230)[_0x7dc9('0x21')](function(_0x4a37ec){_0x553a03[_0x7dc9('0x1b')]=_0x4a37ec;if(_0x4e929c[_0x7dc9('0x2e')][_0x7dc9('0x3d')]){_0x49a4a5['include']=[{'all':!![]}];}return db[_0x7dc9('0x29')][_0x7dc9('0x3e')](_0x49a4a5);})[_0x7dc9('0x21')](function(_0x95513c){_0x553a03[_0x7dc9('0x3f')]=_0x95513c;return _0x553a03;})[_0x7dc9('0x21')](respondWithFilteredResult(_0x513dd6,_0x49a4a5))[_0x7dc9('0x40')](handleError(_0x513dd6,null));};exports['show']=function(_0x187aa6,_0x4f29b2){var _0x52d883={'raw':!![],'where':{'id':_0x187aa6[_0x7dc9('0x41')]['id']}},_0xcced6c={};_0xcced6c[_0x7dc9('0x31')]=_[_0x7dc9('0x42')](db[_0x7dc9('0x29')][_0x7dc9('0x2a')]);_0xcced6c[_0x7dc9('0x2e')]=_[_0x7dc9('0x42')](_0x187aa6[_0x7dc9('0x2e')]);_0xcced6c['filters']=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],_0xcced6c[_0x7dc9('0x2e')]);_0x52d883[_0x7dc9('0x32')]=_[_0x7dc9('0x30')](_0xcced6c[_0x7dc9('0x31')],qs['fields'](_0x187aa6[_0x7dc9('0x2e')][_0x7dc9('0x43')]));_0x52d883['attributes']=_0x52d883[_0x7dc9('0x32')][_0x7dc9('0x33')]?_0x52d883[_0x7dc9('0x32')]:_0xcced6c['model'];if(_0x187aa6[_0x7dc9('0x2e')]['includeAll']){_0x52d883['include']=[{'all':!![]}];}_0x52d883=_[_0x7dc9('0x3a')]({},_0x52d883,_0x187aa6[_0x7dc9('0x44')]);return db[_0x7dc9('0x29')]['find'](_0x52d883)['then'](handleEntityNotFound(_0x4f29b2,null))[_0x7dc9('0x21')](respondWithResult(_0x4f29b2,null))['catch'](handleError(_0x4f29b2,null));};exports[_0x7dc9('0x45')]=function(_0x4ab558,_0x5e2d59){return db[_0x7dc9('0x29')][_0x7dc9('0x45')](_0x4ab558[_0x7dc9('0x46')],{})[_0x7dc9('0x21')](function(_0x414bf4){var _0x113087=_0x4ab558[_0x7dc9('0x47')][_0x7dc9('0x22')]({'plain':!![]});if(!_0x113087)throw new Error(_0x7dc9('0x48'));if(_0x113087[_0x7dc9('0x49')]===_0x7dc9('0x47')){var _0x13580b=_0x414bf4[_0x7dc9('0x22')]({'plain':!![]});var _0x59be9b=_0x7dc9('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x59be9b,'userProfileId':_0x113087[_0x7dc9('0x4b')]},'raw':!![]})[_0x7dc9('0x21')](function(_0x40e382){if(_0x40e382&&_0x40e382[_0x7dc9('0x4c')]===0x0){return db[_0x7dc9('0x4d')]['create']({'name':_0x13580b[_0x7dc9('0x27')],'resourceId':_0x13580b['id'],'type':_0x40e382[_0x7dc9('0x27')],'sectionId':_0x40e382['id']},{})[_0x7dc9('0x21')](function(){return _0x414bf4;});}else{return _0x414bf4;}})['catch'](function(_0x341909){logger[_0x7dc9('0x25')](_0x7dc9('0x4e'),_0x341909);throw _0x341909;});}return _0x414bf4;})[_0x7dc9('0x21')](respondWithResult(_0x5e2d59,0xc9))[_0x7dc9('0x40')](handleError(_0x5e2d59,null));};exports[_0x7dc9('0x20')]=function(_0x593132,_0x366b8b){if(_0x593132[_0x7dc9('0x46')]['id']){delete _0x593132[_0x7dc9('0x46')]['id'];}return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x593132[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x366b8b,null))[_0x7dc9('0x21')](saveUpdates(_0x593132[_0x7dc9('0x46')],null))[_0x7dc9('0x21')](respondWithResult(_0x366b8b,null))[_0x7dc9('0x40')](handleError(_0x366b8b,null));};exports[_0x7dc9('0x23')]=function(_0x4fec6e,_0x1767b6){return db[_0x7dc9('0x29')][_0x7dc9('0x4f')]({'where':{'id':_0x4fec6e[_0x7dc9('0x41')]['id']}})[_0x7dc9('0x21')](handleEntityNotFound(_0x1767b6,null))['then'](removeEntity(_0x1767b6,null))[_0x7dc9('0x40')](handleError(_0x1767b6,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index c4fe35f..5a7e938 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 _0xfdbd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticMetric.attributes'];(function(_0xa1e3e3,_0x29fe0e){var _0xc980e9=function(_0x1f5adc){while(--_0x1f5adc){_0xa1e3e3['push'](_0xa1e3e3['shift']());}};_0xc980e9(++_0x29fe0e);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x65ff6c,_0x4c2da3){_0x65ff6c=_0x65ff6c-0x0;var _0x238215=_0xfdbd[_0x65ff6c];return _0x238215;};'use strict';var _=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var logger=require(_0xdfdb('0x2'))(_0xdfdb('0x3'));var moment=require(_0xdfdb('0x4'));var BPromise=require(_0xdfdb('0x5'));var rp=require(_0xdfdb('0x6'));var fs=require('fs');var path=require(_0xdfdb('0x7'));var rimraf=require(_0xdfdb('0x8'));var config=require('../../config/environment');var attributes=require(_0xdfdb('0x9'));module['exports']=function(_0x453ef6,_0x41bd5e){return _0x453ef6['define']('AnalyticMetric',attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9865=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','lodash','util'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x9865,0x1ba));var _0x5986=function(_0x2c2ab3,_0x593de1){_0x2c2ab3=_0x2c2ab3-0x0;var _0x1803f7=_0x9865[_0x2c2ab3];return _0x1803f7;};'use strict';var _=require(_0x5986('0x0'));var util=require(_0x5986('0x1'));var logger=require(_0x5986('0x2'))(_0x5986('0x3'));var moment=require(_0x5986('0x4'));var BPromise=require(_0x5986('0x5'));var rp=require(_0x5986('0x6'));var fs=require('fs');var path=require(_0x5986('0x7'));var rimraf=require(_0x5986('0x8'));var config=require(_0x5986('0x9'));var attributes=require('./analyticMetric.attributes');module[_0x5986('0xa')]=function(_0x35e6f8,_0x3ac862){return _0x35e6f8[_0x5986('0xb')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 1fdc7b8..78216a5 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 _0xa06e=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3578e0,_0x527708){var _0x9ba392=function(_0xc6b899){while(--_0xc6b899){_0x3578e0['push'](_0x3578e0['shift']());}};_0x9ba392(++_0x527708);}(_0xa06e,0xc2));var _0xea06=function(_0x13ef4f,_0x268dae){_0x13ef4f=_0x13ef4f-0x0;var _0x568fa4=_0xa06e[_0x13ef4f];return _0x568fa4;};'use strict';var _=require(_0xea06('0x0'));var util=require(_0xea06('0x1'));var moment=require(_0xea06('0x2'));var BPromise=require(_0xea06('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xea06('0x4'));var db=require(_0xea06('0x5'))['db'];var utils=require(_0xea06('0x6'));var logger=require(_0xea06('0x7'))(_0xea06('0x8'));var config=require('../../config/environment');var jayson=require(_0xea06('0x9'));var client=jayson[_0xea06('0xa')][_0xea06('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x272f72,_0x359741,_0x265c62){return new BPromise(function(_0x5ac911,_0x5ac6ca){return client['request'](_0x272f72,_0x265c62)['then'](function(_0x24f1ce){logger[_0xea06('0xc')](_0xea06('0xd'),_0x359741,_0xea06('0xe'));logger[_0xea06('0xf')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x359741,_0xea06('0xe'),JSON[_0xea06('0x10')](_0x24f1ce));if(_0x24f1ce[_0xea06('0x11')]){if(_0x24f1ce[_0xea06('0x11')][_0xea06('0x12')]===0x1f4){logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x24f1ce['error']['message']);return _0x5ac6ca(_0x24f1ce[_0xea06('0x11')][_0xea06('0x13')]);}logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x24f1ce['error']['message']);return _0x5ac911(_0x24f1ce[_0xea06('0x11')][_0xea06('0x13')]);}else{logger['info'](_0xea06('0xd'),_0x359741,_0xea06('0xe'));_0x5ac911(_0x24f1ce[_0xea06('0x14')][_0xea06('0x13')]);}})[_0xea06('0x15')](function(_0x465920){logger[_0xea06('0x11')](_0xea06('0xd'),_0x359741,_0x465920);_0x5ac6ca(_0x465920);});});}
\ No newline at end of file
+var _0x5552=['stringify','error','code','message','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x58c961,_0x15690a){var _0x1993bf=function(_0x5494e6){while(--_0x5494e6){_0x58c961['push'](_0x58c961['shift']());}};_0x1993bf(++_0x15690a);}(_0x5552,0x8a));var _0x2555=function(_0x352026,_0x14f939){_0x352026=_0x352026-0x0;var _0x1a3573=_0x5552[_0x352026];return _0x1a3573;};'use strict';var _=require(_0x2555('0x0'));var util=require(_0x2555('0x1'));var moment=require(_0x2555('0x2'));var BPromise=require(_0x2555('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2555('0x4'))['db'];var utils=require(_0x2555('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x2555('0x6'));var jayson=require(_0x2555('0x7'));var client=jayson['client'][_0x2555('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x32ad2c,_0x404070,_0x5c17e1){return new BPromise(function(_0x35c2f2,_0x23e68a){return client[_0x2555('0x9')](_0x32ad2c,_0x5c17e1)['then'](function(_0x440932){logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));logger[_0x2555('0xd')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x404070,_0x2555('0xc'),JSON[_0x2555('0xe')](_0x440932));if(_0x440932[_0x2555('0xf')]){if(_0x440932['error'][_0x2555('0x10')]===0x1f4){logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')]['message']);return _0x23e68a(_0x440932[_0x2555('0xf')][_0x2555('0x11')]);}logger['error'](_0x2555('0xb'),_0x404070,_0x440932[_0x2555('0xf')][_0x2555('0x11')]);return _0x35c2f2(_0x440932['error'][_0x2555('0x11')]);}else{logger[_0x2555('0xa')](_0x2555('0xb'),_0x404070,_0x2555('0xc'));_0x35c2f2(_0x440932['result']['message']);}})[_0x2555('0x12')](function(_0x4c09e3){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x404070,_0x4c09e3);_0x23e68a(_0x4c09e3);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index adbe4f2..232af2e 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 _0x4fd7=['fs-extra','../../components/auth/service','../../config/environment','get','index','isAuthenticated','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x17072e,_0x51728c){var _0x75baee=function(_0x14cb19){while(--_0x14cb19){_0x17072e['push'](_0x17072e['shift']());}};_0x75baee(++_0x51728c);}(_0x4fd7,0xe6));var _0x74fd=function(_0x528bf7,_0x2c17c5){_0x528bf7=_0x528bf7-0x0;var _0x45e043=_0x4fd7[_0x528bf7];return _0x45e043;};'use strict';var multer=require(_0x74fd('0x0'));var util=require(_0x74fd('0x1'));var path=require(_0x74fd('0x2'));var timeout=require(_0x74fd('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x74fd('0x4'));var auth=require(_0x74fd('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x74fd('0x6'));var controller=require('./analyticMetric.controller');router[_0x74fd('0x7')]('/',auth['isAuthenticated'](),controller[_0x74fd('0x8')]);router[_0x74fd('0x7')]('/:id',auth[_0x74fd('0x9')](),controller[_0x74fd('0xa')]);router['post']('/',auth[_0x74fd('0x9')](),controller[_0x74fd('0xb')]);router[_0x74fd('0xc')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0xe')]);router[_0x74fd('0xf')](_0x74fd('0xd'),auth[_0x74fd('0x9')](),controller[_0x74fd('0x10')]);module[_0x74fd('0x11')]=router;
\ No newline at end of file
+var _0xa4dc=['put','/:id','update','destroy','exports','multer','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get','isAuthenticated','show','post'];(function(_0x48ec16,_0x3536e0){var _0x272d42=function(_0x34051d){while(--_0x34051d){_0x48ec16['push'](_0x48ec16['shift']());}};_0x272d42(++_0x3536e0);}(_0xa4dc,0x16a));var _0xca4d=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0xa4dc[_0x8a969d];return _0x1d8dc7;};'use strict';var multer=require(_0xca4d('0x0'));var util=require(_0xca4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xca4d('0x2'));var router=express[_0xca4d('0x3')]();var fs_extra=require(_0xca4d('0x4'));var auth=require(_0xca4d('0x5'));var interaction=require(_0xca4d('0x6'));var config=require('../../config/environment');var controller=require(_0xca4d('0x7'));router[_0xca4d('0x8')]('/',auth[_0xca4d('0x9')](),controller['index']);router[_0xca4d('0x8')]('/:id',auth[_0xca4d('0x9')](),controller[_0xca4d('0xa')]);router[_0xca4d('0xb')]('/',auth[_0xca4d('0x9')](),controller['create']);router[_0xca4d('0xc')](_0xca4d('0xd'),auth['isAuthenticated'](),controller[_0xca4d('0xe')]);router['delete'](_0xca4d('0xd'),auth[_0xca4d('0x9')](),controller[_0xca4d('0xf')]);module[_0xca4d('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index bca9a9b..793ea75 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 _0x76b4=['sequelize','TEXT'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76b4,0x110));var _0x476b=function(_0x42be7f,_0x36f338){_0x42be7f=_0x42be7f-0x0;var _0x42c239=_0x76b4[_0x42be7f];return _0x42c239;};'use strict';var Sequelize=require(_0x476b('0x0'));module['exports']={'tree':{'type':Sequelize[_0x476b('0x1')],'allowNull':![]}};
\ No newline at end of file
+var _0x7be8=['sequelize','TEXT'];(function(_0x1c89c3,_0x3c2348){var _0x62d305=function(_0x5441a2){while(--_0x5441a2){_0x1c89c3['push'](_0x1c89c3['shift']());}};_0x62d305(++_0x3c2348);}(_0x7be8,0x80));var _0x87be=function(_0x555014,_0xf5b10b){_0x555014=_0x555014-0x0;var _0x2dbe09=_0x7be8[_0x555014];return _0x2dbe09;};'use strict';var Sequelize=require(_0x87be('0x0'));module['exports']={'tree':{'type':Sequelize[_0x87be('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 8f76c1a..97159ce 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 _0x024c=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','destroy','then','error','name','map','AnalyticTreeReport','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','show','params','keys','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel'];(function(_0x3198fd,_0x3729d8){var _0x2dd0b=function(_0x94b525){while(--_0x94b525){_0x3198fd['push'](_0x3198fd['shift']());}};_0x2dd0b(++_0x3729d8);}(_0x024c,0x113));var _0xc024=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x024c[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xc024('0x0'));var rimraf=require(_0xc024('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc024('0x2'));var rp=require(_0xc024('0x3'));var moment=require(_0xc024('0x4'));var BPromise=require(_0xc024('0x5'));var Mustache=require(_0xc024('0x6'));var util=require(_0xc024('0x7'));var path=require(_0xc024('0x8'));var sox=require(_0xc024('0x9'));var csv=require(_0xc024('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc024('0xb'));var squel=require(_0xc024('0xc'));var crypto=require(_0xc024('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc024('0xe'));var toCsv=require(_0xc024('0xa'));var querystring=require(_0xc024('0xf'));var Papa=require(_0xc024('0x10'));var Redis=require(_0xc024('0x11'));var authService=require(_0xc024('0x12'));var qs=require(_0xc024('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xc024('0x14'))(_0xc024('0x15'));var utils=require(_0xc024('0x16'));var config=require(_0xc024('0x17'));var licenseUtil=require(_0xc024('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x217646,_0x32e2af){_0x32e2af=_0x32e2af||0xcc;return function(_0x544a89){if(_0x544a89){return _0x217646[_0xc024('0x19')](_0x32e2af);}return _0x217646[_0xc024('0x1a')](_0x32e2af)[_0xc024('0x1b')]();};}function respondWithResult(_0x4a20a5,_0x2dcce1){_0x2dcce1=_0x2dcce1||0xc8;return function(_0x48086b){if(_0x48086b){return _0x4a20a5[_0xc024('0x1a')](_0x2dcce1)[_0xc024('0x1c')](_0x48086b);}};}function respondWithFilteredResult(_0x10fb89,_0x379dc3){return function(_0xf95cf){if(_0xf95cf){var _0x40ca26=typeof _0x379dc3[_0xc024('0x1d')]===_0xc024('0x1e')&&typeof _0x379dc3[_0xc024('0x1f')]===_0xc024('0x1e');var _0x50506a=_0xf95cf['count'];var _0x79a9c8=_0x40ca26?0x0:_0x379dc3[_0xc024('0x1d')];var _0x47b396=_0x40ca26?_0xf95cf[_0xc024('0x20')]:_0x379dc3[_0xc024('0x1d')]+_0x379dc3[_0xc024('0x1f')];var _0xf3d1ed;if(_0x47b396>=_0x50506a){_0x47b396=_0x50506a;_0xf3d1ed=0xc8;}else{_0xf3d1ed=0xce;}_0x10fb89['status'](_0xf3d1ed);return _0x10fb89[_0xc024('0x21')](_0xc024('0x22'),_0x79a9c8+'-'+_0x47b396+'/'+_0x50506a)[_0xc024('0x1c')](_0xf95cf);}return null;};}function patchUpdates(_0x1e9a78){return function(_0xa49142){try{jsonpatch['apply'](_0xa49142,_0x1e9a78,!![]);}catch(_0x546396){return BPromise['reject'](_0x546396);}return _0xa49142[_0xc024('0x23')]();};}function saveUpdates(_0x469237,_0x33b953){return function(_0x4d1a1c){if(_0x4d1a1c){return _0x4d1a1c[_0xc024('0x24')](_0x469237)['then'](function(_0x4c1931){return _0x4c1931;});}return null;};}function removeEntity(_0x3f6f81,_0x2c11e5){return function(_0x557b7f){if(_0x557b7f){return _0x557b7f[_0xc024('0x25')]()[_0xc024('0x26')](function(){_0x3f6f81[_0xc024('0x1a')](0xcc)[_0xc024('0x1b')]();});}};}function handleEntityNotFound(_0x513bc1,_0x18db9b){return function(_0x52f500){if(!_0x52f500){_0x513bc1[_0xc024('0x19')](0x194);}return _0x52f500;};}function handleError(_0x2c2888,_0x3df63d){_0x3df63d=_0x3df63d||0x1f4;return function(_0x118624){logger[_0xc024('0x27')](_0x118624['stack']);if(_0x118624[_0xc024('0x28')]){delete _0x118624[_0xc024('0x28')];}_0x2c2888[_0xc024('0x1a')](_0x3df63d)['send'](_0x118624);};}exports['index']=function(_0xfb4c64,_0x106748){var _0x4c5e38={},_0x31821c={},_0x519d4d={'count':0x0,'rows':[]};var _0x36c2a4=_[_0xc024('0x29')](db[_0xc024('0x2a')]['rawAttributes'],function(_0x19c866){return{'name':_0x19c866[_0xc024('0x2b')],'type':_0x19c866['type'][_0xc024('0x2c')]};});_0x31821c[_0xc024('0x2d')]=_[_0xc024('0x29')](_0x36c2a4,_0xc024('0x28'));_0x31821c['query']=_['keys'](_0xfb4c64[_0xc024('0x2e')]);_0x31821c[_0xc024('0x2f')]=_[_0xc024('0x30')](_0x31821c[_0xc024('0x2d')],_0x31821c[_0xc024('0x2e')]);_0x4c5e38[_0xc024('0x31')]=_['intersection'](_0x31821c[_0xc024('0x2d')],qs[_0xc024('0x32')](_0xfb4c64[_0xc024('0x2e')]['fields']));_0x4c5e38[_0xc024('0x31')]=_0x4c5e38[_0xc024('0x31')][_0xc024('0x33')]?_0x4c5e38['attributes']:_0x31821c[_0xc024('0x2d')];if(!_0xfb4c64[_0xc024('0x2e')][_0xc024('0x34')](_0xc024('0x35'))){_0x4c5e38['limit']=qs['limit'](_0xfb4c64['query'][_0xc024('0x1f')]);_0x4c5e38[_0xc024('0x1d')]=qs[_0xc024('0x1d')](_0xfb4c64[_0xc024('0x2e')]['offset']);}_0x4c5e38['order']=qs[_0xc024('0x36')](_0xfb4c64[_0xc024('0x2e')]['sort']);_0x4c5e38[_0xc024('0x37')]=qs[_0xc024('0x2f')](_[_0xc024('0x38')](_0xfb4c64['query'],_0x31821c[_0xc024('0x2f')]),_0x36c2a4);if(_0xfb4c64[_0xc024('0x2e')][_0xc024('0x39')]){_0x4c5e38[_0xc024('0x37')]=_['merge'](_0x4c5e38[_0xc024('0x37')],{'$or':_[_0xc024('0x29')](_0x36c2a4,function(_0x5d372e){if(_0x5d372e[_0xc024('0x3a')]!==_0xc024('0x3b')){var _0x55fb4c={};_0x55fb4c[_0x5d372e[_0xc024('0x28')]]={'$like':'%'+_0xfb4c64['query'][_0xc024('0x39')]+'%'};return _0x55fb4c;}})});}_0x4c5e38=_[_0xc024('0x3c')]({},_0x4c5e38,_0xfb4c64[_0xc024('0x3d')]);var _0x1ac9b5={'where':_0x4c5e38['where']};return db[_0xc024('0x2a')][_0xc024('0x20')](_0x1ac9b5)['then'](function(_0x192055){_0x519d4d['count']=_0x192055;if(_0xfb4c64[_0xc024('0x2e')][_0xc024('0x3e')]){_0x4c5e38[_0xc024('0x3f')]=[{'all':!![]}];}return db[_0xc024('0x2a')][_0xc024('0x40')](_0x4c5e38);})[_0xc024('0x26')](function(_0x1601e8){_0x519d4d['rows']=_0x1601e8;return _0x519d4d;})['then'](respondWithFilteredResult(_0x106748,_0x4c5e38))['catch'](handleError(_0x106748,null));};exports[_0xc024('0x41')]=function(_0x4335ac,_0x3cc1dd){var _0x57fbc8={'raw':!![],'where':{'id':_0x4335ac[_0xc024('0x42')]['id']}},_0x45842e={};_0x45842e[_0xc024('0x2d')]=_['keys'](db[_0xc024('0x2a')]['rawAttributes']);_0x45842e[_0xc024('0x2e')]=_[_0xc024('0x43')](_0x4335ac[_0xc024('0x2e')]);_0x45842e[_0xc024('0x2f')]=_[_0xc024('0x30')](_0x45842e[_0xc024('0x2d')],_0x45842e[_0xc024('0x2e')]);_0x57fbc8[_0xc024('0x31')]=_[_0xc024('0x30')](_0x45842e[_0xc024('0x2d')],qs['fields'](_0x4335ac['query'][_0xc024('0x32')]));_0x57fbc8[_0xc024('0x31')]=_0x57fbc8[_0xc024('0x31')][_0xc024('0x33')]?_0x57fbc8['attributes']:_0x45842e[_0xc024('0x2d')];if(_0x4335ac[_0xc024('0x2e')]['includeAll']){_0x57fbc8['include']=[{'all':!![]}];}_0x57fbc8=_[_0xc024('0x3c')]({},_0x57fbc8,_0x4335ac[_0xc024('0x3d')]);return db[_0xc024('0x2a')]['find'](_0x57fbc8)[_0xc024('0x26')](handleEntityNotFound(_0x3cc1dd,null))['then'](respondWithResult(_0x3cc1dd,null))[_0xc024('0x44')](handleError(_0x3cc1dd,null));};exports[_0xc024('0x45')]=function(_0x36d94e,_0x526343){return db[_0xc024('0x2a')][_0xc024('0x45')](_0x36d94e[_0xc024('0x46')],{})[_0xc024('0x26')](respondWithResult(_0x526343,0xc9))[_0xc024('0x44')](handleError(_0x526343,null));};exports[_0xc024('0x24')]=function(_0x112736,_0x32bf93){if(_0x112736[_0xc024('0x46')]['id']){delete _0x112736['body']['id'];}return db[_0xc024('0x2a')][_0xc024('0x47')]({'where':{'id':_0x112736[_0xc024('0x42')]['id']}})['then'](handleEntityNotFound(_0x32bf93,null))[_0xc024('0x26')](saveUpdates(_0x112736['body'],null))[_0xc024('0x26')](respondWithResult(_0x32bf93,null))[_0xc024('0x44')](handleError(_0x32bf93,null));};exports['destroy']=function(_0x3f2f7b,_0x463cb1){return db[_0xc024('0x2a')][_0xc024('0x47')]({'where':{'id':_0x3f2f7b[_0xc024('0x42')]['id']}})['then'](handleEntityNotFound(_0x463cb1,null))[_0xc024('0x26')](removeEntity(_0x463cb1,null))['catch'](handleError(_0x463cb1,null));};
\ No newline at end of file
+var _0xc206=['fieldName','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','params','keys','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','destroy','then','sendStatus','error','stack','name','send','index','map','AnalyticTreeReport','rawAttributes'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0xc206,0xae));var _0x6c20=function(_0x1b6c6d,_0x2983b0){_0x1b6c6d=_0x1b6c6d-0x0;var _0x290d9d=_0xc206[_0x1b6c6d];return _0x290d9d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6c20('0x0'));var zipdir=require(_0x6c20('0x1'));var jsonpatch=require(_0x6c20('0x2'));var rp=require(_0x6c20('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6c20('0x4'));var util=require('util');var path=require(_0x6c20('0x5'));var sox=require(_0x6c20('0x6'));var csv=require('to-csv');var ejs=require(_0x6c20('0x7'));var fs=require('fs');var fs_extra=require(_0x6c20('0x8'));var _=require(_0x6c20('0x9'));var squel=require(_0x6c20('0xa'));var crypto=require(_0x6c20('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x6c20('0xc'));var toCsv=require(_0x6c20('0xd'));var querystring=require(_0x6c20('0xe'));var Papa=require(_0x6c20('0xf'));var Redis=require(_0x6c20('0x10'));var authService=require(_0x6c20('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x6c20('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6c20('0x13'));var utils=require(_0x6c20('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x6c20('0x15'));var db=require(_0x6c20('0x16'))['db'];function respondWithStatusCode(_0x92280e,_0x484350){_0x484350=_0x484350||0xcc;return function(_0x5411f5){if(_0x5411f5){return _0x92280e['sendStatus'](_0x484350);}return _0x92280e[_0x6c20('0x17')](_0x484350)[_0x6c20('0x18')]();};}function respondWithResult(_0x456861,_0x2719df){_0x2719df=_0x2719df||0xc8;return function(_0x22805d){if(_0x22805d){return _0x456861['status'](_0x2719df)[_0x6c20('0x19')](_0x22805d);}};}function respondWithFilteredResult(_0x3634cc,_0x2eb939){return function(_0x37d4f8){if(_0x37d4f8){var _0x2bc2d3=typeof _0x2eb939[_0x6c20('0x1a')]==='undefined'&&typeof _0x2eb939[_0x6c20('0x1b')]===_0x6c20('0x1c');var _0x80ddea=_0x37d4f8[_0x6c20('0x1d')];var _0x22b0b2=_0x2bc2d3?0x0:_0x2eb939[_0x6c20('0x1a')];var _0x46ec47=_0x2bc2d3?_0x37d4f8[_0x6c20('0x1d')]:_0x2eb939['offset']+_0x2eb939[_0x6c20('0x1b')];var _0x7c88dd;if(_0x46ec47>=_0x80ddea){_0x46ec47=_0x80ddea;_0x7c88dd=0xc8;}else{_0x7c88dd=0xce;}_0x3634cc[_0x6c20('0x17')](_0x7c88dd);return _0x3634cc[_0x6c20('0x1e')](_0x6c20('0x1f'),_0x22b0b2+'-'+_0x46ec47+'/'+_0x80ddea)[_0x6c20('0x19')](_0x37d4f8);}return null;};}function patchUpdates(_0x2e77c6){return function(_0x510b6c){try{jsonpatch[_0x6c20('0x20')](_0x510b6c,_0x2e77c6,!![]);}catch(_0x2270bc){return BPromise['reject'](_0x2270bc);}return _0x510b6c['save']();};}function saveUpdates(_0x223c8f,_0x36da6e){return function(_0x767b77){if(_0x767b77){return _0x767b77[_0x6c20('0x21')](_0x223c8f)['then'](function(_0x1d865c){return _0x1d865c;});}return null;};}function removeEntity(_0x1f215a,_0x1b526f){return function(_0x4e8108){if(_0x4e8108){return _0x4e8108[_0x6c20('0x22')]()[_0x6c20('0x23')](function(){_0x1f215a[_0x6c20('0x17')](0xcc)[_0x6c20('0x18')]();});}};}function handleEntityNotFound(_0x4591d5,_0x457071){return function(_0x1665c8){if(!_0x1665c8){_0x4591d5[_0x6c20('0x24')](0x194);}return _0x1665c8;};}function handleError(_0x5d4695,_0x505ac1){_0x505ac1=_0x505ac1||0x1f4;return function(_0x533be1){logger[_0x6c20('0x25')](_0x533be1[_0x6c20('0x26')]);if(_0x533be1[_0x6c20('0x27')]){delete _0x533be1[_0x6c20('0x27')];}_0x5d4695['status'](_0x505ac1)[_0x6c20('0x28')](_0x533be1);};}exports[_0x6c20('0x29')]=function(_0x367491,_0x5791f7){var _0x461d2d={},_0x4892b6={},_0x246d82={'count':0x0,'rows':[]};var _0x84de8a=_[_0x6c20('0x2a')](db[_0x6c20('0x2b')][_0x6c20('0x2c')],function(_0x3b9739){return{'name':_0x3b9739[_0x6c20('0x2d')],'type':_0x3b9739[_0x6c20('0x2e')]['key']};});_0x4892b6[_0x6c20('0x2f')]=_['map'](_0x84de8a,_0x6c20('0x27'));_0x4892b6[_0x6c20('0x30')]=_['keys'](_0x367491[_0x6c20('0x30')]);_0x4892b6[_0x6c20('0x31')]=_['intersection'](_0x4892b6[_0x6c20('0x2f')],_0x4892b6['query']);_0x461d2d[_0x6c20('0x32')]=_[_0x6c20('0x33')](_0x4892b6[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x367491[_0x6c20('0x30')][_0x6c20('0x34')]));_0x461d2d[_0x6c20('0x32')]=_0x461d2d[_0x6c20('0x32')][_0x6c20('0x35')]?_0x461d2d[_0x6c20('0x32')]:_0x4892b6['model'];if(!_0x367491['query'][_0x6c20('0x36')]('nolimit')){_0x461d2d[_0x6c20('0x1b')]=qs[_0x6c20('0x1b')](_0x367491[_0x6c20('0x30')]['limit']);_0x461d2d[_0x6c20('0x1a')]=qs['offset'](_0x367491['query'][_0x6c20('0x1a')]);}_0x461d2d[_0x6c20('0x37')]=qs[_0x6c20('0x38')](_0x367491[_0x6c20('0x30')][_0x6c20('0x38')]);_0x461d2d[_0x6c20('0x39')]=qs['filters'](_[_0x6c20('0x3a')](_0x367491[_0x6c20('0x30')],_0x4892b6[_0x6c20('0x31')]),_0x84de8a);if(_0x367491['query']['filter']){_0x461d2d[_0x6c20('0x39')]=_[_0x6c20('0x3b')](_0x461d2d[_0x6c20('0x39')],{'$or':_['map'](_0x84de8a,function(_0x2e4f93){if(_0x2e4f93[_0x6c20('0x2e')]!==_0x6c20('0x3c')){var _0x5cc0ff={};_0x5cc0ff[_0x2e4f93[_0x6c20('0x27')]]={'$like':'%'+_0x367491['query'][_0x6c20('0x3d')]+'%'};return _0x5cc0ff;}})});}_0x461d2d=_[_0x6c20('0x3b')]({},_0x461d2d,_0x367491[_0x6c20('0x3e')]);var _0x1d0669={'where':_0x461d2d[_0x6c20('0x39')]};return db['AnalyticTreeReport'][_0x6c20('0x1d')](_0x1d0669)[_0x6c20('0x23')](function(_0x40e716){_0x246d82[_0x6c20('0x1d')]=_0x40e716;if(_0x367491[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x461d2d[_0x6c20('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6c20('0x41')](_0x461d2d);})[_0x6c20('0x23')](function(_0x582922){_0x246d82['rows']=_0x582922;return _0x246d82;})[_0x6c20('0x23')](respondWithFilteredResult(_0x5791f7,_0x461d2d))['catch'](handleError(_0x5791f7,null));};exports[_0x6c20('0x42')]=function(_0x1d4e61,_0x51210f){var _0x5c2e51={'raw':!![],'where':{'id':_0x1d4e61[_0x6c20('0x43')]['id']}},_0x2c4d97={};_0x2c4d97[_0x6c20('0x2f')]=_[_0x6c20('0x44')](db[_0x6c20('0x2b')][_0x6c20('0x2c')]);_0x2c4d97[_0x6c20('0x30')]=_[_0x6c20('0x44')](_0x1d4e61[_0x6c20('0x30')]);_0x2c4d97['filters']=_[_0x6c20('0x33')](_0x2c4d97['model'],_0x2c4d97[_0x6c20('0x30')]);_0x5c2e51[_0x6c20('0x32')]=_['intersection'](_0x2c4d97[_0x6c20('0x2f')],qs[_0x6c20('0x34')](_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x34')]));_0x5c2e51[_0x6c20('0x32')]=_0x5c2e51['attributes'][_0x6c20('0x35')]?_0x5c2e51[_0x6c20('0x32')]:_0x2c4d97[_0x6c20('0x2f')];if(_0x1d4e61[_0x6c20('0x30')][_0x6c20('0x3f')]){_0x5c2e51[_0x6c20('0x40')]=[{'all':!![]}];}_0x5c2e51=_['merge']({},_0x5c2e51,_0x1d4e61[_0x6c20('0x3e')]);return db[_0x6c20('0x2b')][_0x6c20('0x45')](_0x5c2e51)['then'](handleEntityNotFound(_0x51210f,null))['then'](respondWithResult(_0x51210f,null))[_0x6c20('0x46')](handleError(_0x51210f,null));};exports[_0x6c20('0x47')]=function(_0x20b386,_0xf11e7c){return db[_0x6c20('0x2b')][_0x6c20('0x47')](_0x20b386[_0x6c20('0x48')],{})[_0x6c20('0x23')](respondWithResult(_0xf11e7c,0xc9))[_0x6c20('0x46')](handleError(_0xf11e7c,null));};exports['update']=function(_0x181984,_0x44b973){if(_0x181984[_0x6c20('0x48')]['id']){delete _0x181984[_0x6c20('0x48')]['id'];}return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x181984[_0x6c20('0x43')]['id']}})[_0x6c20('0x23')](handleEntityNotFound(_0x44b973,null))['then'](saveUpdates(_0x181984[_0x6c20('0x48')],null))[_0x6c20('0x23')](respondWithResult(_0x44b973,null))['catch'](handleError(_0x44b973,null));};exports['destroy']=function(_0x8591c7,_0x22018b){return db[_0x6c20('0x2b')][_0x6c20('0x45')]({'where':{'id':_0x8591c7[_0x6c20('0x43')]['id']}})['then'](handleEntityNotFound(_0x22018b,null))[_0x6c20('0x23')](removeEntity(_0x22018b,null))['catch'](handleError(_0x22018b,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 81dc0aa..124b728 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 _0x3af5=['define','AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports'];(function(_0x5ec370,_0x5a2a10){var _0x1bb5bc=function(_0xcc785c){while(--_0xcc785c){_0x5ec370['push'](_0x5ec370['shift']());}};_0x1bb5bc(++_0x5a2a10);}(_0x3af5,0x129));var _0x53af=function(_0x5e9817,_0xa29439){_0x5e9817=_0x5e9817-0x0;var _0x25b437=_0x3af5[_0x5e9817];return _0x25b437;};'use strict';var _=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var logger=require('../../config/logger')(_0x53af('0x2'));var moment=require(_0x53af('0x3'));var BPromise=require(_0x53af('0x4'));var rp=require(_0x53af('0x5'));var fs=require('fs');var path=require(_0x53af('0x6'));var rimraf=require(_0x53af('0x7'));var config=require(_0x53af('0x8'));var attributes=require(_0x53af('0x9'));module[_0x53af('0xa')]=function(_0x1aed3e,_0x249328){return _0x1aed3e[_0x53af('0xb')](_0x53af('0xc'),attributes,{'tableName':_0x53af('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x191d=['AnalyticTreeReport','analytics_report_trees','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define'];(function(_0x4133fd,_0x1cd6ec){var _0x2365d6=function(_0x471734){while(--_0x471734){_0x4133fd['push'](_0x4133fd['shift']());}};_0x2365d6(++_0x1cd6ec);}(_0x191d,0x161));var _0xd191=function(_0x15a782,_0x25165f){_0x15a782=_0x15a782-0x0;var _0x376302=_0x191d[_0x15a782];return _0x376302;};'use strict';var _=require(_0xd191('0x0'));var util=require(_0xd191('0x1'));var logger=require(_0xd191('0x2'))(_0xd191('0x3'));var moment=require('moment');var BPromise=require(_0xd191('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd191('0x5'));var rimraf=require(_0xd191('0x6'));var config=require(_0xd191('0x7'));var attributes=require(_0xd191('0x8'));module[_0xd191('0x9')]=function(_0x4ffbd0,_0x56fe2c){return _0x4ffbd0[_0xd191('0xa')](_0xd191('0xb'),attributes,{'tableName':_0xd191('0xc'),'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 24f0f36..57d5373 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 _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x3ca879,_0x2e88ee){var _0x1f0bae=function(_0x114b52){while(--_0x114b52){_0x3ca879['push'](_0x3ca879['shift']());}};_0x1f0bae(++_0x2e88ee);}(_0x2ef3,0xba));var _0x32ef=function(_0x2eaa59,_0x298b57){_0x2eaa59=_0x2eaa59-0x0;var _0x393824=_0x2ef3[_0x2eaa59];return _0x393824;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
+var _0x7a54=['info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x7a54,0x106));var _0x47a5=function(_0x41c87b,_0x52f73e){_0x41c87b=_0x41c87b-0x0;var _0x22506f=_0x7a54[_0x41c87b];return _0x22506f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x59199c,_0x343372,_0x30e405){return new BPromise(function(_0x506eda,_0x194fb0){return client['request'](_0x59199c,_0x30e405)['then'](function(_0x582352){logger[_0x47a5('0xb')](_0x47a5('0xc'),_0x343372,'request\x20sent');logger[_0x47a5('0xd')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index d072265..bb0b5e6 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 _0x844d=['index','/:id','create','put','update','destroy','exports','util','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticTreeReport.controller','get','isAuthenticated'];(function(_0x9cf391,_0x3b631f){var _0xb7069f=function(_0x36a123){while(--_0x36a123){_0x9cf391['push'](_0x9cf391['shift']());}};_0xb7069f(++_0x3b631f);}(_0x844d,0x117));var _0xd844=function(_0x26bcec,_0xe13f50){_0x26bcec=_0x26bcec-0x0;var _0x1049dc=_0x844d[_0x26bcec];return _0x1049dc;};'use strict';var multer=require('multer');var util=require(_0xd844('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd844('0x1'));var router=express[_0xd844('0x2')]();var fs_extra=require(_0xd844('0x3'));var auth=require(_0xd844('0x4'));var interaction=require(_0xd844('0x5'));var config=require('../../config/environment');var controller=require(_0xd844('0x6'));router[_0xd844('0x7')]('/',auth[_0xd844('0x8')](),controller[_0xd844('0x9')]);router[_0xd844('0x7')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xd844('0xb')]);router[_0xd844('0xc')](_0xd844('0xa'),auth[_0xd844('0x8')](),controller[_0xd844('0xd')]);router['delete']('/:id',auth[_0xd844('0x8')](),controller[_0xd844('0xe')]);module[_0xd844('0xf')]=router;
\ No newline at end of file
+var _0x60e4=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','get','/:id','post','create'];(function(_0xb2432a,_0x46ce8b){var _0x38ec39=function(_0x378ed7){while(--_0x378ed7){_0xb2432a['push'](_0xb2432a['shift']());}};_0x38ec39(++_0x46ce8b);}(_0x60e4,0xff));var _0x460e=function(_0x3e8096,_0xf1d389){_0x3e8096=_0x3e8096-0x0;var _0x3c2377=_0x60e4[_0x3e8096];return _0x3c2377;};'use strict';var multer=require(_0x460e('0x0'));var util=require(_0x460e('0x1'));var path=require(_0x460e('0x2'));var timeout=require(_0x460e('0x3'));var express=require(_0x460e('0x4'));var router=express[_0x460e('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x460e('0x6'));var config=require(_0x460e('0x7'));var controller=require(_0x460e('0x8'));router['get']('/',auth[_0x460e('0x9')](),controller[_0x460e('0xa')]);router[_0x460e('0xb')](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['show']);router[_0x460e('0xd')]('/',auth[_0x460e('0x9')](),controller[_0x460e('0xe')]);router['put'](_0x460e('0xc'),auth[_0x460e('0x9')](),controller['update']);router[_0x460e('0xf')]('/:id',auth[_0x460e('0x9')](),controller[_0x460e('0x10')]);module[_0x460e('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 b65700b..4e1985b 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 _0x98a7=['exports','STRING','sequelize'];(function(_0x4e4933,_0x32cd71){var _0x2890a2=function(_0x384bff){while(--_0x384bff){_0x4e4933['push'](_0x4e4933['shift']());}};_0x2890a2(++_0x32cd71);}(_0x98a7,0x9e));var _0x798a=function(_0x50dce5,_0x5e3d03){_0x50dce5=_0x50dce5-0x0;var _0x3783ab=_0x98a7[_0x50dce5];return _0x3783ab;};'use strict';var Sequelize=require(_0x798a('0x0'));module[_0x798a('0x1')]={'name':{'type':Sequelize[_0x798a('0x2')]},'basename':{'type':Sequelize[_0x798a('0x2')]},'type':{'type':Sequelize[_0x798a('0x2')]}};
\ No newline at end of file
+var _0x89c3=['sequelize','exports','STRING'];(function(_0x2dcc80,_0x96b865){var _0x1289d9=function(_0x155eab){while(--_0x155eab){_0x2dcc80['push'](_0x2dcc80['shift']());}};_0x1289d9(++_0x96b865);}(_0x89c3,0xff));var _0x389c=function(_0x4a8829,_0x36f847){_0x4a8829=_0x4a8829-0x0;var _0x22dc42=_0x89c3[_0x4a8829];return _0x22dc42;};'use strict';var Sequelize=require(_0x389c('0x0'));module[_0x389c('0x1')]={'name':{'type':Sequelize[_0x389c('0x2')]},'basename':{'type':Sequelize[_0x389c('0x2')]},'type':{'type':Sequelize[_0x389c('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index ab1084d..b8948a4 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 _0x3c23=['moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','Attachment','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','merge','find','clone','get','omit','updatedAt','body','createdAt','create','originalname','file','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','eml-format','rimraf','fast-json-patch'];(function(_0x50b07f,_0x1dee5b){var _0x19b62c=function(_0x257bb3){while(--_0x257bb3){_0x50b07f['push'](_0x50b07f['shift']());}};_0x19b62c(++_0x1dee5b);}(_0x3c23,0xbf));var _0x33c2=function(_0x481471,_0x26356b){_0x481471=_0x481471-0x0;var _0x1e92e0=_0x3c23[_0x481471];return _0x1e92e0;};'use strict';var emlformat=require(_0x33c2('0x0'));var rimraf=require(_0x33c2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x33c2('0x2'));var rp=require('request-promise');var moment=require(_0x33c2('0x3'));var BPromise=require(_0x33c2('0x4'));var Mustache=require(_0x33c2('0x5'));var util=require(_0x33c2('0x6'));var path=require(_0x33c2('0x7'));var sox=require(_0x33c2('0x8'));var csv=require(_0x33c2('0x9'));var ejs=require(_0x33c2('0xa'));var fs=require('fs');var fs_extra=require(_0x33c2('0xb'));var _=require(_0x33c2('0xc'));var squel=require(_0x33c2('0xd'));var crypto=require(_0x33c2('0xe'));var jsforce=require(_0x33c2('0xf'));var deskjs=require(_0x33c2('0x10'));var toCsv=require('to-csv');var querystring=require(_0x33c2('0x11'));var Papa=require(_0x33c2('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x33c2('0x13'));var as=require(_0x33c2('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x33c2('0x15'))(_0x33c2('0x16'));var utils=require(_0x33c2('0x17'));var config=require(_0x33c2('0x18'));var licenseUtil=require(_0x33c2('0x19'));var db=require(_0x33c2('0x1a'))['db'];function respondWithStatusCode(_0x21fab8,_0x80dd71){_0x80dd71=_0x80dd71||0xcc;return function(_0x2e5bb3){if(_0x2e5bb3){return _0x21fab8[_0x33c2('0x1b')](_0x80dd71);}return _0x21fab8[_0x33c2('0x1c')](_0x80dd71)[_0x33c2('0x1d')]();};}function respondWithResult(_0x26f194,_0xd160ca){_0xd160ca=_0xd160ca||0xc8;return function(_0xefb92f){if(_0xefb92f){return _0x26f194['status'](_0xd160ca)[_0x33c2('0x1e')](_0xefb92f);}};}function respondWithFilteredResult(_0x275dbb,_0x42def0){return function(_0x142147){if(_0x142147){var _0x5412a1=typeof _0x42def0[_0x33c2('0x1f')]==='undefined'&&typeof _0x42def0[_0x33c2('0x20')]==='undefined';var _0x490692=_0x142147[_0x33c2('0x21')];var _0x38ca01=_0x5412a1?0x0:_0x42def0[_0x33c2('0x1f')];var _0x83c846=_0x5412a1?_0x142147[_0x33c2('0x21')]:_0x42def0['offset']+_0x42def0['limit'];var _0x17310d;if(_0x83c846>=_0x490692){_0x83c846=_0x490692;_0x17310d=0xc8;}else{_0x17310d=0xce;}_0x275dbb[_0x33c2('0x1c')](_0x17310d);return _0x275dbb[_0x33c2('0x22')](_0x33c2('0x23'),_0x38ca01+'-'+_0x83c846+'/'+_0x490692)[_0x33c2('0x1e')](_0x142147);}return null;};}function patchUpdates(_0x2c3039){return function(_0x1606c8){try{jsonpatch[_0x33c2('0x24')](_0x1606c8,_0x2c3039,!![]);}catch(_0x55ffd5){return BPromise[_0x33c2('0x25')](_0x55ffd5);}return _0x1606c8[_0x33c2('0x26')]();};}function saveUpdates(_0x5ce085,_0x1f40a0){return function(_0x5e2aaa){if(_0x5e2aaa){return _0x5e2aaa[_0x33c2('0x27')](_0x5ce085)['then'](function(_0x13854c){return _0x13854c;});}return null;};}function removeEntity(_0x375740,_0x4401ba){return function(_0x361515){if(_0x361515){return _0x361515[_0x33c2('0x28')]()[_0x33c2('0x29')](function(){_0x375740[_0x33c2('0x1c')](0xcc)[_0x33c2('0x1d')]();});}};}function handleEntityNotFound(_0x268da0,_0x98f241){return function(_0x498af1){if(!_0x498af1){_0x268da0[_0x33c2('0x1b')](0x194);}return _0x498af1;};}function handleError(_0x1a8116,_0xca1eef){_0xca1eef=_0xca1eef||0x1f4;return function(_0x290579){logger[_0x33c2('0x2a')](_0x290579[_0x33c2('0x2b')]);if(_0x290579['name']){delete _0x290579[_0x33c2('0x2c')];}_0x1a8116['status'](_0xca1eef)[_0x33c2('0x2d')](_0x290579);};}exports[_0x33c2('0x2e')]=function(_0x416fb4,_0x47c483){var _0x487a65={},_0x3f3d2d={},_0x2945b2={'count':0x0,'rows':[]};var _0x2ad2da=_['map'](db[_0x33c2('0x2f')]['rawAttributes'],function(_0x4315c2){return{'name':_0x4315c2[_0x33c2('0x30')],'type':_0x4315c2['type'][_0x33c2('0x31')]};});_0x3f3d2d[_0x33c2('0x32')]=_[_0x33c2('0x33')](_0x2ad2da,_0x33c2('0x2c'));_0x3f3d2d[_0x33c2('0x34')]=_[_0x33c2('0x35')](_0x416fb4['query']);_0x3f3d2d[_0x33c2('0x36')]=_[_0x33c2('0x37')](_0x3f3d2d[_0x33c2('0x32')],_0x3f3d2d[_0x33c2('0x34')]);_0x487a65[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x3f3d2d[_0x33c2('0x32')],qs[_0x33c2('0x39')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x39')]));_0x487a65[_0x33c2('0x38')]=_0x487a65[_0x33c2('0x38')][_0x33c2('0x3a')]?_0x487a65['attributes']:_0x3f3d2d[_0x33c2('0x32')];if(!_0x416fb4[_0x33c2('0x34')][_0x33c2('0x3b')](_0x33c2('0x3c'))){_0x487a65[_0x33c2('0x20')]=qs[_0x33c2('0x20')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x20')]);_0x487a65[_0x33c2('0x1f')]=qs[_0x33c2('0x1f')](_0x416fb4['query'][_0x33c2('0x1f')]);}_0x487a65[_0x33c2('0x3d')]=qs[_0x33c2('0x3e')](_0x416fb4[_0x33c2('0x34')][_0x33c2('0x3e')]);_0x487a65[_0x33c2('0x3f')]=qs[_0x33c2('0x36')](_[_0x33c2('0x40')](_0x416fb4[_0x33c2('0x34')],_0x3f3d2d[_0x33c2('0x36')]),_0x2ad2da);if(_0x416fb4[_0x33c2('0x34')][_0x33c2('0x41')]){_0x487a65[_0x33c2('0x3f')]=_['merge'](_0x487a65['where'],{'$or':_[_0x33c2('0x33')](_0x2ad2da,function(_0x4c27a0){if(_0x4c27a0[_0x33c2('0x42')]!=='VIRTUAL'){var _0x18ee6b={};_0x18ee6b[_0x4c27a0[_0x33c2('0x2c')]]={'$like':'%'+_0x416fb4[_0x33c2('0x34')]['filter']+'%'};return _0x18ee6b;}})});}_0x487a65=_['merge']({},_0x487a65,_0x416fb4[_0x33c2('0x43')]);var _0x3a07d3={'where':_0x487a65['where']};return db['Attachment'][_0x33c2('0x21')](_0x3a07d3)[_0x33c2('0x29')](function(_0x155684){_0x2945b2['count']=_0x155684;if(_0x416fb4[_0x33c2('0x34')][_0x33c2('0x44')]){_0x487a65[_0x33c2('0x45')]=[{'all':!![]}];}return db[_0x33c2('0x2f')][_0x33c2('0x46')](_0x487a65);})['then'](function(_0x369b95){_0x2945b2[_0x33c2('0x47')]=_0x369b95;return _0x2945b2;})[_0x33c2('0x29')](respondWithFilteredResult(_0x47c483,_0x487a65))[_0x33c2('0x48')](handleError(_0x47c483,null));};exports[_0x33c2('0x49')]=function(_0x44c7df,_0x127b8f){var _0x224d57={'raw':!![],'where':{'id':_0x44c7df[_0x33c2('0x4a')]['id']}},_0x4e1afe={};_0x4e1afe[_0x33c2('0x32')]=_[_0x33c2('0x35')](db[_0x33c2('0x2f')][_0x33c2('0x4b')]);_0x4e1afe[_0x33c2('0x34')]=_[_0x33c2('0x35')](_0x44c7df[_0x33c2('0x34')]);_0x4e1afe['filters']=_[_0x33c2('0x37')](_0x4e1afe[_0x33c2('0x32')],_0x4e1afe['query']);_0x224d57[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x4e1afe['model'],qs[_0x33c2('0x39')](_0x44c7df[_0x33c2('0x34')][_0x33c2('0x39')]));_0x224d57[_0x33c2('0x38')]=_0x224d57[_0x33c2('0x38')][_0x33c2('0x3a')]?_0x224d57['attributes']:_0x4e1afe[_0x33c2('0x32')];if(_0x44c7df[_0x33c2('0x34')][_0x33c2('0x44')]){_0x224d57[_0x33c2('0x45')]=[{'all':!![]}];}_0x224d57=_[_0x33c2('0x4c')]({},_0x224d57,_0x44c7df[_0x33c2('0x43')]);return db['Attachment'][_0x33c2('0x4d')](_0x224d57)[_0x33c2('0x29')](handleEntityNotFound(_0x127b8f,null))['then'](respondWithResult(_0x127b8f,null))['catch'](handleError(_0x127b8f,null));};exports[_0x33c2('0x4e')]=function(_0xcccc89,_0x19a142){var _0x52efb8={'where':{'id':_0xcccc89[_0x33c2('0x4a')]['id']}},_0x5c818f={};_0x5c818f[_0x33c2('0x32')]=_[_0x33c2('0x35')](db[_0x33c2('0x2f')][_0x33c2('0x4b')]);_0x52efb8[_0x33c2('0x38')]=_[_0x33c2('0x37')](_0x5c818f[_0x33c2('0x32')],qs['fields'](_0xcccc89['query'][_0x33c2('0x39')]));_0x52efb8['attributes']=_0x52efb8['attributes']['length']?_0x52efb8['attributes']:_0x5c818f[_0x33c2('0x32')];if(_0xcccc89[_0x33c2('0x34')]['includeAll']){_0x52efb8[_0x33c2('0x45')]=[{'all':!![]}];}_0x52efb8=_[_0x33c2('0x4c')]({},_0x52efb8,_0xcccc89['options']);return db['Attachment'][_0x33c2('0x4d')](_0x52efb8)[_0x33c2('0x29')](handleEntityNotFound(_0x19a142,null))[_0x33c2('0x29')](function(_0x2ffd0f){if(_0x2ffd0f){var _0x2eb403=_0x2ffd0f[_0x33c2('0x4f')]({'plain':!![]});_0x2eb403=qs[_0x33c2('0x50')](_0x2eb403,['id','createdAt',_0x33c2('0x51')]);_0xcccc89['body']=_[_0x33c2('0x50')](_0xcccc89[_0x33c2('0x52')],['id',_0x33c2('0x53'),_0x33c2('0x51')]);return db[_0x33c2('0x2f')]['create'](_[_0x33c2('0x4c')](_0x2eb403,_0xcccc89['body']),{'include':_0xcccc89['query'][_0x33c2('0x44')]?[{'all':!![]}]:undefined});}})[_0x33c2('0x29')](respondWithResult(_0x19a142,0xc9))[_0x33c2('0x48')](handleError(_0x19a142,null));};exports[_0x33c2('0x27')]=function(_0x39c574,_0x2e6d9b){if(_0x39c574[_0x33c2('0x52')]['id']){delete _0x39c574[_0x33c2('0x52')]['id'];}return db[_0x33c2('0x2f')][_0x33c2('0x4d')]({'where':{'id':_0x39c574[_0x33c2('0x4a')]['id']}})[_0x33c2('0x29')](handleEntityNotFound(_0x2e6d9b,null))[_0x33c2('0x29')](saveUpdates(_0x39c574[_0x33c2('0x52')],null))[_0x33c2('0x29')](respondWithResult(_0x2e6d9b,null))[_0x33c2('0x48')](handleError(_0x2e6d9b,null));};exports[_0x33c2('0x28')]=function(_0x135f29,_0xcf8d0b){return db['Attachment'][_0x33c2('0x4d')]({'where':{'id':_0x135f29[_0x33c2('0x4a')]['id']}})['then'](handleEntityNotFound(_0xcf8d0b,null))['then'](removeEntity(_0xcf8d0b,null))[_0x33c2('0x48')](handleError(_0xcf8d0b,null));};exports[_0x33c2('0x54')]=function(_0x78d33e,_0xf75f78,_0x3c9671){_0x78d33e[_0x33c2('0x52')][_0x33c2('0x2c')]=_0x78d33e['file'][_0x33c2('0x55')];_0x78d33e[_0x33c2('0x52')]['basename']=_0x78d33e[_0x33c2('0x56')][_0x33c2('0x57')];_0x78d33e[_0x33c2('0x52')][_0x33c2('0x42')]=_0x78d33e[_0x33c2('0x56')][_0x33c2('0x58')];return db[_0x33c2('0x2f')]['create'](_0x78d33e[_0x33c2('0x52')])[_0x33c2('0x29')](respondWithResult(_0xf75f78,0xc9))[_0x33c2('0x48')](handleError(_0xf75f78,null));};exports[_0x33c2('0x59')]=function(_0xc12c42,_0x38d2d7,_0x4109f4){return db[_0x33c2('0x2f')][_0x33c2('0x5a')]({'where':{'id':_0xc12c42[_0x33c2('0x4a')]['id']},'raw':!![]})[_0x33c2('0x29')](handleEntityNotFound(_0x38d2d7,null))[_0x33c2('0x29')](function(_0x1fd0ce){if(_0x1fd0ce){var _0x3c50cd=_0x1fd0ce[_0x33c2('0x5b')]!==null;var _0x373396=path[_0x33c2('0x5c')](config[_0x33c2('0x5d')],_0x33c2('0x5e'));if(_0x3c50cd){_0x373396=path[_0x33c2('0x5c')](_0x373396,_0x33c2('0x5f'));}var _0x435d69=path[_0x33c2('0x5c')](_0x373396,_0x1fd0ce[_0x33c2('0x60')]);return _0x38d2d7[_0x33c2('0x59')](_0x435d69);}})['catch'](handleError(_0x38d2d7,null));};
\ No newline at end of file
+var _0xecd4=['keys','find','clone','include','get','omit','createdAt','body','create','originalname','basename','file','filename','mimetype','download','server/files/attachments/','join','offline-chat/','eml-format','rimraf','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','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','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','limit','count','set','apply','reject','save','update','destroy','then','sendStatus','error','name','index','Attachment','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params'];(function(_0x5c3526,_0x2a1e90){var _0xec27a2=function(_0x5ac4e1){while(--_0x5ac4e1){_0x5c3526['push'](_0x5c3526['shift']());}};_0xec27a2(++_0x2a1e90);}(_0xecd4,0xc6));var _0x4ecd=function(_0x4cb0e3,_0x5e0445){_0x4cb0e3=_0x4cb0e3-0x0;var _0x46ea93=_0xecd4[_0x4cb0e3];return _0x46ea93;};'use strict';var emlformat=require(_0x4ecd('0x0'));var rimraf=require(_0x4ecd('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4ecd('0x2'));var Mustache=require(_0x4ecd('0x3'));var util=require('util');var path=require(_0x4ecd('0x4'));var sox=require(_0x4ecd('0x5'));var csv=require(_0x4ecd('0x6'));var ejs=require(_0x4ecd('0x7'));var fs=require('fs');var fs_extra=require(_0x4ecd('0x8'));var _=require(_0x4ecd('0x9'));var squel=require('squel');var crypto=require(_0x4ecd('0xa'));var jsforce=require(_0x4ecd('0xb'));var deskjs=require(_0x4ecd('0xc'));var toCsv=require(_0x4ecd('0x6'));var querystring=require(_0x4ecd('0xd'));var Papa=require(_0x4ecd('0xe'));var Redis=require('ioredis');var authService=require(_0x4ecd('0xf'));var qs=require(_0x4ecd('0x10'));var as=require(_0x4ecd('0x11'));var hardwareService=require(_0x4ecd('0x12'));var logger=require(_0x4ecd('0x13'))(_0x4ecd('0x14'));var utils=require(_0x4ecd('0x15'));var config=require(_0x4ecd('0x16'));var licenseUtil=require(_0x4ecd('0x17'));var db=require(_0x4ecd('0x18'))['db'];function respondWithStatusCode(_0x1bdeca,_0x31f01e){_0x31f01e=_0x31f01e||0xcc;return function(_0x1b6600){if(_0x1b6600){return _0x1bdeca['sendStatus'](_0x31f01e);}return _0x1bdeca[_0x4ecd('0x19')](_0x31f01e)[_0x4ecd('0x1a')]();};}function respondWithResult(_0x1a7041,_0x3227b3){_0x3227b3=_0x3227b3||0xc8;return function(_0x211fbc){if(_0x211fbc){return _0x1a7041[_0x4ecd('0x19')](_0x3227b3)[_0x4ecd('0x1b')](_0x211fbc);}};}function respondWithFilteredResult(_0x32254e,_0x30c062){return function(_0x3dc5dc){if(_0x3dc5dc){var _0x4483a5=typeof _0x30c062[_0x4ecd('0x1c')]===_0x4ecd('0x1d')&&typeof _0x30c062[_0x4ecd('0x1e')]===_0x4ecd('0x1d');var _0x45ece2=_0x3dc5dc[_0x4ecd('0x1f')];var _0x1dbdf5=_0x4483a5?0x0:_0x30c062[_0x4ecd('0x1c')];var _0x43f2aa=_0x4483a5?_0x3dc5dc[_0x4ecd('0x1f')]:_0x30c062[_0x4ecd('0x1c')]+_0x30c062[_0x4ecd('0x1e')];var _0x390ded;if(_0x43f2aa>=_0x45ece2){_0x43f2aa=_0x45ece2;_0x390ded=0xc8;}else{_0x390ded=0xce;}_0x32254e[_0x4ecd('0x19')](_0x390ded);return _0x32254e[_0x4ecd('0x20')]('Content-Range',_0x1dbdf5+'-'+_0x43f2aa+'/'+_0x45ece2)['json'](_0x3dc5dc);}return null;};}function patchUpdates(_0x38fea7){return function(_0x263273){try{jsonpatch[_0x4ecd('0x21')](_0x263273,_0x38fea7,!![]);}catch(_0xb2c982){return BPromise[_0x4ecd('0x22')](_0xb2c982);}return _0x263273[_0x4ecd('0x23')]();};}function saveUpdates(_0x17a63f,_0x5494dc){return function(_0x1af18e){if(_0x1af18e){return _0x1af18e[_0x4ecd('0x24')](_0x17a63f)['then'](function(_0x3ffa29){return _0x3ffa29;});}return null;};}function removeEntity(_0x83bce5,_0x325f8a){return function(_0x38ab8b){if(_0x38ab8b){return _0x38ab8b[_0x4ecd('0x25')]()[_0x4ecd('0x26')](function(){_0x83bce5['status'](0xcc)[_0x4ecd('0x1a')]();});}};}function handleEntityNotFound(_0x239e22,_0x1719f0){return function(_0x113c7a){if(!_0x113c7a){_0x239e22[_0x4ecd('0x27')](0x194);}return _0x113c7a;};}function handleError(_0x3b11f1,_0x14d42f){_0x14d42f=_0x14d42f||0x1f4;return function(_0x1d0598){logger[_0x4ecd('0x28')](_0x1d0598['stack']);if(_0x1d0598[_0x4ecd('0x29')]){delete _0x1d0598[_0x4ecd('0x29')];}_0x3b11f1[_0x4ecd('0x19')](_0x14d42f)['send'](_0x1d0598);};}exports[_0x4ecd('0x2a')]=function(_0xe4402e,_0x13432b){var _0x4d18c4={},_0x2fd398={},_0x276794={'count':0x0,'rows':[]};var _0x2a025a=_['map'](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')],function(_0x2ccebd){return{'name':_0x2ccebd[_0x4ecd('0x2d')],'type':_0x2ccebd[_0x4ecd('0x2e')][_0x4ecd('0x2f')]};});_0x2fd398[_0x4ecd('0x30')]=_[_0x4ecd('0x31')](_0x2a025a,_0x4ecd('0x29'));_0x2fd398[_0x4ecd('0x32')]=_['keys'](_0xe4402e[_0x4ecd('0x32')]);_0x2fd398['filters']=_[_0x4ecd('0x33')](_0x2fd398['model'],_0x2fd398[_0x4ecd('0x32')]);_0x4d18c4[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2fd398['model'],qs[_0x4ecd('0x35')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x35')]));_0x4d18c4[_0x4ecd('0x34')]=_0x4d18c4[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4d18c4[_0x4ecd('0x34')]:_0x2fd398[_0x4ecd('0x30')];if(!_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x37')](_0x4ecd('0x38'))){_0x4d18c4[_0x4ecd('0x1e')]=qs[_0x4ecd('0x1e')](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1e')]);_0x4d18c4[_0x4ecd('0x1c')]=qs['offset'](_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x1c')]);}_0x4d18c4[_0x4ecd('0x39')]=qs[_0x4ecd('0x3a')](_0xe4402e['query'][_0x4ecd('0x3a')]);_0x4d18c4['where']=qs[_0x4ecd('0x3b')](_[_0x4ecd('0x3c')](_0xe4402e[_0x4ecd('0x32')],_0x2fd398[_0x4ecd('0x3b')]),_0x2a025a);if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]){_0x4d18c4[_0x4ecd('0x3e')]=_[_0x4ecd('0x3f')](_0x4d18c4[_0x4ecd('0x3e')],{'$or':_[_0x4ecd('0x31')](_0x2a025a,function(_0x335602){if(_0x335602[_0x4ecd('0x2e')]!==_0x4ecd('0x40')){var _0x4fb543={};_0x4fb543[_0x335602[_0x4ecd('0x29')]]={'$like':'%'+_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x3d')]+'%'};return _0x4fb543;}})});}_0x4d18c4=_[_0x4ecd('0x3f')]({},_0x4d18c4,_0xe4402e[_0x4ecd('0x41')]);var _0x38f25d={'where':_0x4d18c4[_0x4ecd('0x3e')]};return db[_0x4ecd('0x2b')][_0x4ecd('0x1f')](_0x38f25d)[_0x4ecd('0x26')](function(_0x47103e){_0x276794[_0x4ecd('0x1f')]=_0x47103e;if(_0xe4402e[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4d18c4['include']=[{'all':!![]}];}return db['Attachment'][_0x4ecd('0x43')](_0x4d18c4);})[_0x4ecd('0x26')](function(_0x3898c6){_0x276794[_0x4ecd('0x44')]=_0x3898c6;return _0x276794;})[_0x4ecd('0x26')](respondWithFilteredResult(_0x13432b,_0x4d18c4))[_0x4ecd('0x45')](handleError(_0x13432b,null));};exports[_0x4ecd('0x46')]=function(_0x166c94,_0x194118){var _0x805890={'raw':!![],'where':{'id':_0x166c94[_0x4ecd('0x47')]['id']}},_0x279c54={};_0x279c54['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x279c54[_0x4ecd('0x32')]=_['keys'](_0x166c94['query']);_0x279c54['filters']=_['intersection'](_0x279c54[_0x4ecd('0x30')],_0x279c54[_0x4ecd('0x32')]);_0x805890[_0x4ecd('0x34')]=_['intersection'](_0x279c54['model'],qs[_0x4ecd('0x35')](_0x166c94[_0x4ecd('0x32')]['fields']));_0x805890[_0x4ecd('0x34')]=_0x805890[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x805890[_0x4ecd('0x34')]:_0x279c54['model'];if(_0x166c94[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x805890['include']=[{'all':!![]}];}_0x805890=_['merge']({},_0x805890,_0x166c94[_0x4ecd('0x41')]);return db[_0x4ecd('0x2b')][_0x4ecd('0x49')](_0x805890)[_0x4ecd('0x26')](handleEntityNotFound(_0x194118,null))[_0x4ecd('0x26')](respondWithResult(_0x194118,null))['catch'](handleError(_0x194118,null));};exports[_0x4ecd('0x4a')]=function(_0x3210a8,_0x3aa2c9){var _0x4cc1a1={'where':{'id':_0x3210a8[_0x4ecd('0x47')]['id']}},_0x2ebbf2={};_0x2ebbf2['model']=_[_0x4ecd('0x48')](db[_0x4ecd('0x2b')][_0x4ecd('0x2c')]);_0x4cc1a1[_0x4ecd('0x34')]=_[_0x4ecd('0x33')](_0x2ebbf2[_0x4ecd('0x30')],qs[_0x4ecd('0x35')](_0x3210a8['query'][_0x4ecd('0x35')]));_0x4cc1a1[_0x4ecd('0x34')]=_0x4cc1a1[_0x4ecd('0x34')][_0x4ecd('0x36')]?_0x4cc1a1['attributes']:_0x2ebbf2[_0x4ecd('0x30')];if(_0x3210a8[_0x4ecd('0x32')][_0x4ecd('0x42')]){_0x4cc1a1[_0x4ecd('0x4b')]=[{'all':!![]}];}_0x4cc1a1=_[_0x4ecd('0x3f')]({},_0x4cc1a1,_0x3210a8[_0x4ecd('0x41')]);return db['Attachment'][_0x4ecd('0x49')](_0x4cc1a1)['then'](handleEntityNotFound(_0x3aa2c9,null))['then'](function(_0x2caded){if(_0x2caded){var _0x1280a5=_0x2caded[_0x4ecd('0x4c')]({'plain':!![]});_0x1280a5=qs[_0x4ecd('0x4d')](_0x1280a5,['id',_0x4ecd('0x4e'),'updatedAt']);_0x3210a8[_0x4ecd('0x4f')]=_['omit'](_0x3210a8['body'],['id',_0x4ecd('0x4e'),'updatedAt']);return db['Attachment'][_0x4ecd('0x50')](_[_0x4ecd('0x3f')](_0x1280a5,_0x3210a8['body']),{'include':_0x3210a8['query'][_0x4ecd('0x42')]?[{'all':!![]}]:undefined});}})[_0x4ecd('0x26')](respondWithResult(_0x3aa2c9,0xc9))[_0x4ecd('0x45')](handleError(_0x3aa2c9,null));};exports['update']=function(_0x289308,_0x1af643){if(_0x289308['body']['id']){delete _0x289308[_0x4ecd('0x4f')]['id'];}return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x289308[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x1af643,null))[_0x4ecd('0x26')](saveUpdates(_0x289308[_0x4ecd('0x4f')],null))['then'](respondWithResult(_0x1af643,null))[_0x4ecd('0x45')](handleError(_0x1af643,null));};exports[_0x4ecd('0x25')]=function(_0x4fd831,_0x4ff466){return db[_0x4ecd('0x2b')][_0x4ecd('0x49')]({'where':{'id':_0x4fd831[_0x4ecd('0x47')]['id']}})[_0x4ecd('0x26')](handleEntityNotFound(_0x4ff466,null))['then'](removeEntity(_0x4ff466,null))[_0x4ecd('0x45')](handleError(_0x4ff466,null));};exports[_0x4ecd('0x50')]=function(_0x4a69f8,_0x2869cc,_0x12a0b3){_0x4a69f8[_0x4ecd('0x4f')]['name']=_0x4a69f8['file'][_0x4ecd('0x51')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x52')]=_0x4a69f8[_0x4ecd('0x53')][_0x4ecd('0x54')];_0x4a69f8[_0x4ecd('0x4f')][_0x4ecd('0x2e')]=_0x4a69f8['file'][_0x4ecd('0x55')];return db['Attachment'][_0x4ecd('0x50')](_0x4a69f8[_0x4ecd('0x4f')])[_0x4ecd('0x26')](respondWithResult(_0x2869cc,0xc9))[_0x4ecd('0x45')](handleError(_0x2869cc,null));};exports[_0x4ecd('0x56')]=function(_0x3ad04a,_0x3cb7da,_0x46d78d){return db['Attachment']['findOne']({'where':{'id':_0x3ad04a[_0x4ecd('0x47')]['id']},'raw':!![]})[_0x4ecd('0x26')](handleEntityNotFound(_0x3cb7da,null))[_0x4ecd('0x26')](function(_0x39b149){if(_0x39b149){var _0x39c1b2=_0x39b149['ChatOfflineMessageId']!==null;var _0x2be4be=path['join'](config['root'],_0x4ecd('0x57'));if(_0x39c1b2){_0x2be4be=path[_0x4ecd('0x58')](_0x2be4be,_0x4ecd('0x59'));}var _0x194b64=path[_0x4ecd('0x58')](_0x2be4be,_0x39b149[_0x4ecd('0x52')]);return _0x3cb7da['download'](_0x194b64);}})[_0x4ecd('0x45')](handleError(_0x3cb7da,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 5fa591a..72c908b 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 _0x2c7f=['Attachment','attachments','lodash','util','api','moment','path','rimraf','../../config/environment','./attachment.attributes','exports','define'];(function(_0x2e9a71,_0x206d47){var _0x59955f=function(_0x1d6554){while(--_0x1d6554){_0x2e9a71['push'](_0x2e9a71['shift']());}};_0x59955f(++_0x206d47);}(_0x2c7f,0x1be));var _0xf2c7=function(_0x1333e7,_0x560caa){_0x1333e7=_0x1333e7-0x0;var _0x175b01=_0x2c7f[_0x1333e7];return _0x175b01;};'use strict';var _=require(_0xf2c7('0x0'));var util=require(_0xf2c7('0x1'));var logger=require('../../config/logger')(_0xf2c7('0x2'));var moment=require(_0xf2c7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf2c7('0x4'));var rimraf=require(_0xf2c7('0x5'));var config=require(_0xf2c7('0x6'));var attributes=require(_0xf2c7('0x7'));module[_0xf2c7('0x8')]=function(_0x6adcc6,_0x3c4ac9){return _0x6adcc6[_0xf2c7('0x9')](_0xf2c7('0xa'),attributes,{'tableName':_0xf2c7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3e73=['Attachment','attachments','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','define'];(function(_0x43f9cb,_0x395f16){var _0x56e717=function(_0x49fb96){while(--_0x49fb96){_0x43f9cb['push'](_0x43f9cb['shift']());}};_0x56e717(++_0x395f16);}(_0x3e73,0x122));var _0x33e7=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x3e73[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0x33e7('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x33e7('0x1'));var moment=require(_0x33e7('0x2'));var BPromise=require(_0x33e7('0x3'));var rp=require(_0x33e7('0x4'));var fs=require('fs');var path=require(_0x33e7('0x5'));var rimraf=require(_0x33e7('0x6'));var config=require(_0x33e7('0x7'));var attributes=require(_0x33e7('0x8'));module['exports']=function(_0x52b033,_0x4d31d4){return _0x52b033[_0x33e7('0x9')](_0x33e7('0xa'),attributes,{'tableName':_0x33e7('0xb'),'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 5d5eb0c..c4744ac 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 _0x2504=['catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','error','code','Attachment,\x20%s,\x20%s','message','result'];(function(_0x3ceab8,_0x30486f){var _0x3e9fe3=function(_0x33bd73){while(--_0x33bd73){_0x3ceab8['push'](_0x3ceab8['shift']());}};_0x3e9fe3(++_0x30486f);}(_0x2504,0xee));var _0x4250=function(_0x3e5f50,_0x4c4c90){_0x3e5f50=_0x3e5f50-0x0;var _0xe51297=_0x2504[_0x3e5f50];return _0xe51297;};'use strict';var _=require(_0x4250('0x0'));var util=require(_0x4250('0x1'));var moment=require(_0x4250('0x2'));var BPromise=require(_0x4250('0x3'));var rs=require(_0x4250('0x4'));var fs=require('fs');var Redis=require(_0x4250('0x5'));var db=require(_0x4250('0x6'))['db'];var utils=require(_0x4250('0x7'));var logger=require(_0x4250('0x8'))(_0x4250('0x9'));var config=require(_0x4250('0xa'));var jayson=require(_0x4250('0xb'));var client=jayson['client'][_0x4250('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4e177e,_0x5a5286,_0x370998){return new BPromise(function(_0x477312,_0x1a3b57){return client[_0x4250('0xd')](_0x4e177e,_0x370998)[_0x4250('0xe')](function(_0x51ea6f){logger[_0x4250('0xf')]('Attachment,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'));logger[_0x4250('0x11')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5a5286,_0x4250('0x10'),JSON['stringify'](_0x51ea6f));if(_0x51ea6f['error']){if(_0x51ea6f[_0x4250('0x12')][_0x4250('0x13')]===0x1f4){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')]['message']);return _0x1a3b57(_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);}logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x51ea6f[_0x4250('0x12')][_0x4250('0x15')]);return _0x477312(_0x51ea6f['error'][_0x4250('0x15')]);}else{logger[_0x4250('0xf')](_0x4250('0x14'),_0x5a5286,_0x4250('0x10'));_0x477312(_0x51ea6f[_0x4250('0x16')][_0x4250('0x15')]);}})[_0x4250('0x17')](function(_0x4e70fc){logger[_0x4250('0x12')](_0x4250('0x14'),_0x5a5286,_0x4e70fc);_0x1a3b57(_0x4e70fc);});});}exports[_0x4250('0x18')]=function(_0x17a8a9){var _0x369010=this;return new Promise(function(_0x30e48c,_0x14d590){return db['Attachment'][_0x4250('0x19')](_0x17a8a9['body'],{'raw':_0x17a8a9['options']?_0x17a8a9[_0x4250('0x1a')][_0x4250('0x1b')]===undefined?!![]:![]:!![]})[_0x4250('0xe')](function(_0x42c331){logger[_0x4250('0xf')](_0x4250('0x18'),_0x17a8a9);logger[_0x4250('0x11')](_0x4250('0x18'),_0x17a8a9,JSON[_0x4250('0x1c')](_0x42c331));_0x30e48c(_0x42c331);})[_0x4250('0x17')](function(_0x728862){logger[_0x4250('0x12')]('CreateAttachment',_0x728862[_0x4250('0x15')],_0x17a8a9);_0x14d590(_0x369010[_0x4250('0x12')](0x1f4,_0x728862[_0x4250('0x15')]));});});};
\ No newline at end of file
+var _0x07c3=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','CreateAttachment','body','options','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x275e07,_0x3a2a1a){var _0x5b8eae=function(_0x3c1a99){while(--_0x3c1a99){_0x275e07['push'](_0x275e07['shift']());}};_0x5b8eae(++_0x3a2a1a);}(_0x07c3,0x1bf));var _0x307c=function(_0x46aaaa,_0x3af897){_0x46aaaa=_0x46aaaa-0x0;var _0x26d04e=_0x07c3[_0x46aaaa];return _0x26d04e;};'use strict';var _=require(_0x307c('0x0'));var util=require(_0x307c('0x1'));var moment=require(_0x307c('0x2'));var BPromise=require(_0x307c('0x3'));var rs=require(_0x307c('0x4'));var fs=require('fs');var Redis=require(_0x307c('0x5'));var db=require(_0x307c('0x6'))['db'];var utils=require(_0x307c('0x7'));var logger=require('../../config/logger')(_0x307c('0x8'));var config=require(_0x307c('0x9'));var jayson=require(_0x307c('0xa'));var client=jayson[_0x307c('0xb')][_0x307c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x410ae8,_0x39af52,_0x3f5d08){return new BPromise(function(_0xfb14bf,_0x166467){return client[_0x307c('0xd')](_0x410ae8,_0x3f5d08)[_0x307c('0xe')](function(_0x1af97f){logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,'request\x20sent');logger[_0x307c('0x11')](_0x307c('0x12'),_0x39af52,_0x307c('0x13'),JSON[_0x307c('0x14')](_0x1af97f));if(_0x1af97f['error']){if(_0x1af97f['error'][_0x307c('0x15')]===0x1f4){logger['error'](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')]['message']);return _0x166467(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);return _0xfb14bf(_0x1af97f[_0x307c('0x16')][_0x307c('0x17')]);}else{logger[_0x307c('0xf')](_0x307c('0x10'),_0x39af52,_0x307c('0x13'));_0xfb14bf(_0x1af97f[_0x307c('0x18')]['message']);}})[_0x307c('0x19')](function(_0x364441){logger[_0x307c('0x16')](_0x307c('0x10'),_0x39af52,_0x364441);_0x166467(_0x364441);});});}exports[_0x307c('0x1a')]=function(_0x2e21a6){var _0x3e05e2=this;return new Promise(function(_0x13f03b,_0xbfe2b4){return db['Attachment']['create'](_0x2e21a6[_0x307c('0x1b')],{'raw':_0x2e21a6['options']?_0x2e21a6[_0x307c('0x1c')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x4bcc1a){logger[_0x307c('0xf')]('CreateAttachment',_0x2e21a6);logger[_0x307c('0x11')](_0x307c('0x1a'),_0x2e21a6,JSON['stringify'](_0x4bcc1a));_0x13f03b(_0x4bcc1a);})[_0x307c('0x19')](function(_0x45fe2){logger['error'](_0x307c('0x1a'),_0x45fe2[_0x307c('0x17')],_0x2e21a6);_0xbfe2b4(_0x3e05e2[_0x307c('0x16')](0x1f4,_0x45fe2[_0x307c('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index a2ba6fc..b4aac6d 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 _0x2032=['./attachment.controller','get','isAuthenticated','index','/:id','show','download','/:id/clone','clone','root','server/files/attachments/','now','post','single','file','create','put','update','delete','destroy','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment'];(function(_0x5ede62,_0x312856){var _0x4a43ec=function(_0x2c5607){while(--_0x2c5607){_0x5ede62['push'](_0x5ede62['shift']());}};_0x4a43ec(++_0x312856);}(_0x2032,0xd9));var _0x2203=function(_0x51bc22,_0xa61444){_0x51bc22=_0x51bc22-0x0;var _0xee8e68=_0x2032[_0x51bc22];return _0xee8e68;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var fs_extra=require(_0x2203('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var controller=require(_0x2203('0x7'));router[_0x2203('0x8')]('/',auth[_0x2203('0x9')](),controller[_0x2203('0xa')]);router[_0x2203('0x8')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0xc')]);router[_0x2203('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x2203('0xd')]);router['post'](_0x2203('0xe'),auth[_0x2203('0x9')](),controller[_0x2203('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x849049,_0x4a6832,_0x3f690a){_0x3f690a(null,path['join'](config[_0x2203('0x10')],_0x2203('0x11')));},'filename':function(_0x4b9376,_0x583bc7,_0x585c76){_0x585c76(null,util['format']('%s-%s',Date[_0x2203('0x12')](),_0x583bc7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2203('0x13')]('/',upload[_0x2203('0x14')](_0x2203('0x15')),controller[_0x2203('0x16')]);router[_0x2203('0x17')](_0x2203('0xb'),auth[_0x2203('0x9')](),controller[_0x2203('0x18')]);router[_0x2203('0x19')](_0x2203('0xb'),auth['isAuthenticated'](),controller[_0x2203('0x1a')]);module[_0x2203('0x1b')]=router;
\ No newline at end of file
+var _0x0b0e=['/:id/clone','clone','diskStorage','join','server/files/attachments/','format','now','originalname','replace','single','create','/:id','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','show','/:id/download','post'];(function(_0x5c9307,_0x5b97e4){var _0x373e29=function(_0xefebbd){while(--_0xefebbd){_0x5c9307['push'](_0x5c9307['shift']());}};_0x373e29(++_0x5b97e4);}(_0x0b0e,0x187));var _0xe0b0=function(_0xf31767,_0x381746){_0xf31767=_0xf31767-0x0;var _0x24bd0c=_0x0b0e[_0xf31767];return _0x24bd0c;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var fs_extra=require(_0xe0b0('0x4'));var auth=require(_0xe0b0('0x5'));var interaction=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var controller=require(_0xe0b0('0x8'));router[_0xe0b0('0x9')]('/',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0xb')]);router[_0xe0b0('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xe0b0('0xc')]);router[_0xe0b0('0x9')](_0xe0b0('0xd'),auth[_0xe0b0('0xa')](),controller['download']);router[_0xe0b0('0xe')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);var upload=multer({'storage':multer[_0xe0b0('0x11')]({'destination':function(_0x574d96,_0x399320,_0x2cdad2){_0x2cdad2(null,path[_0xe0b0('0x12')](config['root'],_0xe0b0('0x13')));},'filename':function(_0x1c358a,_0x3cc19a,_0x45f914){_0x45f914(null,util[_0xe0b0('0x14')]('%s-%s',Date[_0xe0b0('0x15')](),_0x3cc19a[_0xe0b0('0x16')][_0xe0b0('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe0b0('0xe')]('/',upload[_0xe0b0('0x18')]('file'),controller[_0xe0b0('0x19')]);router['put'](_0xe0b0('0x1a'),auth[_0xe0b0('0xa')](),controller['update']);router[_0xe0b0('0x1b')]('/:id',auth[_0xe0b0('0xa')](),controller[_0xe0b0('0x1c')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 9e4713d..3b7485b 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 _0x41dc=['User','map','value','admin','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','clearBlockUser','getLicense','lodash','passport','passport-google-oauth20','Strategy','moment','../../mysqldb','signToken','../../config/utils','login','authenticate','/login','profile','email','callback','google','use','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then'];(function(_0x9a36ec,_0x7afd44){var _0x397955=function(_0x16e50e){while(--_0x16e50e){_0x9a36ec['push'](_0x9a36ec['shift']());}};_0x397955(++_0x7afd44);}(_0x41dc,0x148));var _0xc41d=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x41dc[_0x18ab2a];return _0x16dcee;};'use strict';var _=require(_0xc41d('0x0'));var passport=require(_0xc41d('0x1'));var GoogleStrategy=require(_0xc41d('0x2'))[_0xc41d('0x3')];var moment=require(_0xc41d('0x4'));var db=require(_0xc41d('0x5'))['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xc41d('0x6')];var utils=require(_0xc41d('0x7'));exports[_0xc41d('0x8')]=passport[_0xc41d('0x9')]('google',{'failureRedirect':_0xc41d('0xa'),'scope':[_0xc41d('0xb'),_0xc41d('0xc')],'session':![]});exports[_0xc41d('0xd')]=passport['authenticate'](_0xc41d('0xe'),{'failureRedirect':_0xc41d('0xa'),'session':![]});passport[_0xc41d('0xf')](new GoogleStrategy({'clientID':config[_0xc41d('0xe')]?config[_0xc41d('0xe')]['clientID']:'id','clientSecret':config['google']?config['google']['clientSecret']:'secret','callbackURL':config[_0xc41d('0xe')]?config['google'][_0xc41d('0x10')]:''},function(_0x4f3b8d,_0x441066,_0x4ec897,_0x1309bc){var _0x6471c2,_0x45e1b1;return db[_0xc41d('0x11')][_0xc41d('0x12')]({'where':{'id':0x1},'attributes':[_0xc41d('0x13'),_0xc41d('0x14')],'raw':!![]})[_0xc41d('0x15')](function(_0x55e5f8){_0x6471c2=_0x55e5f8;return db[_0xc41d('0x16')]['find']({'where':{'email':_[_0xc41d('0x17')](_0x4ec897['emails'],_0xc41d('0x18')),'role':{'$or':[_0xc41d('0x19'),_0xc41d('0x1a'),_0xc41d('0x1b')]}}});})[_0xc41d('0x15')](function(_0x54e997){_0x45e1b1=_0x54e997;if(_0x45e1b1){if(_0x45e1b1[_0xc41d('0x1c')]){return _0x1309bc(_0xc41d('0x1d'));}else if(_0x6471c2[_0xc41d('0x14')]>0x0){if(_0x45e1b1[_0xc41d('0x1e')]){if(moment(_0x45e1b1[_0xc41d('0x1f')])[_0xc41d('0x20')](_0x6471c2[_0xc41d('0x14')],'minutes')>moment()){return _0x1309bc(_0xc41d('0x1d'));}else{return utils[_0xc41d('0x21')](_0x45e1b1,0x0,![],null)[_0xc41d('0x15')](function(){return utils[_0xc41d('0x22')](_0x45e1b1);})['then'](function(){return _0x1309bc(null,_0x45e1b1);});}}else{return utils['getLicense'](_0x45e1b1)[_0xc41d('0x15')](function(){return _0x1309bc(null,_0x45e1b1);});}}else{return utils[_0xc41d('0x22')](_0x45e1b1)['then'](function(){return _0x1309bc(null,_0x45e1b1);});}}return _0x1309bc('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})['catch'](function(_0x3e6160){_0x1309bc(_0x3e6160);});}));
\ No newline at end of file
+var _0xbe53=['disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','minutes','clearBlockUser','then','getLicense','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','authenticate','google','/login','email','use','clientSecret','secret','callbackURL','Setting','allowedLoginAttempts','blockDuration','User','map','emails','user','agent'];(function(_0x550eaa,_0x4302ab){var _0x4db477=function(_0x59820c){while(--_0x59820c){_0x550eaa['push'](_0x550eaa['shift']());}};_0x4db477(++_0x4302ab);}(_0xbe53,0x1ba));var _0x3be5=function(_0x4b7a91,_0x3d7cd2){_0x4b7a91=_0x4b7a91-0x0;var _0x2fd4b9=_0xbe53[_0x4b7a91];return _0x2fd4b9;};'use strict';var _=require('lodash');var passport=require(_0x3be5('0x0'));var GoogleStrategy=require(_0x3be5('0x1'))['Strategy'];var moment=require(_0x3be5('0x2'));var db=require(_0x3be5('0x3'))['db'];var config=require(_0x3be5('0x4'));var signToken=require('../../components/auth/service')[_0x3be5('0x5')];var utils=require(_0x3be5('0x6'));exports['login']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'scope':['profile',_0x3be5('0xa')],'session':![]});exports['callback']=passport[_0x3be5('0x7')](_0x3be5('0x8'),{'failureRedirect':_0x3be5('0x9'),'session':![]});passport[_0x3be5('0xb')](new GoogleStrategy({'clientID':config[_0x3be5('0x8')]?config['google']['clientID']:'id','clientSecret':config[_0x3be5('0x8')]?config[_0x3be5('0x8')][_0x3be5('0xc')]:_0x3be5('0xd'),'callbackURL':config['google']?config[_0x3be5('0x8')][_0x3be5('0xe')]:''},function(_0x52e48f,_0xa358f9,_0x55b7e7,_0x328516){var _0xa25786,_0x35c0de;return db[_0x3be5('0xf')]['findOne']({'where':{'id':0x1},'attributes':[_0x3be5('0x10'),_0x3be5('0x11')],'raw':!![]})['then'](function(_0x1439ff){_0xa25786=_0x1439ff;return db[_0x3be5('0x12')]['find']({'where':{'email':_[_0x3be5('0x13')](_0x55b7e7[_0x3be5('0x14')],'value'),'role':{'$or':['admin',_0x3be5('0x15'),_0x3be5('0x16')]}}});})['then'](function(_0x49acca){_0x35c0de=_0x49acca;if(_0x35c0de){if(_0x35c0de[_0x3be5('0x17')]){return _0x328516(_0x3be5('0x18'));}else if(_0xa25786[_0x3be5('0x11')]>0x0){if(_0x35c0de[_0x3be5('0x19')]){if(moment(_0x35c0de[_0x3be5('0x1a')])['add'](_0xa25786[_0x3be5('0x11')],_0x3be5('0x1b'))>moment()){return _0x328516(_0x3be5('0x18'));}else{return utils[_0x3be5('0x1c')](_0x35c0de,0x0,![],null)[_0x3be5('0x1d')](function(){return utils[_0x3be5('0x1e')](_0x35c0de);})[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils[_0x3be5('0x1e')](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}else{return utils['getLicense'](_0x35c0de)[_0x3be5('0x1d')](function(){return _0x328516(null,_0x35c0de);});}}return _0x328516(_0x3be5('0x18'));})['catch'](function(_0x2a1dd8){_0x328516(_0x2a1dd8);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index 3e44dc5..6a16d7d 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 _0x41c1=['get','/callback','callback','isMiddleware','setTokenCookie','exports','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x41c1,0x103));var _0x141c=function(_0x2fa771,_0x511aec){_0x2fa771=_0x2fa771-0x0;var _0x8f89c2=_0x41c1[_0x2fa771];return _0x8f89c2;};'use strict';var express=require('express');var passport=require(_0x141c('0x0'));var router=express[_0x141c('0x1')]();var controller=require(_0x141c('0x2'));var userController=require(_0x141c('0x3'));var authService=require(_0x141c('0x4'));router[_0x141c('0x5')]('/',controller['login']);router['get'](_0x141c('0x6'),controller[_0x141c('0x7')],authService[_0x141c('0x8')],userController['login'],authService[_0x141c('0x9')]);module[_0x141c('0xa')]=router;
\ No newline at end of file
+var _0x24d3=['isMiddleware','setTokenCookie','exports','express','passport','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x4efe2c,_0x4e01b0){var _0x146de7=function(_0x43216f){while(--_0x43216f){_0x4efe2c['push'](_0x4efe2c['shift']());}};_0x146de7(++_0x4e01b0);}(_0x24d3,0xcf));var _0x324d=function(_0x428751,_0x1eb9c3){_0x428751=_0x428751-0x0;var _0x147aff=_0x24d3[_0x428751];return _0x147aff;};'use strict';var express=require(_0x324d('0x0'));var passport=require(_0x324d('0x1'));var router=express[_0x324d('0x2')]();var controller=require(_0x324d('0x3'));var userController=require(_0x324d('0x4'));var authService=require(_0x324d('0x5'));router[_0x324d('0x6')]('/',controller[_0x324d('0x7')]);router['get'](_0x324d('0x8'),controller['callback'],authService[_0x324d('0x9')],userController[_0x324d('0x7')],authService[_0x324d('0xa')]);module[_0x324d('0xb')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 6c305b8..a7c26a5 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 _0xa15b=['catch','MailAccount','find','email','MailServerOut','service','Smtp','host','port','secure','auth','pass','\x22%s\x22\x20<%s>','request','error','format','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','send','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','json','online','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','now','save','xCally\x20Motion\x20Password\x20Reset','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://','headers','/reset/','status','Reset\x20Email\x20sent!','User','params','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','name','password','salt','disabled','blocked','blockedAt','loginAttempts','admin','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes','clearBlockUser','getLicense'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0xa15b,0x1e6));var _0xba15=function(_0x1a97c7,_0x556227){_0x1a97c7=_0x1a97c7-0x0;var _0x3bfa53=_0xa15b[_0x1a97c7];return _0x3bfa53;};'use strict';var util=require(_0xba15('0x0'));var passport=require(_0xba15('0x1'));var LocalStrategy=require(_0xba15('0x2'))[_0xba15('0x3')];var jayson=require(_0xba15('0x4'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0xba15('0x5'));var db=require(_0xba15('0x6'))['db'];var authService=require(_0xba15('0x7'));var utils=require(_0xba15('0x8'));var client=jayson[_0xba15('0x9')][_0xba15('0xa')]({'port':0x232b});function localAuthenticate(_0x1df67e,_0x9b1ed1,_0x313a88,_0x553c91){var _0x51d2b4,_0x46abb3;return db[_0xba15('0xb')][_0xba15('0xc')]({'where':{'id':0x1},'attributes':[_0xba15('0xd'),_0xba15('0xe')],'raw':!![]})['then'](function(_0x4a843e){_0x51d2b4=_0x4a843e;return _0x1df67e['findOne']({'attributes':['id',_0xba15('0xf'),_0xba15('0x10'),_0xba15('0x11'),'role',_0xba15('0x12'),_0xba15('0x13'),_0xba15('0x14'),_0xba15('0x15')],'where':{'name':_0x9b1ed1,'role':{'$or':[_0xba15('0x16'),'user','agent']}}});})[_0xba15('0x17')](function(_0x573c36){if(!_0x573c36||_0x573c36&&_0x573c36[_0xba15('0xf')]!==_0x9b1ed1){throw new Error(_0xba15('0x18'));}else{_0x46abb3=_0x573c36;return _0x46abb3;}})['then'](function(){_0x46abb3[_0xba15('0x19')](_0x313a88,function(_0x33aba3,_0x224c5b){var _0x231051=_0x46abb3[_0xba15('0x15')]+0x1;if(_0x33aba3){return _0x553c91(_0x33aba3);}else if(!_0x224c5b){if(_0x46abb3['disabled']){return _0x553c91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x51d2b4[_0xba15('0xd')]>0x0){if(_0x46abb3[_0xba15('0x13')]){if(_0x51d2b4[_0xba15('0xe')]>0x0){if(moment(_0x46abb3[_0xba15('0x14')])[_0xba15('0x1a')](_0x51d2b4[_0xba15('0xe')],_0xba15('0x1b'))>moment()){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else{return utils[_0xba15('0x1c')](_0x46abb3,_0x231051,![],null)[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{if(_0x231051>=_0x51d2b4['allowedLoginAttempts']){return utils['clearBlockUser'](_0x46abb3,0x0,!![],moment())[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}else{return utils[_0xba15('0x1c')](_0x46abb3,_0x231051,![],null)[_0xba15('0x17')](function(){return _0x553c91(null,![],{'message':_0xba15('0x18')});});}}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{if(_0x46abb3[_0xba15('0x12')]){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else if(_0x51d2b4[_0xba15('0xd')]>0x0){if(_0x46abb3['blocked']){if(_0x51d2b4[_0xba15('0xe')]>0x0){if(moment(_0x46abb3[_0xba15('0x14')])['add'](_0x51d2b4[_0xba15('0xe')],_0xba15('0x1b'))>moment()){return _0x553c91(null,![],{'message':_0xba15('0x18')});}else{return utils['clearBlockUser'](_0x46abb3,0x0,![],null)[_0xba15('0x17')](function(){return utils[_0xba15('0x1d')](_0x46abb3);})[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);});}}else{return _0x553c91(null,![],{'message':_0xba15('0x18')});}}else{return utils[_0xba15('0x1c')](_0x46abb3,0x0,![],null)[_0xba15('0x17')](function(){return utils['getLicense'](_0x46abb3);})[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);})[_0xba15('0x1e')](function(_0x3aa75c){return _0x553c91(null,![],_0x3aa75c);});}}else{if(_0x46abb3[_0xba15('0x13')]){return _0x553c91(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils['getLicense'](_0x46abb3)[_0xba15('0x17')](function(){return _0x553c91(null,_0x46abb3);});}}}});})['catch'](function(_0x38fe79){return _0x553c91(null,![],_0x38fe79);});}function sendServiceMail(_0x2b37d9){return db[_0xba15('0x1f')][_0xba15('0x20')]({'where':{'service':!![]},'attributes':['id',_0xba15('0xf'),_0xba15('0x21')],'include':[{'model':db[_0xba15('0x22')],'as':'Smtp'}]})[_0xba15('0x17')](function(_0x5137fe){if(!_0x5137fe){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x430c71={'tls':{'rejectUnauthorized':![]}};if(_0x5137fe['Smtp']['service']){_0x430c71[_0xba15('0x23')]=_0x5137fe[_0xba15('0x24')][_0xba15('0x23')];}else{_0x430c71[_0xba15('0x25')]=_0x5137fe['Smtp']['host'];_0x430c71['port']=_0x5137fe[_0xba15('0x24')][_0xba15('0x26')];_0x430c71[_0xba15('0x27')]=_0x5137fe['Smtp'][_0xba15('0x27')];}if(_0x5137fe['Smtp']['authentication']){_0x430c71[_0xba15('0x28')]={'user':_0x5137fe[_0xba15('0x24')]['user'],'pass':_0x5137fe[_0xba15('0x24')][_0xba15('0x29')]};}var _0x2bc433={'account':_0x430c71,'message':_['merge']({'from':util['format'](_0xba15('0x2a'),_0x5137fe['name'],_0x5137fe[_0xba15('0x21')]||_0x5137fe['Smtp']['user'])},_0x2b37d9)};return client[_0xba15('0x2b')]('SendMail',_0x2bc433);})[_0xba15('0x17')](function(_0x33911e){if(_0x33911e[_0xba15('0x2c')]){throw new Error(util[_0xba15('0x2d')](_0xba15('0x2e'),_0x33911e[_0xba15('0x2c')][_0xba15('0x2f')]||JSON[_0xba15('0x30')](_0x33911e[_0xba15('0x2c')])));}return!![];});}function handleError(_0x575a06,_0xa80376,_0x1e61c7){return _0x575a06['status'](_0xa80376||0x1f4)[_0xba15('0x31')]({'message':_0x1e61c7?_0x1e61c7[_0xba15('0x2f')]||_0x1e61c7:''});}exports['login']=function(_0x470614,_0x189d80,_0x2eba37){passport[_0xba15('0x19')](_0xba15('0x32'),function(_0x3259db,_0x589435,_0x3ae369){var _0x1ec556=_0x3259db||_0x3ae369;if(_0x1ec556){return handleError(_0x189d80,0x191,_0x1ec556);}if(!_0x589435){return handleError(_0x189d80,0x194,{'message':_0xba15('0x33')});}else{var _0x1023b7={'payload':{'id':_0x589435['id'],'role':_0x589435[_0xba15('0x34')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x1023b7)[_0xba15('0x17')](function(_0x123d9e){_0x189d80[_0xba15('0x35')]({'id':_0x589435['id'],'token':_0x123d9e,'statusCall':'','isAlreadyLogged':_0x589435[_0xba15('0x36')]});});}})(_0x470614,_0x189d80,_0x2eba37);};exports[_0xba15('0x37')]=function(_0x3ac4e2,_0x363504,_0x1fd6b8){if(!_0x3ac4e2[_0xba15('0x38')][_0xba15('0x21')]){return handleError(_0x363504,0x1f4,{'message':_0xba15('0x39')});}var _0x4f9fad=rs[_0xba15('0x3a')]();_0x3ac4e2[_0xba15('0x38')]['email']=_0x3ac4e2['body'][_0xba15('0x21')][_0xba15('0x3b')]()[_0xba15('0x3c')]();var _0x90261e;return db[_0xba15('0xb')][_0xba15('0xc')]({'where':{'id':0x1},'attributes':[_0xba15('0xd'),_0xba15('0xe')],'raw':!![]})[_0xba15('0x17')](function(_0x57ac86){_0x90261e=_0x57ac86;return db['User'][_0xba15('0x20')]({'where':{'email':_0x3ac4e2[_0xba15('0x38')][_0xba15('0x21')]}});})[_0xba15('0x17')](function(_0x35802c){if(!_0x35802c){throw new Error(_0xba15('0x3d'));}if(_0x35802c[_0xba15('0x12')]){throw new Error(_0xba15('0x3e'));}if(_0x35802c[_0xba15('0x13')]){if(moment(_0x35802c['blockedAt'])[_0xba15('0x1a')](_0x90261e[_0xba15('0xe')],_0xba15('0x1b'))>moment()){throw new Error(_0xba15('0x3f'));}else{_0x35802c['blocked']=![];_0x35802c['blockedAt']=null;}}_0x35802c[_0xba15('0x40')]=_0x4f9fad;_0x35802c[_0xba15('0x41')]=Date[_0xba15('0x42')]()+0x36ee80;return _0x35802c[_0xba15('0x43')]();})[_0xba15('0x17')](function(){return sendServiceMail({'to':_0x3ac4e2[_0xba15('0x38')]['email'],'subject':_0xba15('0x44'),'text':_0xba15('0x45')+_0xba15('0x46')+_0xba15('0x47')+_0x3ac4e2[_0xba15('0x48')][_0xba15('0x25')]+_0xba15('0x49')+_0x4f9fad+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xba15('0x17')](function(){_0x363504[_0xba15('0x4a')](0xc8)[_0xba15('0x31')]({'message':_0xba15('0x4b')});})[_0xba15('0x1e')](function(_0x3065bb){return handleError(_0x363504,0x1f4,_0x3065bb);});};exports['reset']=function(_0x335c26,_0x5e31f2,_0x1d5b33){return db[_0xba15('0x4c')][_0xba15('0x20')]({'where':{'resetPasswordToken':_0x335c26[_0xba15('0x4d')]['token'],'resetPasswordExpires':{'$gt':Date[_0xba15('0x42')]()}}})['then'](function(_0x3f32cd){if(!_0x3f32cd){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0xba15('0xc')]({'attributes':['id',_0xba15('0x4e'),_0xba15('0x4f'),_0xba15('0x50')]})[_0xba15('0x17')](function(_0x314f80){if(_0x314f80[_0xba15('0x4e')])authService[_0xba15('0x51')](_0x335c26[_0xba15('0x38')][_0xba15('0x10')]);if(!_0x314f80[_0xba15('0x4f')]||!_0x3f32cd[_0xba15('0x52')])return _0x3f32cd;authService[_0xba15('0x53')](_0x335c26[_0xba15('0x38')][_0xba15('0x10')],_0x3f32cd[_0xba15('0x52')],_0x314f80['passwordHistoryLimit']);return _0x3f32cd;})[_0xba15('0x17')](function(){_0x3f32cd[_0xba15('0x10')]=_0x335c26[_0xba15('0x38')][_0xba15('0x10')];_0x3f32cd[_0xba15('0x40')]=null;_0x3f32cd[_0xba15('0x41')]=null;return _0x3f32cd['save']();});})[_0xba15('0x17')](function(){_0x5e31f2[_0xba15('0x4a')](0xc8)[_0xba15('0x31')]({'message':_0xba15('0x54')});})['catch'](function(_0x3502ef){return handleError(_0x5e31f2,0x1f4,_0x3502ef);});};passport[_0xba15('0x55')](new LocalStrategy({'usernameField':_0xba15('0xf'),'passwordField':_0xba15('0x10')},function(_0x589f07,_0x20d2e3,_0x4d94d2){return localAuthenticate(db[_0xba15('0x4c')],_0x589f07,_0x20d2e3,_0x4d94d2);}));
\ No newline at end of file
+var _0xb2e3=['then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','clearBlockUser','blocked','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','send','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','xCally\x20Motion\x20Password\x20Reset','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://','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','params','token','now','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts'];(function(_0x38fe24,_0x239dd9){var _0x245a09=function(_0x58862a){while(--_0x58862a){_0x38fe24['push'](_0x38fe24['shift']());}};_0x245a09(++_0x239dd9);}(_0xb2e3,0xf9));var _0x3b2e=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xb2e3[_0x3bf83f];return _0x22c4a9;};'use strict';var util=require(_0x3b2e('0x0'));var passport=require(_0x3b2e('0x1'));var LocalStrategy=require(_0x3b2e('0x2'))[_0x3b2e('0x3')];var jayson=require(_0x3b2e('0x4'));var _=require(_0x3b2e('0x5'));var rs=require(_0x3b2e('0x6'));var moment=require('moment');var db=require(_0x3b2e('0x7'))['db'];var authService=require(_0x3b2e('0x8'));var utils=require(_0x3b2e('0x9'));var client=jayson[_0x3b2e('0xa')][_0x3b2e('0xb')]({'port':0x232b});function localAuthenticate(_0x44a2f2,_0x52a011,_0x1b6c7b,_0x3f0b9b){var _0x1191c4,_0x3f8b69;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x17d3f4){_0x1191c4=_0x17d3f4;return _0x44a2f2[_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x11'),_0x3b2e('0x12'),_0x3b2e('0x13'),_0x3b2e('0x14'),'blocked',_0x3b2e('0x15'),_0x3b2e('0x16')],'where':{'name':_0x52a011,'role':{'$or':[_0x3b2e('0x17'),_0x3b2e('0x18'),_0x3b2e('0x19')]}}});})[_0x3b2e('0xf')](function(_0x4e2ff0){if(!_0x4e2ff0||_0x4e2ff0&&_0x4e2ff0[_0x3b2e('0x10')]!==_0x52a011){throw new Error(_0x3b2e('0x1a'));}else{_0x3f8b69=_0x4e2ff0;return _0x3f8b69;}})[_0x3b2e('0xf')](function(){_0x3f8b69['authenticate'](_0x1b6c7b,function(_0x37591c,_0x467925){var _0x256658=_0x3f8b69['loginAttempts']+0x1;if(_0x37591c){return _0x3f0b9b(_0x37591c);}else if(!_0x467925){if(_0x3f8b69[_0x3b2e('0x14')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4[_0x3b2e('0xe')]>0x0){if(_0x3f8b69['blocked']){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4['blockDuration'],'minutes')>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)['then'](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x256658>=_0x1191c4[_0x3b2e('0xe')]){return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,!![],moment())[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,_0x256658,![],null)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});});}}}else{return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}}else{if(_0x3f8b69['disabled']){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else if(_0x1191c4['allowedLoginAttempts']>0x0){if(_0x3f8b69[_0x3b2e('0x1d')]){if(_0x1191c4[_0x3b2e('0x1b')]>0x0){if(moment(_0x3f8b69[_0x3b2e('0x15')])['add'](_0x1191c4[_0x3b2e('0x1b')],_0x3b2e('0x1e'))>moment()){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)[_0x3b2e('0xf')](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}else{return _0x3f0b9b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0x3b2e('0x1c')](_0x3f8b69,0x0,![],null)['then'](function(){return utils[_0x3b2e('0x1f')](_0x3f8b69);})['then'](function(){return _0x3f0b9b(null,_0x3f8b69);})[_0x3b2e('0x20')](function(_0xbbe540){return _0x3f0b9b(null,![],_0xbbe540);});}}else{if(_0x3f8b69[_0x3b2e('0x1d')]){return _0x3f0b9b(null,![],{'message':_0x3b2e('0x1a')});}else{return utils[_0x3b2e('0x1f')](_0x3f8b69)[_0x3b2e('0xf')](function(){return _0x3f0b9b(null,_0x3f8b69);});}}}});})[_0x3b2e('0x20')](function(_0xf119a4){return _0x3f0b9b(null,![],_0xf119a4);});}function sendServiceMail(_0x19d381){return db[_0x3b2e('0x21')][_0x3b2e('0x22')]({'where':{'service':!![]},'attributes':['id',_0x3b2e('0x10'),_0x3b2e('0x23')],'include':[{'model':db[_0x3b2e('0x24')],'as':'Smtp'}]})[_0x3b2e('0xf')](function(_0xf2a6f7){if(!_0xf2a6f7){throw new Error(_0x3b2e('0x25'));}var _0x434f52={'tls':{'rejectUnauthorized':![]}};if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')]){_0x434f52[_0x3b2e('0x27')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x27')];}else{_0x434f52[_0x3b2e('0x28')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x28')];_0x434f52[_0x3b2e('0x29')]=_0xf2a6f7['Smtp'][_0x3b2e('0x29')];_0x434f52[_0x3b2e('0x2a')]=_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2a')];}if(_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2b')]){_0x434f52[_0x3b2e('0x2c')]={'user':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x18')],'pass':_0xf2a6f7[_0x3b2e('0x26')][_0x3b2e('0x2d')]};}var _0x2f107e={'account':_0x434f52,'message':_['merge']({'from':util['format'](_0x3b2e('0x2e'),_0xf2a6f7[_0x3b2e('0x10')],_0xf2a6f7[_0x3b2e('0x23')]||_0xf2a6f7[_0x3b2e('0x26')]['user'])},_0x19d381)};return client['request']('SendMail',_0x2f107e);})[_0x3b2e('0xf')](function(_0x1f0610){if(_0x1f0610[_0x3b2e('0x2f')]){throw new Error(util['format'](_0x3b2e('0x30'),_0x1f0610[_0x3b2e('0x2f')][_0x3b2e('0x31')]||JSON['stringify'](_0x1f0610[_0x3b2e('0x2f')])));}return!![];});}function handleError(_0xad25b2,_0x1d0a49,_0x811993){return _0xad25b2['status'](_0x1d0a49||0x1f4)[_0x3b2e('0x32')]({'message':_0x811993?_0x811993[_0x3b2e('0x31')]||_0x811993:''});}exports['login']=function(_0x57bf73,_0x487db1,_0x383bd1){passport[_0x3b2e('0x33')]('local',function(_0x3a281f,_0x58f05d,_0x421290){var _0x48ca40=_0x3a281f||_0x421290;if(_0x48ca40){return handleError(_0x487db1,0x191,_0x48ca40);}if(!_0x58f05d){return handleError(_0x487db1,0x194,{'message':_0x3b2e('0x34')});}else{var _0x899523={'payload':{'id':_0x58f05d['id'],'role':_0x58f05d[_0x3b2e('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0x3b2e('0x35')](_0x899523)[_0x3b2e('0xf')](function(_0x18808a){_0x487db1['json']({'id':_0x58f05d['id'],'token':_0x18808a,'statusCall':'','isAlreadyLogged':_0x58f05d[_0x3b2e('0x36')]});});}})(_0x57bf73,_0x487db1,_0x383bd1);};exports[_0x3b2e('0x37')]=function(_0x194609,_0x451f68,_0x2633ae){if(!_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]){return handleError(_0x451f68,0x1f4,{'message':_0x3b2e('0x39')});}var _0x29498c=rs[_0x3b2e('0x3a')]();_0x194609['body'][_0x3b2e('0x23')]=_0x194609['body'][_0x3b2e('0x23')][_0x3b2e('0x3b')]()[_0x3b2e('0x3c')]();var _0x35549c;return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'where':{'id':0x1},'attributes':[_0x3b2e('0xe'),'blockDuration'],'raw':!![]})[_0x3b2e('0xf')](function(_0x249b3f){_0x35549c=_0x249b3f;return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'email':_0x194609[_0x3b2e('0x38')][_0x3b2e('0x23')]}});})['then'](function(_0x3b3ee6){if(!_0x3b3ee6){throw new Error(_0x3b2e('0x3e'));}if(_0x3b3ee6[_0x3b2e('0x14')]){throw new Error(_0x3b2e('0x3f'));}if(_0x3b3ee6[_0x3b2e('0x1d')]){if(moment(_0x3b3ee6['blockedAt'])[_0x3b2e('0x40')](_0x35549c[_0x3b2e('0x1b')],'minutes')>moment()){throw new Error(_0x3b2e('0x41'));}else{_0x3b3ee6[_0x3b2e('0x1d')]=![];_0x3b3ee6[_0x3b2e('0x15')]=null;}}_0x3b3ee6[_0x3b2e('0x42')]=_0x29498c;_0x3b3ee6[_0x3b2e('0x43')]=Date['now']()+0x36ee80;return _0x3b3ee6['save']();})[_0x3b2e('0xf')](function(){return sendServiceMail({'to':_0x194609[_0x3b2e('0x38')]['email'],'subject':_0x3b2e('0x44'),'text':_0x3b2e('0x45')+_0x3b2e('0x46')+_0x3b2e('0x47')+_0x194609[_0x3b2e('0x48')][_0x3b2e('0x28')]+_0x3b2e('0x49')+_0x29498c+'\x0a\x0a'+_0x3b2e('0x4a')});})['then'](function(){_0x451f68[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':'Reset\x20Email\x20sent!'});})['catch'](function(_0x12cc5f){return handleError(_0x451f68,0x1f4,_0x12cc5f);});};exports['reset']=function(_0x42a43b,_0x1f05c1,_0x235c5a){return db[_0x3b2e('0x3d')][_0x3b2e('0x22')]({'where':{'resetPasswordToken':_0x42a43b[_0x3b2e('0x4c')][_0x3b2e('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x3b2e('0x4e')]()}}})[_0x3b2e('0xf')](function(_0x542b33){if(!_0x542b33){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x3b2e('0xc')][_0x3b2e('0xd')]({'attributes':['id',_0x3b2e('0x4f'),_0x3b2e('0x50'),_0x3b2e('0x51')]})[_0x3b2e('0xf')](function(_0x1f05b2){if(_0x1f05b2[_0x3b2e('0x4f')])authService[_0x3b2e('0x52')](_0x42a43b[_0x3b2e('0x38')]['password']);if(!_0x1f05b2['enforcePasswordHistory']||!_0x542b33[_0x3b2e('0x53')])return _0x542b33;authService[_0x3b2e('0x54')](_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')],_0x542b33[_0x3b2e('0x53')],_0x1f05b2['passwordHistoryLimit']);return _0x542b33;})[_0x3b2e('0xf')](function(){_0x542b33[_0x3b2e('0x11')]=_0x42a43b[_0x3b2e('0x38')][_0x3b2e('0x11')];_0x542b33[_0x3b2e('0x42')]=null;_0x542b33[_0x3b2e('0x43')]=null;return _0x542b33[_0x3b2e('0x55')]();});})[_0x3b2e('0xf')](function(){_0x1f05c1[_0x3b2e('0x4b')](0xc8)[_0x3b2e('0x32')]({'message':_0x3b2e('0x56')});})[_0x3b2e('0x20')](function(_0x3ece9f){return handleError(_0x1f05c1,0x1f4,_0x3ece9f);});};passport[_0x3b2e('0x57')](new LocalStrategy({'usernameField':_0x3b2e('0x10'),'passwordField':_0x3b2e('0x11')},function(_0x5033f2,_0x34869d,_0x5cfb10){return localAuthenticate(db['User'],_0x5033f2,_0x34869d,_0x5cfb10);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 03c0d04..a855aa6 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 _0x7abc=['express','Router','post','login','/forgot','forgot','reset'];(function(_0x25b1f1,_0x314226){var _0x2be1ed=function(_0x4f4480){while(--_0x4f4480){_0x25b1f1['push'](_0x25b1f1['shift']());}};_0x2be1ed(++_0x314226);}(_0x7abc,0xa1));var _0xc7ab=function(_0x1b1211,_0x25a3ec){_0x1b1211=_0x1b1211-0x0;var _0x458eea=_0x7abc[_0x1b1211];return _0x458eea;};'use strict';var express=require(_0xc7ab('0x0'));var router=express[_0xc7ab('0x1')]();var controller=require('./authLocal.controller');router[_0xc7ab('0x2')]('/',controller[_0xc7ab('0x3')]);router[_0xc7ab('0x2')](_0xc7ab('0x4'),controller[_0xc7ab('0x5')]);router['post']('/reset/:token',controller[_0xc7ab('0x6')]);module['exports']=router;
\ No newline at end of file
+var _0x6f46=['exports','express','Router','./authLocal.controller','post','login','forgot','/reset/:token','reset'];(function(_0x2b5513,_0x3fe5cd){var _0x578fd2=function(_0x7a9106){while(--_0x7a9106){_0x2b5513['push'](_0x2b5513['shift']());}};_0x578fd2(++_0x3fe5cd);}(_0x6f46,0x10f));var _0x66f4=function(_0xda5c7c,_0x40f3b4){_0xda5c7c=_0xda5c7c-0x0;var _0x2bb2c2=_0x6f46[_0xda5c7c];return _0x2bb2c2;};'use strict';var express=require(_0x66f4('0x0'));var router=express[_0x66f4('0x1')]();var controller=require(_0x66f4('0x2'));router[_0x66f4('0x3')]('/',controller[_0x66f4('0x4')]);router[_0x66f4('0x3')]('/forgot',controller[_0x66f4('0x5')]);router[_0x66f4('0x3')](_0x66f4('0x6'),controller[_0x66f4('0x7')]);module[_0x66f4('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 6a73f56..e160958 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 _0xdf3e=['INTEGER','exports','STRING','BOOLEAN'];(function(_0x35debf,_0xc16156){var _0x103ae6=function(_0x52037f){while(--_0x52037f){_0x35debf['push'](_0x35debf['shift']());}};_0x103ae6(++_0xc16156);}(_0xdf3e,0x89));var _0xedf3=function(_0x25289c,_0x16ae20){_0x25289c=_0x25289c-0x0;var _0x48a71e=_0xdf3e[_0x25289c];return _0x48a71e;};'use strict';var Sequelize=require('sequelize');module[_0xedf3('0x0')]={'name':{'type':Sequelize[_0xedf3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xedf3('0x1')]},'description':{'type':Sequelize[_0xedf3('0x1')]},'status':{'type':Sequelize[_0xedf3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xedf3('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x3a3e=['STRING','BOOLEAN','INTEGER','sequelize'];(function(_0x225c0b,_0x1cbbc5){var _0x37c039=function(_0x519219){while(--_0x519219){_0x225c0b['push'](_0x225c0b['shift']());}};_0x37c039(++_0x1cbbc5);}(_0x3a3e,0x13b));var _0xe3a3=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x3a3e[_0x4f9b18];return _0x29f20c;};'use strict';var Sequelize=require(_0xe3a3('0x0'));module['exports']={'name':{'type':Sequelize[_0xe3a3('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe3a3('0x1')]},'description':{'type':Sequelize[_0xe3a3('0x1')]},'status':{'type':Sequelize[_0xe3a3('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe3a3('0x3')],'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 cdc05d3..f19cfc5 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 _0x45fd=['fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','Automation','fieldName','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','filters','pick','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','body','find','addConditions','Condition','ids','omit','getConditions','findOne','rawAttributes','order','nolimit','addActions','getActions','eml-format','rimraf','zip-dir'];(function(_0x3daf35,_0x18a6f5){var _0x1cda00=function(_0x5cbecc){while(--_0x5cbecc){_0x3daf35['push'](_0x3daf35['shift']());}};_0x1cda00(++_0x18a6f5);}(_0x45fd,0xf9));var _0xd45f=function(_0x18e915,_0x4fe7bb){_0x18e915=_0x18e915-0x0;var _0x566734=_0x45fd[_0x18e915];return _0x566734;};'use strict';var emlformat=require(_0xd45f('0x0'));var rimraf=require(_0xd45f('0x1'));var zipdir=require(_0xd45f('0x2'));var jsonpatch=require(_0xd45f('0x3'));var rp=require(_0xd45f('0x4'));var moment=require(_0xd45f('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd45f('0x6'));var path=require(_0xd45f('0x7'));var sox=require('sox');var csv=require(_0xd45f('0x8'));var ejs=require(_0xd45f('0x9'));var fs=require('fs');var fs_extra=require(_0xd45f('0xa'));var _=require('lodash');var squel=require(_0xd45f('0xb'));var crypto=require(_0xd45f('0xc'));var jsforce=require(_0xd45f('0xd'));var deskjs=require(_0xd45f('0xe'));var toCsv=require(_0xd45f('0x8'));var querystring=require(_0xd45f('0xf'));var Papa=require(_0xd45f('0x10'));var Redis=require(_0xd45f('0x11'));var authService=require(_0xd45f('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xd45f('0x13'));var hardwareService=require(_0xd45f('0x14'));var logger=require('../../config/logger')(_0xd45f('0x15'));var utils=require('../../config/utils');var config=require(_0xd45f('0x16'));var licenseUtil=require(_0xd45f('0x17'));var db=require(_0xd45f('0x18'))['db'];function respondWithStatusCode(_0x3ae01d,_0x438af0){_0x438af0=_0x438af0||0xcc;return function(_0x2ee37a){if(_0x2ee37a){return _0x3ae01d[_0xd45f('0x19')](_0x438af0);}return _0x3ae01d[_0xd45f('0x1a')](_0x438af0)['end']();};}function respondWithResult(_0x585d0e,_0x4aba48){_0x4aba48=_0x4aba48||0xc8;return function(_0x54bad8){if(_0x54bad8){return _0x585d0e[_0xd45f('0x1a')](_0x4aba48)['json'](_0x54bad8);}};}function respondWithFilteredResult(_0x90ce3b,_0x5831e6){return function(_0x20d4dc){if(_0x20d4dc){var _0x26b257=typeof _0x5831e6[_0xd45f('0x1b')]===_0xd45f('0x1c')&&typeof _0x5831e6[_0xd45f('0x1d')]===_0xd45f('0x1c');var _0x3681b8=_0x20d4dc['count'];var _0x2c1afe=_0x26b257?0x0:_0x5831e6[_0xd45f('0x1b')];var _0x52ca61=_0x26b257?_0x20d4dc[_0xd45f('0x1e')]:_0x5831e6[_0xd45f('0x1b')]+_0x5831e6[_0xd45f('0x1d')];var _0x50f9ea;if(_0x52ca61>=_0x3681b8){_0x52ca61=_0x3681b8;_0x50f9ea=0xc8;}else{_0x50f9ea=0xce;}_0x90ce3b[_0xd45f('0x1a')](_0x50f9ea);return _0x90ce3b['set'](_0xd45f('0x1f'),_0x2c1afe+'-'+_0x52ca61+'/'+_0x3681b8)[_0xd45f('0x20')](_0x20d4dc);}return null;};}function patchUpdates(_0xfc21d5){return function(_0x1c96c2){try{jsonpatch[_0xd45f('0x21')](_0x1c96c2,_0xfc21d5,!![]);}catch(_0x23f3f6){return BPromise[_0xd45f('0x22')](_0x23f3f6);}return _0x1c96c2[_0xd45f('0x23')]();};}function saveUpdates(_0x236751,_0x28c6d3){return function(_0x1274ba){if(_0x1274ba){return _0x1274ba[_0xd45f('0x24')](_0x236751)[_0xd45f('0x25')](function(_0x5e1bb7){return _0x5e1bb7;});}return null;};}function removeEntity(_0xd4ad2e,_0x26cffa){return function(_0xe75b13){if(_0xe75b13){return _0xe75b13[_0xd45f('0x26')]()[_0xd45f('0x25')](function(){_0xd4ad2e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x305077,_0x3071eb){return function(_0x36ea92){if(!_0x36ea92){_0x305077['sendStatus'](0x194);}return _0x36ea92;};}function handleError(_0x5d8f0c,_0x188bdc){_0x188bdc=_0x188bdc||0x1f4;return function(_0x423e1e){logger[_0xd45f('0x27')](_0x423e1e[_0xd45f('0x28')]);if(_0x423e1e[_0xd45f('0x29')]){delete _0x423e1e['name'];}_0x5d8f0c[_0xd45f('0x1a')](_0x188bdc)[_0xd45f('0x2a')](_0x423e1e);};}exports[_0xd45f('0x2b')]=function(_0x36e533,_0x20b9f6){var _0x42cf02={},_0x3da9e9={},_0x2eaad8={'count':0x0,'rows':[]};var _0xa6a924=_[_0xd45f('0x2c')](db[_0xd45f('0x2d')]['rawAttributes'],function(_0x10be95){return{'name':_0x10be95[_0xd45f('0x2e')],'type':_0x10be95['type'][_0xd45f('0x2f')]};});_0x3da9e9[_0xd45f('0x30')]=_[_0xd45f('0x2c')](_0xa6a924,_0xd45f('0x29'));_0x3da9e9[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x36e533[_0xd45f('0x31')]);_0x3da9e9['filters']=_[_0xd45f('0x33')](_0x3da9e9[_0xd45f('0x30')],_0x3da9e9['query']);_0x42cf02['attributes']=_['intersection'](_0x3da9e9[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x36e533[_0xd45f('0x31')][_0xd45f('0x34')]));_0x42cf02[_0xd45f('0x35')]=_0x42cf02['attributes'][_0xd45f('0x36')]?_0x42cf02[_0xd45f('0x35')]:_0x3da9e9[_0xd45f('0x30')];if(!_0x36e533['query'][_0xd45f('0x37')]('nolimit')){_0x42cf02['limit']=qs[_0xd45f('0x1d')](_0x36e533[_0xd45f('0x31')][_0xd45f('0x1d')]);_0x42cf02[_0xd45f('0x1b')]=qs[_0xd45f('0x1b')](_0x36e533[_0xd45f('0x31')]['offset']);}_0x42cf02['order']=qs['sort'](_0x36e533['query'][_0xd45f('0x38')]);_0x42cf02['where']=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x36e533[_0xd45f('0x31')],_0x3da9e9['filters']),_0xa6a924);if(_0x36e533[_0xd45f('0x31')]['filter']){_0x42cf02[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0x42cf02[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0xa6a924,function(_0x324044){if(_0x324044['type']!==_0xd45f('0x3d')){var _0x363454={};_0x363454[_0x324044[_0xd45f('0x29')]]={'$like':'%'+_0x36e533[_0xd45f('0x31')][_0xd45f('0x3e')]+'%'};return _0x363454;}})});}_0x42cf02=_[_0xd45f('0x3c')]({},_0x42cf02,_0x36e533[_0xd45f('0x3f')]);var _0x1dc4ca={'where':_0x42cf02[_0xd45f('0x3b')]};return db[_0xd45f('0x2d')][_0xd45f('0x1e')](_0x1dc4ca)[_0xd45f('0x25')](function(_0x40d6ba){_0x2eaad8[_0xd45f('0x1e')]=_0x40d6ba;if(_0x36e533['query'][_0xd45f('0x40')]){_0x42cf02[_0xd45f('0x41')]=[{'all':!![]}];}return db[_0xd45f('0x2d')]['findAll'](_0x42cf02);})[_0xd45f('0x25')](function(_0x51b95a){_0x2eaad8[_0xd45f('0x42')]=_0x51b95a;return _0x2eaad8;})['then'](respondWithFilteredResult(_0x20b9f6,_0x42cf02))[_0xd45f('0x43')](handleError(_0x20b9f6,null));};exports[_0xd45f('0x44')]=function(_0x37c878,_0x3ac5d8){var _0x8d741b={'raw':![],'where':{'id':_0x37c878[_0xd45f('0x45')]['id']}},_0x4b4121={};_0x4b4121[_0xd45f('0x30')]=_['keys'](db[_0xd45f('0x2d')]['rawAttributes']);_0x4b4121[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x37c878[_0xd45f('0x31')]);_0x4b4121[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x4b4121['model'],_0x4b4121[_0xd45f('0x31')]);_0x8d741b[_0xd45f('0x35')]=_[_0xd45f('0x33')](_0x4b4121[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x37c878[_0xd45f('0x31')]['fields']));_0x8d741b['attributes']=_0x8d741b[_0xd45f('0x35')][_0xd45f('0x36')]?_0x8d741b[_0xd45f('0x35')]:_0x4b4121['model'];if(_0x37c878[_0xd45f('0x31')]['includeAll']){_0x8d741b[_0xd45f('0x41')]=[{'all':!![]}];}_0x8d741b=_['merge']({},_0x8d741b,_0x37c878['options']);return db['Automation']['find'](_0x8d741b)[_0xd45f('0x25')](handleEntityNotFound(_0x3ac5d8,null))['then'](respondWithResult(_0x3ac5d8,null))[_0xd45f('0x43')](handleError(_0x3ac5d8,null));};exports[_0xd45f('0x46')]=function(_0x12b6b4,_0x1e8348){return db[_0xd45f('0x2d')]['create'](_0x12b6b4[_0xd45f('0x47')],{})[_0xd45f('0x25')](respondWithResult(_0x1e8348,0xc9))[_0xd45f('0x43')](handleError(_0x1e8348,null));};exports[_0xd45f('0x24')]=function(_0x2ea6d7,_0xfe69d3){if(_0x2ea6d7[_0xd45f('0x47')]['id']){delete _0x2ea6d7[_0xd45f('0x47')]['id'];}return db[_0xd45f('0x2d')][_0xd45f('0x48')]({'where':{'id':_0x2ea6d7[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0xfe69d3,null))[_0xd45f('0x25')](saveUpdates(_0x2ea6d7[_0xd45f('0x47')],null))['then'](respondWithResult(_0xfe69d3,null))[_0xd45f('0x43')](handleError(_0xfe69d3,null));};exports[_0xd45f('0x26')]=function(_0x4e4a98,_0x1a4683){return db[_0xd45f('0x2d')][_0xd45f('0x48')]({'where':{'id':_0x4e4a98[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x1a4683,null))['then'](removeEntity(_0x1a4683,null))[_0xd45f('0x43')](handleError(_0x1a4683,null));};exports[_0xd45f('0x49')]=function(_0x5d8230,_0x28d3fc,_0x27affe){return db[_0xd45f('0x4a')]['find']({'where':{'id':_0x5d8230[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x28d3fc,null))['then'](function(_0x3837af){if(_0x3837af){return _0x3837af[_0xd45f('0x49')](_0x5d8230[_0xd45f('0x47')][_0xd45f('0x4b')],_[_0xd45f('0x4c')](_0x5d8230[_0xd45f('0x47')],['ids','id'])||{});}})[_0xd45f('0x25')](respondWithResult(_0x28d3fc,null))[_0xd45f('0x43')](handleError(_0x28d3fc,null));};exports[_0xd45f('0x4d')]=function(_0x28bd60,_0x3e7a07,_0x3cd02f){var _0x48d4b2={};var _0x49d74b={};var _0x538a2b;var _0x16c026;return db[_0xd45f('0x2d')][_0xd45f('0x4e')]({'where':{'id':_0x28bd60[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x3e7a07,null))[_0xd45f('0x25')](function(_0x2dce8a){if(_0x2dce8a){_0x538a2b=_0x2dce8a;_0x49d74b[_0xd45f('0x30')]=_['keys'](db[_0xd45f('0x4a')][_0xd45f('0x4f')]);_0x49d74b[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x28bd60[_0xd45f('0x31')]);_0x49d74b[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x49d74b['model'],_0x49d74b[_0xd45f('0x31')]);_0x48d4b2[_0xd45f('0x35')]=_[_0xd45f('0x33')](_0x49d74b[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x28bd60[_0xd45f('0x31')][_0xd45f('0x34')]));_0x48d4b2[_0xd45f('0x35')]=_0x48d4b2['attributes'][_0xd45f('0x36')]?_0x48d4b2[_0xd45f('0x35')]:_0x49d74b[_0xd45f('0x30')];_0x48d4b2[_0xd45f('0x50')]=qs[_0xd45f('0x38')](_0x28bd60[_0xd45f('0x31')][_0xd45f('0x38')]);_0x48d4b2[_0xd45f('0x3b')]=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x28bd60[_0xd45f('0x31')],_0x49d74b[_0xd45f('0x39')]));if(_0x28bd60[_0xd45f('0x31')][_0xd45f('0x3e')]){_0x48d4b2[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0x48d4b2[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0x48d4b2['attributes'],function(_0x1781b0){var _0x524a29={};_0x524a29[_0x1781b0]={'$like':'%'+_0x28bd60[_0xd45f('0x31')][_0xd45f('0x3e')]+'%'};return _0x524a29;})});}_0x48d4b2=_['merge']({},_0x48d4b2,_0x28bd60[_0xd45f('0x3f')]);return _0x538a2b[_0xd45f('0x4d')](_0x48d4b2);}})[_0xd45f('0x25')](function(_0x1c600d){if(_0x1c600d){_0x16c026=_0x1c600d[_0xd45f('0x36')];if(!_0x28bd60[_0xd45f('0x31')][_0xd45f('0x37')](_0xd45f('0x51'))){_0x48d4b2[_0xd45f('0x1d')]=qs[_0xd45f('0x1d')](_0x28bd60['query'][_0xd45f('0x1d')]);_0x48d4b2[_0xd45f('0x1b')]=qs[_0xd45f('0x1b')](_0x28bd60['query'][_0xd45f('0x1b')]);}return _0x538a2b[_0xd45f('0x4d')](_0x48d4b2);}})[_0xd45f('0x25')](function(_0x5aa1da){if(_0x5aa1da){return _0x5aa1da?{'count':_0x16c026,'rows':_0x5aa1da}:null;}})[_0xd45f('0x25')](respondWithResult(_0x3e7a07,null))['catch'](handleError(_0x3e7a07,null));};exports[_0xd45f('0x52')]=function(_0x3a85e5,_0x80d420,_0x3ee993){return db['Action'][_0xd45f('0x48')]({'where':{'id':_0x3a85e5['params']['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x80d420,null))[_0xd45f('0x25')](function(_0x182e09){if(_0x182e09){return _0x182e09[_0xd45f('0x52')](_0x3a85e5['body'][_0xd45f('0x4b')],_[_0xd45f('0x4c')](_0x3a85e5[_0xd45f('0x47')],[_0xd45f('0x4b'),'id'])||{});}})['then'](respondWithResult(_0x80d420,null))['catch'](handleError(_0x80d420,null));};exports[_0xd45f('0x53')]=function(_0x3fb804,_0x1e33b3,_0x56ecfd){var _0xb2230f={};var _0x1b2a23={};var _0x49401a;var _0x1c868a;return db[_0xd45f('0x2d')]['findOne']({'where':{'id':_0x3fb804[_0xd45f('0x45')]['id']}})[_0xd45f('0x25')](handleEntityNotFound(_0x1e33b3,null))[_0xd45f('0x25')](function(_0x5751b5){if(_0x5751b5){_0x49401a=_0x5751b5;_0x1b2a23[_0xd45f('0x30')]=_[_0xd45f('0x32')](db['Action'][_0xd45f('0x4f')]);_0x1b2a23[_0xd45f('0x31')]=_[_0xd45f('0x32')](_0x3fb804[_0xd45f('0x31')]);_0x1b2a23[_0xd45f('0x39')]=_[_0xd45f('0x33')](_0x1b2a23[_0xd45f('0x30')],_0x1b2a23[_0xd45f('0x31')]);_0xb2230f[_0xd45f('0x35')]=_['intersection'](_0x1b2a23[_0xd45f('0x30')],qs[_0xd45f('0x34')](_0x3fb804[_0xd45f('0x31')]['fields']));_0xb2230f[_0xd45f('0x35')]=_0xb2230f['attributes']['length']?_0xb2230f[_0xd45f('0x35')]:_0x1b2a23[_0xd45f('0x30')];_0xb2230f['order']=qs[_0xd45f('0x38')](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x38')]);_0xb2230f[_0xd45f('0x3b')]=qs[_0xd45f('0x39')](_[_0xd45f('0x3a')](_0x3fb804[_0xd45f('0x31')],_0x1b2a23['filters']));if(_0x3fb804[_0xd45f('0x31')][_0xd45f('0x3e')]){_0xb2230f[_0xd45f('0x3b')]=_[_0xd45f('0x3c')](_0xb2230f[_0xd45f('0x3b')],{'$or':_[_0xd45f('0x2c')](_0xb2230f[_0xd45f('0x35')],function(_0x862230){var _0x9bdf16={};_0x9bdf16[_0x862230]={'$like':'%'+_0x3fb804['query'][_0xd45f('0x3e')]+'%'};return _0x9bdf16;})});}_0xb2230f=_[_0xd45f('0x3c')]({},_0xb2230f,_0x3fb804[_0xd45f('0x3f')]);return _0x49401a[_0xd45f('0x53')](_0xb2230f);}})[_0xd45f('0x25')](function(_0x103697){if(_0x103697){_0x1c868a=_0x103697[_0xd45f('0x36')];if(!_0x3fb804[_0xd45f('0x31')][_0xd45f('0x37')]('nolimit')){_0xb2230f[_0xd45f('0x1d')]=qs[_0xd45f('0x1d')](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x1d')]);_0xb2230f[_0xd45f('0x1b')]=qs['offset'](_0x3fb804[_0xd45f('0x31')][_0xd45f('0x1b')]);}return _0x49401a[_0xd45f('0x53')](_0xb2230f);}})[_0xd45f('0x25')](function(_0x386699){if(_0x386699){return _0x386699?{'count':_0x1c868a,'rows':_0x386699}:null;}})[_0xd45f('0x25')](respondWithResult(_0x1e33b3,null))['catch'](handleError(_0x1e33b3,null));};
\ No newline at end of file
+var _0x8329=['filters','pick','filter','merge','type','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','Condition','addConditions','ids','getConditions','findOne','addActions','Action','getActions','hasOwnProperty','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','fs-extra','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','stack','name','send','index','map','Automation','rawAttributes','key','model','query','keys','intersection','fields','length','attributes','nolimit','limit','order','sort','where'];(function(_0x46032a,_0xaca6f8){var _0x12766f=function(_0x52cb8d){while(--_0x52cb8d){_0x46032a['push'](_0x46032a['shift']());}};_0x12766f(++_0xaca6f8);}(_0x8329,0x1c0));var _0x9832=function(_0x41cc65,_0x5760d4){_0x41cc65=_0x41cc65-0x0;var _0xae75e9=_0x8329[_0x41cc65];return _0xae75e9;};'use strict';var emlformat=require(_0x9832('0x0'));var rimraf=require(_0x9832('0x1'));var zipdir=require(_0x9832('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9832('0x3'));var moment=require('moment');var BPromise=require(_0x9832('0x4'));var Mustache=require(_0x9832('0x5'));var util=require(_0x9832('0x6'));var path=require(_0x9832('0x7'));var sox=require(_0x9832('0x8'));var csv=require('to-csv');var ejs=require(_0x9832('0x9'));var fs=require('fs');var fs_extra=require(_0x9832('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x9832('0xb'));var jsforce=require(_0x9832('0xc'));var deskjs=require(_0x9832('0xd'));var toCsv=require(_0x9832('0xe'));var querystring=require(_0x9832('0xf'));var Papa=require(_0x9832('0x10'));var Redis=require(_0x9832('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9832('0x12'));var hardwareService=require(_0x9832('0x13'));var logger=require(_0x9832('0x14'))(_0x9832('0x15'));var utils=require(_0x9832('0x16'));var config=require(_0x9832('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x9832('0x18'))['db'];function respondWithStatusCode(_0x2f7bd8,_0x10498c){_0x10498c=_0x10498c||0xcc;return function(_0x297a58){if(_0x297a58){return _0x2f7bd8[_0x9832('0x19')](_0x10498c);}return _0x2f7bd8[_0x9832('0x1a')](_0x10498c)[_0x9832('0x1b')]();};}function respondWithResult(_0x5473af,_0x58b21c){_0x58b21c=_0x58b21c||0xc8;return function(_0x6a915){if(_0x6a915){return _0x5473af[_0x9832('0x1a')](_0x58b21c)[_0x9832('0x1c')](_0x6a915);}};}function respondWithFilteredResult(_0x15fd29,_0x58f974){return function(_0x1285ef){if(_0x1285ef){var _0x3faacd=typeof _0x58f974[_0x9832('0x1d')]===_0x9832('0x1e')&&typeof _0x58f974['limit']===_0x9832('0x1e');var _0x4a1360=_0x1285ef[_0x9832('0x1f')];var _0x41a135=_0x3faacd?0x0:_0x58f974[_0x9832('0x1d')];var _0x182814=_0x3faacd?_0x1285ef['count']:_0x58f974[_0x9832('0x1d')]+_0x58f974['limit'];var _0x78df03;if(_0x182814>=_0x4a1360){_0x182814=_0x4a1360;_0x78df03=0xc8;}else{_0x78df03=0xce;}_0x15fd29['status'](_0x78df03);return _0x15fd29[_0x9832('0x20')]('Content-Range',_0x41a135+'-'+_0x182814+'/'+_0x4a1360)[_0x9832('0x1c')](_0x1285ef);}return null;};}function patchUpdates(_0xdc12ef){return function(_0x13ccd3){try{jsonpatch['apply'](_0x13ccd3,_0xdc12ef,!![]);}catch(_0x175fd2){return BPromise[_0x9832('0x21')](_0x175fd2);}return _0x13ccd3[_0x9832('0x22')]();};}function saveUpdates(_0x53f6fe,_0x2f8fd8){return function(_0x46e1f4){if(_0x46e1f4){return _0x46e1f4[_0x9832('0x23')](_0x53f6fe)['then'](function(_0x3213a4){return _0x3213a4;});}return null;};}function removeEntity(_0x42b416,_0x5ecc9c){return function(_0x17fbc2){if(_0x17fbc2){return _0x17fbc2['destroy']()['then'](function(){_0x42b416['status'](0xcc)[_0x9832('0x1b')]();});}};}function handleEntityNotFound(_0x4f75fc,_0x316d50){return function(_0x259d90){if(!_0x259d90){_0x4f75fc[_0x9832('0x19')](0x194);}return _0x259d90;};}function handleError(_0x17bb0c,_0x5e6940){_0x5e6940=_0x5e6940||0x1f4;return function(_0x1eceb6){logger['error'](_0x1eceb6[_0x9832('0x24')]);if(_0x1eceb6[_0x9832('0x25')]){delete _0x1eceb6[_0x9832('0x25')];}_0x17bb0c[_0x9832('0x1a')](_0x5e6940)[_0x9832('0x26')](_0x1eceb6);};}exports[_0x9832('0x27')]=function(_0x54dda7,_0x52cc3d){var _0xc1aeb4={},_0xa845f0={},_0x421340={'count':0x0,'rows':[]};var _0x5cb12b=_[_0x9832('0x28')](db[_0x9832('0x29')][_0x9832('0x2a')],function(_0x4303b2){return{'name':_0x4303b2['fieldName'],'type':_0x4303b2['type'][_0x9832('0x2b')]};});_0xa845f0[_0x9832('0x2c')]=_[_0x9832('0x28')](_0x5cb12b,_0x9832('0x25'));_0xa845f0[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x54dda7[_0x9832('0x2d')]);_0xa845f0['filters']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],_0xa845f0['query']);_0xc1aeb4['attributes']=_[_0x9832('0x2f')](_0xa845f0[_0x9832('0x2c')],qs['fields'](_0x54dda7[_0x9832('0x2d')][_0x9832('0x30')]));_0xc1aeb4['attributes']=_0xc1aeb4['attributes'][_0x9832('0x31')]?_0xc1aeb4[_0x9832('0x32')]:_0xa845f0[_0x9832('0x2c')];if(!_0x54dda7['query']['hasOwnProperty'](_0x9832('0x33'))){_0xc1aeb4[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x34')]);_0xc1aeb4[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x54dda7['query']['offset']);}_0xc1aeb4[_0x9832('0x35')]=qs[_0x9832('0x36')](_0x54dda7[_0x9832('0x2d')][_0x9832('0x36')]);_0xc1aeb4[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x54dda7['query'],_0xa845f0[_0x9832('0x38')]),_0x5cb12b);if(_0x54dda7['query'][_0x9832('0x3a')]){_0xc1aeb4[_0x9832('0x37')]=_[_0x9832('0x3b')](_0xc1aeb4[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x5cb12b,function(_0x39a231){if(_0x39a231[_0x9832('0x3c')]!==_0x9832('0x3d')){var _0x2e50ce={};_0x2e50ce[_0x39a231[_0x9832('0x25')]]={'$like':'%'+_0x54dda7['query']['filter']+'%'};return _0x2e50ce;}})});}_0xc1aeb4=_['merge']({},_0xc1aeb4,_0x54dda7[_0x9832('0x3e')]);var _0x3c3cdc={'where':_0xc1aeb4[_0x9832('0x37')]};return db[_0x9832('0x29')][_0x9832('0x1f')](_0x3c3cdc)[_0x9832('0x3f')](function(_0x22b2b5){_0x421340['count']=_0x22b2b5;if(_0x54dda7[_0x9832('0x2d')][_0x9832('0x40')]){_0xc1aeb4[_0x9832('0x41')]=[{'all':!![]}];}return db[_0x9832('0x29')][_0x9832('0x42')](_0xc1aeb4);})['then'](function(_0x308391){_0x421340[_0x9832('0x43')]=_0x308391;return _0x421340;})['then'](respondWithFilteredResult(_0x52cc3d,_0xc1aeb4))[_0x9832('0x44')](handleError(_0x52cc3d,null));};exports[_0x9832('0x45')]=function(_0x22fc4a,_0x2b2ce8){var _0x54ab25={'raw':![],'where':{'id':_0x22fc4a[_0x9832('0x46')]['id']}},_0x3018b8={};_0x3018b8[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x29')][_0x9832('0x2a')]);_0x3018b8['query']=_['keys'](_0x22fc4a[_0x9832('0x2d')]);_0x3018b8[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x3018b8['model'],_0x3018b8[_0x9832('0x2d')]);_0x54ab25['attributes']=_[_0x9832('0x2f')](_0x3018b8['model'],qs[_0x9832('0x30')](_0x22fc4a[_0x9832('0x2d')]['fields']));_0x54ab25['attributes']=_0x54ab25[_0x9832('0x32')][_0x9832('0x31')]?_0x54ab25[_0x9832('0x32')]:_0x3018b8[_0x9832('0x2c')];if(_0x22fc4a[_0x9832('0x2d')]['includeAll']){_0x54ab25[_0x9832('0x41')]=[{'all':!![]}];}_0x54ab25=_[_0x9832('0x3b')]({},_0x54ab25,_0x22fc4a[_0x9832('0x3e')]);return db[_0x9832('0x29')][_0x9832('0x47')](_0x54ab25)[_0x9832('0x3f')](handleEntityNotFound(_0x2b2ce8,null))['then'](respondWithResult(_0x2b2ce8,null))[_0x9832('0x44')](handleError(_0x2b2ce8,null));};exports[_0x9832('0x48')]=function(_0x382007,_0x473080){return db[_0x9832('0x29')][_0x9832('0x48')](_0x382007[_0x9832('0x49')],{})[_0x9832('0x3f')](respondWithResult(_0x473080,0xc9))[_0x9832('0x44')](handleError(_0x473080,null));};exports[_0x9832('0x23')]=function(_0x1e0e0d,_0x3c658b){if(_0x1e0e0d['body']['id']){delete _0x1e0e0d[_0x9832('0x49')]['id'];}return db[_0x9832('0x29')][_0x9832('0x47')]({'where':{'id':_0x1e0e0d[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x3c658b,null))[_0x9832('0x3f')](saveUpdates(_0x1e0e0d['body'],null))['then'](respondWithResult(_0x3c658b,null))['catch'](handleError(_0x3c658b,null));};exports[_0x9832('0x4a')]=function(_0x49ab3d,_0x184ce4){return db[_0x9832('0x29')]['find']({'where':{'id':_0x49ab3d[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x184ce4,null))['then'](removeEntity(_0x184ce4,null))[_0x9832('0x44')](handleError(_0x184ce4,null));};exports['addConditions']=function(_0x5c4a3a,_0x1184b3,_0x15765a){return db[_0x9832('0x4b')][_0x9832('0x47')]({'where':{'id':_0x5c4a3a[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x1184b3,null))['then'](function(_0x3e8000){if(_0x3e8000){return _0x3e8000[_0x9832('0x4c')](_0x5c4a3a[_0x9832('0x49')]['ids'],_['omit'](_0x5c4a3a['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x1184b3,null))['catch'](handleError(_0x1184b3,null));};exports[_0x9832('0x4e')]=function(_0x133b44,_0x289e79,_0x162734){var _0x1ff4fc={};var _0x4132bf={};var _0x43ef01;var _0x37ca43;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x133b44[_0x9832('0x46')]['id']}})['then'](handleEntityNotFound(_0x289e79,null))[_0x9832('0x3f')](function(_0x36c6bd){if(_0x36c6bd){_0x43ef01=_0x36c6bd;_0x4132bf[_0x9832('0x2c')]=_[_0x9832('0x2e')](db[_0x9832('0x4b')][_0x9832('0x2a')]);_0x4132bf[_0x9832('0x2d')]=_[_0x9832('0x2e')](_0x133b44['query']);_0x4132bf[_0x9832('0x38')]=_[_0x9832('0x2f')](_0x4132bf['model'],_0x4132bf[_0x9832('0x2d')]);_0x1ff4fc['attributes']=_[_0x9832('0x2f')](_0x4132bf[_0x9832('0x2c')],qs[_0x9832('0x30')](_0x133b44[_0x9832('0x2d')]['fields']));_0x1ff4fc['attributes']=_0x1ff4fc[_0x9832('0x32')][_0x9832('0x31')]?_0x1ff4fc[_0x9832('0x32')]:_0x4132bf[_0x9832('0x2c')];_0x1ff4fc['order']=qs[_0x9832('0x36')](_0x133b44[_0x9832('0x2d')][_0x9832('0x36')]);_0x1ff4fc[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x133b44[_0x9832('0x2d')],_0x4132bf[_0x9832('0x38')]));if(_0x133b44['query'][_0x9832('0x3a')]){_0x1ff4fc[_0x9832('0x37')]=_[_0x9832('0x3b')](_0x1ff4fc['where'],{'$or':_['map'](_0x1ff4fc['attributes'],function(_0x21d4f1){var _0x47f239={};_0x47f239[_0x21d4f1]={'$like':'%'+_0x133b44[_0x9832('0x2d')][_0x9832('0x3a')]+'%'};return _0x47f239;})});}_0x1ff4fc=_[_0x9832('0x3b')]({},_0x1ff4fc,_0x133b44[_0x9832('0x3e')]);return _0x43ef01['getConditions'](_0x1ff4fc);}})[_0x9832('0x3f')](function(_0xd6e4c8){if(_0xd6e4c8){_0x37ca43=_0xd6e4c8[_0x9832('0x31')];if(!_0x133b44[_0x9832('0x2d')]['hasOwnProperty'](_0x9832('0x33'))){_0x1ff4fc[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x133b44['query'][_0x9832('0x34')]);_0x1ff4fc[_0x9832('0x1d')]=qs[_0x9832('0x1d')](_0x133b44['query'][_0x9832('0x1d')]);}return _0x43ef01['getConditions'](_0x1ff4fc);}})['then'](function(_0x55712b){if(_0x55712b){return _0x55712b?{'count':_0x37ca43,'rows':_0x55712b}:null;}})[_0x9832('0x3f')](respondWithResult(_0x289e79,null))[_0x9832('0x44')](handleError(_0x289e79,null));};exports[_0x9832('0x50')]=function(_0x3f2f77,_0x42e097,_0x1baddb){return db[_0x9832('0x51')]['find']({'where':{'id':_0x3f2f77['params']['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x42e097,null))[_0x9832('0x3f')](function(_0x387e27){if(_0x387e27){return _0x387e27[_0x9832('0x50')](_0x3f2f77['body'][_0x9832('0x4d')],_['omit'](_0x3f2f77['body'],[_0x9832('0x4d'),'id'])||{});}})[_0x9832('0x3f')](respondWithResult(_0x42e097,null))[_0x9832('0x44')](handleError(_0x42e097,null));};exports[_0x9832('0x52')]=function(_0x2d72ee,_0x216727,_0x4be8dd){var _0x2429ff={};var _0x210724={};var _0x504a06;var _0x177220;return db['Automation'][_0x9832('0x4f')]({'where':{'id':_0x2d72ee[_0x9832('0x46')]['id']}})[_0x9832('0x3f')](handleEntityNotFound(_0x216727,null))[_0x9832('0x3f')](function(_0xe962cb){if(_0xe962cb){_0x504a06=_0xe962cb;_0x210724['model']=_[_0x9832('0x2e')](db['Action'][_0x9832('0x2a')]);_0x210724[_0x9832('0x2d')]=_['keys'](_0x2d72ee[_0x9832('0x2d')]);_0x210724[_0x9832('0x38')]=_['intersection'](_0x210724['model'],_0x210724[_0x9832('0x2d')]);_0x2429ff[_0x9832('0x32')]=_['intersection'](_0x210724['model'],qs[_0x9832('0x30')](_0x2d72ee[_0x9832('0x2d')]['fields']));_0x2429ff['attributes']=_0x2429ff[_0x9832('0x32')][_0x9832('0x31')]?_0x2429ff[_0x9832('0x32')]:_0x210724[_0x9832('0x2c')];_0x2429ff['order']=qs[_0x9832('0x36')](_0x2d72ee['query']['sort']);_0x2429ff[_0x9832('0x37')]=qs[_0x9832('0x38')](_[_0x9832('0x39')](_0x2d72ee['query'],_0x210724[_0x9832('0x38')]));if(_0x2d72ee[_0x9832('0x2d')][_0x9832('0x3a')]){_0x2429ff['where']=_[_0x9832('0x3b')](_0x2429ff[_0x9832('0x37')],{'$or':_[_0x9832('0x28')](_0x2429ff[_0x9832('0x32')],function(_0x14ef3d){var _0x5f4358={};_0x5f4358[_0x14ef3d]={'$like':'%'+_0x2d72ee[_0x9832('0x2d')]['filter']+'%'};return _0x5f4358;})});}_0x2429ff=_[_0x9832('0x3b')]({},_0x2429ff,_0x2d72ee[_0x9832('0x3e')]);return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x45bf3b){if(_0x45bf3b){_0x177220=_0x45bf3b[_0x9832('0x31')];if(!_0x2d72ee[_0x9832('0x2d')][_0x9832('0x53')]('nolimit')){_0x2429ff[_0x9832('0x34')]=qs[_0x9832('0x34')](_0x2d72ee[_0x9832('0x2d')][_0x9832('0x34')]);_0x2429ff[_0x9832('0x1d')]=qs['offset'](_0x2d72ee['query'][_0x9832('0x1d')]);}return _0x504a06['getActions'](_0x2429ff);}})[_0x9832('0x3f')](function(_0x42d17c){if(_0x42d17c){return _0x42d17c?{'count':_0x177220,'rows':_0x42d17c}:null;}})[_0x9832('0x3f')](respondWithResult(_0x216727,null))[_0x9832('0x44')](handleError(_0x216727,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 749c6ab..3e522aa 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 _0x5a65=['define','tools_automations','lodash','api','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports'];(function(_0x14fad0,_0x278d75){var _0x5c665f=function(_0xe43a83){while(--_0xe43a83){_0x14fad0['push'](_0x14fad0['shift']());}};_0x5c665f(++_0x278d75);}(_0x5a65,0x156));var _0x55a6=function(_0x1cf20b,_0x118a35){_0x1cf20b=_0x1cf20b-0x0;var _0x31434a=_0x5a65[_0x1cf20b];return _0x31434a;};'use strict';var _=require(_0x55a6('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x55a6('0x1'));var moment=require('moment');var BPromise=require(_0x55a6('0x2'));var rp=require(_0x55a6('0x3'));var fs=require('fs');var path=require(_0x55a6('0x4'));var rimraf=require('rimraf');var config=require(_0x55a6('0x5'));var attributes=require(_0x55a6('0x6'));module[_0x55a6('0x7')]=function(_0x28b2ea,_0x30793b){return _0x28b2ea[_0x55a6('0x8')]('Automation',attributes,{'tableName':_0x55a6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xa092=['./automation.attributes','define','tools_automations','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xa092,0x189));var _0x2a09=function(_0x5566b7,_0x4e9e2c){_0x5566b7=_0x5566b7-0x0;var _0x1c7ea7=_0xa092[_0x5566b7];return _0x1c7ea7;};'use strict';var _=require('lodash');var util=require(_0x2a09('0x0'));var logger=require(_0x2a09('0x1'))(_0x2a09('0x2'));var moment=require('moment');var BPromise=require(_0x2a09('0x3'));var rp=require(_0x2a09('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2a09('0x5'));var config=require(_0x2a09('0x6'));var attributes=require(_0x2a09('0x7'));module['exports']=function(_0x7b06ea,_0x167c88){return _0x7b06ea[_0x2a09('0x8')]('Automation',attributes,{'tableName':_0x2a09('0x9'),'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 13bea0d..303f904 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 _0x6e1c=['rpc','../../config/environment','jayson/promise','client','http','request','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x250ddd,_0x57e608){var _0xb42e9c=function(_0x10facc){while(--_0x10facc){_0x250ddd['push'](_0x250ddd['shift']());}};_0xb42e9c(++_0x57e608);}(_0x6e1c,0xb6));var _0xc6e1=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x6e1c[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xc6e1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc6e1('0x1'));var rs=require(_0xc6e1('0x2'));var fs=require('fs');var Redis=require(_0xc6e1('0x3'));var db=require(_0xc6e1('0x4'))['db'];var utils=require(_0xc6e1('0x5'));var logger=require(_0xc6e1('0x6'))(_0xc6e1('0x7'));var config=require(_0xc6e1('0x8'));var jayson=require(_0xc6e1('0x9'));var client=jayson[_0xc6e1('0xa')][_0xc6e1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5247f1,_0x3ff10c,_0x1242d5){return new BPromise(function(_0x39000a,_0x2ffee0){return client[_0xc6e1('0xc')](_0x5247f1,_0x1242d5)['then'](function(_0xa29af9){logger[_0xc6e1('0xd')](_0xc6e1('0xe'),_0x3ff10c,'request\x20sent');logger['debug'](_0xc6e1('0xf'),_0x3ff10c,_0xc6e1('0x10'),JSON['stringify'](_0xa29af9));if(_0xa29af9[_0xc6e1('0x11')]){if(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x12')]===0x1f4){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x2ffee0(_0xa29af9[_0xc6e1('0x11')][_0xc6e1('0x13')]);}logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0xa29af9[_0xc6e1('0x11')]['message']);return _0x39000a(_0xa29af9['error'][_0xc6e1('0x13')]);}else{logger[_0xc6e1('0xd')]('Automation,\x20%s,\x20%s',_0x3ff10c,_0xc6e1('0x10'));_0x39000a(_0xa29af9[_0xc6e1('0x14')][_0xc6e1('0x13')]);}})['catch'](function(_0x44ef6c){logger[_0xc6e1('0x11')](_0xc6e1('0xe'),_0x3ff10c,_0x44ef6c);_0x2ffee0(_0x44ef6c);});});}
\ No newline at end of file
+var _0x505d=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','message','Automation,\x20%s,\x20%s','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x517082,_0xc70ef9){var _0x560118=function(_0xff3513){while(--_0xff3513){_0x517082['push'](_0x517082['shift']());}};_0x560118(++_0xc70ef9);}(_0x505d,0x93));var _0xd505=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0x505d[_0x491a7f];return _0x3d8f44;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('Automation,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 7b4cd86..2baccf8 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 _0x26c2=['addConditions','addActions','put','destroy','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','create','post'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x26c2,0x130));var _0x226c=function(_0x41caaf,_0x2c91c4){_0x41caaf=_0x41caaf-0x0;var _0x41a83d=_0x26c2[_0x41caaf];return _0x41a83d;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x226c('0x0'));var express=require(_0x226c('0x1'));var router=express[_0x226c('0x2')]();var fs_extra=require(_0x226c('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x226c('0x4'));var config=require(_0x226c('0x5'));var controller=require('./automation.controller');router[_0x226c('0x6')]('/',auth[_0x226c('0x7')](),controller[_0x226c('0x8')]);router[_0x226c('0x6')](_0x226c('0x9'),auth['isAuthenticated'](),controller[_0x226c('0xa')]);router[_0x226c('0x6')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0xc')]);router['get'](_0x226c('0xd'),auth[_0x226c('0x7')](),controller['getActions']);router['post']('/',auth[_0x226c('0x7')](),controller[_0x226c('0xe')]);router[_0x226c('0xf')](_0x226c('0xb'),auth[_0x226c('0x7')](),controller[_0x226c('0x10')]);router[_0x226c('0xf')]('/:id/actions',auth['isAuthenticated'](),controller[_0x226c('0x11')]);router[_0x226c('0x12')](_0x226c('0x9'),auth[_0x226c('0x7')](),controller['update']);router['delete'](_0x226c('0x9'),auth[_0x226c('0x7')](),controller[_0x226c('0x13')]);module['exports']=router;
\ No newline at end of file
+var _0x7429=['../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','/:id','show','isAuthenticated','getConditions','post','/:id/conditions','/:id/actions','put','update','delete','destroy','path','express','Router'];(function(_0x1e17eb,_0x2e15c5){var _0x4de4c7=function(_0x52d003){while(--_0x52d003){_0x1e17eb['push'](_0x1e17eb['shift']());}};_0x4de4c7(++_0x2e15c5);}(_0x7429,0x6f));var _0x9742=function(_0x41cf29,_0x5c7212){_0x41cf29=_0x41cf29-0x0;var _0x20753e=_0x7429[_0x41cf29];return _0x20753e;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9742('0x0'));var timeout=require('connect-timeout');var express=require(_0x9742('0x1'));var router=express[_0x9742('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x9742('0x3'));var interaction=require(_0x9742('0x4'));var config=require(_0x9742('0x5'));var controller=require(_0x9742('0x6'));router[_0x9742('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9742('0x7')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x9')]);router[_0x9742('0x7')]('/:id/conditions',auth[_0x9742('0xa')](),controller[_0x9742('0xb')]);router[_0x9742('0x7')]('/:id/actions',auth[_0x9742('0xa')](),controller['getActions']);router[_0x9742('0xc')]('/',auth[_0x9742('0xa')](),controller['create']);router[_0x9742('0xc')](_0x9742('0xd'),auth[_0x9742('0xa')](),controller['addConditions']);router[_0x9742('0xc')](_0x9742('0xe'),auth[_0x9742('0xa')](),controller['addActions']);router[_0x9742('0xf')](_0x9742('0x8'),auth['isAuthenticated'](),controller[_0x9742('0x10')]);router[_0x9742('0x11')](_0x9742('0x8'),auth[_0x9742('0xa')](),controller[_0x9742('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 5783802..965747c 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 _0xb700=['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\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','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)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','ENUM','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','INTEGER'];(function(_0x29df9a,_0x42aff3){var _0x3a8e96=function(_0x70fbe7){while(--_0x70fbe7){_0x29df9a['push'](_0x29df9a['shift']());}};_0x3a8e96(++_0x42aff3);}(_0xb700,0x13d));var _0x0b70=function(_0x330414,_0x4f3207){_0x330414=_0x330414-0x0;var _0x99dbff=_0xb700[_0x330414];return _0x99dbff;};'use strict';var Sequelize=require(_0x0b70('0x0'));module['exports']={'name':{'type':Sequelize[_0x0b70('0x1')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0b70('0x2')]('ivr'),'allowNull':![],'defaultValue':'ivr'},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x0b70('0x3')],'defaultValue':0x0,'comment':_0x0b70('0x4')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0b70('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0b70('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x7')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x8')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x9')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0xa')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0xb')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0b70('0xc')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0b70('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0b70('0xd'),_0x0b70('0xe'),_0x0b70('0xf')),'defaultValue':_0x0b70('0xd')},'dialAMDActive':{'type':Sequelize[_0x0b70('0x3')],'defaultValue':0x0,'comment':_0x0b70('0x10')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0b70('0x5')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x0b70('0x5')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0b70('0x11')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0b70('0x12')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b70('0x13')},'dialAMDMinWordLength':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x64,'validate':{'min':0x0},'comment':'#AMD\x20Min\x20Word\x20Length'},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x0b70('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0b70('0x6')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0b70('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0b70('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0b70('0x6')](0x9)[_0x0b70('0x5')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0b70('0x17')},'dialOrderByScheduledAt':{'type':Sequelize[_0x0b70('0x2')](_0x0b70('0x18'),_0x0b70('0x19')),'defaultValue':_0x0b70('0x18')},'dialPrefix':{'type':Sequelize[_0x0b70('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b70('0x1a')},'dialCutDigit':{'type':Sequelize[_0x0b70('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0b70('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x1c')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x1d')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x1e')},'dialDropRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x21')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0b70('0x22')},'dialMachineRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0b70('0x6')](0x3)[_0x0b70('0x5')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0b70('0x6')](0x5)[_0x0b70('0x5')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0b70('0x23')}};
\ No newline at end of file
+var _0x8e8d=['#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#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)','#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)','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence'];(function(_0x310bd9,_0x27690d){var _0x438c67=function(_0x7ce348){while(--_0x7ce348){_0x310bd9['push'](_0x310bd9['shift']());}};_0x438c67(++_0x27690d);}(_0x8e8d,0x1d7));var _0xd8e8=function(_0x29f9ea,_0x68785d){_0x29f9ea=_0x29f9ea-0x0;var _0xe1819d=_0x8e8d[_0x29f9ea];return _0xe1819d;};'use strict';var Sequelize=require('sequelize');module[_0xd8e8('0x0')]={'name':{'type':Sequelize[_0xd8e8('0x1')],'unique':_0xd8e8('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x4')),'allowNull':![],'defaultValue':_0xd8e8('0x4')},'description':{'type':Sequelize[_0xd8e8('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x5')},'limitCalls':{'type':Sequelize[_0xd8e8('0x6')](0x4)[_0xd8e8('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd8e8('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xd8e8('0x1')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x9')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xd8e8('0xe')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':_0xd8e8('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x10'),_0xd8e8('0x11'),_0xd8e8('0x12')),'defaultValue':_0xd8e8('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xd8e8('0x13')},'dialAMDInitialSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xd8e8('0x14')},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xd8e8('0x15')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd8e8('0x16')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x17')},'dialAMDMinWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd8e8('0x18')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xd8e8('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd8e8('0x19')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd8e8('0x6')](0x9)[_0xd8e8('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd8e8('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize[_0xd8e8('0x3')](_0xd8e8('0x1b'),'ASC'),'defaultValue':_0xd8e8('0x1b')},'dialPrefix':{'type':Sequelize[_0xd8e8('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1c')},'dialCutDigit':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd8e8('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x1f')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x20')},'dialDropRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x21')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x22')},'dialMachineMaxRetry':{'type':Sequelize[_0xd8e8('0x6')](0x3)[_0xd8e8('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd8e8('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd8e8('0x6')](0x5)[_0xd8e8('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd8e8('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 9c91bd3..ed7ad37 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 _0x23a0=['ListId\x20=\x20?','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','scheduledAt','phone\x20IS\x20NOT\x20NULL','push','all','removeLists','destroy','getBlackLists','CmList','addBlackLists','sequelize','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','lodash','crypto','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','then','get','name','index','map','Campaign','fieldName','type','key','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','include','rows','catch','show','params','keys','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','IvrCampaigns','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','role','UserProfileSection','userProfileId','update','getHoppers','findOne','CmHopper','CampaignId','findAll','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','ListId','select','NOW()','field','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL'];(function(_0x2c92a3,_0x59ec68){var _0x16c8e7=function(_0x5b7523){while(--_0x5b7523){_0x2c92a3['push'](_0x2c92a3['shift']());}};_0x16c8e7(++_0x59ec68);}(_0x23a0,0x94));var _0x023a=function(_0x45bf86,_0x75586e){_0x45bf86=_0x45bf86-0x0;var _0x1f02b7=_0x23a0[_0x45bf86];return _0x1f02b7;};'use strict';var emlformat=require(_0x023a('0x0'));var rimraf=require(_0x023a('0x1'));var zipdir=require(_0x023a('0x2'));var jsonpatch=require(_0x023a('0x3'));var rp=require('request-promise');var moment=require(_0x023a('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x023a('0x5'));var util=require('util');var path=require(_0x023a('0x6'));var sox=require(_0x023a('0x7'));var csv=require(_0x023a('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x023a('0x9'));var squel=require('squel');var crypto=require(_0x023a('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x023a('0x8'));var querystring=require(_0x023a('0xb'));var Papa=require('papaparse');var Redis=require(_0x023a('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x023a('0xd'));var as=require(_0x023a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x023a('0xf'))('api');var utils=require(_0x023a('0x10'));var config=require(_0x023a('0x11'));var licenseUtil=require(_0x023a('0x12'));var db=require(_0x023a('0x13'))['db'];function respondWithStatusCode(_0x1eaba4,_0xb2bc97){_0xb2bc97=_0xb2bc97||0xcc;return function(_0x491008){if(_0x491008){return _0x1eaba4[_0x023a('0x14')](_0xb2bc97);}return _0x1eaba4[_0x023a('0x15')](_0xb2bc97)[_0x023a('0x16')]();};}function respondWithResult(_0x436b0a,_0x381014){_0x381014=_0x381014||0xc8;return function(_0x3654dd){if(_0x3654dd){return _0x436b0a[_0x023a('0x15')](_0x381014)[_0x023a('0x17')](_0x3654dd);}};}function respondWithFilteredResult(_0xbe6064,_0x12e358){return function(_0x2be30b){if(_0x2be30b){var _0xed01ef=typeof _0x12e358[_0x023a('0x18')]===_0x023a('0x19')&&typeof _0x12e358['limit']==='undefined';var _0x3b7757=_0x2be30b['count'];var _0x10888e=_0xed01ef?0x0:_0x12e358['offset'];var _0x322be0=_0xed01ef?_0x2be30b[_0x023a('0x1a')]:_0x12e358[_0x023a('0x18')]+_0x12e358[_0x023a('0x1b')];var _0x4d0c11;if(_0x322be0>=_0x3b7757){_0x322be0=_0x3b7757;_0x4d0c11=0xc8;}else{_0x4d0c11=0xce;}_0xbe6064['status'](_0x4d0c11);return _0xbe6064['set'](_0x023a('0x1c'),_0x10888e+'-'+_0x322be0+'/'+_0x3b7757)['json'](_0x2be30b);}return null;};}function patchUpdates(_0x13c800){return function(_0x18b222){try{jsonpatch[_0x023a('0x1d')](_0x18b222,_0x13c800,!![]);}catch(_0x2dd1ca){return BPromise[_0x023a('0x1e')](_0x2dd1ca);}return _0x18b222[_0x023a('0x1f')]();};}function saveUpdates(_0x4ec1c7,_0x3fc025){return function(_0x554aaf){if(_0x554aaf){return _0x554aaf['update'](_0x4ec1c7)[_0x023a('0x20')](function(_0x37ee49){return _0x37ee49;});}return null;};}function removeEntity(_0x1fb09f,_0x40914d){return function(_0x1d2ab8){if(_0x1d2ab8){return _0x1d2ab8['destroy']()[_0x023a('0x20')](function(){var _0x49c635=_0x1d2ab8[_0x023a('0x21')]({'plain':!![]});var _0x52914f='IvrCampaigns';return db['UserProfileResource']['destroy']({'where':{'type':_0x52914f,'resourceId':_0x49c635['id']}})[_0x023a('0x20')](function(){return _0x1d2ab8;});})['then'](function(){_0x1fb09f[_0x023a('0x15')](0xcc)[_0x023a('0x16')]();});}};}function handleEntityNotFound(_0x11e7a4,_0x3715ec){return function(_0x4b7cea){if(!_0x4b7cea){_0x11e7a4[_0x023a('0x14')](0x194);}return _0x4b7cea;};}function handleError(_0x59630c,_0x5a1c9e){_0x5a1c9e=_0x5a1c9e||0x1f4;return function(_0x3036d4){logger['error'](_0x3036d4['stack']);if(_0x3036d4[_0x023a('0x22')]){delete _0x3036d4[_0x023a('0x22')];}_0x59630c[_0x023a('0x15')](_0x5a1c9e)['send'](_0x3036d4);};}exports[_0x023a('0x23')]=function(_0x2089f6,_0xd83581){var _0x1aa324={},_0x521363={},_0x24738c={'count':0x0,'rows':[]};var _0x37e2cc=_[_0x023a('0x24')](db[_0x023a('0x25')]['rawAttributes'],function(_0x487750){return{'name':_0x487750[_0x023a('0x26')],'type':_0x487750[_0x023a('0x27')][_0x023a('0x28')]};});_0x521363['model']=_[_0x023a('0x24')](_0x37e2cc,_0x023a('0x22'));_0x521363[_0x023a('0x29')]=_['keys'](_0x2089f6[_0x023a('0x29')]);_0x521363[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x521363[_0x023a('0x2c')],_0x521363[_0x023a('0x29')]);_0x1aa324['attributes']=_[_0x023a('0x2b')](_0x521363[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x2089f6['query']['fields']));_0x1aa324[_0x023a('0x2e')]=_0x1aa324['attributes']['length']?_0x1aa324['attributes']:_0x521363['model'];if(!_0x2089f6[_0x023a('0x29')][_0x023a('0x2f')](_0x023a('0x30'))){_0x1aa324[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x2089f6[_0x023a('0x29')][_0x023a('0x1b')]);_0x1aa324[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x2089f6[_0x023a('0x29')][_0x023a('0x18')]);}_0x1aa324[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x2089f6[_0x023a('0x29')]['sort']);_0x1aa324['where']=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x2089f6['query'],_0x521363[_0x023a('0x2a')]),_0x37e2cc);if(_0x2089f6['query'][_0x023a('0x34')]){_0x1aa324[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1aa324[_0x023a('0x35')],{'$or':_[_0x023a('0x24')](_0x37e2cc,function(_0x212a0c){if(_0x212a0c[_0x023a('0x27')]!=='VIRTUAL'){var _0x50fbcf={};_0x50fbcf[_0x212a0c[_0x023a('0x22')]]={'$like':'%'+_0x2089f6[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x50fbcf;}})});}_0x1aa324=_[_0x023a('0x36')]({},_0x1aa324,_0x2089f6[_0x023a('0x37')]);var _0x2baa16={'where':_0x1aa324[_0x023a('0x35')]};return db[_0x023a('0x25')][_0x023a('0x1a')](_0x2baa16)[_0x023a('0x20')](function(_0x2f88f7){_0x24738c[_0x023a('0x1a')]=_0x2f88f7;if(_0x2089f6['query'][_0x023a('0x38')]){_0x1aa324[_0x023a('0x39')]=[{'all':!![]}];}return db['Campaign']['findAll'](_0x1aa324);})[_0x023a('0x20')](function(_0x13a90d){_0x24738c[_0x023a('0x3a')]=_0x13a90d;return _0x24738c;})[_0x023a('0x20')](respondWithFilteredResult(_0xd83581,_0x1aa324))[_0x023a('0x3b')](handleError(_0xd83581,null));};exports[_0x023a('0x3c')]=function(_0x28f703,_0x3c1605){var _0x445a16={'raw':![],'where':{'id':_0x28f703[_0x023a('0x3d')]['id']}},_0x1879b1={};_0x1879b1[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x25')][_0x023a('0x3f')]);_0x1879b1[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x28f703[_0x023a('0x29')]);_0x1879b1[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x1879b1[_0x023a('0x2c')],_0x1879b1[_0x023a('0x29')]);_0x445a16[_0x023a('0x2e')]=_['intersection'](_0x1879b1[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x28f703[_0x023a('0x29')][_0x023a('0x2d')]));_0x445a16['attributes']=_0x445a16['attributes'][_0x023a('0x40')]?_0x445a16[_0x023a('0x2e')]:_0x1879b1[_0x023a('0x2c')];if(_0x28f703[_0x023a('0x29')][_0x023a('0x38')]){_0x445a16[_0x023a('0x39')]=[{'all':!![]}];}_0x445a16=_['merge']({},_0x445a16,_0x28f703[_0x023a('0x37')]);return db[_0x023a('0x25')][_0x023a('0x41')](_0x445a16)[_0x023a('0x20')](handleEntityNotFound(_0x3c1605,null))[_0x023a('0x20')](respondWithResult(_0x3c1605,null))[_0x023a('0x3b')](handleError(_0x3c1605,null));};exports[_0x023a('0x42')]=function(_0x158f57,_0x260be5){return db[_0x023a('0x25')][_0x023a('0x42')](_0x158f57[_0x023a('0x43')],{})[_0x023a('0x20')](function(_0xc15ab6){var _0x388217=_0x158f57[_0x023a('0x44')]['get']({'plain':!![]});if(!_0x388217)throw new Error(_0x023a('0x45'));if(_0x388217['role']===_0x023a('0x44')){var _0x91d007=_0xc15ab6[_0x023a('0x21')]({'plain':!![]});var _0x3d47ee=_0x023a('0x46');return db['UserProfileSection'][_0x023a('0x41')]({'where':{'name':_0x3d47ee,'userProfileId':_0x388217['userProfileId']},'raw':!![]})[_0x023a('0x20')](function(_0x107954){if(_0x107954&&_0x107954[_0x023a('0x47')]===0x0){return db[_0x023a('0x48')][_0x023a('0x42')]({'name':_0x91d007[_0x023a('0x22')],'resourceId':_0x91d007['id'],'type':_0x107954[_0x023a('0x22')],'sectionId':_0x107954['id']},{})[_0x023a('0x20')](function(){return _0xc15ab6;});}else{return _0xc15ab6;}})['catch'](function(_0x4df6e8){logger[_0x023a('0x49')](_0x023a('0x4a'),_0x4df6e8);throw _0x4df6e8;});}return _0xc15ab6;})[_0x023a('0x20')](respondWithResult(_0x260be5,0xc9))[_0x023a('0x3b')](handleError(_0x260be5,null));};exports[_0x023a('0x4b')]=function(_0x472746,_0x26cdce){var _0x28e86b={'where':{'id':_0x472746[_0x023a('0x3d')]['id']}},_0x3b4e4c={};_0x3b4e4c[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x25')][_0x023a('0x3f')]);_0x28e86b[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x3b4e4c[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x472746['query'][_0x023a('0x2d')]));_0x28e86b[_0x023a('0x2e')]=_0x28e86b[_0x023a('0x2e')]['length']?_0x28e86b['attributes']:_0x3b4e4c[_0x023a('0x2c')];if(_0x472746[_0x023a('0x29')][_0x023a('0x38')]){_0x28e86b['include']=[{'all':!![]}];}_0x28e86b=_['merge']({},_0x28e86b,_0x472746[_0x023a('0x37')]);return db[_0x023a('0x25')][_0x023a('0x41')](_0x28e86b)['then'](handleEntityNotFound(_0x26cdce,null))['then'](function(_0x4dd2bc){if(_0x4dd2bc){var _0x465d91=_0x4dd2bc[_0x023a('0x21')]({'plain':!![]});_0x465d91=qs[_0x023a('0x4c')](_0x465d91,['id',_0x023a('0x4d'),'updatedAt']);_0x472746[_0x023a('0x43')]=_[_0x023a('0x4c')](_0x472746[_0x023a('0x43')],['id',_0x023a('0x4d'),_0x023a('0x4e')]);return db[_0x023a('0x25')][_0x023a('0x42')](_[_0x023a('0x36')](_0x465d91,_0x472746[_0x023a('0x43')]),{'include':_0x472746[_0x023a('0x29')][_0x023a('0x38')]?[{'all':!![]}]:undefined})[_0x023a('0x20')](function(_0x180c64){var _0x1bc7aa=_0x472746[_0x023a('0x44')][_0x023a('0x21')]({'plain':!![]});if(!_0x1bc7aa)throw new Error(_0x023a('0x45'));if(_0x1bc7aa[_0x023a('0x4f')]===_0x023a('0x44')){var _0x32b3e1=_0x180c64[_0x023a('0x21')]({'plain':!![]});var _0x203cd7='IvrCampaigns';return db[_0x023a('0x50')]['find']({'where':{'name':_0x203cd7,'userProfileId':_0x1bc7aa[_0x023a('0x51')]},'raw':!![]})[_0x023a('0x20')](function(_0x108d7d){if(_0x108d7d&&_0x108d7d['autoAssociation']===0x0){return db[_0x023a('0x48')][_0x023a('0x42')]({'name':_0x32b3e1[_0x023a('0x22')],'resourceId':_0x32b3e1['id'],'type':_0x108d7d['name'],'sectionId':_0x108d7d['id']},{})[_0x023a('0x20')](function(){return _0x180c64;});}else{return _0x180c64;}})[_0x023a('0x3b')](function(_0x28c448){logger[_0x023a('0x49')](_0x023a('0x4a'),_0x28c448);throw _0x28c448;});}return _0x180c64;});}})['then'](respondWithResult(_0x26cdce,0xc9))[_0x023a('0x3b')](handleError(_0x26cdce,null));};exports[_0x023a('0x52')]=function(_0x14e893,_0xd1263d){if(_0x14e893[_0x023a('0x43')]['id']){delete _0x14e893[_0x023a('0x43')]['id'];}return db[_0x023a('0x25')][_0x023a('0x41')]({'where':{'id':_0x14e893[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0xd1263d,null))[_0x023a('0x20')](saveUpdates(_0x14e893[_0x023a('0x43')],null))[_0x023a('0x20')](respondWithResult(_0xd1263d,null))[_0x023a('0x3b')](handleError(_0xd1263d,null));};exports['destroy']=function(_0x33764c,_0x3fe7cd){return db['Campaign']['find']({'where':{'id':_0x33764c['params']['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x3fe7cd,null))[_0x023a('0x20')](removeEntity(_0x3fe7cd,null))[_0x023a('0x3b')](handleError(_0x3fe7cd,null));};exports[_0x023a('0x53')]=function(_0x2ef95b,_0x138025,_0x1b3875){var _0x5cc386={'raw':!![],'where':{}};var _0x1a9cab={};var _0x582401={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x2ef95b[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x138025,null))['then'](function(_0x222321){if(_0x222321){_0x1a9cab[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x55')][_0x023a('0x3f')]);_0x1a9cab[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x2ef95b[_0x023a('0x29')]);_0x1a9cab['filters']=_['intersection'](_0x1a9cab[_0x023a('0x2c')],_0x1a9cab[_0x023a('0x29')]);_0x5cc386[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x1a9cab[_0x023a('0x2c')],qs['fields'](_0x2ef95b[_0x023a('0x29')]['fields']));_0x5cc386[_0x023a('0x2e')]=_0x5cc386['attributes'][_0x023a('0x40')]?_0x5cc386[_0x023a('0x2e')]:_0x1a9cab['model'];if(!_0x2ef95b[_0x023a('0x29')]['hasOwnProperty'](_0x023a('0x30'))){_0x5cc386[_0x023a('0x1b')]=qs['limit'](_0x2ef95b[_0x023a('0x29')][_0x023a('0x1b')]);_0x5cc386[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x2ef95b[_0x023a('0x29')][_0x023a('0x18')]);}_0x5cc386[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x2ef95b['query'][_0x023a('0x32')]);_0x5cc386[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x2ef95b[_0x023a('0x29')],_0x1a9cab[_0x023a('0x2a')]));_0x5cc386['where'][_0x023a('0x56')]=_0x222321['id'];if(_0x2ef95b['query'][_0x023a('0x34')]){_0x5cc386[_0x023a('0x35')]=_[_0x023a('0x36')](_0x5cc386['where'],{'$or':_[_0x023a('0x24')](_0x5cc386[_0x023a('0x2e')],function(_0x4af321){var _0x278e4c={};_0x278e4c[_0x4af321]={'$like':'%'+_0x2ef95b[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x278e4c;})});}_0x5cc386=_[_0x023a('0x36')]({},_0x5cc386,_0x2ef95b['options']);return db[_0x023a('0x55')][_0x023a('0x1a')]({'where':_0x5cc386[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x4b9f40){_0x582401['count']=_0x4b9f40;if(_0x2ef95b[_0x023a('0x29')][_0x023a('0x38')]){_0x5cc386[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x55')][_0x023a('0x57')](_0x5cc386);})[_0x023a('0x20')](function(_0x2410aa){_0x582401[_0x023a('0x3a')]=_0x2410aa;return _0x582401;});}})['then'](respondWithFilteredResult(_0x138025,_0x5cc386))[_0x023a('0x3b')](handleError(_0x138025,null));};exports[_0x023a('0x58')]=function(_0x58b392,_0x45d97c,_0x2fd100){var _0x256f0b={'raw':!![],'where':{}};var _0x494976={};var _0x1a730d={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x58b392[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x45d97c,null))[_0x023a('0x20')](function(_0x5679b2){if(_0x5679b2){_0x494976[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x59')]['rawAttributes']);_0x494976['query']=_[_0x023a('0x3e')](_0x58b392['query']);_0x494976[_0x023a('0x2a')]=_['intersection'](_0x494976[_0x023a('0x2c')],_0x494976[_0x023a('0x29')]);_0x256f0b[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x494976[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x58b392[_0x023a('0x29')]['fields']));_0x256f0b[_0x023a('0x2e')]=_0x256f0b[_0x023a('0x2e')][_0x023a('0x40')]?_0x256f0b[_0x023a('0x2e')]:_0x494976[_0x023a('0x2c')];if(!_0x58b392['query'][_0x023a('0x2f')](_0x023a('0x30'))){_0x256f0b[_0x023a('0x1b')]=qs['limit'](_0x58b392[_0x023a('0x29')][_0x023a('0x1b')]);_0x256f0b[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x58b392['query'][_0x023a('0x18')]);}_0x256f0b[_0x023a('0x31')]=qs['sort'](_0x58b392[_0x023a('0x29')][_0x023a('0x32')]);_0x256f0b[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x58b392[_0x023a('0x29')],_0x494976[_0x023a('0x2a')]));_0x256f0b[_0x023a('0x35')][_0x023a('0x56')]=_0x5679b2['id'];if(_0x58b392[_0x023a('0x29')][_0x023a('0x34')]){_0x256f0b[_0x023a('0x35')]=_[_0x023a('0x36')](_0x256f0b[_0x023a('0x35')],{'$or':_['map'](_0x256f0b[_0x023a('0x2e')],function(_0x10e28a){var _0x4f1de7={};_0x4f1de7[_0x10e28a]={'$like':'%'+_0x58b392[_0x023a('0x29')]['filter']+'%'};return _0x4f1de7;})});}_0x256f0b=_[_0x023a('0x36')]({},_0x256f0b,_0x58b392['options']);return db[_0x023a('0x59')][_0x023a('0x1a')]({'where':_0x256f0b[_0x023a('0x35')]})['then'](function(_0x530394){_0x1a730d[_0x023a('0x1a')]=_0x530394;if(_0x58b392[_0x023a('0x29')][_0x023a('0x38')]){_0x256f0b[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x59')][_0x023a('0x57')](_0x256f0b);})['then'](function(_0x54a861){_0x1a730d['rows']=_0x54a861;return _0x1a730d;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x45d97c,_0x256f0b))[_0x023a('0x3b')](handleError(_0x45d97c,null));};exports[_0x023a('0x5a')]=function(_0x30a9d,_0x26515d,_0x144a77){var _0x1d9363={'raw':!![],'where':{}};var _0x2f2cc7={};var _0x312343={'count':0x0,'rows':[]};return db['Campaign'][_0x023a('0x54')]({'where':{'id':_0x30a9d['params']['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x26515d,null))[_0x023a('0x20')](function(_0x4ebc29){if(_0x4ebc29){_0x2f2cc7[_0x023a('0x2c')]=_[_0x023a('0x3e')](db[_0x023a('0x5b')][_0x023a('0x3f')]);_0x2f2cc7['query']=_[_0x023a('0x3e')](_0x30a9d[_0x023a('0x29')]);_0x2f2cc7[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x2f2cc7[_0x023a('0x2c')],_0x2f2cc7['query']);_0x1d9363[_0x023a('0x2e')]=_['intersection'](_0x2f2cc7[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x30a9d[_0x023a('0x29')][_0x023a('0x2d')]));_0x1d9363[_0x023a('0x2e')]=_0x1d9363[_0x023a('0x2e')][_0x023a('0x40')]?_0x1d9363[_0x023a('0x2e')]:_0x2f2cc7['model'];if(!_0x30a9d['query'][_0x023a('0x2f')](_0x023a('0x30'))){_0x1d9363[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x30a9d[_0x023a('0x29')]['limit']);_0x1d9363[_0x023a('0x18')]=qs['offset'](_0x30a9d['query']['offset']);}_0x1d9363['order']=qs['sort'](_0x30a9d[_0x023a('0x29')]['sort']);_0x1d9363['where']=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x30a9d['query'],_0x2f2cc7[_0x023a('0x2a')]));_0x1d9363[_0x023a('0x35')][_0x023a('0x56')]=_0x4ebc29['id'];if(_0x30a9d[_0x023a('0x29')]['filter']){_0x1d9363[_0x023a('0x35')]=_[_0x023a('0x36')](_0x1d9363['where'],{'$or':_[_0x023a('0x24')](_0x1d9363[_0x023a('0x2e')],function(_0x424a90){var _0xc00e0f={};_0xc00e0f[_0x424a90]={'$like':'%'+_0x30a9d[_0x023a('0x29')]['filter']+'%'};return _0xc00e0f;})});}_0x1d9363=_[_0x023a('0x36')]({},_0x1d9363,_0x30a9d[_0x023a('0x37')]);return db['CmHopperFinal'][_0x023a('0x1a')]({'where':_0x1d9363[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x12901b){_0x312343[_0x023a('0x1a')]=_0x12901b;if(_0x30a9d[_0x023a('0x29')][_0x023a('0x38')]){_0x1d9363[_0x023a('0x39')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x023a('0x57')](_0x1d9363);})[_0x023a('0x20')](function(_0x3dd276){_0x312343[_0x023a('0x3a')]=_0x3dd276;return _0x312343;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x26515d,_0x1d9363))[_0x023a('0x3b')](handleError(_0x26515d,null));};exports[_0x023a('0x5c')]=function(_0x4239c2,_0x4248e9,_0x32fe1c){var _0xdf9c6a={'raw':!![],'where':{}};var _0x3df86b={};var _0x46433d={'count':0x0,'rows':[]};return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x4239c2['params']['id']}})['then'](handleEntityNotFound(_0x4248e9,null))[_0x023a('0x20')](function(_0xce97a5){if(_0xce97a5){_0x3df86b[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x5d')][_0x023a('0x3f')]);_0x3df86b[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x4239c2['query']);_0x3df86b[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x3df86b[_0x023a('0x2c')],_0x3df86b[_0x023a('0x29')]);_0xdf9c6a['attributes']=_['intersection'](_0x3df86b[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x4239c2[_0x023a('0x29')][_0x023a('0x2d')]));_0xdf9c6a[_0x023a('0x2e')]=_0xdf9c6a['attributes'][_0x023a('0x40')]?_0xdf9c6a['attributes']:_0x3df86b[_0x023a('0x2c')];if(!_0x4239c2['query'][_0x023a('0x2f')]('nolimit')){_0xdf9c6a[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x4239c2[_0x023a('0x29')][_0x023a('0x1b')]);_0xdf9c6a[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x4239c2[_0x023a('0x29')][_0x023a('0x18')]);}_0xdf9c6a['order']=qs[_0x023a('0x32')](_0x4239c2[_0x023a('0x29')][_0x023a('0x32')]);_0xdf9c6a[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x4239c2[_0x023a('0x29')],_0x3df86b['filters']));_0xdf9c6a['where'][_0x023a('0x56')]=_0xce97a5['id'];if(_0x4239c2[_0x023a('0x29')][_0x023a('0x34')]){_0xdf9c6a[_0x023a('0x35')]=_[_0x023a('0x36')](_0xdf9c6a[_0x023a('0x35')],{'$or':_['map'](_0xdf9c6a['attributes'],function(_0x55e2f8){var _0x29485a={};_0x29485a[_0x55e2f8]={'$like':'%'+_0x4239c2[_0x023a('0x29')]['filter']+'%'};return _0x29485a;})});}_0xdf9c6a=_[_0x023a('0x36')]({},_0xdf9c6a,_0x4239c2[_0x023a('0x37')]);return db[_0x023a('0x5d')][_0x023a('0x1a')]({'where':_0xdf9c6a[_0x023a('0x35')]})[_0x023a('0x20')](function(_0x2a4cf4){_0x46433d['count']=_0x2a4cf4;if(_0x4239c2[_0x023a('0x29')]['includeAll']){_0xdf9c6a[_0x023a('0x39')]=[{'all':!![]}];}return db[_0x023a('0x5d')][_0x023a('0x57')](_0xdf9c6a);})['then'](function(_0x4fb451){_0x46433d[_0x023a('0x3a')]=_0x4fb451;return _0x46433d;});}})[_0x023a('0x20')](respondWithFilteredResult(_0x4248e9,_0xdf9c6a))[_0x023a('0x3b')](handleError(_0x4248e9,null));};exports[_0x023a('0x5e')]=function(_0x30f940,_0x2b636b,_0x30b51f){var _0x2fce34={};var _0x14879c={};var _0x7f4ae4;var _0x47a25d;return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x30f940[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x2b636b,null))['then'](function(_0x503f20){if(_0x503f20){_0x7f4ae4=_0x503f20;_0x14879c[_0x023a('0x2c')]=_[_0x023a('0x3e')](db['CmList'][_0x023a('0x3f')]);_0x14879c[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x30f940[_0x023a('0x29')]);_0x14879c[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x14879c[_0x023a('0x2c')],_0x14879c[_0x023a('0x29')]);_0x2fce34['attributes']=_['intersection'](_0x14879c[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x30f940[_0x023a('0x29')][_0x023a('0x2d')]));_0x2fce34[_0x023a('0x2e')]=_0x2fce34[_0x023a('0x2e')][_0x023a('0x40')]?_0x2fce34[_0x023a('0x2e')]:_0x14879c[_0x023a('0x2c')];_0x2fce34['order']=qs[_0x023a('0x32')](_0x30f940[_0x023a('0x29')]['sort']);_0x2fce34[_0x023a('0x35')]=qs[_0x023a('0x2a')](_[_0x023a('0x33')](_0x30f940[_0x023a('0x29')],_0x14879c[_0x023a('0x2a')]));if(_0x30f940[_0x023a('0x29')]['filter']){_0x2fce34[_0x023a('0x35')]=_[_0x023a('0x36')](_0x2fce34[_0x023a('0x35')],{'$or':_['map'](_0x2fce34[_0x023a('0x2e')],function(_0x2594a7){var _0x35cc31={};_0x35cc31[_0x2594a7]={'$like':'%'+_0x30f940[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x35cc31;})});}_0x2fce34=_[_0x023a('0x36')]({},_0x2fce34,_0x30f940['options']);return _0x7f4ae4['getLists'](_0x2fce34);}})['then'](function(_0xa3840){if(_0xa3840){_0x47a25d=_0xa3840['length'];if(!_0x30f940[_0x023a('0x29')][_0x023a('0x2f')](_0x023a('0x30'))){_0x2fce34[_0x023a('0x1b')]=qs[_0x023a('0x1b')](_0x30f940[_0x023a('0x29')]['limit']);_0x2fce34[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x30f940[_0x023a('0x29')][_0x023a('0x18')]);}return _0x7f4ae4['getLists'](_0x2fce34);}})[_0x023a('0x20')](function(_0x15250c){if(_0x15250c){return _0x15250c?{'count':_0x47a25d,'rows':_0x15250c}:null;}})[_0x023a('0x20')](respondWithResult(_0x2b636b,null))[_0x023a('0x3b')](handleError(_0x2b636b,null));};exports['addLists']=function(_0x305df9,_0x276a25,_0x16eb19){var _0x2110cd,_0x157424;return db['Campaign'][_0x023a('0x41')]({'where':{'id':_0x305df9[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x276a25,null))[_0x023a('0x20')](function(_0x2e90cc){if(_0x2e90cc){_0x157424=_0x2e90cc;return _0x2e90cc[_0x023a('0x5f')](_0x305df9['body']['ids'],_['omit'](_0x305df9[_0x023a('0x43')],[_0x023a('0x60'),'id'])||{});}return null;})[_0x023a('0x61')](function(_0x4f4381){var _0x2e5286;_0x2110cd=_0x4f4381||[];var _0x4d1dfa=[];if(_0x4f4381){for(var _0xb42d07=0x0;_0xb42d07<_0x4f4381['length'];_0xb42d07+=0x1){var _0x29b1a7=_0x4f4381[_0xb42d07][_0x023a('0x21')]({'plain':!![]});_0x157424['dialCheckDuplicateType']=_0x305df9[_0x023a('0x43')][_0x023a('0x62')]?_0x305df9['body'][_0x023a('0x62')]:_0x157424['dialCheckDuplicateType'];switch(_0x157424[_0x023a('0x62')]){case _0x023a('0x63'):_0x2e5286=squel['insert']()[_0x023a('0x64')](_0x023a('0x65'))[_0x023a('0x66')]([_0x023a('0x67'),'scheduledAt','ContactId',_0x023a('0x68'),_0x023a('0x56'),'createdAt',_0x023a('0x4e')],squel[_0x023a('0x69')]()['field']('phone','phone')['field'](_0x023a('0x6a'),'scheduledAt')[_0x023a('0x6b')]('id',_0x023a('0x6c'))['field'](_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9['params']['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')]('NOW()','createdAt')['field'](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')](_0x023a('0x70'))[_0x023a('0x35')](_0x023a('0x71'))[_0x023a('0x35')](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')]['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()['field'](_0x023a('0x73'))[_0x023a('0x6f')](_0x023a('0x74'))['where'](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id'][_0x023a('0x6e')]()))[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x76'))[_0x023a('0x6f')](_0x023a('0x65'))[_0x023a('0x35')](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id']['toString']())))[_0x023a('0x6e')]();break;case _0x023a('0x77'):_0x2e5286=squel['insert']()[_0x023a('0x64')]('cm_hopper')[_0x023a('0x66')](['phone','scheduledAt',_0x023a('0x6c'),_0x023a('0x68'),_0x023a('0x56'),_0x023a('0x4d'),_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')]('phone',_0x023a('0x67'))[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x78'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))[_0x023a('0x6b')](_0x29b1a7['CmListId'][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9['params']['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')](_0x023a('0x6a'),'createdAt')[_0x023a('0x6b')]('NOW()','updatedAt')['from']('cm_contacts')['where'](_0x023a('0x71'))['where'](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')]())[_0x023a('0x35')](_0x023a('0x79'))[_0x023a('0x35')]('phone\x20NOT\x20IN\x20(?)',squel[_0x023a('0x69')]()['field'](_0x023a('0x76'))[_0x023a('0x6f')]('cm_hopper')[_0x023a('0x35')](_0x023a('0x75'),_0x305df9[_0x023a('0x3d')]['id']['toString']())))[_0x023a('0x6e')]();break;default:_0x2e5286=squel['insert']()[_0x023a('0x64')](_0x023a('0x65'))['fromQuery'](['phone','scheduledAt','ContactId',_0x023a('0x68'),_0x023a('0x56'),_0x023a('0x4d'),_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x67'),_0x023a('0x67'))[_0x023a('0x6b')]('NOW()',_0x023a('0x78'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))['field'](_0x29b1a7[_0x023a('0x6d')][_0x023a('0x6e')](),_0x023a('0x68'))[_0x023a('0x6b')](_0x305df9[_0x023a('0x3d')]['id'][_0x023a('0x6e')](),_0x023a('0x56'))[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x4d'))['field'](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')]('cm_contacts')[_0x023a('0x35')](_0x023a('0x71'))['where'](_0x023a('0x72'),_0x29b1a7[_0x023a('0x6d')]['toString']())[_0x023a('0x35')]('phone\x20IS\x20NOT\x20NULL'))[_0x023a('0x6e')]();}_0x4d1dfa[_0x023a('0x7a')](db['sequelize'][_0x023a('0x29')](_0x2e5286));}return BPromise[_0x023a('0x7b')](_0x4d1dfa);}})[_0x023a('0x20')](function(){return _0x2110cd;})[_0x023a('0x20')](respondWithResult(_0x276a25,null))['catch'](handleError(_0x276a25,null));};exports['removeLists']=function(_0x1f3503,_0x5baa2e,_0x3698fc){return db['Campaign'][_0x023a('0x41')]({'where':{'id':_0x1f3503[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x5baa2e,null))[_0x023a('0x20')](function(_0xbc9a6f){if(_0xbc9a6f){return _0xbc9a6f[_0x023a('0x7c')](_0x1f3503['query'][_0x023a('0x60')]);}})[_0x023a('0x20')](function(_0x48633f){if(_0x48633f){return db['CmHopper'][_0x023a('0x7d')]({'where':{'ListId':_0x1f3503[_0x023a('0x29')][_0x023a('0x60')],'CampaignId':_0x1f3503[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](function(){return _0x48633f;});}})['then'](respondWithStatusCode(_0x5baa2e,null))['catch'](handleError(_0x5baa2e,null));};exports[_0x023a('0x7e')]=function(_0x526773,_0x2daf15,_0x47309a){var _0x2bc2cb={};var _0x4bce13={};var _0x311320;var _0x294fa0;return db[_0x023a('0x25')][_0x023a('0x54')]({'where':{'id':_0x526773[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x2daf15,null))[_0x023a('0x20')](function(_0x5a1819){if(_0x5a1819){_0x311320=_0x5a1819;_0x4bce13[_0x023a('0x2c')]=_['keys'](db[_0x023a('0x7f')]['rawAttributes']);_0x4bce13[_0x023a('0x29')]=_[_0x023a('0x3e')](_0x526773[_0x023a('0x29')]);_0x4bce13[_0x023a('0x2a')]=_[_0x023a('0x2b')](_0x4bce13[_0x023a('0x2c')],_0x4bce13[_0x023a('0x29')]);_0x2bc2cb[_0x023a('0x2e')]=_[_0x023a('0x2b')](_0x4bce13[_0x023a('0x2c')],qs[_0x023a('0x2d')](_0x526773[_0x023a('0x29')][_0x023a('0x2d')]));_0x2bc2cb[_0x023a('0x2e')]=_0x2bc2cb['attributes'][_0x023a('0x40')]?_0x2bc2cb[_0x023a('0x2e')]:_0x4bce13[_0x023a('0x2c')];_0x2bc2cb[_0x023a('0x31')]=qs[_0x023a('0x32')](_0x526773[_0x023a('0x29')][_0x023a('0x32')]);_0x2bc2cb[_0x023a('0x35')]=qs['filters'](_[_0x023a('0x33')](_0x526773[_0x023a('0x29')],_0x4bce13[_0x023a('0x2a')]));if(_0x526773[_0x023a('0x29')][_0x023a('0x34')]){_0x2bc2cb[_0x023a('0x35')]=_[_0x023a('0x36')](_0x2bc2cb['where'],{'$or':_['map'](_0x2bc2cb['attributes'],function(_0xa1c1e5){var _0x2d52fb={};_0x2d52fb[_0xa1c1e5]={'$like':'%'+_0x526773[_0x023a('0x29')][_0x023a('0x34')]+'%'};return _0x2d52fb;})});}_0x2bc2cb=_[_0x023a('0x36')]({},_0x2bc2cb,_0x526773[_0x023a('0x37')]);return _0x311320[_0x023a('0x7e')](_0x2bc2cb);}})['then'](function(_0x11ed38){if(_0x11ed38){_0x294fa0=_0x11ed38[_0x023a('0x40')];if(!_0x526773['query']['hasOwnProperty'](_0x023a('0x30'))){_0x2bc2cb['limit']=qs[_0x023a('0x1b')](_0x526773[_0x023a('0x29')][_0x023a('0x1b')]);_0x2bc2cb[_0x023a('0x18')]=qs[_0x023a('0x18')](_0x526773[_0x023a('0x29')]['offset']);}return _0x311320[_0x023a('0x7e')](_0x2bc2cb);}})[_0x023a('0x20')](function(_0x5760cc){if(_0x5760cc){return _0x5760cc?{'count':_0x294fa0,'rows':_0x5760cc}:null;}})[_0x023a('0x20')](respondWithResult(_0x2daf15,null))[_0x023a('0x3b')](handleError(_0x2daf15,null));};exports[_0x023a('0x80')]=function(_0x1b7a57,_0x323539,_0x2c3c8f){var _0x18478f,_0x3f567d;return db[_0x023a('0x25')]['find']({'where':{'id':_0x1b7a57[_0x023a('0x3d')]['id']}})['then'](handleEntityNotFound(_0x323539,null))[_0x023a('0x20')](function(_0x583530){if(_0x583530){_0x3f567d=_0x583530;return _0x583530[_0x023a('0x80')](_0x1b7a57[_0x023a('0x43')][_0x023a('0x60')],_[_0x023a('0x4c')](_0x1b7a57['body'],['ids','id'])||{});}return null;})[_0x023a('0x61')](function(_0xc95d55){var _0x38b1d9;_0x18478f=_0xc95d55||[];var _0x4c4b2c=[];if(_0xc95d55){for(var _0x35174a=0x0;_0x35174a<_0xc95d55[_0x023a('0x40')];_0x35174a+=0x1){var _0x1ad936=_0xc95d55[_0x35174a][_0x023a('0x21')]({'plain':!![]});_0x38b1d9=squel['insert']()[_0x023a('0x64')]('cm_hopper_black')['fromQuery']([_0x023a('0x67'),_0x023a('0x6c'),_0x023a('0x68'),_0x023a('0x56'),'createdAt',_0x023a('0x4e')],squel[_0x023a('0x69')]()[_0x023a('0x6b')](_0x023a('0x67'),_0x023a('0x67'))[_0x023a('0x6b')]('id',_0x023a('0x6c'))[_0x023a('0x6b')](_0x1ad936[_0x023a('0x6d')][_0x023a('0x6e')](),'ListId')['field'](_0x1b7a57[_0x023a('0x3d')]['id']['toString'](),_0x023a('0x56'))['field'](_0x023a('0x6a'),'createdAt')[_0x023a('0x6b')](_0x023a('0x6a'),_0x023a('0x4e'))[_0x023a('0x6f')](_0x023a('0x70'))[_0x023a('0x35')](_0x023a('0x71'))[_0x023a('0x35')](_0x023a('0x72'),_0x1ad936[_0x023a('0x6d')]['toString']())[_0x023a('0x35')](_0x023a('0x79')))[_0x023a('0x6e')]();_0x4c4b2c[_0x023a('0x7a')](db[_0x023a('0x81')]['query'](_0x38b1d9));}return BPromise[_0x023a('0x7b')](_0x4c4b2c);}})[_0x023a('0x20')](function(){return _0x18478f;})[_0x023a('0x20')](respondWithResult(_0x323539,null))[_0x023a('0x3b')](handleError(_0x323539,null));};exports[_0x023a('0x82')]=function(_0x443a4c,_0x3bd443,_0x3b1763){return db[_0x023a('0x25')]['find']({'where':{'id':_0x443a4c[_0x023a('0x3d')]['id']}})[_0x023a('0x20')](handleEntityNotFound(_0x3bd443,null))[_0x023a('0x20')](function(_0x9d16f7){if(_0x9d16f7){return _0x9d16f7[_0x023a('0x82')](_0x443a4c[_0x023a('0x29')][_0x023a('0x60')]);}})[_0x023a('0x20')](function(_0x178b7c){if(_0x178b7c){return db[_0x023a('0x5d')][_0x023a('0x7d')]({'where':{'ListId':_0x443a4c[_0x023a('0x29')][_0x023a('0x60')],'CampaignId':_0x443a4c[_0x023a('0x3d')]['id']}})['then'](function(){return _0x178b7c;});}})[_0x023a('0x20')](respondWithStatusCode(_0x3bd443,null))[_0x023a('0x3b')](handleError(_0x3bd443,null));};
\ No newline at end of file
+var _0xd1e7=['key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','CmHopper','nolimit','CampaignId','filter','getHopperHistories','CmHopperHistory','CmHopperFinal','CmHopperBlack','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','removeBlackLists','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','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/license/util','../../mysqldb','sendStatus','status','json','undefined','count','offset','limit','set','apply','reject','save','then','destroy','IvrCampaigns','UserProfileResource','end','error','stack','name','send','index','map','Campaign','fieldName','type'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0xd1e7,0x1ee));var _0x7d1e=function(_0x2fc9d4,_0x14719f){_0x2fc9d4=_0x2fc9d4-0x0;var _0x1eff4b=_0xd1e7[_0x2fc9d4];return _0x1eff4b;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7d1e('0x0'));var zipdir=require(_0x7d1e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7d1e('0x2'));var moment=require(_0x7d1e('0x3'));var BPromise=require(_0x7d1e('0x4'));var Mustache=require(_0x7d1e('0x5'));var util=require(_0x7d1e('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x7d1e('0x7'));var ejs=require(_0x7d1e('0x8'));var fs=require('fs');var fs_extra=require(_0x7d1e('0x9'));var _=require(_0x7d1e('0xa'));var squel=require(_0x7d1e('0xb'));var crypto=require(_0x7d1e('0xc'));var jsforce=require(_0x7d1e('0xd'));var deskjs=require(_0x7d1e('0xe'));var toCsv=require(_0x7d1e('0x7'));var querystring=require(_0x7d1e('0xf'));var Papa=require(_0x7d1e('0x10'));var Redis=require(_0x7d1e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7d1e('0x12'));var as=require(_0x7d1e('0x13'));var hardwareService=require(_0x7d1e('0x14'));var logger=require(_0x7d1e('0x15'))(_0x7d1e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x7d1e('0x17'));var db=require(_0x7d1e('0x18'))['db'];function respondWithStatusCode(_0x26a589,_0x31b8e6){_0x31b8e6=_0x31b8e6||0xcc;return function(_0x57776a){if(_0x57776a){return _0x26a589[_0x7d1e('0x19')](_0x31b8e6);}return _0x26a589[_0x7d1e('0x1a')](_0x31b8e6)['end']();};}function respondWithResult(_0xc7b55e,_0xf740c4){_0xf740c4=_0xf740c4||0xc8;return function(_0x4a9ea){if(_0x4a9ea){return _0xc7b55e['status'](_0xf740c4)[_0x7d1e('0x1b')](_0x4a9ea);}};}function respondWithFilteredResult(_0x4fb9c3,_0x1404ac){return function(_0x384a51){if(_0x384a51){var _0x1e9e77=typeof _0x1404ac['offset']===_0x7d1e('0x1c')&&typeof _0x1404ac['limit']==='undefined';var _0xcc0868=_0x384a51[_0x7d1e('0x1d')];var _0x1861a3=_0x1e9e77?0x0:_0x1404ac[_0x7d1e('0x1e')];var _0x14b044=_0x1e9e77?_0x384a51[_0x7d1e('0x1d')]:_0x1404ac[_0x7d1e('0x1e')]+_0x1404ac[_0x7d1e('0x1f')];var _0x518db8;if(_0x14b044>=_0xcc0868){_0x14b044=_0xcc0868;_0x518db8=0xc8;}else{_0x518db8=0xce;}_0x4fb9c3['status'](_0x518db8);return _0x4fb9c3[_0x7d1e('0x20')]('Content-Range',_0x1861a3+'-'+_0x14b044+'/'+_0xcc0868)['json'](_0x384a51);}return null;};}function patchUpdates(_0x25a691){return function(_0x2cb5ec){try{jsonpatch[_0x7d1e('0x21')](_0x2cb5ec,_0x25a691,!![]);}catch(_0xf065e){return BPromise[_0x7d1e('0x22')](_0xf065e);}return _0x2cb5ec[_0x7d1e('0x23')]();};}function saveUpdates(_0x189427,_0x1392ab){return function(_0x5aba8b){if(_0x5aba8b){return _0x5aba8b['update'](_0x189427)[_0x7d1e('0x24')](function(_0x33c9b1){return _0x33c9b1;});}return null;};}function removeEntity(_0x2c8836,_0x573f1a){return function(_0x4fbc16){if(_0x4fbc16){return _0x4fbc16[_0x7d1e('0x25')]()[_0x7d1e('0x24')](function(){var _0x3abf36=_0x4fbc16['get']({'plain':!![]});var _0x524c00=_0x7d1e('0x26');return db[_0x7d1e('0x27')][_0x7d1e('0x25')]({'where':{'type':_0x524c00,'resourceId':_0x3abf36['id']}})[_0x7d1e('0x24')](function(){return _0x4fbc16;});})[_0x7d1e('0x24')](function(){_0x2c8836[_0x7d1e('0x1a')](0xcc)[_0x7d1e('0x28')]();});}};}function handleEntityNotFound(_0xdfc49e,_0x3d0ecd){return function(_0x124037){if(!_0x124037){_0xdfc49e[_0x7d1e('0x19')](0x194);}return _0x124037;};}function handleError(_0x4cefde,_0x36b982){_0x36b982=_0x36b982||0x1f4;return function(_0x206779){logger[_0x7d1e('0x29')](_0x206779[_0x7d1e('0x2a')]);if(_0x206779['name']){delete _0x206779[_0x7d1e('0x2b')];}_0x4cefde[_0x7d1e('0x1a')](_0x36b982)[_0x7d1e('0x2c')](_0x206779);};}exports[_0x7d1e('0x2d')]=function(_0x2cf4dc,_0x2a5bb7){var _0x3f99b={},_0x51265e={},_0x2d7e03={'count':0x0,'rows':[]};var _0xb853ff=_[_0x7d1e('0x2e')](db[_0x7d1e('0x2f')]['rawAttributes'],function(_0xc9e0dc){return{'name':_0xc9e0dc[_0x7d1e('0x30')],'type':_0xc9e0dc[_0x7d1e('0x31')][_0x7d1e('0x32')]};});_0x51265e['model']=_[_0x7d1e('0x2e')](_0xb853ff,'name');_0x51265e[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2cf4dc[_0x7d1e('0x33')]);_0x51265e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],_0x51265e[_0x7d1e('0x33')]);_0x3f99b['attributes']=_[_0x7d1e('0x36')](_0x51265e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2cf4dc[_0x7d1e('0x33')]['fields']));_0x3f99b[_0x7d1e('0x39')]=_0x3f99b[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3f99b[_0x7d1e('0x39')]:_0x51265e[_0x7d1e('0x37')];if(!_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x3f99b[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2cf4dc['query'][_0x7d1e('0x1f')]);_0x3f99b['offset']=qs['offset'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3f99b[_0x7d1e('0x3c')]=qs['sort'](_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3f99b['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2cf4dc[_0x7d1e('0x33')],_0x51265e['filters']),_0xb853ff);if(_0x2cf4dc[_0x7d1e('0x33')]['filter']){_0x3f99b[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3f99b['where'],{'$or':_[_0x7d1e('0x2e')](_0xb853ff,function(_0x361aa0){if(_0x361aa0[_0x7d1e('0x31')]!=='VIRTUAL'){var _0x3e2f71={};_0x3e2f71[_0x361aa0[_0x7d1e('0x2b')]]={'$like':'%'+_0x2cf4dc[_0x7d1e('0x33')]['filter']+'%'};return _0x3e2f71;}})});}_0x3f99b=_[_0x7d1e('0x40')]({},_0x3f99b,_0x2cf4dc[_0x7d1e('0x41')]);var _0x135953={'where':_0x3f99b[_0x7d1e('0x3f')]};return db[_0x7d1e('0x2f')][_0x7d1e('0x1d')](_0x135953)['then'](function(_0x12c67d){_0x2d7e03[_0x7d1e('0x1d')]=_0x12c67d;if(_0x2cf4dc[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3f99b[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x2f')][_0x7d1e('0x44')](_0x3f99b);})[_0x7d1e('0x24')](function(_0x823b3){_0x2d7e03[_0x7d1e('0x45')]=_0x823b3;return _0x2d7e03;})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2a5bb7,_0x3f99b))[_0x7d1e('0x46')](handleError(_0x2a5bb7,null));};exports[_0x7d1e('0x47')]=function(_0xdde30f,_0x24eadc){var _0xcfe0d4={'raw':![],'where':{'id':_0xdde30f[_0x7d1e('0x48')]['id']}},_0x2bcf2e={};_0x2bcf2e[_0x7d1e('0x37')]=_['keys'](db['Campaign'][_0x7d1e('0x49')]);_0x2bcf2e[_0x7d1e('0x33')]=_['keys'](_0xdde30f['query']);_0x2bcf2e[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x2bcf2e[_0x7d1e('0x37')],_0x2bcf2e['query']);_0xcfe0d4['attributes']=_['intersection'](_0x2bcf2e[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0xdde30f['query'][_0x7d1e('0x38')]));_0xcfe0d4[_0x7d1e('0x39')]=_0xcfe0d4[_0x7d1e('0x39')]['length']?_0xcfe0d4[_0x7d1e('0x39')]:_0x2bcf2e['model'];if(_0xdde30f['query']['includeAll']){_0xcfe0d4[_0x7d1e('0x43')]=[{'all':!![]}];}_0xcfe0d4=_[_0x7d1e('0x40')]({},_0xcfe0d4,_0xdde30f[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')]['find'](_0xcfe0d4)[_0x7d1e('0x24')](handleEntityNotFound(_0x24eadc,null))[_0x7d1e('0x24')](respondWithResult(_0x24eadc,null))[_0x7d1e('0x46')](handleError(_0x24eadc,null));};exports['create']=function(_0xd256e5,_0x14f008){return db[_0x7d1e('0x2f')][_0x7d1e('0x4a')](_0xd256e5[_0x7d1e('0x4b')],{})['then'](function(_0x530214){var _0xf860ef=_0xd256e5[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0xf860ef)throw new Error(_0x7d1e('0x4e'));if(_0xf860ef[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x34b641=_0x530214[_0x7d1e('0x4d')]({'plain':!![]});var _0x446b82=_0x7d1e('0x26');return db[_0x7d1e('0x50')]['find']({'where':{'name':_0x446b82,'userProfileId':_0xf860ef[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x1bc8f6){if(_0x1bc8f6&&_0x1bc8f6[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')]['create']({'name':_0x34b641[_0x7d1e('0x2b')],'resourceId':_0x34b641['id'],'type':_0x1bc8f6[_0x7d1e('0x2b')],'sectionId':_0x1bc8f6['id']},{})[_0x7d1e('0x24')](function(){return _0x530214;});}else{return _0x530214;}})[_0x7d1e('0x46')](function(_0x38690a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x38690a);throw _0x38690a;});}return _0x530214;})[_0x7d1e('0x24')](respondWithResult(_0x14f008,0xc9))['catch'](handleError(_0x14f008,null));};exports[_0x7d1e('0x53')]=function(_0x3f9a68,_0x211867){var _0x233512={'where':{'id':_0x3f9a68[_0x7d1e('0x48')]['id']}},_0x4361ee={};_0x4361ee[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x2f')][_0x7d1e('0x49')]);_0x233512['attributes']=_[_0x7d1e('0x36')](_0x4361ee[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x3f9a68['query'][_0x7d1e('0x38')]));_0x233512[_0x7d1e('0x39')]=_0x233512[_0x7d1e('0x39')]['length']?_0x233512['attributes']:_0x4361ee[_0x7d1e('0x37')];if(_0x3f9a68[_0x7d1e('0x33')]['includeAll']){_0x233512[_0x7d1e('0x43')]=[{'all':!![]}];}_0x233512=_[_0x7d1e('0x40')]({},_0x233512,_0x3f9a68[_0x7d1e('0x41')]);return db[_0x7d1e('0x2f')][_0x7d1e('0x54')](_0x233512)[_0x7d1e('0x24')](handleEntityNotFound(_0x211867,null))['then'](function(_0x2fc02f){if(_0x2fc02f){var _0x42007c=_0x2fc02f[_0x7d1e('0x4d')]({'plain':!![]});_0x42007c=qs[_0x7d1e('0x55')](_0x42007c,['id',_0x7d1e('0x56'),_0x7d1e('0x57')]);_0x3f9a68[_0x7d1e('0x4b')]=_[_0x7d1e('0x55')](_0x3f9a68[_0x7d1e('0x4b')],['id','createdAt','updatedAt']);return db[_0x7d1e('0x2f')]['create'](_[_0x7d1e('0x40')](_0x42007c,_0x3f9a68[_0x7d1e('0x4b')]),{'include':_0x3f9a68[_0x7d1e('0x33')][_0x7d1e('0x42')]?[{'all':!![]}]:undefined})['then'](function(_0x4e45d3){var _0x1a9f18=_0x3f9a68[_0x7d1e('0x4c')][_0x7d1e('0x4d')]({'plain':!![]});if(!_0x1a9f18)throw new Error(_0x7d1e('0x4e'));if(_0x1a9f18[_0x7d1e('0x4f')]===_0x7d1e('0x4c')){var _0x3538e1=_0x4e45d3[_0x7d1e('0x4d')]({'plain':!![]});var _0x29b8e2=_0x7d1e('0x26');return db[_0x7d1e('0x50')][_0x7d1e('0x54')]({'where':{'name':_0x29b8e2,'userProfileId':_0x1a9f18[_0x7d1e('0x51')]},'raw':!![]})[_0x7d1e('0x24')](function(_0x2e993c){if(_0x2e993c&&_0x2e993c[_0x7d1e('0x52')]===0x0){return db[_0x7d1e('0x27')][_0x7d1e('0x4a')]({'name':_0x3538e1[_0x7d1e('0x2b')],'resourceId':_0x3538e1['id'],'type':_0x2e993c[_0x7d1e('0x2b')],'sectionId':_0x2e993c['id']},{})['then'](function(){return _0x4e45d3;});}else{return _0x4e45d3;}})['catch'](function(_0x5a1750){logger[_0x7d1e('0x29')](_0x7d1e('0x58'),_0x5a1750);throw _0x5a1750;});}return _0x4e45d3;});}})['then'](respondWithResult(_0x211867,0xc9))[_0x7d1e('0x46')](handleError(_0x211867,null));};exports[_0x7d1e('0x59')]=function(_0x1bddd8,_0x16b79c){if(_0x1bddd8[_0x7d1e('0x4b')]['id']){delete _0x1bddd8[_0x7d1e('0x4b')]['id'];}return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x1bddd8[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x16b79c,null))[_0x7d1e('0x24')](saveUpdates(_0x1bddd8[_0x7d1e('0x4b')],null))[_0x7d1e('0x24')](respondWithResult(_0x16b79c,null))[_0x7d1e('0x46')](handleError(_0x16b79c,null));};exports[_0x7d1e('0x25')]=function(_0x2e60cf,_0x9dbd6c){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x2e60cf[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x9dbd6c,null))[_0x7d1e('0x24')](removeEntity(_0x9dbd6c,null))['catch'](handleError(_0x9dbd6c,null));};exports[_0x7d1e('0x5a')]=function(_0x313e0a,_0x35c59b,_0x18ee9b){var _0x41a378={'raw':!![],'where':{}};var _0x117cb7={};var _0x1ade85={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x313e0a['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x35c59b,null))[_0x7d1e('0x24')](function(_0x5ec93c){if(_0x5ec93c){_0x117cb7['model']=_[_0x7d1e('0x34')](db[_0x7d1e('0x5c')]['rawAttributes']);_0x117cb7['query']=_[_0x7d1e('0x34')](_0x313e0a[_0x7d1e('0x33')]);_0x117cb7[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],_0x117cb7['query']);_0x41a378[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x117cb7[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x41a378[_0x7d1e('0x39')]=_0x41a378[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x41a378['attributes']:_0x117cb7['model'];if(!_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x41a378[_0x7d1e('0x1f')]=qs['limit'](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x41a378['offset']=qs[_0x7d1e('0x1e')](_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x41a378['order']=qs[_0x7d1e('0x3d')](_0x313e0a[_0x7d1e('0x33')]['sort']);_0x41a378[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_['pick'](_0x313e0a['query'],_0x117cb7['filters']));_0x41a378[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x5ec93c['id'];if(_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x41a378['where']=_[_0x7d1e('0x40')](_0x41a378[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x41a378['attributes'],function(_0xb04b39){var _0x4b7efd={};_0x4b7efd[_0xb04b39]={'$like':'%'+_0x313e0a[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x4b7efd;})});}_0x41a378=_[_0x7d1e('0x40')]({},_0x41a378,_0x313e0a[_0x7d1e('0x41')]);return db['CmHopper'][_0x7d1e('0x1d')]({'where':_0x41a378[_0x7d1e('0x3f')]})['then'](function(_0xaa428a){_0x1ade85['count']=_0xaa428a;if(_0x313e0a[_0x7d1e('0x33')]['includeAll']){_0x41a378[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x5c')][_0x7d1e('0x44')](_0x41a378);})[_0x7d1e('0x24')](function(_0xbd0e6b){_0x1ade85[_0x7d1e('0x45')]=_0xbd0e6b;return _0x1ade85;});}})['then'](respondWithFilteredResult(_0x35c59b,_0x41a378))[_0x7d1e('0x46')](handleError(_0x35c59b,null));};exports[_0x7d1e('0x60')]=function(_0x569a9c,_0x184673,_0x2f3f61){var _0x5cf758={'raw':!![],'where':{}};var _0x433fcf={};var _0x3ac15a={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x569a9c['params']['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x184673,null))[_0x7d1e('0x24')](function(_0x4b4f9f){if(_0x4b4f9f){_0x433fcf[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x61')][_0x7d1e('0x49')]);_0x433fcf['query']=_[_0x7d1e('0x34')](_0x569a9c[_0x7d1e('0x33')]);_0x433fcf[_0x7d1e('0x35')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],_0x433fcf[_0x7d1e('0x33')]);_0x5cf758[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x433fcf[_0x7d1e('0x37')],qs['fields'](_0x569a9c[_0x7d1e('0x33')]['fields']));_0x5cf758[_0x7d1e('0x39')]=_0x5cf758[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x5cf758[_0x7d1e('0x39')]:_0x433fcf[_0x7d1e('0x37')];if(!_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x5cf758['limit']=qs[_0x7d1e('0x1f')](_0x569a9c['query']['limit']);_0x5cf758[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x569a9c['query']['offset']);}_0x5cf758[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x569a9c['query']['sort']);_0x5cf758['where']=qs[_0x7d1e('0x35')](_['pick'](_0x569a9c[_0x7d1e('0x33')],_0x433fcf[_0x7d1e('0x35')]));_0x5cf758['where'][_0x7d1e('0x5e')]=_0x4b4f9f['id'];if(_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x5cf758['where']=_[_0x7d1e('0x40')](_0x5cf758[_0x7d1e('0x3f')],{'$or':_['map'](_0x5cf758['attributes'],function(_0x34a290){var _0x52be4c={};_0x52be4c[_0x34a290]={'$like':'%'+_0x569a9c[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x52be4c;})});}_0x5cf758=_[_0x7d1e('0x40')]({},_0x5cf758,_0x569a9c[_0x7d1e('0x41')]);return db[_0x7d1e('0x61')][_0x7d1e('0x1d')]({'where':_0x5cf758['where']})['then'](function(_0x3afad2){_0x3ac15a[_0x7d1e('0x1d')]=_0x3afad2;if(_0x569a9c[_0x7d1e('0x33')]['includeAll']){_0x5cf758[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x61')][_0x7d1e('0x44')](_0x5cf758);})[_0x7d1e('0x24')](function(_0x14fab5){_0x3ac15a['rows']=_0x14fab5;return _0x3ac15a;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x184673,_0x5cf758))[_0x7d1e('0x46')](handleError(_0x184673,null));};exports['getHopperFinals']=function(_0x2debfb,_0x37048c,_0x3d00c6){var _0x3e33d1={'raw':!![],'where':{}};var _0x8a138a={};var _0x50526a={'count':0x0,'rows':[]};return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2debfb[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x37048c,null))[_0x7d1e('0x24')](function(_0x1e9e26){if(_0x1e9e26){_0x8a138a[_0x7d1e('0x37')]=_['keys'](db[_0x7d1e('0x62')][_0x7d1e('0x49')]);_0x8a138a[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2debfb[_0x7d1e('0x33')]);_0x8a138a[_0x7d1e('0x35')]=_['intersection'](_0x8a138a[_0x7d1e('0x37')],_0x8a138a[_0x7d1e('0x33')]);_0x3e33d1['attributes']=_[_0x7d1e('0x36')](_0x8a138a[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x2debfb['query'][_0x7d1e('0x38')]));_0x3e33d1[_0x7d1e('0x39')]=_0x3e33d1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3e33d1[_0x7d1e('0x39')]:_0x8a138a[_0x7d1e('0x37')];if(!_0x2debfb[_0x7d1e('0x33')]['hasOwnProperty'](_0x7d1e('0x5d'))){_0x3e33d1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x3e33d1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x3e33d1[_0x7d1e('0x3c')]=qs['sort'](_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3e33d1['where']=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2debfb['query'],_0x8a138a['filters']));_0x3e33d1['where']['CampaignId']=_0x1e9e26['id'];if(_0x2debfb[_0x7d1e('0x33')]['filter']){_0x3e33d1['where']=_[_0x7d1e('0x40')](_0x3e33d1[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x3e33d1['attributes'],function(_0x3f906d){var _0x5f3d3c={};_0x5f3d3c[_0x3f906d]={'$like':'%'+_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x5f3d3c;})});}_0x3e33d1=_[_0x7d1e('0x40')]({},_0x3e33d1,_0x2debfb['options']);return db['CmHopperFinal']['count']({'where':_0x3e33d1[_0x7d1e('0x3f')]})[_0x7d1e('0x24')](function(_0x48cbd3){_0x50526a[_0x7d1e('0x1d')]=_0x48cbd3;if(_0x2debfb[_0x7d1e('0x33')][_0x7d1e('0x42')]){_0x3e33d1['include']=[{'all':!![]}];}return db[_0x7d1e('0x62')][_0x7d1e('0x44')](_0x3e33d1);})[_0x7d1e('0x24')](function(_0x288e3b){_0x50526a[_0x7d1e('0x45')]=_0x288e3b;return _0x50526a;});}})['then'](respondWithFilteredResult(_0x37048c,_0x3e33d1))['catch'](handleError(_0x37048c,null));};exports['getHopperBlacks']=function(_0x3a771f,_0x2d15f4,_0x38ec66){var _0x4589b9={'raw':!![],'where':{}};var _0x16cb78={};var _0x9a1c77={'count':0x0,'rows':[]};return db[_0x7d1e('0x2f')][_0x7d1e('0x5b')]({'where':{'id':_0x3a771f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d15f4,null))['then'](function(_0x58dadc){if(_0x58dadc){_0x16cb78[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x63')][_0x7d1e('0x49')]);_0x16cb78[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x3a771f['query']);_0x16cb78['filters']=_[_0x7d1e('0x36')](_0x16cb78[_0x7d1e('0x37')],_0x16cb78[_0x7d1e('0x33')]);_0x4589b9['attributes']=_['intersection'](_0x16cb78['model'],qs['fields'](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x4589b9[_0x7d1e('0x39')]=_0x4589b9['attributes'][_0x7d1e('0x3a')]?_0x4589b9[_0x7d1e('0x39')]:_0x16cb78[_0x7d1e('0x37')];if(!_0x3a771f[_0x7d1e('0x33')]['hasOwnProperty']('nolimit')){_0x4589b9[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1f')]);_0x4589b9[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}_0x4589b9['order']=qs[_0x7d1e('0x3d')](_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x4589b9[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x3a771f[_0x7d1e('0x33')],_0x16cb78[_0x7d1e('0x35')]));_0x4589b9[_0x7d1e('0x3f')][_0x7d1e('0x5e')]=_0x58dadc['id'];if(_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x4589b9[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x4589b9[_0x7d1e('0x3f')],{'$or':_[_0x7d1e('0x2e')](_0x4589b9[_0x7d1e('0x39')],function(_0x59e232){var _0x29f5fb={};_0x29f5fb[_0x59e232]={'$like':'%'+_0x3a771f[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x29f5fb;})});}_0x4589b9=_[_0x7d1e('0x40')]({},_0x4589b9,_0x3a771f['options']);return db[_0x7d1e('0x63')]['count']({'where':_0x4589b9['where']})[_0x7d1e('0x24')](function(_0x540bb3){_0x9a1c77['count']=_0x540bb3;if(_0x3a771f['query'][_0x7d1e('0x42')]){_0x4589b9[_0x7d1e('0x43')]=[{'all':!![]}];}return db[_0x7d1e('0x63')]['findAll'](_0x4589b9);})['then'](function(_0x2a7146){_0x9a1c77[_0x7d1e('0x45')]=_0x2a7146;return _0x9a1c77;});}})[_0x7d1e('0x24')](respondWithFilteredResult(_0x2d15f4,_0x4589b9))[_0x7d1e('0x46')](handleError(_0x2d15f4,null));};exports['getLists']=function(_0x2ce351,_0x144c94,_0x17e73e){var _0x3a0ff1={};var _0x4318d6={};var _0x4a5ab7;var _0x47315b;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x2ce351[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x144c94,null))[_0x7d1e('0x24')](function(_0x2a6f86){if(_0x2a6f86){_0x4a5ab7=_0x2a6f86;_0x4318d6[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x4318d6[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x2ce351[_0x7d1e('0x33')]);_0x4318d6[_0x7d1e('0x35')]=_['intersection'](_0x4318d6[_0x7d1e('0x37')],_0x4318d6[_0x7d1e('0x33')]);_0x3a0ff1[_0x7d1e('0x39')]=_[_0x7d1e('0x36')](_0x4318d6[_0x7d1e('0x37')],qs['fields'](_0x2ce351['query'][_0x7d1e('0x38')]));_0x3a0ff1['attributes']=_0x3a0ff1[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x3a0ff1[_0x7d1e('0x39')]:_0x4318d6[_0x7d1e('0x37')];_0x3a0ff1[_0x7d1e('0x3c')]=qs[_0x7d1e('0x3d')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x3a0ff1[_0x7d1e('0x3f')]=qs[_0x7d1e('0x35')](_[_0x7d1e('0x3e')](_0x2ce351[_0x7d1e('0x33')],_0x4318d6[_0x7d1e('0x35')]));if(_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x3a0ff1[_0x7d1e('0x3f')]=_[_0x7d1e('0x40')](_0x3a0ff1['where'],{'$or':_[_0x7d1e('0x2e')](_0x3a0ff1[_0x7d1e('0x39')],function(_0x53f99e){var _0x9a1d6c={};_0x9a1d6c[_0x53f99e]={'$like':'%'+_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x9a1d6c;})});}_0x3a0ff1=_[_0x7d1e('0x40')]({},_0x3a0ff1,_0x2ce351[_0x7d1e('0x41')]);return _0x4a5ab7['getLists'](_0x3a0ff1);}})['then'](function(_0x48972b){if(_0x48972b){_0x47315b=_0x48972b['length'];if(!_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x3b')](_0x7d1e('0x5d'))){_0x3a0ff1[_0x7d1e('0x1f')]=qs[_0x7d1e('0x1f')](_0x2ce351['query'][_0x7d1e('0x1f')]);_0x3a0ff1[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x2ce351[_0x7d1e('0x33')][_0x7d1e('0x1e')]);}return _0x4a5ab7['getLists'](_0x3a0ff1);}})[_0x7d1e('0x24')](function(_0x21bb17){if(_0x21bb17){return _0x21bb17?{'count':_0x47315b,'rows':_0x21bb17}:null;}})['then'](respondWithResult(_0x144c94,null))['catch'](handleError(_0x144c94,null));};exports[_0x7d1e('0x65')]=function(_0x5dd05f,_0x13698a,_0x4f9e21){var _0x4e5f78,_0xca93fd;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x5dd05f[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x13698a,null))[_0x7d1e('0x24')](function(_0x4da334){if(_0x4da334){_0xca93fd=_0x4da334;return _0x4da334['addLists'](_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x5dd05f[_0x7d1e('0x4b')],['ids','id'])||{});}return null;})['spread'](function(_0x22eb67){var _0x23790f;_0x4e5f78=_0x22eb67||[];var _0x53153f=[];if(_0x22eb67){for(var _0x5793a7=0x0;_0x5793a7<_0x22eb67[_0x7d1e('0x3a')];_0x5793a7+=0x1){var _0x51ed2c=_0x22eb67[_0x5793a7][_0x7d1e('0x4d')]({'plain':!![]});_0xca93fd[_0x7d1e('0x67')]=_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]?_0x5dd05f[_0x7d1e('0x4b')][_0x7d1e('0x67')]:_0xca93fd[_0x7d1e('0x67')];switch(_0xca93fd[_0x7d1e('0x67')]){case _0x7d1e('0x68'):_0x23790f=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),'createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),'phone')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x51ed2c['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))[_0x7d1e('0x3f')](_0x7d1e('0x78'),_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel['select']()[_0x7d1e('0x70')](_0x7d1e('0x7c'))[_0x7d1e('0x75')]('cm_hopper_final')['where'](_0x7d1e('0x7d'),_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]()))[_0x7d1e('0x3f')](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))['from'](_0x7d1e('0x6b'))[_0x7d1e('0x3f')](_0x7d1e('0x7d'),_0x5dd05f['params']['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;case _0x7d1e('0x7f'):_0x23790f=squel[_0x7d1e('0x69')]()['into'](_0x7d1e('0x6b'))['fromQuery'](['phone',_0x7d1e('0x6d'),'ContactId','ListId','CampaignId','createdAt',_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone',_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x6d'))[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')](),_0x7d1e('0x6e'))[_0x7d1e('0x70')](_0x5dd05f[_0x7d1e('0x48')]['id']['toString'](),'CampaignId')[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))['where'](_0x7d1e('0x77'))['where'](_0x7d1e('0x78'),_0x51ed2c['CmListId']['toString']())['where'](_0x7d1e('0x7a'))['where'](_0x7d1e('0x7b'),squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x7e'))[_0x7d1e('0x75')]('cm_hopper')[_0x7d1e('0x3f')]('CampaignId\x20=\x20?',_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')]())))[_0x7d1e('0x74')]();break;default:_0x23790f=squel['insert']()[_0x7d1e('0x6a')](_0x7d1e('0x6b'))[_0x7d1e('0x6c')](['phone',_0x7d1e('0x6d'),'ContactId',_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')](_0x7d1e('0x71'),_0x7d1e('0x71'))[_0x7d1e('0x70')](_0x7d1e('0x72'),'scheduledAt')['field']('id','ContactId')[_0x7d1e('0x70')](_0x51ed2c[_0x7d1e('0x79')]['toString'](),_0x7d1e('0x6e'))['field'](_0x5dd05f[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))['field'](_0x7d1e('0x72'),_0x7d1e('0x56'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x57'))[_0x7d1e('0x75')](_0x7d1e('0x76'))[_0x7d1e('0x3f')](_0x7d1e('0x77'))['where']('ListId\x20=\x20?',_0x51ed2c[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))[_0x7d1e('0x74')]();}_0x53153f[_0x7d1e('0x80')](db[_0x7d1e('0x81')][_0x7d1e('0x33')](_0x23790f));}return BPromise[_0x7d1e('0x82')](_0x53153f);}})[_0x7d1e('0x24')](function(){return _0x4e5f78;})['then'](respondWithResult(_0x13698a,null))['catch'](handleError(_0x13698a,null));};exports[_0x7d1e('0x83')]=function(_0x59e013,_0x2d5b74,_0x90b4aa){return db[_0x7d1e('0x2f')]['find']({'where':{'id':_0x59e013[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x2d5b74,null))[_0x7d1e('0x24')](function(_0x3c6843){if(_0x3c6843){return _0x3c6843[_0x7d1e('0x83')](_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x5a13d3){if(_0x5a13d3){return db[_0x7d1e('0x5c')][_0x7d1e('0x25')]({'where':{'ListId':_0x59e013[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x59e013['params']['id']}})[_0x7d1e('0x24')](function(){return _0x5a13d3;});}})[_0x7d1e('0x24')](respondWithStatusCode(_0x2d5b74,null))[_0x7d1e('0x46')](handleError(_0x2d5b74,null));};exports[_0x7d1e('0x84')]=function(_0x4af5ae,_0x34ad7c,_0x376cf8){var _0x50a9a2={};var _0x16e020={};var _0x5cb468;var _0x2c5390;return db['Campaign'][_0x7d1e('0x5b')]({'where':{'id':_0x4af5ae[_0x7d1e('0x48')]['id']}})['then'](handleEntityNotFound(_0x34ad7c,null))[_0x7d1e('0x24')](function(_0x2eda37){if(_0x2eda37){_0x5cb468=_0x2eda37;_0x16e020[_0x7d1e('0x37')]=_[_0x7d1e('0x34')](db[_0x7d1e('0x64')][_0x7d1e('0x49')]);_0x16e020[_0x7d1e('0x33')]=_[_0x7d1e('0x34')](_0x4af5ae[_0x7d1e('0x33')]);_0x16e020['filters']=_[_0x7d1e('0x36')](_0x16e020[_0x7d1e('0x37')],_0x16e020[_0x7d1e('0x33')]);_0x50a9a2[_0x7d1e('0x39')]=_['intersection'](_0x16e020[_0x7d1e('0x37')],qs[_0x7d1e('0x38')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x38')]));_0x50a9a2[_0x7d1e('0x39')]=_0x50a9a2[_0x7d1e('0x39')][_0x7d1e('0x3a')]?_0x50a9a2['attributes']:_0x16e020['model'];_0x50a9a2['order']=qs[_0x7d1e('0x3d')](_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3d')]);_0x50a9a2[_0x7d1e('0x3f')]=qs['filters'](_[_0x7d1e('0x3e')](_0x4af5ae['query'],_0x16e020[_0x7d1e('0x35')]));if(_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]){_0x50a9a2[_0x7d1e('0x3f')]=_['merge'](_0x50a9a2['where'],{'$or':_[_0x7d1e('0x2e')](_0x50a9a2[_0x7d1e('0x39')],function(_0x3a0bef){var _0x2befa2={};_0x2befa2[_0x3a0bef]={'$like':'%'+_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x5f')]+'%'};return _0x2befa2;})});}_0x50a9a2=_[_0x7d1e('0x40')]({},_0x50a9a2,_0x4af5ae[_0x7d1e('0x41')]);return _0x5cb468['getBlackLists'](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x800fc1){if(_0x800fc1){_0x2c5390=_0x800fc1['length'];if(!_0x4af5ae[_0x7d1e('0x33')][_0x7d1e('0x3b')]('nolimit')){_0x50a9a2['limit']=qs[_0x7d1e('0x1f')](_0x4af5ae[_0x7d1e('0x33')]['limit']);_0x50a9a2[_0x7d1e('0x1e')]=qs[_0x7d1e('0x1e')](_0x4af5ae['query'][_0x7d1e('0x1e')]);}return _0x5cb468[_0x7d1e('0x84')](_0x50a9a2);}})[_0x7d1e('0x24')](function(_0x69beec){if(_0x69beec){return _0x69beec?{'count':_0x2c5390,'rows':_0x69beec}:null;}})[_0x7d1e('0x24')](respondWithResult(_0x34ad7c,null))['catch'](handleError(_0x34ad7c,null));};exports[_0x7d1e('0x85')]=function(_0x572649,_0x444dc4,_0x1dfe2a){var _0x31387a,_0x47c79f;return db[_0x7d1e('0x2f')][_0x7d1e('0x54')]({'where':{'id':_0x572649[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x444dc4,null))[_0x7d1e('0x24')](function(_0x1d0937){if(_0x1d0937){_0x47c79f=_0x1d0937;return _0x1d0937[_0x7d1e('0x85')](_0x572649['body'][_0x7d1e('0x66')],_[_0x7d1e('0x55')](_0x572649[_0x7d1e('0x4b')],[_0x7d1e('0x66'),'id'])||{});}return null;})[_0x7d1e('0x86')](function(_0x22617e){var _0x4b966c;_0x31387a=_0x22617e||[];var _0x381c29=[];if(_0x22617e){for(var _0x2439d5=0x0;_0x2439d5<_0x22617e[_0x7d1e('0x3a')];_0x2439d5+=0x1){var _0x419536=_0x22617e[_0x2439d5]['get']({'plain':!![]});_0x4b966c=squel[_0x7d1e('0x69')]()[_0x7d1e('0x6a')]('cm_hopper_black')[_0x7d1e('0x6c')](['phone',_0x7d1e('0x73'),_0x7d1e('0x6e'),_0x7d1e('0x5e'),_0x7d1e('0x56'),_0x7d1e('0x57')],squel[_0x7d1e('0x6f')]()[_0x7d1e('0x70')]('phone','phone')[_0x7d1e('0x70')]('id',_0x7d1e('0x73'))['field'](_0x419536['CmListId'][_0x7d1e('0x74')](),_0x7d1e('0x6e'))['field'](_0x572649[_0x7d1e('0x48')]['id'][_0x7d1e('0x74')](),_0x7d1e('0x5e'))[_0x7d1e('0x70')](_0x7d1e('0x72'),_0x7d1e('0x56'))['field'](_0x7d1e('0x72'),_0x7d1e('0x57'))['from'](_0x7d1e('0x76'))[_0x7d1e('0x3f')]('deletedAt\x20IS\x20NULL')['where'](_0x7d1e('0x78'),_0x419536[_0x7d1e('0x79')][_0x7d1e('0x74')]())[_0x7d1e('0x3f')](_0x7d1e('0x7a')))['toString']();_0x381c29['push'](db['sequelize'][_0x7d1e('0x33')](_0x4b966c));}return BPromise['all'](_0x381c29);}})['then'](function(){return _0x31387a;})[_0x7d1e('0x24')](respondWithResult(_0x444dc4,null))['catch'](handleError(_0x444dc4,null));};exports[_0x7d1e('0x87')]=function(_0x12adc0,_0x5da1e5,_0x378ee2){return db['Campaign'][_0x7d1e('0x54')]({'where':{'id':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](handleEntityNotFound(_0x5da1e5,null))[_0x7d1e('0x24')](function(_0x9ea85b){if(_0x9ea85b){return _0x9ea85b[_0x7d1e('0x87')](_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')]);}})['then'](function(_0x39f005){if(_0x39f005){return db[_0x7d1e('0x63')][_0x7d1e('0x25')]({'where':{'ListId':_0x12adc0[_0x7d1e('0x33')][_0x7d1e('0x66')],'CampaignId':_0x12adc0[_0x7d1e('0x48')]['id']}})[_0x7d1e('0x24')](function(){return _0x39f005;});}})['then'](respondWithStatusCode(_0x5da1e5,null))[_0x7d1e('0x46')](handleError(_0x5da1e5,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 656f5cb..e1452f2 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(_0x5509a8,_0x1a8b93){var _0x5383b1=function(_0x14cde3){while(--_0x14cde3){_0x5509a8['push'](_0x5509a8['shift']());}};_0x5383b1(++_0x1a8b93);}(_0x7a54,0x106));var _0x47a5=function(_0x55215a,_0x19cbd2){_0x55215a=_0x55215a-0x0;var _0x265e45=_0x7a54[_0x55215a];return _0x265e45;};'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 _0x9957=['exports','define','Campaign','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./campaign.attributes'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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':'campaigns','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 2986a3e..7a6baf3 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 _0x45c8=['debug','stringify','error','code','message','result','options','raw','where','attributes','include','model','map','GetCampaign','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent'];(function(_0x200556,_0x486dda){var _0x569faa=function(_0x2299b4){while(--_0x2299b4){_0x200556['push'](_0x200556['shift']());}};_0x569faa(++_0x486dda);}(_0x45c8,0xef));var _0x845c=function(_0x376573,_0x5eea01){_0x376573=_0x376573-0x0;var _0x23e41b=_0x45c8[_0x376573];return _0x23e41b;};'use strict';var _=require(_0x845c('0x0'));var util=require('util');var moment=require(_0x845c('0x1'));var BPromise=require(_0x845c('0x2'));var rs=require(_0x845c('0x3'));var fs=require('fs');var Redis=require(_0x845c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x845c('0x5'));var jayson=require(_0x845c('0x6'));var client=jayson[_0x845c('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x335f38,_0x4a1a42,_0x42b569){return new BPromise(function(_0x4648e1,_0x3075cd){return client[_0x845c('0x8')](_0x335f38,_0x42b569)[_0x845c('0x9')](function(_0x34a8ae){logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));logger[_0x845c('0xd')]('Campaign,\x20%s,\x20%s,\x20%s',_0x4a1a42,'request\x20sent',JSON[_0x845c('0xe')](_0x34a8ae));if(_0x34a8ae[_0x845c('0xf')]){if(_0x34a8ae['error'][_0x845c('0x10')]===0x1f4){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);return _0x3075cd(_0x34a8ae[_0x845c('0xf')]['message']);}logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x34a8ae['error'][_0x845c('0x11')]);return _0x4648e1(_0x34a8ae[_0x845c('0xf')][_0x845c('0x11')]);}else{logger[_0x845c('0xa')](_0x845c('0xb'),_0x4a1a42,_0x845c('0xc'));_0x4648e1(_0x34a8ae[_0x845c('0x12')]['message']);}})['catch'](function(_0x3b1ff9){logger[_0x845c('0xf')](_0x845c('0xb'),_0x4a1a42,_0x3b1ff9);_0x3075cd(_0x3b1ff9);});});}exports['GetCampaign']=function(_0x1f9bed){var _0x104314=this;return new Promise(function(_0x452b54,_0x48e7d4){return db['Campaign']['findAll']({'raw':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x14')]===undefined?!![]:![]:!![],'where':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed[_0x845c('0x13')][_0x845c('0x15')]||null:null,'attributes':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x16')]||null:null,'limit':_0x1f9bed['options']?_0x1f9bed[_0x845c('0x13')]['limit']||null:null,'include':_0x1f9bed[_0x845c('0x13')]?_0x1f9bed['options'][_0x845c('0x17')]?_['map'](_0x1f9bed[_0x845c('0x13')][_0x845c('0x17')],function(_0x362975){return{'model':db[_0x362975[_0x845c('0x18')]],'as':_0x362975['as'],'attributes':_0x362975[_0x845c('0x16')],'include':_0x362975[_0x845c('0x17')]?_['map'](_0x362975[_0x845c('0x17')],function(_0x5e3ec8){return{'model':db[_0x5e3ec8[_0x845c('0x18')]],'as':_0x5e3ec8['as'],'attributes':_0x5e3ec8[_0x845c('0x16')],'include':_0x5e3ec8['include']?_[_0x845c('0x19')](_0x5e3ec8[_0x845c('0x17')],function(_0x189c19){return{'model':db[_0x189c19['model']],'as':_0x189c19['as'],'attributes':_0x189c19['attributes']};}):[]};}):[]};}):[]:[]})[_0x845c('0x9')](function(_0x2a3c1d){logger[_0x845c('0xa')]('GetCampaign',_0x1f9bed);logger[_0x845c('0xd')](_0x845c('0x1a'),_0x1f9bed,JSON[_0x845c('0xe')](_0x2a3c1d));_0x452b54(_0x2a3c1d);})[_0x845c('0x1b')](function(_0x5d7b58){logger[_0x845c('0xf')](_0x845c('0x1a'),_0x5d7b58[_0x845c('0x11')],_0x1f9bed);_0x48e7d4(_0x104314['error'](0x1f4,_0x5d7b58[_0x845c('0x11')]));});});};
\ No newline at end of file
+var _0x0dba=['Campaign,\x20%s,\x20%s','message','result','catch','GetCampaign','Campaign','findAll','options','raw','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x17866f,_0x2bc389){var _0x5109ac=function(_0x191415){while(--_0x191415){_0x17866f['push'](_0x17866f['shift']());}};_0x5109ac(++_0x2bc389);}(_0x0dba,0x136));var _0xa0db=function(_0x40be2b,_0x2c77b4){_0x40be2b=_0x40be2b-0x0;var _0x5a4403=_0x0dba[_0x40be2b];return _0x5a4403;};'use strict';var _=require(_0xa0db('0x0'));var util=require(_0xa0db('0x1'));var moment=require(_0xa0db('0x2'));var BPromise=require(_0xa0db('0x3'));var rs=require(_0xa0db('0x4'));var fs=require('fs');var Redis=require(_0xa0db('0x5'));var db=require(_0xa0db('0x6'))['db'];var utils=require(_0xa0db('0x7'));var logger=require(_0xa0db('0x8'))(_0xa0db('0x9'));var config=require(_0xa0db('0xa'));var jayson=require(_0xa0db('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5b77ce,_0x5a8cb2,_0x45fb6d){return new BPromise(function(_0x1fd7ed,_0x483ddf){return client[_0xa0db('0xc')](_0x5b77ce,_0x45fb6d)[_0xa0db('0xd')](function(_0x35445a){logger[_0xa0db('0xe')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0xa0db('0xf'));logger[_0xa0db('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5a8cb2,'request\x20sent',JSON[_0xa0db('0x11')](_0x35445a));if(_0x35445a[_0xa0db('0x12')]){if(_0x35445a[_0xa0db('0x12')][_0xa0db('0x13')]===0x1f4){logger['error'](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x483ddf(_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);}logger[_0xa0db('0x12')](_0xa0db('0x14'),_0x5a8cb2,_0x35445a[_0xa0db('0x12')][_0xa0db('0x15')]);return _0x1fd7ed(_0x35445a['error'][_0xa0db('0x15')]);}else{logger[_0xa0db('0xe')](_0xa0db('0x14'),_0x5a8cb2,_0xa0db('0xf'));_0x1fd7ed(_0x35445a[_0xa0db('0x16')][_0xa0db('0x15')]);}})[_0xa0db('0x17')](function(_0x12a3e8){logger[_0xa0db('0x12')]('Campaign,\x20%s,\x20%s',_0x5a8cb2,_0x12a3e8);_0x483ddf(_0x12a3e8);});});}exports[_0xa0db('0x18')]=function(_0x215658){var _0x4be2e2=this;return new Promise(function(_0x12766f,_0x2786ae){return db[_0xa0db('0x19')][_0xa0db('0x1a')]({'raw':_0x215658[_0xa0db('0x1b')]?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1c')]===undefined?!![]:![]:!![],'where':_0x215658['options']?_0x215658['options']['where']||null:null,'attributes':_0x215658['options']?_0x215658[_0xa0db('0x1b')][_0xa0db('0x1d')]||null:null,'limit':_0x215658[_0xa0db('0x1b')]?_0x215658['options']['limit']||null:null,'include':_0x215658[_0xa0db('0x1b')]?_0x215658['options'][_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x215658[_0xa0db('0x1b')][_0xa0db('0x1e')],function(_0x4e9a22){return{'model':db[_0x4e9a22[_0xa0db('0x20')]],'as':_0x4e9a22['as'],'attributes':_0x4e9a22[_0xa0db('0x1d')],'include':_0x4e9a22[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x4e9a22[_0xa0db('0x1e')],function(_0x362c30){return{'model':db[_0x362c30[_0xa0db('0x20')]],'as':_0x362c30['as'],'attributes':_0x362c30[_0xa0db('0x1d')],'include':_0x362c30[_0xa0db('0x1e')]?_[_0xa0db('0x1f')](_0x362c30['include'],function(_0x3652a1){return{'model':db[_0x3652a1[_0xa0db('0x20')]],'as':_0x3652a1['as'],'attributes':_0x3652a1[_0xa0db('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xa0db('0xd')](function(_0xe3372c){logger[_0xa0db('0xe')](_0xa0db('0x18'),_0x215658);logger[_0xa0db('0x10')](_0xa0db('0x18'),_0x215658,JSON[_0xa0db('0x11')](_0xe3372c));_0x12766f(_0xe3372c);})[_0xa0db('0x17')](function(_0x3a3dba){logger[_0xa0db('0x12')](_0xa0db('0x18'),_0x3a3dba[_0xa0db('0x15')],_0x215658);_0x2786ae(_0x4be2e2[_0xa0db('0x12')](0x1f4,_0x3a3dba[_0xa0db('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 4c223ac..b9216e4 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 _0xf774=['index','get','/:id','getHoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addLists','addBlackLists','put','delete','destroy','removeLists','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x25b4a4,_0x2e081b){var _0x707267=function(_0x440123){while(--_0x440123){_0x25b4a4['push'](_0x25b4a4['shift']());}};_0x707267(++_0x2e081b);}(_0xf774,0x1e4));var _0x4f77=function(_0x5f1a58,_0x45c87d){_0x5f1a58=_0x5f1a58-0x0;var _0x2bf6c5=_0xf774[_0x5f1a58];return _0x2bf6c5;};'use strict';var multer=require(_0x4f77('0x0'));var util=require(_0x4f77('0x1'));var path=require(_0x4f77('0x2'));var timeout=require(_0x4f77('0x3'));var express=require(_0x4f77('0x4'));var router=express['Router']();var fs_extra=require(_0x4f77('0x5'));var auth=require(_0x4f77('0x6'));var interaction=require(_0x4f77('0x7'));var config=require(_0x4f77('0x8'));var controller=require(_0x4f77('0x9'));router['get']('/',auth[_0x4f77('0xa')](),controller[_0x4f77('0xb')]);router[_0x4f77('0xc')](_0x4f77('0xd'),auth[_0x4f77('0xa')](),controller['show']);router[_0x4f77('0xc')]('/:id/hoppers',auth['isAuthenticated'](),controller[_0x4f77('0xe')]);router[_0x4f77('0xc')](_0x4f77('0xf'),auth[_0x4f77('0xa')](),controller['getHopperHistories']);router[_0x4f77('0xc')](_0x4f77('0x10'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x11')]);router[_0x4f77('0xc')](_0x4f77('0x12'),auth['isAuthenticated'](),controller[_0x4f77('0x13')]);router[_0x4f77('0xc')](_0x4f77('0x14'),auth['isAuthenticated'](),controller[_0x4f77('0x15')]);router['get'](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x17')]);router[_0x4f77('0x18')]('/',auth['isAuthenticated'](),controller[_0x4f77('0x19')]);router[_0x4f77('0x18')](_0x4f77('0x1a'),auth[_0x4f77('0xa')](),controller['clone']);router[_0x4f77('0x18')]('/:id/lists',auth[_0x4f77('0xa')](),controller[_0x4f77('0x1b')]);router[_0x4f77('0x18')](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x1c')]);router[_0x4f77('0x1d')]('/:id',auth[_0x4f77('0xa')](),controller['update']);router[_0x4f77('0x1e')](_0x4f77('0xd'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x1f')]);router[_0x4f77('0x1e')](_0x4f77('0x14'),auth[_0x4f77('0xa')](),controller[_0x4f77('0x20')]);router['delete'](_0x4f77('0x16'),auth[_0x4f77('0xa')](),controller['removeBlackLists']);module['exports']=router;
\ No newline at end of file
+var _0x2bc6=['addLists','addBlackLists','update','removeLists','removeBlackLists','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','index','get','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','isAuthenticated','/:id/hopper_black','getHopperBlacks','/:id/lists','/:id/blacklists','post','create','/:id/clone'];(function(_0x3fda1e,_0x3f8d30){var _0x1126bc=function(_0x42774d){while(--_0x42774d){_0x3fda1e['push'](_0x3fda1e['shift']());}};_0x1126bc(++_0x3f8d30);}(_0x2bc6,0xf6));var _0x62bc=function(_0xaf95fa,_0xb0f101){_0xaf95fa=_0xaf95fa-0x0;var _0x11d293=_0x2bc6[_0xaf95fa];return _0x11d293;};'use strict';var multer=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var path=require(_0x62bc('0x2'));var timeout=require('connect-timeout');var express=require(_0x62bc('0x3'));var router=express[_0x62bc('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x62bc('0x5'));var interaction=require(_0x62bc('0x6'));var config=require(_0x62bc('0x7'));var controller=require(_0x62bc('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x62bc('0x9')]);router[_0x62bc('0xa')](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0xc')]);router[_0x62bc('0xa')](_0x62bc('0xd'),auth['isAuthenticated'](),controller[_0x62bc('0xe')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x62bc('0xa')](_0x62bc('0xf'),auth[_0x62bc('0x10')](),controller['getHopperFinals']);router[_0x62bc('0xa')](_0x62bc('0x11'),auth['isAuthenticated'](),controller[_0x62bc('0x12')]);router[_0x62bc('0xa')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller['getLists']);router[_0x62bc('0xa')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller['getBlackLists']);router[_0x62bc('0x15')]('/',auth[_0x62bc('0x10')](),controller[_0x62bc('0x16')]);router[_0x62bc('0x15')](_0x62bc('0x17'),auth[_0x62bc('0x10')](),controller['clone']);router[_0x62bc('0x15')](_0x62bc('0x13'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x18')]);router[_0x62bc('0x15')](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x19')]);router['put'](_0x62bc('0xb'),auth['isAuthenticated'](),controller[_0x62bc('0x1a')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x62bc('0x13'),auth['isAuthenticated'](),controller[_0x62bc('0x1b')]);router['delete'](_0x62bc('0x14'),auth[_0x62bc('0x10')](),controller[_0x62bc('0x1c')]);module[_0x62bc('0x1d')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index cd697b9..c79e903 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 _0xbd92=['STRING','VIRTUAL','getDataValue','sequelize','exports','TEXT'];(function(_0xd87364,_0x3a60d8){var _0x23761e=function(_0x5d6f28){while(--_0x5d6f28){_0xd87364['push'](_0xd87364['shift']());}};_0x23761e(++_0x3a60d8);}(_0xbd92,0x1d1));var _0x2bd9=function(_0xb6ea0a,_0x3e2964){_0xb6ea0a=_0xb6ea0a-0x0;var _0x46464a=_0xbd92[_0xb6ea0a];return _0x46464a;};'use strict';var Sequelize=require(_0x2bd9('0x0'));module[_0x2bd9('0x1')]={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x2bd9('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2bd9('0x3')]},'name':{'type':Sequelize[_0x2bd9('0x4')],'get':function(){return this[_0x2bd9('0x5')]('key');}}};
\ No newline at end of file
+var _0xd467=['VIRTUAL','getDataValue','sequelize','exports','STRING','TEXT'];(function(_0x4f7280,_0x3c30ff){var _0x5ea336=function(_0x4337de){while(--_0x4337de){_0x4f7280['push'](_0x4f7280['shift']());}};_0x5ea336(++_0x3c30ff);}(_0xd467,0xb6));var _0x7d46=function(_0x2fce58,_0x71e113){_0x2fce58=_0x2fce58-0x0;var _0xfa4b6a=_0xd467[_0x2fce58];return _0xfa4b6a;};'use strict';var Sequelize=require(_0x7d46('0x0'));module[_0x7d46('0x1')]={'key':{'type':Sequelize[_0x7d46('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x7d46('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x7d46('0x4')],'get':function(){return this[_0x7d46('0x5')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index ff48ce0..4c35dbf 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 _0x8385=['merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','key','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','role','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','mustache','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','undefined','limit','count','offset','set','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','sendStatus','error','stack','name','send','index','map','CannedAnswer','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter'];(function(_0x3a7e97,_0x3ea0ab){var _0x3a1841=function(_0x13d4cb){while(--_0x13d4cb){_0x3a7e97['push'](_0x3a7e97['shift']());}};_0x3a1841(++_0x3ea0ab);}(_0x8385,0x75));var _0x5838=function(_0x36eaca,_0x390731){_0x36eaca=_0x36eaca-0x0;var _0x54f561=_0x8385[_0x36eaca];return _0x54f561;};'use strict';var emlformat=require(_0x5838('0x0'));var rimraf=require(_0x5838('0x1'));var zipdir=require(_0x5838('0x2'));var jsonpatch=require(_0x5838('0x3'));var rp=require(_0x5838('0x4'));var moment=require(_0x5838('0x5'));var BPromise=require(_0x5838('0x6'));var Mustache=require(_0x5838('0x7'));var util=require(_0x5838('0x8'));var path=require(_0x5838('0x9'));var sox=require(_0x5838('0xa'));var csv=require('to-csv');var ejs=require(_0x5838('0xb'));var fs=require('fs');var fs_extra=require(_0x5838('0xc'));var _=require(_0x5838('0xd'));var squel=require(_0x5838('0xe'));var crypto=require(_0x5838('0xf'));var jsforce=require(_0x5838('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x5838('0x11'));var querystring=require(_0x5838('0x12'));var Papa=require('papaparse');var Redis=require(_0x5838('0x13'));var authService=require(_0x5838('0x14'));var qs=require(_0x5838('0x15'));var as=require(_0x5838('0x16'));var hardwareService=require(_0x5838('0x17'));var logger=require('../../config/logger')(_0x5838('0x18'));var utils=require('../../config/utils');var config=require(_0x5838('0x19'));var licenseUtil=require(_0x5838('0x1a'));var db=require(_0x5838('0x1b'))['db'];function respondWithStatusCode(_0x4400cb,_0x35a67c){_0x35a67c=_0x35a67c||0xcc;return function(_0x4c8c7b){if(_0x4c8c7b){return _0x4400cb['sendStatus'](_0x35a67c);}return _0x4400cb[_0x5838('0x1c')](_0x35a67c)[_0x5838('0x1d')]();};}function respondWithResult(_0x1065f2,_0x459b71){_0x459b71=_0x459b71||0xc8;return function(_0x403748){if(_0x403748){return _0x1065f2[_0x5838('0x1c')](_0x459b71)[_0x5838('0x1e')](_0x403748);}};}function respondWithFilteredResult(_0x70b87,_0x12203a){return function(_0x3e05fd){if(_0x3e05fd){var _0x5813f1=typeof _0x12203a['offset']===_0x5838('0x1f')&&typeof _0x12203a[_0x5838('0x20')]==='undefined';var _0x1cb94f=_0x3e05fd[_0x5838('0x21')];var _0x3507a2=_0x5813f1?0x0:_0x12203a[_0x5838('0x22')];var _0x3e0ed9=_0x5813f1?_0x3e05fd[_0x5838('0x21')]:_0x12203a[_0x5838('0x22')]+_0x12203a[_0x5838('0x20')];var _0x1abf88;if(_0x3e0ed9>=_0x1cb94f){_0x3e0ed9=_0x1cb94f;_0x1abf88=0xc8;}else{_0x1abf88=0xce;}_0x70b87[_0x5838('0x1c')](_0x1abf88);return _0x70b87[_0x5838('0x23')]('Content-Range',_0x3507a2+'-'+_0x3e0ed9+'/'+_0x1cb94f)[_0x5838('0x1e')](_0x3e05fd);}return null;};}function patchUpdates(_0x1bcaf2){return function(_0x1f11ea){try{jsonpatch['apply'](_0x1f11ea,_0x1bcaf2,!![]);}catch(_0x3f1771){return BPromise[_0x5838('0x24')](_0x3f1771);}return _0x1f11ea[_0x5838('0x25')]();};}function saveUpdates(_0x5a3434,_0xa93088){return function(_0x1cf036){if(_0x1cf036){return _0x1cf036['update'](_0x5a3434)[_0x5838('0x26')](function(_0x65beb7){return _0x65beb7;});}return null;};}function removeEntity(_0x185307,_0x3eba5b){return function(_0xee895c){if(_0xee895c){return _0xee895c[_0x5838('0x27')]()[_0x5838('0x26')](function(){var _0x13f338=_0xee895c[_0x5838('0x28')]({'plain':!![]});var _0xb9df3b=_0x5838('0x29');return db[_0x5838('0x2a')][_0x5838('0x27')]({'where':{'type':_0xb9df3b,'resourceId':_0x13f338['id']}})[_0x5838('0x26')](function(){return _0xee895c;});})[_0x5838('0x26')](function(){_0x185307[_0x5838('0x1c')](0xcc)[_0x5838('0x1d')]();});}};}function handleEntityNotFound(_0x370241,_0x5e88c3){return function(_0x1eaa8c){if(!_0x1eaa8c){_0x370241[_0x5838('0x2b')](0x194);}return _0x1eaa8c;};}function handleError(_0x302b37,_0x1be547){_0x1be547=_0x1be547||0x1f4;return function(_0x8bbb9e){logger[_0x5838('0x2c')](_0x8bbb9e[_0x5838('0x2d')]);if(_0x8bbb9e[_0x5838('0x2e')]){delete _0x8bbb9e['name'];}_0x302b37['status'](_0x1be547)[_0x5838('0x2f')](_0x8bbb9e);};}exports[_0x5838('0x30')]=function(_0x25b518,_0x2c8e88){var _0x2987ec={},_0x2313fd={},_0x1f0d9b={'count':0x0,'rows':[]};var _0x3d95d6=_[_0x5838('0x31')](db[_0x5838('0x32')][_0x5838('0x33')],function(_0x228079){return{'name':_0x228079['fieldName'],'type':_0x228079[_0x5838('0x34')]['key']};});_0x2313fd[_0x5838('0x35')]=_[_0x5838('0x31')](_0x3d95d6,_0x5838('0x2e'));_0x2313fd[_0x5838('0x36')]=_[_0x5838('0x37')](_0x25b518[_0x5838('0x36')]);_0x2313fd[_0x5838('0x38')]=_[_0x5838('0x39')](_0x2313fd[_0x5838('0x35')],_0x2313fd[_0x5838('0x36')]);_0x2987ec[_0x5838('0x3a')]=_[_0x5838('0x39')](_0x2313fd['model'],qs[_0x5838('0x3b')](_0x25b518[_0x5838('0x36')][_0x5838('0x3b')]));_0x2987ec['attributes']=_0x2987ec[_0x5838('0x3a')][_0x5838('0x3c')]?_0x2987ec[_0x5838('0x3a')]:_0x2313fd[_0x5838('0x35')];if(!_0x25b518[_0x5838('0x36')]['hasOwnProperty'](_0x5838('0x3d'))){_0x2987ec[_0x5838('0x20')]=qs[_0x5838('0x20')](_0x25b518[_0x5838('0x36')]['limit']);_0x2987ec[_0x5838('0x22')]=qs[_0x5838('0x22')](_0x25b518[_0x5838('0x36')][_0x5838('0x22')]);}_0x2987ec[_0x5838('0x3e')]=qs[_0x5838('0x3f')](_0x25b518[_0x5838('0x36')][_0x5838('0x3f')]);_0x2987ec[_0x5838('0x40')]=qs[_0x5838('0x38')](_[_0x5838('0x41')](_0x25b518['query'],_0x2313fd[_0x5838('0x38')]),_0x3d95d6);if(_0x25b518['query'][_0x5838('0x42')]){_0x2987ec[_0x5838('0x40')]=_[_0x5838('0x43')](_0x2987ec[_0x5838('0x40')],{'$or':[{'key':{'$like':'%'+_0x25b518['query'][_0x5838('0x42')]+'%'}},{'value':{'$like':'%'+_0x25b518[_0x5838('0x36')][_0x5838('0x42')]+'%'}}]});}_0x2987ec=_['merge']({},_0x2987ec,_0x25b518[_0x5838('0x44')]);var _0x581e1b={'where':_0x2987ec['where']};return db[_0x5838('0x32')][_0x5838('0x21')](_0x581e1b)[_0x5838('0x26')](function(_0x5cc70b){_0x1f0d9b['count']=_0x5cc70b;if(_0x25b518[_0x5838('0x36')][_0x5838('0x45')]){_0x2987ec['include']=[{'all':!![]}];}return db[_0x5838('0x32')][_0x5838('0x46')](_0x2987ec);})[_0x5838('0x26')](function(_0x5e427e){_0x1f0d9b[_0x5838('0x47')]=_0x5e427e;return _0x1f0d9b;})[_0x5838('0x26')](respondWithFilteredResult(_0x2c8e88,_0x2987ec))[_0x5838('0x48')](handleError(_0x2c8e88,null));};exports[_0x5838('0x49')]=function(_0x5b4c07,_0x1312b3){var _0x4bcfbc={'raw':!![],'where':{'id':_0x5b4c07[_0x5838('0x4a')]['id']}},_0x800c3c={};_0x800c3c[_0x5838('0x35')]=_[_0x5838('0x37')](db[_0x5838('0x32')][_0x5838('0x33')]);_0x800c3c[_0x5838('0x36')]=_[_0x5838('0x37')](_0x5b4c07[_0x5838('0x36')]);_0x800c3c[_0x5838('0x38')]=_[_0x5838('0x39')](_0x800c3c[_0x5838('0x35')],_0x800c3c[_0x5838('0x36')]);_0x4bcfbc[_0x5838('0x3a')]=_[_0x5838('0x39')](_0x800c3c['model'],qs[_0x5838('0x3b')](_0x5b4c07[_0x5838('0x36')][_0x5838('0x3b')]));_0x4bcfbc[_0x5838('0x3a')]=_0x4bcfbc[_0x5838('0x3a')][_0x5838('0x3c')]?_0x4bcfbc[_0x5838('0x3a')]:_0x800c3c[_0x5838('0x35')];if(_0x5b4c07[_0x5838('0x36')]['includeAll']){_0x4bcfbc[_0x5838('0x4b')]=[{'all':!![]}];}_0x4bcfbc=_[_0x5838('0x43')]({},_0x4bcfbc,_0x5b4c07[_0x5838('0x44')]);return db[_0x5838('0x32')][_0x5838('0x4c')](_0x4bcfbc)[_0x5838('0x26')](handleEntityNotFound(_0x1312b3,null))[_0x5838('0x26')](respondWithResult(_0x1312b3,null))[_0x5838('0x48')](handleError(_0x1312b3,null));};exports['update']=function(_0x57341c,_0x347d3a){if(_0x57341c[_0x5838('0x4d')]['id']){delete _0x57341c[_0x5838('0x4d')]['id'];}return db[_0x5838('0x32')]['find']({'where':{'id':_0x57341c[_0x5838('0x4a')]['id']}})[_0x5838('0x26')](handleEntityNotFound(_0x347d3a,null))[_0x5838('0x26')](saveUpdates(_0x57341c[_0x5838('0x4d')],null))[_0x5838('0x26')](respondWithResult(_0x347d3a,null))[_0x5838('0x48')](handleError(_0x347d3a,null));};exports[_0x5838('0x27')]=function(_0x47f1c5,_0x3499d7){return db['CannedAnswer'][_0x5838('0x4c')]({'where':{'id':_0x47f1c5[_0x5838('0x4a')]['id']}})[_0x5838('0x26')](handleEntityNotFound(_0x3499d7,null))['then'](removeEntity(_0x3499d7,null))[_0x5838('0x48')](handleError(_0x3499d7,null));};exports[_0x5838('0x4e')]=function(_0x1dc6c9,_0x36256c){var _0x552581={'key':_0x1dc6c9['body'][_0x5838('0x4f')]};if(_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x50')]){_0x552581['MailAccountId']=_0x1dc6c9[_0x5838('0x4d')]['MailAccountId'];}else if(_0x1dc6c9[_0x5838('0x4d')]['SmsAccountId']){_0x552581[_0x5838('0x51')]=_0x1dc6c9[_0x5838('0x4d')]['SmsAccountId'];}else if(_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x52')]){_0x552581[_0x5838('0x52')]=_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x52')];}else if(_0x1dc6c9[_0x5838('0x4d')]['ChatWebsiteId']){_0x552581['ChatWebsiteId']=_0x1dc6c9[_0x5838('0x4d')][_0x5838('0x53')];}return db[_0x5838('0x32')]['find']({'where':_0x552581})[_0x5838('0x26')](function(_0x570c10){if(_0x570c10){throw new db[(_0x5838('0x54'))][(_0x5838('0x55'))](_0x5838('0x56'));}return db[_0x5838('0x32')]['create'](_0x1dc6c9['body']);})['then'](function(_0x30c1b2){var _0x4c14e9=_0x1dc6c9[_0x5838('0x57')][_0x5838('0x28')]({'plain':!![]});if(!_0x4c14e9)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c14e9[_0x5838('0x58')]==='user'){var _0x50b0cf=_0x30c1b2[_0x5838('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x5838('0x4c')]({'where':{'name':_0x5838('0x29'),'userProfileId':_0x4c14e9[_0x5838('0x59')]},'raw':!![]})[_0x5838('0x26')](function(_0x4bb49f){if(_0x4bb49f&&_0x4bb49f[_0x5838('0x5a')]===0x0){return db[_0x5838('0x2a')][_0x5838('0x4e')]({'name':_0x50b0cf[_0x5838('0x2e')],'resourceId':_0x50b0cf['id'],'type':_0x4bb49f[_0x5838('0x2e')],'sectionId':_0x4bb49f['id']},{})[_0x5838('0x26')](function(){return _0x30c1b2;});}else{return _0x30c1b2;}})[_0x5838('0x48')](function(_0x34a1c8){logger[_0x5838('0x2c')](_0x5838('0x5b'),_0x34a1c8);throw _0x34a1c8;});}return _0x30c1b2;})[_0x5838('0x26')](respondWithResult(_0x36256c,0xc9))['catch'](handleError(_0x36256c,null));};
\ No newline at end of file
+var _0x1bef=['keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','findAll','rows','show','params','includeAll','include','find','body','catch','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/license/util','sendStatus','end','status','offset','undefined','limit','count','Content-Range','json','apply','reject','update','then','destroy','get','CannedAnswers','error','name','send','index','CannedAnswer','rawAttributes','key','query'];(function(_0x37c775,_0x160938){var _0x513a37=function(_0x2e285c){while(--_0x2e285c){_0x37c775['push'](_0x37c775['shift']());}};_0x513a37(++_0x160938);}(_0x1bef,0x177));var _0xf1be=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1bef[_0x3dd15e];return _0x231fd0;};'use strict';var emlformat=require(_0xf1be('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xf1be('0x1'));var jsonpatch=require(_0xf1be('0x2'));var rp=require(_0xf1be('0x3'));var moment=require('moment');var BPromise=require(_0xf1be('0x4'));var Mustache=require(_0xf1be('0x5'));var util=require(_0xf1be('0x6'));var path=require(_0xf1be('0x7'));var sox=require('sox');var csv=require(_0xf1be('0x8'));var ejs=require(_0xf1be('0x9'));var fs=require('fs');var fs_extra=require(_0xf1be('0xa'));var _=require(_0xf1be('0xb'));var squel=require(_0xf1be('0xc'));var crypto=require('crypto');var jsforce=require(_0xf1be('0xd'));var deskjs=require(_0xf1be('0xe'));var toCsv=require(_0xf1be('0x8'));var querystring=require('querystring');var Papa=require(_0xf1be('0xf'));var Redis=require('ioredis');var authService=require(_0xf1be('0x10'));var qs=require(_0xf1be('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1be('0x12'))(_0xf1be('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xf1be('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23aa50,_0x362397){_0x362397=_0x362397||0xcc;return function(_0x5de63e){if(_0x5de63e){return _0x23aa50[_0xf1be('0x15')](_0x362397);}return _0x23aa50['status'](_0x362397)[_0xf1be('0x16')]();};}function respondWithResult(_0x472151,_0xc11cba){_0xc11cba=_0xc11cba||0xc8;return function(_0x1f5f7b){if(_0x1f5f7b){return _0x472151[_0xf1be('0x17')](_0xc11cba)['json'](_0x1f5f7b);}};}function respondWithFilteredResult(_0x5ae923,_0x8f25a9){return function(_0x11bf9f){if(_0x11bf9f){var _0x53ff08=typeof _0x8f25a9[_0xf1be('0x18')]===_0xf1be('0x19')&&typeof _0x8f25a9[_0xf1be('0x1a')]===_0xf1be('0x19');var _0x41dbcb=_0x11bf9f['count'];var _0x282312=_0x53ff08?0x0:_0x8f25a9[_0xf1be('0x18')];var _0x104141=_0x53ff08?_0x11bf9f[_0xf1be('0x1b')]:_0x8f25a9[_0xf1be('0x18')]+_0x8f25a9[_0xf1be('0x1a')];var _0xc777c3;if(_0x104141>=_0x41dbcb){_0x104141=_0x41dbcb;_0xc777c3=0xc8;}else{_0xc777c3=0xce;}_0x5ae923[_0xf1be('0x17')](_0xc777c3);return _0x5ae923['set'](_0xf1be('0x1c'),_0x282312+'-'+_0x104141+'/'+_0x41dbcb)[_0xf1be('0x1d')](_0x11bf9f);}return null;};}function patchUpdates(_0x443393){return function(_0x3b933e){try{jsonpatch[_0xf1be('0x1e')](_0x3b933e,_0x443393,!![]);}catch(_0x3fe46b){return BPromise[_0xf1be('0x1f')](_0x3fe46b);}return _0x3b933e['save']();};}function saveUpdates(_0x3be5d8,_0x4ddf1e){return function(_0x39d1ae){if(_0x39d1ae){return _0x39d1ae[_0xf1be('0x20')](_0x3be5d8)[_0xf1be('0x21')](function(_0xbcf3d9){return _0xbcf3d9;});}return null;};}function removeEntity(_0x27a7ce,_0x1dc282){return function(_0x40e2a0){if(_0x40e2a0){return _0x40e2a0[_0xf1be('0x22')]()[_0xf1be('0x21')](function(){var _0x4c2b82=_0x40e2a0[_0xf1be('0x23')]({'plain':!![]});var _0xca64ce=_0xf1be('0x24');return db['UserProfileResource'][_0xf1be('0x22')]({'where':{'type':_0xca64ce,'resourceId':_0x4c2b82['id']}})[_0xf1be('0x21')](function(){return _0x40e2a0;});})[_0xf1be('0x21')](function(){_0x27a7ce['status'](0xcc)[_0xf1be('0x16')]();});}};}function handleEntityNotFound(_0x3cb8d6,_0x497fdb){return function(_0x2c2899){if(!_0x2c2899){_0x3cb8d6[_0xf1be('0x15')](0x194);}return _0x2c2899;};}function handleError(_0x5b752c,_0x45b1ed){_0x45b1ed=_0x45b1ed||0x1f4;return function(_0x38c648){logger[_0xf1be('0x25')](_0x38c648['stack']);if(_0x38c648[_0xf1be('0x26')]){delete _0x38c648[_0xf1be('0x26')];}_0x5b752c['status'](_0x45b1ed)[_0xf1be('0x27')](_0x38c648);};}exports[_0xf1be('0x28')]=function(_0x237439,_0x4bddc3){var _0x37e8f9={},_0x119952={},_0xebcb90={'count':0x0,'rows':[]};var _0x4b8611=_['map'](db[_0xf1be('0x29')][_0xf1be('0x2a')],function(_0x2a4a36){return{'name':_0x2a4a36['fieldName'],'type':_0x2a4a36['type'][_0xf1be('0x2b')]};});_0x119952['model']=_['map'](_0x4b8611,'name');_0x119952[_0xf1be('0x2c')]=_[_0xf1be('0x2d')](_0x237439[_0xf1be('0x2c')]);_0x119952[_0xf1be('0x2e')]=_[_0xf1be('0x2f')](_0x119952['model'],_0x119952['query']);_0x37e8f9[_0xf1be('0x30')]=_[_0xf1be('0x2f')](_0x119952[_0xf1be('0x31')],qs['fields'](_0x237439[_0xf1be('0x2c')][_0xf1be('0x32')]));_0x37e8f9[_0xf1be('0x30')]=_0x37e8f9[_0xf1be('0x30')][_0xf1be('0x33')]?_0x37e8f9[_0xf1be('0x30')]:_0x119952[_0xf1be('0x31')];if(!_0x237439[_0xf1be('0x2c')][_0xf1be('0x34')](_0xf1be('0x35'))){_0x37e8f9[_0xf1be('0x1a')]=qs[_0xf1be('0x1a')](_0x237439[_0xf1be('0x2c')]['limit']);_0x37e8f9[_0xf1be('0x18')]=qs[_0xf1be('0x18')](_0x237439['query']['offset']);}_0x37e8f9[_0xf1be('0x36')]=qs[_0xf1be('0x37')](_0x237439[_0xf1be('0x2c')][_0xf1be('0x37')]);_0x37e8f9[_0xf1be('0x38')]=qs[_0xf1be('0x2e')](_[_0xf1be('0x39')](_0x237439[_0xf1be('0x2c')],_0x119952['filters']),_0x4b8611);if(_0x237439['query']['filter']){_0x37e8f9['where']=_[_0xf1be('0x3a')](_0x37e8f9['where'],{'$or':[{'key':{'$like':'%'+_0x237439[_0xf1be('0x2c')][_0xf1be('0x3b')]+'%'}},{'value':{'$like':'%'+_0x237439[_0xf1be('0x2c')]['filter']+'%'}}]});}_0x37e8f9=_['merge']({},_0x37e8f9,_0x237439[_0xf1be('0x3c')]);var _0x1093c4={'where':_0x37e8f9[_0xf1be('0x38')]};return db[_0xf1be('0x29')][_0xf1be('0x1b')](_0x1093c4)['then'](function(_0x4b0aa9){_0xebcb90['count']=_0x4b0aa9;if(_0x237439[_0xf1be('0x2c')]['includeAll']){_0x37e8f9['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xf1be('0x3d')](_0x37e8f9);})[_0xf1be('0x21')](function(_0x3c25b1){_0xebcb90[_0xf1be('0x3e')]=_0x3c25b1;return _0xebcb90;})[_0xf1be('0x21')](respondWithFilteredResult(_0x4bddc3,_0x37e8f9))['catch'](handleError(_0x4bddc3,null));};exports[_0xf1be('0x3f')]=function(_0x4750f0,_0x5b485a){var _0xa1294c={'raw':!![],'where':{'id':_0x4750f0[_0xf1be('0x40')]['id']}},_0x5822={};_0x5822[_0xf1be('0x31')]=_['keys'](db['CannedAnswer'][_0xf1be('0x2a')]);_0x5822[_0xf1be('0x2c')]=_['keys'](_0x4750f0['query']);_0x5822['filters']=_[_0xf1be('0x2f')](_0x5822[_0xf1be('0x31')],_0x5822['query']);_0xa1294c['attributes']=_['intersection'](_0x5822[_0xf1be('0x31')],qs[_0xf1be('0x32')](_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x32')]));_0xa1294c['attributes']=_0xa1294c[_0xf1be('0x30')]['length']?_0xa1294c[_0xf1be('0x30')]:_0x5822['model'];if(_0x4750f0[_0xf1be('0x2c')][_0xf1be('0x41')]){_0xa1294c[_0xf1be('0x42')]=[{'all':!![]}];}_0xa1294c=_['merge']({},_0xa1294c,_0x4750f0[_0xf1be('0x3c')]);return db[_0xf1be('0x29')][_0xf1be('0x43')](_0xa1294c)[_0xf1be('0x21')](handleEntityNotFound(_0x5b485a,null))[_0xf1be('0x21')](respondWithResult(_0x5b485a,null))['catch'](handleError(_0x5b485a,null));};exports[_0xf1be('0x20')]=function(_0x53c934,_0x17c0e1){if(_0x53c934[_0xf1be('0x44')]['id']){delete _0x53c934['body']['id'];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':{'id':_0x53c934[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x17c0e1,null))['then'](saveUpdates(_0x53c934['body'],null))[_0xf1be('0x21')](respondWithResult(_0x17c0e1,null))[_0xf1be('0x45')](handleError(_0x17c0e1,null));};exports['destroy']=function(_0x3b9178,_0x54a6ef){return db['CannedAnswer']['find']({'where':{'id':_0x3b9178[_0xf1be('0x40')]['id']}})[_0xf1be('0x21')](handleEntityNotFound(_0x54a6ef,null))[_0xf1be('0x21')](removeEntity(_0x54a6ef,null))[_0xf1be('0x45')](handleError(_0x54a6ef,null));};exports['create']=function(_0x39d9d4,_0x391a2e){var _0x1b6986={'key':_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x2b')]};if(_0x39d9d4[_0xf1be('0x44')]['MailAccountId']){_0x1b6986[_0xf1be('0x46')]=_0x39d9d4[_0xf1be('0x44')]['MailAccountId'];}else if(_0x39d9d4['body'][_0xf1be('0x47')]){_0x1b6986[_0xf1be('0x47')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x47')];}else if(_0x39d9d4[_0xf1be('0x44')]['OpenchannelAccountId']){_0x1b6986[_0xf1be('0x48')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x48')];}else if(_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')]){_0x1b6986[_0xf1be('0x49')]=_0x39d9d4[_0xf1be('0x44')][_0xf1be('0x49')];}return db[_0xf1be('0x29')][_0xf1be('0x43')]({'where':_0x1b6986})[_0xf1be('0x21')](function(_0x199f6d){if(_0x199f6d){throw new db[(_0xf1be('0x4a'))][(_0xf1be('0x4b'))](_0xf1be('0x4c'));}return db['CannedAnswer'][_0xf1be('0x4d')](_0x39d9d4[_0xf1be('0x44')]);})[_0xf1be('0x21')](function(_0x3dd33f){var _0x21a374=_0x39d9d4[_0xf1be('0x4e')][_0xf1be('0x23')]({'plain':!![]});if(!_0x21a374)throw new Error(_0xf1be('0x4f'));if(_0x21a374[_0xf1be('0x50')]==='user'){var _0x341bcd=_0x3dd33f[_0xf1be('0x23')]({'plain':!![]});return db['UserProfileSection'][_0xf1be('0x43')]({'where':{'name':'CannedAnswers','userProfileId':_0x21a374['userProfileId']},'raw':!![]})[_0xf1be('0x21')](function(_0x468fce){if(_0x468fce&&_0x468fce[_0xf1be('0x51')]===0x0){return db[_0xf1be('0x52')][_0xf1be('0x4d')]({'name':_0x341bcd[_0xf1be('0x26')],'resourceId':_0x341bcd['id'],'type':_0x468fce[_0xf1be('0x26')],'sectionId':_0x468fce['id']},{})[_0xf1be('0x21')](function(){return _0x3dd33f;});}else{return _0x3dd33f;}})['catch'](function(_0xd17e9e){logger[_0xf1be('0x25')](_0xf1be('0x53'),_0xd17e9e);throw _0xd17e9e;});}return _0x3dd33f;})['then'](respondWithResult(_0x391a2e,0xc9))[_0xf1be('0x45')](handleError(_0x391a2e,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index e7f68d9..77cf62b 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 _0x34f9=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0xf5e243,_0x5f51c5){var _0x578dc0=function(_0x3cf219){while(--_0x3cf219){_0xf5e243['push'](_0xf5e243['shift']());}};_0x578dc0(++_0x5f51c5);}(_0x34f9,0xfb));var _0x934f=function(_0x5b2ae8,_0x2f5fdd){_0x5b2ae8=_0x5b2ae8-0x0;var _0x17a99e=_0x34f9[_0x5b2ae8];return _0x17a99e;};'use strict';var _=require(_0x934f('0x0'));var util=require(_0x934f('0x1'));var logger=require(_0x934f('0x2'))(_0x934f('0x3'));var moment=require(_0x934f('0x4'));var BPromise=require(_0x934f('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x934f('0x6'));var rimraf=require(_0x934f('0x7'));var config=require(_0x934f('0x8'));var attributes=require(_0x934f('0x9'));module['exports']=function(_0x2f1329,_0x1be01d){return _0x2f1329[_0x934f('0xa')]('CannedAnswer',attributes,{'tableName':_0x934f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x934f('0xc'),'collate':_0x934f('0xd')});};
\ No newline at end of file
+var _0x388a=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x10f2e7,_0x491801){var _0x183060=function(_0x462680){while(--_0x462680){_0x10f2e7['push'](_0x10f2e7['shift']());}};_0x183060(++_0x491801);}(_0x388a,0xdc));var _0xa388=function(_0x18bb13,_0x4562e3){_0x18bb13=_0x18bb13-0x0;var _0x2192f3=_0x388a[_0x18bb13];return _0x2192f3;};'use strict';var _=require('lodash');var util=require(_0xa388('0x0'));var logger=require(_0xa388('0x1'))(_0xa388('0x2'));var moment=require(_0xa388('0x3'));var BPromise=require(_0xa388('0x4'));var rp=require(_0xa388('0x5'));var fs=require('fs');var path=require(_0xa388('0x6'));var rimraf=require(_0xa388('0x7'));var config=require(_0xa388('0x8'));var attributes=require(_0xa388('0x9'));module[_0xa388('0xa')]=function(_0x2d30c1,_0x297742){return _0x2d30c1['define']('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','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 b50cfd7..15930be 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(_0x3d5505,_0xf37a5d){var _0x3a3dd4=function(_0x3fc5ac){while(--_0x3fc5ac){_0x3d5505['push'](_0x3d5505['shift']());}};_0x3a3dd4(++_0xf37a5d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x19a19c,_0x75752b){var _0x3e79bb=function(_0x277c7a){while(--_0x277c7a){_0x19a19c['push'](_0x19a19c['shift']());}};_0x3e79bb(++_0x75752b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa9e0[_0x501510];return _0x1e6ee5;};'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 05ab623..8876367 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 _0xf402=['delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','show','post','create','/:id'];(function(_0x314a8c,_0x1c2e8d){var _0x1d4607=function(_0x3df20c){while(--_0x3df20c){_0x314a8c['push'](_0x314a8c['shift']());}};_0x1d4607(++_0x1c2e8d);}(_0xf402,0xf0));var _0x2f40=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf402[_0x618414];return _0x21c19a;};'use strict';var multer=require(_0x2f40('0x0'));var util=require(_0x2f40('0x1'));var path=require(_0x2f40('0x2'));var timeout=require(_0x2f40('0x3'));var express=require('express');var router=express[_0x2f40('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2f40('0x5'));var interaction=require(_0x2f40('0x6'));var config=require(_0x2f40('0x7'));var controller=require(_0x2f40('0x8'));router[_0x2f40('0x9')]('/',auth[_0x2f40('0xa')](),controller['index']);router[_0x2f40('0x9')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0xb')]);router[_0x2f40('0xc')]('/',auth[_0x2f40('0xa')](),controller[_0x2f40('0xd')]);router['put'](_0x2f40('0xe'),auth[_0x2f40('0xa')](),controller['update']);router[_0x2f40('0xf')]('/:id',auth[_0x2f40('0xa')](),controller[_0x2f40('0x10')]);module['exports']=router;
\ No newline at end of file
+var _0xe095=['put','/:id','update','delete','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','post','create'];(function(_0x1a9e39,_0x36d760){var _0x406407=function(_0x3a2de1){while(--_0x3a2de1){_0x1a9e39['push'](_0x1a9e39['shift']());}};_0x406407(++_0x36d760);}(_0xe095,0x1b5));var _0x5e09=function(_0x5b039d,_0x4306ba){_0x5b039d=_0x5b039d-0x0;var _0x2c64c2=_0xe095[_0x5b039d];return _0x2c64c2;};'use strict';var multer=require(_0x5e09('0x0'));var util=require(_0x5e09('0x1'));var path=require('path');var timeout=require(_0x5e09('0x2'));var express=require(_0x5e09('0x3'));var router=express['Router']();var fs_extra=require(_0x5e09('0x4'));var auth=require(_0x5e09('0x5'));var interaction=require(_0x5e09('0x6'));var config=require(_0x5e09('0x7'));var controller=require(_0x5e09('0x8'));router[_0x5e09('0x9')]('/',auth[_0x5e09('0xa')](),controller['index']);router[_0x5e09('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5e09('0xb')]('/',auth[_0x5e09('0xa')](),controller[_0x5e09('0xc')]);router[_0x5e09('0xd')](_0x5e09('0xe'),auth[_0x5e09('0xa')](),controller[_0x5e09('0xf')]);router[_0x5e09('0x10')](_0x5e09('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x5e09('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 9c3444c..3f16d42 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 _0x49ac=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0xd2154b,_0xef4cec){var _0x560c1f=function(_0x5a0cd9){while(--_0x5a0cd9){_0xd2154b['push'](_0xd2154b['shift']());}};_0x560c1f(++_0xef4cec);}(_0x49ac,0x19e));var _0xc49a=function(_0x14d896,_0x53578b){_0x14d896=_0x14d896-0x0;var _0x28679a=_0x49ac[_0x14d896];return _0x28679a;};'use strict';var Sequelize=require(_0xc49a('0x0'));module[_0xc49a('0x1')]={'calldate':{'type':Sequelize[_0xc49a('0x2')],'allowNull':![],'defaultValue':_0xc49a('0x3')},'clid':{'type':Sequelize[_0xc49a('0x4')]},'src':{'type':Sequelize[_0xc49a('0x4')]},'dst':{'type':Sequelize[_0xc49a('0x4')]},'dcontext':{'type':Sequelize[_0xc49a('0x4')]},'channel':{'type':Sequelize[_0xc49a('0x4')]},'dstchannel':{'type':Sequelize[_0xc49a('0x4')]},'lastapp':{'type':Sequelize[_0xc49a('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xc49a('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xc49a('0x4')]},'amaflags':{'type':Sequelize[_0xc49a('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xc49a('0x4')]},'userfield':{'type':Sequelize[_0xc49a('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xc49a('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0xc49a('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0xc49a('0x4')]}};
\ No newline at end of file
+var _0x3098=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x278b77,_0x34f7dd){var _0x2b07f2=function(_0x32e6bf){while(--_0x32e6bf){_0x278b77['push'](_0x278b77['shift']());}};_0x2b07f2(++_0x34f7dd);}(_0x3098,0x86));var _0x8309=function(_0x4629ee,_0x5802d8){_0x4629ee=_0x4629ee-0x0;var _0x47fb5b=_0x3098[_0x4629ee];return _0x47fb5b;};'use strict';var Sequelize=require(_0x8309('0x0'));module[_0x8309('0x1')]={'calldate':{'type':Sequelize[_0x8309('0x2')],'allowNull':![],'defaultValue':_0x8309('0x3')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0x8309('0x4')]},'dst':{'type':Sequelize[_0x8309('0x4')]},'dcontext':{'type':Sequelize[_0x8309('0x4')]},'channel':{'type':Sequelize[_0x8309('0x4')]},'dstchannel':{'type':Sequelize[_0x8309('0x4')]},'lastapp':{'type':Sequelize[_0x8309('0x4')]},'lastdata':{'type':Sequelize[_0x8309('0x4')]},'duration':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8309('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8309('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8309('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8309('0x4')]},'linkedid':{'type':Sequelize[_0x8309('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x8309('0x4')]},'tag':{'type':Sequelize[_0x8309('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 831bf81..e74a9f1 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 _0xc492=['findAll','rows','catch','params','includeAll','find','body','describe','eml-format','rimraf','zip-dir','moment','util','path','to-csv','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','include'];(function(_0x3fac88,_0xceed4f){var _0x4424fe=function(_0x4c4403){while(--_0x4c4403){_0x3fac88['push'](_0x3fac88['shift']());}};_0x4424fe(++_0xceed4f);}(_0xc492,0xd7));var _0x2c49=function(_0x4f836e,_0x4d6423){_0x4f836e=_0x4f836e-0x0;var _0x5b963a=_0xc492[_0x4f836e];return _0x5b963a;};'use strict';var emlformat=require(_0x2c49('0x0'));var rimraf=require(_0x2c49('0x1'));var zipdir=require(_0x2c49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2c49('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x2c49('0x4'));var path=require(_0x2c49('0x5'));var sox=require('sox');var csv=require(_0x2c49('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x2c49('0x7'));var _=require(_0x2c49('0x8'));var squel=require('squel');var crypto=require(_0x2c49('0x9'));var jsforce=require(_0x2c49('0xa'));var deskjs=require(_0x2c49('0xb'));var toCsv=require(_0x2c49('0x6'));var querystring=require(_0x2c49('0xc'));var Papa=require('papaparse');var Redis=require(_0x2c49('0xd'));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(_0x2c49('0xe'))('api');var utils=require(_0x2c49('0xf'));var config=require(_0x2c49('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0x2c49('0x11'))['db'];function respondWithStatusCode(_0x1cc78b,_0x19f7d9){_0x19f7d9=_0x19f7d9||0xcc;return function(_0x1e2210){if(_0x1e2210){return _0x1cc78b[_0x2c49('0x12')](_0x19f7d9);}return _0x1cc78b[_0x2c49('0x13')](_0x19f7d9)['end']();};}function respondWithResult(_0x2006cf,_0x5af5e7){_0x5af5e7=_0x5af5e7||0xc8;return function(_0x2eeb10){if(_0x2eeb10){return _0x2006cf[_0x2c49('0x13')](_0x5af5e7)[_0x2c49('0x14')](_0x2eeb10);}};}function respondWithFilteredResult(_0x561d83,_0x19f59b){return function(_0x385724){if(_0x385724){var _0x30da01=typeof _0x19f59b[_0x2c49('0x15')]===_0x2c49('0x16')&&typeof _0x19f59b[_0x2c49('0x17')]===_0x2c49('0x16');var _0x2e2e07=_0x385724[_0x2c49('0x18')];var _0x89bcb=_0x30da01?0x0:_0x19f59b['offset'];var _0x3001af=_0x30da01?_0x385724[_0x2c49('0x18')]:_0x19f59b[_0x2c49('0x15')]+_0x19f59b[_0x2c49('0x17')];var _0x4793d5;if(_0x3001af>=_0x2e2e07){_0x3001af=_0x2e2e07;_0x4793d5=0xc8;}else{_0x4793d5=0xce;}_0x561d83[_0x2c49('0x13')](_0x4793d5);return _0x561d83['set'](_0x2c49('0x19'),_0x89bcb+'-'+_0x3001af+'/'+_0x2e2e07)[_0x2c49('0x14')](_0x385724);}return null;};}function patchUpdates(_0x573157){return function(_0x4b8f61){try{jsonpatch[_0x2c49('0x1a')](_0x4b8f61,_0x573157,!![]);}catch(_0x3bda90){return BPromise[_0x2c49('0x1b')](_0x3bda90);}return _0x4b8f61[_0x2c49('0x1c')]();};}function saveUpdates(_0x202205,_0x294c70){return function(_0x33c09f){if(_0x33c09f){return _0x33c09f[_0x2c49('0x1d')](_0x202205)[_0x2c49('0x1e')](function(_0x54fe21){return _0x54fe21;});}return null;};}function removeEntity(_0x14ca06,_0x20f3bf){return function(_0x4037b0){if(_0x4037b0){return _0x4037b0[_0x2c49('0x1f')]()['then'](function(){_0x14ca06[_0x2c49('0x13')](0xcc)[_0x2c49('0x20')]();});}};}function handleEntityNotFound(_0x3a35b4,_0x2a9109){return function(_0x59c061){if(!_0x59c061){_0x3a35b4[_0x2c49('0x12')](0x194);}return _0x59c061;};}function handleError(_0x18a41e,_0x25bf3d){_0x25bf3d=_0x25bf3d||0x1f4;return function(_0x50da06){logger[_0x2c49('0x21')](_0x50da06[_0x2c49('0x22')]);if(_0x50da06['name']){delete _0x50da06[_0x2c49('0x23')];}_0x18a41e['status'](_0x25bf3d)['send'](_0x50da06);};}exports[_0x2c49('0x24')]=function(_0x4d2564,_0x5c4fb1){var _0x4d9334={},_0x433503={},_0x7b8d75={'count':0x0,'rows':[]};var _0x2b2dd5=_[_0x2c49('0x25')](db[_0x2c49('0x26')][_0x2c49('0x27')],function(_0x131c06){return{'name':_0x131c06[_0x2c49('0x28')],'type':_0x131c06[_0x2c49('0x29')][_0x2c49('0x2a')]};});_0x433503['model']=_[_0x2c49('0x25')](_0x2b2dd5,'name');_0x433503[_0x2c49('0x2b')]=_[_0x2c49('0x2c')](_0x4d2564[_0x2c49('0x2b')]);_0x433503[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],_0x433503[_0x2c49('0x2b')]);_0x4d9334[_0x2c49('0x30')]=_[_0x2c49('0x2e')](_0x433503[_0x2c49('0x2f')],qs[_0x2c49('0x31')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x31')]));_0x4d9334[_0x2c49('0x30')]=_0x4d9334['attributes']['length']?_0x4d9334[_0x2c49('0x30')]:_0x433503[_0x2c49('0x2f')];if(!_0x4d2564['query'][_0x2c49('0x32')](_0x2c49('0x33'))){_0x4d9334[_0x2c49('0x17')]=qs[_0x2c49('0x17')](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x17')]);_0x4d9334[_0x2c49('0x15')]=qs[_0x2c49('0x15')](_0x4d2564['query'][_0x2c49('0x15')]);}_0x4d9334[_0x2c49('0x34')]=qs['sort'](_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x35')]);_0x4d9334[_0x2c49('0x36')]=qs['filters'](_[_0x2c49('0x37')](_0x4d2564[_0x2c49('0x2b')],_0x433503[_0x2c49('0x2d')]),_0x2b2dd5);if(_0x4d2564[_0x2c49('0x2b')][_0x2c49('0x38')]){_0x4d9334[_0x2c49('0x36')]=_['merge'](_0x4d9334[_0x2c49('0x36')],{'$or':_[_0x2c49('0x25')](_0x2b2dd5,function(_0x4cbfe4){if(_0x4cbfe4[_0x2c49('0x29')]!==_0x2c49('0x39')){var _0x52f123={};_0x52f123[_0x4cbfe4[_0x2c49('0x23')]]={'$like':'%'+_0x4d2564['query'][_0x2c49('0x38')]+'%'};return _0x52f123;}})});}_0x4d9334=_[_0x2c49('0x3a')]({},_0x4d9334,_0x4d2564[_0x2c49('0x3b')]);var _0x5a6822={'where':_0x4d9334[_0x2c49('0x36')]};return db['Cdr'][_0x2c49('0x18')](_0x5a6822)[_0x2c49('0x1e')](function(_0x24e53a){_0x7b8d75[_0x2c49('0x18')]=_0x24e53a;if(_0x4d2564[_0x2c49('0x2b')]['includeAll']){_0x4d9334[_0x2c49('0x3c')]=[{'all':!![]}];}return db[_0x2c49('0x26')][_0x2c49('0x3d')](_0x4d9334);})[_0x2c49('0x1e')](function(_0x251c8d){_0x7b8d75[_0x2c49('0x3e')]=_0x251c8d;return _0x7b8d75;})[_0x2c49('0x1e')](respondWithFilteredResult(_0x5c4fb1,_0x4d9334))[_0x2c49('0x3f')](handleError(_0x5c4fb1,null));};exports['show']=function(_0xa912b8,_0x30e892){var _0x5b1ee0={'raw':!![],'where':{'id':_0xa912b8[_0x2c49('0x40')]['id']}},_0x2a21b9={};_0x2a21b9['model']=_[_0x2c49('0x2c')](db['Cdr']['rawAttributes']);_0x2a21b9['query']=_['keys'](_0xa912b8[_0x2c49('0x2b')]);_0x2a21b9[_0x2c49('0x2d')]=_[_0x2c49('0x2e')](_0x2a21b9[_0x2c49('0x2f')],_0x2a21b9[_0x2c49('0x2b')]);_0x5b1ee0['attributes']=_['intersection'](_0x2a21b9['model'],qs['fields'](_0xa912b8[_0x2c49('0x2b')]['fields']));_0x5b1ee0[_0x2c49('0x30')]=_0x5b1ee0['attributes']['length']?_0x5b1ee0['attributes']:_0x2a21b9[_0x2c49('0x2f')];if(_0xa912b8['query'][_0x2c49('0x41')]){_0x5b1ee0[_0x2c49('0x3c')]=[{'all':!![]}];}_0x5b1ee0=_['merge']({},_0x5b1ee0,_0xa912b8['options']);return db[_0x2c49('0x26')][_0x2c49('0x42')](_0x5b1ee0)[_0x2c49('0x1e')](handleEntityNotFound(_0x30e892,null))[_0x2c49('0x1e')](respondWithResult(_0x30e892,null))[_0x2c49('0x3f')](handleError(_0x30e892,null));};exports['create']=function(_0x50dce4,_0x426c8a){return db[_0x2c49('0x26')]['create'](_0x50dce4['body'],{})['then'](respondWithResult(_0x426c8a,0xc9))[_0x2c49('0x3f')](handleError(_0x426c8a,null));};exports[_0x2c49('0x1d')]=function(_0x98fc90,_0x55e4cd){if(_0x98fc90[_0x2c49('0x43')]['id']){delete _0x98fc90[_0x2c49('0x43')]['id'];}return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x98fc90[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x55e4cd,null))[_0x2c49('0x1e')](saveUpdates(_0x98fc90['body'],null))['then'](respondWithResult(_0x55e4cd,null))['catch'](handleError(_0x55e4cd,null));};exports[_0x2c49('0x1f')]=function(_0x1aa034,_0x5385e5){return db[_0x2c49('0x26')][_0x2c49('0x42')]({'where':{'id':_0x1aa034[_0x2c49('0x40')]['id']}})[_0x2c49('0x1e')](handleEntityNotFound(_0x5385e5,null))[_0x2c49('0x1e')](removeEntity(_0x5385e5,null))[_0x2c49('0x3f')](handleError(_0x5385e5,null));};exports[_0x2c49('0x44')]=function(_0x11878d,_0x331519){return db[_0x2c49('0x26')]['describe']()[_0x2c49('0x1e')](respondWithResult(_0x331519,null))[_0x2c49('0x3f')](handleError(_0x331519,null));};
\ No newline at end of file
+var _0xdb94=['keys','find','create','body','destroy','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','index','Cdr','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','sort','pick','where','VIRTUAL','filter','includeAll','include','findAll','rows','catch'];(function(_0x142507,_0x51fb78){var _0x2a513c=function(_0x28050f){while(--_0x28050f){_0x142507['push'](_0x142507['shift']());}};_0x2a513c(++_0x51fb78);}(_0xdb94,0xe5));var _0x4db9=function(_0x36e567,_0xb4ba91){_0x36e567=_0x36e567-0x0;var _0x2df914=_0xdb94[_0x36e567];return _0x2df914;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4db9('0x0'));var zipdir=require(_0x4db9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4db9('0x2'));var moment=require(_0x4db9('0x3'));var BPromise=require(_0x4db9('0x4'));var Mustache=require(_0x4db9('0x5'));var util=require(_0x4db9('0x6'));var path=require('path');var sox=require(_0x4db9('0x7'));var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var fs_extra=require(_0x4db9('0x9'));var _=require(_0x4db9('0xa'));var squel=require(_0x4db9('0xb'));var crypto=require(_0x4db9('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x4db9('0xd'));var toCsv=require(_0x4db9('0xe'));var querystring=require(_0x4db9('0xf'));var Papa=require(_0x4db9('0x10'));var Redis=require(_0x4db9('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4db9('0x12'));var as=require(_0x4db9('0x13'));var hardwareService=require(_0x4db9('0x14'));var logger=require(_0x4db9('0x15'))(_0x4db9('0x16'));var utils=require(_0x4db9('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x4db9('0x18'));var db=require(_0x4db9('0x19'))['db'];function respondWithStatusCode(_0x59f01c,_0x549c92){_0x549c92=_0x549c92||0xcc;return function(_0x19f2d3){if(_0x19f2d3){return _0x59f01c[_0x4db9('0x1a')](_0x549c92);}return _0x59f01c[_0x4db9('0x1b')](_0x549c92)['end']();};}function respondWithResult(_0x1a93be,_0x3dde55){_0x3dde55=_0x3dde55||0xc8;return function(_0x2018d2){if(_0x2018d2){return _0x1a93be[_0x4db9('0x1b')](_0x3dde55)[_0x4db9('0x1c')](_0x2018d2);}};}function respondWithFilteredResult(_0x585230,_0x1b1062){return function(_0x1a5a9c){if(_0x1a5a9c){var _0x5d4d70=typeof _0x1b1062[_0x4db9('0x1d')]===_0x4db9('0x1e')&&typeof _0x1b1062[_0x4db9('0x1f')]==='undefined';var _0xedc513=_0x1a5a9c[_0x4db9('0x20')];var _0x4c5f4f=_0x5d4d70?0x0:_0x1b1062['offset'];var _0x493923=_0x5d4d70?_0x1a5a9c[_0x4db9('0x20')]:_0x1b1062[_0x4db9('0x1d')]+_0x1b1062['limit'];var _0x375515;if(_0x493923>=_0xedc513){_0x493923=_0xedc513;_0x375515=0xc8;}else{_0x375515=0xce;}_0x585230[_0x4db9('0x1b')](_0x375515);return _0x585230[_0x4db9('0x21')](_0x4db9('0x22'),_0x4c5f4f+'-'+_0x493923+'/'+_0xedc513)[_0x4db9('0x1c')](_0x1a5a9c);}return null;};}function patchUpdates(_0x28b7f6){return function(_0x34a6ed){try{jsonpatch[_0x4db9('0x23')](_0x34a6ed,_0x28b7f6,!![]);}catch(_0x3256f4){return BPromise[_0x4db9('0x24')](_0x3256f4);}return _0x34a6ed[_0x4db9('0x25')]();};}function saveUpdates(_0x102402,_0x4d56a1){return function(_0x42cc40){if(_0x42cc40){return _0x42cc40[_0x4db9('0x26')](_0x102402)['then'](function(_0x37c81f){return _0x37c81f;});}return null;};}function removeEntity(_0x3f4931,_0x4419af){return function(_0x402898){if(_0x402898){return _0x402898['destroy']()[_0x4db9('0x27')](function(){_0x3f4931['status'](0xcc)[_0x4db9('0x28')]();});}};}function handleEntityNotFound(_0x1c82b6,_0x135aa7){return function(_0x47e89c){if(!_0x47e89c){_0x1c82b6[_0x4db9('0x1a')](0x194);}return _0x47e89c;};}function handleError(_0x622db6,_0x47464d){_0x47464d=_0x47464d||0x1f4;return function(_0x5e7d29){logger['error'](_0x5e7d29[_0x4db9('0x29')]);if(_0x5e7d29['name']){delete _0x5e7d29[_0x4db9('0x2a')];}_0x622db6[_0x4db9('0x1b')](_0x47464d)[_0x4db9('0x2b')](_0x5e7d29);};}exports[_0x4db9('0x2c')]=function(_0x384df5,_0x3c3fcf){var _0x1d0dc2={},_0x373a7d={},_0x4c4a47={'count':0x0,'rows':[]};var _0x35f757=_['map'](db[_0x4db9('0x2d')][_0x4db9('0x2e')],function(_0x1e7840){return{'name':_0x1e7840[_0x4db9('0x2f')],'type':_0x1e7840[_0x4db9('0x30')]['key']};});_0x373a7d[_0x4db9('0x31')]=_[_0x4db9('0x32')](_0x35f757,_0x4db9('0x2a'));_0x373a7d[_0x4db9('0x33')]=_['keys'](_0x384df5['query']);_0x373a7d[_0x4db9('0x34')]=_[_0x4db9('0x35')](_0x373a7d['model'],_0x373a7d['query']);_0x1d0dc2[_0x4db9('0x36')]=_['intersection'](_0x373a7d['model'],qs[_0x4db9('0x37')](_0x384df5[_0x4db9('0x33')]['fields']));_0x1d0dc2[_0x4db9('0x36')]=_0x1d0dc2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x1d0dc2[_0x4db9('0x36')]:_0x373a7d['model'];if(!_0x384df5[_0x4db9('0x33')]['hasOwnProperty']('nolimit')){_0x1d0dc2['limit']=qs[_0x4db9('0x1f')](_0x384df5[_0x4db9('0x33')]['limit']);_0x1d0dc2[_0x4db9('0x1d')]=qs[_0x4db9('0x1d')](_0x384df5['query']['offset']);}_0x1d0dc2['order']=qs[_0x4db9('0x39')](_0x384df5['query'][_0x4db9('0x39')]);_0x1d0dc2['where']=qs[_0x4db9('0x34')](_[_0x4db9('0x3a')](_0x384df5[_0x4db9('0x33')],_0x373a7d[_0x4db9('0x34')]),_0x35f757);if(_0x384df5[_0x4db9('0x33')]['filter']){_0x1d0dc2[_0x4db9('0x3b')]=_['merge'](_0x1d0dc2[_0x4db9('0x3b')],{'$or':_[_0x4db9('0x32')](_0x35f757,function(_0x15929e){if(_0x15929e[_0x4db9('0x30')]!==_0x4db9('0x3c')){var _0x4159d2={};_0x4159d2[_0x15929e['name']]={'$like':'%'+_0x384df5[_0x4db9('0x33')][_0x4db9('0x3d')]+'%'};return _0x4159d2;}})});}_0x1d0dc2=_['merge']({},_0x1d0dc2,_0x384df5['options']);var _0x404af3={'where':_0x1d0dc2[_0x4db9('0x3b')]};return db[_0x4db9('0x2d')][_0x4db9('0x20')](_0x404af3)[_0x4db9('0x27')](function(_0x36a648){_0x4c4a47[_0x4db9('0x20')]=_0x36a648;if(_0x384df5[_0x4db9('0x33')][_0x4db9('0x3e')]){_0x1d0dc2[_0x4db9('0x3f')]=[{'all':!![]}];}return db[_0x4db9('0x2d')][_0x4db9('0x40')](_0x1d0dc2);})['then'](function(_0x2716d6){_0x4c4a47[_0x4db9('0x41')]=_0x2716d6;return _0x4c4a47;})[_0x4db9('0x27')](respondWithFilteredResult(_0x3c3fcf,_0x1d0dc2))[_0x4db9('0x42')](handleError(_0x3c3fcf,null));};exports['show']=function(_0x57d32d,_0x248891){var _0x2b18a2={'raw':!![],'where':{'id':_0x57d32d['params']['id']}},_0x2fc233={};_0x2fc233[_0x4db9('0x31')]=_['keys'](db[_0x4db9('0x2d')][_0x4db9('0x2e')]);_0x2fc233[_0x4db9('0x33')]=_[_0x4db9('0x43')](_0x57d32d[_0x4db9('0x33')]);_0x2fc233['filters']=_[_0x4db9('0x35')](_0x2fc233[_0x4db9('0x31')],_0x2fc233[_0x4db9('0x33')]);_0x2b18a2[_0x4db9('0x36')]=_[_0x4db9('0x35')](_0x2fc233['model'],qs[_0x4db9('0x37')](_0x57d32d[_0x4db9('0x33')][_0x4db9('0x37')]));_0x2b18a2[_0x4db9('0x36')]=_0x2b18a2[_0x4db9('0x36')][_0x4db9('0x38')]?_0x2b18a2[_0x4db9('0x36')]:_0x2fc233[_0x4db9('0x31')];if(_0x57d32d[_0x4db9('0x33')]['includeAll']){_0x2b18a2[_0x4db9('0x3f')]=[{'all':!![]}];}_0x2b18a2=_['merge']({},_0x2b18a2,_0x57d32d['options']);return db[_0x4db9('0x2d')][_0x4db9('0x44')](_0x2b18a2)['then'](handleEntityNotFound(_0x248891,null))['then'](respondWithResult(_0x248891,null))[_0x4db9('0x42')](handleError(_0x248891,null));};exports[_0x4db9('0x45')]=function(_0x3fc788,_0x7f0aac){return db[_0x4db9('0x2d')][_0x4db9('0x45')](_0x3fc788[_0x4db9('0x46')],{})[_0x4db9('0x27')](respondWithResult(_0x7f0aac,0xc9))[_0x4db9('0x42')](handleError(_0x7f0aac,null));};exports[_0x4db9('0x26')]=function(_0x43312c,_0x5495de){if(_0x43312c[_0x4db9('0x46')]['id']){delete _0x43312c[_0x4db9('0x46')]['id'];}return db['Cdr'][_0x4db9('0x44')]({'where':{'id':_0x43312c['params']['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x5495de,null))[_0x4db9('0x27')](saveUpdates(_0x43312c[_0x4db9('0x46')],null))[_0x4db9('0x27')](respondWithResult(_0x5495de,null))[_0x4db9('0x42')](handleError(_0x5495de,null));};exports[_0x4db9('0x47')]=function(_0x3f1aac,_0x3b8d8c){return db[_0x4db9('0x2d')][_0x4db9('0x44')]({'where':{'id':_0x3f1aac[_0x4db9('0x48')]['id']}})[_0x4db9('0x27')](handleEntityNotFound(_0x3b8d8c,null))[_0x4db9('0x27')](removeEntity(_0x3b8d8c,null))['catch'](handleError(_0x3b8d8c,null));};exports['describe']=function(_0x5ececc,_0x161e2e){return db['Cdr'][_0x4db9('0x49')]()['then'](respondWithResult(_0x161e2e,null))[_0x4db9('0x42')](handleError(_0x161e2e,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 6c268b3..198a701 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(_0x1194a5,_0xd0a243){var _0x339830=function(_0x36ef18){while(--_0x36ef18){_0x1194a5['push'](_0x1194a5['shift']());}};_0x339830(++_0xd0a243);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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(_0x49f87b,_0x41908f){var _0x4ee2b6=function(_0x4b5fab){while(--_0x4b5fab){_0x49f87b['push'](_0x49f87b['shift']());}};_0x4ee2b6(++_0x41908f);}(_0x7a54,0x106));var _0x47a5=function(_0x514b5a,_0x1d05d8){_0x514b5a=_0x514b5a-0x0;var _0x29810a=_0x7a54[_0x514b5a];return _0x29810a;};'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 db8b609..392e404 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 _0x1b5a=['jayson/promise','client','request','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x4b809b,_0x205cfc){var _0x14ff77=function(_0x155aff){while(--_0x155aff){_0x4b809b['push'](_0x4b809b['shift']());}};_0x14ff77(++_0x205cfc);}(_0x1b5a,0x98));var _0xa1b5=function(_0x464a27,_0x206acd){_0x464a27=_0x464a27-0x0;var _0x1ab379=_0x1b5a[_0x464a27];return _0x1ab379;};'use strict';var _=require(_0xa1b5('0x0'));var util=require(_0xa1b5('0x1'));var moment=require(_0xa1b5('0x2'));var BPromise=require('bluebird');var rs=require(_0xa1b5('0x3'));var fs=require('fs');var Redis=require(_0xa1b5('0x4'));var db=require(_0xa1b5('0x5'))['db'];var utils=require(_0xa1b5('0x6'));var logger=require('../../config/logger')(_0xa1b5('0x7'));var config=require('../../config/environment');var jayson=require(_0xa1b5('0x8'));var client=jayson[_0xa1b5('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44d969,_0x32e715,_0x4326a5){return new BPromise(function(_0x167b7f,_0x12c7bb){return client[_0xa1b5('0xa')](_0x44d969,_0x4326a5)['then'](function(_0x39e94e){logger['info'](_0xa1b5('0xb'),_0x32e715,_0xa1b5('0xc'));logger[_0xa1b5('0xd')](_0xa1b5('0xe'),_0x32e715,_0xa1b5('0xc'),JSON[_0xa1b5('0xf')](_0x39e94e));if(_0x39e94e[_0xa1b5('0x10')]){if(_0x39e94e[_0xa1b5('0x10')]['code']===0x1f4){logger['error'](_0xa1b5('0xb'),_0x32e715,_0x39e94e['error']['message']);return _0x12c7bb(_0x39e94e['error'][_0xa1b5('0x11')]);}logger[_0xa1b5('0x10')](_0xa1b5('0xb'),_0x32e715,_0x39e94e[_0xa1b5('0x10')][_0xa1b5('0x11')]);return _0x167b7f(_0x39e94e['error'][_0xa1b5('0x11')]);}else{logger['info'](_0xa1b5('0xb'),_0x32e715,_0xa1b5('0xc'));_0x167b7f(_0x39e94e[_0xa1b5('0x12')][_0xa1b5('0x11')]);}})[_0xa1b5('0x13')](function(_0x5eb1cb){logger['error']('Cdr,\x20%s,\x20%s',_0x32e715,_0x5eb1cb);_0x12c7bb(_0x5eb1cb);});});}
\ No newline at end of file
+var _0xeef8=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Cdr,\x20%s,\x20%s','result','catch','lodash','util','bluebird'];(function(_0x404fb4,_0x508e6d){var _0x28992d=function(_0x56d9b7){while(--_0x56d9b7){_0x404fb4['push'](_0x404fb4['shift']());}};_0x28992d(++_0x508e6d);}(_0xeef8,0x1ad));var _0x8eef=function(_0x249bae,_0x39509a){_0x249bae=_0x249bae-0x0;var _0x5407f1=_0xeef8[_0x249bae];return _0x5407f1;};'use strict';var _=require(_0x8eef('0x0'));var util=require(_0x8eef('0x1'));var moment=require('moment');var BPromise=require(_0x8eef('0x2'));var rs=require(_0x8eef('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8eef('0x4'))['db'];var utils=require(_0x8eef('0x5'));var logger=require(_0x8eef('0x6'))('rpc');var config=require(_0x8eef('0x7'));var jayson=require(_0x8eef('0x8'));var client=jayson[_0x8eef('0x9')][_0x8eef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x381290,_0x478694,_0x489a90){return new BPromise(function(_0x5f4a83,_0x40b5f9){return client[_0x8eef('0xb')](_0x381290,_0x489a90)[_0x8eef('0xc')](function(_0x431b8c){logger[_0x8eef('0xd')]('Cdr,\x20%s,\x20%s',_0x478694,_0x8eef('0xe'));logger[_0x8eef('0xf')](_0x8eef('0x10'),_0x478694,_0x8eef('0xe'),JSON[_0x8eef('0x11')](_0x431b8c));if(_0x431b8c[_0x8eef('0x12')]){if(_0x431b8c[_0x8eef('0x12')][_0x8eef('0x13')]===0x1f4){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x40b5f9(_0x431b8c[_0x8eef('0x12')]['message']);}logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0x431b8c[_0x8eef('0x12')]['message']);return _0x5f4a83(_0x431b8c['error'][_0x8eef('0x14')]);}else{logger['info'](_0x8eef('0x15'),_0x478694,_0x8eef('0xe'));_0x5f4a83(_0x431b8c[_0x8eef('0x16')][_0x8eef('0x14')]);}})[_0x8eef('0x17')](function(_0xf27091){logger[_0x8eef('0x12')]('Cdr,\x20%s,\x20%s',_0x478694,_0xf27091);_0x40b5f9(_0xf27091);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index 98eb66a..a80baf7 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 _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(_0x38aa1d,_0x4faf18){var _0x2fb75d=function(_0x14ee14){while(--_0x14ee14){_0x38aa1d['push'](_0x38aa1d['shift']());}};_0x2fb75d(++_0x4faf18);}(_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
+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(_0x5cfaf5,_0x1c4530){var _0x30468e=function(_0x4b97ed){while(--_0x4b97ed){_0x5cfaf5['push'](_0x5cfaf5['shift']());}};_0x30468e(++_0x1c4530);}(_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 2b2b0a8..ed058bc 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 _0x985c=['TEXT','sequelize','INTEGER','STRING','noop'];(function(_0x11b8ae,_0x485fa8){var _0x35a448=function(_0x188a5b){while(--_0x188a5b){_0x11b8ae['push'](_0x11b8ae['shift']());}};_0x35a448(++_0x485fa8);}(_0x985c,0x8d));var _0xc985=function(_0x54c9f0,_0x402dae){_0x54c9f0=_0x54c9f0-0x0;var _0x57f97a=_0x985c[_0x54c9f0];return _0x57f97a;};'use strict';var Sequelize=require(_0xc985('0x0'));module['exports']={'priority':{'type':Sequelize[_0xc985('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xc985('0x2')],'allowNull':![],'defaultValue':_0xc985('0x3')},'appdata':{'type':Sequelize[_0xc985('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xc985('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x4b7b=['INTEGER','STRING','noop','TEXT','*,*,*,*','exports'];(function(_0x4add74,_0x41e997){var _0x64e1f2=function(_0x1c6985){while(--_0x1c6985){_0x4add74['push'](_0x4add74['shift']());}};_0x64e1f2(++_0x41e997);}(_0x4b7b,0x143));var _0xb4b7=function(_0x14fa9f,_0x4b9856){_0x14fa9f=_0x14fa9f-0x0;var _0x362f8d=_0x4b7b[_0x14fa9f];return _0x362f8d;};'use strict';var Sequelize=require('sequelize');module[_0xb4b7('0x0')]={'priority':{'type':Sequelize[_0xb4b7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb4b7('0x2')],'allowNull':![],'defaultValue':_0xb4b7('0x3')},'appdata':{'type':Sequelize[_0xb4b7('0x4')]()},'description':{'type':Sequelize[_0xb4b7('0x2')]},'interval':{'type':Sequelize[_0xb4b7('0x2')],'defaultValue':_0xb4b7('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 041d660..66dba03 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 _0xad13=['length','includeAll','ChatApplication','find','catch','body','params','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','stack','name','show','keys','rawAttributes','query','filters','intersection','model','attributes','fields'];(function(_0x20aab1,_0xc6d854){var _0x277dff=function(_0x494c4d){while(--_0x494c4d){_0x20aab1['push'](_0x20aab1['shift']());}};_0x277dff(++_0xc6d854);}(_0xad13,0x79));var _0x3ad1=function(_0x18e3c5,_0x54fe8d){_0x18e3c5=_0x18e3c5-0x0;var _0x1a6b15=_0xad13[_0x18e3c5];return _0x1a6b15;};'use strict';var emlformat=require(_0x3ad1('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3ad1('0x1'));var jsonpatch=require(_0x3ad1('0x2'));var rp=require(_0x3ad1('0x3'));var moment=require(_0x3ad1('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3ad1('0x5'));var util=require(_0x3ad1('0x6'));var path=require(_0x3ad1('0x7'));var sox=require(_0x3ad1('0x8'));var csv=require(_0x3ad1('0x9'));var ejs=require(_0x3ad1('0xa'));var fs=require('fs');var fs_extra=require(_0x3ad1('0xb'));var _=require(_0x3ad1('0xc'));var squel=require(_0x3ad1('0xd'));var crypto=require(_0x3ad1('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3ad1('0xf'));var toCsv=require(_0x3ad1('0x9'));var querystring=require(_0x3ad1('0x10'));var Papa=require('papaparse');var Redis=require(_0x3ad1('0x11'));var authService=require(_0x3ad1('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3ad1('0x13'));var hardwareService=require(_0x3ad1('0x14'));var logger=require(_0x3ad1('0x15'))(_0x3ad1('0x16'));var utils=require(_0x3ad1('0x17'));var config=require(_0x3ad1('0x18'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x142957,_0x42f6a0){_0x42f6a0=_0x42f6a0||0xcc;return function(_0x4544c0){if(_0x4544c0){return _0x142957[_0x3ad1('0x19')](_0x42f6a0);}return _0x142957['status'](_0x42f6a0)[_0x3ad1('0x1a')]();};}function respondWithResult(_0x4bf44f,_0x19b1db){_0x19b1db=_0x19b1db||0xc8;return function(_0x3b68de){if(_0x3b68de){return _0x4bf44f[_0x3ad1('0x1b')](_0x19b1db)[_0x3ad1('0x1c')](_0x3b68de);}};}function respondWithFilteredResult(_0x5448a1,_0x4104aa){return function(_0xce229){if(_0xce229){var _0x384ed5=typeof _0x4104aa[_0x3ad1('0x1d')]===_0x3ad1('0x1e')&&typeof _0x4104aa[_0x3ad1('0x1f')]===_0x3ad1('0x1e');var _0x5cf66b=_0xce229[_0x3ad1('0x20')];var _0x30e53f=_0x384ed5?0x0:_0x4104aa[_0x3ad1('0x1d')];var _0xd43203=_0x384ed5?_0xce229[_0x3ad1('0x20')]:_0x4104aa['offset']+_0x4104aa[_0x3ad1('0x1f')];var _0x3de9a2;if(_0xd43203>=_0x5cf66b){_0xd43203=_0x5cf66b;_0x3de9a2=0xc8;}else{_0x3de9a2=0xce;}_0x5448a1['status'](_0x3de9a2);return _0x5448a1[_0x3ad1('0x21')](_0x3ad1('0x22'),_0x30e53f+'-'+_0xd43203+'/'+_0x5cf66b)[_0x3ad1('0x1c')](_0xce229);}return null;};}function patchUpdates(_0x46649d){return function(_0x1f65ff){try{jsonpatch[_0x3ad1('0x23')](_0x1f65ff,_0x46649d,!![]);}catch(_0x5aa568){return BPromise[_0x3ad1('0x24')](_0x5aa568);}return _0x1f65ff['save']();};}function saveUpdates(_0xc78309,_0x5f1031){return function(_0x21ed3b){if(_0x21ed3b){return _0x21ed3b[_0x3ad1('0x25')](_0xc78309)[_0x3ad1('0x26')](function(_0x3e9c1f){return _0x3e9c1f;});}return null;};}function removeEntity(_0x2365f3,_0x3a0166){return function(_0x2fd5e6){if(_0x2fd5e6){return _0x2fd5e6['destroy']()[_0x3ad1('0x26')](function(){_0x2365f3[_0x3ad1('0x1b')](0xcc)[_0x3ad1('0x1a')]();});}};}function handleEntityNotFound(_0x2ee2e8,_0x1d82a8){return function(_0x2cd135){if(!_0x2cd135){_0x2ee2e8['sendStatus'](0x194);}return _0x2cd135;};}function handleError(_0x5b5abc,_0x7b69e5){_0x7b69e5=_0x7b69e5||0x1f4;return function(_0x5e1c03){logger['error'](_0x5e1c03[_0x3ad1('0x27')]);if(_0x5e1c03[_0x3ad1('0x28')]){delete _0x5e1c03[_0x3ad1('0x28')];}_0x5b5abc[_0x3ad1('0x1b')](_0x7b69e5)['send'](_0x5e1c03);};}exports[_0x3ad1('0x29')]=function(_0xc56f8a,_0x402df6){var _0x3753f1={'raw':!![],'where':{'id':_0xc56f8a['params']['id']}},_0x345cb9={};_0x345cb9['model']=_[_0x3ad1('0x2a')](db['ChatApplication'][_0x3ad1('0x2b')]);_0x345cb9[_0x3ad1('0x2c')]=_[_0x3ad1('0x2a')](_0xc56f8a[_0x3ad1('0x2c')]);_0x345cb9[_0x3ad1('0x2d')]=_[_0x3ad1('0x2e')](_0x345cb9[_0x3ad1('0x2f')],_0x345cb9[_0x3ad1('0x2c')]);_0x3753f1[_0x3ad1('0x30')]=_['intersection'](_0x345cb9[_0x3ad1('0x2f')],qs['fields'](_0xc56f8a[_0x3ad1('0x2c')][_0x3ad1('0x31')]));_0x3753f1[_0x3ad1('0x30')]=_0x3753f1[_0x3ad1('0x30')][_0x3ad1('0x32')]?_0x3753f1[_0x3ad1('0x30')]:_0x345cb9[_0x3ad1('0x2f')];if(_0xc56f8a['query'][_0x3ad1('0x33')]){_0x3753f1['include']=[{'all':!![]}];}_0x3753f1=_['merge']({},_0x3753f1,_0xc56f8a['options']);return db[_0x3ad1('0x34')][_0x3ad1('0x35')](_0x3753f1)[_0x3ad1('0x26')](handleEntityNotFound(_0x402df6,null))[_0x3ad1('0x26')](respondWithResult(_0x402df6,null))[_0x3ad1('0x36')](handleError(_0x402df6,null));};exports[_0x3ad1('0x25')]=function(_0x54f100,_0x51d21b){if(_0x54f100[_0x3ad1('0x37')]['id']){delete _0x54f100[_0x3ad1('0x37')]['id'];}return db[_0x3ad1('0x34')][_0x3ad1('0x35')]({'where':{'id':_0x54f100[_0x3ad1('0x38')]['id']}})['then'](handleEntityNotFound(_0x51d21b,null))['then'](saveUpdates(_0x54f100['body'],null))['then'](respondWithResult(_0x51d21b,null))[_0x3ad1('0x36')](handleError(_0x51d21b,null));};exports['destroy']=function(_0x5c2acd,_0x78b554){return db[_0x3ad1('0x34')]['find']({'where':{'id':_0x5c2acd[_0x3ad1('0x38')]['id']}})[_0x3ad1('0x26')](handleEntityNotFound(_0x78b554,null))['then'](removeEntity(_0x78b554,null))[_0x3ad1('0x36')](handleError(_0x78b554,null));};
\ No newline at end of file
+var _0x19c3=['keys','ChatApplication','rawAttributes','query','filters','intersection','fields','attributes','include','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','limit','undefined','count','offset','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','show','params','model'];(function(_0x17b4cd,_0x428e1a){var _0x35449c=function(_0x3b0a1a){while(--_0x3b0a1a){_0x17b4cd['push'](_0x17b4cd['shift']());}};_0x35449c(++_0x428e1a);}(_0x19c3,0xf9));var _0x319c=function(_0x29b931,_0x109906){_0x29b931=_0x29b931-0x0;var _0xafbd90=_0x19c3[_0x29b931];return _0xafbd90;};'use strict';var emlformat=require(_0x319c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x319c('0x1'));var jsonpatch=require(_0x319c('0x2'));var rp=require('request-promise');var moment=require(_0x319c('0x3'));var BPromise=require(_0x319c('0x4'));var Mustache=require(_0x319c('0x5'));var util=require(_0x319c('0x6'));var path=require(_0x319c('0x7'));var sox=require(_0x319c('0x8'));var csv=require('to-csv');var ejs=require(_0x319c('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x319c('0xa'));var squel=require(_0x319c('0xb'));var crypto=require(_0x319c('0xc'));var jsforce=require(_0x319c('0xd'));var deskjs=require(_0x319c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x319c('0xf'));var Papa=require(_0x319c('0x10'));var Redis=require(_0x319c('0x11'));var authService=require(_0x319c('0x12'));var qs=require(_0x319c('0x13'));var as=require(_0x319c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x319c('0x15'))('api');var utils=require(_0x319c('0x16'));var config=require(_0x319c('0x17'));var licenseUtil=require(_0x319c('0x18'));var db=require(_0x319c('0x19'))['db'];function respondWithStatusCode(_0x362f44,_0x3be537){_0x3be537=_0x3be537||0xcc;return function(_0x401fdb){if(_0x401fdb){return _0x362f44['sendStatus'](_0x3be537);}return _0x362f44['status'](_0x3be537)[_0x319c('0x1a')]();};}function respondWithResult(_0x2fb398,_0x4c246e){_0x4c246e=_0x4c246e||0xc8;return function(_0x372a50){if(_0x372a50){return _0x2fb398[_0x319c('0x1b')](_0x4c246e)[_0x319c('0x1c')](_0x372a50);}};}function respondWithFilteredResult(_0x2cd063,_0x23afe7){return function(_0xa9b5a7){if(_0xa9b5a7){var _0x29b26c=typeof _0x23afe7['offset']==='undefined'&&typeof _0x23afe7[_0x319c('0x1d')]===_0x319c('0x1e');var _0x53c939=_0xa9b5a7[_0x319c('0x1f')];var _0x49624c=_0x29b26c?0x0:_0x23afe7[_0x319c('0x20')];var _0x45a822=_0x29b26c?_0xa9b5a7[_0x319c('0x1f')]:_0x23afe7[_0x319c('0x20')]+_0x23afe7[_0x319c('0x1d')];var _0x1c11d3;if(_0x45a822>=_0x53c939){_0x45a822=_0x53c939;_0x1c11d3=0xc8;}else{_0x1c11d3=0xce;}_0x2cd063[_0x319c('0x1b')](_0x1c11d3);return _0x2cd063['set'](_0x319c('0x21'),_0x49624c+'-'+_0x45a822+'/'+_0x53c939)[_0x319c('0x1c')](_0xa9b5a7);}return null;};}function patchUpdates(_0x5bd273){return function(_0x500597){try{jsonpatch[_0x319c('0x22')](_0x500597,_0x5bd273,!![]);}catch(_0xc2e927){return BPromise[_0x319c('0x23')](_0xc2e927);}return _0x500597['save']();};}function saveUpdates(_0x3bc070,_0xe50337){return function(_0x386340){if(_0x386340){return _0x386340[_0x319c('0x24')](_0x3bc070)[_0x319c('0x25')](function(_0x4d2ace){return _0x4d2ace;});}return null;};}function removeEntity(_0x1d9dfd,_0x2444c8){return function(_0x4508a5){if(_0x4508a5){return _0x4508a5[_0x319c('0x26')]()[_0x319c('0x25')](function(){_0x1d9dfd['status'](0xcc)[_0x319c('0x1a')]();});}};}function handleEntityNotFound(_0x4f87f8,_0x2cf97b){return function(_0x5fcf3c){if(!_0x5fcf3c){_0x4f87f8['sendStatus'](0x194);}return _0x5fcf3c;};}function handleError(_0x46e747,_0x5d93b9){_0x5d93b9=_0x5d93b9||0x1f4;return function(_0x4273de){logger[_0x319c('0x27')](_0x4273de[_0x319c('0x28')]);if(_0x4273de[_0x319c('0x29')]){delete _0x4273de[_0x319c('0x29')];}_0x46e747[_0x319c('0x1b')](_0x5d93b9)[_0x319c('0x2a')](_0x4273de);};}exports[_0x319c('0x2b')]=function(_0x363362,_0x5cf5de){var _0x2a7421={'raw':!![],'where':{'id':_0x363362[_0x319c('0x2c')]['id']}},_0x2591c6={};_0x2591c6[_0x319c('0x2d')]=_[_0x319c('0x2e')](db[_0x319c('0x2f')][_0x319c('0x30')]);_0x2591c6[_0x319c('0x31')]=_[_0x319c('0x2e')](_0x363362['query']);_0x2591c6[_0x319c('0x32')]=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],_0x2591c6[_0x319c('0x31')]);_0x2a7421['attributes']=_[_0x319c('0x33')](_0x2591c6[_0x319c('0x2d')],qs[_0x319c('0x34')](_0x363362['query'][_0x319c('0x34')]));_0x2a7421['attributes']=_0x2a7421[_0x319c('0x35')]['length']?_0x2a7421[_0x319c('0x35')]:_0x2591c6[_0x319c('0x2d')];if(_0x363362[_0x319c('0x31')]['includeAll']){_0x2a7421[_0x319c('0x36')]=[{'all':!![]}];}_0x2a7421=_[_0x319c('0x37')]({},_0x2a7421,_0x363362['options']);return db[_0x319c('0x2f')][_0x319c('0x38')](_0x2a7421)[_0x319c('0x25')](handleEntityNotFound(_0x5cf5de,null))[_0x319c('0x25')](respondWithResult(_0x5cf5de,null))[_0x319c('0x39')](handleError(_0x5cf5de,null));};exports['update']=function(_0x9c47df,_0x220a8c){if(_0x9c47df[_0x319c('0x3a')]['id']){delete _0x9c47df[_0x319c('0x3a')]['id'];}return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x9c47df[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x220a8c,null))[_0x319c('0x25')](saveUpdates(_0x9c47df['body'],null))[_0x319c('0x25')](respondWithResult(_0x220a8c,null))[_0x319c('0x39')](handleError(_0x220a8c,null));};exports[_0x319c('0x26')]=function(_0x176d3f,_0x5b280e){return db[_0x319c('0x2f')][_0x319c('0x38')]({'where':{'id':_0x176d3f[_0x319c('0x2c')]['id']}})[_0x319c('0x25')](handleEntityNotFound(_0x5b280e,null))[_0x319c('0x25')](removeEntity(_0x5b280e,null))[_0x319c('0x39')](handleError(_0x5b280e,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 98d303f..27b412b 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 _0x3021=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger'];(function(_0x105ffd,_0x238299){var _0x1f8870=function(_0x1aecc7){while(--_0x1aecc7){_0x105ffd['push'](_0x105ffd['shift']());}};_0x1f8870(++_0x238299);}(_0x3021,0x1b0));var _0x1302=function(_0xfa5998,_0x4dcec4){_0xfa5998=_0xfa5998-0x0;var _0x55bddd=_0x3021[_0xfa5998];return _0x55bddd;};'use strict';var _=require(_0x1302('0x0'));var util=require('util');var logger=require(_0x1302('0x1'))('api');var moment=require(_0x1302('0x2'));var BPromise=require(_0x1302('0x3'));var rp=require(_0x1302('0x4'));var fs=require('fs');var path=require(_0x1302('0x5'));var rimraf=require(_0x1302('0x6'));var config=require(_0x1302('0x7'));var attributes=require(_0x1302('0x8'));module[_0x1302('0x9')]=function(_0x2bd488,_0x43890d){return _0x2bd488[_0x1302('0xa')](_0x1302('0xb'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1302('0xc'),'collate':_0x1302('0xd')});};
\ No newline at end of file
+var _0xef28=['./chatApplication.attributes','define','ChatApplication','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xef28,0x71));var _0x8ef2=function(_0xf7077d,_0x309ea1){_0xf7077d=_0xf7077d-0x0;var _0x19ff53=_0xef28[_0xf7077d];return _0x19ff53;};'use strict';var _=require(_0x8ef2('0x0'));var util=require(_0x8ef2('0x1'));var logger=require(_0x8ef2('0x2'))(_0x8ef2('0x3'));var moment=require(_0x8ef2('0x4'));var BPromise=require(_0x8ef2('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8ef2('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x8ef2('0x7'));module['exports']=function(_0x354662,_0x61b5ee){return _0x354662[_0x8ef2('0x8')](_0x8ef2('0x9'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 500641f..813f9bf 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 _0x3873=['request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','error','code','message','info','result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','http'];(function(_0x5a0f8a,_0x374487){var _0x1a9380=function(_0x783ef1){while(--_0x783ef1){_0x5a0f8a['push'](_0x5a0f8a['shift']());}};_0x1a9380(++_0x374487);}(_0x3873,0x161));var _0x3387=function(_0xda0921,_0x11bd63){_0xda0921=_0xda0921-0x0;var _0xf871d9=_0x3873[_0xda0921];return _0xf871d9;};'use strict';var _=require(_0x3387('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3387('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3387('0x2'));var db=require(_0x3387('0x3'))['db'];var utils=require(_0x3387('0x4'));var logger=require('../../config/logger')(_0x3387('0x5'));var config=require(_0x3387('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3387('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15a2db,_0x47a783,_0x3deb52){return new BPromise(function(_0x5b4d31,_0x2e4f07){return client[_0x3387('0x8')](_0x15a2db,_0x3deb52)[_0x3387('0x9')](function(_0x4796d0){logger['info'](_0x3387('0xa'),_0x47a783,_0x3387('0xb'));logger[_0x3387('0xc')](_0x3387('0xd'),_0x47a783,_0x3387('0xb'),JSON['stringify'](_0x4796d0));if(_0x4796d0['error']){if(_0x4796d0[_0x3387('0xe')][_0x3387('0xf')]===0x1f4){logger['error'](_0x3387('0xa'),_0x47a783,_0x4796d0[_0x3387('0xe')][_0x3387('0x10')]);return _0x2e4f07(_0x4796d0[_0x3387('0xe')][_0x3387('0x10')]);}logger[_0x3387('0xe')](_0x3387('0xa'),_0x47a783,_0x4796d0[_0x3387('0xe')]['message']);return _0x5b4d31(_0x4796d0[_0x3387('0xe')]['message']);}else{logger[_0x3387('0x11')](_0x3387('0xa'),_0x47a783,_0x3387('0xb'));_0x5b4d31(_0x4796d0[_0x3387('0x12')][_0x3387('0x10')]);}})['catch'](function(_0x50e589){logger[_0x3387('0xe')]('ChatApplication,\x20%s,\x20%s',_0x47a783,_0x50e589);_0x2e4f07(_0x50e589);});});}
\ No newline at end of file
+var _0xbfbb=['ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xbfbb,0x1d7));var _0xbbfb=function(_0x43fbdb,_0x2bfc6e){_0x43fbdb=_0x43fbdb-0x0;var _0x3b6ab8=_0xbfbb[_0x43fbdb];return _0x3b6ab8;};'use strict';var _=require(_0xbbfb('0x0'));var util=require(_0xbbfb('0x1'));var moment=require('moment');var BPromise=require(_0xbbfb('0x2'));var rs=require(_0xbbfb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbbfb('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xbbfb('0x5'))(_0xbbfb('0x6'));var config=require(_0xbbfb('0x7'));var jayson=require(_0xbbfb('0x8'));var client=jayson[_0xbbfb('0x9')][_0xbbfb('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38f91a,_0x329b85,_0x30bd77){return new BPromise(function(_0x4e8da5,_0x233431){return client['request'](_0x38f91a,_0x30bd77)[_0xbbfb('0xb')](function(_0x26c49e){logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));logger[_0xbbfb('0xe')](_0xbbfb('0xf'),_0x329b85,_0xbbfb('0xd'),JSON[_0xbbfb('0x10')](_0x26c49e));if(_0x26c49e[_0xbbfb('0x11')]){if(_0x26c49e['error']['code']===0x1f4){logger['error'](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x233431(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);return _0x4e8da5(_0x26c49e[_0xbbfb('0x11')][_0xbbfb('0x12')]);}else{logger['info'](_0xbbfb('0xc'),_0x329b85,_0xbbfb('0xd'));_0x4e8da5(_0x26c49e[_0xbbfb('0x13')][_0xbbfb('0x12')]);}})[_0xbbfb('0x14')](function(_0x54a1f8){logger[_0xbbfb('0x11')](_0xbbfb('0xc'),_0x329b85,_0x54a1f8);_0x233431(_0x54a1f8);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 0d3e2b3..a04092f 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 _0x5aca=['show','put','isAuthenticated','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x5aca,0xc5));var _0xa5ac=function(_0x507dcd,_0x2ecaeb){_0x507dcd=_0x507dcd-0x0;var _0x35bc5f=_0x5aca[_0x507dcd];return _0x35bc5f;};'use strict';var multer=require(_0xa5ac('0x0'));var util=require(_0xa5ac('0x1'));var path=require(_0xa5ac('0x2'));var timeout=require(_0xa5ac('0x3'));var express=require(_0xa5ac('0x4'));var router=express[_0xa5ac('0x5')]();var fs_extra=require(_0xa5ac('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa5ac('0x7'));var config=require(_0xa5ac('0x8'));var controller=require(_0xa5ac('0x9'));router[_0xa5ac('0xa')](_0xa5ac('0xb'),auth['isAuthenticated'](),controller[_0xa5ac('0xc')]);router[_0xa5ac('0xd')](_0xa5ac('0xb'),auth[_0xa5ac('0xe')](),controller[_0xa5ac('0xf')]);router[_0xa5ac('0x10')](_0xa5ac('0xb'),auth['isAuthenticated'](),controller[_0xa5ac('0x11')]);module[_0xa5ac('0x12')]=router;
\ No newline at end of file
+var _0x871d=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','put','/:id','update','delete','destroy'];(function(_0x541cf4,_0x38ea3c){var _0x2093ec=function(_0x5bd8d7){while(--_0x5bd8d7){_0x541cf4['push'](_0x541cf4['shift']());}};_0x2093ec(++_0x38ea3c);}(_0x871d,0x187));var _0xd871=function(_0x38f771,_0x4587dd){_0x38f771=_0x38f771-0x0;var _0x2c562c=_0x871d[_0x38f771];return _0x2c562c;};'use strict';var multer=require(_0xd871('0x0'));var util=require('util');var path=require(_0xd871('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xd871('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xd871('0x3'));var interaction=require(_0xd871('0x4'));var config=require(_0xd871('0x5'));var controller=require('./chatApplication.controller');router[_0xd871('0x6')]('/:id',auth[_0xd871('0x7')](),controller[_0xd871('0x8')]);router[_0xd871('0x9')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xb')]);router[_0xd871('0xc')](_0xd871('0xa'),auth[_0xd871('0x7')](),controller[_0xd871('0xd')]);module[_0xd871('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 281a610..96c2647 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 _0xac73=['STRING','BOOLEAN','sequelize','exports'];(function(_0x3161b5,_0x42dc8a){var _0x2adf35=function(_0x14ce40){while(--_0x14ce40){_0x3161b5['push'](_0x3161b5['shift']());}};_0x2adf35(++_0x42dc8a);}(_0xac73,0x186));var _0x3ac7=function(_0x41dcd7,_0x467c87){_0x41dcd7=_0x41dcd7-0x0;var _0x1b315d=_0xac73[_0x41dcd7];return _0x1b315d;};'use strict';var Sequelize=require(_0x3ac7('0x0'));module[_0x3ac7('0x1')]={'name':{'type':Sequelize[_0x3ac7('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ac7('0x2')]},'write':{'type':Sequelize[_0x3ac7('0x3')],'defaultValue':!![]}};
\ No newline at end of file
+var _0x2542=['STRING','sequelize','exports'];(function(_0x199bdf,_0x3daaf6){var _0x287fdc=function(_0x36b976){while(--_0x36b976){_0x199bdf['push'](_0x199bdf['shift']());}};_0x287fdc(++_0x3daaf6);}(_0x2542,0x169));var _0x2254=function(_0x10353c,_0x162dac){_0x10353c=_0x10353c-0x0;var _0x20300e=_0x2542[_0x10353c];return _0x20300e;};'use strict';var Sequelize=require(_0x2254('0x0'));module[_0x2254('0x1')]={'name':{'type':Sequelize[_0x2254('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x2254('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index c8e17c9..c06e754 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 _0x5b6c=['reject','save','destroy','then','status','end','stack','name','map','ChatGroup','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','update','describe','ChatInternalMessage','toInteger','addMembers','omit','ids','findOne','order','getMembers','removeMembers','addMessage','ChatGroupId','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','sendStatus','json','undefined','count','offset','limit','set','Content-Range','apply'];(function(_0x3b25e3,_0x368a15){var _0x2eaf8c=function(_0x33d731){while(--_0x33d731){_0x3b25e3['push'](_0x3b25e3['shift']());}};_0x2eaf8c(++_0x368a15);}(_0x5b6c,0x153));var _0xc5b6=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0x5b6c[_0x101e7b];return _0x4995c0;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc5b6('0x0'));var zipdir=require(_0xc5b6('0x1'));var jsonpatch=require(_0xc5b6('0x2'));var rp=require(_0xc5b6('0x3'));var moment=require(_0xc5b6('0x4'));var BPromise=require(_0xc5b6('0x5'));var Mustache=require(_0xc5b6('0x6'));var util=require(_0xc5b6('0x7'));var path=require('path');var sox=require(_0xc5b6('0x8'));var csv=require(_0xc5b6('0x9'));var ejs=require(_0xc5b6('0xa'));var fs=require('fs');var fs_extra=require(_0xc5b6('0xb'));var _=require(_0xc5b6('0xc'));var squel=require('squel');var crypto=require(_0xc5b6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc5b6('0x9'));var querystring=require(_0xc5b6('0xe'));var Papa=require(_0xc5b6('0xf'));var Redis=require(_0xc5b6('0x10'));var authService=require(_0xc5b6('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5b6('0x12'));var logger=require(_0xc5b6('0x13'))(_0xc5b6('0x14'));var utils=require('../../config/utils');var config=require(_0xc5b6('0x15'));var licenseUtil=require(_0xc5b6('0x16'));var db=require(_0xc5b6('0x17'))['db'];config[_0xc5b6('0x18')]=_[_0xc5b6('0x19')](config[_0xc5b6('0x18')],{'host':_0xc5b6('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatGroup.socket')[_0xc5b6('0x1b')](socket);function respondWithStatusCode(_0x2a4679,_0x2070e1){_0x2070e1=_0x2070e1||0xcc;return function(_0x5c4bdd){if(_0x5c4bdd){return _0x2a4679[_0xc5b6('0x1c')](_0x2070e1);}return _0x2a4679['status'](_0x2070e1)['end']();};}function respondWithResult(_0xb4af,_0x421c07){_0x421c07=_0x421c07||0xc8;return function(_0x2a85f2){if(_0x2a85f2){return _0xb4af['status'](_0x421c07)[_0xc5b6('0x1d')](_0x2a85f2);}};}function respondWithFilteredResult(_0x358b2f,_0x25c732){return function(_0x6c147c){if(_0x6c147c){var _0x269889=typeof _0x25c732['offset']===_0xc5b6('0x1e')&&typeof _0x25c732['limit']===_0xc5b6('0x1e');var _0x763f89=_0x6c147c[_0xc5b6('0x1f')];var _0x283974=_0x269889?0x0:_0x25c732[_0xc5b6('0x20')];var _0x143fc7=_0x269889?_0x6c147c[_0xc5b6('0x1f')]:_0x25c732[_0xc5b6('0x20')]+_0x25c732[_0xc5b6('0x21')];var _0x3b587e;if(_0x143fc7>=_0x763f89){_0x143fc7=_0x763f89;_0x3b587e=0xc8;}else{_0x3b587e=0xce;}_0x358b2f['status'](_0x3b587e);return _0x358b2f[_0xc5b6('0x22')](_0xc5b6('0x23'),_0x283974+'-'+_0x143fc7+'/'+_0x763f89)[_0xc5b6('0x1d')](_0x6c147c);}return null;};}function patchUpdates(_0x37ae51){return function(_0x14d45b){try{jsonpatch[_0xc5b6('0x24')](_0x14d45b,_0x37ae51,!![]);}catch(_0x18192e){return BPromise[_0xc5b6('0x25')](_0x18192e);}return _0x14d45b[_0xc5b6('0x26')]();};}function saveUpdates(_0x411d1f,_0x5e087a){return function(_0x3af8fd){if(_0x3af8fd){return _0x3af8fd['update'](_0x411d1f)['then'](function(_0x2d0d00){return _0x2d0d00;});}return null;};}function removeEntity(_0x3b0cca,_0x5bfa7b){return function(_0xc93bf4){if(_0xc93bf4){return _0xc93bf4[_0xc5b6('0x27')]()[_0xc5b6('0x28')](function(){_0x3b0cca[_0xc5b6('0x29')](0xcc)[_0xc5b6('0x2a')]();});}};}function handleEntityNotFound(_0x554ee6,_0x3e6385){return function(_0x530ae4){if(!_0x530ae4){_0x554ee6[_0xc5b6('0x1c')](0x194);}return _0x530ae4;};}function handleError(_0x358531,_0x1071fd){_0x1071fd=_0x1071fd||0x1f4;return function(_0x394130){logger['error'](_0x394130[_0xc5b6('0x2b')]);if(_0x394130[_0xc5b6('0x2c')]){delete _0x394130[_0xc5b6('0x2c')];}_0x358531[_0xc5b6('0x29')](_0x1071fd)['send'](_0x394130);};}exports['index']=function(_0x4408cc,_0x3a0e40){var _0x43a2c2={},_0x4d3698={},_0x59e953={'count':0x0,'rows':[]};var _0x56c50b=_[_0xc5b6('0x2d')](db[_0xc5b6('0x2e')]['rawAttributes'],function(_0x1e0374){return{'name':_0x1e0374[_0xc5b6('0x2f')],'type':_0x1e0374[_0xc5b6('0x30')]['key']};});_0x4d3698[_0xc5b6('0x31')]=_['map'](_0x56c50b,'name');_0x4d3698['query']=_[_0xc5b6('0x32')](_0x4408cc[_0xc5b6('0x33')]);_0x4d3698[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x4d3698[_0xc5b6('0x31')],_0x4d3698[_0xc5b6('0x33')]);_0x43a2c2[_0xc5b6('0x36')]=_[_0xc5b6('0x35')](_0x4d3698[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0x4408cc['query'][_0xc5b6('0x37')]));_0x43a2c2[_0xc5b6('0x36')]=_0x43a2c2['attributes'][_0xc5b6('0x38')]?_0x43a2c2['attributes']:_0x4d3698['model'];if(!_0x4408cc['query'][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x43a2c2[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x21')]);_0x43a2c2[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x20')]);}_0x43a2c2['order']=qs[_0xc5b6('0x3b')](_0x4408cc['query'][_0xc5b6('0x3b')]);_0x43a2c2[_0xc5b6('0x3c')]=qs[_0xc5b6('0x34')](_[_0xc5b6('0x3d')](_0x4408cc[_0xc5b6('0x33')],_0x4d3698['filters']),_0x56c50b);if(_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x43a2c2[_0xc5b6('0x3c')]=_[_0xc5b6('0x3f')](_0x43a2c2[_0xc5b6('0x3c')],{'$or':_['map'](_0x56c50b,function(_0x59a30a){if(_0x59a30a[_0xc5b6('0x30')]!==_0xc5b6('0x40')){var _0x477b4e={};_0x477b4e[_0x59a30a[_0xc5b6('0x2c')]]={'$like':'%'+_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x3e')]+'%'};return _0x477b4e;}})});}_0x43a2c2=_['merge']({},_0x43a2c2,_0x4408cc[_0xc5b6('0x41')]);var _0x561346={'where':_0x43a2c2[_0xc5b6('0x3c')]};return db['ChatGroup'][_0xc5b6('0x1f')](_0x561346)[_0xc5b6('0x28')](function(_0x19a726){_0x59e953[_0xc5b6('0x1f')]=_0x19a726;if(_0x4408cc[_0xc5b6('0x33')][_0xc5b6('0x42')]){_0x43a2c2[_0xc5b6('0x43')]=[{'all':!![]}];}return db[_0xc5b6('0x2e')][_0xc5b6('0x44')](_0x43a2c2);})[_0xc5b6('0x28')](function(_0x18d3f5){_0x59e953[_0xc5b6('0x45')]=_0x18d3f5;return _0x59e953;})['then'](respondWithFilteredResult(_0x3a0e40,_0x43a2c2))[_0xc5b6('0x46')](handleError(_0x3a0e40,null));};exports[_0xc5b6('0x47')]=function(_0x1283ff,_0x46448a){var _0x538ac8={'raw':!![],'where':{'id':_0x1283ff[_0xc5b6('0x48')]['id']}},_0x597670={};_0x597670[_0xc5b6('0x31')]=_[_0xc5b6('0x32')](db['ChatGroup'][_0xc5b6('0x49')]);_0x597670[_0xc5b6('0x33')]=_[_0xc5b6('0x32')](_0x1283ff['query']);_0x597670[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x597670[_0xc5b6('0x31')],_0x597670[_0xc5b6('0x33')]);_0x538ac8[_0xc5b6('0x36')]=_[_0xc5b6('0x35')](_0x597670[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0x1283ff['query'][_0xc5b6('0x37')]));_0x538ac8['attributes']=_0x538ac8['attributes'][_0xc5b6('0x38')]?_0x538ac8[_0xc5b6('0x36')]:_0x597670[_0xc5b6('0x31')];if(_0x1283ff['query']['includeAll']){_0x538ac8[_0xc5b6('0x43')]=[{'all':!![]}];}_0x538ac8=_[_0xc5b6('0x3f')]({},_0x538ac8,_0x1283ff['options']);return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')](_0x538ac8)['then'](handleEntityNotFound(_0x46448a,null))[_0xc5b6('0x28')](respondWithResult(_0x46448a,null))[_0xc5b6('0x46')](handleError(_0x46448a,null));};exports[_0xc5b6('0x4b')]=function(_0x596b24,_0x206076){return db[_0xc5b6('0x2e')][_0xc5b6('0x4b')](_0x596b24[_0xc5b6('0x4c')],{})[_0xc5b6('0x28')](respondWithResult(_0x206076,0xc9))[_0xc5b6('0x46')](handleError(_0x206076,null));};exports[_0xc5b6('0x4d')]=function(_0x22708d,_0x184e0d){if(_0x22708d[_0xc5b6('0x4c')]['id']){delete _0x22708d['body']['id'];}return db[_0xc5b6('0x2e')]['find']({'where':{'id':_0x22708d[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x184e0d,null))['then'](saveUpdates(_0x22708d[_0xc5b6('0x4c')],null))[_0xc5b6('0x28')](respondWithResult(_0x184e0d,null))['catch'](handleError(_0x184e0d,null));};exports[_0xc5b6('0x27')]=function(_0x380d90,_0x320e7e){return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')]({'where':{'id':_0x380d90[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x320e7e,null))['then'](removeEntity(_0x320e7e,null))[_0xc5b6('0x46')](handleError(_0x320e7e,null));};exports[_0xc5b6('0x4e')]=function(_0xd51042,_0x33da35){return db[_0xc5b6('0x2e')][_0xc5b6('0x4e')]()[_0xc5b6('0x28')](respondWithResult(_0x33da35,null))['catch'](handleError(_0x33da35,null));};exports['getUnread']=function(_0x3af80e,_0x3748ff,_0x4acab9){return db[_0xc5b6('0x4f')]['count']({'where':{'ChatGroupId':_0x3af80e[_0xc5b6('0x48')]['id'],'ToId':_0x3af80e['user']['id'],'read':![]}})[_0xc5b6('0x28')](function(_0x1e80bf){return{'id':_[_0xc5b6('0x50')](_0x3af80e[_0xc5b6('0x48')]['id']),'count':_0x1e80bf};})['then'](respondWithResult(_0x3748ff,null))[_0xc5b6('0x46')](handleError(_0x3748ff,null));};exports['addMembers']=function(_0x572741,_0x402d38,_0x59ba82){return db[_0xc5b6('0x2e')]['find']({'where':{'id':_0x572741[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x402d38,null))[_0xc5b6('0x28')](function(_0x32df4d){if(_0x32df4d){return _0x32df4d[_0xc5b6('0x51')](_0x572741[_0xc5b6('0x4c')]['ids'],_[_0xc5b6('0x52')](_0x572741[_0xc5b6('0x4c')],[_0xc5b6('0x53'),'id'])||{});}})[_0xc5b6('0x28')](respondWithResult(_0x402d38,null))['catch'](handleError(_0x402d38,null));};exports['getMembers']=function(_0xc2f9eb,_0x13b829,_0x1dd324){var _0x284521={};var _0x32e062={};var _0xc56d86;var _0x4d9261;return db[_0xc5b6('0x2e')][_0xc5b6('0x54')]({'where':{'id':_0xc2f9eb['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x13b829,null))['then'](function(_0x5b0b49){if(_0x5b0b49){_0xc56d86=_0x5b0b49;_0x32e062[_0xc5b6('0x31')]=_[_0xc5b6('0x32')](db['User'][_0xc5b6('0x49')]);_0x32e062['query']=_[_0xc5b6('0x32')](_0xc2f9eb['query']);_0x32e062[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x32e062[_0xc5b6('0x31')],_0x32e062[_0xc5b6('0x33')]);_0x284521['attributes']=_[_0xc5b6('0x35')](_0x32e062[_0xc5b6('0x31')],qs[_0xc5b6('0x37')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x37')]));_0x284521[_0xc5b6('0x36')]=_0x284521['attributes'][_0xc5b6('0x38')]?_0x284521[_0xc5b6('0x36')]:_0x32e062[_0xc5b6('0x31')];_0x284521[_0xc5b6('0x55')]=qs[_0xc5b6('0x3b')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x3b')]);_0x284521[_0xc5b6('0x3c')]=qs['filters'](_[_0xc5b6('0x3d')](_0xc2f9eb[_0xc5b6('0x33')],_0x32e062[_0xc5b6('0x34')]));if(_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x284521[_0xc5b6('0x3c')]=_['merge'](_0x284521[_0xc5b6('0x3c')],{'$or':_[_0xc5b6('0x2d')](_0x284521[_0xc5b6('0x36')],function(_0x44696d){var _0x47b404={};_0x47b404[_0x44696d]={'$like':'%'+_0xc2f9eb[_0xc5b6('0x33')]['filter']+'%'};return _0x47b404;})});}_0x284521=_[_0xc5b6('0x3f')]({},_0x284521,_0xc2f9eb[_0xc5b6('0x41')]);return _0xc56d86[_0xc5b6('0x56')](_0x284521);}})[_0xc5b6('0x28')](function(_0x17e899){if(_0x17e899){_0x4d9261=_0x17e899[_0xc5b6('0x38')];if(!_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x284521[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0xc2f9eb['query']['limit']);_0x284521['offset']=qs[_0xc5b6('0x20')](_0xc2f9eb[_0xc5b6('0x33')][_0xc5b6('0x20')]);}return _0xc56d86['getMembers'](_0x284521);}})[_0xc5b6('0x28')](function(_0x5b44d6){if(_0x5b44d6){return _0x5b44d6?{'count':_0x4d9261,'rows':_0x5b44d6}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x13b829,null))[_0xc5b6('0x46')](handleError(_0x13b829,null));};exports[_0xc5b6('0x57')]=function(_0x2d613f,_0x1e97e7,_0x458927){return db['ChatGroup'][_0xc5b6('0x4a')]({'where':{'id':_0x2d613f[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x1e97e7,null))['then'](function(_0x2b252b){if(_0x2b252b){return _0x2b252b[_0xc5b6('0x57')](_0x2d613f['query'][_0xc5b6('0x53')]);}})[_0xc5b6('0x28')](respondWithStatusCode(_0x1e97e7,null))[_0xc5b6('0x46')](handleError(_0x1e97e7,null));};exports[_0xc5b6('0x58')]=function(_0x5fe27b,_0xa156ad,_0x1bce1b){if(_0x5fe27b['body']['id']){delete _0x5fe27b[_0xc5b6('0x4c')]['id'];}return db[_0xc5b6('0x2e')][_0xc5b6('0x4a')]({'where':{'id':_0x5fe27b[_0xc5b6('0x48')]['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0xa156ad,null))[_0xc5b6('0x28')](function(_0x4324a6){if(_0x4324a6){_0x5fe27b['body'][_0xc5b6('0x59')]=_0x4324a6['id'];return db[_0xc5b6('0x4f')][_0xc5b6('0x4b')](_0x5fe27b[_0xc5b6('0x4c')]);}})['then'](respondWithResult(_0xa156ad,null))[_0xc5b6('0x46')](handleError(_0xa156ad,null));};exports[_0xc5b6('0x5a')]=function(_0x57db29,_0x559ffd,_0x259398){var _0x5e7166={};var _0x2fe4bb={};var _0x28f370;var _0x24bde5;return db[_0xc5b6('0x2e')][_0xc5b6('0x54')]({'where':{'id':_0x57db29['params']['id']}})[_0xc5b6('0x28')](handleEntityNotFound(_0x559ffd,null))[_0xc5b6('0x28')](function(_0x2e2821){if(_0x2e2821){_0x28f370=_0x2e2821;_0x2fe4bb['model']=_[_0xc5b6('0x32')](db[_0xc5b6('0x4f')][_0xc5b6('0x49')]);_0x2fe4bb[_0xc5b6('0x33')]=_[_0xc5b6('0x32')](_0x57db29['query']);_0x2fe4bb[_0xc5b6('0x34')]=_[_0xc5b6('0x35')](_0x2fe4bb[_0xc5b6('0x31')],_0x2fe4bb[_0xc5b6('0x33')]);_0x5e7166['attributes']=_[_0xc5b6('0x35')](_0x2fe4bb['model'],qs[_0xc5b6('0x37')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x37')]));_0x5e7166[_0xc5b6('0x36')]=_0x5e7166['attributes'][_0xc5b6('0x38')]?_0x5e7166[_0xc5b6('0x36')]:_0x2fe4bb[_0xc5b6('0x31')];_0x5e7166[_0xc5b6('0x55')]=qs[_0xc5b6('0x3b')](_0x57db29[_0xc5b6('0x33')]['sort']);_0x5e7166['where']=qs['filters'](_[_0xc5b6('0x3d')](_0x57db29['query'],_0x2fe4bb['filters']));if(_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x3e')]){_0x5e7166[_0xc5b6('0x3c')]=_[_0xc5b6('0x3f')](_0x5e7166[_0xc5b6('0x3c')],{'$or':_['map'](_0x5e7166[_0xc5b6('0x36')],function(_0x71cf6e){var _0x39c4fd={};_0x39c4fd[_0x71cf6e]={'$like':'%'+_0x57db29['query'][_0xc5b6('0x3e')]+'%'};return _0x39c4fd;})});}if(_0x57db29[_0xc5b6('0x33')]['$gte']){var _0x1c9374=_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x5b')]['split'](',');var _0xac4a2b={};_0xac4a2b[_0x1c9374[0x0]]={'$gte':moment(_0x1c9374[0x1])[_0xc5b6('0x5c')](_0xc5b6('0x5d'))};_0x5e7166[_0xc5b6('0x3c')]=_['merge'](_0x5e7166[_0xc5b6('0x3c')],_0xac4a2b);}_0x5e7166=_[_0xc5b6('0x3f')]({},_0x5e7166,_0x57db29['options']);return _0x28f370[_0xc5b6('0x5a')](_0x5e7166);}})[_0xc5b6('0x28')](function(_0x578a50){if(_0x578a50){_0x24bde5=_0x578a50[_0xc5b6('0x38')];if(!_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x39')](_0xc5b6('0x3a'))){_0x5e7166[_0xc5b6('0x21')]=qs[_0xc5b6('0x21')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x21')]);_0x5e7166[_0xc5b6('0x20')]=qs[_0xc5b6('0x20')](_0x57db29[_0xc5b6('0x33')][_0xc5b6('0x20')]);}return _0x28f370[_0xc5b6('0x5a')](_0x5e7166);}})['then'](function(_0x22376a){if(_0x22376a){return _0x22376a?{'count':_0x24bde5,'rows':_0x22376a}:null;}})[_0xc5b6('0x28')](respondWithResult(_0x559ffd,null))['catch'](handleError(_0x559ffd,null));};
\ No newline at end of file
+var _0x25b4=['VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','find','create','body','params','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','getMessages','pick','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','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','redis','defaults','localhost','socket.io-emitter','status','end','json','undefined','limit','count','offset','set','save','then','destroy','sendStatus','error','stack','name','send','index','map','ChatGroup','rawAttributes','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','filter','where'];(function(_0x350bd9,_0x7ee684){var _0x460756=function(_0x564516){while(--_0x564516){_0x350bd9['push'](_0x350bd9['shift']());}};_0x460756(++_0x7ee684);}(_0x25b4,0xe0));var _0x425b=function(_0x3c59fc,_0x10dbd2){_0x3c59fc=_0x3c59fc-0x0;var _0x2b78d4=_0x25b4[_0x3c59fc];return _0x2b78d4;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x425b('0x0'));var zipdir=require(_0x425b('0x1'));var jsonpatch=require(_0x425b('0x2'));var rp=require(_0x425b('0x3'));var moment=require('moment');var BPromise=require(_0x425b('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x425b('0x5'));var sox=require(_0x425b('0x6'));var csv=require(_0x425b('0x7'));var ejs=require(_0x425b('0x8'));var fs=require('fs');var fs_extra=require(_0x425b('0x9'));var _=require(_0x425b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x425b('0xb'));var deskjs=require(_0x425b('0xc'));var toCsv=require('to-csv');var querystring=require(_0x425b('0xd'));var Papa=require(_0x425b('0xe'));var Redis=require(_0x425b('0xf'));var authService=require(_0x425b('0x10'));var qs=require(_0x425b('0x11'));var as=require(_0x425b('0x12'));var hardwareService=require(_0x425b('0x13'));var logger=require(_0x425b('0x14'))('api');var utils=require(_0x425b('0x15'));var config=require(_0x425b('0x16'));var licenseUtil=require(_0x425b('0x17'));var db=require(_0x425b('0x18'))['db'];config[_0x425b('0x19')]=_[_0x425b('0x1a')](config[_0x425b('0x19')],{'host':_0x425b('0x1b'),'port':0x18eb});var socket=require(_0x425b('0x1c'))(new Redis(config[_0x425b('0x19')]));require('./chatGroup.socket')['register'](socket);function respondWithStatusCode(_0x3fec83,_0x3b811a){_0x3b811a=_0x3b811a||0xcc;return function(_0x1d020d){if(_0x1d020d){return _0x3fec83['sendStatus'](_0x3b811a);}return _0x3fec83[_0x425b('0x1d')](_0x3b811a)[_0x425b('0x1e')]();};}function respondWithResult(_0xc83b96,_0x56a434){_0x56a434=_0x56a434||0xc8;return function(_0xf237a9){if(_0xf237a9){return _0xc83b96['status'](_0x56a434)[_0x425b('0x1f')](_0xf237a9);}};}function respondWithFilteredResult(_0x15c07f,_0x37c80d){return function(_0x46d1dc){if(_0x46d1dc){var _0x3f81b4=typeof _0x37c80d['offset']===_0x425b('0x20')&&typeof _0x37c80d[_0x425b('0x21')]===_0x425b('0x20');var _0x403b58=_0x46d1dc[_0x425b('0x22')];var _0x1f993c=_0x3f81b4?0x0:_0x37c80d[_0x425b('0x23')];var _0xa6008b=_0x3f81b4?_0x46d1dc['count']:_0x37c80d['offset']+_0x37c80d[_0x425b('0x21')];var _0x124784;if(_0xa6008b>=_0x403b58){_0xa6008b=_0x403b58;_0x124784=0xc8;}else{_0x124784=0xce;}_0x15c07f[_0x425b('0x1d')](_0x124784);return _0x15c07f[_0x425b('0x24')]('Content-Range',_0x1f993c+'-'+_0xa6008b+'/'+_0x403b58)[_0x425b('0x1f')](_0x46d1dc);}return null;};}function patchUpdates(_0x2efef0){return function(_0x3745dd){try{jsonpatch['apply'](_0x3745dd,_0x2efef0,!![]);}catch(_0x43d2a9){return BPromise['reject'](_0x43d2a9);}return _0x3745dd[_0x425b('0x25')]();};}function saveUpdates(_0x5842e9,_0x13ff96){return function(_0xceaeed){if(_0xceaeed){return _0xceaeed['update'](_0x5842e9)[_0x425b('0x26')](function(_0x559a24){return _0x559a24;});}return null;};}function removeEntity(_0x4656f2,_0x33d8b8){return function(_0x35cdcd){if(_0x35cdcd){return _0x35cdcd[_0x425b('0x27')]()[_0x425b('0x26')](function(){_0x4656f2[_0x425b('0x1d')](0xcc)[_0x425b('0x1e')]();});}};}function handleEntityNotFound(_0xab8ad0,_0xeb0120){return function(_0x420e4d){if(!_0x420e4d){_0xab8ad0[_0x425b('0x28')](0x194);}return _0x420e4d;};}function handleError(_0x393296,_0x20ae70){_0x20ae70=_0x20ae70||0x1f4;return function(_0x5cd58b){logger[_0x425b('0x29')](_0x5cd58b[_0x425b('0x2a')]);if(_0x5cd58b[_0x425b('0x2b')]){delete _0x5cd58b[_0x425b('0x2b')];}_0x393296[_0x425b('0x1d')](_0x20ae70)[_0x425b('0x2c')](_0x5cd58b);};}exports[_0x425b('0x2d')]=function(_0xdd2906,_0x3b1c03){var _0x1f53f1={},_0x5bb1d1={},_0x511697={'count':0x0,'rows':[]};var _0x3bc1df=_[_0x425b('0x2e')](db[_0x425b('0x2f')][_0x425b('0x30')],function(_0x511020){return{'name':_0x511020['fieldName'],'type':_0x511020[_0x425b('0x31')][_0x425b('0x32')]};});_0x5bb1d1['model']=_[_0x425b('0x2e')](_0x3bc1df,_0x425b('0x2b'));_0x5bb1d1['query']=_[_0x425b('0x33')](_0xdd2906[_0x425b('0x34')]);_0x5bb1d1[_0x425b('0x35')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],_0x5bb1d1[_0x425b('0x34')]);_0x1f53f1[_0x425b('0x38')]=_[_0x425b('0x36')](_0x5bb1d1[_0x425b('0x37')],qs[_0x425b('0x39')](_0xdd2906[_0x425b('0x34')][_0x425b('0x39')]));_0x1f53f1[_0x425b('0x38')]=_0x1f53f1[_0x425b('0x38')][_0x425b('0x3a')]?_0x1f53f1[_0x425b('0x38')]:_0x5bb1d1[_0x425b('0x37')];if(!_0xdd2906[_0x425b('0x34')][_0x425b('0x3b')]('nolimit')){_0x1f53f1['limit']=qs[_0x425b('0x21')](_0xdd2906[_0x425b('0x34')]['limit']);_0x1f53f1[_0x425b('0x23')]=qs['offset'](_0xdd2906[_0x425b('0x34')][_0x425b('0x23')]);}_0x1f53f1[_0x425b('0x3c')]=qs['sort'](_0xdd2906[_0x425b('0x34')][_0x425b('0x3d')]);_0x1f53f1['where']=qs[_0x425b('0x35')](_['pick'](_0xdd2906['query'],_0x5bb1d1[_0x425b('0x35')]),_0x3bc1df);if(_0xdd2906['query'][_0x425b('0x3e')]){_0x1f53f1[_0x425b('0x3f')]=_['merge'](_0x1f53f1[_0x425b('0x3f')],{'$or':_['map'](_0x3bc1df,function(_0x358e45){if(_0x358e45[_0x425b('0x31')]!==_0x425b('0x40')){var _0x24fbfa={};_0x24fbfa[_0x358e45[_0x425b('0x2b')]]={'$like':'%'+_0xdd2906['query'][_0x425b('0x3e')]+'%'};return _0x24fbfa;}})});}_0x1f53f1=_[_0x425b('0x41')]({},_0x1f53f1,_0xdd2906[_0x425b('0x42')]);var _0x52d478={'where':_0x1f53f1['where']};return db[_0x425b('0x2f')]['count'](_0x52d478)['then'](function(_0x4419c6){_0x511697['count']=_0x4419c6;if(_0xdd2906[_0x425b('0x34')][_0x425b('0x43')]){_0x1f53f1[_0x425b('0x44')]=[{'all':!![]}];}return db['ChatGroup'][_0x425b('0x45')](_0x1f53f1);})['then'](function(_0x8798fe){_0x511697[_0x425b('0x46')]=_0x8798fe;return _0x511697;})[_0x425b('0x26')](respondWithFilteredResult(_0x3b1c03,_0x1f53f1))[_0x425b('0x47')](handleError(_0x3b1c03,null));};exports[_0x425b('0x48')]=function(_0x4e9e91,_0x21bdfd){var _0x2cb9e3={'raw':!![],'where':{'id':_0x4e9e91['params']['id']}},_0x3ca7e8={};_0x3ca7e8[_0x425b('0x37')]=_[_0x425b('0x33')](db[_0x425b('0x2f')][_0x425b('0x30')]);_0x3ca7e8[_0x425b('0x34')]=_[_0x425b('0x33')](_0x4e9e91[_0x425b('0x34')]);_0x3ca7e8[_0x425b('0x35')]=_[_0x425b('0x36')](_0x3ca7e8['model'],_0x3ca7e8[_0x425b('0x34')]);_0x2cb9e3['attributes']=_[_0x425b('0x36')](_0x3ca7e8[_0x425b('0x37')],qs['fields'](_0x4e9e91[_0x425b('0x34')][_0x425b('0x39')]));_0x2cb9e3[_0x425b('0x38')]=_0x2cb9e3[_0x425b('0x38')][_0x425b('0x3a')]?_0x2cb9e3[_0x425b('0x38')]:_0x3ca7e8[_0x425b('0x37')];if(_0x4e9e91[_0x425b('0x34')][_0x425b('0x43')]){_0x2cb9e3[_0x425b('0x44')]=[{'all':!![]}];}_0x2cb9e3=_[_0x425b('0x41')]({},_0x2cb9e3,_0x4e9e91['options']);return db['ChatGroup'][_0x425b('0x49')](_0x2cb9e3)[_0x425b('0x26')](handleEntityNotFound(_0x21bdfd,null))['then'](respondWithResult(_0x21bdfd,null))['catch'](handleError(_0x21bdfd,null));};exports[_0x425b('0x4a')]=function(_0x3a9b70,_0x34ad34){return db[_0x425b('0x2f')][_0x425b('0x4a')](_0x3a9b70[_0x425b('0x4b')],{})['then'](respondWithResult(_0x34ad34,0xc9))[_0x425b('0x47')](handleError(_0x34ad34,null));};exports['update']=function(_0x1e9cc1,_0x347674){if(_0x1e9cc1['body']['id']){delete _0x1e9cc1[_0x425b('0x4b')]['id'];}return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x1e9cc1[_0x425b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x347674,null))['then'](saveUpdates(_0x1e9cc1['body'],null))[_0x425b('0x26')](respondWithResult(_0x347674,null))[_0x425b('0x47')](handleError(_0x347674,null));};exports[_0x425b('0x27')]=function(_0x58391b,_0x48859d){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x58391b[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x48859d,null))[_0x425b('0x26')](removeEntity(_0x48859d,null))[_0x425b('0x47')](handleError(_0x48859d,null));};exports[_0x425b('0x4d')]=function(_0x45693d,_0x586842){return db[_0x425b('0x2f')][_0x425b('0x4d')]()[_0x425b('0x26')](respondWithResult(_0x586842,null))['catch'](handleError(_0x586842,null));};exports[_0x425b('0x4e')]=function(_0x183e3a,_0x4348fe,_0x30fc77){return db[_0x425b('0x4f')][_0x425b('0x22')]({'where':{'ChatGroupId':_0x183e3a[_0x425b('0x4c')]['id'],'ToId':_0x183e3a[_0x425b('0x50')]['id'],'read':![]}})[_0x425b('0x26')](function(_0x1a9ad9){return{'id':_[_0x425b('0x51')](_0x183e3a[_0x425b('0x4c')]['id']),'count':_0x1a9ad9};})[_0x425b('0x26')](respondWithResult(_0x4348fe,null))[_0x425b('0x47')](handleError(_0x4348fe,null));};exports[_0x425b('0x52')]=function(_0x79075c,_0x296982,_0x5ac032){return db[_0x425b('0x2f')]['find']({'where':{'id':_0x79075c[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x296982,null))[_0x425b('0x26')](function(_0x1d2b8a){if(_0x1d2b8a){return _0x1d2b8a[_0x425b('0x52')](_0x79075c[_0x425b('0x4b')][_0x425b('0x53')],_['omit'](_0x79075c['body'],[_0x425b('0x53'),'id'])||{});}})[_0x425b('0x26')](respondWithResult(_0x296982,null))[_0x425b('0x47')](handleError(_0x296982,null));};exports[_0x425b('0x54')]=function(_0x42d8d6,_0x49dfbb,_0x201a41){var _0x141759={};var _0x537148={};var _0xacc558;var _0x5e0837;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x42d8d6[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x49dfbb,null))[_0x425b('0x26')](function(_0x365e79){if(_0x365e79){_0xacc558=_0x365e79;_0x537148['model']=_[_0x425b('0x33')](db[_0x425b('0x56')][_0x425b('0x30')]);_0x537148[_0x425b('0x34')]=_[_0x425b('0x33')](_0x42d8d6[_0x425b('0x34')]);_0x537148[_0x425b('0x35')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],_0x537148[_0x425b('0x34')]);_0x141759[_0x425b('0x38')]=_[_0x425b('0x36')](_0x537148[_0x425b('0x37')],qs[_0x425b('0x39')](_0x42d8d6['query'][_0x425b('0x39')]));_0x141759[_0x425b('0x38')]=_0x141759[_0x425b('0x38')][_0x425b('0x3a')]?_0x141759[_0x425b('0x38')]:_0x537148['model'];_0x141759['order']=qs[_0x425b('0x3d')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x3d')]);_0x141759[_0x425b('0x3f')]=qs[_0x425b('0x35')](_['pick'](_0x42d8d6[_0x425b('0x34')],_0x537148[_0x425b('0x35')]));if(_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]){_0x141759['where']=_['merge'](_0x141759['where'],{'$or':_['map'](_0x141759[_0x425b('0x38')],function(_0x37addc){var _0x1e6193={};_0x1e6193[_0x37addc]={'$like':'%'+_0x42d8d6[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x1e6193;})});}_0x141759=_['merge']({},_0x141759,_0x42d8d6['options']);return _0xacc558[_0x425b('0x54')](_0x141759);}})['then'](function(_0x16a93b){if(_0x16a93b){_0x5e0837=_0x16a93b[_0x425b('0x3a')];if(!_0x42d8d6[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x141759[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x21')]);_0x141759[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x42d8d6[_0x425b('0x34')][_0x425b('0x23')]);}return _0xacc558[_0x425b('0x54')](_0x141759);}})[_0x425b('0x26')](function(_0x4113d5){if(_0x4113d5){return _0x4113d5?{'count':_0x5e0837,'rows':_0x4113d5}:null;}})[_0x425b('0x26')](respondWithResult(_0x49dfbb,null))[_0x425b('0x47')](handleError(_0x49dfbb,null));};exports[_0x425b('0x58')]=function(_0x37d50e,_0x515060,_0x1ff2db){return db[_0x425b('0x2f')][_0x425b('0x49')]({'where':{'id':_0x37d50e[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x515060,null))['then'](function(_0x25fd63){if(_0x25fd63){return _0x25fd63[_0x425b('0x58')](_0x37d50e['query']['ids']);}})['then'](respondWithStatusCode(_0x515060,null))[_0x425b('0x47')](handleError(_0x515060,null));};exports[_0x425b('0x59')]=function(_0x4e5751,_0x12b617,_0x55dfcc){if(_0x4e5751[_0x425b('0x4b')]['id']){delete _0x4e5751[_0x425b('0x4b')]['id'];}return db['ChatGroup'][_0x425b('0x49')]({'where':{'id':_0x4e5751[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x12b617,null))[_0x425b('0x26')](function(_0x8c7b13){if(_0x8c7b13){_0x4e5751['body'][_0x425b('0x5a')]=_0x8c7b13['id'];return db['ChatInternalMessage'][_0x425b('0x4a')](_0x4e5751[_0x425b('0x4b')]);}})[_0x425b('0x26')](respondWithResult(_0x12b617,null))['catch'](handleError(_0x12b617,null));};exports[_0x425b('0x5b')]=function(_0x9458e0,_0x31ce02,_0x18772c){var _0x122b1f={};var _0xb35965={};var _0x1046e1;var _0x1a019f;return db[_0x425b('0x2f')][_0x425b('0x55')]({'where':{'id':_0x9458e0[_0x425b('0x4c')]['id']}})[_0x425b('0x26')](handleEntityNotFound(_0x31ce02,null))[_0x425b('0x26')](function(_0x50efb1){if(_0x50efb1){_0x1046e1=_0x50efb1;_0xb35965['model']=_['keys'](db[_0x425b('0x4f')][_0x425b('0x30')]);_0xb35965[_0x425b('0x34')]=_[_0x425b('0x33')](_0x9458e0[_0x425b('0x34')]);_0xb35965[_0x425b('0x35')]=_[_0x425b('0x36')](_0xb35965['model'],_0xb35965['query']);_0x122b1f['attributes']=_[_0x425b('0x36')](_0xb35965[_0x425b('0x37')],qs[_0x425b('0x39')](_0x9458e0['query']['fields']));_0x122b1f[_0x425b('0x38')]=_0x122b1f[_0x425b('0x38')][_0x425b('0x3a')]?_0x122b1f[_0x425b('0x38')]:_0xb35965[_0x425b('0x37')];_0x122b1f['order']=qs[_0x425b('0x3d')](_0x9458e0['query']['sort']);_0x122b1f[_0x425b('0x3f')]=qs[_0x425b('0x35')](_[_0x425b('0x5c')](_0x9458e0[_0x425b('0x34')],_0xb35965[_0x425b('0x35')]));if(_0x9458e0['query'][_0x425b('0x3e')]){_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],{'$or':_[_0x425b('0x2e')](_0x122b1f['attributes'],function(_0x38f2c4){var _0x4366cb={};_0x4366cb[_0x38f2c4]={'$like':'%'+_0x9458e0[_0x425b('0x34')][_0x425b('0x3e')]+'%'};return _0x4366cb;})});}if(_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]){var _0x149aa1=_0x9458e0[_0x425b('0x34')][_0x425b('0x5d')]['split'](',');var _0xbcdc45={};_0xbcdc45[_0x149aa1[0x0]]={'$gte':moment(_0x149aa1[0x1])[_0x425b('0x5e')](_0x425b('0x5f'))};_0x122b1f[_0x425b('0x3f')]=_[_0x425b('0x41')](_0x122b1f[_0x425b('0x3f')],_0xbcdc45);}_0x122b1f=_['merge']({},_0x122b1f,_0x9458e0['options']);return _0x1046e1['getMessages'](_0x122b1f);}})['then'](function(_0x1693f4){if(_0x1693f4){_0x1a019f=_0x1693f4[_0x425b('0x3a')];if(!_0x9458e0[_0x425b('0x34')][_0x425b('0x3b')](_0x425b('0x57'))){_0x122b1f[_0x425b('0x21')]=qs[_0x425b('0x21')](_0x9458e0[_0x425b('0x34')][_0x425b('0x21')]);_0x122b1f[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x9458e0[_0x425b('0x34')][_0x425b('0x23')]);}return _0x1046e1[_0x425b('0x5b')](_0x122b1f);}})['then'](function(_0xa01449){if(_0xa01449){return _0xa01449?{'count':_0x1a019f,'rows':_0xa01449}:null;}})[_0x425b('0x26')](respondWithResult(_0x31ce02,null))[_0x425b('0x47')](handleError(_0x31ce02,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 706b89b..debfc6a 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 _0xee2c=['update','emit','hasOwnProperty','hook','exports','events','ChatGroup','setMaxListeners','save'];(function(_0x43232a,_0xfda881){var _0x48db5f=function(_0x203b22){while(--_0x203b22){_0x43232a['push'](_0x43232a['shift']());}};_0x48db5f(++_0xfda881);}(_0xee2c,0x1c7));var _0xcee2=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xee2c[_0x3e5086];return _0xfeb102;};'use strict';var EventEmitter=require(_0xcee2('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xcee2('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xcee2('0x2')](0x0);var events={'afterCreate':_0xcee2('0x3'),'afterUpdate':_0xcee2('0x4'),'afterDestroy':'remove'};function emitEvent(_0x589e9d){return function(_0xc9b213,_0xb70cd1,_0x49d04d){ChatGroupEvents[_0xcee2('0x5')](_0x589e9d+':'+_0xc9b213['id'],_0xc9b213);ChatGroupEvents[_0xcee2('0x5')](_0x589e9d,_0xc9b213);_0x49d04d(null);};}for(var e in events){if(events[_0xcee2('0x6')](e)){var event=events[e];ChatGroup[_0xcee2('0x7')](e,emitEvent(event));}}module[_0xcee2('0x8')]=ChatGroupEvents;
\ No newline at end of file
+var _0xfdb5=['ChatGroup','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0xfdb5,0x18f));var _0x5fdb=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xfdb5[_0x12fc8d];return _0x3f9d04;};'use strict';var EventEmitter=require(_0x5fdb('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x5fdb('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x5fdb('0x2')](0x0);var events={'afterCreate':_0x5fdb('0x3'),'afterUpdate':_0x5fdb('0x4'),'afterDestroy':_0x5fdb('0x5')};function emitEvent(_0x379f9b){return function(_0x24cbe7,_0x334e53,_0x5f3fc6){ChatGroupEvents[_0x5fdb('0x6')](_0x379f9b+':'+_0x24cbe7['id'],_0x24cbe7);ChatGroupEvents['emit'](_0x379f9b,_0x24cbe7);_0x5f3fc6(null);};}for(var e in events){if(events[_0x5fdb('0x7')](e)){var event=events[e];ChatGroup[_0x5fdb('0x8')](e,emitEvent(event));}}module[_0x5fdb('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 08b9e17..f391bab 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 _0x0384=['moment','bluebird','request-promise','path','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash','util','../../config/logger','api'];(function(_0x30ab4d,_0x1324db){var _0x41eac2=function(_0x2f7d58){while(--_0x2f7d58){_0x30ab4d['push'](_0x30ab4d['shift']());}};_0x41eac2(++_0x1324db);}(_0x0384,0x11a));var _0x4038=function(_0x2dea0d,_0x553e6f){_0x2dea0d=_0x2dea0d-0x0;var _0x779e6e=_0x0384[_0x2dea0d];return _0x779e6e;};'use strict';var _=require(_0x4038('0x0'));var util=require(_0x4038('0x1'));var logger=require(_0x4038('0x2'))(_0x4038('0x3'));var moment=require(_0x4038('0x4'));var BPromise=require(_0x4038('0x5'));var rp=require(_0x4038('0x6'));var fs=require('fs');var path=require(_0x4038('0x7'));var rimraf=require(_0x4038('0x8'));var config=require('../../config/environment');var attributes=require(_0x4038('0x9'));module[_0x4038('0xa')]=function(_0x4077e4,_0x40c601){return _0x4077e4[_0x4038('0xb')](_0x4038('0xc'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x7d89=['request-promise','path','../../config/environment','define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x331052,_0x1bec7a){var _0x409de2=function(_0x305528){while(--_0x305528){_0x331052['push'](_0x331052['shift']());}};_0x409de2(++_0x1bec7a);}(_0x7d89,0x126));var _0x97d8=function(_0x2f1a48,_0x1fd155){_0x2f1a48=_0x2f1a48-0x0;var _0x4ff0b5=_0x7d89[_0x2f1a48];return _0x4ff0b5;};'use strict';var _=require(_0x97d8('0x0'));var util=require(_0x97d8('0x1'));var logger=require(_0x97d8('0x2'))(_0x97d8('0x3'));var moment=require(_0x97d8('0x4'));var BPromise=require(_0x97d8('0x5'));var rp=require(_0x97d8('0x6'));var fs=require('fs');var path=require(_0x97d8('0x7'));var rimraf=require('rimraf');var config=require(_0x97d8('0x8'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x2dd528,_0x2e2891){return _0x2dd528[_0x97d8('0x9')](_0x97d8('0xa'),attributes,{'tableName':_0x97d8('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 b97e6fb..e6d7250 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 _0x1de4=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s'];(function(_0xc8db6b,_0x320abd){var _0x12cb81=function(_0x417540){while(--_0x417540){_0xc8db6b['push'](_0xc8db6b['shift']());}};_0x12cb81(++_0x320abd);}(_0x1de4,0x94));var _0x41de=function(_0x51cb36,_0x4db5dc){_0x51cb36=_0x51cb36-0x0;var _0x50c6af=_0x1de4[_0x51cb36];return _0x50c6af;};'use strict';var _=require(_0x41de('0x0'));var util=require(_0x41de('0x1'));var moment=require(_0x41de('0x2'));var BPromise=require(_0x41de('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x41de('0x4'));var db=require(_0x41de('0x5'))['db'];var utils=require(_0x41de('0x6'));var logger=require('../../config/logger')(_0x41de('0x7'));var config=require(_0x41de('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x41de('0x9')][_0x41de('0xa')]({'port':0x232a});config[_0x41de('0xb')]=_[_0x41de('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x41de('0xd'))(new Redis(config[_0x41de('0xb')]));require(_0x41de('0xe'))[_0x41de('0xf')](socket);function respondWithRpcPromise(_0x1259ce,_0xac4f6c,_0x5c2eb6){return new BPromise(function(_0x3a923d,_0x415af3){return client[_0x41de('0x10')](_0x1259ce,_0x5c2eb6)[_0x41de('0x11')](function(_0x41e515){logger[_0x41de('0x12')]('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x41de('0x13'));logger[_0x41de('0x14')](_0x41de('0x15'),_0xac4f6c,'request\x20sent',JSON[_0x41de('0x16')](_0x41e515));if(_0x41e515[_0x41de('0x17')]){if(_0x41e515['error'][_0x41de('0x18')]===0x1f4){logger[_0x41de('0x17')](_0x41de('0x19'),_0xac4f6c,_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);return _0x415af3(_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);}logger[_0x41de('0x17')](_0x41de('0x19'),_0xac4f6c,_0x41e515[_0x41de('0x17')][_0x41de('0x1a')]);return _0x3a923d(_0x41e515['error'][_0x41de('0x1a')]);}else{logger[_0x41de('0x12')]('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x41de('0x13'));_0x3a923d(_0x41e515[_0x41de('0x1b')][_0x41de('0x1a')]);}})[_0x41de('0x1c')](function(_0x1a7b6f){logger['error']('ChatGroup,\x20%s,\x20%s',_0xac4f6c,_0x1a7b6f);_0x415af3(_0x1a7b6f);});});}
\ No newline at end of file
+var _0x8ccc=['message','result','catch','lodash','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0xd7de81,_0x35ca61){var _0x41c627=function(_0x10aeff){while(--_0x10aeff){_0xd7de81['push'](_0xd7de81['shift']());}};_0x41c627(++_0x35ca61);}(_0x8ccc,0x16f));var _0xc8cc=function(_0x332d62,_0x236139){_0x332d62=_0x332d62-0x0;var _0x3bd864=_0x8ccc[_0x332d62];return _0x3bd864;};'use strict';var _=require(_0xc8cc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc8cc('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc8cc('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xc8cc('0x3'))(_0xc8cc('0x4'));var config=require(_0xc8cc('0x5'));var jayson=require(_0xc8cc('0x6'));var client=jayson[_0xc8cc('0x7')]['http']({'port':0x232a});config['redis']=_[_0xc8cc('0x8')](config[_0xc8cc('0x9')],{'host':_0xc8cc('0xa'),'port':0x18eb});var socket=require(_0xc8cc('0xb'))(new Redis(config[_0xc8cc('0x9')]));require(_0xc8cc('0xc'))[_0xc8cc('0xd')](socket);function respondWithRpcPromise(_0x181d7d,_0x1913e0,_0x3fe1d8){return new BPromise(function(_0x479f74,_0x2cac96){return client['request'](_0x181d7d,_0x3fe1d8)[_0xc8cc('0xe')](function(_0x1d02fe){logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,'request\x20sent');logger[_0xc8cc('0x11')](_0xc8cc('0x12'),_0x1913e0,_0xc8cc('0x13'),JSON[_0xc8cc('0x14')](_0x1d02fe));if(_0x1d02fe[_0xc8cc('0x15')]){if(_0x1d02fe['error'][_0xc8cc('0x16')]===0x1f4){logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x2cac96(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}logger[_0xc8cc('0x15')](_0xc8cc('0x10'),_0x1913e0,_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);return _0x479f74(_0x1d02fe[_0xc8cc('0x15')][_0xc8cc('0x17')]);}else{logger[_0xc8cc('0xf')](_0xc8cc('0x10'),_0x1913e0,_0xc8cc('0x13'));_0x479f74(_0x1d02fe[_0xc8cc('0x18')][_0xc8cc('0x17')]);}})[_0xc8cc('0x19')](function(_0xb435db){logger[_0xc8cc('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1913e0,_0xb435db);_0x2cac96(_0xb435db);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 3e19e1f..acac911 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 _0xffaa=['./chatGroup.events','save','remove','update','emit','removeListener','length','chatGroup:'];(function(_0xa6e9fa,_0x33372a){var _0x44592c=function(_0x53febe){while(--_0x53febe){_0xa6e9fa['push'](_0xa6e9fa['shift']());}};_0x44592c(++_0x33372a);}(_0xffaa,0x1e0));var _0xaffa=function(_0x67f102,_0x2d3bd1){_0x67f102=_0x67f102-0x0;var _0x568b50=_0xffaa[_0x67f102];return _0x568b50;};'use strict';var ChatGroupEvents=require(_0xaffa('0x0'));var events=[_0xaffa('0x1'),_0xaffa('0x2'),_0xaffa('0x3')];function createListener(_0x1ceac5,_0x145359){return function(_0x4935bc){_0x145359[_0xaffa('0x4')](_0x1ceac5,_0x4935bc);};}function removeListener(_0x4c63e5,_0x3819f0){return function(){ChatGroupEvents[_0xaffa('0x5')](_0x4c63e5,_0x3819f0);};}exports['register']=function(_0x4ecc09){for(var _0x4f031d=0x0,_0x21298c=events[_0xaffa('0x6')];_0x4f031d<_0x21298c;_0x4f031d++){var _0x5a6ea6=events[_0x4f031d];var _0x2e37b6=createListener(_0xaffa('0x7')+_0x5a6ea6,_0x4ecc09);ChatGroupEvents['on'](_0x5a6ea6,_0x2e37b6);}};
\ No newline at end of file
+var _0x75b5=['emit','removeListener','register','chatGroup:','save','remove','update'];(function(_0x3ff33a,_0x32e7a5){var _0x43517f=function(_0x5f0f4a){while(--_0x5f0f4a){_0x3ff33a['push'](_0x3ff33a['shift']());}};_0x43517f(++_0x32e7a5);}(_0x75b5,0xd6));var _0x575b=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0x75b5[_0x43d11d];return _0x38cd08;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0x575b('0x0'),_0x575b('0x1'),_0x575b('0x2')];function createListener(_0x2c37ca,_0xf70335){return function(_0x22ccc9){_0xf70335[_0x575b('0x3')](_0x2c37ca,_0x22ccc9);};}function removeListener(_0x5b04db,_0x51759c){return function(){ChatGroupEvents[_0x575b('0x4')](_0x5b04db,_0x51759c);};}exports[_0x575b('0x5')]=function(_0x25db80){for(var _0x28fc02=0x0,_0x7ad9da=events['length'];_0x28fc02<_0x7ad9da;_0x28fc02++){var _0x49a6e4=events[_0x28fc02];var _0x420e73=createListener(_0x575b('0x6')+_0x49a6e4,_0x25db80);ChatGroupEvents['on'](_0x49a6e4,_0x420e73);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index 92d9f86..5089ab5 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 _0x9fda=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/unread','getUnread','/:id/members','getMembers','getMessages','post','addMembers','/:id/messages','addMessage','put','update','destroy','delete','removeMembers','exports','multer'];(function(_0x2b78de,_0x547dd0){var _0x29f987=function(_0x423471){while(--_0x423471){_0x2b78de['push'](_0x2b78de['shift']());}};_0x29f987(++_0x547dd0);}(_0x9fda,0x15f));var _0xa9fd=function(_0x29c4e5,_0x4b0c43){_0x29c4e5=_0x29c4e5-0x0;var _0x108d1f=_0x9fda[_0x29c4e5];return _0x108d1f;};'use strict';var multer=require(_0xa9fd('0x0'));var util=require(_0xa9fd('0x1'));var path=require(_0xa9fd('0x2'));var timeout=require(_0xa9fd('0x3'));var express=require(_0xa9fd('0x4'));var router=express[_0xa9fd('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xa9fd('0x6'));var interaction=require(_0xa9fd('0x7'));var config=require(_0xa9fd('0x8'));var controller=require(_0xa9fd('0x9'));router[_0xa9fd('0xa')]('/',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xc')]);router[_0xa9fd('0xa')](_0xa9fd('0xd'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0xe')]);router[_0xa9fd('0xa')](_0xa9fd('0xf'),auth['isAuthenticated'](),controller[_0xa9fd('0x10')]);router['get'](_0xa9fd('0x11'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x12')]);router[_0xa9fd('0xa')](_0xa9fd('0x13'),auth['isAuthenticated'](),controller[_0xa9fd('0x14')]);router[_0xa9fd('0xa')]('/:id/messages',auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x15')]);router[_0xa9fd('0x16')]('/',auth[_0xa9fd('0xb')](),controller['create']);router[_0xa9fd('0x16')]('/:id/members',auth['isAuthenticated'](),controller[_0xa9fd('0x17')]);router[_0xa9fd('0x16')](_0xa9fd('0x18'),auth['isAuthenticated'](),controller[_0xa9fd('0x19')]);router[_0xa9fd('0x1a')](_0xa9fd('0xf'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x1b')]);router['delete'](_0xa9fd('0xf'),auth[_0xa9fd('0xb')](),controller[_0xa9fd('0x1c')]);router[_0xa9fd('0x1d')](_0xa9fd('0x13'),auth['isAuthenticated'](),controller[_0xa9fd('0x1e')]);module[_0xa9fd('0x1f')]=router;
\ No newline at end of file
+var _0xc791=['multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','addMessage','put','/:id','update','delete','destroy','exports'];(function(_0x99868f,_0xbdb8e7){var _0x27a71b=function(_0x41feca){while(--_0x41feca){_0x99868f['push'](_0x99868f['shift']());}};_0x27a71b(++_0xbdb8e7);}(_0xc791,0x8c));var _0x1c79=function(_0xa51ba0,_0x3bf58d){_0xa51ba0=_0xa51ba0-0x0;var _0x17f343=_0xc791[_0xa51ba0];return _0x17f343;};'use strict';var multer=require(_0x1c79('0x0'));var util=require(_0x1c79('0x1'));var path=require(_0x1c79('0x2'));var timeout=require(_0x1c79('0x3'));var express=require(_0x1c79('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x1c79('0x5'));var interaction=require(_0x1c79('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x1c79('0x7')]('/',auth[_0x1c79('0x8')](),controller[_0x1c79('0x9')]);router[_0x1c79('0x7')](_0x1c79('0xa'),auth[_0x1c79('0x8')](),controller['describe']);router['get']('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0xb')]);router[_0x1c79('0x7')](_0x1c79('0xc'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xd')]);router['get'](_0x1c79('0xe'),auth[_0x1c79('0x8')](),controller[_0x1c79('0xf')]);router[_0x1c79('0x7')](_0x1c79('0x10'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x11')]);router[_0x1c79('0x12')]('/',auth['isAuthenticated'](),controller[_0x1c79('0x13')]);router[_0x1c79('0x12')]('/:id/members',auth[_0x1c79('0x8')](),controller[_0x1c79('0x14')]);router['post'](_0x1c79('0x10'),auth['isAuthenticated'](),controller[_0x1c79('0x15')]);router[_0x1c79('0x16')](_0x1c79('0x17'),auth[_0x1c79('0x8')](),controller[_0x1c79('0x18')]);router[_0x1c79('0x19')]('/:id',auth[_0x1c79('0x8')](),controller[_0x1c79('0x1a')]);router['delete']('/:id/members',auth[_0x1c79('0x8')](),controller['removeMembers']);module[_0x1c79('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 7ff7209..cbb75be 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 _0x3c81=['INTEGER','ENUM','TEXT','STRING','DATE','long','out','BOOLEAN','sequelize','exports'];(function(_0x1b6bc3,_0xc728b7){var _0x1e0121=function(_0x4925ae){while(--_0x4925ae){_0x1b6bc3['push'](_0x1b6bc3['shift']());}};_0x1e0121(++_0xc728b7);}(_0x3c81,0x102));var _0x13c8=function(_0x585c26,_0xb238c){_0x585c26=_0x585c26-0x0;var _0x3226cd=_0x3c81[_0x585c26];return _0x3226cd;};'use strict';var Sequelize=require(_0x13c8('0x0'));module[_0x13c8('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x13c8('0x2')]},'ratingType':{'type':Sequelize[_0x13c8('0x3')]('star','thumb'),'defaultValue':'star'},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x13c8('0x4')]},'mailTranscript':{'type':Sequelize[_0x13c8('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x13c8('0x6')]},'disposition':{'type':Sequelize[_0x13c8('0x5')]},'secondDisposition':{'type':Sequelize[_0x13c8('0x5')]},'thirdDisposition':{'type':Sequelize[_0x13c8('0x5')]},'note':{'type':Sequelize[_0x13c8('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x13c8('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x13c8('0x5')]},'deviceModel':{'type':Sequelize[_0x13c8('0x5')]},'deviceVendor':{'type':Sequelize[_0x13c8('0x5')]},'deviceType':{'type':Sequelize[_0x13c8('0x5')]},'referer':{'type':Sequelize[_0x13c8('0x4')]},'customerIp':{'type':Sequelize[_0x13c8('0x5')]},'formData':{'type':Sequelize[_0x13c8('0x4')](_0x13c8('0x7'))},'read1stAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgAt':{'type':Sequelize[_0x13c8('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x13c8('0x3')]('in',_0x13c8('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x13c8('0x5')]},'customerPort':{'type':Sequelize[_0x13c8('0x5')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x13c8('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xee4e=['STRING','DATE','sequelize','exports','BOOLEAN','ENUM','star','thumb','TEXT'];(function(_0x37846a,_0x42db81){var _0x401321=function(_0x376993){while(--_0x376993){_0x37846a['push'](_0x37846a['shift']());}};_0x401321(++_0x42db81);}(_0xee4e,0x122));var _0xeee4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xee4e[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xeee4('0x0'));module[_0xeee4('0x1')]={'closed':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xeee4('0x3')](_0xeee4('0x4'),_0xeee4('0x5')),'defaultValue':_0xeee4('0x4')},'ratingMessage':{'type':Sequelize[_0xeee4('0x6')]},'pathTranscript':{'type':Sequelize[_0xeee4('0x6')]},'mailTranscript':{'type':Sequelize[_0xeee4('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xeee4('0x8')]},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0xeee4('0x7')]},'thirdDisposition':{'type':Sequelize[_0xeee4('0x7')]},'note':{'type':Sequelize[_0xeee4('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xeee4('0x7')]},'osName':{'type':Sequelize[_0xeee4('0x7')]},'osVersion':{'type':Sequelize[_0xeee4('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xeee4('0x7')]},'deviceType':{'type':Sequelize[_0xeee4('0x7')]},'referer':{'type':Sequelize[_0xeee4('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xeee4('0x6')]('long')},'read1stAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgAt':{'type':Sequelize[_0xeee4('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xeee4('0x3')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xeee4('0x7')]},'customerPort':{'type':Sequelize[_0xeee4('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xeee4('0x6')]},'autoreplyExecuted':{'type':Sequelize[_0xeee4('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index d559edb..36b81c1 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 _0x9ffd=['MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','contactName','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','agent','getChatWebsites','isEmpty','i.ChatWebsiteId\x20IS\x20NULL','role','sequelize','keyBy','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','toString','ui.ChatInteractionId\x20IN\x20?','groupBy','params','includeAll','find','destroy','describe','createVidaooSession','findOne','ChatWebsite','vidaooNote','vidaooApiKey','vidaooEscalation','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','ChatMessage','create','updateAttributes','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','abandon','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','%s%d','agentAlias','System','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','omit','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','secret','include','includeAgent','push','setTags','spread','Tag','emit','chatInteractionTags:save','removeTags','unix','tmp','server','files','CmContact','firstName','attachments','Account','Owner','get','mkdirSync','Chat','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','lastName','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','end','json','offset','undefined','limit','count','status','set','apply','reject','save','update','stack','name','render','merge','body','contact','account','Users','fullname','Tags','TagIds','split','forEach','index','ChatInteraction','rawAttributes','fieldName','type','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','select','field','color','from','left_join','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','parseSearch','search','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','map','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','compact','ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x274be7,_0x84897d){_0x274be7=_0x274be7-0x0;var _0x123967=_0x9ffd[_0x274be7];return _0x123967;};'use strict';var emlformat=require(_0xd9ff('0x0'));var rimraf=require(_0xd9ff('0x1'));var zipdir=require(_0xd9ff('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd9ff('0x3'));var moment=require(_0xd9ff('0x4'));var BPromise=require(_0xd9ff('0x5'));var Mustache=require(_0xd9ff('0x6'));var util=require('util');var path=require(_0xd9ff('0x7'));var sox=require(_0xd9ff('0x8'));var csv=require('to-csv');var ejs=require(_0xd9ff('0x9'));var fs=require('fs');var fs_extra=require(_0xd9ff('0xa'));var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x10'));var querystring=require(_0xd9ff('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x12'));var pdf=require(_0xd9ff('0x13'));var hardwareService=require(_0xd9ff('0x14'));var logger=require(_0xd9ff('0x15'))(_0xd9ff('0x16'));var utils=require(_0xd9ff('0x17'));var config=require(_0xd9ff('0x18'));var licenseUtil=require(_0xd9ff('0x19'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd9ff('0x1a')](config[_0xd9ff('0x1b')],{'host':_0xd9ff('0x1c'),'port':0x18eb});var socket=require(_0xd9ff('0x1d'))(new Redis(config[_0xd9ff('0x1b')]));require('./chatInteraction.socket')[_0xd9ff('0x1e')](socket);var jayson=require(_0xd9ff('0x1f'));var client=jayson['client'][_0xd9ff('0x20')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function respondWithRpcPromise(_0x547e28,_0x4c5718,_0x271287,_0x4f9d6d){return new BPromise(function(_0x35679e,_0xa30fd2){var _0x39c6ce=_0x4f9d6d||client;return _0x39c6ce[_0xd9ff('0x21')](_0x547e28,_0x271287)[_0xd9ff('0x22')](function(_0x2d4df1){logger[_0xd9ff('0x23')](_0xd9ff('0x24'),_0x4c5718,_0xd9ff('0x25'));logger[_0xd9ff('0x26')](_0xd9ff('0x27'),_0x4c5718,_0xd9ff('0x25'),JSON[_0xd9ff('0x28')](_0x2d4df1));if(_0x2d4df1['error']){if(_0x2d4df1['error'][_0xd9ff('0x29')]===0x1f4){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x2d4df1['error']['message']);return _0xa30fd2(_0x2d4df1['error'][_0xd9ff('0x2b')]);}logger['error'](_0xd9ff('0x24'),_0x4c5718,_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);return _0x35679e(_0x2d4df1[_0xd9ff('0x2a')][_0xd9ff('0x2b')]);}else{logger[_0xd9ff('0x23')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,'request\x20sent');_0x35679e(_0x2d4df1[_0xd9ff('0x2c')]['message']);}})[_0xd9ff('0x2d')](function(_0x4d86fe){logger[_0xd9ff('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x4c5718,_0x4d86fe);_0xa30fd2(_0x4d86fe);});});}function respondWithStatusCode(_0x10cbdd,_0x159e56){_0x159e56=_0x159e56||0xcc;return function(_0x2138b4){if(_0x2138b4){return _0x10cbdd[_0xd9ff('0x2e')](_0x159e56);}return _0x10cbdd['status'](_0x159e56)[_0xd9ff('0x2f')]();};}function respondWithResult(_0xe11f88,_0x1c78c4){_0x1c78c4=_0x1c78c4||0xc8;return function(_0x4390f7){if(_0x4390f7){return _0xe11f88['status'](_0x1c78c4)[_0xd9ff('0x30')](_0x4390f7);}};}function respondWithFilteredResult(_0x3792d9,_0x44b5a7){return function(_0x45fb63){if(_0x45fb63){var _0x263d3a=typeof _0x44b5a7[_0xd9ff('0x31')]===_0xd9ff('0x32')&&typeof _0x44b5a7[_0xd9ff('0x33')]===_0xd9ff('0x32');var _0x5706cf=_0x45fb63[_0xd9ff('0x34')];var _0x4ba2be=_0x263d3a?0x0:_0x44b5a7[_0xd9ff('0x31')];var _0x29c532=_0x263d3a?_0x45fb63[_0xd9ff('0x34')]:_0x44b5a7['offset']+_0x44b5a7[_0xd9ff('0x33')];var _0x3b26da;if(_0x29c532>=_0x5706cf){_0x29c532=_0x5706cf;_0x3b26da=0xc8;}else{_0x3b26da=0xce;}_0x3792d9[_0xd9ff('0x35')](_0x3b26da);return _0x3792d9[_0xd9ff('0x36')]('Content-Range',_0x4ba2be+'-'+_0x29c532+'/'+_0x5706cf)[_0xd9ff('0x30')](_0x45fb63);}return null;};}function patchUpdates(_0x5743de){return function(_0x18c28b){try{jsonpatch[_0xd9ff('0x37')](_0x18c28b,_0x5743de,!![]);}catch(_0x323cb5){return BPromise[_0xd9ff('0x38')](_0x323cb5);}return _0x18c28b[_0xd9ff('0x39')]();};}function saveUpdates(_0xdf3947,_0x2cc2ae){return function(_0x281c7b){if(_0x281c7b){return _0x281c7b[_0xd9ff('0x3a')](_0xdf3947)[_0xd9ff('0x22')](function(_0x4813a5){return _0x4813a5;});}return null;};}function removeEntity(_0x34e9a9,_0x4670e4){return function(_0x66f4d){if(_0x66f4d){return _0x66f4d['destroy']()[_0xd9ff('0x22')](function(){_0x34e9a9[_0xd9ff('0x35')](0xcc)[_0xd9ff('0x2f')]();});}};}function handleEntityNotFound(_0x4ab10f,_0x3d449d){return function(_0x5e3ff9){if(!_0x5e3ff9){_0x4ab10f[_0xd9ff('0x2e')](0x194);}return _0x5e3ff9;};}function handleError(_0x4ae56b,_0x20a021){_0x20a021=_0x20a021||0x1f4;return function(_0x5db498){logger[_0xd9ff('0x2a')](_0x5db498[_0xd9ff('0x3b')]);if(_0x5db498[_0xd9ff('0x3c')]){delete _0x5db498['name'];}_0x4ae56b['status'](_0x20a021)['send'](_0x5db498);};}function getMustacheRender(_0x7ac3d1,_0x30fc5b){return Mustache[_0xd9ff('0x3d')](_0x7ac3d1,_[_0xd9ff('0x3e')](_0x30fc5b[_0xd9ff('0x3f')],{'contact':_0x30fc5b[_0xd9ff('0x40')],'message':_0x30fc5b['message'],'agent':_0x30fc5b['agent'],'interaction':_0x30fc5b['interaction'],'account':_0x30fc5b[_0xd9ff('0x41')]}))||'';}function getInteractionUsers(_0x252edc,_0x918c9a){return new BPromise(function(_0x32adae,_0x56b94d){try{if(_0x918c9a[_0x252edc['id']]){_0x252edc[_0xd9ff('0x42')]=_['map'](_0x918c9a[_0x252edc['id']],function(_0x3cff52){return{'id':_0x3cff52['id'],'fullname':_0x3cff52[_0xd9ff('0x43')]};});}}catch(_0x1bedaf){_0x56b94d(_0x1bedaf);}_0x32adae(_0x252edc);});}function getInteractionTags(_0x169dc7,_0x59fc07){return new BPromise(function(_0x1e34da,_0x2d4d97){try{if(_0x169dc7['TagIds']){_0x169dc7[_0xd9ff('0x44')]=[];_0x169dc7[_0xd9ff('0x45')][_0xd9ff('0x46')](',')[_0xd9ff('0x47')](function(_0x1fe44d){_0x169dc7[_0xd9ff('0x44')]['push'](_0x59fc07[_0x1fe44d]);});}delete _0x169dc7[_0xd9ff('0x45')];}catch(_0x116f28){_0x2d4d97(_0x116f28);}_0x1e34da(_0x169dc7);});}function updateChatInteraction(_0x10533a,_0x39fbbb,_0x472724){return new BPromise(function(_0x52aab8,_0x3178cd){return getInteractionUsers(_0x10533a,_0x472724)[_0xd9ff('0x22')](function(_0xe0bc49){return getInteractionTags(_0xe0bc49,_0x39fbbb);})['then'](function(_0x5d06dd){_0x52aab8(_0x5d06dd);})[_0xd9ff('0x2d')](function(_0x7eb1a){_0x3178cd(_0x7eb1a);});});}exports[_0xd9ff('0x48')]=function(_0x2dfb8f,_0x437561){var _0x30c69d={},_0x564ef4={},_0xd64585={'count':0x0,'rows':[]};var _0x2d3013=_['map'](db[_0xd9ff('0x49')][_0xd9ff('0x4a')],function(_0x13a1ec){return{'name':_0x13a1ec[_0xd9ff('0x4b')],'type':_0x13a1ec[_0xd9ff('0x4c')]['key']};});_0x564ef4['model']=_['map'](_0x2d3013,_0xd9ff('0x3c'));_0x564ef4['query']=_[_0xd9ff('0x4d')](_0x2dfb8f[_0xd9ff('0x4e')]);_0x564ef4[_0xd9ff('0x4f')]=_['intersection'](_0x564ef4[_0xd9ff('0x50')],_0x564ef4[_0xd9ff('0x4e')]);_0x30c69d['attributes']=_[_0xd9ff('0x51')](_0x564ef4[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x2dfb8f[_0xd9ff('0x4e')]['fields']));_0x30c69d[_0xd9ff('0x53')]=_0x30c69d['attributes'][_0xd9ff('0x54')]?_0x30c69d['attributes']:_0x564ef4[_0xd9ff('0x50')];if(!_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x30c69d[_0xd9ff('0x33')]=qs['limit'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x30c69d[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2dfb8f['query']['offset']);}_0x30c69d['order']=qs[_0xd9ff('0x57')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x30c69d['where']=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0x2dfb8f[_0xd9ff('0x4e')],_0x564ef4[_0xd9ff('0x4f')]),_0x2d3013);var _0xfede73=[];var _0x40d391=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5a')]('id')[_0xd9ff('0x5a')](_0xd9ff('0x3c'))[_0xd9ff('0x5a')](_0xd9ff('0x5b'))[_0xd9ff('0x5c')]('tools_tags');var _0x3ed112=squel['select']()[_0xd9ff('0x5a')]('u.id')[_0xd9ff('0x5a')]('u.fullname')[_0xd9ff('0x5a')]('ui.ChatInteractionId')[_0xd9ff('0x5c')]('user_has_chat_interactions','ui')[_0xd9ff('0x5d')]('users','u',_0xd9ff('0x5e'));var _0x5da1a8=squel[_0xd9ff('0x59')]()[_0xd9ff('0x5c')](_0xd9ff('0x5f'),'i')[_0xd9ff('0x5d')]('cm_contacts','c',_0xd9ff('0x60'))[_0xd9ff('0x5d')](_0xd9ff('0x61'),'o','o.id\x20=\x20i.UserId')[_0xd9ff('0x5d')](_0xd9ff('0x62'),'a',_0xd9ff('0x63'))[_0xd9ff('0x5d')](_0xd9ff('0x64'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xd9ff('0x5d')](_0xd9ff('0x65'),'it',_0xd9ff('0x66'))[_0xd9ff('0x5d')](_0xd9ff('0x67'),'t',_0xd9ff('0x68'));var _0x458fd4=squel['expr']();var _0x3be850=[];var _0x11251f=squel['expr']();var _0x1c885f;if(_0x2dfb8f[_0xd9ff('0x4e')]['search']){_0x1c885f=as[_0xd9ff('0x69')](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x6a')]);var _0x54ea27=_0x1c885f['sqlOperator'];for(var _0x39473e=0x0;_0x39473e<_0x1c885f['conditions'][_0xd9ff('0x54')];_0x39473e++){var _0x1e4d0c=_0x1c885f[_0xd9ff('0x6b')][_0x39473e];var _0x102aea='i';var _0x53a230=_['find'](_0x2d3013,['name',_0x1e4d0c[_0xd9ff('0x5a')]]);if(!_0x53a230){switch(_0x1e4d0c[_0xd9ff('0x5a')]){case _0xd9ff('0x6c'):if(_0x1e4d0c[_0xd9ff('0x6d')]==0x1){_0x5da1a8[_0xd9ff('0x6e')]('`'+_0x1e4d0c['field']+_0xd9ff('0x6f'));}else{_0x5da1a8['having']('`'+_0x1e4d0c[_0xd9ff('0x5a')]+_0xd9ff('0x70'));}break;case _0xd9ff('0x71'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){if(_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')]('\x20')[_0xd9ff('0x54')]>0x1){_0x458fd4[_0x54ea27]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd9ff('0x74')](_0x1e4d0c[_0xd9ff('0x6d')]),null);}else{var _0x4f5338='%'+_0x1e4d0c['value']+'%';_0x458fd4[_0x54ea27](_0xd9ff('0x75'),_0x4f5338,_0x4f5338,_0x4f5338);}}else{_0x53a230=_['find'](_0x2d3013,[_0xd9ff('0x3c'),_0xd9ff('0x76')]);_0x1e4d0c['field']=_0xd9ff('0x76');_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')]['start'],_0x58c9c2[_0xd9ff('0x6d')]['end']);}break;case'Tag':var _0x3dabb1=_0x1e4d0c[_0xd9ff('0x6d')][_0xd9ff('0x46')](',')[_0xd9ff('0x79')](function(_0x56d822){return Number(_0x56d822);});_0x3dabb1[_0xd9ff('0x47')](function(_0x23b816){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x23b816+',%');});_0x3be850=_[_0xd9ff('0x7b')](_0x3be850,_0x3dabb1);break;case _0xd9ff('0x7c'):if(_0x1e4d0c[_0xd9ff('0x72')]===_0xd9ff('0x73')){_0x458fd4[_0x54ea27](_0xd9ff('0x7d'),'%'+_0x1e4d0c['value']+'%',null);}else{_0x53a230=_['find'](_0x2d3013,['name',_0xd9ff('0x7e')]);_0x1e4d0c[_0xd9ff('0x5a')]='UserId';_0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}break;case _0xd9ff('0x3f'):_0x58c9c2=as['buildExpression']('me',null,_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x7f')],_0x58c9c2['value'][_0xd9ff('0x2f')]);break;}}else{var _0x58c9c2=as[_0xd9ff('0x77')](_0x102aea,_0x53a230[_0xd9ff('0x4c')],_0x1e4d0c);_0x458fd4[_0x54ea27](_0x58c9c2[_0xd9ff('0x78')],_0x58c9c2['value'][_0xd9ff('0x7f')],_0x58c9c2[_0xd9ff('0x6d')][_0xd9ff('0x2f')]);}}}else{var _0x1cd620=_(_0x2dfb8f['query'])[_0xd9ff('0x4d')]()[_0xd9ff('0x79')](function(_0x1de5c9){return _['some'](_0x2d3013,[_0xd9ff('0x3c'),_0x1de5c9])?_0x1de5c9:undefined;})[_0xd9ff('0x80')]()[_0xd9ff('0x6d')]();if(!_['isEmpty'](_0x1cd620)){_0x1cd620[_0xd9ff('0x47')](function(_0x35926f){if(_0x35926f===_0xd9ff('0x81')){_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0x83'),[]['concat'](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]));}else if(_0x35926f===_0xd9ff('0x84')){var _0x59af0a=JSON[_0xd9ff('0x85')](_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f])[_0xd9ff('0x86')];var _0x5d1973=JSON[_0xd9ff('0x85')](_0x2dfb8f['query'][_0x35926f])[_0xd9ff('0x87')];_0x5da1a8['where'](_0xd9ff('0x88'),_0x59af0a,_0x5d1973);}else{if(_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]===_0xd9ff('0x89')){_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8a'));}else{_0x5da1a8[_0xd9ff('0x82')]('i.'+_0x35926f+_0xd9ff('0x8b'),_0x2dfb8f[_0xd9ff('0x4e')][_0x35926f]);}}});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8c')]){if(_0x2dfb8f['query'][_0xd9ff('0x8c')]==0x1){_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8d'));}else{_0x5da1a8[_0xd9ff('0x6e')](_0xd9ff('0x8e'));}}if(_0x2dfb8f[_0xd9ff('0x4e')]['tag']){_0x3be850=_['isArray'](_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')])?_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]:new Array(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x8f')]);_0x3be850['forEach'](function(_0x1d34a1){_0x11251f['or'](_0xd9ff('0x7a'),'%,'+_0x1d34a1+',%');});}if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x90')]){var _0x14c89f=_0x2dfb8f[_0xd9ff('0x4e')]['filter'][_0xd9ff('0x91')]('\x5c','\x5c\x5c')[_0xd9ff('0x91')](/'/g,'\x27\x27');if(qs[_0xd9ff('0x92')](_0x14c89f)){_0x458fd4['or'](_0xd9ff('0x93'),_0x14c89f+'%');}else{_0x458fd4['or'](_0xd9ff('0x94'),qs[_0xd9ff('0x74')](_0x14c89f))['or'](_0xd9ff('0x95'),_0x14c89f+'%');}}}_0x5da1a8[_0xd9ff('0x82')](_0x458fd4);_0x5da1a8['group'](_0xd9ff('0x96'));var _0x4c2ad5={'type':db[_0xd9ff('0x97')][_0xd9ff('0x98')][_0xd9ff('0x99')],'raw':!![]};var _0x2d2d1c=_0x5da1a8[_0xd9ff('0x9a')]();_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x96'));_0x2d2d1c[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));if(_0x30c69d[_0xd9ff('0x9c')]){_0x30c69d[_0xd9ff('0x9c')][_0xd9ff('0x47')](function(_0x5d29b9){var _0x4413c4=_0x5d29b9[0x0]===_0xd9ff('0x9d')?_0x5d29b9[0x0]:'i.'+_0x5d29b9[0x0];_0x5da1a8[_0xd9ff('0x9c')](_0x4413c4,_0x5d29b9[0x1]===_0xd9ff('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x3be850)){_0x5da1a8[_0xd9ff('0x6e')](_0x11251f);_0x2d2d1c[_0xd9ff('0x82')]('t.id\x20IN\x20?',_0x3be850);}BPromise[_0xd9ff('0x9f')]()[_0xd9ff('0x22')](function(){if(!_0x1c885f){if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x81')])return;_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa0'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}if(_0x2dfb8f[_0xd9ff('0xa1')]['role']!==_0xd9ff('0xa2'))return;return _0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa3')]({'attributes':['id'],'raw':!![]})[_0xd9ff('0x22')](function(_0x320adb){if(_[_0xd9ff('0xa4')](_0x320adb)){_0x2d2d1c[_0xd9ff('0x82')](_0xd9ff('0xa5'));_0x5da1a8[_0xd9ff('0x82')](_0xd9ff('0xa5'));}else{_0x2d2d1c[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));_0x5da1a8[_0xd9ff('0x82')]('i.ChatWebsiteId\x20IN\x20?',_[_0xd9ff('0x79')](_0x320adb,'id'));}});})[_0xd9ff('0x22')](function(){if(_0x2dfb8f[_0xd9ff('0xa1')][_0xd9ff('0xa6')]===_0xd9ff('0xa2')&&!_0x1c885f&&!_0x2dfb8f[_0xd9ff('0x4e')]['ChatWebsiteId'])return[];return db['sequelize'][_0xd9ff('0x4e')](_0x2d2d1c['toString'](),_0x4c2ad5);})['then'](function(_0x4a55c1){_0xd64585['count']=_0x4a55c1[_0xd9ff('0x54')];if(_0xd64585[_0xd9ff('0x34')]===0x0)return[];return db[_0xd9ff('0xa7')]['query'](_0x40d391['toString'](),_0x4c2ad5)[_0xd9ff('0x22')](function(_0x5e7f52){_0xfede73=_[_0xd9ff('0xa8')](_0x5e7f52,'id');_0x4c2ad5=_['merge'](_0x4c2ad5,{'model':db[_0xd9ff('0x49')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2dfb8f[_0xd9ff('0x4e')][_0xd9ff('0x52')]){_0x30c69d[_0xd9ff('0x53')][_0xd9ff('0x47')](function(_0x4e6dd2){_0x5da1a8['field']('i.'+_0x4e6dd2);});}else{_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0x9b'),_0xd9ff('0x6c'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xa9'),'Account.key');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xaa'),_0xd9ff('0xab'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xac'),_0xd9ff('0x9d'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xad'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xae'),_0xd9ff('0xaf'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb0'),'Contact.lastName');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb1'),'Contact.email');_0x5da1a8['field'](_0xd9ff('0xb2'),_0xd9ff('0xb3'));_0x5da1a8['field'](_0xd9ff('0xb4'),_0xd9ff('0xb5'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb6'),_0xd9ff('0xb7'));_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xb8'),_0xd9ff('0xb9'));_0x5da1a8['field']('o.internal','Owner.internal');_0x5da1a8[_0xd9ff('0x5a')](_0xd9ff('0xba'),_0xd9ff('0x45'));}if(_0x30c69d['limit'])_0x5da1a8[_0xd9ff('0x33')](_0x30c69d[_0xd9ff('0x33')]);if(_0x30c69d[_0xd9ff('0x31')])_0x5da1a8[_0xd9ff('0x31')](_0x30c69d[_0xd9ff('0x31')]);return db[_0xd9ff('0xa7')]['query'](_0x5da1a8[_0xd9ff('0xbb')](),_0x4c2ad5);})['then'](function(_0x5cb3af){if(_0x5cb3af[_0xd9ff('0x54')]>0x0)_0x3ed112[_0xd9ff('0x82')](_0xd9ff('0xbc'),_['map'](_0x5cb3af,'id'));return db[_0xd9ff('0xa7')][_0xd9ff('0x4e')](_0x3ed112['toString'](),_0x4c2ad5)['then'](function(_0x4aa6d5){var _0x11840a=_[_0xd9ff('0xbd')](_0x4aa6d5,'ChatInteractionId');var _0x2871ec=[];_0x5cb3af[_0xd9ff('0x47')](function(_0x16e130){_0x2871ec['push'](updateChatInteraction(_0x16e130,_0xfede73,_0x11840a));});return BPromise['all'](_0x2871ec);});});})['then'](function(_0xdf2e33){_0xd64585['rows']=_0xdf2e33;return _0xd64585;})[_0xd9ff('0x22')](respondWithFilteredResult(_0x437561,_0x30c69d))[_0xd9ff('0x2d')](handleError(_0x437561,null));};exports['show']=function(_0x1b048b,_0x5eeeaf){var _0x3339e5={'raw':![],'where':{'id':_0x1b048b[_0xd9ff('0xbe')]['id']}},_0x1f7d87={};_0x1f7d87['model']=_[_0xd9ff('0x4d')](db['ChatInteraction']['rawAttributes']);_0x1f7d87['query']=_[_0xd9ff('0x4d')](_0x1b048b[_0xd9ff('0x4e')]);_0x1f7d87[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x1f7d87['model'],_0x1f7d87['query']);_0x3339e5[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x1f7d87[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0x1b048b[_0xd9ff('0x4e')]['fields']));_0x3339e5['attributes']=_0x3339e5[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x3339e5[_0xd9ff('0x53')]:_0x1f7d87[_0xd9ff('0x50')];if(_0x1b048b[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x3339e5['include']=[{'all':!![]}];}_0x3339e5=_[_0xd9ff('0x3e')]({},_0x3339e5,_0x1b048b['options']);return db['ChatInteraction'][_0xd9ff('0xc0')](_0x3339e5)[_0xd9ff('0x22')](handleEntityNotFound(_0x5eeeaf,null))[_0xd9ff('0x22')](respondWithResult(_0x5eeeaf,null))[_0xd9ff('0x2d')](handleError(_0x5eeeaf,null));};exports['create']=function(_0x4e3fdd,_0x2cf8da){return db['ChatInteraction']['create'](_0x4e3fdd[_0xd9ff('0x3f')],{})['then'](respondWithResult(_0x2cf8da,0xc9))[_0xd9ff('0x2d')](handleError(_0x2cf8da,null));};exports['update']=function(_0x327cd8,_0xd95329){if(_0x327cd8[_0xd9ff('0x3f')]['id']){delete _0x327cd8[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x327cd8[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0xd95329,null))[_0xd9ff('0x22')](saveUpdates(_0x327cd8['body'],null))['then'](respondWithResult(_0xd95329,null))[_0xd9ff('0x2d')](handleError(_0xd95329,null));};exports[_0xd9ff('0xc1')]=function(_0x499869,_0x3c86ac){return db['ChatInteraction']['find']({'where':{'id':_0x499869[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x3c86ac,null))[_0xd9ff('0x22')](removeEntity(_0x3c86ac,null))[_0xd9ff('0x2d')](handleError(_0x3c86ac,null));};exports[_0xd9ff('0xc2')]=function(_0x11c84f,_0x2d0261){return db[_0xd9ff('0x49')][_0xd9ff('0xc2')]()[_0xd9ff('0x22')](respondWithResult(_0x2d0261,null))[_0xd9ff('0x2d')](handleError(_0x2d0261,null));};exports[_0xd9ff('0xc3')]=function(_0x73cfcf,_0x538f20){var _0x51feff=_0x73cfcf['params']['id'];var _0x30c62c;var _0x50b6b2;var _0x413aef;return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x51feff}})[_0xd9ff('0x22')](function(_0x54c390){_0x30c62c=_0x54c390;return db[_0xd9ff('0xc5')]['findOne']({'where':{'id':_0x54c390[_0xd9ff('0x81')]},'attributes':['id','vidaooApiKey','vidaooEscalation','vidaooTopic',_0xd9ff('0xc6'),'vidaooMetadata'],'raw':!![]});})[_0xd9ff('0x22')](function(_0x54524c){if(_0x54524c&&_0x54524c[_0xd9ff('0xc7')]&&_0x54524c[_0xd9ff('0xc8')]){_0x50b6b2=_0x54524c;var _0x696e18={'interaction':{'id':_0x51feff},'agent':{'id':_0x73cfcf[_0xd9ff('0xa1')]['id'],'name':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0x3c')],'fullname':_0x73cfcf['user']['fullname'],'email':_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]},'contact':_0x73cfcf[_0xd9ff('0x3f')][_0xd9ff('0x40')],'account':_0x73cfcf[_0xd9ff('0x3f')]['account']};var _0x432854={'rejectUnauthorized':![],'method':_0xd9ff('0xca'),'url':_0xd9ff('0xcb'),'headers':{'X-APIKEY':_0x54524c[_0xd9ff('0xc7')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x73cfcf[_0xd9ff('0xa1')][_0xd9ff('0xc9')]],'buttons':null,'topic':_0x50b6b2['vidaooTopic'],'note':_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xc6')])?null:getMustacheRender(_0x50b6b2[_0xd9ff('0xc6')],_0x696e18),'metadata':null},'redirect':_0xd9ff('0xcd'),'json':!![]};try{if(!_[_0xd9ff('0xcc')](_0x50b6b2[_0xd9ff('0xce')])){var _0x1c8e55=getMustacheRender(_0x50b6b2[_0xd9ff('0xce')],_0x696e18);var _0x29fdb8=JSON[_0xd9ff('0x85')](_0x1c8e55);_0x432854[_0xd9ff('0x3f')][_0xd9ff('0xcf')]=_0x29fdb8;}}catch(_0xfc755a){throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))](_0xd9ff('0xd1'));}return rp(_0x432854);}else{throw new db[(_0xd9ff('0x97'))][(_0xd9ff('0xd0'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0xd9ff('0x22')](function(_0x282183){_0x413aef=_0x282183;if(_0x413aef['id']){var _0x3aba00={'body':_0x413aef[_0xd9ff('0xd2')],'ChatWebsiteId':_0x50b6b2['id'],'ChatInteractionId':_0x30c62c['id'],'direction':_0xd9ff('0xd3'),'UserId':_0x73cfcf[_0xd9ff('0xa1')]['id']};return db[_0xd9ff('0xd4')][_0xd9ff('0xd5')](_0x3aba00,{});}else{throw new db['Sequelize'][(_0xd9ff('0xd0'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0xd9ff('0x22')](function(){return _0x30c62c[_0xd9ff('0xd6')]({'vidaooSessionId':_0x413aef['id']});})[_0xd9ff('0x22')](respondWithResult(_0x538f20,null))[_0xd9ff('0x2d')](handleError(_0x538f20,null));};exports[_0xd9ff('0xd7')]=function(_0x204127,_0xf98666){if(_0x204127['body']['id']){delete _0x204127[_0xd9ff('0x3f')]['id'];}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x204127[_0xd9ff('0xbe')]['id']},'include':[{'model':db['CmContact'],'as':_0xd9ff('0x71')}]})[_0xd9ff('0x22')](handleEntityNotFound(_0xf98666,null))['then'](saveUpdates(_0x204127[_0xd9ff('0x3f')],null))[_0xd9ff('0x22')](respondWithResult(_0xf98666,null))['catch'](handleError(_0xf98666,null));};exports['abandon']=function(_0x5c4138,_0x560ea2,_0x1e6d5a){if(_0x5c4138[_0xd9ff('0x3f')]['id']){delete _0x5c4138[_0xd9ff('0x3f')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x5c4138[_0xd9ff('0xbe')]['id']}})['then'](function(_0x43a941){if(!_0x43a941){logger[_0xd9ff('0x2a')](_0xd9ff('0xd8'),'abandon',0x194,'entity\x20not\x20found');_0x560ea2['sendStatus'](0x194);}else{if(_0x43a941[_0xd9ff('0x7e')]){throw new db[(_0xd9ff('0x97'))]['ValidationError'](_0xd9ff('0xd9'));}}return _0x43a941;})[_0xd9ff('0x22')](function(_0x7efe12){if(_0x7efe12){return _0x7efe12[_0xd9ff('0x3a')]({'closed':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xda')],'disposition':_0x5c4138[_0xd9ff('0x3f')][_0xd9ff('0xdb')]})[_0xd9ff('0x22')](function(_0x3b7aeb){return _0x3b7aeb;});}})[_0xd9ff('0x22')](function(_0x37eb49){return respondWithRpcPromise(_0xd9ff('0xdc'),_0xd9ff('0xdd'),_0x5c4138[_0xd9ff('0x3f')],client9004);})[_0xd9ff('0x22')](respondWithResult(_0x560ea2,null))[_0xd9ff('0x2d')](handleError(_0x560ea2,null));};exports[_0xd9ff('0xde')]=function(_0x3b05c4,_0x32c04e,_0x1bcf8f){_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0x3c')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe0')];_0x3b05c4[_0xd9ff('0x3f')][_0xd9ff('0xe1')]=_0x3b05c4[_0xd9ff('0xdf')][_0xd9ff('0xe2')];_0x3b05c4['body'][_0xd9ff('0x4c')]=_0x3b05c4[_0xd9ff('0xdf')]['mimetype'];return db[_0xd9ff('0xe3')][_0xd9ff('0xd5')](_0x3b05c4[_0xd9ff('0x3f')])[_0xd9ff('0x22')](respondWithResult(_0x32c04e,0xc9))[_0xd9ff('0x2d')](handleError(_0x32c04e,null));};exports[_0xd9ff('0xe4')]=function(_0x5978ad,_0x4ddfe7,_0x30c520){return db['ChatInteraction']['findOne']({'where':{'id':_0x5978ad[_0xd9ff('0xbe')]['id']},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null))['then'](function(_0x327362){if(_0x327362){if(_0x327362[_0xd9ff('0xda')]){return _0x4ddfe7[_0xd9ff('0x35')](0x193)[_0xd9ff('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xd9ff('0xe3')][_0xd9ff('0xc4')]({'where':{'id':_0x5978ad['query'][_0xd9ff('0xe5')]},'raw':!![]})[_0xd9ff('0x22')](handleEntityNotFound(_0x4ddfe7,null));}})['then'](function(_0x62f1f3){if(_0x62f1f3){var _0xd188cf=_0x62f1f3[_0xd9ff('0xe6')]!==null;var _0x5b2e9c=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],_0xd9ff('0xe9'));if(_0xd188cf){_0x5b2e9c=path['join'](_0x5b2e9c,_0xd9ff('0xea'));}var _0x53a25a=path[_0xd9ff('0xe7')](_0x5b2e9c,_0x62f1f3[_0xd9ff('0xe1')]);return _0x4ddfe7[_0xd9ff('0xeb')](_0x53a25a);}})[_0xd9ff('0x2d')](handleError(_0x4ddfe7,null));};exports[_0xd9ff('0xec')]=function(_0x10397d,_0x51039f){var _0x37ea50=null;var _0x3cf2ef=null;var _0x171195=null;var _0x24c066=null;if(_0x10397d[_0xd9ff('0x3f')]['id']){delete _0x10397d['body']['id'];}if(_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]){_0x24c066=path['join'](config[_0xd9ff('0xe8')],_0xd9ff('0xee'),util[_0xd9ff('0xef')](_0xd9ff('0xf0'),Date[_0xd9ff('0xf1')]()));_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xf2')]=_0x24c066;}return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x10397d[_0xd9ff('0xbe')]['id']},'include':[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'include':[{'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c')}]}]})[_0xd9ff('0x22')](handleEntityNotFound(_0x51039f,null))[_0xd9ff('0x22')](saveUpdates(_0x10397d['body'],null))['then'](function(_0x497e36){if(_0x497e36){_0x37ea50=_0x497e36;return db[_0xd9ff('0xc5')]['find']({'where':{'id':_0x37ea50[_0xd9ff('0x81')]}});}})['then'](function(_0x4d4cc0){if(_0x4d4cc0){_0x171195=_0x4d4cc0;return db['CmContact'][_0xd9ff('0xc0')]({'where':{'id':_0x37ea50['ContactId']}});}})['then'](function(_0x474b4c){if(_0x474b4c){_0x3cf2ef=_0x474b4c;if(_0x24c066){var _0x144cf7=null;for(var _0x9eac7f=0x1;_0x9eac7f<_0x37ea50[_0xd9ff('0xf3')][_0xd9ff('0x54')];++_0x9eac7f){_0x144cf7=_0x37ea50[_0xd9ff('0xf3')][_0x9eac7f];var _0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');var _0x4531bc=_0x10397d['body']['customer']||util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0xd9ff('0xf7'),_0x144cf7[_0xd9ff('0x76')]);switch(_0x171195[_0xd9ff('0xf8')]){case _0xd9ff('0xf9'):_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')]('%s%d',_0x171195[_0xd9ff('0xf5')],_0x144cf7[_0xd9ff('0x7e')]):_0xd9ff('0xf6');break;case _0xd9ff('0xfa'):_0x2450da=_0x144cf7['UserId']?_0x144cf7['User'][_0xd9ff('0xfb')]||_0x144cf7[_0xd9ff('0x7c')]['fullname']:_0xd9ff('0xf6');break;case _0xd9ff('0xfc'):_0x2450da=_0x144cf7['UserId']?_0x144cf7[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6');break;default:_0x2450da=_0x144cf7[_0xd9ff('0x7e')]?util[_0xd9ff('0xef')](_0xd9ff('0xf4'),_0x171195[_0xd9ff('0xf5')],_0x144cf7['UserId']):_0xd9ff('0xf6');}var _0x62b518=util[_0xd9ff('0xef')](_0xd9ff('0xfd'),moment(_0x144cf7[_0xd9ff('0x84')])['format'](_0xd9ff('0xfe')),_0x144cf7[_0xd9ff('0xff')]==='in'?_0x4531bc:_0x2450da,_0x144cf7[_0xd9ff('0x3f')]);if(!_0x144cf7['secret']){fs[_0xd9ff('0x100')](_0x24c066,_0x62b518);}}return db[_0xd9ff('0x101')][_0xd9ff('0xc4')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xd9ff('0x102'),'raw':!![]}]});}}})['then'](function(_0x5e07ae){if(_0x5e07ae&&_0x5e07ae['Smtp']&&_0x10397d['body']){var _0x578f41={'tls':{'rejectUnauthorized':![]}};if(_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')]){_0x578f41['service']=_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x103')];}else{_0x578f41[_0xd9ff('0x104')]=_0x5e07ae['Smtp'][_0xd9ff('0x104')];_0x578f41['port']=_0x5e07ae['Smtp'][_0xd9ff('0x105')];_0x578f41[_0xd9ff('0x106')]=_0x5e07ae[_0xd9ff('0x102')]['secure'];}if(_0x5e07ae['Smtp'][_0xd9ff('0x107')]){_0x578f41[_0xd9ff('0x108')]={'user':_0x5e07ae['Smtp'][_0xd9ff('0xa1')],'pass':_0x5e07ae[_0xd9ff('0x102')][_0xd9ff('0x109')]};}return respondWithRpcPromise(_0xd9ff('0x10a'),_0xd9ff('0x10b'),{'account':_0x578f41,'message':{'from':util[_0xd9ff('0xef')](_0xd9ff('0x10c'),_0x5e07ae['name'],_0x5e07ae[_0xd9ff('0xc9')]||_0x5e07ae[_0xd9ff('0x102')]['user']),'to':_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')],'subject':'Mail\x20Transcript','text':util[_0xd9ff('0xef')]('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x10397d[_0xd9ff('0x3f')][_0xd9ff('0xed')]),'attachments':[{'path':_0x24c066}]}})['then'](function(){return _0x37ea50;})[_0xd9ff('0x2d')](function(_0x4d6172){console[_0xd9ff('0x2a')](_0x4d6172);});}else{return _0x37ea50;}})[_0xd9ff('0x22')](respondWithStatusCode(_0x51039f,0xc8))[_0xd9ff('0x2d')](handleError(_0x51039f,null));};exports[_0xd9ff('0x10d')]=function(_0x6a2524,_0x356583,_0x5c1165){return db['ChatMessage'][_0xd9ff('0xc0')]({'where':{'id':_0x6a2524['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x356583,null))[_0xd9ff('0x22')](function(_0x599273){if(_0x599273){return _0x599273['addMessage'](_0x6a2524['body'][_0xd9ff('0x10e')],_[_0xd9ff('0x10f')](_0x6a2524[_0xd9ff('0x3f')],['ids','id'])||{});}})[_0xd9ff('0x22')](respondWithResult(_0x356583,null))[_0xd9ff('0x2d')](handleError(_0x356583,null));};exports[_0xd9ff('0x110')]=function(_0x2832b7,_0x618c47,_0x109140){var _0x278670={'raw':![],'where':{}};var _0x5e064d={};var _0x231b46={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0x2832b7[_0xd9ff('0xbe')]['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x618c47,null))[_0xd9ff('0x22')](function(_0x1802b1){if(_0x1802b1){_0x5e064d[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')][_0xd9ff('0x4a')]);_0x5e064d['query']=_['keys'](_0x2832b7[_0xd9ff('0x4e')]);_0x5e064d['filters']=_['intersection'](_0x5e064d[_0xd9ff('0x50')],_0x5e064d[_0xd9ff('0x4e')]);_0x278670[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x5e064d[_0xd9ff('0x50')],qs['fields'](_0x2832b7[_0xd9ff('0x4e')]['fields']));_0x278670[_0xd9ff('0x53')]=_0x278670[_0xd9ff('0x53')]['length']?_0x278670[_0xd9ff('0x53')]:_0x5e064d[_0xd9ff('0x50')];if(!_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x278670[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0x2832b7['query'][_0xd9ff('0x33')]);_0x278670[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x31')]);}_0x278670[_0xd9ff('0x9c')]=qs['sort'](_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x57')]);_0x278670[_0xd9ff('0x82')]=qs['filters'](_[_0xd9ff('0x58')](_0x2832b7['query'],_0x5e064d[_0xd9ff('0x4f')]));_0x278670['where'][_0xd9ff('0x111')]=_0x1802b1['id'];if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x278670['where']=_[_0xd9ff('0x3e')](_0x278670['where'],{'$or':_[_0xd9ff('0x79')](_0x278670[_0xd9ff('0x53')],function(_0x2b2a50){var _0x34f3f0={};_0x34f3f0[_0x2b2a50]={'$like':'%'+_0x2832b7[_0xd9ff('0x4e')]['filter']+'%'};return _0x34f3f0;})});}if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')]){var _0x955328=_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0x86')][_0xd9ff('0x46')](',');var _0x5d95b1={};_0x5d95b1[_0x955328[0x0]]={'$gte':moment(_0x955328[0x1])['format'](_0xd9ff('0x112'))};_0x278670[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x278670[_0xd9ff('0x82')],_0x5d95b1);}_0x278670=_[_0xd9ff('0x3e')]({},_0x278670,_0x2832b7[_0xd9ff('0x113')]);return db[_0xd9ff('0xd4')]['count']({'where':_0x278670[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x3e90fe){_0x231b46[_0xd9ff('0x34')]=_0x3e90fe;if(_0x2832b7[_0xd9ff('0x4e')][_0xd9ff('0xbf')]){_0x278670['include']=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x278670);})[_0xd9ff('0x22')](function(_0x33f933){_0x231b46[_0xd9ff('0x115')]=_0x33f933;return _0x231b46;});}})[_0xd9ff('0x22')](respondWithFilteredResult(_0x618c47,_0x278670))['catch'](handleError(_0x618c47,null));};exports['getMyMessages']=function(_0xf3a93b,_0x473ecf,_0x1213a4){var _0x6f731a={'where':{}},_0x193c57={},_0x4572b2={'count':0x0,'rows':[]};return db[_0xd9ff('0x49')][_0xd9ff('0xc4')]({'where':{'id':_0xf3a93b['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x473ecf,null))[_0xd9ff('0x22')](function(_0x4115a3){if(_0x4115a3){_0x193c57[_0xd9ff('0x50')]=_[_0xd9ff('0x4d')](db[_0xd9ff('0xd4')]['rawAttributes']);_0x193c57[_0xd9ff('0x4e')]=_['keys'](_0xf3a93b['query']);_0x193c57[_0xd9ff('0x4f')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],_0x193c57[_0xd9ff('0x4e')]);_0x6f731a[_0xd9ff('0x53')]=_[_0xd9ff('0x51')](_0x193c57[_0xd9ff('0x50')],qs[_0xd9ff('0x52')](_0xf3a93b['query'][_0xd9ff('0x52')]));_0x6f731a['attributes']=_0x6f731a[_0xd9ff('0x53')][_0xd9ff('0x54')]?_0x6f731a[_0xd9ff('0x53')]:_0x193c57[_0xd9ff('0x50')];if(!_0xf3a93b['query'][_0xd9ff('0x55')](_0xd9ff('0x56'))){_0x6f731a[_0xd9ff('0x33')]=qs[_0xd9ff('0x33')](_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x33')]);_0x6f731a[_0xd9ff('0x31')]=qs[_0xd9ff('0x31')](_0xf3a93b[_0xd9ff('0x4e')]['offset']);}_0x6f731a[_0xd9ff('0x9c')]=qs['sort'](_0xf3a93b['query'][_0xd9ff('0x57')]);_0x6f731a[_0xd9ff('0x82')]=qs[_0xd9ff('0x4f')](_[_0xd9ff('0x58')](_0xf3a93b[_0xd9ff('0x4e')],_0x193c57[_0xd9ff('0x4f')]));_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x111')]=_0x4115a3['id'];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x90')]){_0x6f731a[_0xd9ff('0x82')]=_[_0xd9ff('0x3e')](_0x6f731a['where'],{'$or':_[_0xd9ff('0x79')](_0x6f731a['attributes'],function(_0x1bb980){var _0x3ccf5d={};_0x3ccf5d[_0x1bb980]={'$like':'%'+_0xf3a93b['query']['filter']+'%'};return _0x3ccf5d;})});}_0x6f731a[_0xd9ff('0x82')][_0xd9ff('0x116')]=![];if(_0xf3a93b['query']['id']){_0x6f731a[_0xd9ff('0x82')]['id']={'$gt':_0xf3a93b[_0xd9ff('0x4e')]['id']};}_0x6f731a=_['merge']({},_0x6f731a,_0xf3a93b[_0xd9ff('0x113')]);return db['ChatMessage'][_0xd9ff('0x34')]({'where':_0x6f731a[_0xd9ff('0x82')]})[_0xd9ff('0x22')](function(_0x42d9ff){_0x4572b2[_0xd9ff('0x34')]=_0x42d9ff;_0x6f731a[_0xd9ff('0x117')]=[];if(_0xf3a93b[_0xd9ff('0x4e')][_0xd9ff('0x118')]){_0x6f731a[_0xd9ff('0x117')][_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43'),_0xd9ff('0xfb')]});}if(_0xf3a93b['query'][_0xd9ff('0xbf')]){_0x6f731a[_0xd9ff('0x117')]=[{'all':!![]}];}return db[_0xd9ff('0xd4')][_0xd9ff('0x114')](_0x6f731a);})[_0xd9ff('0x22')](function(_0x314f18){_0x4572b2['rows']=_0x314f18;return _0x4572b2;});}})['then'](respondWithFilteredResult(_0x473ecf,_0x6f731a))['catch'](handleError(_0x473ecf,null));};exports['addTags']=function(_0x4699d3,_0x2e91a8,_0x4956b2){return db[_0xd9ff('0x49')][_0xd9ff('0xc0')]({'where':{'id':_0x4699d3[_0xd9ff('0xbe')]['id']}})['then'](handleEntityNotFound(_0x2e91a8,null))['then'](function(_0x217023){if(_0x217023){return _0x217023[_0xd9ff('0x11a')](_0x4699d3['body']['ids'],_['omit'](_0x4699d3['body'],['ids','id'])||{})[_0xd9ff('0x11b')](function(){return db[_0xd9ff('0x11c')][_0xd9ff('0x114')]({'attributes':['id',_0xd9ff('0x3c'),_0xd9ff('0x5b')],'where':{'id':_0x4699d3[_0xd9ff('0x3f')][_0xd9ff('0x10e')]}});})[_0xd9ff('0x22')](function(_0x317f93){socket[_0xd9ff('0x11d')](_0xd9ff('0x11e'),{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]});return{'id':Number(_0x4699d3[_0xd9ff('0xbe')]['id']),'tags':_0x317f93||[]};});}})[_0xd9ff('0x22')](respondWithResult(_0x2e91a8,null))[_0xd9ff('0x2d')](handleError(_0x2e91a8,null));};exports[_0xd9ff('0x11f')]=function(_0x404baf,_0x5d73cd,_0xdb719b){return db['ChatInteraction'][_0xd9ff('0xc0')]({'where':{'id':_0x404baf['params']['id']}})[_0xd9ff('0x22')](handleEntityNotFound(_0x5d73cd,null))[_0xd9ff('0x22')](function(_0x10935d){if(_0x10935d){return _0x10935d['removeTags'](_0x404baf['query']['ids']);}})['then'](respondWithStatusCode(_0x5d73cd,null))['catch'](handleError(_0x5d73cd,null));};exports[_0xd9ff('0xeb')]=function(_0x2031e9,_0x3b50d9){var _0x410fae=moment()[_0xd9ff('0x120')]()[_0xd9ff('0xbb')]();var _0x494da6=path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server','files',_0xd9ff('0x121'));var _0x49c9cc=path[_0xd9ff('0xe7')](config['root'],_0xd9ff('0x122'),_0xd9ff('0x123'),'attachments');var _0x378746=path[_0xd9ff('0xe7')](_0x494da6,_0x410fae);var _0x2acbe3=util[_0xd9ff('0xef')]('transcript-%d-%s.zip',_0x2031e9['params']['id'],_0x410fae);var _0x46d12c=path[_0xd9ff('0xe7')](_0x494da6,_0x2acbe3);var _0x54f4aa=[];_0x54f4aa[_0xd9ff('0x119')]({'model':db['User'],'as':_0xd9ff('0x7c'),'attributes':['id',_0xd9ff('0x43')],'raw':!![]});_0x54f4aa[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x124')],'as':_0xd9ff('0x71'),'attributes':['id',_0xd9ff('0x125'),'lastName'],'raw':!![]});if(_0x2031e9['query'][_0xd9ff('0x126')]){_0x54f4aa['push']({'model':db[_0xd9ff('0xe3')],'as':'Attachment','raw':!![]});}var _0xd015e9=[{'model':db[_0xd9ff('0xd4')],'as':_0xd9ff('0xf3'),'attributes':['id','body',_0xd9ff('0x84'),_0xd9ff('0xff'),'secret','read'],'include':_0x54f4aa}];_0xd015e9['push']({'model':db[_0xd9ff('0xc5')],'as':_0xd9ff('0x127'),'attributes':['id',_0xd9ff('0x3c')]});_0xd015e9[_0xd9ff('0x119')]({'model':db[_0xd9ff('0x7c')],'as':_0xd9ff('0x128'),'attributes':['id',_0xd9ff('0x43')]});return db[_0xd9ff('0x49')]['find']({'where':{'id':_0x2031e9[_0xd9ff('0xbe')]['id']},'include':_0xd015e9})[_0xd9ff('0x22')](handleEntityNotFound(_0x3b50d9,null))[_0xd9ff('0x22')](function(_0x1b452e){if(_0x1b452e){var _0x3ab927=_0x1b452e[_0xd9ff('0x129')]({'plain':!![]});fs[_0xd9ff('0x12a')](_0x378746);var _0x2b6e15={'channel':_0xd9ff('0x12b'),'account':_0x3ab927['Account']['name'],'agent':_0x3ab927['Owner']?_0x3ab927[_0xd9ff('0x128')][_0xd9ff('0x43')]:'N.A.','createdAt':moment(_0x3ab927[_0xd9ff('0x84')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd9ff('0xbb')](),'closedAt':_0x3ab927[_0xd9ff('0xda')]?moment(_0x3ab927[_0xd9ff('0x12c')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')]():'','disposition':_0x3ab927['disposition'],'chatInfo':{'browser':_0x3ab927[_0xd9ff('0x12d')],'os':_0x3ab927[_0xd9ff('0x12e')],'referer':_0x3ab927[_0xd9ff('0x12f')],'customerIp':_0x3ab927[_0xd9ff('0x130')],'customerPort':_0x3ab927[_0xd9ff('0x131')]?_0x3ab927['customerPort']:'N.A.'},'messages':_(_0x3ab927[_0xd9ff('0xf3')])[_0xd9ff('0x132')]()[_0xd9ff('0x90')]({'secret':![]})[_0xd9ff('0x79')](function(_0x319248){if(_0x319248[_0xd9ff('0xe3')]){var _0x1ea603=path[_0xd9ff('0xe7')](_0x49c9cc,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')]);if(fs[_0xd9ff('0x133')](_0x1ea603)){fs[_0xd9ff('0x134')](_0x1ea603)[_0xd9ff('0x135')](fs['createWriteStream'](path[_0xd9ff('0xe7')](_0x378746,_0x319248[_0xd9ff('0xe3')][_0xd9ff('0xe1')])));}}return{'date':moment(_0x319248[_0xd9ff('0x84')])[_0xd9ff('0xef')](_0xd9ff('0x112'))[_0xd9ff('0xbb')](),'sender':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?_0x319248[_0xd9ff('0x7c')]?_0x319248[_0xd9ff('0x7c')][_0xd9ff('0x43')]:_0xd9ff('0xf6'):_0x319248['Contact'][_0xd9ff('0x125')]+(_0x319248[_0xd9ff('0x71')][_0xd9ff('0x136')]?'\x20'+_0x319248[_0xd9ff('0x71')]['lastName']:''),'body':_0x319248[_0xd9ff('0xe3')]?_0x319248['Attachment']['basename']:_0x319248[_0xd9ff('0x3f')],'direction':_0x319248[_0xd9ff('0xff')]===_0xd9ff('0xd3')?'A':'C','secret':_0x319248[_0xd9ff('0x116')],'read':_0x319248[_0xd9ff('0x8c')],'attachment':_0x319248[_0xd9ff('0xe3')]};})[_0xd9ff('0x6d')]()};return ejs['renderFile'](path[_0xd9ff('0xe7')](config[_0xd9ff('0xe8')],'server',_0xd9ff('0x137'),_0xd9ff('0x138')),{'interaction':_0x2b6e15})[_0xd9ff('0x22')](function(_0xb07a14){var _0x1c419f=path[_0xd9ff('0xe7')](_0x378746,_0xd9ff('0x139')+_0x3ab927['id']+'-'+_0x410fae+_0xd9ff('0x13a'));var _0x3156c8={'path':_0x1c419f,'channel':_0xd9ff('0x12b'),'interactionId':_0x3ab927['id']};return pdf[_0xd9ff('0x13b')](_0xb07a14,_0x3156c8);})['then'](function(){return new BPromise(function(_0x567007,_0x1019f9){zipdir(_0x378746,{'saveTo':_0x46d12c},function(_0x2ab78a,_0x4649d9){if(_0x2ab78a)return _0x1019f9(_0x2ab78a);return _0x567007(_0x4649d9);});})[_0xd9ff('0x22')](function(){return new BPromise(function(_0x166033,_0x3c40e4){rimraf(_0x378746,function(_0x346d93){if(_0x346d93)_0x3c40e4(_0x346d93);return _0x166033();});});})[_0xd9ff('0x22')](function(){return _0x3b50d9['download'](_0x46d12c,_0x2acbe3,function(_0x22680e){if(_0x22680e){console['log'](_0xd9ff('0x13c'),_0x22680e);}else{fs[_0xd9ff('0x13d')](_0x46d12c);}});});});}else{return _0x3b50d9['sendStatus'](0xc8);}})[_0xd9ff('0x2d')](handleError(_0x3b50d9,null));};
\ No newline at end of file
+var _0x0b0e=['closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','attachId','ChatOfflineMessageId','join','root','offline-chat/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','%s%d','agentAlias','customer','Visitor','agentIdentifier','website_alias','System','agent_alias','alias','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','SendMail','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','includeAgent','spread','chatInteractionTags:save','removeTags','files','tmp','attachments','lastName','Account','Owner','get','mkdirSync','N.A.','browserName','customerIp','customerPort','createReadStream','pipe','createWriteStream','firstName','renderFile','server','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','log','err','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','http','then','request\x20sent','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','send','merge','body','contact','interaction','account','Users','map','TagIds','split','forEach','Tags','push','index','ChatInteraction','rawAttributes','fieldName','type','name','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','pick','field','color','from','tools_tags','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','select','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','createdAt','parse','$gte','$lte','null','read','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isNumeric','i.id\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','t.id\x20IN\x20?','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','role','agent','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','ChatWebsiteId','sequelize','toString','Account.key','a.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','all','rows','show','params','filters','includeAll','include','options','create','describe','createVidaooSession','ChatWebsite','findOne','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','fullname','email','POST','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned'];(function(_0x529b89,_0x4c0cd6){var _0x5e7124=function(_0x477328){while(--_0x477328){_0x529b89['push'](_0x529b89['shift']());}};_0x5e7124(++_0x4c0cd6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x542da8,_0x509c26){_0x542da8=_0x542da8-0x0;var _0x533d7e=_0x0b0e[_0x542da8];return _0x533d7e;};'use strict';var emlformat=require(_0xe0b0('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe0b0('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0b0('0x2'));var moment=require(_0xe0b0('0x3'));var BPromise=require(_0xe0b0('0x4'));var Mustache=require(_0xe0b0('0x5'));var util=require(_0xe0b0('0x6'));var path=require(_0xe0b0('0x7'));var sox=require(_0xe0b0('0x8'));var csv=require(_0xe0b0('0x9'));var ejs=require(_0xe0b0('0xa'));var fs=require('fs');var fs_extra=require(_0xe0b0('0xb'));var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0x9'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var pdf=require(_0xe0b0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0b0('0x14'))(_0xe0b0('0x15'));var utils=require(_0xe0b0('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xe0b0('0x17'));var db=require(_0xe0b0('0x18'))['db'];config[_0xe0b0('0x19')]=_[_0xe0b0('0x1a')](config[_0xe0b0('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xe0b0('0x1b'))(new Redis(config[_0xe0b0('0x19')]));require(_0xe0b0('0x1c'))[_0xe0b0('0x1d')](socket);var jayson=require(_0xe0b0('0x1e'));var client=jayson['client'][_0xe0b0('0x1f')]({'port':0x232b});var client9004=jayson['client'][_0xe0b0('0x1f')]({'port':0x232c});function respondWithRpcPromise(_0xadee6e,_0x519ae8,_0x11fdca,_0x4a4cc0){return new BPromise(function(_0x2d6fb6,_0x100204){var _0x56bcc7=_0x4a4cc0||client;return _0x56bcc7['request'](_0xadee6e,_0x11fdca)[_0xe0b0('0x20')](function(_0x50a441){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'));logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x519ae8,_0xe0b0('0x21'),JSON['stringify'](_0x50a441));if(_0x50a441[_0xe0b0('0x22')]){if(_0x50a441['error'][_0xe0b0('0x23')]===0x1f4){logger[_0xe0b0('0x22')](_0xe0b0('0x24'),_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x100204(_0x50a441['error']['message']);}logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x50a441[_0xe0b0('0x22')][_0xe0b0('0x25')]);return _0x2d6fb6(_0x50a441['error'][_0xe0b0('0x25')]);}else{logger['info'](_0xe0b0('0x24'),_0x519ae8,'request\x20sent');_0x2d6fb6(_0x50a441[_0xe0b0('0x26')]['message']);}})[_0xe0b0('0x27')](function(_0x4de537){logger[_0xe0b0('0x22')]('ChatInteraction,\x20%s,\x20%s',_0x519ae8,_0x4de537);_0x100204(_0x4de537);});});}function respondWithStatusCode(_0x3c221d,_0x5c5317){_0x5c5317=_0x5c5317||0xcc;return function(_0x362aba){if(_0x362aba){return _0x3c221d[_0xe0b0('0x28')](_0x5c5317);}return _0x3c221d[_0xe0b0('0x29')](_0x5c5317)[_0xe0b0('0x2a')]();};}function respondWithResult(_0x3ec2,_0x10745d){_0x10745d=_0x10745d||0xc8;return function(_0x5200a6){if(_0x5200a6){return _0x3ec2[_0xe0b0('0x29')](_0x10745d)[_0xe0b0('0x2b')](_0x5200a6);}};}function respondWithFilteredResult(_0x5b7a64,_0x15e13b){return function(_0x419b1f){if(_0x419b1f){var _0x36d137=typeof _0x15e13b[_0xe0b0('0x2c')]===_0xe0b0('0x2d')&&typeof _0x15e13b[_0xe0b0('0x2e')]===_0xe0b0('0x2d');var _0x4fb3b7=_0x419b1f[_0xe0b0('0x2f')];var _0x3c0109=_0x36d137?0x0:_0x15e13b['offset'];var _0x4fe400=_0x36d137?_0x419b1f[_0xe0b0('0x2f')]:_0x15e13b[_0xe0b0('0x2c')]+_0x15e13b[_0xe0b0('0x2e')];var _0x3f81d5;if(_0x4fe400>=_0x4fb3b7){_0x4fe400=_0x4fb3b7;_0x3f81d5=0xc8;}else{_0x3f81d5=0xce;}_0x5b7a64[_0xe0b0('0x29')](_0x3f81d5);return _0x5b7a64['set'](_0xe0b0('0x30'),_0x3c0109+'-'+_0x4fe400+'/'+_0x4fb3b7)[_0xe0b0('0x2b')](_0x419b1f);}return null;};}function patchUpdates(_0x7867c4){return function(_0x29d725){try{jsonpatch[_0xe0b0('0x31')](_0x29d725,_0x7867c4,!![]);}catch(_0x4fe835){return BPromise[_0xe0b0('0x32')](_0x4fe835);}return _0x29d725[_0xe0b0('0x33')]();};}function saveUpdates(_0xfc51d3,_0x31c6f5){return function(_0x3575bc){if(_0x3575bc){return _0x3575bc[_0xe0b0('0x34')](_0xfc51d3)[_0xe0b0('0x20')](function(_0x20908f){return _0x20908f;});}return null;};}function removeEntity(_0x2125d5,_0x1dd010){return function(_0xd56467){if(_0xd56467){return _0xd56467[_0xe0b0('0x35')]()[_0xe0b0('0x20')](function(){_0x2125d5[_0xe0b0('0x29')](0xcc)[_0xe0b0('0x2a')]();});}};}function handleEntityNotFound(_0x4cf80c,_0x121608){return function(_0x135be5){if(!_0x135be5){_0x4cf80c[_0xe0b0('0x28')](0x194);}return _0x135be5;};}function handleError(_0x1eb3f9,_0x1a2d24){_0x1a2d24=_0x1a2d24||0x1f4;return function(_0x2c6e60){logger[_0xe0b0('0x22')](_0x2c6e60['stack']);if(_0x2c6e60['name']){delete _0x2c6e60['name'];}_0x1eb3f9['status'](_0x1a2d24)[_0xe0b0('0x36')](_0x2c6e60);};}function getMustacheRender(_0xc3d967,_0xe6f635){return Mustache['render'](_0xc3d967,_[_0xe0b0('0x37')](_0xe6f635[_0xe0b0('0x38')],{'contact':_0xe6f635[_0xe0b0('0x39')],'message':_0xe6f635[_0xe0b0('0x25')],'agent':_0xe6f635['agent'],'interaction':_0xe6f635[_0xe0b0('0x3a')],'account':_0xe6f635[_0xe0b0('0x3b')]}))||'';}function getInteractionUsers(_0x43d352,_0x30dcbb){return new BPromise(function(_0x4265e3,_0x1205db){try{if(_0x30dcbb[_0x43d352['id']]){_0x43d352[_0xe0b0('0x3c')]=_[_0xe0b0('0x3d')](_0x30dcbb[_0x43d352['id']],function(_0xeaffbb){return{'id':_0xeaffbb['id'],'fullname':_0xeaffbb['fullname']};});}}catch(_0x3e349b){_0x1205db(_0x3e349b);}_0x4265e3(_0x43d352);});}function getInteractionTags(_0x54f646,_0x34178d){return new BPromise(function(_0x2d5f47,_0x46c4ea){try{if(_0x54f646[_0xe0b0('0x3e')]){_0x54f646['Tags']=[];_0x54f646[_0xe0b0('0x3e')][_0xe0b0('0x3f')](',')[_0xe0b0('0x40')](function(_0x402a0e){_0x54f646[_0xe0b0('0x41')][_0xe0b0('0x42')](_0x34178d[_0x402a0e]);});}delete _0x54f646[_0xe0b0('0x3e')];}catch(_0x3bde8b){_0x46c4ea(_0x3bde8b);}_0x2d5f47(_0x54f646);});}function updateChatInteraction(_0x52ffe4,_0x2aad80,_0x309bbf){return new BPromise(function(_0x528818,_0x515bd2){return getInteractionUsers(_0x52ffe4,_0x309bbf)[_0xe0b0('0x20')](function(_0x247f8d){return getInteractionTags(_0x247f8d,_0x2aad80);})['then'](function(_0x18a59d){_0x528818(_0x18a59d);})[_0xe0b0('0x27')](function(_0x6bca5c){_0x515bd2(_0x6bca5c);});});}exports[_0xe0b0('0x43')]=function(_0x1a8cc7,_0x5c31b5){var _0x5d2fa2={},_0x51c580={},_0xc3235b={'count':0x0,'rows':[]};var _0x38e715=_['map'](db[_0xe0b0('0x44')][_0xe0b0('0x45')],function(_0x14197b){return{'name':_0x14197b[_0xe0b0('0x46')],'type':_0x14197b[_0xe0b0('0x47')]['key']};});_0x51c580['model']=_[_0xe0b0('0x3d')](_0x38e715,_0xe0b0('0x48'));_0x51c580[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1a8cc7[_0xe0b0('0x49')]);_0x51c580['filters']=_[_0xe0b0('0x4b')](_0x51c580[_0xe0b0('0x4c')],_0x51c580['query']);_0x5d2fa2['attributes']=_['intersection'](_0x51c580[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x5d2fa2['attributes']=_0x5d2fa2[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5d2fa2['attributes']:_0x51c580['model'];if(!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x50')]('nolimit')){_0x5d2fa2[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1a8cc7['query']['limit']);_0x5d2fa2[_0xe0b0('0x2c')]=qs['offset'](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x2c')]);}_0x5d2fa2[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5d2fa2['where']=qs['filters'](_[_0xe0b0('0x53')](_0x1a8cc7['query'],_0x51c580['filters']),_0x38e715);var _0x249d9a=[];var _0x222174=squel['select']()['field']('id')[_0xe0b0('0x54')](_0xe0b0('0x48'))[_0xe0b0('0x54')](_0xe0b0('0x55'))[_0xe0b0('0x56')](_0xe0b0('0x57'));var _0x84fabb=squel['select']()[_0xe0b0('0x54')]('u.id')[_0xe0b0('0x54')]('u.fullname')['field'](_0xe0b0('0x58'))[_0xe0b0('0x56')](_0xe0b0('0x59'),'ui')[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'u',_0xe0b0('0x5c'));var _0x4548da=squel[_0xe0b0('0x5d')]()[_0xe0b0('0x56')]('chat_interactions','i')[_0xe0b0('0x5a')]('cm_contacts','c',_0xe0b0('0x5e'))[_0xe0b0('0x5a')](_0xe0b0('0x5b'),'o',_0xe0b0('0x5f'))[_0xe0b0('0x5a')](_0xe0b0('0x60'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0xe0b0('0x5a')](_0xe0b0('0x61'),'me',_0xe0b0('0x62'))[_0xe0b0('0x5a')](_0xe0b0('0x63'),'it',_0xe0b0('0x64'))[_0xe0b0('0x5a')](_0xe0b0('0x57'),'t',_0xe0b0('0x65'));var _0xf331df=squel[_0xe0b0('0x66')]();var _0x18ab99=[];var _0xc719d2=squel[_0xe0b0('0x66')]();var _0xcdf97;if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x67')]){_0xcdf97=as[_0xe0b0('0x68')](_0x1a8cc7['query'][_0xe0b0('0x67')]);var _0xe7fbac=_0xcdf97[_0xe0b0('0x69')];for(var _0x2f24e6=0x0;_0x2f24e6<_0xcdf97[_0xe0b0('0x6a')][_0xe0b0('0x4f')];_0x2f24e6++){var _0x2bdb59=_0xcdf97['conditions'][_0x2f24e6];var _0x47dcc4='i';var _0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0x2bdb59['field']]);if(!_0x139014){switch(_0x2bdb59[_0xe0b0('0x54')]){case _0xe0b0('0x6c'):if(_0x2bdb59[_0xe0b0('0x6d')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+'`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')]('`'+_0x2bdb59[_0xe0b0('0x54')]+_0xe0b0('0x6f'));}break;case'Contact':if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){if(_0x2bdb59['value'][_0xe0b0('0x3f')]('\x20')['length']>0x1){_0xf331df[_0xe7fbac]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xe0b0('0x72')](_0x2bdb59['value']),null);}else{var _0x4d75e4='%'+_0x2bdb59[_0xe0b0('0x6d')]+'%';_0xf331df[_0xe7fbac](_0xe0b0('0x73'),_0x4d75e4,_0x4d75e4,_0x4d75e4);}}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),'ContactId']);_0x2bdb59[_0xe0b0('0x54')]=_0xe0b0('0x74');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')]['end']);}break;case'Tag':var _0x4b41a=_0x2bdb59[_0xe0b0('0x6d')][_0xe0b0('0x3f')](',')['map'](function(_0x49b754){return Number(_0x49b754);});_0x4b41a[_0xe0b0('0x40')](function(_0x26f36f){_0xc719d2['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x26f36f+',%');});_0x18ab99=_['union'](_0x18ab99,_0x4b41a);break;case _0xe0b0('0x78'):if(_0x2bdb59[_0xe0b0('0x70')]===_0xe0b0('0x71')){_0xf331df[_0xe7fbac](_0xe0b0('0x79'),'%'+_0x2bdb59[_0xe0b0('0x6d')]+'%',null);}else{_0x139014=_[_0xe0b0('0x6b')](_0x38e715,[_0xe0b0('0x48'),_0xe0b0('0x7a')]);_0x2bdb59['field']=_0xe0b0('0x7a');_0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value']['start'],_0x14da9c['value']['end']);}break;case'body':_0x14da9c=as[_0xe0b0('0x75')]('me',null,_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c['text'],_0x14da9c['value'][_0xe0b0('0x77')],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);break;}}else{var _0x14da9c=as[_0xe0b0('0x75')](_0x47dcc4,_0x139014[_0xe0b0('0x47')],_0x2bdb59);_0xf331df[_0xe7fbac](_0x14da9c[_0xe0b0('0x76')],_0x14da9c[_0xe0b0('0x6d')]['start'],_0x14da9c[_0xe0b0('0x6d')][_0xe0b0('0x2a')]);}}}else{var _0x86e90=_(_0x1a8cc7[_0xe0b0('0x49')])[_0xe0b0('0x4a')]()[_0xe0b0('0x3d')](function(_0x16a2ae){return _['some'](_0x38e715,[_0xe0b0('0x48'),_0x16a2ae])?_0x16a2ae:undefined;})['compact']()[_0xe0b0('0x6d')]();if(!_[_0xe0b0('0x7b')](_0x86e90)){_0x86e90[_0xe0b0('0x40')](function(_0x9c7221){if(_0x9c7221==='ChatWebsiteId'){_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x7d'),[]['concat'](_0x1a8cc7['query'][_0x9c7221]));}else if(_0x9c7221===_0xe0b0('0x7e')){var _0x30adc5=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x80')];var _0x31dd21=JSON[_0xe0b0('0x7f')](_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221])[_0xe0b0('0x81')];_0x4548da[_0xe0b0('0x7c')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x30adc5,_0x31dd21);}else{if(_0x1a8cc7['query'][_0x9c7221]===_0xe0b0('0x82')){_0x4548da['where']('i.'+_0x9c7221+'\x20IS\x20NULL');}else{_0x4548da['where']('i.'+_0x9c7221+'\x20=\x20?',_0x1a8cc7[_0xe0b0('0x49')][_0x9c7221]);}}});}if(_0x1a8cc7['query'][_0xe0b0('0x83')]){if(_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x83')]==0x1){_0x4548da[_0xe0b0('0x6e')]('`unreadMessages`\x20=\x200');}else{_0x4548da[_0xe0b0('0x6e')](_0xe0b0('0x84'));}}if(_0x1a8cc7['query'][_0xe0b0('0x85')]){_0x18ab99=_[_0xe0b0('0x86')](_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x85')])?_0x1a8cc7[_0xe0b0('0x49')]['tag']:new Array(_0x1a8cc7['query']['tag']);_0x18ab99['forEach'](function(_0x5c258b){_0xc719d2['or'](_0xe0b0('0x87'),'%,'+_0x5c258b+',%');});}if(_0x1a8cc7['query'][_0xe0b0('0x88')]){var _0x5f4aaf=_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x88')][_0xe0b0('0x89')]('\x5c','\x5c\x5c')[_0xe0b0('0x89')](/'/g,'\x27\x27');if(qs[_0xe0b0('0x8a')](_0x5f4aaf)){_0xf331df['or'](_0xe0b0('0x8b'),_0x5f4aaf+'%');}else{_0xf331df['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x5f4aaf))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x5f4aaf+'%');}}}_0x4548da['where'](_0xf331df);_0x4548da[_0xe0b0('0x8c')](_0xe0b0('0x8d'));var _0x264363={'type':db[_0xe0b0('0x8e')][_0xe0b0('0x8f')]['SELECT'],'raw':!![]};var _0x234716=_0x4548da[_0xe0b0('0x90')]();_0x234716[_0xe0b0('0x54')](_0xe0b0('0x8d'));_0x234716[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));if(_0x5d2fa2[_0xe0b0('0x51')]){_0x5d2fa2[_0xe0b0('0x51')]['forEach'](function(_0x589c47){var _0x6e0e9=_0x589c47[0x0]===_0xe0b0('0x92')?_0x589c47[0x0]:'i.'+_0x589c47[0x0];_0x4548da['order'](_0x6e0e9,_0x589c47[0x1]===_0xe0b0('0x93')?![]:!![]);});}if(!_[_0xe0b0('0x7b')](_0x18ab99)){_0x4548da[_0xe0b0('0x6e')](_0xc719d2);_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x94'),_0x18ab99);}BPromise[_0xe0b0('0x95')]()[_0xe0b0('0x20')](function(){if(!_0xcdf97){if(_0x1a8cc7[_0xe0b0('0x49')]['ChatWebsiteId'])return;_0x234716['where']('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');_0x4548da[_0xe0b0('0x7c')](_0xe0b0('0x96'));return;}if(_0x1a8cc7['user'][_0xe0b0('0x97')]!==_0xe0b0('0x98'))return;return _0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x9a')]({'attributes':['id'],'raw':!![]})['then'](function(_0x56c4b9){if(_['isEmpty'](_0x56c4b9)){_0x234716[_0xe0b0('0x7c')](_0xe0b0('0x9b'));_0x4548da['where'](_0xe0b0('0x9b'));}else{_0x234716[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0x56c4b9,'id'));_0x4548da[_0xe0b0('0x7c')]('i.ChatWebsiteId\x20IN\x20?',_[_0xe0b0('0x3d')](_0x56c4b9,'id'));}});})['then'](function(){if(_0x1a8cc7[_0xe0b0('0x99')][_0xe0b0('0x97')]===_0xe0b0('0x98')&&!_0xcdf97&&!_0x1a8cc7[_0xe0b0('0x49')][_0xe0b0('0x9c')])return[];return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x234716[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x48497e){_0xc3235b[_0xe0b0('0x2f')]=_0x48497e[_0xe0b0('0x4f')];if(_0xc3235b[_0xe0b0('0x2f')]===0x0)return[];return db['sequelize'][_0xe0b0('0x49')](_0x222174['toString'](),_0x264363)[_0xe0b0('0x20')](function(_0x350c40){_0x249d9a=_['keyBy'](_0x350c40,'id');_0x264363=_[_0xe0b0('0x37')](_0x264363,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1a8cc7['query'][_0xe0b0('0x4d')]){_0x5d2fa2['attributes']['forEach'](function(_0x4f027c){_0x4548da[_0xe0b0('0x54')]('i.'+_0x4f027c);});}else{_0x4548da[_0xe0b0('0x54')](_0xe0b0('0x91'),_0xe0b0('0x6c'));_0x4548da[_0xe0b0('0x54')]('a.key',_0xe0b0('0x9f'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa0'),'Account.mandatoryDisposition');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa1'),'contactName');_0x4548da['field'](_0xe0b0('0xa2'));_0x4548da['field'](_0xe0b0('0xa3'),_0xe0b0('0xa4'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa5'),_0xe0b0('0xa6'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa7'),'Contact.email');_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xa8'),_0xe0b0('0xa9'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaa'),'Contact.mobile');_0x4548da['field'](_0xe0b0('0xab'),_0xe0b0('0xac'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xad'),_0xe0b0('0xae'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xaf'),_0xe0b0('0xb0'));_0x4548da[_0xe0b0('0x54')](_0xe0b0('0xb1'),'TagIds');}if(_0x5d2fa2[_0xe0b0('0x2e')])_0x4548da[_0xe0b0('0x2e')](_0x5d2fa2[_0xe0b0('0x2e')]);if(_0x5d2fa2[_0xe0b0('0x2c')])_0x4548da['offset'](_0x5d2fa2[_0xe0b0('0x2c')]);return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x4548da[_0xe0b0('0x9e')](),_0x264363);})[_0xe0b0('0x20')](function(_0x484cb2){if(_0x484cb2[_0xe0b0('0x4f')]>0x0)_0x84fabb['where'](_0xe0b0('0xb2'),_[_0xe0b0('0x3d')](_0x484cb2,'id'));return db[_0xe0b0('0x9d')][_0xe0b0('0x49')](_0x84fabb[_0xe0b0('0x9e')](),_0x264363)['then'](function(_0x567e42){var _0x3822e4=_['groupBy'](_0x567e42,_0xe0b0('0xb3'));var _0x4c82d6=[];_0x484cb2[_0xe0b0('0x40')](function(_0x474fbb){_0x4c82d6[_0xe0b0('0x42')](updateChatInteraction(_0x474fbb,_0x249d9a,_0x3822e4));});return BPromise[_0xe0b0('0xb4')](_0x4c82d6);});});})[_0xe0b0('0x20')](function(_0x1bb4da){_0xc3235b[_0xe0b0('0xb5')]=_0x1bb4da;return _0xc3235b;})['then'](respondWithFilteredResult(_0x5c31b5,_0x5d2fa2))['catch'](handleError(_0x5c31b5,null));};exports[_0xe0b0('0xb6')]=function(_0x717e74,_0x184938){var _0x20d6bd={'raw':![],'where':{'id':_0x717e74[_0xe0b0('0xb7')]['id']}},_0xd83992={};_0xd83992[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db[_0xe0b0('0x44')][_0xe0b0('0x45')]);_0xd83992['query']=_['keys'](_0x717e74[_0xe0b0('0x49')]);_0xd83992[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0xd83992[_0xe0b0('0x4c')],_0xd83992[_0xe0b0('0x49')]);_0x20d6bd[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0xd83992['model'],qs['fields'](_0x717e74[_0xe0b0('0x49')][_0xe0b0('0x4d')]));_0x20d6bd[_0xe0b0('0x4e')]=_0x20d6bd[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x20d6bd[_0xe0b0('0x4e')]:_0xd83992[_0xe0b0('0x4c')];if(_0x717e74[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x20d6bd[_0xe0b0('0xba')]=[{'all':!![]}];}_0x20d6bd=_['merge']({},_0x20d6bd,_0x717e74[_0xe0b0('0xbb')]);return db[_0xe0b0('0x44')]['find'](_0x20d6bd)[_0xe0b0('0x20')](handleEntityNotFound(_0x184938,null))[_0xe0b0('0x20')](respondWithResult(_0x184938,null))[_0xe0b0('0x27')](handleError(_0x184938,null));};exports[_0xe0b0('0xbc')]=function(_0x41fdef,_0x594f91){return db[_0xe0b0('0x44')][_0xe0b0('0xbc')](_0x41fdef[_0xe0b0('0x38')],{})[_0xe0b0('0x20')](respondWithResult(_0x594f91,0xc9))[_0xe0b0('0x27')](handleError(_0x594f91,null));};exports['update']=function(_0x475404,_0x58d61b){if(_0x475404[_0xe0b0('0x38')]['id']){delete _0x475404[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')]['find']({'where':{'id':_0x475404['params']['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x58d61b,null))[_0xe0b0('0x20')](saveUpdates(_0x475404[_0xe0b0('0x38')],null))['then'](respondWithResult(_0x58d61b,null))['catch'](handleError(_0x58d61b,null));};exports['destroy']=function(_0x5175e1,_0x57694c){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x5175e1[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x57694c,null))[_0xe0b0('0x20')](removeEntity(_0x57694c,null))[_0xe0b0('0x27')](handleError(_0x57694c,null));};exports[_0xe0b0('0xbd')]=function(_0xd73b8a,_0x437588){return db['ChatInteraction']['describe']()[_0xe0b0('0x20')](respondWithResult(_0x437588,null))[_0xe0b0('0x27')](handleError(_0x437588,null));};exports[_0xe0b0('0xbe')]=function(_0x52dfd8,_0x6ab413){var _0x395083=_0x52dfd8[_0xe0b0('0xb7')]['id'];var _0xd231c4;var _0x35ca4e;var _0x1b8d4a;return db['ChatInteraction']['findOne']({'where':{'id':_0x395083}})['then'](function(_0x1ce027){_0xd231c4=_0x1ce027;return db[_0xe0b0('0xbf')][_0xe0b0('0xc0')]({'where':{'id':_0x1ce027[_0xe0b0('0x9c')]},'attributes':['id',_0xe0b0('0xc1'),_0xe0b0('0xc2'),_0xe0b0('0xc3'),_0xe0b0('0xc4'),'vidaooMetadata'],'raw':!![]});})['then'](function(_0x28ba25){if(_0x28ba25&&_0x28ba25[_0xe0b0('0xc1')]&&_0x28ba25[_0xe0b0('0xc2')]){_0x35ca4e=_0x28ba25;var _0x5451e7={'interaction':{'id':_0x395083},'agent':{'id':_0x52dfd8[_0xe0b0('0x99')]['id'],'name':_0x52dfd8[_0xe0b0('0x99')][_0xe0b0('0x48')],'fullname':_0x52dfd8['user'][_0xe0b0('0xc5')],'email':_0x52dfd8['user'][_0xe0b0('0xc6')]},'contact':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x39')],'account':_0x52dfd8[_0xe0b0('0x38')][_0xe0b0('0x3b')]};var _0x26df60={'rejectUnauthorized':![],'method':_0xe0b0('0xc7'),'url':'https://api-vidaoo.xcally.com/api/v1/meetings','headers':{'X-APIKEY':_0x28ba25[_0xe0b0('0xc1')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x52dfd8[_0xe0b0('0x99')]['email']],'buttons':null,'topic':_0x35ca4e[_0xe0b0('0xc3')],'note':_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xc4')])?null:getMustacheRender(_0x35ca4e['vidaooNote'],_0x5451e7),'metadata':null},'redirect':_0xe0b0('0xc9'),'json':!![]};try{if(!_[_0xe0b0('0xc8')](_0x35ca4e[_0xe0b0('0xca')])){var _0x566a6e=getMustacheRender(_0x35ca4e[_0xe0b0('0xca')],_0x5451e7);var _0x32f67b=JSON[_0xe0b0('0x7f')](_0x566a6e);_0x26df60[_0xe0b0('0x38')][_0xe0b0('0xcb')]=_0x32f67b;}}catch(_0x15be52){throw new db['Sequelize'][(_0xe0b0('0xcc'))](_0xe0b0('0xcd'));}return rp(_0x26df60);}else{throw new db[(_0xe0b0('0x8e'))][(_0xe0b0('0xcc'))](_0xe0b0('0xce'));}})[_0xe0b0('0x20')](function(_0x38b2cf){_0x1b8d4a=_0x38b2cf;if(_0x1b8d4a['id']){var _0x31b01a={'body':_0x1b8d4a[_0xe0b0('0xcf')],'ChatWebsiteId':_0x35ca4e['id'],'ChatInteractionId':_0xd231c4['id'],'direction':_0xe0b0('0xd0'),'UserId':_0x52dfd8[_0xe0b0('0x99')]['id']};return db['ChatMessage'][_0xe0b0('0xbc')](_0x31b01a,{});}else{throw new db['Sequelize']['ValidationError'](_0xe0b0('0xd1'));}})[_0xe0b0('0x20')](function(){return _0xd231c4['updateAttributes']({'vidaooSessionId':_0x1b8d4a['id']});})[_0xe0b0('0x20')](respondWithResult(_0x6ab413,null))[_0xe0b0('0x27')](handleError(_0x6ab413,null));};exports[_0xe0b0('0xd2')]=function(_0x11e969,_0xa18619){if(_0x11e969[_0xe0b0('0x38')]['id']){delete _0x11e969[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x11e969['params']['id']},'include':[{'model':db[_0xe0b0('0xd3')],'as':_0xe0b0('0xd4')}]})[_0xe0b0('0x20')](handleEntityNotFound(_0xa18619,null))[_0xe0b0('0x20')](saveUpdates(_0x11e969['body'],null))['then'](respondWithResult(_0xa18619,null))[_0xe0b0('0x27')](handleError(_0xa18619,null));};exports[_0xe0b0('0xd5')]=function(_0x333c2a,_0x2cd7db,_0x308d03){if(_0x333c2a[_0xe0b0('0x38')]['id']){delete _0x333c2a[_0xe0b0('0x38')]['id'];}return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x333c2a[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](function(_0xaa7a71){if(!_0xaa7a71){logger[_0xe0b0('0x22')](_0xe0b0('0xd6'),_0xe0b0('0xd5'),0x194,_0xe0b0('0xd7'));_0x2cd7db[_0xe0b0('0x28')](0x194);}else{if(_0xaa7a71[_0xe0b0('0x7a')]){throw new db[(_0xe0b0('0x8e'))]['ValidationError'](_0xe0b0('0xd8'));}}return _0xaa7a71;})[_0xe0b0('0x20')](function(_0x36a006){if(_0x36a006){return _0x36a006['update']({'closed':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xd9')],'disposition':_0x333c2a[_0xe0b0('0x38')][_0xe0b0('0xda')]})[_0xe0b0('0x20')](function(_0x3532f1){return _0x3532f1;});}})[_0xe0b0('0x20')](function(_0x581ae9){return respondWithRpcPromise(_0xe0b0('0xdb'),'abandon',_0x333c2a[_0xe0b0('0x38')],client9004);})['then'](respondWithResult(_0x2cd7db,null))[_0xe0b0('0x27')](handleError(_0x2cd7db,null));};exports[_0xe0b0('0xdc')]=function(_0x4bd799,_0x2102bc,_0x4f0cbe){_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0x48')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xde')];_0x4bd799[_0xe0b0('0x38')][_0xe0b0('0xdf')]=_0x4bd799[_0xe0b0('0xdd')][_0xe0b0('0xe0')];_0x4bd799['body'][_0xe0b0('0x47')]=_0x4bd799['file']['mimetype'];return db[_0xe0b0('0xe1')][_0xe0b0('0xbc')](_0x4bd799[_0xe0b0('0x38')])['then'](respondWithResult(_0x2102bc,0xc9))['catch'](handleError(_0x2102bc,null));};exports[_0xe0b0('0xe2')]=function(_0x3c207e,_0x4fc379,_0x98e7c9){return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0xb7')]['id']},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null))[_0xe0b0('0x20')](function(_0x4074bb){if(_0x4074bb){if(_0x4074bb[_0xe0b0('0xd9')]){return _0x4fc379[_0xe0b0('0x29')](0x193)['json']({'status':0x193,'message':'Unauthorized'});}return db[_0xe0b0('0xe1')][_0xe0b0('0xc0')]({'where':{'id':_0x3c207e[_0xe0b0('0x49')][_0xe0b0('0xe3')]},'raw':!![]})[_0xe0b0('0x20')](handleEntityNotFound(_0x4fc379,null));}})[_0xe0b0('0x20')](function(_0x54f90a){if(_0x54f90a){var _0x1aa40b=_0x54f90a[_0xe0b0('0xe4')]!==null;var _0x22c8a2=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server/files/attachments/');if(_0x1aa40b){_0x22c8a2=path[_0xe0b0('0xe5')](_0x22c8a2,_0xe0b0('0xe7'));}var _0x321b0b=path[_0xe0b0('0xe5')](_0x22c8a2,_0x54f90a[_0xe0b0('0xdf')]);return _0x4fc379[_0xe0b0('0xe8')](_0x321b0b);}})[_0xe0b0('0x27')](handleError(_0x4fc379,null));};exports[_0xe0b0('0xe9')]=function(_0x1ccfc1,_0x2b1474){var _0x574f0a=null;var _0x108371=null;var _0x3f2ec=null;var _0x4f0db7=null;if(_0x1ccfc1[_0xe0b0('0x38')]['id']){delete _0x1ccfc1['body']['id'];}if(_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]){_0x4f0db7=path['join'](config[_0xe0b0('0xe6')],_0xe0b0('0xeb'),util[_0xe0b0('0xec')](_0xe0b0('0xed'),Date[_0xe0b0('0xee')]()));_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xef')]=_0x4f0db7;}return db['ChatInteraction']['find']({'where':{'id':_0x1ccfc1[_0xe0b0('0xb7')]['id']},'include':[{'model':db[_0xe0b0('0xf0')],'as':_0xe0b0('0xf1'),'include':[{'model':db['User'],'as':_0xe0b0('0x78')}]}]})[_0xe0b0('0x20')](handleEntityNotFound(_0x2b1474,null))[_0xe0b0('0x20')](saveUpdates(_0x1ccfc1[_0xe0b0('0x38')],null))[_0xe0b0('0x20')](function(_0x117d00){if(_0x117d00){_0x574f0a=_0x117d00;return db[_0xe0b0('0xbf')][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x9c')]}});}})[_0xe0b0('0x20')](function(_0x5aa313){if(_0x5aa313){_0x3f2ec=_0x5aa313;return db['CmContact'][_0xe0b0('0x6b')]({'where':{'id':_0x574f0a[_0xe0b0('0x74')]}});}})[_0xe0b0('0x20')](function(_0x3c93c6){if(_0x3c93c6){_0x108371=_0x3c93c6;if(_0x4f0db7){var _0x203351=null;for(var _0x343409=0x1;_0x343409<_0x574f0a[_0xe0b0('0xf1')]['length'];++_0x343409){_0x203351=_0x574f0a[_0xe0b0('0xf1')][_0x343409];var _0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util['format'](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351['UserId']):'System';var _0x3b3473=_0x1ccfc1['body'][_0xe0b0('0xf4')]||util['format'](_0xe0b0('0xf2'),_0xe0b0('0xf5'),_0x203351['ContactId']);switch(_0x3f2ec[_0xe0b0('0xf6')]){case _0xe0b0('0xf7'):_0x2e7fe2=_0x203351['UserId']?util[_0xe0b0('0xec')]('%s%d',_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');break;case _0xe0b0('0xf9'):_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?_0x203351[_0xe0b0('0x78')][_0xe0b0('0xfa')]||_0x203351['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8');break;case'agent_fullname':_0x2e7fe2=_0x203351['UserId']?_0x203351[_0xe0b0('0x78')]['fullname']:_0xe0b0('0xf8');break;default:_0x2e7fe2=_0x203351[_0xe0b0('0x7a')]?util[_0xe0b0('0xec')](_0xe0b0('0xf2'),_0x3f2ec[_0xe0b0('0xf3')],_0x203351[_0xe0b0('0x7a')]):_0xe0b0('0xf8');}var _0x8364b0=util[_0xe0b0('0xec')](_0xe0b0('0xfb'),moment(_0x203351[_0xe0b0('0x7e')])[_0xe0b0('0xec')](_0xe0b0('0xfc')),_0x203351[_0xe0b0('0xfd')]==='in'?_0x3b3473:_0x2e7fe2,_0x203351['body']);if(!_0x203351[_0xe0b0('0xfe')]){fs[_0xe0b0('0xff')](_0x4f0db7,_0x8364b0);}}return db[_0xe0b0('0x100')][_0xe0b0('0xc0')]({'where':{'service':!![]},'include':[{'model':db[_0xe0b0('0x101')],'as':'Smtp','raw':!![]}]});}}})[_0xe0b0('0x20')](function(_0x3a75d8){if(_0x3a75d8&&_0x3a75d8[_0xe0b0('0x102')]&&_0x1ccfc1[_0xe0b0('0x38')]){var _0x1e2ef8={'tls':{'rejectUnauthorized':![]}};if(_0x3a75d8[_0xe0b0('0x102')]['service']){_0x1e2ef8[_0xe0b0('0x103')]=_0x3a75d8['Smtp'][_0xe0b0('0x103')];}else{_0x1e2ef8[_0xe0b0('0x104')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x104')];_0x1e2ef8[_0xe0b0('0x105')]=_0x3a75d8[_0xe0b0('0x102')]['port'];_0x1e2ef8[_0xe0b0('0x106')]=_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x106')];}if(_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x107')]){_0x1e2ef8[_0xe0b0('0x108')]={'user':_0x3a75d8[_0xe0b0('0x102')][_0xe0b0('0x99')],'pass':_0x3a75d8['Smtp']['pass']};}return respondWithRpcPromise(_0xe0b0('0x109'),'sendMail',{'account':_0x1e2ef8,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x3a75d8['name'],_0x3a75d8[_0xe0b0('0xc6')]||_0x3a75d8['Smtp']['user']),'to':_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')],'subject':_0xe0b0('0x10a'),'text':util[_0xe0b0('0xec')](_0xe0b0('0x10b'),_0x1ccfc1[_0xe0b0('0x38')][_0xe0b0('0xea')]),'attachments':[{'path':_0x4f0db7}]}})[_0xe0b0('0x20')](function(){return _0x574f0a;})[_0xe0b0('0x27')](function(_0x43f1b1){console['error'](_0x43f1b1);});}else{return _0x574f0a;}})['then'](respondWithStatusCode(_0x2b1474,0xc8))[_0xe0b0('0x27')](handleError(_0x2b1474,null));};exports[_0xe0b0('0x10c')]=function(_0x2b8a03,_0x4f784a,_0x4b5a48){return db[_0xe0b0('0xf0')]['find']({'where':{'id':_0x2b8a03[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x4f784a,null))['then'](function(_0x2e393e){if(_0x2e393e){return _0x2e393e[_0xe0b0('0x10c')](_0x2b8a03[_0xe0b0('0x38')][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x2b8a03[_0xe0b0('0x38')],[_0xe0b0('0x10d'),'id'])||{});}})['then'](respondWithResult(_0x4f784a,null))[_0xe0b0('0x27')](handleError(_0x4f784a,null));};exports[_0xe0b0('0x10f')]=function(_0x1f3162,_0x22da3a,_0x2b2c68){var _0x5c5c2d={'raw':![],'where':{}};var _0x4d6429={};var _0x322d1b={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x1f3162[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22da3a,null))[_0xe0b0('0x20')](function(_0x151da2){if(_0x151da2){_0x4d6429[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage']['rawAttributes']);_0x4d6429[_0xe0b0('0x49')]=_[_0xe0b0('0x4a')](_0x1f3162[_0xe0b0('0x49')]);_0x4d6429[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x4d6429[_0xe0b0('0x4c')],_0x4d6429[_0xe0b0('0x49')]);_0x5c5c2d[_0xe0b0('0x4e')]=_['intersection'](_0x4d6429[_0xe0b0('0x4c')],qs[_0xe0b0('0x4d')](_0x1f3162[_0xe0b0('0x49')]['fields']));_0x5c5c2d[_0xe0b0('0x4e')]=_0x5c5c2d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x5c5c2d[_0xe0b0('0x4e')]:_0x4d6429[_0xe0b0('0x4c')];if(!_0x1f3162[_0xe0b0('0x49')]['hasOwnProperty'](_0xe0b0('0x110'))){_0x5c5c2d[_0xe0b0('0x2e')]=qs[_0xe0b0('0x2e')](_0x1f3162['query'][_0xe0b0('0x2e')]);_0x5c5c2d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x1f3162[_0xe0b0('0x49')]['offset']);}_0x5c5c2d[_0xe0b0('0x51')]=qs[_0xe0b0('0x52')](_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x52')]);_0x5c5c2d[_0xe0b0('0x7c')]=qs[_0xe0b0('0xb8')](_[_0xe0b0('0x53')](_0x1f3162[_0xe0b0('0x49')],_0x4d6429['filters']));_0x5c5c2d[_0xe0b0('0x7c')]['ChatInteractionId']=_0x151da2['id'];if(_0x1f3162['query'][_0xe0b0('0x88')]){_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d['where'],{'$or':_[_0xe0b0('0x3d')](_0x5c5c2d['attributes'],function(_0xf0c217){var _0x4c5406={};_0x4c5406[_0xf0c217]={'$like':'%'+_0x1f3162['query']['filter']+'%'};return _0x4c5406;})});}if(_0x1f3162[_0xe0b0('0x49')][_0xe0b0('0x80')]){var _0x55e013=_0x1f3162[_0xe0b0('0x49')]['$gte']['split'](',');var _0x31fa9d={};_0x31fa9d[_0x55e013[0x0]]={'$gte':moment(_0x55e013[0x1])['format'](_0xe0b0('0x111'))};_0x5c5c2d[_0xe0b0('0x7c')]=_[_0xe0b0('0x37')](_0x5c5c2d[_0xe0b0('0x7c')],_0x31fa9d);}_0x5c5c2d=_['merge']({},_0x5c5c2d,_0x1f3162[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')][_0xe0b0('0x2f')]({'where':_0x5c5c2d[_0xe0b0('0x7c')]})[_0xe0b0('0x20')](function(_0x51600e){_0x322d1b[_0xe0b0('0x2f')]=_0x51600e;if(_0x1f3162[_0xe0b0('0x49')]['includeAll']){_0x5c5c2d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x5c5c2d);})[_0xe0b0('0x20')](function(_0x1e0374){_0x322d1b[_0xe0b0('0xb5')]=_0x1e0374;return _0x322d1b;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x22da3a,_0x5c5c2d))[_0xe0b0('0x27')](handleError(_0x22da3a,null));};exports[_0xe0b0('0x113')]=function(_0x5b7b02,_0x565f67,_0x2853bf){var _0x4c0d9d={'where':{}},_0x38dd79={},_0x2dc446={'count':0x0,'rows':[]};return db[_0xe0b0('0x44')][_0xe0b0('0xc0')]({'where':{'id':_0x5b7b02[_0xe0b0('0xb7')]['id']}})[_0xe0b0('0x20')](handleEntityNotFound(_0x565f67,null))['then'](function(_0x5996a6){if(_0x5996a6){_0x38dd79[_0xe0b0('0x4c')]=_[_0xe0b0('0x4a')](db['ChatMessage'][_0xe0b0('0x45')]);_0x38dd79[_0xe0b0('0x49')]=_['keys'](_0x5b7b02[_0xe0b0('0x49')]);_0x38dd79[_0xe0b0('0xb8')]=_[_0xe0b0('0x4b')](_0x38dd79['model'],_0x38dd79[_0xe0b0('0x49')]);_0x4c0d9d[_0xe0b0('0x4e')]=_[_0xe0b0('0x4b')](_0x38dd79[_0xe0b0('0x4c')],qs['fields'](_0x5b7b02[_0xe0b0('0x49')]['fields']));_0x4c0d9d[_0xe0b0('0x4e')]=_0x4c0d9d[_0xe0b0('0x4e')][_0xe0b0('0x4f')]?_0x4c0d9d['attributes']:_0x38dd79[_0xe0b0('0x4c')];if(!_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x50')](_0xe0b0('0x110'))){_0x4c0d9d['limit']=qs[_0xe0b0('0x2e')](_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x2e')]);_0x4c0d9d[_0xe0b0('0x2c')]=qs[_0xe0b0('0x2c')](_0x5b7b02[_0xe0b0('0x49')]['offset']);}_0x4c0d9d['order']=qs['sort'](_0x5b7b02[_0xe0b0('0x49')]['sort']);_0x4c0d9d[_0xe0b0('0x7c')]=qs['filters'](_['pick'](_0x5b7b02[_0xe0b0('0x49')],_0x38dd79[_0xe0b0('0xb8')]));_0x4c0d9d[_0xe0b0('0x7c')][_0xe0b0('0xb3')]=_0x5996a6['id'];if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0x88')]){_0x4c0d9d[_0xe0b0('0x7c')]=_['merge'](_0x4c0d9d[_0xe0b0('0x7c')],{'$or':_[_0xe0b0('0x3d')](_0x4c0d9d[_0xe0b0('0x4e')],function(_0x15033e){var _0x14ba21={};_0x14ba21[_0x15033e]={'$like':'%'+_0x5b7b02[_0xe0b0('0x49')]['filter']+'%'};return _0x14ba21;})});}_0x4c0d9d['where'][_0xe0b0('0xfe')]=![];if(_0x5b7b02[_0xe0b0('0x49')]['id']){_0x4c0d9d[_0xe0b0('0x7c')]['id']={'$gt':_0x5b7b02[_0xe0b0('0x49')]['id']};}_0x4c0d9d=_[_0xe0b0('0x37')]({},_0x4c0d9d,_0x5b7b02[_0xe0b0('0xbb')]);return db[_0xe0b0('0xf0')]['count']({'where':_0x4c0d9d['where']})[_0xe0b0('0x20')](function(_0x16386b){_0x2dc446[_0xe0b0('0x2f')]=_0x16386b;_0x4c0d9d['include']=[];if(_0x5b7b02['query'][_0xe0b0('0x114')]){_0x4c0d9d[_0xe0b0('0xba')][_0xe0b0('0x42')]({'model':db[_0xe0b0('0x78')],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5'),_0xe0b0('0xfa')]});}if(_0x5b7b02[_0xe0b0('0x49')][_0xe0b0('0xb9')]){_0x4c0d9d[_0xe0b0('0xba')]=[{'all':!![]}];}return db['ChatMessage'][_0xe0b0('0x112')](_0x4c0d9d);})['then'](function(_0x2df3df){_0x2dc446['rows']=_0x2df3df;return _0x2dc446;});}})[_0xe0b0('0x20')](respondWithFilteredResult(_0x565f67,_0x4c0d9d))[_0xe0b0('0x27')](handleError(_0x565f67,null));};exports['addTags']=function(_0x236966,_0x41fd0e,_0x17e7d4){return db['ChatInteraction'][_0xe0b0('0x6b')]({'where':{'id':_0x236966[_0xe0b0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x41fd0e,null))[_0xe0b0('0x20')](function(_0x19dafb){if(_0x19dafb){return _0x19dafb['setTags'](_0x236966['body'][_0xe0b0('0x10d')],_[_0xe0b0('0x10e')](_0x236966['body'],['ids','id'])||{})[_0xe0b0('0x115')](function(){return db['Tag'][_0xe0b0('0x112')]({'attributes':['id',_0xe0b0('0x48'),_0xe0b0('0x55')],'where':{'id':_0x236966[_0xe0b0('0x38')][_0xe0b0('0x10d')]}});})[_0xe0b0('0x20')](function(_0x36106e){socket['emit'](_0xe0b0('0x116'),{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]});return{'id':Number(_0x236966['params']['id']),'tags':_0x36106e||[]};});}})['then'](respondWithResult(_0x41fd0e,null))[_0xe0b0('0x27')](handleError(_0x41fd0e,null));};exports[_0xe0b0('0x117')]=function(_0x263288,_0x7117ca,_0x21ccfe){return db['ChatInteraction']['find']({'where':{'id':_0x263288['params']['id']}})['then'](handleEntityNotFound(_0x7117ca,null))[_0xe0b0('0x20')](function(_0x1bd420){if(_0x1bd420){return _0x1bd420[_0xe0b0('0x117')](_0x263288['query'][_0xe0b0('0x10d')]);}})[_0xe0b0('0x20')](respondWithStatusCode(_0x7117ca,null))[_0xe0b0('0x27')](handleError(_0x7117ca,null));};exports[_0xe0b0('0xe8')]=function(_0x2d2852,_0x16a02b){var _0x125ead=moment()['unix']()[_0xe0b0('0x9e')]();var _0x380fe1=path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],'server',_0xe0b0('0x118'),_0xe0b0('0x119'));var _0x3eb643=path[_0xe0b0('0xe5')](config['root'],'server',_0xe0b0('0x118'),_0xe0b0('0x11a'));var _0x26bd6c=path[_0xe0b0('0xe5')](_0x380fe1,_0x125ead);var _0x104409=util[_0xe0b0('0xec')]('transcript-%d-%s.zip',_0x2d2852[_0xe0b0('0xb7')]['id'],_0x125ead);var _0x6f9dbd=path[_0xe0b0('0xe5')](_0x380fe1,_0x104409);var _0x4c6646=[];_0x4c6646[_0xe0b0('0x42')]({'model':db['User'],'as':_0xe0b0('0x78'),'attributes':['id',_0xe0b0('0xc5')],'raw':!![]});_0x4c6646['push']({'model':db[_0xe0b0('0xd3')],'as':'Contact','attributes':['id','firstName',_0xe0b0('0x11b')],'raw':!![]});if(_0x2d2852['query']['attachments']){_0x4c6646['push']({'model':db[_0xe0b0('0xe1')],'as':_0xe0b0('0xe1'),'raw':!![]});}var _0x573ca9=[{'model':db[_0xe0b0('0xf0')],'as':'Messages','attributes':['id',_0xe0b0('0x38'),_0xe0b0('0x7e'),_0xe0b0('0xfd'),_0xe0b0('0xfe'),'read'],'include':_0x4c6646}];_0x573ca9['push']({'model':db['ChatWebsite'],'as':_0xe0b0('0x11c'),'attributes':['id',_0xe0b0('0x48')]});_0x573ca9['push']({'model':db['User'],'as':_0xe0b0('0x11d'),'attributes':['id',_0xe0b0('0xc5')]});return db[_0xe0b0('0x44')][_0xe0b0('0x6b')]({'where':{'id':_0x2d2852['params']['id']},'include':_0x573ca9})['then'](handleEntityNotFound(_0x16a02b,null))[_0xe0b0('0x20')](function(_0x329684){if(_0x329684){var _0x5b1bb7=_0x329684[_0xe0b0('0x11e')]({'plain':!![]});fs[_0xe0b0('0x11f')](_0x26bd6c);var _0x5b7df1={'channel':'Chat','account':_0x5b1bb7['Account'][_0xe0b0('0x48')],'agent':_0x5b1bb7[_0xe0b0('0x11d')]?_0x5b1bb7['Owner'][_0xe0b0('0xc5')]:_0xe0b0('0x120'),'createdAt':moment(_0x5b1bb7[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'closedAt':_0x5b1bb7[_0xe0b0('0xd9')]?moment(_0x5b1bb7['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')]():'','disposition':_0x5b1bb7['disposition'],'chatInfo':{'browser':_0x5b1bb7[_0xe0b0('0x121')],'os':_0x5b1bb7['osName'],'referer':_0x5b1bb7['referer'],'customerIp':_0x5b1bb7[_0xe0b0('0x122')],'customerPort':_0x5b1bb7[_0xe0b0('0x123')]?_0x5b1bb7[_0xe0b0('0x123')]:_0xe0b0('0x120')},'messages':_(_0x5b1bb7['Messages'])['tail']()['filter']({'secret':![]})['map'](function(_0x26a916){if(_0x26a916[_0xe0b0('0xe1')]){var _0x5b5bb2=path['join'](_0x3eb643,_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]);if(fs['existsSync'](_0x5b5bb2)){fs[_0xe0b0('0x124')](_0x5b5bb2)[_0xe0b0('0x125')](fs[_0xe0b0('0x126')](path[_0xe0b0('0xe5')](_0x26bd6c,_0x26a916['Attachment'][_0xe0b0('0xdf')])));}}return{'date':moment(_0x26a916[_0xe0b0('0x7e')])[_0xe0b0('0xec')]('YYYY-MM-DD\x20HH:mm:ss')[_0xe0b0('0x9e')](),'sender':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?_0x26a916[_0xe0b0('0x78')]?_0x26a916['User'][_0xe0b0('0xc5')]:_0xe0b0('0xf8'):_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x127')]+(_0x26a916[_0xe0b0('0xd4')]['lastName']?'\x20'+_0x26a916[_0xe0b0('0xd4')][_0xe0b0('0x11b')]:''),'body':_0x26a916['Attachment']?_0x26a916[_0xe0b0('0xe1')][_0xe0b0('0xdf')]:_0x26a916[_0xe0b0('0x38')],'direction':_0x26a916[_0xe0b0('0xfd')]===_0xe0b0('0xd0')?'A':'C','secret':_0x26a916[_0xe0b0('0xfe')],'read':_0x26a916['read'],'attachment':_0x26a916[_0xe0b0('0xe1')]};})[_0xe0b0('0x6d')]()};return ejs[_0xe0b0('0x128')](path[_0xe0b0('0xe5')](config[_0xe0b0('0xe6')],_0xe0b0('0x129'),_0xe0b0('0x12a'),_0xe0b0('0x12b')),{'interaction':_0x5b7df1})[_0xe0b0('0x20')](function(_0x1f5871){var _0x4d12b2=path[_0xe0b0('0xe5')](_0x26bd6c,'transcript-'+_0x5b1bb7['id']+'-'+_0x125ead+_0xe0b0('0x12c'));var _0x4b655d={'path':_0x4d12b2,'channel':'Chat','interactionId':_0x5b1bb7['id']};return pdf[_0xe0b0('0x12d')](_0x1f5871,_0x4b655d);})[_0xe0b0('0x20')](function(){return new BPromise(function(_0x5b8cef,_0x4d4eae){zipdir(_0x26bd6c,{'saveTo':_0x6f9dbd},function(_0x388f0d,_0x317dee){if(_0x388f0d)return _0x4d4eae(_0x388f0d);return _0x5b8cef(_0x317dee);});})['then'](function(){return new BPromise(function(_0x5501c2,_0xa7f2cf){rimraf(_0x26bd6c,function(_0x2c61b3){if(_0x2c61b3)_0xa7f2cf(_0x2c61b3);return _0x5501c2();});});})['then'](function(){return _0x16a02b[_0xe0b0('0xe8')](_0x6f9dbd,_0x104409,function(_0x465315){if(_0x465315){console[_0xe0b0('0x12e')](_0xe0b0('0x12f'),_0x465315);}else{fs['unlinkSync'](_0x6f9dbd);}});});});}else{return _0x16a02b[_0xe0b0('0x28')](0xc8);}})[_0xe0b0('0x27')](handleError(_0x16a02b,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 24279b3..d2c0006 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 _0x09c1=['Users','map','findAll','setDataValue','unreadMessages','length','emit','hasOwnProperty','hook','exports','events','ChatInteraction','../../mysqldb','ChatMessage','update','then'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x09c1,0xaa));var _0x109c=function(_0x16697e,_0x112bf8){_0x16697e=_0x16697e-0x0;var _0x218ede=_0x09c1[_0x16697e];return _0x218ede;};'use strict';var EventEmitter=require(_0x109c('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x109c('0x1')];var ChatMessage=require(_0x109c('0x2'))['db'][_0x109c('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x109c('0x4'),'afterDestroy':'remove'};function emitEvent(_0x5c3d73){return function(_0x316ea5,_0xfbc621,_0x264197){_0x316ea5['getUsers']({'attributes':['id'],'raw':!![]})[_0x109c('0x5')](function(_0x354452){_0x316ea5['setDataValue'](_0x109c('0x6'),_0x354452[_0x109c('0x7')](function(_0x34208b){return{'id':_0x34208b['id']};}));return ChatMessage[_0x109c('0x8')]({'where':{'ChatInteractionId':_0x316ea5['id'],'direction':'in','read':![]},'raw':!![]});})[_0x109c('0x5')](function(_0x4191fd){_0x316ea5[_0x109c('0x9')](_0x109c('0xa'),_0x4191fd[_0x109c('0xb')]);ChatInteractionEvents[_0x109c('0xc')](_0x5c3d73+':'+_0x316ea5['id'],_0x316ea5);ChatInteractionEvents['emit'](_0x5c3d73,_0x316ea5);_0x264197(null);})['catch'](_0x264197(null));};}for(var e in events){if(events[_0x109c('0xd')](e)){var event=events[e];ChatInteraction[_0x109c('0xe')](e,emitEvent(event));}}module[_0x109c('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x4804=['save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','catch','hasOwnProperty','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x8e74c4,_0x4c3b72){var _0x50e53f=function(_0x2a4eef){while(--_0x2a4eef){_0x8e74c4['push'](_0x8e74c4['shift']());}};_0x50e53f(++_0x4c3b72);}(_0x4804,0x15b));var _0x4480=function(_0x531598,_0x3db452){_0x531598=_0x531598-0x0;var _0x47be54=_0x4804[_0x531598];return _0x47be54;};'use strict';var EventEmitter=require(_0x4480('0x0'));var ChatInteraction=require(_0x4480('0x1'))['db'][_0x4480('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x4480('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4480('0x4')](0x0);var events={'afterCreate':_0x4480('0x5'),'afterUpdate':_0x4480('0x6'),'afterDestroy':_0x4480('0x7')};function emitEvent(_0x386300){return function(_0x5ad808,_0x8a023e,_0x16e840){_0x5ad808['getUsers']({'attributes':['id'],'raw':!![]})[_0x4480('0x8')](function(_0x1d8d1c){_0x5ad808[_0x4480('0x9')](_0x4480('0xa'),_0x1d8d1c['map'](function(_0x5508c7){return{'id':_0x5508c7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x5ad808['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4480('0x8')](function(_0x2587c3){_0x5ad808[_0x4480('0x9')](_0x4480('0xb'),_0x2587c3[_0x4480('0xc')]);ChatInteractionEvents[_0x4480('0xd')](_0x386300+':'+_0x5ad808['id'],_0x5ad808);ChatInteractionEvents[_0x4480('0xd')](_0x386300,_0x5ad808);_0x16e840(null);})[_0x4480('0xe')](_0x16e840(null));};}for(var e in events){if(events[_0x4480('0xf')](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 4aa2d16..2b15116 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 _0xc744=['closed','closedAt','format','utf8mb4','util','../../config/logger','api','moment','request-promise','path','rimraf','./chatInteraction.attributes','exports','changed'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc744,0x66));var _0x4c74=function(_0x35b976,_0x289a1a){_0x35b976=_0x35b976-0x0;var _0x56565f=_0xc744[_0x35b976];return _0x56565f;};'use strict';var _=require('lodash');var util=require(_0x4c74('0x0'));var logger=require(_0x4c74('0x1'))(_0x4c74('0x2'));var moment=require(_0x4c74('0x3'));var BPromise=require('bluebird');var rp=require(_0x4c74('0x4'));var fs=require('fs');var path=require(_0x4c74('0x5'));var rimraf=require(_0x4c74('0x6'));var config=require('../../config/environment');var attributes=require(_0x4c74('0x7'));module[_0x4c74('0x8')]=function(_0xb6b5b7,_0x2fe406){return _0xb6b5b7['define']('ChatInteraction',attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1b9113,_0x2fd749,_0x2d23a0){if(_0x1b9113[_0x4c74('0x9')](_0x4c74('0xa'))){_0x1b9113[_0x4c74('0xb')]=moment()[_0x4c74('0xc')]('YYYY-MM-DD\x20HH:mm:ss');}_0x2d23a0(null,_0x1b9113);}},'charset':_0x4c74('0xd'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xd0d2=['utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','ChatInteraction','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x5ad781,_0x27573a){var _0x82d137=function(_0x4369e2){while(--_0x4369e2){_0x5ad781['push'](_0x5ad781['shift']());}};_0x82d137(++_0x27573a);}(_0xd0d2,0x191));var _0x2d0d=function(_0x585e84,_0x1d8489){_0x585e84=_0x585e84-0x0;var _0x39f3c4=_0xd0d2[_0x585e84];return _0x39f3c4;};'use strict';var _=require(_0x2d0d('0x0'));var util=require(_0x2d0d('0x1'));var logger=require(_0x2d0d('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2d0d('0x3'));var fs=require('fs');var path=require(_0x2d0d('0x4'));var rimraf=require(_0x2d0d('0x5'));var config=require(_0x2d0d('0x6'));var attributes=require(_0x2d0d('0x7'));module[_0x2d0d('0x8')]=function(_0x50e279,_0xa3fc37){return _0x50e279['define'](_0x2d0d('0x9'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3eb451,_0x5875a8,_0x3163e6){if(_0x3eb451[_0x2d0d('0xa')](_0x2d0d('0xb'))){_0x3eb451[_0x2d0d('0xc')]=moment()[_0x2d0d('0xd')](_0x2d0d('0xe'));}_0x3163e6(null,_0x3eb451);}},'charset':'utf8mb4','collate':_0x2d0d('0xf')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index a77797a..180c7bc 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 _0xb89f=['AddTags','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','then','info','ChatInteraction,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','UpdateChatInteraction','ChatInteraction','update','body','options','where','limit','debug','find','addTags','ids','omit','spread'];(function(_0x10197a,_0x5b7bb6){var _0x11ad2b=function(_0x5b8bc9){while(--_0x5b8bc9){_0x10197a['push'](_0x10197a['shift']());}};_0x11ad2b(++_0x5b7bb6);}(_0xb89f,0x99));var _0xfb89=function(_0x57e8e1,_0x22396f){_0x57e8e1=_0x57e8e1-0x0;var _0x3b4664=_0xb89f[_0x57e8e1];return _0x3b4664;};'use strict';var _=require('lodash');var util=require(_0xfb89('0x0'));var moment=require('moment');var BPromise=require(_0xfb89('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfb89('0x2'));var db=require(_0xfb89('0x3'))['db'];var utils=require(_0xfb89('0x4'));var logger=require(_0xfb89('0x5'))(_0xfb89('0x6'));var config=require(_0xfb89('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfb89('0x8')][_0xfb89('0x9')]({'port':0x232a});config[_0xfb89('0xa')]=_[_0xfb89('0xb')](config[_0xfb89('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xfb89('0xc'))(new Redis(config['redis']));require(_0xfb89('0xd'))[_0xfb89('0xe')](socket);function respondWithRpcPromise(_0x13deca,_0x693471,_0x2eab02){return new BPromise(function(_0x1a780c,_0x3046a7){return client['request'](_0x13deca,_0x2eab02)[_0xfb89('0xf')](function(_0x2f4007){logger[_0xfb89('0x10')](_0xfb89('0x11'),_0x693471,'request\x20sent');logger['debug']('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x693471,'request\x20sent',JSON[_0xfb89('0x12')](_0x2f4007));if(_0x2f4007['error']){if(_0x2f4007[_0xfb89('0x13')]['code']===0x1f4){logger['error'](_0xfb89('0x11'),_0x693471,_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);return _0x3046a7(_0x2f4007[_0xfb89('0x13')]['message']);}logger[_0xfb89('0x13')](_0xfb89('0x11'),_0x693471,_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);return _0x1a780c(_0x2f4007[_0xfb89('0x13')][_0xfb89('0x14')]);}else{logger[_0xfb89('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x693471,_0xfb89('0x15'));_0x1a780c(_0x2f4007[_0xfb89('0x16')][_0xfb89('0x14')]);}})[_0xfb89('0x17')](function(_0xf57a67){logger[_0xfb89('0x13')](_0xfb89('0x11'),_0x693471,_0xf57a67);_0x3046a7(_0xf57a67);});});}exports[_0xfb89('0x18')]=function(_0x59e956){var _0x3dd0d6=this;return new Promise(function(_0x3bf4c0,_0x271c98){return db[_0xfb89('0x19')][_0xfb89('0x1a')](_0x59e956[_0xfb89('0x1b')],{'raw':_0x59e956['options']?_0x59e956[_0xfb89('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')][_0xfb89('0x1d')]||null:null,'attributes':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')]['attributes']||null:null,'limit':_0x59e956[_0xfb89('0x1c')]?_0x59e956[_0xfb89('0x1c')][_0xfb89('0x1e')]||null:null})[_0xfb89('0xf')](function(_0x196e18){logger[_0xfb89('0x10')](_0xfb89('0x18'),_0x59e956);logger[_0xfb89('0x1f')](_0xfb89('0x18'),_0x59e956,JSON[_0xfb89('0x12')](_0x196e18));_0x3bf4c0(_0x196e18);})[_0xfb89('0x17')](function(_0x2149cc){logger['error'](_0xfb89('0x18'),_0x2149cc[_0xfb89('0x14')],_0x59e956);_0x271c98(_0x3dd0d6[_0xfb89('0x13')](0x1f4,_0x2149cc[_0xfb89('0x14')]));});});};exports['AddTagsToChatInteraction']=function(_0x5dd2ba){return new Promise(function(_0x5544bb,_0x449acf){return db[_0xfb89('0x19')][_0xfb89('0x20')]({'where':_0x5dd2ba['options']?_0x5dd2ba[_0xfb89('0x1c')][_0xfb89('0x1d')]||null:null})['then'](function(_0x490e91){if(_0x490e91){return _0x490e91[_0xfb89('0x21')](_0x5dd2ba['body'][_0xfb89('0x22')],_[_0xfb89('0x23')](_0x5dd2ba[_0xfb89('0x1b')],[_0xfb89('0x22'),'id'])||{});}})[_0xfb89('0x24')](function(_0x532375){logger[_0xfb89('0x10')](_0xfb89('0x25'),_0x5dd2ba);logger['debug'](_0xfb89('0x25'),_0x5dd2ba,JSON[_0xfb89('0x12')](_0x532375));_0x5544bb(_0x532375);})['catch'](function(_0x53d614){logger['error'](_0xfb89('0x25'),_0x53d614['message'],_0x5dd2ba);_0x449acf(_this['error'](0x1f4,_0x53d614[_0xfb89('0x14')]));});});};
\ No newline at end of file
+var _0x062b=['catch','ChatInteraction','addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','UpdateChatInteraction','update','options','raw','where','attributes','limit'];(function(_0x1b6311,_0x42ec20){var _0x25aab6=function(_0x139a77){while(--_0x139a77){_0x1b6311['push'](_0x1b6311['shift']());}};_0x25aab6(++_0x42ec20);}(_0x062b,0xdf));var _0xb062=function(_0x62628,_0x35b586){_0x62628=_0x62628-0x0;var _0x50c4f4=_0x062b[_0x62628];return _0x50c4f4;};'use strict';var _=require(_0xb062('0x0'));var util=require(_0xb062('0x1'));var moment=require(_0xb062('0x2'));var BPromise=require('bluebird');var rs=require(_0xb062('0x3'));var fs=require('fs');var Redis=require(_0xb062('0x4'));var db=require(_0xb062('0x5'))['db'];var utils=require(_0xb062('0x6'));var logger=require(_0xb062('0x7'))(_0xb062('0x8'));var config=require(_0xb062('0x9'));var jayson=require(_0xb062('0xa'));var client=jayson[_0xb062('0xb')][_0xb062('0xc')]({'port':0x232a});config[_0xb062('0xd')]=_[_0xb062('0xe')](config[_0xb062('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb062('0xd')]));require(_0xb062('0xf'))[_0xb062('0x10')](socket);function respondWithRpcPromise(_0x52f824,_0x26b15f,_0x298a4b){return new BPromise(function(_0x30719a,_0x516d96){return client[_0xb062('0x11')](_0x52f824,_0x298a4b)[_0xb062('0x12')](function(_0x5ae9c8){logger['info'](_0xb062('0x13'),_0x26b15f,'request\x20sent');logger[_0xb062('0x14')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x26b15f,_0xb062('0x15'),JSON[_0xb062('0x16')](_0x5ae9c8));if(_0x5ae9c8[_0xb062('0x17')]){if(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x18')]===0x1f4){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);return _0x516d96(_0x5ae9c8['error'][_0xb062('0x19')]);}logger[_0xb062('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x26b15f,_0x5ae9c8[_0xb062('0x17')]['message']);return _0x30719a(_0x5ae9c8[_0xb062('0x17')][_0xb062('0x19')]);}else{logger[_0xb062('0x1a')](_0xb062('0x13'),_0x26b15f,'request\x20sent');_0x30719a(_0x5ae9c8[_0xb062('0x1b')][_0xb062('0x19')]);}})['catch'](function(_0x2501ca){logger[_0xb062('0x17')](_0xb062('0x13'),_0x26b15f,_0x2501ca);_0x516d96(_0x2501ca);});});}exports[_0xb062('0x1c')]=function(_0x9a68f0){var _0x3eb4ad=this;return new Promise(function(_0x3c3356,_0x496f7f){return db['ChatInteraction'][_0xb062('0x1d')](_0x9a68f0['body'],{'raw':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x20')]||null:null,'attributes':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0[_0xb062('0x1e')][_0xb062('0x21')]||null:null,'limit':_0x9a68f0[_0xb062('0x1e')]?_0x9a68f0['options'][_0xb062('0x22')]||null:null})[_0xb062('0x12')](function(_0x7bc93a){logger['info'](_0xb062('0x1c'),_0x9a68f0);logger['debug'](_0xb062('0x1c'),_0x9a68f0,JSON['stringify'](_0x7bc93a));_0x3c3356(_0x7bc93a);})[_0xb062('0x23')](function(_0x480b83){logger[_0xb062('0x17')](_0xb062('0x1c'),_0x480b83[_0xb062('0x19')],_0x9a68f0);_0x496f7f(_0x3eb4ad[_0xb062('0x17')](0x1f4,_0x480b83[_0xb062('0x19')]));});});};exports['AddTagsToChatInteraction']=function(_0x460a96){return new Promise(function(_0x2acca0,_0x23c8e9){return db[_0xb062('0x24')]['find']({'where':_0x460a96[_0xb062('0x1e')]?_0x460a96[_0xb062('0x1e')][_0xb062('0x20')]||null:null})[_0xb062('0x12')](function(_0x2ba9f0){if(_0x2ba9f0){return _0x2ba9f0[_0xb062('0x25')](_0x460a96[_0xb062('0x26')][_0xb062('0x27')],_[_0xb062('0x28')](_0x460a96[_0xb062('0x26')],[_0xb062('0x27'),'id'])||{});}})[_0xb062('0x29')](function(_0x4a0783){logger[_0xb062('0x1a')](_0xb062('0x2a'),_0x460a96);logger[_0xb062('0x14')](_0xb062('0x2a'),_0x460a96,JSON[_0xb062('0x16')](_0x4a0783));_0x2acca0(_0x4a0783);})[_0xb062('0x23')](function(_0xca353d){logger[_0xb062('0x17')](_0xb062('0x2a'),_0xca353d[_0xb062('0x19')],_0x460a96);_0x23c8e9(_this['error'](0x1f4,_0xca353d[_0xb062('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 76da22c..b437a39 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 _0xe889=['save','update','emit','removeListener','./chatInteraction.events'];(function(_0x1b7a3f,_0x212a5c){var _0x56dee8=function(_0x451ed4){while(--_0x451ed4){_0x1b7a3f['push'](_0x1b7a3f['shift']());}};_0x56dee8(++_0x212a5c);}(_0xe889,0xd6));var _0x9e88=function(_0x53bfae,_0x5c9342){_0x53bfae=_0x53bfae-0x0;var _0x294798=_0xe889[_0x53bfae];return _0x294798;};'use strict';var ChatInteractionEvents=require(_0x9e88('0x0'));var events=[_0x9e88('0x1'),'remove',_0x9e88('0x2')];function createListener(_0x73fd17,_0x12a2c9){return function(_0x24cdc5){_0x12a2c9[_0x9e88('0x3')](_0x73fd17,_0x24cdc5);};}function removeListener(_0x5012c5,_0x59d809){return function(){ChatInteractionEvents[_0x9e88('0x4')](_0x5012c5,_0x59d809);};}exports['register']=function(_0x576de6){for(var _0x2d3347=0x0,_0x3a0b5d=events['length'];_0x2d3347<_0x3a0b5d;_0x2d3347++){var _0x2a9cf8=events[_0x2d3347];var _0x3929aa=createListener('chatInteraction:'+_0x2a9cf8,_0x576de6);ChatInteractionEvents['on'](_0x2a9cf8,_0x3929aa);}};
\ No newline at end of file
+var _0xc86c=['removeListener','chatInteraction:','./chatInteraction.events','save','emit'];(function(_0x20634c,_0x5534fc){var _0x5d8936=function(_0x6b45f2){while(--_0x6b45f2){_0x20634c['push'](_0x20634c['shift']());}};_0x5d8936(++_0x5534fc);}(_0xc86c,0x138));var _0xcc86=function(_0x42e03b,_0x110aea){_0x42e03b=_0x42e03b-0x0;var _0x3ba84b=_0xc86c[_0x42e03b];return _0x3ba84b;};'use strict';var ChatInteractionEvents=require(_0xcc86('0x0'));var events=[_0xcc86('0x1'),'remove','update'];function createListener(_0x3012b1,_0x3c4260){return function(_0x14639c){_0x3c4260[_0xcc86('0x2')](_0x3012b1,_0x14639c);};}function removeListener(_0x4ee129,_0x5d41db){return function(){ChatInteractionEvents[_0xcc86('0x3')](_0x4ee129,_0x5d41db);};}exports['register']=function(_0x55c925){for(var _0x1f39c4=0x0,_0x501fca=events['length'];_0x1f39c4<_0x501fca;_0x1f39c4++){var _0x2d301a=events[_0x1f39c4];var _0x2b08dd=createListener(_0xcc86('0x4')+_0x2d301a,_0x55c925);ChatInteractionEvents['on'](_0x2d301a,_0x2b08dd);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 3d47b6d..8ff7c7c 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 _0x530e=['put','chatinteraction:update','update','customUpdate','/:id/abandon','abandon','/:id/close','close','/:id','delete','removeTags','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','now','originalname','replace','/:id/attachment_upload','single','file','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags'];(function(_0x16b4eb,_0x583bdd){var _0xeb3035=function(_0x1d50b5){while(--_0x1d50b5){_0x16b4eb['push'](_0x16b4eb['shift']());}};_0xeb3035(++_0x583bdd);}(_0x530e,0x106));var _0xe530=function(_0x1c97a8,_0x55c4ca){_0x1c97a8=_0x1c97a8-0x0;var _0x21b006=_0x530e[_0x1c97a8];return _0x21b006;};'use strict';var multer=require(_0xe530('0x0'));var util=require(_0xe530('0x1'));var path=require('path');var timeout=require(_0xe530('0x2'));var express=require(_0xe530('0x3'));var router=express[_0xe530('0x4')]();var fs_extra=require(_0xe530('0x5'));var auth=require(_0xe530('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xe530('0x7'));var controller=require(_0xe530('0x8'));router[_0xe530('0x9')]('/',auth[_0xe530('0xa')](),controller[_0xe530('0xb')]);router[_0xe530('0x9')](_0xe530('0xc'),auth[_0xe530('0xa')](),controller['describe']);router[_0xe530('0x9')]('/:id',auth[_0xe530('0xd')](),controller[_0xe530('0xe')]);router['get'](_0xe530('0xf'),auth['isChatInteractionAuthorized'](),controller[_0xe530('0x10')]);router[_0xe530('0x9')](_0xe530('0x11'),auth[_0xe530('0xa')](),controller[_0xe530('0x12')]);router['get']('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0xe530('0x13')]);router['get'](_0xe530('0x14'),auth[_0xe530('0xa')](),controller[_0xe530('0x15')]);router[_0xe530('0x16')]('/',auth[_0xe530('0xa')](),controller[_0xe530('0x17')]);router[_0xe530('0x16')]('/:id/vidaoo',auth[_0xe530('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xc9d75c,_0x9029d1,_0x540aff){_0x540aff(null,path[_0xe530('0x18')](config[_0xe530('0x19')],_0xe530('0x1a')));},'filename':function(_0x5d2236,_0x2f69a1,_0x42a7ac){_0x42a7ac(null,util['format']('%s-%s',Date[_0xe530('0x1b')](),_0x2f69a1[_0xe530('0x1c')][_0xe530('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe530('0x16')](_0xe530('0x1e'),upload[_0xe530('0x1f')](_0xe530('0x20')),controller['attachmentUpload']);router[_0xe530('0x16')](_0xe530('0x11'),auth['isChatInteractionAuthorized'](),controller[_0xe530('0x21')]);router['post'](_0xe530('0x22'),auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),_0xe530('0x25')),controller['addTags']);router[_0xe530('0x26')]('/:id',auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),_0xe530('0x27')),controller[_0xe530('0x28')]);router[_0xe530('0x26')]('/:id/custom_update',controller[_0xe530('0x29')]);router[_0xe530('0x26')](_0xe530('0x2a'),auth[_0xe530('0xd')](),controller[_0xe530('0x2b')]);router['put'](_0xe530('0x2c'),controller[_0xe530('0x2d')]);router['delete'](_0xe530('0x2e'),auth[_0xe530('0xa')](),interaction[_0xe530('0x23')](_0xe530('0x24'),'chatinteraction:destroy'),controller['destroy']);router[_0xe530('0x2f')](_0xe530('0x22'),auth[_0xe530('0xa')](),controller[_0xe530('0x30')]);module[_0xe530('0x31')]=router;
\ No newline at end of file
+var _0xcaab=['diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','update','put','/:id/custom_update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','exports','multer','path','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession'];(function(_0x344d0a,_0x32bb71){var _0x58a652=function(_0xcda1a7){while(--_0xcda1a7){_0x344d0a['push'](_0x344d0a['shift']());}};_0x58a652(++_0x32bb71);}(_0xcaab,0x10b));var _0xbcaa=function(_0x3f30a5,_0x180083){_0x3f30a5=_0x3f30a5-0x0;var _0x18d972=_0xcaab[_0x3f30a5];return _0x18d972;};'use strict';var multer=require(_0xbcaa('0x0'));var util=require('util');var path=require(_0xbcaa('0x1'));var timeout=require('connect-timeout');var express=require(_0xbcaa('0x2'));var router=express[_0xbcaa('0x3')]();var fs_extra=require(_0xbcaa('0x4'));var auth=require(_0xbcaa('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbcaa('0x6'));var controller=require(_0xbcaa('0x7'));router[_0xbcaa('0x8')]('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xa')]);router['get'](_0xbcaa('0xb'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0xc')]);router[_0xbcaa('0x8')](_0xbcaa('0xd'),auth['isChatInteractionAuthorized'](),controller[_0xbcaa('0xe')]);router[_0xbcaa('0x8')](_0xbcaa('0xf'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x11')]);router[_0xbcaa('0x8')](_0xbcaa('0x12'),auth['isAuthenticated'](),controller[_0xbcaa('0x13')]);router[_0xbcaa('0x8')](_0xbcaa('0x14'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x15')]);router[_0xbcaa('0x8')](_0xbcaa('0x16'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x17')]);router['post']('/',auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x18')]);router[_0xbcaa('0x19')](_0xbcaa('0x1a'),auth[_0xbcaa('0x9')](),controller[_0xbcaa('0x1b')]);var upload=multer({'storage':multer[_0xbcaa('0x1c')]({'destination':function(_0x1d7ddd,_0x486a75,_0x1377be){_0x1377be(null,path[_0xbcaa('0x1d')](config[_0xbcaa('0x1e')],_0xbcaa('0x1f')));},'filename':function(_0x437c8c,_0x43379e,_0x5b1613){_0x5b1613(null,util['format'](_0xbcaa('0x20'),Date[_0xbcaa('0x21')](),_0x43379e[_0xbcaa('0x22')][_0xbcaa('0x23')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0xbcaa('0x24'),upload[_0xbcaa('0x25')](_0xbcaa('0x26')),controller[_0xbcaa('0x27')]);router[_0xbcaa('0x19')](_0xbcaa('0x12'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x28')]);router['post'](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2c')),controller[_0xbcaa('0x2d')]);router['put'](_0xbcaa('0xd'),auth[_0xbcaa('0x9')](),interaction[_0xbcaa('0x2a')](_0xbcaa('0x2b'),_0xbcaa('0x2e')),controller[_0xbcaa('0x2f')]);router[_0xbcaa('0x30')](_0xbcaa('0x31'),controller[_0xbcaa('0x32')]);router[_0xbcaa('0x30')](_0xbcaa('0x33'),auth[_0xbcaa('0x10')](),controller[_0xbcaa('0x34')]);router[_0xbcaa('0x30')](_0xbcaa('0x35'),controller[_0xbcaa('0x36')]);router[_0xbcaa('0x37')]('/:id',auth[_0xbcaa('0x9')](),interaction['tracked']('chat',_0xbcaa('0x38')),controller[_0xbcaa('0x39')]);router[_0xbcaa('0x37')](_0xbcaa('0x29'),auth[_0xbcaa('0x9')](),controller['removeTags']);module[_0xbcaa('0x3a')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index f7e100c..6a744ea 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 _0xbad0=['BOOLEAN','exports','TEXT'];(function(_0x57d93d,_0x3e393b){var _0x25cb7d=function(_0x4be5e1){while(--_0x4be5e1){_0x57d93d['push'](_0x57d93d['shift']());}};_0x25cb7d(++_0x3e393b);}(_0xbad0,0x18a));var _0x0bad=function(_0x27671e,_0x351e75){_0x27671e=_0x27671e-0x0;var _0x20f949=_0xbad0[_0x27671e];return _0x20f949;};'use strict';var Sequelize=require('sequelize');module[_0x0bad('0x0')]={'body':{'type':Sequelize[_0x0bad('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0bad('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x1a3b=['sequelize','TEXT','BOOLEAN','INTEGER'];(function(_0x3fb392,_0x4259ad){var _0x49b16e=function(_0x5aec73){while(--_0x5aec73){_0x3fb392['push'](_0x3fb392['shift']());}};_0x49b16e(++_0x4259ad);}(_0x1a3b,0x138));var _0xb1a3=function(_0x2970f7,_0x2cbd32){_0x2970f7=_0x2970f7-0x0;var _0x263211=_0x1a3b[_0x2970f7];return _0x263211;};'use strict';var Sequelize=require(_0xb1a3('0x0'));module['exports']={'body':{'type':Sequelize[_0xb1a3('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xb1a3('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xb1a3('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 18b2811..2ee7d6f 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 _0x32c3=['-online','VoiceQueue','VoiceQueues','user','UserProfileSection','Agents','autoAssociation','UserProfileResource','findAll','isEmpty','agent','resourceId','push','createdAt','read','-createdAt','all','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','localhost','register','sendStatus','status','offset','limit','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','end','error','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','sort','filter','where','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','find','create','body','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','fullname','role','online','lastLoginAt','allowmessenger','showWebBar'];(function(_0x5b28ff,_0x1531f0){var _0xdebb37=function(_0x597284){while(--_0x597284){_0x5b28ff['push'](_0x5b28ff['shift']());}};_0xdebb37(++_0x1531f0);}(_0x32c3,0x1c9));var _0x332c=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x32c3[_0x14add3];return _0x4a174f;};'use strict';var emlformat=require(_0x332c('0x0'));var rimraf=require(_0x332c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x332c('0x2'));var rp=require(_0x332c('0x3'));var moment=require(_0x332c('0x4'));var BPromise=require(_0x332c('0x5'));var Mustache=require(_0x332c('0x6'));var util=require('util');var path=require(_0x332c('0x7'));var sox=require(_0x332c('0x8'));var csv=require(_0x332c('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x332c('0xa'));var _=require(_0x332c('0xb'));var squel=require(_0x332c('0xc'));var crypto=require(_0x332c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x332c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x332c('0xf'));var Papa=require(_0x332c('0x10'));var Redis=require(_0x332c('0x11'));var authService=require(_0x332c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x332c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x332c('0x14'))(_0x332c('0x15'));var utils=require(_0x332c('0x16'));var config=require(_0x332c('0x17'));var licenseUtil=require(_0x332c('0x18'));var db=require(_0x332c('0x19'))['db'];config['redis']=_[_0x332c('0x1a')](config[_0x332c('0x1b')],{'host':_0x332c('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatInternalMessage.socket')[_0x332c('0x1d')](socket);function respondWithStatusCode(_0x4aacf6,_0x5664af){_0x5664af=_0x5664af||0xcc;return function(_0x4abbb0){if(_0x4abbb0){return _0x4aacf6[_0x332c('0x1e')](_0x5664af);}return _0x4aacf6['status'](_0x5664af)['end']();};}function respondWithResult(_0x40cf05,_0x158a48){_0x158a48=_0x158a48||0xc8;return function(_0x522999){if(_0x522999){return _0x40cf05[_0x332c('0x1f')](_0x158a48)['json'](_0x522999);}};}function respondWithFilteredResult(_0xec0fa6,_0x453aba){return function(_0x362300){if(_0x362300){var _0x4efa1f=typeof _0x453aba[_0x332c('0x20')]==='undefined'&&typeof _0x453aba[_0x332c('0x21')]===_0x332c('0x22');var _0x598a81=_0x362300[_0x332c('0x23')];var _0x280534=_0x4efa1f?0x0:_0x453aba[_0x332c('0x20')];var _0x27a443=_0x4efa1f?_0x362300['count']:_0x453aba[_0x332c('0x20')]+_0x453aba['limit'];var _0x4ca6f7;if(_0x27a443>=_0x598a81){_0x27a443=_0x598a81;_0x4ca6f7=0xc8;}else{_0x4ca6f7=0xce;}_0xec0fa6[_0x332c('0x1f')](_0x4ca6f7);return _0xec0fa6['set'](_0x332c('0x24'),_0x280534+'-'+_0x27a443+'/'+_0x598a81)[_0x332c('0x25')](_0x362300);}return null;};}function patchUpdates(_0x5a9080){return function(_0x573034){try{jsonpatch[_0x332c('0x26')](_0x573034,_0x5a9080,!![]);}catch(_0x38737a){return BPromise[_0x332c('0x27')](_0x38737a);}return _0x573034[_0x332c('0x28')]();};}function saveUpdates(_0x28f44e,_0x2c76d7){return function(_0x336769){if(_0x336769){return _0x336769[_0x332c('0x29')](_0x28f44e)[_0x332c('0x2a')](function(_0x3c4b43){return _0x3c4b43;});}return null;};}function removeEntity(_0xe46d80,_0x225933){return function(_0x34f92b){if(_0x34f92b){return _0x34f92b[_0x332c('0x2b')]()[_0x332c('0x2a')](function(){_0xe46d80[_0x332c('0x1f')](0xcc)[_0x332c('0x2c')]();});}};}function handleEntityNotFound(_0x1c2070,_0xf66390){return function(_0x2df2a8){if(!_0x2df2a8){_0x1c2070['sendStatus'](0x194);}return _0x2df2a8;};}function handleError(_0x3dffef,_0x5514b1){_0x5514b1=_0x5514b1||0x1f4;return function(_0x2878a2){logger[_0x332c('0x2d')](_0x2878a2['stack']);if(_0x2878a2[_0x332c('0x2e')]){delete _0x2878a2[_0x332c('0x2e')];}_0x3dffef[_0x332c('0x1f')](_0x5514b1)[_0x332c('0x2f')](_0x2878a2);};}exports[_0x332c('0x30')]=function(_0x29d321,_0x22514b){var _0x26adb8={},_0x2e64d7={},_0x4d9eab={'count':0x0,'rows':[]};var _0x4aba95=_[_0x332c('0x31')](db[_0x332c('0x32')][_0x332c('0x33')],function(_0x522dfb){return{'name':_0x522dfb[_0x332c('0x34')],'type':_0x522dfb[_0x332c('0x35')][_0x332c('0x36')]};});_0x2e64d7[_0x332c('0x37')]=_[_0x332c('0x31')](_0x4aba95,'name');_0x2e64d7[_0x332c('0x38')]=_[_0x332c('0x39')](_0x29d321['query']);_0x2e64d7[_0x332c('0x3a')]=_[_0x332c('0x3b')](_0x2e64d7['model'],_0x2e64d7[_0x332c('0x38')]);_0x26adb8['attributes']=_[_0x332c('0x3b')](_0x2e64d7[_0x332c('0x37')],qs[_0x332c('0x3c')](_0x29d321['query']['fields']));_0x26adb8['attributes']=_0x26adb8[_0x332c('0x3d')][_0x332c('0x3e')]?_0x26adb8['attributes']:_0x2e64d7['model'];if(!_0x29d321['query'][_0x332c('0x3f')]('nolimit')){_0x26adb8['limit']=qs[_0x332c('0x21')](_0x29d321[_0x332c('0x38')]['limit']);_0x26adb8[_0x332c('0x20')]=qs[_0x332c('0x20')](_0x29d321['query'][_0x332c('0x20')]);}_0x26adb8['order']=qs[_0x332c('0x40')](_0x29d321['query'][_0x332c('0x40')]);_0x26adb8['where']=qs[_0x332c('0x3a')](_['pick'](_0x29d321[_0x332c('0x38')],_0x2e64d7[_0x332c('0x3a')]),_0x4aba95);if(_0x29d321[_0x332c('0x38')][_0x332c('0x41')]){_0x26adb8[_0x332c('0x42')]=_[_0x332c('0x43')](_0x26adb8[_0x332c('0x42')],{'$or':_['map'](_0x4aba95,function(_0x1c6451){if(_0x1c6451[_0x332c('0x35')]!==_0x332c('0x44')){var _0x4fac95={};_0x4fac95[_0x1c6451[_0x332c('0x2e')]]={'$like':'%'+_0x29d321[_0x332c('0x38')][_0x332c('0x41')]+'%'};return _0x4fac95;}})});}_0x26adb8=_[_0x332c('0x43')]({},_0x26adb8,_0x29d321[_0x332c('0x45')]);var _0x10b314={'where':_0x26adb8[_0x332c('0x42')]};return db[_0x332c('0x32')][_0x332c('0x23')](_0x10b314)[_0x332c('0x2a')](function(_0x32bddb){_0x4d9eab['count']=_0x32bddb;if(_0x29d321[_0x332c('0x38')][_0x332c('0x46')]){_0x26adb8[_0x332c('0x47')]=[{'all':!![]}];}return db[_0x332c('0x32')]['findAll'](_0x26adb8);})['then'](function(_0x4ab0fc){_0x4d9eab[_0x332c('0x48')]=_0x4ab0fc;return _0x4d9eab;})[_0x332c('0x2a')](respondWithFilteredResult(_0x22514b,_0x26adb8))[_0x332c('0x49')](handleError(_0x22514b,null));};exports[_0x332c('0x4a')]=function(_0x240943,_0x15c991){var _0x1a7939={'raw':!![],'where':{'id':_0x240943[_0x332c('0x4b')]['id']}},_0x54bf71={};_0x54bf71[_0x332c('0x37')]=_[_0x332c('0x39')](db[_0x332c('0x32')][_0x332c('0x33')]);_0x54bf71[_0x332c('0x38')]=_[_0x332c('0x39')](_0x240943['query']);_0x54bf71[_0x332c('0x3a')]=_[_0x332c('0x3b')](_0x54bf71[_0x332c('0x37')],_0x54bf71[_0x332c('0x38')]);_0x1a7939[_0x332c('0x3d')]=_[_0x332c('0x3b')](_0x54bf71['model'],qs[_0x332c('0x3c')](_0x240943[_0x332c('0x38')]['fields']));_0x1a7939[_0x332c('0x3d')]=_0x1a7939[_0x332c('0x3d')][_0x332c('0x3e')]?_0x1a7939[_0x332c('0x3d')]:_0x54bf71[_0x332c('0x37')];if(_0x240943[_0x332c('0x38')]['includeAll']){_0x1a7939['include']=[{'all':!![]}];}_0x1a7939=_[_0x332c('0x43')]({},_0x1a7939,_0x240943[_0x332c('0x45')]);return db[_0x332c('0x32')][_0x332c('0x4c')](_0x1a7939)[_0x332c('0x2a')](handleEntityNotFound(_0x15c991,null))[_0x332c('0x2a')](respondWithResult(_0x15c991,null))['catch'](handleError(_0x15c991,null));};exports[_0x332c('0x4d')]=function(_0x5b15c8,_0x3f15f8){return db['ChatInternalMessage'][_0x332c('0x4d')](_0x5b15c8[_0x332c('0x4e')],{})[_0x332c('0x2a')](respondWithResult(_0x3f15f8,0xc9))['catch'](handleError(_0x3f15f8,null));};exports[_0x332c('0x29')]=function(_0x153ebe,_0x154149){if(_0x153ebe[_0x332c('0x4e')]['id']){delete _0x153ebe[_0x332c('0x4e')]['id'];}return db[_0x332c('0x32')]['find']({'where':{'id':_0x153ebe[_0x332c('0x4b')]['id']}})[_0x332c('0x2a')](handleEntityNotFound(_0x154149,null))[_0x332c('0x2a')](saveUpdates(_0x153ebe[_0x332c('0x4e')],null))[_0x332c('0x2a')](respondWithResult(_0x154149,null))[_0x332c('0x49')](handleError(_0x154149,null));};exports[_0x332c('0x2b')]=function(_0x4a66db,_0x1d8fc8){return db[_0x332c('0x32')][_0x332c('0x4c')]({'where':{'id':_0x4a66db[_0x332c('0x4b')]['id']}})[_0x332c('0x2a')](handleEntityNotFound(_0x1d8fc8,null))[_0x332c('0x2a')](removeEntity(_0x1d8fc8,null))[_0x332c('0x49')](handleError(_0x1d8fc8,null));};exports[_0x332c('0x4f')]=function(_0x55a339,_0x19746f){return db['ChatInternalMessage'][_0x332c('0x4f')]()[_0x332c('0x2a')](respondWithResult(_0x19746f,null))[_0x332c('0x49')](handleError(_0x19746f,null));};function wrapUser(_0x28a71d){return function(_0x4883fc){var _0x2c7362=_0x28a71d[_0x332c('0x50')]({'plain':!![]});_0x2c7362[_0x332c('0x51')]=[];if(_0x4883fc){_0x2c7362[_0x332c('0x52')]=_0x4883fc['createdAt'];_0x2c7362[_0x332c('0x53')]=_0x4883fc;}else{_0x2c7362[_0x332c('0x52')]=moment(0x0)['format'](_0x332c('0x54'));_0x2c7362[_0x332c('0x53')]={};}return _0x2c7362;};}exports[_0x332c('0x55')]=function(_0x465c1f,_0x382881,_0x4f50e5){var _0x453a51=[];return db[_0x332c('0x56')]['findAll']({'where':{'role':['agent','admin','user']},'attributes':['id',_0x332c('0x57'),_0x332c('0x2e'),_0x332c('0x58'),'userpic','internal',_0x332c('0x59'),_0x332c('0x5a'),_0x332c('0x5b'),_0x332c('0x5c')],'order':qs[_0x332c('0x40')](_0x332c('0x5d')),'include':[{'model':db[_0x332c('0x5e')],'as':_0x332c('0x5f'),'attributes':['id',_0x332c('0x2e'),_0x332c('0x35')],'through':{'attributes':[]}}]})[_0x332c('0x2a')](function(_0x2d16f9){if(_0x2d16f9){var _0x30d9de=_0x465c1f[_0x332c('0x60')][_0x332c('0x50')]({'plain':!![]});if(!_0x30d9de)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x30d9de['role']===_0x332c('0x60')){return db[_0x332c('0x61')][_0x332c('0x4c')]({'where':{'name':_0x332c('0x62'),'userProfileId':_0x30d9de['userProfileId']},'raw':!![]})[_0x332c('0x2a')](function(_0x12fb04){if(_0x12fb04){if(_0x12fb04[_0x332c('0x63')]===0x0){return db[_0x332c('0x64')][_0x332c('0x65')]({'where':{'sectionId':_0x12fb04['id']},'raw':!![]})['then'](function(_0xfb24e0){var _0x3e35d9=[];if(_[_0x332c('0x66')](_0xfb24e0)){_0x3e35d9=_['filter'](_0x2d16f9,function(_0x4af5ac){if(_0x4af5ac[_0x332c('0x58')]!==_0x332c('0x67')){return _0x4af5ac;}});return _0x3e35d9;}else{for(var _0x5d854b=0x0;_0x5d854b<_0x2d16f9[_0x332c('0x3e')];_0x5d854b++){var _0x1b3904=_0x2d16f9[_0x5d854b];if(_0x1b3904[_0x332c('0x58')]==='agent'){var _0x149050=_[_0x332c('0x4c')](_0xfb24e0,function(_0x17a805){return _0x17a805[_0x332c('0x68')]===_0x1b3904['id'];});if(_0x149050)_0x3e35d9[_0x332c('0x69')](_0x1b3904);}else{_0x3e35d9[_0x332c('0x69')](_0x1b3904);}}return _0x3e35d9;}});}else{return _0x2d16f9;}}else{var _0x3748e6=_['filter'](_0x2d16f9,function(_0x34c1cd){if(_0x34c1cd[_0x332c('0x58')]!==_0x332c('0x67')){return _0x34c1cd;}});return _0x3748e6;}});}else{return _0x2d16f9;}}})[_0x332c('0x2a')](function(_0x5ec221){var _0x1be782=[];if(_0x5ec221){_0x453a51=_0x5ec221;for(var _0x460124=0x0;_0x460124<_0x5ec221['length'];_0x460124+=0x1){_0x453a51[_0x460124][_0x332c('0x51')]=[];_0x1be782['push'](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x465c1f['user']['id'],_0x5ec221[_0x460124]['id']],'ToId':[_0x465c1f[_0x332c('0x60')]['id'],_0x5ec221[_0x460124]['id']],'ChatGroupId':null},'attributes':['id',_0x332c('0x6a'),'FromId','ToId',_0x332c('0x6b'),_0x332c('0x4e')],'order':qs[_0x332c('0x40')](_0x332c('0x6c')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x332c('0x2a')](wrapUser(_0x5ec221[_0x460124])));}return BPromise[_0x332c('0x6d')](_0x1be782);}return[];})['then'](function(_0x50ed63){return{'rows':_0x50ed63,'count':_0x50ed63[_0x332c('0x3e')]};})[_0x332c('0x2a')](respondWithResult(_0x382881,null))[_0x332c('0x49')](handleError(_0x382881,null));};
\ No newline at end of file
+var _0xcc96=['then','destroy','error','stack','name','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','ChatInternalMessage','include','findAll','rows','catch','show','fields','length','includeAll','find','create','body','params','describe','get','lastMessageAt','createdAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','fullname','role','userpic','online','lastLoginAt','allowmessenger','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','agent','push','messages','FromId','all','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update'];(function(_0x3a6c6d,_0x2dda5c){var _0x4868ed=function(_0x3f3682){while(--_0x3f3682){_0x3a6c6d['push'](_0x3a6c6d['shift']());}};_0x4868ed(++_0x2dda5c);}(_0xcc96,0x17c));var _0x6cc9=function(_0x279b5b,_0x49641e){_0x279b5b=_0x279b5b-0x0;var _0x220f80=_0xcc96[_0x279b5b];return _0x220f80;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x6cc9('0x0'));var zipdir=require(_0x6cc9('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6cc9('0x2'));var moment=require(_0x6cc9('0x3'));var BPromise=require(_0x6cc9('0x4'));var Mustache=require(_0x6cc9('0x5'));var util=require(_0x6cc9('0x6'));var path=require(_0x6cc9('0x7'));var sox=require(_0x6cc9('0x8'));var csv=require(_0x6cc9('0x9'));var ejs=require(_0x6cc9('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x6cc9('0xb'));var squel=require(_0x6cc9('0xc'));var crypto=require(_0x6cc9('0xd'));var jsforce=require(_0x6cc9('0xe'));var deskjs=require(_0x6cc9('0xf'));var toCsv=require(_0x6cc9('0x9'));var querystring=require(_0x6cc9('0x10'));var Papa=require(_0x6cc9('0x11'));var Redis=require('ioredis');var authService=require(_0x6cc9('0x12'));var qs=require(_0x6cc9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6cc9('0x14'))(_0x6cc9('0x15'));var utils=require(_0x6cc9('0x16'));var config=require(_0x6cc9('0x17'));var licenseUtil=require(_0x6cc9('0x18'));var db=require('../../mysqldb')['db'];config[_0x6cc9('0x19')]=_[_0x6cc9('0x1a')](config[_0x6cc9('0x19')],{'host':_0x6cc9('0x1b'),'port':0x18eb});var socket=require(_0x6cc9('0x1c'))(new Redis(config['redis']));require(_0x6cc9('0x1d'))[_0x6cc9('0x1e')](socket);function respondWithStatusCode(_0x5e4412,_0x3b3be7){_0x3b3be7=_0x3b3be7||0xcc;return function(_0x27c7cc){if(_0x27c7cc){return _0x5e4412[_0x6cc9('0x1f')](_0x3b3be7);}return _0x5e4412[_0x6cc9('0x20')](_0x3b3be7)[_0x6cc9('0x21')]();};}function respondWithResult(_0x1757a3,_0x129053){_0x129053=_0x129053||0xc8;return function(_0x5bc0e1){if(_0x5bc0e1){return _0x1757a3[_0x6cc9('0x20')](_0x129053)[_0x6cc9('0x22')](_0x5bc0e1);}};}function respondWithFilteredResult(_0x46fdb9,_0x533c1c){return function(_0x584c06){if(_0x584c06){var _0x3fea9d=typeof _0x533c1c[_0x6cc9('0x23')]===_0x6cc9('0x24')&&typeof _0x533c1c[_0x6cc9('0x25')]===_0x6cc9('0x24');var _0x12b1ed=_0x584c06[_0x6cc9('0x26')];var _0x163a54=_0x3fea9d?0x0:_0x533c1c['offset'];var _0x15865b=_0x3fea9d?_0x584c06[_0x6cc9('0x26')]:_0x533c1c['offset']+_0x533c1c['limit'];var _0x2bd696;if(_0x15865b>=_0x12b1ed){_0x15865b=_0x12b1ed;_0x2bd696=0xc8;}else{_0x2bd696=0xce;}_0x46fdb9['status'](_0x2bd696);return _0x46fdb9[_0x6cc9('0x27')](_0x6cc9('0x28'),_0x163a54+'-'+_0x15865b+'/'+_0x12b1ed)[_0x6cc9('0x22')](_0x584c06);}return null;};}function patchUpdates(_0x54db34){return function(_0x227d6d){try{jsonpatch['apply'](_0x227d6d,_0x54db34,!![]);}catch(_0x2b2901){return BPromise[_0x6cc9('0x29')](_0x2b2901);}return _0x227d6d[_0x6cc9('0x2a')]();};}function saveUpdates(_0x4c31e8,_0x192d03){return function(_0x2293c0){if(_0x2293c0){return _0x2293c0[_0x6cc9('0x2b')](_0x4c31e8)[_0x6cc9('0x2c')](function(_0x2f47c6){return _0x2f47c6;});}return null;};}function removeEntity(_0x1c8a36,_0x8e5686){return function(_0x3e2263){if(_0x3e2263){return _0x3e2263[_0x6cc9('0x2d')]()[_0x6cc9('0x2c')](function(){_0x1c8a36[_0x6cc9('0x20')](0xcc)[_0x6cc9('0x21')]();});}};}function handleEntityNotFound(_0x619a4d,_0x2ecda8){return function(_0x3dca84){if(!_0x3dca84){_0x619a4d['sendStatus'](0x194);}return _0x3dca84;};}function handleError(_0x2fa1b6,_0x91a7dd){_0x91a7dd=_0x91a7dd||0x1f4;return function(_0x5627f7){logger[_0x6cc9('0x2e')](_0x5627f7[_0x6cc9('0x2f')]);if(_0x5627f7[_0x6cc9('0x30')]){delete _0x5627f7['name'];}_0x2fa1b6[_0x6cc9('0x20')](_0x91a7dd)['send'](_0x5627f7);};}exports['index']=function(_0x573408,_0xc76fa7){var _0x504474={},_0x4d64f3={},_0x46dfc0={'count':0x0,'rows':[]};var _0x5bd243=_['map'](db['ChatInternalMessage'][_0x6cc9('0x31')],function(_0x264a91){return{'name':_0x264a91[_0x6cc9('0x32')],'type':_0x264a91[_0x6cc9('0x33')][_0x6cc9('0x34')]};});_0x4d64f3[_0x6cc9('0x35')]=_['map'](_0x5bd243,_0x6cc9('0x30'));_0x4d64f3[_0x6cc9('0x36')]=_[_0x6cc9('0x37')](_0x573408[_0x6cc9('0x36')]);_0x4d64f3[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],_0x4d64f3[_0x6cc9('0x36')]);_0x504474[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x4d64f3[_0x6cc9('0x35')],qs['fields'](_0x573408[_0x6cc9('0x36')]['fields']));_0x504474[_0x6cc9('0x3a')]=_0x504474[_0x6cc9('0x3a')]['length']?_0x504474[_0x6cc9('0x3a')]:_0x4d64f3[_0x6cc9('0x35')];if(!_0x573408['query']['hasOwnProperty'](_0x6cc9('0x3b'))){_0x504474[_0x6cc9('0x25')]=qs[_0x6cc9('0x25')](_0x573408['query'][_0x6cc9('0x25')]);_0x504474[_0x6cc9('0x23')]=qs['offset'](_0x573408['query'][_0x6cc9('0x23')]);}_0x504474[_0x6cc9('0x3c')]=qs[_0x6cc9('0x3d')](_0x573408[_0x6cc9('0x36')][_0x6cc9('0x3d')]);_0x504474[_0x6cc9('0x3e')]=qs[_0x6cc9('0x38')](_[_0x6cc9('0x3f')](_0x573408[_0x6cc9('0x36')],_0x4d64f3[_0x6cc9('0x38')]),_0x5bd243);if(_0x573408[_0x6cc9('0x36')][_0x6cc9('0x40')]){_0x504474[_0x6cc9('0x3e')]=_[_0x6cc9('0x41')](_0x504474[_0x6cc9('0x3e')],{'$or':_[_0x6cc9('0x42')](_0x5bd243,function(_0x3335ee){if(_0x3335ee[_0x6cc9('0x33')]!==_0x6cc9('0x43')){var _0x1a5cf8={};_0x1a5cf8[_0x3335ee[_0x6cc9('0x30')]]={'$like':'%'+_0x573408[_0x6cc9('0x36')]['filter']+'%'};return _0x1a5cf8;}})});}_0x504474=_['merge']({},_0x504474,_0x573408[_0x6cc9('0x44')]);var _0x99d42b={'where':_0x504474[_0x6cc9('0x3e')]};return db[_0x6cc9('0x45')]['count'](_0x99d42b)[_0x6cc9('0x2c')](function(_0x576087){_0x46dfc0['count']=_0x576087;if(_0x573408[_0x6cc9('0x36')]['includeAll']){_0x504474[_0x6cc9('0x46')]=[{'all':!![]}];}return db[_0x6cc9('0x45')][_0x6cc9('0x47')](_0x504474);})['then'](function(_0xf68238){_0x46dfc0[_0x6cc9('0x48')]=_0xf68238;return _0x46dfc0;})[_0x6cc9('0x2c')](respondWithFilteredResult(_0xc76fa7,_0x504474))[_0x6cc9('0x49')](handleError(_0xc76fa7,null));};exports[_0x6cc9('0x4a')]=function(_0x4621f0,_0x16abce){var _0x190d44={'raw':!![],'where':{'id':_0x4621f0['params']['id']}},_0x1c64b9={};_0x1c64b9['model']=_['keys'](db['ChatInternalMessage'][_0x6cc9('0x31')]);_0x1c64b9[_0x6cc9('0x36')]=_['keys'](_0x4621f0['query']);_0x1c64b9[_0x6cc9('0x38')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],_0x1c64b9[_0x6cc9('0x36')]);_0x190d44[_0x6cc9('0x3a')]=_[_0x6cc9('0x39')](_0x1c64b9[_0x6cc9('0x35')],qs[_0x6cc9('0x4b')](_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4b')]));_0x190d44['attributes']=_0x190d44[_0x6cc9('0x3a')][_0x6cc9('0x4c')]?_0x190d44[_0x6cc9('0x3a')]:_0x1c64b9[_0x6cc9('0x35')];if(_0x4621f0[_0x6cc9('0x36')][_0x6cc9('0x4d')]){_0x190d44[_0x6cc9('0x46')]=[{'all':!![]}];}_0x190d44=_[_0x6cc9('0x41')]({},_0x190d44,_0x4621f0[_0x6cc9('0x44')]);return db['ChatInternalMessage'][_0x6cc9('0x4e')](_0x190d44)[_0x6cc9('0x2c')](handleEntityNotFound(_0x16abce,null))[_0x6cc9('0x2c')](respondWithResult(_0x16abce,null))[_0x6cc9('0x49')](handleError(_0x16abce,null));};exports[_0x6cc9('0x4f')]=function(_0x5373fe,_0x3adea4){return db[_0x6cc9('0x45')][_0x6cc9('0x4f')](_0x5373fe['body'],{})[_0x6cc9('0x2c')](respondWithResult(_0x3adea4,0xc9))['catch'](handleError(_0x3adea4,null));};exports['update']=function(_0x3c0271,_0x9626c){if(_0x3c0271[_0x6cc9('0x50')]['id']){delete _0x3c0271[_0x6cc9('0x50')]['id'];}return db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'id':_0x3c0271[_0x6cc9('0x51')]['id']}})[_0x6cc9('0x2c')](handleEntityNotFound(_0x9626c,null))[_0x6cc9('0x2c')](saveUpdates(_0x3c0271[_0x6cc9('0x50')],null))[_0x6cc9('0x2c')](respondWithResult(_0x9626c,null))[_0x6cc9('0x49')](handleError(_0x9626c,null));};exports[_0x6cc9('0x2d')]=function(_0x24fa53,_0x2527c1){return db['ChatInternalMessage'][_0x6cc9('0x4e')]({'where':{'id':_0x24fa53[_0x6cc9('0x51')]['id']}})['then'](handleEntityNotFound(_0x2527c1,null))[_0x6cc9('0x2c')](removeEntity(_0x2527c1,null))['catch'](handleError(_0x2527c1,null));};exports[_0x6cc9('0x52')]=function(_0x202ec3,_0x544580){return db[_0x6cc9('0x45')][_0x6cc9('0x52')]()[_0x6cc9('0x2c')](respondWithResult(_0x544580,null))[_0x6cc9('0x49')](handleError(_0x544580,null));};function wrapUser(_0x13dc12){return function(_0x5ee8c9){var _0x702778=_0x13dc12[_0x6cc9('0x53')]({'plain':!![]});_0x702778['messages']=[];if(_0x5ee8c9){_0x702778[_0x6cc9('0x54')]=_0x5ee8c9[_0x6cc9('0x55')];_0x702778[_0x6cc9('0x56')]=_0x5ee8c9;}else{_0x702778[_0x6cc9('0x54')]=moment(0x0)['format'](_0x6cc9('0x57'));_0x702778[_0x6cc9('0x56')]={};}return _0x702778;};}exports['getUsers']=function(_0x2d2905,_0x1e5671,_0x44d37c){var _0x23caa0=[];return db[_0x6cc9('0x58')][_0x6cc9('0x47')]({'where':{'role':['agent','admin','user']},'attributes':['id',_0x6cc9('0x59'),'name',_0x6cc9('0x5a'),_0x6cc9('0x5b'),'internal',_0x6cc9('0x5c'),_0x6cc9('0x5d'),_0x6cc9('0x5e'),'showWebBar'],'order':qs[_0x6cc9('0x3d')]('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x6cc9('0x5f'),'attributes':['id',_0x6cc9('0x30'),'type'],'through':{'attributes':[]}}]})[_0x6cc9('0x2c')](function(_0x41386a){if(_0x41386a){var _0x37cc83=_0x2d2905[_0x6cc9('0x60')][_0x6cc9('0x53')]({'plain':!![]});if(!_0x37cc83)throw new Error(_0x6cc9('0x61'));if(_0x37cc83['role']===_0x6cc9('0x60')){return db['UserProfileSection'][_0x6cc9('0x4e')]({'where':{'name':_0x6cc9('0x62'),'userProfileId':_0x37cc83[_0x6cc9('0x63')]},'raw':!![]})[_0x6cc9('0x2c')](function(_0x2ed8f9){if(_0x2ed8f9){if(_0x2ed8f9['autoAssociation']===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x2ed8f9['id']},'raw':!![]})[_0x6cc9('0x2c')](function(_0x1721c3){var _0x3ab218=[];if(_[_0x6cc9('0x64')](_0x1721c3)){_0x3ab218=_[_0x6cc9('0x40')](_0x41386a,function(_0x53b07f){if(_0x53b07f[_0x6cc9('0x5a')]!==_0x6cc9('0x65')){return _0x53b07f;}});return _0x3ab218;}else{for(var _0x86df85=0x0;_0x86df85<_0x41386a[_0x6cc9('0x4c')];_0x86df85++){var _0x5e24ba=_0x41386a[_0x86df85];if(_0x5e24ba[_0x6cc9('0x5a')]===_0x6cc9('0x65')){var _0x254e6e=_[_0x6cc9('0x4e')](_0x1721c3,function(_0x27244d){return _0x27244d['resourceId']===_0x5e24ba['id'];});if(_0x254e6e)_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}else{_0x3ab218[_0x6cc9('0x66')](_0x5e24ba);}}return _0x3ab218;}});}else{return _0x41386a;}}else{var _0x44af76=_[_0x6cc9('0x40')](_0x41386a,function(_0x36b06e){if(_0x36b06e['role']!==_0x6cc9('0x65')){return _0x36b06e;}});return _0x44af76;}});}else{return _0x41386a;}}})[_0x6cc9('0x2c')](function(_0x419c75){var _0x5c3d25=[];if(_0x419c75){_0x23caa0=_0x419c75;for(var _0x12123f=0x0;_0x12123f<_0x419c75[_0x6cc9('0x4c')];_0x12123f+=0x1){_0x23caa0[_0x12123f][_0x6cc9('0x67')]=[];_0x5c3d25['push'](db[_0x6cc9('0x45')][_0x6cc9('0x4e')]({'where':{'FromId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ToId':[_0x2d2905[_0x6cc9('0x60')]['id'],_0x419c75[_0x12123f]['id']],'ChatGroupId':null},'attributes':['id',_0x6cc9('0x55'),_0x6cc9('0x68'),'ToId','read','body'],'order':qs[_0x6cc9('0x3d')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x6cc9('0x2c')](wrapUser(_0x419c75[_0x12123f])));}return BPromise[_0x6cc9('0x69')](_0x5c3d25);}return[];})[_0x6cc9('0x2c')](function(_0x46b2f9){return{'rows':_0x46b2f9,'count':_0x46b2f9[_0x6cc9('0x4c')]};})[_0x6cc9('0x2c')](respondWithResult(_0x1e5671,null))[_0x6cc9('0x49')](handleError(_0x1e5671,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 887ba9a..ad851a3 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 _0xdd72=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1568fa,_0x3cba8d){var _0x3e433a=function(_0x4f8d57){while(--_0x4f8d57){_0x1568fa['push'](_0x1568fa['shift']());}};_0x3e433a(++_0x3cba8d);}(_0xdd72,0xb4));var _0x2dd7=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0xdd72[_0x22b8a3];return _0x199a0c;};'use strict';var EventEmitter=require(_0x2dd7('0x0'));var ChatInternalMessage=require(_0x2dd7('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2dd7('0x2')](0x0);var events={'afterCreate':_0x2dd7('0x3'),'afterUpdate':_0x2dd7('0x4'),'afterDestroy':_0x2dd7('0x5')};function emitEvent(_0x9797c4){return function(_0x16f0a4,_0x19d79b,_0x47f7c0){ChatInternalMessageEvents[_0x2dd7('0x6')](_0x9797c4+':'+_0x16f0a4['id'],_0x16f0a4);ChatInternalMessageEvents['emit'](_0x9797c4,_0x16f0a4);_0x47f7c0(null);};}for(var e in events){if(events[_0x2dd7('0x7')](e)){var event=events[e];ChatInternalMessage[_0x2dd7('0x8')](e,emitEvent(event));}}module[_0x2dd7('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0xa66e=['exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x505493,_0xa913c8){var _0x5604cc=function(_0x23f626){while(--_0x23f626){_0x505493['push'](_0x505493['shift']());}};_0x5604cc(++_0xa913c8);}(_0xa66e,0xf4));var _0xea66=function(_0x5d7a5a,_0x57c3d0){_0x5d7a5a=_0x5d7a5a-0x0;var _0x33c063=_0xa66e[_0x5d7a5a];return _0x33c063;};'use strict';var EventEmitter=require(_0xea66('0x0'));var ChatInternalMessage=require(_0xea66('0x1'))['db'][_0xea66('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xea66('0x3')](0x0);var events={'afterCreate':_0xea66('0x4'),'afterUpdate':_0xea66('0x5'),'afterDestroy':'remove'};function emitEvent(_0x37baa8){return function(_0x38638b,_0xc7fc47,_0x139ad2){ChatInternalMessageEvents['emit'](_0x37baa8+':'+_0x38638b['id'],_0x38638b);ChatInternalMessageEvents[_0xea66('0x6')](_0x37baa8,_0x38638b);_0x139ad2(null);};}for(var e in events){if(events[_0xea66('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xea66('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 574cf3d..5c8bf7e 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 _0x4575=['ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4575,0x146));var _0x5457=function(_0x5698a9,_0x4ae7c7){_0x5698a9=_0x5698a9-0x0;var _0x3be696=_0x4575[_0x5698a9];return _0x3be696;};'use strict';var _=require('lodash');var util=require(_0x5457('0x0'));var logger=require(_0x5457('0x1'))(_0x5457('0x2'));var moment=require(_0x5457('0x3'));var BPromise=require(_0x5457('0x4'));var rp=require(_0x5457('0x5'));var fs=require('fs');var path=require(_0x5457('0x6'));var rimraf=require(_0x5457('0x7'));var config=require('../../config/environment');var attributes=require('./chatInternalMessage.attributes');module[_0x5457('0x8')]=function(_0x2e491f,_0x508920){return _0x2e491f[_0x5457('0x9')](_0x5457('0xa'),attributes,{'tableName':_0x5457('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5457('0xc'),'collate':_0x5457('0xd')});};
\ No newline at end of file
+var _0x63ec=['util','api','moment','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5115fe,_0x447a8e){var _0x64874d=function(_0x2f74a){while(--_0x2f74a){_0x5115fe['push'](_0x5115fe['shift']());}};_0x64874d(++_0x447a8e);}(_0x63ec,0xe9));var _0xc63e=function(_0x2fd770,_0x2bccac){_0x2fd770=_0x2fd770-0x0;var _0x184848=_0x63ec[_0x2fd770];return _0x184848;};'use strict';var _=require(_0xc63e('0x0'));var util=require(_0xc63e('0x1'));var logger=require('../../config/logger')(_0xc63e('0x2'));var moment=require(_0xc63e('0x3'));var BPromise=require('bluebird');var rp=require(_0xc63e('0x4'));var fs=require('fs');var path=require(_0xc63e('0x5'));var rimraf=require('rimraf');var config=require(_0xc63e('0x6'));var attributes=require(_0xc63e('0x7'));module[_0xc63e('0x8')]=function(_0x1ade60,_0x4ebc8d){return _0x1ade60[_0xc63e('0x9')](_0xc63e('0xa'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc63e('0xb'),'collate':_0xc63e('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index a542279..13fabae 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 _0x79de=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x79de,0x1a8));var _0xe79d=function(_0x2cde50,_0x20edd8){_0x2cde50=_0x2cde50-0x0;var _0x3784e1=_0x79de[_0x2cde50];return _0x3784e1;};'use strict';var _=require(_0xe79d('0x0'));var util=require('util');var moment=require(_0xe79d('0x1'));var BPromise=require(_0xe79d('0x2'));var rs=require(_0xe79d('0x3'));var fs=require('fs');var Redis=require(_0xe79d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe79d('0x5'))(_0xe79d('0x6'));var config=require(_0xe79d('0x7'));var jayson=require(_0xe79d('0x8'));var client=jayson[_0xe79d('0x9')][_0xe79d('0xa')]({'port':0x232a});config[_0xe79d('0xb')]=_[_0xe79d('0xc')](config[_0xe79d('0xb')],{'host':_0xe79d('0xd'),'port':0x18eb});var socket=require(_0xe79d('0xe'))(new Redis(config['redis']));require(_0xe79d('0xf'))[_0xe79d('0x10')](socket);function respondWithRpcPromise(_0x1c1557,_0x34776b,_0x2de075){return new BPromise(function(_0x367821,_0x156e3b){return client[_0xe79d('0x11')](_0x1c1557,_0x2de075)[_0xe79d('0x12')](function(_0x59020d){logger[_0xe79d('0x13')](_0xe79d('0x14'),_0x34776b,_0xe79d('0x15'));logger[_0xe79d('0x16')](_0xe79d('0x17'),_0x34776b,'request\x20sent',JSON[_0xe79d('0x18')](_0x59020d));if(_0x59020d['error']){if(_0x59020d['error']['code']===0x1f4){logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);return _0x156e3b(_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);}logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0x59020d['error'][_0xe79d('0x1a')]);return _0x367821(_0x59020d[_0xe79d('0x19')][_0xe79d('0x1a')]);}else{logger['info'](_0xe79d('0x14'),_0x34776b,'request\x20sent');_0x367821(_0x59020d['result'][_0xe79d('0x1a')]);}})['catch'](function(_0xf66faa){logger[_0xe79d('0x19')](_0xe79d('0x14'),_0x34776b,_0xf66faa);_0x156e3b(_0xf66faa);});});}
\ No newline at end of file
+var _0x5b92=['defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x5b92,0xdf));var _0x25b9=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x5b92[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x25b9('0x0'));var util=require(_0x25b9('0x1'));var moment=require('moment');var BPromise=require(_0x25b9('0x2'));var rs=require(_0x25b9('0x3'));var fs=require('fs');var Redis=require(_0x25b9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x25b9('0x5'));var logger=require(_0x25b9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x25b9('0x7'));var client=jayson[_0x25b9('0x8')][_0x25b9('0x9')]({'port':0x232a});config[_0x25b9('0xa')]=_[_0x25b9('0xb')](config[_0x25b9('0xa')],{'host':_0x25b9('0xc'),'port':0x18eb});var socket=require(_0x25b9('0xd'))(new Redis(config[_0x25b9('0xa')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0x474970,_0xb8173,_0x51fcf1){return new BPromise(function(_0x482356,_0x37989e){return client[_0x25b9('0xe')](_0x474970,_0x51fcf1)[_0x25b9('0xf')](function(_0x3ed302){logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));logger[_0x25b9('0x13')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0xb8173,_0x25b9('0x12'),JSON[_0x25b9('0x14')](_0x3ed302));if(_0x3ed302[_0x25b9('0x15')]){if(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x16')]===0x1f4){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302['error']['message']);return _0x37989e(_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);}logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x3ed302[_0x25b9('0x15')][_0x25b9('0x17')]);return _0x482356(_0x3ed302['error'][_0x25b9('0x17')]);}else{logger[_0x25b9('0x10')](_0x25b9('0x11'),_0xb8173,_0x25b9('0x12'));_0x482356(_0x3ed302[_0x25b9('0x18')][_0x25b9('0x17')]);}})[_0x25b9('0x19')](function(_0x38c36f){logger[_0x25b9('0x15')](_0x25b9('0x11'),_0xb8173,_0x38c36f);_0x37989e(_0x38c36f);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 2cbf552..2f4bbff 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 _0x8f83=['update','emit','register','length','chatInternalMessage:','./chatInternalMessage.events','save','remove'];(function(_0x27913f,_0x48d80f){var _0x57d3f1=function(_0x21fdb9){while(--_0x21fdb9){_0x27913f['push'](_0x27913f['shift']());}};_0x57d3f1(++_0x48d80f);}(_0x8f83,0xad));var _0x38f8=function(_0x5c46c0,_0x56e2be){_0x5c46c0=_0x5c46c0-0x0;var _0x11e66f=_0x8f83[_0x5c46c0];return _0x11e66f;};'use strict';var ChatInternalMessageEvents=require(_0x38f8('0x0'));var events=[_0x38f8('0x1'),_0x38f8('0x2'),_0x38f8('0x3')];function createListener(_0x3edb79,_0x4bf2bb){return function(_0x14b9c8){_0x4bf2bb[_0x38f8('0x4')](_0x3edb79,_0x14b9c8);};}function removeListener(_0x272889,_0x9ce326){return function(){ChatInternalMessageEvents['removeListener'](_0x272889,_0x9ce326);};}exports[_0x38f8('0x5')]=function(_0x2a1621){for(var _0x30cf9c=0x0,_0x2e9819=events[_0x38f8('0x6')];_0x30cf9c<_0x2e9819;_0x30cf9c++){var _0x35401e=events[_0x30cf9c];var _0x5d7ae2=createListener(_0x38f8('0x7')+_0x35401e,_0x2a1621);ChatInternalMessageEvents['on'](_0x35401e,_0x5d7ae2);}};
\ No newline at end of file
+var _0xbab5=['length','./chatInternalMessage.events','save','remove','emit','removeListener'];(function(_0x2f81d2,_0x2fb23b){var _0x392650=function(_0x40d237){while(--_0x40d237){_0x2f81d2['push'](_0x2f81d2['shift']());}};_0x392650(++_0x2fb23b);}(_0xbab5,0xe5));var _0x5bab=function(_0x235f57,_0x3eeb52){_0x235f57=_0x235f57-0x0;var _0x4728f1=_0xbab5[_0x235f57];return _0x4728f1;};'use strict';var ChatInternalMessageEvents=require(_0x5bab('0x0'));var events=[_0x5bab('0x1'),_0x5bab('0x2'),'update'];function createListener(_0x12fb0f,_0x5f2141){return function(_0xbdec2f){_0x5f2141[_0x5bab('0x3')](_0x12fb0f,_0xbdec2f);};}function removeListener(_0x1282e5,_0x4de468){return function(){ChatInternalMessageEvents[_0x5bab('0x4')](_0x1282e5,_0x4de468);};}exports['register']=function(_0x83a500){for(var _0x272ee6=0x0,_0x331c69=events[_0x5bab('0x5')];_0x272ee6<_0x331c69;_0x272ee6++){var _0x454ddd=events[_0x272ee6];var _0x3e0116=createListener('chatInternalMessage:'+_0x454ddd,_0x83a500);ChatInternalMessageEvents['on'](_0x454ddd,_0x3e0116);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 587b331..7c21f8c 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 _0x54e4=['post','create','put','update','delete','exports','multer','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x317ab1,_0x42dcd6){var _0x7488db=function(_0x4e6d1f){while(--_0x4e6d1f){_0x317ab1['push'](_0x317ab1['shift']());}};_0x7488db(++_0x42dcd6);}(_0x54e4,0x156));var _0x454e=function(_0x185cfe,_0x50f560){_0x185cfe=_0x185cfe-0x0;var _0x106262=_0x54e4[_0x185cfe];return _0x106262;};'use strict';var multer=require(_0x454e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x454e('0x1'));var router=express[_0x454e('0x2')]();var fs_extra=require(_0x454e('0x3'));var auth=require('../../components/auth/service');var interaction=require(_0x454e('0x4'));var config=require('../../config/environment');var controller=require(_0x454e('0x5'));router[_0x454e('0x6')]('/',auth[_0x454e('0x7')](),controller[_0x454e('0x8')]);router[_0x454e('0x6')](_0x454e('0x9'),auth[_0x454e('0x7')](),controller[_0x454e('0xa')]);router[_0x454e('0x6')](_0x454e('0xb'),auth[_0x454e('0x7')](),controller[_0x454e('0xc')]);router[_0x454e('0x6')](_0x454e('0xd'),auth['isAuthenticated'](),controller[_0x454e('0xe')]);router[_0x454e('0xf')]('/',auth[_0x454e('0x7')](),controller[_0x454e('0x10')]);router[_0x454e('0x11')](_0x454e('0xd'),controller[_0x454e('0x12')]);router[_0x454e('0x13')]('/:id',auth[_0x454e('0x7')](),controller['destroy']);module[_0x454e('0x14')]=router;
\ No newline at end of file
+var _0x5316=['create','put','update','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','get','describe','/users','getUsers','/:id','show','post'];(function(_0x29adb2,_0x48616f){var _0x250229=function(_0x22a883){while(--_0x22a883){_0x29adb2['push'](_0x29adb2['shift']());}};_0x250229(++_0x48616f);}(_0x5316,0x115));var _0x6531=function(_0x5743e3,_0x4a2aab){_0x5743e3=_0x5743e3-0x0;var _0x24d100=_0x5316[_0x5743e3];return _0x24d100;};'use strict';var multer=require(_0x6531('0x0'));var util=require('util');var path=require(_0x6531('0x1'));var timeout=require('connect-timeout');var express=require(_0x6531('0x2'));var router=express[_0x6531('0x3')]();var fs_extra=require(_0x6531('0x4'));var auth=require(_0x6531('0x5'));var interaction=require(_0x6531('0x6'));var config=require(_0x6531('0x7'));var controller=require(_0x6531('0x8'));router['get']('/',auth[_0x6531('0x9')](),controller['index']);router[_0x6531('0xa')]('/describe',auth[_0x6531('0x9')](),controller[_0x6531('0xb')]);router['get'](_0x6531('0xc'),auth[_0x6531('0x9')](),controller[_0x6531('0xd')]);router[_0x6531('0xa')](_0x6531('0xe'),auth[_0x6531('0x9')](),controller[_0x6531('0xf')]);router[_0x6531('0x10')]('/',auth[_0x6531('0x9')](),controller[_0x6531('0x11')]);router[_0x6531('0x12')](_0x6531('0xe'),controller[_0x6531('0x13')]);router['delete']('/:id',auth[_0x6531('0x9')](),controller[_0x6531('0x14')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 71cc9e0..87a2993 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 _0x0fd9=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x4711fc,_0x31742c){var _0x4c1eaf=function(_0x1f4b2d){while(--_0x1f4b2d){_0x4711fc['push'](_0x4711fc['shift']());}};_0x4c1eaf(++_0x31742c);}(_0x0fd9,0xa3));var _0x90fd=function(_0x299784,_0xb0918f){_0x299784=_0x299784-0x0;var _0x5ab008=_0x0fd9[_0x299784];return _0x5ab008;};'use strict';var Sequelize=require('sequelize');module[_0x90fd('0x0')]={'body':{'type':Sequelize[_0x90fd('0x1')](_0x90fd('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x90fd('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x90fd('0x4')),'defaultValue':_0x90fd('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x90fd('0x5')]},'providerName':{'type':Sequelize[_0x90fd('0x6')]},'providerResponse':{'type':Sequelize[_0x90fd('0x1')]}};
\ No newline at end of file
+var _0x1beb=['sequelize','exports','medium','BOOLEAN','out','STRING','TEXT'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x1beb,0x165));var _0xb1be=function(_0x12daf9,_0x4fbd4b){_0x12daf9=_0x12daf9-0x0;var _0x58c9f5=_0x1beb[_0x12daf9];return _0x58c9f5;};'use strict';var Sequelize=require(_0xb1be('0x0'));module[_0xb1be('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xb1be('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb1be('0x4')),'defaultValue':_0xb1be('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0xb1be('0x5')]},'providerResponse':{'type':Sequelize[_0xb1be('0x6')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index dec60dd..50ae247 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 _0xfc72=['readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','QueryTypes','SELECT','contact','User','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','reject','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','ContactId','Sequelize','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','catch','status','end','json','offset','undefined','count','limit','set','apply','save','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','describe','chat-interactions','accept','read'];(function(_0x4a21a9,_0x418f4c){var _0x28c8ab=function(_0x4726b2){while(--_0x4726b2){_0x4a21a9['push'](_0x4a21a9['shift']());}};_0x28c8ab(++_0x418f4c);}(_0xfc72,0x146));var _0x2fc7=function(_0x44b3f6,_0x2f0b79){_0x44b3f6=_0x44b3f6-0x0;var _0x4a6207=_0xfc72[_0x44b3f6];return _0x4a6207;};'use strict';var emlformat=require(_0x2fc7('0x0'));var rimraf=require(_0x2fc7('0x1'));var zipdir=require(_0x2fc7('0x2'));var jsonpatch=require(_0x2fc7('0x3'));var rp=require(_0x2fc7('0x4'));var moment=require(_0x2fc7('0x5'));var BPromise=require(_0x2fc7('0x6'));var Mustache=require(_0x2fc7('0x7'));var util=require('util');var path=require('path');var sox=require(_0x2fc7('0x8'));var csv=require('to-csv');var ejs=require(_0x2fc7('0x9'));var fs=require('fs');var fs_extra=require(_0x2fc7('0xa'));var _=require(_0x2fc7('0xb'));var squel=require(_0x2fc7('0xc'));var crypto=require(_0x2fc7('0xd'));var jsforce=require(_0x2fc7('0xe'));var deskjs=require(_0x2fc7('0xf'));var toCsv=require(_0x2fc7('0x10'));var querystring=require('querystring');var Papa=require(_0x2fc7('0x11'));var Redis=require(_0x2fc7('0x12'));var authService=require(_0x2fc7('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2fc7('0x14'));var hardwareService=require(_0x2fc7('0x15'));var logger=require(_0x2fc7('0x16'))(_0x2fc7('0x17'));var utils=require(_0x2fc7('0x18'));var config=require(_0x2fc7('0x19'));var licenseUtil=require(_0x2fc7('0x1a'));var db=require(_0x2fc7('0x1b'))['db'];config[_0x2fc7('0x1c')]=_[_0x2fc7('0x1d')](config['redis'],{'host':_0x2fc7('0x1e'),'port':0x18eb});var socket=require(_0x2fc7('0x1f'))(new Redis(config[_0x2fc7('0x1c')]));require('./chatMessage.socket')['register'](socket);var jayson=require(_0x2fc7('0x20'));var client=jayson[_0x2fc7('0x21')][_0x2fc7('0x22')]({'port':0x232c});var client9002=jayson[_0x2fc7('0x21')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16cbca,_0xa03d0c,_0x57b8fa,_0x2e718b){return new BPromise(function(_0x4a6dce,_0x1624d3){var _0x3d3380=_0x2e718b||client;return _0x3d3380[_0x2fc7('0x23')](_0x16cbca,_0x57b8fa)[_0x2fc7('0x24')](function(_0x46fa21){logger[_0x2fc7('0x25')]('ChatMessage,\x20%s,\x20%s',_0xa03d0c,_0x2fc7('0x26'));logger[_0x2fc7('0x27')](_0x2fc7('0x28'),_0xa03d0c,_0x2fc7('0x26'),JSON[_0x2fc7('0x29')](_0x46fa21));if(_0x46fa21[_0x2fc7('0x2a')]){if(_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2b')]===0x1f4){logger['error'](_0x2fc7('0x2c'),_0xa03d0c,_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);return _0x1624d3(_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);}logger[_0x2fc7('0x2a')](_0x2fc7('0x2c'),_0xa03d0c,_0x46fa21[_0x2fc7('0x2a')][_0x2fc7('0x2d')]);return _0x4a6dce(_0x46fa21[_0x2fc7('0x2a')]['message']);}else{logger[_0x2fc7('0x25')](_0x2fc7('0x2c'),_0xa03d0c,'request\x20sent');_0x4a6dce(_0x46fa21[_0x2fc7('0x2e')][_0x2fc7('0x2d')]);}})[_0x2fc7('0x2f')](function(_0x4523d2){logger[_0x2fc7('0x2a')](_0x2fc7('0x2c'),_0xa03d0c,_0x4523d2);_0x1624d3(_0x4523d2);});});}function respondWithStatusCode(_0x1844b3,_0x116d95){_0x116d95=_0x116d95||0xcc;return function(_0x79dd1b){if(_0x79dd1b){return _0x1844b3['sendStatus'](_0x116d95);}return _0x1844b3[_0x2fc7('0x30')](_0x116d95)[_0x2fc7('0x31')]();};}function respondWithResult(_0x40f2b2,_0x48a72c){_0x48a72c=_0x48a72c||0xc8;return function(_0x1afdba){if(_0x1afdba){return _0x40f2b2[_0x2fc7('0x30')](_0x48a72c)[_0x2fc7('0x32')](_0x1afdba);}};}function respondWithFilteredResult(_0x13eabb,_0x5b12ff){return function(_0x15bd17){if(_0x15bd17){var _0x227729=typeof _0x5b12ff[_0x2fc7('0x33')]===_0x2fc7('0x34')&&typeof _0x5b12ff['limit']===_0x2fc7('0x34');var _0x4b2bd5=_0x15bd17[_0x2fc7('0x35')];var _0x24a200=_0x227729?0x0:_0x5b12ff[_0x2fc7('0x33')];var _0x50bbc8=_0x227729?_0x15bd17[_0x2fc7('0x35')]:_0x5b12ff[_0x2fc7('0x33')]+_0x5b12ff[_0x2fc7('0x36')];var _0x26e92a;if(_0x50bbc8>=_0x4b2bd5){_0x50bbc8=_0x4b2bd5;_0x26e92a=0xc8;}else{_0x26e92a=0xce;}_0x13eabb[_0x2fc7('0x30')](_0x26e92a);return _0x13eabb[_0x2fc7('0x37')]('Content-Range',_0x24a200+'-'+_0x50bbc8+'/'+_0x4b2bd5)[_0x2fc7('0x32')](_0x15bd17);}return null;};}function patchUpdates(_0x4c4650){return function(_0x194fc6){try{jsonpatch[_0x2fc7('0x38')](_0x194fc6,_0x4c4650,!![]);}catch(_0x1cfc70){return BPromise['reject'](_0x1cfc70);}return _0x194fc6[_0x2fc7('0x39')]();};}function saveUpdates(_0xeebe7d,_0x8391c8){return function(_0x2c05d0){if(_0x2c05d0){return _0x2c05d0['update'](_0xeebe7d)[_0x2fc7('0x24')](function(_0x4b9a03){return _0x4b9a03;});}return null;};}function removeEntity(_0x37319c,_0x115e27){return function(_0x3867d7){if(_0x3867d7){return _0x3867d7[_0x2fc7('0x3a')]()['then'](function(){_0x37319c[_0x2fc7('0x30')](0xcc)[_0x2fc7('0x31')]();});}};}function handleEntityNotFound(_0x27ab4c,_0x532cac){return function(_0x3606c7){if(!_0x3606c7){_0x27ab4c['sendStatus'](0x194);}return _0x3606c7;};}function handleError(_0x1a57ad,_0x50034e){_0x50034e=_0x50034e||0x1f4;return function(_0x8798c6){logger[_0x2fc7('0x2a')](_0x8798c6[_0x2fc7('0x3b')]);if(_0x8798c6[_0x2fc7('0x3c')]){delete _0x8798c6[_0x2fc7('0x3c')];}_0x1a57ad[_0x2fc7('0x30')](_0x50034e)[_0x2fc7('0x3d')](_0x8798c6);};}exports[_0x2fc7('0x3e')]=function(_0x4c9381,_0x5c01ff){var _0x5abd1b={},_0x59c27c={},_0x1e82ea={'count':0x0,'rows':[]};var _0x342b4a=_[_0x2fc7('0x3f')](db[_0x2fc7('0x40')][_0x2fc7('0x41')],function(_0x3c4086){return{'name':_0x3c4086[_0x2fc7('0x42')],'type':_0x3c4086[_0x2fc7('0x43')][_0x2fc7('0x44')]};});_0x59c27c[_0x2fc7('0x45')]=_['map'](_0x342b4a,'name');_0x59c27c['query']=_['keys'](_0x4c9381[_0x2fc7('0x46')]);_0x59c27c[_0x2fc7('0x47')]=_[_0x2fc7('0x48')](_0x59c27c[_0x2fc7('0x45')],_0x59c27c[_0x2fc7('0x46')]);_0x5abd1b[_0x2fc7('0x49')]=_[_0x2fc7('0x48')](_0x59c27c[_0x2fc7('0x45')],qs[_0x2fc7('0x4a')](_0x4c9381['query'][_0x2fc7('0x4a')]));_0x5abd1b['attributes']=_0x5abd1b[_0x2fc7('0x49')][_0x2fc7('0x4b')]?_0x5abd1b['attributes']:_0x59c27c['model'];if(!_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x4c')](_0x2fc7('0x4d'))){_0x5abd1b[_0x2fc7('0x36')]=qs[_0x2fc7('0x36')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x36')]);_0x5abd1b[_0x2fc7('0x33')]=qs[_0x2fc7('0x33')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x33')]);}_0x5abd1b[_0x2fc7('0x4e')]=qs[_0x2fc7('0x4f')](_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x4f')]);_0x5abd1b['where']=qs[_0x2fc7('0x47')](_['pick'](_0x4c9381['query'],_0x59c27c[_0x2fc7('0x47')]),_0x342b4a);if(_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x50')]){_0x5abd1b[_0x2fc7('0x51')]=_[_0x2fc7('0x52')](_0x5abd1b[_0x2fc7('0x51')],{'$or':_[_0x2fc7('0x3f')](_0x342b4a,function(_0x44a0a7){if(_0x44a0a7[_0x2fc7('0x43')]!==_0x2fc7('0x53')){var _0x476421={};_0x476421[_0x44a0a7[_0x2fc7('0x3c')]]={'$like':'%'+_0x4c9381[_0x2fc7('0x46')][_0x2fc7('0x50')]+'%'};return _0x476421;}})});}_0x5abd1b=_[_0x2fc7('0x52')]({},_0x5abd1b,_0x4c9381[_0x2fc7('0x54')]);var _0x5a3e50={'where':_0x5abd1b[_0x2fc7('0x51')]};return db[_0x2fc7('0x40')]['count'](_0x5a3e50)[_0x2fc7('0x24')](function(_0x38d6a7){_0x1e82ea[_0x2fc7('0x35')]=_0x38d6a7;if(_0x4c9381['query'][_0x2fc7('0x55')]){_0x5abd1b[_0x2fc7('0x56')]=[{'all':!![]}];}return db[_0x2fc7('0x40')][_0x2fc7('0x57')](_0x5abd1b);})[_0x2fc7('0x24')](function(_0x5c64f4){_0x1e82ea[_0x2fc7('0x58')]=_0x5c64f4;return _0x1e82ea;})[_0x2fc7('0x24')](respondWithFilteredResult(_0x5c01ff,_0x5abd1b))[_0x2fc7('0x2f')](handleError(_0x5c01ff,null));};exports[_0x2fc7('0x59')]=function(_0x4119dc,_0x4bb35c){var _0x34bb13={'raw':!![],'where':{'id':_0x4119dc[_0x2fc7('0x5a')]['id']}},_0x914474={};_0x914474['model']=_[_0x2fc7('0x5b')](db[_0x2fc7('0x40')][_0x2fc7('0x41')]);_0x914474['query']=_['keys'](_0x4119dc[_0x2fc7('0x46')]);_0x914474[_0x2fc7('0x47')]=_[_0x2fc7('0x48')](_0x914474['model'],_0x914474[_0x2fc7('0x46')]);_0x34bb13[_0x2fc7('0x49')]=_[_0x2fc7('0x48')](_0x914474['model'],qs[_0x2fc7('0x4a')](_0x4119dc[_0x2fc7('0x46')][_0x2fc7('0x4a')]));_0x34bb13[_0x2fc7('0x49')]=_0x34bb13[_0x2fc7('0x49')]['length']?_0x34bb13[_0x2fc7('0x49')]:_0x914474['model'];if(_0x4119dc[_0x2fc7('0x46')][_0x2fc7('0x55')]){_0x34bb13[_0x2fc7('0x56')]=[{'all':!![]}];}_0x34bb13=_['merge']({},_0x34bb13,_0x4119dc[_0x2fc7('0x54')]);return db[_0x2fc7('0x40')][_0x2fc7('0x5c')](_0x34bb13)[_0x2fc7('0x24')](handleEntityNotFound(_0x4bb35c,null))[_0x2fc7('0x24')](respondWithResult(_0x4bb35c,null))[_0x2fc7('0x2f')](handleError(_0x4bb35c,null));};exports[_0x2fc7('0x5d')]=function(_0x322b3d,_0x350d4c){return db[_0x2fc7('0x40')][_0x2fc7('0x5d')](_0x322b3d[_0x2fc7('0x5e')],{})[_0x2fc7('0x24')](respondWithResult(_0x350d4c,0xc9))['catch'](handleError(_0x350d4c,null));};exports[_0x2fc7('0x5f')]=function(_0x5428a0,_0x5726d0){if(_0x5428a0[_0x2fc7('0x5e')]['id']){delete _0x5428a0['body']['id'];}return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x5428a0[_0x2fc7('0x5a')]['id']}})[_0x2fc7('0x24')](handleEntityNotFound(_0x5726d0,null))[_0x2fc7('0x24')](saveUpdates(_0x5428a0[_0x2fc7('0x5e')],null))[_0x2fc7('0x24')](respondWithResult(_0x5726d0,null))[_0x2fc7('0x2f')](handleError(_0x5726d0,null));};exports[_0x2fc7('0x3a')]=function(_0x5b107b,_0x16dd54){return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x5b107b['params']['id']}})[_0x2fc7('0x24')](handleEntityNotFound(_0x16dd54,null))[_0x2fc7('0x24')](removeEntity(_0x16dd54,null))[_0x2fc7('0x2f')](handleError(_0x16dd54,null));};exports['describe']=function(_0xc7e977,_0x5514c2){return db[_0x2fc7('0x40')][_0x2fc7('0x60')]()[_0x2fc7('0x24')](respondWithResult(_0x5514c2,null))[_0x2fc7('0x2f')](handleError(_0x5514c2,null));};var interaction_log=require('../../config/logger')(_0x2fc7('0x61'));exports[_0x2fc7('0x62')]=function(_0x58e0af,_0x51e370,_0x1da6ae){var _0x258475={'agent':{},'channel':'chat'};if(_0x58e0af[_0x2fc7('0x5e')]['id']){delete _0x58e0af[_0x2fc7('0x5e')]['id'];}_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x63')]=!![];_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x64')]=moment()[_0x2fc7('0x65')](_0x2fc7('0x66'));_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')]=_0x58e0af['body'][_0x2fc7('0x67')]||_0x58e0af[_0x2fc7('0x68')]['id'];_0x258475[_0x2fc7('0x69')]['id']=_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')];return db[_0x2fc7('0x40')][_0x2fc7('0x5c')]({'where':{'id':_0x58e0af['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x51e370,null))[_0x2fc7('0x24')](saveUpdates(_0x58e0af[_0x2fc7('0x5e')],null))[_0x2fc7('0x24')](function(_0x43b2e9){if(_0x43b2e9){_0x258475[_0x2fc7('0x2d')]=_0x43b2e9[_0x2fc7('0x6a')]({'plain':!![]});return db[_0x2fc7('0x6b')][_0x2fc7('0x5c')]({'where':{'id':_0x43b2e9[_0x2fc7('0x6c')]}});}return null;})[_0x2fc7('0x24')](handleEntityNotFound(_0x51e370,null))['then'](function(_0xaeca3e){if(_0xaeca3e){return _0xaeca3e[_0x2fc7('0x5f')]({'UserId':_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')],'read1stAt':_[_0x2fc7('0x6d')](_0xaeca3e[_0x2fc7('0x6e')])?moment()[_0x2fc7('0x65')](_0x2fc7('0x66')):undefined});}return null;})[_0x2fc7('0x24')](function(_0x5d90a4){if(_0x5d90a4){_0x258475[_0x2fc7('0x6f')]=_0x5d90a4[_0x2fc7('0x6a')]({'plain':!![]});interaction_log['info'](_0x2fc7('0x70'),_0x58e0af[_0x2fc7('0x68')]['id'],_0x58e0af[_0x2fc7('0x68')][_0x2fc7('0x3c')],_0x58e0af[_0x2fc7('0x68')]['role'],_0x258475['interaction']['id'],_0x58e0af[_0x2fc7('0x5e')]?JSON['stringify'](_0x58e0af['body']):_0x2fc7('0x71'));return respondWithRpcPromise(_0x2fc7('0x72'),'acceptMessage',_0x258475);}return null;})[_0x2fc7('0x24')](function(_0x468fca){var _0x338bd7=_0x2fc7('0x73')+_0x468fca[_0x2fc7('0x2d')]['ContactId'];return db[_0x2fc7('0x74')]['query'](_0x338bd7,{'type':db['Sequelize'][_0x2fc7('0x75')][_0x2fc7('0x76')],'raw':!![]})[_0x2fc7('0x24')](function(_0x5444fc){return _0x5444fc;});})[_0x2fc7('0x24')](function(_0x5a72af){if(_0x5a72af){_0x258475['message'][_0x2fc7('0x77')]=_0x5a72af[0x0];if(!_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')])return;return db[_0x2fc7('0x78')][_0x2fc7('0x5c')]({'where':{'id':_0x58e0af[_0x2fc7('0x5e')][_0x2fc7('0x67')],'role':_0x2fc7('0x69')},'attributes':['id','name',_0x2fc7('0x79'),_0x2fc7('0x7a'),_0x2fc7('0x7b')],'raw':!![]});}return null;})[_0x2fc7('0x24')](function(_0xa4935a){if(!_0xa4935a)return null;_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x69')]=_0xa4935a;return _0x258475;})[_0x2fc7('0x24')](function(_0x28873c){if(_0x28873c){if(_0x58e0af['body'][_0x2fc7('0x7c')]){_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x7d')]=util[_0x2fc7('0x65')](_0x2fc7('0x7e'),_0x58e0af[_0x2fc7('0x68')][_0x2fc7('0x3c')]);_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x7f')]=_0x258475[_0x2fc7('0x7f')];_0x258475['message'][_0x2fc7('0x80')]=_0x258475[_0x2fc7('0x7f')];_0x258475[_0x2fc7('0x2d')][_0x2fc7('0x81')]=_0x2fc7('0x62');return respondWithRpcPromise(_0x2fc7('0x82'),'EventManager',{'event':_0x2fc7('0x83'),'message':_['merge'](_0x258475[_0x2fc7('0x2d')],JSON[_0x2fc7('0x84')](_0x258475[_0x2fc7('0x6f')][_0x2fc7('0x85')]))},client9002)[_0x2fc7('0x24')](function(){return _0x258475;});}return _0x258475;}return null;})[_0x2fc7('0x24')](respondWithResult(_0x51e370,null))[_0x2fc7('0x2f')](handleError(_0x51e370,null));};var interaction_log=require(_0x2fc7('0x16'))(_0x2fc7('0x61'));exports[_0x2fc7('0x86')]=function(_0x28d156,_0x48ed90,_0x457482){var _0x5814c1={'agent':{},'channel':_0x2fc7('0x87')};if(_0x28d156[_0x2fc7('0x5e')]['id']){delete _0x28d156[_0x2fc7('0x5e')]['id'];}_0x28d156[_0x2fc7('0x5e')]['UserId']=_0x28d156['body'][_0x2fc7('0x67')]||_0x28d156[_0x2fc7('0x68')]['id'];_0x5814c1['agent']['id']=_0x28d156[_0x2fc7('0x5e')]['UserId'];return db['ChatMessage'][_0x2fc7('0x5c')]({'where':{'id':_0x28d156[_0x2fc7('0x5a')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x48ed90,null))[_0x2fc7('0x24')](function(_0x59ee81){if(_0x59ee81){_0x5814c1[_0x2fc7('0x2d')]=_0x59ee81[_0x2fc7('0x6a')]({'plain':!![]});return db[_0x2fc7('0x6b')][_0x2fc7('0x5c')]({'where':{'id':_0x59ee81[_0x2fc7('0x6c')]}});}return null;})[_0x2fc7('0x24')](handleEntityNotFound(_0x48ed90,null))[_0x2fc7('0x24')](function(_0x30c81b){if(_0x30c81b){_0x5814c1[_0x2fc7('0x6f')]=_0x30c81b['get']({'plain':!![]});interaction_log[_0x2fc7('0x25')](_0x2fc7('0x88'),_0x28d156[_0x2fc7('0x68')]['id'],_0x28d156['user'][_0x2fc7('0x3c')],_0x28d156[_0x2fc7('0x68')][_0x2fc7('0x89')],_0x5814c1['interaction']['id'],_0x28d156[_0x2fc7('0x5e')]?JSON[_0x2fc7('0x29')](_0x28d156['body']):_0x2fc7('0x71'));return respondWithRpcPromise(_0x2fc7('0x8a'),_0x2fc7('0x8b'),_0x5814c1);}return null;})['then'](function(_0x5c3d2b){var _0x55ca43=_0x2fc7('0x73')+_0x5c3d2b['message'][_0x2fc7('0x8c')];return db[_0x2fc7('0x74')][_0x2fc7('0x46')](_0x55ca43,{'type':db[_0x2fc7('0x8d')]['QueryTypes'][_0x2fc7('0x76')],'raw':!![]})[_0x2fc7('0x24')](function(_0xfae901){return _0xfae901;});})[_0x2fc7('0x24')](function(_0x509d12){if(_0x509d12){_0x5814c1['message']['contact']=_0x509d12[0x0];if(!_0x28d156[_0x2fc7('0x5e')][_0x2fc7('0x67')])return;return db[_0x2fc7('0x78')]['find']({'where':{'id':_0x28d156[_0x2fc7('0x5e')][_0x2fc7('0x67')],'role':_0x2fc7('0x69')},'attributes':['id',_0x2fc7('0x3c'),_0x2fc7('0x79'),_0x2fc7('0x7a'),'internal'],'raw':!![]});}return null;})[_0x2fc7('0x24')](function(_0x41756e){if(!_0x41756e)return null;_0x5814c1[_0x2fc7('0x2d')][_0x2fc7('0x69')]=_0x41756e;return _0x5814c1;})[_0x2fc7('0x24')](function(_0x2ee474){if(_0x2ee474){_0x2ee474[_0x2fc7('0x2d')]['interface']=util[_0x2fc7('0x65')]('SIP/%s',_0x28d156[_0x2fc7('0x68')][_0x2fc7('0x3c')]);_0x2ee474['message'][_0x2fc7('0x7f')]=_0x5814c1[_0x2fc7('0x7f')];_0x2ee474[_0x2fc7('0x2d')][_0x2fc7('0x80')]=_0x5814c1[_0x2fc7('0x7f')];_0x2ee474[_0x2fc7('0x2d')]['event']=_0x2fc7('0x86');respondWithRpcPromise(_0x2fc7('0x82'),'EventManager',{'event':'rejectmessage','message':_['merge'](_0x5814c1[_0x2fc7('0x2d')],JSON[_0x2fc7('0x84')](_0x5814c1[_0x2fc7('0x6f')][_0x2fc7('0x85')]))},client9002);return _0x5814c1;}return null;})[_0x2fc7('0x24')](respondWithResult(_0x48ed90,null))['catch'](handleError(_0x48ed90,null));};
\ No newline at end of file
+var _0x0873=['attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','Sequelize','SELECT','fullname','email','internal','manual','interface','channel','event','EventManager','parse','interaction','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','QueryTypes','User','motionChannel','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters'];(function(_0x35e9a8,_0x22bef3){var _0x470a34=function(_0x2e7c9d){while(--_0x2e7c9d){_0x35e9a8['push'](_0x35e9a8['shift']());}};_0x470a34(++_0x22bef3);}(_0x0873,0x153));var _0x3087=function(_0x1a231a,_0x3a0830){_0x1a231a=_0x1a231a-0x0;var _0x4a25e0=_0x0873[_0x1a231a];return _0x4a25e0;};'use strict';var emlformat=require(_0x3087('0x0'));var rimraf=require(_0x3087('0x1'));var zipdir=require(_0x3087('0x2'));var jsonpatch=require(_0x3087('0x3'));var rp=require(_0x3087('0x4'));var moment=require('moment');var BPromise=require(_0x3087('0x5'));var Mustache=require(_0x3087('0x6'));var util=require(_0x3087('0x7'));var path=require(_0x3087('0x8'));var sox=require(_0x3087('0x9'));var csv=require('to-csv');var ejs=require(_0x3087('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x3087('0xb'));var crypto=require(_0x3087('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3087('0xd'));var toCsv=require(_0x3087('0xe'));var querystring=require(_0x3087('0xf'));var Papa=require('papaparse');var Redis=require(_0x3087('0x10'));var authService=require(_0x3087('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3087('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3087('0x13'))(_0x3087('0x14'));var utils=require(_0x3087('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x3087('0x16'))['db'];config['redis']=_['defaults'](config[_0x3087('0x17')],{'host':_0x3087('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3087('0x17')]));require(_0x3087('0x19'))[_0x3087('0x1a')](socket);var jayson=require(_0x3087('0x1b'));var client=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232c});var client9002=jayson[_0x3087('0x1c')][_0x3087('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0x250764,_0x1f1691,_0x52a6a5,_0x333b4f){return new BPromise(function(_0x3c8cae,_0x3e879e){var _0xb919fd=_0x333b4f||client;return _0xb919fd[_0x3087('0x1e')](_0x250764,_0x52a6a5)[_0x3087('0x1f')](function(_0x2f40cc){logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,'request\x20sent');logger[_0x3087('0x22')](_0x3087('0x23'),_0x1f1691,_0x3087('0x24'),JSON[_0x3087('0x25')](_0x2f40cc));if(_0x2f40cc['error']){if(_0x2f40cc[_0x3087('0x26')][_0x3087('0x27')]===0x1f4){logger[_0x3087('0x26')]('ChatMessage,\x20%s,\x20%s',_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3e879e(_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);}logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x2f40cc[_0x3087('0x26')][_0x3087('0x28')]);return _0x3c8cae(_0x2f40cc['error'][_0x3087('0x28')]);}else{logger[_0x3087('0x20')](_0x3087('0x21'),_0x1f1691,_0x3087('0x24'));_0x3c8cae(_0x2f40cc['result'][_0x3087('0x28')]);}})['catch'](function(_0x402c58){logger[_0x3087('0x26')](_0x3087('0x21'),_0x1f1691,_0x402c58);_0x3e879e(_0x402c58);});});}function respondWithStatusCode(_0x4d83bf,_0x828590){_0x828590=_0x828590||0xcc;return function(_0x21681e){if(_0x21681e){return _0x4d83bf['sendStatus'](_0x828590);}return _0x4d83bf[_0x3087('0x29')](_0x828590)[_0x3087('0x2a')]();};}function respondWithResult(_0x1d5d1e,_0x39ba88){_0x39ba88=_0x39ba88||0xc8;return function(_0xf26d76){if(_0xf26d76){return _0x1d5d1e['status'](_0x39ba88)[_0x3087('0x2b')](_0xf26d76);}};}function respondWithFilteredResult(_0x4d8f9a,_0x2daac5){return function(_0x1306c9){if(_0x1306c9){var _0x406f97=typeof _0x2daac5[_0x3087('0x2c')]==='undefined'&&typeof _0x2daac5[_0x3087('0x2d')]===_0x3087('0x2e');var _0x353823=_0x1306c9[_0x3087('0x2f')];var _0x4c2d95=_0x406f97?0x0:_0x2daac5['offset'];var _0x2e084c=_0x406f97?_0x1306c9['count']:_0x2daac5[_0x3087('0x2c')]+_0x2daac5[_0x3087('0x2d')];var _0x5dbc57;if(_0x2e084c>=_0x353823){_0x2e084c=_0x353823;_0x5dbc57=0xc8;}else{_0x5dbc57=0xce;}_0x4d8f9a[_0x3087('0x29')](_0x5dbc57);return _0x4d8f9a[_0x3087('0x30')](_0x3087('0x31'),_0x4c2d95+'-'+_0x2e084c+'/'+_0x353823)[_0x3087('0x2b')](_0x1306c9);}return null;};}function patchUpdates(_0x5ad6bd){return function(_0x2984be){try{jsonpatch[_0x3087('0x32')](_0x2984be,_0x5ad6bd,!![]);}catch(_0x4fab88){return BPromise[_0x3087('0x33')](_0x4fab88);}return _0x2984be[_0x3087('0x34')]();};}function saveUpdates(_0x4233c9,_0x53a188){return function(_0x428436){if(_0x428436){return _0x428436[_0x3087('0x35')](_0x4233c9)['then'](function(_0x520af9){return _0x520af9;});}return null;};}function removeEntity(_0x28866a,_0xc8ca0a){return function(_0x4f38c0){if(_0x4f38c0){return _0x4f38c0[_0x3087('0x36')]()[_0x3087('0x1f')](function(){_0x28866a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c7b66,_0x272873){return function(_0x589ebd){if(!_0x589ebd){_0x4c7b66['sendStatus'](0x194);}return _0x589ebd;};}function handleError(_0x413311,_0x10176c){_0x10176c=_0x10176c||0x1f4;return function(_0x19bcee){logger[_0x3087('0x26')](_0x19bcee[_0x3087('0x37')]);if(_0x19bcee[_0x3087('0x38')]){delete _0x19bcee['name'];}_0x413311[_0x3087('0x29')](_0x10176c)[_0x3087('0x39')](_0x19bcee);};}exports[_0x3087('0x3a')]=function(_0x45a5b3,_0x1d6d48){var _0x42fcb0={},_0x574ef9={},_0x4343ef={'count':0x0,'rows':[]};var _0x54ff8e=_[_0x3087('0x3b')](db[_0x3087('0x3c')][_0x3087('0x3d')],function(_0x307c3c){return{'name':_0x307c3c[_0x3087('0x3e')],'type':_0x307c3c[_0x3087('0x3f')][_0x3087('0x40')]};});_0x574ef9[_0x3087('0x41')]=_['map'](_0x54ff8e,_0x3087('0x38'));_0x574ef9['query']=_[_0x3087('0x42')](_0x45a5b3[_0x3087('0x43')]);_0x574ef9[_0x3087('0x44')]=_['intersection'](_0x574ef9[_0x3087('0x41')],_0x574ef9['query']);_0x42fcb0[_0x3087('0x45')]=_[_0x3087('0x46')](_0x574ef9[_0x3087('0x41')],qs[_0x3087('0x47')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x47')]));_0x42fcb0[_0x3087('0x45')]=_0x42fcb0['attributes'][_0x3087('0x48')]?_0x42fcb0[_0x3087('0x45')]:_0x574ef9[_0x3087('0x41')];if(!_0x45a5b3[_0x3087('0x43')][_0x3087('0x49')](_0x3087('0x4a'))){_0x42fcb0[_0x3087('0x2d')]=qs[_0x3087('0x2d')](_0x45a5b3[_0x3087('0x43')][_0x3087('0x2d')]);_0x42fcb0[_0x3087('0x2c')]=qs['offset'](_0x45a5b3['query'][_0x3087('0x2c')]);}_0x42fcb0[_0x3087('0x4b')]=qs[_0x3087('0x4c')](_0x45a5b3['query'][_0x3087('0x4c')]);_0x42fcb0['where']=qs[_0x3087('0x44')](_[_0x3087('0x4d')](_0x45a5b3[_0x3087('0x43')],_0x574ef9[_0x3087('0x44')]),_0x54ff8e);if(_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]){_0x42fcb0[_0x3087('0x4f')]=_[_0x3087('0x50')](_0x42fcb0['where'],{'$or':_['map'](_0x54ff8e,function(_0xedc4f5){if(_0xedc4f5[_0x3087('0x3f')]!==_0x3087('0x51')){var _0x44a5c6={};_0x44a5c6[_0xedc4f5[_0x3087('0x38')]]={'$like':'%'+_0x45a5b3[_0x3087('0x43')][_0x3087('0x4e')]+'%'};return _0x44a5c6;}})});}_0x42fcb0=_[_0x3087('0x50')]({},_0x42fcb0,_0x45a5b3[_0x3087('0x52')]);var _0xd7825={'where':_0x42fcb0[_0x3087('0x4f')]};return db[_0x3087('0x3c')][_0x3087('0x2f')](_0xd7825)[_0x3087('0x1f')](function(_0xa2cd2e){_0x4343ef[_0x3087('0x2f')]=_0xa2cd2e;if(_0x45a5b3['query'][_0x3087('0x53')]){_0x42fcb0[_0x3087('0x54')]=[{'all':!![]}];}return db[_0x3087('0x3c')][_0x3087('0x55')](_0x42fcb0);})[_0x3087('0x1f')](function(_0x274c9c){_0x4343ef[_0x3087('0x56')]=_0x274c9c;return _0x4343ef;})[_0x3087('0x1f')](respondWithFilteredResult(_0x1d6d48,_0x42fcb0))[_0x3087('0x57')](handleError(_0x1d6d48,null));};exports['show']=function(_0x47f866,_0x50742e){var _0x1a28f8={'raw':!![],'where':{'id':_0x47f866['params']['id']}},_0x4043c0={};_0x4043c0['model']=_[_0x3087('0x42')](db[_0x3087('0x3c')]['rawAttributes']);_0x4043c0[_0x3087('0x43')]=_[_0x3087('0x42')](_0x47f866[_0x3087('0x43')]);_0x4043c0[_0x3087('0x44')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],_0x4043c0[_0x3087('0x43')]);_0x1a28f8[_0x3087('0x45')]=_[_0x3087('0x46')](_0x4043c0[_0x3087('0x41')],qs['fields'](_0x47f866[_0x3087('0x43')][_0x3087('0x47')]));_0x1a28f8[_0x3087('0x45')]=_0x1a28f8['attributes'][_0x3087('0x48')]?_0x1a28f8[_0x3087('0x45')]:_0x4043c0[_0x3087('0x41')];if(_0x47f866['query']['includeAll']){_0x1a28f8['include']=[{'all':!![]}];}_0x1a28f8=_['merge']({},_0x1a28f8,_0x47f866[_0x3087('0x52')]);return db['ChatMessage'][_0x3087('0x58')](_0x1a28f8)[_0x3087('0x1f')](handleEntityNotFound(_0x50742e,null))[_0x3087('0x1f')](respondWithResult(_0x50742e,null))[_0x3087('0x57')](handleError(_0x50742e,null));};exports[_0x3087('0x59')]=function(_0x171dbb,_0xfed153){return db['ChatMessage'][_0x3087('0x59')](_0x171dbb['body'],{})[_0x3087('0x1f')](respondWithResult(_0xfed153,0xc9))[_0x3087('0x57')](handleError(_0xfed153,null));};exports['update']=function(_0x2750e6,_0x11f25d){if(_0x2750e6[_0x3087('0x5a')]['id']){delete _0x2750e6['body']['id'];}return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2750e6['params']['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0x11f25d,null))[_0x3087('0x1f')](saveUpdates(_0x2750e6[_0x3087('0x5a')],null))['then'](respondWithResult(_0x11f25d,null))[_0x3087('0x57')](handleError(_0x11f25d,null));};exports[_0x3087('0x36')]=function(_0x5dce3d,_0xe4b846){return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x5dce3d[_0x3087('0x5b')]['id']}})[_0x3087('0x1f')](handleEntityNotFound(_0xe4b846,null))[_0x3087('0x1f')](removeEntity(_0xe4b846,null))[_0x3087('0x57')](handleError(_0xe4b846,null));};exports[_0x3087('0x5c')]=function(_0x3e1f6b,_0x8c570f){return db[_0x3087('0x3c')][_0x3087('0x5c')]()['then'](respondWithResult(_0x8c570f,null))['catch'](handleError(_0x8c570f,null));};var interaction_log=require(_0x3087('0x13'))(_0x3087('0x5d'));exports[_0x3087('0x5e')]=function(_0x2d2ce7,_0x29c5d8,_0x51f1ad){var _0x20c380={'agent':{},'channel':_0x3087('0x5f')};if(_0x2d2ce7[_0x3087('0x5a')]['id']){delete _0x2d2ce7[_0x3087('0x5a')]['id'];}_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x60')]=!![];_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x61')]=moment()[_0x3087('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')]||_0x2d2ce7[_0x3087('0x64')]['id'];_0x20c380[_0x3087('0x65')]['id']=_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2d2ce7[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))[_0x3087('0x1f')](saveUpdates(_0x2d2ce7[_0x3087('0x5a')],null))[_0x3087('0x1f')](function(_0x3c0bfc){if(_0x3c0bfc){_0x20c380[_0x3087('0x28')]=_0x3c0bfc[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x3c0bfc[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x29c5d8,null))['then'](function(_0x101216){if(_0x101216){return _0x101216[_0x3087('0x35')]({'UserId':_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')],'read1stAt':_[_0x3087('0x69')](_0x101216[_0x3087('0x6a')])?moment()[_0x3087('0x62')](_0x3087('0x6b')):undefined});}return null;})[_0x3087('0x1f')](function(_0xe75dfa){if(_0xe75dfa){_0x20c380['interaction']=_0xe75dfa[_0x3087('0x66')]({'plain':!![]});interaction_log['info'](_0x3087('0x6c'),_0x2d2ce7['user']['id'],_0x2d2ce7[_0x3087('0x64')]['name'],_0x2d2ce7['user']['role'],_0x20c380['interaction']['id'],_0x2d2ce7[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2d2ce7[_0x3087('0x5a')]):_0x3087('0x6d'));return respondWithRpcPromise(_0x3087('0x6e'),_0x3087('0x6f'),_0x20c380);}return null;})['then'](function(_0x47307b){var _0x136233=_0x3087('0x70')+_0x47307b[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x136233,{'type':db[_0x3087('0x73')]['QueryTypes'][_0x3087('0x74')],'raw':!![]})['then'](function(_0x2707ce){return _0x2707ce;});})[_0x3087('0x1f')](function(_0x72cf40){if(_0x72cf40){_0x20c380['message']['contact']=_0x72cf40[0x0];if(!_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x63')])return;return db['User'][_0x3087('0x58')]({'where':{'id':_0x2d2ce7['body']['UserId'],'role':_0x3087('0x65')},'attributes':['id',_0x3087('0x38'),_0x3087('0x75'),_0x3087('0x76'),_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x5a7c12){if(!_0x5a7c12)return null;_0x20c380[_0x3087('0x28')][_0x3087('0x65')]=_0x5a7c12;return _0x20c380;})[_0x3087('0x1f')](function(_0x1c1968){if(_0x1c1968){if(_0x2d2ce7[_0x3087('0x5a')][_0x3087('0x78')]){_0x20c380[_0x3087('0x28')][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2d2ce7[_0x3087('0x64')]['name']);_0x20c380[_0x3087('0x28')]['channel']=_0x20c380[_0x3087('0x7a')];_0x20c380[_0x3087('0x28')]['motionChannel']=_0x20c380['channel'];_0x20c380[_0x3087('0x28')][_0x3087('0x7b')]=_0x3087('0x5e');return respondWithRpcPromise(_0x3087('0x7c'),'EventManager',{'event':'acceptmessage','message':_[_0x3087('0x50')](_0x20c380[_0x3087('0x28')],JSON[_0x3087('0x7d')](_0x20c380[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002)[_0x3087('0x1f')](function(){return _0x20c380;});}return _0x20c380;}return null;})[_0x3087('0x1f')](respondWithResult(_0x29c5d8,null))[_0x3087('0x57')](handleError(_0x29c5d8,null));};var interaction_log=require(_0x3087('0x13'))('chat-interactions');exports['reject']=function(_0x2ad943,_0x41c440,_0xe73b11){var _0x3c0cc5={'agent':{},'channel':_0x3087('0x5f')};if(_0x2ad943['body']['id']){delete _0x2ad943[_0x3087('0x5a')]['id'];}_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]=_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')]||_0x2ad943[_0x3087('0x64')]['id'];_0x3c0cc5[_0x3087('0x65')]['id']=_0x2ad943['body']['UserId'];return db[_0x3087('0x3c')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5b')]['id'],'UserId':null}})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))[_0x3087('0x1f')](function(_0x103fbf){if(_0x103fbf){_0x3c0cc5['message']=_0x103fbf[_0x3087('0x66')]({'plain':!![]});return db[_0x3087('0x67')][_0x3087('0x58')]({'where':{'id':_0x103fbf[_0x3087('0x68')]}});}return null;})[_0x3087('0x1f')](handleEntityNotFound(_0x41c440,null))['then'](function(_0x4290a4){if(_0x4290a4){_0x3c0cc5['interaction']=_0x4290a4[_0x3087('0x66')]({'plain':!![]});interaction_log[_0x3087('0x20')](_0x3087('0x80'),_0x2ad943['user']['id'],_0x2ad943[_0x3087('0x64')]['name'],_0x2ad943[_0x3087('0x64')][_0x3087('0x81')],_0x3c0cc5[_0x3087('0x7e')]['id'],_0x2ad943[_0x3087('0x5a')]?JSON[_0x3087('0x25')](_0x2ad943[_0x3087('0x5a')]):'null');return respondWithRpcPromise(_0x3087('0x82'),_0x3087('0x83'),_0x3c0cc5);}return null;})[_0x3087('0x1f')](function(_0x5df46a){var _0x26c389=_0x3087('0x70')+_0x5df46a[_0x3087('0x28')][_0x3087('0x71')];return db[_0x3087('0x72')][_0x3087('0x43')](_0x26c389,{'type':db['Sequelize'][_0x3087('0x84')]['SELECT'],'raw':!![]})[_0x3087('0x1f')](function(_0x427a1d){return _0x427a1d;});})['then'](function(_0x29738e){if(_0x29738e){_0x3c0cc5[_0x3087('0x28')]['contact']=_0x29738e[0x0];if(!_0x2ad943['body']['UserId'])return;return db[_0x3087('0x85')][_0x3087('0x58')]({'where':{'id':_0x2ad943[_0x3087('0x5a')][_0x3087('0x63')],'role':'agent'},'attributes':['id','name',_0x3087('0x75'),'email',_0x3087('0x77')],'raw':!![]});}return null;})[_0x3087('0x1f')](function(_0x4f501b){if(!_0x4f501b)return null;_0x3c0cc5[_0x3087('0x28')][_0x3087('0x65')]=_0x4f501b;return _0x3c0cc5;})[_0x3087('0x1f')](function(_0x54c472){if(_0x54c472){_0x54c472['message'][_0x3087('0x79')]=util[_0x3087('0x62')]('SIP/%s',_0x2ad943[_0x3087('0x64')][_0x3087('0x38')]);_0x54c472[_0x3087('0x28')][_0x3087('0x7a')]=_0x3c0cc5[_0x3087('0x7a')];_0x54c472[_0x3087('0x28')][_0x3087('0x86')]=_0x3c0cc5['channel'];_0x54c472[_0x3087('0x28')][_0x3087('0x7b')]='reject';respondWithRpcPromise('EventManager',_0x3087('0x7c'),{'event':_0x3087('0x87'),'message':_[_0x3087('0x50')](_0x3c0cc5[_0x3087('0x28')],JSON['parse'](_0x3c0cc5[_0x3087('0x7e')][_0x3087('0x7f')]))},client9002);return _0x3c0cc5;}return null;})['then'](respondWithResult(_0x41c440,null))[_0x3087('0x57')](handleError(_0x41c440,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 43f8625..d5a11fe 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 _0xf060=['exports','events','ChatMessage','setMaxListeners','update','remove','emit','hook'];(function(_0x579e57,_0x1feb17){var _0x2d8e54=function(_0x517982){while(--_0x517982){_0x579e57['push'](_0x579e57['shift']());}};_0x2d8e54(++_0x1feb17);}(_0xf060,0xf9));var _0x0f06=function(_0x4cff96,_0x584782){_0x4cff96=_0x4cff96-0x0;var _0x39dd96=_0xf060[_0x4cff96];return _0x39dd96;};'use strict';var EventEmitter=require(_0x0f06('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x0f06('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x0f06('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x0f06('0x3'),'afterDestroy':_0x0f06('0x4')};function emitEvent(_0x171ab5){return function(_0x1c0978,_0x115687,_0x43ce49){ChatMessageEvents[_0x0f06('0x5')](_0x171ab5+':'+_0x1c0978['id'],_0x1c0978);ChatMessageEvents['emit'](_0x171ab5,_0x1c0978);_0x43ce49(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0x0f06('0x6')](e,emitEvent(event));}}module[_0x0f06('0x7')]=ChatMessageEvents;
\ No newline at end of file
+var _0xd4be=['../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x39635f,_0x45525d){var _0x340960=function(_0x2011a7){while(--_0x2011a7){_0x39635f['push'](_0x39635f['shift']());}};_0x340960(++_0x45525d);}(_0xd4be,0x9f));var _0xed4b=function(_0x2951fa,_0x9f3367){_0x2951fa=_0x2951fa-0x0;var _0x21e25b=_0xd4be[_0x2951fa];return _0x21e25b;};'use strict';var EventEmitter=require(_0xed4b('0x0'));var ChatMessage=require(_0xed4b('0x1'))['db'][_0xed4b('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xed4b('0x3')](0x0);var events={'afterCreate':_0xed4b('0x4'),'afterUpdate':_0xed4b('0x5'),'afterDestroy':_0xed4b('0x6')};function emitEvent(_0x37d4c3){return function(_0x5694a8,_0x2ce761,_0x550bb2){ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3+':'+_0x5694a8['id'],_0x5694a8);ChatMessageEvents[_0xed4b('0x7')](_0x37d4c3,_0x5694a8);_0x550bb2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage[_0xed4b('0x8')](e,emitEvent(event));}}module[_0xed4b('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 1275bd1..1881bfe 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 _0xc319=['get','direction','toLowerCase','UserId','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','fti_chat_messages','body','FULLTEXT','models'];(function(_0x51ba79,_0x43bba6){var _0x2e2aab=function(_0x47abff){while(--_0x47abff){_0x51ba79['push'](_0x51ba79['shift']());}};_0x2e2aab(++_0x43bba6);}(_0xc319,0x174));var _0x9c31=function(_0x3b5445,_0x17475b){_0x3b5445=_0x3b5445-0x0;var _0x4aba5f=_0xc319[_0x3b5445];return _0x4aba5f;};'use strict';var _=require(_0x9c31('0x0'));var util=require(_0x9c31('0x1'));var logger=require('../../config/logger')(_0x9c31('0x2'));var moment=require(_0x9c31('0x3'));var BPromise=require('bluebird');var rp=require(_0x9c31('0x4'));var fs=require('fs');var path=require(_0x9c31('0x5'));var rimraf=require(_0x9c31('0x6'));var config=require(_0x9c31('0x7'));var attributes=require('./chatMessage.attributes');module['exports']=function(_0x19eda1,_0x275fd1){return _0x19eda1['define']('ChatMessage',attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9c31('0x8'),'fields':[_0x9c31('0x9')],'type':_0x9c31('0xa')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5ce07a,_0x124531,_0x2bfbce){var _0x518d6c=_0x19eda1[_0x9c31('0xb')];var _0x51bb5a=_0x5ce07a[_0x9c31('0xc')]({'plain':!![]});if(_0x51bb5a[_0x9c31('0xd')][_0x9c31('0xe')]()==='in'||_0x51bb5a[_0x9c31('0xd')][_0x9c31('0xe')]()==='out'&&!_0x51bb5a['secret']&&!_['isNil'](_0x51bb5a[_0x9c31('0xf')])){_0x518d6c['ChatInteraction'][_0x9c31('0x10')]({'where':{'id':_0x51bb5a[_0x9c31('0x11')]}})[_0x9c31('0x12')](function(_0x57f1d3){if(_0x57f1d3){_0x57f1d3[_0x9c31('0x13')]({'lastMsgAt':_0x51bb5a[_0x9c31('0x14')],'lastMsgDirection':_0x51bb5a[_0x9c31('0xd')]['toLowerCase']()});}})[_0x9c31('0x15')](function(_0x1bb3fc){console[_0x9c31('0x16')](_0x1bb3fc);});}_0x2bfbce();}},'charset':_0x9c31('0x17'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x623e=['error','lodash','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ChatMessage','chat_messages','fti_chat_messages','body','models','get','direction','toLowerCase','isNil','UserId','ChatInteraction','findOne','then','update','createdAt'];(function(_0x290818,_0x500c35){var _0x2cc668=function(_0x605dfb){while(--_0x605dfb){_0x290818['push'](_0x290818['shift']());}};_0x2cc668(++_0x500c35);}(_0x623e,0x65));var _0xe623=function(_0x503166,_0x32adbd){_0x503166=_0x503166-0x0;var _0x57535b=_0x623e[_0x503166];return _0x57535b;};'use strict';var _=require(_0xe623('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe623('0x1'));var moment=require('moment');var BPromise=require(_0xe623('0x2'));var rp=require(_0xe623('0x3'));var fs=require('fs');var path=require(_0xe623('0x4'));var rimraf=require(_0xe623('0x5'));var config=require(_0xe623('0x6'));var attributes=require('./chatMessage.attributes');module[_0xe623('0x7')]=function(_0x5ed775,_0x570056){return _0x5ed775[_0xe623('0x8')](_0xe623('0x9'),attributes,{'tableName':_0xe623('0xa'),'paranoid':![],'indexes':[{'name':_0xe623('0xb'),'fields':[_0xe623('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x511a5c,_0xaf269d,_0x5930e2){var _0x5645fe=_0x5ed775[_0xe623('0xd')];var _0x4300f6=_0x511a5c[_0xe623('0xe')]({'plain':!![]});if(_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='in'||_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()==='out'&&!_0x4300f6['secret']&&!_[_0xe623('0x11')](_0x4300f6[_0xe623('0x12')])){_0x5645fe[_0xe623('0x13')][_0xe623('0x14')]({'where':{'id':_0x4300f6['ChatInteractionId']}})[_0xe623('0x15')](function(_0x2d05a2){if(_0x2d05a2){_0x2d05a2[_0xe623('0x16')]({'lastMsgAt':_0x4300f6[_0xe623('0x17')],'lastMsgDirection':_0x4300f6[_0xe623('0xf')][_0xe623('0x10')]()});}})['catch'](function(_0x3bee29){console[_0xe623('0x18')](_0x3bee29);});}_0x5930e2();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index fcec52e..a751045 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 _0xcdf1=['create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','info','request\x20sent','debug','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage'];(function(_0x50cb4b,_0x31a607){var _0x8b1491=function(_0x53596c){while(--_0x53596c){_0x50cb4b['push'](_0x50cb4b['shift']());}};_0x8b1491(++_0x31a607);}(_0xcdf1,0x11e));var _0x1cdf=function(_0x1be35b,_0xa49780){_0x1be35b=_0x1be35b-0x0;var _0xd22f6=_0xcdf1[_0x1be35b];return _0xd22f6;};'use strict';var _=require(_0x1cdf('0x0'));var util=require(_0x1cdf('0x1'));var moment=require(_0x1cdf('0x2'));var BPromise=require(_0x1cdf('0x3'));var rs=require(_0x1cdf('0x4'));var fs=require('fs');var Redis=require(_0x1cdf('0x5'));var db=require(_0x1cdf('0x6'))['db'];var utils=require(_0x1cdf('0x7'));var logger=require(_0x1cdf('0x8'))(_0x1cdf('0x9'));var config=require('../../config/environment');var jayson=require(_0x1cdf('0xa'));var client=jayson[_0x1cdf('0xb')]['http']({'port':0x232a});config[_0x1cdf('0xc')]=_[_0x1cdf('0xd')](config[_0x1cdf('0xc')],{'host':_0x1cdf('0xe'),'port':0x18eb});var socket=require(_0x1cdf('0xf'))(new Redis(config['redis']));require(_0x1cdf('0x10'))[_0x1cdf('0x11')](socket);function respondWithRpcPromise(_0x31a205,_0x4af438,_0x20f5b5){return new BPromise(function(_0x191dc3,_0x551eed){return client['request'](_0x31a205,_0x20f5b5)['then'](function(_0x447bce){logger[_0x1cdf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'));logger[_0x1cdf('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'),JSON[_0x1cdf('0x15')](_0x447bce));if(_0x447bce[_0x1cdf('0x16')]){if(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x17')]===0x1f4){logger[_0x1cdf('0x16')](_0x1cdf('0x18'),_0x4af438,_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);return _0x551eed(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);}logger[_0x1cdf('0x16')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);return _0x191dc3(_0x447bce[_0x1cdf('0x16')][_0x1cdf('0x19')]);}else{logger[_0x1cdf('0x12')]('ChatMessage,\x20%s,\x20%s',_0x4af438,_0x1cdf('0x13'));_0x191dc3(_0x447bce[_0x1cdf('0x1a')][_0x1cdf('0x19')]);}})['catch'](function(_0x23a397){logger[_0x1cdf('0x16')](_0x1cdf('0x18'),_0x4af438,_0x23a397);_0x551eed(_0x23a397);});});}exports[_0x1cdf('0x1b')]=function(_0x13c8a3){var _0x1c5ce9=this;return new Promise(function(_0x13c842,_0x11521f){return db[_0x1cdf('0x1c')][_0x1cdf('0x1d')](_0x13c8a3[_0x1cdf('0x1e')],{'raw':_0x13c8a3[_0x1cdf('0x1f')]?_0x13c8a3['options'][_0x1cdf('0x20')]===undefined?!![]:![]:!![]})[_0x1cdf('0x21')](function(_0x57a0d2){logger[_0x1cdf('0x12')]('CreateChatMessage',_0x13c8a3);logger['debug'](_0x1cdf('0x1b'),_0x13c8a3,JSON[_0x1cdf('0x15')](_0x57a0d2));_0x13c842(_0x57a0d2);})[_0x1cdf('0x22')](function(_0x1c4e44){logger[_0x1cdf('0x16')](_0x1cdf('0x1b'),_0x1c4e44[_0x1cdf('0x19')],_0x13c8a3);_0x11521f(_0x1c5ce9['error'](0x1f4,_0x1c4e44[_0x1cdf('0x19')]));});});};
\ No newline at end of file
+var _0x1f24=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateChatMessage','ChatMessage','create','body','options','raw','catch','lodash','bluebird','randomstring'];(function(_0x1ae94c,_0x489198){var _0x91a500=function(_0x51a333){while(--_0x51a333){_0x1ae94c['push'](_0x1ae94c['shift']());}};_0x91a500(++_0x489198);}(_0x1f24,0x12f));var _0x41f2=function(_0x3877aa,_0x42bf1e){_0x3877aa=_0x3877aa-0x0;var _0x4e2e61=_0x1f24[_0x3877aa];return _0x4e2e61;};'use strict';var _=require(_0x41f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x41f2('0x1'));var rs=require(_0x41f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x41f2('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x41f2('0x4'))('rpc');var config=require(_0x41f2('0x5'));var jayson=require(_0x41f2('0x6'));var client=jayson[_0x41f2('0x7')][_0x41f2('0x8')]({'port':0x232a});config[_0x41f2('0x9')]=_[_0x41f2('0xa')](config[_0x41f2('0x9')],{'host':_0x41f2('0xb'),'port':0x18eb});var socket=require(_0x41f2('0xc'))(new Redis(config['redis']));require(_0x41f2('0xd'))[_0x41f2('0xe')](socket);function respondWithRpcPromise(_0x34ea0a,_0x36e9ba,_0x38c5ef){return new BPromise(function(_0x3454f0,_0x5583da){return client[_0x41f2('0xf')](_0x34ea0a,_0x38c5ef)[_0x41f2('0x10')](function(_0x58642a){logger[_0x41f2('0x11')](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');logger[_0x41f2('0x13')](_0x41f2('0x14'),_0x36e9ba,_0x41f2('0x15'),JSON[_0x41f2('0x16')](_0x58642a));if(_0x58642a['error']){if(_0x58642a[_0x41f2('0x17')][_0x41f2('0x18')]===0x1f4){logger[_0x41f2('0x17')](_0x41f2('0x12'),_0x36e9ba,_0x58642a[_0x41f2('0x17')]['message']);return _0x5583da(_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);}logger[_0x41f2('0x17')]('ChatMessage,\x20%s,\x20%s',_0x36e9ba,_0x58642a[_0x41f2('0x17')][_0x41f2('0x19')]);return _0x3454f0(_0x58642a[_0x41f2('0x17')]['message']);}else{logger['info'](_0x41f2('0x12'),_0x36e9ba,'request\x20sent');_0x3454f0(_0x58642a[_0x41f2('0x1a')]['message']);}})['catch'](function(_0x3819cf){logger['error'](_0x41f2('0x12'),_0x36e9ba,_0x3819cf);_0x5583da(_0x3819cf);});});}exports[_0x41f2('0x1b')]=function(_0x3e7db5){var _0x42a9f2=this;return new Promise(function(_0x38d8c0,_0x26d0bc){return db[_0x41f2('0x1c')][_0x41f2('0x1d')](_0x3e7db5[_0x41f2('0x1e')],{'raw':_0x3e7db5[_0x41f2('0x1f')]?_0x3e7db5['options'][_0x41f2('0x20')]===undefined?!![]:![]:!![]})[_0x41f2('0x10')](function(_0x3dc07d){logger['info']('CreateChatMessage',_0x3e7db5);logger['debug'](_0x41f2('0x1b'),_0x3e7db5,JSON[_0x41f2('0x16')](_0x3dc07d));_0x38d8c0(_0x3dc07d);})[_0x41f2('0x21')](function(_0x3ba91e){logger['error'](_0x41f2('0x1b'),_0x3ba91e[_0x41f2('0x19')],_0x3e7db5);_0x26d0bc(_0x42a9f2[_0x41f2('0x17')](0x1f4,_0x3ba91e[_0x41f2('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index f1a3324..b1a3fef 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 _0x4ab0=['register','length','chatMessage:','save','remove','update'];(function(_0x18ac33,_0x3f860a){var _0x33dd81=function(_0xd8fe3f){while(--_0xd8fe3f){_0x18ac33['push'](_0x18ac33['shift']());}};_0x33dd81(++_0x3f860a);}(_0x4ab0,0xd5));var _0x04ab=function(_0x52bc51,_0x2662c){_0x52bc51=_0x52bc51-0x0;var _0x5a5bda=_0x4ab0[_0x52bc51];return _0x5a5bda;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x04ab('0x0'),_0x04ab('0x1'),_0x04ab('0x2')];function createListener(_0x3d8417,_0x3a7b9f){return function(_0x51135e){_0x3a7b9f['emit'](_0x3d8417,_0x51135e);};}function removeListener(_0x45dfee,_0xb1bf2d){return function(){ChatMessageEvents['removeListener'](_0x45dfee,_0xb1bf2d);};}exports[_0x04ab('0x3')]=function(_0x2c5730){for(var _0x4edd2e=0x0,_0x3f5901=events[_0x04ab('0x4')];_0x4edd2e<_0x3f5901;_0x4edd2e++){var _0x1ff7f6=events[_0x4edd2e];var _0x4bc05e=createListener(_0x04ab('0x5')+_0x1ff7f6,_0x2c5730);ChatMessageEvents['on'](_0x1ff7f6,_0x4bc05e);}};
\ No newline at end of file
+var _0x1b20=['removeListener','register','length','chatMessage:','save','remove','emit'];(function(_0x1ee294,_0xbba3f5){var _0x41d205=function(_0x529f07){while(--_0x529f07){_0x1ee294['push'](_0x1ee294['shift']());}};_0x41d205(++_0xbba3f5);}(_0x1b20,0x66));var _0x01b2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x1b20[_0x4565bf];return _0x5610ba;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0x01b2('0x0'),_0x01b2('0x1'),'update'];function createListener(_0x54eccf,_0x27a406){return function(_0x18e3ff){_0x27a406[_0x01b2('0x2')](_0x54eccf,_0x18e3ff);};}function removeListener(_0x1150fc,_0x1cf757){return function(){ChatMessageEvents[_0x01b2('0x3')](_0x1150fc,_0x1cf757);};}exports[_0x01b2('0x4')]=function(_0x28de4a){for(var _0x46e745=0x0,_0xa64ad1=events[_0x01b2('0x5')];_0x46e745<_0xa64ad1;_0x46e745++){var _0x323470=events[_0x46e745];var _0x508add=createListener(_0x01b2('0x6')+_0x323470,_0x28de4a);ChatMessageEvents['on'](_0x323470,_0x508add);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 992688d..ba0ad07 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 _0x2eb4=['describe','get','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','reject','delete','destroy','exports','multer','util','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','/describe'];(function(_0x3163ee,_0x4f031c){var _0x4e31cc=function(_0x5e5fa5){while(--_0x5e5fa5){_0x3163ee['push'](_0x3163ee['shift']());}};_0x4e31cc(++_0x4f031c);}(_0x2eb4,0x1db));var _0x42eb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2eb4[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x42eb('0x0'));var util=require(_0x42eb('0x1'));var path=require('path');var timeout=require(_0x42eb('0x2'));var express=require('express');var router=express[_0x42eb('0x3')]();var fs_extra=require(_0x42eb('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x42eb('0x5'));var config=require(_0x42eb('0x6'));var controller=require(_0x42eb('0x7'));router['get']('/',auth[_0x42eb('0x8')](),controller[_0x42eb('0x9')]);router['get'](_0x42eb('0xa'),auth['isAuthenticated'](),controller[_0x42eb('0xb')]);router[_0x42eb('0xc')](_0x42eb('0xd'),auth['isAuthenticated'](),controller[_0x42eb('0xe')]);router[_0x42eb('0xf')]('/',auth[_0x42eb('0x8')](),interaction[_0x42eb('0x10')](_0x42eb('0x11'),_0x42eb('0x12')),controller[_0x42eb('0x13')]);router[_0x42eb('0x14')]('/:id',controller[_0x42eb('0x15')]);router[_0x42eb('0x14')](_0x42eb('0x16'),auth[_0x42eb('0x8')](),controller['accept']);router[_0x42eb('0x14')]('/:id/reject',auth[_0x42eb('0x8')](),controller[_0x42eb('0x17')]);router[_0x42eb('0x18')](_0x42eb('0xd'),auth['isAuthenticated'](),controller[_0x42eb('0x19')]);module[_0x42eb('0x1a')]=router;
\ No newline at end of file
+var _0xfe9e=['isAuthenticated','tracked','chat','chatmessage:create','create','put','accept','/:id/reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id'];(function(_0xd89f4e,_0x275d9){var _0x2bf51b=function(_0x68692a){while(--_0x68692a){_0xd89f4e['push'](_0xd89f4e['shift']());}};_0x2bf51b(++_0x275d9);}(_0xfe9e,0x177));var _0xefe9=function(_0x50c16c,_0x43b99e){_0x50c16c=_0x50c16c-0x0;var _0x24dc5f=_0xfe9e[_0x50c16c];return _0x24dc5f;};'use strict';var multer=require(_0xefe9('0x0'));var util=require(_0xefe9('0x1'));var path=require(_0xefe9('0x2'));var timeout=require(_0xefe9('0x3'));var express=require(_0xefe9('0x4'));var router=express[_0xefe9('0x5')]();var fs_extra=require(_0xefe9('0x6'));var auth=require(_0xefe9('0x7'));var interaction=require(_0xefe9('0x8'));var config=require(_0xefe9('0x9'));var controller=require('./chatMessage.controller');router[_0xefe9('0xa')]('/',auth['isAuthenticated'](),controller[_0xefe9('0xb')]);router[_0xefe9('0xa')](_0xefe9('0xc'),auth['isAuthenticated'](),controller[_0xefe9('0xd')]);router['get'](_0xefe9('0xe'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xefe9('0xf')](),interaction[_0xefe9('0x10')](_0xefe9('0x11'),_0xefe9('0x12')),controller[_0xefe9('0x13')]);router[_0xefe9('0x14')]('/:id',controller['update']);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0xefe9('0x15')]);router[_0xefe9('0x14')](_0xefe9('0x16'),auth[_0xefe9('0xf')](),controller['reject']);router[_0xefe9('0x17')](_0xefe9('0xe'),auth[_0xefe9('0xf')](),controller[_0xefe9('0x18')]);module[_0xefe9('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 92a1849..9f40e17 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 _0x1739=['TEXT','exports'];(function(_0x25b7fd,_0x479a63){var _0x1c712e=function(_0x31cc60){while(--_0x31cc60){_0x25b7fd['push'](_0x25b7fd['shift']());}};_0x1c712e(++_0x479a63);}(_0x1739,0x1e9));var _0x9173=function(_0x40f340,_0x167f80){_0x40f340=_0x40f340-0x0;var _0x2538c5=_0x1739[_0x40f340];return _0x2538c5;};'use strict';var Sequelize=require('sequelize');module[_0x9173('0x0')]={'body':{'type':Sequelize[_0x9173('0x1')]('medium'),'allowNull':![]}};
\ No newline at end of file
+var _0xd8d6=['exports','TEXT','medium','sequelize'];(function(_0x3c819e,_0x1d0c31){var _0x122739=function(_0x2deea9){while(--_0x2deea9){_0x3c819e['push'](_0x3c819e['shift']());}};_0x122739(++_0x1d0c31);}(_0xd8d6,0x177));var _0x6d8d=function(_0x349766,_0x1b7f7d){_0x349766=_0x349766-0x0;var _0xbfc0dd=_0xd8d6[_0x349766];return _0xbfc0dd;};'use strict';var Sequelize=require(_0x6d8d('0x0'));module[_0x6d8d('0x1')]={'body':{'type':Sequelize[_0x6d8d('0x2')](_0x6d8d('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 1edde58..9ff4d0d 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 _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(_0x25386b,_0x2c852f){var _0x21952c=function(_0x330912){while(--_0x330912){_0x25386b['push'](_0x25386b['shift']());}};_0x21952c(++_0x2c852f);}(_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
+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(_0x243b2f,_0x30aa15){var _0xcb3c2d=function(_0x213bb2){while(--_0x213bb2){_0x243b2f['push'](_0x243b2f['shift']());}};_0xcb3c2d(++_0x30aa15);}(_0x7a54,0x106));var _0x47a5=function(_0x1e700b,_0x495c85){_0x1e700b=_0x1e700b-0x0;var _0x42ca03=_0x7a54[_0x1e700b];return _0x42ca03;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index f89cc55..f47c7f1 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 _0x94bb=['bluebird','path','rimraf','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x1a9204,_0x1c9e00){var _0x17ca68=function(_0x1f4399){while(--_0x1f4399){_0x1a9204['push'](_0x1a9204['shift']());}};_0x17ca68(++_0x1c9e00);}(_0x94bb,0xa5));var _0xb94b=function(_0x2059df,_0x367401){_0x2059df=_0x2059df-0x0;var _0xdd848b=_0x94bb[_0x2059df];return _0xdd848b;};'use strict';var _=require('lodash');var util=require(_0xb94b('0x0'));var logger=require('../../config/logger')(_0xb94b('0x1'));var moment=require(_0xb94b('0x2'));var BPromise=require(_0xb94b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb94b('0x4'));var rimraf=require(_0xb94b('0x5'));var config=require('../../config/environment');var attributes=require(_0xb94b('0x6'));module[_0xb94b('0x7')]=function(_0x3bda7c,_0x1d5737){return _0x3bda7c[_0xb94b('0x8')](_0xb94b('0x9'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb94b('0xa'),'collate':_0xb94b('0xb')});};
\ No newline at end of file
+var _0x0ff9=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatOfflineMessage.attributes'];(function(_0x398eb8,_0x4757d8){var _0x5aa1d6=function(_0x190a13){while(--_0x190a13){_0x398eb8['push'](_0x398eb8['shift']());}};_0x5aa1d6(++_0x4757d8);}(_0x0ff9,0x156));var _0x90ff=function(_0x1ce472,_0x5f5374){_0x1ce472=_0x1ce472-0x0;var _0x5414e7=_0x0ff9[_0x1ce472];return _0x5414e7;};'use strict';var _=require('lodash');var util=require(_0x90ff('0x0'));var logger=require(_0x90ff('0x1'))(_0x90ff('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x90ff('0x3'));var fs=require('fs');var path=require(_0x90ff('0x4'));var rimraf=require(_0x90ff('0x5'));var config=require(_0x90ff('0x6'));var attributes=require(_0x90ff('0x7'));module[_0x90ff('0x8')]=function(_0x46cacb,_0x2ee7dd){return _0x46cacb[_0x90ff('0x9')](_0x90ff('0xa'),attributes,{'tableName':_0x90ff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x90ff('0xc'),'collate':_0x90ff('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index e4e03c1..735016e 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 _0x39f0=['code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatOfflineMessage,\x20%s,\x20%s','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x39f0,0x1d1));var _0x039f=function(_0x190488,_0x2fb857){_0x190488=_0x190488-0x0;var _0x5ab646=_0x39f0[_0x190488];return _0x5ab646;};'use strict';var _=require(_0x039f('0x0'));var util=require(_0x039f('0x1'));var moment=require(_0x039f('0x2'));var BPromise=require(_0x039f('0x3'));var rs=require(_0x039f('0x4'));var fs=require('fs');var Redis=require(_0x039f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x039f('0x6'));var logger=require(_0x039f('0x7'))('rpc');var config=require(_0x039f('0x8'));var jayson=require(_0x039f('0x9'));var client=jayson[_0x039f('0xa')][_0x039f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4381ac,_0x5ed44c,_0x5f47e1){return new BPromise(function(_0x1a3af6,_0x170a0e){return client['request'](_0x4381ac,_0x5f47e1)[_0x039f('0xc')](function(_0x1f87dc){logger[_0x039f('0xd')](_0x039f('0xe'),_0x5ed44c,'request\x20sent');logger['debug'](_0x039f('0xf'),_0x5ed44c,'request\x20sent',JSON[_0x039f('0x10')](_0x1f87dc));if(_0x1f87dc[_0x039f('0x11')]){if(_0x1f87dc[_0x039f('0x11')][_0x039f('0x12')]===0x1f4){logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);return _0x170a0e(_0x1f87dc['error'][_0x039f('0x13')]);}logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);return _0x1a3af6(_0x1f87dc[_0x039f('0x11')][_0x039f('0x13')]);}else{logger[_0x039f('0xd')](_0x039f('0xe'),_0x5ed44c,_0x039f('0x14'));_0x1a3af6(_0x1f87dc[_0x039f('0x15')][_0x039f('0x13')]);}})[_0x039f('0x16')](function(_0x92ac10){logger[_0x039f('0x11')](_0x039f('0xe'),_0x5ed44c,_0x92ac10);_0x170a0e(_0x92ac10);});});}
\ No newline at end of file
+var _0x5270=['error','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5270,0xab));var _0x0527=function(_0x231c1e,_0xff1290){_0x231c1e=_0x231c1e-0x0;var _0x3a220a=_0x5270[_0x231c1e];return _0x3a220a;};'use strict';var _=require(_0x0527('0x0'));var util=require(_0x0527('0x1'));var moment=require('moment');var BPromise=require(_0x0527('0x2'));var rs=require(_0x0527('0x3'));var fs=require('fs');var Redis=require(_0x0527('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0527('0x5'));var logger=require(_0x0527('0x6'))(_0x0527('0x7'));var config=require(_0x0527('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0527('0x9')][_0x0527('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f6299,_0x3b2f09,_0x5b2929){return new BPromise(function(_0x42a07f,_0xd6cf99){return client[_0x0527('0xb')](_0x3f6299,_0x5b2929)[_0x0527('0xc')](function(_0x2f0a05){logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));logger[_0x0527('0x10')](_0x0527('0x11'),_0x3b2f09,_0x0527('0xf'),JSON['stringify'](_0x2f0a05));if(_0x2f0a05['error']){if(_0x2f0a05[_0x0527('0x12')]['code']===0x1f4){logger[_0x0527('0x12')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3b2f09,_0x2f0a05['error']['message']);return _0xd6cf99(_0x2f0a05['error']['message']);}logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2f0a05['error'][_0x0527('0x13')]);return _0x42a07f(_0x2f0a05[_0x0527('0x12')][_0x0527('0x13')]);}else{logger[_0x0527('0xd')](_0x0527('0xe'),_0x3b2f09,_0x0527('0xf'));_0x42a07f(_0x2f0a05[_0x0527('0x14')][_0x0527('0x13')]);}})['catch'](function(_0x2bc699){logger['error'](_0x0527('0xe'),_0x3b2f09,_0x2bc699);_0xd6cf99(_0x2bc699);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e53c18d..028966e 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 _0xe752=['fs-extra','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','get','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3336ad,_0x4f8359){var _0x286568=function(_0x180d3b){while(--_0x180d3b){_0x3336ad['push'](_0x3336ad['shift']());}};_0x286568(++_0x4f8359);}(_0xe752,0xe1));var _0x2e75=function(_0xb378f1,_0x523663){_0xb378f1=_0xb378f1-0x0;var _0x263069=_0xe752[_0xb378f1];return _0x263069;};'use strict';var multer=require(_0x2e75('0x0'));var util=require(_0x2e75('0x1'));var path=require(_0x2e75('0x2'));var timeout=require(_0x2e75('0x3'));var express=require(_0x2e75('0x4'));var router=express[_0x2e75('0x5')]();var fs_extra=require(_0x2e75('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x2e75('0x7'));var config=require('../../config/environment');var controller=require(_0x2e75('0x8'));router['get']('/',auth[_0x2e75('0x9')](),controller['index']);router[_0x2e75('0xa')]('/describe',auth[_0x2e75('0x9')](),controller[_0x2e75('0xb')]);router[_0x2e75('0xa')]('/:id',auth[_0x2e75('0x9')](),controller[_0x2e75('0xc')]);router[_0x2e75('0xd')]('/',auth['isAuthenticated'](),controller[_0x2e75('0xe')]);router[_0x2e75('0xf')](_0x2e75('0x10'),auth[_0x2e75('0x9')](),controller[_0x2e75('0x11')]);router[_0x2e75('0x12')](_0x2e75('0x10'),auth[_0x2e75('0x9')](),controller[_0x2e75('0x13')]);module[_0x2e75('0x14')]=router;
\ No newline at end of file
+var _0xf77b=['create','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x571a17,_0x63fb3d){var _0x3ef337=function(_0x12096b){while(--_0x12096b){_0x571a17['push'](_0x571a17['shift']());}};_0x3ef337(++_0x63fb3d);}(_0xf77b,0xa2));var _0xbf77=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0xf77b[_0x3c8e9a];return _0x2d4c57;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xbf77('0x0'));var express=require(_0xbf77('0x1'));var router=express[_0xbf77('0x2')]();var fs_extra=require(_0xbf77('0x3'));var auth=require(_0xbf77('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbf77('0x5'));var controller=require(_0xbf77('0x6'));router[_0xbf77('0x7')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0x9')]);router[_0xbf77('0x7')](_0xbf77('0xa'),auth[_0xbf77('0x8')](),controller[_0xbf77('0xb')]);router['get'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['show']);router[_0xbf77('0xd')]('/',auth[_0xbf77('0x8')](),controller[_0xbf77('0xe')]);router['put'](_0xbf77('0xc'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xbf77('0xc'),auth[_0xbf77('0x8')](),controller['destroy']);module[_0xbf77('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index a85bac7..1e9e612 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 _0x0610=['exports','STRING','ENUM','mouseOver','timeout','INTEGER','sequelize'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x0610,0x156));var _0x0061=function(_0x517bca,_0x447dc8){_0x517bca=_0x517bca-0x0;var _0x117c43=_0x0610[_0x517bca];return _0x117c43;};'use strict';var Sequelize=require(_0x0061('0x0'));module[_0x0061('0x1')]={'name':{'type':Sequelize[_0x0061('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x0061('0x3')](_0x0061('0x4'),_0x0061('0x5')),'defaultValue':_0x0061('0x4')},'selector':{'type':Sequelize[_0x0061('0x2')]},'timeout':{'type':Sequelize[_0x0061('0x6')]}};
\ No newline at end of file
+var _0x53ce=['timeout','STRING','exports','ENUM','mouseOver'];(function(_0x16fd27,_0x3b82ef){var _0x2539e9=function(_0x3be0e1){while(--_0x3be0e1){_0x16fd27['push'](_0x16fd27['shift']());}};_0x2539e9(++_0x3b82ef);}(_0x53ce,0x110));var _0xe53c=function(_0x353dfb,_0x4fcbcc){_0x353dfb=_0x353dfb-0x0;var _0x34fc15=_0x53ce[_0x353dfb];return _0x34fc15;};'use strict';var Sequelize=require('sequelize');module[_0xe53c('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xe53c('0x1')](_0xe53c('0x2'),_0xe53c('0x3')),'defaultValue':_0xe53c('0x2')},'selector':{'type':Sequelize[_0xe53c('0x4')]},'timeout':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index 7225c0f..82e6afc 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 _0xbf07=['rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../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','show','params','model','ChatProactiveAction','rawAttributes','query','filters','intersection','attributes','fields','includeAll','include','merge','options','find','catch','create','body','eml-format'];(function(_0x22a19c,_0xb78748){var _0x3d8120=function(_0x241270){while(--_0x241270){_0x22a19c['push'](_0x22a19c['shift']());}};_0x3d8120(++_0xb78748);}(_0xbf07,0x77));var _0x7bf0=function(_0x207811,_0x3420a6){_0x207811=_0x207811-0x0;var _0x170d56=_0xbf07[_0x207811];return _0x170d56;};'use strict';var emlformat=require(_0x7bf0('0x0'));var rimraf=require(_0x7bf0('0x1'));var zipdir=require(_0x7bf0('0x2'));var jsonpatch=require(_0x7bf0('0x3'));var rp=require('request-promise');var moment=require(_0x7bf0('0x4'));var BPromise=require(_0x7bf0('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x7bf0('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x7bf0('0x7'));var squel=require('squel');var crypto=require(_0x7bf0('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7bf0('0x9'));var toCsv=require(_0x7bf0('0xa'));var querystring=require(_0x7bf0('0xb'));var Papa=require(_0x7bf0('0xc'));var Redis=require(_0x7bf0('0xd'));var authService=require(_0x7bf0('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7bf0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bf0('0x10'))(_0x7bf0('0x11'));var utils=require(_0x7bf0('0x12'));var config=require(_0x7bf0('0x13'));var licenseUtil=require(_0x7bf0('0x14'));var db=require(_0x7bf0('0x15'))['db'];function respondWithStatusCode(_0xf81111,_0x2382fb){_0x2382fb=_0x2382fb||0xcc;return function(_0x1897e0){if(_0x1897e0){return _0xf81111[_0x7bf0('0x16')](_0x2382fb);}return _0xf81111[_0x7bf0('0x17')](_0x2382fb)[_0x7bf0('0x18')]();};}function respondWithResult(_0xf15732,_0x88142d){_0x88142d=_0x88142d||0xc8;return function(_0x13c6e9){if(_0x13c6e9){return _0xf15732[_0x7bf0('0x17')](_0x88142d)[_0x7bf0('0x19')](_0x13c6e9);}};}function respondWithFilteredResult(_0x383be0,_0x20fc70){return function(_0x182df9){if(_0x182df9){var _0x4f551c=typeof _0x20fc70[_0x7bf0('0x1a')]===_0x7bf0('0x1b')&&typeof _0x20fc70[_0x7bf0('0x1c')]===_0x7bf0('0x1b');var _0x13c9bb=_0x182df9['count'];var _0x254dc8=_0x4f551c?0x0:_0x20fc70[_0x7bf0('0x1a')];var _0x2a99fe=_0x4f551c?_0x182df9[_0x7bf0('0x1d')]:_0x20fc70[_0x7bf0('0x1a')]+_0x20fc70[_0x7bf0('0x1c')];var _0xf97278;if(_0x2a99fe>=_0x13c9bb){_0x2a99fe=_0x13c9bb;_0xf97278=0xc8;}else{_0xf97278=0xce;}_0x383be0[_0x7bf0('0x17')](_0xf97278);return _0x383be0[_0x7bf0('0x1e')](_0x7bf0('0x1f'),_0x254dc8+'-'+_0x2a99fe+'/'+_0x13c9bb)['json'](_0x182df9);}return null;};}function patchUpdates(_0x115f78){return function(_0x131a9b){try{jsonpatch[_0x7bf0('0x20')](_0x131a9b,_0x115f78,!![]);}catch(_0x3a74b6){return BPromise[_0x7bf0('0x21')](_0x3a74b6);}return _0x131a9b[_0x7bf0('0x22')]();};}function saveUpdates(_0x4e41b6,_0x4924d8){return function(_0x4379cb){if(_0x4379cb){return _0x4379cb[_0x7bf0('0x23')](_0x4e41b6)['then'](function(_0x4345a3){return _0x4345a3;});}return null;};}function removeEntity(_0x4b5278,_0x157e0f){return function(_0x44e281){if(_0x44e281){return _0x44e281[_0x7bf0('0x24')]()[_0x7bf0('0x25')](function(){_0x4b5278[_0x7bf0('0x17')](0xcc)[_0x7bf0('0x18')]();});}};}function handleEntityNotFound(_0x2e4994,_0xb4c390){return function(_0x14a98c){if(!_0x14a98c){_0x2e4994[_0x7bf0('0x16')](0x194);}return _0x14a98c;};}function handleError(_0x1e0f7f,_0x573ab4){_0x573ab4=_0x573ab4||0x1f4;return function(_0x366c54){logger[_0x7bf0('0x26')](_0x366c54[_0x7bf0('0x27')]);if(_0x366c54[_0x7bf0('0x28')]){delete _0x366c54[_0x7bf0('0x28')];}_0x1e0f7f['status'](_0x573ab4)[_0x7bf0('0x29')](_0x366c54);};}exports[_0x7bf0('0x2a')]=function(_0x4d1b7a,_0x145f54){var _0x540e84={'raw':!![],'where':{'id':_0x4d1b7a[_0x7bf0('0x2b')]['id']}},_0x1393f7={};_0x1393f7[_0x7bf0('0x2c')]=_['keys'](db[_0x7bf0('0x2d')][_0x7bf0('0x2e')]);_0x1393f7[_0x7bf0('0x2f')]=_['keys'](_0x4d1b7a[_0x7bf0('0x2f')]);_0x1393f7[_0x7bf0('0x30')]=_[_0x7bf0('0x31')](_0x1393f7[_0x7bf0('0x2c')],_0x1393f7['query']);_0x540e84[_0x7bf0('0x32')]=_[_0x7bf0('0x31')](_0x1393f7[_0x7bf0('0x2c')],qs[_0x7bf0('0x33')](_0x4d1b7a[_0x7bf0('0x2f')]['fields']));_0x540e84[_0x7bf0('0x32')]=_0x540e84[_0x7bf0('0x32')]['length']?_0x540e84[_0x7bf0('0x32')]:_0x1393f7[_0x7bf0('0x2c')];if(_0x4d1b7a['query'][_0x7bf0('0x34')]){_0x540e84[_0x7bf0('0x35')]=[{'all':!![]}];}_0x540e84=_[_0x7bf0('0x36')]({},_0x540e84,_0x4d1b7a[_0x7bf0('0x37')]);return db[_0x7bf0('0x2d')][_0x7bf0('0x38')](_0x540e84)[_0x7bf0('0x25')](handleEntityNotFound(_0x145f54,null))[_0x7bf0('0x25')](respondWithResult(_0x145f54,null))[_0x7bf0('0x39')](handleError(_0x145f54,null));};exports[_0x7bf0('0x3a')]=function(_0x458142,_0x37217c){return db[_0x7bf0('0x2d')][_0x7bf0('0x3a')](_0x458142[_0x7bf0('0x3b')],{})['then'](respondWithResult(_0x37217c,0xc9))[_0x7bf0('0x39')](handleError(_0x37217c,null));};exports[_0x7bf0('0x23')]=function(_0x351336,_0x946380){if(_0x351336[_0x7bf0('0x3b')]['id']){delete _0x351336['body']['id'];}return db[_0x7bf0('0x2d')][_0x7bf0('0x38')]({'where':{'id':_0x351336['params']['id']}})[_0x7bf0('0x25')](handleEntityNotFound(_0x946380,null))['then'](saveUpdates(_0x351336[_0x7bf0('0x3b')],null))[_0x7bf0('0x25')](respondWithResult(_0x946380,null))[_0x7bf0('0x39')](handleError(_0x946380,null));};exports[_0x7bf0('0x24')]=function(_0x172d35,_0xed9c6b){return db[_0x7bf0('0x2d')]['find']({'where':{'id':_0x172d35['params']['id']}})[_0x7bf0('0x25')](handleEntityNotFound(_0xed9c6b,null))[_0x7bf0('0x25')](removeEntity(_0xed9c6b,null))[_0x7bf0('0x39')](handleError(_0xed9c6b,null));};
\ No newline at end of file
+var _0xe314=['mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','count','limit','Content-Range','json','apply','reject','then','error','stack','name','show','model','ChatProactiveAction','rawAttributes','keys','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','find','catch','create','update','body','destroy','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x5959c9,_0x2ed153){var _0x4ffcbc=function(_0x459b7a){while(--_0x459b7a){_0x5959c9['push'](_0x5959c9['shift']());}};_0x4ffcbc(++_0x2ed153);}(_0xe314,0x7c));var _0x4e31=function(_0x5e1184,_0x22508c){_0x5e1184=_0x5e1184-0x0;var _0x4f6ef7=_0xe314[_0x5e1184];return _0x4f6ef7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4e31('0x0'));var zipdir=require(_0x4e31('0x1'));var jsonpatch=require(_0x4e31('0x2'));var rp=require(_0x4e31('0x3'));var moment=require(_0x4e31('0x4'));var BPromise=require(_0x4e31('0x5'));var Mustache=require(_0x4e31('0x6'));var util=require(_0x4e31('0x7'));var path=require(_0x4e31('0x8'));var sox=require(_0x4e31('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4e31('0xa'));var _=require(_0x4e31('0xb'));var squel=require(_0x4e31('0xc'));var crypto=require(_0x4e31('0xd'));var jsforce=require(_0x4e31('0xe'));var deskjs=require(_0x4e31('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4e31('0x10'));var Papa=require(_0x4e31('0x11'));var Redis=require(_0x4e31('0x12'));var authService=require(_0x4e31('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x4e31('0x14'));var hardwareService=require(_0x4e31('0x15'));var logger=require(_0x4e31('0x16'))(_0x4e31('0x17'));var utils=require(_0x4e31('0x18'));var config=require(_0x4e31('0x19'));var licenseUtil=require(_0x4e31('0x1a'));var db=require(_0x4e31('0x1b'))['db'];function respondWithStatusCode(_0x278a3b,_0x3f8dff){_0x3f8dff=_0x3f8dff||0xcc;return function(_0x41abc8){if(_0x41abc8){return _0x278a3b[_0x4e31('0x1c')](_0x3f8dff);}return _0x278a3b[_0x4e31('0x1d')](_0x3f8dff)[_0x4e31('0x1e')]();};}function respondWithResult(_0x9d0d2,_0x3f7e56){_0x3f7e56=_0x3f7e56||0xc8;return function(_0x8389a9){if(_0x8389a9){return _0x9d0d2[_0x4e31('0x1d')](_0x3f7e56)['json'](_0x8389a9);}};}function respondWithFilteredResult(_0xee6bb9,_0x2e8651){return function(_0x551b8e){if(_0x551b8e){var _0x23dd30=typeof _0x2e8651[_0x4e31('0x1f')]===_0x4e31('0x20')&&typeof _0x2e8651['limit']===_0x4e31('0x20');var _0x14a367=_0x551b8e[_0x4e31('0x21')];var _0x5cdcba=_0x23dd30?0x0:_0x2e8651[_0x4e31('0x1f')];var _0x4264f7=_0x23dd30?_0x551b8e[_0x4e31('0x21')]:_0x2e8651['offset']+_0x2e8651[_0x4e31('0x22')];var _0x2c36f6;if(_0x4264f7>=_0x14a367){_0x4264f7=_0x14a367;_0x2c36f6=0xc8;}else{_0x2c36f6=0xce;}_0xee6bb9['status'](_0x2c36f6);return _0xee6bb9['set'](_0x4e31('0x23'),_0x5cdcba+'-'+_0x4264f7+'/'+_0x14a367)[_0x4e31('0x24')](_0x551b8e);}return null;};}function patchUpdates(_0x38dd6c){return function(_0x349594){try{jsonpatch[_0x4e31('0x25')](_0x349594,_0x38dd6c,!![]);}catch(_0x1b7968){return BPromise[_0x4e31('0x26')](_0x1b7968);}return _0x349594['save']();};}function saveUpdates(_0x41aaa7,_0x31c5dc){return function(_0x240d19){if(_0x240d19){return _0x240d19['update'](_0x41aaa7)[_0x4e31('0x27')](function(_0xcd5940){return _0xcd5940;});}return null;};}function removeEntity(_0x171a42,_0x3d4255){return function(_0x12efaf){if(_0x12efaf){return _0x12efaf['destroy']()[_0x4e31('0x27')](function(){_0x171a42[_0x4e31('0x1d')](0xcc)[_0x4e31('0x1e')]();});}};}function handleEntityNotFound(_0x53c3e0,_0x1a3435){return function(_0xe7e0f8){if(!_0xe7e0f8){_0x53c3e0[_0x4e31('0x1c')](0x194);}return _0xe7e0f8;};}function handleError(_0x182a4d,_0x20941d){_0x20941d=_0x20941d||0x1f4;return function(_0x1ee99c){logger[_0x4e31('0x28')](_0x1ee99c[_0x4e31('0x29')]);if(_0x1ee99c[_0x4e31('0x2a')]){delete _0x1ee99c[_0x4e31('0x2a')];}_0x182a4d[_0x4e31('0x1d')](_0x20941d)['send'](_0x1ee99c);};}exports[_0x4e31('0x2b')]=function(_0x3b74b0,_0x55cb05){var _0x32d9bf={'raw':!![],'where':{'id':_0x3b74b0['params']['id']}},_0x41d0eb={};_0x41d0eb[_0x4e31('0x2c')]=_['keys'](db[_0x4e31('0x2d')][_0x4e31('0x2e')]);_0x41d0eb['query']=_[_0x4e31('0x2f')](_0x3b74b0[_0x4e31('0x30')]);_0x41d0eb[_0x4e31('0x31')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],_0x41d0eb[_0x4e31('0x30')]);_0x32d9bf[_0x4e31('0x33')]=_[_0x4e31('0x32')](_0x41d0eb[_0x4e31('0x2c')],qs[_0x4e31('0x34')](_0x3b74b0['query'][_0x4e31('0x34')]));_0x32d9bf[_0x4e31('0x33')]=_0x32d9bf['attributes'][_0x4e31('0x35')]?_0x32d9bf[_0x4e31('0x33')]:_0x41d0eb[_0x4e31('0x2c')];if(_0x3b74b0['query'][_0x4e31('0x36')]){_0x32d9bf[_0x4e31('0x37')]=[{'all':!![]}];}_0x32d9bf=_[_0x4e31('0x38')]({},_0x32d9bf,_0x3b74b0[_0x4e31('0x39')]);return db['ChatProactiveAction'][_0x4e31('0x3a')](_0x32d9bf)['then'](handleEntityNotFound(_0x55cb05,null))['then'](respondWithResult(_0x55cb05,null))[_0x4e31('0x3b')](handleError(_0x55cb05,null));};exports[_0x4e31('0x3c')]=function(_0x5c2dcb,_0x4d82cc){return db[_0x4e31('0x2d')][_0x4e31('0x3c')](_0x5c2dcb['body'],{})['then'](respondWithResult(_0x4d82cc,0xc9))[_0x4e31('0x3b')](handleError(_0x4d82cc,null));};exports[_0x4e31('0x3d')]=function(_0x3b2e20,_0x34f11f){if(_0x3b2e20['body']['id']){delete _0x3b2e20[_0x4e31('0x3e')]['id'];}return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x3b2e20['params']['id']}})['then'](handleEntityNotFound(_0x34f11f,null))[_0x4e31('0x27')](saveUpdates(_0x3b2e20[_0x4e31('0x3e')],null))[_0x4e31('0x27')](respondWithResult(_0x34f11f,null))[_0x4e31('0x3b')](handleError(_0x34f11f,null));};exports[_0x4e31('0x3f')]=function(_0x26c684,_0xf9c44b){return db[_0x4e31('0x2d')][_0x4e31('0x3a')]({'where':{'id':_0x26c684[_0x4e31('0x40')]['id']}})[_0x4e31('0x27')](handleEntityNotFound(_0xf9c44b,null))[_0x4e31('0x27')](removeEntity(_0xf9c44b,null))['catch'](handleError(_0xf9c44b,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index d9a65fe..32a53e7 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 _0xa87c=['./chatProactiveAction.attributes','exports','define','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xe78bdf,_0x102a52){var _0x197f88=function(_0x34124a){while(--_0x34124a){_0xe78bdf['push'](_0xe78bdf['shift']());}};_0x197f88(++_0x102a52);}(_0xa87c,0x142));var _0xca87=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0xa87c[_0x54e4ec];return _0x44ef91;};'use strict';var _=require(_0xca87('0x0'));var util=require('util');var logger=require(_0xca87('0x1'))(_0xca87('0x2'));var moment=require(_0xca87('0x3'));var BPromise=require(_0xca87('0x4'));var rp=require(_0xca87('0x5'));var fs=require('fs');var path=require(_0xca87('0x6'));var rimraf=require('rimraf');var config=require(_0xca87('0x7'));var attributes=require(_0xca87('0x8'));module[_0xca87('0x9')]=function(_0x133a81,_0x24bc6b){return _0x133a81[_0xca87('0xa')]('ChatProactiveAction',attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8659=['../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','util'];(function(_0x19c1ca,_0x881113){var _0x5960af=function(_0x3e568f){while(--_0x3e568f){_0x19c1ca['push'](_0x19c1ca['shift']());}};_0x5960af(++_0x881113);}(_0x8659,0x82));var _0x9865=function(_0x82d06e,_0xb52ffa){_0x82d06e=_0x82d06e-0x0;var _0x36de13=_0x8659[_0x82d06e];return _0x36de13;};'use strict';var _=require(_0x9865('0x0'));var util=require(_0x9865('0x1'));var logger=require(_0x9865('0x2'))(_0x9865('0x3'));var moment=require(_0x9865('0x4'));var BPromise=require(_0x9865('0x5'));var rp=require(_0x9865('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9865('0x7'));var attributes=require(_0x9865('0x8'));module[_0x9865('0x9')]=function(_0x492f0a,_0x31f3eb){return _0x492f0a[_0x9865('0xa')](_0x9865('0xb'),attributes,{'tableName':'chat_proactive_actions','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 d691e0b..c6c602d 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 _0xa6f9=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatProactiveAction,\x20%s,\x20%s','result','catch','moment','bluebird','randomstring'];(function(_0x31745c,_0x3b8d6e){var _0xbee8b7=function(_0x53d485){while(--_0x53d485){_0x31745c['push'](_0x31745c['shift']());}};_0xbee8b7(++_0x3b8d6e);}(_0xa6f9,0x165));var _0x9a6f=function(_0xa7dfcd,_0x3ab8bd){_0xa7dfcd=_0xa7dfcd-0x0;var _0x5d8883=_0xa6f9[_0xa7dfcd];return _0x5d8883;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9a6f('0x0'));var BPromise=require(_0x9a6f('0x1'));var rs=require(_0x9a6f('0x2'));var fs=require('fs');var Redis=require(_0x9a6f('0x3'));var db=require(_0x9a6f('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9a6f('0x5'));var config=require(_0x9a6f('0x6'));var jayson=require(_0x9a6f('0x7'));var client=jayson[_0x9a6f('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xa0532e,_0x3373f4,_0x24ea6c){return new BPromise(function(_0x4bc86e,_0x3cd9c2){return client[_0x9a6f('0x9')](_0xa0532e,_0x24ea6c)[_0x9a6f('0xa')](function(_0x13e018){logger[_0x9a6f('0xb')]('ChatProactiveAction,\x20%s,\x20%s',_0x3373f4,_0x9a6f('0xc'));logger['debug'](_0x9a6f('0xd'),_0x3373f4,_0x9a6f('0xc'),JSON[_0x9a6f('0xe')](_0x13e018));if(_0x13e018[_0x9a6f('0xf')]){if(_0x13e018[_0x9a6f('0xf')]['code']===0x1f4){logger[_0x9a6f('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x3373f4,_0x13e018[_0x9a6f('0xf')]['message']);return _0x3cd9c2(_0x13e018[_0x9a6f('0xf')][_0x9a6f('0x10')]);}logger[_0x9a6f('0xf')](_0x9a6f('0x11'),_0x3373f4,_0x13e018[_0x9a6f('0xf')]['message']);return _0x4bc86e(_0x13e018[_0x9a6f('0xf')]['message']);}else{logger[_0x9a6f('0xb')](_0x9a6f('0x11'),_0x3373f4,_0x9a6f('0xc'));_0x4bc86e(_0x13e018[_0x9a6f('0x12')][_0x9a6f('0x10')]);}})[_0x9a6f('0x13')](function(_0x11ab8b){logger[_0x9a6f('0xf')](_0x9a6f('0x11'),_0x3373f4,_0x11ab8b);_0x3cd9c2(_0x11ab8b);});});}
\ No newline at end of file
+var _0xbdf4=['result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','http','request','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x48317e,_0x5e222e){var _0xe34bde=function(_0x2e40f8){while(--_0x2e40f8){_0x48317e['push'](_0x48317e['shift']());}};_0xe34bde(++_0x5e222e);}(_0xbdf4,0xdd));var _0x4bdf=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xbdf4[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x4bdf('0x0'));var util=require(_0x4bdf('0x1'));var moment=require(_0x4bdf('0x2'));var BPromise=require(_0x4bdf('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4bdf('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4bdf('0x5'));var logger=require(_0x4bdf('0x6'))('rpc');var config=require(_0x4bdf('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4bdf('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x474cb7,_0x5ebc78,_0x2d57b7){return new BPromise(function(_0xd1b14f,_0x121d5f){return client[_0x4bdf('0x9')](_0x474cb7,_0x2d57b7)['then'](function(_0x25e6df){logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));logger[_0x4bdf('0xd')](_0x4bdf('0xe'),_0x5ebc78,_0x4bdf('0xc'),JSON[_0x4bdf('0xf')](_0x25e6df));if(_0x25e6df[_0x4bdf('0x10')]){if(_0x25e6df['error'][_0x4bdf('0x11')]===0x1f4){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x25e6df[_0x4bdf('0x10')]['message']);return _0x121d5f(_0x25e6df['error'][_0x4bdf('0x12')]);}logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x5ebc78,_0x25e6df['error'][_0x4bdf('0x12')]);return _0xd1b14f(_0x25e6df['error']['message']);}else{logger[_0x4bdf('0xa')](_0x4bdf('0xb'),_0x5ebc78,_0x4bdf('0xc'));_0xd1b14f(_0x25e6df[_0x4bdf('0x13')][_0x4bdf('0x12')]);}})['catch'](function(_0x2927ec){logger[_0x4bdf('0x10')](_0x4bdf('0xb'),_0x5ebc78,_0x2927ec);_0x121d5f(_0x2927ec);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 92876bf..f03ac7d 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 _0xe14b=['/:id','isAuthenticated','show','post','update','delete','exports','multer','util','express','Router','../../components/auth/service','./chatProactiveAction.controller','get'];(function(_0x228445,_0x4bfa2b){var _0x33d4f8=function(_0x15917e){while(--_0x15917e){_0x228445['push'](_0x228445['shift']());}};_0x33d4f8(++_0x4bfa2b);}(_0xe14b,0x93));var _0xbe14=function(_0x25dc61,_0x19fae8){_0x25dc61=_0x25dc61-0x0;var _0x21e26c=_0xe14b[_0x25dc61];return _0x21e26c;};'use strict';var multer=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe14('0x2'));var router=express[_0xbe14('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xbe14('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xbe14('0x5'));router[_0xbe14('0x6')](_0xbe14('0x7'),auth[_0xbe14('0x8')](),controller[_0xbe14('0x9')]);router[_0xbe14('0xa')]('/',auth[_0xbe14('0x8')](),controller['create']);router['put']('/:id',auth[_0xbe14('0x8')](),controller[_0xbe14('0xb')]);router[_0xbe14('0xc')](_0xbe14('0x7'),auth['isAuthenticated'](),controller['destroy']);module[_0xbe14('0xd')]=router;
\ No newline at end of file
+var _0x032e=['post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show'];(function(_0x1415d3,_0x453d0a){var _0x5df6b2=function(_0x4274da){while(--_0x4274da){_0x1415d3['push'](_0x1415d3['shift']());}};_0x5df6b2(++_0x453d0a);}(_0x032e,0x124));var _0xe032=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0x032e[_0x2763f2];return _0x3ef471;};'use strict';var multer=require(_0xe032('0x0'));var util=require('util');var path=require(_0xe032('0x1'));var timeout=require(_0xe032('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0xe032('0x3'));var auth=require(_0xe032('0x4'));var interaction=require(_0xe032('0x5'));var config=require(_0xe032('0x6'));var controller=require(_0xe032('0x7'));router[_0xe032('0x8')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xb')]);router[_0xe032('0xc')]('/',auth[_0xe032('0xa')](),controller[_0xe032('0xd')]);router[_0xe032('0xe')](_0xe032('0x9'),auth[_0xe032('0xa')](),controller[_0xe032('0xf')]);router[_0xe032('0x10')](_0xe032('0x9'),auth['isAuthenticated'](),controller[_0xe032('0x11')]);module[_0xe032('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index e20dd0b..9a8a765 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 _0xcc21=['INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x53adf1,_0x2e4d6f){var _0x3334b1=function(_0x22b979){while(--_0x22b979){_0x53adf1['push'](_0x53adf1['shift']());}};_0x3334b1(++_0x2e4d6f);}(_0xcc21,0x9e));var _0x1cc2=function(_0x53ec7a,_0x2c1f7e){_0x53ec7a=_0x53ec7a-0x0;var _0x3a1407=_0xcc21[_0x53ec7a];return _0x3a1407;};'use strict';var Sequelize=require(_0x1cc2('0x0'));module[_0x1cc2('0x1')]={'name':{'type':Sequelize[_0x1cc2('0x2')],'unique':_0x1cc2('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x1cc2('0x2')]},'timeout':{'type':Sequelize[_0x1cc2('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x1cc2('0x5')](_0x1cc2('0x6'),_0x1cc2('0x7'),_0x1cc2('0x8'))}};
\ No newline at end of file
+var _0xa08e=['rrmemory','beepall','roundrobin','exports','STRING','name','ENUM'];(function(_0x2a3462,_0x2c8460){var _0x38b619=function(_0x616cab){while(--_0x616cab){_0x2a3462['push'](_0x2a3462['shift']());}};_0x38b619(++_0x2c8460);}(_0xa08e,0x1ca));var _0xea08=function(_0x3f88bc,_0xe38cf5){_0x3f88bc=_0x3f88bc-0x0;var _0x4df1c4=_0xa08e[_0x3f88bc];return _0x4df1c4;};'use strict';var Sequelize=require('sequelize');module[_0xea08('0x0')]={'name':{'type':Sequelize[_0xea08('0x1')],'unique':_0xea08('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xea08('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xea08('0x3')](_0xea08('0x4'),_0xea08('0x5'),_0xea08('0x6'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index 0534663..25ed7f4 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 _0x1829=['isEmpty','removeAgents','addAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','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/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','status','end','json','undefined','limit','offset','count','Content-Range','apply','save','update','destroy','get','ChatQueues','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','filters','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','create','describe','getMembers','UserChatQueue','hasOwnProperty','User','findAndCountAll','chatPause','updatedAt','rows','format','%s/%s','getTeams','findOne','Team','ids','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','tq.TeamId','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','includes','union','value','removeTeams'];(function(_0x15b71c,_0x25708f){var _0x35c8c8=function(_0x36b4d6){while(--_0x36b4d6){_0x15b71c['push'](_0x15b71c['shift']());}};_0x35c8c8(++_0x25708f);}(_0x1829,0x13f));var _0x9182=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x1829[_0x5a9c0c];return _0x53c77d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9182('0x0'));var zipdir=require(_0x9182('0x1'));var jsonpatch=require(_0x9182('0x2'));var rp=require(_0x9182('0x3'));var moment=require(_0x9182('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x9182('0x5'));var util=require('util');var path=require(_0x9182('0x6'));var sox=require(_0x9182('0x7'));var csv=require('to-csv');var ejs=require(_0x9182('0x8'));var fs=require('fs');var fs_extra=require(_0x9182('0x9'));var _=require(_0x9182('0xa'));var squel=require(_0x9182('0xb'));var crypto=require(_0x9182('0xc'));var jsforce=require(_0x9182('0xd'));var deskjs=require(_0x9182('0xe'));var toCsv=require(_0x9182('0xf'));var querystring=require(_0x9182('0x10'));var Papa=require(_0x9182('0x11'));var Redis=require(_0x9182('0x12'));var authService=require(_0x9182('0x13'));var qs=require(_0x9182('0x14'));var as=require(_0x9182('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9182('0x16'))(_0x9182('0x17'));var utils=require(_0x9182('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x9182('0x19'));var db=require(_0x9182('0x1a'))['db'];config[_0x9182('0x1b')]=_[_0x9182('0x1c')](config['redis'],{'host':_0x9182('0x1d'),'port':0x18eb});var socket=require(_0x9182('0x1e'))(new Redis(config['redis']));require(_0x9182('0x1f'))[_0x9182('0x20')](socket);var jayson=require(_0x9182('0x21'));var client=jayson[_0x9182('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35ee31,_0x31c992,_0x341e81,_0x4a94a7){return new BPromise(function(_0x1c594b,_0x4285ad){var _0x19826e=_0x4a94a7||client;return _0x19826e['request'](_0x35ee31,_0x341e81)[_0x9182('0x23')](function(_0x46f1b9){logger['info'](_0x9182('0x24'),_0x31c992,_0x9182('0x25'));logger[_0x9182('0x26')](_0x9182('0x27'),_0x31c992,_0x9182('0x25'),JSON[_0x9182('0x28')](_0x46f1b9));if(_0x46f1b9[_0x9182('0x29')]){if(_0x46f1b9['error'][_0x9182('0x2a')]===0x1f4){logger['error'](_0x9182('0x24'),_0x31c992,_0x46f1b9['error'][_0x9182('0x2b')]);return _0x4285ad(_0x46f1b9[_0x9182('0x29')]['message']);}logger[_0x9182('0x29')](_0x9182('0x24'),_0x31c992,_0x46f1b9['error']['message']);return _0x1c594b(_0x46f1b9[_0x9182('0x29')][_0x9182('0x2b')]);}else{logger[_0x9182('0x2c')](_0x9182('0x24'),_0x31c992,_0x9182('0x25'));_0x1c594b(_0x46f1b9[_0x9182('0x2d')][_0x9182('0x2b')]);}})[_0x9182('0x2e')](function(_0x5e69c7){logger[_0x9182('0x29')](_0x9182('0x24'),_0x31c992,_0x5e69c7);_0x4285ad(_0x5e69c7);});});}function respondWithStatusCode(_0x49c155,_0x50d3b3){_0x50d3b3=_0x50d3b3||0xcc;return function(_0x54239b){if(_0x54239b){return _0x49c155['sendStatus'](_0x50d3b3);}return _0x49c155[_0x9182('0x2f')](_0x50d3b3)[_0x9182('0x30')]();};}function respondWithResult(_0x246d96,_0x188b79){_0x188b79=_0x188b79||0xc8;return function(_0x2a248e){if(_0x2a248e){return _0x246d96['status'](_0x188b79)[_0x9182('0x31')](_0x2a248e);}};}function respondWithFilteredResult(_0x3bb390,_0x420f7f){return function(_0xe2526d){if(_0xe2526d){var _0x3a26d5=typeof _0x420f7f['offset']===_0x9182('0x32')&&typeof _0x420f7f[_0x9182('0x33')]===_0x9182('0x32');var _0x2fe154=_0xe2526d['count'];var _0x125ece=_0x3a26d5?0x0:_0x420f7f[_0x9182('0x34')];var _0x349818=_0x3a26d5?_0xe2526d[_0x9182('0x35')]:_0x420f7f[_0x9182('0x34')]+_0x420f7f[_0x9182('0x33')];var _0x4da502;if(_0x349818>=_0x2fe154){_0x349818=_0x2fe154;_0x4da502=0xc8;}else{_0x4da502=0xce;}_0x3bb390['status'](_0x4da502);return _0x3bb390['set'](_0x9182('0x36'),_0x125ece+'-'+_0x349818+'/'+_0x2fe154)[_0x9182('0x31')](_0xe2526d);}return null;};}function patchUpdates(_0x595d80){return function(_0x494b42){try{jsonpatch[_0x9182('0x37')](_0x494b42,_0x595d80,!![]);}catch(_0x2cca0d){return BPromise['reject'](_0x2cca0d);}return _0x494b42[_0x9182('0x38')]();};}function saveUpdates(_0x2a0e93,_0x3f0d85){return function(_0x260bbc){if(_0x260bbc){return _0x260bbc[_0x9182('0x39')](_0x2a0e93)[_0x9182('0x23')](function(_0x5eb2b6){return _0x5eb2b6;});}return null;};}function removeEntity(_0x19a34a,_0x136a7b){return function(_0x376877){if(_0x376877){return _0x376877[_0x9182('0x3a')]()['then'](function(){var _0x2dadab=_0x376877[_0x9182('0x3b')]({'plain':!![]});var _0x319e2c=_0x9182('0x3c');return db['UserProfileResource'][_0x9182('0x3a')]({'where':{'type':_0x319e2c,'resourceId':_0x2dadab['id']}})[_0x9182('0x23')](function(){return _0x376877;});})[_0x9182('0x23')](function(){_0x19a34a[_0x9182('0x2f')](0xcc)[_0x9182('0x30')]();});}};}function handleEntityNotFound(_0x544c06,_0x13819f){return function(_0x5b304b){if(!_0x5b304b){_0x544c06['sendStatus'](0x194);}return _0x5b304b;};}function handleError(_0x213479,_0x39e1b2){_0x39e1b2=_0x39e1b2||0x1f4;return function(_0x4597ce){logger[_0x9182('0x29')](_0x4597ce[_0x9182('0x3d')]);if(_0x4597ce[_0x9182('0x3e')]){delete _0x4597ce['name'];}_0x213479[_0x9182('0x2f')](_0x39e1b2)[_0x9182('0x3f')](_0x4597ce);};}exports[_0x9182('0x40')]=function(_0x1f8b51,_0x1afa43){var _0x215bde={},_0x39e62b={},_0x16d516={'count':0x0,'rows':[]};var _0x31f355=_[_0x9182('0x41')](db[_0x9182('0x42')][_0x9182('0x43')],function(_0x530a3f){return{'name':_0x530a3f[_0x9182('0x44')],'type':_0x530a3f[_0x9182('0x45')]['key']};});_0x39e62b[_0x9182('0x46')]=_[_0x9182('0x41')](_0x31f355,'name');_0x39e62b[_0x9182('0x47')]=_[_0x9182('0x48')](_0x1f8b51[_0x9182('0x47')]);_0x39e62b['filters']=_[_0x9182('0x49')](_0x39e62b[_0x9182('0x46')],_0x39e62b['query']);_0x215bde[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x39e62b[_0x9182('0x46')],qs['fields'](_0x1f8b51[_0x9182('0x47')][_0x9182('0x4b')]));_0x215bde[_0x9182('0x4a')]=_0x215bde[_0x9182('0x4a')][_0x9182('0x4c')]?_0x215bde[_0x9182('0x4a')]:_0x39e62b[_0x9182('0x46')];if(!_0x1f8b51['query']['hasOwnProperty'](_0x9182('0x4d'))){_0x215bde[_0x9182('0x33')]=qs['limit'](_0x1f8b51['query']['limit']);_0x215bde[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x1f8b51[_0x9182('0x47')][_0x9182('0x34')]);}_0x215bde[_0x9182('0x4e')]=qs['sort'](_0x1f8b51[_0x9182('0x47')][_0x9182('0x4f')]);_0x215bde[_0x9182('0x50')]=qs['filters'](_[_0x9182('0x51')](_0x1f8b51[_0x9182('0x47')],_0x39e62b['filters']),_0x31f355);if(_0x1f8b51[_0x9182('0x47')][_0x9182('0x52')]){_0x215bde[_0x9182('0x50')]=_[_0x9182('0x53')](_0x215bde['where'],{'$or':_[_0x9182('0x41')](_0x31f355,function(_0x274d20){if(_0x274d20[_0x9182('0x45')]!==_0x9182('0x54')){var _0x19a129={};_0x19a129[_0x274d20[_0x9182('0x3e')]]={'$like':'%'+_0x1f8b51[_0x9182('0x47')]['filter']+'%'};return _0x19a129;}})});}_0x215bde=_['merge']({},_0x215bde,_0x1f8b51[_0x9182('0x55')]);var _0x210669={'where':_0x215bde[_0x9182('0x50')]};return db[_0x9182('0x42')][_0x9182('0x35')](_0x210669)[_0x9182('0x23')](function(_0x52544c){_0x16d516[_0x9182('0x35')]=_0x52544c;if(_0x1f8b51['query'][_0x9182('0x56')]){_0x215bde[_0x9182('0x57')]=[{'all':!![]}];}return db[_0x9182('0x42')][_0x9182('0x58')](_0x215bde);})[_0x9182('0x23')](function(_0x22d8c2){_0x16d516['rows']=_0x22d8c2;return _0x16d516;})[_0x9182('0x23')](respondWithFilteredResult(_0x1afa43,_0x215bde))['catch'](handleError(_0x1afa43,null));};exports[_0x9182('0x59')]=function(_0xfb6767,_0x24ef1c){var _0x1d19ff={'raw':!![],'where':{'id':_0xfb6767[_0x9182('0x5a')]['id']}},_0x3f58e3={};_0x3f58e3['model']=_[_0x9182('0x48')](db[_0x9182('0x42')]['rawAttributes']);_0x3f58e3[_0x9182('0x47')]=_[_0x9182('0x48')](_0xfb6767['query']);_0x3f58e3[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x3f58e3[_0x9182('0x46')],_0x3f58e3['query']);_0x1d19ff[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x3f58e3[_0x9182('0x46')],qs[_0x9182('0x4b')](_0xfb6767[_0x9182('0x47')][_0x9182('0x4b')]));_0x1d19ff[_0x9182('0x4a')]=_0x1d19ff[_0x9182('0x4a')][_0x9182('0x4c')]?_0x1d19ff[_0x9182('0x4a')]:_0x3f58e3[_0x9182('0x46')];if(_0xfb6767[_0x9182('0x47')][_0x9182('0x56')]){_0x1d19ff['include']=[{'all':!![]}];}_0x1d19ff=_[_0x9182('0x53')]({},_0x1d19ff,_0xfb6767['options']);return db[_0x9182('0x42')][_0x9182('0x5c')](_0x1d19ff)[_0x9182('0x23')](handleEntityNotFound(_0x24ef1c,null))[_0x9182('0x23')](respondWithResult(_0x24ef1c,null))[_0x9182('0x2e')](handleError(_0x24ef1c,null));};exports['create']=function(_0x1491c4,_0x5713bc){return db[_0x9182('0x42')]['create'](_0x1491c4[_0x9182('0x5d')],{})[_0x9182('0x23')](function(_0x4f22aa){var _0x5ae6f5=_0x1491c4[_0x9182('0x5e')]['get']({'plain':!![]});if(!_0x5ae6f5)throw new Error(_0x9182('0x5f'));if(_0x5ae6f5[_0x9182('0x60')]===_0x9182('0x5e')){var _0x3e986e=_0x4f22aa[_0x9182('0x3b')]({'plain':!![]});var _0x5436a1=_0x9182('0x3c');return db['UserProfileSection'][_0x9182('0x5c')]({'where':{'name':_0x5436a1,'userProfileId':_0x5ae6f5[_0x9182('0x61')]},'raw':!![]})['then'](function(_0x262d30){if(_0x262d30&&_0x262d30[_0x9182('0x62')]===0x0){return db['UserProfileResource'][_0x9182('0x63')]({'name':_0x3e986e['name'],'resourceId':_0x3e986e['id'],'type':_0x262d30[_0x9182('0x3e')],'sectionId':_0x262d30['id']},{})[_0x9182('0x23')](function(){return _0x4f22aa;});}else{return _0x4f22aa;}})['catch'](function(_0x114dc6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x114dc6);throw _0x114dc6;});}return _0x4f22aa;})['then'](respondWithResult(_0x5713bc,0xc9))[_0x9182('0x2e')](handleError(_0x5713bc,null));};exports[_0x9182('0x39')]=function(_0x3b1edb,_0x3a541a){if(_0x3b1edb[_0x9182('0x5d')]['id']){delete _0x3b1edb['body']['id'];}return db[_0x9182('0x42')]['find']({'where':{'id':_0x3b1edb[_0x9182('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3a541a,null))['then'](saveUpdates(_0x3b1edb[_0x9182('0x5d')],null))[_0x9182('0x23')](respondWithResult(_0x3a541a,null))[_0x9182('0x2e')](handleError(_0x3a541a,null));};exports[_0x9182('0x3a')]=function(_0xc6d0f7,_0xd5da66){return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0xc6d0f7[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0xd5da66,null))['then'](removeEntity(_0xd5da66,null))[_0x9182('0x2e')](handleError(_0xd5da66,null));};exports[_0x9182('0x64')]=function(_0x48542e,_0xbe7169){return db['ChatQueue'][_0x9182('0x64')]()[_0x9182('0x23')](respondWithResult(_0xbe7169,null))[_0x9182('0x2e')](handleError(_0xbe7169,null));};exports[_0x9182('0x65')]=function(_0x4a03f9,_0x23acbc,_0x11c02f){var _0x5b8113={'raw':!![],'where':{}},_0x5743fa={},_0x556650;return db['ChatQueue']['findOne']({'where':{'id':_0x4a03f9['params']['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x23acbc,null))[_0x9182('0x23')](function(_0x4c9356){if(_0x4c9356){_0x556650=_0x4c9356[_0x9182('0x3b')]({'plain':!![]});_0x5743fa[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x66')][_0x9182('0x43')]);_0x5743fa[_0x9182('0x47')]=_[_0x9182('0x48')](_0x4a03f9[_0x9182('0x47')]);_0x5743fa[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x5743fa[_0x9182('0x46')],_0x5743fa[_0x9182('0x47')]);_0x5b8113[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x5743fa[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x4a03f9[_0x9182('0x47')][_0x9182('0x4b')]));_0x5b8113[_0x9182('0x4a')]=_0x5b8113[_0x9182('0x4a')][_0x9182('0x4c')]?_0x5b8113[_0x9182('0x4a')]:_0x5743fa[_0x9182('0x46')];if(!_0x4a03f9[_0x9182('0x47')][_0x9182('0x67')]('nolimit')){_0x5b8113['limit']=qs[_0x9182('0x33')](_0x4a03f9['query'][_0x9182('0x33')]);_0x5b8113[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x4a03f9[_0x9182('0x47')][_0x9182('0x34')]);}_0x5b8113[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x4a03f9[_0x9182('0x47')]['sort']);_0x5b8113[_0x9182('0x50')]=qs['filters'](_['pick'](_0x4a03f9[_0x9182('0x47')],_0x5743fa[_0x9182('0x5b')]));_0x5b8113['where']['ChatQueueId']=_0x4c9356['id'];if(_0x4a03f9[_0x9182('0x47')][_0x9182('0x52')]){_0x5b8113[_0x9182('0x50')]=_['merge'](_0x5b8113['where'],{'$or':_['map'](_0x5b8113['attributes'],function(_0x20d90e){var _0x980b2a={};_0x980b2a[_0x20d90e]={'$like':'%'+_0x4a03f9[_0x9182('0x47')][_0x9182('0x52')]+'%'};return _0x980b2a;})});}_0x5b8113=_[_0x9182('0x53')]({},_0x5b8113,_0x4a03f9[_0x9182('0x55')]);return db[_0x9182('0x66')]['findAll'](_0x5b8113);}})['then'](function(_0x2b2ed1){if(_0x2b2ed1){return db[_0x9182('0x68')][_0x9182('0x69')]({'where':{'id':_[_0x9182('0x41')](_0x2b2ed1,'UserId'),'role':'agent'},'attributes':['id',_0x9182('0x3e'),_0x9182('0x6a'),_0x9182('0x6b'),'createdAt']});}})[_0x9182('0x23')](function(_0x49e9b2){if(_0x49e9b2){return{'count':_0x49e9b2[_0x9182('0x35')],'rows':_[_0x9182('0x41')](_0x49e9b2[_0x9182('0x6c')],function(_0xfa8afe){return{'membername':_0xfa8afe[_0x9182('0x3e')],'UserId':_0xfa8afe['id'],'queue_name':_0x556650[_0x9182('0x3e')],'ChatQueueId':_0x556650['id'],'interface':util[_0x9182('0x6d')](_0x9182('0x6e'),'SIP',_0xfa8afe[_0x9182('0x3e')]),'penalty':0x0,'paused':_0xfa8afe[_0x9182('0x6a')],'createdAt':_0xfa8afe['createdAt'],'updatedAt':_0xfa8afe[_0x9182('0x6b')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x23acbc,_0x5b8113))['catch'](handleError(_0x23acbc,null));};exports[_0x9182('0x6f')]=function(_0x2a1109,_0x20e18b,_0x547991){var _0x36e5da={};var _0x115e11={};var _0x474310;var _0x48b069;return db[_0x9182('0x42')][_0x9182('0x70')]({'where':{'id':_0x2a1109[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x20e18b,null))[_0x9182('0x23')](function(_0x489c87){if(_0x489c87){_0x474310=_0x489c87;_0x115e11[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x71')][_0x9182('0x43')]);_0x115e11[_0x9182('0x47')]=_['keys'](_0x2a1109[_0x9182('0x47')]);_0x115e11[_0x9182('0x5b')]=_['intersection'](_0x115e11[_0x9182('0x46')],_0x115e11[_0x9182('0x47')]);_0x36e5da[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x115e11[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x2a1109[_0x9182('0x47')][_0x9182('0x4b')]));_0x36e5da[_0x9182('0x4a')]=_0x36e5da[_0x9182('0x4a')][_0x9182('0x4c')]?_0x36e5da['attributes']:_0x115e11['model'];_0x36e5da[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x2a1109[_0x9182('0x47')]['sort']);_0x36e5da[_0x9182('0x50')]=qs['filters'](_['pick'](_0x2a1109[_0x9182('0x47')],_0x115e11[_0x9182('0x5b')]));if(_0x2a1109['query'][_0x9182('0x52')]){_0x36e5da[_0x9182('0x50')]=_[_0x9182('0x53')](_0x36e5da['where'],{'$or':_[_0x9182('0x41')](_0x36e5da[_0x9182('0x4a')],function(_0x42fd91){var _0x490844={};_0x490844[_0x42fd91]={'$like':'%'+_0x2a1109['query'][_0x9182('0x52')]+'%'};return _0x490844;})});}_0x36e5da=_[_0x9182('0x53')]({},_0x36e5da,_0x2a1109[_0x9182('0x55')]);return _0x474310['getTeams'](_0x36e5da);}})['then'](function(_0x3e0df4){if(_0x3e0df4){_0x48b069=_0x3e0df4[_0x9182('0x4c')];if(!_0x2a1109[_0x9182('0x47')][_0x9182('0x67')](_0x9182('0x4d'))){_0x36e5da[_0x9182('0x33')]=qs[_0x9182('0x33')](_0x2a1109['query'][_0x9182('0x33')]);_0x36e5da['offset']=qs['offset'](_0x2a1109[_0x9182('0x47')]['offset']);}return _0x474310[_0x9182('0x6f')](_0x36e5da);}})[_0x9182('0x23')](function(_0x30904c){if(_0x30904c){return _0x30904c?{'count':_0x48b069,'rows':_0x30904c}:null;}})['then'](respondWithResult(_0x20e18b,null))[_0x9182('0x2e')](handleError(_0x20e18b,null));};exports['addTeams']=function(_0x56e9df,_0x167a43,_0xec9a46){var _0x4d71a5=_0x56e9df[_0x9182('0x5d')][_0x9182('0x72')];return db[_0x9182('0x71')][_0x9182('0x58')]({'where':{'id':_0x4d71a5},'attributes':['id'],'include':[{'model':db[_0x9182('0x68')],'as':_0x9182('0x73'),'attributes':['id',_0x9182('0x3e'),_0x9182('0x74'),_0x9182('0x75'),_0x9182('0x76')],'raw':!![]}]})[_0x9182('0x23')](function(_0x4b29b3){if(_0x4b29b3){var _0x1e3be4=_['flatMap'](_0x4b29b3,function(_0x4399d2){var _0x3c8be3=_0x4399d2['get']({'plain':!![]});return _0x3c8be3[_0x9182('0x73')];});return db['ChatQueue'][_0x9182('0x5c')]({'where':{'id':_0x56e9df[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](function(_0x5a4dc1){return db[_0x9182('0x77')][_0x9182('0x78')](function(_0x1ce743){return _0x5a4dc1[_0x9182('0x79')](_0x4d71a5,{'transaction':_0x1ce743})[_0x9182('0x23')](function(){return BPromise[_0x9182('0x7a')](_0x1e3be4,function(_0x2f3790){return db[_0x9182('0x66')][_0x9182('0x7b')]({'where':{'UserId':_0x2f3790['id'],'ChatQueueId':_0x56e9df['params']['id']},'transaction':_0x1ce743});});})[_0x9182('0x23')](function(){_0x1e3be4[_0x9182('0x7c')](function(_0x21bb68){socket[_0x9182('0x7d')]('userChatQueue:save',{'UserId':_0x21bb68['id'],'ChatQueueId':_0x5a4dc1['id']});});});});});}})[_0x9182('0x23')](respondWithStatusCode(_0x167a43,null))['catch'](handleError(_0x167a43,null));};exports['removeTeams']=function(_0x4f38e1,_0x17c227,_0x4719ba){return db[_0x9182('0x71')][_0x9182('0x58')]({'where':{'id':_0x4f38e1[_0x9182('0x47')][_0x9182('0x72')]},'attributes':['id'],'include':[{'model':db[_0x9182('0x68')],'as':_0x9182('0x73'),'attributes':['id'],'raw':!![]}]})[_0x9182('0x23')](handleEntityNotFound(_0x17c227,null))[_0x9182('0x23')](function(_0x2edb4b){var _0x117d0e=_[_0x9182('0x41')](_0x2edb4b,'id');var _0x339b9f=[];var _0x18fd24=[];var _0x166cff=squel[_0x9182('0x7e')]();_0x166cff[_0x9182('0x7f')](_0x9182('0x80'))['from'](_0x9182('0x81'),'tq')[_0x9182('0x82')](_0x9182('0x83'),'ut',_0x9182('0x84'))[_0x9182('0x50')](_0x9182('0x85'),_0x4f38e1['params']['id']);for(var _0x480bed=0x0;_0x480bed<_0x2edb4b['length'];_0x480bed+=0x1){let _0x14c897=_0x2edb4b[_0x480bed];for(var _0x45c857=0x0;_0x45c857<_0x14c897[_0x9182('0x73')][_0x9182('0x4c')];_0x45c857+=0x1){let _0x348f79=_0x14c897[_0x9182('0x73')][_0x45c857];var _0x17a3b7=_0x166cff[_0x9182('0x86')]();_0x17a3b7['where'](_0x9182('0x87'),_0x348f79['id']);_0x18fd24[_0x9182('0x88')](db[_0x9182('0x77')][_0x9182('0x47')](_0x17a3b7[_0x9182('0x89')](),{'type':db['sequelize'][_0x9182('0x8a')][_0x9182('0x8b')]})['then'](function(_0x203021){if(_0x203021[_0x9182('0x4c')]===0x1){return _0x348f79['id'];}else{var _0x374f85=_[_0x9182('0x8c')](_[_0x9182('0x41')](_0x203021,_0x9182('0x8d')),function(_0x360bcf){return _[_0x9182('0x8e')](_0x117d0e,_0x360bcf);});if(_0x374f85){return _0x348f79['id'];}}}));}}return BPromise['all'](_0x18fd24)['then'](function(_0x483fb4){_0x339b9f=_(_0x339b9f)[_0x9182('0x8f')](_0x483fb4)['compact']()[_0x9182('0x90')]();return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0x4f38e1[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](function(_0x41396d){return db['sequelize'][_0x9182('0x78')](function(_0x311daa){return _0x41396d[_0x9182('0x91')](_0x4f38e1['query'][_0x9182('0x72')],{'transaction':_0x311daa})['then'](function(){if(!_[_0x9182('0x92')](_0x339b9f)){return _0x41396d[_0x9182('0x93')](_0x339b9f,{'transaction':_0x311daa});}})[_0x9182('0x23')](function(){_0x339b9f[_0x9182('0x7c')](function(_0x19c652){socket[_0x9182('0x7d')]('userChatQueue:remove',{'UserId':_0x19c652,'ChatQueueId':_0x41396d['id']});});});});});});})[_0x9182('0x23')](respondWithStatusCode(_0x17c227,null))[_0x9182('0x2e')](handleError(_0x17c227,null));};exports['addAgents']=function(_0xad24d9,_0x1bf5c6,_0x307e10){return db[_0x9182('0x42')][_0x9182('0x5c')]({'where':{'id':_0xad24d9[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x1bf5c6,null))[_0x9182('0x23')](function(_0xd2386c){if(_0xd2386c){return _0xd2386c[_0x9182('0x94')](_0xad24d9['body'][_0x9182('0x72')],_[_0x9182('0x95')](_0xad24d9['body'],[_0x9182('0x72'),'id'])||{})[_0x9182('0x96')](function(_0x361aee){for(var _0x264a73=0x0;_0x264a73<_0xad24d9['body'][_0x9182('0x72')]['length'];_0x264a73+=0x1){socket[_0x9182('0x7d')](_0x9182('0x97'),{'UserId':Number(_0xad24d9['body']['ids'][_0x264a73]),'ChatQueueId':Number(_0xad24d9[_0x9182('0x5a')]['id'])});}return _0x361aee;});}})[_0x9182('0x23')](respondWithResult(_0x1bf5c6,null))['catch'](handleError(_0x1bf5c6,null));};exports[_0x9182('0x93')]=function(_0x1b1c27,_0x33a389,_0x3c7087){return db['ChatQueue'][_0x9182('0x5c')]({'where':{'id':_0x1b1c27['params']['id']}})['then'](handleEntityNotFound(_0x33a389,null))[_0x9182('0x23')](function(_0x4f7b9e){if(_0x4f7b9e){return _0x4f7b9e[_0x9182('0x93')](_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')])[_0x9182('0x23')](function(){if(_[_0x9182('0x98')](_0x1b1c27['query'][_0x9182('0x72')])){for(var _0x2308e8=0x0;_0x2308e8<_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')][_0x9182('0x4c')];_0x2308e8+=0x1){socket[_0x9182('0x7d')](_0x9182('0x99'),{'UserId':Number(_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')][_0x2308e8]),'ChatQueueId':Number(_0x1b1c27[_0x9182('0x5a')]['id'])});}}else{socket[_0x9182('0x7d')](_0x9182('0x99'),{'UserId':Number(_0x1b1c27[_0x9182('0x47')][_0x9182('0x72')]),'ChatQueueId':Number(_0x1b1c27[_0x9182('0x5a')]['id'])});}});}})[_0x9182('0x23')](respondWithStatusCode(_0x33a389,null))[_0x9182('0x2e')](handleError(_0x33a389,null));};exports['getAgents']=function(_0x383f82,_0x2cb8bf,_0x5abc68){var _0x15002d={};var _0x48ab18={};var _0x4c70f6;var _0x5e662c;return db[_0x9182('0x42')][_0x9182('0x70')]({'where':{'id':_0x383f82[_0x9182('0x5a')]['id']}})[_0x9182('0x23')](handleEntityNotFound(_0x2cb8bf,null))[_0x9182('0x23')](function(_0x95dbab){if(_0x95dbab){_0x4c70f6=_0x95dbab;_0x48ab18[_0x9182('0x46')]=_[_0x9182('0x48')](db[_0x9182('0x68')][_0x9182('0x43')]);_0x48ab18[_0x9182('0x47')]=_['keys'](_0x383f82[_0x9182('0x47')]);_0x48ab18[_0x9182('0x5b')]=_[_0x9182('0x49')](_0x48ab18['model'],_0x48ab18[_0x9182('0x47')]);_0x15002d[_0x9182('0x4a')]=_[_0x9182('0x49')](_0x48ab18[_0x9182('0x46')],qs[_0x9182('0x4b')](_0x383f82[_0x9182('0x47')][_0x9182('0x4b')]));_0x15002d[_0x9182('0x4a')]=_0x15002d[_0x9182('0x4a')][_0x9182('0x4c')]?_0x15002d[_0x9182('0x4a')]:_0x48ab18['model'];_0x15002d[_0x9182('0x4e')]=qs[_0x9182('0x4f')](_0x383f82[_0x9182('0x47')]['sort']);_0x15002d[_0x9182('0x50')]=qs['filters'](_[_0x9182('0x51')](_0x383f82[_0x9182('0x47')],_0x48ab18[_0x9182('0x5b')]));if(_0x383f82['query'][_0x9182('0x52')]){_0x15002d[_0x9182('0x50')]=_[_0x9182('0x53')](_0x15002d['where'],{'$or':_[_0x9182('0x41')](_0x15002d[_0x9182('0x4a')],function(_0x18de17){var _0x589562={};_0x589562[_0x18de17]={'$like':'%'+_0x383f82[_0x9182('0x47')][_0x9182('0x52')]+'%'};return _0x589562;})});}_0x15002d=_['merge']({},_0x15002d,_0x383f82['options']);return _0x4c70f6[_0x9182('0x9a')](_0x15002d);}})['then'](function(_0x41ce54){if(_0x41ce54){_0x5e662c=_0x41ce54[_0x9182('0x4c')];if(!_0x383f82[_0x9182('0x47')][_0x9182('0x67')](_0x9182('0x4d'))){_0x15002d[_0x9182('0x33')]=qs[_0x9182('0x33')](_0x383f82[_0x9182('0x47')][_0x9182('0x33')]);_0x15002d[_0x9182('0x34')]=qs[_0x9182('0x34')](_0x383f82[_0x9182('0x47')][_0x9182('0x34')]);}return _0x4c70f6[_0x9182('0x9a')](_0x15002d);}})[_0x9182('0x23')](function(_0xcb1530){if(_0xcb1530){return _0xcb1530?{'count':_0x5e662c,'rows':_0xcb1530}:null;}})[_0x9182('0x23')](respondWithResult(_0x2cb8bf,null))[_0x9182('0x2e')](handleError(_0x2cb8bf,null));};
\ No newline at end of file
+var _0x35f3=['getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','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','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','client','request','then','info','request\x20sent','stringify','error','message','ChatQueue,\x20%s,\x20%s','catch','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','update','destroy','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','ChatQueue','includeAll','include','findAll','rows','params','rawAttributes','options','create','body','user','get','role','ChatQueues','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','describe','findOne','ChatQueueId','findAndCountAll','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','SELECT','every','union','compact','value','transaction','isEmpty','removeAgents','addAgents','omit','spread','isArray','userChatQueue:remove'];(function(_0x614c88,_0x184f02){var _0x1a768e=function(_0x4f204f){while(--_0x4f204f){_0x614c88['push'](_0x614c88['shift']());}};_0x1a768e(++_0x184f02);}(_0x35f3,0x98));var _0x335f=function(_0xbd4a35,_0x3eec3b){_0xbd4a35=_0xbd4a35-0x0;var _0x1da054=_0x35f3[_0xbd4a35];return _0x1da054;};'use strict';var emlformat=require(_0x335f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x335f('0x1'));var jsonpatch=require(_0x335f('0x2'));var rp=require(_0x335f('0x3'));var moment=require('moment');var BPromise=require(_0x335f('0x4'));var Mustache=require(_0x335f('0x5'));var util=require(_0x335f('0x6'));var path=require(_0x335f('0x7'));var sox=require(_0x335f('0x8'));var csv=require(_0x335f('0x9'));var ejs=require(_0x335f('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x335f('0xb'));var squel=require(_0x335f('0xc'));var crypto=require('crypto');var jsforce=require(_0x335f('0xd'));var deskjs=require(_0x335f('0xe'));var toCsv=require(_0x335f('0x9'));var querystring=require(_0x335f('0xf'));var Papa=require(_0x335f('0x10'));var Redis=require(_0x335f('0x11'));var authService=require(_0x335f('0x12'));var qs=require(_0x335f('0x13'));var as=require(_0x335f('0x14'));var hardwareService=require(_0x335f('0x15'));var logger=require(_0x335f('0x16'))('api');var utils=require(_0x335f('0x17'));var config=require(_0x335f('0x18'));var licenseUtil=require(_0x335f('0x19'));var db=require(_0x335f('0x1a'))['db'];config[_0x335f('0x1b')]=_[_0x335f('0x1c')](config[_0x335f('0x1b')],{'host':_0x335f('0x1d'),'port':0x18eb});var socket=require(_0x335f('0x1e'))(new Redis(config[_0x335f('0x1b')]));require(_0x335f('0x1f'))[_0x335f('0x20')](socket);var jayson=require(_0x335f('0x21'));var client=jayson[_0x335f('0x22')]['http']({'port':0x232a});function respondWithRpcPromise(_0x32ef1e,_0x27b886,_0x478a97,_0x288be2){return new BPromise(function(_0x5e3d8d,_0x2070c0){var _0x206630=_0x288be2||client;return _0x206630[_0x335f('0x23')](_0x32ef1e,_0x478a97)[_0x335f('0x24')](function(_0x41c6d2){logger[_0x335f('0x25')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x27b886,_0x335f('0x26'),JSON[_0x335f('0x27')](_0x41c6d2));if(_0x41c6d2['error']){if(_0x41c6d2['error']['code']===0x1f4){logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')]['message']);return _0x2070c0(_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);}logger[_0x335f('0x28')]('ChatQueue,\x20%s,\x20%s',_0x27b886,_0x41c6d2[_0x335f('0x28')][_0x335f('0x29')]);return _0x5e3d8d(_0x41c6d2['error']['message']);}else{logger[_0x335f('0x25')](_0x335f('0x2a'),_0x27b886,_0x335f('0x26'));_0x5e3d8d(_0x41c6d2['result'][_0x335f('0x29')]);}})[_0x335f('0x2b')](function(_0x1286a8){logger[_0x335f('0x28')](_0x335f('0x2a'),_0x27b886,_0x1286a8);_0x2070c0(_0x1286a8);});});}function respondWithStatusCode(_0x55787a,_0x583917){_0x583917=_0x583917||0xcc;return function(_0x178322){if(_0x178322){return _0x55787a[_0x335f('0x2c')](_0x583917);}return _0x55787a[_0x335f('0x2d')](_0x583917)[_0x335f('0x2e')]();};}function respondWithResult(_0x53fd7d,_0x2c92ec){_0x2c92ec=_0x2c92ec||0xc8;return function(_0x5c205b){if(_0x5c205b){return _0x53fd7d[_0x335f('0x2d')](_0x2c92ec)['json'](_0x5c205b);}};}function respondWithFilteredResult(_0x1d09a5,_0x4d7832){return function(_0x5d5bcf){if(_0x5d5bcf){var _0x497658=typeof _0x4d7832[_0x335f('0x2f')]===_0x335f('0x30')&&typeof _0x4d7832[_0x335f('0x31')]===_0x335f('0x30');var _0x1c55ee=_0x5d5bcf[_0x335f('0x32')];var _0x1b528b=_0x497658?0x0:_0x4d7832[_0x335f('0x2f')];var _0x57689c=_0x497658?_0x5d5bcf[_0x335f('0x32')]:_0x4d7832[_0x335f('0x2f')]+_0x4d7832[_0x335f('0x31')];var _0x429c6;if(_0x57689c>=_0x1c55ee){_0x57689c=_0x1c55ee;_0x429c6=0xc8;}else{_0x429c6=0xce;}_0x1d09a5[_0x335f('0x2d')](_0x429c6);return _0x1d09a5['set'](_0x335f('0x33'),_0x1b528b+'-'+_0x57689c+'/'+_0x1c55ee)[_0x335f('0x34')](_0x5d5bcf);}return null;};}function patchUpdates(_0x8b6651){return function(_0x50ffb2){try{jsonpatch[_0x335f('0x35')](_0x50ffb2,_0x8b6651,!![]);}catch(_0x1235a3){return BPromise[_0x335f('0x36')](_0x1235a3);}return _0x50ffb2['save']();};}function saveUpdates(_0x238975,_0xf01acf){return function(_0x3a094d){if(_0x3a094d){return _0x3a094d[_0x335f('0x37')](_0x238975)[_0x335f('0x24')](function(_0x30bcb8){return _0x30bcb8;});}return null;};}function removeEntity(_0x535df2,_0x5b28f0){return function(_0x287271){if(_0x287271){return _0x287271['destroy']()['then'](function(){var _0x24666d=_0x287271['get']({'plain':!![]});var _0x59ed5a='ChatQueues';return db['UserProfileResource'][_0x335f('0x38')]({'where':{'type':_0x59ed5a,'resourceId':_0x24666d['id']}})['then'](function(){return _0x287271;});})['then'](function(){_0x535df2[_0x335f('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2f9b6a,_0x52e448){return function(_0x4278ec){if(!_0x4278ec){_0x2f9b6a[_0x335f('0x2c')](0x194);}return _0x4278ec;};}function handleError(_0x1aa4c5,_0x3d1f22){_0x3d1f22=_0x3d1f22||0x1f4;return function(_0x101ab2){logger[_0x335f('0x28')](_0x101ab2['stack']);if(_0x101ab2[_0x335f('0x39')]){delete _0x101ab2['name'];}_0x1aa4c5['status'](_0x3d1f22)[_0x335f('0x3a')](_0x101ab2);};}exports[_0x335f('0x3b')]=function(_0x221f9e,_0x14f0b7){var _0x221dc1={},_0xbe0bd9={},_0x517662={'count':0x0,'rows':[]};var _0x189b91=_['map'](db['ChatQueue']['rawAttributes'],function(_0x4f96af){return{'name':_0x4f96af[_0x335f('0x3c')],'type':_0x4f96af[_0x335f('0x3d')][_0x335f('0x3e')]};});_0xbe0bd9[_0x335f('0x3f')]=_[_0x335f('0x40')](_0x189b91,_0x335f('0x39'));_0xbe0bd9[_0x335f('0x41')]=_[_0x335f('0x42')](_0x221f9e[_0x335f('0x41')]);_0xbe0bd9[_0x335f('0x43')]=_[_0x335f('0x44')](_0xbe0bd9['model'],_0xbe0bd9[_0x335f('0x41')]);_0x221dc1['attributes']=_[_0x335f('0x44')](_0xbe0bd9['model'],qs['fields'](_0x221f9e[_0x335f('0x41')][_0x335f('0x45')]));_0x221dc1[_0x335f('0x46')]=_0x221dc1[_0x335f('0x46')][_0x335f('0x47')]?_0x221dc1['attributes']:_0xbe0bd9[_0x335f('0x3f')];if(!_0x221f9e['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x221dc1[_0x335f('0x31')]=qs[_0x335f('0x31')](_0x221f9e[_0x335f('0x41')][_0x335f('0x31')]);_0x221dc1[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x221f9e[_0x335f('0x41')][_0x335f('0x2f')]);}_0x221dc1[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x221f9e[_0x335f('0x41')][_0x335f('0x4b')]);_0x221dc1['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x221f9e['query'],_0xbe0bd9[_0x335f('0x43')]),_0x189b91);if(_0x221f9e['query'][_0x335f('0x4d')]){_0x221dc1['where']=_[_0x335f('0x4e')](_0x221dc1[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x189b91,function(_0x1540d2){if(_0x1540d2[_0x335f('0x3d')]!=='VIRTUAL'){var _0x2c14bf={};_0x2c14bf[_0x1540d2[_0x335f('0x39')]]={'$like':'%'+_0x221f9e[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x2c14bf;}})});}_0x221dc1=_[_0x335f('0x4e')]({},_0x221dc1,_0x221f9e['options']);var _0x1dbe27={'where':_0x221dc1[_0x335f('0x4f')]};return db[_0x335f('0x50')][_0x335f('0x32')](_0x1dbe27)[_0x335f('0x24')](function(_0x5d66d5){_0x517662[_0x335f('0x32')]=_0x5d66d5;if(_0x221f9e[_0x335f('0x41')][_0x335f('0x51')]){_0x221dc1[_0x335f('0x52')]=[{'all':!![]}];}return db[_0x335f('0x50')][_0x335f('0x53')](_0x221dc1);})[_0x335f('0x24')](function(_0x5c5228){_0x517662[_0x335f('0x54')]=_0x5c5228;return _0x517662;})[_0x335f('0x24')](respondWithFilteredResult(_0x14f0b7,_0x221dc1))['catch'](handleError(_0x14f0b7,null));};exports['show']=function(_0x1ab2e4,_0x4c0198){var _0xd654cf={'raw':!![],'where':{'id':_0x1ab2e4[_0x335f('0x55')]['id']}},_0x54c57a={};_0x54c57a[_0x335f('0x3f')]=_[_0x335f('0x42')](db['ChatQueue'][_0x335f('0x56')]);_0x54c57a['query']=_[_0x335f('0x42')](_0x1ab2e4[_0x335f('0x41')]);_0x54c57a[_0x335f('0x43')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],_0x54c57a['query']);_0xd654cf[_0x335f('0x46')]=_[_0x335f('0x44')](_0x54c57a[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x1ab2e4['query'][_0x335f('0x45')]));_0xd654cf[_0x335f('0x46')]=_0xd654cf[_0x335f('0x46')][_0x335f('0x47')]?_0xd654cf[_0x335f('0x46')]:_0x54c57a[_0x335f('0x3f')];if(_0x1ab2e4[_0x335f('0x41')]['includeAll']){_0xd654cf[_0x335f('0x52')]=[{'all':!![]}];}_0xd654cf=_[_0x335f('0x4e')]({},_0xd654cf,_0x1ab2e4[_0x335f('0x57')]);return db[_0x335f('0x50')]['find'](_0xd654cf)['then'](handleEntityNotFound(_0x4c0198,null))[_0x335f('0x24')](respondWithResult(_0x4c0198,null))['catch'](handleError(_0x4c0198,null));};exports[_0x335f('0x58')]=function(_0x32d049,_0x1d069c){return db[_0x335f('0x50')][_0x335f('0x58')](_0x32d049[_0x335f('0x59')],{})[_0x335f('0x24')](function(_0x2512fc){var _0x57ea09=_0x32d049[_0x335f('0x5a')][_0x335f('0x5b')]({'plain':!![]});if(!_0x57ea09)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57ea09[_0x335f('0x5c')]===_0x335f('0x5a')){var _0x102501=_0x2512fc[_0x335f('0x5b')]({'plain':!![]});var _0x284f2e=_0x335f('0x5d');return db[_0x335f('0x5e')]['find']({'where':{'name':_0x284f2e,'userProfileId':_0x57ea09['userProfileId']},'raw':!![]})[_0x335f('0x24')](function(_0x2157e3){if(_0x2157e3&&_0x2157e3[_0x335f('0x5f')]===0x0){return db[_0x335f('0x60')]['create']({'name':_0x102501[_0x335f('0x39')],'resourceId':_0x102501['id'],'type':_0x2157e3['name'],'sectionId':_0x2157e3['id']},{})[_0x335f('0x24')](function(){return _0x2512fc;});}else{return _0x2512fc;}})['catch'](function(_0x40b751){logger[_0x335f('0x28')](_0x335f('0x61'),_0x40b751);throw _0x40b751;});}return _0x2512fc;})[_0x335f('0x24')](respondWithResult(_0x1d069c,0xc9))[_0x335f('0x2b')](handleError(_0x1d069c,null));};exports['update']=function(_0x5ba1f5,_0x47e97a){if(_0x5ba1f5[_0x335f('0x59')]['id']){delete _0x5ba1f5['body']['id'];}return db['ChatQueue']['find']({'where':{'id':_0x5ba1f5[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x47e97a,null))['then'](saveUpdates(_0x5ba1f5[_0x335f('0x59')],null))['then'](respondWithResult(_0x47e97a,null))[_0x335f('0x2b')](handleError(_0x47e97a,null));};exports[_0x335f('0x38')]=function(_0x468a4a,_0x5a1aa0){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x468a4a['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x5a1aa0,null))[_0x335f('0x24')](removeEntity(_0x5a1aa0,null))[_0x335f('0x2b')](handleError(_0x5a1aa0,null));};exports[_0x335f('0x63')]=function(_0x53eea1,_0x4ad269){return db[_0x335f('0x50')][_0x335f('0x63')]()['then'](respondWithResult(_0x4ad269,null))['catch'](handleError(_0x4ad269,null));};exports['getMembers']=function(_0x3efe13,_0x1cee05,_0x474c77){var _0xb35305={'raw':!![],'where':{}},_0x316f11={},_0x22f663;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x3efe13[_0x335f('0x55')]['id']}})['then'](handleEntityNotFound(_0x1cee05,null))[_0x335f('0x24')](function(_0x3e026b){if(_0x3e026b){_0x22f663=_0x3e026b[_0x335f('0x5b')]({'plain':!![]});_0x316f11['model']=_[_0x335f('0x42')](db['UserChatQueue']['rawAttributes']);_0x316f11['query']=_[_0x335f('0x42')](_0x3efe13['query']);_0x316f11[_0x335f('0x43')]=_['intersection'](_0x316f11[_0x335f('0x3f')],_0x316f11[_0x335f('0x41')]);_0xb35305[_0x335f('0x46')]=_[_0x335f('0x44')](_0x316f11['model'],qs[_0x335f('0x45')](_0x3efe13[_0x335f('0x41')][_0x335f('0x45')]));_0xb35305[_0x335f('0x46')]=_0xb35305[_0x335f('0x46')]['length']?_0xb35305[_0x335f('0x46')]:_0x316f11[_0x335f('0x3f')];if(!_0x3efe13['query'][_0x335f('0x48')]('nolimit')){_0xb35305[_0x335f('0x31')]=qs['limit'](_0x3efe13[_0x335f('0x41')][_0x335f('0x31')]);_0xb35305['offset']=qs['offset'](_0x3efe13[_0x335f('0x41')][_0x335f('0x2f')]);}_0xb35305['order']=qs[_0x335f('0x4b')](_0x3efe13[_0x335f('0x41')][_0x335f('0x4b')]);_0xb35305[_0x335f('0x4f')]=qs[_0x335f('0x43')](_['pick'](_0x3efe13[_0x335f('0x41')],_0x316f11['filters']));_0xb35305[_0x335f('0x4f')][_0x335f('0x65')]=_0x3e026b['id'];if(_0x3efe13['query']['filter']){_0xb35305[_0x335f('0x4f')]=_[_0x335f('0x4e')](_0xb35305['where'],{'$or':_[_0x335f('0x40')](_0xb35305['attributes'],function(_0x3795a1){var _0x32705c={};_0x32705c[_0x3795a1]={'$like':'%'+_0x3efe13[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x32705c;})});}_0xb35305=_[_0x335f('0x4e')]({},_0xb35305,_0x3efe13[_0x335f('0x57')]);return db['UserChatQueue'][_0x335f('0x53')](_0xb35305);}})[_0x335f('0x24')](function(_0x3ba5ff){if(_0x3ba5ff){return db['User'][_0x335f('0x66')]({'where':{'id':_[_0x335f('0x40')](_0x3ba5ff,'UserId'),'role':_0x335f('0x67')},'attributes':['id',_0x335f('0x39'),_0x335f('0x68'),_0x335f('0x69'),_0x335f('0x6a')]});}})[_0x335f('0x24')](function(_0x192d2d){if(_0x192d2d){return{'count':_0x192d2d['count'],'rows':_['map'](_0x192d2d[_0x335f('0x54')],function(_0x1872cd){return{'membername':_0x1872cd[_0x335f('0x39')],'UserId':_0x1872cd['id'],'queue_name':_0x22f663[_0x335f('0x39')],'ChatQueueId':_0x22f663['id'],'interface':util[_0x335f('0x6b')](_0x335f('0x6c'),'SIP',_0x1872cd['name']),'penalty':0x0,'paused':_0x1872cd[_0x335f('0x68')],'createdAt':_0x1872cd[_0x335f('0x6a')],'updatedAt':_0x1872cd[_0x335f('0x69')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x335f('0x24')](respondWithFilteredResult(_0x1cee05,_0xb35305))['catch'](handleError(_0x1cee05,null));};exports[_0x335f('0x6d')]=function(_0x2c52aa,_0x9c75a,_0x420ee9){var _0x1afb99={};var _0x108e7d={};var _0x3975a1;var _0x2809b0;return db[_0x335f('0x50')][_0x335f('0x64')]({'where':{'id':_0x2c52aa[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x9c75a,null))[_0x335f('0x24')](function(_0x430559){if(_0x430559){_0x3975a1=_0x430559;_0x108e7d[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x6e')][_0x335f('0x56')]);_0x108e7d[_0x335f('0x41')]=_[_0x335f('0x42')](_0x2c52aa[_0x335f('0x41')]);_0x108e7d[_0x335f('0x43')]=_['intersection'](_0x108e7d['model'],_0x108e7d[_0x335f('0x41')]);_0x1afb99[_0x335f('0x46')]=_[_0x335f('0x44')](_0x108e7d[_0x335f('0x3f')],qs[_0x335f('0x45')](_0x2c52aa[_0x335f('0x41')][_0x335f('0x45')]));_0x1afb99[_0x335f('0x46')]=_0x1afb99[_0x335f('0x46')]['length']?_0x1afb99['attributes']:_0x108e7d[_0x335f('0x3f')];_0x1afb99[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0x2c52aa['query'][_0x335f('0x4b')]);_0x1afb99['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0x2c52aa[_0x335f('0x41')],_0x108e7d[_0x335f('0x43')]));if(_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]){_0x1afb99[_0x335f('0x4f')]=_['merge'](_0x1afb99[_0x335f('0x4f')],{'$or':_[_0x335f('0x40')](_0x1afb99[_0x335f('0x46')],function(_0x22b328){var _0x204dcf={};_0x204dcf[_0x22b328]={'$like':'%'+_0x2c52aa[_0x335f('0x41')][_0x335f('0x4d')]+'%'};return _0x204dcf;})});}_0x1afb99=_[_0x335f('0x4e')]({},_0x1afb99,_0x2c52aa[_0x335f('0x57')]);return _0x3975a1[_0x335f('0x6d')](_0x1afb99);}})['then'](function(_0x5bf0dc){if(_0x5bf0dc){_0x2809b0=_0x5bf0dc[_0x335f('0x47')];if(!_0x2c52aa['query'][_0x335f('0x48')](_0x335f('0x49'))){_0x1afb99[_0x335f('0x31')]=qs['limit'](_0x2c52aa[_0x335f('0x41')]['limit']);_0x1afb99[_0x335f('0x2f')]=qs[_0x335f('0x2f')](_0x2c52aa['query'][_0x335f('0x2f')]);}return _0x3975a1['getTeams'](_0x1afb99);}})[_0x335f('0x24')](function(_0x3fb11d){if(_0x3fb11d){return _0x3fb11d?{'count':_0x2809b0,'rows':_0x3fb11d}:null;}})[_0x335f('0x24')](respondWithResult(_0x9c75a,null))['catch'](handleError(_0x9c75a,null));};exports[_0x335f('0x6f')]=function(_0x48393f,_0x21efc2,_0x6853fb){var _0xe5cd1d=_0x48393f[_0x335f('0x59')][_0x335f('0x70')];return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0xe5cd1d},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id','name',_0x335f('0x73'),_0x335f('0x74'),_0x335f('0x75')],'raw':!![]}]})[_0x335f('0x24')](function(_0x59b6cf){if(_0x59b6cf){var _0x4dd723=_[_0x335f('0x76')](_0x59b6cf,function(_0x126ab6){var _0x18521c=_0x126ab6[_0x335f('0x5b')]({'plain':!![]});return _0x18521c['Agents'];});return db[_0x335f('0x50')]['find']({'where':{'id':_0x48393f[_0x335f('0x55')]['id']}})[_0x335f('0x24')](function(_0x2a87b3){return db['sequelize']['transaction'](function(_0x1bb1db){return _0x2a87b3[_0x335f('0x6f')](_0xe5cd1d,{'transaction':_0x1bb1db})['then'](function(){return BPromise[_0x335f('0x77')](_0x4dd723,function(_0x167d0b){return db['UserChatQueue'][_0x335f('0x78')]({'where':{'UserId':_0x167d0b['id'],'ChatQueueId':_0x48393f[_0x335f('0x55')]['id']},'transaction':_0x1bb1db});});})[_0x335f('0x24')](function(){_0x4dd723[_0x335f('0x79')](function(_0x3b18af){socket[_0x335f('0x7a')](_0x335f('0x7b'),{'UserId':_0x3b18af['id'],'ChatQueueId':_0x2a87b3['id']});});});});});}})[_0x335f('0x24')](respondWithStatusCode(_0x21efc2,null))[_0x335f('0x2b')](handleError(_0x21efc2,null));};exports[_0x335f('0x7c')]=function(_0x515d77,_0x2918ec,_0x5424fb){return db[_0x335f('0x6e')][_0x335f('0x53')]({'where':{'id':_0x515d77[_0x335f('0x41')][_0x335f('0x70')]},'attributes':['id'],'include':[{'model':db[_0x335f('0x71')],'as':_0x335f('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2918ec,null))['then'](function(_0x3f7e2b){var _0x3013ae=_[_0x335f('0x40')](_0x3f7e2b,'id');var _0x2232e9=[];var _0x428abe=[];var _0x5ded24=squel[_0x335f('0x7d')]();_0x5ded24[_0x335f('0x7e')](_0x335f('0x7f'))[_0x335f('0x80')](_0x335f('0x81'),'tq')[_0x335f('0x82')](_0x335f('0x83'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x335f('0x84'),_0x515d77[_0x335f('0x55')]['id']);for(var _0x4c4629=0x0;_0x4c4629<_0x3f7e2b[_0x335f('0x47')];_0x4c4629+=0x1){let _0x1c6e0a=_0x3f7e2b[_0x4c4629];for(var _0x378506=0x0;_0x378506<_0x1c6e0a[_0x335f('0x72')][_0x335f('0x47')];_0x378506+=0x1){let _0x1a7fcf=_0x1c6e0a['Agents'][_0x378506];var _0x267cc9=_0x5ded24[_0x335f('0x85')]();_0x267cc9[_0x335f('0x4f')](_0x335f('0x86'),_0x1a7fcf['id']);_0x428abe[_0x335f('0x87')](db['sequelize'][_0x335f('0x41')](_0x267cc9['toString'](),{'type':db[_0x335f('0x88')]['QueryTypes'][_0x335f('0x89')]})['then'](function(_0x5ed752){if(_0x5ed752[_0x335f('0x47')]===0x1){return _0x1a7fcf['id'];}else{var _0x266fea=_[_0x335f('0x8a')](_[_0x335f('0x40')](_0x5ed752,'TeamId'),function(_0x49aec9){return _['includes'](_0x3013ae,_0x49aec9);});if(_0x266fea){return _0x1a7fcf['id'];}}}));}}return BPromise['all'](_0x428abe)[_0x335f('0x24')](function(_0x3f4c53){_0x2232e9=_(_0x2232e9)[_0x335f('0x8b')](_0x3f4c53)[_0x335f('0x8c')]()[_0x335f('0x8d')]();return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x515d77[_0x335f('0x55')]['id']}})['then'](function(_0x507de7){return db[_0x335f('0x88')][_0x335f('0x8e')](function(_0x40e02a){return _0x507de7[_0x335f('0x7c')](_0x515d77['query']['ids'],{'transaction':_0x40e02a})['then'](function(){if(!_[_0x335f('0x8f')](_0x2232e9)){return _0x507de7[_0x335f('0x90')](_0x2232e9,{'transaction':_0x40e02a});}})['then'](function(){_0x2232e9[_0x335f('0x79')](function(_0x1b0e22){socket['emit']('userChatQueue:remove',{'UserId':_0x1b0e22,'ChatQueueId':_0x507de7['id']});});});});});});})[_0x335f('0x24')](respondWithStatusCode(_0x2918ec,null))[_0x335f('0x2b')](handleError(_0x2918ec,null));};exports[_0x335f('0x91')]=function(_0x2c11dd,_0x488cc9,_0x11b57b){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x2c11dd['params']['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x488cc9,null))[_0x335f('0x24')](function(_0x204cf8){if(_0x204cf8){return _0x204cf8[_0x335f('0x91')](_0x2c11dd['body'][_0x335f('0x70')],_[_0x335f('0x92')](_0x2c11dd[_0x335f('0x59')],[_0x335f('0x70'),'id'])||{})[_0x335f('0x93')](function(_0x4a5d8a){for(var _0x289dab=0x0;_0x289dab<_0x2c11dd['body'][_0x335f('0x70')][_0x335f('0x47')];_0x289dab+=0x1){socket['emit'](_0x335f('0x7b'),{'UserId':Number(_0x2c11dd['body'][_0x335f('0x70')][_0x289dab]),'ChatQueueId':Number(_0x2c11dd[_0x335f('0x55')]['id'])});}return _0x4a5d8a;});}})[_0x335f('0x24')](respondWithResult(_0x488cc9,null))['catch'](handleError(_0x488cc9,null));};exports[_0x335f('0x90')]=function(_0x111df1,_0x35dd30,_0x316948){return db[_0x335f('0x50')][_0x335f('0x62')]({'where':{'id':_0x111df1[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x35dd30,null))[_0x335f('0x24')](function(_0x26b9ee){if(_0x26b9ee){return _0x26b9ee[_0x335f('0x90')](_0x111df1[_0x335f('0x41')][_0x335f('0x70')])[_0x335f('0x24')](function(){if(_[_0x335f('0x94')](_0x111df1['query'][_0x335f('0x70')])){for(var _0x27e4f0=0x0;_0x27e4f0<_0x111df1[_0x335f('0x41')][_0x335f('0x70')]['length'];_0x27e4f0+=0x1){socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')][_0x335f('0x70')][_0x27e4f0]),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}}else{socket[_0x335f('0x7a')](_0x335f('0x95'),{'UserId':Number(_0x111df1[_0x335f('0x41')]['ids']),'ChatQueueId':Number(_0x111df1[_0x335f('0x55')]['id'])});}});}})[_0x335f('0x24')](respondWithStatusCode(_0x35dd30,null))[_0x335f('0x2b')](handleError(_0x35dd30,null));};exports[_0x335f('0x96')]=function(_0xd90543,_0x23f596,_0x3ca7e9){var _0x58af07={};var _0x2cf3ae={};var _0x211ac8;var _0x6970c0;return db[_0x335f('0x50')]['findOne']({'where':{'id':_0xd90543[_0x335f('0x55')]['id']}})[_0x335f('0x24')](handleEntityNotFound(_0x23f596,null))['then'](function(_0x19aba3){if(_0x19aba3){_0x211ac8=_0x19aba3;_0x2cf3ae[_0x335f('0x3f')]=_[_0x335f('0x42')](db[_0x335f('0x71')][_0x335f('0x56')]);_0x2cf3ae[_0x335f('0x41')]=_[_0x335f('0x42')](_0xd90543[_0x335f('0x41')]);_0x2cf3ae[_0x335f('0x43')]=_[_0x335f('0x44')](_0x2cf3ae['model'],_0x2cf3ae[_0x335f('0x41')]);_0x58af07[_0x335f('0x46')]=_[_0x335f('0x44')](_0x2cf3ae[_0x335f('0x3f')],qs[_0x335f('0x45')](_0xd90543['query']['fields']));_0x58af07[_0x335f('0x46')]=_0x58af07[_0x335f('0x46')]['length']?_0x58af07[_0x335f('0x46')]:_0x2cf3ae[_0x335f('0x3f')];_0x58af07[_0x335f('0x4a')]=qs[_0x335f('0x4b')](_0xd90543['query'][_0x335f('0x4b')]);_0x58af07['where']=qs[_0x335f('0x43')](_[_0x335f('0x4c')](_0xd90543[_0x335f('0x41')],_0x2cf3ae['filters']));if(_0xd90543[_0x335f('0x41')][_0x335f('0x4d')]){_0x58af07['where']=_[_0x335f('0x4e')](_0x58af07['where'],{'$or':_[_0x335f('0x40')](_0x58af07[_0x335f('0x46')],function(_0x38755b){var _0x4c4bb8={};_0x4c4bb8[_0x38755b]={'$like':'%'+_0xd90543['query'][_0x335f('0x4d')]+'%'};return _0x4c4bb8;})});}_0x58af07=_[_0x335f('0x4e')]({},_0x58af07,_0xd90543[_0x335f('0x57')]);return _0x211ac8[_0x335f('0x96')](_0x58af07);}})['then'](function(_0x62806b){if(_0x62806b){_0x6970c0=_0x62806b[_0x335f('0x47')];if(!_0xd90543[_0x335f('0x41')][_0x335f('0x48')]('nolimit')){_0x58af07[_0x335f('0x31')]=qs[_0x335f('0x31')](_0xd90543[_0x335f('0x41')][_0x335f('0x31')]);_0x58af07['offset']=qs[_0x335f('0x2f')](_0xd90543[_0x335f('0x41')][_0x335f('0x2f')]);}return _0x211ac8[_0x335f('0x96')](_0x58af07);}})[_0x335f('0x24')](function(_0x4031ba){if(_0x4031ba){return _0x4031ba?{'count':_0x6970c0,'rows':_0x4031ba}:null;}})[_0x335f('0x24')](respondWithResult(_0x23f596,null))['catch'](handleError(_0x23f596,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 49b9819..8577b63 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 _0xff7a=['ChatQueue','setMaxListeners','emit','hasOwnProperty','hook','exports','events'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0xff7a,0xa0));var _0xaff7=function(_0x3e1ca5,_0x509226){_0x3e1ca5=_0x3e1ca5-0x0;var _0x428493=_0xff7a[_0x3e1ca5];return _0x428493;};'use strict';var EventEmitter=require(_0xaff7('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xaff7('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xaff7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2b21e0){return function(_0x2feb15,_0x17e257,_0xa5173){ChatQueueEvents[_0xaff7('0x3')](_0x2b21e0+':'+_0x2feb15['id'],_0x2feb15);ChatQueueEvents[_0xaff7('0x3')](_0x2b21e0,_0x2feb15);_0xa5173(null);};}for(var e in events){if(events[_0xaff7('0x4')](e)){var event=events[e];ChatQueue[_0xaff7('0x5')](e,emitEvent(event));}}module[_0xaff7('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0xbc17=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','emit'];(function(_0x31ddea,_0x40de6d){var _0x12539b=function(_0x1d353b){while(--_0x1d353b){_0x31ddea['push'](_0x31ddea['shift']());}};_0x12539b(++_0x40de6d);}(_0xbc17,0x1ab));var _0x7bc1=function(_0x361bb4,_0x411189){_0x361bb4=_0x361bb4-0x0;var _0x3e88c3=_0xbc17[_0x361bb4];return _0x3e88c3;};'use strict';var EventEmitter=require(_0x7bc1('0x0'));var ChatQueue=require(_0x7bc1('0x1'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7bc1('0x2')](0x0);var events={'afterCreate':_0x7bc1('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3ff36d){return function(_0x7aa41e,_0x5dfaa8,_0x2cd126){ChatQueueEvents['emit'](_0x3ff36d+':'+_0x7aa41e['id'],_0x7aa41e);ChatQueueEvents[_0x7bc1('0x4')](_0x3ff36d,_0x7aa41e);_0x2cd126(null);};}for(var e in events){if(events[_0x7bc1('0x5')](e)){var event=events[e];ChatQueue[_0x7bc1('0x6')](e,emitEvent(event));}}module[_0x7bc1('0x7')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index b3916f4..b5957f8 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 _0xf00a=['./chatQueue.attributes','exports','ChatQueue','chat_queues','lodash','../../config/logger','api','bluebird','path','rimraf'];(function(_0x19a49f,_0x444d74){var _0x5351ae=function(_0x58b1ed){while(--_0x58b1ed){_0x19a49f['push'](_0x19a49f['shift']());}};_0x5351ae(++_0x444d74);}(_0xf00a,0x90));var _0xaf00=function(_0x55a101,_0x3df81b){_0x55a101=_0x55a101-0x0;var _0x43466b=_0xf00a[_0x55a101];return _0x43466b;};'use strict';var _=require(_0xaf00('0x0'));var util=require('util');var logger=require(_0xaf00('0x1'))(_0xaf00('0x2'));var moment=require('moment');var BPromise=require(_0xaf00('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xaf00('0x4'));var rimraf=require(_0xaf00('0x5'));var config=require('../../config/environment');var attributes=require(_0xaf00('0x6'));module[_0xaf00('0x7')]=function(_0xe82429,_0x4b0857){return _0xe82429['define'](_0xaf00('0x8'),attributes,{'tableName':_0xaf00('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9ac7=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api','moment'];(function(_0x3ab7a7,_0x3d421d){var _0x3f7a31=function(_0x4d2c0d){while(--_0x4d2c0d){_0x3ab7a7['push'](_0x3ab7a7['shift']());}};_0x3f7a31(++_0x3d421d);}(_0x9ac7,0xdb));var _0x79ac=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x9ac7[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0x79ac('0x0'));var util=require(_0x79ac('0x1'));var logger=require(_0x79ac('0x2'))(_0x79ac('0x3'));var moment=require(_0x79ac('0x4'));var BPromise=require('bluebird');var rp=require(_0x79ac('0x5'));var fs=require('fs');var path=require(_0x79ac('0x6'));var rimraf=require(_0x79ac('0x7'));var config=require(_0x79ac('0x8'));var attributes=require(_0x79ac('0x9'));module[_0x79ac('0xa')]=function(_0x29a9b8,_0xae1f63){return _0x29a9b8[_0x79ac('0xb')](_0x79ac('0xc'),attributes,{'tableName':_0x79ac('0xd'),'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 d7a7f42..3e68862 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 _0x25a9=['where','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatQueue','findAll','options','raw','attributes','limit','map','include','model','GetChatQueue','debug','ShowChatQueue','find'];(function(_0x3f19b3,_0x3f0849){var _0xd61898=function(_0x3ca685){while(--_0x3ca685){_0x3f19b3['push'](_0x3f19b3['shift']());}};_0xd61898(++_0x3f0849);}(_0x25a9,0xf1));var _0x925a=function(_0x4d93c9,_0x4775ae){_0x4d93c9=_0x4d93c9-0x0;var _0x48536d=_0x25a9[_0x4d93c9];return _0x48536d;};'use strict';var _=require('lodash');var util=require(_0x925a('0x0'));var moment=require(_0x925a('0x1'));var BPromise=require(_0x925a('0x2'));var rs=require(_0x925a('0x3'));var fs=require('fs');var Redis=require(_0x925a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x925a('0x5'));var logger=require(_0x925a('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x925a('0x7'));var client=jayson['client'][_0x925a('0x8')]({'port':0x232a});config[_0x925a('0x9')]=_[_0x925a('0xa')](config[_0x925a('0x9')],{'host':_0x925a('0xb'),'port':0x18eb});var socket=require(_0x925a('0xc'))(new Redis(config[_0x925a('0x9')]));require('./chatQueue.socket')[_0x925a('0xd')](socket);function respondWithRpcPromise(_0x55a571,_0x4f76b2,_0x575450){return new BPromise(function(_0x152980,_0x5871f4){return client[_0x925a('0xe')](_0x55a571,_0x575450)[_0x925a('0xf')](function(_0xe633a1){logger[_0x925a('0x10')](_0x925a('0x11'),_0x4f76b2,_0x925a('0x12'));logger['debug'](_0x925a('0x13'),_0x4f76b2,_0x925a('0x12'),JSON[_0x925a('0x14')](_0xe633a1));if(_0xe633a1[_0x925a('0x15')]){if(_0xe633a1[_0x925a('0x15')][_0x925a('0x16')]===0x1f4){logger[_0x925a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4f76b2,_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);return _0x5871f4(_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);}logger['error'](_0x925a('0x11'),_0x4f76b2,_0xe633a1[_0x925a('0x15')]['message']);return _0x152980(_0xe633a1[_0x925a('0x15')][_0x925a('0x17')]);}else{logger[_0x925a('0x10')](_0x925a('0x11'),_0x4f76b2,'request\x20sent');_0x152980(_0xe633a1[_0x925a('0x18')][_0x925a('0x17')]);}})[_0x925a('0x19')](function(_0x3375e6){logger[_0x925a('0x15')]('ChatQueue,\x20%s,\x20%s',_0x4f76b2,_0x3375e6);_0x5871f4(_0x3375e6);});});}exports['GetChatQueue']=function(_0x433077){var _0x228158=this;return new Promise(function(_0x54d9aa,_0x2abbdc){return db[_0x925a('0x1a')][_0x925a('0x1b')]({'raw':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')][_0x925a('0x1d')]===undefined?!![]:![]:!![],'where':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')]['where']||null:null,'attributes':_0x433077[_0x925a('0x1c')]?_0x433077[_0x925a('0x1c')][_0x925a('0x1e')]||null:null,'limit':_0x433077['options']?_0x433077[_0x925a('0x1c')][_0x925a('0x1f')]||null:null,'include':_0x433077['options']?_0x433077[_0x925a('0x1c')]['include']?_[_0x925a('0x20')](_0x433077[_0x925a('0x1c')][_0x925a('0x21')],function(_0x2d4e16){return{'model':db[_0x2d4e16[_0x925a('0x22')]],'as':_0x2d4e16['as'],'attributes':_0x2d4e16[_0x925a('0x1e')],'include':_0x2d4e16[_0x925a('0x21')]?_[_0x925a('0x20')](_0x2d4e16[_0x925a('0x21')],function(_0x159c0a){return{'model':db[_0x159c0a['model']],'as':_0x159c0a['as'],'attributes':_0x159c0a[_0x925a('0x1e')],'include':_0x159c0a[_0x925a('0x21')]?_[_0x925a('0x20')](_0x159c0a[_0x925a('0x21')],function(_0x5cb909){return{'model':db[_0x5cb909[_0x925a('0x22')]],'as':_0x5cb909['as'],'attributes':_0x5cb909['attributes']};}):[]};}):[]};}):[]:[]})[_0x925a('0xf')](function(_0x5d704a){logger[_0x925a('0x10')](_0x925a('0x23'),_0x433077);logger[_0x925a('0x24')](_0x925a('0x23'),_0x433077,JSON[_0x925a('0x14')](_0x5d704a));_0x54d9aa(_0x5d704a);})[_0x925a('0x19')](function(_0x1c951b){logger[_0x925a('0x15')]('GetChatQueue',_0x1c951b[_0x925a('0x17')],_0x433077);_0x2abbdc(_0x228158['error'](0x1f4,_0x1c951b[_0x925a('0x17')]));});});};exports[_0x925a('0x25')]=function(_0xe9c070){var _0x53f35d=this;return new Promise(function(_0x3c70a3,_0x113a16){return db[_0x925a('0x1a')][_0x925a('0x26')]({'raw':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')][_0x925a('0x27')]||null:null,'attributes':_0xe9c070[_0x925a('0x1c')]?_0xe9c070['options']['attributes']||null:null,'include':_0xe9c070[_0x925a('0x1c')]?_0xe9c070[_0x925a('0x1c')][_0x925a('0x21')]?_['map'](_0xe9c070[_0x925a('0x1c')][_0x925a('0x21')],function(_0x386911){return{'model':db[_0x386911[_0x925a('0x22')]],'as':_0x386911['as'],'attributes':_0x386911['attributes'],'include':_0x386911['include']?_[_0x925a('0x20')](_0x386911[_0x925a('0x21')],function(_0x3af324){return{'model':db[_0x3af324[_0x925a('0x22')]],'as':_0x3af324['as'],'attributes':_0x3af324[_0x925a('0x1e')],'include':_0x3af324[_0x925a('0x21')]?_['map'](_0x3af324[_0x925a('0x21')],function(_0x494e83){return{'model':db[_0x494e83['model']],'as':_0x494e83['as'],'attributes':_0x494e83[_0x925a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x925a('0xf')](function(_0x5b1289){logger[_0x925a('0x10')](_0x925a('0x25'),_0xe9c070);logger['debug'](_0x925a('0x25'),_0xe9c070,JSON['stringify'](_0x5b1289));_0x3c70a3(_0x5b1289);})['catch'](function(_0x526552){logger[_0x925a('0x15')](_0x925a('0x25'),_0x526552[_0x925a('0x17')],_0xe9c070);_0x113a16(_0x53f35d[_0x925a('0x15')](0x1f4,_0x526552[_0x925a('0x17')]));});});};
\ No newline at end of file
+var _0xd7cf=['ShowChatQueue','ChatQueue','find','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','debug','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetChatQueue','findAll','options','where','attributes','limit','include','map','model'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd7cf,0x12b));var _0xfd7c=function(_0x14102c,_0x1cb214){_0x14102c=_0x14102c-0x0;var _0x13297b=_0xd7cf[_0x14102c];return _0x13297b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfd7c('0x0'));var BPromise=require(_0xfd7c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd7c('0x2'));var db=require(_0xfd7c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd7c('0x4'));var config=require(_0xfd7c('0x5'));var jayson=require(_0xfd7c('0x6'));var client=jayson[_0xfd7c('0x7')]['http']({'port':0x232a});config[_0xfd7c('0x8')]=_[_0xfd7c('0x9')](config[_0xfd7c('0x8')],{'host':_0xfd7c('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfd7c('0x8')]));require(_0xfd7c('0xb'))[_0xfd7c('0xc')](socket);function respondWithRpcPromise(_0x4e7912,_0x156d02,_0x24e717){return new BPromise(function(_0x1adb82,_0x4d4395){return client[_0xfd7c('0xd')](_0x4e7912,_0x24e717)[_0xfd7c('0xe')](function(_0x34e894){logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,'request\x20sent');logger[_0xfd7c('0x11')](_0xfd7c('0x12'),_0x156d02,_0xfd7c('0x13'),JSON[_0xfd7c('0x14')](_0x34e894));if(_0x34e894[_0xfd7c('0x15')]){if(_0x34e894['error'][_0xfd7c('0x16')]===0x1f4){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894[_0xfd7c('0x15')]['message']);return _0x4d4395(_0x34e894['error']['message']);}logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x34e894['error'][_0xfd7c('0x17')]);return _0x1adb82(_0x34e894[_0xfd7c('0x15')]['message']);}else{logger[_0xfd7c('0xf')](_0xfd7c('0x10'),_0x156d02,_0xfd7c('0x13'));_0x1adb82(_0x34e894['result'][_0xfd7c('0x17')]);}})[_0xfd7c('0x18')](function(_0x52d2d2){logger[_0xfd7c('0x15')](_0xfd7c('0x10'),_0x156d02,_0x52d2d2);_0x4d4395(_0x52d2d2);});});}exports[_0xfd7c('0x19')]=function(_0x484adc){var _0x58a155=this;return new Promise(function(_0x4d86c4,_0x483cc4){return db['ChatQueue'][_0xfd7c('0x1a')]({'raw':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1d')]||null:null,'limit':_0x484adc['options']?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1e')]||null:null,'include':_0x484adc[_0xfd7c('0x1b')]?_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x484adc[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x285768){return{'model':db[_0x285768[_0xfd7c('0x21')]],'as':_0x285768['as'],'attributes':_0x285768[_0xfd7c('0x1d')],'include':_0x285768['include']?_[_0xfd7c('0x20')](_0x285768[_0xfd7c('0x1f')],function(_0x5276cc){return{'model':db[_0x5276cc[_0xfd7c('0x21')]],'as':_0x5276cc['as'],'attributes':_0x5276cc[_0xfd7c('0x1d')],'include':_0x5276cc[_0xfd7c('0x1f')]?_['map'](_0x5276cc['include'],function(_0x374dce){return{'model':db[_0x374dce[_0xfd7c('0x21')]],'as':_0x374dce['as'],'attributes':_0x374dce[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x59ca9f){logger['info']('GetChatQueue',_0x484adc);logger[_0xfd7c('0x11')](_0xfd7c('0x19'),_0x484adc,JSON[_0xfd7c('0x14')](_0x59ca9f));_0x4d86c4(_0x59ca9f);})[_0xfd7c('0x18')](function(_0x2e9eaa){logger[_0xfd7c('0x15')](_0xfd7c('0x19'),_0x2e9eaa['message'],_0x484adc);_0x483cc4(_0x58a155[_0xfd7c('0x15')](0x1f4,_0x2e9eaa['message']));});});};exports[_0xfd7c('0x22')]=function(_0x4f6d24){var _0x383c43=this;return new Promise(function(_0x3e8d86,_0x4043dc){return db[_0xfd7c('0x23')][_0xfd7c('0x24')]({'raw':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1c')]||null:null,'attributes':_0x4f6d24[_0xfd7c('0x1b')]?_0x4f6d24[_0xfd7c('0x1b')]['attributes']||null:null,'include':_0x4f6d24['options']?_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')]?_['map'](_0x4f6d24[_0xfd7c('0x1b')][_0xfd7c('0x1f')],function(_0x490331){return{'model':db[_0x490331[_0xfd7c('0x21')]],'as':_0x490331['as'],'attributes':_0x490331[_0xfd7c('0x1d')],'include':_0x490331[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x490331[_0xfd7c('0x1f')],function(_0x4cfbbd){return{'model':db[_0x4cfbbd[_0xfd7c('0x21')]],'as':_0x4cfbbd['as'],'attributes':_0x4cfbbd[_0xfd7c('0x1d')],'include':_0x4cfbbd[_0xfd7c('0x1f')]?_[_0xfd7c('0x20')](_0x4cfbbd[_0xfd7c('0x1f')],function(_0x154894){return{'model':db[_0x154894[_0xfd7c('0x21')]],'as':_0x154894['as'],'attributes':_0x154894[_0xfd7c('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xfd7c('0xe')](function(_0x5e3d23){logger[_0xfd7c('0xf')](_0xfd7c('0x22'),_0x4f6d24);logger['debug'](_0xfd7c('0x22'),_0x4f6d24,JSON[_0xfd7c('0x14')](_0x5e3d23));_0x3e8d86(_0x5e3d23);})[_0xfd7c('0x18')](function(_0x46cce7){logger[_0xfd7c('0x15')]('ShowChatQueue',_0x46cce7[_0xfd7c('0x17')],_0x4f6d24);_0x4043dc(_0x383c43[_0xfd7c('0x15')](0x1f4,_0x46cce7[_0xfd7c('0x17')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index fe8d84c..79c308d 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(_0x20837e,_0x2adf66){var _0x3fa4e8=function(_0x3a2e99){while(--_0x3a2e99){_0x20837e['push'](_0x20837e['shift']());}};_0x3fa4e8(++_0x2adf66);}(_0x70e0,0x17b));var _0x070e=function(_0x487939,_0x562e0e){_0x487939=_0x487939-0x0;var _0x165d57=_0x70e0[_0x487939];return _0x165d57;};'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 _0xa37e=['chatQueue:','remove','update','emit','removeListener','register'];(function(_0x4ad88a,_0x46411b){var _0x1af50a=function(_0x48190c){while(--_0x48190c){_0x4ad88a['push'](_0x4ad88a['shift']());}};_0x1af50a(++_0x46411b);}(_0xa37e,0x97));var _0xea37=function(_0x211c4c,_0x264156){_0x211c4c=_0x211c4c-0x0;var _0x464c20=_0xa37e[_0x211c4c];return _0x464c20;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0xea37('0x0'),_0xea37('0x1')];function createListener(_0x204a22,_0x475c71){return function(_0x5430aa){_0x475c71[_0xea37('0x2')](_0x204a22,_0x5430aa);};}function removeListener(_0x537c5a,_0x360ed5){return function(){ChatQueueEvents[_0xea37('0x3')](_0x537c5a,_0x360ed5);};}exports[_0xea37('0x4')]=function(_0x4d380b){for(var _0x57135b=0x0,_0x36c489=events['length'];_0x57135b<_0x36c489;_0x57135b++){var _0x4ae081=events[_0x57135b];var _0x2c2890=createListener(_0xea37('0x5')+_0x4ae081,_0x4d380b);ChatQueueEvents['on'](_0x4ae081,_0x2c2890);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index de595fc..99378d6 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 _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x48ec32,_0x43a389){var _0x40b304=function(_0x550eb1){while(--_0x550eb1){_0x48ec32['push'](_0x48ec32['shift']());}};_0x40b304(++_0x43a389);}(_0x008c,0x188));var _0xc008=function(_0x4fbf33,_0x318fbc){_0x4fbf33=_0x4fbf33-0x0;var _0x1997d2=_0x008c[_0x4fbf33];return _0x1997d2;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=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(_0x209cea,_0x9bcc6e){var _0x45521f=function(_0x5c99a0){while(--_0x5c99a0){_0x209cea['push'](_0x209cea['shift']());}};_0x45521f(++_0x9bcc6e);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 a0e2227..bc8f087 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 _0x2f7e=['STRING','DATE','moment','sequelize'];(function(_0x77651c,_0x2bd29b){var _0x1cba5d=function(_0x241ab3){while(--_0x241ab3){_0x77651c['push'](_0x77651c['shift']());}};_0x1cba5d(++_0x2bd29b);}(_0x2f7e,0x122));var _0xe2f7=function(_0x338aa7,_0x411a47){_0x338aa7=_0x338aa7-0x0;var _0x4e0471=_0x2f7e[_0x338aa7];return _0x4e0471;};'use strict';var moment=require(_0xe2f7('0x0'));var Sequelize=require(_0xe2f7('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xe2f7('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe2f7('0x2')]},'joinAt':{'type':Sequelize[_0xe2f7('0x3')]},'leaveAt':{'type':Sequelize[_0xe2f7('0x3')]},'acceptAt':{'type':Sequelize[_0xe2f7('0x3')]},'exitAt':{'type':Sequelize[_0xe2f7('0x3')]},'reason':{'type':Sequelize[_0xe2f7('0x2')]}};
\ No newline at end of file
+var _0x64a1=['exports','DATE','STRING','moment','sequelize'];(function(_0x3c2a69,_0x4c8b41){var _0x596bc8=function(_0x1b4b7c){while(--_0x1b4b7c){_0x3c2a69['push'](_0x3c2a69['shift']());}};_0x596bc8(++_0x4c8b41);}(_0x64a1,0x13e));var _0x164a=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x64a1[_0x57b54c];return _0x59cc19;};'use strict';var moment=require(_0x164a('0x0'));var Sequelize=require(_0x164a('0x1'));module[_0x164a('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x164a('0x3')]},'leaveAt':{'type':Sequelize[_0x164a('0x3')]},'acceptAt':{'type':Sequelize[_0x164a('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x164a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index e2a7376..b0fcecf 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 _0x9b2c=['order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','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','end','json','offset','limit','undefined','count','Content-Range','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','nolimit'];(function(_0x50aa2e,_0xfbd6f0){var _0x5e07f0=function(_0x3ed540){while(--_0x3ed540){_0x50aa2e['push'](_0x50aa2e['shift']());}};_0x5e07f0(++_0xfbd6f0);}(_0x9b2c,0x189));var _0xc9b2=function(_0x43ed38,_0x507af1){_0x43ed38=_0x43ed38-0x0;var _0x181497=_0x9b2c[_0x43ed38];return _0x181497;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc9b2('0x0'));var zipdir=require(_0xc9b2('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc9b2('0x2'));var moment=require('moment');var BPromise=require(_0xc9b2('0x3'));var Mustache=require('mustache');var util=require(_0xc9b2('0x4'));var path=require(_0xc9b2('0x5'));var sox=require(_0xc9b2('0x6'));var csv=require(_0xc9b2('0x7'));var ejs=require(_0xc9b2('0x8'));var fs=require('fs');var fs_extra=require(_0xc9b2('0x9'));var _=require(_0xc9b2('0xa'));var squel=require(_0xc9b2('0xb'));var crypto=require(_0xc9b2('0xc'));var jsforce=require(_0xc9b2('0xd'));var deskjs=require(_0xc9b2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc9b2('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc9b2('0x10'));var qs=require(_0xc9b2('0x11'));var as=require(_0xc9b2('0x12'));var hardwareService=require(_0xc9b2('0x13'));var logger=require(_0xc9b2('0x14'))(_0xc9b2('0x15'));var utils=require(_0xc9b2('0x16'));var config=require(_0xc9b2('0x17'));var licenseUtil=require(_0xc9b2('0x18'));var db=require(_0xc9b2('0x19'))['db'];function respondWithStatusCode(_0x1cddb4,_0x3c4a7e){_0x3c4a7e=_0x3c4a7e||0xcc;return function(_0x5a1297){if(_0x5a1297){return _0x1cddb4[_0xc9b2('0x1a')](_0x3c4a7e);}return _0x1cddb4[_0xc9b2('0x1b')](_0x3c4a7e)[_0xc9b2('0x1c')]();};}function respondWithResult(_0x203739,_0x58a94f){_0x58a94f=_0x58a94f||0xc8;return function(_0x11b076){if(_0x11b076){return _0x203739[_0xc9b2('0x1b')](_0x58a94f)[_0xc9b2('0x1d')](_0x11b076);}};}function respondWithFilteredResult(_0x3a000e,_0xe8c3d8){return function(_0xc37dd){if(_0xc37dd){var _0x302c1a=typeof _0xe8c3d8[_0xc9b2('0x1e')]==='undefined'&&typeof _0xe8c3d8[_0xc9b2('0x1f')]===_0xc9b2('0x20');var _0xe224aa=_0xc37dd[_0xc9b2('0x21')];var _0x49d95a=_0x302c1a?0x0:_0xe8c3d8[_0xc9b2('0x1e')];var _0xde5092=_0x302c1a?_0xc37dd[_0xc9b2('0x21')]:_0xe8c3d8[_0xc9b2('0x1e')]+_0xe8c3d8[_0xc9b2('0x1f')];var _0x43fb7a;if(_0xde5092>=_0xe224aa){_0xde5092=_0xe224aa;_0x43fb7a=0xc8;}else{_0x43fb7a=0xce;}_0x3a000e[_0xc9b2('0x1b')](_0x43fb7a);return _0x3a000e['set'](_0xc9b2('0x22'),_0x49d95a+'-'+_0xde5092+'/'+_0xe224aa)['json'](_0xc37dd);}return null;};}function patchUpdates(_0x13739a){return function(_0x3d3a5c){try{jsonpatch['apply'](_0x3d3a5c,_0x13739a,!![]);}catch(_0x18237a){return BPromise[_0xc9b2('0x23')](_0x18237a);}return _0x3d3a5c['save']();};}function saveUpdates(_0x2842be,_0x4cc1b9){return function(_0x127fef){if(_0x127fef){return _0x127fef[_0xc9b2('0x24')](_0x2842be)[_0xc9b2('0x25')](function(_0x13006d){return _0x13006d;});}return null;};}function removeEntity(_0x20875a,_0x16e0e6){return function(_0x128ec5){if(_0x128ec5){return _0x128ec5[_0xc9b2('0x26')]()[_0xc9b2('0x25')](function(){_0x20875a[_0xc9b2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15dc60,_0xbb3bf9){return function(_0x444181){if(!_0x444181){_0x15dc60[_0xc9b2('0x1a')](0x194);}return _0x444181;};}function handleError(_0x5a2c79,_0x349943){_0x349943=_0x349943||0x1f4;return function(_0x5bdfe8){logger[_0xc9b2('0x27')](_0x5bdfe8[_0xc9b2('0x28')]);if(_0x5bdfe8[_0xc9b2('0x29')]){delete _0x5bdfe8[_0xc9b2('0x29')];}_0x5a2c79[_0xc9b2('0x1b')](_0x349943)[_0xc9b2('0x2a')](_0x5bdfe8);};}exports[_0xc9b2('0x2b')]=function(_0x3d735a,_0x46ab9b){var _0x37f4f0={},_0x16936f={},_0x2ab823={'count':0x0,'rows':[]};var _0x3de1f9=_[_0xc9b2('0x2c')](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')],function(_0x5d7748){return{'name':_0x5d7748['fieldName'],'type':_0x5d7748[_0xc9b2('0x2f')][_0xc9b2('0x30')]};});_0x16936f[_0xc9b2('0x31')]=_['map'](_0x3de1f9,_0xc9b2('0x29'));_0x16936f['query']=_[_0xc9b2('0x32')](_0x3d735a[_0xc9b2('0x33')]);_0x16936f[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x16936f[_0xc9b2('0x31')],_0x16936f[_0xc9b2('0x33')]);_0x37f4f0[_0xc9b2('0x36')]=_[_0xc9b2('0x35')](_0x16936f['model'],qs[_0xc9b2('0x37')](_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x37f4f0[_0xc9b2('0x36')]=_0x37f4f0['attributes']['length']?_0x37f4f0[_0xc9b2('0x36')]:_0x16936f[_0xc9b2('0x31')];if(!_0x3d735a['query']['hasOwnProperty'](_0xc9b2('0x38'))){_0x37f4f0['limit']=qs[_0xc9b2('0x1f')](_0x3d735a[_0xc9b2('0x33')]['limit']);_0x37f4f0[_0xc9b2('0x1e')]=qs[_0xc9b2('0x1e')](_0x3d735a[_0xc9b2('0x33')]['offset']);}_0x37f4f0[_0xc9b2('0x39')]=qs[_0xc9b2('0x3a')](_0x3d735a[_0xc9b2('0x33')]['sort']);_0x37f4f0['where']=qs[_0xc9b2('0x34')](_['pick'](_0x3d735a[_0xc9b2('0x33')],_0x16936f[_0xc9b2('0x34')]),_0x3de1f9);if(_0x3d735a['query'][_0xc9b2('0x3b')]){_0x37f4f0[_0xc9b2('0x3c')]=_[_0xc9b2('0x3d')](_0x37f4f0['where'],{'$or':_[_0xc9b2('0x2c')](_0x3de1f9,function(_0x1ef6f3){if(_0x1ef6f3[_0xc9b2('0x2f')]!==_0xc9b2('0x3e')){var _0x3f31ae={};_0x3f31ae[_0x1ef6f3['name']]={'$like':'%'+_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x3b')]+'%'};return _0x3f31ae;}})});}_0x37f4f0=_[_0xc9b2('0x3d')]({},_0x37f4f0,_0x3d735a[_0xc9b2('0x3f')]);var _0x97b664={'where':_0x37f4f0[_0xc9b2('0x3c')]};return db[_0xc9b2('0x2d')][_0xc9b2('0x21')](_0x97b664)[_0xc9b2('0x25')](function(_0x26893c){_0x2ab823[_0xc9b2('0x21')]=_0x26893c;if(_0x3d735a[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x37f4f0[_0xc9b2('0x41')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc9b2('0x42')](_0x37f4f0);})[_0xc9b2('0x25')](function(_0x304fa1){_0x2ab823[_0xc9b2('0x43')]=_0x304fa1;return _0x2ab823;})['then'](respondWithFilteredResult(_0x46ab9b,_0x37f4f0))[_0xc9b2('0x44')](handleError(_0x46ab9b,null));};exports[_0xc9b2('0x45')]=function(_0x53b549,_0x21dd63){var _0x3b93cb={'raw':!![],'where':{'id':_0x53b549[_0xc9b2('0x46')]['id']}},_0x5add26={};_0x5add26['model']=_['keys'](db[_0xc9b2('0x2d')][_0xc9b2('0x2e')]);_0x5add26[_0xc9b2('0x33')]=_[_0xc9b2('0x32')](_0x53b549[_0xc9b2('0x33')]);_0x5add26[_0xc9b2('0x34')]=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],_0x5add26[_0xc9b2('0x33')]);_0x3b93cb['attributes']=_[_0xc9b2('0x35')](_0x5add26[_0xc9b2('0x31')],qs[_0xc9b2('0x37')](_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x37')]));_0x3b93cb[_0xc9b2('0x36')]=_0x3b93cb[_0xc9b2('0x36')]['length']?_0x3b93cb[_0xc9b2('0x36')]:_0x5add26['model'];if(_0x53b549[_0xc9b2('0x33')][_0xc9b2('0x40')]){_0x3b93cb['include']=[{'all':!![]}];}_0x3b93cb=_[_0xc9b2('0x3d')]({},_0x3b93cb,_0x53b549['options']);return db[_0xc9b2('0x2d')][_0xc9b2('0x47')](_0x3b93cb)['then'](handleEntityNotFound(_0x21dd63,null))[_0xc9b2('0x25')](respondWithResult(_0x21dd63,null))['catch'](handleError(_0x21dd63,null));};exports[_0xc9b2('0x48')]=function(_0x351ef6,_0x5413bd){return db[_0xc9b2('0x2d')][_0xc9b2('0x48')](_0x351ef6[_0xc9b2('0x49')],{})[_0xc9b2('0x25')](respondWithResult(_0x5413bd,0xc9))[_0xc9b2('0x44')](handleError(_0x5413bd,null));};exports[_0xc9b2('0x24')]=function(_0x245293,_0x544445){if(_0x245293['body']['id']){delete _0x245293[_0xc9b2('0x49')]['id'];}return db[_0xc9b2('0x2d')]['find']({'where':{'id':_0x245293[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x544445,null))[_0xc9b2('0x25')](saveUpdates(_0x245293[_0xc9b2('0x49')],null))['then'](respondWithResult(_0x544445,null))[_0xc9b2('0x44')](handleError(_0x544445,null));};exports[_0xc9b2('0x26')]=function(_0x456ea4,_0x3f6083){return db['ChatQueueReport']['find']({'where':{'id':_0x456ea4[_0xc9b2('0x46')]['id']}})[_0xc9b2('0x25')](handleEntityNotFound(_0x3f6083,null))[_0xc9b2('0x25')](removeEntity(_0x3f6083,null))['catch'](handleError(_0x3f6083,null));};exports[_0xc9b2('0x4a')]=function(_0x392807,_0x2ab7e1){return db[_0xc9b2('0x2d')][_0xc9b2('0x4a')]()[_0xc9b2('0x25')](respondWithResult(_0x2ab7e1,null))['catch'](handleError(_0x2ab7e1,null));};
\ No newline at end of file
+var _0x3c85=['../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','save','update','then','destroy','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','jsforce','querystring','papaparse','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x14aec3,_0x12f372){var _0x3b599a=function(_0x46133d){while(--_0x46133d){_0x14aec3['push'](_0x14aec3['shift']());}};_0x3b599a(++_0x12f372);}(_0x3c85,0x1a0));var _0x53c8=function(_0x1ded1f,_0x42bf0d){_0x1ded1f=_0x1ded1f-0x0;var _0x5dc380=_0x3c85[_0x1ded1f];return _0x5dc380;};'use strict';var emlformat=require(_0x53c8('0x0'));var rimraf=require(_0x53c8('0x1'));var zipdir=require(_0x53c8('0x2'));var jsonpatch=require(_0x53c8('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x53c8('0x4'));var Mustache=require(_0x53c8('0x5'));var util=require(_0x53c8('0x6'));var path=require('path');var sox=require(_0x53c8('0x7'));var csv=require(_0x53c8('0x8'));var ejs=require(_0x53c8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x53c8('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x53c8('0xb'));var Papa=require(_0x53c8('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x53c8('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x53c8('0xe'));var utils=require(_0x53c8('0xf'));var config=require(_0x53c8('0x10'));var licenseUtil=require(_0x53c8('0x11'));var db=require(_0x53c8('0x12'))['db'];function respondWithStatusCode(_0x499ba8,_0x2ccf50){_0x2ccf50=_0x2ccf50||0xcc;return function(_0x3231f6){if(_0x3231f6){return _0x499ba8[_0x53c8('0x13')](_0x2ccf50);}return _0x499ba8['status'](_0x2ccf50)[_0x53c8('0x14')]();};}function respondWithResult(_0x31979e,_0x5a9f7f){_0x5a9f7f=_0x5a9f7f||0xc8;return function(_0x132777){if(_0x132777){return _0x31979e[_0x53c8('0x15')](_0x5a9f7f)[_0x53c8('0x16')](_0x132777);}};}function respondWithFilteredResult(_0xb13c1f,_0x30ff54){return function(_0x1c037f){if(_0x1c037f){var _0x385c39=typeof _0x30ff54[_0x53c8('0x17')]===_0x53c8('0x18')&&typeof _0x30ff54[_0x53c8('0x19')]===_0x53c8('0x18');var _0x44d6e4=_0x1c037f[_0x53c8('0x1a')];var _0x297f98=_0x385c39?0x0:_0x30ff54[_0x53c8('0x17')];var _0x4551b9=_0x385c39?_0x1c037f['count']:_0x30ff54['offset']+_0x30ff54[_0x53c8('0x19')];var _0x1a006c;if(_0x4551b9>=_0x44d6e4){_0x4551b9=_0x44d6e4;_0x1a006c=0xc8;}else{_0x1a006c=0xce;}_0xb13c1f[_0x53c8('0x15')](_0x1a006c);return _0xb13c1f[_0x53c8('0x1b')]('Content-Range',_0x297f98+'-'+_0x4551b9+'/'+_0x44d6e4)[_0x53c8('0x16')](_0x1c037f);}return null;};}function patchUpdates(_0x333990){return function(_0x40cc4c){try{jsonpatch[_0x53c8('0x1c')](_0x40cc4c,_0x333990,!![]);}catch(_0x12190e){return BPromise[_0x53c8('0x1d')](_0x12190e);}return _0x40cc4c[_0x53c8('0x1e')]();};}function saveUpdates(_0x54c1de,_0x1cf910){return function(_0x5b67d5){if(_0x5b67d5){return _0x5b67d5[_0x53c8('0x1f')](_0x54c1de)[_0x53c8('0x20')](function(_0xc329e8){return _0xc329e8;});}return null;};}function removeEntity(_0x2b024,_0x4cb9cb){return function(_0x3b2556){if(_0x3b2556){return _0x3b2556[_0x53c8('0x21')]()[_0x53c8('0x20')](function(){_0x2b024[_0x53c8('0x15')](0xcc)[_0x53c8('0x14')]();});}};}function handleEntityNotFound(_0x454bc5,_0x424211){return function(_0x11c6ca){if(!_0x11c6ca){_0x454bc5[_0x53c8('0x13')](0x194);}return _0x11c6ca;};}function handleError(_0x2821ad,_0x5e9265){_0x5e9265=_0x5e9265||0x1f4;return function(_0x1fe7e4){logger['error'](_0x1fe7e4['stack']);if(_0x1fe7e4[_0x53c8('0x22')]){delete _0x1fe7e4[_0x53c8('0x22')];}_0x2821ad[_0x53c8('0x15')](_0x5e9265)[_0x53c8('0x23')](_0x1fe7e4);};}exports[_0x53c8('0x24')]=function(_0x3f2c72,_0x320293){var _0x4031ba={},_0xf11181={},_0x6aa920={'count':0x0,'rows':[]};var _0x178992=_[_0x53c8('0x25')](db[_0x53c8('0x26')][_0x53c8('0x27')],function(_0x14e750){return{'name':_0x14e750[_0x53c8('0x28')],'type':_0x14e750[_0x53c8('0x29')][_0x53c8('0x2a')]};});_0xf11181[_0x53c8('0x2b')]=_['map'](_0x178992,_0x53c8('0x22'));_0xf11181[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x3f2c72['query']);_0xf11181[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0xf11181[_0x53c8('0x2b')],_0xf11181[_0x53c8('0x2c')]);_0x4031ba['attributes']=_['intersection'](_0xf11181[_0x53c8('0x2b')],qs[_0x53c8('0x30')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x30')]));_0x4031ba[_0x53c8('0x31')]=_0x4031ba['attributes'][_0x53c8('0x32')]?_0x4031ba['attributes']:_0xf11181[_0x53c8('0x2b')];if(!_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x33')](_0x53c8('0x34'))){_0x4031ba['limit']=qs['limit'](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x19')]);_0x4031ba[_0x53c8('0x17')]=qs[_0x53c8('0x17')](_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x17')]);}_0x4031ba[_0x53c8('0x35')]=qs[_0x53c8('0x36')](_0x3f2c72['query'][_0x53c8('0x36')]);_0x4031ba[_0x53c8('0x37')]=qs['filters'](_[_0x53c8('0x38')](_0x3f2c72[_0x53c8('0x2c')],_0xf11181[_0x53c8('0x2e')]),_0x178992);if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]){_0x4031ba[_0x53c8('0x37')]=_[_0x53c8('0x3a')](_0x4031ba['where'],{'$or':_['map'](_0x178992,function(_0x5a3691){if(_0x5a3691[_0x53c8('0x29')]!==_0x53c8('0x3b')){var _0x13f787={};_0x13f787[_0x5a3691[_0x53c8('0x22')]]={'$like':'%'+_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x39')]+'%'};return _0x13f787;}})});}_0x4031ba=_[_0x53c8('0x3a')]({},_0x4031ba,_0x3f2c72[_0x53c8('0x3c')]);var _0xf4c9b={'where':_0x4031ba[_0x53c8('0x37')]};return db[_0x53c8('0x26')][_0x53c8('0x1a')](_0xf4c9b)[_0x53c8('0x20')](function(_0x1d61e9){_0x6aa920[_0x53c8('0x1a')]=_0x1d61e9;if(_0x3f2c72[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x4031ba[_0x53c8('0x3e')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x53c8('0x3f')](_0x4031ba);})[_0x53c8('0x20')](function(_0x3f47a9){_0x6aa920[_0x53c8('0x40')]=_0x3f47a9;return _0x6aa920;})[_0x53c8('0x20')](respondWithFilteredResult(_0x320293,_0x4031ba))[_0x53c8('0x41')](handleError(_0x320293,null));};exports[_0x53c8('0x42')]=function(_0x146878,_0x4d772e){var _0x3ba6dd={'raw':!![],'where':{'id':_0x146878[_0x53c8('0x43')]['id']}},_0x284d91={};_0x284d91[_0x53c8('0x2b')]=_[_0x53c8('0x2d')](db[_0x53c8('0x26')][_0x53c8('0x27')]);_0x284d91[_0x53c8('0x2c')]=_[_0x53c8('0x2d')](_0x146878[_0x53c8('0x2c')]);_0x284d91[_0x53c8('0x2e')]=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],_0x284d91[_0x53c8('0x2c')]);_0x3ba6dd['attributes']=_[_0x53c8('0x2f')](_0x284d91[_0x53c8('0x2b')],qs['fields'](_0x146878['query'][_0x53c8('0x30')]));_0x3ba6dd['attributes']=_0x3ba6dd[_0x53c8('0x31')]['length']?_0x3ba6dd[_0x53c8('0x31')]:_0x284d91[_0x53c8('0x2b')];if(_0x146878[_0x53c8('0x2c')][_0x53c8('0x3d')]){_0x3ba6dd['include']=[{'all':!![]}];}_0x3ba6dd=_['merge']({},_0x3ba6dd,_0x146878['options']);return db[_0x53c8('0x26')][_0x53c8('0x44')](_0x3ba6dd)[_0x53c8('0x20')](handleEntityNotFound(_0x4d772e,null))[_0x53c8('0x20')](respondWithResult(_0x4d772e,null))[_0x53c8('0x41')](handleError(_0x4d772e,null));};exports['create']=function(_0x3fe863,_0x13d1e0){return db[_0x53c8('0x26')][_0x53c8('0x45')](_0x3fe863[_0x53c8('0x46')],{})['then'](respondWithResult(_0x13d1e0,0xc9))[_0x53c8('0x41')](handleError(_0x13d1e0,null));};exports[_0x53c8('0x1f')]=function(_0x487189,_0x143a5a){if(_0x487189[_0x53c8('0x46')]['id']){delete _0x487189[_0x53c8('0x46')]['id'];}return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x487189['params']['id']}})['then'](handleEntityNotFound(_0x143a5a,null))['then'](saveUpdates(_0x487189['body'],null))[_0x53c8('0x20')](respondWithResult(_0x143a5a,null))[_0x53c8('0x41')](handleError(_0x143a5a,null));};exports[_0x53c8('0x21')]=function(_0x4809e,_0x52de94){return db[_0x53c8('0x26')][_0x53c8('0x44')]({'where':{'id':_0x4809e[_0x53c8('0x43')]['id']}})[_0x53c8('0x20')](handleEntityNotFound(_0x52de94,null))[_0x53c8('0x20')](removeEntity(_0x52de94,null))[_0x53c8('0x41')](handleError(_0x52de94,null));};exports[_0x53c8('0x47')]=function(_0x3167ad,_0x10dd3e){return db[_0x53c8('0x26')][_0x53c8('0x47')]()[_0x53c8('0x20')](respondWithResult(_0x10dd3e,null))['catch'](handleError(_0x10dd3e,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index dfb1156..abbb32d 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 _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x9f48e6,_0x8f87aa){var _0x45fc5c=function(_0xab1f4e){while(--_0xab1f4e){_0x9f48e6['push'](_0x9f48e6['shift']());}};_0x45fc5c(++_0x8f87aa);}(_0xb10b,0x12a));var _0xbb10=function(_0x100338,_0x5cdbcc){_0x100338=_0x100338-0x0;var _0x330d32=_0xb10b[_0x100338];return _0x330d32;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xb10b=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','report_chat_queue','uniqueid','lodash'];(function(_0x2b70f8,_0x361789){var _0x2f741e=function(_0x50d901){while(--_0x50d901){_0x2b70f8['push'](_0x2b70f8['shift']());}};_0x2f741e(++_0x361789);}(_0xb10b,0x12a));var _0xbb10=function(_0x4aa662,_0x1cc90c){_0x4aa662=_0x4aa662-0x0;var _0x336478=_0xb10b[_0x4aa662];return _0x336478;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var logger=require(_0xbb10('0x1'))(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var BPromise=require('bluebird');var rp=require(_0xbb10('0x4'));var fs=require('fs');var path=require(_0xbb10('0x5'));var rimraf=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var attributes=require(_0xbb10('0x8'));module[_0xbb10('0x9')]=function(_0x481979,_0x328583){return _0x481979[_0xbb10('0xa')]('ChatQueueReport',attributes,{'tableName':_0xbb10('0xb'),'paranoid':![],'indexes':[{'name':_0xbb10('0xc'),'fields':[_0xbb10('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index d03a110..0b5e291 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 _0xc229=['info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','ChatQueueReport','create','body','options','raw','CreateChatQueueReport','catch','UpdateChatQueueReport','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0xc229,0xb3));var _0x9c22=function(_0x46fcca,_0x1e6178){_0x46fcca=_0x46fcca-0x0;var _0x32d1fe=_0xc229[_0x46fcca];return _0x32d1fe;};'use strict';var _=require(_0x9c22('0x0'));var util=require(_0x9c22('0x1'));var moment=require('moment');var BPromise=require(_0x9c22('0x2'));var rs=require(_0x9c22('0x3'));var fs=require('fs');var Redis=require(_0x9c22('0x4'));var db=require(_0x9c22('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9c22('0x6'))(_0x9c22('0x7'));var config=require(_0x9c22('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c22('0x9')][_0x9c22('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x30df48,_0x56a281,_0x1b87e4){return new BPromise(function(_0xad8255,_0x59fbc7){return client[_0x9c22('0xb')](_0x30df48,_0x1b87e4)[_0x9c22('0xc')](function(_0x3c9f3f){logger[_0x9c22('0xd')](_0x9c22('0xe'),_0x56a281,'request\x20sent');logger[_0x9c22('0xf')](_0x9c22('0x10'),_0x56a281,'request\x20sent',JSON[_0x9c22('0x11')](_0x3c9f3f));if(_0x3c9f3f[_0x9c22('0x12')]){if(_0x3c9f3f[_0x9c22('0x12')][_0x9c22('0x13')]===0x1f4){logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x3c9f3f['error'][_0x9c22('0x14')]);return _0x59fbc7(_0x3c9f3f[_0x9c22('0x12')]['message']);}logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x3c9f3f[_0x9c22('0x12')][_0x9c22('0x14')]);return _0xad8255(_0x3c9f3f['error'][_0x9c22('0x14')]);}else{logger[_0x9c22('0xd')](_0x9c22('0xe'),_0x56a281,_0x9c22('0x15'));_0xad8255(_0x3c9f3f['result'][_0x9c22('0x14')]);}})['catch'](function(_0x35ac75){logger[_0x9c22('0x12')](_0x9c22('0xe'),_0x56a281,_0x35ac75);_0x59fbc7(_0x35ac75);});});}exports['CreateChatQueueReport']=function(_0x4f0c1a){var _0x50e94e=this;return new Promise(function(_0x1fb44f,_0x4dc03b){return db[_0x9c22('0x16')][_0x9c22('0x17')](_0x4f0c1a[_0x9c22('0x18')],{'raw':_0x4f0c1a[_0x9c22('0x19')]?_0x4f0c1a[_0x9c22('0x19')][_0x9c22('0x1a')]===undefined?!![]:![]:!![]})[_0x9c22('0xc')](function(_0x120d56){logger[_0x9c22('0xd')]('CreateChatQueueReport',_0x4f0c1a);logger[_0x9c22('0xf')](_0x9c22('0x1b'),_0x4f0c1a,JSON[_0x9c22('0x11')](_0x120d56));_0x1fb44f(_0x120d56);})[_0x9c22('0x1c')](function(_0x134fcb){logger[_0x9c22('0x12')](_0x9c22('0x1b'),_0x134fcb[_0x9c22('0x14')],_0x4f0c1a);_0x4dc03b(_0x50e94e[_0x9c22('0x12')](0x1f4,_0x134fcb[_0x9c22('0x14')]));});});};exports[_0x9c22('0x1d')]=function(_0x136575){var _0x4a1cc3=this;return new Promise(function(_0x1dbb8e,_0x5911db){return db[_0x9c22('0x16')]['update'](_0x136575[_0x9c22('0x18')],{'raw':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')][_0x9c22('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')]['where']||null:null,'attributes':_0x136575[_0x9c22('0x19')]?_0x136575['options'][_0x9c22('0x1e')]||null:null,'limit':_0x136575[_0x9c22('0x19')]?_0x136575[_0x9c22('0x19')][_0x9c22('0x1f')]||null:null})[_0x9c22('0xc')](function(_0x59b4e9){logger['info'](_0x9c22('0x1d'),_0x136575);logger[_0x9c22('0xf')](_0x9c22('0x1d'),_0x136575,JSON['stringify'](_0x59b4e9));_0x1dbb8e(_0x59b4e9);})[_0x9c22('0x1c')](function(_0x1be455){logger[_0x9c22('0x12')](_0x9c22('0x1d'),_0x1be455['message'],_0x136575);_0x5911db(_0x4a1cc3['error'](0x1f4,_0x1be455[_0x9c22('0x14')]));});});};
\ No newline at end of file
+var _0x9ac6=['options','raw','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateChatQueueReport','create','body'];(function(_0x4b038c,_0x57f2b4){var _0x1b9fe8=function(_0x30c9e0){while(--_0x30c9e0){_0x4b038c['push'](_0x4b038c['shift']());}};_0x1b9fe8(++_0x57f2b4);}(_0x9ac6,0x120));var _0x69ac=function(_0x49e130,_0x75a7e7){_0x49e130=_0x49e130-0x0;var _0x5e86eb=_0x9ac6[_0x49e130];return _0x5e86eb;};'use strict';var _=require(_0x69ac('0x0'));var util=require(_0x69ac('0x1'));var moment=require(_0x69ac('0x2'));var BPromise=require(_0x69ac('0x3'));var rs=require(_0x69ac('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x69ac('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x69ac('0x6'))(_0x69ac('0x7'));var config=require(_0x69ac('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x69ac('0x9')][_0x69ac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2db475,_0x29a38f,_0x4f5878){return new BPromise(function(_0x41ee01,_0x32391e){return client[_0x69ac('0xb')](_0x2db475,_0x4f5878)[_0x69ac('0xc')](function(_0x3505f2){logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));logger[_0x69ac('0x10')](_0x69ac('0x11'),_0x29a38f,'request\x20sent',JSON[_0x69ac('0x12')](_0x3505f2));if(_0x3505f2[_0x69ac('0x13')]){if(_0x3505f2[_0x69ac('0x13')][_0x69ac('0x14')]===0x1f4){logger[_0x69ac('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x32391e(_0x3505f2['error'][_0x69ac('0x15')]);}logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x3505f2[_0x69ac('0x13')][_0x69ac('0x15')]);return _0x41ee01(_0x3505f2[_0x69ac('0x13')]['message']);}else{logger[_0x69ac('0xd')](_0x69ac('0xe'),_0x29a38f,_0x69ac('0xf'));_0x41ee01(_0x3505f2[_0x69ac('0x16')][_0x69ac('0x15')]);}})[_0x69ac('0x17')](function(_0x4d741d){logger[_0x69ac('0x13')](_0x69ac('0xe'),_0x29a38f,_0x4d741d);_0x32391e(_0x4d741d);});});}exports[_0x69ac('0x18')]=function(_0x4963ba){var _0x57df9a=this;return new Promise(function(_0x4a1950,_0x5e12cd){return db['ChatQueueReport'][_0x69ac('0x19')](_0x4963ba[_0x69ac('0x1a')],{'raw':_0x4963ba[_0x69ac('0x1b')]?_0x4963ba[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x802c5e){logger[_0x69ac('0xd')](_0x69ac('0x18'),_0x4963ba);logger[_0x69ac('0x10')]('CreateChatQueueReport',_0x4963ba,JSON[_0x69ac('0x12')](_0x802c5e));_0x4a1950(_0x802c5e);})['catch'](function(_0x48d98c){logger['error']('CreateChatQueueReport',_0x48d98c['message'],_0x4963ba);_0x5e12cd(_0x57df9a[_0x69ac('0x13')](0x1f4,_0x48d98c['message']));});});};exports[_0x69ac('0x1d')]=function(_0x5c53c2){var _0x4d4c17=this;return new Promise(function(_0x1c7c7d,_0x28782e){return db[_0x69ac('0x1e')][_0x69ac('0x1f')](_0x5c53c2[_0x69ac('0x1a')],{'raw':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c53c2['options']?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x20')]||null:null,'attributes':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2['options'][_0x69ac('0x21')]||null:null,'limit':_0x5c53c2[_0x69ac('0x1b')]?_0x5c53c2[_0x69ac('0x1b')][_0x69ac('0x22')]||null:null})['then'](function(_0xdc4b40){logger[_0x69ac('0xd')](_0x69ac('0x1d'),_0x5c53c2);logger[_0x69ac('0x10')](_0x69ac('0x1d'),_0x5c53c2,JSON[_0x69ac('0x12')](_0xdc4b40));_0x1c7c7d(_0xdc4b40);})[_0x69ac('0x17')](function(_0x4bd1bf){logger[_0x69ac('0x13')]('UpdateChatQueueReport',_0x4bd1bf['message'],_0x5c53c2);_0x28782e(_0x4d4c17[_0x69ac('0x13')](0x1f4,_0x4bd1bf[_0x69ac('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 18bf67b..22ecb2a 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 _0x1040=['index','describe','show','post','create','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x204b09,_0x58b9a8){var _0x2b7238=function(_0xadd03a){while(--_0xadd03a){_0x204b09['push'](_0x204b09['shift']());}};_0x2b7238(++_0x58b9a8);}(_0x1040,0x16f));var _0x0104=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0x1040[_0x386c3e];return _0x4b8e13;};'use strict';var multer=require(_0x0104('0x0'));var util=require(_0x0104('0x1'));var path=require(_0x0104('0x2'));var timeout=require(_0x0104('0x3'));var express=require(_0x0104('0x4'));var router=express[_0x0104('0x5')]();var fs_extra=require(_0x0104('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x0104('0x7'));var config=require(_0x0104('0x8'));var controller=require('./chatQueueReport.controller');router[_0x0104('0x9')]('/',auth[_0x0104('0xa')](),controller[_0x0104('0xb')]);router[_0x0104('0x9')]('/describe',auth[_0x0104('0xa')](),controller[_0x0104('0xc')]);router[_0x0104('0x9')]('/:id',auth[_0x0104('0xa')](),controller[_0x0104('0xd')]);router[_0x0104('0xe')]('/',auth['isAuthenticated'](),controller[_0x0104('0xf')]);router[_0x0104('0x10')](_0x0104('0x11'),auth['isAuthenticated'](),controller[_0x0104('0x12')]);router[_0x0104('0x13')](_0x0104('0x11'),auth[_0x0104('0xa')](),controller['destroy']);module[_0x0104('0x14')]=router;
\ No newline at end of file
+var _0x0826=['post','create','put','update','delete','multer','util','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','index','get','/describe','isAuthenticated','describe','/:id','show'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0826,0xcd));var _0x6082=function(_0x382410,_0x3f67c9){_0x382410=_0x382410-0x0;var _0x1a603d=_0x0826[_0x382410];return _0x1a603d;};'use strict';var multer=require(_0x6082('0x0'));var util=require(_0x6082('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6082('0x2'));var router=express[_0x6082('0x3')]();var fs_extra=require(_0x6082('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x6082('0x5'));var config=require(_0x6082('0x6'));var controller=require(_0x6082('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6082('0x8')]);router[_0x6082('0x9')](_0x6082('0xa'),auth[_0x6082('0xb')](),controller[_0x6082('0xc')]);router[_0x6082('0x9')](_0x6082('0xd'),auth['isAuthenticated'](),controller[_0x6082('0xe')]);router[_0x6082('0xf')]('/',auth['isAuthenticated'](),controller[_0x6082('0x10')]);router[_0x6082('0x11')](_0x6082('0xd'),auth[_0x6082('0xb')](),controller[_0x6082('0x12')]);router[_0x6082('0x13')](_0x6082('0xd'),auth['isAuthenticated'](),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 6672271..cd11f5c 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 _0xf4eb=['NOW','moment','account','queue','DATE'];(function(_0x323d9e,_0x329440){var _0x2249e7=function(_0x3ec72f){while(--_0x3ec72f){_0x323d9e['push'](_0x323d9e['shift']());}};_0x2249e7(++_0x329440);}(_0xf4eb,0xec));var _0xbf4e=function(_0x5e48d9,_0x3a84f9){_0x5e48d9=_0x5e48d9-0x0;var _0x2b4922=_0xf4eb[_0x5e48d9];return _0x2b4922;};'use strict';var moment=require(_0xbf4e('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xbf4e('0x1'),'agent','queue'),'allowNull':![],'defaultValue':_0xbf4e('0x2')},'transferredAt':{'type':Sequelize[_0xbf4e('0x3')],'allowNull':![],'defaultValue':Sequelize[_0xbf4e('0x4')]}};
\ No newline at end of file
+var _0x00bb=['moment','sequelize','exports','ENUM','agent','queue','DATE','NOW'];(function(_0x3feeec,_0x1bc0c8){var _0x2fcc54=function(_0x88a3f){while(--_0x88a3f){_0x3feeec['push'](_0x3feeec['shift']());}};_0x2fcc54(++_0x1bc0c8);}(_0x00bb,0x1d8));var _0xb00b=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x00bb[_0x1d9aa0];return _0x226868;};'use strict';var moment=require(_0xb00b('0x0'));var Sequelize=require(_0xb00b('0x1'));module[_0xb00b('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb00b('0x3')]('account',_0xb00b('0x4'),_0xb00b('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xb00b('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xb00b('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 12e9d35..84d9d0f 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 _0x552c=['create','body','params','describe','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','fs-extra','lodash','jsforce','desk.js','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','error','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','sort','where','pick','merge','type','options','include','rows','catch','show','includeAll','find'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x552c,0x114));var _0xc552=function(_0x1b39eb,_0xe33080){_0x1b39eb=_0x1b39eb-0x0;var _0x4fe80e=_0x552c[_0x1b39eb];return _0x4fe80e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc552('0x0'));var zipdir=require(_0xc552('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xc552('0x2'));var BPromise=require(_0xc552('0x3'));var Mustache=require(_0xc552('0x4'));var util=require(_0xc552('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xc552('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc552('0x7'));var _=require(_0xc552('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xc552('0x9'));var deskjs=require(_0xc552('0xa'));var toCsv=require(_0xc552('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xc552('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc552('0xc'));var logger=require(_0xc552('0xd'))(_0xc552('0xe'));var utils=require(_0xc552('0xf'));var config=require('../../config/environment');var licenseUtil=require(_0xc552('0x10'));var db=require(_0xc552('0x11'))['db'];function respondWithStatusCode(_0x115477,_0x3be0cc){_0x3be0cc=_0x3be0cc||0xcc;return function(_0x103caa){if(_0x103caa){return _0x115477[_0xc552('0x12')](_0x3be0cc);}return _0x115477[_0xc552('0x13')](_0x3be0cc)[_0xc552('0x14')]();};}function respondWithResult(_0x4afc33,_0xe2bf6b){_0xe2bf6b=_0xe2bf6b||0xc8;return function(_0x38dd6d){if(_0x38dd6d){return _0x4afc33['status'](_0xe2bf6b)[_0xc552('0x15')](_0x38dd6d);}};}function respondWithFilteredResult(_0x4331b1,_0x49e101){return function(_0x1f8a1d){if(_0x1f8a1d){var _0x1aa0c8=typeof _0x49e101['offset']==='undefined'&&typeof _0x49e101[_0xc552('0x16')]===_0xc552('0x17');var _0x3c3f81=_0x1f8a1d[_0xc552('0x18')];var _0x597d4a=_0x1aa0c8?0x0:_0x49e101['offset'];var _0x498054=_0x1aa0c8?_0x1f8a1d[_0xc552('0x18')]:_0x49e101['offset']+_0x49e101[_0xc552('0x16')];var _0x3ec885;if(_0x498054>=_0x3c3f81){_0x498054=_0x3c3f81;_0x3ec885=0xc8;}else{_0x3ec885=0xce;}_0x4331b1['status'](_0x3ec885);return _0x4331b1[_0xc552('0x19')](_0xc552('0x1a'),_0x597d4a+'-'+_0x498054+'/'+_0x3c3f81)[_0xc552('0x15')](_0x1f8a1d);}return null;};}function patchUpdates(_0x447c48){return function(_0x117560){try{jsonpatch['apply'](_0x117560,_0x447c48,!![]);}catch(_0x23323a){return BPromise[_0xc552('0x1b')](_0x23323a);}return _0x117560[_0xc552('0x1c')]();};}function saveUpdates(_0x292dae,_0xe59879){return function(_0x3ac16e){if(_0x3ac16e){return _0x3ac16e[_0xc552('0x1d')](_0x292dae)[_0xc552('0x1e')](function(_0x5c5f37){return _0x5c5f37;});}return null;};}function removeEntity(_0x16ebd3,_0x9135a1){return function(_0x1d5835){if(_0x1d5835){return _0x1d5835[_0xc552('0x1f')]()[_0xc552('0x1e')](function(){_0x16ebd3[_0xc552('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c7cb3,_0x3fcb1a){return function(_0xb506a2){if(!_0xb506a2){_0x1c7cb3['sendStatus'](0x194);}return _0xb506a2;};}function handleError(_0x1420dc,_0x594281){_0x594281=_0x594281||0x1f4;return function(_0x4529a5){logger[_0xc552('0x20')](_0x4529a5['stack']);if(_0x4529a5['name']){delete _0x4529a5['name'];}_0x1420dc[_0xc552('0x13')](_0x594281)[_0xc552('0x21')](_0x4529a5);};}exports[_0xc552('0x22')]=function(_0x39a07c,_0x4f43c9){var _0x331006={},_0x191aba={},_0x2fde05={'count':0x0,'rows':[]};var _0x2a554=_[_0xc552('0x23')](db[_0xc552('0x24')][_0xc552('0x25')],function(_0x23f9b9){return{'name':_0x23f9b9[_0xc552('0x26')],'type':_0x23f9b9['type'][_0xc552('0x27')]};});_0x191aba[_0xc552('0x28')]=_[_0xc552('0x23')](_0x2a554,_0xc552('0x29'));_0x191aba[_0xc552('0x2a')]=_[_0xc552('0x2b')](_0x39a07c[_0xc552('0x2a')]);_0x191aba[_0xc552('0x2c')]=_[_0xc552('0x2d')](_0x191aba[_0xc552('0x28')],_0x191aba['query']);_0x331006[_0xc552('0x2e')]=_['intersection'](_0x191aba['model'],qs[_0xc552('0x2f')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x2f')]));_0x331006['attributes']=_0x331006[_0xc552('0x2e')][_0xc552('0x30')]?_0x331006[_0xc552('0x2e')]:_0x191aba['model'];if(!_0x39a07c[_0xc552('0x2a')][_0xc552('0x31')](_0xc552('0x32'))){_0x331006[_0xc552('0x16')]=qs[_0xc552('0x16')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x16')]);_0x331006[_0xc552('0x33')]=qs['offset'](_0x39a07c[_0xc552('0x2a')]['offset']);}_0x331006['order']=qs[_0xc552('0x34')](_0x39a07c[_0xc552('0x2a')][_0xc552('0x34')]);_0x331006[_0xc552('0x35')]=qs[_0xc552('0x2c')](_[_0xc552('0x36')](_0x39a07c[_0xc552('0x2a')],_0x191aba['filters']),_0x2a554);if(_0x39a07c[_0xc552('0x2a')]['filter']){_0x331006[_0xc552('0x35')]=_[_0xc552('0x37')](_0x331006[_0xc552('0x35')],{'$or':_[_0xc552('0x23')](_0x2a554,function(_0xc3c9f1){if(_0xc3c9f1[_0xc552('0x38')]!=='VIRTUAL'){var _0x360f23={};_0x360f23[_0xc3c9f1['name']]={'$like':'%'+_0x39a07c['query']['filter']+'%'};return _0x360f23;}})});}_0x331006=_[_0xc552('0x37')]({},_0x331006,_0x39a07c[_0xc552('0x39')]);var _0xd8c1d9={'where':_0x331006[_0xc552('0x35')]};return db['ChatTransferReport'][_0xc552('0x18')](_0xd8c1d9)[_0xc552('0x1e')](function(_0x45e890){_0x2fde05[_0xc552('0x18')]=_0x45e890;if(_0x39a07c[_0xc552('0x2a')]['includeAll']){_0x331006[_0xc552('0x3a')]=[{'all':!![]}];}return db[_0xc552('0x24')]['findAll'](_0x331006);})[_0xc552('0x1e')](function(_0x15321a){_0x2fde05[_0xc552('0x3b')]=_0x15321a;return _0x2fde05;})[_0xc552('0x1e')](respondWithFilteredResult(_0x4f43c9,_0x331006))[_0xc552('0x3c')](handleError(_0x4f43c9,null));};exports[_0xc552('0x3d')]=function(_0x33657f,_0x55c1fc){var _0x1e8eb5={'raw':!![],'where':{'id':_0x33657f['params']['id']}},_0x124f7a={};_0x124f7a[_0xc552('0x28')]=_[_0xc552('0x2b')](db[_0xc552('0x24')][_0xc552('0x25')]);_0x124f7a[_0xc552('0x2a')]=_[_0xc552('0x2b')](_0x33657f[_0xc552('0x2a')]);_0x124f7a[_0xc552('0x2c')]=_['intersection'](_0x124f7a[_0xc552('0x28')],_0x124f7a[_0xc552('0x2a')]);_0x1e8eb5['attributes']=_[_0xc552('0x2d')](_0x124f7a[_0xc552('0x28')],qs[_0xc552('0x2f')](_0x33657f[_0xc552('0x2a')][_0xc552('0x2f')]));_0x1e8eb5[_0xc552('0x2e')]=_0x1e8eb5['attributes']['length']?_0x1e8eb5[_0xc552('0x2e')]:_0x124f7a[_0xc552('0x28')];if(_0x33657f['query'][_0xc552('0x3e')]){_0x1e8eb5[_0xc552('0x3a')]=[{'all':!![]}];}_0x1e8eb5=_[_0xc552('0x37')]({},_0x1e8eb5,_0x33657f['options']);return db[_0xc552('0x24')][_0xc552('0x3f')](_0x1e8eb5)['then'](handleEntityNotFound(_0x55c1fc,null))[_0xc552('0x1e')](respondWithResult(_0x55c1fc,null))[_0xc552('0x3c')](handleError(_0x55c1fc,null));};exports[_0xc552('0x40')]=function(_0x351424,_0xee72c3){return db['ChatTransferReport'][_0xc552('0x40')](_0x351424['body'],{})['then'](respondWithResult(_0xee72c3,0xc9))[_0xc552('0x3c')](handleError(_0xee72c3,null));};exports[_0xc552('0x1d')]=function(_0x4356bf,_0x5048f8){if(_0x4356bf[_0xc552('0x41')]['id']){delete _0x4356bf[_0xc552('0x41')]['id'];}return db['ChatTransferReport'][_0xc552('0x3f')]({'where':{'id':_0x4356bf[_0xc552('0x42')]['id']}})['then'](handleEntityNotFound(_0x5048f8,null))[_0xc552('0x1e')](saveUpdates(_0x4356bf[_0xc552('0x41')],null))[_0xc552('0x1e')](respondWithResult(_0x5048f8,null))[_0xc552('0x3c')](handleError(_0x5048f8,null));};exports[_0xc552('0x1f')]=function(_0x4300e8,_0x2504c1){return db[_0xc552('0x24')][_0xc552('0x3f')]({'where':{'id':_0x4300e8[_0xc552('0x42')]['id']}})[_0xc552('0x1e')](handleEntityNotFound(_0x2504c1,null))['then'](removeEntity(_0x2504c1,null))[_0xc552('0x3c')](handleError(_0x2504c1,null));};exports[_0xc552('0x43')]=function(_0x17ea53,_0x1ea96e){return db[_0xc552('0x24')]['describe']()[_0xc552('0x1e')](respondWithResult(_0x1ea96e,null))['catch'](handleError(_0x1ea96e,null));};
\ No newline at end of file
+var _0xae2e=['to-csv','fs-extra','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','include','options','find','create','body','describe','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox'];(function(_0x30b85d,_0x3dbb26){var _0x38b87f=function(_0x5e4fef){while(--_0x5e4fef){_0x30b85d['push'](_0x30b85d['shift']());}};_0x38b87f(++_0x3dbb26);}(_0xae2e,0x17e));var _0xeae2=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xae2e[_0x3947c9];return _0x2e7871;};'use strict';var emlformat=require(_0xeae2('0x0'));var rimraf=require(_0xeae2('0x1'));var zipdir=require(_0xeae2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xeae2('0x3'));var BPromise=require(_0xeae2('0x4'));var Mustache=require('mustache');var util=require(_0xeae2('0x5'));var path=require(_0xeae2('0x6'));var sox=require(_0xeae2('0x7'));var csv=require(_0xeae2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xeae2('0x9'));var _=require(_0xeae2('0xa'));var squel=require(_0xeae2('0xb'));var crypto=require('crypto');var jsforce=require(_0xeae2('0xc'));var deskjs=require(_0xeae2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xeae2('0xe'));var Papa=require('papaparse');var Redis=require(_0xeae2('0xf'));var authService=require(_0xeae2('0x10'));var qs=require(_0xeae2('0x11'));var as=require(_0xeae2('0x12'));var hardwareService=require(_0xeae2('0x13'));var logger=require(_0xeae2('0x14'))(_0xeae2('0x15'));var utils=require(_0xeae2('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xeae2('0x17'));var db=require(_0xeae2('0x18'))['db'];function respondWithStatusCode(_0xd4e7e8,_0x1491fc){_0x1491fc=_0x1491fc||0xcc;return function(_0x2e7a6b){if(_0x2e7a6b){return _0xd4e7e8[_0xeae2('0x19')](_0x1491fc);}return _0xd4e7e8[_0xeae2('0x1a')](_0x1491fc)[_0xeae2('0x1b')]();};}function respondWithResult(_0x4e1236,_0x58553c){_0x58553c=_0x58553c||0xc8;return function(_0x1caa39){if(_0x1caa39){return _0x4e1236[_0xeae2('0x1a')](_0x58553c)[_0xeae2('0x1c')](_0x1caa39);}};}function respondWithFilteredResult(_0x4f5b14,_0x590f8b){return function(_0x4871f4){if(_0x4871f4){var _0x16a6cb=typeof _0x590f8b[_0xeae2('0x1d')]===_0xeae2('0x1e')&&typeof _0x590f8b['limit']==='undefined';var _0x5a8a57=_0x4871f4[_0xeae2('0x1f')];var _0x5ebb74=_0x16a6cb?0x0:_0x590f8b[_0xeae2('0x1d')];var _0x1774d9=_0x16a6cb?_0x4871f4[_0xeae2('0x1f')]:_0x590f8b['offset']+_0x590f8b['limit'];var _0x2084f2;if(_0x1774d9>=_0x5a8a57){_0x1774d9=_0x5a8a57;_0x2084f2=0xc8;}else{_0x2084f2=0xce;}_0x4f5b14['status'](_0x2084f2);return _0x4f5b14[_0xeae2('0x20')](_0xeae2('0x21'),_0x5ebb74+'-'+_0x1774d9+'/'+_0x5a8a57)['json'](_0x4871f4);}return null;};}function patchUpdates(_0x2b838f){return function(_0x2e8019){try{jsonpatch[_0xeae2('0x22')](_0x2e8019,_0x2b838f,!![]);}catch(_0x1115e6){return BPromise[_0xeae2('0x23')](_0x1115e6);}return _0x2e8019[_0xeae2('0x24')]();};}function saveUpdates(_0x52f73e,_0x4263e8){return function(_0x12b828){if(_0x12b828){return _0x12b828[_0xeae2('0x25')](_0x52f73e)[_0xeae2('0x26')](function(_0x5e5eca){return _0x5e5eca;});}return null;};}function removeEntity(_0x516dc3,_0x4f083e){return function(_0x46f7fd){if(_0x46f7fd){return _0x46f7fd['destroy']()[_0xeae2('0x26')](function(){_0x516dc3[_0xeae2('0x1a')](0xcc)[_0xeae2('0x1b')]();});}};}function handleEntityNotFound(_0x1476bb,_0x290abd){return function(_0x7ff416){if(!_0x7ff416){_0x1476bb[_0xeae2('0x19')](0x194);}return _0x7ff416;};}function handleError(_0x2b6800,_0x432f8b){_0x432f8b=_0x432f8b||0x1f4;return function(_0x5060c3){logger[_0xeae2('0x27')](_0x5060c3[_0xeae2('0x28')]);if(_0x5060c3['name']){delete _0x5060c3[_0xeae2('0x29')];}_0x2b6800[_0xeae2('0x1a')](_0x432f8b)[_0xeae2('0x2a')](_0x5060c3);};}exports[_0xeae2('0x2b')]=function(_0x272966,_0x1f98e4){var _0x556271={},_0x14ea44={},_0x3f2036={'count':0x0,'rows':[]};var _0x4e99de=_[_0xeae2('0x2c')](db[_0xeae2('0x2d')][_0xeae2('0x2e')],function(_0x2d8941){return{'name':_0x2d8941[_0xeae2('0x2f')],'type':_0x2d8941[_0xeae2('0x30')]['key']};});_0x14ea44['model']=_[_0xeae2('0x2c')](_0x4e99de,_0xeae2('0x29'));_0x14ea44['query']=_[_0xeae2('0x31')](_0x272966[_0xeae2('0x32')]);_0x14ea44[_0xeae2('0x33')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],_0x14ea44[_0xeae2('0x32')]);_0x556271[_0xeae2('0x36')]=_[_0xeae2('0x34')](_0x14ea44[_0xeae2('0x35')],qs[_0xeae2('0x37')](_0x272966[_0xeae2('0x32')][_0xeae2('0x37')]));_0x556271['attributes']=_0x556271[_0xeae2('0x36')][_0xeae2('0x38')]?_0x556271[_0xeae2('0x36')]:_0x14ea44[_0xeae2('0x35')];if(!_0x272966['query'][_0xeae2('0x39')](_0xeae2('0x3a'))){_0x556271[_0xeae2('0x3b')]=qs[_0xeae2('0x3b')](_0x272966[_0xeae2('0x32')][_0xeae2('0x3b')]);_0x556271[_0xeae2('0x1d')]=qs[_0xeae2('0x1d')](_0x272966[_0xeae2('0x32')]['offset']);}_0x556271[_0xeae2('0x3c')]=qs['sort'](_0x272966[_0xeae2('0x32')][_0xeae2('0x3d')]);_0x556271[_0xeae2('0x3e')]=qs[_0xeae2('0x33')](_[_0xeae2('0x3f')](_0x272966['query'],_0x14ea44['filters']),_0x4e99de);if(_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]){_0x556271[_0xeae2('0x3e')]=_[_0xeae2('0x41')](_0x556271[_0xeae2('0x3e')],{'$or':_['map'](_0x4e99de,function(_0x5a5218){if(_0x5a5218[_0xeae2('0x30')]!==_0xeae2('0x42')){var _0xa330bf={};_0xa330bf[_0x5a5218[_0xeae2('0x29')]]={'$like':'%'+_0x272966[_0xeae2('0x32')][_0xeae2('0x40')]+'%'};return _0xa330bf;}})});}_0x556271=_[_0xeae2('0x41')]({},_0x556271,_0x272966['options']);var _0x14bb5d={'where':_0x556271[_0xeae2('0x3e')]};return db[_0xeae2('0x2d')]['count'](_0x14bb5d)[_0xeae2('0x26')](function(_0x4e0da6){_0x3f2036['count']=_0x4e0da6;if(_0x272966[_0xeae2('0x32')][_0xeae2('0x43')]){_0x556271['include']=[{'all':!![]}];}return db[_0xeae2('0x2d')][_0xeae2('0x44')](_0x556271);})[_0xeae2('0x26')](function(_0x2b8bff){_0x3f2036['rows']=_0x2b8bff;return _0x3f2036;})['then'](respondWithFilteredResult(_0x1f98e4,_0x556271))[_0xeae2('0x45')](handleError(_0x1f98e4,null));};exports[_0xeae2('0x46')]=function(_0x4d795b,_0x4fa9ad){var _0x389f6c={'raw':!![],'where':{'id':_0x4d795b[_0xeae2('0x47')]['id']}},_0xc52ef={};_0xc52ef[_0xeae2('0x35')]=_[_0xeae2('0x31')](db['ChatTransferReport']['rawAttributes']);_0xc52ef[_0xeae2('0x32')]=_['keys'](_0x4d795b[_0xeae2('0x32')]);_0xc52ef['filters']=_['intersection'](_0xc52ef[_0xeae2('0x35')],_0xc52ef[_0xeae2('0x32')]);_0x389f6c[_0xeae2('0x36')]=_['intersection'](_0xc52ef['model'],qs[_0xeae2('0x37')](_0x4d795b[_0xeae2('0x32')][_0xeae2('0x37')]));_0x389f6c[_0xeae2('0x36')]=_0x389f6c[_0xeae2('0x36')][_0xeae2('0x38')]?_0x389f6c[_0xeae2('0x36')]:_0xc52ef['model'];if(_0x4d795b[_0xeae2('0x32')][_0xeae2('0x43')]){_0x389f6c[_0xeae2('0x48')]=[{'all':!![]}];}_0x389f6c=_[_0xeae2('0x41')]({},_0x389f6c,_0x4d795b[_0xeae2('0x49')]);return db[_0xeae2('0x2d')][_0xeae2('0x4a')](_0x389f6c)['then'](handleEntityNotFound(_0x4fa9ad,null))[_0xeae2('0x26')](respondWithResult(_0x4fa9ad,null))[_0xeae2('0x45')](handleError(_0x4fa9ad,null));};exports['create']=function(_0xbad9f8,_0x81bee0){return db[_0xeae2('0x2d')][_0xeae2('0x4b')](_0xbad9f8[_0xeae2('0x4c')],{})[_0xeae2('0x26')](respondWithResult(_0x81bee0,0xc9))[_0xeae2('0x45')](handleError(_0x81bee0,null));};exports[_0xeae2('0x25')]=function(_0x1fb98c,_0x1b321b){if(_0x1fb98c[_0xeae2('0x4c')]['id']){delete _0x1fb98c[_0xeae2('0x4c')]['id'];}return db[_0xeae2('0x2d')]['find']({'where':{'id':_0x1fb98c[_0xeae2('0x47')]['id']}})[_0xeae2('0x26')](handleEntityNotFound(_0x1b321b,null))[_0xeae2('0x26')](saveUpdates(_0x1fb98c[_0xeae2('0x4c')],null))['then'](respondWithResult(_0x1b321b,null))[_0xeae2('0x45')](handleError(_0x1b321b,null));};exports['destroy']=function(_0x4b1bdf,_0x203eae){return db[_0xeae2('0x2d')][_0xeae2('0x4a')]({'where':{'id':_0x4b1bdf[_0xeae2('0x47')]['id']}})['then'](handleEntityNotFound(_0x203eae,null))[_0xeae2('0x26')](removeEntity(_0x203eae,null))[_0xeae2('0x45')](handleError(_0x203eae,null));};exports[_0xeae2('0x4d')]=function(_0x2c9f3d,_0x5387e1){return db[_0xeae2('0x2d')][_0xeae2('0x4d')]()[_0xeae2('0x26')](respondWithResult(_0x5387e1,null))[_0xeae2('0x45')](handleError(_0x5387e1,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 26d0e78..b079391 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 _0xe8a2=['define','ChatTransferReport','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xe8a2,0x121));var _0x2e8a=function(_0x4f8d8a,_0x37bd37){_0x4f8d8a=_0x4f8d8a-0x0;var _0x5cf5cd=_0xe8a2[_0x4f8d8a];return _0x5cf5cd;};'use strict';var _=require(_0x2e8a('0x0'));var util=require(_0x2e8a('0x1'));var logger=require(_0x2e8a('0x2'))(_0x2e8a('0x3'));var moment=require('moment');var BPromise=require(_0x2e8a('0x4'));var rp=require(_0x2e8a('0x5'));var fs=require('fs');var path=require(_0x2e8a('0x6'));var rimraf=require(_0x2e8a('0x7'));var config=require(_0x2e8a('0x8'));var attributes=require(_0x2e8a('0x9'));module['exports']=function(_0x4a4276,_0x292e89){return _0x4a4276[_0x2e8a('0xa')](_0x2e8a('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x2e8a('0xc'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x5ac3=['../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x19691f,_0x159737){var _0x5677b6=function(_0x41a9b2){while(--_0x41a9b2){_0x19691f['push'](_0x19691f['shift']());}};_0x5677b6(++_0x159737);}(_0x5ac3,0x68));var _0x35ac=function(_0xdf0f2a,_0x382763){_0xdf0f2a=_0xdf0f2a-0x0;var _0x4000f8=_0x5ac3[_0xdf0f2a];return _0x4000f8;};'use strict';var _=require(_0x35ac('0x0'));var util=require(_0x35ac('0x1'));var logger=require('../../config/logger')(_0x35ac('0x2'));var moment=require(_0x35ac('0x3'));var BPromise=require(_0x35ac('0x4'));var rp=require(_0x35ac('0x5'));var fs=require('fs');var path=require(_0x35ac('0x6'));var rimraf=require(_0x35ac('0x7'));var config=require(_0x35ac('0x8'));var attributes=require(_0x35ac('0x9'));module[_0x35ac('0xa')]=function(_0x1ef8f9,_0x19b3cf){return _0x1ef8f9[_0x35ac('0xb')]('ChatTransferReport',attributes,{'tableName':_0x35ac('0xc'),'paranoid':![],'indexes':[{'name':_0x35ac('0xd'),'fields':[_0x35ac('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index cf5f15f..32e9ba2 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 _0x88b5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x2deee9,_0x58b00f){var _0x51a55e=function(_0x4de56a){while(--_0x4de56a){_0x2deee9['push'](_0x2deee9['shift']());}};_0x51a55e(++_0x58b00f);}(_0x88b5,0xa5));var _0x588b=function(_0x45906b,_0xc2c7ae){_0x45906b=_0x45906b-0x0;var _0x8fc176=_0x88b5[_0x45906b];return _0x8fc176;};'use strict';var _=require('lodash');var util=require(_0x588b('0x0'));var moment=require(_0x588b('0x1'));var BPromise=require(_0x588b('0x2'));var rs=require(_0x588b('0x3'));var fs=require('fs');var Redis=require(_0x588b('0x4'));var db=require(_0x588b('0x5'))['db'];var utils=require(_0x588b('0x6'));var logger=require(_0x588b('0x7'))(_0x588b('0x8'));var config=require('../../config/environment');var jayson=require(_0x588b('0x9'));var client=jayson[_0x588b('0xa')][_0x588b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x186f25,_0x182668,_0x567766){return new BPromise(function(_0x45e1a0,_0x312fd4){return client[_0x588b('0xc')](_0x186f25,_0x567766)[_0x588b('0xd')](function(_0x451698){logger[_0x588b('0xe')](_0x588b('0xf'),_0x182668,'request\x20sent');logger[_0x588b('0x10')](_0x588b('0x11'),_0x182668,_0x588b('0x12'),JSON[_0x588b('0x13')](_0x451698));if(_0x451698[_0x588b('0x14')]){if(_0x451698['error'][_0x588b('0x15')]===0x1f4){logger[_0x588b('0x14')](_0x588b('0xf'),_0x182668,_0x451698['error'][_0x588b('0x16')]);return _0x312fd4(_0x451698[_0x588b('0x14')]['message']);}logger[_0x588b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x182668,_0x451698[_0x588b('0x14')][_0x588b('0x16')]);return _0x45e1a0(_0x451698[_0x588b('0x14')][_0x588b('0x16')]);}else{logger[_0x588b('0xe')](_0x588b('0xf'),_0x182668,_0x588b('0x12'));_0x45e1a0(_0x451698['result']['message']);}})[_0x588b('0x17')](function(_0x34238d){logger[_0x588b('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x182668,_0x34238d);_0x312fd4(_0x34238d);});});}
\ No newline at end of file
+var _0x0841=['ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','client','request','then'];(function(_0x3b5775,_0x53eefd){var _0x4a241f=function(_0x5f424e){while(--_0x5f424e){_0x3b5775['push'](_0x3b5775['shift']());}};_0x4a241f(++_0x53eefd);}(_0x0841,0x9e));var _0x1084=function(_0x284328,_0x4d674e){_0x284328=_0x284328-0x0;var _0x6efdac=_0x0841[_0x284328];return _0x6efdac;};'use strict';var _=require(_0x1084('0x0'));var util=require(_0x1084('0x1'));var moment=require(_0x1084('0x2'));var BPromise=require(_0x1084('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1084('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1084('0x5'))(_0x1084('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1084('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x298c3f,_0x59869d,_0x341fc0){return new BPromise(function(_0x5b00d8,_0x19cac7){return client[_0x1084('0x8')](_0x298c3f,_0x341fc0)[_0x1084('0x9')](function(_0xdcaa33){logger['info'](_0x1084('0xa'),_0x59869d,_0x1084('0xb'));logger[_0x1084('0xc')](_0x1084('0xd'),_0x59869d,_0x1084('0xb'),JSON[_0x1084('0xe')](_0xdcaa33));if(_0xdcaa33['error']){if(_0xdcaa33[_0x1084('0xf')][_0x1084('0x10')]===0x1f4){logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x19cac7(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}logger['error'](_0x1084('0xa'),_0x59869d,_0xdcaa33['error'][_0x1084('0x11')]);return _0x5b00d8(_0xdcaa33[_0x1084('0xf')][_0x1084('0x11')]);}else{logger[_0x1084('0x12')](_0x1084('0xa'),_0x59869d,'request\x20sent');_0x5b00d8(_0xdcaa33[_0x1084('0x13')][_0x1084('0x11')]);}})[_0x1084('0x14')](function(_0x5912ce){logger[_0x1084('0xf')](_0x1084('0xa'),_0x59869d,_0x5912ce);_0x19cac7(_0x5912ce);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 57e8d76..2695c09 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 _0xe7e2=['isAuthenticated','index','/describe','/:id','show','post','create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get'];(function(_0x493ef6,_0x31f63d){var _0x2c56d4=function(_0x1c0d47){while(--_0x1c0d47){_0x493ef6['push'](_0x493ef6['shift']());}};_0x2c56d4(++_0x31f63d);}(_0xe7e2,0x1c3));var _0x2e7e=function(_0x7b5f9a,_0x138869){_0x7b5f9a=_0x7b5f9a-0x0;var _0x45670f=_0xe7e2[_0x7b5f9a];return _0x45670f;};'use strict';var multer=require('multer');var util=require(_0x2e7e('0x0'));var path=require(_0x2e7e('0x1'));var timeout=require(_0x2e7e('0x2'));var express=require(_0x2e7e('0x3'));var router=express[_0x2e7e('0x4')]();var fs_extra=require(_0x2e7e('0x5'));var auth=require(_0x2e7e('0x6'));var interaction=require(_0x2e7e('0x7'));var config=require(_0x2e7e('0x8'));var controller=require(_0x2e7e('0x9'));router[_0x2e7e('0xa')]('/',auth[_0x2e7e('0xb')](),controller[_0x2e7e('0xc')]);router[_0x2e7e('0xa')](_0x2e7e('0xd'),auth[_0x2e7e('0xb')](),controller['describe']);router[_0x2e7e('0xa')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller[_0x2e7e('0xf')]);router[_0x2e7e('0x10')]('/',auth[_0x2e7e('0xb')](),controller[_0x2e7e('0x11')]);router[_0x2e7e('0x12')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller['update']);router[_0x2e7e('0x13')](_0x2e7e('0xe'),auth[_0x2e7e('0xb')](),controller[_0x2e7e('0x14')]);module[_0x2e7e('0x15')]=router;
\ No newline at end of file
+var _0x2000=['../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller','index','get','/describe','isAuthenticated','describe','show','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra'];(function(_0x4f4b34,_0x47dda1){var _0xac9265=function(_0x5340fa){while(--_0x5340fa){_0x4f4b34['push'](_0x4f4b34['shift']());}};_0xac9265(++_0x47dda1);}(_0x2000,0x68));var _0x0200=function(_0x48ccaa,_0x118a60){_0x48ccaa=_0x48ccaa-0x0;var _0x3c11ab=_0x2000[_0x48ccaa];return _0x3c11ab;};'use strict';var multer=require(_0x0200('0x0'));var util=require(_0x0200('0x1'));var path=require(_0x0200('0x2'));var timeout=require(_0x0200('0x3'));var express=require(_0x0200('0x4'));var router=express['Router']();var fs_extra=require(_0x0200('0x5'));var auth=require(_0x0200('0x6'));var interaction=require(_0x0200('0x7'));var config=require('../../config/environment');var controller=require(_0x0200('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x0200('0x9')]);router[_0x0200('0xa')](_0x0200('0xb'),auth[_0x0200('0xc')](),controller[_0x0200('0xd')]);router[_0x0200('0xa')]('/:id',auth[_0x0200('0xc')](),controller[_0x0200('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0x0200('0xf')]);router[_0x0200('0x10')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x12')]);router[_0x0200('0x13')](_0x0200('0x11'),auth[_0x0200('0xc')](),controller[_0x0200('0x14')]);module[_0x0200('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index c47feaf..d8e923c 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 _0x235a=['Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','stringify','input','name','getDataValue','onlineForm','parse','setDataValue','Comments','Leave\x20your\x20comments','offlineForm','generate','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}}','bottom_right','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','Generated\x20by\x20XCALLY\x20Motion','sequelize','randomstring','exports','STRING','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM'];(function(_0x1cdf3d,_0xf691e2){var _0x33a5c1=function(_0xcd3c7a){while(--_0xcd3c7a){_0x1cdf3d['push'](_0x1cdf3d['shift']());}};_0x33a5c1(++_0xf691e2);}(_0x235a,0xfe));var _0xa235=function(_0x2bbd7d,_0x2998d4){_0x2bbd7d=_0x2bbd7d-0x0;var _0x4c8250=_0x235a[_0x2bbd7d];return _0x4c8250;};'use strict';var Sequelize=require(_0xa235('0x0'));var rs=require(_0xa235('0x1'));module[_0xa235('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xa235('0x3')]},'mapKey':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x4')},'mapKeyOffline':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'email'},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa235('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xa235('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xa235('0x3')]},'animation':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xa235('0x9')]('rounded','squared'),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xa')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xb')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xc')},'download_transcript':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xa235('0xe')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0xf')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x10')},'noteTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x12')},'closingMessageButton':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xb')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x13')},'conditionAgreement':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x14')},'ratingType':{'type':Sequelize[_0xa235('0x9')](_0xa235('0x15'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xa235('0xe')],'defaultValue':function(){return JSON[_0xa235('0x16')]({'items':[{'type':_0xa235('0x17'),'variable':null,'config':{'placeholder':_0xa235('0x18'),'type':'text','required':!![]},'props':{'title':_0xa235('0x18'),'helpText':''}},{'type':_0xa235('0x17'),'props':{'title':_0xa235('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa235('0x4'),'type':_0xa235('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xa235('0x19')](_0xa235('0x1a'))?JSON[_0xa235('0x1b')](this[_0xa235('0x19')](_0xa235('0x1a'))):{};},'set':function(_0x215890){return this[_0xa235('0x1c')](_0xa235('0x1a'),JSON['stringify'](_0x215890));}},'offlineForm':{'type':Sequelize[_0xa235('0xe')],'defaultValue':function(){return JSON[_0xa235('0x16')]({'items':[{'type':'input','props':{'title':_0xa235('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xa235('0x4'),'type':_0xa235('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xa235('0x1d')},'props':{'title':'Comments','helpText':_0xa235('0x1e')}}],'fromKey':0x0});},'get':function(){return this[_0xa235('0x19')](_0xa235('0x1f'))?JSON[_0xa235('0x1b')](this[_0xa235('0x19')](_0xa235('0x1f'))):{};},'set':function(_0x54b151){return this[_0xa235('0x1c')]('offlineForm',JSON[_0xa235('0x16')](_0x54b151));}},'token':{'type':Sequelize[_0xa235('0x3')],'defaultValue':function(){return rs[_0xa235('0x20')]();}},'autoclose':{'type':Sequelize[_0xa235('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xa235('0x3')]},'forwardOffline':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xa235('0x21')},'offlineMessageBody':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x22')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x23')},'skipUnmanaged':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0xb')},'enableCustomerAttachment':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xa235('0xe')]},'showAgentAvatar':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa235('0x24');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x25')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xa235('0x3')],'defaultValue':_0xa235('0x26')},'defaultTitle':{'type':Sequelize[_0xa235('0x3')]},'customerAvatar':{'type':Sequelize[_0xa235('0xe')]},'showCustomerAvatar':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xa235('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x27'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa235('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xa235('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xa235('0x28')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0xa235('0x29'),'set':function(_0x55860e){if(!_0x55860e)this[_0xa235('0x1c')](_0xa235('0x2a'),null);this['setDataValue']('mandatoryDisposition',_0x55860e);}},'vidaooEscalation':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0xa235('0x3')],'allowNull':![],'defaultValue':_0xa235('0x2b')},'vidaooNote':{'type':Sequelize[_0xa235('0x3')],'defaultValue':function(){return'Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}';}},'vidaooMetadata':{'type':Sequelize[_0xa235('0xe')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xa235('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xa235('0xe')]}};
\ No newline at end of file
+var _0x8c5f=['Form\x20submission\x20error','Note','Thanks\x20you\x20for\x20your\x20time!','Skip','ENUM','thumb','star','input','name','text','getDataValue','onlineForm','setDataValue','stringify','TEXT','textarea','Comments','offlineForm','parse','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','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','squared','Send','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted'];(function(_0x255b73,_0x5b2756){var _0x8f95dc=function(_0x396ed5){while(--_0x396ed5){_0x255b73['push'](_0x255b73['shift']());}};_0x8f95dc(++_0x5b2756);}(_0x8c5f,0xd3));var _0xf8c5=function(_0x1d5fd9,_0x39e853){_0x1d5fd9=_0x1d5fd9-0x0;var _0x3e11bc=_0x8c5f[_0x1d5fd9];return _0x3e11bc;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module['exports']={'name':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'address':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'unique':_0xf8c5('0x1')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x2')},'mapKeyOffline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x2')},'key':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x3')},'customerAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xf8c5('0x0')]},'animation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM']('rounded',_0xf8c5('0x8')),'defaultValue':'rounded'},'header_online':{'type':Sequelize['STRING'],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'header_offline':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xa')},'download_transcript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xb')},'defaultWhiteLabel':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xc')},'formSubmitSuccessMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xd')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0xe')},'noteTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0xf')},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x10')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xf8c5('0x9')},'skipMessageButton':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x11')},'conditionAgreement':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0xf8c5('0x12')]('star',_0xf8c5('0x13')),'defaultValue':_0xf8c5('0x14')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'variable':null,'config':{'placeholder':_0xf8c5('0x16'),'type':_0xf8c5('0x17'),'required':!![]},'props':{'title':_0xf8c5('0x16'),'helpText':''}},{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x19'))?JSON['parse'](this[_0xf8c5('0x18')]('onlineForm')):{};},'set':function(_0x3d1a1e){return this[_0xf8c5('0x1a')](_0xf8c5('0x19'),JSON[_0xf8c5('0x1b')](_0x3d1a1e));}},'offlineForm':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xf8c5('0x15'),'props':{'title':_0xf8c5('0x2'),'helpText':''},'config':{'required':!![],'placeholder':_0xf8c5('0x2'),'type':'email'},'variable':null},{'type':_0xf8c5('0x1d'),'config':{'placeholder':_0xf8c5('0x1e')},'props':{'title':_0xf8c5('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0xf8c5('0x18')](_0xf8c5('0x1f'))?JSON[_0xf8c5('0x20')](this[_0xf8c5('0x18')](_0xf8c5('0x1f'))):{};},'set':function(_0x2696e6){return this[_0xf8c5('0x1a')]('offlineForm',JSON['stringify'](_0x2696e6));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x21')},'offlineMessageSubject':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x22')},'enableUnmanagedNote':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x23')},'skipUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x9')},'enableCustomerAttachment':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showAgentAvatar':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xf8c5('0x0')]},'notificationTemplate':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':function(){return _0xf8c5('0x24');}},'notificationSound':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x25')},'waitForTheAssignedAgent':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x26')},'verticalAlignment':{'type':Sequelize[_0xf8c5('0x6')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':_0xf8c5('0x27')},'defaultTitle':{'type':Sequelize[_0xf8c5('0x0')]},'customerAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':_0xf8c5('0x28'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xf8c5('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0xf8c5('0x1c')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf8c5('0x6')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'comment':_0xf8c5('0x29'),'set':function(_0x20393f){if(!_0x20393f)this['setDataValue'](_0xf8c5('0x2a'),null);this['setDataValue'](_0xf8c5('0x2b'),_0x20393f);}},'vidaooEscalation':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xf8c5('0x0')]},'vidaooTopic':{'type':Sequelize[_0xf8c5('0x0')],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize[_0xf8c5('0x0')],'defaultValue':function(){return _0xf8c5('0x2c');}},'vidaooMetadata':{'type':Sequelize[_0xf8c5('0x1c')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xf8c5('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xf8c5('0x1c')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index dfd540c..16ac94c 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 _0x9e66=['ChatInteraction','externalUrl','interaction','spread','contact','lastName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','ChatOfflineMessage','originalname','server','attachments','offline-chat','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','forwardOffline','service','host','port','secure','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','mapValues','subjectOffline','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','Contact','Owner','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','Interval','Intervals','getProactiveActions','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','render','alignment','verticalAlignment','textColor','color_button','backgroundColor','sequelize','findAndCountAll','getApplications','addProactiveActions','getFields','online','false','offlineForm','items','fromKey','Attachment','Attachments','addAgents','userChatWebsite:save','removeAgents','isArray','emit','userChatWebsite:remove','getAgents','User','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','http','client','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','update','get','ChatWebsites','destroy','stack','name','send','Pause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','ChatWebsite','include','findAll','rows','show','params','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','hasOwnProperty','order','ChatWebsiteId','Disposition','removeDispositions','ids','CannedAnswer','getAnswers','findOne','removeAnswers','addLogo','sitepic','addAvatar','agentAvatar','file','customerAvatar','filename','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','Sequelize','ValidationError','createdAt','updatedAt','difference','CompanyId','ListId','from','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','CmContact','Contacts','DESC','ChatApplication','Applications','applications','list','priority','asc','account','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','device','vendor','stringify','threadId'];(function(_0x5c3315,_0x3fd991){var _0x5f0f2a=function(_0x322161){while(--_0x322161){_0x5c3315['push'](_0x5c3315['shift']());}};_0x5f0f2a(++_0x3fd991);}(_0x9e66,0x1ae));var _0x69e6=function(_0x481382,_0x166482){_0x481382=_0x481382-0x0;var _0x5d67ad=_0x9e66[_0x481382];return _0x5d67ad;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x69e6('0x0'));var jsonpatch=require(_0x69e6('0x1'));var rp=require(_0x69e6('0x2'));var moment=require(_0x69e6('0x3'));var BPromise=require(_0x69e6('0x4'));var Mustache=require(_0x69e6('0x5'));var util=require(_0x69e6('0x6'));var path=require(_0x69e6('0x7'));var sox=require(_0x69e6('0x8'));var csv=require(_0x69e6('0x9'));var ejs=require(_0x69e6('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x69e6('0xb'));var squel=require(_0x69e6('0xc'));var crypto=require(_0x69e6('0xd'));var jsforce=require(_0x69e6('0xe'));var deskjs=require(_0x69e6('0xf'));var toCsv=require(_0x69e6('0x9'));var querystring=require(_0x69e6('0x10'));var Papa=require(_0x69e6('0x11'));var Redis=require(_0x69e6('0x12'));var authService=require(_0x69e6('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x69e6('0x14'));var logger=require(_0x69e6('0x15'))(_0x69e6('0x16'));var utils=require(_0x69e6('0x17'));var config=require(_0x69e6('0x18'));var licenseUtil=require(_0x69e6('0x19'));var db=require('../../mysqldb')['db'];config[_0x69e6('0x1a')]=_[_0x69e6('0x1b')](config[_0x69e6('0x1a')],{'host':_0x69e6('0x1c'),'port':0x18eb});var socket=require(_0x69e6('0x1d'))(new Redis(config[_0x69e6('0x1a')]));require('./chatWebsite.socket')[_0x69e6('0x1e')](socket);var jayson=require(_0x69e6('0x1f'));var client=jayson['client'][_0x69e6('0x20')]({'port':0x232c});var client9002=jayson[_0x69e6('0x21')][_0x69e6('0x20')]({'port':0x232a});var client9003=jayson[_0x69e6('0x21')]['http']({'port':0x232b});var client9001=jayson[_0x69e6('0x21')][_0x69e6('0x20')]({'port':0x2329});function respondWithRpcPromise(_0x47479e,_0x3d9095,_0x303c53,_0x331928){return new BPromise(function(_0xa2726c,_0x12c3b2){var _0x442c27=_0x331928||client;return _0x442c27[_0x69e6('0x22')](_0x47479e,_0x303c53)[_0x69e6('0x23')](function(_0x2924f0){logger[_0x69e6('0x24')]('ChatWebsite,\x20%s,\x20%s',_0x3d9095,_0x69e6('0x25'));logger[_0x69e6('0x26')](_0x69e6('0x27'),_0x3d9095,'request\x20sent',JSON['stringify'](_0x2924f0));if(_0x2924f0[_0x69e6('0x28')]){if(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x29')]===0x1f4){logger['error'](_0x69e6('0x2a'),_0x3d9095,_0x2924f0['error'][_0x69e6('0x2b')]);return _0x12c3b2(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);}logger[_0x69e6('0x28')](_0x69e6('0x2a'),_0x3d9095,_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);return _0xa2726c(_0x2924f0[_0x69e6('0x28')][_0x69e6('0x2b')]);}else{logger[_0x69e6('0x24')](_0x69e6('0x2a'),_0x3d9095,_0x69e6('0x25'));_0xa2726c(_0x2924f0['result'][_0x69e6('0x2b')]);}})[_0x69e6('0x2c')](function(_0x28089e){logger['error'](_0x69e6('0x2a'),_0x3d9095,_0x28089e);_0x12c3b2(_0x28089e);});});}function respondWithStatusCode(_0xfba6d3,_0xbede29){_0xbede29=_0xbede29||0xcc;return function(_0x56af4d){if(_0x56af4d){return _0xfba6d3[_0x69e6('0x2d')](_0xbede29);}return _0xfba6d3[_0x69e6('0x2e')](_0xbede29)[_0x69e6('0x2f')]();};}function respondWithResult(_0x1f6987,_0x2baf4b){_0x2baf4b=_0x2baf4b||0xc8;return function(_0x125f4f){if(_0x125f4f){return _0x1f6987['status'](_0x2baf4b)[_0x69e6('0x30')](_0x125f4f);}};}function respondWithFilteredResult(_0x325e02,_0x2f82a5){return function(_0x2a0d28){if(_0x2a0d28){var _0xa110ed=typeof _0x2f82a5['offset']===_0x69e6('0x31')&&typeof _0x2f82a5[_0x69e6('0x32')]===_0x69e6('0x31');var _0x224556=_0x2a0d28[_0x69e6('0x33')];var _0x33e373=_0xa110ed?0x0:_0x2f82a5['offset'];var _0x56e075=_0xa110ed?_0x2a0d28[_0x69e6('0x33')]:_0x2f82a5[_0x69e6('0x34')]+_0x2f82a5['limit'];var _0x4b56d1;if(_0x56e075>=_0x224556){_0x56e075=_0x224556;_0x4b56d1=0xc8;}else{_0x4b56d1=0xce;}_0x325e02[_0x69e6('0x2e')](_0x4b56d1);return _0x325e02[_0x69e6('0x35')](_0x69e6('0x36'),_0x33e373+'-'+_0x56e075+'/'+_0x224556)[_0x69e6('0x30')](_0x2a0d28);}return null;};}function patchUpdates(_0x23cbd8){return function(_0x300208){try{jsonpatch[_0x69e6('0x37')](_0x300208,_0x23cbd8,!![]);}catch(_0x18d399){return BPromise[_0x69e6('0x38')](_0x18d399);}return _0x300208[_0x69e6('0x39')]();};}function saveUpdates(_0x35d139,_0x3fb1cc){return function(_0xd9bcfe){if(_0xd9bcfe){return _0xd9bcfe[_0x69e6('0x3a')](_0x35d139)[_0x69e6('0x23')](function(_0xffbdc2){return _0xffbdc2;});}return null;};}function removeEntity(_0x430f64,_0x412260){return function(_0x3f24f0){if(_0x3f24f0){return _0x3f24f0['destroy']()[_0x69e6('0x23')](function(){var _0x107fc1=_0x3f24f0[_0x69e6('0x3b')]({'plain':!![]});var _0x3a3f86=_0x69e6('0x3c');return db['UserProfileResource'][_0x69e6('0x3d')]({'where':{'type':_0x3a3f86,'resourceId':_0x107fc1['id']}})[_0x69e6('0x23')](function(){return _0x3f24f0;});})[_0x69e6('0x23')](function(){_0x430f64[_0x69e6('0x2e')](0xcc)[_0x69e6('0x2f')]();});}};}function handleEntityNotFound(_0x1816b5,_0x1b374a){return function(_0x14b320){if(!_0x14b320){_0x1816b5[_0x69e6('0x2d')](0x194);}return _0x14b320;};}function handleError(_0x455f6b,_0x12fbdc){_0x12fbdc=_0x12fbdc||0x1f4;return function(_0x55100b){logger[_0x69e6('0x28')](_0x55100b[_0x69e6('0x3e')]);if(_0x55100b[_0x69e6('0x3f')]){delete _0x55100b[_0x69e6('0x3f')];}_0x455f6b[_0x69e6('0x2e')](_0x12fbdc)[_0x69e6('0x40')](_0x55100b);};}exports['index']=function(_0x34eb65,_0x257cc7){var _0x4ff9f6={'include':[{'model':db[_0x69e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x34ddd6={},_0x3ba0c8={'count':0x0,'rows':[]};var _0x4d1997=_[_0x69e6('0x42')](db['ChatWebsite'][_0x69e6('0x43')],function(_0x3e4f20){return{'name':_0x3e4f20[_0x69e6('0x44')],'type':_0x3e4f20[_0x69e6('0x45')][_0x69e6('0x46')]};});_0x34ddd6[_0x69e6('0x47')]=_['map'](_0x4d1997,_0x69e6('0x3f'));_0x34ddd6[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x34eb65[_0x69e6('0x48')]);_0x34ddd6[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x34ddd6['model'],_0x34ddd6[_0x69e6('0x48')]);_0x4ff9f6[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x34ddd6[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x34eb65['query'][_0x69e6('0x4d')]));_0x4ff9f6['attributes']=_0x4ff9f6[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x4ff9f6['attributes']:_0x34ddd6[_0x69e6('0x47')];if(!_0x34eb65[_0x69e6('0x48')]['hasOwnProperty'](_0x69e6('0x4f'))){_0x4ff9f6[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x32')]);_0x4ff9f6[_0x69e6('0x34')]=qs['offset'](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x34')]);}_0x4ff9f6['order']=qs[_0x69e6('0x50')](_0x34eb65[_0x69e6('0x48')][_0x69e6('0x50')]);_0x4ff9f6[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x34eb65[_0x69e6('0x48')],_0x34ddd6[_0x69e6('0x4a')]),_0x4d1997);if(_0x34eb65[_0x69e6('0x48')][_0x69e6('0x53')]){_0x4ff9f6['where']=_['merge'](_0x4ff9f6['where'],{'$or':_[_0x69e6('0x42')](_0x4d1997,function(_0x23a52a){if(_0x23a52a['type']!==_0x69e6('0x54')){var _0x5cffe5={};_0x5cffe5[_0x23a52a[_0x69e6('0x3f')]]={'$like':'%'+_0x34eb65[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x5cffe5;}})});}_0x4ff9f6=_[_0x69e6('0x55')]({},_0x4ff9f6,_0x34eb65[_0x69e6('0x56')]);var _0x131724={'where':_0x4ff9f6['where']};return db[_0x69e6('0x57')]['count'](_0x131724)[_0x69e6('0x23')](function(_0x410045){_0x3ba0c8[_0x69e6('0x33')]=_0x410045;if(_0x34eb65[_0x69e6('0x48')]['includeAll']){_0x4ff9f6[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x57')][_0x69e6('0x59')](_0x4ff9f6);})[_0x69e6('0x23')](function(_0x2a8175){_0x3ba0c8[_0x69e6('0x5a')]=_0x2a8175;return _0x3ba0c8;})[_0x69e6('0x23')](respondWithFilteredResult(_0x257cc7,_0x4ff9f6))['catch'](handleError(_0x257cc7,null));};exports[_0x69e6('0x5b')]=function(_0xde850d,_0x36a0f7){var _0x31a172={'raw':![],'where':{'id':_0xde850d[_0x69e6('0x5c')]['id']},'include':[{'model':db[_0x69e6('0x41')],'as':'mandatoryDispositionPause'}]},_0x35ac24={};_0x35ac24[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0x57')][_0x69e6('0x43')]);_0x35ac24[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0xde850d['query']);_0x35ac24[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x35ac24['model'],_0x35ac24['query']);_0x31a172['attributes']=_[_0x69e6('0x4b')](_0x35ac24[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0xde850d[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x31a172[_0x69e6('0x4c')]=_0x31a172[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x31a172[_0x69e6('0x4c')]:_0x35ac24[_0x69e6('0x47')];if(_0xde850d['query'][_0x69e6('0x5d')]){_0x31a172[_0x69e6('0x58')]=[{'all':!![]}];}_0x31a172=_[_0x69e6('0x55')]({},_0x31a172,_0xde850d[_0x69e6('0x56')]);return db['ChatWebsite'][_0x69e6('0x5e')](_0x31a172)[_0x69e6('0x23')](handleEntityNotFound(_0x36a0f7,null))[_0x69e6('0x23')](respondWithResult(_0x36a0f7,null))['catch'](handleError(_0x36a0f7,null));};exports[_0x69e6('0x5f')]=function(_0x23ac0e,_0x4ab3c8){return db[_0x69e6('0x57')][_0x69e6('0x5f')](_0x23ac0e[_0x69e6('0x60')],{})[_0x69e6('0x23')](function(_0x19174e){var _0x2bc126=_0x23ac0e['user']['get']({'plain':!![]});if(!_0x2bc126)throw new Error(_0x69e6('0x61'));if(_0x2bc126['role']===_0x69e6('0x62')){var _0x491371=_0x19174e[_0x69e6('0x3b')]({'plain':!![]});var _0x2aa8e5=_0x69e6('0x3c');return db[_0x69e6('0x63')][_0x69e6('0x5e')]({'where':{'name':_0x2aa8e5,'userProfileId':_0x2bc126['userProfileId']},'raw':!![]})[_0x69e6('0x23')](function(_0x45614e){if(_0x45614e&&_0x45614e[_0x69e6('0x64')]===0x0){return db[_0x69e6('0x65')][_0x69e6('0x5f')]({'name':_0x491371[_0x69e6('0x3f')],'resourceId':_0x491371['id'],'type':_0x45614e[_0x69e6('0x3f')],'sectionId':_0x45614e['id']},{})[_0x69e6('0x23')](function(){return _0x19174e;});}else{return _0x19174e;}})['catch'](function(_0xa292a){logger[_0x69e6('0x28')](_0x69e6('0x66'),_0xa292a);throw _0xa292a;});}return _0x19174e;})[_0x69e6('0x23')](respondWithResult(_0x4ab3c8,0xc9))['catch'](handleError(_0x4ab3c8,null));};exports[_0x69e6('0x3a')]=function(_0x5c4a83,_0x5e7afb){if(_0x5c4a83[_0x69e6('0x60')]['id']){delete _0x5c4a83[_0x69e6('0x60')]['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x5c4a83[_0x69e6('0x5c')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x69e6('0x23')](handleEntityNotFound(_0x5e7afb,null))['then'](saveUpdates(_0x5c4a83[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0x5e7afb,null))[_0x69e6('0x2c')](handleError(_0x5e7afb,null));};exports[_0x69e6('0x3d')]=function(_0x134a2b,_0x4940a4){return db['ChatWebsite'][_0x69e6('0x5e')]({'where':{'id':_0x134a2b[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4940a4,null))[_0x69e6('0x23')](removeEntity(_0x4940a4,null))['catch'](handleError(_0x4940a4,null));};exports[_0x69e6('0x67')]=function(_0x5ba207,_0x44af05){return db[_0x69e6('0x57')]['describe']()[_0x69e6('0x23')](respondWithResult(_0x44af05,null))[_0x69e6('0x2c')](handleError(_0x44af05,null));};exports[_0x69e6('0x68')]=function(_0x279c22,_0x36faa8,_0x3ff3d3){if(_0x279c22[_0x69e6('0x60')]['id']){delete _0x279c22['body']['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x279c22[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x36faa8,null))[_0x69e6('0x23')](function(_0x543bdf){if(_0x543bdf){_0x279c22[_0x69e6('0x60')]['ChatWebsiteId']=_0x543bdf['id'];return db['Disposition'][_0x69e6('0x5f')](_0x279c22[_0x69e6('0x60')]);}})[_0x69e6('0x23')](respondWithResult(_0x36faa8,null))[_0x69e6('0x2c')](handleError(_0x36faa8,null));};exports['getDispositions']=function(_0x3f30e7,_0x4bea2e,_0xccf9bf){var _0xdb491a={'raw':![],'where':{}};var _0x241b86={};var _0x35116f={'count':0x0,'rows':[]};return db[_0x69e6('0x57')]['findOne']({'where':{'id':_0x3f30e7[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4bea2e,null))['then'](function(_0xad3a20){if(_0xad3a20){_0x241b86[_0x69e6('0x47')]=_['keys'](db['Disposition'][_0x69e6('0x43')]);_0x241b86[_0x69e6('0x48')]=_['keys'](_0x3f30e7['query']);_0x241b86[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x241b86[_0x69e6('0x47')],_0x241b86[_0x69e6('0x48')]);_0xdb491a[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x241b86['model'],qs[_0x69e6('0x4d')](_0x3f30e7['query'][_0x69e6('0x4d')]));_0xdb491a[_0x69e6('0x4c')]=_0xdb491a[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0xdb491a[_0x69e6('0x4c')]:_0x241b86[_0x69e6('0x47')];if(!_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0xdb491a[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x3f30e7['query'][_0x69e6('0x32')]);_0xdb491a[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x3f30e7[_0x69e6('0x48')]['offset']);}_0xdb491a[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x50')]);_0xdb491a[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x3f30e7[_0x69e6('0x48')],_0x241b86['filters']));_0xdb491a[_0x69e6('0x51')][_0x69e6('0x6b')]=_0xad3a20['id'];if(_0x3f30e7[_0x69e6('0x48')][_0x69e6('0x53')]){_0xdb491a[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0xdb491a[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0xdb491a[_0x69e6('0x4c')],function(_0x39bf68){var _0x286eba={};_0x286eba[_0x39bf68]={'$like':'%'+_0x3f30e7[_0x69e6('0x48')]['filter']+'%'};return _0x286eba;})});}_0xdb491a=_[_0x69e6('0x55')]({},_0xdb491a,_0x3f30e7[_0x69e6('0x56')]);return db[_0x69e6('0x6c')]['count']({'where':_0xdb491a[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x129e6b){_0x35116f[_0x69e6('0x33')]=_0x129e6b;if(_0x3f30e7['query']['includeAll']){_0xdb491a[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x6c')]['findAll'](_0xdb491a);})['then'](function(_0xb6476b){_0x35116f['rows']=_0xb6476b;return _0x35116f;});}})['then'](respondWithFilteredResult(_0x4bea2e,_0xdb491a))[_0x69e6('0x2c')](handleError(_0x4bea2e,null));};exports[_0x69e6('0x6d')]=function(_0x47eea2,_0xac1e6d,_0x195042){return db['ChatWebsite'][_0x69e6('0x5e')]({'where':{'id':_0x47eea2['params']['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xac1e6d,null))[_0x69e6('0x23')](function(_0x5a8d98){if(_0x5a8d98){return _0x5a8d98[_0x69e6('0x6d')](_0x47eea2[_0x69e6('0x48')][_0x69e6('0x6e')]);}})['then'](respondWithStatusCode(_0xac1e6d,null))[_0x69e6('0x2c')](handleError(_0xac1e6d,null));};exports['addAnswer']=function(_0x5249a1,_0x2e8923,_0x49d516){if(_0x5249a1['body']['id']){delete _0x5249a1['body']['id'];}return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x5249a1[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x2e8923,null))[_0x69e6('0x23')](function(_0x22926){if(_0x22926){_0x5249a1[_0x69e6('0x60')][_0x69e6('0x6b')]=_0x22926['id'];return db[_0x69e6('0x6f')][_0x69e6('0x5f')](_0x5249a1[_0x69e6('0x60')]);}})[_0x69e6('0x23')](respondWithResult(_0x2e8923,null))[_0x69e6('0x2c')](handleError(_0x2e8923,null));};exports[_0x69e6('0x70')]=function(_0x30cd2f,_0x3815a2,_0x2f8102){var _0xaf48db={'raw':![],'where':{}};var _0x428aac={};var _0x510bd6={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x30cd2f[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3815a2,null))['then'](function(_0x454ed6){if(_0x454ed6){_0x428aac['model']=_[_0x69e6('0x49')](db['CannedAnswer'][_0x69e6('0x43')]);_0x428aac[_0x69e6('0x48')]=_['keys'](_0x30cd2f[_0x69e6('0x48')]);_0x428aac[_0x69e6('0x4a')]=_['intersection'](_0x428aac[_0x69e6('0x47')],_0x428aac['query']);_0xaf48db[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x428aac[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x30cd2f['query'][_0x69e6('0x4d')]));_0xaf48db[_0x69e6('0x4c')]=_0xaf48db[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0xaf48db[_0x69e6('0x4c')]:_0x428aac['model'];if(!_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0xaf48db[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x30cd2f['query'][_0x69e6('0x32')]);_0xaf48db['offset']=qs[_0x69e6('0x34')](_0x30cd2f['query'][_0x69e6('0x34')]);}_0xaf48db[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x50')]);_0xaf48db[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_['pick'](_0x30cd2f[_0x69e6('0x48')],_0x428aac[_0x69e6('0x4a')]));_0xaf48db[_0x69e6('0x51')]['ChatWebsiteId']=_0x454ed6['id'];if(_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x53')]){_0xaf48db['where']=_[_0x69e6('0x55')](_0xaf48db[_0x69e6('0x51')],{'$or':_['map'](_0xaf48db[_0x69e6('0x4c')],function(_0x29f9a1){var _0x203366={};_0x203366[_0x29f9a1]={'$like':'%'+_0x30cd2f['query']['filter']+'%'};return _0x203366;})});}_0xaf48db=_[_0x69e6('0x55')]({},_0xaf48db,_0x30cd2f[_0x69e6('0x56')]);return db[_0x69e6('0x6f')][_0x69e6('0x33')]({'where':_0xaf48db[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x29d8ca){_0x510bd6[_0x69e6('0x33')]=_0x29d8ca;if(_0x30cd2f[_0x69e6('0x48')][_0x69e6('0x5d')]){_0xaf48db[_0x69e6('0x58')]=[{'all':!![]}];}return db[_0x69e6('0x6f')][_0x69e6('0x59')](_0xaf48db);})[_0x69e6('0x23')](function(_0x3cb6e3){_0x510bd6[_0x69e6('0x5a')]=_0x3cb6e3;return _0x510bd6;});}})[_0x69e6('0x23')](respondWithFilteredResult(_0x3815a2,_0xaf48db))[_0x69e6('0x2c')](handleError(_0x3815a2,null));};exports[_0x69e6('0x72')]=function(_0x2647bf,_0x137876,_0x35614b){return db['ChatWebsite']['find']({'where':{'id':_0x2647bf[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x137876,null))[_0x69e6('0x23')](function(_0x5d4002){if(_0x5d4002){return _0x5d4002['removeAnswers'](_0x2647bf[_0x69e6('0x48')]['ids']);}})[_0x69e6('0x23')](respondWithStatusCode(_0x137876,null))['catch'](handleError(_0x137876,null));};exports[_0x69e6('0x73')]=function(_0x76a517,_0xbbb7f0,_0x4b43cc){_0x76a517[_0x69e6('0x60')][_0x69e6('0x74')]=_0x76a517['file']['filename'];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x76a517['params']['id']}})['then'](handleEntityNotFound(_0xbbb7f0,null))['then'](saveUpdates(_0x76a517[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0xbbb7f0,null))['catch'](handleError(_0xbbb7f0,null));};exports[_0x69e6('0x75')]=function(_0x168caf,_0x2dac45,_0x3387da){_0x168caf['body'][_0x69e6('0x76')]=_0x168caf[_0x69e6('0x77')]['filename'];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x168caf[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x2dac45,null))[_0x69e6('0x23')](saveUpdates(_0x168caf['body'],null))['then'](respondWithResult(_0x2dac45,null))['catch'](handleError(_0x2dac45,null));};exports['addCustomerAvatar']=function(_0x4639fb,_0x3acfef,_0x5a164c){_0x4639fb[_0x69e6('0x60')][_0x69e6('0x78')]=_0x4639fb[_0x69e6('0x77')][_0x69e6('0x79')];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x4639fb['params']['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3acfef,null))[_0x69e6('0x23')](saveUpdates(_0x4639fb['body'],null))['then'](respondWithResult(_0x3acfef,null))['catch'](handleError(_0x3acfef,null));};exports[_0x69e6('0x7a')]=function(_0x52325d,_0x509577,_0x19980e){_0x52325d[_0x69e6('0x60')][_0x69e6('0x7b')]=_0x52325d[_0x69e6('0x77')][_0x69e6('0x79')];return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x52325d[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x509577,null))[_0x69e6('0x23')](saveUpdates(_0x52325d[_0x69e6('0x60')],null))[_0x69e6('0x23')](respondWithResult(_0x509577,null))[_0x69e6('0x2c')](handleError(_0x509577,null));};exports['getLogo']=function(_0x4c7346,_0xf684e8,_0x56d07c){var _0x1340ea=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x7e'));var _0x61c17e={'where':{'id':_0x4c7346[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x74')],'raw':!![]};var _0x30e3a1=![];return require(_0x69e6('0x19'))[_0x69e6('0x7f')]()[_0x69e6('0x23')](function(_0x3b764b){if(_0x3b764b){_0x30e3a1=_0x3b764b[_0x69e6('0x80')];}})['then'](function(){return db['ChatWebsite'][_0x69e6('0x5e')](_0x61c17e);})[_0x69e6('0x23')](handleEntityNotFound(_0xf684e8,null))[_0x69e6('0x23')](function(_0x18bf0e){if(_0x18bf0e){if(!_[_0x69e6('0x81')](_0x18bf0e[_0x69e6('0x74')])){if(fs[_0x69e6('0x82')](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],'server/files/images/logos/',_0x18bf0e[_0x69e6('0x74')]))&&_0x30e3a1){_0x1340ea=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x83'),_0x18bf0e['sitepic']);}}return _0xf684e8['download'](_0x1340ea);}})[_0x69e6('0x2c')](handleError(_0xf684e8,null));};exports[_0x69e6('0x84')]=function(_0x4184b9,_0x37b1e9,_0x2d4521){var _0x7d5217=path['join'](config[_0x69e6('0x7d')],_0x69e6('0x85'));var _0xedc90c={'where':{'id':_0x4184b9[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x76')],'raw':!![]};return db['ChatWebsite']['find'](_0xedc90c)[_0x69e6('0x23')](handleEntityNotFound(_0x37b1e9,null))[_0x69e6('0x23')](function(_0x23a9b6){if(_0x23a9b6){if(!_[_0x69e6('0x81')](_0x23a9b6[_0x69e6('0x76')])){if(fs['existsSync'](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],'server/files/images/avatars/',_0x23a9b6[_0x69e6('0x76')]))){_0x7d5217=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x23a9b6['agentAvatar']);}}return _0x37b1e9[_0x69e6('0x87')](_0x7d5217);}})['catch'](handleError(_0x37b1e9,null));};exports['getCustomerAvatar']=function(_0x16b205,_0x1cb150,_0x260a8f){var _0xcc28eb=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x88'));var _0x4af6fd={'where':{'id':_0x16b205[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x78'),_0x69e6('0x89')],'raw':!![]};return db['ChatWebsite'][_0x69e6('0x5e')](_0x4af6fd)[_0x69e6('0x23')](handleEntityNotFound(_0x1cb150,null))[_0x69e6('0x23')](function(_0x470482){if(_0x470482){if(!_['isNil'](_0x470482[_0x69e6('0x78')])){if(fs['existsSync'](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x470482['customerAvatar']))&&_0x470482[_0x69e6('0x89')]){_0xcc28eb=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x470482[_0x69e6('0x78')]);}}return _0x1cb150[_0x69e6('0x87')](_0xcc28eb);}})['catch'](handleError(_0x1cb150,null));};exports[_0x69e6('0x8a')]=function(_0x3a3ac8,_0x29bad2,_0x41edbf){var _0x15e1b3=path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0x8b'));var _0x4b24a6={'where':{'id':_0x3a3ac8[_0x69e6('0x5c')]['id']},'attributes':['id',_0x69e6('0x7b')],'raw':!![]};return db[_0x69e6('0x57')][_0x69e6('0x5e')](_0x4b24a6)[_0x69e6('0x23')](handleEntityNotFound(_0x29bad2,null))[_0x69e6('0x23')](function(_0x2005ec){if(_0x2005ec){if(!_[_0x69e6('0x81')](_0x2005ec[_0x69e6('0x7b')])){if(fs[_0x69e6('0x82')](path['join'](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x2005ec[_0x69e6('0x7b')]))){_0x15e1b3=path['join'](config[_0x69e6('0x7d')],_0x69e6('0x86'),_0x2005ec[_0x69e6('0x7b')]);}}return _0x29bad2['download'](_0x15e1b3);}})[_0x69e6('0x2c')](handleError(_0x29bad2,null));};exports['notify']=function(_0x3db9e8,_0x977483,_0x556850){var _0x107162=require(_0x69e6('0x8c'));var _0x483b39=new _0x107162();var _0x24f0fb=_0x483b39[_0x69e6('0x8d')](_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0x8f')])[_0x69e6('0x90')]();var _0x58e1e3={'body':_0x3db9e8[_0x69e6('0x60')],'channel':'chat'};var _0x167f27=[];var _0x3046a8=[];var _0x34fd40={};var _0x306995=![];return db['CmContact'][_0x69e6('0x67')]()['then'](function(_0x35eff4){if(!_0x35eff4){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))]('no\x20available\x20attributes');}_0x167f27=_['difference'](_[_0x69e6('0x49')](_0x35eff4),[_0x69e6('0x93'),_0x69e6('0x94')]);_0x3046a8=_[_0x69e6('0x95')](_[_0x69e6('0x49')](_0x35eff4),[_0x69e6('0x93'),_0x69e6('0x94'),_0x69e6('0x96'),_0x69e6('0x97')]);if(_0x3db9e8['body']['id']){delete _0x3db9e8[_0x69e6('0x60')]['id'];}if(_[_0x69e6('0x81')](_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x98')])){throw new db['Sequelize'][(_0x69e6('0x92'))](_0x69e6('0x99'));}if(_[_0x69e6('0x81')](_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x60')])||_0x3db9e8['body'][_0x69e6('0x60')]===''){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x9a'));}if(_['isNil'](_0x3db9e8['body'][_0x69e6('0x9b')])){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x9c')+_0x3046a8);}if(!_[_0x69e6('0x9d')](_0x3046a8,_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x9b')])){throw new db['Sequelize'][(_0x69e6('0x92'))](_0x69e6('0x9e')+_0x3046a8);}_0x34fd40[_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x9b')]]=_0x3db9e8['body'][_0x69e6('0x98')];})[_0x69e6('0x23')](function(){return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x3db9e8[_0x69e6('0x5c')]['id']},'include':[{'model':db[_0x69e6('0x9f')],'as':_0x69e6('0xa0'),'include':[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xa2'),'where':_0x34fd40,'limit':0x1,'order':[[_0x69e6('0x94'),_0x69e6('0xa3')]]}]},{'model':db[_0x69e6('0xa4')],'as':_0x69e6('0xa5')}]});})[_0x69e6('0x23')](handleEntityNotFound(_0x977483,null))[_0x69e6('0x23')](function(_0xf6fe21){if(_0xf6fe21&&_0xf6fe21[_0x69e6('0xa0')]){_0x58e1e3['account']=_0xf6fe21;_0x58e1e3[_0x69e6('0xa6')]=_0xf6fe21[_0x69e6('0xa5')];_0x58e1e3[_0x69e6('0xa7')]=_0xf6fe21[_0x69e6('0xa0')];_0x58e1e3[_0x69e6('0xa6')]=_['orderBy'](_0x58e1e3[_0x69e6('0xa6')],[_0x69e6('0xa8')],[_0x69e6('0xa9')]);if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xa5')]){delete _0x58e1e3['account'][_0x69e6('0xa5')];}if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xa0')]&&_0x58e1e3[_0x69e6('0xaa')]['List'][_0x69e6('0xa2')][_0x69e6('0x4e')]){return _0x58e1e3['account'][_0x69e6('0xa0')]['Contacts'][0x0];}var _0x3bcb36=_[_0x69e6('0x1b')](_0x3db9e8[_0x69e6('0x60')],{'firstName':_0x3db9e8['body'][_0x69e6('0x98')],'ListId':_0xf6fe21['ListId']});_0x3bcb36[_0x3db9e8['body'][_0x69e6('0x9b')]]=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x98')];return db['CmContact'][_0x69e6('0x5f')](_0x3bcb36,{'fields':_0x167f27,'raw':!![]});}})['then'](handleEntityNotFound(_0x977483,null))['then'](function(_0x4fabe5){_0x58e1e3['contact']=_0x4fabe5;var _0x5cb752=_0x3db9e8['body'][_0x69e6('0xab')];if(_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xac')]){_0x5cb752=_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xac')];}else if(_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xad')]){_0x5cb752=_[_0x69e6('0xae')](_0x3db9e8['headers'][_0x69e6('0xad')][_0x69e6('0xaf')](','));}if(_0x4fabe5){var _0xc480d1={'ContactId':_0x4fabe5['id'],'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'from':(_0x4fabe5[_0x69e6('0xb0')]||'')+'\x20'+(_0x4fabe5['lastName']||''),'customerIp':_0x5cb752,'customerPort':_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xb1')]?_0x3db9e8[_0x69e6('0x8e')][_0x69e6('0xb1')]:null,'referer':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb2')],'browserName':_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0x3f')]&&_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]?util['format']('%s\x20%s',_0x24f0fb['browser'][_0x69e6('0x3f')],_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]):'unknown','browserVersion':_0x24f0fb[_0x69e6('0xb3')][_0x69e6('0xb4')]||'unknown','osName':util[_0x69e6('0xb5')]('%s\x20%s',_0x24f0fb['os']['name'],_0x24f0fb['os']['version']),'osVersion':_0x24f0fb['os'][_0x69e6('0xb4')],'deviceModel':_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0x47')]&&_0x24f0fb['device'][_0x69e6('0xb7')]?util['format']('%s\x20%s\x20%s',_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0x47')],_0x24f0fb['device'][_0x69e6('0xb7')],_0x24f0fb['device'][_0x69e6('0x45')]):null,'deviceVendor':_0x24f0fb[_0x69e6('0xb6')][_0x69e6('0xb7')],'deviceType':_0x24f0fb[_0x69e6('0xb6')]['type'],'formData':JSON[_0x69e6('0xb8')](_0x3db9e8['body'])};var _0x4682b0={'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'closed':![]};if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]){_0x4682b0[_0x69e6('0xb9')]=_0x3db9e8['body'][_0x69e6('0xb9')];return db[_0x69e6('0xba')]['find']({'where':_0x4682b0})['then'](function(_0x2a65d5){if(_0x2a65d5){return[_0x2a65d5,![]];}_0xc480d1['threadId']=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')];_0xc480d1[_0x69e6('0xbb')]=_0x3db9e8[_0x69e6('0x60')]['externalUrl'];return db['ChatInteraction']['create'](_0xc480d1)['then'](function(_0x4f7e4b){return[_0x4f7e4b,!![]];});});}_0x4682b0['ContactId']=_0x4fabe5['id'];if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xbc')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xbc')]['id']){_0x4682b0['id']=_0x3db9e8[_0x69e6('0x60')]['interaction']['id'];return db[_0x69e6('0xba')][_0x69e6('0x5e')]({'where':_0x4682b0})[_0x69e6('0x23')](function(_0x5a515b){if(_0x5a515b){return[_0x5a515b,![]];}return db['ChatInteraction'][_0x69e6('0x5f')](_0xc480d1)[_0x69e6('0x23')](function(_0x2b8035){return[_0x2b8035,!![]];});});}return db[_0x69e6('0xba')]['create'](_0xc480d1)[_0x69e6('0x23')](function(_0x5673c3){return[_0x5673c3,!![]];});}})[_0x69e6('0xbd')](function(_0x47befc,_0x35f5b){if(_0x47befc){_0x306995=_0x35f5b;if(!_0x35f5b){var _0x1e6f8e={'from':(_0x58e1e3[_0x69e6('0xbe')]['firstName']||'')+'\x20'+(_0x58e1e3[_0x69e6('0xbe')][_0x69e6('0xbf')]||'')};if(_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')]&&_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xb9')]!=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')]){_0x1e6f8e[_0x69e6('0xb9')]=_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc0')];}return _0x47befc['update'](_0x1e6f8e);}else{return _0x47befc;}}})[_0x69e6('0x23')](function(_0x177665){_0x58e1e3[_0x69e6('0xbc')]=_0x177665[_0x69e6('0x3b')]({'plain':!![]});_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc1')]=_0x306995;if(_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc1')]){if(_0x58e1e3[_0x69e6('0xaa')][_0x69e6('0xc2')]){_0x58e1e3['applications'][_0x69e6('0xc3')]({'id':0x0,'priority':_0x58e1e3[_0x69e6('0xa6')]['length']+0x1,'app':_0x69e6('0xc4'),'appdata':_0x69e6('0xc5'),'interval':_0x69e6('0xc6')});}}return db[_0x69e6('0xc7')][_0x69e6('0x5f')]({'body':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0x60')],'ChatWebsiteId':_0x3db9e8[_0x69e6('0x5c')]['id'],'ChatInteractionId':_0x177665['id'],'direction':'in','ContactId':_0x58e1e3[_0x69e6('0xbe')]['id'],'AttachmentId':_0x3db9e8[_0x69e6('0x60')][_0x69e6('0xc8')]});})[_0x69e6('0x23')](function(_0x2c2284){_0x58e1e3[_0x69e6('0x2b')]=_0x2c2284;if(_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc9')]){return db['User'][_0x69e6('0x5e')]({'attributes':['id','name'],'where':{'id':_0x58e1e3[_0x69e6('0xbc')][_0x69e6('0xc9')]}})['then'](function(_0x440211){if(_0x440211){_0x58e1e3[_0x69e6('0xa6')]['unshift']({'id':0x0,'priority':0x0,'app':_0x69e6('0xca'),'appdata':_0x440211[_0x69e6('0x3f')]+','+(_0x58e1e3['account'][_0x69e6('0xcb')]||0xa),'interval':_0x69e6('0xc6')});_0x58e1e3[_0x69e6('0xcc')]=!![];}return respondWithRpcPromise(_0x69e6('0xcd'),_0x69e6('0xce'),_0x58e1e3);});}return respondWithRpcPromise('Start',_0x69e6('0xce'),_0x58e1e3);})[_0x69e6('0x23')](function(_0x4e1140){respondWithRpcPromise('EventManager',_0x69e6('0xcf'),{'event':_0x69e6('0xd0'),'message':_0x4e1140},client9002);return _0x4e1140;})[_0x69e6('0x23')](respondWithResult(_0x977483,null))[_0x69e6('0x2c')](handleError(_0x977483,null));};exports[_0x69e6('0xd1')]=function(_0x14711d,_0x3ae1a8,_0x588c7a){var _0x4dbe0d,_0x2bca83,_0xe1c2f;var _0xbfd52d=[];var _0xfde647=[];var _0x3eea26={};var _0x5bc06a=_0x14711d[_0x69e6('0xd2')]||[];var _0x374e14=[];var _0x4cc70a;return db[_0x69e6('0xa1')][_0x69e6('0x67')]()[_0x69e6('0x23')](function(_0x89c40b){if(!_0x89c40b){throw new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))]('no\x20available\x20attributes');}_0xfde647=_[_0x69e6('0x95')](_[_0x69e6('0x49')](_0x89c40b),[_0x69e6('0x93'),'updatedAt']);_0xbfd52d=_['difference'](_[_0x69e6('0x49')](_0x89c40b),['createdAt',_0x69e6('0x94'),_0x69e6('0x96'),_0x69e6('0x97')]);if(_0x14711d[_0x69e6('0x60')]['id']){delete _0x14711d[_0x69e6('0x60')]['id'];}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')])){throw _0x3ae1a8['status'](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0x99')));}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0x60')])||_0x14711d[_0x69e6('0x60')][_0x69e6('0x60')]===''){throw _0x3ae1a8[_0x69e6('0x2e')](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))]['ValidationError'](_0x69e6('0x9a')));}if(_[_0x69e6('0x81')](_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')])){throw _0x3ae1a8[_0x69e6('0x2e')](0x1f4)[_0x69e6('0x40')](new db[(_0x69e6('0x91'))][(_0x69e6('0x92'))](_0x69e6('0xd4')+_0xbfd52d));}if(!_[_0x69e6('0x9d')](_0xbfd52d,_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')])){throw _0x3ae1a8['status'](0x1f4)[_0x69e6('0x40')](new db['Sequelize'][(_0x69e6('0x92'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xbfd52d));}_0x3eea26[_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')]]=_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')];})[_0x69e6('0x23')](function(){return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x14711d['params']['id']},'include':[{'model':db[_0x69e6('0x9f')],'as':_0x69e6('0xa0')},{'model':db[_0x69e6('0xd5')],'as':_0x69e6('0xd5')}]});})[_0x69e6('0x23')](handleEntityNotFound(_0x3ae1a8,null))['then'](function(_0x236ccf){if(_0x236ccf&&_0x236ccf[_0x69e6('0xa0')]){_0x2bca83=_0x236ccf;var _0x8b052a=_[_0x69e6('0x1b')](_0x14711d[_0x69e6('0x60')],{'firstName':_0x14711d[_0x69e6('0x60')]['from'],'phone':_0x14711d[_0x69e6('0x60')][_0x69e6('0x98')],'ListId':_0x236ccf['ListId']});_0x8b052a[_0x14711d[_0x69e6('0x60')][_0x69e6('0xd3')]]=_0x14711d['body'][_0x69e6('0x98')];return db[_0x69e6('0xa1')][_0x69e6('0xd6')]({'where':_0x3eea26,'defaults':_0x8b052a});}})[_0x69e6('0xbd')](function(_0x14565d){if(_0x14565d){_0xe1c2f=_0x14565d;var _0x24566e=fs[_0x69e6('0xd7')](path[_0x69e6('0x7c')](config[_0x69e6('0x7d')],_0x69e6('0xd8')),_0x69e6('0xd9'));var _0x2002e3=ejs['render'](_0x24566e,{'body':_['toPairs'](_0x14711d[_0x69e6('0x60')]['body']),'bodyTitle':_0x2bca83['offlineMessageBody']});return db[_0x69e6('0xda')][_0x69e6('0x5f')]({'body':_0x2002e3,'ContactId':_0x14565d['id'],'ChatWebsiteId':_0x2bca83['id']});}})[_0x69e6('0x23')](function(_0x59b7d8){_0x4cc70a=_0x59b7d8;if(_0x5bc06a[_0x69e6('0x4e')]){var _0xdd4223=_0x5bc06a[_0x69e6('0x42')](function(_0x98eff2){return{'name':_0x98eff2[_0x69e6('0xdb')],'basename':_0x98eff2[_0x69e6('0x79')],'type':_0x98eff2['mimetype'],'ChatOfflineMessageId':_0x59b7d8['id']};});_0x374e14=_0xdd4223[_0x69e6('0x42')](_0x31f0b7=>{var _0x3b2a7d={'filename':_0x31f0b7[_0x69e6('0x3f')],'path':path['join'](config[_0x69e6('0x7d')],_0x69e6('0xdc'),_0x69e6('0xd2'),_0x69e6('0xdd'),_0x69e6('0xde'),_0x31f0b7['basename'])};return _0x3b2a7d;});if(!_0x2bca83[_0x69e6('0xdf')]){return db['sequelize'][_0x69e6('0xe0')](function(_0x9a649c){return db['Attachment'][_0x69e6('0xe1')](_0xdd4223,{'transaction':_0x9a649c});});}}})[_0x69e6('0x23')](function(){if(_0x4cc70a){_0x4dbe0d=_0x4cc70a;return db[_0x69e6('0xd5')][_0x69e6('0x71')]({'where':{'active':!![]},'include':[{'model':db[_0x69e6('0xe2')],'as':_0x69e6('0xe3'),'raw':!![]}]});}})[_0x69e6('0x23')](function(_0x58a4b5){if(_0x58a4b5&&_0x58a4b5['Smtp']&&_0x2bca83[_0x69e6('0xe4')]&&_0x2bca83['forwardOfflineAddress']){var _0x3703cc={'tls':{'rejectUnauthorized':![]}};if(_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe5')]){_0x3703cc[_0x69e6('0xe5')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe5')];}else{_0x3703cc[_0x69e6('0xe6')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe6')];_0x3703cc[_0x69e6('0xe7')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe7')];_0x3703cc[_0x69e6('0xe8')]=_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe8')];}if(_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xe9')]){_0x3703cc[_0x69e6('0xea')]={'user':_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0x62')],'pass':_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0xeb')]};}return respondWithRpcPromise(_0x69e6('0xec'),'sendMail',{'account':_0x3703cc,'message':{'from':util['format'](_0x69e6('0xed'),_0x58a4b5[_0x69e6('0x3f')],_0x58a4b5[_0x69e6('0xee')]||_0x58a4b5[_0x69e6('0xe3')][_0x69e6('0x62')]),'to':_0x2bca83[_0x69e6('0xef')],'subject':_0x2bca83[_0x69e6('0xf0')],'html':_0x4dbe0d['body'],'attachments':_0x374e14}},client9003)[_0x69e6('0x23')](function(){return _0x4dbe0d;})[_0x69e6('0x2c')](function(_0x4e99f2){console[_0x69e6('0x28')](_0x4e99f2);});}})[_0x69e6('0x23')](function(){if(_0x2bca83&&_0x2bca83[_0x69e6('0xdf')]&&_0x2bca83[_0x69e6('0xf1')]){var _0x24e058=[];if(_0x5bc06a[_0x69e6('0x4e')]){_0x24e058=_0x5bc06a[_0x69e6('0x42')](function(_0x9a14b0){return{'name':_0x9a14b0[_0x69e6('0xdb')],'basename':_0x9a14b0[_0x69e6('0x79')],'type':_0x9a14b0['mimetype'],'ChatOfflineMessageId':_0x4cc70a['id']};});}var _0x575add;if(!_['isNil'](_0x2bca83['subjectOffline'])){var _0x3fc22f=_['map'](_0x14711d[_0x69e6('0x60')],function(_0x384ddb){return _0x384ddb;});var _0x8df699=_['toPairsIn'](_0x3fc22f)[0x0];var _0x44ff60=_[_0x69e6('0xf2')](_0x8df699,function(_0x777a8){return _0x777a8;});_0x575add=_0x44ff60[0x1][_0x2bca83[_0x69e6('0xf3')]];}var _0x299056={'from':_0xe1c2f[_0x69e6('0xee')],'firstName':_0xe1c2f[_0x69e6('0xb0')],'lastName':_0xe1c2f['lastName'],'mapKey':_0x69e6('0xee'),'message':{'from':_0xe1c2f[_0x69e6('0xee')],'to':_0x2bca83[_0x69e6('0xd5')][_0x69e6('0xee')],'cc':'','subject':_[_0x69e6('0x81')](_0x575add)?_0x2bca83[_0x69e6('0xf0')]:_0x575add,'messageId':'','sentAt':new Date(),'attach':_0x24e058[_0x69e6('0x4e')],'attachments':_0x24e058,'originChannel':'Chat','ChatWebsiteId':_0x2bca83['id'],'ChatOfflineMessageId':_0x4dbe0d['id'],'originTo':_0x2bca83[_0x69e6('0xd5')][_0x69e6('0xee')]},'body':_0x4dbe0d['body']};var _0xf955d6={'account':{'id':_0x2bca83['MailAccountId']},'body':_0x299056,'log':_0x69e6('0xf4')};return respondWithRpcPromise(_0x69e6('0xf4'),_0x69e6('0xf5'),_0xf955d6,client9001)['then'](function(){return _0x4dbe0d;})[_0x69e6('0x2c')](function(_0x2fe7f5){console[_0x69e6('0x28')](_0x2fe7f5);});}return;})[_0x69e6('0x23')](function(){if(_0x4dbe0d){return _0x4dbe0d;}})[_0x69e6('0x23')](respondWithResult(_0x3ae1a8,null))[_0x69e6('0x2c')](function(_0xaa9ebd){console['error'](_0x69e6('0x2c'),_0xaa9ebd);for(var _0x455b82 of _0x5bc06a){var _0x270d49=path[_0x69e6('0x7c')](config['root'],_0x69e6('0xdc'),_0x69e6('0xd2'),_0x69e6('0xdd'),_0x69e6('0xde'),_0x455b82['filename']);fs_extra[_0x69e6('0xf6')](_0x270d49)[_0x69e6('0x2c')](function(_0x453f85){console[_0x69e6('0x28')](_0x69e6('0xf7'),_0x270d49,_0x453f85);});}});};exports[_0x69e6('0xf8')]=function(_0x3d2d29,_0xd6261,_0x2eeea6){return db['ChatInteraction'][_0x69e6('0x5e')]({'where':{'id':_0x3d2d29[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xd6261,null))[_0x69e6('0x23')](function(_0x4fc29d){if(_0x4fc29d){return _0x4fc29d[_0x69e6('0xf8')](_0x3d2d29[_0x69e6('0x60')][_0x69e6('0x6e')],_[_0x69e6('0xf9')](_0x3d2d29[_0x69e6('0x60')],[_0x69e6('0x6e'),'id'])||{});}})['then'](respondWithResult(_0xd6261,null))[_0x69e6('0x2c')](handleError(_0xd6261,null));};exports['getInteractions']=function(_0x580efb,_0xce22d2,_0x17e4e8){var _0x1cba53={'raw':![],'where':{}};var _0x323a05={};var _0xf84ba6={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x580efb[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0xce22d2,null))[_0x69e6('0x23')](function(_0x2fd3a5){if(_0x2fd3a5){_0x323a05['model']=_[_0x69e6('0x49')](db[_0x69e6('0xba')]['rawAttributes']);_0x323a05['query']=_[_0x69e6('0x49')](_0x580efb[_0x69e6('0x48')]);_0x323a05['filters']=_[_0x69e6('0x4b')](_0x323a05[_0x69e6('0x47')],_0x323a05[_0x69e6('0x48')]);_0x1cba53['attributes']=_[_0x69e6('0x4b')](_0x323a05[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x580efb[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x1cba53['attributes']=_0x1cba53[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x1cba53['attributes']:_0x323a05[_0x69e6('0x47')];if(!_0x580efb[_0x69e6('0x48')][_0x69e6('0x69')](_0x69e6('0x4f'))){_0x1cba53[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x580efb[_0x69e6('0x48')]['limit']);_0x1cba53[_0x69e6('0x34')]=qs['offset'](_0x580efb['query'][_0x69e6('0x34')]);}_0x1cba53[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x580efb[_0x69e6('0x48')][_0x69e6('0x50')]);_0x1cba53[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x580efb[_0x69e6('0x48')],_0x323a05['filters']));_0x1cba53['where'][_0x69e6('0x6b')]=_0x2fd3a5['id'];if(_0x580efb[_0x69e6('0x48')][_0x69e6('0x53')]){_0x1cba53[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x1cba53[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0x1cba53[_0x69e6('0x4c')],function(_0x1177ca){var _0x304ae7={};_0x304ae7[_0x1177ca]={'$like':'%'+_0x580efb['query'][_0x69e6('0x53')]+'%'};return _0x304ae7;})});}_0x1cba53=_[_0x69e6('0x55')]({},_0x1cba53,_0x580efb[_0x69e6('0x56')]);return db[_0x69e6('0xba')][_0x69e6('0x33')]({'where':_0x1cba53[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x3bc27a){_0xf84ba6[_0x69e6('0x33')]=_0x3bc27a;if(_0x580efb[_0x69e6('0x48')][_0x69e6('0x5d')]){_0x1cba53['include']=[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xfa'),'required':![]},{'model':db['User'],'as':_0x69e6('0xfb'),'attributes':[_0x69e6('0x3f'),_0x69e6('0xfc'),_0x69e6('0xfd')],'required':![]},{'model':db[_0x69e6('0xfe')],'as':_0x69e6('0xff'),'attributes':['id',_0x69e6('0x3f'),_0x69e6('0x100')],'where':_0x580efb['query'][_0x69e6('0x101')]?{'id':_0x580efb[_0x69e6('0x48')][_0x69e6('0x101')]}:undefined,'required':_0x580efb['query']['tag']?!![]:![]}];}return db[_0x69e6('0xba')][_0x69e6('0x59')](_0x1cba53);})[_0x69e6('0x23')](function(_0x9bbea2){_0xf84ba6[_0x69e6('0x5a')]=_0x9bbea2;return _0xf84ba6;});}})['then'](respondWithFilteredResult(_0xce22d2,_0x1cba53))['catch'](handleError(_0xce22d2,null));};function iftimePromise(_0x409de0,_0x28d8b7){return respondWithRpcPromise(_0x69e6('0x102'),_0x69e6('0x103'),{'command':_0x28d8b7['timezone']?util[_0x69e6('0xb5')](_0x69e6('0x104'),_0x409de0[_0x69e6('0x105')],_0x28d8b7[_0x69e6('0x106')]):util[_0x69e6('0xb5')](_0x69e6('0x107'),_0x409de0[_0x69e6('0x105')])},client9002)['then'](function(_0x68ef87){var _0x51e833=_0x68ef87&&_0x68ef87[_0x69e6('0x108')](_0x69e6('0x109'))>=0x0?!![]:![];logger[_0x69e6('0x24')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x28d8b7['id'],_0x409de0['id'],_0x409de0[_0x69e6('0x105')],_0x51e833?'ONLINE':_0x69e6('0x10a'),_0x28d8b7[_0x69e6('0x106')]?_0x28d8b7[_0x69e6('0x106')]:_0x69e6('0x10b'));return _0x51e833;})[_0x69e6('0x2c')](function(_0x27a3e1){logger[_0x69e6('0x28')](_0x69e6('0x10c'),_0x28d8b7['id'],_0x409de0['id'],_0x409de0['interval'],util['inspect'](_0x27a3e1,{'showHidden':![],'depth':null}),_0x28d8b7[_0x69e6('0x106')]?_0x28d8b7['timezone']:_0x69e6('0x10b'));return![];});}exports[_0x69e6('0x103')]=function(_0x1b2da7,_0x40c676,_0x32546d){var _0x304f58=0x0;var _0x3f3518=0x0;var _0x6784d9=![];var _0x1802bf;var _0x190130;return db[_0x69e6('0x57')][_0x69e6('0x5e')]({'where':{'id':_0x1b2da7['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0x69e6('0x10d')],'as':_0x69e6('0x10e'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x69e6('0x23')](handleEntityNotFound(_0x40c676,null))[_0x69e6('0x23')](function(_0x59ba3e){if(_0x59ba3e){_0x1802bf=_0x59ba3e;return _0x59ba3e[_0x69e6('0x10f')]({'raw':!![]});}})[_0x69e6('0x23')](function(_0x1ed46e){if(_0x1802bf){if(_0x1ed46e){_0x190130=_0x1ed46e;}}return require('../../config/license/util')[_0x69e6('0x7f')]();})[_0x69e6('0x23')](function(_0x96e83){if(_0x96e83){_0x3f3518=_0x96e83[_0x69e6('0x110')];_0x6784d9=_0x96e83['custom'];}})[_0x69e6('0x23')](function(){return db[_0x69e6('0xba')]['count']({'where':{'closed':![]}});})[_0x69e6('0x23')](function(_0xbd7889){_0x304f58=_0xbd7889;if(_0x3f3518&&_0xbd7889>_0x3f3518){return db[_0x69e6('0x111')][_0x69e6('0x71')]({'where':{'id':0x1}})[_0x69e6('0x23')](function(_0x220ac3){if(_0x220ac3){_0x220ac3[_0x69e6('0x112')](_0x69e6('0x113'));}});}})[_0x69e6('0x23')](function(){if(_0x1802bf[_0x69e6('0x10d')]&&_0x1802bf[_0x69e6('0x10d')][_0x69e6('0x10e')]){var _0x2ffa35=[];for(var _0x27b5d1=0x0;_0x27b5d1<_0x1802bf['Interval'][_0x69e6('0x10e')]['length'];_0x27b5d1++){var _0x1f791f=_0x1802bf[_0x69e6('0x10d')]['Intervals'][_0x27b5d1][_0x69e6('0x3b')]({'plain':!![]});_0x2ffa35[_0x69e6('0xc3')](iftimePromise(_0x1f791f,_0x1802bf));}return BPromise[_0x69e6('0x114')](_0x2ffa35)[_0x69e6('0x23')](function(_0x4971cc){return _[_0x69e6('0x115')](_0x4971cc);});}else{return!![];}})[_0x69e6('0x23')](function(_0x138834){var _0x4a828b=fs[_0x69e6('0xd7')](path[_0x69e6('0x7c')](config['root'],_0x69e6('0x116')),_0x69e6('0xd9'));var _0x24b5ee={'remote':_0x1802bf[_0x69e6('0x117')],'query':querystring[_0x69e6('0xb8')](_[_0x69e6('0x55')](_0x1802bf['get']({'plain':!![]}),{'customerIp':_0x1b2da7['headers'][_0x69e6('0xad')]||_0x1b2da7[_0x69e6('0x8e')][_0x69e6('0x118')]||_0x1b2da7[_0x69e6('0x119')]['remoteAddress']||_0x1b2da7['ip'],'referer':_0x1b2da7[_0x69e6('0x8e')]['referer'],'openedInteractions':_0x304f58,'maxInteractions':_0x3f3518,'virtual':_0x6784d9['virtual'],'online':_0x138834,'custom':_0x6784d9}))['replace'](/'/g,'\x5c\x27')};_0x40c676[_0x69e6('0x40')](ejs[_0x69e6('0x11a')](Mustache[_0x69e6('0x11a')](_0x4a828b,_0x24b5ee),{'proactiveActions':_0x190130,'alignment':_0x1802bf[_0x69e6('0x11b')],'verticalAlignment':_0x1802bf[_0x69e6('0x11c')],'div_color':_0x1802bf[_0x69e6('0x100')],'text_color':_0x1802bf[_0x69e6('0x11d')],'button_color':_0x1802bf[_0x69e6('0x11e')],'background_color':_0x1802bf[_0x69e6('0x11f')]}));})[_0x69e6('0x2c')](handleError(_0x40c676,null));};exports['addApplications']=function(_0x3990b1,_0x49d4f1,_0x4e25b1){return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x3990b1[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x49d4f1,null))[_0x69e6('0x23')](function(_0x127c16){if(_0x127c16){return db[_0x69e6('0x120')][_0x69e6('0xe0')](function(_0x2fca5a){return db[_0x69e6('0xa4')][_0x69e6('0x3d')]({'where':{'ChatWebsiteId':_0x3990b1['params']['id']},'transaction':_0x2fca5a})[_0x69e6('0x23')](function(_0x480eb9){var _0x5b8fda=_[_0x69e6('0x42')](_0x3990b1[_0x69e6('0x60')],function(_0x54cef1){_0x54cef1[_0x69e6('0x6b')]=_0x3990b1[_0x69e6('0x5c')]['id'];return _0x54cef1;});return db[_0x69e6('0xa4')][_0x69e6('0xe1')](_0x5b8fda,{'transaction':_0x2fca5a});});})[_0x69e6('0x23')](function(){return db[_0x69e6('0xa4')][_0x69e6('0x121')]({'where':{'ChatWebsiteId':_0x3990b1[_0x69e6('0x5c')]['id']},'order':_0x69e6('0xa8')});});}})['then'](respondWithResult(_0x49d4f1,null))['catch'](handleError(_0x49d4f1,null));};exports[_0x69e6('0x122')]=function(_0x51461f,_0x4c731e,_0x5c1519){var _0x551f80={};var _0x5b6301={};var _0x2766ef;var _0x441afa;return db['ChatWebsite'][_0x69e6('0x71')]({'where':{'id':_0x51461f[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x4c731e,null))[_0x69e6('0x23')](function(_0x146cb7){if(_0x146cb7){_0x2766ef=_0x146cb7;_0x5b6301[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0xa4')][_0x69e6('0x43')]);_0x5b6301[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x51461f[_0x69e6('0x48')]);_0x5b6301[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x5b6301['model'],_0x5b6301[_0x69e6('0x48')]);_0x551f80[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x5b6301[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x551f80[_0x69e6('0x4c')]=_0x551f80[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x551f80[_0x69e6('0x4c')]:_0x5b6301[_0x69e6('0x47')];_0x551f80[_0x69e6('0x6a')]=qs[_0x69e6('0x50')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x50')]);_0x551f80[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x51461f[_0x69e6('0x48')],_0x5b6301[_0x69e6('0x4a')]));if(_0x51461f['query']['filter']){_0x551f80[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x551f80[_0x69e6('0x51')],{'$or':_['map'](_0x551f80[_0x69e6('0x4c')],function(_0x4ff373){var _0x4a6426={};_0x4a6426[_0x4ff373]={'$like':'%'+_0x51461f[_0x69e6('0x48')]['filter']+'%'};return _0x4a6426;})});}_0x551f80=_[_0x69e6('0x55')]({},_0x551f80,_0x51461f[_0x69e6('0x56')]);return _0x2766ef[_0x69e6('0x122')](_0x551f80);}})[_0x69e6('0x23')](function(_0x234947){if(_0x234947){_0x441afa=_0x234947[_0x69e6('0x4e')];if(!_0x51461f[_0x69e6('0x48')][_0x69e6('0x69')]('nolimit')){_0x551f80['limit']=qs[_0x69e6('0x32')](_0x51461f[_0x69e6('0x48')][_0x69e6('0x32')]);_0x551f80[_0x69e6('0x34')]=qs['offset'](_0x51461f['query'][_0x69e6('0x34')]);}return _0x2766ef[_0x69e6('0x122')](_0x551f80);}})[_0x69e6('0x23')](function(_0x36b899){if(_0x36b899){return _0x36b899?{'count':_0x441afa,'rows':_0x36b899}:null;}})[_0x69e6('0x23')](respondWithResult(_0x4c731e,null))[_0x69e6('0x2c')](handleError(_0x4c731e,null));};exports[_0x69e6('0x123')]=function(_0x5ee987,_0x43a7ad,_0x3cf5c0){return db['chatProactiveAction']['find']({'where':{'id':_0x5ee987['params']['id']}})['then'](handleEntityNotFound(_0x43a7ad,null))[_0x69e6('0x23')](function(_0x2f86ce){if(_0x2f86ce){return _0x2f86ce['addProactiveActions'](_0x5ee987[_0x69e6('0x60')]['ids'],_[_0x69e6('0xf9')](_0x5ee987[_0x69e6('0x60')],[_0x69e6('0x6e'),'id'])||{});}})[_0x69e6('0x23')](respondWithResult(_0x43a7ad,null))[_0x69e6('0x2c')](handleError(_0x43a7ad,null));};exports[_0x69e6('0x10f')]=function(_0x3b62dc,_0xe01ad1,_0x1f8b89){var _0x3ba0ab={};var _0x2ed910={};var _0x89385e;var _0x3188e7;return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x3b62dc['params']['id']}})['then'](handleEntityNotFound(_0xe01ad1,null))[_0x69e6('0x23')](function(_0x3dc04b){if(_0x3dc04b){_0x89385e=_0x3dc04b;_0x2ed910[_0x69e6('0x47')]=_['keys'](db['ChatProactiveAction'][_0x69e6('0x43')]);_0x2ed910[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x3b62dc['query']);_0x2ed910[_0x69e6('0x4a')]=_[_0x69e6('0x4b')](_0x2ed910['model'],_0x2ed910[_0x69e6('0x48')]);_0x3ba0ab[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x2ed910[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x3b62dc[_0x69e6('0x48')]['fields']));_0x3ba0ab[_0x69e6('0x4c')]=_0x3ba0ab[_0x69e6('0x4c')]['length']?_0x3ba0ab['attributes']:_0x2ed910[_0x69e6('0x47')];_0x3ba0ab[_0x69e6('0x6a')]=qs['sort'](_0x3b62dc[_0x69e6('0x48')]['sort']);_0x3ba0ab['where']=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x3b62dc[_0x69e6('0x48')],_0x2ed910[_0x69e6('0x4a')]));if(_0x3b62dc[_0x69e6('0x48')][_0x69e6('0x53')]){_0x3ba0ab[_0x69e6('0x51')]=_['merge'](_0x3ba0ab[_0x69e6('0x51')],{'$or':_['map'](_0x3ba0ab[_0x69e6('0x4c')],function(_0x5805f1){var _0x1ba4e5={};_0x1ba4e5[_0x5805f1]={'$like':'%'+_0x3b62dc[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x1ba4e5;})});}_0x3ba0ab=_['merge']({},_0x3ba0ab,_0x3b62dc['options']);return _0x89385e[_0x69e6('0x10f')](_0x3ba0ab);}})[_0x69e6('0x23')](function(_0x33755d){if(_0x33755d){_0x3188e7=_0x33755d[_0x69e6('0x4e')];if(!_0x3b62dc['query'][_0x69e6('0x69')]('nolimit')){_0x3ba0ab[_0x69e6('0x32')]=qs[_0x69e6('0x32')](_0x3b62dc[_0x69e6('0x48')]['limit']);_0x3ba0ab[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x3b62dc['query'][_0x69e6('0x34')]);}return _0x89385e[_0x69e6('0x10f')](_0x3ba0ab);}})['then'](function(_0x3e55fe){if(_0x3e55fe){return _0x3e55fe?{'count':_0x3188e7,'rows':_0x3e55fe}:null;}})['then'](respondWithResult(_0xe01ad1,null))[_0x69e6('0x2c')](handleError(_0xe01ad1,null));};exports[_0x69e6('0x124')]=function(_0x3eea3f,_0x109c46,_0x32ca76){var _0x8cab25=_0x3eea3f['query'][_0x69e6('0x125')]===_0x69e6('0x126')?_0x69e6('0x127'):'onlineForm';return db['ChatWebsite']['find']({'attributes':['id',_0x8cab25],'where':{'id':_0x3eea3f[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x109c46,null))['then'](function(_0x483fbc){if(_0x483fbc){var _0x1ae2b9=_0x483fbc[_0x8cab25];var _0x1265f8=_0x1ae2b9&&_0x1ae2b9[_0x69e6('0x128')]?_0x1ae2b9[_0x69e6('0x128')]:[];_0x109c46[_0x69e6('0x40')]({'fromKey':_[_0x69e6('0x81')](_0x1ae2b9[_0x69e6('0x129')])?undefined:_0x1ae2b9[_0x69e6('0x129')],'count':_0x1265f8[_0x69e6('0x4e')],'rows':_0x1265f8});}})[_0x69e6('0x2c')](handleError(_0x109c46,null));};exports['getOfflineMessages']=function(_0x4e4c82,_0x336576,_0x26a293){var _0x3c465b={'raw':![],'where':{}};var _0x22ad7b={};var _0x6e26c2={'count':0x0,'rows':[]};return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x4e4c82[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x336576,null))[_0x69e6('0x23')](function(_0x21f7ad){if(_0x21f7ad){_0x22ad7b['model']=_['keys'](db[_0x69e6('0xda')][_0x69e6('0x43')]);_0x22ad7b[_0x69e6('0x48')]=_[_0x69e6('0x49')](_0x4e4c82[_0x69e6('0x48')]);_0x22ad7b['filters']=_[_0x69e6('0x4b')](_0x22ad7b['model'],_0x22ad7b['query']);_0x3c465b['attributes']=_['intersection'](_0x22ad7b[_0x69e6('0x47')],qs[_0x69e6('0x4d')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x3c465b[_0x69e6('0x4c')]=_0x3c465b[_0x69e6('0x4c')]['length']?_0x3c465b[_0x69e6('0x4c')]:_0x22ad7b[_0x69e6('0x47')];if(!_0x4e4c82['query'][_0x69e6('0x69')]('nolimit')){_0x3c465b['limit']=qs[_0x69e6('0x32')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x32')]);_0x3c465b[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x34')]);}_0x3c465b[_0x69e6('0x6a')]=qs['sort'](_0x4e4c82['query'][_0x69e6('0x50')]);_0x3c465b[_0x69e6('0x51')]=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x4e4c82[_0x69e6('0x48')],_0x22ad7b[_0x69e6('0x4a')]));_0x3c465b[_0x69e6('0x51')][_0x69e6('0x6b')]=_0x21f7ad['id'];if(_0x4e4c82[_0x69e6('0x48')]['filter']){_0x3c465b[_0x69e6('0x51')]=_['merge'](_0x3c465b['where'],{'$or':_['map'](_0x3c465b[_0x69e6('0x4c')],function(_0x909d2f){var _0x6b4a8f={};_0x6b4a8f[_0x909d2f]={'$like':'%'+_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x53')]+'%'};return _0x6b4a8f;})});}_0x3c465b=_['merge']({},_0x3c465b,_0x4e4c82[_0x69e6('0x56')]);return db[_0x69e6('0xda')][_0x69e6('0x33')]({'where':_0x3c465b[_0x69e6('0x51')]})[_0x69e6('0x23')](function(_0x3a4a61){_0x6e26c2[_0x69e6('0x33')]=_0x3a4a61;if(_0x4e4c82[_0x69e6('0x48')][_0x69e6('0x5d')]){_0x3c465b[_0x69e6('0x58')]=[{'all':!![]}];}else{_0x3c465b[_0x69e6('0x58')]=[{'model':db[_0x69e6('0xa1')],'as':_0x69e6('0xfa'),'required':![]},{'model':db[_0x69e6('0x12a')],'as':_0x69e6('0x12b'),'required':![]}];}return db[_0x69e6('0xda')][_0x69e6('0x59')](_0x3c465b);})['then'](function(_0x13bc99){_0x6e26c2['rows']=_0x13bc99;return _0x6e26c2;});}})['then'](respondWithFilteredResult(_0x336576,_0x3c465b))[_0x69e6('0x2c')](handleError(_0x336576,null));};exports['addAgents']=function(_0x396091,_0x32241f,_0x21c83c){return db[_0x69e6('0x57')]['find']({'where':{'id':_0x396091[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x32241f,null))[_0x69e6('0x23')](function(_0x1ef2f9){if(_0x1ef2f9){return _0x1ef2f9[_0x69e6('0x12c')](_0x396091['body'][_0x69e6('0x6e')],_[_0x69e6('0xf9')](_0x396091['body'],[_0x69e6('0x6e'),'id'])||{})[_0x69e6('0xbd')](function(_0x1b82e3){for(var _0x1f8a34=0x0;_0x1f8a34<_0x396091[_0x69e6('0x60')][_0x69e6('0x6e')]['length'];_0x1f8a34+=0x1){socket['emit'](_0x69e6('0x12d'),{'UserId':Number(_0x396091[_0x69e6('0x60')][_0x69e6('0x6e')][_0x1f8a34]),'ChatWebsiteId':Number(_0x396091['params']['id'])});}return _0x1b82e3;});}})[_0x69e6('0x23')](respondWithResult(_0x32241f,null))[_0x69e6('0x2c')](handleError(_0x32241f,null));};exports['removeAgents']=function(_0x5cae8e,_0x531c77,_0x1e39e5){return db[_0x69e6('0x57')]['find']({'where':{'id':_0x5cae8e[_0x69e6('0x5c')]['id']}})['then'](handleEntityNotFound(_0x531c77,null))['then'](function(_0x3a753f){if(_0x3a753f){return _0x3a753f[_0x69e6('0x12e')](_0x5cae8e['query']['ids'])['then'](function(){if(_[_0x69e6('0x12f')](_0x5cae8e[_0x69e6('0x48')][_0x69e6('0x6e')])){for(var _0x28efe7=0x0;_0x28efe7<_0x5cae8e[_0x69e6('0x48')][_0x69e6('0x6e')][_0x69e6('0x4e')];_0x28efe7+=0x1){socket[_0x69e6('0x130')](_0x69e6('0x131'),{'UserId':Number(_0x5cae8e['query']['ids'][_0x28efe7]),'ChatWebsiteId':Number(_0x5cae8e[_0x69e6('0x5c')]['id'])});}}else{socket[_0x69e6('0x130')]('userChatWebsite:remove',{'UserId':Number(_0x5cae8e['query'][_0x69e6('0x6e')]),'ChatWebsiteId':Number(_0x5cae8e[_0x69e6('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x531c77,null))['catch'](handleError(_0x531c77,null));};exports[_0x69e6('0x132')]=function(_0x337ba4,_0x3fb559,_0x5688a6){var _0x2aa0fd={};var _0x2a10b2={};var _0x3f4fbf;var _0x2c05dd;return db[_0x69e6('0x57')][_0x69e6('0x71')]({'where':{'id':_0x337ba4[_0x69e6('0x5c')]['id']}})[_0x69e6('0x23')](handleEntityNotFound(_0x3fb559,null))[_0x69e6('0x23')](function(_0x54b23f){if(_0x54b23f){_0x3f4fbf=_0x54b23f;_0x2a10b2[_0x69e6('0x47')]=_[_0x69e6('0x49')](db[_0x69e6('0x133')][_0x69e6('0x43')]);_0x2a10b2['query']=_[_0x69e6('0x49')](_0x337ba4[_0x69e6('0x48')]);_0x2a10b2[_0x69e6('0x4a')]=_['intersection'](_0x2a10b2[_0x69e6('0x47')],_0x2a10b2[_0x69e6('0x48')]);_0x2aa0fd[_0x69e6('0x4c')]=_[_0x69e6('0x4b')](_0x2a10b2['model'],qs[_0x69e6('0x4d')](_0x337ba4[_0x69e6('0x48')][_0x69e6('0x4d')]));_0x2aa0fd[_0x69e6('0x4c')]=_0x2aa0fd[_0x69e6('0x4c')][_0x69e6('0x4e')]?_0x2aa0fd[_0x69e6('0x4c')]:_0x2a10b2['model'];_0x2aa0fd['order']=qs[_0x69e6('0x50')](_0x337ba4['query']['sort']);_0x2aa0fd['where']=qs[_0x69e6('0x4a')](_[_0x69e6('0x52')](_0x337ba4[_0x69e6('0x48')],_0x2a10b2[_0x69e6('0x4a')]));if(_0x337ba4[_0x69e6('0x48')]['filter']){_0x2aa0fd[_0x69e6('0x51')]=_[_0x69e6('0x55')](_0x2aa0fd[_0x69e6('0x51')],{'$or':_[_0x69e6('0x42')](_0x2aa0fd[_0x69e6('0x4c')],function(_0x214163){var _0x44374a={};_0x44374a[_0x214163]={'$like':'%'+_0x337ba4['query'][_0x69e6('0x53')]+'%'};return _0x44374a;})});}_0x2aa0fd=_[_0x69e6('0x55')]({},_0x2aa0fd,_0x337ba4[_0x69e6('0x56')]);return _0x3f4fbf['getAgents'](_0x2aa0fd);}})[_0x69e6('0x23')](function(_0xce4636){if(_0xce4636){_0x2c05dd=_0xce4636[_0x69e6('0x4e')];if(!_0x337ba4['query']['hasOwnProperty']('nolimit')){_0x2aa0fd['limit']=qs[_0x69e6('0x32')](_0x337ba4[_0x69e6('0x48')]['limit']);_0x2aa0fd[_0x69e6('0x34')]=qs[_0x69e6('0x34')](_0x337ba4[_0x69e6('0x48')]['offset']);}return _0x3f4fbf[_0x69e6('0x132')](_0x2aa0fd);}})[_0x69e6('0x23')](function(_0x4bcec0){if(_0x4bcec0){return _0x4bcec0?{'count':_0x2c05dd,'rows':_0x4bcec0}:null;}})[_0x69e6('0x23')](respondWithResult(_0x3fb559,null))[_0x69e6('0x2c')](handleError(_0x3fb559,null));};
\ No newline at end of file
+var _0xb7ea=['mapValues','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','ONLINE','OFFLINE','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','virtual','License','increment','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.ejs','remote','x-real-ip','connection','remoteAddress','replace','alignment','textColor','backgroundColor','addApplications','findAndCountAll','priority','getApplications','addProactiveActions','omit','getProactiveActions','online','false','offlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','json','offset','undefined','count','apply','save','get','ChatWebsites','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','ChatWebsite','includeAll','include','findAll','rows','show','params','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ChatWebsiteId','Disposition','findOne','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','download','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','CmContact','Sequelize','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','from','ValidationError','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','ChatApplication','Applications','List','account','applications','orderBy','Contacts','contact','customerIp','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','lastName','messageId','created','autoclose','push','close','*,*,*,*','UserId','User','unshift','agent','Start','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','transaction','Attachment','bulkCreate','MailServerOut','Smtp','forwardOffline','forwardOfflineAddress','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xb7ea,0x16c));var _0xab7e=function(_0x65c50e,_0x1aa926){_0x65c50e=_0x65c50e-0x0;var _0x4573e7=_0xb7ea[_0x65c50e];return _0x4573e7;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xab7e('0x0'));var zipdir=require(_0xab7e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xab7e('0x2'));var BPromise=require(_0xab7e('0x3'));var Mustache=require(_0xab7e('0x4'));var util=require(_0xab7e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0xab7e('0x6'));var ejs=require(_0xab7e('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xab7e('0x8'));var squel=require(_0xab7e('0x9'));var crypto=require(_0xab7e('0xa'));var jsforce=require(_0xab7e('0xb'));var deskjs=require(_0xab7e('0xc'));var toCsv=require(_0xab7e('0x6'));var querystring=require(_0xab7e('0xd'));var Papa=require(_0xab7e('0xe'));var Redis=require('ioredis');var authService=require(_0xab7e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xab7e('0x10'));var hardwareService=require(_0xab7e('0x11'));var logger=require(_0xab7e('0x12'))(_0xab7e('0x13'));var utils=require(_0xab7e('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xab7e('0x15'));var db=require(_0xab7e('0x16'))['db'];config[_0xab7e('0x17')]=_[_0xab7e('0x18')](config[_0xab7e('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xab7e('0x19'))(new Redis(config[_0xab7e('0x17')]));require(_0xab7e('0x1a'))[_0xab7e('0x1b')](socket);var jayson=require(_0xab7e('0x1c'));var client=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232c});var client9002=jayson['client'][_0xab7e('0x1e')]({'port':0x232a});var client9003=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x232b});var client9001=jayson[_0xab7e('0x1d')][_0xab7e('0x1e')]({'port':0x2329});function respondWithRpcPromise(_0x5aadb8,_0xe7f6e9,_0x3c1799,_0x433072){return new BPromise(function(_0x58ffa0,_0x5ba2dd){var _0x64928=_0x433072||client;return _0x64928[_0xab7e('0x1f')](_0x5aadb8,_0x3c1799)[_0xab7e('0x20')](function(_0x58846b){logger['info'](_0xab7e('0x21'),_0xe7f6e9,'request\x20sent');logger[_0xab7e('0x22')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'),JSON[_0xab7e('0x24')](_0x58846b));if(_0x58846b[_0xab7e('0x25')]){if(_0x58846b[_0xab7e('0x25')][_0xab7e('0x26')]===0x1f4){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x5ba2dd(_0x58846b['error'][_0xab7e('0x27')]);}logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);return _0x58ffa0(_0x58846b[_0xab7e('0x25')][_0xab7e('0x27')]);}else{logger[_0xab7e('0x28')]('ChatWebsite,\x20%s,\x20%s',_0xe7f6e9,_0xab7e('0x23'));_0x58ffa0(_0x58846b[_0xab7e('0x29')][_0xab7e('0x27')]);}})[_0xab7e('0x2a')](function(_0x5e6c68){logger[_0xab7e('0x25')](_0xab7e('0x21'),_0xe7f6e9,_0x5e6c68);_0x5ba2dd(_0x5e6c68);});});}function respondWithStatusCode(_0x1e1931,_0x26bef5){_0x26bef5=_0x26bef5||0xcc;return function(_0x1316ff){if(_0x1316ff){return _0x1e1931[_0xab7e('0x2b')](_0x26bef5);}return _0x1e1931[_0xab7e('0x2c')](_0x26bef5)[_0xab7e('0x2d')]();};}function respondWithResult(_0x5d2d1c,_0x537215){_0x537215=_0x537215||0xc8;return function(_0x48846d){if(_0x48846d){return _0x5d2d1c['status'](_0x537215)[_0xab7e('0x2e')](_0x48846d);}};}function respondWithFilteredResult(_0x4c268a,_0x35c507){return function(_0x5e8efa){if(_0x5e8efa){var _0x33d8a0=typeof _0x35c507[_0xab7e('0x2f')]===_0xab7e('0x30')&&typeof _0x35c507['limit']===_0xab7e('0x30');var _0x4bfcf0=_0x5e8efa['count'];var _0x409a8b=_0x33d8a0?0x0:_0x35c507[_0xab7e('0x2f')];var _0x1f621e=_0x33d8a0?_0x5e8efa[_0xab7e('0x31')]:_0x35c507[_0xab7e('0x2f')]+_0x35c507['limit'];var _0x47a322;if(_0x1f621e>=_0x4bfcf0){_0x1f621e=_0x4bfcf0;_0x47a322=0xc8;}else{_0x47a322=0xce;}_0x4c268a[_0xab7e('0x2c')](_0x47a322);return _0x4c268a['set']('Content-Range',_0x409a8b+'-'+_0x1f621e+'/'+_0x4bfcf0)['json'](_0x5e8efa);}return null;};}function patchUpdates(_0x30b442){return function(_0x175c9c){try{jsonpatch[_0xab7e('0x32')](_0x175c9c,_0x30b442,!![]);}catch(_0x299f06){return BPromise['reject'](_0x299f06);}return _0x175c9c[_0xab7e('0x33')]();};}function saveUpdates(_0x1ac8b3,_0x4fd262){return function(_0x4df546){if(_0x4df546){return _0x4df546['update'](_0x1ac8b3)[_0xab7e('0x20')](function(_0x472cbb){return _0x472cbb;});}return null;};}function removeEntity(_0x5f0abd,_0x25a4d7){return function(_0x421ed7){if(_0x421ed7){return _0x421ed7['destroy']()[_0xab7e('0x20')](function(){var _0x25960a=_0x421ed7[_0xab7e('0x34')]({'plain':!![]});var _0x28e6bb=_0xab7e('0x35');return db[_0xab7e('0x36')][_0xab7e('0x37')]({'where':{'type':_0x28e6bb,'resourceId':_0x25960a['id']}})[_0xab7e('0x20')](function(){return _0x421ed7;});})[_0xab7e('0x20')](function(){_0x5f0abd[_0xab7e('0x2c')](0xcc)[_0xab7e('0x2d')]();});}};}function handleEntityNotFound(_0x371d44,_0x275968){return function(_0x3444c6){if(!_0x3444c6){_0x371d44['sendStatus'](0x194);}return _0x3444c6;};}function handleError(_0x4772b7,_0x2ec77f){_0x2ec77f=_0x2ec77f||0x1f4;return function(_0x1cc44c){logger['error'](_0x1cc44c[_0xab7e('0x38')]);if(_0x1cc44c[_0xab7e('0x39')]){delete _0x1cc44c['name'];}_0x4772b7[_0xab7e('0x2c')](_0x2ec77f)[_0xab7e('0x3a')](_0x1cc44c);};}exports[_0xab7e('0x3b')]=function(_0x279b63,_0x399319){var _0x152245={'include':[{'model':db[_0xab7e('0x3c')],'as':_0xab7e('0x3d')}]},_0x27c493={},_0x4dfd7e={'count':0x0,'rows':[]};var _0xb4f340=_[_0xab7e('0x3e')](db['ChatWebsite'][_0xab7e('0x3f')],function(_0x41a2e0){return{'name':_0x41a2e0[_0xab7e('0x40')],'type':_0x41a2e0[_0xab7e('0x41')][_0xab7e('0x42')]};});_0x27c493[_0xab7e('0x43')]=_[_0xab7e('0x3e')](_0xb4f340,_0xab7e('0x39'));_0x27c493[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x279b63[_0xab7e('0x44')]);_0x27c493[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x27c493['model'],_0x27c493[_0xab7e('0x44')]);_0x152245['attributes']=_[_0xab7e('0x47')](_0x27c493[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x48')]));_0x152245[_0xab7e('0x49')]=_0x152245[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x152245[_0xab7e('0x49')]:_0x27c493[_0xab7e('0x43')];if(!_0x279b63[_0xab7e('0x44')][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x152245['limit']=qs[_0xab7e('0x4d')](_0x279b63[_0xab7e('0x44')]['limit']);_0x152245[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x279b63[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x152245[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x279b63['query']['sort']);_0x152245[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x279b63['query'],_0x27c493[_0xab7e('0x46')]),_0xb4f340);if(_0x279b63['query']['filter']){_0x152245[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x152245[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0xb4f340,function(_0x197e8a){if(_0x197e8a[_0xab7e('0x41')]!==_0xab7e('0x53')){var _0x155f35={};_0x155f35[_0x197e8a[_0xab7e('0x39')]]={'$like':'%'+_0x279b63['query'][_0xab7e('0x54')]+'%'};return _0x155f35;}})});}_0x152245=_[_0xab7e('0x52')]({},_0x152245,_0x279b63[_0xab7e('0x55')]);var _0x1f62dd={'where':_0x152245['where']};return db[_0xab7e('0x56')]['count'](_0x1f62dd)[_0xab7e('0x20')](function(_0x2b7f8e){_0x4dfd7e[_0xab7e('0x31')]=_0x2b7f8e;if(_0x279b63['query'][_0xab7e('0x57')]){_0x152245[_0xab7e('0x58')]=[{'all':!![]}];}return db[_0xab7e('0x56')][_0xab7e('0x59')](_0x152245);})[_0xab7e('0x20')](function(_0x398ceb){_0x4dfd7e[_0xab7e('0x5a')]=_0x398ceb;return _0x4dfd7e;})[_0xab7e('0x20')](respondWithFilteredResult(_0x399319,_0x152245))['catch'](handleError(_0x399319,null));};exports[_0xab7e('0x5b')]=function(_0x2008f3,_0x38538b){var _0x42b5f6={'raw':![],'where':{'id':_0x2008f3[_0xab7e('0x5c')]['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]},_0x1599a2={};_0x1599a2[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatWebsite']['rawAttributes']);_0x1599a2[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2008f3['query']);_0x1599a2[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],_0x1599a2[_0xab7e('0x44')]);_0x42b5f6[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x1599a2[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x2008f3[_0xab7e('0x44')][_0xab7e('0x48')]));_0x42b5f6['attributes']=_0x42b5f6[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x42b5f6['attributes']:_0x1599a2[_0xab7e('0x43')];if(_0x2008f3[_0xab7e('0x44')][_0xab7e('0x57')]){_0x42b5f6[_0xab7e('0x58')]=[{'all':!![]}];}_0x42b5f6=_[_0xab7e('0x52')]({},_0x42b5f6,_0x2008f3[_0xab7e('0x55')]);return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x42b5f6)['then'](handleEntityNotFound(_0x38538b,null))[_0xab7e('0x20')](respondWithResult(_0x38538b,null))[_0xab7e('0x2a')](handleError(_0x38538b,null));};exports[_0xab7e('0x5e')]=function(_0x4b1163,_0x278068){return db['ChatWebsite'][_0xab7e('0x5e')](_0x4b1163[_0xab7e('0x5f')],{})[_0xab7e('0x20')](function(_0x15963b){var _0x3eec87=_0x4b1163[_0xab7e('0x60')][_0xab7e('0x34')]({'plain':!![]});if(!_0x3eec87)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3eec87[_0xab7e('0x61')]==='user'){var _0x186803=_0x15963b[_0xab7e('0x34')]({'plain':!![]});var _0xb4a6c4=_0xab7e('0x35');return db['UserProfileSection'][_0xab7e('0x5d')]({'where':{'name':_0xb4a6c4,'userProfileId':_0x3eec87[_0xab7e('0x62')]},'raw':!![]})[_0xab7e('0x20')](function(_0x46298b){if(_0x46298b&&_0x46298b[_0xab7e('0x63')]===0x0){return db[_0xab7e('0x36')][_0xab7e('0x5e')]({'name':_0x186803[_0xab7e('0x39')],'resourceId':_0x186803['id'],'type':_0x46298b['name'],'sectionId':_0x46298b['id']},{})['then'](function(){return _0x15963b;});}else{return _0x15963b;}})[_0xab7e('0x2a')](function(_0x2e69b8){logger[_0xab7e('0x25')](_0xab7e('0x64'),_0x2e69b8);throw _0x2e69b8;});}return _0x15963b;})[_0xab7e('0x20')](respondWithResult(_0x278068,0xc9))[_0xab7e('0x2a')](handleError(_0x278068,null));};exports[_0xab7e('0x65')]=function(_0x52a48c,_0x589bdc){if(_0x52a48c[_0xab7e('0x5f')]['id']){delete _0x52a48c[_0xab7e('0x5f')]['id'];}return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x52a48c['params']['id']},'include':[{'model':db['Pause'],'as':_0xab7e('0x3d')}]})[_0xab7e('0x20')](handleEntityNotFound(_0x589bdc,null))['then'](saveUpdates(_0x52a48c['body'],null))[_0xab7e('0x20')](respondWithResult(_0x589bdc,null))[_0xab7e('0x2a')](handleError(_0x589bdc,null));};exports[_0xab7e('0x37')]=function(_0x8b9201,_0x5355d2){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x8b9201[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5355d2,null))[_0xab7e('0x20')](removeEntity(_0x5355d2,null))[_0xab7e('0x2a')](handleError(_0x5355d2,null));};exports[_0xab7e('0x66')]=function(_0x4e4087,_0x1e2bc6){return db[_0xab7e('0x56')]['describe']()[_0xab7e('0x20')](respondWithResult(_0x1e2bc6,null))[_0xab7e('0x2a')](handleError(_0x1e2bc6,null));};exports[_0xab7e('0x67')]=function(_0x5f1af4,_0xf1c8df,_0x515a5c){if(_0x5f1af4[_0xab7e('0x5f')]['id']){delete _0x5f1af4['body']['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5f1af4[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0xf1c8df,null))['then'](function(_0x5dd194){if(_0x5dd194){_0x5f1af4[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x5dd194['id'];return db[_0xab7e('0x69')]['create'](_0x5f1af4[_0xab7e('0x5f')]);}})[_0xab7e('0x20')](respondWithResult(_0xf1c8df,null))[_0xab7e('0x2a')](handleError(_0xf1c8df,null));};exports['getDispositions']=function(_0x13a5ab,_0xbb4e6f,_0x192d02){var _0x2089ff={'raw':![],'where':{}};var _0x22728e={};var _0x480d06={'count':0x0,'rows':[]};return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x13a5ab[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xbb4e6f,null))[_0xab7e('0x20')](function(_0x3e57b6){if(_0x3e57b6){_0x22728e['model']=_[_0xab7e('0x45')](db['Disposition'][_0xab7e('0x3f')]);_0x22728e[_0xab7e('0x44')]=_['keys'](_0x13a5ab[_0xab7e('0x44')]);_0x22728e['filters']=_[_0xab7e('0x47')](_0x22728e['model'],_0x22728e[_0xab7e('0x44')]);_0x2089ff[_0xab7e('0x49')]=_['intersection'](_0x22728e[_0xab7e('0x43')],qs['fields'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x48')]));_0x2089ff[_0xab7e('0x49')]=_0x2089ff['attributes'][_0xab7e('0x4a')]?_0x2089ff[_0xab7e('0x49')]:_0x22728e[_0xab7e('0x43')];if(!_0x13a5ab['query'][_0xab7e('0x4b')]('nolimit')){_0x2089ff[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x13a5ab['query'][_0xab7e('0x4d')]);_0x2089ff[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x2089ff[_0xab7e('0x4e')]=qs['sort'](_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x2089ff[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x13a5ab[_0xab7e('0x44')],_0x22728e[_0xab7e('0x46')]));_0x2089ff[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e57b6['id'];if(_0x13a5ab[_0xab7e('0x44')]['filter']){_0x2089ff['where']=_[_0xab7e('0x52')](_0x2089ff[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x2089ff[_0xab7e('0x49')],function(_0x224fd8){var _0x3f3f23={};_0x3f3f23[_0x224fd8]={'$like':'%'+_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x3f3f23;})});}_0x2089ff=_[_0xab7e('0x52')]({},_0x2089ff,_0x13a5ab[_0xab7e('0x55')]);return db['Disposition'][_0xab7e('0x31')]({'where':_0x2089ff[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x3f2190){_0x480d06[_0xab7e('0x31')]=_0x3f2190;if(_0x13a5ab[_0xab7e('0x44')][_0xab7e('0x57')]){_0x2089ff[_0xab7e('0x58')]=[{'all':!![]}];}return db['Disposition'][_0xab7e('0x59')](_0x2089ff);})[_0xab7e('0x20')](function(_0x5c817b){_0x480d06[_0xab7e('0x5a')]=_0x5c817b;return _0x480d06;});}})['then'](respondWithFilteredResult(_0xbb4e6f,_0x2089ff))[_0xab7e('0x2a')](handleError(_0xbb4e6f,null));};exports[_0xab7e('0x6b')]=function(_0x226459,_0x4a50b2,_0x5ddb61){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x226459[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a50b2,null))[_0xab7e('0x20')](function(_0x4494fc){if(_0x4494fc){return _0x4494fc[_0xab7e('0x6b')](_0x226459[_0xab7e('0x44')]['ids']);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4a50b2,null))[_0xab7e('0x2a')](handleError(_0x4a50b2,null));};exports[_0xab7e('0x6c')]=function(_0x5799ec,_0x3856f,_0x6d2fa1){if(_0x5799ec[_0xab7e('0x5f')]['id']){delete _0x5799ec[_0xab7e('0x5f')]['id'];}return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x5799ec['params']['id']}})['then'](handleEntityNotFound(_0x3856f,null))[_0xab7e('0x20')](function(_0x1cb6a9){if(_0x1cb6a9){_0x5799ec[_0xab7e('0x5f')][_0xab7e('0x68')]=_0x1cb6a9['id'];return db[_0xab7e('0x6d')]['create'](_0x5799ec['body']);}})[_0xab7e('0x20')](respondWithResult(_0x3856f,null))[_0xab7e('0x2a')](handleError(_0x3856f,null));};exports[_0xab7e('0x6e')]=function(_0x25b757,_0x11b5b8,_0x1deec7){var _0x56e5c1={'raw':![],'where':{}};var _0x49b647={};var _0x328388={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xab7e('0x6a')]({'where':{'id':_0x25b757[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11b5b8,null))['then'](function(_0x46921a){if(_0x46921a){_0x49b647[_0xab7e('0x43')]=_['keys'](db[_0xab7e('0x6d')]['rawAttributes']);_0x49b647[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x25b757[_0xab7e('0x44')]);_0x49b647[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x49b647[_0xab7e('0x43')],_0x49b647[_0xab7e('0x44')]);_0x56e5c1[_0xab7e('0x49')]=_['intersection'](_0x49b647[_0xab7e('0x43')],qs['fields'](_0x25b757[_0xab7e('0x44')]['fields']));_0x56e5c1['attributes']=_0x56e5c1[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x56e5c1[_0xab7e('0x49')]:_0x49b647[_0xab7e('0x43')];if(!_0x25b757['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x56e5c1[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x56e5c1['offset']=qs[_0xab7e('0x2f')](_0x25b757[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x56e5c1[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x25b757['query'][_0xab7e('0x4f')]);_0x56e5c1[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x25b757['query'],_0x49b647[_0xab7e('0x46')]));_0x56e5c1[_0xab7e('0x50')][_0xab7e('0x68')]=_0x46921a['id'];if(_0x25b757[_0xab7e('0x44')]['filter']){_0x56e5c1[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x56e5c1[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x56e5c1[_0xab7e('0x49')],function(_0x4440d4){var _0x22f476={};_0x22f476[_0x4440d4]={'$like':'%'+_0x25b757[_0xab7e('0x44')]['filter']+'%'};return _0x22f476;})});}_0x56e5c1=_[_0xab7e('0x52')]({},_0x56e5c1,_0x25b757['options']);return db[_0xab7e('0x6d')]['count']({'where':_0x56e5c1[_0xab7e('0x50')]})['then'](function(_0x6c3aa4){_0x328388['count']=_0x6c3aa4;if(_0x25b757[_0xab7e('0x44')][_0xab7e('0x57')]){_0x56e5c1[_0xab7e('0x58')]=[{'all':!![]}];}return db['CannedAnswer'][_0xab7e('0x59')](_0x56e5c1);})['then'](function(_0x1c5184){_0x328388[_0xab7e('0x5a')]=_0x1c5184;return _0x328388;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x11b5b8,_0x56e5c1))[_0xab7e('0x2a')](handleError(_0x11b5b8,null));};exports['removeAnswers']=function(_0x2be82b,_0x4eaa76,_0x27ccbd){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2be82b[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4eaa76,null))[_0xab7e('0x20')](function(_0x121145){if(_0x121145){return _0x121145[_0xab7e('0x6f')](_0x2be82b[_0xab7e('0x44')][_0xab7e('0x70')]);}})[_0xab7e('0x20')](respondWithStatusCode(_0x4eaa76,null))[_0xab7e('0x2a')](handleError(_0x4eaa76,null));};exports[_0xab7e('0x71')]=function(_0x51feee,_0x539916,_0xceec97){_0x51feee[_0xab7e('0x5f')][_0xab7e('0x72')]=_0x51feee[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x51feee[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x539916,null))['then'](saveUpdates(_0x51feee['body'],null))[_0xab7e('0x20')](respondWithResult(_0x539916,null))[_0xab7e('0x2a')](handleError(_0x539916,null));};exports[_0xab7e('0x75')]=function(_0x2c9291,_0x2f71f1,_0x1f4270){_0x2c9291['body'][_0xab7e('0x76')]=_0x2c9291[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x2c9291[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x2f71f1,null))[_0xab7e('0x20')](saveUpdates(_0x2c9291[_0xab7e('0x5f')],null))[_0xab7e('0x20')](respondWithResult(_0x2f71f1,null))[_0xab7e('0x2a')](handleError(_0x2f71f1,null));};exports[_0xab7e('0x77')]=function(_0x387b59,_0x277306,_0x590358){_0x387b59[_0xab7e('0x5f')][_0xab7e('0x78')]=_0x387b59[_0xab7e('0x73')][_0xab7e('0x74')];return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x387b59[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x277306,null))[_0xab7e('0x20')](saveUpdates(_0x387b59['body'],null))[_0xab7e('0x20')](respondWithResult(_0x277306,null))['catch'](handleError(_0x277306,null));};exports[_0xab7e('0x79')]=function(_0x122c6a,_0x11e5a0,_0x5e3a99){_0x122c6a['body'][_0xab7e('0x7a')]=_0x122c6a[_0xab7e('0x73')][_0xab7e('0x74')];return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x122c6a[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x11e5a0,null))[_0xab7e('0x20')](saveUpdates(_0x122c6a['body'],null))[_0xab7e('0x20')](respondWithResult(_0x11e5a0,null))['catch'](handleError(_0x11e5a0,null));};exports[_0xab7e('0x7b')]=function(_0x1b212b,_0x333704,_0x13d84f){var _0x203565=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x7d'));var _0x56dc0e={'where':{'id':_0x1b212b[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x72')],'raw':!![]};var _0x4dc744=![];return require('../../config/license/util')[_0xab7e('0x7e')]()['then'](function(_0x11fd8b){if(_0x11fd8b){_0x4dc744=_0x11fd8b[_0xab7e('0x7f')];}})[_0xab7e('0x20')](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x56dc0e);})['then'](handleEntityNotFound(_0x333704,null))[_0xab7e('0x20')](function(_0x7cf2f2){if(_0x7cf2f2){if(!_[_0xab7e('0x80')](_0x7cf2f2[_0xab7e('0x72')])){if(fs[_0xab7e('0x81')](path['join'](config['root'],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]))&&_0x4dc744){_0x203565=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/logos/',_0x7cf2f2[_0xab7e('0x72')]);}}return _0x333704['download'](_0x203565);}})[_0xab7e('0x2a')](handleError(_0x333704,null));};exports[_0xab7e('0x83')]=function(_0x4f15b0,_0x165395,_0x4ea43c){var _0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x84'));var _0x4f525b={'where':{'id':_0x4f15b0['params']['id']},'attributes':['id',_0xab7e('0x76')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x4f525b)[_0xab7e('0x20')](handleEntityNotFound(_0x165395,null))[_0xab7e('0x20')](function(_0x223908){if(_0x223908){if(!_[_0xab7e('0x80')](_0x223908['agentAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]))){_0x3ef0d9=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x223908[_0xab7e('0x76')]);}}return _0x165395[_0xab7e('0x86')](_0x3ef0d9);}})['catch'](handleError(_0x165395,null));};exports[_0xab7e('0x87')]=function(_0x21bc1d,_0x44714d,_0x26029d){var _0x40e8b0=path[_0xab7e('0x82')](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x1784ba={'where':{'id':_0x21bc1d[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x78'),_0xab7e('0x88')],'raw':!![]};return db[_0xab7e('0x56')][_0xab7e('0x5d')](_0x1784ba)[_0xab7e('0x20')](handleEntityNotFound(_0x44714d,null))[_0xab7e('0x20')](function(_0x45ab5e){if(_0x45ab5e){if(!_[_0xab7e('0x80')](_0x45ab5e[_0xab7e('0x78')])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]))&&_0x45ab5e[_0xab7e('0x88')]){_0x40e8b0=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0x45ab5e[_0xab7e('0x78')]);}}return _0x44714d[_0xab7e('0x86')](_0x40e8b0);}})[_0xab7e('0x2a')](handleError(_0x44714d,null));};exports['getSystemAvatar']=function(_0x37f4ec,_0x51ffec,_0x3e1ad0){var _0x36f5ab=path['join'](config[_0xab7e('0x7c')],_0xab7e('0x89'));var _0x8de24e={'where':{'id':_0x37f4ec[_0xab7e('0x5c')]['id']},'attributes':['id',_0xab7e('0x7a')],'raw':!![]};return db['ChatWebsite'][_0xab7e('0x5d')](_0x8de24e)[_0xab7e('0x20')](handleEntityNotFound(_0x51ffec,null))[_0xab7e('0x20')](function(_0xa9136a){if(_0xa9136a){if(!_[_0xab7e('0x80')](_0xa9136a['systemAvatar'])){if(fs[_0xab7e('0x81')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/images/avatars/',_0xa9136a[_0xab7e('0x7a')]))){_0x36f5ab=path[_0xab7e('0x82')](config[_0xab7e('0x7c')],_0xab7e('0x85'),_0xa9136a[_0xab7e('0x7a')]);}}return _0x51ffec[_0xab7e('0x86')](_0x36f5ab);}})[_0xab7e('0x2a')](handleError(_0x51ffec,null));};exports[_0xab7e('0x8a')]=function(_0x393b1d,_0x4a353d,_0x4d845e){var _0x3d7de6=require(_0xab7e('0x8b'));var _0x3373f0=new _0x3d7de6();var _0xa54467=_0x3373f0[_0xab7e('0x8c')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0x8e')])[_0xab7e('0x8f')]();var _0xbec26d={'body':_0x393b1d['body'],'channel':'chat'};var _0x4fc89d=[];var _0x50ad72=[];var _0x37577e={};var _0x2d7037=![];return db[_0xab7e('0x90')][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x16c43a){if(!_0x16c43a){throw new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x92'));}_0x4fc89d=_[_0xab7e('0x93')](_['keys'](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95')]);_0x50ad72=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x16c43a),[_0xab7e('0x94'),_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x393b1d['body']['id']){delete _0x393b1d[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x393b1d['body'][_0xab7e('0x98')])){throw new db[(_0xab7e('0x91'))]['ValidationError']('from\x20is\x20mandatory');}if(_[_0xab7e('0x80')](_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')])||_0x393b1d[_0xab7e('0x5f')]['body']===''){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x9a'));}if(_[_0xab7e('0x80')](_0x393b1d['body']['mapKey'])){throw new db[(_0xab7e('0x91'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x50ad72);}if(!_['includes'](_0x50ad72,_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')])){throw new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0x9c')+_0x50ad72);}_0x37577e[_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];})[_0xab7e('0x20')](function(){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x393b1d['params']['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':'List','include':[{'model':db[_0xab7e('0x90')],'as':'Contacts','where':_0x37577e,'limit':0x1,'order':[[_0xab7e('0x95'),'DESC']]}]},{'model':db[_0xab7e('0x9e')],'as':_0xab7e('0x9f')}]});})['then'](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4555a1){if(_0x4555a1&&_0x4555a1[_0xab7e('0xa0')]){_0xbec26d[_0xab7e('0xa1')]=_0x4555a1;_0xbec26d[_0xab7e('0xa2')]=_0x4555a1[_0xab7e('0x9f')];_0xbec26d['list']=_0x4555a1[_0xab7e('0xa0')];_0xbec26d[_0xab7e('0xa2')]=_[_0xab7e('0xa3')](_0xbec26d[_0xab7e('0xa2')],['priority'],['asc']);if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')]){delete _0xbec26d[_0xab7e('0xa1')][_0xab7e('0x9f')];}if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')]&&_0xbec26d[_0xab7e('0xa1')]['List'][_0xab7e('0xa4')]['length']){return _0xbec26d[_0xab7e('0xa1')][_0xab7e('0xa0')][_0xab7e('0xa4')][0x0];}var _0x5d3907=_[_0xab7e('0x18')](_0x393b1d[_0xab7e('0x5f')],{'firstName':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x4555a1['ListId']});_0x5d3907[_0x393b1d['body'][_0xab7e('0x9b')]]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x98')];return db[_0xab7e('0x90')][_0xab7e('0x5e')](_0x5d3907,{'fields':_0x4fc89d,'raw':!![]});}})[_0xab7e('0x20')](handleEntityNotFound(_0x4a353d,null))[_0xab7e('0x20')](function(_0x4d0c7a){_0xbec26d[_0xab7e('0xa5')]=_0x4d0c7a;var _0x10d586=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xa6')];if(_0x393b1d['headers']['cf-connecting-ip']){_0x10d586=_0x393b1d[_0xab7e('0x8d')]['cf-connecting-ip'];}else if(_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')]){_0x10d586=_[_0xab7e('0xa8')](_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xa7')][_0xab7e('0xa9')](','));}if(_0x4d0c7a){var _0x1a4ce3={'ContactId':_0x4d0c7a['id'],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'from':(_0x4d0c7a['firstName']||'')+'\x20'+(_0x4d0c7a['lastName']||''),'customerIp':_0x10d586,'customerPort':_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]?_0x393b1d[_0xab7e('0x8d')][_0xab7e('0xaa')]:null,'referer':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xab')],'browserName':_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')]&&_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]?util[_0xab7e('0xae')]('%s\x20%s',_0xa54467[_0xab7e('0xac')][_0xab7e('0x39')],_0xa54467['browser'][_0xab7e('0xad')]):'unknown','browserVersion':_0xa54467[_0xab7e('0xac')][_0xab7e('0xad')]||_0xab7e('0xaf'),'osName':util[_0xab7e('0xae')](_0xab7e('0xb0'),_0xa54467['os'][_0xab7e('0x39')],_0xa54467['os'][_0xab7e('0xad')]),'osVersion':_0xa54467['os']['version'],'deviceModel':_0xa54467[_0xab7e('0xb1')]['model']&&_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')]?util[_0xab7e('0xae')](_0xab7e('0xb3'),_0xa54467['device'][_0xab7e('0x43')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')]):null,'deviceVendor':_0xa54467[_0xab7e('0xb1')][_0xab7e('0xb2')],'deviceType':_0xa54467[_0xab7e('0xb1')][_0xab7e('0x41')],'formData':JSON['stringify'](_0x393b1d[_0xab7e('0x5f')])};var _0x791f67={'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'closed':![]};if(_0x393b1d['body'][_0xab7e('0xb4')]){_0x791f67[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb4')];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x5294b8){if(_0x5294b8){return[_0x5294b8,![]];}_0x1a4ce3[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')]['threadId'];_0x1a4ce3[_0xab7e('0xb6')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb6')];return db['ChatInteraction']['create'](_0x1a4ce3)[_0xab7e('0x20')](function(_0x2e7f3c){return[_0x2e7f3c,!![]];});});}_0x791f67[_0xab7e('0xb7')]=_0x4d0c7a['id'];if(_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]&&_0x393b1d[_0xab7e('0x5f')]['interaction']['id']){_0x791f67['id']=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xb8')]['id'];return db[_0xab7e('0xb5')][_0xab7e('0x5d')]({'where':_0x791f67})[_0xab7e('0x20')](function(_0x222f8a){if(_0x222f8a){return[_0x222f8a,![]];}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x195685){return[_0x195685,!![]];});});}return db[_0xab7e('0xb5')][_0xab7e('0x5e')](_0x1a4ce3)[_0xab7e('0x20')](function(_0x11c388){return[_0x11c388,!![]];});}})[_0xab7e('0xb9')](function(_0x5d7a03,_0x5f1ef5){if(_0x5d7a03){_0x2d7037=_0x5f1ef5;if(!_0x5f1ef5){var _0x84c1c9={'from':(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xba')]||'')+'\x20'+(_0xbec26d[_0xab7e('0xa5')][_0xab7e('0xbb')]||'')};if(_0x393b1d['body']['threadId']&&_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')]&&_0x393b1d['body'][_0xab7e('0xb4')]!=_0x393b1d['body']['messageId']){_0x84c1c9[_0xab7e('0xb4')]=_0x393b1d[_0xab7e('0x5f')][_0xab7e('0xbc')];}return _0x5d7a03[_0xab7e('0x65')](_0x84c1c9);}else{return _0x5d7a03;}}})[_0xab7e('0x20')](function(_0x25027f){_0xbec26d[_0xab7e('0xb8')]=_0x25027f['get']({'plain':!![]});_0xbec26d['interaction'][_0xab7e('0xbd')]=_0x2d7037;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xbd')]){if(_0xbec26d[_0xab7e('0xa1')][_0xab7e('0xbe')]){_0xbec26d['applications'][_0xab7e('0xbf')]({'id':0x0,'priority':_0xbec26d[_0xab7e('0xa2')][_0xab7e('0x4a')]+0x1,'app':_0xab7e('0xc0'),'appdata':'unmanaged','interval':_0xab7e('0xc1')});}}return db['ChatMessage'][_0xab7e('0x5e')]({'body':_0x393b1d[_0xab7e('0x5f')][_0xab7e('0x5f')],'ChatWebsiteId':_0x393b1d[_0xab7e('0x5c')]['id'],'ChatInteractionId':_0x25027f['id'],'direction':'in','ContactId':_0xbec26d[_0xab7e('0xa5')]['id'],'AttachmentId':_0x393b1d['body']['AttachmentId']});})[_0xab7e('0x20')](function(_0x54d9aa){_0xbec26d[_0xab7e('0x27')]=_0x54d9aa;if(_0xbec26d[_0xab7e('0xb8')][_0xab7e('0xc2')]){return db[_0xab7e('0xc3')]['find']({'attributes':['id','name'],'where':{'id':_0xbec26d['interaction'][_0xab7e('0xc2')]}})[_0xab7e('0x20')](function(_0xa30c24){if(_0xa30c24){_0xbec26d[_0xab7e('0xa2')][_0xab7e('0xc4')]({'id':0x0,'priority':0x0,'app':_0xab7e('0xc5'),'appdata':_0xa30c24[_0xab7e('0x39')]+','+(_0xbec26d[_0xab7e('0xa1')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0xbec26d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);});}return respondWithRpcPromise(_0xab7e('0xc6'),'startRouting',_0xbec26d);})[_0xab7e('0x20')](function(_0x2645a8){respondWithRpcPromise(_0xab7e('0xc7'),_0xab7e('0xc7'),{'event':'notify','message':_0x2645a8},client9002);return _0x2645a8;})['then'](respondWithResult(_0x4a353d,null))[_0xab7e('0x2a')](handleError(_0x4a353d,null));};exports[_0xab7e('0xc8')]=function(_0x598c63,_0x3e408d,_0xc1209e){var _0x1ad7b0,_0x39087d,_0x4bbe1e;var _0xe70b01=[];var _0x22ae01=[];var _0x3df878={};var _0x42ac81=_0x598c63[_0xab7e('0xc9')]||[];var _0x5911df=[];var _0x279351;return db['CmContact'][_0xab7e('0x66')]()[_0xab7e('0x20')](function(_0x4c1526){if(!_0x4c1526){throw new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))](_0xab7e('0x92'));}_0x22ae01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),[_0xab7e('0x94'),_0xab7e('0x95')]);_0xe70b01=_[_0xab7e('0x93')](_[_0xab7e('0x45')](_0x4c1526),['createdAt',_0xab7e('0x95'),_0xab7e('0x96'),_0xab7e('0x97')]);if(_0x598c63[_0xab7e('0x5f')]['id']){delete _0x598c63[_0xab7e('0x5f')]['id'];}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('from\x20is\x20mandatory'));}if(_[_0xab7e('0x80')](_0x598c63['body']['body'])||_0x598c63['body'][_0xab7e('0x5f')]===''){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)['send'](new db[(_0xab7e('0x91'))]['ValidationError'](_0xab7e('0x9a')));}if(_[_0xab7e('0x80')](_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db['Sequelize'][(_0xab7e('0x99'))](_0xab7e('0xcb')+_0xe70b01));}if(!_['includes'](_0xe70b01,_0x598c63['body'][_0xab7e('0xca')])){throw _0x3e408d[_0xab7e('0x2c')](0x1f4)[_0xab7e('0x3a')](new db[(_0xab7e('0x91'))][(_0xab7e('0x99'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe70b01));}_0x3df878[_0x598c63[_0xab7e('0x5f')][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')]['from'];})['then'](function(){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x598c63[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x9d')],'as':_0xab7e('0xa0')},{'model':db[_0xab7e('0xcc')],'as':_0xab7e('0xcc')}]});})[_0xab7e('0x20')](handleEntityNotFound(_0x3e408d,null))[_0xab7e('0x20')](function(_0x5c9b98){if(_0x5c9b98&&_0x5c9b98[_0xab7e('0xa0')]){_0x39087d=_0x5c9b98;var _0x59f1d5=_['defaults'](_0x598c63[_0xab7e('0x5f')],{'firstName':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'phone':_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')],'ListId':_0x5c9b98[_0xab7e('0x97')]});_0x59f1d5[_0x598c63['body'][_0xab7e('0xca')]]=_0x598c63[_0xab7e('0x5f')][_0xab7e('0x98')];return db['CmContact'][_0xab7e('0xcd')]({'where':_0x3df878,'defaults':_0x59f1d5});}})[_0xab7e('0xb9')](function(_0x5014c3){if(_0x5014c3){_0x4bbe1e=_0x5014c3;var _0x3a458b=fs[_0xab7e('0xce')](path[_0xab7e('0x82')](config[_0xab7e('0x7c')],'server/files/templates/chatOfflineMessage.ejs'),_0xab7e('0xcf'));var _0x1a34e4=ejs[_0xab7e('0xd0')](_0x3a458b,{'body':_[_0xab7e('0xd1')](_0x598c63['body'][_0xab7e('0x5f')]),'bodyTitle':_0x39087d[_0xab7e('0xd2')]});return db[_0xab7e('0xd3')][_0xab7e('0x5e')]({'body':_0x1a34e4,'ContactId':_0x5014c3['id'],'ChatWebsiteId':_0x39087d['id']});}})[_0xab7e('0x20')](function(_0x26ac22){_0x279351=_0x26ac22;if(_0x42ac81[_0xab7e('0x4a')]){var _0x1a2346=_0x42ac81[_0xab7e('0x3e')](function(_0x25b630){return{'name':_0x25b630[_0xab7e('0xd4')],'basename':_0x25b630[_0xab7e('0x74')],'type':_0x25b630[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x26ac22['id']};});_0x5911df=_0x1a2346[_0xab7e('0x3e')](_0x482503=>{var _0x16ccc1={'filename':_0x482503[_0xab7e('0x39')],'path':path[_0xab7e('0x82')](config['root'],_0xab7e('0xd6'),'files',_0xab7e('0xd7'),_0xab7e('0xd8'),_0x482503['basename'])};return _0x16ccc1;});if(!_0x39087d[_0xab7e('0xd9')]){return db['sequelize'][_0xab7e('0xda')](function(_0x1dd8da){return db[_0xab7e('0xdb')][_0xab7e('0xdc')](_0x1a2346,{'transaction':_0x1dd8da});});}}})[_0xab7e('0x20')](function(){if(_0x279351){_0x1ad7b0=_0x279351;return db[_0xab7e('0xcc')]['findOne']({'where':{'active':!![]},'include':[{'model':db[_0xab7e('0xdd')],'as':_0xab7e('0xde'),'raw':!![]}]});}})[_0xab7e('0x20')](function(_0x488142){if(_0x488142&&_0x488142['Smtp']&&_0x39087d[_0xab7e('0xdf')]&&_0x39087d[_0xab7e('0xe0')]){var _0x4523dd={'tls':{'rejectUnauthorized':![]}};if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe1')]){_0x4523dd['service']=_0x488142['Smtp']['service'];}else{_0x4523dd['host']=_0x488142[_0xab7e('0xde')][_0xab7e('0xe2')];_0x4523dd[_0xab7e('0xe3')]=_0x488142[_0xab7e('0xde')][_0xab7e('0xe3')];_0x4523dd[_0xab7e('0xe4')]=_0x488142['Smtp'][_0xab7e('0xe4')];}if(_0x488142[_0xab7e('0xde')][_0xab7e('0xe5')]){_0x4523dd[_0xab7e('0xe6')]={'user':_0x488142[_0xab7e('0xde')][_0xab7e('0x60')],'pass':_0x488142[_0xab7e('0xde')][_0xab7e('0xe7')]};}return respondWithRpcPromise(_0xab7e('0xe8'),_0xab7e('0xe9'),{'account':_0x4523dd,'message':{'from':util['format'](_0xab7e('0xea'),_0x488142[_0xab7e('0x39')],_0x488142[_0xab7e('0xeb')]||_0x488142[_0xab7e('0xde')][_0xab7e('0x60')]),'to':_0x39087d[_0xab7e('0xe0')],'subject':_0x39087d[_0xab7e('0xec')],'html':_0x1ad7b0['body'],'attachments':_0x5911df}},client9003)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x429dd3){console[_0xab7e('0x25')](_0x429dd3);});}})[_0xab7e('0x20')](function(){if(_0x39087d&&_0x39087d['openNewInteraction']&&_0x39087d[_0xab7e('0xed')]){var _0x3fe803=[];if(_0x42ac81[_0xab7e('0x4a')]){_0x3fe803=_0x42ac81[_0xab7e('0x3e')](function(_0x22c4bc){return{'name':_0x22c4bc[_0xab7e('0xd4')],'basename':_0x22c4bc[_0xab7e('0x74')],'type':_0x22c4bc[_0xab7e('0xd5')],'ChatOfflineMessageId':_0x279351['id']};});}var _0x7c85e8;if(!_[_0xab7e('0x80')](_0x39087d[_0xab7e('0xee')])){var _0x14e774=_[_0xab7e('0x3e')](_0x598c63['body'],function(_0x15f917){return _0x15f917;});var _0x19af67=_[_0xab7e('0xef')](_0x14e774)[0x0];var _0x17a2d1=_[_0xab7e('0xf0')](_0x19af67,function(_0x2fbe2e){return _0x2fbe2e;});_0x7c85e8=_0x17a2d1[0x1][_0x39087d[_0xab7e('0xee')]];}var _0xeba857={'from':_0x4bbe1e['email'],'firstName':_0x4bbe1e[_0xab7e('0xba')],'lastName':_0x4bbe1e['lastName'],'mapKey':_0xab7e('0xeb'),'message':{'from':_0x4bbe1e[_0xab7e('0xeb')],'to':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')],'cc':'','subject':_[_0xab7e('0x80')](_0x7c85e8)?_0x39087d[_0xab7e('0xec')]:_0x7c85e8,'messageId':'','sentAt':new Date(),'attach':_0x3fe803['length'],'attachments':_0x3fe803,'originChannel':'Chat','ChatWebsiteId':_0x39087d['id'],'ChatOfflineMessageId':_0x1ad7b0['id'],'originTo':_0x39087d[_0xab7e('0xcc')][_0xab7e('0xeb')]},'body':_0x1ad7b0[_0xab7e('0x5f')]};var _0x39b3bb={'account':{'id':_0x39087d[_0xab7e('0xed')]},'body':_0xeba857,'log':_0xab7e('0xf1')};return respondWithRpcPromise(_0xab7e('0xf1'),_0xab7e('0xf2'),_0x39b3bb,client9001)[_0xab7e('0x20')](function(){return _0x1ad7b0;})[_0xab7e('0x2a')](function(_0x2199f8){console[_0xab7e('0x25')](_0x2199f8);});}return;})[_0xab7e('0x20')](function(){if(_0x1ad7b0){return _0x1ad7b0;}})['then'](respondWithResult(_0x3e408d,null))[_0xab7e('0x2a')](function(_0x3e23c1){console[_0xab7e('0x25')]('catch',_0x3e23c1);for(var _0x269467 of _0x42ac81){var _0x2aa049=path[_0xab7e('0x82')](config['root'],'server',_0xab7e('0xc9'),_0xab7e('0xd7'),_0xab7e('0xd8'),_0x269467[_0xab7e('0x74')]);fs_extra[_0xab7e('0xf3')](_0x2aa049)[_0xab7e('0x2a')](function(_0x4b56fe){console[_0xab7e('0x25')](_0xab7e('0xf4'),_0x2aa049,_0x4b56fe);});}});};exports['addInteraction']=function(_0x468f81,_0x12ea06,_0xc02cdc){return db[_0xab7e('0xb5')]['find']({'where':{'id':_0x468f81['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x12ea06,null))['then'](function(_0xa7b65b){if(_0xa7b65b){return _0xa7b65b[_0xab7e('0xf5')](_0x468f81['body'][_0xab7e('0x70')],_['omit'](_0x468f81[_0xab7e('0x5f')],['ids','id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x12ea06,null))['catch'](handleError(_0x12ea06,null));};exports[_0xab7e('0xf6')]=function(_0x2d1e5d,_0xe8f8b2,_0xd3d5cc){var _0x4402ad={'raw':![],'where':{}};var _0x3f2877={};var _0x1f4c61={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x2d1e5d[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0xe8f8b2,null))[_0xab7e('0x20')](function(_0x3e5c21){if(_0x3e5c21){_0x3f2877[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatInteraction'][_0xab7e('0x3f')]);_0x3f2877[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x2d1e5d['query']);_0x3f2877['filters']=_['intersection'](_0x3f2877[_0xab7e('0x43')],_0x3f2877[_0xab7e('0x44')]);_0x4402ad[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x3f2877[_0xab7e('0x43')],qs['fields'](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x48')]));_0x4402ad[_0xab7e('0x49')]=_0x4402ad['attributes'][_0xab7e('0x4a')]?_0x4402ad[_0xab7e('0x49')]:_0x3f2877['model'];if(!_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4b')]('nolimit')){_0x4402ad['limit']=qs[_0xab7e('0x4d')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x4402ad[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x2f')]);}_0x4402ad['order']=qs[_0xab7e('0x4f')](_0x2d1e5d[_0xab7e('0x44')]['sort']);_0x4402ad[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x2d1e5d['query'],_0x3f2877[_0xab7e('0x46')]));_0x4402ad[_0xab7e('0x50')][_0xab7e('0x68')]=_0x3e5c21['id'];if(_0x2d1e5d['query'][_0xab7e('0x54')]){_0x4402ad[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x4402ad[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4402ad[_0xab7e('0x49')],function(_0x25f246){var _0x5cba7b={};_0x5cba7b[_0x25f246]={'$like':'%'+_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x5cba7b;})});}_0x4402ad=_[_0xab7e('0x52')]({},_0x4402ad,_0x2d1e5d['options']);return db[_0xab7e('0xb5')]['count']({'where':_0x4402ad[_0xab7e('0x50')]})[_0xab7e('0x20')](function(_0x236b95){_0x1f4c61[_0xab7e('0x31')]=_0x236b95;if(_0x2d1e5d['query'][_0xab7e('0x57')]){_0x4402ad[_0xab7e('0x58')]=[{'model':db[_0xab7e('0x90')],'as':'Contact','required':![]},{'model':db[_0xab7e('0xc3')],'as':'Owner','attributes':[_0xab7e('0x39'),_0xab7e('0xf7'),'internal'],'required':![]},{'model':db[_0xab7e('0xf8')],'as':_0xab7e('0xf9'),'attributes':['id',_0xab7e('0x39'),_0xab7e('0xfa')],'where':_0x2d1e5d[_0xab7e('0x44')]['tag']?{'id':_0x2d1e5d[_0xab7e('0x44')]['tag']}:undefined,'required':_0x2d1e5d[_0xab7e('0x44')][_0xab7e('0xfb')]?!![]:![]}];}return db[_0xab7e('0xb5')][_0xab7e('0x59')](_0x4402ad);})[_0xab7e('0x20')](function(_0x329c00){_0x1f4c61['rows']=_0x329c00;return _0x1f4c61;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0xe8f8b2,_0x4402ad))[_0xab7e('0x2a')](handleError(_0xe8f8b2,null));};function iftimePromise(_0x201a8c,_0x38b436){return respondWithRpcPromise(_0xab7e('0xfc'),_0xab7e('0xfd'),{'command':_0x38b436[_0xab7e('0xfe')]?util['format'](_0xab7e('0xff'),_0x201a8c[_0xab7e('0x100')],_0x38b436['timezone']):util[_0xab7e('0xae')](_0xab7e('0x101'),_0x201a8c[_0xab7e('0x100')])},client9002)[_0xab7e('0x20')](function(_0x201222){var _0x37a6a1=_0x201222&&_0x201222[_0xab7e('0x102')]('true')>=0x0?!![]:![];logger[_0xab7e('0x28')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],_0x37a6a1?_0xab7e('0x103'):_0xab7e('0x104'),_0x38b436['timezone']?_0x38b436[_0xab7e('0xfe')]:_0xab7e('0x105'));return _0x37a6a1;})[_0xab7e('0x2a')](function(_0x3ff952){logger[_0xab7e('0x25')](_0xab7e('0x106'),_0x38b436['id'],_0x201a8c['id'],_0x201a8c['interval'],util[_0xab7e('0x107')](_0x3ff952,{'showHidden':![],'depth':null}),_0x38b436[_0xab7e('0xfe')]?_0x38b436[_0xab7e('0xfe')]:'No\x20timezone');return![];});}exports[_0xab7e('0xfd')]=function(_0x38b44b,_0x20eacd,_0x47494b){var _0x417709=0x0;var _0x5a51ad=0x0;var _0x53a365=![];var _0x3cb9cb;var _0x5e4bd1;return db[_0xab7e('0x56')]['find']({'where':{'id':_0x38b44b[_0xab7e('0x5c')]['id']},'include':[{'model':db[_0xab7e('0x108')],'as':_0xab7e('0x108'),'include':[{'model':db['Interval'],'as':'Intervals','attributes':['id',_0xab7e('0x100')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x20eacd,null))[_0xab7e('0x20')](function(_0x1fa7c2){if(_0x1fa7c2){_0x3cb9cb=_0x1fa7c2;return _0x1fa7c2['getProactiveActions']({'raw':!![]});}})[_0xab7e('0x20')](function(_0x145178){if(_0x3cb9cb){if(_0x145178){_0x5e4bd1=_0x145178;}}return require(_0xab7e('0x15'))[_0xab7e('0x7e')]();})[_0xab7e('0x20')](function(_0x1ec21e){if(_0x1ec21e){_0x5a51ad=_0x1ec21e[_0xab7e('0x109')];_0x53a365=_0x1ec21e[_0xab7e('0x7f')];}})['then'](function(){return db[_0xab7e('0xb5')][_0xab7e('0x31')]({'where':{'closed':![]}});})[_0xab7e('0x20')](function(_0x1bfec0){_0x417709=_0x1bfec0;if(_0x5a51ad&&_0x1bfec0>_0x5a51ad){return db[_0xab7e('0x10a')][_0xab7e('0x6a')]({'where':{'id':0x1}})[_0xab7e('0x20')](function(_0x2c41c7){if(_0x2c41c7){_0x2c41c7[_0xab7e('0x10b')](_0xab7e('0x10c'));}});}})[_0xab7e('0x20')](function(){if(_0x3cb9cb['Interval']&&_0x3cb9cb['Interval'][_0xab7e('0x10d')]){var _0x15cd95=[];for(var _0x50fe9a=0x0;_0x50fe9a<_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0xab7e('0x4a')];_0x50fe9a++){var _0x2f26da=_0x3cb9cb[_0xab7e('0x108')][_0xab7e('0x10d')][_0x50fe9a][_0xab7e('0x34')]({'plain':!![]});_0x15cd95[_0xab7e('0xbf')](iftimePromise(_0x2f26da,_0x3cb9cb));}return BPromise[_0xab7e('0x10e')](_0x15cd95)['then'](function(_0x37d156){return _[_0xab7e('0x10f')](_0x37d156);});}else{return!![];}})[_0xab7e('0x20')](function(_0x235688){var _0x30a3bf=fs['readFileSync'](path['join'](config[_0xab7e('0x7c')],_0xab7e('0x110')),_0xab7e('0xcf'));var _0x540e2c={'remote':_0x3cb9cb[_0xab7e('0x111')],'query':querystring[_0xab7e('0x24')](_['merge'](_0x3cb9cb['get']({'plain':!![]}),{'customerIp':_0x38b44b[_0xab7e('0x8d')]['x-forwarded-for']||_0x38b44b[_0xab7e('0x8d')][_0xab7e('0x112')]||_0x38b44b[_0xab7e('0x113')][_0xab7e('0x114')]||_0x38b44b['ip'],'referer':_0x38b44b[_0xab7e('0x8d')][_0xab7e('0xab')],'openedInteractions':_0x417709,'maxInteractions':_0x5a51ad,'virtual':_0x53a365[_0xab7e('0x109')],'online':_0x235688,'custom':_0x53a365}))[_0xab7e('0x115')](/'/g,'\x5c\x27')};_0x20eacd[_0xab7e('0x3a')](ejs['render'](Mustache[_0xab7e('0xd0')](_0x30a3bf,_0x540e2c),{'proactiveActions':_0x5e4bd1,'alignment':_0x3cb9cb[_0xab7e('0x116')],'verticalAlignment':_0x3cb9cb['verticalAlignment'],'div_color':_0x3cb9cb[_0xab7e('0xfa')],'text_color':_0x3cb9cb[_0xab7e('0x117')],'button_color':_0x3cb9cb['color_button'],'background_color':_0x3cb9cb[_0xab7e('0x118')]}));})[_0xab7e('0x2a')](handleError(_0x20eacd,null));};exports[_0xab7e('0x119')]=function(_0x4240c1,_0x5f16e8,_0x51a01d){return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x4240c1[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x5f16e8,null))['then'](function(_0x71534d){if(_0x71534d){return db['sequelize'][_0xab7e('0xda')](function(_0x532006){return db[_0xab7e('0x9e')][_0xab7e('0x37')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'transaction':_0x532006})['then'](function(_0x45ea0a){var _0x5ae05f=_[_0xab7e('0x3e')](_0x4240c1[_0xab7e('0x5f')],function(_0x3c7eda){_0x3c7eda[_0xab7e('0x68')]=_0x4240c1[_0xab7e('0x5c')]['id'];return _0x3c7eda;});return db[_0xab7e('0x9e')]['bulkCreate'](_0x5ae05f,{'transaction':_0x532006});});})['then'](function(){return db['ChatApplication'][_0xab7e('0x11a')]({'where':{'ChatWebsiteId':_0x4240c1[_0xab7e('0x5c')]['id']},'order':_0xab7e('0x11b')});});}})[_0xab7e('0x20')](respondWithResult(_0x5f16e8,null))[_0xab7e('0x2a')](handleError(_0x5f16e8,null));};exports[_0xab7e('0x11c')]=function(_0x24d72e,_0x245169,_0x4fc3a1){var _0x187957={};var _0x2a3691={};var _0xcfb6a0;var _0x2c8e57;return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x24d72e[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x245169,null))[_0xab7e('0x20')](function(_0x41cf53){if(_0x41cf53){_0xcfb6a0=_0x41cf53;_0x2a3691[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatApplication'][_0xab7e('0x3f')]);_0x2a3691['query']=_[_0xab7e('0x45')](_0x24d72e[_0xab7e('0x44')]);_0x2a3691[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x2a3691[_0xab7e('0x43')],_0x2a3691[_0xab7e('0x44')]);_0x187957[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x2a3691['model'],qs[_0xab7e('0x48')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x48')]));_0x187957[_0xab7e('0x49')]=_0x187957[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x187957['attributes']:_0x2a3691[_0xab7e('0x43')];_0x187957[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x187957[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x24d72e[_0xab7e('0x44')],_0x2a3691['filters']));if(_0x24d72e[_0xab7e('0x44')][_0xab7e('0x54')]){_0x187957[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x187957[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x187957[_0xab7e('0x49')],function(_0x45fab6){var _0x23d8c7={};_0x23d8c7[_0x45fab6]={'$like':'%'+_0x24d72e['query'][_0xab7e('0x54')]+'%'};return _0x23d8c7;})});}_0x187957=_[_0xab7e('0x52')]({},_0x187957,_0x24d72e[_0xab7e('0x55')]);return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0x19d388){if(_0x19d388){_0x2c8e57=_0x19d388[_0xab7e('0x4a')];if(!_0x24d72e[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x187957[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x187957[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x24d72e[_0xab7e('0x44')][_0xab7e('0x2f')]);}return _0xcfb6a0[_0xab7e('0x11c')](_0x187957);}})[_0xab7e('0x20')](function(_0xcda0c2){if(_0xcda0c2){return _0xcda0c2?{'count':_0x2c8e57,'rows':_0xcda0c2}:null;}})[_0xab7e('0x20')](respondWithResult(_0x245169,null))[_0xab7e('0x2a')](handleError(_0x245169,null));};exports[_0xab7e('0x11d')]=function(_0x4923f6,_0x1789fe,_0x290b52){return db['chatProactiveAction']['find']({'where':{'id':_0x4923f6[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1789fe,null))[_0xab7e('0x20')](function(_0x2e5937){if(_0x2e5937){return _0x2e5937[_0xab7e('0x11d')](_0x4923f6['body'][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4923f6['body'],[_0xab7e('0x70'),'id'])||{});}})[_0xab7e('0x20')](respondWithResult(_0x1789fe,null))[_0xab7e('0x2a')](handleError(_0x1789fe,null));};exports[_0xab7e('0x11f')]=function(_0x59a5e4,_0x56b15e,_0x39242b){var _0x14e08b={};var _0x5b2b3a={};var _0x1a12bd;var _0x486986;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x59a5e4['params']['id']}})['then'](handleEntityNotFound(_0x56b15e,null))[_0xab7e('0x20')](function(_0x431b78){if(_0x431b78){_0x1a12bd=_0x431b78;_0x5b2b3a[_0xab7e('0x43')]=_[_0xab7e('0x45')](db['ChatProactiveAction'][_0xab7e('0x3f')]);_0x5b2b3a[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x59a5e4[_0xab7e('0x44')]);_0x5b2b3a[_0xab7e('0x46')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],_0x5b2b3a[_0xab7e('0x44')]);_0x14e08b[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x5b2b3a[_0xab7e('0x43')],qs['fields'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x48')]));_0x14e08b[_0xab7e('0x49')]=_0x14e08b[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x14e08b[_0xab7e('0x49')]:_0x5b2b3a['model'];_0x14e08b[_0xab7e('0x4e')]=qs['sort'](_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x14e08b[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x59a5e4[_0xab7e('0x44')],_0x5b2b3a[_0xab7e('0x46')]));if(_0x59a5e4['query'][_0xab7e('0x54')]){_0x14e08b[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x14e08b[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x14e08b[_0xab7e('0x49')],function(_0xe55f5b){var _0xaadb8e={};_0xaadb8e[_0xe55f5b]={'$like':'%'+_0x59a5e4[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0xaadb8e;})});}_0x14e08b=_[_0xab7e('0x52')]({},_0x14e08b,_0x59a5e4[_0xab7e('0x55')]);return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})['then'](function(_0x49b934){if(_0x49b934){_0x486986=_0x49b934[_0xab7e('0x4a')];if(!_0x59a5e4[_0xab7e('0x44')]['hasOwnProperty'](_0xab7e('0x4c'))){_0x14e08b[_0xab7e('0x4d')]=qs[_0xab7e('0x4d')](_0x59a5e4['query'][_0xab7e('0x4d')]);_0x14e08b[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x59a5e4['query'][_0xab7e('0x2f')]);}return _0x1a12bd[_0xab7e('0x11f')](_0x14e08b);}})[_0xab7e('0x20')](function(_0x33b986){if(_0x33b986){return _0x33b986?{'count':_0x486986,'rows':_0x33b986}:null;}})[_0xab7e('0x20')](respondWithResult(_0x56b15e,null))['catch'](handleError(_0x56b15e,null));};exports['getFields']=function(_0x51dd89,_0x4b514d,_0x57b5f8){var _0x41ec3a=_0x51dd89[_0xab7e('0x44')][_0xab7e('0x120')]===_0xab7e('0x121')?_0xab7e('0x122'):'onlineForm';return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'attributes':['id',_0x41ec3a],'where':{'id':_0x51dd89[_0xab7e('0x5c')]['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4b514d,null))[_0xab7e('0x20')](function(_0x343ce5){if(_0x343ce5){var _0x3ab911=_0x343ce5[_0x41ec3a];var _0x1d4b2f=_0x3ab911&&_0x3ab911['items']?_0x3ab911[_0xab7e('0x123')]:[];_0x4b514d[_0xab7e('0x3a')]({'fromKey':_[_0xab7e('0x80')](_0x3ab911[_0xab7e('0x124')])?undefined:_0x3ab911[_0xab7e('0x124')],'count':_0x1d4b2f[_0xab7e('0x4a')],'rows':_0x1d4b2f});}})[_0xab7e('0x2a')](handleError(_0x4b514d,null));};exports[_0xab7e('0x125')]=function(_0x300372,_0x261d33,_0x1644b7){var _0x3a7b9d={'raw':![],'where':{}};var _0x4f49cc={};var _0x4fdfcc={'count':0x0,'rows':[]};return db[_0xab7e('0x56')]['findOne']({'where':{'id':_0x300372[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x261d33,null))[_0xab7e('0x20')](function(_0x49d4e7){if(_0x49d4e7){_0x4f49cc[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xd3')]['rawAttributes']);_0x4f49cc[_0xab7e('0x44')]=_[_0xab7e('0x45')](_0x300372[_0xab7e('0x44')]);_0x4f49cc['filters']=_[_0xab7e('0x47')](_0x4f49cc[_0xab7e('0x43')],_0x4f49cc[_0xab7e('0x44')]);_0x3a7b9d[_0xab7e('0x49')]=_[_0xab7e('0x47')](_0x4f49cc['model'],qs[_0xab7e('0x48')](_0x300372[_0xab7e('0x44')][_0xab7e('0x48')]));_0x3a7b9d[_0xab7e('0x49')]=_0x3a7b9d[_0xab7e('0x49')][_0xab7e('0x4a')]?_0x3a7b9d[_0xab7e('0x49')]:_0x4f49cc[_0xab7e('0x43')];if(!_0x300372['query'][_0xab7e('0x4b')]('nolimit')){_0x3a7b9d[_0xab7e('0x4d')]=qs['limit'](_0x300372[_0xab7e('0x44')][_0xab7e('0x4d')]);_0x3a7b9d[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x300372[_0xab7e('0x44')]['offset']);}_0x3a7b9d[_0xab7e('0x4e')]=qs[_0xab7e('0x4f')](_0x300372[_0xab7e('0x44')]['sort']);_0x3a7b9d[_0xab7e('0x50')]=qs['filters'](_[_0xab7e('0x51')](_0x300372[_0xab7e('0x44')],_0x4f49cc[_0xab7e('0x46')]));_0x3a7b9d['where']['ChatWebsiteId']=_0x49d4e7['id'];if(_0x300372[_0xab7e('0x44')]['filter']){_0x3a7b9d[_0xab7e('0x50')]=_[_0xab7e('0x52')](_0x3a7b9d[_0xab7e('0x50')],{'$or':_['map'](_0x3a7b9d['attributes'],function(_0x53dcc3){var _0x71e39a={};_0x71e39a[_0x53dcc3]={'$like':'%'+_0x300372[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x71e39a;})});}_0x3a7b9d=_['merge']({},_0x3a7b9d,_0x300372[_0xab7e('0x55')]);return db[_0xab7e('0xd3')][_0xab7e('0x31')]({'where':_0x3a7b9d['where']})[_0xab7e('0x20')](function(_0x3fd9c7){_0x4fdfcc['count']=_0x3fd9c7;if(_0x300372['query'][_0xab7e('0x57')]){_0x3a7b9d[_0xab7e('0x58')]=[{'all':!![]}];}else{_0x3a7b9d['include']=[{'model':db[_0xab7e('0x90')],'as':_0xab7e('0x126'),'required':![]},{'model':db[_0xab7e('0xdb')],'as':'Attachments','required':![]}];}return db[_0xab7e('0xd3')]['findAll'](_0x3a7b9d);})[_0xab7e('0x20')](function(_0xa90a97){_0x4fdfcc[_0xab7e('0x5a')]=_0xa90a97;return _0x4fdfcc;});}})[_0xab7e('0x20')](respondWithFilteredResult(_0x261d33,_0x3a7b9d))[_0xab7e('0x2a')](handleError(_0x261d33,null));};exports[_0xab7e('0x127')]=function(_0x4fc0df,_0x27995c,_0x4e0e10){return db['ChatWebsite'][_0xab7e('0x5d')]({'where':{'id':_0x4fc0df[_0xab7e('0x5c')]['id']}})['then'](handleEntityNotFound(_0x27995c,null))[_0xab7e('0x20')](function(_0x5f10b0){if(_0x5f10b0){return _0x5f10b0[_0xab7e('0x127')](_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')],_[_0xab7e('0x11e')](_0x4fc0df['body'],['ids','id'])||{})[_0xab7e('0xb9')](function(_0xfc4710){for(var _0x661b99=0x0;_0x661b99<_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0xab7e('0x4a')];_0x661b99+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x129'),{'UserId':Number(_0x4fc0df[_0xab7e('0x5f')][_0xab7e('0x70')][_0x661b99]),'ChatWebsiteId':Number(_0x4fc0df['params']['id'])});}return _0xfc4710;});}})[_0xab7e('0x20')](respondWithResult(_0x27995c,null))[_0xab7e('0x2a')](handleError(_0x27995c,null));};exports['removeAgents']=function(_0x39f782,_0x54ef60,_0x30f4ae){return db[_0xab7e('0x56')][_0xab7e('0x5d')]({'where':{'id':_0x39f782['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x54ef60,null))[_0xab7e('0x20')](function(_0x378f37){if(_0x378f37){return _0x378f37[_0xab7e('0x12a')](_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')])[_0xab7e('0x20')](function(){if(_[_0xab7e('0x12b')](_0x39f782[_0xab7e('0x44')]['ids'])){for(var _0x170ac4=0x0;_0x170ac4<_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')]['length'];_0x170ac4+=0x1){socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782[_0xab7e('0x44')][_0xab7e('0x70')][_0x170ac4]),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}}else{socket[_0xab7e('0x128')](_0xab7e('0x12c'),{'UserId':Number(_0x39f782['query']['ids']),'ChatWebsiteId':Number(_0x39f782[_0xab7e('0x5c')]['id'])});}});}})['then'](respondWithStatusCode(_0x54ef60,null))[_0xab7e('0x2a')](handleError(_0x54ef60,null));};exports[_0xab7e('0x12d')]=function(_0x5c75c9,_0x4d7d6c,_0x4176d6){var _0x4de977={};var _0x1a9534={};var _0xf113a9;var _0x3a9c06;return db[_0xab7e('0x56')][_0xab7e('0x6a')]({'where':{'id':_0x5c75c9['params']['id']}})[_0xab7e('0x20')](handleEntityNotFound(_0x4d7d6c,null))[_0xab7e('0x20')](function(_0x40575a){if(_0x40575a){_0xf113a9=_0x40575a;_0x1a9534[_0xab7e('0x43')]=_[_0xab7e('0x45')](db[_0xab7e('0xc3')]['rawAttributes']);_0x1a9534['query']=_['keys'](_0x5c75c9[_0xab7e('0x44')]);_0x1a9534['filters']=_[_0xab7e('0x47')](_0x1a9534[_0xab7e('0x43')],_0x1a9534[_0xab7e('0x44')]);_0x4de977[_0xab7e('0x49')]=_['intersection'](_0x1a9534[_0xab7e('0x43')],qs[_0xab7e('0x48')](_0x5c75c9['query'][_0xab7e('0x48')]));_0x4de977[_0xab7e('0x49')]=_0x4de977[_0xab7e('0x49')]['length']?_0x4de977[_0xab7e('0x49')]:_0x1a9534[_0xab7e('0x43')];_0x4de977[_0xab7e('0x4e')]=qs['sort'](_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x4f')]);_0x4de977[_0xab7e('0x50')]=qs[_0xab7e('0x46')](_[_0xab7e('0x51')](_0x5c75c9[_0xab7e('0x44')],_0x1a9534[_0xab7e('0x46')]));if(_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]){_0x4de977['where']=_[_0xab7e('0x52')](_0x4de977[_0xab7e('0x50')],{'$or':_[_0xab7e('0x3e')](_0x4de977[_0xab7e('0x49')],function(_0xd2a692){var _0x10c4be={};_0x10c4be[_0xd2a692]={'$like':'%'+_0x5c75c9[_0xab7e('0x44')][_0xab7e('0x54')]+'%'};return _0x10c4be;})});}_0x4de977=_[_0xab7e('0x52')]({},_0x4de977,_0x5c75c9[_0xab7e('0x55')]);return _0xf113a9['getAgents'](_0x4de977);}})[_0xab7e('0x20')](function(_0x4e838a){if(_0x4e838a){_0x3a9c06=_0x4e838a[_0xab7e('0x4a')];if(!_0x5c75c9['query'][_0xab7e('0x4b')](_0xab7e('0x4c'))){_0x4de977['limit']=qs[_0xab7e('0x4d')](_0x5c75c9['query'][_0xab7e('0x4d')]);_0x4de977[_0xab7e('0x2f')]=qs[_0xab7e('0x2f')](_0x5c75c9[_0xab7e('0x44')]['offset']);}return _0xf113a9[_0xab7e('0x12d')](_0x4de977);}})[_0xab7e('0x20')](function(_0x19eaf7){if(_0x19eaf7){return _0x19eaf7?{'count':_0x3a9c06,'rows':_0x19eaf7}:null;}})['then'](respondWithResult(_0x4d7d6c,null))['catch'](handleError(_0x4d7d6c,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 649a4cf..08e08a3 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 _0xaa19=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0xaa19,0x79));var _0x9aa1=function(_0x32f98e,_0x5c1821){_0x32f98e=_0x32f98e-0x0;var _0x4944f3=_0xaa19[_0x32f98e];return _0x4944f3;};'use strict';var EventEmitter=require(_0x9aa1('0x0'));var ChatWebsite=require(_0x9aa1('0x1'))['db'][_0x9aa1('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x9aa1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x9aa1('0x4'),'afterDestroy':'remove'};function emitEvent(_0x15dd20){return function(_0x58fb46,_0x11fd1b,_0x36a679){ChatWebsiteEvents[_0x9aa1('0x5')](_0x15dd20+':'+_0x58fb46['id'],_0x58fb46);ChatWebsiteEvents['emit'](_0x15dd20,_0x58fb46);_0x36a679(null);};}for(var e in events){if(events[_0x9aa1('0x6')](e)){var event=events[e];ChatWebsite[_0x9aa1('0x7')](e,emitEvent(event));}}module[_0x9aa1('0x8')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0x3ee5=['save','update','remove','emit','hasOwnProperty','hook','../../mysqldb','ChatWebsite'];(function(_0x1a5631,_0x1af65a){var _0x4d0e02=function(_0x592e1f){while(--_0x592e1f){_0x1a5631['push'](_0x1a5631['shift']());}};_0x4d0e02(++_0x1af65a);}(_0x3ee5,0x1b6));var _0x53ee=function(_0x4fffcf,_0x49b324){_0x4fffcf=_0x4fffcf-0x0;var _0x544752=_0x3ee5[_0x4fffcf];return _0x544752;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x53ee('0x0'))['db'][_0x53ee('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x53ee('0x2'),'afterUpdate':_0x53ee('0x3'),'afterDestroy':_0x53ee('0x4')};function emitEvent(_0x24e272){return function(_0x25e597,_0x119975,_0x21c99a){ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272+':'+_0x25e597['id'],_0x25e597);ChatWebsiteEvents[_0x53ee('0x5')](_0x24e272,_0x25e597);_0x21c99a(null);};}for(var e in events){if(events[_0x53ee('0x6')](e)){var event=events[e];ChatWebsite[_0x53ee('0x7')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ea020cf..7463e6b 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 _0x7216=['request-promise','path','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4ac0f1,_0x4b4686){var _0x1dfc0d=function(_0xe86617){while(--_0xe86617){_0x4ac0f1['push'](_0x4ac0f1['shift']());}};_0x1dfc0d(++_0x4b4686);}(_0x7216,0x181));var _0x6721=function(_0x5847bc,_0x305090){_0x5847bc=_0x5847bc-0x0;var _0x2a1fb0=_0x7216[_0x5847bc];return _0x2a1fb0;};'use strict';var _=require(_0x6721('0x0'));var util=require('util');var logger=require(_0x6721('0x1'))(_0x6721('0x2'));var moment=require(_0x6721('0x3'));var BPromise=require(_0x6721('0x4'));var rp=require(_0x6721('0x5'));var fs=require('fs');var path=require(_0x6721('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6721('0x7'));module['exports']=function(_0x716f00,_0x57ca73){return _0x716f00['define'](_0x6721('0x8'),attributes,{'tableName':_0x6721('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9581=['request-promise','path','rimraf','../../config/environment','chat_websites','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2bc293,_0x2749be){var _0x2f83ed=function(_0x1d53d1){while(--_0x1d53d1){_0x2bc293['push'](_0x2bc293['shift']());}};_0x2f83ed(++_0x2749be);}(_0x9581,0x191));var _0x1958=function(_0x1beebe,_0x5594ae){_0x1beebe=_0x1beebe-0x0;var _0x2bd4c3=_0x9581[_0x1beebe];return _0x2bd4c3;};'use strict';var _=require(_0x1958('0x0'));var util=require(_0x1958('0x1'));var logger=require(_0x1958('0x2'))(_0x1958('0x3'));var moment=require(_0x1958('0x4'));var BPromise=require(_0x1958('0x5'));var rp=require(_0x1958('0x6'));var fs=require('fs');var path=require(_0x1958('0x7'));var rimraf=require(_0x1958('0x8'));var config=require(_0x1958('0x9'));var attributes=require('./chatWebsite.attributes');module['exports']=function(_0x9d2dab,_0x483514){return _0x9d2dab['define']('ChatWebsite',attributes,{'tableName':_0x1958('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 aff8f10..921bda5 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 _0x455a=['code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error'];(function(_0x5943d3,_0x41e5fe){var _0x2e8469=function(_0x5786e1){while(--_0x5786e1){_0x5943d3['push'](_0x5943d3['shift']());}};_0x2e8469(++_0x41e5fe);}(_0x455a,0x10a));var _0xa455=function(_0x336fa0,_0x4e8281){_0x336fa0=_0x336fa0-0x0;var _0x4d1399=_0x455a[_0x336fa0];return _0x4d1399;};'use strict';var _=require(_0xa455('0x0'));var util=require(_0xa455('0x1'));var moment=require(_0xa455('0x2'));var BPromise=require(_0xa455('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa455('0x4'));var db=require(_0xa455('0x5'))['db'];var utils=require(_0xa455('0x6'));var logger=require(_0xa455('0x7'))(_0xa455('0x8'));var config=require(_0xa455('0x9'));var jayson=require(_0xa455('0xa'));var client=jayson[_0xa455('0xb')][_0xa455('0xc')]({'port':0x232a});config[_0xa455('0xd')]=_['defaults'](config[_0xa455('0xd')],{'host':_0xa455('0xe'),'port':0x18eb});var socket=require(_0xa455('0xf'))(new Redis(config['redis']));require(_0xa455('0x10'))[_0xa455('0x11')](socket);function respondWithRpcPromise(_0x4fd20a,_0x428180,_0x1b0586){return new BPromise(function(_0x2805f6,_0x52ed0a){return client[_0xa455('0x12')](_0x4fd20a,_0x1b0586)['then'](function(_0x5b61d3){logger['info'](_0xa455('0x13'),_0x428180,_0xa455('0x14'));logger[_0xa455('0x15')](_0xa455('0x16'),_0x428180,'request\x20sent',JSON['stringify'](_0x5b61d3));if(_0x5b61d3[_0xa455('0x17')]){if(_0x5b61d3['error'][_0xa455('0x18')]===0x1f4){logger[_0xa455('0x17')](_0xa455('0x13'),_0x428180,_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);return _0x52ed0a(_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);}logger['error'](_0xa455('0x13'),_0x428180,_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);return _0x2805f6(_0x5b61d3[_0xa455('0x17')][_0xa455('0x19')]);}else{logger[_0xa455('0x1a')](_0xa455('0x13'),_0x428180,_0xa455('0x14'));_0x2805f6(_0x5b61d3[_0xa455('0x1b')][_0xa455('0x19')]);}})[_0xa455('0x1c')](function(_0x36b55c){logger[_0xa455('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x428180,_0x36b55c);_0x52ed0a(_0x36b55c);});});}
\ No newline at end of file
+var _0xb5c4=['rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x138adb,_0x193fee){var _0x1b27f2=function(_0x5e97a2){while(--_0x5e97a2){_0x138adb['push'](_0x138adb['shift']());}};_0x1b27f2(++_0x193fee);}(_0xb5c4,0xc8));var _0x4b5c=function(_0x12b4d4,_0x2134e9){_0x12b4d4=_0x12b4d4-0x0;var _0x32604e=_0xb5c4[_0x12b4d4];return _0x32604e;};'use strict';var _=require('lodash');var util=require(_0x4b5c('0x0'));var moment=require(_0x4b5c('0x1'));var BPromise=require(_0x4b5c('0x2'));var rs=require(_0x4b5c('0x3'));var fs=require('fs');var Redis=require(_0x4b5c('0x4'));var db=require(_0x4b5c('0x5'))['db'];var utils=require(_0x4b5c('0x6'));var logger=require(_0x4b5c('0x7'))(_0x4b5c('0x8'));var config=require(_0x4b5c('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x4b5c('0xa')][_0x4b5c('0xb')]({'port':0x232a});config[_0x4b5c('0xc')]=_[_0x4b5c('0xd')](config[_0x4b5c('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b5c('0xe'))(new Redis(config[_0x4b5c('0xc')]));require(_0x4b5c('0xf'))[_0x4b5c('0x10')](socket);function respondWithRpcPromise(_0x558f41,_0x2b2aec,_0x441b52){return new BPromise(function(_0x3203e6,_0x2b75b8){return client[_0x4b5c('0x11')](_0x558f41,_0x441b52)['then'](function(_0x10aaa8){logger[_0x4b5c('0x12')](_0x4b5c('0x13'),_0x2b2aec,_0x4b5c('0x14'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'),JSON[_0x4b5c('0x15')](_0x10aaa8));if(_0x10aaa8[_0x4b5c('0x16')]){if(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x17')]===0x1f4){logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')]['message']);return _0x2b75b8(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}logger[_0x4b5c('0x16')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);return _0x3203e6(_0x10aaa8[_0x4b5c('0x16')][_0x4b5c('0x18')]);}else{logger[_0x4b5c('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x2b2aec,_0x4b5c('0x14'));_0x3203e6(_0x10aaa8[_0x4b5c('0x19')]['message']);}})['catch'](function(_0x50b356){logger[_0x4b5c('0x16')](_0x4b5c('0x13'),_0x2b2aec,_0x50b356);_0x2b75b8(_0x50b356);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index ffbc654..8b29f5a 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 _0xc8a3=['removeListener','length','./chatWebsite.events','save','remove','emit'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xc8a3,0x140));var _0x3c8a=function(_0x10da33,_0xcbf5db){_0x10da33=_0x10da33-0x0;var _0x17275f=_0xc8a3[_0x10da33];return _0x17275f;};'use strict';var ChatWebsiteEvents=require(_0x3c8a('0x0'));var events=[_0x3c8a('0x1'),_0x3c8a('0x2'),'update'];function createListener(_0x222feb,_0x2ea092){return function(_0x17fef8){_0x2ea092[_0x3c8a('0x3')](_0x222feb,_0x17fef8);};}function removeListener(_0x4c46bc,_0x46fe80){return function(){ChatWebsiteEvents[_0x3c8a('0x4')](_0x4c46bc,_0x46fe80);};}exports['register']=function(_0x5a4fcf){for(var _0x15f6ac=0x0,_0x38c735=events[_0x3c8a('0x5')];_0x15f6ac<_0x38c735;_0x15f6ac++){var _0x4f3590=events[_0x15f6ac];var _0x4c7b40=createListener('chatWebsite:'+_0x4f3590,_0x5a4fcf);ChatWebsiteEvents['on'](_0x4f3590,_0x4c7b40);}};
\ No newline at end of file
+var _0x455a=['removeListener','length','chatWebsite:','./chatWebsite.events','save','remove','update'];(function(_0x577722,_0xcaa9af){var _0x409f2d=function(_0x47f53c){while(--_0x47f53c){_0x577722['push'](_0x577722['shift']());}};_0x409f2d(++_0xcaa9af);}(_0x455a,0x10d));var _0xa455=function(_0x502eb0,_0x6d0814){_0x502eb0=_0x502eb0-0x0;var _0x4f78e4=_0x455a[_0x502eb0];return _0x4f78e4;};'use strict';var ChatWebsiteEvents=require(_0xa455('0x0'));var events=[_0xa455('0x1'),_0xa455('0x2'),_0xa455('0x3')];function createListener(_0xc10cfe,_0x27b956){return function(_0x1d00cf){_0x27b956['emit'](_0xc10cfe,_0x1d00cf);};}function removeListener(_0x1886b7,_0x559ff1){return function(){ChatWebsiteEvents[_0xa455('0x4')](_0x1886b7,_0x559ff1);};}exports['register']=function(_0x1bdd5f){for(var _0x36fa2b=0x0,_0x43a266=events[_0xa455('0x5')];_0x36fa2b<_0x43a266;_0x36fa2b++){var _0x2f368b=events[_0x36fa2b];var _0xb69dab=createListener(_0xa455('0x6')+_0x2f368b,_0x1bdd5f);ChatWebsiteEvents['on'](_0x2f368b,_0xb69dab);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index b528352..b886a8a 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 _0x721d=['addCustomerAvatar','/:id/notify','notify','server/files','attachments','ensureDir','replace','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','addAgents','put','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','/describe','describe','/:id','show','/:id/dispositions','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/snippet','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/users','getAgents','post','create','addDisposition','addAnswer','diskStorage','join','root','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar'];(function(_0x10ec04,_0x45ca9d){var _0x46eca4=function(_0x307ba1){while(--_0x307ba1){_0x10ec04['push'](_0x10ec04['shift']());}};_0x46eca4(++_0x45ca9d);}(_0x721d,0xf5));var _0xd721=function(_0x4940a0,_0x3f9be1){_0x4940a0=_0x4940a0-0x0;var _0x556f14=_0x721d[_0x4940a0];return _0x556f14;};'use strict';var multer=require(_0xd721('0x0'));var util=require(_0xd721('0x1'));var path=require(_0xd721('0x2'));var timeout=require(_0xd721('0x3'));var express=require(_0xd721('0x4'));var router=express[_0xd721('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xd721('0x6'));var interaction=require(_0xd721('0x7'));var config=require('../../config/environment');var controller=require(_0xd721('0x8'));router[_0xd721('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xd721('0x9')](_0xd721('0xa'),auth['isAuthenticated'](),controller[_0xd721('0xb')]);router[_0xd721('0x9')](_0xd721('0xc'),auth['isAuthenticated'](),controller[_0xd721('0xd')]);router[_0xd721('0x9')](_0xd721('0xe'),auth[_0xd721('0xf')](),controller[_0xd721('0x10')]);router[_0xd721('0x9')](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x12')]);router[_0xd721('0x9')](_0xd721('0x13'),controller[_0xd721('0x14')]);router[_0xd721('0x9')](_0xd721('0x15'),controller[_0xd721('0x16')]);router['get'](_0xd721('0x17'),controller['getCustomerAvatar']);router[_0xd721('0x9')](_0xd721('0x18'),controller[_0xd721('0x19')]);router[_0xd721('0x9')]('/:id/interactions',auth[_0xd721('0xf')](),controller['getInteractions']);router[_0xd721('0x9')](_0xd721('0x1a'),controller[_0xd721('0x1b')]);router[_0xd721('0x9')](_0xd721('0x1c'),auth[_0xd721('0xf')](),controller[_0xd721('0x1d')]);router[_0xd721('0x9')]('/:id/proactive_actions',auth[_0xd721('0xf')](),controller[_0xd721('0x1e')]);router[_0xd721('0x9')](_0xd721('0x1f'),controller[_0xd721('0x20')]);router[_0xd721('0x9')]('/:id/offline_messages',auth[_0xd721('0xf')](),controller['getOfflineMessages']);router['get'](_0xd721('0x21'),auth[_0xd721('0xf')](),controller[_0xd721('0x22')]);router[_0xd721('0x23')]('/',auth[_0xd721('0xf')](),controller[_0xd721('0x24')]);router[_0xd721('0x23')]('/:id/dispositions',auth[_0xd721('0xf')](),controller[_0xd721('0x25')]);router[_0xd721('0x23')](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x26')]);var upload=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x4ed9d6,_0x16269d,_0x271f93){_0x271f93(null,path[_0xd721('0x28')](config[_0xd721('0x29')],'server/files/images/logos/'));},'filename':function(_0xe0f0d4,_0x80f96d,_0x4a478e){_0x4a478e(null,util[_0xd721('0x2a')](_0xd721('0x2b'),Date[_0xd721('0x2c')](),_0x80f96d[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x13'),upload[_0xd721('0x2e')](_0xd721('0x2f')),controller[_0xd721('0x30')]);var upload=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x5a2064,_0x47a72d,_0x1938cf){_0x1938cf(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x46fd59,_0xb706de,_0x27a605){_0x27a605(null,util['format'](_0xd721('0x2b'),Date[_0xd721('0x2c')](),_0xb706de[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x15'),upload[_0xd721('0x2e')]('file'),controller[_0xd721('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb0f3,_0x418432,_0x5aaa11){_0x5aaa11(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x9322a,_0x141c89,_0x34bbfc){_0x34bbfc(null,util[_0xd721('0x2a')](_0xd721('0x2b'),Date['now'](),_0x141c89[_0xd721('0x2d')]));}})});router[_0xd721('0x23')](_0xd721('0x17'),upload[_0xd721('0x2e')](_0xd721('0x2f')),controller[_0xd721('0x33')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x38ad8d,_0x5849fc,_0x505de1){_0x505de1(null,path[_0xd721('0x28')](config[_0xd721('0x29')],_0xd721('0x31')));},'filename':function(_0x52bf06,_0x242063,_0x617d4f){_0x617d4f(null,util['format']('%s-%s',Date[_0xd721('0x2c')](),_0x242063['originalname']));}})});router[_0xd721('0x23')](_0xd721('0x18'),upload['single'](_0xd721('0x2f')),controller['addSystemAvatar']);router[_0xd721('0x23')](_0xd721('0x34'),controller[_0xd721('0x35')]);const offlineUploadMulter=multer({'storage':multer[_0xd721('0x27')]({'destination':function(_0x41f2e0,_0x22e3c1,_0x5ee9c8){const _0x9d7704=path[_0xd721('0x28')](config['root'],_0xd721('0x36'),_0xd721('0x37'),'offline-chat');fs_extra[_0xd721('0x38')](_0x9d7704,function(){_0x5ee9c8(null,_0x9d7704);});},'filename':function(_0x27becd,_0x2f5954,_0x3527b5){const _0x470ce5=_0x2f5954[_0xd721('0x2d')][_0xd721('0x39')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2acd74=path[_0xd721('0x3a')](_0x470ce5);const _0x17574e=Date['now']()+'-'+_0x470ce5['replace'](_0x2acd74,'')+_0x2acd74;_0x3527b5(null,_0x17574e);}})});router[_0xd721('0x23')](_0xd721('0x3b'),offlineUploadMulter[_0xd721('0x3c')](),controller[_0xd721('0x3d')]);router[_0xd721('0x23')](_0xd721('0x3e'),auth[_0xd721('0xf')](),controller[_0xd721('0x3f')]);router[_0xd721('0x23')](_0xd721('0x1c'),auth['isAuthenticated'](),controller[_0xd721('0x40')]);router[_0xd721('0x23')]('/:id/proactive_actions',auth[_0xd721('0xf')](),controller[_0xd721('0x41')]);router[_0xd721('0x23')]('/:id/users',auth['isAuthenticated'](),controller[_0xd721('0x42')]);router[_0xd721('0x43')](_0xd721('0xc'),auth[_0xd721('0xf')](),controller['update']);router[_0xd721('0x44')](_0xd721('0xc'),auth[_0xd721('0xf')](),controller[_0xd721('0x45')]);router[_0xd721('0x44')](_0xd721('0xe'),auth[_0xd721('0xf')](),controller[_0xd721('0x46')]);router['delete'](_0xd721('0x11'),auth[_0xd721('0xf')](),controller[_0xd721('0x47')]);router[_0xd721('0x44')](_0xd721('0x21'),auth[_0xd721('0xf')](),controller[_0xd721('0x48')]);module[_0xd721('0x49')]=router;
\ No newline at end of file
+var _0x5be5=['post','create','addAnswer','join','root','server/files/images/logos/','format','%s-%s','single','addLogo','diskStorage','server/files/images/avatars/','now','file','addAvatar','addCustomerAvatar','originalname','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','/:id/offline','offline','addApplications','addProactiveActions','update','delete','destroy','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','index','/describe','isAuthenticated','describe','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents'];(function(_0x5eb447,_0xd7e005){var _0x1758f2=function(_0x2215d4){while(--_0x2215d4){_0x5eb447['push'](_0x5eb447['shift']());}};_0x1758f2(++_0xd7e005);}(_0x5be5,0xb0));var _0x55be=function(_0x39106d,_0x4d5fef){_0x39106d=_0x39106d-0x0;var _0x42d497=_0x5be5[_0x39106d];return _0x42d497;};'use strict';var multer=require(_0x55be('0x0'));var util=require(_0x55be('0x1'));var path=require(_0x55be('0x2'));var timeout=require(_0x55be('0x3'));var express=require(_0x55be('0x4'));var router=express[_0x55be('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x55be('0x6'));var interaction=require(_0x55be('0x7'));var config=require(_0x55be('0x8'));var controller=require(_0x55be('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0x55be('0xa')]);router['get'](_0x55be('0xb'),auth[_0x55be('0xc')](),controller[_0x55be('0xd')]);router[_0x55be('0xe')](_0x55be('0xf'),auth['isAuthenticated'](),controller[_0x55be('0x10')]);router['get'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller[_0x55be('0x12')]);router[_0x55be('0xe')](_0x55be('0x13'),auth[_0x55be('0xc')](),controller[_0x55be('0x14')]);router[_0x55be('0xe')](_0x55be('0x15'),controller[_0x55be('0x16')]);router[_0x55be('0xe')](_0x55be('0x17'),controller[_0x55be('0x18')]);router[_0x55be('0xe')](_0x55be('0x19'),controller['getCustomerAvatar']);router[_0x55be('0xe')](_0x55be('0x1a'),controller['getSystemAvatar']);router['get'](_0x55be('0x1b'),auth[_0x55be('0xc')](),controller[_0x55be('0x1c')]);router[_0x55be('0xe')](_0x55be('0x1d'),controller[_0x55be('0x1e')]);router['get'](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x20')]);router[_0x55be('0xe')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x22')]);router[_0x55be('0xe')](_0x55be('0x23'),controller[_0x55be('0x24')]);router['get'](_0x55be('0x25'),auth[_0x55be('0xc')](),controller['getOfflineMessages']);router[_0x55be('0xe')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller[_0x55be('0x27')]);router[_0x55be('0x28')]('/',auth['isAuthenticated'](),controller[_0x55be('0x29')]);router[_0x55be('0x28')](_0x55be('0x11'),auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x82646f,_0xb0968b,_0x16d901){_0x16d901(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x2d')));},'filename':function(_0x35ebf8,_0x2d3292,_0x407e36){_0x407e36(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date['now'](),_0x2d3292['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x15'),upload[_0x55be('0x30')]('file'),controller[_0x55be('0x31')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x12f185,_0x4b8abd,_0x4131fa){_0x4131fa(null,path[_0x55be('0x2b')](config['root'],_0x55be('0x33')));},'filename':function(_0xe6b580,_0x1c99b3,_0x2c75bd){_0x2c75bd(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x1c99b3['originalname']));}})});router[_0x55be('0x28')](_0x55be('0x17'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x36')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x177c91,_0x1ce893,_0x254ade){_0x254ade(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x33')));},'filename':function(_0x360e3c,_0x2acf89,_0x37d290){_0x37d290(null,util['format'](_0x55be('0x2f'),Date['now'](),_0x2acf89['originalname']));}})});router[_0x55be('0x28')]('/:id/customer_avatar',upload['single']('file'),controller[_0x55be('0x37')]);var upload=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x25de52,_0x428f33,_0x569d07){_0x569d07(null,path[_0x55be('0x2b')](config[_0x55be('0x2c')],'server/files/images/avatars/'));},'filename':function(_0x179cc3,_0x20a455,_0x49a9f4){_0x49a9f4(null,util[_0x55be('0x2e')](_0x55be('0x2f'),Date[_0x55be('0x34')](),_0x20a455[_0x55be('0x38')]));}})});router[_0x55be('0x28')](_0x55be('0x1a'),upload[_0x55be('0x30')](_0x55be('0x35')),controller[_0x55be('0x39')]);router[_0x55be('0x28')]('/:id/notify',controller[_0x55be('0x3a')]);const offlineUploadMulter=multer({'storage':multer[_0x55be('0x32')]({'destination':function(_0x3114bc,_0x22f36f,_0x50112a){const _0x4852d0=path[_0x55be('0x2b')](config[_0x55be('0x2c')],_0x55be('0x3b'),'attachments',_0x55be('0x3c'));fs_extra[_0x55be('0x3d')](_0x4852d0,function(){_0x50112a(null,_0x4852d0);});},'filename':function(_0x273aaa,_0x300ea9,_0x40bdf1){const _0x415343=_0x300ea9[_0x55be('0x38')][_0x55be('0x3e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x1fcbf7=path['extname'](_0x415343);const _0x4fe431=Date[_0x55be('0x34')]()+'-'+_0x415343[_0x55be('0x3e')](_0x1fcbf7,'')+_0x1fcbf7;_0x40bdf1(null,_0x4fe431);}})});router[_0x55be('0x28')](_0x55be('0x3f'),offlineUploadMulter['any'](),controller[_0x55be('0x40')]);router['post'](_0x55be('0x1b'),auth['isAuthenticated'](),controller['addInteraction']);router[_0x55be('0x28')](_0x55be('0x1f'),auth[_0x55be('0xc')](),controller[_0x55be('0x41')]);router[_0x55be('0x28')](_0x55be('0x21'),auth['isAuthenticated'](),controller[_0x55be('0x42')]);router[_0x55be('0x28')](_0x55be('0x26'),auth[_0x55be('0xc')](),controller['addAgents']);router['put'](_0x55be('0xf'),auth[_0x55be('0xc')](),controller[_0x55be('0x43')]);router[_0x55be('0x44')]('/:id',auth[_0x55be('0xc')](),controller[_0x55be('0x45')]);router['delete'](_0x55be('0x11'),auth[_0x55be('0xc')](),controller['removeDispositions']);router[_0x55be('0x44')](_0x55be('0x13'),auth['isAuthenticated'](),controller[_0x55be('0x46')]);router[_0x55be('0x44')]('/:id/users',auth[_0x55be('0xc')](),controller['removeAgents']);module[_0x55be('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 7cb4347..25246dc 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 _0xd1f9=['STRING','ENUM','AmazonAWS','Google'];(function(_0x590001,_0x3505fe){var _0x291888=function(_0x10ffd){while(--_0x10ffd){_0x590001['push'](_0x590001['shift']());}};_0x291888(++_0x3505fe);}(_0xd1f9,0x88));var _0x9d1f=function(_0x20c6f1,_0x21fa65){_0x20c6f1=_0x20c6f1-0x0;var _0x43c3bf=_0xd1f9[_0x20c6f1];return _0x43c3bf;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x9d1f('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x9d1f('0x1')](_0x9d1f('0x2'),_0x9d1f('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize[_0x9d1f('0x0')]},'data2':{'type':Sequelize[_0x9d1f('0x0')]}};
\ No newline at end of file
+var _0x496e=['exports','STRING','ENUM','AmazonAWS'];(function(_0x4e783c,_0x51a362){var _0x2fbd6d=function(_0x513e00){while(--_0x513e00){_0x4e783c['push'](_0x4e783c['shift']());}};_0x2fbd6d(++_0x51a362);}(_0x496e,0x1a0));var _0xe496=function(_0x91e3a4,_0x3af814){_0x91e3a4=_0x91e3a4-0x0;var _0x383bd5=_0x496e[_0x91e3a4];return _0x383bd5;};'use strict';var Sequelize=require('sequelize');module[_0xe496('0x0')]={'name':{'type':Sequelize[_0xe496('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe496('0x2')](_0xe496('0x3'),'Google'),'allowNull':![],'validate':{'notEmpty':!![]}},'data1':{'type':Sequelize['STRING']},'data2':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 54f0d8e..f0b2aeb 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 _0xdb28=['error','stack','name','send','index','CloudProvider','fieldName','type','key','map','query','keys','model','fields','attributes','length','nolimit','order','sort','filters','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','rawAttributes','intersection','include','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','set','apply','save','update','then','sendStatus'];(function(_0x5a4d4c,_0x4e74b5){var _0x476ce4=function(_0x10aa22){while(--_0x10aa22){_0x5a4d4c['push'](_0x5a4d4c['shift']());}};_0x476ce4(++_0x4e74b5);}(_0xdb28,0x106));var _0x8db2=function(_0x1f0ceb,_0x41ca3f){_0x1f0ceb=_0x1f0ceb-0x0;var _0x20696d=_0xdb28[_0x1f0ceb];return _0x20696d;};'use strict';var emlformat=require(_0x8db2('0x0'));var rimraf=require(_0x8db2('0x1'));var zipdir=require(_0x8db2('0x2'));var jsonpatch=require(_0x8db2('0x3'));var rp=require('request-promise');var moment=require(_0x8db2('0x4'));var BPromise=require(_0x8db2('0x5'));var Mustache=require(_0x8db2('0x6'));var util=require(_0x8db2('0x7'));var path=require(_0x8db2('0x8'));var sox=require('sox');var csv=require(_0x8db2('0x9'));var ejs=require(_0x8db2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0x9'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var licenseUtil=require(_0x8db2('0x17'));var db=require(_0x8db2('0x18'))['db'];function respondWithStatusCode(_0x204f49,_0x37d017){_0x37d017=_0x37d017||0xcc;return function(_0x559fb1){if(_0x559fb1){return _0x204f49['sendStatus'](_0x37d017);}return _0x204f49[_0x8db2('0x19')](_0x37d017)[_0x8db2('0x1a')]();};}function respondWithResult(_0x350d61,_0x1d6a15){_0x1d6a15=_0x1d6a15||0xc8;return function(_0x227355){if(_0x227355){return _0x350d61[_0x8db2('0x19')](_0x1d6a15)[_0x8db2('0x1b')](_0x227355);}};}function respondWithFilteredResult(_0x3c96a7,_0x131252){return function(_0x16c8c2){if(_0x16c8c2){var _0x5489a9=typeof _0x131252[_0x8db2('0x1c')]===_0x8db2('0x1d')&&typeof _0x131252['limit']===_0x8db2('0x1d');var _0x44957d=_0x16c8c2[_0x8db2('0x1e')];var _0x3fddc2=_0x5489a9?0x0:_0x131252[_0x8db2('0x1c')];var _0x46ce14=_0x5489a9?_0x16c8c2['count']:_0x131252['offset']+_0x131252[_0x8db2('0x1f')];var _0x104e33;if(_0x46ce14>=_0x44957d){_0x46ce14=_0x44957d;_0x104e33=0xc8;}else{_0x104e33=0xce;}_0x3c96a7[_0x8db2('0x19')](_0x104e33);return _0x3c96a7[_0x8db2('0x20')]('Content-Range',_0x3fddc2+'-'+_0x46ce14+'/'+_0x44957d)[_0x8db2('0x1b')](_0x16c8c2);}return null;};}function patchUpdates(_0x36a9ff){return function(_0x260940){try{jsonpatch[_0x8db2('0x21')](_0x260940,_0x36a9ff,!![]);}catch(_0x3dbe8e){return BPromise['reject'](_0x3dbe8e);}return _0x260940[_0x8db2('0x22')]();};}function saveUpdates(_0x3e30e6,_0x18f69c){return function(_0x125be2){if(_0x125be2){return _0x125be2[_0x8db2('0x23')](_0x3e30e6)[_0x8db2('0x24')](function(_0x796ec1){return _0x796ec1;});}return null;};}function removeEntity(_0x5c6614,_0x256202){return function(_0x4f6516){if(_0x4f6516){return _0x4f6516['destroy']()['then'](function(){_0x5c6614['status'](0xcc)[_0x8db2('0x1a')]();});}};}function handleEntityNotFound(_0x29b5cd,_0x3be281){return function(_0x2baed0){if(!_0x2baed0){_0x29b5cd[_0x8db2('0x25')](0x194);}return _0x2baed0;};}function handleError(_0x8d4f54,_0x58cd9d){_0x58cd9d=_0x58cd9d||0x1f4;return function(_0x3544ba){logger[_0x8db2('0x26')](_0x3544ba[_0x8db2('0x27')]);if(_0x3544ba[_0x8db2('0x28')]){delete _0x3544ba['name'];}_0x8d4f54[_0x8db2('0x19')](_0x58cd9d)[_0x8db2('0x29')](_0x3544ba);};}exports[_0x8db2('0x2a')]=function(_0x1687ed,_0xbe5ece){var _0x21bae5={},_0xa54ea3={},_0x3124d5={'count':0x0,'rows':[]};var _0xbc5366=_['map'](db[_0x8db2('0x2b')]['rawAttributes'],function(_0x59cb77){return{'name':_0x59cb77[_0x8db2('0x2c')],'type':_0x59cb77[_0x8db2('0x2d')][_0x8db2('0x2e')]};});_0xa54ea3['model']=_[_0x8db2('0x2f')](_0xbc5366,'name');_0xa54ea3[_0x8db2('0x30')]=_[_0x8db2('0x31')](_0x1687ed[_0x8db2('0x30')]);_0xa54ea3['filters']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],_0xa54ea3[_0x8db2('0x30')]);_0x21bae5['attributes']=_['intersection'](_0xa54ea3[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x33')]));_0x21bae5[_0x8db2('0x34')]=_0x21bae5[_0x8db2('0x34')][_0x8db2('0x35')]?_0x21bae5[_0x8db2('0x34')]:_0xa54ea3[_0x8db2('0x32')];if(!_0x1687ed[_0x8db2('0x30')]['hasOwnProperty'](_0x8db2('0x36'))){_0x21bae5[_0x8db2('0x1f')]=qs['limit'](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x1f')]);_0x21bae5['offset']=qs['offset'](_0x1687ed[_0x8db2('0x30')]['offset']);}_0x21bae5[_0x8db2('0x37')]=qs[_0x8db2('0x38')](_0x1687ed[_0x8db2('0x30')][_0x8db2('0x38')]);_0x21bae5['where']=qs[_0x8db2('0x39')](_['pick'](_0x1687ed[_0x8db2('0x30')],_0xa54ea3[_0x8db2('0x39')]),_0xbc5366);if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]){_0x21bae5['where']=_['merge'](_0x21bae5[_0x8db2('0x3b')],{'$or':_[_0x8db2('0x2f')](_0xbc5366,function(_0x5dc2b4){if(_0x5dc2b4[_0x8db2('0x2d')]!==_0x8db2('0x3c')){var _0x656dd2={};_0x656dd2[_0x5dc2b4['name']]={'$like':'%'+_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3a')]+'%'};return _0x656dd2;}})});}_0x21bae5=_[_0x8db2('0x3d')]({},_0x21bae5,_0x1687ed[_0x8db2('0x3e')]);var _0x2e6f0c={'where':_0x21bae5[_0x8db2('0x3b')]};return db[_0x8db2('0x2b')][_0x8db2('0x1e')](_0x2e6f0c)[_0x8db2('0x24')](function(_0x63c561){_0x3124d5[_0x8db2('0x1e')]=_0x63c561;if(_0x1687ed[_0x8db2('0x30')][_0x8db2('0x3f')]){_0x21bae5['include']=[{'all':!![]}];}return db[_0x8db2('0x2b')][_0x8db2('0x40')](_0x21bae5);})['then'](function(_0x49a7ae){_0x3124d5[_0x8db2('0x41')]=_0x49a7ae;return _0x3124d5;})['then'](respondWithFilteredResult(_0xbe5ece,_0x21bae5))[_0x8db2('0x42')](handleError(_0xbe5ece,null));};exports[_0x8db2('0x43')]=function(_0x313130,_0x307783){var _0xb4fe2c={'raw':!![],'where':{'id':_0x313130[_0x8db2('0x44')]['id']}},_0x30d606={};_0x30d606['model']=_[_0x8db2('0x31')](db[_0x8db2('0x2b')][_0x8db2('0x45')]);_0x30d606[_0x8db2('0x30')]=_['keys'](_0x313130[_0x8db2('0x30')]);_0x30d606[_0x8db2('0x39')]=_[_0x8db2('0x46')](_0x30d606[_0x8db2('0x32')],_0x30d606['query']);_0xb4fe2c[_0x8db2('0x34')]=_['intersection'](_0x30d606[_0x8db2('0x32')],qs[_0x8db2('0x33')](_0x313130[_0x8db2('0x30')]['fields']));_0xb4fe2c['attributes']=_0xb4fe2c[_0x8db2('0x34')]['length']?_0xb4fe2c[_0x8db2('0x34')]:_0x30d606[_0x8db2('0x32')];if(_0x313130[_0x8db2('0x30')][_0x8db2('0x3f')]){_0xb4fe2c[_0x8db2('0x47')]=[{'all':!![]}];}_0xb4fe2c=_[_0x8db2('0x3d')]({},_0xb4fe2c,_0x313130[_0x8db2('0x3e')]);return db[_0x8db2('0x2b')][_0x8db2('0x48')](_0xb4fe2c)[_0x8db2('0x24')](handleEntityNotFound(_0x307783,null))[_0x8db2('0x24')](respondWithResult(_0x307783,null))[_0x8db2('0x42')](handleError(_0x307783,null));};exports['create']=function(_0x449109,_0x2ada52){return db[_0x8db2('0x2b')][_0x8db2('0x49')](_0x449109['body'],{})['then'](respondWithResult(_0x2ada52,0xc9))[_0x8db2('0x42')](handleError(_0x2ada52,null));};exports[_0x8db2('0x23')]=function(_0x164020,_0x4c66e5){if(_0x164020['body']['id']){delete _0x164020['body']['id'];}return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x164020[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x4c66e5,null))[_0x8db2('0x24')](saveUpdates(_0x164020[_0x8db2('0x4a')],null))[_0x8db2('0x24')](respondWithResult(_0x4c66e5,null))['catch'](handleError(_0x4c66e5,null));};exports['destroy']=function(_0x3d29bc,_0x18c6ef){return db[_0x8db2('0x2b')][_0x8db2('0x48')]({'where':{'id':_0x3d29bc[_0x8db2('0x44')]['id']}})[_0x8db2('0x24')](handleEntityNotFound(_0x18c6ef,null))[_0x8db2('0x24')](removeEntity(_0x18c6ef,null))[_0x8db2('0x42')](handleError(_0x18c6ef,null));};
\ No newline at end of file
+var _0x7a54=['offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','CloudProvider','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','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'];(function(_0x51c56c,_0x42c126){var _0x927019=function(_0x241547){while(--_0x241547){_0x51c56c['push'](_0x51c56c['shift']());}};_0x927019(++_0x42c126);}(_0x7a54,0x106));var _0x47a5=function(_0x183d92,_0x3699d7){_0x183d92=_0x183d92-0x0;var _0x4a59d2=_0x7a54[_0x183d92];return _0x4a59d2;};'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['CloudProvider'][_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['CloudProvider']['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['CloudProvider']['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('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 1a48c6f..04a0483 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 _0x0e50=['path','../../config/environment','./cloudProvider.attributes','exports','define','CloudProvider','cloud_providers','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x3bd139,_0x52a505){var _0xa9342a=function(_0xb2a913){while(--_0xb2a913){_0x3bd139['push'](_0x3bd139['shift']());}};_0xa9342a(++_0x52a505);}(_0x0e50,0x187));var _0x00e5=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0x0e50[_0x1928c9];return _0x51b5fb;};'use strict';var _=require(_0x00e5('0x0'));var util=require('util');var logger=require(_0x00e5('0x1'))(_0x00e5('0x2'));var moment=require('moment');var BPromise=require(_0x00e5('0x3'));var rp=require(_0x00e5('0x4'));var fs=require('fs');var path=require(_0x00e5('0x5'));var rimraf=require('rimraf');var config=require(_0x00e5('0x6'));var attributes=require(_0x00e5('0x7'));module[_0x00e5('0x8')]=function(_0x33df4f,_0x4c0967){return _0x33df4f[_0x00e5('0x9')](_0x00e5('0xa'),attributes,{'tableName':_0x00e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3210=['exports','define','CloudProvider','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x36cb61,_0x48ede7){var _0x22bb48=function(_0xed2888){while(--_0xed2888){_0x36cb61['push'](_0x36cb61['shift']());}};_0x22bb48(++_0x48ede7);}(_0x3210,0x142));var _0x0321=function(_0x202dbd,_0x515964){_0x202dbd=_0x202dbd-0x0;var _0x3edb3f=_0x3210[_0x202dbd];return _0x3edb3f;};'use strict';var _=require(_0x0321('0x0'));var util=require(_0x0321('0x1'));var logger=require('../../config/logger')(_0x0321('0x2'));var moment=require(_0x0321('0x3'));var BPromise=require(_0x0321('0x4'));var rp=require(_0x0321('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0321('0x6'));var config=require(_0x0321('0x7'));var attributes=require('./cloudProvider.attributes');module[_0x0321('0x8')]=function(_0x147df0,_0x186f9a){return _0x147df0[_0x0321('0x9')](_0x0321('0xa'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 28a593f..97549ad 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 _0xacc6=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','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'];(function(_0xcf0479,_0x537ff7){var _0x1e350e=function(_0x1ba284){while(--_0x1ba284){_0xcf0479['push'](_0xcf0479['shift']());}};_0x1e350e(++_0x537ff7);}(_0xacc6,0x150));var _0x6acc=function(_0x358806,_0x322b66){_0x358806=_0x358806-0x0;var _0x19fdcb=_0xacc6[_0x358806];return _0x19fdcb;};'use strict';var _=require(_0x6acc('0x0'));var util=require(_0x6acc('0x1'));var moment=require(_0x6acc('0x2'));var BPromise=require(_0x6acc('0x3'));var rs=require(_0x6acc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6acc('0x5'))['db'];var utils=require(_0x6acc('0x6'));var logger=require(_0x6acc('0x7'))('rpc');var config=require(_0x6acc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x6acc('0x9')][_0x6acc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5e7f3a,_0x41edfd,_0x48b1a8){return new BPromise(function(_0x1f95e8,_0x538730){return client[_0x6acc('0xb')](_0x5e7f3a,_0x48b1a8)[_0x6acc('0xc')](function(_0x4d6b7f){logger[_0x6acc('0xd')]('CloudProvider,\x20%s,\x20%s',_0x41edfd,_0x6acc('0xe'));logger[_0x6acc('0xf')](_0x6acc('0x10'),_0x41edfd,_0x6acc('0xe'),JSON[_0x6acc('0x11')](_0x4d6b7f));if(_0x4d6b7f[_0x6acc('0x12')]){if(_0x4d6b7f['error'][_0x6acc('0x13')]===0x1f4){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x538730(_0x4d6b7f['error']['message']);}logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);return _0x1f95e8(_0x4d6b7f[_0x6acc('0x12')][_0x6acc('0x15')]);}else{logger[_0x6acc('0xd')](_0x6acc('0x14'),_0x41edfd,_0x6acc('0xe'));_0x1f95e8(_0x4d6b7f[_0x6acc('0x16')][_0x6acc('0x15')]);}})[_0x6acc('0x17')](function(_0x31c4c2){logger[_0x6acc('0x12')](_0x6acc('0x14'),_0x41edfd,_0x31c4c2);_0x538730(_0x31c4c2);});});}
\ No newline at end of file
+var _0x2b47=['result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x18483c,_0x33b067){var _0x4e0cf0=function(_0x418001){while(--_0x418001){_0x18483c['push'](_0x18483c['shift']());}};_0x4e0cf0(++_0x33b067);}(_0x2b47,0x177));var _0x72b4=function(_0x2f5ca2,_0x10f3e4){_0x2f5ca2=_0x2f5ca2-0x0;var _0x3c4041=_0x2b47[_0x2f5ca2];return _0x3c4041;};'use strict';var _=require(_0x72b4('0x0'));var util=require('util');var moment=require(_0x72b4('0x1'));var BPromise=require(_0x72b4('0x2'));var rs=require(_0x72b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x72b4('0x4'))['db'];var utils=require(_0x72b4('0x5'));var logger=require(_0x72b4('0x6'))(_0x72b4('0x7'));var config=require(_0x72b4('0x8'));var jayson=require(_0x72b4('0x9'));var client=jayson['client'][_0x72b4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x480984,_0x104f08,_0x1c90aa){return new BPromise(function(_0xb1e42f,_0x1bdf7f){return client[_0x72b4('0xb')](_0x480984,_0x1c90aa)[_0x72b4('0xc')](function(_0x114a98){logger[_0x72b4('0xd')](_0x72b4('0xe'),_0x104f08,_0x72b4('0xf'));logger[_0x72b4('0x10')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x104f08,_0x72b4('0xf'),JSON[_0x72b4('0x11')](_0x114a98));if(_0x114a98[_0x72b4('0x12')]){if(_0x114a98[_0x72b4('0x12')][_0x72b4('0x13')]===0x1f4){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0x1bdf7f(_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);}logger['error'](_0x72b4('0xe'),_0x104f08,_0x114a98[_0x72b4('0x12')][_0x72b4('0x14')]);return _0xb1e42f(_0x114a98[_0x72b4('0x12')]['message']);}else{logger['info'](_0x72b4('0xe'),_0x104f08,'request\x20sent');_0xb1e42f(_0x114a98[_0x72b4('0x15')][_0x72b4('0x14')]);}})['catch'](function(_0x2a9c37){logger[_0x72b4('0x12')](_0x72b4('0xe'),_0x104f08,_0x2a9c37);_0x1bdf7f(_0x2a9c37);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 0ed66c5..2455913 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 _0x83a7=['/:id','update','destroy','multer','util','express','Router','fs-extra','../../config/environment','./cloudProvider.controller','get','index','isAuthenticated','post','put'];(function(_0x377609,_0x50c4ef){var _0x16978b=function(_0x5cd0b1){while(--_0x5cd0b1){_0x377609['push'](_0x377609['shift']());}};_0x16978b(++_0x50c4ef);}(_0x83a7,0x1f2));var _0x783a=function(_0x14edcd,_0x3dd904){_0x14edcd=_0x14edcd-0x0;var _0x2d3e00=_0x83a7[_0x14edcd];return _0x2d3e00;};'use strict';var multer=require(_0x783a('0x0'));var util=require(_0x783a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x783a('0x2'));var router=express[_0x783a('0x3')]();var fs_extra=require(_0x783a('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x783a('0x5'));var controller=require(_0x783a('0x6'));router[_0x783a('0x7')]('/',auth['isAuthenticated'](),controller[_0x783a('0x8')]);router[_0x783a('0x7')]('/:id',auth[_0x783a('0x9')](),controller['show']);router[_0x783a('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x783a('0xb')](_0x783a('0xc'),auth['isAuthenticated'](),controller[_0x783a('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x783a('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x6348=['show','post','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cloudProvider.controller','isAuthenticated','get','/:id'];(function(_0x9aada2,_0xd2d349){var _0x196dff=function(_0x5ad061){while(--_0x5ad061){_0x9aada2['push'](_0x9aada2['shift']());}};_0x196dff(++_0xd2d349);}(_0x6348,0x1f3));var _0x8634=function(_0x24f5ad,_0x31ef05){_0x24f5ad=_0x24f5ad-0x0;var _0x455039=_0x6348[_0x24f5ad];return _0x455039;};'use strict';var multer=require('multer');var util=require(_0x8634('0x0'));var path=require(_0x8634('0x1'));var timeout=require(_0x8634('0x2'));var express=require('express');var router=express[_0x8634('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x8634('0x4'));var interaction=require(_0x8634('0x5'));var config=require(_0x8634('0x6'));var controller=require(_0x8634('0x7'));router['get']('/',auth[_0x8634('0x8')](),controller['index']);router[_0x8634('0x9')](_0x8634('0xa'),auth['isAuthenticated'](),controller[_0x8634('0xb')]);router[_0x8634('0xc')]('/',auth[_0x8634('0x8')](),controller['create']);router['put'](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['update']);router[_0x8634('0xd')](_0x8634('0xa'),auth[_0x8634('0x8')](),controller['destroy']);module[_0x8634('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 972074f..747351a 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 _0xdd92=['sequelize','exports','STRING','name'];(function(_0x57f74a,_0x3f8b13){var _0x15b677=function(_0x332610){while(--_0x332610){_0x57f74a['push'](_0x57f74a['shift']());}};_0x15b677(++_0x3f8b13);}(_0xdd92,0x188));var _0x2dd9=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0xdd92[_0x5f1391];return _0x50ebe3;};'use strict';var Sequelize=require(_0x2dd9('0x0'));module[_0x2dd9('0x1')]={'name':{'type':Sequelize[_0x2dd9('0x2')],'unique':_0x2dd9('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x2dd9('0x2')]},'website':{'type':Sequelize[_0x2dd9('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x2dd9('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2dd9('0x2')]},'postalCode':{'type':Sequelize[_0x2dd9('0x2')]},'city':{'type':Sequelize[_0x2dd9('0x2')]},'country':{'type':Sequelize[_0x2dd9('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2dd9('0x2')]},'sStreet':{'type':Sequelize[_0x2dd9('0x2')]},'sPostalCode':{'type':Sequelize[_0x2dd9('0x2')]},'sCity':{'type':Sequelize[_0x2dd9('0x2')]},'sCountry':{'type':Sequelize[_0x2dd9('0x2')]},'description':{'type':Sequelize[_0x2dd9('0x2')]}};
\ No newline at end of file
+var _0x494a=['sequelize','exports','STRING','name'];(function(_0x24f862,_0x4b645a){var _0x198aa4=function(_0x131195){while(--_0x131195){_0x24f862['push'](_0x24f862['shift']());}};_0x198aa4(++_0x4b645a);}(_0x494a,0x17c));var _0xa494=function(_0x19587b,_0x324fad){_0x19587b=_0x19587b-0x0;var _0x3aebb3=_0x494a[_0x19587b];return _0x3aebb3;};'use strict';var Sequelize=require(_0xa494('0x0'));module[_0xa494('0x1')]={'name':{'type':Sequelize[_0xa494('0x2')],'unique':_0xa494('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa494('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0xa494('0x2')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa494('0x2')]},'street':{'type':Sequelize[_0xa494('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xa494('0x2')]},'country':{'type':Sequelize[_0xa494('0x2')]},'email':{'type':Sequelize[_0xa494('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa494('0x2')]},'sStreet':{'type':Sequelize[_0xa494('0x2')]},'sPostalCode':{'type':Sequelize[_0xa494('0x2')]},'sCity':{'type':Sequelize[_0xa494('0x2')]},'sCountry':{'type':Sequelize[_0xa494('0x2')]},'description':{'type':Sequelize[_0xa494('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 6d798ca..da7607e 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 _0x37eb=['rows','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','addContacts','CmContact','ids','getContacts','findOne','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','update','get','UserProfileResource','then','error','stack','name','send','CmCompany','describe','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','where','merge','map','filter','options','includeAll','include','findAll'];(function(_0x1196cd,_0x33c691){var _0x4afd49=function(_0x5a76cb){while(--_0x5a76cb){_0x1196cd['push'](_0x1196cd['shift']());}};_0x4afd49(++_0x33c691);}(_0x37eb,0xc2));var _0xb37e=function(_0x55f5c0,_0x64d09e){_0x55f5c0=_0x55f5c0-0x0;var _0x1ed6fe=_0x37eb[_0x55f5c0];return _0x1ed6fe;};'use strict';var emlformat=require(_0xb37e('0x0'));var rimraf=require(_0xb37e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb37e('0x2'));var rp=require(_0xb37e('0x3'));var moment=require(_0xb37e('0x4'));var BPromise=require(_0xb37e('0x5'));var Mustache=require(_0xb37e('0x6'));var util=require(_0xb37e('0x7'));var path=require(_0xb37e('0x8'));var sox=require(_0xb37e('0x9'));var csv=require(_0xb37e('0xa'));var ejs=require(_0xb37e('0xb'));var fs=require('fs');var fs_extra=require(_0xb37e('0xc'));var _=require(_0xb37e('0xd'));var squel=require(_0xb37e('0xe'));var crypto=require(_0xb37e('0xf'));var jsforce=require(_0xb37e('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xb37e('0xa'));var querystring=require('querystring');var Papa=require(_0xb37e('0x11'));var Redis=require(_0xb37e('0x12'));var authService=require(_0xb37e('0x13'));var qs=require(_0xb37e('0x14'));var as=require(_0xb37e('0x15'));var hardwareService=require(_0xb37e('0x16'));var logger=require(_0xb37e('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xb37e('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xb37e('0x19'))['db'];function respondWithStatusCode(_0x25dedd,_0x112de9){_0x112de9=_0x112de9||0xcc;return function(_0x473e23){if(_0x473e23){return _0x25dedd[_0xb37e('0x1a')](_0x112de9);}return _0x25dedd[_0xb37e('0x1b')](_0x112de9)[_0xb37e('0x1c')]();};}function respondWithResult(_0x6d6889,_0x19a064){_0x19a064=_0x19a064||0xc8;return function(_0x16e0f9){if(_0x16e0f9){return _0x6d6889[_0xb37e('0x1b')](_0x19a064)[_0xb37e('0x1d')](_0x16e0f9);}};}function respondWithFilteredResult(_0x4d48ad,_0x3811fe){return function(_0x3a2804){if(_0x3a2804){var _0x574ceb=typeof _0x3811fe[_0xb37e('0x1e')]==='undefined'&&typeof _0x3811fe[_0xb37e('0x1f')]==='undefined';var _0x39f50a=_0x3a2804[_0xb37e('0x20')];var _0x5e8bbb=_0x574ceb?0x0:_0x3811fe[_0xb37e('0x1e')];var _0x15d708=_0x574ceb?_0x3a2804['count']:_0x3811fe['offset']+_0x3811fe[_0xb37e('0x1f')];var _0x14a294;if(_0x15d708>=_0x39f50a){_0x15d708=_0x39f50a;_0x14a294=0xc8;}else{_0x14a294=0xce;}_0x4d48ad[_0xb37e('0x1b')](_0x14a294);return _0x4d48ad['set'](_0xb37e('0x21'),_0x5e8bbb+'-'+_0x15d708+'/'+_0x39f50a)[_0xb37e('0x1d')](_0x3a2804);}return null;};}function patchUpdates(_0x5af3ed){return function(_0x5137f7){try{jsonpatch[_0xb37e('0x22')](_0x5137f7,_0x5af3ed,!![]);}catch(_0x352af7){return BPromise[_0xb37e('0x23')](_0x352af7);}return _0x5137f7['save']();};}function saveUpdates(_0x4eee7d,_0x12c3ea){return function(_0x4fa59c){if(_0x4fa59c){return _0x4fa59c[_0xb37e('0x24')](_0x4eee7d)['then'](function(_0x5ef0cd){return _0x5ef0cd;});}return null;};}function removeEntity(_0x5cdc0e,_0x3567ef){return function(_0x5589dc){if(_0x5589dc){return _0x5589dc['destroy']()['then'](function(){var _0x39e5df=_0x5589dc[_0xb37e('0x25')]({'plain':!![]});var _0x9894f7='Companies';return db[_0xb37e('0x26')]['destroy']({'where':{'type':_0x9894f7,'resourceId':_0x39e5df['id']}})[_0xb37e('0x27')](function(){return _0x5589dc;});})['then'](function(){_0x5cdc0e[_0xb37e('0x1b')](0xcc)[_0xb37e('0x1c')]();});}};}function handleEntityNotFound(_0x149831,_0xf6fce2){return function(_0x46dae0){if(!_0x46dae0){_0x149831['sendStatus'](0x194);}return _0x46dae0;};}function handleError(_0x14486f,_0x3a55b1){_0x3a55b1=_0x3a55b1||0x1f4;return function(_0x20c122){logger[_0xb37e('0x28')](_0x20c122[_0xb37e('0x29')]);if(_0x20c122[_0xb37e('0x2a')]){delete _0x20c122['name'];}_0x14486f[_0xb37e('0x1b')](_0x3a55b1)[_0xb37e('0x2b')](_0x20c122);};}exports['index']=function(_0x487f14,_0x4606ae){var _0x374d26={},_0x5d8e4c={},_0x5e8467={'count':0x0,'rows':[]};return db[_0xb37e('0x2c')][_0xb37e('0x2d')]()[_0xb37e('0x27')](function(_0x164fd6){_0x5d8e4c[_0xb37e('0x2e')]=_[_0xb37e('0x2f')](_0x164fd6);_0x5d8e4c['query']=_[_0xb37e('0x2f')](_0x487f14[_0xb37e('0x30')]);_0x5d8e4c['filters']=_[_0xb37e('0x31')](_0x5d8e4c[_0xb37e('0x2e')],_0x5d8e4c['query']);_0x374d26[_0xb37e('0x32')]=_[_0xb37e('0x31')](_0x5d8e4c[_0xb37e('0x2e')],qs[_0xb37e('0x33')](_0x487f14['query'][_0xb37e('0x33')]));_0x374d26[_0xb37e('0x32')]=_0x374d26['attributes'][_0xb37e('0x34')]?_0x374d26[_0xb37e('0x32')]:_0x5d8e4c[_0xb37e('0x2e')];if(!_0x487f14[_0xb37e('0x30')][_0xb37e('0x35')](_0xb37e('0x36'))){_0x374d26[_0xb37e('0x1f')]=qs[_0xb37e('0x1f')](_0x487f14['query'][_0xb37e('0x1f')]);_0x374d26['offset']=qs[_0xb37e('0x1e')](_0x487f14[_0xb37e('0x30')]['offset']);}_0x374d26[_0xb37e('0x37')]=qs[_0xb37e('0x38')](_0x487f14[_0xb37e('0x30')]['sort']);_0x374d26['where']=qs[_0xb37e('0x39')](_[_0xb37e('0x3a')](_0x487f14[_0xb37e('0x30')],_0x5d8e4c[_0xb37e('0x39')]),_0x164fd6);if(_0x487f14['query']['filter']){_0x374d26[_0xb37e('0x3b')]=_[_0xb37e('0x3c')](_0x374d26[_0xb37e('0x3b')],{'$or':_[_0xb37e('0x3d')](_0x374d26[_0xb37e('0x32')],function(_0x30476c){var _0x7893c7={};_0x7893c7[_0x30476c]={'$like':'%'+_0x487f14['query'][_0xb37e('0x3e')]+'%'};return _0x7893c7;})});}_0x374d26=_[_0xb37e('0x3c')]({},_0x374d26,_0x487f14[_0xb37e('0x3f')]);var _0x4507c6={'where':_0x374d26[_0xb37e('0x3b')]};return db[_0xb37e('0x2c')][_0xb37e('0x20')](_0x4507c6)['then'](function(_0x5e35bf){_0x5e8467[_0xb37e('0x20')]=_0x5e35bf;if(_0x487f14[_0xb37e('0x30')][_0xb37e('0x40')]){_0x374d26[_0xb37e('0x41')]=[{'all':!![]}];}return db[_0xb37e('0x2c')][_0xb37e('0x42')](_0x374d26);})[_0xb37e('0x27')](function(_0x21fd45){_0x5e8467[_0xb37e('0x43')]=_0x21fd45;return _0x5e8467;})[_0xb37e('0x27')](respondWithFilteredResult(_0x4606ae,_0x374d26))[_0xb37e('0x44')](handleError(_0x4606ae,null));})[_0xb37e('0x44')](handleError(_0x4606ae,null));};exports[_0xb37e('0x45')]=function(_0x20a7fa,_0xbc3c34){var _0x14160f={'raw':![],'where':{'id':_0x20a7fa[_0xb37e('0x46')]['id']}},_0xcf59a0={};_0xcf59a0[_0xb37e('0x2e')]=_[_0xb37e('0x2f')](db[_0xb37e('0x2c')]['rawAttributes']);_0xcf59a0[_0xb37e('0x30')]=_[_0xb37e('0x2f')](_0x20a7fa['query']);_0xcf59a0['filters']=_[_0xb37e('0x31')](_0xcf59a0['model'],_0xcf59a0['query']);_0x14160f[_0xb37e('0x32')]=_[_0xb37e('0x31')](_0xcf59a0['model'],qs[_0xb37e('0x33')](_0x20a7fa[_0xb37e('0x30')][_0xb37e('0x33')]));_0x14160f[_0xb37e('0x32')]=_0x14160f[_0xb37e('0x32')][_0xb37e('0x34')]?_0x14160f[_0xb37e('0x32')]:_0xcf59a0[_0xb37e('0x2e')];if(_0x20a7fa[_0xb37e('0x30')]['includeAll']){_0x14160f[_0xb37e('0x41')]=[{'all':!![]}];}_0x14160f=_[_0xb37e('0x3c')]({},_0x14160f,_0x20a7fa[_0xb37e('0x3f')]);return db[_0xb37e('0x2c')][_0xb37e('0x47')](_0x14160f)[_0xb37e('0x27')](handleEntityNotFound(_0xbc3c34,null))[_0xb37e('0x27')](respondWithResult(_0xbc3c34,null))[_0xb37e('0x44')](handleError(_0xbc3c34,null));};exports[_0xb37e('0x48')]=function(_0x273d35,_0x23228d){return db['CmCompany'][_0xb37e('0x48')](_0x273d35[_0xb37e('0x49')],{})[_0xb37e('0x27')](function(_0x9b3180){var _0x5150d3=_0x273d35[_0xb37e('0x4a')][_0xb37e('0x25')]({'plain':!![]});if(!_0x5150d3)throw new Error(_0xb37e('0x4b'));if(_0x5150d3[_0xb37e('0x4c')]==='user'){var _0x207c5f=_0x9b3180[_0xb37e('0x25')]({'plain':!![]});var _0x31a7d3='Companies';return db[_0xb37e('0x4d')]['find']({'where':{'name':_0x31a7d3,'userProfileId':_0x5150d3[_0xb37e('0x4e')]},'raw':!![]})['then'](function(_0x2af684){if(_0x2af684&&_0x2af684[_0xb37e('0x4f')]===0x0){return db[_0xb37e('0x26')][_0xb37e('0x48')]({'name':_0x207c5f[_0xb37e('0x2a')],'resourceId':_0x207c5f['id'],'type':_0x2af684[_0xb37e('0x2a')],'sectionId':_0x2af684['id']},{})[_0xb37e('0x27')](function(){return _0x9b3180;});}else{return _0x9b3180;}})[_0xb37e('0x44')](function(_0xef0c95){logger[_0xb37e('0x28')](_0xb37e('0x50'),_0xef0c95);throw _0xef0c95;});}return _0x9b3180;})[_0xb37e('0x27')](respondWithResult(_0x23228d,0xc9))[_0xb37e('0x44')](handleError(_0x23228d,null));};exports[_0xb37e('0x24')]=function(_0xa1a230,_0x3987ee){if(_0xa1a230[_0xb37e('0x49')]['id']){delete _0xa1a230[_0xb37e('0x49')]['id'];}return db['CmCompany'][_0xb37e('0x47')]({'where':{'id':_0xa1a230[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x3987ee,null))[_0xb37e('0x27')](saveUpdates(_0xa1a230[_0xb37e('0x49')],null))[_0xb37e('0x27')](respondWithResult(_0x3987ee,null))[_0xb37e('0x44')](handleError(_0x3987ee,null));};exports[_0xb37e('0x51')]=function(_0xd806a1,_0x5f5648){return db[_0xb37e('0x2c')][_0xb37e('0x47')]({'where':{'id':_0xd806a1[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x5f5648,null))[_0xb37e('0x27')](removeEntity(_0x5f5648,null))[_0xb37e('0x44')](handleError(_0x5f5648,null));};exports[_0xb37e('0x2d')]=function(_0x512830,_0x2e1781){return db['CmCompany'][_0xb37e('0x2d')]()[_0xb37e('0x27')](respondWithResult(_0x2e1781,null))[_0xb37e('0x44')](handleError(_0x2e1781,null));};exports[_0xb37e('0x52')]=function(_0x1b0d63,_0x3f1f4f,_0x58b933){return db[_0xb37e('0x53')][_0xb37e('0x47')]({'where':{'id':_0x1b0d63[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x3f1f4f,null))['then'](function(_0x573989){if(_0x573989){return _0x573989[_0xb37e('0x52')](_0x1b0d63['body']['ids'],_['omit'](_0x1b0d63['body'],[_0xb37e('0x54'),'id'])||{});}})[_0xb37e('0x27')](respondWithResult(_0x3f1f4f,null))[_0xb37e('0x44')](handleError(_0x3f1f4f,null));};exports[_0xb37e('0x55')]=function(_0xc4e2c8,_0x1cd9a5,_0x4def4e){var _0x507ddb={};var _0x156d34={};var _0x47abbe;var _0xd1e263;return db['CmCompany'][_0xb37e('0x56')]({'where':{'id':_0xc4e2c8[_0xb37e('0x46')]['id']}})[_0xb37e('0x27')](handleEntityNotFound(_0x1cd9a5,null))['then'](function(_0x3fb6ae){if(_0x3fb6ae){_0x47abbe=_0x3fb6ae;_0x156d34[_0xb37e('0x2e')]=_['keys'](db[_0xb37e('0x53')]['rawAttributes']);_0x156d34[_0xb37e('0x30')]=_[_0xb37e('0x2f')](_0xc4e2c8[_0xb37e('0x30')]);_0x156d34[_0xb37e('0x39')]=_[_0xb37e('0x31')](_0x156d34[_0xb37e('0x2e')],_0x156d34['query']);_0x507ddb['attributes']=_['intersection'](_0x156d34[_0xb37e('0x2e')],qs[_0xb37e('0x33')](_0xc4e2c8[_0xb37e('0x30')]['fields']));_0x507ddb[_0xb37e('0x32')]=_0x507ddb[_0xb37e('0x32')][_0xb37e('0x34')]?_0x507ddb['attributes']:_0x156d34[_0xb37e('0x2e')];_0x507ddb[_0xb37e('0x37')]=qs['sort'](_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x38')]);_0x507ddb[_0xb37e('0x3b')]=qs[_0xb37e('0x39')](_['pick'](_0xc4e2c8[_0xb37e('0x30')],_0x156d34[_0xb37e('0x39')]));if(_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x3e')]){_0x507ddb[_0xb37e('0x3b')]=_[_0xb37e('0x3c')](_0x507ddb[_0xb37e('0x3b')],{'$or':_[_0xb37e('0x3d')](_0x507ddb[_0xb37e('0x32')],function(_0x166a09){var _0x44eb62={};_0x44eb62[_0x166a09]={'$like':'%'+_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x3e')]+'%'};return _0x44eb62;})});}_0x507ddb=_[_0xb37e('0x3c')]({},_0x507ddb,_0xc4e2c8[_0xb37e('0x3f')]);return _0x47abbe[_0xb37e('0x55')](_0x507ddb);}})[_0xb37e('0x27')](function(_0x1b42f9){if(_0x1b42f9){_0xd1e263=_0x1b42f9[_0xb37e('0x34')];if(!_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x35')]('nolimit')){_0x507ddb[_0xb37e('0x1f')]=qs[_0xb37e('0x1f')](_0xc4e2c8[_0xb37e('0x30')][_0xb37e('0x1f')]);_0x507ddb['offset']=qs['offset'](_0xc4e2c8['query'][_0xb37e('0x1e')]);}return _0x47abbe['getContacts'](_0x507ddb);}})[_0xb37e('0x27')](function(_0x4ef4f8){if(_0x4ef4f8){return _0x4ef4f8?{'count':_0xd1e263,'rows':_0x4ef4f8}:null;}})[_0xb37e('0x27')](respondWithResult(_0x1cd9a5,null))['catch'](handleError(_0x1cd9a5,null));};
\ No newline at end of file
+var _0x7437=['end','sendStatus','error','stack','name','index','describe','model','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','map','CmCompany','includeAll','include','findAll','rows','catch','show','rawAttributes','length','options','create','body','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Companies'];(function(_0x3cc57e,_0x29cd65){var _0x264316=function(_0x12992b){while(--_0x12992b){_0x3cc57e['push'](_0x3cc57e['shift']());}};_0x264316(++_0x29cd65);}(_0x7437,0xe6));var _0x7743=function(_0x3d0ab3,_0x2e1926){_0x3d0ab3=_0x3d0ab3-0x0;var _0x17fd2c=_0x7437[_0x3d0ab3];return _0x17fd2c;};'use strict';var emlformat=require(_0x7743('0x0'));var rimraf=require(_0x7743('0x1'));var zipdir=require(_0x7743('0x2'));var jsonpatch=require(_0x7743('0x3'));var rp=require(_0x7743('0x4'));var moment=require(_0x7743('0x5'));var BPromise=require(_0x7743('0x6'));var Mustache=require(_0x7743('0x7'));var util=require(_0x7743('0x8'));var path=require('path');var sox=require(_0x7743('0x9'));var csv=require(_0x7743('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7743('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x7743('0xc'));var jsforce=require(_0x7743('0xd'));var deskjs=require(_0x7743('0xe'));var toCsv=require(_0x7743('0xa'));var querystring=require(_0x7743('0xf'));var Papa=require(_0x7743('0x10'));var Redis=require(_0x7743('0x11'));var authService=require(_0x7743('0x12'));var qs=require(_0x7743('0x13'));var as=require(_0x7743('0x14'));var hardwareService=require(_0x7743('0x15'));var logger=require(_0x7743('0x16'))(_0x7743('0x17'));var utils=require(_0x7743('0x18'));var config=require(_0x7743('0x19'));var licenseUtil=require(_0x7743('0x1a'));var db=require(_0x7743('0x1b'))['db'];function respondWithStatusCode(_0x2a1398,_0x58f989){_0x58f989=_0x58f989||0xcc;return function(_0x374c8e){if(_0x374c8e){return _0x2a1398['sendStatus'](_0x58f989);}return _0x2a1398[_0x7743('0x1c')](_0x58f989)['end']();};}function respondWithResult(_0x24ae63,_0x3a7cb7){_0x3a7cb7=_0x3a7cb7||0xc8;return function(_0x2a9bb6){if(_0x2a9bb6){return _0x24ae63[_0x7743('0x1c')](_0x3a7cb7)[_0x7743('0x1d')](_0x2a9bb6);}};}function respondWithFilteredResult(_0x5eb20e,_0x5c6744){return function(_0x471fe4){if(_0x471fe4){var _0x102f17=typeof _0x5c6744['offset']==='undefined'&&typeof _0x5c6744[_0x7743('0x1e')]===_0x7743('0x1f');var _0x1c7f26=_0x471fe4[_0x7743('0x20')];var _0x3f2702=_0x102f17?0x0:_0x5c6744[_0x7743('0x21')];var _0x4d0db2=_0x102f17?_0x471fe4[_0x7743('0x20')]:_0x5c6744['offset']+_0x5c6744['limit'];var _0x52f153;if(_0x4d0db2>=_0x1c7f26){_0x4d0db2=_0x1c7f26;_0x52f153=0xc8;}else{_0x52f153=0xce;}_0x5eb20e['status'](_0x52f153);return _0x5eb20e[_0x7743('0x22')]('Content-Range',_0x3f2702+'-'+_0x4d0db2+'/'+_0x1c7f26)['json'](_0x471fe4);}return null;};}function patchUpdates(_0x572485){return function(_0x16f155){try{jsonpatch[_0x7743('0x23')](_0x16f155,_0x572485,!![]);}catch(_0x3a20c3){return BPromise[_0x7743('0x24')](_0x3a20c3);}return _0x16f155[_0x7743('0x25')]();};}function saveUpdates(_0x1b6106,_0x455c9e){return function(_0x16f259){if(_0x16f259){return _0x16f259[_0x7743('0x26')](_0x1b6106)[_0x7743('0x27')](function(_0x22319d){return _0x22319d;});}return null;};}function removeEntity(_0x1272a2,_0x2a879a){return function(_0x46b67d){if(_0x46b67d){return _0x46b67d[_0x7743('0x28')]()[_0x7743('0x27')](function(){var _0x5ba375=_0x46b67d[_0x7743('0x29')]({'plain':!![]});var _0x28125d=_0x7743('0x2a');return db['UserProfileResource'][_0x7743('0x28')]({'where':{'type':_0x28125d,'resourceId':_0x5ba375['id']}})['then'](function(){return _0x46b67d;});})[_0x7743('0x27')](function(){_0x1272a2[_0x7743('0x1c')](0xcc)[_0x7743('0x2b')]();});}};}function handleEntityNotFound(_0x57ba34,_0xc634d8){return function(_0x48238d){if(!_0x48238d){_0x57ba34[_0x7743('0x2c')](0x194);}return _0x48238d;};}function handleError(_0x29eeb0,_0x30e386){_0x30e386=_0x30e386||0x1f4;return function(_0x1aac64){logger[_0x7743('0x2d')](_0x1aac64[_0x7743('0x2e')]);if(_0x1aac64['name']){delete _0x1aac64[_0x7743('0x2f')];}_0x29eeb0['status'](_0x30e386)['send'](_0x1aac64);};}exports[_0x7743('0x30')]=function(_0x49abc7,_0x1bbf54){var _0x1902da={},_0x5b7f14={},_0x27d7e6={'count':0x0,'rows':[]};return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](function(_0x1a2ae0){_0x5b7f14[_0x7743('0x32')]=_[_0x7743('0x33')](_0x1a2ae0);_0x5b7f14['query']=_[_0x7743('0x33')](_0x49abc7[_0x7743('0x34')]);_0x5b7f14['filters']=_[_0x7743('0x35')](_0x5b7f14[_0x7743('0x32')],_0x5b7f14[_0x7743('0x34')]);_0x1902da[_0x7743('0x36')]=_['intersection'](_0x5b7f14[_0x7743('0x32')],qs[_0x7743('0x37')](_0x49abc7[_0x7743('0x34')]['fields']));_0x1902da[_0x7743('0x36')]=_0x1902da['attributes']['length']?_0x1902da[_0x7743('0x36')]:_0x5b7f14[_0x7743('0x32')];if(!_0x49abc7['query'][_0x7743('0x38')](_0x7743('0x39'))){_0x1902da[_0x7743('0x1e')]=qs[_0x7743('0x1e')](_0x49abc7[_0x7743('0x34')][_0x7743('0x1e')]);_0x1902da['offset']=qs[_0x7743('0x21')](_0x49abc7['query']['offset']);}_0x1902da[_0x7743('0x3a')]=qs[_0x7743('0x3b')](_0x49abc7[_0x7743('0x34')][_0x7743('0x3b')]);_0x1902da[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x49abc7[_0x7743('0x34')],_0x5b7f14[_0x7743('0x3d')]),_0x1a2ae0);if(_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]){_0x1902da[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x1902da['where'],{'$or':_[_0x7743('0x40')](_0x1902da[_0x7743('0x36')],function(_0x106a2c){var _0xfa9c80={};_0xfa9c80[_0x106a2c]={'$like':'%'+_0x49abc7[_0x7743('0x34')][_0x7743('0x3e')]+'%'};return _0xfa9c80;})});}_0x1902da=_[_0x7743('0x3f')]({},_0x1902da,_0x49abc7['options']);var _0x37b6b8={'where':_0x1902da[_0x7743('0x3c')]};return db[_0x7743('0x41')][_0x7743('0x20')](_0x37b6b8)[_0x7743('0x27')](function(_0x5a7d7e){_0x27d7e6[_0x7743('0x20')]=_0x5a7d7e;if(_0x49abc7[_0x7743('0x34')][_0x7743('0x42')]){_0x1902da[_0x7743('0x43')]=[{'all':!![]}];}return db[_0x7743('0x41')][_0x7743('0x44')](_0x1902da);})[_0x7743('0x27')](function(_0x1a42c6){_0x27d7e6[_0x7743('0x45')]=_0x1a42c6;return _0x27d7e6;})[_0x7743('0x27')](respondWithFilteredResult(_0x1bbf54,_0x1902da))[_0x7743('0x46')](handleError(_0x1bbf54,null));})[_0x7743('0x46')](handleError(_0x1bbf54,null));};exports[_0x7743('0x47')]=function(_0x86ccaa,_0x47b171){var _0x145124={'raw':![],'where':{'id':_0x86ccaa['params']['id']}},_0x29dd36={};_0x29dd36[_0x7743('0x32')]=_[_0x7743('0x33')](db[_0x7743('0x41')][_0x7743('0x48')]);_0x29dd36[_0x7743('0x34')]=_[_0x7743('0x33')](_0x86ccaa[_0x7743('0x34')]);_0x29dd36[_0x7743('0x3d')]=_[_0x7743('0x35')](_0x29dd36[_0x7743('0x32')],_0x29dd36['query']);_0x145124[_0x7743('0x36')]=_[_0x7743('0x35')](_0x29dd36['model'],qs[_0x7743('0x37')](_0x86ccaa[_0x7743('0x34')][_0x7743('0x37')]));_0x145124['attributes']=_0x145124[_0x7743('0x36')][_0x7743('0x49')]?_0x145124[_0x7743('0x36')]:_0x29dd36[_0x7743('0x32')];if(_0x86ccaa[_0x7743('0x34')][_0x7743('0x42')]){_0x145124[_0x7743('0x43')]=[{'all':!![]}];}_0x145124=_[_0x7743('0x3f')]({},_0x145124,_0x86ccaa[_0x7743('0x4a')]);return db['CmCompany']['find'](_0x145124)[_0x7743('0x27')](handleEntityNotFound(_0x47b171,null))[_0x7743('0x27')](respondWithResult(_0x47b171,null))['catch'](handleError(_0x47b171,null));};exports[_0x7743('0x4b')]=function(_0x5cd6f4,_0x59cab8){return db[_0x7743('0x41')][_0x7743('0x4b')](_0x5cd6f4[_0x7743('0x4c')],{})[_0x7743('0x27')](function(_0x243cc4){var _0x536e50=_0x5cd6f4[_0x7743('0x4d')][_0x7743('0x29')]({'plain':!![]});if(!_0x536e50)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x536e50['role']===_0x7743('0x4d')){var _0x59fd91=_0x243cc4['get']({'plain':!![]});var _0x42ecbd=_0x7743('0x2a');return db[_0x7743('0x4e')][_0x7743('0x4f')]({'where':{'name':_0x42ecbd,'userProfileId':_0x536e50[_0x7743('0x50')]},'raw':!![]})[_0x7743('0x27')](function(_0x570a4c){if(_0x570a4c&&_0x570a4c[_0x7743('0x51')]===0x0){return db[_0x7743('0x52')]['create']({'name':_0x59fd91['name'],'resourceId':_0x59fd91['id'],'type':_0x570a4c[_0x7743('0x2f')],'sectionId':_0x570a4c['id']},{})[_0x7743('0x27')](function(){return _0x243cc4;});}else{return _0x243cc4;}})[_0x7743('0x46')](function(_0x5bdfe8){logger[_0x7743('0x2d')](_0x7743('0x53'),_0x5bdfe8);throw _0x5bdfe8;});}return _0x243cc4;})[_0x7743('0x27')](respondWithResult(_0x59cab8,0xc9))[_0x7743('0x46')](handleError(_0x59cab8,null));};exports[_0x7743('0x26')]=function(_0x215528,_0x37223d){if(_0x215528[_0x7743('0x4c')]['id']){delete _0x215528['body']['id'];}return db[_0x7743('0x41')][_0x7743('0x4f')]({'where':{'id':_0x215528[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x37223d,null))[_0x7743('0x27')](saveUpdates(_0x215528[_0x7743('0x4c')],null))[_0x7743('0x27')](respondWithResult(_0x37223d,null))[_0x7743('0x46')](handleError(_0x37223d,null));};exports['destroy']=function(_0xd47076,_0x6f93c3){return db[_0x7743('0x41')]['find']({'where':{'id':_0xd47076[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x6f93c3,null))[_0x7743('0x27')](removeEntity(_0x6f93c3,null))['catch'](handleError(_0x6f93c3,null));};exports[_0x7743('0x31')]=function(_0x14bbe7,_0xcc25bc){return db['CmCompany'][_0x7743('0x31')]()[_0x7743('0x27')](respondWithResult(_0xcc25bc,null))['catch'](handleError(_0xcc25bc,null));};exports[_0x7743('0x55')]=function(_0x27ea3f,_0x39c517,_0x909544){return db['CmContact'][_0x7743('0x4f')]({'where':{'id':_0x27ea3f[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x39c517,null))[_0x7743('0x27')](function(_0x406891){if(_0x406891){return _0x406891[_0x7743('0x55')](_0x27ea3f[_0x7743('0x4c')]['ids'],_[_0x7743('0x56')](_0x27ea3f[_0x7743('0x4c')],[_0x7743('0x57'),'id'])||{});}})[_0x7743('0x27')](respondWithResult(_0x39c517,null))[_0x7743('0x46')](handleError(_0x39c517,null));};exports[_0x7743('0x58')]=function(_0x408345,_0x94466b,_0x351046){var _0x46a8e3={};var _0x5c11af={};var _0x30e8ac;var _0x4c31f7;return db[_0x7743('0x41')][_0x7743('0x59')]({'where':{'id':_0x408345[_0x7743('0x54')]['id']}})[_0x7743('0x27')](handleEntityNotFound(_0x94466b,null))['then'](function(_0x225121){if(_0x225121){_0x30e8ac=_0x225121;_0x5c11af['model']=_[_0x7743('0x33')](db[_0x7743('0x5a')][_0x7743('0x48')]);_0x5c11af[_0x7743('0x34')]=_[_0x7743('0x33')](_0x408345[_0x7743('0x34')]);_0x5c11af['filters']=_[_0x7743('0x35')](_0x5c11af[_0x7743('0x32')],_0x5c11af[_0x7743('0x34')]);_0x46a8e3[_0x7743('0x36')]=_[_0x7743('0x35')](_0x5c11af['model'],qs['fields'](_0x408345[_0x7743('0x34')][_0x7743('0x37')]));_0x46a8e3[_0x7743('0x36')]=_0x46a8e3['attributes'][_0x7743('0x49')]?_0x46a8e3['attributes']:_0x5c11af[_0x7743('0x32')];_0x46a8e3[_0x7743('0x3a')]=qs['sort'](_0x408345['query'][_0x7743('0x3b')]);_0x46a8e3[_0x7743('0x3c')]=qs[_0x7743('0x3d')](_['pick'](_0x408345[_0x7743('0x34')],_0x5c11af[_0x7743('0x3d')]));if(_0x408345[_0x7743('0x34')][_0x7743('0x3e')]){_0x46a8e3[_0x7743('0x3c')]=_[_0x7743('0x3f')](_0x46a8e3[_0x7743('0x3c')],{'$or':_[_0x7743('0x40')](_0x46a8e3['attributes'],function(_0x34066a){var _0x219074={};_0x219074[_0x34066a]={'$like':'%'+_0x408345[_0x7743('0x34')]['filter']+'%'};return _0x219074;})});}_0x46a8e3=_[_0x7743('0x3f')]({},_0x46a8e3,_0x408345[_0x7743('0x4a')]);return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})[_0x7743('0x27')](function(_0x57a4d5){if(_0x57a4d5){_0x4c31f7=_0x57a4d5[_0x7743('0x49')];if(!_0x408345[_0x7743('0x34')][_0x7743('0x38')](_0x7743('0x39'))){_0x46a8e3['limit']=qs[_0x7743('0x1e')](_0x408345[_0x7743('0x34')][_0x7743('0x1e')]);_0x46a8e3[_0x7743('0x21')]=qs[_0x7743('0x21')](_0x408345[_0x7743('0x34')][_0x7743('0x21')]);}return _0x30e8ac[_0x7743('0x58')](_0x46a8e3);}})['then'](function(_0x3cf4e8){if(_0x3cf4e8){return _0x3cf4e8?{'count':_0x4c31f7,'rows':_0x3cf4e8}:null;}})['then'](respondWithResult(_0x94466b,null))[_0x7743('0x46')](handleError(_0x94466b,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index de39432..55be2b1 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 _0x2704=['moment','bluebird','request-promise','path','rimraf','./cmCompany.attributes','exports','define','CmCompany','lodash','util','../../config/logger','api'];(function(_0xbf50e9,_0x37815a){var _0x5a375b=function(_0x35a694){while(--_0x35a694){_0xbf50e9['push'](_0xbf50e9['shift']());}};_0x5a375b(++_0x37815a);}(_0x2704,0x182));var _0x4270=function(_0x3a7ab8,_0x35dbf3){_0x3a7ab8=_0x3a7ab8-0x0;var _0x2734fa=_0x2704[_0x3a7ab8];return _0x2734fa;};'use strict';var _=require(_0x4270('0x0'));var util=require(_0x4270('0x1'));var logger=require(_0x4270('0x2'))(_0x4270('0x3'));var moment=require(_0x4270('0x4'));var BPromise=require(_0x4270('0x5'));var rp=require(_0x4270('0x6'));var fs=require('fs');var path=require(_0x4270('0x7'));var rimraf=require(_0x4270('0x8'));var config=require('../../config/environment');var attributes=require(_0x4270('0x9'));module[_0x4270('0xa')]=function(_0x17cb39,_0x540298){return _0x17cb39[_0x4270('0xb')](_0x4270('0xc'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe420=['path','rimraf','../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x33032e,_0x31411a){var _0x13316b=function(_0x2fb049){while(--_0x2fb049){_0x33032e['push'](_0x33032e['shift']());}};_0x13316b(++_0x31411a);}(_0xe420,0xb0));var _0x0e42=function(_0xa272c4,_0x1cf585){_0xa272c4=_0xa272c4-0x0;var _0x555142=_0xe420[_0xa272c4];return _0x555142;};'use strict';var _=require(_0x0e42('0x0'));var util=require(_0x0e42('0x1'));var logger=require(_0x0e42('0x2'))(_0x0e42('0x3'));var moment=require(_0x0e42('0x4'));var BPromise=require('bluebird');var rp=require(_0x0e42('0x5'));var fs=require('fs');var path=require(_0x0e42('0x6'));var rimraf=require(_0x0e42('0x7'));var config=require(_0x0e42('0x8'));var attributes=require(_0x0e42('0x9'));module['exports']=function(_0x27b5f1,_0x33604f){return _0x27b5f1[_0x0e42('0xa')](_0x0e42('0xb'),attributes,{'tableName':_0x0e42('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 0e77786..4af4b41 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 _0x7e4c=['../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x7e4c,0x11e));var _0xc7e4=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x7e4c[_0x2742db];return _0x18659e;};'use strict';var _=require(_0xc7e4('0x0'));var util=require('util');var moment=require(_0xc7e4('0x1'));var BPromise=require('bluebird');var rs=require(_0xc7e4('0x2'));var fs=require('fs');var Redis=require(_0xc7e4('0x3'));var db=require(_0xc7e4('0x4'))['db'];var utils=require(_0xc7e4('0x5'));var logger=require(_0xc7e4('0x6'))(_0xc7e4('0x7'));var config=require(_0xc7e4('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc7e4('0x9')][_0xc7e4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2612a7,_0x427557,_0x162bd2){return new BPromise(function(_0x1a8c07,_0x27127e){return client['request'](_0x2612a7,_0x162bd2)[_0xc7e4('0xb')](function(_0x3ced0f){logger[_0xc7e4('0xc')](_0xc7e4('0xd'),_0x427557,_0xc7e4('0xe'));logger[_0xc7e4('0xf')](_0xc7e4('0x10'),_0x427557,_0xc7e4('0xe'),JSON[_0xc7e4('0x11')](_0x3ced0f));if(_0x3ced0f[_0xc7e4('0x12')]){if(_0x3ced0f['error']['code']===0x1f4){logger[_0xc7e4('0x12')](_0xc7e4('0xd'),_0x427557,_0x3ced0f[_0xc7e4('0x12')][_0xc7e4('0x13')]);return _0x27127e(_0x3ced0f[_0xc7e4('0x12')][_0xc7e4('0x13')]);}logger[_0xc7e4('0x12')]('CmCompany,\x20%s,\x20%s',_0x427557,_0x3ced0f['error'][_0xc7e4('0x13')]);return _0x1a8c07(_0x3ced0f[_0xc7e4('0x12')]['message']);}else{logger[_0xc7e4('0xc')](_0xc7e4('0xd'),_0x427557,_0xc7e4('0xe'));_0x1a8c07(_0x3ced0f[_0xc7e4('0x14')][_0xc7e4('0x13')]);}})['catch'](function(_0x32e405){logger[_0xc7e4('0x12')](_0xc7e4('0xd'),_0x427557,_0x32e405);_0x27127e(_0x32e405);});});}
\ No newline at end of file
+var _0x5b64=['request','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1e5019,_0x516600){var _0x5bb93a=function(_0x4b4df4){while(--_0x4b4df4){_0x1e5019['push'](_0x1e5019['shift']());}};_0x5bb93a(++_0x516600);}(_0x5b64,0x66));var _0x45b6=function(_0x7cc4c4,_0x544d32){_0x7cc4c4=_0x7cc4c4-0x0;var _0x5d464b=_0x5b64[_0x7cc4c4];return _0x5d464b;};'use strict';var _=require(_0x45b6('0x0'));var util=require(_0x45b6('0x1'));var moment=require(_0x45b6('0x2'));var BPromise=require(_0x45b6('0x3'));var rs=require(_0x45b6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x45b6('0x5'))['db'];var utils=require(_0x45b6('0x6'));var logger=require(_0x45b6('0x7'))(_0x45b6('0x8'));var config=require(_0x45b6('0x9'));var jayson=require(_0x45b6('0xa'));var client=jayson[_0x45b6('0xb')][_0x45b6('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x272c8a,_0xf0ad47,_0x1d118a){return new BPromise(function(_0x239074,_0x536669){return client[_0x45b6('0xd')](_0x272c8a,_0x1d118a)['then'](function(_0x4891ff){logger[_0x45b6('0xe')]('CmCompany,\x20%s,\x20%s',_0xf0ad47,_0x45b6('0xf'));logger[_0x45b6('0x10')](_0x45b6('0x11'),_0xf0ad47,'request\x20sent',JSON[_0x45b6('0x12')](_0x4891ff));if(_0x4891ff[_0x45b6('0x13')]){if(_0x4891ff['error'][_0x45b6('0x14')]===0x1f4){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0x4891ff[_0x45b6('0x13')][_0x45b6('0x16')]);return _0x536669(_0x4891ff[_0x45b6('0x13')]['message']);}logger['error'](_0x45b6('0x15'),_0xf0ad47,_0x4891ff['error'][_0x45b6('0x16')]);return _0x239074(_0x4891ff[_0x45b6('0x13')]['message']);}else{logger[_0x45b6('0xe')](_0x45b6('0x15'),_0xf0ad47,'request\x20sent');_0x239074(_0x4891ff['result'][_0x45b6('0x16')]);}})['catch'](function(_0xebfc33){logger[_0x45b6('0x13')](_0x45b6('0x15'),_0xf0ad47,_0xebfc33);_0x536669(_0xebfc33);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 01bdd89..e8e522f 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 _0x0f08=['exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete'];(function(_0x5c6ac8,_0x1b617f){var _0x16394c=function(_0x391106){while(--_0x391106){_0x5c6ac8['push'](_0x5c6ac8['shift']());}};_0x16394c(++_0x1b617f);}(_0x0f08,0x109));var _0x80f0=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x0f08[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x80f0('0x0'));var util=require(_0x80f0('0x1'));var path=require(_0x80f0('0x2'));var timeout=require(_0x80f0('0x3'));var express=require('express');var router=express[_0x80f0('0x4')]();var fs_extra=require(_0x80f0('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x80f0('0x6'));var config=require(_0x80f0('0x7'));var controller=require('./cmCompany.controller');router[_0x80f0('0x8')]('/',auth[_0x80f0('0x9')](),controller[_0x80f0('0xa')]);router[_0x80f0('0x8')](_0x80f0('0xb'),auth[_0x80f0('0x9')](),controller['describe']);router[_0x80f0('0x8')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller[_0x80f0('0xd')]);router['get'](_0x80f0('0xe'),auth[_0x80f0('0x9')](),controller[_0x80f0('0xf')]);router['post']('/',auth[_0x80f0('0x9')](),controller['create']);router[_0x80f0('0x10')]('/:id/contacts',auth[_0x80f0('0x9')](),controller[_0x80f0('0x11')]);router[_0x80f0('0x12')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller[_0x80f0('0x13')]);router[_0x80f0('0x14')](_0x80f0('0xc'),auth[_0x80f0('0x9')](),controller['destroy']);module[_0x80f0('0x15')]=router;
\ No newline at end of file
+var _0x1d39=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post','addContacts','put','update','delete','destroy','exports'];(function(_0x2f4c1c,_0x5a3dd4){var _0x25e0f2=function(_0x46ea31){while(--_0x46ea31){_0x2f4c1c['push'](_0x2f4c1c['shift']());}};_0x25e0f2(++_0x5a3dd4);}(_0x1d39,0x108));var _0x91d3=function(_0x10c4d6,_0x1cd56c){_0x10c4d6=_0x10c4d6-0x0;var _0x3a4a5f=_0x1d39[_0x10c4d6];return _0x3a4a5f;};'use strict';var multer=require(_0x91d3('0x0'));var util=require(_0x91d3('0x1'));var path=require(_0x91d3('0x2'));var timeout=require(_0x91d3('0x3'));var express=require(_0x91d3('0x4'));var router=express[_0x91d3('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x91d3('0x6'));var interaction=require(_0x91d3('0x7'));var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0x91d3('0x8')]('/',auth[_0x91d3('0x9')](),controller[_0x91d3('0xa')]);router[_0x91d3('0x8')](_0x91d3('0xb'),auth[_0x91d3('0x9')](),controller[_0x91d3('0xc')]);router[_0x91d3('0x8')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0xe')]);router['get'](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x10')]);router[_0x91d3('0x11')]('/',auth[_0x91d3('0x9')](),controller['create']);router[_0x91d3('0x11')](_0x91d3('0xf'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x12')]);router[_0x91d3('0x13')](_0x91d3('0xd'),auth[_0x91d3('0x9')](),controller[_0x91d3('0x14')]);router[_0x91d3('0x15')](_0x91d3('0xd'),auth['isAuthenticated'](),controller[_0x91d3('0x16')]);module[_0x91d3('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index edf4353..263f971 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 _0xe4e8=['lodash','exports','STRING','TEXT','INTEGER','UNSIGNED','NOW'];(function(_0x5bec42,_0x2e8ce9){var _0x2a1602=function(_0x3fb8a8){while(--_0x3fb8a8){_0x5bec42['push'](_0x5bec42['shift']());}};_0x2a1602(++_0x2e8ce9);}(_0xe4e8,0x13b));var _0x8e4e=function(_0x133a2e,_0x18376d){_0x133a2e=_0x133a2e-0x0;var _0x1a2782=_0xe4e8[_0x133a2e];return _0x1a2782;};'use strict';var _=require(_0x8e4e('0x0'));var Sequelize=require('sequelize');module[_0x8e4e('0x1')]={'firstName':{'type':Sequelize[_0x8e4e('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x8e4e('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x8e4e('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x8e4e('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8e4e('0x3')]},'phone':{'type':Sequelize[_0x8e4e('0x2')]},'mobile':{'type':Sequelize[_0x8e4e('0x2')]},'fax':{'type':Sequelize[_0x8e4e('0x2')]},'email':{'type':Sequelize[_0x8e4e('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x8e4e('0x2')]},'skype':{'type':Sequelize[_0x8e4e('0x2')]},'teams':{'type':Sequelize[_0x8e4e('0x2')]},'viber':{'type':Sequelize[_0x8e4e('0x2')]},'line':{'type':Sequelize[_0x8e4e('0x2')]},'wechat':{'type':Sequelize[_0x8e4e('0x2')]},'telegram':{'type':Sequelize[_0x8e4e('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x8e4e('0x4')](0x2)[_0x8e4e('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x8e4e('0x6')]}};
\ No newline at end of file
+var _0xeca1=['DATE','NOW','lodash','exports','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x3f830b,_0x493523){var _0x33f6f2=function(_0x1e2751){while(--_0x1e2751){_0x3f830b['push'](_0x3f830b['shift']());}};_0x33f6f2(++_0x493523);}(_0xeca1,0x10a));var _0x1eca=function(_0x142d26,_0x1920db){_0x142d26=_0x142d26-0x0;var _0x4aee13=_0xeca1[_0x142d26];return _0x4aee13;};'use strict';var _=require(_0x1eca('0x0'));var Sequelize=require('sequelize');module[_0x1eca('0x1')]={'firstName':{'type':Sequelize[_0x1eca('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1eca('0x2')]},'street':{'type':Sequelize[_0x1eca('0x2')]},'postalCode':{'type':Sequelize[_0x1eca('0x2')]},'city':{'type':Sequelize[_0x1eca('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x1eca('0x2')]},'description':{'type':Sequelize[_0x1eca('0x3')]},'phone':{'type':Sequelize[_0x1eca('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x1eca('0x2')]},'email':{'type':Sequelize[_0x1eca('0x2')]},'url':{'type':Sequelize[_0x1eca('0x2')]},'facebook':{'type':Sequelize[_0x1eca('0x2')]},'fb_data':{'type':Sequelize[_0x1eca('0x2')]},'twitter':{'type':Sequelize[_0x1eca('0x2')]},'skype':{'type':Sequelize[_0x1eca('0x2')]},'teams':{'type':Sequelize[_0x1eca('0x2')]},'viber':{'type':Sequelize[_0x1eca('0x2')]},'line':{'type':Sequelize[_0x1eca('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x1eca('0x2')]},'UserId':{'type':Sequelize['INTEGER']},'priority':{'type':Sequelize[_0x1eca('0x4')](0x2)[_0x1eca('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x1eca('0x6')],'defaultValue':Sequelize[_0x1eca('0x7')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 07685dc..30213c3 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 _0xc202=['rows','catch','params','columnName','findAll','displayName','alias','values','body','get','mergeWith','tags','join','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','info','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','error','show','color','$and','omit','cf_%d','pickBy','format','id\x20=\x20?','phone','getTags','findOne','rawAttributes','pick','options','setTags','ContactId','includeAll','include','getHopperHistories','getHopperFinals','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','server/files/tmp','file','chmodSync','0777','child_process','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','meta','import','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','getJourney','mail','chat','openchannel','fax','whatsapp','voice','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20date\x20for\x20range\x20to\x20filter','uniqueid','source','destination','duration','note','userDisposition','UserId','fullname','createdAt','DESC','findAndCountAll','startCase','Website','closed','closedAt','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','customerPort','deviceModel','osName','ratingMessage','ratingType','referer','subject','substatus','externalUrl','threadId','Interaction','flatten','sortBy','slice','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','redis','./cmContact.socket','register','sendStatus','status','end','offset','undefined','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index','CmContact','describe','keys','length','startsWith','CmCustomField','trimStart','all','cf_','fieldType','type','model','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','select','field','from','tools_tags','cm_contacts','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','expr','search','sqlOperator','conditions','find','Tag','split','map','union','User','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','value','start','Contact','isEmpty','forEach','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','having','t.id\x20IN\x20?','role','agent','user','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge','c.firstName','c.fax','c.email','c.ListId','c.createdAt','c.deletedAt','c.CompanyId','TagIds','Tags','push'];(function(_0x49297d,_0x2b04c1){var _0x3e7dbd=function(_0x10a151){while(--_0x10a151){_0x49297d['push'](_0x49297d['shift']());}};_0x3e7dbd(++_0x2b04c1);}(_0xc202,0x95));var _0x2c20=function(_0x56c758,_0x540591){_0x56c758=_0x56c758-0x0;var _0x9bb0db=_0xc202[_0x56c758];return _0x9bb0db;};'use strict';var emlformat=require(_0x2c20('0x0'));var rimraf=require(_0x2c20('0x1'));var zipdir=require(_0x2c20('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2c20('0x3'));var moment=require(_0x2c20('0x4'));var BPromise=require(_0x2c20('0x5'));var Mustache=require(_0x2c20('0x6'));var util=require('util');var path=require(_0x2c20('0x7'));var sox=require('sox');var csv=require(_0x2c20('0x8'));var ejs=require(_0x2c20('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2c20('0xa'));var squel=require('squel');var crypto=require(_0x2c20('0xb'));var jsforce=require(_0x2c20('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2c20('0xd'));var Redis=require(_0x2c20('0xe'));var authService=require(_0x2c20('0xf'));var qs=require(_0x2c20('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2c20('0x11'));var logger=require('../../config/logger')(_0x2c20('0x12'));var utils=require(_0x2c20('0x13'));var config=require(_0x2c20('0x14'));var licenseUtil=require(_0x2c20('0x15'));var db=require(_0x2c20('0x16'))['db'];config['redis']=_[_0x2c20('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2c20('0x18'))(new Redis(config[_0x2c20('0x19')]));require(_0x2c20('0x1a'))[_0x2c20('0x1b')](socket);function respondWithStatusCode(_0xb3ae36,_0x4c3e50){_0x4c3e50=_0x4c3e50||0xcc;return function(_0x36a231){if(_0x36a231){return _0xb3ae36[_0x2c20('0x1c')](_0x4c3e50);}return _0xb3ae36[_0x2c20('0x1d')](_0x4c3e50)[_0x2c20('0x1e')]();};}function respondWithResult(_0x2e2429,_0xc67df3){_0xc67df3=_0xc67df3||0xc8;return function(_0x1fd186){if(_0x1fd186){return _0x2e2429[_0x2c20('0x1d')](_0xc67df3)['json'](_0x1fd186);}};}function respondWithFilteredResult(_0x362a88,_0x54495d){return function(_0x384198){if(_0x384198){var _0x3aaea2=typeof _0x54495d[_0x2c20('0x1f')]==='undefined'&&typeof _0x54495d['limit']===_0x2c20('0x20');var _0x4602ac=_0x384198['count'];var _0x2b886f=_0x3aaea2?0x0:_0x54495d[_0x2c20('0x1f')];var _0x4369e3=_0x3aaea2?_0x384198[_0x2c20('0x21')]:_0x54495d[_0x2c20('0x1f')]+_0x54495d[_0x2c20('0x22')];var _0x539a49;if(_0x4369e3>=_0x4602ac){_0x4369e3=_0x4602ac;_0x539a49=0xc8;}else{_0x539a49=0xce;}_0x362a88[_0x2c20('0x1d')](_0x539a49);return _0x362a88[_0x2c20('0x23')](_0x2c20('0x24'),_0x2b886f+'-'+_0x4369e3+'/'+_0x4602ac)[_0x2c20('0x25')](_0x384198);}return null;};}function patchUpdates(_0x580c4a){return function(_0x21c1db){try{jsonpatch[_0x2c20('0x26')](_0x21c1db,_0x580c4a,!![]);}catch(_0x517b5e){return BPromise[_0x2c20('0x27')](_0x517b5e);}return _0x21c1db[_0x2c20('0x28')]();};}function saveUpdates(_0x33b197,_0x12a198){return function(_0x3522b9){if(_0x3522b9){return _0x3522b9[_0x2c20('0x29')](_0x33b197)[_0x2c20('0x2a')](function(_0x26c500){return _0x26c500;});}return null;};}function removeEntity(_0x4e3d63,_0x322ef4){return function(_0x5c5590){if(_0x5c5590){return _0x5c5590[_0x2c20('0x2b')]()['then'](function(){_0x4e3d63['status'](0xcc)[_0x2c20('0x1e')]();});}};}function handleEntityNotFound(_0x566ba3,_0xfb0f95){return function(_0x9c5ab0){if(!_0x9c5ab0){_0x566ba3[_0x2c20('0x1c')](0x194);}return _0x9c5ab0;};}function handleError(_0x2d7e28,_0x297532){_0x297532=_0x297532||0x1f4;return function(_0x2cc8ae){logger['error'](_0x2cc8ae['stack']);if(_0x2cc8ae[_0x2c20('0x2c')]){delete _0x2cc8ae[_0x2c20('0x2c')];}_0x2d7e28[_0x2c20('0x1d')](_0x297532)[_0x2c20('0x2d')](_0x2cc8ae);};}exports[_0x2c20('0x2e')]=function(_0x31a26b,_0x46b65c){var _0x3d74a8={},_0x493f49={},_0x21b281={'count':0x0,'rows':[]};return db[_0x2c20('0x2f')][_0x2c20('0x30')]()[_0x2c20('0x2a')](function(_0x432011){var _0x3c457a=[];for(var _0x496e3c=0x0;_0x496e3c
'];(function(_0x249dcd,_0xeae469){var _0x2b952d=function(_0x5ca7d8){while(--_0x5ca7d8){_0x249dcd['push'](_0x249dcd['shift']());}};_0x2b952d(++_0xeae469);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x3173a5,_0x4d7458){_0x3173a5=_0x3173a5-0x0;var _0x2d4cf4=_0x9e2e[_0x3173a5];return _0x2d4cf4;};'use strict';var _=require(_0xe9e2('0x0'));var moment=require(_0xe9e2('0x1'));var random=require(_0xe9e2('0x2'));var fs=require('fs');var path=require('path');var util=require(_0xe9e2('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')(_0xe9e2('0x4'));var config=require(_0xe9e2('0x5'));function getAddress(_0x3bfa90){var _0x212d98=_[_0xe9e2('0x6')](_0x3bfa90[_0xe9e2('0x7')]);return _0x212d98&&_0x212d98[_0xe9e2('0x8')]?_0x212d98['address']:_0xe9e2('0x9')+random['generate'](0x6)+_0xe9e2('0xa');}function getFirstName(_0x1ade12){var _0x58a008=_[_0xe9e2('0x6')](_0x1ade12[_0xe9e2('0x7')]);if(_0x58a008&&_0x58a008['name']){if(_0x58a008[_0xe9e2('0xb')]==_0x58a008[_0xe9e2('0x8')]){return _0x58a008['name']['substring'](0x0,_0x58a008[_0xe9e2('0xb')][_0xe9e2('0xc')]('@'));}var _0x2e02c8=_0x58a008[_0xe9e2('0xb')]['split'](/\s+/);return _0x2e02c8['length']>0x1?_0x2e02c8[_0xe9e2('0xd')](0x0,-0x1)[_0xe9e2('0xe')]('\x20'):_0x58a008[_0xe9e2('0xb')];}return _0xe9e2('0xf');}function getLastName(_0x13bfad){var _0x23331d=_[_0xe9e2('0x6')](_0x13bfad[_0xe9e2('0x7')]);if(_0x23331d&&_0x23331d[_0xe9e2('0xb')]){var _0x33a169=_0x23331d['name']['split'](/\s+/);return _0x33a169[_0xe9e2('0x10')]>0x1?_0x33a169['pop']():'';}return'';}function getMails(_0x533e9e,_0x17a5c3){var _0x28aff7='';for(var _0x3550ce=0x0;_0x3550ce<_0x17a5c3[_0xe9e2('0x7')][_0xe9e2('0x10')];_0x3550ce+=0x1){if(_0x17a5c3[_0xe9e2('0x7')][_0x3550ce]['address']!==_0x533e9e){if(!_[_0xe9e2('0x11')](_0x28aff7)){_0x28aff7+=',';}_0x28aff7+=_0x17a5c3[_0xe9e2('0x7')][_0x3550ce][_0xe9e2('0xb')]||_0x17a5c3['value'][_0x3550ce][_0xe9e2('0x8')]||'';_0x28aff7+='\x20<';_0x28aff7+=_0x17a5c3[_0xe9e2('0x7')][_0x3550ce][_0xe9e2('0x8')]?_0x17a5c3['value'][_0x3550ce][_0xe9e2('0x8')]:_0xe9e2('0x9')+random[_0xe9e2('0x12')](0x6)+'@xcally.com';_0x28aff7+='>';}}return _0x28aff7;}function parseEmail(_0x16d953,_0x36c8a3,_0x456455){if(_0x36c8a3[_0xe9e2('0x13')]){var _0x5bb286=/