From: support
Date: Mon, 24 Oct 2022 15:38:43 +0000 (+0000)
Subject: Built motion from commit 1fd437e9.|2.6.19
X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=b6e2e710c6ea70397294e7f53bfc06674b0b172d;p=motion2.git
Built motion from commit 1fd437e9.|2.6.19
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1704d8f..565c1bd 100644
--- a/apidoc/api_project.js
+++ b/apidoc/api_project.js
@@ -17,7 +17,7 @@ define({
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-24T14:15:10.937Z",
+ "time": "2022-10-24T15:31:09.882Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index b3eccbe..c80ef17 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-10-24T14:15:10.937Z",
+ "time": "2022-10-24T15:31:09.882Z",
"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 f8875fb..435ca62 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 _0x7584=['VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','urlForward','browser','bot','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','urlForward[body]','sequelize','exports'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0x7584,0x10e));var _0x4758=function(_0x168720,_0x38bf6a){_0x168720=_0x168720-0x0;var _0x7eeeb8=_0x7584[_0x168720];return _0x7eeeb8;};'use strict';var Sequelize=require(_0x4758('0x0'));module[_0x4758('0x1')]={'name':{'type':Sequelize[_0x4758('0x2')],'get':function(_0x34622b){return this[_0x4758('0x3')](_0x4758('0x4'));}},'action':{'type':Sequelize[_0x4758('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x4758('0x6'),_0x4758('0x7'),_0x4758('0x8'),'jscripty',_0x4758('0x9'),_0x4758('0xa'),_0x4758('0xb'),'script']],'msg':_0x4758('0xc')}},'comment':_0x4758('0xc')},'data1':{'type':Sequelize[_0x4758('0x5')](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[_0x4758('0x5')](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]'},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0x4758('0xd')},'data5':{'type':Sequelize[_0x4758('0x5')](0x1000),'comments':_0x4758('0xe')},'data6':{'type':Sequelize['STRING'],'comments':_0x4758('0xf')},'data7':{'type':Sequelize['TEXT'],'comments':_0x4758('0x10')}};
\ No newline at end of file
+var _0xc9cb=['urlForward[body]','exports','getDataValue','STRING','integration','motionbar','jscripty','urlForward','bot','script','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)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT'];(function(_0x1709e7,_0x2ced21){var _0x402819=function(_0x3637a0){while(--_0x3637a0){_0x1709e7['push'](_0x1709e7['shift']());}};_0x402819(++_0x2ced21);}(_0xc9cb,0x91));var _0xbc9c=function(_0x3056bf,_0x10dbef){_0x3056bf=_0x3056bf-0x0;var _0x2adc05=_0xc9cb[_0x3056bf];return _0x2adc05;};'use strict';var Sequelize=require('sequelize');module[_0xbc9c('0x0')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4d59a0){return this[_0xbc9c('0x1')]('action');}},'action':{'type':Sequelize[_0xbc9c('0x2')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xbc9c('0x3'),_0xbc9c('0x4'),_0xbc9c('0x5'),_0xbc9c('0x6'),'browser',_0xbc9c('0x7'),_0xbc9c('0x8')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0xbc9c('0x9')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0xbc9c('0xa')},'data3':{'type':Sequelize[_0xbc9c('0x2')](0x1000),'comment':_0xbc9c('0xb')},'data4':{'type':Sequelize[_0xbc9c('0x2')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0xbc9c('0x2')](0x1000),'comments':_0xbc9c('0xc')},'data6':{'type':Sequelize[_0xbc9c('0x2')],'comments':_0xbc9c('0xd')},'data7':{'type':Sequelize[_0xbc9c('0xe')],'comments':_0xbc9c('0xf')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index f3cbc75..683d73d 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 _0x739f=['body','Action','find','params','destroy','catch','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','undefined','count','offset','limit','Content-Range','apply','save','update','then','sendStatus','error','stack','name','send'];(function(_0x3679bd,_0x44f12){var _0x1d0ed0=function(_0xafdb4a){while(--_0xafdb4a){_0x3679bd['push'](_0x3679bd['shift']());}};_0x1d0ed0(++_0x44f12);}(_0x739f,0x120));var _0xf739=function(_0x150768,_0x2d1aff){_0x150768=_0x150768-0x0;var _0xfed081=_0x739f[_0x150768];return _0xfed081;};'use strict';var emlformat=require(_0xf739('0x0'));var rimraf=require(_0xf739('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf739('0x2'));var rp=require(_0xf739('0x3'));var moment=require(_0xf739('0x4'));var BPromise=require(_0xf739('0x5'));var Mustache=require('mustache');var util=require(_0xf739('0x6'));var path=require('path');var sox=require(_0xf739('0x7'));var csv=require(_0xf739('0x8'));var ejs=require(_0xf739('0x9'));var fs=require('fs');var fs_extra=require(_0xf739('0xa'));var _=require(_0xf739('0xb'));var squel=require(_0xf739('0xc'));var crypto=require(_0xf739('0xd'));var jsforce=require(_0xf739('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf739('0xf'));var Papa=require('papaparse');var Redis=require(_0xf739('0x10'));var authService=require(_0xf739('0x11'));var qs=require(_0xf739('0x12'));var as=require(_0xf739('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf739('0x14'))(_0xf739('0x15'));var utils=require(_0xf739('0x16'));var config=require(_0xf739('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xf739('0x18'))['db'];function respondWithStatusCode(_0x16af1d,_0x287b7c){_0x287b7c=_0x287b7c||0xcc;return function(_0x4ea912){if(_0x4ea912){return _0x16af1d['sendStatus'](_0x287b7c);}return _0x16af1d[_0xf739('0x19')](_0x287b7c)['end']();};}function respondWithResult(_0x135d18,_0x1f691f){_0x1f691f=_0x1f691f||0xc8;return function(_0x49a0bd){if(_0x49a0bd){return _0x135d18[_0xf739('0x19')](_0x1f691f)[_0xf739('0x1a')](_0x49a0bd);}};}function respondWithFilteredResult(_0x4d55ca,_0x2601e3){return function(_0x3789a3){if(_0x3789a3){var _0x2936a5=typeof _0x2601e3['offset']===_0xf739('0x1b')&&typeof _0x2601e3['limit']===_0xf739('0x1b');var _0x83ddae=_0x3789a3[_0xf739('0x1c')];var _0x39199c=_0x2936a5?0x0:_0x2601e3[_0xf739('0x1d')];var _0x4be4ed=_0x2936a5?_0x3789a3[_0xf739('0x1c')]:_0x2601e3[_0xf739('0x1d')]+_0x2601e3[_0xf739('0x1e')];var _0x3e863a;if(_0x4be4ed>=_0x83ddae){_0x4be4ed=_0x83ddae;_0x3e863a=0xc8;}else{_0x3e863a=0xce;}_0x4d55ca[_0xf739('0x19')](_0x3e863a);return _0x4d55ca['set'](_0xf739('0x1f'),_0x39199c+'-'+_0x4be4ed+'/'+_0x83ddae)['json'](_0x3789a3);}return null;};}function patchUpdates(_0x2c622f){return function(_0x5b05aa){try{jsonpatch[_0xf739('0x20')](_0x5b05aa,_0x2c622f,!![]);}catch(_0x1ad349){return BPromise['reject'](_0x1ad349);}return _0x5b05aa[_0xf739('0x21')]();};}function saveUpdates(_0x5b7f10,_0x1bab69){return function(_0x564f85){if(_0x564f85){return _0x564f85[_0xf739('0x22')](_0x5b7f10)['then'](function(_0x2c528f){return _0x2c528f;});}return null;};}function removeEntity(_0x34f7a6,_0x5eaf47){return function(_0x15dc5a){if(_0x15dc5a){return _0x15dc5a['destroy']()[_0xf739('0x23')](function(){_0x34f7a6[_0xf739('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x355370,_0xea2ec3){return function(_0x31e2a1){if(!_0x31e2a1){_0x355370[_0xf739('0x24')](0x194);}return _0x31e2a1;};}function handleError(_0x3c53fc,_0x3b7c2d){_0x3b7c2d=_0x3b7c2d||0x1f4;return function(_0x3146bc){logger[_0xf739('0x25')](_0x3146bc[_0xf739('0x26')]);if(_0x3146bc[_0xf739('0x27')]){delete _0x3146bc[_0xf739('0x27')];}_0x3c53fc[_0xf739('0x19')](_0x3b7c2d)[_0xf739('0x28')](_0x3146bc);};}exports[_0xf739('0x22')]=function(_0x318b87,_0x163c45){if(_0x318b87['body']['id']){delete _0x318b87[_0xf739('0x29')]['id'];}return db[_0xf739('0x2a')][_0xf739('0x2b')]({'where':{'id':_0x318b87[_0xf739('0x2c')]['id']}})['then'](handleEntityNotFound(_0x163c45,null))[_0xf739('0x23')](saveUpdates(_0x318b87[_0xf739('0x29')],null))[_0xf739('0x23')](respondWithResult(_0x163c45,null))['catch'](handleError(_0x163c45,null));};exports[_0xf739('0x2d')]=function(_0x48cf56,_0x1d02c8){return db[_0xf739('0x2a')][_0xf739('0x2b')]({'where':{'id':_0x48cf56[_0xf739('0x2c')]['id']}})[_0xf739('0x23')](handleEntityNotFound(_0x1d02c8,null))[_0xf739('0x23')](removeEntity(_0x1d02c8,null))[_0xf739('0x2e')](handleError(_0x1d02c8,null));};
\ No newline at end of file
+var _0x4e24=['then','destroy','sendStatus','error','stack','name','body','Action','params','catch','find','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','limit','apply','reject','save','update'];(function(_0x5c7730,_0x39ef25){var _0x3b06ad=function(_0x2c7fb1){while(--_0x2c7fb1){_0x5c7730['push'](_0x5c7730['shift']());}};_0x3b06ad(++_0x39ef25);}(_0x4e24,0x119));var _0x44e2=function(_0x38ca87,_0xc5e59f){_0x38ca87=_0x38ca87-0x0;var _0x1d254e=_0x4e24[_0x38ca87];return _0x1d254e;};'use strict';var emlformat=require(_0x44e2('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x44e2('0x1'));var jsonpatch=require(_0x44e2('0x2'));var rp=require(_0x44e2('0x3'));var moment=require(_0x44e2('0x4'));var BPromise=require(_0x44e2('0x5'));var Mustache=require('mustache');var util=require(_0x44e2('0x6'));var path=require(_0x44e2('0x7'));var sox=require(_0x44e2('0x8'));var csv=require(_0x44e2('0x9'));var ejs=require(_0x44e2('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x44e2('0xb'));var squel=require(_0x44e2('0xc'));var crypto=require(_0x44e2('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x44e2('0xe'));var toCsv=require(_0x44e2('0x9'));var querystring=require(_0x44e2('0xf'));var Papa=require(_0x44e2('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x44e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44e2('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x44e2('0x13'));var config=require(_0x44e2('0x14'));var licenseUtil=require(_0x44e2('0x15'));var db=require(_0x44e2('0x16'))['db'];function respondWithStatusCode(_0x399633,_0xc60d73){_0xc60d73=_0xc60d73||0xcc;return function(_0x11a95e){if(_0x11a95e){return _0x399633['sendStatus'](_0xc60d73);}return _0x399633[_0x44e2('0x17')](_0xc60d73)[_0x44e2('0x18')]();};}function respondWithResult(_0x2e77c4,_0x39261e){_0x39261e=_0x39261e||0xc8;return function(_0x42cade){if(_0x42cade){return _0x2e77c4[_0x44e2('0x17')](_0x39261e)[_0x44e2('0x19')](_0x42cade);}};}function respondWithFilteredResult(_0x24bca8,_0x38adf3){return function(_0x212d68){if(_0x212d68){var _0x404d57=typeof _0x38adf3[_0x44e2('0x1a')]===_0x44e2('0x1b')&&typeof _0x38adf3['limit']===_0x44e2('0x1b');var _0x3c4116=_0x212d68[_0x44e2('0x1c')];var _0x2de878=_0x404d57?0x0:_0x38adf3[_0x44e2('0x1a')];var _0x6a2d0c=_0x404d57?_0x212d68[_0x44e2('0x1c')]:_0x38adf3[_0x44e2('0x1a')]+_0x38adf3[_0x44e2('0x1d')];var _0x2525c1;if(_0x6a2d0c>=_0x3c4116){_0x6a2d0c=_0x3c4116;_0x2525c1=0xc8;}else{_0x2525c1=0xce;}_0x24bca8['status'](_0x2525c1);return _0x24bca8['set']('Content-Range',_0x2de878+'-'+_0x6a2d0c+'/'+_0x3c4116)[_0x44e2('0x19')](_0x212d68);}return null;};}function patchUpdates(_0x52b791){return function(_0x432f51){try{jsonpatch[_0x44e2('0x1e')](_0x432f51,_0x52b791,!![]);}catch(_0x4a60ec){return BPromise[_0x44e2('0x1f')](_0x4a60ec);}return _0x432f51[_0x44e2('0x20')]();};}function saveUpdates(_0x4d9762,_0x3f2810){return function(_0x946515){if(_0x946515){return _0x946515[_0x44e2('0x21')](_0x4d9762)[_0x44e2('0x22')](function(_0x485dee){return _0x485dee;});}return null;};}function removeEntity(_0x178c59,_0x59071f){return function(_0xf762c3){if(_0xf762c3){return _0xf762c3[_0x44e2('0x23')]()[_0x44e2('0x22')](function(){_0x178c59[_0x44e2('0x17')](0xcc)[_0x44e2('0x18')]();});}};}function handleEntityNotFound(_0x36f845,_0x4328a6){return function(_0x1ffd9d){if(!_0x1ffd9d){_0x36f845[_0x44e2('0x24')](0x194);}return _0x1ffd9d;};}function handleError(_0x536744,_0x253fd9){_0x253fd9=_0x253fd9||0x1f4;return function(_0x577f4f){logger[_0x44e2('0x25')](_0x577f4f[_0x44e2('0x26')]);if(_0x577f4f[_0x44e2('0x27')]){delete _0x577f4f[_0x44e2('0x27')];}_0x536744[_0x44e2('0x17')](_0x253fd9)['send'](_0x577f4f);};}exports['update']=function(_0x4f0875,_0xaed27){if(_0x4f0875[_0x44e2('0x28')]['id']){delete _0x4f0875[_0x44e2('0x28')]['id'];}return db[_0x44e2('0x29')]['find']({'where':{'id':_0x4f0875[_0x44e2('0x2a')]['id']}})[_0x44e2('0x22')](handleEntityNotFound(_0xaed27,null))[_0x44e2('0x22')](saveUpdates(_0x4f0875[_0x44e2('0x28')],null))[_0x44e2('0x22')](respondWithResult(_0xaed27,null))[_0x44e2('0x2b')](handleError(_0xaed27,null));};exports[_0x44e2('0x23')]=function(_0x5c84ba,_0x2bed80){return db[_0x44e2('0x29')][_0x44e2('0x2c')]({'where':{'id':_0x5c84ba[_0x44e2('0x2a')]['id']}})[_0x44e2('0x22')](handleEntityNotFound(_0x2bed80,null))['then'](removeEntity(_0x2bed80,null))[_0x44e2('0x2b')](handleError(_0x2bed80,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index ff63f42..c274030 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 _0xab06=['bluebird','request-promise','rimraf','../../config/environment','./action.attributes','exports','Action','tools_actions','lodash','util','../../config/logger','api','moment'];(function(_0x16f5d5,_0x184bb0){var _0x1b9f8c=function(_0x224d6d){while(--_0x224d6d){_0x16f5d5['push'](_0x16f5d5['shift']());}};_0x1b9f8c(++_0x184bb0);}(_0xab06,0xe5));var _0x6ab0=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xab06[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x6ab0('0x0'));var util=require(_0x6ab0('0x1'));var logger=require(_0x6ab0('0x2'))(_0x6ab0('0x3'));var moment=require(_0x6ab0('0x4'));var BPromise=require(_0x6ab0('0x5'));var rp=require(_0x6ab0('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6ab0('0x7'));var config=require(_0x6ab0('0x8'));var attributes=require(_0x6ab0('0x9'));module[_0x6ab0('0xa')]=function(_0x20f900,_0x2afae6){return _0x20f900['define'](_0x6ab0('0xb'),attributes,{'tableName':_0x6ab0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4333=['define','Action','tools_actions','util','../../config/logger','moment','path','exports'];(function(_0x2bc19d,_0x35474a){var _0xd745b2=function(_0x1508a6){while(--_0x1508a6){_0x2bc19d['push'](_0x2bc19d['shift']());}};_0xd745b2(++_0x35474a);}(_0x4333,0x1eb));var _0x3433=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0x4333[_0x1b6186];return _0x186121;};'use strict';var _=require('lodash');var util=require(_0x3433('0x0'));var logger=require(_0x3433('0x1'))('api');var moment=require(_0x3433('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3433('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./action.attributes');module[_0x3433('0x4')]=function(_0x439188,_0x583276){return _0x439188[_0x3433('0x5')](_0x3433('0x6'),attributes,{'tableName':_0x3433('0x7'),'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 469cb9b..f796a40 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 _0x7a54=['info','Action,\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(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7a54,0x106));var _0x47a5=function(_0x34b1da,_0x4ce1d8){_0x34b1da=_0x34b1da-0x0;var _0x136f6c=_0x7a54[_0x34b1da];return _0x136f6c;};'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')]('Action,\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
+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(_0x155a6c,_0x48b201){var _0x6497d=function(_0x11a6c9){while(--_0x11a6c9){_0x155a6c['push'](_0x155a6c['shift']());}};_0x6497d(++_0x48b201);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x1928c9,_0x13a6d1){_0x1928c9=_0x1928c9-0x0;var _0x51b5fb=_0xc4aa[_0x1928c9];return _0x51b5fb;};'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
diff --git a/server/api/action/index.js b/server/api/action/index.js
index d29baf5..18dd2fb 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 _0x9db5=['/:id','isAuthenticated','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put'];(function(_0x4afe3b,_0x255e0d){var _0x2c22d1=function(_0x313847){while(--_0x313847){_0x4afe3b['push'](_0x4afe3b['shift']());}};_0x2c22d1(++_0x255e0d);}(_0x9db5,0x1e4));var _0x59db=function(_0x584693,_0x5464c2){_0x584693=_0x584693-0x0;var _0x5e28cd=_0x9db5[_0x584693];return _0x5e28cd;};'use strict';var multer=require(_0x59db('0x0'));var util=require(_0x59db('0x1'));var path=require(_0x59db('0x2'));var timeout=require(_0x59db('0x3'));var express=require(_0x59db('0x4'));var router=express[_0x59db('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x59db('0x6'));var interaction=require(_0x59db('0x7'));var config=require(_0x59db('0x8'));var controller=require(_0x59db('0x9'));router[_0x59db('0xa')](_0x59db('0xb'),auth[_0x59db('0xc')](),controller['update']);router[_0x59db('0xd')](_0x59db('0xb'),auth[_0x59db('0xc')](),controller['destroy']);module[_0x59db('0xe')]=router;
\ No newline at end of file
+var _0x57ad=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./action.controller','put','isAuthenticated','delete','/:id','destroy','exports','multer'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x57ad,0x1cf));var _0xd57a=function(_0x41b66e,_0x103310){_0x41b66e=_0x41b66e-0x0;var _0x390cfa=_0x57ad[_0x41b66e];return _0x390cfa;};'use strict';var multer=require(_0xd57a('0x0'));var util=require(_0xd57a('0x1'));var path=require(_0xd57a('0x2'));var timeout=require(_0xd57a('0x3'));var express=require(_0xd57a('0x4'));var router=express[_0xd57a('0x5')]();var fs_extra=require(_0xd57a('0x6'));var auth=require(_0xd57a('0x7'));var interaction=require(_0xd57a('0x8'));var config=require('../../config/environment');var controller=require(_0xd57a('0x9'));router[_0xd57a('0xa')]('/:id',auth[_0xd57a('0xb')](),controller['update']);router[_0xd57a('0xc')](_0xd57a('0xd'),auth[_0xd57a('0xb')](),controller[_0xd57a('0xe')]);module[_0xd57a('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 0886085..a8b62c7 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 _0x1883=['exports','STRING','TEXT','sequelize'];(function(_0x5c396c,_0x3b75c3){var _0x514f6c=function(_0x368b1a){while(--_0x368b1a){_0x5c396c['push'](_0x5c396c['shift']());}};_0x514f6c(++_0x3b75c3);}(_0x1883,0xab));var _0x3188=function(_0x2bb3a8,_0x3d3f2e){_0x2bb3a8=_0x2bb3a8-0x0;var _0x3fe3f4=_0x1883[_0x2bb3a8];return _0x3fe3f4;};'use strict';var Sequelize=require(_0x3188('0x0'));module[_0x3188('0x1')]={'name':{'type':Sequelize[_0x3188('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3188('0x2')]},'parent':{'type':Sequelize[_0x3188('0x2')]},'table':{'type':Sequelize[_0x3188('0x2')]},'conditions':{'type':Sequelize[_0x3188('0x3')]},'joins':{'type':Sequelize[_0x3188('0x3')]}};
\ No newline at end of file
+var _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x5de38f,_0x386782){var _0x19b8ff=function(_0x2a9a84){while(--_0x2a9a84){_0x5de38f['push'](_0x5de38f['shift']());}};_0x19b8ff(++_0x386782);}(_0xabce,0x103));var _0xeabc=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xabce[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'name':{'type':Sequelize[_0xeabc('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeabc('0x2')]},'parent':{'type':Sequelize[_0xeabc('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0xeabc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 9754d6b..5ae5b42 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 _0x6c0d=['dbH','sendStatus','status','json','offset','undefined','limit','set','apply','reject','save','update','then','get','CustomReports','UserProfileResource','end','error','name','send','map','AnalyticCustomReport','type','key','model','keys','query','filters','intersection','fields','attributes','nolimit','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','show','params','rawAttributes','length','includeAll','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','destroy','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','function','replace','format','groupBy','orderBy','order','joins','includes','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','parse','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','GROUP_CONCAT(%s)','IS\x20NULL','value','DESC','alias','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','custom','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','COUNT(*)','runReport','DATE(%s)','metric','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/license/util','../../mysqldb'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6c0d,0x132));var _0xd6c0=function(_0x5eb6d6,_0x2839a0){_0x5eb6d6=_0x5eb6d6-0x0;var _0x588167=_0x6c0d[_0x5eb6d6];return _0x588167;};'use strict';var emlformat=require(_0xd6c0('0x0'));var rimraf=require(_0xd6c0('0x1'));var zipdir=require(_0xd6c0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd6c0('0x3'));var moment=require(_0xd6c0('0x4'));var BPromise=require(_0xd6c0('0x5'));var Mustache=require('mustache');var util=require(_0xd6c0('0x6'));var path=require(_0xd6c0('0x7'));var sox=require(_0xd6c0('0x8'));var csv=require('to-csv');var ejs=require(_0xd6c0('0x9'));var fs=require('fs');var fs_extra=require(_0xd6c0('0xa'));var _=require(_0xd6c0('0xb'));var squel=require(_0xd6c0('0xc'));var crypto=require(_0xd6c0('0xd'));var jsforce=require(_0xd6c0('0xe'));var deskjs=require(_0xd6c0('0xf'));var toCsv=require(_0xd6c0('0x10'));var querystring=require(_0xd6c0('0x11'));var Papa=require(_0xd6c0('0x12'));var Redis=require('ioredis');var authService=require(_0xd6c0('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6c0('0x14'));var logger=require('../../config/logger')(_0xd6c0('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0xd6c0('0x16'));var db=require(_0xd6c0('0x17'))['db'];var dbH=require(_0xd6c0('0x17'))[_0xd6c0('0x18')];function respondWithStatusCode(_0x40658a,_0x588141){_0x588141=_0x588141||0xcc;return function(_0x3483a3){if(_0x3483a3){return _0x40658a[_0xd6c0('0x19')](_0x588141);}return _0x40658a[_0xd6c0('0x1a')](_0x588141)['end']();};}function respondWithResult(_0x179274,_0x56ff84){_0x56ff84=_0x56ff84||0xc8;return function(_0x5a19f0){if(_0x5a19f0){return _0x179274[_0xd6c0('0x1a')](_0x56ff84)[_0xd6c0('0x1b')](_0x5a19f0);}};}function respondWithFilteredResult(_0x3539c9,_0xe8122){return function(_0x4f4870){if(_0x4f4870){var _0x4e5afe=typeof _0xe8122[_0xd6c0('0x1c')]===_0xd6c0('0x1d')&&typeof _0xe8122[_0xd6c0('0x1e')]===_0xd6c0('0x1d');var _0x151d07=_0x4f4870['count'];var _0x3d4157=_0x4e5afe?0x0:_0xe8122[_0xd6c0('0x1c')];var _0x59dc7f=_0x4e5afe?_0x4f4870['count']:_0xe8122[_0xd6c0('0x1c')]+_0xe8122['limit'];var _0x4c3da8;if(_0x59dc7f>=_0x151d07){_0x59dc7f=_0x151d07;_0x4c3da8=0xc8;}else{_0x4c3da8=0xce;}_0x3539c9[_0xd6c0('0x1a')](_0x4c3da8);return _0x3539c9[_0xd6c0('0x1f')]('Content-Range',_0x3d4157+'-'+_0x59dc7f+'/'+_0x151d07)['json'](_0x4f4870);}return null;};}function patchUpdates(_0x286821){return function(_0xf5159d){try{jsonpatch[_0xd6c0('0x20')](_0xf5159d,_0x286821,!![]);}catch(_0x5928de){return BPromise[_0xd6c0('0x21')](_0x5928de);}return _0xf5159d[_0xd6c0('0x22')]();};}function saveUpdates(_0x459c33,_0x3e7ce8){return function(_0x2bab46){if(_0x2bab46){return _0x2bab46[_0xd6c0('0x23')](_0x459c33)[_0xd6c0('0x24')](function(_0x4fa905){return _0x4fa905;});}return null;};}function removeEntity(_0x2cc6c1,_0x49ebc8){return function(_0xf97d4c){if(_0xf97d4c){return _0xf97d4c['destroy']()[_0xd6c0('0x24')](function(){var _0x3e66f2=_0xf97d4c[_0xd6c0('0x25')]({'plain':!![]});var _0x4ac378=_0xd6c0('0x26');return db[_0xd6c0('0x27')]['destroy']({'where':{'type':_0x4ac378,'resourceId':_0x3e66f2['id']}})[_0xd6c0('0x24')](function(){return _0xf97d4c;});})['then'](function(){_0x2cc6c1[_0xd6c0('0x1a')](0xcc)[_0xd6c0('0x28')]();});}};}function handleEntityNotFound(_0x1d6563,_0x310d9f){return function(_0xede467){if(!_0xede467){_0x1d6563[_0xd6c0('0x19')](0x194);}return _0xede467;};}function handleError(_0x5516b7,_0x27b5de){_0x27b5de=_0x27b5de||0x1f4;return function(_0x5a7627){logger[_0xd6c0('0x29')](_0x5a7627['stack']);if(_0x5a7627[_0xd6c0('0x2a')]){delete _0x5a7627['name'];}_0x5516b7['status'](_0x27b5de)[_0xd6c0('0x2b')](_0x5a7627);};}exports['index']=function(_0x1ff7e2,_0x34ada0){var _0x13b092={},_0x3e9edf={},_0x14b86d={'count':0x0,'rows':[]};var _0x45447e=_[_0xd6c0('0x2c')](db[_0xd6c0('0x2d')]['rawAttributes'],function(_0x4ae7c9){return{'name':_0x4ae7c9['fieldName'],'type':_0x4ae7c9[_0xd6c0('0x2e')][_0xd6c0('0x2f')]};});_0x3e9edf[_0xd6c0('0x30')]=_['map'](_0x45447e,_0xd6c0('0x2a'));_0x3e9edf['query']=_[_0xd6c0('0x31')](_0x1ff7e2[_0xd6c0('0x32')]);_0x3e9edf[_0xd6c0('0x33')]=_[_0xd6c0('0x34')](_0x3e9edf[_0xd6c0('0x30')],_0x3e9edf['query']);_0x13b092['attributes']=_[_0xd6c0('0x34')](_0x3e9edf['model'],qs['fields'](_0x1ff7e2[_0xd6c0('0x32')][_0xd6c0('0x35')]));_0x13b092[_0xd6c0('0x36')]=_0x13b092[_0xd6c0('0x36')]['length']?_0x13b092[_0xd6c0('0x36')]:_0x3e9edf[_0xd6c0('0x30')];if(!_0x1ff7e2['query']['hasOwnProperty'](_0xd6c0('0x37'))){_0x13b092[_0xd6c0('0x1e')]=qs[_0xd6c0('0x1e')](_0x1ff7e2[_0xd6c0('0x32')]['limit']);_0x13b092[_0xd6c0('0x1c')]=qs['offset'](_0x1ff7e2['query'][_0xd6c0('0x1c')]);}_0x13b092['order']=qs['sort'](_0x1ff7e2['query']['sort']);_0x13b092[_0xd6c0('0x38')]=qs['filters'](_[_0xd6c0('0x39')](_0x1ff7e2['query'],_0x3e9edf[_0xd6c0('0x33')]),_0x45447e);if(_0x1ff7e2['query'][_0xd6c0('0x3a')]){_0x13b092[_0xd6c0('0x38')]=_[_0xd6c0('0x3b')](_0x13b092[_0xd6c0('0x38')],{'$or':_[_0xd6c0('0x2c')](_0x45447e,function(_0x5eaf1e){if(_0x5eaf1e[_0xd6c0('0x2e')]!==_0xd6c0('0x3c')){var _0x5e622a={};_0x5e622a[_0x5eaf1e[_0xd6c0('0x2a')]]={'$like':'%'+_0x1ff7e2['query'][_0xd6c0('0x3a')]+'%'};return _0x5e622a;}})});}_0x13b092=_[_0xd6c0('0x3b')]({},_0x13b092,_0x1ff7e2[_0xd6c0('0x3d')]);var _0x2e4abc={'where':_0x13b092['where']};return db[_0xd6c0('0x2d')][_0xd6c0('0x3e')](_0x2e4abc)['then'](function(_0xfe9c36){_0x14b86d[_0xd6c0('0x3e')]=_0xfe9c36;if(_0x1ff7e2['query']['includeAll']){_0x13b092[_0xd6c0('0x3f')]=[{'all':!![]}];}return db[_0xd6c0('0x2d')][_0xd6c0('0x40')](_0x13b092);})[_0xd6c0('0x24')](function(_0x57043e){_0x14b86d['rows']=_0x57043e;return _0x14b86d;})[_0xd6c0('0x24')](respondWithFilteredResult(_0x34ada0,_0x13b092))['catch'](handleError(_0x34ada0,null));};exports[_0xd6c0('0x41')]=function(_0x6a6a55,_0x32528c){var _0x1662a0={'raw':![],'where':{'id':_0x6a6a55[_0xd6c0('0x42')]['id']}},_0x402e08={};_0x402e08[_0xd6c0('0x30')]=_[_0xd6c0('0x31')](db[_0xd6c0('0x2d')][_0xd6c0('0x43')]);_0x402e08[_0xd6c0('0x32')]=_['keys'](_0x6a6a55[_0xd6c0('0x32')]);_0x402e08['filters']=_[_0xd6c0('0x34')](_0x402e08[_0xd6c0('0x30')],_0x402e08['query']);_0x1662a0[_0xd6c0('0x36')]=_[_0xd6c0('0x34')](_0x402e08[_0xd6c0('0x30')],qs[_0xd6c0('0x35')](_0x6a6a55[_0xd6c0('0x32')][_0xd6c0('0x35')]));_0x1662a0[_0xd6c0('0x36')]=_0x1662a0[_0xd6c0('0x36')][_0xd6c0('0x44')]?_0x1662a0[_0xd6c0('0x36')]:_0x402e08['model'];if(_0x6a6a55[_0xd6c0('0x32')][_0xd6c0('0x45')]){_0x1662a0['include']=[{'all':!![]}];}_0x1662a0=_[_0xd6c0('0x3b')]({},_0x1662a0,_0x6a6a55[_0xd6c0('0x3d')]);return db[_0xd6c0('0x2d')][_0xd6c0('0x46')](_0x1662a0)[_0xd6c0('0x24')](handleEntityNotFound(_0x32528c,null))['then'](respondWithResult(_0x32528c,null))[_0xd6c0('0x47')](handleError(_0x32528c,null));};exports[_0xd6c0('0x48')]=function(_0x54c5e3,_0x131e56){return db['AnalyticCustomReport'][_0xd6c0('0x48')](_0x54c5e3[_0xd6c0('0x49')],{})['then'](function(_0x34c550){var _0x5b341a=_0x54c5e3[_0xd6c0('0x4a')][_0xd6c0('0x25')]({'plain':!![]});if(!_0x5b341a)throw new Error(_0xd6c0('0x4b'));if(_0x5b341a[_0xd6c0('0x4c')]===_0xd6c0('0x4a')){var _0x1f3ba4=_0x34c550[_0xd6c0('0x25')]({'plain':!![]});var _0x3b6fa8='Reports';return db[_0xd6c0('0x4d')][_0xd6c0('0x46')]({'where':{'name':_0x3b6fa8,'userProfileId':_0x5b341a[_0xd6c0('0x4e')]},'raw':!![]})[_0xd6c0('0x24')](function(_0x214b6f){if(_0x214b6f&&_0x214b6f['autoAssociation']===0x0){return db[_0xd6c0('0x27')][_0xd6c0('0x48')]({'name':_0x1f3ba4['name'],'resourceId':_0x1f3ba4['id'],'type':'CustomReports','sectionId':_0x214b6f['id']},{})[_0xd6c0('0x24')](function(){return _0x34c550;});}else{return _0x34c550;}})[_0xd6c0('0x47')](function(_0x223e21){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x223e21);throw _0x223e21;});}return _0x34c550;})[_0xd6c0('0x24')](respondWithResult(_0x131e56,0xc9))['catch'](handleError(_0x131e56,null));};exports[_0xd6c0('0x23')]=function(_0x3678f9,_0x49d710){if(_0x3678f9['body']['id']){delete _0x3678f9['body']['id'];}return db[_0xd6c0('0x2d')][_0xd6c0('0x46')]({'where':{'id':_0x3678f9[_0xd6c0('0x42')]['id']}})[_0xd6c0('0x24')](handleEntityNotFound(_0x49d710,null))[_0xd6c0('0x24')](saveUpdates(_0x3678f9['body'],null))['then'](respondWithResult(_0x49d710,null))[_0xd6c0('0x47')](handleError(_0x49d710,null));};exports[_0xd6c0('0x4f')]=function(_0x591b53,_0x4238de){return db[_0xd6c0('0x2d')][_0xd6c0('0x46')]({'where':{'id':_0x591b53['params']['id']}})[_0xd6c0('0x24')](handleEntityNotFound(_0x4238de,null))['then'](removeEntity(_0x4238de,null))[_0xd6c0('0x47')](handleError(_0x4238de,null));};exports[_0xd6c0('0x50')]=function(_0x498ce6,_0x1098a0){var _0x505703=0xa;var _0x29f404=[_0xd6c0('0x51'),_0xd6c0('0x52'),_0xd6c0('0x53'),_0xd6c0('0x54')];var _0x5cec3b={'SUM':_0xd6c0('0x55'),'COUNT':_0xd6c0('0x56'),'COUNT DISTINCT':_0xd6c0('0x57'),'MAX':_0xd6c0('0x58'),'MIN':_0xd6c0('0x59'),'AVG':_0xd6c0('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd6c0('0x5b'),'GROUP_CONCAT DESC':_0xd6c0('0x5c')};var _0x6de914={'SEC_TO_TIME':_0xd6c0('0x5d'),'DATE':'DATE(%s)','HOUR':_0xd6c0('0x5e'),'ROUND':_0xd6c0('0x5f'),'UNIX_TIMESTAMP':_0xd6c0('0x60')};var _0x411ed7=function(_0x472f69){return!_['includes'](['IS\x20NULL',_0xd6c0('0x61'),_0xd6c0('0x62'),_0xd6c0('0x63')],_0x472f69);};var _0x36f732=function(_0x44f925){if(!_0x44f925||!_0x44f925[_0xd6c0('0x64')]['length']){return'';}for(var _0x1c4b99='(',_0x44abf7=0x0;_0x44abf7<_0x44f925[_0xd6c0('0x64')][_0xd6c0('0x44')];_0x44abf7+=0x1){_0x44abf7>0x0&&(_0x1c4b99+='\x20'+_0x44f925[_0xd6c0('0x65')]+'\x20');_0x1c4b99+=_0x44f925[_0xd6c0('0x64')][_0x44abf7][_0xd6c0('0x66')]?_0x36f732(_0x44f925['rules'][_0x44abf7]['group']):_0x44f925[_0xd6c0('0x64')][_0x44abf7][_0xd6c0('0x67')]+'\x20'+_0x44f925[_0xd6c0('0x64')][_0x44abf7][_0xd6c0('0x68')]+(_0x411ed7(_0x44f925[_0xd6c0('0x64')][_0x44abf7][_0xd6c0('0x68')])?'\x20'+_0x44f925[_0xd6c0('0x64')][_0x44abf7]['value']:'');}return _0x1c4b99+')';};var _0x476029={'where':{'id':_0x498ce6[_0xd6c0('0x42')]['id']}},_0x534e89,_0x1f535c,_0x31e22c,_0x32008e,_0x843577;_0x476029=_[_0xd6c0('0x3b')]({},_0x476029,_0x498ce6[_0xd6c0('0x3d')]);return db[_0xd6c0('0x2d')][_0xd6c0('0x46')](_0x476029)[_0xd6c0('0x24')](function(_0xdb60ec){if(_0xdb60ec){_0x534e89=_0xdb60ec;return _0xdb60ec[_0xd6c0('0x69')]();}return null;})['then'](function(_0x195c3a){if(_0x195c3a){if(!_0x195c3a[_0xd6c0('0x44')]){throw new db[(_0xd6c0('0x6a'))][(_0xd6c0('0x6b'))](_0xd6c0('0x6c'),0x193);}_0x1f535c=_0x195c3a;return db[_0xd6c0('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xd6c0('0x24')](function(_0x4edf53){if(_0x4edf53){_0x31e22c=_[_0xd6c0('0x6e')](_0x4edf53,'id');var _0x1ae949;var _0x289123=squel[_0xd6c0('0x6f')]();_0x289123[_0xd6c0('0x70')](_0x534e89[_0xd6c0('0x71')]);for(var _0x544b23=0x0;_0x544b23<_0x1f535c[_0xd6c0('0x44')];_0x544b23+=0x1){_0x1ae949=_0x1f535c[_0x544b23][_0xd6c0('0x72')]?_0x31e22c[_0x1f535c[_0x544b23]['MetricId']]['metric']:_0x1f535c[_0x544b23][_0xd6c0('0x67')];_0x1ae949=_0x1f535c[_0x544b23][_0xd6c0('0x73')]?_[_0xd6c0('0x74')](_0x5cec3b[_0x1f535c[_0x544b23][_0xd6c0('0x73')]],'%s',_0x1ae949):_0x1ae949;_0x1ae949=_0x1f535c[_0x544b23][_0xd6c0('0x75')]?_[_0xd6c0('0x74')](_0x6de914[_0x1f535c[_0x544b23][_0xd6c0('0x75')]],'%s',_0x1ae949):_0x1ae949;if(_0x1f535c[_0x544b23][_0xd6c0('0x76')]){_0x289123[_0xd6c0('0x66')](_0x1ae949);}_0x1f535c[_0x544b23][_0xd6c0('0x77')]&&_0x289123[_0xd6c0('0x78')](_0x1ae949,_0x1f535c[_0x544b23]['orderBy']==='DESC'?![]:!![]);_0x289123[_0xd6c0('0x67')](_0x1ae949,_0x1f535c[_0x544b23]['alias']||_0x1ae949);}if(_0x534e89[_0xd6c0('0x79')]){_0x534e89[_0xd6c0('0x79')]=JSON['parse'](_0x534e89[_0xd6c0('0x79')]);for(var _0x1a8d4f=0x0;_0x1a8d4f<_0x534e89[_0xd6c0('0x79')]['length'];_0x1a8d4f+=0x1){if(_0x534e89[_0xd6c0('0x79')][_0x1a8d4f][_0xd6c0('0x2e')]&&_[_0xd6c0('0x7a')](_0x29f404,_0x534e89[_0xd6c0('0x79')][_0x1a8d4f][_0xd6c0('0x2e')])&&_0x534e89['joins'][_0x1a8d4f][_0xd6c0('0x7b')]&&_0x534e89['joins'][_0x1a8d4f][_0xd6c0('0x7c')]&&_0x534e89[_0xd6c0('0x79')][_0x1a8d4f]['foreignKey']){_0x289123[_0x534e89[_0xd6c0('0x79')][_0x1a8d4f]['type']](_0x534e89[_0xd6c0('0x79')][_0x1a8d4f]['foreignTable'],null,util['format'](_0xd6c0('0x7d'),_0x534e89['table'],_0x534e89['joins'][_0x1a8d4f][_0xd6c0('0x7b')],_0x534e89[_0xd6c0('0x79')][_0x1a8d4f][_0xd6c0('0x7c')],_0x534e89['joins'][_0x1a8d4f][_0xd6c0('0x7e')]));}}}if(_0x534e89['conditions']){_0x534e89[_0xd6c0('0x7f')]=JSON[_0xd6c0('0x80')](_0x534e89['conditions']);_0x289123[_0xd6c0('0x38')](_0x36f732(_0x534e89[_0xd6c0('0x7f')][_0xd6c0('0x66')]));}_0x843577=_0x289123[_0xd6c0('0x81')]();_0x289123[_0xd6c0('0x1e')](_0x505703);_0x289123[_0xd6c0('0x1c')](0x0);logger[_0xd6c0('0x82')](_0xd6c0('0x83'),_0x289123[_0xd6c0('0x84')]());return dbH[_0xd6c0('0x85')][_0xd6c0('0x32')](_0x289123['toString'](),{'type':dbH[_0xd6c0('0x85')][_0xd6c0('0x86')][_0xd6c0('0x87')]});}})[_0xd6c0('0x24')](respondWithResult(_0x1098a0,null))[_0xd6c0('0x47')](handleError(_0x1098a0,null));};function runReport(_0x338ddb,_0x53dca2,_0x482480){var _0x553a2d=_0x53dca2[_0xd6c0('0x2a')];var _0x16afbb=0xa;var _0x2b1b7d=[_0xd6c0('0x51'),_0xd6c0('0x52'),_0xd6c0('0x53'),_0xd6c0('0x54')];var _0x52b3ac={'SUM':_0xd6c0('0x55'),'COUNT':_0xd6c0('0x56'),'COUNT DISTINCT':_0xd6c0('0x57'),'MAX':_0xd6c0('0x58'),'MIN':_0xd6c0('0x59'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xd6c0('0x88'),'GROUP_CONCAT ASC':_0xd6c0('0x5b'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x28cca5={'SEC_TO_TIME':_0xd6c0('0x5d'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xd6c0('0x5f'),'UNIX_TIMESTAMP':_0xd6c0('0x60')};var _0x48d850=function(_0x17a723){return!_[_0xd6c0('0x7a')]([_0xd6c0('0x89'),_0xd6c0('0x61'),'IS\x20EMPTY',_0xd6c0('0x63')],_0x17a723);};var _0x2aa196=function(_0x334df0){if(!_0x334df0||!_0x334df0[_0xd6c0('0x64')]['length']){return'';}for(var _0x356e59='(',_0x433495=0x0;_0x433495<_0x334df0[_0xd6c0('0x64')][_0xd6c0('0x44')];_0x433495+=0x1){_0x433495>0x0&&(_0x356e59+='\x20'+_0x334df0['operator']+'\x20');_0x356e59+=_0x334df0[_0xd6c0('0x64')][_0x433495]['group']?_0x2aa196(_0x334df0[_0xd6c0('0x64')][_0x433495][_0xd6c0('0x66')]):_0x334df0[_0xd6c0('0x64')][_0x433495][_0xd6c0('0x67')]+'\x20'+_0x334df0[_0xd6c0('0x64')][_0x433495][_0xd6c0('0x68')]+(_0x48d850(_0x334df0[_0xd6c0('0x64')][_0x433495][_0xd6c0('0x68')])?'\x20'+_0x334df0[_0xd6c0('0x64')][_0x433495][_0xd6c0('0x8a')]:'');}return _0x356e59+')';};var _0x510e9d={'where':{'id':_0x338ddb['id']}},_0x3e8ab7,_0xca6637,_0x5ac4e5,_0x1b31fc,_0x5a3e9e;_0x510e9d=_[_0xd6c0('0x3b')]({},_0x510e9d,_0x482480);return db[_0xd6c0('0x2d')]['find'](_0x510e9d)[_0xd6c0('0x24')](function(_0x32b486){if(_0x32b486){_0x3e8ab7=_0x32b486;return _0x32b486[_0xd6c0('0x69')]();}return null;})['then'](function(_0xf8018b){if(_0xf8018b){if(!_0xf8018b[_0xd6c0('0x44')]){throw new db[(_0xd6c0('0x6a'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xca6637=_0xf8018b;return db[_0xd6c0('0x6d')][_0xd6c0('0x40')]({'raw':!![]});}return null;})[_0xd6c0('0x24')](function(_0xea5743){if(_0xea5743){_0x5ac4e5=_['keyBy'](_0xea5743,'id');var _0x229b67;var _0x3d44ae=squel[_0xd6c0('0x6f')]();_0x3d44ae[_0xd6c0('0x70')](_0x3e8ab7[_0xd6c0('0x71')]);for(var _0x4455ca=0x0;_0x4455ca<_0xca6637[_0xd6c0('0x44')];_0x4455ca+=0x1){_0x229b67=_0xca6637[_0x4455ca][_0xd6c0('0x72')]?_0x5ac4e5[_0xca6637[_0x4455ca][_0xd6c0('0x72')]]['metric']:_0xca6637[_0x4455ca][_0xd6c0('0x67')];_0x229b67=_0xca6637[_0x4455ca][_0xd6c0('0x73')]?_[_0xd6c0('0x74')](_0x52b3ac[_0xca6637[_0x4455ca][_0xd6c0('0x73')]],'%s',_0x229b67):_0x229b67;_0x229b67=_0xca6637[_0x4455ca][_0xd6c0('0x75')]?_[_0xd6c0('0x74')](_0x28cca5[_0xca6637[_0x4455ca]['format']],'%s',_0x229b67):_0x229b67;if(_0xca6637[_0x4455ca][_0xd6c0('0x76')]){_0x3d44ae[_0xd6c0('0x66')](_0x229b67);}_0xca6637[_0x4455ca][_0xd6c0('0x77')]&&_0x3d44ae[_0xd6c0('0x78')](_0x229b67,_0xca6637[_0x4455ca]['orderBy']===_0xd6c0('0x8b')?![]:!![]);_0x3d44ae['field'](_0x229b67,_0xca6637[_0x4455ca][_0xd6c0('0x8c')]||_0x229b67);}if(_0x3e8ab7['joins']){_0x3e8ab7[_0xd6c0('0x79')]=JSON['parse'](_0x3e8ab7[_0xd6c0('0x79')]);for(var _0xa8c5b=0x0;_0xa8c5b<_0x3e8ab7[_0xd6c0('0x79')][_0xd6c0('0x44')];_0xa8c5b+=0x1){if(_0x3e8ab7['joins'][_0xa8c5b][_0xd6c0('0x2e')]&&_[_0xd6c0('0x7a')](_0x2b1b7d,_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b]['type'])&&_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b][_0xd6c0('0x7b')]&&_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b][_0xd6c0('0x7c')]&&_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b][_0xd6c0('0x7e')]){_0x3d44ae[_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b]['type']](_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b][_0xd6c0('0x7c')],null,util[_0xd6c0('0x75')](_0xd6c0('0x7d'),_0x3e8ab7[_0xd6c0('0x71')],_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b][_0xd6c0('0x7b')],_0x3e8ab7['joins'][_0xa8c5b][_0xd6c0('0x7c')],_0x3e8ab7[_0xd6c0('0x79')][_0xa8c5b]['foreignKey']));}}}if(_0x3e8ab7[_0xd6c0('0x7f')]){_0x3e8ab7[_0xd6c0('0x7f')]=JSON['parse'](_0x3e8ab7['conditions']);_0x3d44ae['where'](_0x2aa196(_0x3e8ab7[_0xd6c0('0x7f')][_0xd6c0('0x66')]));}_0x5a3e9e=_0x3d44ae['clone']();_0x3d44ae[_0xd6c0('0x1e')](_0x16afbb);_0x3d44ae[_0xd6c0('0x1c')](0x0);return;}})[_0xd6c0('0x24')](function(){if(_0x53dca2[_0xd6c0('0x8d')]===_0xd6c0('0x8e')){return null;}var _0x4854dc=_[_0xd6c0('0x3b')](_0x53dca2,{'name':_0x53dca2[_0xd6c0('0x8f')]||_0x53dca2[_0xd6c0('0x2a')]||_0x3e8ab7[_0xd6c0('0x2a')],'basename':_0x553a2d,'savename':util['format'](_0xd6c0('0x90'),_0x53dca2[_0xd6c0('0x2a')]||_0x3e8ab7['name'],require(_0xd6c0('0x91'))[_0xd6c0('0x92')](0x4),_0x53dca2['output']||_0xd6c0('0x93')),'reportId':_0x3e8ab7['id'],'reportType':_0xd6c0('0x94')});return db['AnalyticExtractedReport'][_0xd6c0('0x48')](_0x4854dc,{'raw':!![]});})[_0xd6c0('0x24')](function(_0x58b017){if(_0x3e8ab7['table']===_0xd6c0('0x95')){_0x5a3e9e[_0xd6c0('0x38')](_0x3e8ab7['table']+_0xd6c0('0x96'),_0x53dca2[_0xd6c0('0x97')],_0x53dca2[_0xd6c0('0x98')]);}else{_0x5a3e9e[_0xd6c0('0x38')](_0x3e8ab7[_0xd6c0('0x71')]+_0xd6c0('0x99'),_0x53dca2['startDate'],_0x53dca2[_0xd6c0('0x98')]);}if(_0x58b017){logger[_0xd6c0('0x9a')](_0xd6c0('0x9b'),_0x5a3e9e['toString']());require(_0xd6c0('0x9c'))[_0xd6c0('0x9d')](path[_0xd6c0('0x51')](__dirname,_0xd6c0('0x9e'),_0x58b017[_0xd6c0('0x8d')]),[_0x58b017['id'],_0x5a3e9e['toString'](),path[_0xd6c0('0x51')](__dirname,_0xd6c0('0x9f'),_0x58b017[_0xd6c0('0xa0')]),_0x553a2d]);return _0x58b017;}else{var _0x144198=squel[_0xd6c0('0x6f')]();_0x144198['from']('('+_0x5a3e9e[_0xd6c0('0x84')]()+')','countTable');_0x144198[_0xd6c0('0x67')](_0xd6c0('0xa1'),_0xd6c0('0x3e'));_0x5a3e9e['limit'](_0x53dca2['limit']||_0x16afbb);_0x5a3e9e[_0xd6c0('0x1c')](_0x53dca2[_0xd6c0('0x1c')]||0x0);return dbH[_0xd6c0('0x85')][_0xd6c0('0x32')](_0x144198['toString'](),{'type':dbH[_0xd6c0('0x85')][_0xd6c0('0x86')][_0xd6c0('0x87')]})[_0xd6c0('0x24')](function(_0x50fbfc){if(!_0x50fbfc['length']){_0x1b31fc=0x0;}else{_0x1b31fc=_0x50fbfc[0x0][_0xd6c0('0x3e')]||0x0;}return dbH[_0xd6c0('0x85')]['query'](_0x5a3e9e[_0xd6c0('0x84')](),{'type':dbH[_0xd6c0('0x85')][_0xd6c0('0x86')]['SELECT']});})[_0xd6c0('0x24')](function(_0x3cb3d7){return{'rows':_0x3cb3d7||[],'count':_0x1b31fc};});}});}exports['run']=function(_0x584735,_0x3ae0e1){return runReport(_0x584735[_0xd6c0('0x42')],_0x584735[_0xd6c0('0x32')],_0x584735['options'])[_0xd6c0('0x24')](respondWithResult(_0x3ae0e1,null))['catch'](handleError(_0x3ae0e1,null));};exports[_0xd6c0('0xa2')]=runReport;exports['query']=function(_0x3ea24a,_0x12ac9c){var _0xf22810=0xa;var _0x500cc5=[_0xd6c0('0x51'),_0xd6c0('0x52'),_0xd6c0('0x53'),_0xd6c0('0x54')];var _0x5aa210={'SUM':_0xd6c0('0x55'),'COUNT':_0xd6c0('0x56'),'COUNT DISTINCT':_0xd6c0('0x57'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xd6c0('0x5a'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xd6c0('0x5b'),'GROUP_CONCAT DESC':_0xd6c0('0x5c')};var _0x253b81={'SEC_TO_TIME':_0xd6c0('0x5d'),'DATE':_0xd6c0('0xa3'),'HOUR':_0xd6c0('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xd6c0('0x60')};var _0x302827=function(_0x2edf03){return!_[_0xd6c0('0x7a')](['IS\x20NULL',_0xd6c0('0x61'),'IS\x20EMPTY',_0xd6c0('0x63')],_0x2edf03);};var _0x5e9f76=function(_0x400402){if(!_0x400402||!_0x400402['rules'][_0xd6c0('0x44')]){return'';}for(var _0xee779b='(',_0x224e55=0x0;_0x224e55<_0x400402[_0xd6c0('0x64')][_0xd6c0('0x44')];_0x224e55+=0x1){_0x224e55>0x0&&(_0xee779b+='\x20'+_0x400402[_0xd6c0('0x65')]+'\x20');_0xee779b+=_0x400402[_0xd6c0('0x64')][_0x224e55][_0xd6c0('0x66')]?_0x5e9f76(_0x400402[_0xd6c0('0x64')][_0x224e55]['group']):_0x400402['rules'][_0x224e55]['field']+'\x20'+_0x400402[_0xd6c0('0x64')][_0x224e55][_0xd6c0('0x68')]+(_0x302827(_0x400402[_0xd6c0('0x64')][_0x224e55][_0xd6c0('0x68')])?'\x20'+_0x400402[_0xd6c0('0x64')][_0x224e55][_0xd6c0('0x8a')]:'');}return _0xee779b+')';};var _0x156956={'where':{'id':_0x3ea24a[_0xd6c0('0x42')]['id']}},_0xe3d9c2,_0x282dda,_0x3192ab,_0x49ad70,_0x453263;_0x156956=_[_0xd6c0('0x3b')]({},_0x156956,_0x3ea24a[_0xd6c0('0x3d')]);return db[_0xd6c0('0x2d')][_0xd6c0('0x46')](_0x156956)[_0xd6c0('0x24')](function(_0x288243){if(_0x288243){_0xe3d9c2=_0x288243;return _0x288243[_0xd6c0('0x69')]();}return null;})['then'](function(_0x315b3a){if(_0x315b3a){if(!_0x315b3a['length']){throw new db[(_0xd6c0('0x6a'))][(_0xd6c0('0x6b'))](_0xd6c0('0x6c'),0x193);}_0x282dda=_0x315b3a;return db[_0xd6c0('0x6d')]['findAll']({'raw':!![]});}return null;})[_0xd6c0('0x24')](function(_0x44be1f){if(_0x44be1f){_0x3192ab=_['keyBy'](_0x44be1f,'id');var _0x565089;var _0x3c0bef=squel[_0xd6c0('0x6f')]();_0x3c0bef[_0xd6c0('0x70')](_0xe3d9c2['table']);for(var _0x4aebf4=0x0;_0x4aebf4<_0x282dda[_0xd6c0('0x44')];_0x4aebf4+=0x1){_0x565089=_0x282dda[_0x4aebf4][_0xd6c0('0x72')]?_0x3192ab[_0x282dda[_0x4aebf4][_0xd6c0('0x72')]][_0xd6c0('0xa4')]:_0x282dda[_0x4aebf4][_0xd6c0('0x67')];_0x565089=_0x282dda[_0x4aebf4][_0xd6c0('0x73')]?_['replace'](_0x5aa210[_0x282dda[_0x4aebf4][_0xd6c0('0x73')]],'%s',_0x565089):_0x565089;_0x565089=_0x282dda[_0x4aebf4][_0xd6c0('0x75')]?_[_0xd6c0('0x74')](_0x253b81[_0x282dda[_0x4aebf4][_0xd6c0('0x75')]],'%s',_0x565089):_0x565089;if(_0x282dda[_0x4aebf4][_0xd6c0('0x76')]){_0x3c0bef[_0xd6c0('0x66')](_0x565089);}_0x282dda[_0x4aebf4][_0xd6c0('0x77')]&&_0x3c0bef[_0xd6c0('0x78')](_0x565089,_0x282dda[_0x4aebf4][_0xd6c0('0x77')]===_0xd6c0('0x8b')?![]:!![]);_0x3c0bef['field'](_0x565089,_0x282dda[_0x4aebf4][_0xd6c0('0x8c')]||_0x565089);}if(_0xe3d9c2[_0xd6c0('0x79')]){_0xe3d9c2[_0xd6c0('0x79')]=JSON[_0xd6c0('0x80')](_0xe3d9c2['joins']);for(var _0x52449e=0x0;_0x52449e<_0xe3d9c2[_0xd6c0('0x79')]['length'];_0x52449e+=0x1){if(_0xe3d9c2[_0xd6c0('0x79')][_0x52449e][_0xd6c0('0x2e')]&&_['includes'](_0x500cc5,_0xe3d9c2[_0xd6c0('0x79')][_0x52449e][_0xd6c0('0x2e')])&&_0xe3d9c2[_0xd6c0('0x79')][_0x52449e][_0xd6c0('0x7b')]&&_0xe3d9c2[_0xd6c0('0x79')][_0x52449e][_0xd6c0('0x7c')]&&_0xe3d9c2[_0xd6c0('0x79')][_0x52449e]['foreignKey']){_0x3c0bef[_0xe3d9c2[_0xd6c0('0x79')][_0x52449e][_0xd6c0('0x2e')]](_0xe3d9c2[_0xd6c0('0x79')][_0x52449e][_0xd6c0('0x7c')],null,util[_0xd6c0('0x75')]('%s.%s\x20=\x20%s.%s',_0xe3d9c2['table'],_0xe3d9c2[_0xd6c0('0x79')][_0x52449e]['parentKey'],_0xe3d9c2[_0xd6c0('0x79')][_0x52449e]['foreignTable'],_0xe3d9c2[_0xd6c0('0x79')][_0x52449e]['foreignKey']));}}}if(_0xe3d9c2[_0xd6c0('0x7f')]){_0xe3d9c2[_0xd6c0('0x7f')]=JSON[_0xd6c0('0x80')](_0xe3d9c2['conditions']);_0x3c0bef['where'](_0x5e9f76(_0xe3d9c2[_0xd6c0('0x7f')][_0xd6c0('0x66')]));}_0x453263=_0x3c0bef[_0xd6c0('0x81')]();_0x3c0bef[_0xd6c0('0x1e')](_0xf22810);_0x3c0bef['offset'](0x0);logger['debug'](_0xd6c0('0x83'),_0x3c0bef[_0xd6c0('0x84')]());return dbH['sequelize'][_0xd6c0('0x32')](_0x3c0bef[_0xd6c0('0x84')](),{'type':dbH[_0xd6c0('0x85')][_0xd6c0('0x86')]['SELECT']});}})[_0xd6c0('0x24')](function(){return{'sql':_0x453263['toString']()};})[_0xd6c0('0x24')](respondWithResult(_0x12ac9c,null))[_0xd6c0('0x47')](handleError(_0x12ac9c,null));};
\ No newline at end of file
+var _0x4965=['GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','ValidationErrorItem','AnalyticMetric','MetricId','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','QueryTypes','runReport','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','to-csv','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','dbH','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','sendStatus','error','stack','index','map','AnalyticCustomReport','fieldName','type','key','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','pick','where','merge','filter','include','findAll','rows','catch','show','params','rawAttributes','length','includeAll','find','create','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','options','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','Limited\x20Query:','toString','sequelize','SELECT','left_join'];(function(_0x4e8b4c,_0x170953){var _0x198b19=function(_0x23ff10){while(--_0x23ff10){_0x4e8b4c['push'](_0x4e8b4c['shift']());}};_0x198b19(++_0x170953);}(_0x4965,0x16e));var _0x5496=function(_0x6c79a9,_0x3218e7){_0x6c79a9=_0x6c79a9-0x0;var _0x1f80a9=_0x4965[_0x6c79a9];return _0x1f80a9;};'use strict';var emlformat=require(_0x5496('0x0'));var rimraf=require(_0x5496('0x1'));var zipdir=require(_0x5496('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5496('0x3'));var Mustache=require('mustache');var util=require(_0x5496('0x4'));var path=require(_0x5496('0x5'));var sox=require(_0x5496('0x6'));var csv=require('to-csv');var ejs=require(_0x5496('0x7'));var fs=require('fs');var fs_extra=require(_0x5496('0x8'));var _=require(_0x5496('0x9'));var squel=require(_0x5496('0xa'));var crypto=require('crypto');var jsforce=require(_0x5496('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x5496('0xc'));var querystring=require(_0x5496('0xd'));var Papa=require(_0x5496('0xe'));var Redis=require('ioredis');var authService=require(_0x5496('0xf'));var qs=require(_0x5496('0x10'));var as=require(_0x5496('0x11'));var hardwareService=require(_0x5496('0x12'));var logger=require(_0x5496('0x13'))(_0x5496('0x14'));var utils=require(_0x5496('0x15'));var config=require(_0x5496('0x16'));var licenseUtil=require(_0x5496('0x17'));var db=require(_0x5496('0x18'))['db'];var dbH=require(_0x5496('0x18'))[_0x5496('0x19')];function respondWithStatusCode(_0x39f846,_0x45c7fb){_0x45c7fb=_0x45c7fb||0xcc;return function(_0x30104e){if(_0x30104e){return _0x39f846['sendStatus'](_0x45c7fb);}return _0x39f846[_0x5496('0x1a')](_0x45c7fb)[_0x5496('0x1b')]();};}function respondWithResult(_0x27072e,_0x35520e){_0x35520e=_0x35520e||0xc8;return function(_0x20814f){if(_0x20814f){return _0x27072e[_0x5496('0x1a')](_0x35520e)[_0x5496('0x1c')](_0x20814f);}};}function respondWithFilteredResult(_0x2f746c,_0x4c7317){return function(_0x4bf295){if(_0x4bf295){var _0x1a5deb=typeof _0x4c7317[_0x5496('0x1d')]===_0x5496('0x1e')&&typeof _0x4c7317[_0x5496('0x1f')]===_0x5496('0x1e');var _0x3496fb=_0x4bf295[_0x5496('0x20')];var _0x38a8c3=_0x1a5deb?0x0:_0x4c7317[_0x5496('0x1d')];var _0x512872=_0x1a5deb?_0x4bf295['count']:_0x4c7317[_0x5496('0x1d')]+_0x4c7317[_0x5496('0x1f')];var _0x10599a;if(_0x512872>=_0x3496fb){_0x512872=_0x3496fb;_0x10599a=0xc8;}else{_0x10599a=0xce;}_0x2f746c[_0x5496('0x1a')](_0x10599a);return _0x2f746c['set'](_0x5496('0x21'),_0x38a8c3+'-'+_0x512872+'/'+_0x3496fb)[_0x5496('0x1c')](_0x4bf295);}return null;};}function patchUpdates(_0x58b5a2){return function(_0x4650db){try{jsonpatch[_0x5496('0x22')](_0x4650db,_0x58b5a2,!![]);}catch(_0x3624ee){return BPromise[_0x5496('0x23')](_0x3624ee);}return _0x4650db[_0x5496('0x24')]();};}function saveUpdates(_0x408716,_0x25a988){return function(_0x1fb22a){if(_0x1fb22a){return _0x1fb22a[_0x5496('0x25')](_0x408716)[_0x5496('0x26')](function(_0x394551){return _0x394551;});}return null;};}function removeEntity(_0x1ab3ca,_0x385134){return function(_0x48367e){if(_0x48367e){return _0x48367e[_0x5496('0x27')]()['then'](function(){var _0x482324=_0x48367e['get']({'plain':!![]});var _0xc6e98b=_0x5496('0x28');return db[_0x5496('0x29')][_0x5496('0x27')]({'where':{'type':_0xc6e98b,'resourceId':_0x482324['id']}})[_0x5496('0x26')](function(){return _0x48367e;});})[_0x5496('0x26')](function(){_0x1ab3ca[_0x5496('0x1a')](0xcc)[_0x5496('0x1b')]();});}};}function handleEntityNotFound(_0x100123,_0x2c7a37){return function(_0x542fb2){if(!_0x542fb2){_0x100123[_0x5496('0x2a')](0x194);}return _0x542fb2;};}function handleError(_0x28d7d5,_0x519bd7){_0x519bd7=_0x519bd7||0x1f4;return function(_0x802f78){logger[_0x5496('0x2b')](_0x802f78[_0x5496('0x2c')]);if(_0x802f78['name']){delete _0x802f78['name'];}_0x28d7d5['status'](_0x519bd7)['send'](_0x802f78);};}exports[_0x5496('0x2d')]=function(_0x36a421,_0x33ae26){var _0x37b1f0={},_0x87702b={},_0x3cf590={'count':0x0,'rows':[]};var _0x59811c=_[_0x5496('0x2e')](db[_0x5496('0x2f')]['rawAttributes'],function(_0x2c6514){return{'name':_0x2c6514[_0x5496('0x30')],'type':_0x2c6514[_0x5496('0x31')][_0x5496('0x32')]};});_0x87702b['model']=_['map'](_0x59811c,_0x5496('0x33'));_0x87702b[_0x5496('0x34')]=_[_0x5496('0x35')](_0x36a421[_0x5496('0x34')]);_0x87702b[_0x5496('0x36')]=_[_0x5496('0x37')](_0x87702b[_0x5496('0x38')],_0x87702b['query']);_0x37b1f0['attributes']=_[_0x5496('0x37')](_0x87702b['model'],qs[_0x5496('0x39')](_0x36a421[_0x5496('0x34')][_0x5496('0x39')]));_0x37b1f0[_0x5496('0x3a')]=_0x37b1f0[_0x5496('0x3a')]['length']?_0x37b1f0[_0x5496('0x3a')]:_0x87702b['model'];if(!_0x36a421[_0x5496('0x34')][_0x5496('0x3b')]('nolimit')){_0x37b1f0[_0x5496('0x1f')]=qs[_0x5496('0x1f')](_0x36a421['query'][_0x5496('0x1f')]);_0x37b1f0[_0x5496('0x1d')]=qs[_0x5496('0x1d')](_0x36a421[_0x5496('0x34')]['offset']);}_0x37b1f0['order']=qs['sort'](_0x36a421[_0x5496('0x34')]['sort']);_0x37b1f0['where']=qs[_0x5496('0x36')](_[_0x5496('0x3c')](_0x36a421['query'],_0x87702b[_0x5496('0x36')]),_0x59811c);if(_0x36a421[_0x5496('0x34')]['filter']){_0x37b1f0[_0x5496('0x3d')]=_[_0x5496('0x3e')](_0x37b1f0[_0x5496('0x3d')],{'$or':_[_0x5496('0x2e')](_0x59811c,function(_0x1af21b){if(_0x1af21b['type']!=='VIRTUAL'){var _0x40da58={};_0x40da58[_0x1af21b[_0x5496('0x33')]]={'$like':'%'+_0x36a421['query'][_0x5496('0x3f')]+'%'};return _0x40da58;}})});}_0x37b1f0=_[_0x5496('0x3e')]({},_0x37b1f0,_0x36a421['options']);var _0x348f69={'where':_0x37b1f0[_0x5496('0x3d')]};return db[_0x5496('0x2f')][_0x5496('0x20')](_0x348f69)[_0x5496('0x26')](function(_0x2d98b1){_0x3cf590[_0x5496('0x20')]=_0x2d98b1;if(_0x36a421['query']['includeAll']){_0x37b1f0[_0x5496('0x40')]=[{'all':!![]}];}return db[_0x5496('0x2f')][_0x5496('0x41')](_0x37b1f0);})[_0x5496('0x26')](function(_0x325efb){_0x3cf590[_0x5496('0x42')]=_0x325efb;return _0x3cf590;})[_0x5496('0x26')](respondWithFilteredResult(_0x33ae26,_0x37b1f0))[_0x5496('0x43')](handleError(_0x33ae26,null));};exports[_0x5496('0x44')]=function(_0x29b57a,_0x1fa3f4){var _0x59f3dc={'raw':![],'where':{'id':_0x29b57a[_0x5496('0x45')]['id']}},_0x2fb3e9={};_0x2fb3e9[_0x5496('0x38')]=_[_0x5496('0x35')](db[_0x5496('0x2f')][_0x5496('0x46')]);_0x2fb3e9[_0x5496('0x34')]=_['keys'](_0x29b57a['query']);_0x2fb3e9[_0x5496('0x36')]=_[_0x5496('0x37')](_0x2fb3e9[_0x5496('0x38')],_0x2fb3e9[_0x5496('0x34')]);_0x59f3dc['attributes']=_[_0x5496('0x37')](_0x2fb3e9[_0x5496('0x38')],qs[_0x5496('0x39')](_0x29b57a['query'][_0x5496('0x39')]));_0x59f3dc[_0x5496('0x3a')]=_0x59f3dc[_0x5496('0x3a')][_0x5496('0x47')]?_0x59f3dc[_0x5496('0x3a')]:_0x2fb3e9[_0x5496('0x38')];if(_0x29b57a[_0x5496('0x34')][_0x5496('0x48')]){_0x59f3dc[_0x5496('0x40')]=[{'all':!![]}];}_0x59f3dc=_[_0x5496('0x3e')]({},_0x59f3dc,_0x29b57a['options']);return db[_0x5496('0x2f')][_0x5496('0x49')](_0x59f3dc)[_0x5496('0x26')](handleEntityNotFound(_0x1fa3f4,null))[_0x5496('0x26')](respondWithResult(_0x1fa3f4,null))[_0x5496('0x43')](handleError(_0x1fa3f4,null));};exports[_0x5496('0x4a')]=function(_0x15fbde,_0x3ff5fa){return db['AnalyticCustomReport']['create'](_0x15fbde[_0x5496('0x4b')],{})[_0x5496('0x26')](function(_0x2da752){var _0x186907=_0x15fbde['user'][_0x5496('0x4c')]({'plain':!![]});if(!_0x186907)throw new Error(_0x5496('0x4d'));if(_0x186907[_0x5496('0x4e')]===_0x5496('0x4f')){var _0x395e94=_0x2da752[_0x5496('0x4c')]({'plain':!![]});var _0x39e6b4=_0x5496('0x50');return db[_0x5496('0x51')][_0x5496('0x49')]({'where':{'name':_0x39e6b4,'userProfileId':_0x186907[_0x5496('0x52')]},'raw':!![]})[_0x5496('0x26')](function(_0x5df52b){if(_0x5df52b&&_0x5df52b[_0x5496('0x53')]===0x0){return db[_0x5496('0x29')][_0x5496('0x4a')]({'name':_0x395e94[_0x5496('0x33')],'resourceId':_0x395e94['id'],'type':_0x5496('0x28'),'sectionId':_0x5df52b['id']},{})[_0x5496('0x26')](function(){return _0x2da752;});}else{return _0x2da752;}})[_0x5496('0x43')](function(_0x59fb23){logger[_0x5496('0x2b')](_0x5496('0x54'),_0x59fb23);throw _0x59fb23;});}return _0x2da752;})['then'](respondWithResult(_0x3ff5fa,0xc9))[_0x5496('0x43')](handleError(_0x3ff5fa,null));};exports[_0x5496('0x25')]=function(_0x2959f5,_0x346bfe){if(_0x2959f5[_0x5496('0x4b')]['id']){delete _0x2959f5[_0x5496('0x4b')]['id'];}return db[_0x5496('0x2f')][_0x5496('0x49')]({'where':{'id':_0x2959f5[_0x5496('0x45')]['id']}})[_0x5496('0x26')](handleEntityNotFound(_0x346bfe,null))[_0x5496('0x26')](saveUpdates(_0x2959f5[_0x5496('0x4b')],null))[_0x5496('0x26')](respondWithResult(_0x346bfe,null))[_0x5496('0x43')](handleError(_0x346bfe,null));};exports[_0x5496('0x27')]=function(_0x49bb29,_0x4704f7){return db[_0x5496('0x2f')][_0x5496('0x49')]({'where':{'id':_0x49bb29[_0x5496('0x45')]['id']}})['then'](handleEntityNotFound(_0x4704f7,null))['then'](removeEntity(_0x4704f7,null))[_0x5496('0x43')](handleError(_0x4704f7,null));};exports[_0x5496('0x55')]=function(_0x45dc59,_0x2c692c){var _0x241c0b=0xa;var _0x4306b7=[_0x5496('0x56'),'left_join',_0x5496('0x57'),_0x5496('0x58')];var _0x1989e1={'SUM':_0x5496('0x59'),'COUNT':_0x5496('0x5a'),'COUNT DISTINCT':_0x5496('0x5b'),'MAX':_0x5496('0x5c'),'MIN':_0x5496('0x5d'),'AVG':_0x5496('0x5e'),'GROUP_CONCAT':_0x5496('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x5496('0x60')};var _0x3881ed={'SEC_TO_TIME':_0x5496('0x61'),'DATE':_0x5496('0x62'),'HOUR':_0x5496('0x63'),'ROUND':_0x5496('0x64'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x17f5ca=function(_0x22ca99){return!_[_0x5496('0x65')](['IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY',_0x5496('0x66')],_0x22ca99);};var _0x1b5ff8=function(_0x161e06){if(!_0x161e06||!_0x161e06[_0x5496('0x67')][_0x5496('0x47')]){return'';}for(var _0xe49cfa='(',_0x3d3a9c=0x0;_0x3d3a9c<_0x161e06[_0x5496('0x67')]['length'];_0x3d3a9c+=0x1){_0x3d3a9c>0x0&&(_0xe49cfa+='\x20'+_0x161e06[_0x5496('0x68')]+'\x20');_0xe49cfa+=_0x161e06['rules'][_0x3d3a9c]['group']?_0x1b5ff8(_0x161e06[_0x5496('0x67')][_0x3d3a9c][_0x5496('0x69')]):_0x161e06[_0x5496('0x67')][_0x3d3a9c][_0x5496('0x6a')]+'\x20'+_0x161e06[_0x5496('0x67')][_0x3d3a9c]['condition']+(_0x17f5ca(_0x161e06[_0x5496('0x67')][_0x3d3a9c][_0x5496('0x6b')])?'\x20'+_0x161e06['rules'][_0x3d3a9c][_0x5496('0x6c')]:'');}return _0xe49cfa+')';};var _0x28acc0={'where':{'id':_0x45dc59['params']['id']}},_0x903c49,_0xeb293b,_0x3edb57,_0x4060c0,_0x57320c;_0x28acc0=_[_0x5496('0x3e')]({},_0x28acc0,_0x45dc59[_0x5496('0x6d')]);return db['AnalyticCustomReport']['find'](_0x28acc0)[_0x5496('0x26')](function(_0xb72621){if(_0xb72621){_0x903c49=_0xb72621;return _0xb72621[_0x5496('0x6e')]();}return null;})[_0x5496('0x26')](function(_0x7ca846){if(_0x7ca846){if(!_0x7ca846['length']){throw new db[(_0x5496('0x6f'))]['ValidationErrorItem'](_0x5496('0x70'),0x193);}_0xeb293b=_0x7ca846;return db['AnalyticMetric'][_0x5496('0x41')]({'raw':!![]});}return null;})[_0x5496('0x26')](function(_0x159f83){if(_0x159f83){_0x3edb57=_[_0x5496('0x71')](_0x159f83,'id');var _0x4a9f89;var _0x110dbf=squel[_0x5496('0x72')]();_0x110dbf[_0x5496('0x73')](_0x903c49[_0x5496('0x74')]);for(var _0x2ed9f4=0x0;_0x2ed9f4<_0xeb293b['length'];_0x2ed9f4+=0x1){_0x4a9f89=_0xeb293b[_0x2ed9f4]['MetricId']?_0x3edb57[_0xeb293b[_0x2ed9f4]['MetricId']][_0x5496('0x75')]:_0xeb293b[_0x2ed9f4][_0x5496('0x6a')];_0x4a9f89=_0xeb293b[_0x2ed9f4][_0x5496('0x76')]?_[_0x5496('0x77')](_0x1989e1[_0xeb293b[_0x2ed9f4][_0x5496('0x76')]],'%s',_0x4a9f89):_0x4a9f89;_0x4a9f89=_0xeb293b[_0x2ed9f4]['format']?_[_0x5496('0x77')](_0x3881ed[_0xeb293b[_0x2ed9f4][_0x5496('0x78')]],'%s',_0x4a9f89):_0x4a9f89;if(_0xeb293b[_0x2ed9f4][_0x5496('0x79')]){_0x110dbf['group'](_0x4a9f89);}_0xeb293b[_0x2ed9f4]['orderBy']&&_0x110dbf[_0x5496('0x7a')](_0x4a9f89,_0xeb293b[_0x2ed9f4][_0x5496('0x7b')]===_0x5496('0x7c')?![]:!![]);_0x110dbf[_0x5496('0x6a')](_0x4a9f89,_0xeb293b[_0x2ed9f4][_0x5496('0x7d')]||_0x4a9f89);}if(_0x903c49[_0x5496('0x7e')]){_0x903c49['joins']=JSON[_0x5496('0x7f')](_0x903c49['joins']);for(var _0x26b6a3=0x0;_0x26b6a3<_0x903c49[_0x5496('0x7e')][_0x5496('0x47')];_0x26b6a3+=0x1){if(_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x31')]&&_['includes'](_0x4306b7,_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x31')])&&_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x80')]&&_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x81')]&&_0x903c49['joins'][_0x26b6a3][_0x5496('0x82')]){_0x110dbf[_0x903c49['joins'][_0x26b6a3]['type']](_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x81')],null,util[_0x5496('0x78')]('%s.%s\x20=\x20%s.%s',_0x903c49[_0x5496('0x74')],_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x80')],_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x81')],_0x903c49[_0x5496('0x7e')][_0x26b6a3][_0x5496('0x82')]));}}}if(_0x903c49[_0x5496('0x83')]){_0x903c49[_0x5496('0x83')]=JSON[_0x5496('0x7f')](_0x903c49[_0x5496('0x83')]);_0x110dbf['where'](_0x1b5ff8(_0x903c49['conditions']['group']));}_0x57320c=_0x110dbf[_0x5496('0x84')]();_0x110dbf[_0x5496('0x1f')](_0x241c0b);_0x110dbf[_0x5496('0x1d')](0x0);logger['debug'](_0x5496('0x85'),_0x110dbf[_0x5496('0x86')]());return dbH[_0x5496('0x87')][_0x5496('0x34')](_0x110dbf[_0x5496('0x86')](),{'type':dbH[_0x5496('0x87')]['QueryTypes'][_0x5496('0x88')]});}})[_0x5496('0x26')](respondWithResult(_0x2c692c,null))[_0x5496('0x43')](handleError(_0x2c692c,null));};function runReport(_0x26176b,_0x4dfcfe,_0x192751){var _0x367e83=_0x4dfcfe[_0x5496('0x33')];var _0x3fdb18=0xa;var _0x3fed70=[_0x5496('0x56'),_0x5496('0x89'),_0x5496('0x57'),_0x5496('0x58')];var _0x3b9e05={'SUM':_0x5496('0x59'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5496('0x5c'),'MIN':_0x5496('0x5d'),'AVG':_0x5496('0x5e'),'GROUP_CONCAT':_0x5496('0x5f'),'GROUP_CONCAT ASC':_0x5496('0x8a'),'GROUP_CONCAT DESC':_0x5496('0x60')};var _0xecee07={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x5496('0x62'),'HOUR':_0x5496('0x63'),'ROUND':_0x5496('0x64'),'UNIX_TIMESTAMP':_0x5496('0x8b')};var _0x192c51=function(_0x3655fd){return!_[_0x5496('0x65')]([_0x5496('0x8c'),'IS\x20NOT\x20NULL',_0x5496('0x8d'),'IS\x20NOT\x20EMPTY'],_0x3655fd);};var _0x1882d9=function(_0x1de82f){if(!_0x1de82f||!_0x1de82f[_0x5496('0x67')][_0x5496('0x47')]){return'';}for(var _0x5e7d34='(',_0x32982c=0x0;_0x32982c<_0x1de82f[_0x5496('0x67')]['length'];_0x32982c+=0x1){_0x32982c>0x0&&(_0x5e7d34+='\x20'+_0x1de82f[_0x5496('0x68')]+'\x20');_0x5e7d34+=_0x1de82f['rules'][_0x32982c]['group']?_0x1882d9(_0x1de82f['rules'][_0x32982c]['group']):_0x1de82f[_0x5496('0x67')][_0x32982c][_0x5496('0x6a')]+'\x20'+_0x1de82f[_0x5496('0x67')][_0x32982c]['condition']+(_0x192c51(_0x1de82f[_0x5496('0x67')][_0x32982c][_0x5496('0x6b')])?'\x20'+_0x1de82f[_0x5496('0x67')][_0x32982c][_0x5496('0x6c')]:'');}return _0x5e7d34+')';};var _0x485cd0={'where':{'id':_0x26176b['id']}},_0x41545d,_0x141227,_0x22db1e,_0x4f5a7f,_0x33cf9c;_0x485cd0=_[_0x5496('0x3e')]({},_0x485cd0,_0x192751);return db[_0x5496('0x2f')][_0x5496('0x49')](_0x485cd0)[_0x5496('0x26')](function(_0x4bb18d){if(_0x4bb18d){_0x41545d=_0x4bb18d;return _0x4bb18d[_0x5496('0x6e')]();}return null;})[_0x5496('0x26')](function(_0xdc4e74){if(_0xdc4e74){if(!_0xdc4e74[_0x5496('0x47')]){throw new db[(_0x5496('0x6f'))][(_0x5496('0x8e'))](_0x5496('0x70'),0x193);}_0x141227=_0xdc4e74;return db[_0x5496('0x8f')][_0x5496('0x41')]({'raw':!![]});}return null;})['then'](function(_0x5cd353){if(_0x5cd353){_0x22db1e=_[_0x5496('0x71')](_0x5cd353,'id');var _0x5c6b0f;var _0x119933=squel[_0x5496('0x72')]();_0x119933[_0x5496('0x73')](_0x41545d[_0x5496('0x74')]);for(var _0x232481=0x0;_0x232481<_0x141227['length'];_0x232481+=0x1){_0x5c6b0f=_0x141227[_0x232481]['MetricId']?_0x22db1e[_0x141227[_0x232481][_0x5496('0x90')]][_0x5496('0x75')]:_0x141227[_0x232481][_0x5496('0x6a')];_0x5c6b0f=_0x141227[_0x232481]['function']?_['replace'](_0x3b9e05[_0x141227[_0x232481][_0x5496('0x76')]],'%s',_0x5c6b0f):_0x5c6b0f;_0x5c6b0f=_0x141227[_0x232481]['format']?_[_0x5496('0x77')](_0xecee07[_0x141227[_0x232481][_0x5496('0x78')]],'%s',_0x5c6b0f):_0x5c6b0f;if(_0x141227[_0x232481]['groupBy']){_0x119933[_0x5496('0x69')](_0x5c6b0f);}_0x141227[_0x232481][_0x5496('0x7b')]&&_0x119933[_0x5496('0x7a')](_0x5c6b0f,_0x141227[_0x232481]['orderBy']===_0x5496('0x7c')?![]:!![]);_0x119933[_0x5496('0x6a')](_0x5c6b0f,_0x141227[_0x232481]['alias']||_0x5c6b0f);}if(_0x41545d[_0x5496('0x7e')]){_0x41545d[_0x5496('0x7e')]=JSON[_0x5496('0x7f')](_0x41545d[_0x5496('0x7e')]);for(var _0x4ff860=0x0;_0x4ff860<_0x41545d['joins'][_0x5496('0x47')];_0x4ff860+=0x1){if(_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x31')]&&_[_0x5496('0x65')](_0x3fed70,_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x31')])&&_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x80')]&&_0x41545d[_0x5496('0x7e')][_0x4ff860]['foreignTable']&&_0x41545d['joins'][_0x4ff860][_0x5496('0x82')]){_0x119933[_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x31')]](_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x81')],null,util[_0x5496('0x78')](_0x5496('0x91'),_0x41545d[_0x5496('0x74')],_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x80')],_0x41545d[_0x5496('0x7e')][_0x4ff860]['foreignTable'],_0x41545d[_0x5496('0x7e')][_0x4ff860][_0x5496('0x82')]));}}}if(_0x41545d['conditions']){_0x41545d[_0x5496('0x83')]=JSON[_0x5496('0x7f')](_0x41545d[_0x5496('0x83')]);_0x119933['where'](_0x1882d9(_0x41545d['conditions'][_0x5496('0x69')]));}_0x33cf9c=_0x119933[_0x5496('0x84')]();_0x119933['limit'](_0x3fdb18);_0x119933[_0x5496('0x1d')](0x0);return;}})[_0x5496('0x26')](function(){if(_0x4dfcfe[_0x5496('0x92')]===_0x5496('0x93')){return null;}var _0x346f91=_[_0x5496('0x3e')](_0x4dfcfe,{'name':_0x4dfcfe[_0x5496('0x94')]||_0x4dfcfe[_0x5496('0x33')]||_0x41545d[_0x5496('0x33')],'basename':_0x367e83,'savename':util[_0x5496('0x78')](_0x5496('0x95'),_0x4dfcfe[_0x5496('0x33')]||_0x41545d[_0x5496('0x33')],require('randomstring')[_0x5496('0x96')](0x4),_0x4dfcfe[_0x5496('0x92')]||_0x5496('0x97')),'reportId':_0x41545d['id'],'reportType':'custom'});return db[_0x5496('0x98')][_0x5496('0x4a')](_0x346f91,{'raw':!![]});})['then'](function(_0x33891f){if(_0x41545d['table']===_0x5496('0x99')){_0x33cf9c[_0x5496('0x3d')](_0x41545d[_0x5496('0x74')]+_0x5496('0x9a'),_0x4dfcfe[_0x5496('0x9b')],_0x4dfcfe['endDate']);}else{_0x33cf9c[_0x5496('0x3d')](_0x41545d['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4dfcfe[_0x5496('0x9b')],_0x4dfcfe[_0x5496('0x9c')]);}if(_0x33891f){logger[_0x5496('0x9d')]('Run\x20Query:',_0x33cf9c['toString']());require(_0x5496('0x9e'))[_0x5496('0x9f')](path['join'](__dirname,_0x5496('0xa0'),_0x33891f['output']),[_0x33891f['id'],_0x33cf9c[_0x5496('0x86')](),path[_0x5496('0x56')](__dirname,_0x5496('0xa1'),_0x33891f[_0x5496('0xa2')]),_0x367e83]);return _0x33891f;}else{var _0x550544=squel[_0x5496('0x72')]();_0x550544[_0x5496('0x73')]('('+_0x33cf9c['toString']()+')',_0x5496('0xa3'));_0x550544[_0x5496('0x6a')](_0x5496('0xa4'),_0x5496('0x20'));_0x33cf9c[_0x5496('0x1f')](_0x4dfcfe['limit']||_0x3fdb18);_0x33cf9c[_0x5496('0x1d')](_0x4dfcfe[_0x5496('0x1d')]||0x0);return dbH[_0x5496('0x87')]['query'](_0x550544[_0x5496('0x86')](),{'type':dbH[_0x5496('0x87')][_0x5496('0xa5')]['SELECT']})[_0x5496('0x26')](function(_0x12071b){if(!_0x12071b[_0x5496('0x47')]){_0x4f5a7f=0x0;}else{_0x4f5a7f=_0x12071b[0x0][_0x5496('0x20')]||0x0;}return dbH[_0x5496('0x87')][_0x5496('0x34')](_0x33cf9c[_0x5496('0x86')](),{'type':dbH[_0x5496('0x87')]['QueryTypes']['SELECT']});})[_0x5496('0x26')](function(_0xf3016a){return{'rows':_0xf3016a||[],'count':_0x4f5a7f};});}});}exports['run']=function(_0x20f65d,_0x2e0327){return runReport(_0x20f65d['params'],_0x20f65d['query'],_0x20f65d[_0x5496('0x6d')])[_0x5496('0x26')](respondWithResult(_0x2e0327,null))[_0x5496('0x43')](handleError(_0x2e0327,null));};exports[_0x5496('0xa6')]=runReport;exports['query']=function(_0x5ce282,_0x5531da){var _0x56010c=0xa;var _0x4ece2b=[_0x5496('0x56'),_0x5496('0x89'),_0x5496('0x57'),_0x5496('0x58')];var _0x231272={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x5496('0x5b'),'MAX':_0x5496('0x5c'),'MIN':_0x5496('0x5d'),'AVG':_0x5496('0x5e'),'GROUP_CONCAT':_0x5496('0x5f'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x200b34={'SEC_TO_TIME':_0x5496('0x61'),'DATE':_0x5496('0x62'),'HOUR':_0x5496('0x63'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5496('0x8b')};var _0x1c4ed7=function(_0xc50b3d){return!_[_0x5496('0x65')]([_0x5496('0x8c'),_0x5496('0xa7'),_0x5496('0x8d'),_0x5496('0x66')],_0xc50b3d);};var _0x3538ef=function(_0x3020f1){if(!_0x3020f1||!_0x3020f1[_0x5496('0x67')][_0x5496('0x47')]){return'';}for(var _0x3e3bb1='(',_0x518182=0x0;_0x518182<_0x3020f1[_0x5496('0x67')][_0x5496('0x47')];_0x518182+=0x1){_0x518182>0x0&&(_0x3e3bb1+='\x20'+_0x3020f1[_0x5496('0x68')]+'\x20');_0x3e3bb1+=_0x3020f1[_0x5496('0x67')][_0x518182][_0x5496('0x69')]?_0x3538ef(_0x3020f1['rules'][_0x518182][_0x5496('0x69')]):_0x3020f1['rules'][_0x518182][_0x5496('0x6a')]+'\x20'+_0x3020f1[_0x5496('0x67')][_0x518182][_0x5496('0x6b')]+(_0x1c4ed7(_0x3020f1[_0x5496('0x67')][_0x518182]['condition'])?'\x20'+_0x3020f1[_0x5496('0x67')][_0x518182][_0x5496('0x6c')]:'');}return _0x3e3bb1+')';};var _0x405b70={'where':{'id':_0x5ce282[_0x5496('0x45')]['id']}},_0x62feb6,_0xf0f0a8,_0x1a1faf,_0x1481d9,_0x5e4929;_0x405b70=_[_0x5496('0x3e')]({},_0x405b70,_0x5ce282['options']);return db[_0x5496('0x2f')][_0x5496('0x49')](_0x405b70)['then'](function(_0x24b22e){if(_0x24b22e){_0x62feb6=_0x24b22e;return _0x24b22e[_0x5496('0x6e')]();}return null;})[_0x5496('0x26')](function(_0x3e6c1b){if(_0x3e6c1b){if(!_0x3e6c1b['length']){throw new db[(_0x5496('0x6f'))][(_0x5496('0x8e'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xf0f0a8=_0x3e6c1b;return db['AnalyticMetric'][_0x5496('0x41')]({'raw':!![]});}return null;})[_0x5496('0x26')](function(_0x4a8bbc){if(_0x4a8bbc){_0x1a1faf=_['keyBy'](_0x4a8bbc,'id');var _0x116dee;var _0x8caa9=squel[_0x5496('0x72')]();_0x8caa9[_0x5496('0x73')](_0x62feb6['table']);for(var _0x25792f=0x0;_0x25792f<_0xf0f0a8['length'];_0x25792f+=0x1){_0x116dee=_0xf0f0a8[_0x25792f][_0x5496('0x90')]?_0x1a1faf[_0xf0f0a8[_0x25792f][_0x5496('0x90')]]['metric']:_0xf0f0a8[_0x25792f][_0x5496('0x6a')];_0x116dee=_0xf0f0a8[_0x25792f][_0x5496('0x76')]?_[_0x5496('0x77')](_0x231272[_0xf0f0a8[_0x25792f][_0x5496('0x76')]],'%s',_0x116dee):_0x116dee;_0x116dee=_0xf0f0a8[_0x25792f][_0x5496('0x78')]?_[_0x5496('0x77')](_0x200b34[_0xf0f0a8[_0x25792f][_0x5496('0x78')]],'%s',_0x116dee):_0x116dee;if(_0xf0f0a8[_0x25792f][_0x5496('0x79')]){_0x8caa9[_0x5496('0x69')](_0x116dee);}_0xf0f0a8[_0x25792f]['orderBy']&&_0x8caa9[_0x5496('0x7a')](_0x116dee,_0xf0f0a8[_0x25792f][_0x5496('0x7b')]==='DESC'?![]:!![]);_0x8caa9[_0x5496('0x6a')](_0x116dee,_0xf0f0a8[_0x25792f][_0x5496('0x7d')]||_0x116dee);}if(_0x62feb6['joins']){_0x62feb6[_0x5496('0x7e')]=JSON['parse'](_0x62feb6[_0x5496('0x7e')]);for(var _0x5375c8=0x0;_0x5375c8<_0x62feb6[_0x5496('0x7e')][_0x5496('0x47')];_0x5375c8+=0x1){if(_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x31')]&&_[_0x5496('0x65')](_0x4ece2b,_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x31')])&&_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x80')]&&_0x62feb6['joins'][_0x5375c8][_0x5496('0x81')]&&_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x82')]){_0x8caa9[_0x62feb6[_0x5496('0x7e')][_0x5375c8]['type']](_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x81')],null,util['format'](_0x5496('0x91'),_0x62feb6[_0x5496('0x74')],_0x62feb6[_0x5496('0x7e')][_0x5375c8]['parentKey'],_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x81')],_0x62feb6[_0x5496('0x7e')][_0x5375c8][_0x5496('0x82')]));}}}if(_0x62feb6[_0x5496('0x83')]){_0x62feb6[_0x5496('0x83')]=JSON[_0x5496('0x7f')](_0x62feb6[_0x5496('0x83')]);_0x8caa9[_0x5496('0x3d')](_0x3538ef(_0x62feb6[_0x5496('0x83')][_0x5496('0x69')]));}_0x5e4929=_0x8caa9[_0x5496('0x84')]();_0x8caa9[_0x5496('0x1f')](_0x56010c);_0x8caa9[_0x5496('0x1d')](0x0);logger['debug']('Limited\x20Query:',_0x8caa9[_0x5496('0x86')]());return dbH[_0x5496('0x87')][_0x5496('0x34')](_0x8caa9[_0x5496('0x86')](),{'type':dbH['sequelize'][_0x5496('0xa5')]['SELECT']});}})[_0x5496('0x26')](function(){return{'sql':_0x5e4929[_0x5496('0x86')]()};})[_0x5496('0x26')](respondWithResult(_0x5531da,null))[_0x5496('0x43')](handleError(_0x5531da,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index 210aecb..799d8e6 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 _0x739a=['exports','define','analytics_custom_reports','util','../../config/logger','api','moment','bluebird','path','./analyticCustomReport.attributes'];(function(_0x49fb2d,_0x34b0ca){var _0x29996c=function(_0x36fcf5){while(--_0x36fcf5){_0x49fb2d['push'](_0x49fb2d['shift']());}};_0x29996c(++_0x34b0ca);}(_0x739a,0xe9));var _0xa739=function(_0x14e393,_0x5ef7b3){_0x14e393=_0x14e393-0x0;var _0x5b5ffa=_0x739a[_0x14e393];return _0x5b5ffa;};'use strict';var _=require('lodash');var util=require(_0xa739('0x0'));var logger=require(_0xa739('0x1'))(_0xa739('0x2'));var moment=require(_0xa739('0x3'));var BPromise=require(_0xa739('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa739('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa739('0x6'));module[_0xa739('0x7')]=function(_0x522db8,_0xcde1f5){return _0x522db8[_0xa739('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xa739('0x9'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4703=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','analytics_custom_reports','lodash'];(function(_0x4f7269,_0x33cbc1){var _0xc6b419=function(_0x1b3dfe){while(--_0x1b3dfe){_0x4f7269['push'](_0x4f7269['shift']());}};_0xc6b419(++_0x33cbc1);}(_0x4703,0x13a));var _0x3470=function(_0x23200d,_0x15fb6e){_0x23200d=_0x23200d-0x0;var _0x3f8381=_0x4703[_0x23200d];return _0x3f8381;};'use strict';var _=require(_0x3470('0x0'));var util=require(_0x3470('0x1'));var logger=require(_0x3470('0x2'))('api');var moment=require('moment');var BPromise=require(_0x3470('0x3'));var rp=require(_0x3470('0x4'));var fs=require('fs');var path=require(_0x3470('0x5'));var rimraf=require(_0x3470('0x6'));var config=require(_0x3470('0x7'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x461e9c,_0x1f995c){return _0x461e9c['define']('AnalyticCustomReport',attributes,{'tableName':_0x3470('0x8'),'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 6a9d18d..6790c98 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 _0x8d88=['stringify','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s'];(function(_0x26d70d,_0x1c9224){var _0x43d4e3=function(_0x130b27){while(--_0x130b27){_0x26d70d['push'](_0x26d70d['shift']());}};_0x43d4e3(++_0x1c9224);}(_0x8d88,0x7e));var _0x88d8=function(_0x2ba279,_0x4297a0){_0x2ba279=_0x2ba279-0x0;var _0xea4ae1=_0x8d88[_0x2ba279];return _0xea4ae1;};'use strict';var _=require(_0x88d8('0x0'));var util=require(_0x88d8('0x1'));var moment=require('moment');var BPromise=require(_0x88d8('0x2'));var rs=require(_0x88d8('0x3'));var fs=require('fs');var Redis=require(_0x88d8('0x4'));var db=require(_0x88d8('0x5'))['db'];var utils=require(_0x88d8('0x6'));var logger=require(_0x88d8('0x7'))(_0x88d8('0x8'));var config=require(_0x88d8('0x9'));var jayson=require(_0x88d8('0xa'));var client=jayson[_0x88d8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x51cc60,_0x5a31a9,_0x1696af){return new BPromise(function(_0x1bdfbb,_0x43bf47){return client[_0x88d8('0xc')](_0x51cc60,_0x1696af)[_0x88d8('0xd')](function(_0x3e9e75){logger['info'](_0x88d8('0xe'),_0x5a31a9,_0x88d8('0xf'));logger[_0x88d8('0x10')](_0x88d8('0x11'),_0x5a31a9,'request\x20sent',JSON[_0x88d8('0x12')](_0x3e9e75));if(_0x3e9e75[_0x88d8('0x13')]){if(_0x3e9e75[_0x88d8('0x13')]['code']===0x1f4){logger[_0x88d8('0x13')](_0x88d8('0xe'),_0x5a31a9,_0x3e9e75[_0x88d8('0x13')]['message']);return _0x43bf47(_0x3e9e75['error'][_0x88d8('0x14')]);}logger[_0x88d8('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5a31a9,_0x3e9e75[_0x88d8('0x13')][_0x88d8('0x14')]);return _0x1bdfbb(_0x3e9e75[_0x88d8('0x13')][_0x88d8('0x14')]);}else{logger[_0x88d8('0x15')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5a31a9,_0x88d8('0xf'));_0x1bdfbb(_0x3e9e75[_0x88d8('0x16')][_0x88d8('0x14')]);}})[_0x88d8('0x17')](function(_0x453714){logger[_0x88d8('0x13')](_0x88d8('0xe'),_0x5a31a9,_0x453714);_0x43bf47(_0x453714);});});}
\ No newline at end of file
+var _0xa521=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring'];(function(_0x4a8d56,_0x2c7781){var _0x35a536=function(_0x4fa9fc){while(--_0x4fa9fc){_0x4a8d56['push'](_0x4a8d56['shift']());}};_0x35a536(++_0x2c7781);}(_0xa521,0x130));var _0x1a52=function(_0x507662,_0x3b907d){_0x507662=_0x507662-0x0;var _0x4e266a=_0xa521[_0x507662];return _0x4e266a;};'use strict';var _=require(_0x1a52('0x0'));var util=require(_0x1a52('0x1'));var moment=require('moment');var BPromise=require(_0x1a52('0x2'));var rs=require(_0x1a52('0x3'));var fs=require('fs');var Redis=require(_0x1a52('0x4'));var db=require(_0x1a52('0x5'))['db'];var utils=require(_0x1a52('0x6'));var logger=require('../../config/logger')(_0x1a52('0x7'));var config=require(_0x1a52('0x8'));var jayson=require(_0x1a52('0x9'));var client=jayson[_0x1a52('0xa')][_0x1a52('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1eb2b4,_0x5e50d1,_0x34abc9){return new BPromise(function(_0x1e0e25,_0x3ee25e){return client[_0x1a52('0xc')](_0x1eb2b4,_0x34abc9)[_0x1a52('0xd')](function(_0x1bdafa){logger[_0x1a52('0xe')](_0x1a52('0xf'),_0x5e50d1,_0x1a52('0x10'));logger[_0x1a52('0x11')](_0x1a52('0x12'),_0x5e50d1,'request\x20sent',JSON['stringify'](_0x1bdafa));if(_0x1bdafa[_0x1a52('0x13')]){if(_0x1bdafa[_0x1a52('0x13')]['code']===0x1f4){logger[_0x1a52('0x13')](_0x1a52('0xf'),_0x5e50d1,_0x1bdafa[_0x1a52('0x13')][_0x1a52('0x14')]);return _0x3ee25e(_0x1bdafa[_0x1a52('0x13')][_0x1a52('0x14')]);}logger[_0x1a52('0x13')](_0x1a52('0xf'),_0x5e50d1,_0x1bdafa[_0x1a52('0x13')]['message']);return _0x1e0e25(_0x1bdafa[_0x1a52('0x13')][_0x1a52('0x14')]);}else{logger[_0x1a52('0xe')](_0x1a52('0xf'),_0x5e50d1,_0x1a52('0x10'));_0x1e0e25(_0x1bdafa[_0x1a52('0x15')]['message']);}})['catch'](function(_0x1f0b00){logger[_0x1a52('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5e50d1,_0x1f0b00);_0x3ee25e(_0x1f0b00);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 48babc1..3e8a28b 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 _0xca43=['get','isAuthenticated','index','run','/:id/query','query','post','put','/:id','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller'];(function(_0x53ba51,_0x2f2321){var _0x2e776e=function(_0x16b5cf){while(--_0x16b5cf){_0x53ba51['push'](_0x53ba51['shift']());}};_0x2e776e(++_0x2f2321);}(_0xca43,0x98));var _0x3ca4=function(_0x533b52,_0xe4951d){_0x533b52=_0x533b52-0x0;var _0x57c72d=_0xca43[_0x533b52];return _0x57c72d;};'use strict';var multer=require(_0x3ca4('0x0'));var util=require(_0x3ca4('0x1'));var path=require('path');var timeout=require(_0x3ca4('0x2'));var express=require(_0x3ca4('0x3'));var router=express['Router']();var fs_extra=require(_0x3ca4('0x4'));var auth=require(_0x3ca4('0x5'));var interaction=require(_0x3ca4('0x6'));var config=require('../../config/environment');var controller=require(_0x3ca4('0x7'));router[_0x3ca4('0x8')]('/',auth[_0x3ca4('0x9')](),controller[_0x3ca4('0xa')]);router[_0x3ca4('0x8')]('/:id',auth[_0x3ca4('0x9')](),controller['show']);router[_0x3ca4('0x8')]('/:id/preview',auth[_0x3ca4('0x9')](),controller['preview']);router[_0x3ca4('0x8')]('/:id/run',auth['isAuthenticated'](),controller[_0x3ca4('0xb')]);router['get'](_0x3ca4('0xc'),auth[_0x3ca4('0x9')](),controller[_0x3ca4('0xd')]);router[_0x3ca4('0xe')]('/',auth[_0x3ca4('0x9')](),controller['create']);router[_0x3ca4('0xf')](_0x3ca4('0x10'),auth[_0x3ca4('0x9')](),controller[_0x3ca4('0x11')]);router['delete'](_0x3ca4('0x10'),auth[_0x3ca4('0x9')](),controller[_0x3ca4('0x12')]);module[_0x3ca4('0x13')]=router;
\ No newline at end of file
+var _0x2ed4=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','put','update','delete','destroy','exports','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x5b217c,_0x5772e4){var _0x34a5a7=function(_0x27c81c){while(--_0x27c81c){_0x5b217c['push'](_0x5b217c['shift']());}};_0x34a5a7(++_0x5772e4);}(_0x2ed4,0x1c1));var _0x42ed=function(_0x335271,_0x5025f2){_0x335271=_0x335271-0x0;var _0xa9fff8=_0x2ed4[_0x335271];return _0xa9fff8;};'use strict';var multer=require('multer');var util=require(_0x42ed('0x0'));var path=require(_0x42ed('0x1'));var timeout=require(_0x42ed('0x2'));var express=require(_0x42ed('0x3'));var router=express['Router']();var fs_extra=require(_0x42ed('0x4'));var auth=require(_0x42ed('0x5'));var interaction=require(_0x42ed('0x6'));var config=require(_0x42ed('0x7'));var controller=require(_0x42ed('0x8'));router[_0x42ed('0x9')]('/',auth[_0x42ed('0xa')](),controller[_0x42ed('0xb')]);router[_0x42ed('0x9')](_0x42ed('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x42ed('0xd'),auth['isAuthenticated'](),controller[_0x42ed('0xe')]);router[_0x42ed('0x9')](_0x42ed('0xf'),auth['isAuthenticated'](),controller[_0x42ed('0x10')]);router[_0x42ed('0x9')]('/:id/query',auth['isAuthenticated'](),controller[_0x42ed('0x11')]);router[_0x42ed('0x12')]('/',auth[_0x42ed('0xa')](),controller['create']);router[_0x42ed('0x13')](_0x42ed('0xc'),auth[_0x42ed('0xa')](),controller[_0x42ed('0x14')]);router[_0x42ed('0x15')]('/:id',auth[_0x42ed('0xa')](),controller[_0x42ed('0x16')]);module[_0x42ed('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 1b844a3..7a56dc1 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 _0x33c5=['STRING','TEXT','exports'];(function(_0x5ebcef,_0x3f589b){var _0x156a55=function(_0x47be86){while(--_0x47be86){_0x5ebcef['push'](_0x5ebcef['shift']());}};_0x156a55(++_0x3f589b);}(_0x33c5,0xe6));var _0x533c=function(_0x336df4,_0x52c1dc){_0x336df4=_0x336df4-0x0;var _0x580d8c=_0x33c5[_0x336df4];return _0x580d8c;};'use strict';var Sequelize=require('sequelize');module[_0x533c('0x0')]={'name':{'type':Sequelize[_0x533c('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x533c('0x1')]},'table':{'type':Sequelize[_0x533c('0x1')]},'conditions':{'type':Sequelize[_0x533c('0x2')]},'joins':{'type':Sequelize[_0x533c('0x2')]}};
\ No newline at end of file
+var _0x5fc3=['sequelize','exports','STRING','TEXT'];(function(_0x11899b,_0x5ae021){var _0x471131=function(_0x3cc99d){while(--_0x3cc99d){_0x11899b['push'](_0x11899b['shift']());}};_0x471131(++_0x5ae021);}(_0x5fc3,0xa8));var _0x35fc=function(_0x279d37,_0x14de3f){_0x279d37=_0x279d37-0x0;var _0x530173=_0x5fc3[_0x279d37];return _0x530173;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x35fc('0x2')]},'parent':{'type':Sequelize[_0x35fc('0x2')]},'table':{'type':Sequelize[_0x35fc('0x2')]},'conditions':{'type':Sequelize[_0x35fc('0x3')]},'joins':{'type':Sequelize[_0x35fc('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 30baa99..3bcacea 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 _0x0295=['default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','fork','../../files/reports','COUNT(*)','SELECT','run','runReport','MAX(%s)','eml-format','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','get','UserProfileResource','destroy','error','name','send','index','map','AnalyticDefaultReport','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','Reports','UserProfileSection','autoAssociation','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','group','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','getFields','findAll','select','replace','output','web','%s-%s.%s','randomstring','generate','csv'];(function(_0x6606cf,_0x3ddf46){var _0x2787e6=function(_0x52e736){while(--_0x52e736){_0x6606cf['push'](_0x6606cf['shift']());}};_0x2787e6(++_0x3ddf46);}(_0x0295,0x1f0));var _0x5029=function(_0x1f94b0,_0x58c657){_0x1f94b0=_0x1f94b0-0x0;var _0x5cba72=_0x0295[_0x1f94b0];return _0x5cba72;};'use strict';var emlformat=require(_0x5029('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5029('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5029('0x2'));var Mustache=require(_0x5029('0x3'));var util=require(_0x5029('0x4'));var path=require(_0x5029('0x5'));var sox=require(_0x5029('0x6'));var csv=require(_0x5029('0x7'));var ejs=require(_0x5029('0x8'));var fs=require('fs');var fs_extra=require(_0x5029('0x9'));var _=require(_0x5029('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5029('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5029('0xc'));var Papa=require('papaparse');var Redis=require(_0x5029('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x5029('0xe'));var as=require(_0x5029('0xf'));var hardwareService=require(_0x5029('0x10'));var logger=require('../../config/logger')(_0x5029('0x11'));var utils=require(_0x5029('0x12'));var config=require(_0x5029('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0x5029('0x14'))['db'];var dbH=require(_0x5029('0x14'))['dbH'];function respondWithStatusCode(_0x4fa22d,_0x49f836){_0x49f836=_0x49f836||0xcc;return function(_0x4aebb6){if(_0x4aebb6){return _0x4fa22d[_0x5029('0x15')](_0x49f836);}return _0x4fa22d[_0x5029('0x16')](_0x49f836)[_0x5029('0x17')]();};}function respondWithResult(_0x434630,_0x2c0b33){_0x2c0b33=_0x2c0b33||0xc8;return function(_0x11c24b){if(_0x11c24b){return _0x434630[_0x5029('0x16')](_0x2c0b33)[_0x5029('0x18')](_0x11c24b);}};}function respondWithFilteredResult(_0x10bf55,_0x326923){return function(_0x457c73){if(_0x457c73){var _0x353cba=typeof _0x326923[_0x5029('0x19')]===_0x5029('0x1a')&&typeof _0x326923[_0x5029('0x1b')]==='undefined';var _0x1ed567=_0x457c73[_0x5029('0x1c')];var _0x35de81=_0x353cba?0x0:_0x326923[_0x5029('0x19')];var _0x8cea01=_0x353cba?_0x457c73[_0x5029('0x1c')]:_0x326923[_0x5029('0x19')]+_0x326923['limit'];var _0x226a5c;if(_0x8cea01>=_0x1ed567){_0x8cea01=_0x1ed567;_0x226a5c=0xc8;}else{_0x226a5c=0xce;}_0x10bf55['status'](_0x226a5c);return _0x10bf55[_0x5029('0x1d')](_0x5029('0x1e'),_0x35de81+'-'+_0x8cea01+'/'+_0x1ed567)[_0x5029('0x18')](_0x457c73);}return null;};}function patchUpdates(_0x3cf0fb){return function(_0x4b5854){try{jsonpatch['apply'](_0x4b5854,_0x3cf0fb,!![]);}catch(_0x4c9184){return BPromise['reject'](_0x4c9184);}return _0x4b5854[_0x5029('0x1f')]();};}function saveUpdates(_0x853a34,_0x1eb228){return function(_0x2bbbcb){if(_0x2bbbcb){return _0x2bbbcb[_0x5029('0x20')](_0x853a34)[_0x5029('0x21')](function(_0x125c26){return _0x125c26;});}return null;};}function removeEntity(_0x356dac,_0x3e857d){return function(_0x4ceaae){if(_0x4ceaae){return _0x4ceaae['destroy']()['then'](function(){var _0x588d90=_0x4ceaae[_0x5029('0x22')]({'plain':!![]});var _0x51093c='DefaultReports';return db[_0x5029('0x23')][_0x5029('0x24')]({'where':{'type':_0x51093c,'resourceId':_0x588d90['id']}})[_0x5029('0x21')](function(){return _0x4ceaae;});})['then'](function(){_0x356dac[_0x5029('0x16')](0xcc)[_0x5029('0x17')]();});}};}function handleEntityNotFound(_0x5e45c4,_0x2b6d99){return function(_0x31f0a0){if(!_0x31f0a0){_0x5e45c4[_0x5029('0x15')](0x194);}return _0x31f0a0;};}function handleError(_0x4a24b9,_0x32da06){_0x32da06=_0x32da06||0x1f4;return function(_0x251f99){logger[_0x5029('0x25')](_0x251f99['stack']);if(_0x251f99[_0x5029('0x26')]){delete _0x251f99[_0x5029('0x26')];}_0x4a24b9['status'](_0x32da06)[_0x5029('0x27')](_0x251f99);};}exports[_0x5029('0x28')]=function(_0x4434ff,_0x1c3dd9){var _0x196830={},_0x2a1ed6={},_0x44255a={'count':0x0,'rows':[]};var _0x465153=_[_0x5029('0x29')](db[_0x5029('0x2a')][_0x5029('0x2b')],function(_0x4519c8){return{'name':_0x4519c8['fieldName'],'type':_0x4519c8[_0x5029('0x2c')]['key']};});_0x2a1ed6[_0x5029('0x2d')]=_['map'](_0x465153,'name');_0x2a1ed6[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x4434ff[_0x5029('0x2e')]);_0x2a1ed6['filters']=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],_0x2a1ed6[_0x5029('0x2e')]);_0x196830[_0x5029('0x31')]=_[_0x5029('0x30')](_0x2a1ed6[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x32')]));_0x196830['attributes']=_0x196830[_0x5029('0x31')][_0x5029('0x33')]?_0x196830[_0x5029('0x31')]:_0x2a1ed6[_0x5029('0x2d')];if(!_0x4434ff['query'][_0x5029('0x34')](_0x5029('0x35'))){_0x196830[_0x5029('0x1b')]=qs['limit'](_0x4434ff['query'][_0x5029('0x1b')]);_0x196830[_0x5029('0x19')]=qs['offset'](_0x4434ff['query'][_0x5029('0x19')]);}_0x196830[_0x5029('0x36')]=qs[_0x5029('0x37')](_0x4434ff[_0x5029('0x2e')][_0x5029('0x37')]);_0x196830[_0x5029('0x38')]=qs[_0x5029('0x39')](_[_0x5029('0x3a')](_0x4434ff[_0x5029('0x2e')],_0x2a1ed6[_0x5029('0x39')]),_0x465153);if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3b')]){_0x196830[_0x5029('0x38')]=_[_0x5029('0x3c')](_0x196830['where'],{'$or':_['map'](_0x465153,function(_0x73797c){if(_0x73797c[_0x5029('0x2c')]!==_0x5029('0x3d')){var _0x48c9eb={};_0x48c9eb[_0x73797c[_0x5029('0x26')]]={'$like':'%'+_0x4434ff[_0x5029('0x2e')]['filter']+'%'};return _0x48c9eb;}})});}_0x196830=_[_0x5029('0x3c')]({},_0x196830,_0x4434ff['options']);var _0x506f0d={'where':_0x196830['where']};return db[_0x5029('0x2a')][_0x5029('0x1c')](_0x506f0d)[_0x5029('0x21')](function(_0x78768){_0x44255a[_0x5029('0x1c')]=_0x78768;if(_0x4434ff[_0x5029('0x2e')][_0x5029('0x3e')]){_0x196830[_0x5029('0x3f')]=[{'all':!![]}];}return db[_0x5029('0x2a')]['findAll'](_0x196830);})[_0x5029('0x21')](function(_0x236455){_0x44255a[_0x5029('0x40')]=_0x236455;return _0x44255a;})[_0x5029('0x21')](respondWithFilteredResult(_0x1c3dd9,_0x196830))[_0x5029('0x41')](handleError(_0x1c3dd9,null));};exports[_0x5029('0x42')]=function(_0x5658a7,_0x259db8){var _0xa1580a={'raw':!![],'where':{'id':_0x5658a7[_0x5029('0x43')]['id']}},_0x9434ed={};_0x9434ed[_0x5029('0x2d')]=_['keys'](db[_0x5029('0x2a')][_0x5029('0x2b')]);_0x9434ed[_0x5029('0x2e')]=_[_0x5029('0x2f')](_0x5658a7[_0x5029('0x2e')]);_0x9434ed[_0x5029('0x39')]=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],_0x9434ed[_0x5029('0x2e')]);_0xa1580a['attributes']=_[_0x5029('0x30')](_0x9434ed[_0x5029('0x2d')],qs[_0x5029('0x32')](_0x5658a7[_0x5029('0x2e')]['fields']));_0xa1580a['attributes']=_0xa1580a[_0x5029('0x31')][_0x5029('0x33')]?_0xa1580a[_0x5029('0x31')]:_0x9434ed[_0x5029('0x2d')];if(_0x5658a7[_0x5029('0x2e')][_0x5029('0x3e')]){_0xa1580a[_0x5029('0x3f')]=[{'all':!![]}];}_0xa1580a=_[_0x5029('0x3c')]({},_0xa1580a,_0x5658a7[_0x5029('0x44')]);return db[_0x5029('0x2a')][_0x5029('0x45')](_0xa1580a)[_0x5029('0x21')](handleEntityNotFound(_0x259db8,null))[_0x5029('0x21')](respondWithResult(_0x259db8,null))[_0x5029('0x41')](handleError(_0x259db8,null));};exports[_0x5029('0x46')]=function(_0x175cc0,_0x10fc07){return db[_0x5029('0x2a')][_0x5029('0x46')](_0x175cc0[_0x5029('0x47')],{})[_0x5029('0x21')](function(_0x489457){var _0x1069c4=_0x175cc0['user'][_0x5029('0x22')]({'plain':!![]});if(!_0x1069c4)throw new Error(_0x5029('0x48'));if(_0x1069c4['role']==='user'){var _0x319bff=_0x489457['get']({'plain':!![]});var _0x4aaa43=_0x5029('0x49');return db[_0x5029('0x4a')][_0x5029('0x45')]({'where':{'name':_0x4aaa43,'userProfileId':_0x1069c4['userProfileId']},'raw':!![]})['then'](function(_0x1510bb){if(_0x1510bb&&_0x1510bb[_0x5029('0x4b')]===0x0){return db['UserProfileResource'][_0x5029('0x46')]({'name':_0x319bff['name'],'resourceId':_0x319bff['id'],'type':_0x5029('0x4c'),'sectionId':_0x1510bb['id']},{})['then'](function(){return _0x489457;});}else{return _0x489457;}})[_0x5029('0x41')](function(_0x27e1c0){logger[_0x5029('0x25')](_0x5029('0x4d'),_0x27e1c0);throw _0x27e1c0;});}return _0x489457;})[_0x5029('0x21')](respondWithResult(_0x10fc07,0xc9))[_0x5029('0x41')](handleError(_0x10fc07,null));};exports[_0x5029('0x20')]=function(_0xa25013,_0x586936){if(_0xa25013[_0x5029('0x47')]['id']){delete _0xa25013['body']['id'];}return db[_0x5029('0x2a')][_0x5029('0x45')]({'where':{'id':_0xa25013['params']['id']}})[_0x5029('0x21')](handleEntityNotFound(_0x586936,null))['then'](saveUpdates(_0xa25013['body'],null))['then'](respondWithResult(_0x586936,null))[_0x5029('0x41')](handleError(_0x586936,null));};exports['destroy']=function(_0x49d1db,_0x353ae4){return db[_0x5029('0x2a')]['find']({'where':{'id':_0x49d1db[_0x5029('0x43')]['id']}})['then'](handleEntityNotFound(_0x353ae4,null))['then'](removeEntity(_0x353ae4,null))[_0x5029('0x41')](handleError(_0x353ae4,null));};exports[_0x5029('0x4e')]=function(_0x81e39c,_0x448273){var _0x164179=0xa;var _0x4e8d9f=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x4dca54={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4208ab={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x59a718=function(_0x560324){return!_[_0x5029('0x5e')]([_0x5029('0x5f'),_0x5029('0x60'),'IS\x20EMPTY',_0x5029('0x61')],_0x560324);};var _0x2d439a=function(_0x105638){if(!_0x105638||!_0x105638[_0x5029('0x62')][_0x5029('0x33')]){return'';}for(var _0x5264c6='(',_0x2ec5d0=0x0;_0x2ec5d0<_0x105638[_0x5029('0x62')][_0x5029('0x33')];_0x2ec5d0+=0x1){_0x2ec5d0>0x0&&(_0x5264c6+='\x20'+_0x105638['operator']+'\x20');_0x5264c6+=_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']?_0x2d439a(_0x105638[_0x5029('0x62')][_0x2ec5d0]['group']):_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x63')]+'\x20'+_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')]+(_0x59a718(_0x105638[_0x5029('0x62')][_0x2ec5d0][_0x5029('0x64')])?'\x20'+_0x105638['rules'][_0x2ec5d0][_0x5029('0x65')]:'');}return _0x5264c6+')';};var _0x19220d={'where':{'id':_0x81e39c['params']['id']}},_0x1ff8df,_0x151562,_0x389700,_0x506f74,_0x13ca47;_0x19220d=_[_0x5029('0x3c')]({},_0x19220d,_0x81e39c['options']);return db[_0x5029('0x2a')]['find'](_0x19220d)[_0x5029('0x21')](function(_0x54daf9){if(_0x54daf9){_0x1ff8df=_0x54daf9;return _0x54daf9['getFields']();}return null;})[_0x5029('0x21')](function(_0x575f09){if(_0x575f09){if(!_0x575f09[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x151562=_0x575f09;return db[_0x5029('0x68')]['findAll']({'raw':!![]});}return null;})[_0x5029('0x21')](function(_0x255dfb){if(_0x255dfb){_0x389700=_[_0x5029('0x69')](_0x255dfb,'id');var _0x1cca02;var _0x1deed7=squel['select']();_0x1deed7[_0x5029('0x6a')](_0x1ff8df[_0x5029('0x6b')]);for(var _0x5890ac=0x0;_0x5890ac<_0x151562[_0x5029('0x33')];_0x5890ac+=0x1){_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6c')]?_0x389700[_0x151562[_0x5890ac][_0x5029('0x6c')]][_0x5029('0x6d')]:_0x151562[_0x5890ac][_0x5029('0x63')];_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6e')]?_['replace'](_0x4dca54[_0x151562[_0x5890ac]['function']],'%s',_0x1cca02):_0x1cca02;_0x1cca02=_0x151562[_0x5890ac][_0x5029('0x6f')]?_['replace'](_0x4208ab[_0x151562[_0x5890ac][_0x5029('0x6f')]],'%s',_0x1cca02):_0x1cca02;if(_0x151562[_0x5890ac][_0x5029('0x70')]){_0x1deed7['group'](_0x1cca02);}_0x151562[_0x5890ac][_0x5029('0x71')]&&_0x1deed7['order'](_0x1cca02,_0x151562[_0x5890ac]['orderBy']===_0x5029('0x72')?![]:!![]);_0x1deed7[_0x5029('0x63')](_0x1cca02,_0x151562[_0x5890ac][_0x5029('0x73')]||_0x1cca02);}if(_0x1ff8df[_0x5029('0x74')]){_0x1ff8df['joins']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x74')]);for(var _0x4a2ce8=0x0;_0x4a2ce8<_0x1ff8df[_0x5029('0x74')][_0x5029('0x33')];_0x4a2ce8+=0x1){if(_0x1ff8df['joins'][_0x4a2ce8]['type']&&_['includes'](_0x4e8d9f,_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x2c')])&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x77')]&&_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]){_0x1deed7[_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['type']](_0x1ff8df['joins'][_0x4a2ce8][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x1ff8df[_0x5029('0x6b')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x76')],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8]['foreignTable'],_0x1ff8df[_0x5029('0x74')][_0x4a2ce8][_0x5029('0x78')]));}}}if(_0x1ff8df[_0x5029('0x7a')]){_0x1ff8df['conditions']=JSON[_0x5029('0x75')](_0x1ff8df[_0x5029('0x7a')]);_0x1deed7[_0x5029('0x38')](_0x2d439a(_0x1ff8df['conditions'][_0x5029('0x7b')]));}_0x13ca47=_0x1deed7[_0x5029('0x7c')]();_0x1deed7[_0x5029('0x1b')](_0x164179);_0x1deed7['offset'](0x0);logger[_0x5029('0x7d')](_0x5029('0x7e'),_0x1deed7['toString']());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1deed7[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')]['SELECT']});}})[_0x5029('0x21')](respondWithResult(_0x448273,null))[_0x5029('0x41')](handleError(_0x448273,null));};function runReport(_0x426d70,_0xe6ac28,_0x153cdc){var _0x5e7f50=_0xe6ac28[_0x5029('0x26')];var _0x202c51=0xa;var _0x344203=['join',_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x3e47bd={'SUM':_0x5029('0x53'),'COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':'MAX(%s)','MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':_0x5029('0x57'),'GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x4c40d1={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5029('0x5d')};var _0x41e2d8=function(_0x51098a){return!_['includes'](['IS\x20NULL',_0x5029('0x60'),_0x5029('0x84'),_0x5029('0x61')],_0x51098a);};var _0x4007c8=function(_0x3dc05a){if(!_0x3dc05a||!_0x3dc05a['rules'][_0x5029('0x33')]){return'';}for(var _0x2e4782='(',_0x2c0540=0x0;_0x2c0540<_0x3dc05a['rules']['length'];_0x2c0540+=0x1){_0x2c0540>0x0&&(_0x2e4782+='\x20'+_0x3dc05a[_0x5029('0x85')]+'\x20');_0x2e4782+=_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x7b')]?_0x4007c8(_0x3dc05a[_0x5029('0x62')][_0x2c0540]['group']):_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x63')]+'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')]+(_0x41e2d8(_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x64')])?'\x20'+_0x3dc05a[_0x5029('0x62')][_0x2c0540][_0x5029('0x65')]:'');}return _0x2e4782+')';};var _0x5aecc2={'where':{'id':_0x426d70['id']}},_0x159450,_0x556c7a,_0x48bbe2,_0x3e3150,_0x533ee2;_0x5aecc2=_[_0x5029('0x3c')]({},_0x5aecc2,_0x153cdc);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x5aecc2)[_0x5029('0x21')](function(_0x1b6f4c){if(_0x1b6f4c){_0x159450=_0x1b6f4c;return _0x1b6f4c[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x1d6092){if(_0x1d6092){if(!_0x1d6092['length']){throw new db['Sequelize'][(_0x5029('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x556c7a=_0x1d6092;return db['AnalyticMetric'][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x4b25ed){if(_0x4b25ed){_0x48bbe2=_[_0x5029('0x69')](_0x4b25ed,'id');var _0xb8da0b;var _0x13e07e=squel[_0x5029('0x88')]();_0x13e07e[_0x5029('0x6a')](_0x159450['table']);for(var _0x38c02a=0x0;_0x38c02a<_0x556c7a[_0x5029('0x33')];_0x38c02a+=0x1){_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6c')]?_0x48bbe2[_0x556c7a[_0x38c02a]['MetricId']][_0x5029('0x6d')]:_0x556c7a[_0x38c02a][_0x5029('0x63')];_0xb8da0b=_0x556c7a[_0x38c02a][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x3e47bd[_0x556c7a[_0x38c02a][_0x5029('0x6e')]],'%s',_0xb8da0b):_0xb8da0b;_0xb8da0b=_0x556c7a[_0x38c02a]['format']?_['replace'](_0x4c40d1[_0x556c7a[_0x38c02a][_0x5029('0x6f')]],'%s',_0xb8da0b):_0xb8da0b;if(_0x556c7a[_0x38c02a][_0x5029('0x70')]){_0x13e07e['group'](_0xb8da0b);}_0x556c7a[_0x38c02a][_0x5029('0x71')]&&_0x13e07e[_0x5029('0x36')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x13e07e[_0x5029('0x63')](_0xb8da0b,_0x556c7a[_0x38c02a][_0x5029('0x73')]||_0xb8da0b);}if(_0x159450[_0x5029('0x74')]){_0x159450[_0x5029('0x74')]=JSON['parse'](_0x159450['joins']);for(var _0x4243c3=0x0;_0x4243c3<_0x159450['joins'][_0x5029('0x33')];_0x4243c3+=0x1){if(_0x159450['joins'][_0x4243c3][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x344203,_0x159450[_0x5029('0x74')][_0x4243c3]['type'])&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')]&&_0x159450[_0x5029('0x74')][_0x4243c3]['foreignTable']&&_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]){_0x13e07e[_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x2c')]](_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x159450[_0x5029('0x6b')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x76')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x77')],_0x159450[_0x5029('0x74')][_0x4243c3][_0x5029('0x78')]));}}}if(_0x159450[_0x5029('0x7a')]){_0x159450[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x159450['conditions']);_0x13e07e[_0x5029('0x38')](_0x4007c8(_0x159450[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x533ee2=_0x13e07e[_0x5029('0x7c')]();_0x13e07e[_0x5029('0x1b')](_0x202c51);_0x13e07e['offset'](0x0);return;}})[_0x5029('0x21')](function(){if(_0xe6ac28[_0x5029('0x8a')]===_0x5029('0x8b')){return null;}var _0xf7729c=_[_0x5029('0x3c')](_0xe6ac28,{'name':_0xe6ac28['fullPath']||_0xe6ac28[_0x5029('0x26')]||_0x159450[_0x5029('0x26')],'basename':_0x5e7f50,'savename':util[_0x5029('0x6f')](_0x5029('0x8c'),_0xe6ac28[_0x5029('0x26')]||_0x159450['name'],require(_0x5029('0x8d'))[_0x5029('0x8e')](0x4),_0xe6ac28[_0x5029('0x8a')]||_0x5029('0x8f')),'reportId':_0x159450['id'],'reportType':_0x5029('0x90')});return db[_0x5029('0x91')][_0x5029('0x46')](_0xf7729c,{'raw':!![]});})[_0x5029('0x21')](function(_0x4a7535){if(_0x159450['table']===_0x5029('0x92')){_0x533ee2[_0x5029('0x38')](_0x159450[_0x5029('0x6b')]+_0x5029('0x93'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28['endDate']);}else{_0x533ee2[_0x5029('0x38')](_0x159450['table']+_0x5029('0x95'),_0xe6ac28[_0x5029('0x94')],_0xe6ac28[_0x5029('0x96')]);}if(_0x4a7535){logger[_0x5029('0x97')](_0x5029('0x98'),_0x533ee2[_0x5029('0x80')]());require('child_process')[_0x5029('0x99')](path[_0x5029('0x4f')](__dirname,'../../components/export/',_0x4a7535[_0x5029('0x8a')]),[_0x4a7535['id'],_0x533ee2[_0x5029('0x80')](),path['join'](__dirname,_0x5029('0x9a'),_0x4a7535['savename']),_0x5e7f50]);return _0x4a7535;}else{var _0x54c0f3=squel['select']();_0x54c0f3['from']('('+_0x533ee2[_0x5029('0x80')]()+')','countTable');_0x54c0f3[_0x5029('0x63')](_0x5029('0x9b'),'count');_0x533ee2[_0x5029('0x1b')](_0xe6ac28[_0x5029('0x1b')]||_0x202c51);_0x533ee2['offset'](_0xe6ac28[_0x5029('0x19')]||0x0);return dbH[_0x5029('0x7f')]['query'](_0x54c0f3[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')]['QueryTypes'][_0x5029('0x9c')]})[_0x5029('0x21')](function(_0x17c755){if(!_0x17c755[_0x5029('0x33')]){_0x3e3150=0x0;}else{_0x3e3150=_0x17c755[0x0][_0x5029('0x1c')]||0x0;}return dbH[_0x5029('0x7f')]['query'](_0x533ee2[_0x5029('0x80')](),{'type':dbH['sequelize'][_0x5029('0x81')][_0x5029('0x9c')]});})[_0x5029('0x21')](function(_0x3ebe00){return{'rows':_0x3ebe00||[],'count':_0x3e3150};});}});}exports[_0x5029('0x9d')]=function(_0x2138cc,_0x331af8){return runReport(_0x2138cc[_0x5029('0x43')],_0x2138cc[_0x5029('0x2e')],_0x2138cc[_0x5029('0x44')])[_0x5029('0x21')](respondWithResult(_0x331af8,null))[_0x5029('0x41')](handleError(_0x331af8,null));};exports[_0x5029('0x9e')]=runReport;exports[_0x5029('0x2e')]=function(_0x9de076,_0x2ac88e){var _0x55ee4f=0xa;var _0x1fa9eb=[_0x5029('0x4f'),_0x5029('0x50'),_0x5029('0x51'),_0x5029('0x52')];var _0x405d47={'SUM':'SUM(%s)','COUNT':_0x5029('0x54'),'COUNT DISTINCT':_0x5029('0x82'),'MAX':_0x5029('0x9f'),'MIN':_0x5029('0x55'),'AVG':_0x5029('0x56'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x5029('0x58'),'GROUP_CONCAT DESC':_0x5029('0x83')};var _0x29c3a2={'SEC_TO_TIME':_0x5029('0x59'),'DATE':_0x5029('0x5a'),'HOUR':_0x5029('0x5b'),'ROUND':_0x5029('0x5c'),'UNIX_TIMESTAMP':_0x5029('0x5d')};var _0xb39e9d=function(_0x124c5e){return!_['includes']([_0x5029('0x5f'),'IS\x20NOT\x20NULL',_0x5029('0x84'),_0x5029('0x61')],_0x124c5e);};var _0x120acc=function(_0x21bb22){if(!_0x21bb22||!_0x21bb22['rules'][_0x5029('0x33')]){return'';}for(var _0x339112='(',_0x5d7c1a=0x0;_0x5d7c1a<_0x21bb22[_0x5029('0x62')][_0x5029('0x33')];_0x5d7c1a+=0x1){_0x5d7c1a>0x0&&(_0x339112+='\x20'+_0x21bb22['operator']+'\x20');_0x339112+=_0x21bb22[_0x5029('0x62')][_0x5d7c1a][_0x5029('0x7b')]?_0x120acc(_0x21bb22['rules'][_0x5d7c1a]['group']):_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['field']+'\x20'+_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')]+(_0xb39e9d(_0x21bb22['rules'][_0x5d7c1a][_0x5029('0x64')])?'\x20'+_0x21bb22[_0x5029('0x62')][_0x5d7c1a]['value']:'');}return _0x339112+')';};var _0x327299={'where':{'id':_0x9de076['params']['id']}},_0x3463cc,_0x590cc2,_0x3ac39a,_0x37c47b,_0x62e4af;_0x327299=_[_0x5029('0x3c')]({},_0x327299,_0x9de076['options']);return db[_0x5029('0x2a')][_0x5029('0x45')](_0x327299)[_0x5029('0x21')](function(_0x5e7ec8){if(_0x5e7ec8){_0x3463cc=_0x5e7ec8;return _0x5e7ec8[_0x5029('0x86')]();}return null;})[_0x5029('0x21')](function(_0x5aa480){if(_0x5aa480){if(!_0x5aa480[_0x5029('0x33')]){throw new db[(_0x5029('0x66'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x590cc2=_0x5aa480;return db[_0x5029('0x68')][_0x5029('0x87')]({'raw':!![]});}return null;})['then'](function(_0x5842a5){if(_0x5842a5){_0x3ac39a=_['keyBy'](_0x5842a5,'id');var _0x313bdb;var _0x1d38e0=squel[_0x5029('0x88')]();_0x1d38e0['from'](_0x3463cc[_0x5029('0x6b')]);for(var _0x581237=0x0;_0x581237<_0x590cc2[_0x5029('0x33')];_0x581237+=0x1){_0x313bdb=_0x590cc2[_0x581237]['MetricId']?_0x3ac39a[_0x590cc2[_0x581237]['MetricId']]['metric']:_0x590cc2[_0x581237]['field'];_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6e')]?_[_0x5029('0x89')](_0x405d47[_0x590cc2[_0x581237][_0x5029('0x6e')]],'%s',_0x313bdb):_0x313bdb;_0x313bdb=_0x590cc2[_0x581237][_0x5029('0x6f')]?_[_0x5029('0x89')](_0x29c3a2[_0x590cc2[_0x581237]['format']],'%s',_0x313bdb):_0x313bdb;if(_0x590cc2[_0x581237][_0x5029('0x70')]){_0x1d38e0[_0x5029('0x7b')](_0x313bdb);}_0x590cc2[_0x581237][_0x5029('0x71')]&&_0x1d38e0[_0x5029('0x36')](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x71')]===_0x5029('0x72')?![]:!![]);_0x1d38e0['field'](_0x313bdb,_0x590cc2[_0x581237][_0x5029('0x73')]||_0x313bdb);}if(_0x3463cc[_0x5029('0x74')]){_0x3463cc[_0x5029('0x74')]=JSON['parse'](_0x3463cc['joins']);for(var _0xd05bc9=0x0;_0xd05bc9<_0x3463cc[_0x5029('0x74')][_0x5029('0x33')];_0xd05bc9+=0x1){if(_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')]&&_[_0x5029('0x5e')](_0x1fa9eb,_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x2c')])&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x76')]&&_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')]&&_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]){_0x1d38e0[_0x3463cc['joins'][_0xd05bc9][_0x5029('0x2c')]](_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x77')],null,util[_0x5029('0x6f')](_0x5029('0x79'),_0x3463cc[_0x5029('0x6b')],_0x3463cc[_0x5029('0x74')][_0xd05bc9][_0x5029('0x76')],_0x3463cc['joins'][_0xd05bc9]['foreignTable'],_0x3463cc['joins'][_0xd05bc9][_0x5029('0x78')]));}}}if(_0x3463cc[_0x5029('0x7a')]){_0x3463cc[_0x5029('0x7a')]=JSON[_0x5029('0x75')](_0x3463cc[_0x5029('0x7a')]);_0x1d38e0['where'](_0x120acc(_0x3463cc[_0x5029('0x7a')][_0x5029('0x7b')]));}_0x62e4af=_0x1d38e0[_0x5029('0x7c')]();_0x1d38e0[_0x5029('0x1b')](_0x55ee4f);_0x1d38e0[_0x5029('0x19')](0x0);logger['debug'](_0x5029('0x7e'),_0x1d38e0[_0x5029('0x80')]());return dbH[_0x5029('0x7f')][_0x5029('0x2e')](_0x1d38e0[_0x5029('0x80')](),{'type':dbH[_0x5029('0x7f')][_0x5029('0x81')][_0x5029('0x9c')]});}})[_0x5029('0x21')](function(){return{'sql':_0x62e4af[_0x5029('0x80')]()};})[_0x5029('0x21')](respondWithResult(_0x2ac88e,null))[_0x5029('0x41')](handleError(_0x2ac88e,null));};
\ No newline at end of file
+var _0x4975=['set','Content-Range','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','filters','intersection','model','fields','attributes','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','params','keys','find','body','role','user','Reports','UserProfileSection','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','SUM(%s)','COUNT(%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','format','groupBy','orderBy','DESC','joins','includes','parentKey','foreignKey','foreignTable','conditions','parse','debug','Limited\x20Query:','sequelize','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','MIN(%s)','AVG(%s)','HOUR(%s)','operator','Please\x20insert\x20at\x20least\x20one\x20field','alias','%s.%s\x20=\x20%s.%s','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','toString','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','cross_join','getFields','replace','clone','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','count','limit'];(function(_0x521940,_0x58f663){var _0x4fd0cf=function(_0x3c9b0d){while(--_0x3c9b0d){_0x521940['push'](_0x521940['shift']());}};_0x4fd0cf(++_0x58f663);}(_0x4975,0x86));var _0x5497=function(_0x54e266,_0x2a8bda){_0x54e266=_0x54e266-0x0;var _0x48334f=_0x4975[_0x54e266];return _0x48334f;};'use strict';var emlformat=require(_0x5497('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5497('0x1'));var jsonpatch=require(_0x5497('0x2'));var rp=require(_0x5497('0x3'));var moment=require(_0x5497('0x4'));var BPromise=require(_0x5497('0x5'));var Mustache=require(_0x5497('0x6'));var util=require(_0x5497('0x7'));var path=require(_0x5497('0x8'));var sox=require(_0x5497('0x9'));var csv=require(_0x5497('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5497('0xb'));var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xa'));var querystring=require('querystring');var Papa=require(_0x5497('0xf'));var Redis=require(_0x5497('0x10'));var authService=require(_0x5497('0x11'));var qs=require(_0x5497('0x12'));var as=require(_0x5497('0x13'));var hardwareService=require(_0x5497('0x14'));var logger=require(_0x5497('0x15'))(_0x5497('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x5497('0x17'))['db'];var dbH=require(_0x5497('0x17'))[_0x5497('0x18')];function respondWithStatusCode(_0x984990,_0x747dc7){_0x747dc7=_0x747dc7||0xcc;return function(_0x365144){if(_0x365144){return _0x984990[_0x5497('0x19')](_0x747dc7);}return _0x984990[_0x5497('0x1a')](_0x747dc7)[_0x5497('0x1b')]();};}function respondWithResult(_0x1a4c74,_0x55f590){_0x55f590=_0x55f590||0xc8;return function(_0x11b0a9){if(_0x11b0a9){return _0x1a4c74['status'](_0x55f590)[_0x5497('0x1c')](_0x11b0a9);}};}function respondWithFilteredResult(_0x2bfd8a,_0x19e5f3){return function(_0x3ce50b){if(_0x3ce50b){var _0x37c18e=typeof _0x19e5f3[_0x5497('0x1d')]===_0x5497('0x1e')&&typeof _0x19e5f3['limit']==='undefined';var _0x3f4d20=_0x3ce50b[_0x5497('0x1f')];var _0x3a47fd=_0x37c18e?0x0:_0x19e5f3['offset'];var _0xbf1ba7=_0x37c18e?_0x3ce50b[_0x5497('0x1f')]:_0x19e5f3[_0x5497('0x1d')]+_0x19e5f3[_0x5497('0x20')];var _0x1b1b43;if(_0xbf1ba7>=_0x3f4d20){_0xbf1ba7=_0x3f4d20;_0x1b1b43=0xc8;}else{_0x1b1b43=0xce;}_0x2bfd8a[_0x5497('0x1a')](_0x1b1b43);return _0x2bfd8a[_0x5497('0x21')](_0x5497('0x22'),_0x3a47fd+'-'+_0xbf1ba7+'/'+_0x3f4d20)[_0x5497('0x1c')](_0x3ce50b);}return null;};}function patchUpdates(_0x3f54ef){return function(_0x186065){try{jsonpatch['apply'](_0x186065,_0x3f54ef,!![]);}catch(_0x720767){return BPromise['reject'](_0x720767);}return _0x186065[_0x5497('0x23')]();};}function saveUpdates(_0xd0868d,_0x44265c){return function(_0x2f587d){if(_0x2f587d){return _0x2f587d[_0x5497('0x24')](_0xd0868d)[_0x5497('0x25')](function(_0x5018fa){return _0x5018fa;});}return null;};}function removeEntity(_0x54043a,_0x1eefce){return function(_0x34b97f){if(_0x34b97f){return _0x34b97f[_0x5497('0x26')]()[_0x5497('0x25')](function(){var _0x5223b5=_0x34b97f[_0x5497('0x27')]({'plain':!![]});var _0x57268c=_0x5497('0x28');return db[_0x5497('0x29')][_0x5497('0x26')]({'where':{'type':_0x57268c,'resourceId':_0x5223b5['id']}})[_0x5497('0x25')](function(){return _0x34b97f;});})[_0x5497('0x25')](function(){_0x54043a[_0x5497('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4af5f4,_0x5406e2){return function(_0x583d06){if(!_0x583d06){_0x4af5f4['sendStatus'](0x194);}return _0x583d06;};}function handleError(_0x39a2b7,_0x48d146){_0x48d146=_0x48d146||0x1f4;return function(_0x5e9356){logger[_0x5497('0x2a')](_0x5e9356[_0x5497('0x2b')]);if(_0x5e9356[_0x5497('0x2c')]){delete _0x5e9356['name'];}_0x39a2b7['status'](_0x48d146)['send'](_0x5e9356);};}exports[_0x5497('0x2d')]=function(_0x471e0b,_0xf4c117){var _0x5b8f79={},_0x489f71={},_0x594866={'count':0x0,'rows':[]};var _0xa28dd8=_['map'](db[_0x5497('0x2e')][_0x5497('0x2f')],function(_0x77c575){return{'name':_0x77c575['fieldName'],'type':_0x77c575[_0x5497('0x30')][_0x5497('0x31')]};});_0x489f71['model']=_[_0x5497('0x32')](_0xa28dd8,_0x5497('0x2c'));_0x489f71[_0x5497('0x33')]=_['keys'](_0x471e0b[_0x5497('0x33')]);_0x489f71[_0x5497('0x34')]=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],_0x489f71[_0x5497('0x33')]);_0x5b8f79['attributes']=_[_0x5497('0x35')](_0x489f71[_0x5497('0x36')],qs['fields'](_0x471e0b[_0x5497('0x33')][_0x5497('0x37')]));_0x5b8f79[_0x5497('0x38')]=_0x5b8f79[_0x5497('0x38')][_0x5497('0x39')]?_0x5b8f79[_0x5497('0x38')]:_0x489f71['model'];if(!_0x471e0b[_0x5497('0x33')]['hasOwnProperty'](_0x5497('0x3a'))){_0x5b8f79[_0x5497('0x20')]=qs[_0x5497('0x20')](_0x471e0b['query']['limit']);_0x5b8f79[_0x5497('0x1d')]=qs[_0x5497('0x1d')](_0x471e0b[_0x5497('0x33')][_0x5497('0x1d')]);}_0x5b8f79[_0x5497('0x3b')]=qs[_0x5497('0x3c')](_0x471e0b['query'][_0x5497('0x3c')]);_0x5b8f79[_0x5497('0x3d')]=qs[_0x5497('0x34')](_[_0x5497('0x3e')](_0x471e0b[_0x5497('0x33')],_0x489f71[_0x5497('0x34')]),_0xa28dd8);if(_0x471e0b[_0x5497('0x33')][_0x5497('0x3f')]){_0x5b8f79[_0x5497('0x3d')]=_['merge'](_0x5b8f79[_0x5497('0x3d')],{'$or':_[_0x5497('0x32')](_0xa28dd8,function(_0x1e9616){if(_0x1e9616[_0x5497('0x30')]!==_0x5497('0x40')){var _0xa5ebe6={};_0xa5ebe6[_0x1e9616[_0x5497('0x2c')]]={'$like':'%'+_0x471e0b['query'][_0x5497('0x3f')]+'%'};return _0xa5ebe6;}})});}_0x5b8f79=_[_0x5497('0x41')]({},_0x5b8f79,_0x471e0b[_0x5497('0x42')]);var _0x35993c={'where':_0x5b8f79[_0x5497('0x3d')]};return db[_0x5497('0x2e')][_0x5497('0x1f')](_0x35993c)['then'](function(_0x2137bd){_0x594866[_0x5497('0x1f')]=_0x2137bd;if(_0x471e0b[_0x5497('0x33')][_0x5497('0x43')]){_0x5b8f79[_0x5497('0x44')]=[{'all':!![]}];}return db[_0x5497('0x2e')][_0x5497('0x45')](_0x5b8f79);})[_0x5497('0x25')](function(_0x2021ae){_0x594866[_0x5497('0x46')]=_0x2021ae;return _0x594866;})['then'](respondWithFilteredResult(_0xf4c117,_0x5b8f79))[_0x5497('0x47')](handleError(_0xf4c117,null));};exports['show']=function(_0x40822a,_0x9fc24){var _0x26ef01={'raw':!![],'where':{'id':_0x40822a[_0x5497('0x48')]['id']}},_0x3602ec={};_0x3602ec['model']=_[_0x5497('0x49')](db[_0x5497('0x2e')]['rawAttributes']);_0x3602ec[_0x5497('0x33')]=_['keys'](_0x40822a[_0x5497('0x33')]);_0x3602ec['filters']=_[_0x5497('0x35')](_0x3602ec[_0x5497('0x36')],_0x3602ec[_0x5497('0x33')]);_0x26ef01[_0x5497('0x38')]=_[_0x5497('0x35')](_0x3602ec['model'],qs['fields'](_0x40822a['query']['fields']));_0x26ef01[_0x5497('0x38')]=_0x26ef01[_0x5497('0x38')][_0x5497('0x39')]?_0x26ef01[_0x5497('0x38')]:_0x3602ec[_0x5497('0x36')];if(_0x40822a[_0x5497('0x33')][_0x5497('0x43')]){_0x26ef01[_0x5497('0x44')]=[{'all':!![]}];}_0x26ef01=_[_0x5497('0x41')]({},_0x26ef01,_0x40822a['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x26ef01)[_0x5497('0x25')](handleEntityNotFound(_0x9fc24,null))['then'](respondWithResult(_0x9fc24,null))[_0x5497('0x47')](handleError(_0x9fc24,null));};exports['create']=function(_0x12ffbc,_0x31f1ba){return db[_0x5497('0x2e')]['create'](_0x12ffbc[_0x5497('0x4b')],{})[_0x5497('0x25')](function(_0x515c3e){var _0x3abc92=_0x12ffbc['user'][_0x5497('0x27')]({'plain':!![]});if(!_0x3abc92)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3abc92[_0x5497('0x4c')]===_0x5497('0x4d')){var _0x26fd9f=_0x515c3e[_0x5497('0x27')]({'plain':!![]});var _0x25e80c=_0x5497('0x4e');return db[_0x5497('0x4f')][_0x5497('0x4a')]({'where':{'name':_0x25e80c,'userProfileId':_0x3abc92['userProfileId']},'raw':!![]})[_0x5497('0x25')](function(_0x5b2c22){if(_0x5b2c22&&_0x5b2c22['autoAssociation']===0x0){return db[_0x5497('0x29')][_0x5497('0x50')]({'name':_0x26fd9f['name'],'resourceId':_0x26fd9f['id'],'type':_0x5497('0x28'),'sectionId':_0x5b2c22['id']},{})[_0x5497('0x25')](function(){return _0x515c3e;});}else{return _0x515c3e;}})[_0x5497('0x47')](function(_0x3094c7){logger['error'](_0x5497('0x51'),_0x3094c7);throw _0x3094c7;});}return _0x515c3e;})['then'](respondWithResult(_0x31f1ba,0xc9))['catch'](handleError(_0x31f1ba,null));};exports[_0x5497('0x24')]=function(_0x33dd07,_0x2f7ec8){if(_0x33dd07['body']['id']){delete _0x33dd07['body']['id'];}return db[_0x5497('0x2e')]['find']({'where':{'id':_0x33dd07[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x2f7ec8,null))[_0x5497('0x25')](saveUpdates(_0x33dd07['body'],null))[_0x5497('0x25')](respondWithResult(_0x2f7ec8,null))[_0x5497('0x47')](handleError(_0x2f7ec8,null));};exports['destroy']=function(_0x418f17,_0x5dccfb){return db['AnalyticDefaultReport'][_0x5497('0x4a')]({'where':{'id':_0x418f17[_0x5497('0x48')]['id']}})['then'](handleEntityNotFound(_0x5dccfb,null))[_0x5497('0x25')](removeEntity(_0x5dccfb,null))[_0x5497('0x47')](handleError(_0x5dccfb,null));};exports[_0x5497('0x52')]=function(_0x28b2a3,_0x3fca40){var _0x25c75e=0xa;var _0x590be7=[_0x5497('0x53'),'left_join','right_join','cross_join'];var _0x1f3965={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x5497('0x56'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x25f349={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':'HOUR(%s)','ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x425995=function(_0xc783ce){return!_['includes']([_0x5497('0x5e'),_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0xc783ce);};var _0x5823f6=function(_0x31271c){if(!_0x31271c||!_0x31271c[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x542bcf='(',_0x1ab48f=0x0;_0x1ab48f<_0x31271c['rules']['length'];_0x1ab48f+=0x1){_0x1ab48f>0x0&&(_0x542bcf+='\x20'+_0x31271c['operator']+'\x20');_0x542bcf+=_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x63')]?_0x5823f6(_0x31271c[_0x5497('0x62')][_0x1ab48f]['group']):_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x64')]+'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x65')]+(_0x425995(_0x31271c['rules'][_0x1ab48f][_0x5497('0x65')])?'\x20'+_0x31271c[_0x5497('0x62')][_0x1ab48f][_0x5497('0x66')]:'');}return _0x542bcf+')';};var _0x49617c={'where':{'id':_0x28b2a3[_0x5497('0x48')]['id']}},_0x164de1,_0x465bed,_0xb3eec2,_0x4368e3,_0x1467c4;_0x49617c=_[_0x5497('0x41')]({},_0x49617c,_0x28b2a3['options']);return db[_0x5497('0x2e')][_0x5497('0x4a')](_0x49617c)[_0x5497('0x25')](function(_0x20efea){if(_0x20efea){_0x164de1=_0x20efea;return _0x20efea['getFields']();}return null;})['then'](function(_0x4a7360){if(_0x4a7360){if(!_0x4a7360[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x465bed=_0x4a7360;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x464df3){if(_0x464df3){_0xb3eec2=_[_0x5497('0x6a')](_0x464df3,'id');var _0x4338d4;var _0x3f38bf=squel[_0x5497('0x6b')]();_0x3f38bf[_0x5497('0x6c')](_0x164de1[_0x5497('0x6d')]);for(var _0x1fc6ad=0x0;_0x1fc6ad<_0x465bed['length'];_0x1fc6ad+=0x1){_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x6e')]?_0xb3eec2[_0x465bed[_0x1fc6ad][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x465bed[_0x1fc6ad]['field'];_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x70')]?_['replace'](_0x1f3965[_0x465bed[_0x1fc6ad][_0x5497('0x70')]],'%s',_0x4338d4):_0x4338d4;_0x4338d4=_0x465bed[_0x1fc6ad][_0x5497('0x71')]?_['replace'](_0x25f349[_0x465bed[_0x1fc6ad][_0x5497('0x71')]],'%s',_0x4338d4):_0x4338d4;if(_0x465bed[_0x1fc6ad][_0x5497('0x72')]){_0x3f38bf[_0x5497('0x63')](_0x4338d4);}_0x465bed[_0x1fc6ad][_0x5497('0x73')]&&_0x3f38bf['order'](_0x4338d4,_0x465bed[_0x1fc6ad][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x3f38bf[_0x5497('0x64')](_0x4338d4,_0x465bed[_0x1fc6ad]['alias']||_0x4338d4);}if(_0x164de1[_0x5497('0x75')]){_0x164de1[_0x5497('0x75')]=JSON['parse'](_0x164de1[_0x5497('0x75')]);for(var _0xebe694=0x0;_0xebe694<_0x164de1[_0x5497('0x75')]['length'];_0xebe694+=0x1){if(_0x164de1['joins'][_0xebe694][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x590be7,_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x30')])&&_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x77')]&&_0x164de1[_0x5497('0x75')][_0xebe694]['foreignTable']&&_0x164de1['joins'][_0xebe694][_0x5497('0x78')]){_0x3f38bf[_0x164de1[_0x5497('0x75')][_0xebe694]['type']](_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],null,util[_0x5497('0x71')]('%s.%s\x20=\x20%s.%s',_0x164de1[_0x5497('0x6d')],_0x164de1[_0x5497('0x75')][_0xebe694]['parentKey'],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x79')],_0x164de1[_0x5497('0x75')][_0xebe694][_0x5497('0x78')]));}}}if(_0x164de1[_0x5497('0x7a')]){_0x164de1['conditions']=JSON[_0x5497('0x7b')](_0x164de1[_0x5497('0x7a')]);_0x3f38bf[_0x5497('0x3d')](_0x5823f6(_0x164de1[_0x5497('0x7a')][_0x5497('0x63')]));}_0x1467c4=_0x3f38bf['clone']();_0x3f38bf[_0x5497('0x20')](_0x25c75e);_0x3f38bf[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')](_0x5497('0x7d'),_0x3f38bf['toString']());return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x3f38bf['toString'](),{'type':dbH[_0x5497('0x7e')][_0x5497('0x7f')][_0x5497('0x80')]});}})[_0x5497('0x25')](respondWithResult(_0x3fca40,null))['catch'](handleError(_0x3fca40,null));};function runReport(_0x547de7,_0x4ff64f,_0x5343d5){var _0x594761=_0x4ff64f[_0x5497('0x2c')];var _0x2375cc=0xa;var _0x15d0da=[_0x5497('0x53'),_0x5497('0x81'),'right_join','cross_join'];var _0x392987={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x4c41c4={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':_0x5497('0x5c'),'UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x22b019=function(_0x4aa4ba){return!_[_0x5497('0x76')](['IS\x20NULL',_0x5497('0x5f'),_0x5497('0x60'),_0x5497('0x61')],_0x4aa4ba);};var _0x5b0f9d=function(_0x59960b){if(!_0x59960b||!_0x59960b[_0x5497('0x62')][_0x5497('0x39')]){return'';}for(var _0x953b31='(',_0xeb52c9=0x0;_0xeb52c9<_0x59960b[_0x5497('0x62')][_0x5497('0x39')];_0xeb52c9+=0x1){_0xeb52c9>0x0&&(_0x953b31+='\x20'+_0x59960b[_0x5497('0x86')]+'\x20');_0x953b31+=_0x59960b[_0x5497('0x62')][_0xeb52c9]['group']?_0x5b0f9d(_0x59960b['rules'][_0xeb52c9]['group']):_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x64')]+'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x65')]+(_0x22b019(_0x59960b['rules'][_0xeb52c9]['condition'])?'\x20'+_0x59960b[_0x5497('0x62')][_0xeb52c9][_0x5497('0x66')]:'');}return _0x953b31+')';};var _0x5dd9bc={'where':{'id':_0x547de7['id']}},_0x83b240,_0x2fc11a,_0x3ce2ee,_0x36c09f,_0x51e9fb;_0x5dd9bc=_['merge']({},_0x5dd9bc,_0x5343d5);return db['AnalyticDefaultReport']['find'](_0x5dd9bc)['then'](function(_0x497295){if(_0x497295){_0x83b240=_0x497295;return _0x497295['getFields']();}return null;})[_0x5497('0x25')](function(_0x5aa5e1){if(_0x5aa5e1){if(!_0x5aa5e1[_0x5497('0x39')]){throw new db[(_0x5497('0x67'))][(_0x5497('0x68'))](_0x5497('0x87'),0x193);}_0x2fc11a=_0x5aa5e1;return db[_0x5497('0x69')][_0x5497('0x45')]({'raw':!![]});}return null;})['then'](function(_0x77d52c){if(_0x77d52c){_0x3ce2ee=_['keyBy'](_0x77d52c,'id');var _0x15a67d;var _0x2721b2=squel[_0x5497('0x6b')]();_0x2721b2[_0x5497('0x6c')](_0x83b240[_0x5497('0x6d')]);for(var _0x38fa59=0x0;_0x38fa59<_0x2fc11a[_0x5497('0x39')];_0x38fa59+=0x1){_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x6e')]?_0x3ce2ee[_0x2fc11a[_0x38fa59][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x2fc11a[_0x38fa59]['field'];_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x70')]?_['replace'](_0x392987[_0x2fc11a[_0x38fa59][_0x5497('0x70')]],'%s',_0x15a67d):_0x15a67d;_0x15a67d=_0x2fc11a[_0x38fa59][_0x5497('0x71')]?_['replace'](_0x4c41c4[_0x2fc11a[_0x38fa59][_0x5497('0x71')]],'%s',_0x15a67d):_0x15a67d;if(_0x2fc11a[_0x38fa59][_0x5497('0x72')]){_0x2721b2[_0x5497('0x63')](_0x15a67d);}_0x2fc11a[_0x38fa59][_0x5497('0x73')]&&_0x2721b2[_0x5497('0x3b')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x2721b2[_0x5497('0x64')](_0x15a67d,_0x2fc11a[_0x38fa59][_0x5497('0x88')]||_0x15a67d);}if(_0x83b240[_0x5497('0x75')]){_0x83b240[_0x5497('0x75')]=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x75')]);for(var _0x22426e=0x0;_0x22426e<_0x83b240['joins'][_0x5497('0x39')];_0x22426e+=0x1){if(_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]&&_[_0x5497('0x76')](_0x15d0da,_0x83b240[_0x5497('0x75')][_0x22426e]['type'])&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')]&&_0x83b240['joins'][_0x22426e]['foreignTable']&&_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]){_0x2721b2[_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x30')]](_0x83b240[_0x5497('0x75')][_0x22426e]['foreignTable'],null,util['format'](_0x5497('0x89'),_0x83b240['table'],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x77')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x79')],_0x83b240[_0x5497('0x75')][_0x22426e][_0x5497('0x78')]));}}}if(_0x83b240['conditions']){_0x83b240['conditions']=JSON[_0x5497('0x7b')](_0x83b240[_0x5497('0x7a')]);_0x2721b2[_0x5497('0x3d')](_0x5b0f9d(_0x83b240['conditions'][_0x5497('0x63')]));}_0x51e9fb=_0x2721b2['clone']();_0x2721b2[_0x5497('0x20')](_0x2375cc);_0x2721b2['offset'](0x0);return;}})['then'](function(){if(_0x4ff64f[_0x5497('0x8a')]===_0x5497('0x8b')){return null;}var _0x4ce768=_[_0x5497('0x41')](_0x4ff64f,{'name':_0x4ff64f[_0x5497('0x8c')]||_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],'basename':_0x594761,'savename':util['format'](_0x5497('0x8d'),_0x4ff64f[_0x5497('0x2c')]||_0x83b240[_0x5497('0x2c')],require(_0x5497('0x8e'))[_0x5497('0x8f')](0x4),_0x4ff64f['output']||_0x5497('0x90')),'reportId':_0x83b240['id'],'reportType':'default'});return db[_0x5497('0x91')][_0x5497('0x50')](_0x4ce768,{'raw':!![]});})[_0x5497('0x25')](function(_0x314db4){if(_0x83b240[_0x5497('0x6d')]===_0x5497('0x92')){_0x51e9fb[_0x5497('0x3d')](_0x83b240[_0x5497('0x6d')]+_0x5497('0x93'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}else{_0x51e9fb['where'](_0x83b240[_0x5497('0x6d')]+_0x5497('0x96'),_0x4ff64f[_0x5497('0x94')],_0x4ff64f[_0x5497('0x95')]);}if(_0x314db4){logger[_0x5497('0x97')](_0x5497('0x98'),_0x51e9fb[_0x5497('0x99')]());require(_0x5497('0x9a'))[_0x5497('0x9b')](path[_0x5497('0x53')](__dirname,_0x5497('0x9c'),_0x314db4['output']),[_0x314db4['id'],_0x51e9fb[_0x5497('0x99')](),path[_0x5497('0x53')](__dirname,_0x5497('0x9d'),_0x314db4[_0x5497('0x9e')]),_0x594761]);return _0x314db4;}else{var _0x46be08=squel[_0x5497('0x6b')]();_0x46be08[_0x5497('0x6c')]('('+_0x51e9fb[_0x5497('0x99')]()+')',_0x5497('0x9f'));_0x46be08[_0x5497('0x64')](_0x5497('0xa0'),_0x5497('0x1f'));_0x51e9fb[_0x5497('0x20')](_0x4ff64f[_0x5497('0x20')]||_0x2375cc);_0x51e9fb['offset'](_0x4ff64f['offset']||0x0);return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x46be08[_0x5497('0x99')](),{'type':dbH['sequelize'][_0x5497('0x7f')][_0x5497('0x80')]})[_0x5497('0x25')](function(_0x2bd48c){if(!_0x2bd48c[_0x5497('0x39')]){_0x36c09f=0x0;}else{_0x36c09f=_0x2bd48c[0x0][_0x5497('0x1f')]||0x0;}return dbH[_0x5497('0x7e')][_0x5497('0x33')](_0x51e9fb['toString'](),{'type':dbH['sequelize']['QueryTypes'][_0x5497('0x80')]});})[_0x5497('0x25')](function(_0x4dab6a){return{'rows':_0x4dab6a||[],'count':_0x36c09f};});}});}exports[_0x5497('0xa1')]=function(_0x27f42b,_0x1bef85){return runReport(_0x27f42b['params'],_0x27f42b[_0x5497('0x33')],_0x27f42b['options'])[_0x5497('0x25')](respondWithResult(_0x1bef85,null))[_0x5497('0x47')](handleError(_0x1bef85,null));};exports[_0x5497('0xa2')]=runReport;exports['query']=function(_0x1c3dad,_0xfba062){var _0x494cc3=0xa;var _0x401f04=[_0x5497('0x53'),_0x5497('0x81'),'right_join',_0x5497('0xa3')];var _0x1a5c32={'SUM':_0x5497('0x54'),'COUNT':_0x5497('0x55'),'COUNT DISTINCT':_0x5497('0x82'),'MAX':_0x5497('0x56'),'MIN':_0x5497('0x83'),'AVG':_0x5497('0x84'),'GROUP_CONCAT':_0x5497('0x57'),'GROUP_CONCAT ASC':_0x5497('0x58'),'GROUP_CONCAT DESC':_0x5497('0x59')};var _0x1dfb76={'SEC_TO_TIME':_0x5497('0x5a'),'DATE':_0x5497('0x5b'),'HOUR':_0x5497('0x85'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5497('0x5d')};var _0x5c2517=function(_0x367929){return!_[_0x5497('0x76')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x5497('0x60'),_0x5497('0x61')],_0x367929);};var _0x2fd2e3=function(_0x2fe770){if(!_0x2fe770||!_0x2fe770['rules'][_0x5497('0x39')]){return'';}for(var _0x1299cd='(',_0x4c2b14=0x0;_0x4c2b14<_0x2fe770['rules'][_0x5497('0x39')];_0x4c2b14+=0x1){_0x4c2b14>0x0&&(_0x1299cd+='\x20'+_0x2fe770[_0x5497('0x86')]+'\x20');_0x1299cd+=_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x63')]?_0x2fd2e3(_0x2fe770[_0x5497('0x62')][_0x4c2b14]['group']):_0x2fe770['rules'][_0x4c2b14][_0x5497('0x64')]+'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14]['condition']+(_0x5c2517(_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x65')])?'\x20'+_0x2fe770[_0x5497('0x62')][_0x4c2b14][_0x5497('0x66')]:'');}return _0x1299cd+')';};var _0x358ec5={'where':{'id':_0x1c3dad['params']['id']}},_0x5cddbc,_0x188d21,_0xf92129,_0x2d5cc1,_0x4f9228;_0x358ec5=_[_0x5497('0x41')]({},_0x358ec5,_0x1c3dad[_0x5497('0x42')]);return db[_0x5497('0x2e')]['find'](_0x358ec5)[_0x5497('0x25')](function(_0x30a248){if(_0x30a248){_0x5cddbc=_0x30a248;return _0x30a248[_0x5497('0xa4')]();}return null;})['then'](function(_0x1d4c76){if(_0x1d4c76){if(!_0x1d4c76[_0x5497('0x39')]){throw new db['Sequelize']['ValidationErrorItem'](_0x5497('0x87'),0x193);}_0x188d21=_0x1d4c76;return db[_0x5497('0x69')]['findAll']({'raw':!![]});}return null;})[_0x5497('0x25')](function(_0x5001d5){if(_0x5001d5){_0xf92129=_[_0x5497('0x6a')](_0x5001d5,'id');var _0x2c58e6;var _0x300f3e=squel[_0x5497('0x6b')]();_0x300f3e[_0x5497('0x6c')](_0x5cddbc[_0x5497('0x6d')]);for(var _0x23732d=0x0;_0x23732d<_0x188d21['length'];_0x23732d+=0x1){_0x2c58e6=_0x188d21[_0x23732d]['MetricId']?_0xf92129[_0x188d21[_0x23732d][_0x5497('0x6e')]][_0x5497('0x6f')]:_0x188d21[_0x23732d]['field'];_0x2c58e6=_0x188d21[_0x23732d]['function']?_[_0x5497('0xa5')](_0x1a5c32[_0x188d21[_0x23732d][_0x5497('0x70')]],'%s',_0x2c58e6):_0x2c58e6;_0x2c58e6=_0x188d21[_0x23732d][_0x5497('0x71')]?_[_0x5497('0xa5')](_0x1dfb76[_0x188d21[_0x23732d][_0x5497('0x71')]],'%s',_0x2c58e6):_0x2c58e6;if(_0x188d21[_0x23732d][_0x5497('0x72')]){_0x300f3e['group'](_0x2c58e6);}_0x188d21[_0x23732d][_0x5497('0x73')]&&_0x300f3e[_0x5497('0x3b')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x73')]===_0x5497('0x74')?![]:!![]);_0x300f3e[_0x5497('0x64')](_0x2c58e6,_0x188d21[_0x23732d][_0x5497('0x88')]||_0x2c58e6);}if(_0x5cddbc['joins']){_0x5cddbc[_0x5497('0x75')]=JSON['parse'](_0x5cddbc[_0x5497('0x75')]);for(var _0x261804=0x0;_0x261804<_0x5cddbc[_0x5497('0x75')]['length'];_0x261804+=0x1){if(_0x5cddbc[_0x5497('0x75')][_0x261804]['type']&&_['includes'](_0x401f04,_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')])&&_0x5cddbc['joins'][_0x261804][_0x5497('0x77')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')]&&_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]){_0x300f3e[_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x30')]](_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],null,util['format'](_0x5497('0x89'),_0x5cddbc[_0x5497('0x6d')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x77')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x79')],_0x5cddbc[_0x5497('0x75')][_0x261804][_0x5497('0x78')]));}}}if(_0x5cddbc[_0x5497('0x7a')]){_0x5cddbc[_0x5497('0x7a')]=JSON[_0x5497('0x7b')](_0x5cddbc[_0x5497('0x7a')]);_0x300f3e[_0x5497('0x3d')](_0x2fd2e3(_0x5cddbc[_0x5497('0x7a')][_0x5497('0x63')]));}_0x4f9228=_0x300f3e[_0x5497('0xa6')]();_0x300f3e[_0x5497('0x20')](_0x494cc3);_0x300f3e[_0x5497('0x1d')](0x0);logger[_0x5497('0x7c')]('Limited\x20Query:',_0x300f3e[_0x5497('0x99')]());return dbH[_0x5497('0x7e')]['query'](_0x300f3e['toString'](),{'type':dbH[_0x5497('0x7e')]['QueryTypes'][_0x5497('0x80')]});}})[_0x5497('0x25')](function(){return{'sql':_0x4f9228[_0x5497('0x99')]()};})[_0x5497('0x25')](respondWithResult(_0xfba062,null))[_0x5497('0x47')](handleError(_0xfba062,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 37c5be6..ccb634a 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 _0xca93=['../../config/environment','./analyticDefaultReport.attributes','exports','analytics_default_reports','util','../../config/logger','api','moment','path','rimraf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xca93,0xae));var _0x3ca9=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xca93[_0x12d033];return _0x3b4e80;};'use strict';var _=require('lodash');var util=require(_0x3ca9('0x0'));var logger=require(_0x3ca9('0x1'))(_0x3ca9('0x2'));var moment=require(_0x3ca9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3ca9('0x4'));var rimraf=require(_0x3ca9('0x5'));var config=require(_0x3ca9('0x6'));var attributes=require(_0x3ca9('0x7'));module[_0x3ca9('0x8')]=function(_0x10bfa1,_0x31e32b){return _0x10bfa1['define']('AnalyticDefaultReport',attributes,{'tableName':_0x3ca9('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xf1b7=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','analytics_default_reports','util','../../config/logger','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf1b7,0x134));var _0x7f1b=function(_0x5be16a,_0x145a69){_0x5be16a=_0x5be16a-0x0;var _0x5eb46e=_0xf1b7[_0x5be16a];return _0x5eb46e;};'use strict';var _=require('lodash');var util=require(_0x7f1b('0x0'));var logger=require(_0x7f1b('0x1'))(_0x7f1b('0x2'));var moment=require(_0x7f1b('0x3'));var BPromise=require(_0x7f1b('0x4'));var rp=require(_0x7f1b('0x5'));var fs=require('fs');var path=require(_0x7f1b('0x6'));var rimraf=require(_0x7f1b('0x7'));var config=require(_0x7f1b('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x7f1b('0x9')]=function(_0x45e584,_0x584877){return _0x45e584[_0x7f1b('0xa')]('AnalyticDefaultReport',attributes,{'tableName':_0x7f1b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js
index 1d8e83d..2a814b8 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 _0x503b=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x503b,0x73));var _0xb503=function(_0x486805,_0x12bd34){_0x486805=_0x486805-0x0;var _0x2e9173=_0x503b[_0x486805];return _0x2e9173;};'use strict';var _=require(_0xb503('0x0'));var util=require(_0xb503('0x1'));var moment=require(_0xb503('0x2'));var BPromise=require(_0xb503('0x3'));var rs=require(_0xb503('0x4'));var fs=require('fs');var Redis=require(_0xb503('0x5'));var db=require(_0xb503('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb503('0x7'));var config=require(_0xb503('0x8'));var jayson=require(_0xb503('0x9'));var client=jayson[_0xb503('0xa')][_0xb503('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x39a8b7,_0x1d7b1b,_0x34504b){return new BPromise(function(_0x4409de,_0x4e15cd){return client[_0xb503('0xc')](_0x39a8b7,_0x34504b)['then'](function(_0x354eb0){logger['info'](_0xb503('0xd'),_0x1d7b1b,_0xb503('0xe'));logger['debug'](_0xb503('0xf'),_0x1d7b1b,_0xb503('0xe'),JSON[_0xb503('0x10')](_0x354eb0));if(_0x354eb0[_0xb503('0x11')]){if(_0x354eb0[_0xb503('0x11')][_0xb503('0x12')]===0x1f4){logger[_0xb503('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1d7b1b,_0x354eb0[_0xb503('0x11')][_0xb503('0x13')]);return _0x4e15cd(_0x354eb0['error'][_0xb503('0x13')]);}logger[_0xb503('0x11')](_0xb503('0xd'),_0x1d7b1b,_0x354eb0[_0xb503('0x11')][_0xb503('0x13')]);return _0x4409de(_0x354eb0[_0xb503('0x11')][_0xb503('0x13')]);}else{logger[_0xb503('0x14')](_0xb503('0xd'),_0x1d7b1b,'request\x20sent');_0x4409de(_0x354eb0[_0xb503('0x15')][_0xb503('0x13')]);}})[_0xb503('0x16')](function(_0x89df0f){logger[_0xb503('0x11')](_0xb503('0xd'),_0x1d7b1b,_0x89df0f);_0x4e15cd(_0x89df0f);});});}
\ No newline at end of file
+var _0x756d=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x40cded,_0x39ce20){var _0x50fcda=function(_0x15b3ce){while(--_0x15b3ce){_0x40cded['push'](_0x40cded['shift']());}};_0x50fcda(++_0x39ce20);}(_0x756d,0x82));var _0xd756=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x756d[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xd756('0x0'));var util=require('util');var moment=require(_0xd756('0x1'));var BPromise=require(_0xd756('0x2'));var rs=require(_0xd756('0x3'));var fs=require('fs');var Redis=require(_0xd756('0x4'));var db=require(_0xd756('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xd756('0x6'));var jayson=require(_0xd756('0x7'));var client=jayson[_0xd756('0x8')][_0xd756('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2524b5,_0x47b9a1,_0x19727d){return new BPromise(function(_0x6a637d,_0x5e8ac1){return client[_0xd756('0xa')](_0x2524b5,_0x19727d)[_0xd756('0xb')](function(_0x5e809d){logger['info'](_0xd756('0xc'),_0x47b9a1,'request\x20sent');logger['debug'](_0xd756('0xd'),_0x47b9a1,_0xd756('0xe'),JSON[_0xd756('0xf')](_0x5e809d));if(_0x5e809d['error']){if(_0x5e809d[_0xd756('0x10')][_0xd756('0x11')]===0x1f4){logger[_0xd756('0x10')](_0xd756('0xc'),_0x47b9a1,_0x5e809d['error'][_0xd756('0x12')]);return _0x5e8ac1(_0x5e809d[_0xd756('0x10')]['message']);}logger[_0xd756('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x47b9a1,_0x5e809d[_0xd756('0x10')][_0xd756('0x12')]);return _0x6a637d(_0x5e809d[_0xd756('0x10')]['message']);}else{logger['info'](_0xd756('0xc'),_0x47b9a1,'request\x20sent');_0x6a637d(_0x5e809d[_0xd756('0x13')][_0xd756('0x12')]);}})[_0xd756('0x14')](function(_0x2525cf){logger[_0xd756('0x10')](_0xd756('0xc'),_0x47b9a1,_0x2525cf);_0x5e8ac1(_0x2525cf);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index f382753..05361e0 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 _0xc97e=['Router','fs-extra','../../config/environment','./analyticDefaultReport.controller','index','get','/:id','isAuthenticated','show','/:id/preview','preview','run','/:id/query','query','post','put','update','delete','exports','multer','path','connect-timeout'];(function(_0x17dde4,_0x5c5ada){var _0x2a1076=function(_0x2b9df8){while(--_0x2b9df8){_0x17dde4['push'](_0x17dde4['shift']());}};_0x2a1076(++_0x5c5ada);}(_0xc97e,0x19f));var _0xec97=function(_0x291a25,_0x31ae01){_0x291a25=_0x291a25-0x0;var _0x380fab=_0xc97e[_0x291a25];return _0x380fab;};'use strict';var multer=require(_0xec97('0x0'));var util=require('util');var path=require(_0xec97('0x1'));var timeout=require(_0xec97('0x2'));var express=require('express');var router=express[_0xec97('0x3')]();var fs_extra=require(_0xec97('0x4'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xec97('0x5'));var controller=require(_0xec97('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0xec97('0x7')]);router[_0xec97('0x8')](_0xec97('0x9'),auth[_0xec97('0xa')](),controller[_0xec97('0xb')]);router[_0xec97('0x8')](_0xec97('0xc'),auth[_0xec97('0xa')](),controller[_0xec97('0xd')]);router['get']('/:id/run',auth[_0xec97('0xa')](),controller[_0xec97('0xe')]);router[_0xec97('0x8')](_0xec97('0xf'),auth['isAuthenticated'](),controller[_0xec97('0x10')]);router[_0xec97('0x11')]('/',auth[_0xec97('0xa')](),controller['create']);router[_0xec97('0x12')](_0xec97('0x9'),auth[_0xec97('0xa')](),controller[_0xec97('0x13')]);router[_0xec97('0x14')](_0xec97('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xec97('0x15')]=router;
\ No newline at end of file
+var _0xb296=['show','/:id/preview','preview','/:id/run','run','query','post','create','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','./analyticDefaultReport.controller','get','index','/:id','isAuthenticated'];(function(_0x20b12e,_0x2e7c49){var _0x1772a0=function(_0x5865ce){while(--_0x5865ce){_0x20b12e['push'](_0x20b12e['shift']());}};_0x1772a0(++_0x2e7c49);}(_0xb296,0xa3));var _0x6b29=function(_0x6460fa,_0x322653){_0x6460fa=_0x6460fa-0x0;var _0x4422ac=_0xb296[_0x6460fa];return _0x4422ac;};'use strict';var multer=require(_0x6b29('0x0'));var util=require(_0x6b29('0x1'));var path=require(_0x6b29('0x2'));var timeout=require(_0x6b29('0x3'));var express=require(_0x6b29('0x4'));var router=express[_0x6b29('0x5')]();var fs_extra=require(_0x6b29('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x6b29('0x7'));var config=require('../../config/environment');var controller=require(_0x6b29('0x8'));router[_0x6b29('0x9')]('/',auth['isAuthenticated'](),controller[_0x6b29('0xa')]);router[_0x6b29('0x9')](_0x6b29('0xb'),auth[_0x6b29('0xc')](),controller[_0x6b29('0xd')]);router['get'](_0x6b29('0xe'),auth[_0x6b29('0xc')](),controller[_0x6b29('0xf')]);router[_0x6b29('0x9')](_0x6b29('0x10'),auth[_0x6b29('0xc')](),controller[_0x6b29('0x11')]);router[_0x6b29('0x9')]('/:id/query',auth[_0x6b29('0xc')](),controller[_0x6b29('0x12')]);router[_0x6b29('0x13')]('/',auth['isAuthenticated'](),controller[_0x6b29('0x14')]);router['put']('/:id',auth[_0x6b29('0xc')](),controller['update']);router['delete'](_0x6b29('0xb'),auth[_0x6b29('0xc')](),controller['destroy']);module[_0x6b29('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index edf937b..4e93e74 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 _0xbae3=['scheduled','sequelize','exports','STRING','ENUM','pdf','xlsx','csv','DATE','Loading','manual'];(function(_0x3a4318,_0x13c6eb){var _0x36d746=function(_0x508617){while(--_0x508617){_0x3a4318['push'](_0x3a4318['shift']());}};_0x36d746(++_0x13c6eb);}(_0xbae3,0x90));var _0x3bae=function(_0x5ddc6a,_0x5aa4ee){_0x5ddc6a=_0x5ddc6a-0x0;var _0x5d297e=_0xbae3[_0x5ddc6a];return _0x5d297e;};'use strict';var Sequelize=require(_0x3bae('0x0'));var moment=require('moment');module[_0x3bae('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0x3bae('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x3bae('0x3')]('csv',_0x3bae('0x4'),_0x3bae('0x5')),'allowNull':![],'defaultValue':_0x3bae('0x6')},'savename':{'type':Sequelize[_0x3bae('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x3bae('0x7')]},'endDate':{'type':Sequelize[_0x3bae('0x7')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0x3bae('0x8')},'type':{'type':Sequelize[_0x3bae('0x3')](_0x3bae('0x9'),_0x3bae('0xa')),'allowNull':![],'defaultValue':_0x3bae('0x9')},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xea7e=['STRING','ENUM','csv','DATE','Loading','scheduled','INTEGER','UNSIGNED','sequelize','exports'];(function(_0x570acd,_0x4adcde){var _0x1cd437=function(_0x558416){while(--_0x558416){_0x570acd['push'](_0x570acd['shift']());}};_0x1cd437(++_0x4adcde);}(_0xea7e,0x10c));var _0xeea7=function(_0x30e8db,_0x3dab00){_0x30e8db=_0x30e8db-0x0;var _0x1c7a80=_0xea7e[_0x30e8db];return _0x1c7a80;};'use strict';var Sequelize=require(_0xeea7('0x0'));var moment=require('moment');module[_0xeea7('0x1')]={'name':{'type':Sequelize[_0xeea7('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xeea7('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xeea7('0x3')](_0xeea7('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xeea7('0x4')},'savename':{'type':Sequelize[_0xeea7('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xeea7('0x5')]},'endDate':{'type':Sequelize[_0xeea7('0x5')]},'status':{'type':Sequelize['STRING'],'defaultValue':_0xeea7('0x6')},'type':{'type':Sequelize[_0xeea7('0x3')]('manual',_0xeea7('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xeea7('0x8')](0xb)[_0xeea7('0x9')]},'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 1949d08..907286c 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 _0x2617=['where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ExtractedReports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','basename','savename','output','existsSync','join','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','download','root','%s.%s','toLowerCase','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','get','UserProfileResource','destroy','error','name','send','AnalyticExtractedReport','rawAttributes','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort'];(function(_0x4a71f0,_0x5a7b6c){var _0x3b169c=function(_0x342d80){while(--_0x342d80){_0x4a71f0['push'](_0x4a71f0['shift']());}};_0x3b169c(++_0x5a7b6c);}(_0x2617,0xd9));var _0x7261=function(_0x10bfbf,_0x1c839e){_0x10bfbf=_0x10bfbf-0x0;var _0xca4140=_0x2617[_0x10bfbf];return _0xca4140;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7261('0x0'));var jsonpatch=require(_0x7261('0x1'));var rp=require('request-promise');var moment=require(_0x7261('0x2'));var BPromise=require(_0x7261('0x3'));var Mustache=require(_0x7261('0x4'));var util=require('util');var path=require('path');var sox=require(_0x7261('0x5'));var csv=require(_0x7261('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x7261('0x7'));var crypto=require(_0x7261('0x8'));var jsforce=require('jsforce');var deskjs=require(_0x7261('0x9'));var toCsv=require(_0x7261('0x6'));var querystring=require(_0x7261('0xa'));var Papa=require(_0x7261('0xb'));var Redis=require('ioredis');var authService=require(_0x7261('0xc'));var qs=require(_0x7261('0xd'));var as=require(_0x7261('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7261('0xf'))(_0x7261('0x10'));var utils=require('../../config/utils');var config=require(_0x7261('0x11'));var licenseUtil=require(_0x7261('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3273af,_0x74b3e7){_0x74b3e7=_0x74b3e7||0xcc;return function(_0x229233){if(_0x229233){return _0x3273af[_0x7261('0x13')](_0x74b3e7);}return _0x3273af[_0x7261('0x14')](_0x74b3e7)[_0x7261('0x15')]();};}function respondWithResult(_0x58eeb1,_0x4dafb3){_0x4dafb3=_0x4dafb3||0xc8;return function(_0x19cc84){if(_0x19cc84){return _0x58eeb1[_0x7261('0x14')](_0x4dafb3)[_0x7261('0x16')](_0x19cc84);}};}function respondWithFilteredResult(_0x5d0d40,_0x2a421b){return function(_0xe3bb86){if(_0xe3bb86){var _0x2d47e4=typeof _0x2a421b[_0x7261('0x17')]===_0x7261('0x18')&&typeof _0x2a421b['limit']===_0x7261('0x18');var _0x85d3cb=_0xe3bb86[_0x7261('0x19')];var _0x4ad066=_0x2d47e4?0x0:_0x2a421b[_0x7261('0x17')];var _0x4fdefd=_0x2d47e4?_0xe3bb86[_0x7261('0x19')]:_0x2a421b[_0x7261('0x17')]+_0x2a421b['limit'];var _0x3a3db5;if(_0x4fdefd>=_0x85d3cb){_0x4fdefd=_0x85d3cb;_0x3a3db5=0xc8;}else{_0x3a3db5=0xce;}_0x5d0d40[_0x7261('0x14')](_0x3a3db5);return _0x5d0d40[_0x7261('0x1a')](_0x7261('0x1b'),_0x4ad066+'-'+_0x4fdefd+'/'+_0x85d3cb)[_0x7261('0x16')](_0xe3bb86);}return null;};}function patchUpdates(_0x439359){return function(_0x26bb55){try{jsonpatch[_0x7261('0x1c')](_0x26bb55,_0x439359,!![]);}catch(_0x236bb1){return BPromise[_0x7261('0x1d')](_0x236bb1);}return _0x26bb55['save']();};}function saveUpdates(_0x374710,_0x32edc7){return function(_0x1adf45){if(_0x1adf45){return _0x1adf45[_0x7261('0x1e')](_0x374710)[_0x7261('0x1f')](function(_0x374e96){return _0x374e96;});}return null;};}function removeEntity(_0x278022,_0x54d7cd){return function(_0x237dc3){if(_0x237dc3){return _0x237dc3['destroy']()[_0x7261('0x1f')](function(){var _0x2d5587=_0x237dc3[_0x7261('0x20')]({'plain':!![]});var _0x30e5eb='ExtractedReports';return db[_0x7261('0x21')][_0x7261('0x22')]({'where':{'type':_0x30e5eb,'resourceId':_0x2d5587['id']}})['then'](function(){return _0x237dc3;});})['then'](function(){_0x278022[_0x7261('0x14')](0xcc)[_0x7261('0x15')]();});}};}function handleEntityNotFound(_0x1ef32f,_0x365d38){return function(_0x3362b4){if(!_0x3362b4){_0x1ef32f[_0x7261('0x13')](0x194);}return _0x3362b4;};}function handleError(_0x5dec5b,_0x17bef8){_0x17bef8=_0x17bef8||0x1f4;return function(_0x5a3099){logger[_0x7261('0x23')](_0x5a3099['stack']);if(_0x5a3099[_0x7261('0x24')]){delete _0x5a3099[_0x7261('0x24')];}_0x5dec5b[_0x7261('0x14')](_0x17bef8)[_0x7261('0x25')](_0x5a3099);};}exports['index']=function(_0x36350e,_0x386f1d){var _0x5b5d10={},_0x2d32e3={},_0x49f058={'count':0x0,'rows':[]};var _0x49537b=_['map'](db[_0x7261('0x26')][_0x7261('0x27')],function(_0x5a502a){return{'name':_0x5a502a['fieldName'],'type':_0x5a502a[_0x7261('0x28')][_0x7261('0x29')]};});_0x2d32e3['model']=_[_0x7261('0x2a')](_0x49537b,'name');_0x2d32e3[_0x7261('0x2b')]=_[_0x7261('0x2c')](_0x36350e['query']);_0x2d32e3[_0x7261('0x2d')]=_[_0x7261('0x2e')](_0x2d32e3[_0x7261('0x2f')],_0x2d32e3[_0x7261('0x2b')]);_0x5b5d10[_0x7261('0x30')]=_['intersection'](_0x2d32e3['model'],qs['fields'](_0x36350e[_0x7261('0x2b')][_0x7261('0x31')]));_0x5b5d10[_0x7261('0x30')]=_0x5b5d10[_0x7261('0x30')][_0x7261('0x32')]?_0x5b5d10[_0x7261('0x30')]:_0x2d32e3[_0x7261('0x2f')];if(!_0x36350e['query'][_0x7261('0x33')](_0x7261('0x34'))){_0x5b5d10['limit']=qs[_0x7261('0x35')](_0x36350e[_0x7261('0x2b')][_0x7261('0x35')]);_0x5b5d10[_0x7261('0x17')]=qs[_0x7261('0x17')](_0x36350e[_0x7261('0x2b')]['offset']);}_0x5b5d10[_0x7261('0x36')]=qs[_0x7261('0x37')](_0x36350e[_0x7261('0x2b')][_0x7261('0x37')]);_0x5b5d10[_0x7261('0x38')]=qs[_0x7261('0x2d')](_[_0x7261('0x39')](_0x36350e['query'],_0x2d32e3[_0x7261('0x2d')]),_0x49537b);if(_0x36350e[_0x7261('0x2b')][_0x7261('0x3a')]){_0x5b5d10[_0x7261('0x38')]=_[_0x7261('0x3b')](_0x5b5d10[_0x7261('0x38')],{'$or':_[_0x7261('0x2a')](_0x49537b,function(_0xa68837){if(_0xa68837[_0x7261('0x28')]!==_0x7261('0x3c')){var _0x2514cb={};_0x2514cb[_0xa68837[_0x7261('0x24')]]={'$like':'%'+_0x36350e['query'][_0x7261('0x3a')]+'%'};return _0x2514cb;}})});}_0x5b5d10=_['merge']({},_0x5b5d10,_0x36350e[_0x7261('0x3d')]);var _0x2a9a76={'where':_0x5b5d10[_0x7261('0x38')]};return db[_0x7261('0x26')][_0x7261('0x19')](_0x2a9a76)[_0x7261('0x1f')](function(_0x2e995d){_0x49f058[_0x7261('0x19')]=_0x2e995d;if(_0x36350e[_0x7261('0x2b')][_0x7261('0x3e')]){_0x5b5d10[_0x7261('0x3f')]=[{'all':!![]}];}return db[_0x7261('0x26')][_0x7261('0x40')](_0x5b5d10);})[_0x7261('0x1f')](function(_0x47b0b7){_0x49f058[_0x7261('0x41')]=_0x47b0b7;return _0x49f058;})[_0x7261('0x1f')](respondWithFilteredResult(_0x386f1d,_0x5b5d10))[_0x7261('0x42')](handleError(_0x386f1d,null));};exports[_0x7261('0x43')]=function(_0x258bcd,_0x4c95f5){var _0x538e96={'raw':!![],'where':{'id':_0x258bcd['params']['id']}},_0x10b861={};_0x10b861[_0x7261('0x2f')]=_[_0x7261('0x2c')](db[_0x7261('0x26')][_0x7261('0x27')]);_0x10b861[_0x7261('0x2b')]=_[_0x7261('0x2c')](_0x258bcd['query']);_0x10b861[_0x7261('0x2d')]=_[_0x7261('0x2e')](_0x10b861[_0x7261('0x2f')],_0x10b861['query']);_0x538e96[_0x7261('0x30')]=_[_0x7261('0x2e')](_0x10b861['model'],qs[_0x7261('0x31')](_0x258bcd[_0x7261('0x2b')][_0x7261('0x31')]));_0x538e96[_0x7261('0x30')]=_0x538e96[_0x7261('0x30')][_0x7261('0x32')]?_0x538e96[_0x7261('0x30')]:_0x10b861[_0x7261('0x2f')];if(_0x258bcd[_0x7261('0x2b')][_0x7261('0x3e')]){_0x538e96[_0x7261('0x3f')]=[{'all':!![]}];}_0x538e96=_[_0x7261('0x3b')]({},_0x538e96,_0x258bcd['options']);return db[_0x7261('0x26')][_0x7261('0x44')](_0x538e96)[_0x7261('0x1f')](handleEntityNotFound(_0x4c95f5,null))['then'](respondWithResult(_0x4c95f5,null))['catch'](handleError(_0x4c95f5,null));};exports[_0x7261('0x45')]=function(_0xe74cc4,_0x300acf){return db[_0x7261('0x26')][_0x7261('0x45')](_0xe74cc4[_0x7261('0x46')],{})['then'](function(_0xf733e6){var _0x5baebb=_0xe74cc4[_0x7261('0x47')][_0x7261('0x20')]({'plain':!![]});if(!_0x5baebb)throw new Error(_0x7261('0x48'));if(_0x5baebb['role']==='user'){var _0x36f8c7=_0xf733e6['get']({'plain':!![]});var _0x2809c6=_0x7261('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x2809c6,'userProfileId':_0x5baebb[_0x7261('0x4a')]},'raw':!![]})['then'](function(_0x18a7c2){if(_0x18a7c2&&_0x18a7c2[_0x7261('0x4b')]===0x0){return db[_0x7261('0x21')][_0x7261('0x45')]({'name':_0x36f8c7[_0x7261('0x24')],'resourceId':_0x36f8c7['id'],'type':_0x18a7c2[_0x7261('0x24')],'sectionId':_0x18a7c2['id']},{})[_0x7261('0x1f')](function(){return _0xf733e6;});}else{return _0xf733e6;}})[_0x7261('0x42')](function(_0x4aadc6){logger['error'](_0x7261('0x4c'),_0x4aadc6);throw _0x4aadc6;});}return _0xf733e6;})[_0x7261('0x1f')](respondWithResult(_0x300acf,0xc9))[_0x7261('0x42')](handleError(_0x300acf,null));};exports[_0x7261('0x1e')]=function(_0x52f1b5,_0x19db0e){if(_0x52f1b5['body']['id']){delete _0x52f1b5[_0x7261('0x46')]['id'];}return db[_0x7261('0x26')][_0x7261('0x44')]({'where':{'id':_0x52f1b5[_0x7261('0x4d')]['id']}})['then'](handleEntityNotFound(_0x19db0e,null))[_0x7261('0x1f')](saveUpdates(_0x52f1b5[_0x7261('0x46')],null))[_0x7261('0x1f')](respondWithResult(_0x19db0e,null))[_0x7261('0x42')](handleError(_0x19db0e,null));};exports['destroy']=function(_0x5c78ef,_0x470fee){return db['AnalyticExtractedReport'][_0x7261('0x44')]({'where':{'id':_0x5c78ef['params']['id']}})[_0x7261('0x1f')](handleEntityNotFound(_0x470fee,null))[_0x7261('0x1f')](removeEntity(_0x470fee,null))[_0x7261('0x42')](handleError(_0x470fee,null));};exports['download']=function(_0x38d838,_0x2611a6,_0x16d818){return db[_0x7261('0x26')][_0x7261('0x44')]({'where':{'id':_0x38d838[_0x7261('0x4d')]['id']},'attributes':[_0x7261('0x24'),_0x7261('0x4e'),_0x7261('0x4f'),_0x7261('0x50')],'raw':!![]})[_0x7261('0x1f')](handleEntityNotFound(_0x2611a6,null))[_0x7261('0x1f')](function(_0x14006f){if(_0x14006f){if(!fs[_0x7261('0x51')](path[_0x7261('0x52')](config['root'],_0x7261('0x53'),_0x14006f[_0x7261('0x4f')]))){throw new db[(_0x7261('0x54'))][(_0x7261('0x55'))](_0x7261('0x56'));}if(_0x38d838[_0x7261('0x2b')]['exists']){return _0x2611a6[_0x7261('0x13')](0xc8);}return _0x2611a6[_0x7261('0x57')](path[_0x7261('0x52')](config[_0x7261('0x58')],_0x7261('0x53'),_0x14006f[_0x7261('0x4f')]),util['format'](_0x7261('0x59'),_0x14006f[_0x7261('0x4e')]||_0x14006f['name'],_0x14006f['output'][_0x7261('0x5a')]()));}})[_0x7261('0x42')](handleError(_0x2611a6,null));};
\ No newline at end of file
+var _0x9d87=['join','Sequelize','Report\x20not\x20found\x20or\x20empty','exists','root','server/files/reports','savename','format','toLowerCase','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','json','offset','undefined','limit','count','status','set','Content-Range','apply','reject','save','update','then','destroy','ExtractedReports','sendStatus','error','send','index','map','AnalyticExtractedReport','key','model','name','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','includeAll','include','rows','params','rawAttributes','length','options','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','download','basename','output'];(function(_0x5ddaac,_0x2697a8){var _0x2a9c58=function(_0x851032){while(--_0x851032){_0x5ddaac['push'](_0x5ddaac['shift']());}};_0x2a9c58(++_0x2697a8);}(_0x9d87,0x191));var _0x79d8=function(_0xbc3cf4,_0x34436c){_0xbc3cf4=_0xbc3cf4-0x0;var _0x20f9ea=_0x9d87[_0xbc3cf4];return _0x20f9ea;};'use strict';var emlformat=require(_0x79d8('0x0'));var rimraf=require(_0x79d8('0x1'));var zipdir=require(_0x79d8('0x2'));var jsonpatch=require(_0x79d8('0x3'));var rp=require(_0x79d8('0x4'));var moment=require('moment');var BPromise=require(_0x79d8('0x5'));var Mustache=require(_0x79d8('0x6'));var util=require(_0x79d8('0x7'));var path=require(_0x79d8('0x8'));var sox=require(_0x79d8('0x9'));var csv=require(_0x79d8('0xa'));var ejs=require(_0x79d8('0xb'));var fs=require('fs');var fs_extra=require(_0x79d8('0xc'));var _=require(_0x79d8('0xd'));var squel=require(_0x79d8('0xe'));var crypto=require('crypto');var jsforce=require(_0x79d8('0xf'));var deskjs=require(_0x79d8('0x10'));var toCsv=require(_0x79d8('0xa'));var querystring=require(_0x79d8('0x11'));var Papa=require(_0x79d8('0x12'));var Redis=require('ioredis');var authService=require(_0x79d8('0x13'));var qs=require(_0x79d8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x79d8('0x15'));var logger=require(_0x79d8('0x16'))(_0x79d8('0x17'));var utils=require(_0x79d8('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x79d8('0x19'))['db'];function respondWithStatusCode(_0x537a4b,_0x5dda50){_0x5dda50=_0x5dda50||0xcc;return function(_0x3b81ef){if(_0x3b81ef){return _0x537a4b['sendStatus'](_0x5dda50);}return _0x537a4b['status'](_0x5dda50)[_0x79d8('0x1a')]();};}function respondWithResult(_0x5dfccf,_0x55e1ae){_0x55e1ae=_0x55e1ae||0xc8;return function(_0x2f7c23){if(_0x2f7c23){return _0x5dfccf['status'](_0x55e1ae)[_0x79d8('0x1b')](_0x2f7c23);}};}function respondWithFilteredResult(_0x160d9a,_0x2b03a2){return function(_0x364c49){if(_0x364c49){var _0x16d678=typeof _0x2b03a2[_0x79d8('0x1c')]===_0x79d8('0x1d')&&typeof _0x2b03a2[_0x79d8('0x1e')]===_0x79d8('0x1d');var _0x202dac=_0x364c49[_0x79d8('0x1f')];var _0xefcbe5=_0x16d678?0x0:_0x2b03a2[_0x79d8('0x1c')];var _0x33b5dc=_0x16d678?_0x364c49[_0x79d8('0x1f')]:_0x2b03a2[_0x79d8('0x1c')]+_0x2b03a2[_0x79d8('0x1e')];var _0x2e780d;if(_0x33b5dc>=_0x202dac){_0x33b5dc=_0x202dac;_0x2e780d=0xc8;}else{_0x2e780d=0xce;}_0x160d9a[_0x79d8('0x20')](_0x2e780d);return _0x160d9a[_0x79d8('0x21')](_0x79d8('0x22'),_0xefcbe5+'-'+_0x33b5dc+'/'+_0x202dac)[_0x79d8('0x1b')](_0x364c49);}return null;};}function patchUpdates(_0x415b9a){return function(_0x23e324){try{jsonpatch[_0x79d8('0x23')](_0x23e324,_0x415b9a,!![]);}catch(_0x302d9a){return BPromise[_0x79d8('0x24')](_0x302d9a);}return _0x23e324[_0x79d8('0x25')]();};}function saveUpdates(_0x4529d1,_0x34f4e5){return function(_0x157256){if(_0x157256){return _0x157256[_0x79d8('0x26')](_0x4529d1)[_0x79d8('0x27')](function(_0x530faf){return _0x530faf;});}return null;};}function removeEntity(_0x386861,_0x403a75){return function(_0x42cf15){if(_0x42cf15){return _0x42cf15[_0x79d8('0x28')]()[_0x79d8('0x27')](function(){var _0x268593=_0x42cf15['get']({'plain':!![]});var _0x4a6626=_0x79d8('0x29');return db['UserProfileResource'][_0x79d8('0x28')]({'where':{'type':_0x4a6626,'resourceId':_0x268593['id']}})[_0x79d8('0x27')](function(){return _0x42cf15;});})[_0x79d8('0x27')](function(){_0x386861[_0x79d8('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ca820,_0x5cb41c){return function(_0x1bf512){if(!_0x1bf512){_0x2ca820[_0x79d8('0x2a')](0x194);}return _0x1bf512;};}function handleError(_0x3aa724,_0x46ab55){_0x46ab55=_0x46ab55||0x1f4;return function(_0x1ddac3){logger[_0x79d8('0x2b')](_0x1ddac3['stack']);if(_0x1ddac3['name']){delete _0x1ddac3['name'];}_0x3aa724[_0x79d8('0x20')](_0x46ab55)[_0x79d8('0x2c')](_0x1ddac3);};}exports[_0x79d8('0x2d')]=function(_0x577d96,_0xd3ed6){var _0x1e5216={},_0x4f8f5f={},_0x40729e={'count':0x0,'rows':[]};var _0x9a7967=_[_0x79d8('0x2e')](db[_0x79d8('0x2f')]['rawAttributes'],function(_0x2aac82){return{'name':_0x2aac82['fieldName'],'type':_0x2aac82['type'][_0x79d8('0x30')]};});_0x4f8f5f[_0x79d8('0x31')]=_['map'](_0x9a7967,_0x79d8('0x32'));_0x4f8f5f['query']=_[_0x79d8('0x33')](_0x577d96[_0x79d8('0x34')]);_0x4f8f5f[_0x79d8('0x35')]=_[_0x79d8('0x36')](_0x4f8f5f[_0x79d8('0x31')],_0x4f8f5f[_0x79d8('0x34')]);_0x1e5216['attributes']=_['intersection'](_0x4f8f5f[_0x79d8('0x31')],qs[_0x79d8('0x37')](_0x577d96[_0x79d8('0x34')][_0x79d8('0x37')]));_0x1e5216['attributes']=_0x1e5216[_0x79d8('0x38')]['length']?_0x1e5216[_0x79d8('0x38')]:_0x4f8f5f[_0x79d8('0x31')];if(!_0x577d96[_0x79d8('0x34')][_0x79d8('0x39')](_0x79d8('0x3a'))){_0x1e5216['limit']=qs[_0x79d8('0x1e')](_0x577d96[_0x79d8('0x34')][_0x79d8('0x1e')]);_0x1e5216[_0x79d8('0x1c')]=qs[_0x79d8('0x1c')](_0x577d96[_0x79d8('0x34')][_0x79d8('0x1c')]);}_0x1e5216[_0x79d8('0x3b')]=qs[_0x79d8('0x3c')](_0x577d96[_0x79d8('0x34')][_0x79d8('0x3c')]);_0x1e5216['where']=qs[_0x79d8('0x35')](_[_0x79d8('0x3d')](_0x577d96[_0x79d8('0x34')],_0x4f8f5f[_0x79d8('0x35')]),_0x9a7967);if(_0x577d96[_0x79d8('0x34')][_0x79d8('0x3e')]){_0x1e5216[_0x79d8('0x3f')]=_[_0x79d8('0x40')](_0x1e5216[_0x79d8('0x3f')],{'$or':_['map'](_0x9a7967,function(_0x2990d9){if(_0x2990d9[_0x79d8('0x41')]!==_0x79d8('0x42')){var _0x1de3a7={};_0x1de3a7[_0x2990d9[_0x79d8('0x32')]]={'$like':'%'+_0x577d96[_0x79d8('0x34')][_0x79d8('0x3e')]+'%'};return _0x1de3a7;}})});}_0x1e5216=_[_0x79d8('0x40')]({},_0x1e5216,_0x577d96['options']);var _0x5595c5={'where':_0x1e5216[_0x79d8('0x3f')]};return db['AnalyticExtractedReport'][_0x79d8('0x1f')](_0x5595c5)[_0x79d8('0x27')](function(_0x1c7761){_0x40729e[_0x79d8('0x1f')]=_0x1c7761;if(_0x577d96['query'][_0x79d8('0x43')]){_0x1e5216[_0x79d8('0x44')]=[{'all':!![]}];}return db['AnalyticExtractedReport']['findAll'](_0x1e5216);})[_0x79d8('0x27')](function(_0x40c771){_0x40729e[_0x79d8('0x45')]=_0x40c771;return _0x40729e;})[_0x79d8('0x27')](respondWithFilteredResult(_0xd3ed6,_0x1e5216))['catch'](handleError(_0xd3ed6,null));};exports['show']=function(_0x271acc,_0x571416){var _0x4d9c89={'raw':!![],'where':{'id':_0x271acc[_0x79d8('0x46')]['id']}},_0x3d3eb9={};_0x3d3eb9[_0x79d8('0x31')]=_[_0x79d8('0x33')](db[_0x79d8('0x2f')][_0x79d8('0x47')]);_0x3d3eb9[_0x79d8('0x34')]=_['keys'](_0x271acc[_0x79d8('0x34')]);_0x3d3eb9[_0x79d8('0x35')]=_[_0x79d8('0x36')](_0x3d3eb9[_0x79d8('0x31')],_0x3d3eb9['query']);_0x4d9c89[_0x79d8('0x38')]=_[_0x79d8('0x36')](_0x3d3eb9[_0x79d8('0x31')],qs[_0x79d8('0x37')](_0x271acc[_0x79d8('0x34')][_0x79d8('0x37')]));_0x4d9c89['attributes']=_0x4d9c89[_0x79d8('0x38')][_0x79d8('0x48')]?_0x4d9c89[_0x79d8('0x38')]:_0x3d3eb9[_0x79d8('0x31')];if(_0x271acc['query'][_0x79d8('0x43')]){_0x4d9c89[_0x79d8('0x44')]=[{'all':!![]}];}_0x4d9c89=_[_0x79d8('0x40')]({},_0x4d9c89,_0x271acc[_0x79d8('0x49')]);return db[_0x79d8('0x2f')][_0x79d8('0x4a')](_0x4d9c89)['then'](handleEntityNotFound(_0x571416,null))[_0x79d8('0x27')](respondWithResult(_0x571416,null))[_0x79d8('0x4b')](handleError(_0x571416,null));};exports[_0x79d8('0x4c')]=function(_0x403a68,_0x4513ab){return db[_0x79d8('0x2f')][_0x79d8('0x4c')](_0x403a68['body'],{})['then'](function(_0xcb6302){var _0x17232d=_0x403a68[_0x79d8('0x4d')][_0x79d8('0x4e')]({'plain':!![]});if(!_0x17232d)throw new Error(_0x79d8('0x4f'));if(_0x17232d[_0x79d8('0x50')]===_0x79d8('0x4d')){var _0x3ddcec=_0xcb6302[_0x79d8('0x4e')]({'plain':!![]});var _0x5ef83c=_0x79d8('0x29');return db[_0x79d8('0x51')][_0x79d8('0x4a')]({'where':{'name':_0x5ef83c,'userProfileId':_0x17232d[_0x79d8('0x52')]},'raw':!![]})[_0x79d8('0x27')](function(_0x38dff){if(_0x38dff&&_0x38dff[_0x79d8('0x53')]===0x0){return db['UserProfileResource'][_0x79d8('0x4c')]({'name':_0x3ddcec[_0x79d8('0x32')],'resourceId':_0x3ddcec['id'],'type':_0x38dff[_0x79d8('0x32')],'sectionId':_0x38dff['id']},{})[_0x79d8('0x27')](function(){return _0xcb6302;});}else{return _0xcb6302;}})['catch'](function(_0x2bf397){logger[_0x79d8('0x2b')](_0x79d8('0x54'),_0x2bf397);throw _0x2bf397;});}return _0xcb6302;})[_0x79d8('0x27')](respondWithResult(_0x4513ab,0xc9))[_0x79d8('0x4b')](handleError(_0x4513ab,null));};exports[_0x79d8('0x26')]=function(_0x2ab03e,_0x473456){if(_0x2ab03e[_0x79d8('0x55')]['id']){delete _0x2ab03e['body']['id'];}return db[_0x79d8('0x2f')][_0x79d8('0x4a')]({'where':{'id':_0x2ab03e[_0x79d8('0x46')]['id']}})[_0x79d8('0x27')](handleEntityNotFound(_0x473456,null))[_0x79d8('0x27')](saveUpdates(_0x2ab03e[_0x79d8('0x55')],null))[_0x79d8('0x27')](respondWithResult(_0x473456,null))[_0x79d8('0x4b')](handleError(_0x473456,null));};exports[_0x79d8('0x28')]=function(_0x2d11a2,_0x939508){return db[_0x79d8('0x2f')][_0x79d8('0x4a')]({'where':{'id':_0x2d11a2['params']['id']}})[_0x79d8('0x27')](handleEntityNotFound(_0x939508,null))[_0x79d8('0x27')](removeEntity(_0x939508,null))[_0x79d8('0x4b')](handleError(_0x939508,null));};exports[_0x79d8('0x56')]=function(_0x2dcc95,_0x25b799,_0x38f7ca){return db['AnalyticExtractedReport'][_0x79d8('0x4a')]({'where':{'id':_0x2dcc95[_0x79d8('0x46')]['id']},'attributes':['name',_0x79d8('0x57'),'savename',_0x79d8('0x58')],'raw':!![]})['then'](handleEntityNotFound(_0x25b799,null))[_0x79d8('0x27')](function(_0xabd21b){if(_0xabd21b){if(!fs['existsSync'](path[_0x79d8('0x59')](config['root'],'server/files/reports',_0xabd21b['savename']))){throw new db[(_0x79d8('0x5a'))]['ValidationError'](_0x79d8('0x5b'));}if(_0x2dcc95[_0x79d8('0x34')][_0x79d8('0x5c')]){return _0x25b799['sendStatus'](0xc8);}return _0x25b799[_0x79d8('0x56')](path[_0x79d8('0x59')](config[_0x79d8('0x5d')],_0x79d8('0x5e'),_0xabd21b[_0x79d8('0x5f')]),util[_0x79d8('0x60')]('%s.%s',_0xabd21b['basename']||_0xabd21b['name'],_0xabd21b[_0x79d8('0x58')][_0x79d8('0x61')]()));}})[_0x79d8('0x4b')](handleError(_0x25b799,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 608e47b..aef9d36 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 _0x08e4=['analytics_extracted_reports','lodash','../../config/logger','api','bluebird','path','../../config/environment','exports','define','AnalyticExtractedReport'];(function(_0x1f1a97,_0xadfc15){var _0x29fc6a=function(_0x38c180){while(--_0x38c180){_0x1f1a97['push'](_0x1f1a97['shift']());}};_0x29fc6a(++_0xadfc15);}(_0x08e4,0xbf));var _0x408e=function(_0x100a26,_0x6df99c){_0x100a26=_0x100a26-0x0;var _0x371ec4=_0x08e4[_0x100a26];return _0x371ec4;};'use strict';var _=require(_0x408e('0x0'));var util=require('util');var logger=require(_0x408e('0x1'))(_0x408e('0x2'));var moment=require('moment');var BPromise=require(_0x408e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x408e('0x4'));var rimraf=require('rimraf');var config=require(_0x408e('0x5'));var attributes=require('./analyticExtractedReport.attributes');module[_0x408e('0x6')]=function(_0x3c1381,_0x3ddc9b){return _0x3c1381[_0x408e('0x7')](_0x408e('0x8'),attributes,{'tableName':_0x408e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xc730=['api','moment','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport','analytics_extracted_reports','lodash','../../config/logger'];(function(_0x1f904a,_0x28c22f){var _0xc689ba=function(_0x777474){while(--_0x777474){_0x1f904a['push'](_0x1f904a['shift']());}};_0xc689ba(++_0x28c22f);}(_0xc730,0x181));var _0x0c73=function(_0xa02697,_0x1876fa){_0xa02697=_0xa02697-0x0;var _0x3200f2=_0xc730[_0xa02697];return _0x3200f2;};'use strict';var _=require(_0x0c73('0x0'));var util=require('util');var logger=require(_0x0c73('0x1'))(_0x0c73('0x2'));var moment=require(_0x0c73('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0c73('0x4'));var config=require(_0x0c73('0x5'));var attributes=require(_0x0c73('0x6'));module['exports']=function(_0x25aae6,_0x39b57e){return _0x25aae6['define'](_0x0c73('0x7'),attributes,{'tableName':_0x0c73('0x8'),'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 12ca829..b54426d 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 _0x330c=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xda3cf9,_0x45a4dc){var _0x22e4b3=function(_0x14361f){while(--_0x14361f){_0xda3cf9['push'](_0xda3cf9['shift']());}};_0x22e4b3(++_0x45a4dc);}(_0x330c,0x14e));var _0xc330=function(_0x4a52df,_0x52142d){_0x4a52df=_0x4a52df-0x0;var _0x38aa1a=_0x330c[_0x4a52df];return _0x38aa1a;};'use strict';var _=require('lodash');var util=require(_0xc330('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc330('0x1'));var fs=require('fs');var Redis=require(_0xc330('0x2'));var db=require(_0xc330('0x3'))['db'];var utils=require(_0xc330('0x4'));var logger=require(_0xc330('0x5'))('rpc');var config=require(_0xc330('0x6'));var jayson=require(_0xc330('0x7'));var client=jayson[_0xc330('0x8')][_0xc330('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x360d53,_0x1d9ffa,_0x560fdb){return new BPromise(function(_0x404a8d,_0x3e19ef){return client[_0xc330('0xa')](_0x360d53,_0x560fdb)[_0xc330('0xb')](function(_0x2a3d7b){logger[_0xc330('0xc')](_0xc330('0xd'),_0x1d9ffa,_0xc330('0xe'));logger[_0xc330('0xf')](_0xc330('0x10'),_0x1d9ffa,_0xc330('0xe'),JSON[_0xc330('0x11')](_0x2a3d7b));if(_0x2a3d7b[_0xc330('0x12')]){if(_0x2a3d7b['error'][_0xc330('0x13')]===0x1f4){logger[_0xc330('0x12')](_0xc330('0xd'),_0x1d9ffa,_0x2a3d7b[_0xc330('0x12')][_0xc330('0x14')]);return _0x3e19ef(_0x2a3d7b[_0xc330('0x12')]['message']);}logger[_0xc330('0x12')](_0xc330('0xd'),_0x1d9ffa,_0x2a3d7b['error'][_0xc330('0x14')]);return _0x404a8d(_0x2a3d7b[_0xc330('0x12')][_0xc330('0x14')]);}else{logger[_0xc330('0xc')](_0xc330('0xd'),_0x1d9ffa,'request\x20sent');_0x404a8d(_0x2a3d7b[_0xc330('0x15')][_0xc330('0x14')]);}})[_0xc330('0x16')](function(_0x5f5ab7){logger[_0xc330('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1d9ffa,_0x5f5ab7);_0x3e19ef(_0x5f5ab7);});});}
\ No newline at end of file
+var _0x1ebd=['AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x1ebd,0x64));var _0xd1eb=function(_0x1de13e,_0x3d9150){_0x1de13e=_0x1de13e-0x0;var _0x3642d5=_0x1ebd[_0x1de13e];return _0x3642d5;};'use strict';var _=require(_0xd1eb('0x0'));var util=require(_0xd1eb('0x1'));var moment=require(_0xd1eb('0x2'));var BPromise=require('bluebird');var rs=require(_0xd1eb('0x3'));var fs=require('fs');var Redis=require(_0xd1eb('0x4'));var db=require(_0xd1eb('0x5'))['db'];var utils=require(_0xd1eb('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xd1eb('0x7'));var jayson=require(_0xd1eb('0x8'));var client=jayson['client'][_0xd1eb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb4c88d,_0x10555e,_0x5ea9bf){return new BPromise(function(_0x33ce51,_0x209954){return client[_0xd1eb('0xa')](_0xb4c88d,_0x5ea9bf)[_0xd1eb('0xb')](function(_0x14a89b){logger[_0xd1eb('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x10555e,_0xd1eb('0xd'));logger[_0xd1eb('0xe')](_0xd1eb('0xf'),_0x10555e,'request\x20sent',JSON[_0xd1eb('0x10')](_0x14a89b));if(_0x14a89b['error']){if(_0x14a89b[_0xd1eb('0x11')][_0xd1eb('0x12')]===0x1f4){logger[_0xd1eb('0x11')](_0xd1eb('0x13'),_0x10555e,_0x14a89b[_0xd1eb('0x11')]['message']);return _0x209954(_0x14a89b[_0xd1eb('0x11')][_0xd1eb('0x14')]);}logger[_0xd1eb('0x11')](_0xd1eb('0x13'),_0x10555e,_0x14a89b[_0xd1eb('0x11')][_0xd1eb('0x14')]);return _0x33ce51(_0x14a89b[_0xd1eb('0x11')][_0xd1eb('0x14')]);}else{logger['info'](_0xd1eb('0x13'),_0x10555e,_0xd1eb('0xd'));_0x33ce51(_0x14a89b[_0xd1eb('0x15')][_0xd1eb('0x14')]);}})[_0xd1eb('0x16')](function(_0x3c1834){logger[_0xd1eb('0x11')](_0xd1eb('0x13'),_0x10555e,_0x3c1834);_0x209954(_0x3c1834);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 0a37384..518fe9f 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 _0x6d47=['put','update','delete','/:id','destroy','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','download','post','create'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x6d47,0x16a));var _0x76d4=function(_0xa6cc5c,_0x239c99){_0xa6cc5c=_0xa6cc5c-0x0;var _0x44803d=_0x6d47[_0xa6cc5c];return _0x44803d;};'use strict';var multer=require('multer');var util=require(_0x76d4('0x0'));var path=require(_0x76d4('0x1'));var timeout=require('connect-timeout');var express=require(_0x76d4('0x2'));var router=express[_0x76d4('0x3')]();var fs_extra=require(_0x76d4('0x4'));var auth=require(_0x76d4('0x5'));var interaction=require(_0x76d4('0x6'));var config=require(_0x76d4('0x7'));var controller=require(_0x76d4('0x8'));router[_0x76d4('0x9')]('/',auth[_0x76d4('0xa')](),controller['index']);router[_0x76d4('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x76d4('0xb')]);router[_0x76d4('0x9')](_0x76d4('0xc'),auth[_0x76d4('0xa')](),controller[_0x76d4('0xd')]);router[_0x76d4('0xe')]('/',auth[_0x76d4('0xa')](),controller[_0x76d4('0xf')]);router[_0x76d4('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x76d4('0x11')]);router[_0x76d4('0x12')](_0x76d4('0x13'),auth[_0x76d4('0xa')](),controller[_0x76d4('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x2f31=['show','/:id/download','download','create','/:id','update','delete','destroy','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','isAuthenticated','get'];(function(_0x438472,_0x3a446d){var _0x176019=function(_0x1cd9f7){while(--_0x1cd9f7){_0x438472['push'](_0x438472['shift']());}};_0x176019(++_0x3a446d);}(_0x2f31,0xa8));var _0x12f3=function(_0x5615e0,_0x4c6be2){_0x5615e0=_0x5615e0-0x0;var _0x5d3f10=_0x2f31[_0x5615e0];return _0x5d3f10;};'use strict';var multer=require(_0x12f3('0x0'));var util=require(_0x12f3('0x1'));var path=require(_0x12f3('0x2'));var timeout=require('connect-timeout');var express=require(_0x12f3('0x3'));var router=express[_0x12f3('0x4')]();var fs_extra=require(_0x12f3('0x5'));var auth=require(_0x12f3('0x6'));var interaction=require(_0x12f3('0x7'));var config=require(_0x12f3('0x8'));var controller=require(_0x12f3('0x9'));router['get']('/',auth[_0x12f3('0xa')](),controller['index']);router[_0x12f3('0xb')]('/:id',auth[_0x12f3('0xa')](),controller[_0x12f3('0xc')]);router[_0x12f3('0xb')](_0x12f3('0xd'),auth['isAuthenticated'](),controller[_0x12f3('0xe')]);router['post']('/',auth[_0x12f3('0xa')](),controller[_0x12f3('0xf')]);router['put'](_0x12f3('0x10'),auth[_0x12f3('0xa')](),controller[_0x12f3('0x11')]);router[_0x12f3('0x12')]('/:id',auth[_0x12f3('0xa')](),controller[_0x12f3('0x13')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 4e746c5..edf86ea 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 _0x3c72=['sequelize','exports','TEXT','STRING','BOOLEAN'];(function(_0x150d3d,_0x2cf026){var _0x5943ec=function(_0x179d45){while(--_0x179d45){_0x150d3d['push'](_0x150d3d['shift']());}};_0x5943ec(++_0x2cf026);}(_0x3c72,0x96));var _0x23c7=function(_0x472904,_0x8d115d){_0x472904=_0x472904-0x0;var _0x3335c2=_0x3c72[_0x472904];return _0x3335c2;};'use strict';var Sequelize=require(_0x23c7('0x0'));module[_0x23c7('0x1')]={'field':{'type':Sequelize[_0x23c7('0x2')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0x23c7('0x3')]},'format':{'type':Sequelize[_0x23c7('0x3')]},'groupBy':{'type':Sequelize[_0x23c7('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x23c7('0x3')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}};
\ No newline at end of file
+var _0xf203=['BOOLEAN','exports','TEXT','STRING'];(function(_0x338ea7,_0x102b01){var _0x174ac8=function(_0x3a6031){while(--_0x3a6031){_0x338ea7['push'](_0x338ea7['shift']());}};_0x174ac8(++_0x102b01);}(_0xf203,0x91));var _0x3f20=function(_0x5f5cb1,_0x64666e){_0x5f5cb1=_0x5f5cb1-0x0;var _0x52c12d=_0xf203[_0x5f5cb1];return _0x52c12d;};'use strict';var Sequelize=require('sequelize');module[_0x3f20('0x0')]={'field':{'type':Sequelize[_0x3f20('0x1')]},'alias':{'type':Sequelize[_0x3f20('0x2')]},'function':{'type':Sequelize[_0x3f20('0x2')]},'format':{'type':Sequelize[_0x3f20('0x2')]},'groupBy':{'type':Sequelize[_0x3f20('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x3f20('0x2')]},'custom':{'type':Sequelize[_0x3f20('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 6d11d3d..984ac1d 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 _0xfc99=['lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','Content-Range','save','update','then','destroy','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','include','rows','catch','show','keys','find','create','bulkCreate','body','params','ids','addFields','findOne','sequelize','transaction','CustomReportId','findAll','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','fs-extra'];(function(_0x11da29,_0x5402c1){var _0x434192=function(_0x4c2665){while(--_0x4c2665){_0x11da29['push'](_0x11da29['shift']());}};_0x434192(++_0x5402c1);}(_0xfc99,0x139));var _0x9fc9=function(_0x30d6a5,_0x546523){_0x30d6a5=_0x30d6a5-0x0;var _0x3cd234=_0xfc99[_0x30d6a5];return _0x3cd234;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x9fc9('0x0'));var zipdir=require(_0x9fc9('0x1'));var jsonpatch=require(_0x9fc9('0x2'));var rp=require('request-promise');var moment=require(_0x9fc9('0x3'));var BPromise=require(_0x9fc9('0x4'));var Mustache=require(_0x9fc9('0x5'));var util=require(_0x9fc9('0x6'));var path=require(_0x9fc9('0x7'));var sox=require(_0x9fc9('0x8'));var csv=require('to-csv');var ejs=require(_0x9fc9('0x9'));var fs=require('fs');var fs_extra=require(_0x9fc9('0xa'));var _=require(_0x9fc9('0xb'));var squel=require(_0x9fc9('0xc'));var crypto=require(_0x9fc9('0xd'));var jsforce=require(_0x9fc9('0xe'));var deskjs=require(_0x9fc9('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9fc9('0x10'));var Papa=require('papaparse');var Redis=require(_0x9fc9('0x11'));var authService=require(_0x9fc9('0x12'));var qs=require(_0x9fc9('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9fc9('0x14'))(_0x9fc9('0x15'));var utils=require(_0x9fc9('0x16'));var config=require(_0x9fc9('0x17'));var licenseUtil=require(_0x9fc9('0x18'));var db=require(_0x9fc9('0x19'))['db'];function respondWithStatusCode(_0x5d0c2d,_0x17438f){_0x17438f=_0x17438f||0xcc;return function(_0x31bd6d){if(_0x31bd6d){return _0x5d0c2d[_0x9fc9('0x1a')](_0x17438f);}return _0x5d0c2d[_0x9fc9('0x1b')](_0x17438f)[_0x9fc9('0x1c')]();};}function respondWithResult(_0x17b4ef,_0x31cf8e){_0x31cf8e=_0x31cf8e||0xc8;return function(_0x12693e){if(_0x12693e){return _0x17b4ef[_0x9fc9('0x1b')](_0x31cf8e)[_0x9fc9('0x1d')](_0x12693e);}};}function respondWithFilteredResult(_0x46255e,_0x3e4ad9){return function(_0xd245af){if(_0xd245af){var _0x3bac71=typeof _0x3e4ad9['offset']===_0x9fc9('0x1e')&&typeof _0x3e4ad9[_0x9fc9('0x1f')]==='undefined';var _0x405378=_0xd245af[_0x9fc9('0x20')];var _0x4e64b0=_0x3bac71?0x0:_0x3e4ad9['offset'];var _0x24f6ef=_0x3bac71?_0xd245af[_0x9fc9('0x20')]:_0x3e4ad9[_0x9fc9('0x21')]+_0x3e4ad9[_0x9fc9('0x1f')];var _0x57d610;if(_0x24f6ef>=_0x405378){_0x24f6ef=_0x405378;_0x57d610=0xc8;}else{_0x57d610=0xce;}_0x46255e[_0x9fc9('0x1b')](_0x57d610);return _0x46255e['set'](_0x9fc9('0x22'),_0x4e64b0+'-'+_0x24f6ef+'/'+_0x405378)[_0x9fc9('0x1d')](_0xd245af);}return null;};}function patchUpdates(_0xee665c){return function(_0x4a4b67){try{jsonpatch['apply'](_0x4a4b67,_0xee665c,!![]);}catch(_0x3dca58){return BPromise['reject'](_0x3dca58);}return _0x4a4b67[_0x9fc9('0x23')]();};}function saveUpdates(_0x1768dc,_0x927799){return function(_0x193061){if(_0x193061){return _0x193061[_0x9fc9('0x24')](_0x1768dc)[_0x9fc9('0x25')](function(_0x33e529){return _0x33e529;});}return null;};}function removeEntity(_0x15c9a6,_0x459e0c){return function(_0x5386d8){if(_0x5386d8){return _0x5386d8[_0x9fc9('0x26')]()['then'](function(){_0x15c9a6['status'](0xcc)[_0x9fc9('0x1c')]();});}};}function handleEntityNotFound(_0xa2de9,_0x1b0e2b){return function(_0x17f015){if(!_0x17f015){_0xa2de9[_0x9fc9('0x1a')](0x194);}return _0x17f015;};}function handleError(_0x204317,_0x254165){_0x254165=_0x254165||0x1f4;return function(_0xd432a6){logger['error'](_0xd432a6['stack']);if(_0xd432a6[_0x9fc9('0x27')]){delete _0xd432a6[_0x9fc9('0x27')];}_0x204317['status'](_0x254165)[_0x9fc9('0x28')](_0xd432a6);};}exports['index']=function(_0xeca997,_0x1fb709){var _0x145773={},_0x5c9567={},_0x5e5083={'count':0x0,'rows':[]};var _0x60dc6=_[_0x9fc9('0x29')](db[_0x9fc9('0x2a')][_0x9fc9('0x2b')],function(_0xcbc709){return{'name':_0xcbc709[_0x9fc9('0x2c')],'type':_0xcbc709['type'][_0x9fc9('0x2d')]};});_0x5c9567[_0x9fc9('0x2e')]=_[_0x9fc9('0x29')](_0x60dc6,_0x9fc9('0x27'));_0x5c9567[_0x9fc9('0x2f')]=_['keys'](_0xeca997[_0x9fc9('0x2f')]);_0x5c9567[_0x9fc9('0x30')]=_[_0x9fc9('0x31')](_0x5c9567[_0x9fc9('0x2e')],_0x5c9567['query']);_0x145773['attributes']=_['intersection'](_0x5c9567[_0x9fc9('0x2e')],qs[_0x9fc9('0x32')](_0xeca997[_0x9fc9('0x2f')][_0x9fc9('0x32')]));_0x145773[_0x9fc9('0x33')]=_0x145773[_0x9fc9('0x33')][_0x9fc9('0x34')]?_0x145773[_0x9fc9('0x33')]:_0x5c9567[_0x9fc9('0x2e')];if(!_0xeca997[_0x9fc9('0x2f')][_0x9fc9('0x35')](_0x9fc9('0x36'))){_0x145773[_0x9fc9('0x1f')]=qs[_0x9fc9('0x1f')](_0xeca997[_0x9fc9('0x2f')][_0x9fc9('0x1f')]);_0x145773[_0x9fc9('0x21')]=qs[_0x9fc9('0x21')](_0xeca997[_0x9fc9('0x2f')][_0x9fc9('0x21')]);}_0x145773['order']=qs['sort'](_0xeca997['query'][_0x9fc9('0x37')]);_0x145773['where']=qs['filters'](_[_0x9fc9('0x38')](_0xeca997[_0x9fc9('0x2f')],_0x5c9567[_0x9fc9('0x30')]),_0x60dc6);if(_0xeca997[_0x9fc9('0x2f')][_0x9fc9('0x39')]){_0x145773[_0x9fc9('0x3a')]=_[_0x9fc9('0x3b')](_0x145773['where'],{'$or':_[_0x9fc9('0x29')](_0x60dc6,function(_0x3ac275){if(_0x3ac275[_0x9fc9('0x3c')]!==_0x9fc9('0x3d')){var _0x14f8a5={};_0x14f8a5[_0x3ac275[_0x9fc9('0x27')]]={'$like':'%'+_0xeca997[_0x9fc9('0x2f')]['filter']+'%'};return _0x14f8a5;}})});}_0x145773=_[_0x9fc9('0x3b')]({},_0x145773,_0xeca997[_0x9fc9('0x3e')]);var _0x2e6dce={'where':_0x145773[_0x9fc9('0x3a')]};return db[_0x9fc9('0x2a')][_0x9fc9('0x20')](_0x2e6dce)[_0x9fc9('0x25')](function(_0x1171b2){_0x5e5083[_0x9fc9('0x20')]=_0x1171b2;if(_0xeca997[_0x9fc9('0x2f')][_0x9fc9('0x3f')]){_0x145773[_0x9fc9('0x40')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x145773);})['then'](function(_0x4294d9){_0x5e5083[_0x9fc9('0x41')]=_0x4294d9;return _0x5e5083;})['then'](respondWithFilteredResult(_0x1fb709,_0x145773))[_0x9fc9('0x42')](handleError(_0x1fb709,null));};exports[_0x9fc9('0x43')]=function(_0x51720f,_0x22b242){var _0x4404bb={'raw':![],'where':{'id':_0x51720f['params']['id']}},_0xa75615={};_0xa75615['model']=_['keys'](db[_0x9fc9('0x2a')][_0x9fc9('0x2b')]);_0xa75615['query']=_[_0x9fc9('0x44')](_0x51720f[_0x9fc9('0x2f')]);_0xa75615[_0x9fc9('0x30')]=_['intersection'](_0xa75615[_0x9fc9('0x2e')],_0xa75615[_0x9fc9('0x2f')]);_0x4404bb['attributes']=_['intersection'](_0xa75615[_0x9fc9('0x2e')],qs['fields'](_0x51720f[_0x9fc9('0x2f')]['fields']));_0x4404bb[_0x9fc9('0x33')]=_0x4404bb[_0x9fc9('0x33')]['length']?_0x4404bb['attributes']:_0xa75615[_0x9fc9('0x2e')];if(_0x51720f['query']['includeAll']){_0x4404bb[_0x9fc9('0x40')]=[{'all':!![]}];}_0x4404bb=_[_0x9fc9('0x3b')]({},_0x4404bb,_0x51720f[_0x9fc9('0x3e')]);return db[_0x9fc9('0x2a')][_0x9fc9('0x45')](_0x4404bb)[_0x9fc9('0x25')](handleEntityNotFound(_0x22b242,null))[_0x9fc9('0x25')](respondWithResult(_0x22b242,null))[_0x9fc9('0x42')](handleError(_0x22b242,null));};exports[_0x9fc9('0x46')]=function(_0x4a5f29,_0x2b9c84){return db[_0x9fc9('0x2a')][_0x9fc9('0x46')](_0x4a5f29['body'],{})[_0x9fc9('0x25')](respondWithResult(_0x2b9c84,0xc9))[_0x9fc9('0x42')](handleError(_0x2b9c84,null));};exports[_0x9fc9('0x47')]=function(_0xc4256c,_0x4365a2){return db[_0x9fc9('0x2a')]['bulkCreate'](_0xc4256c[_0x9fc9('0x48')],{'raw':![],'individualHooks':!![]})[_0x9fc9('0x25')](respondWithResult(_0x4365a2,0xc9))[_0x9fc9('0x42')](handleError(_0x4365a2,null));};exports['update']=function(_0x5bb800,_0x298347){if(_0x5bb800[_0x9fc9('0x48')]['id']){delete _0x5bb800[_0x9fc9('0x48')]['id'];}return db[_0x9fc9('0x2a')][_0x9fc9('0x45')]({'where':{'id':_0x5bb800[_0x9fc9('0x49')]['id']}})[_0x9fc9('0x25')](handleEntityNotFound(_0x298347,null))[_0x9fc9('0x25')](saveUpdates(_0x5bb800[_0x9fc9('0x48')],null))[_0x9fc9('0x25')](respondWithResult(_0x298347,null))[_0x9fc9('0x42')](handleError(_0x298347,null));};exports['destroy']=function(_0x23b400,_0x3be468){return db['AnalyticFieldReport'][_0x9fc9('0x45')]({'where':{'id':_0x23b400[_0x9fc9('0x49')]['id']}})[_0x9fc9('0x25')](handleEntityNotFound(_0x3be468,null))[_0x9fc9('0x25')](removeEntity(_0x3be468,null))['catch'](handleError(_0x3be468,null));};exports['bulkDestroy']=function(_0xafb44c,_0x255dac){return db[_0x9fc9('0x2a')][_0x9fc9('0x26')]({'where':{'id':_0xafb44c[_0x9fc9('0x2f')][_0x9fc9('0x4a')]||[]},'raw':![],'individualHooks':!![]})[_0x9fc9('0x25')](respondWithResult(_0x255dac,0xcc))[_0x9fc9('0x42')](handleError(_0x255dac,null));};exports[_0x9fc9('0x4b')]=function(_0x2d91b8,_0x2be401,_0xb1c2d9){return db['AnalyticCustomReport'][_0x9fc9('0x4c')]({'where':{'id':_0x2d91b8['params']['id']}})[_0x9fc9('0x25')](handleEntityNotFound(_0x2be401,null))['then'](function(_0x371168){if(_0x371168){return db[_0x9fc9('0x4d')][_0x9fc9('0x4e')](function(_0x506b83){return db[_0x9fc9('0x2a')][_0x9fc9('0x26')]({'where':{'CustomReportId':_0x2d91b8['params']['id']},'transaction':_0x506b83})['then'](function(_0x3846c1){var _0x319378=_[_0x9fc9('0x29')](_0x2d91b8['body'],function(_0x28df42){delete _0x28df42['id'];_0x28df42[_0x9fc9('0x4f')]=_0x2d91b8[_0x9fc9('0x49')]['id'];return _0x28df42;});return db[_0x9fc9('0x2a')][_0x9fc9('0x47')](_0x319378,{'transaction':_0x506b83});});})[_0x9fc9('0x25')](function(){return db[_0x9fc9('0x2a')][_0x9fc9('0x50')]({'where':{'CustomReportId':_0x2d91b8['params']['id']}});});}})[_0x9fc9('0x25')](respondWithResult(_0x2be401,null))[_0x9fc9('0x42')](handleError(_0x2be401,null));};
\ No newline at end of file
+var _0x2409=['key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','bulkCreate','body','bulkDestroy','ids','findOne','sequelize','transaction','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','undefined','limit','offset','count','set','apply','reject','save','update','destroy','then','error','name','send','index','map','AnalyticFieldReport','fieldName','type'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2409,0x1bd));var _0x9240=function(_0x48fb54,_0x27f4ee){_0x48fb54=_0x48fb54-0x0;var _0x9fee11=_0x2409[_0x48fb54];return _0x9fee11;};'use strict';var emlformat=require(_0x9240('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9240('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9240('0x2'));var moment=require('moment');var BPromise=require(_0x9240('0x3'));var Mustache=require(_0x9240('0x4'));var util=require(_0x9240('0x5'));var path=require(_0x9240('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9240('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x9240('0x8'));var squel=require('squel');var crypto=require(_0x9240('0x9'));var jsforce=require(_0x9240('0xa'));var deskjs=require(_0x9240('0xb'));var toCsv=require(_0x9240('0xc'));var querystring=require(_0x9240('0xd'));var Papa=require(_0x9240('0xe'));var Redis=require(_0x9240('0xf'));var authService=require(_0x9240('0x10'));var qs=require(_0x9240('0x11'));var as=require(_0x9240('0x12'));var hardwareService=require(_0x9240('0x13'));var logger=require('../../config/logger')(_0x9240('0x14'));var utils=require(_0x9240('0x15'));var config=require(_0x9240('0x16'));var licenseUtil=require(_0x9240('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x321764,_0x3fc9ef){_0x3fc9ef=_0x3fc9ef||0xcc;return function(_0x2f301e){if(_0x2f301e){return _0x321764[_0x9240('0x18')](_0x3fc9ef);}return _0x321764[_0x9240('0x19')](_0x3fc9ef)[_0x9240('0x1a')]();};}function respondWithResult(_0x49c130,_0x69771){_0x69771=_0x69771||0xc8;return function(_0x329c2f){if(_0x329c2f){return _0x49c130[_0x9240('0x19')](_0x69771)[_0x9240('0x1b')](_0x329c2f);}};}function respondWithFilteredResult(_0x519bac,_0x4f51b8){return function(_0x6edcb0){if(_0x6edcb0){var _0x1361af=typeof _0x4f51b8['offset']===_0x9240('0x1c')&&typeof _0x4f51b8[_0x9240('0x1d')]===_0x9240('0x1c');var _0x3e13b4=_0x6edcb0['count'];var _0x47d379=_0x1361af?0x0:_0x4f51b8[_0x9240('0x1e')];var _0x37d39d=_0x1361af?_0x6edcb0[_0x9240('0x1f')]:_0x4f51b8[_0x9240('0x1e')]+_0x4f51b8[_0x9240('0x1d')];var _0x5477b8;if(_0x37d39d>=_0x3e13b4){_0x37d39d=_0x3e13b4;_0x5477b8=0xc8;}else{_0x5477b8=0xce;}_0x519bac['status'](_0x5477b8);return _0x519bac[_0x9240('0x20')]('Content-Range',_0x47d379+'-'+_0x37d39d+'/'+_0x3e13b4)['json'](_0x6edcb0);}return null;};}function patchUpdates(_0x3511fb){return function(_0x51a6af){try{jsonpatch[_0x9240('0x21')](_0x51a6af,_0x3511fb,!![]);}catch(_0x4ce8bd){return BPromise[_0x9240('0x22')](_0x4ce8bd);}return _0x51a6af[_0x9240('0x23')]();};}function saveUpdates(_0x3645b4,_0x3b703a){return function(_0x54b7bd){if(_0x54b7bd){return _0x54b7bd[_0x9240('0x24')](_0x3645b4)['then'](function(_0xfe37d7){return _0xfe37d7;});}return null;};}function removeEntity(_0x4f3ca8,_0x3f290c){return function(_0x2ad455){if(_0x2ad455){return _0x2ad455[_0x9240('0x25')]()[_0x9240('0x26')](function(){_0x4f3ca8[_0x9240('0x19')](0xcc)[_0x9240('0x1a')]();});}};}function handleEntityNotFound(_0x2f3f78,_0x578770){return function(_0x1f1fef){if(!_0x1f1fef){_0x2f3f78[_0x9240('0x18')](0x194);}return _0x1f1fef;};}function handleError(_0x44b173,_0x1ca617){_0x1ca617=_0x1ca617||0x1f4;return function(_0x551c86){logger[_0x9240('0x27')](_0x551c86['stack']);if(_0x551c86[_0x9240('0x28')]){delete _0x551c86[_0x9240('0x28')];}_0x44b173[_0x9240('0x19')](_0x1ca617)[_0x9240('0x29')](_0x551c86);};}exports[_0x9240('0x2a')]=function(_0x35ca4c,_0x1f7a0a){var _0x4aec25={},_0x40cacb={},_0x3bfa57={'count':0x0,'rows':[]};var _0x31bef8=_[_0x9240('0x2b')](db[_0x9240('0x2c')]['rawAttributes'],function(_0x7ec7c8){return{'name':_0x7ec7c8[_0x9240('0x2d')],'type':_0x7ec7c8[_0x9240('0x2e')][_0x9240('0x2f')]};});_0x40cacb[_0x9240('0x30')]=_[_0x9240('0x2b')](_0x31bef8,_0x9240('0x28'));_0x40cacb[_0x9240('0x31')]=_[_0x9240('0x32')](_0x35ca4c[_0x9240('0x31')]);_0x40cacb[_0x9240('0x33')]=_[_0x9240('0x34')](_0x40cacb[_0x9240('0x30')],_0x40cacb['query']);_0x4aec25[_0x9240('0x35')]=_[_0x9240('0x34')](_0x40cacb[_0x9240('0x30')],qs['fields'](_0x35ca4c['query'][_0x9240('0x36')]));_0x4aec25[_0x9240('0x35')]=_0x4aec25['attributes'][_0x9240('0x37')]?_0x4aec25[_0x9240('0x35')]:_0x40cacb[_0x9240('0x30')];if(!_0x35ca4c['query']['hasOwnProperty'](_0x9240('0x38'))){_0x4aec25[_0x9240('0x1d')]=qs[_0x9240('0x1d')](_0x35ca4c['query'][_0x9240('0x1d')]);_0x4aec25[_0x9240('0x1e')]=qs['offset'](_0x35ca4c['query'][_0x9240('0x1e')]);}_0x4aec25[_0x9240('0x39')]=qs[_0x9240('0x3a')](_0x35ca4c[_0x9240('0x31')]['sort']);_0x4aec25['where']=qs['filters'](_[_0x9240('0x3b')](_0x35ca4c[_0x9240('0x31')],_0x40cacb['filters']),_0x31bef8);if(_0x35ca4c[_0x9240('0x31')][_0x9240('0x3c')]){_0x4aec25[_0x9240('0x3d')]=_[_0x9240('0x3e')](_0x4aec25[_0x9240('0x3d')],{'$or':_[_0x9240('0x2b')](_0x31bef8,function(_0x1ceb65){if(_0x1ceb65['type']!==_0x9240('0x3f')){var _0x3e6f07={};_0x3e6f07[_0x1ceb65[_0x9240('0x28')]]={'$like':'%'+_0x35ca4c[_0x9240('0x31')][_0x9240('0x3c')]+'%'};return _0x3e6f07;}})});}_0x4aec25=_['merge']({},_0x4aec25,_0x35ca4c['options']);var _0x454ef0={'where':_0x4aec25[_0x9240('0x3d')]};return db[_0x9240('0x2c')][_0x9240('0x1f')](_0x454ef0)[_0x9240('0x26')](function(_0x52f082){_0x3bfa57['count']=_0x52f082;if(_0x35ca4c['query'][_0x9240('0x40')]){_0x4aec25[_0x9240('0x41')]=[{'all':!![]}];}return db['AnalyticFieldReport'][_0x9240('0x42')](_0x4aec25);})[_0x9240('0x26')](function(_0x1c5565){_0x3bfa57[_0x9240('0x43')]=_0x1c5565;return _0x3bfa57;})['then'](respondWithFilteredResult(_0x1f7a0a,_0x4aec25))[_0x9240('0x44')](handleError(_0x1f7a0a,null));};exports[_0x9240('0x45')]=function(_0x4fc74f,_0x27c157){var _0xda0429={'raw':![],'where':{'id':_0x4fc74f[_0x9240('0x46')]['id']}},_0x56ec45={};_0x56ec45[_0x9240('0x30')]=_[_0x9240('0x32')](db[_0x9240('0x2c')][_0x9240('0x47')]);_0x56ec45[_0x9240('0x31')]=_[_0x9240('0x32')](_0x4fc74f[_0x9240('0x31')]);_0x56ec45['filters']=_['intersection'](_0x56ec45[_0x9240('0x30')],_0x56ec45['query']);_0xda0429[_0x9240('0x35')]=_[_0x9240('0x34')](_0x56ec45[_0x9240('0x30')],qs[_0x9240('0x36')](_0x4fc74f[_0x9240('0x31')][_0x9240('0x36')]));_0xda0429[_0x9240('0x35')]=_0xda0429['attributes'][_0x9240('0x37')]?_0xda0429[_0x9240('0x35')]:_0x56ec45['model'];if(_0x4fc74f[_0x9240('0x31')]['includeAll']){_0xda0429[_0x9240('0x41')]=[{'all':!![]}];}_0xda0429=_[_0x9240('0x3e')]({},_0xda0429,_0x4fc74f[_0x9240('0x48')]);return db[_0x9240('0x2c')][_0x9240('0x49')](_0xda0429)[_0x9240('0x26')](handleEntityNotFound(_0x27c157,null))[_0x9240('0x26')](respondWithResult(_0x27c157,null))[_0x9240('0x44')](handleError(_0x27c157,null));};exports[_0x9240('0x4a')]=function(_0x1aa4a7,_0x2c6194){return db[_0x9240('0x2c')][_0x9240('0x4a')](_0x1aa4a7['body'],{})[_0x9240('0x26')](respondWithResult(_0x2c6194,0xc9))[_0x9240('0x44')](handleError(_0x2c6194,null));};exports[_0x9240('0x4b')]=function(_0x19f6d9,_0x434543){return db[_0x9240('0x2c')][_0x9240('0x4b')](_0x19f6d9[_0x9240('0x4c')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x434543,0xc9))[_0x9240('0x44')](handleError(_0x434543,null));};exports['update']=function(_0x374dc4,_0x2f854a){if(_0x374dc4[_0x9240('0x4c')]['id']){delete _0x374dc4[_0x9240('0x4c')]['id'];}return db[_0x9240('0x2c')][_0x9240('0x49')]({'where':{'id':_0x374dc4[_0x9240('0x46')]['id']}})[_0x9240('0x26')](handleEntityNotFound(_0x2f854a,null))['then'](saveUpdates(_0x374dc4['body'],null))['then'](respondWithResult(_0x2f854a,null))[_0x9240('0x44')](handleError(_0x2f854a,null));};exports[_0x9240('0x25')]=function(_0x5bd6da,_0x5d59ec){return db['AnalyticFieldReport'][_0x9240('0x49')]({'where':{'id':_0x5bd6da[_0x9240('0x46')]['id']}})[_0x9240('0x26')](handleEntityNotFound(_0x5d59ec,null))[_0x9240('0x26')](removeEntity(_0x5d59ec,null))[_0x9240('0x44')](handleError(_0x5d59ec,null));};exports[_0x9240('0x4d')]=function(_0x500887,_0x32882b){return db[_0x9240('0x2c')]['destroy']({'where':{'id':_0x500887[_0x9240('0x31')][_0x9240('0x4e')]||[]},'raw':![],'individualHooks':!![]})[_0x9240('0x26')](respondWithResult(_0x32882b,0xcc))['catch'](handleError(_0x32882b,null));};exports['addFields']=function(_0x196304,_0x4de845,_0xb5326e){return db['AnalyticCustomReport'][_0x9240('0x4f')]({'where':{'id':_0x196304[_0x9240('0x46')]['id']}})['then'](handleEntityNotFound(_0x4de845,null))[_0x9240('0x26')](function(_0x386884){if(_0x386884){return db[_0x9240('0x50')][_0x9240('0x51')](function(_0x126a02){return db['AnalyticFieldReport'][_0x9240('0x25')]({'where':{'CustomReportId':_0x196304[_0x9240('0x46')]['id']},'transaction':_0x126a02})[_0x9240('0x26')](function(_0x35fda2){var _0x3ce51d=_[_0x9240('0x2b')](_0x196304['body'],function(_0x1d8f49){delete _0x1d8f49['id'];_0x1d8f49['CustomReportId']=_0x196304[_0x9240('0x46')]['id'];return _0x1d8f49;});return db[_0x9240('0x2c')][_0x9240('0x4b')](_0x3ce51d,{'transaction':_0x126a02});});})['then'](function(){return db[_0x9240('0x2c')]['findAll']({'where':{'CustomReportId':_0x196304[_0x9240('0x46')]['id']}});});}})[_0x9240('0x26')](respondWithResult(_0x4de845,null))['catch'](handleError(_0x4de845,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index 9889750..24c050e 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 _0xa26f=['moment','bluebird','request-promise','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','api'];(function(_0x4d666c,_0x55ad25){var _0x7fd845=function(_0x2f75c8){while(--_0x2f75c8){_0x4d666c['push'](_0x4d666c['shift']());}};_0x7fd845(++_0x55ad25);}(_0xa26f,0x6b));var _0xfa26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa26f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfa26('0x0'));var util=require('util');var logger=require(_0xfa26('0x1'))(_0xfa26('0x2'));var moment=require(_0xfa26('0x3'));var BPromise=require(_0xfa26('0x4'));var rp=require(_0xfa26('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfa26('0x6'));module[_0xfa26('0x7')]=function(_0x105ee2,_0x145116){return _0x105ee2[_0xfa26('0x8')](_0xfa26('0x9'),attributes,{'tableName':_0xfa26('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1d01=['path','rimraf','../../config/environment','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3bcdd2,_0x25d9c0){var _0x5f4a36=function(_0x2b45da){while(--_0x2b45da){_0x3bcdd2['push'](_0x3bcdd2['shift']());}};_0x5f4a36(++_0x25d9c0);}(_0x1d01,0x186));var _0x11d0=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x1d01[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x11d0('0x0'));var util=require(_0x11d0('0x1'));var logger=require(_0x11d0('0x2'))('api');var moment=require(_0x11d0('0x3'));var BPromise=require(_0x11d0('0x4'));var rp=require(_0x11d0('0x5'));var fs=require('fs');var path=require(_0x11d0('0x6'));var rimraf=require(_0x11d0('0x7'));var config=require(_0x11d0('0x8'));var attributes=require('./analyticFieldReport.attributes');module[_0x11d0('0x9')]=function(_0x55cb62,_0x393fb6){return _0x55cb62['define'](_0x11d0('0xa'),attributes,{'tableName':_0x11d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 418e2c4..aa30aae 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 _0x270c=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x36a236,_0x3cc5fc){var _0xa4ab27=function(_0xac60ea){while(--_0xac60ea){_0x36a236['push'](_0x36a236['shift']());}};_0xa4ab27(++_0x3cc5fc);}(_0x270c,0xd8));var _0xc270=function(_0x441d52,_0x4ca1c4){_0x441d52=_0x441d52-0x0;var _0x32f501=_0x270c[_0x441d52];return _0x32f501;};'use strict';var _=require(_0xc270('0x0'));var util=require(_0xc270('0x1'));var moment=require(_0xc270('0x2'));var BPromise=require('bluebird');var rs=require(_0xc270('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc270('0x4'))['db'];var utils=require(_0xc270('0x5'));var logger=require(_0xc270('0x6'))(_0xc270('0x7'));var config=require(_0xc270('0x8'));var jayson=require(_0xc270('0x9'));var client=jayson[_0xc270('0xa')][_0xc270('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xd0c690,_0x4dc56c,_0x55f797){return new BPromise(function(_0x419169,_0x3ad41c){return client[_0xc270('0xc')](_0xd0c690,_0x55f797)[_0xc270('0xd')](function(_0x5c25ea){logger[_0xc270('0xe')](_0xc270('0xf'),_0x4dc56c,_0xc270('0x10'));logger[_0xc270('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x4dc56c,_0xc270('0x10'),JSON[_0xc270('0x12')](_0x5c25ea));if(_0x5c25ea[_0xc270('0x13')]){if(_0x5c25ea[_0xc270('0x13')][_0xc270('0x14')]===0x1f4){logger['error'](_0xc270('0xf'),_0x4dc56c,_0x5c25ea['error'][_0xc270('0x15')]);return _0x3ad41c(_0x5c25ea[_0xc270('0x13')]['message']);}logger[_0xc270('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dc56c,_0x5c25ea['error'][_0xc270('0x15')]);return _0x419169(_0x5c25ea[_0xc270('0x13')][_0xc270('0x15')]);}else{logger[_0xc270('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4dc56c,_0xc270('0x10'));_0x419169(_0x5c25ea[_0xc270('0x16')][_0xc270('0x15')]);}})['catch'](function(_0x4b292c){logger[_0xc270('0x13')](_0xc270('0xf'),_0x4dc56c,_0x4b292c);_0x3ad41c(_0x4b292c);});});}
\ No newline at end of file
+var _0x64f0=['rpc','../../config/environment','jayson/promise','client','http','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x4693ac,_0xb702b7){var _0x4dd543=function(_0x463169){while(--_0x463169){_0x4693ac['push'](_0x4693ac['shift']());}};_0x4dd543(++_0xb702b7);}(_0x64f0,0x19d));var _0x064f=function(_0x2b6600,_0x24c497){_0x2b6600=_0x2b6600-0x0;var _0x912ee2=_0x64f0[_0x2b6600];return _0x912ee2;};'use strict';var _=require(_0x064f('0x0'));var util=require(_0x064f('0x1'));var moment=require(_0x064f('0x2'));var BPromise=require(_0x064f('0x3'));var rs=require(_0x064f('0x4'));var fs=require('fs');var Redis=require(_0x064f('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x064f('0x6'));var logger=require('../../config/logger')(_0x064f('0x7'));var config=require(_0x064f('0x8'));var jayson=require(_0x064f('0x9'));var client=jayson[_0x064f('0xa')][_0x064f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1f56ba,_0x1d214c,_0x164809){return new BPromise(function(_0x1244ad,_0x3894a1){return client['request'](_0x1f56ba,_0x164809)['then'](function(_0xf49df5){logger[_0x064f('0xc')](_0x064f('0xd'),_0x1d214c,_0x064f('0xe'));logger[_0x064f('0xf')](_0x064f('0x10'),_0x1d214c,_0x064f('0xe'),JSON['stringify'](_0xf49df5));if(_0xf49df5[_0x064f('0x11')]){if(_0xf49df5['error'][_0x064f('0x12')]===0x1f4){logger[_0x064f('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1d214c,_0xf49df5[_0x064f('0x11')][_0x064f('0x13')]);return _0x3894a1(_0xf49df5[_0x064f('0x11')][_0x064f('0x13')]);}logger[_0x064f('0x11')](_0x064f('0xd'),_0x1d214c,_0xf49df5['error'][_0x064f('0x13')]);return _0x1244ad(_0xf49df5[_0x064f('0x11')]['message']);}else{logger[_0x064f('0xc')](_0x064f('0xd'),_0x1d214c,'request\x20sent');_0x1244ad(_0xf49df5[_0x064f('0x14')][_0x064f('0x13')]);}})['catch'](function(_0x571e2f){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1d214c,_0x571e2f);_0x3894a1(_0x571e2f);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index a382724..0589d89 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(_0x4dc5eb,_0x8e2c9a){var _0x55a235=function(_0x4269c4){while(--_0x4269c4){_0x4dc5eb['push'](_0x4dc5eb['shift']());}};_0x55a235(++_0x8e2c9a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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(_0x4aff63,_0x39444b){var _0x4c853b=function(_0x107bd6){while(--_0x107bd6){_0x4aff63['push'](_0x4aff63['shift']());}};_0x4c853b(++_0x39444b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x139a3c,_0x4fc883){_0x139a3c=_0x139a3c-0x0;var _0x2b375b=_0xa9e0[_0x139a3c];return _0x2b375b;};'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 b3f222a..5ae8dbb 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 _0x6c9c=['name','STRING','TEXT','sequelize','exports'];(function(_0x1b1464,_0x59069e){var _0x32d77b=function(_0x19fec5){while(--_0x19fec5){_0x1b1464['push'](_0x1b1464['shift']());}};_0x32d77b(++_0x59069e);}(_0x6c9c,0x12a));var _0xc6c9=function(_0x7246ee,_0x2c46a9){_0x7246ee=_0x7246ee-0x0;var _0x4ae624=_0x6c9c[_0x7246ee];return _0x4ae624;};'use strict';var Sequelize=require(_0xc6c9('0x0'));module[_0xc6c9('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc6c9('0x2')},'table':{'type':Sequelize[_0xc6c9('0x3')]},'metric':{'type':Sequelize[_0xc6c9('0x4')]},'description':{'type':Sequelize[_0xc6c9('0x3')]}};
\ No newline at end of file
+var _0xfe9d=['STRING','name','sequelize','exports'];(function(_0x2eb46b,_0x59bb26){var _0x335612=function(_0x3753a2){while(--_0x3753a2){_0x2eb46b['push'](_0x2eb46b['shift']());}};_0x335612(++_0x59bb26);}(_0xfe9d,0x10e));var _0xdfe9=function(_0x107ad0,_0x400f9f){_0x107ad0=_0x107ad0-0x0;var _0xbc6750=_0xfe9d[_0x107ad0];return _0xbc6750;};'use strict';var Sequelize=require(_0xdfe9('0x0'));module[_0xdfe9('0x1')]={'name':{'type':Sequelize[_0xdfe9('0x2')],'allowNull':![],'unique':_0xdfe9('0x3')},'table':{'type':Sequelize[_0xdfe9('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xdfe9('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 4894cca..0d3a68b 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 _0xf2ca=['filter','merge','map','type','VIRTUAL','options','AnalyticMetric','count','includeAll','findAll','rows','catch','keys','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','apply','reject','then','get','Metrics','UserProfileResource','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x56b9ab,_0x2a36bd){var _0x1fad82=function(_0x377a41){while(--_0x377a41){_0x56b9ab['push'](_0x56b9ab['shift']());}};_0x1fad82(++_0x2a36bd);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x20f96d,_0x23e67f){_0x20f96d=_0x20f96d-0x0;var _0x9a7524=_0xf2ca[_0x20f96d];return _0x9a7524;};'use strict';var emlformat=require(_0xaf2c('0x0'));var rimraf=require(_0xaf2c('0x1'));var zipdir=require(_0xaf2c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xaf2c('0x3'));var moment=require(_0xaf2c('0x4'));var BPromise=require(_0xaf2c('0x5'));var Mustache=require(_0xaf2c('0x6'));var util=require(_0xaf2c('0x7'));var path=require(_0xaf2c('0x8'));var sox=require('sox');var csv=require(_0xaf2c('0x9'));var ejs=require(_0xaf2c('0xa'));var fs=require('fs');var fs_extra=require(_0xaf2c('0xb'));var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0x9'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var licenseUtil=require(_0xaf2c('0x16'));var db=require(_0xaf2c('0x17'))['db'];function respondWithStatusCode(_0x285dac,_0x59a59b){_0x59a59b=_0x59a59b||0xcc;return function(_0x590126){if(_0x590126){return _0x285dac[_0xaf2c('0x18')](_0x59a59b);}return _0x285dac[_0xaf2c('0x19')](_0x59a59b)[_0xaf2c('0x1a')]();};}function respondWithResult(_0x18a8a5,_0x293ca6){_0x293ca6=_0x293ca6||0xc8;return function(_0x152c73){if(_0x152c73){return _0x18a8a5[_0xaf2c('0x19')](_0x293ca6)[_0xaf2c('0x1b')](_0x152c73);}};}function respondWithFilteredResult(_0x2119c8,_0x1d0633){return function(_0x6ac8e){if(_0x6ac8e){var _0x2b4d13=typeof _0x1d0633[_0xaf2c('0x1c')]===_0xaf2c('0x1d')&&typeof _0x1d0633[_0xaf2c('0x1e')]==='undefined';var _0x3ca650=_0x6ac8e['count'];var _0x278a28=_0x2b4d13?0x0:_0x1d0633[_0xaf2c('0x1c')];var _0x1d544a=_0x2b4d13?_0x6ac8e['count']:_0x1d0633[_0xaf2c('0x1c')]+_0x1d0633[_0xaf2c('0x1e')];var _0x1fec4c;if(_0x1d544a>=_0x3ca650){_0x1d544a=_0x3ca650;_0x1fec4c=0xc8;}else{_0x1fec4c=0xce;}_0x2119c8[_0xaf2c('0x19')](_0x1fec4c);return _0x2119c8[_0xaf2c('0x1f')](_0xaf2c('0x20'),_0x278a28+'-'+_0x1d544a+'/'+_0x3ca650)['json'](_0x6ac8e);}return null;};}function patchUpdates(_0x35e712){return function(_0x164bcb){try{jsonpatch[_0xaf2c('0x21')](_0x164bcb,_0x35e712,!![]);}catch(_0x3bfd3f){return BPromise[_0xaf2c('0x22')](_0x3bfd3f);}return _0x164bcb['save']();};}function saveUpdates(_0x396646,_0xbf6f62){return function(_0x18153c){if(_0x18153c){return _0x18153c['update'](_0x396646)['then'](function(_0x29cbdf){return _0x29cbdf;});}return null;};}function removeEntity(_0x303546,_0x1cafad){return function(_0x99f78d){if(_0x99f78d){return _0x99f78d['destroy']()[_0xaf2c('0x23')](function(){var _0xf1a7cf=_0x99f78d[_0xaf2c('0x24')]({'plain':!![]});var _0x3c1ae6=_0xaf2c('0x25');return db[_0xaf2c('0x26')][_0xaf2c('0x27')]({'where':{'type':_0x3c1ae6,'resourceId':_0xf1a7cf['id']}})['then'](function(){return _0x99f78d;});})[_0xaf2c('0x23')](function(){_0x303546[_0xaf2c('0x19')](0xcc)[_0xaf2c('0x1a')]();});}};}function handleEntityNotFound(_0x410536,_0x4b7cf2){return function(_0x3fb190){if(!_0x3fb190){_0x410536['sendStatus'](0x194);}return _0x3fb190;};}function handleError(_0x38db1b,_0x42f980){_0x42f980=_0x42f980||0x1f4;return function(_0x15466b){logger['error'](_0x15466b[_0xaf2c('0x28')]);if(_0x15466b[_0xaf2c('0x29')]){delete _0x15466b[_0xaf2c('0x29')];}_0x38db1b['status'](_0x42f980)[_0xaf2c('0x2a')](_0x15466b);};}exports[_0xaf2c('0x2b')]=function(_0x42e2a5,_0x19364e){var _0x59d858={},_0x3da072={},_0x4072ff={'count':0x0,'rows':[]};var _0x1be1ef=_['map'](db['AnalyticMetric'][_0xaf2c('0x2c')],function(_0x4c9b4f){return{'name':_0x4c9b4f[_0xaf2c('0x2d')],'type':_0x4c9b4f['type'][_0xaf2c('0x2e')]};});_0x3da072[_0xaf2c('0x2f')]=_['map'](_0x1be1ef,_0xaf2c('0x29'));_0x3da072[_0xaf2c('0x30')]=_['keys'](_0x42e2a5[_0xaf2c('0x30')]);_0x3da072[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x3da072[_0xaf2c('0x2f')],_0x3da072[_0xaf2c('0x30')]);_0x59d858[_0xaf2c('0x33')]=_['intersection'](_0x3da072[_0xaf2c('0x2f')],qs['fields'](_0x42e2a5[_0xaf2c('0x30')]['fields']));_0x59d858[_0xaf2c('0x33')]=_0x59d858['attributes'][_0xaf2c('0x34')]?_0x59d858['attributes']:_0x3da072[_0xaf2c('0x2f')];if(!_0x42e2a5['query'][_0xaf2c('0x35')](_0xaf2c('0x36'))){_0x59d858[_0xaf2c('0x1e')]=qs[_0xaf2c('0x1e')](_0x42e2a5[_0xaf2c('0x30')]['limit']);_0x59d858['offset']=qs[_0xaf2c('0x1c')](_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x1c')]);}_0x59d858[_0xaf2c('0x37')]=qs[_0xaf2c('0x38')](_0x42e2a5[_0xaf2c('0x30')]['sort']);_0x59d858[_0xaf2c('0x39')]=qs[_0xaf2c('0x31')](_['pick'](_0x42e2a5[_0xaf2c('0x30')],_0x3da072[_0xaf2c('0x31')]),_0x1be1ef);if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x3a')]){_0x59d858[_0xaf2c('0x39')]=_[_0xaf2c('0x3b')](_0x59d858[_0xaf2c('0x39')],{'$or':_[_0xaf2c('0x3c')](_0x1be1ef,function(_0x296ca8){if(_0x296ca8[_0xaf2c('0x3d')]!==_0xaf2c('0x3e')){var _0x43f606={};_0x43f606[_0x296ca8[_0xaf2c('0x29')]]={'$like':'%'+_0x42e2a5['query']['filter']+'%'};return _0x43f606;}})});}_0x59d858=_['merge']({},_0x59d858,_0x42e2a5[_0xaf2c('0x3f')]);var _0x3cb075={'where':_0x59d858[_0xaf2c('0x39')]};return db[_0xaf2c('0x40')][_0xaf2c('0x41')](_0x3cb075)[_0xaf2c('0x23')](function(_0x51c441){_0x4072ff[_0xaf2c('0x41')]=_0x51c441;if(_0x42e2a5[_0xaf2c('0x30')][_0xaf2c('0x42')]){_0x59d858['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0xaf2c('0x43')](_0x59d858);})['then'](function(_0x181787){_0x4072ff[_0xaf2c('0x44')]=_0x181787;return _0x4072ff;})[_0xaf2c('0x23')](respondWithFilteredResult(_0x19364e,_0x59d858))[_0xaf2c('0x45')](handleError(_0x19364e,null));};exports['show']=function(_0x2091eb,_0x532d5f){var _0x2056b8={'raw':!![],'where':{'id':_0x2091eb['params']['id']}},_0x8ebb65={};_0x8ebb65[_0xaf2c('0x2f')]=_['keys'](db[_0xaf2c('0x40')][_0xaf2c('0x2c')]);_0x8ebb65[_0xaf2c('0x30')]=_[_0xaf2c('0x46')](_0x2091eb[_0xaf2c('0x30')]);_0x8ebb65[_0xaf2c('0x31')]=_[_0xaf2c('0x32')](_0x8ebb65[_0xaf2c('0x2f')],_0x8ebb65[_0xaf2c('0x30')]);_0x2056b8['attributes']=_['intersection'](_0x8ebb65[_0xaf2c('0x2f')],qs['fields'](_0x2091eb['query']['fields']));_0x2056b8[_0xaf2c('0x33')]=_0x2056b8[_0xaf2c('0x33')][_0xaf2c('0x34')]?_0x2056b8[_0xaf2c('0x33')]:_0x8ebb65['model'];if(_0x2091eb[_0xaf2c('0x30')]['includeAll']){_0x2056b8[_0xaf2c('0x47')]=[{'all':!![]}];}_0x2056b8=_['merge']({},_0x2056b8,_0x2091eb[_0xaf2c('0x3f')]);return db[_0xaf2c('0x40')][_0xaf2c('0x48')](_0x2056b8)[_0xaf2c('0x23')](handleEntityNotFound(_0x532d5f,null))[_0xaf2c('0x23')](respondWithResult(_0x532d5f,null))['catch'](handleError(_0x532d5f,null));};exports[_0xaf2c('0x49')]=function(_0x26afee,_0x4b3ca4){return db['AnalyticMetric'][_0xaf2c('0x49')](_0x26afee['body'],{})[_0xaf2c('0x23')](function(_0x23642b){var _0x17b9ec=_0x26afee[_0xaf2c('0x4a')][_0xaf2c('0x24')]({'plain':!![]});if(!_0x17b9ec)throw new Error(_0xaf2c('0x4b'));if(_0x17b9ec[_0xaf2c('0x4c')]===_0xaf2c('0x4a')){var _0x31ccfe=_0x23642b[_0xaf2c('0x24')]({'plain':!![]});var _0x371486='Metrics';return db[_0xaf2c('0x4d')][_0xaf2c('0x48')]({'where':{'name':_0x371486,'userProfileId':_0x17b9ec['userProfileId']},'raw':!![]})['then'](function(_0x56d7ce){if(_0x56d7ce&&_0x56d7ce[_0xaf2c('0x4e')]===0x0){return db[_0xaf2c('0x26')]['create']({'name':_0x31ccfe[_0xaf2c('0x29')],'resourceId':_0x31ccfe['id'],'type':_0x56d7ce[_0xaf2c('0x29')],'sectionId':_0x56d7ce['id']},{})[_0xaf2c('0x23')](function(){return _0x23642b;});}else{return _0x23642b;}})[_0xaf2c('0x45')](function(_0x265748){logger[_0xaf2c('0x4f')](_0xaf2c('0x50'),_0x265748);throw _0x265748;});}return _0x23642b;})['then'](respondWithResult(_0x4b3ca4,0xc9))[_0xaf2c('0x45')](handleError(_0x4b3ca4,null));};exports[_0xaf2c('0x51')]=function(_0x5771e5,_0x245797){if(_0x5771e5[_0xaf2c('0x52')]['id']){delete _0x5771e5[_0xaf2c('0x52')]['id'];}return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x5771e5[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x245797,null))[_0xaf2c('0x23')](saveUpdates(_0x5771e5[_0xaf2c('0x52')],null))[_0xaf2c('0x23')](respondWithResult(_0x245797,null))[_0xaf2c('0x45')](handleError(_0x245797,null));};exports[_0xaf2c('0x27')]=function(_0x411e84,_0x2356a0){return db[_0xaf2c('0x40')][_0xaf2c('0x48')]({'where':{'id':_0x411e84[_0xaf2c('0x53')]['id']}})[_0xaf2c('0x23')](handleEntityNotFound(_0x2356a0,null))[_0xaf2c('0x23')](removeEntity(_0x2356a0,null))[_0xaf2c('0x45')](handleError(_0x2356a0,null));};
\ No newline at end of file
+var _0x5fc3=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','status','end','offset','undefined','limit','count','Content-Range','json','apply','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','catch','show','params','merge','create','body'];(function(_0x3f31f8,_0x148a34){var _0x425fb9=function(_0x1f0b56){while(--_0x1f0b56){_0x3f31f8['push'](_0x3f31f8['shift']());}};_0x425fb9(++_0x148a34);}(_0x5fc3,0xa8));var _0x35fc=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x5fc3[_0x231e16];return _0x570a7c;};'use strict';var emlformat=require(_0x35fc('0x0'));var rimraf=require(_0x35fc('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x35fc('0x2'));var rp=require(_0x35fc('0x3'));var moment=require(_0x35fc('0x4'));var BPromise=require(_0x35fc('0x5'));var Mustache=require(_0x35fc('0x6'));var util=require('util');var path=require(_0x35fc('0x7'));var sox=require(_0x35fc('0x8'));var csv=require(_0x35fc('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0x9'));var querystring=require(_0x35fc('0xe'));var Papa=require(_0x35fc('0xf'));var Redis=require(_0x35fc('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x11'));var as=require(_0x35fc('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x13'))(_0x35fc('0x14'));var utils=require('../../config/utils');var config=require(_0x35fc('0x15'));var licenseUtil=require(_0x35fc('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4cbe74,_0x409357){_0x409357=_0x409357||0xcc;return function(_0x5d462a){if(_0x5d462a){return _0x4cbe74[_0x35fc('0x17')](_0x409357);}return _0x4cbe74[_0x35fc('0x18')](_0x409357)[_0x35fc('0x19')]();};}function respondWithResult(_0x29730f,_0x38d9f2){_0x38d9f2=_0x38d9f2||0xc8;return function(_0x5cfe94){if(_0x5cfe94){return _0x29730f['status'](_0x38d9f2)['json'](_0x5cfe94);}};}function respondWithFilteredResult(_0x558364,_0x398b67){return function(_0x229d56){if(_0x229d56){var _0x53b898=typeof _0x398b67[_0x35fc('0x1a')]===_0x35fc('0x1b')&&typeof _0x398b67[_0x35fc('0x1c')]==='undefined';var _0x26ba54=_0x229d56[_0x35fc('0x1d')];var _0x553677=_0x53b898?0x0:_0x398b67[_0x35fc('0x1a')];var _0x363e47=_0x53b898?_0x229d56[_0x35fc('0x1d')]:_0x398b67['offset']+_0x398b67[_0x35fc('0x1c')];var _0x3c58ea;if(_0x363e47>=_0x26ba54){_0x363e47=_0x26ba54;_0x3c58ea=0xc8;}else{_0x3c58ea=0xce;}_0x558364[_0x35fc('0x18')](_0x3c58ea);return _0x558364['set'](_0x35fc('0x1e'),_0x553677+'-'+_0x363e47+'/'+_0x26ba54)[_0x35fc('0x1f')](_0x229d56);}return null;};}function patchUpdates(_0x3229d1){return function(_0x251a1f){try{jsonpatch[_0x35fc('0x20')](_0x251a1f,_0x3229d1,!![]);}catch(_0x21f1a9){return BPromise[_0x35fc('0x21')](_0x21f1a9);}return _0x251a1f[_0x35fc('0x22')]();};}function saveUpdates(_0x2405e8,_0x427eae){return function(_0x5bd2b8){if(_0x5bd2b8){return _0x5bd2b8[_0x35fc('0x23')](_0x2405e8)[_0x35fc('0x24')](function(_0x257719){return _0x257719;});}return null;};}function removeEntity(_0x2d8183,_0x3b4743){return function(_0x55e9e7){if(_0x55e9e7){return _0x55e9e7[_0x35fc('0x25')]()[_0x35fc('0x24')](function(){var _0x561bf8=_0x55e9e7[_0x35fc('0x26')]({'plain':!![]});var _0x5a93df=_0x35fc('0x27');return db['UserProfileResource'][_0x35fc('0x25')]({'where':{'type':_0x5a93df,'resourceId':_0x561bf8['id']}})['then'](function(){return _0x55e9e7;});})[_0x35fc('0x24')](function(){_0x2d8183[_0x35fc('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x519264,_0x47774c){return function(_0x58edb6){if(!_0x58edb6){_0x519264[_0x35fc('0x17')](0x194);}return _0x58edb6;};}function handleError(_0x1a5d92,_0x57001c){_0x57001c=_0x57001c||0x1f4;return function(_0x26b7cb){logger[_0x35fc('0x28')](_0x26b7cb[_0x35fc('0x29')]);if(_0x26b7cb[_0x35fc('0x2a')]){delete _0x26b7cb[_0x35fc('0x2a')];}_0x1a5d92[_0x35fc('0x18')](_0x57001c)[_0x35fc('0x2b')](_0x26b7cb);};}exports[_0x35fc('0x2c')]=function(_0x54aedc,_0x1cd1ae){var _0x220931={},_0x22af18={},_0x52acc5={'count':0x0,'rows':[]};var _0xe79f52=_[_0x35fc('0x2d')](db[_0x35fc('0x2e')][_0x35fc('0x2f')],function(_0xd8a4ca){return{'name':_0xd8a4ca[_0x35fc('0x30')],'type':_0xd8a4ca[_0x35fc('0x31')][_0x35fc('0x32')]};});_0x22af18[_0x35fc('0x33')]=_[_0x35fc('0x2d')](_0xe79f52,'name');_0x22af18['query']=_[_0x35fc('0x34')](_0x54aedc['query']);_0x22af18[_0x35fc('0x35')]=_[_0x35fc('0x36')](_0x22af18[_0x35fc('0x33')],_0x22af18[_0x35fc('0x37')]);_0x220931[_0x35fc('0x38')]=_[_0x35fc('0x36')](_0x22af18['model'],qs[_0x35fc('0x39')](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x39')]));_0x220931[_0x35fc('0x38')]=_0x220931[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x220931['attributes']:_0x22af18[_0x35fc('0x33')];if(!_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3b')]('nolimit')){_0x220931[_0x35fc('0x1c')]=qs['limit'](_0x54aedc[_0x35fc('0x37')][_0x35fc('0x1c')]);_0x220931[_0x35fc('0x1a')]=qs[_0x35fc('0x1a')](_0x54aedc['query']['offset']);}_0x220931['order']=qs[_0x35fc('0x3c')](_0x54aedc['query'][_0x35fc('0x3c')]);_0x220931['where']=qs[_0x35fc('0x35')](_[_0x35fc('0x3d')](_0x54aedc[_0x35fc('0x37')],_0x22af18[_0x35fc('0x35')]),_0xe79f52);if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]){_0x220931[_0x35fc('0x3f')]=_['merge'](_0x220931[_0x35fc('0x3f')],{'$or':_[_0x35fc('0x2d')](_0xe79f52,function(_0x4e0ce3){if(_0x4e0ce3[_0x35fc('0x31')]!==_0x35fc('0x40')){var _0x1aac67={};_0x1aac67[_0x4e0ce3[_0x35fc('0x2a')]]={'$like':'%'+_0x54aedc[_0x35fc('0x37')][_0x35fc('0x3e')]+'%'};return _0x1aac67;}})});}_0x220931=_['merge']({},_0x220931,_0x54aedc[_0x35fc('0x41')]);var _0x267858={'where':_0x220931[_0x35fc('0x3f')]};return db['AnalyticMetric'][_0x35fc('0x1d')](_0x267858)[_0x35fc('0x24')](function(_0x596919){_0x52acc5[_0x35fc('0x1d')]=_0x596919;if(_0x54aedc[_0x35fc('0x37')][_0x35fc('0x42')]){_0x220931[_0x35fc('0x43')]=[{'all':!![]}];}return db[_0x35fc('0x2e')][_0x35fc('0x44')](_0x220931);})[_0x35fc('0x24')](function(_0x3ec51f){_0x52acc5['rows']=_0x3ec51f;return _0x52acc5;})['then'](respondWithFilteredResult(_0x1cd1ae,_0x220931))[_0x35fc('0x45')](handleError(_0x1cd1ae,null));};exports[_0x35fc('0x46')]=function(_0x4fdc6d,_0x5c2e5c){var _0x4ff202={'raw':!![],'where':{'id':_0x4fdc6d[_0x35fc('0x47')]['id']}},_0x79677d={};_0x79677d['model']=_[_0x35fc('0x34')](db[_0x35fc('0x2e')][_0x35fc('0x2f')]);_0x79677d[_0x35fc('0x37')]=_['keys'](_0x4fdc6d['query']);_0x79677d['filters']=_['intersection'](_0x79677d['model'],_0x79677d[_0x35fc('0x37')]);_0x4ff202[_0x35fc('0x38')]=_['intersection'](_0x79677d[_0x35fc('0x33')],qs['fields'](_0x4fdc6d[_0x35fc('0x37')][_0x35fc('0x39')]));_0x4ff202[_0x35fc('0x38')]=_0x4ff202[_0x35fc('0x38')][_0x35fc('0x3a')]?_0x4ff202['attributes']:_0x79677d[_0x35fc('0x33')];if(_0x4fdc6d[_0x35fc('0x37')]['includeAll']){_0x4ff202[_0x35fc('0x43')]=[{'all':!![]}];}_0x4ff202=_[_0x35fc('0x48')]({},_0x4ff202,_0x4fdc6d[_0x35fc('0x41')]);return db[_0x35fc('0x2e')]['find'](_0x4ff202)[_0x35fc('0x24')](handleEntityNotFound(_0x5c2e5c,null))['then'](respondWithResult(_0x5c2e5c,null))['catch'](handleError(_0x5c2e5c,null));};exports[_0x35fc('0x49')]=function(_0x9db7e8,_0x18dc78){return db[_0x35fc('0x2e')][_0x35fc('0x49')](_0x9db7e8[_0x35fc('0x4a')],{})[_0x35fc('0x24')](function(_0x16afa6){var _0x4f555f=_0x9db7e8[_0x35fc('0x4b')][_0x35fc('0x26')]({'plain':!![]});if(!_0x4f555f)throw new Error(_0x35fc('0x4c'));if(_0x4f555f[_0x35fc('0x4d')]===_0x35fc('0x4b')){var _0x1e3221=_0x16afa6[_0x35fc('0x26')]({'plain':!![]});var _0x347a4a=_0x35fc('0x27');return db[_0x35fc('0x4e')][_0x35fc('0x4f')]({'where':{'name':_0x347a4a,'userProfileId':_0x4f555f[_0x35fc('0x50')]},'raw':!![]})[_0x35fc('0x24')](function(_0x3146e2){if(_0x3146e2&&_0x3146e2['autoAssociation']===0x0){return db['UserProfileResource'][_0x35fc('0x49')]({'name':_0x1e3221[_0x35fc('0x2a')],'resourceId':_0x1e3221['id'],'type':_0x3146e2[_0x35fc('0x2a')],'sectionId':_0x3146e2['id']},{})[_0x35fc('0x24')](function(){return _0x16afa6;});}else{return _0x16afa6;}})[_0x35fc('0x45')](function(_0x3e6494){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e6494);throw _0x3e6494;});}return _0x16afa6;})[_0x35fc('0x24')](respondWithResult(_0x18dc78,0xc9))[_0x35fc('0x45')](handleError(_0x18dc78,null));};exports[_0x35fc('0x23')]=function(_0x38bc78,_0x5b2595){if(_0x38bc78[_0x35fc('0x4a')]['id']){delete _0x38bc78[_0x35fc('0x4a')]['id'];}return db['AnalyticMetric'][_0x35fc('0x4f')]({'where':{'id':_0x38bc78[_0x35fc('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b2595,null))[_0x35fc('0x24')](saveUpdates(_0x38bc78[_0x35fc('0x4a')],null))[_0x35fc('0x24')](respondWithResult(_0x5b2595,null))[_0x35fc('0x45')](handleError(_0x5b2595,null));};exports['destroy']=function(_0x4de34b,_0x502a15){return db[_0x35fc('0x2e')][_0x35fc('0x4f')]({'where':{'id':_0x4de34b['params']['id']}})[_0x35fc('0x24')](handleEntityNotFound(_0x502a15,null))[_0x35fc('0x24')](removeEntity(_0x502a15,null))[_0x35fc('0x45')](handleError(_0x502a15,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 2a190f3..ceff209 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 _0xa63f=['request-promise','path','rimraf','../../config/environment','define','AnalyticMetric','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5d0288,_0x348df1){var _0x45ebd9=function(_0x180208){while(--_0x180208){_0x5d0288['push'](_0x5d0288['shift']());}};_0x45ebd9(++_0x348df1);}(_0xa63f,0x1b6));var _0xfa63=function(_0x1ff2ec,_0x386e86){_0x1ff2ec=_0x1ff2ec-0x0;var _0x405683=_0xa63f[_0x1ff2ec];return _0x405683;};'use strict';var _=require(_0xfa63('0x0'));var util=require(_0xfa63('0x1'));var logger=require(_0xfa63('0x2'))(_0xfa63('0x3'));var moment=require(_0xfa63('0x4'));var BPromise=require(_0xfa63('0x5'));var rp=require(_0xfa63('0x6'));var fs=require('fs');var path=require(_0xfa63('0x7'));var rimraf=require(_0xfa63('0x8'));var config=require(_0xfa63('0x9'));var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x20d4f6,_0x41efce){return _0x20d4f6[_0xfa63('0xa')](_0xfa63('0xb'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x975b=['define','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticMetric.attributes','exports'];(function(_0x2552e3,_0x577a45){var _0x38ffc9=function(_0x58c77e){while(--_0x58c77e){_0x2552e3['push'](_0x2552e3['shift']());}};_0x38ffc9(++_0x577a45);}(_0x975b,0x1c9));var _0xb975=function(_0x1f0d1d,_0x340a1b){_0x1f0d1d=_0x1f0d1d-0x0;var _0x3a7301=_0x975b[_0x1f0d1d];return _0x3a7301;};'use strict';var _=require(_0xb975('0x0'));var util=require(_0xb975('0x1'));var logger=require(_0xb975('0x2'))(_0xb975('0x3'));var moment=require(_0xb975('0x4'));var BPromise=require(_0xb975('0x5'));var rp=require(_0xb975('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb975('0x7'));var config=require(_0xb975('0x8'));var attributes=require(_0xb975('0x9'));module[_0xb975('0xa')]=function(_0x599d95,_0x1729fe){return _0x599d95[_0xb975('0xb')]('AnalyticMetric',attributes,{'tableName':_0xb975('0xc'),'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 25d7d96..8ef3793 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 _0x5976=['catch','lodash','util','moment','bluebird','../../config/utils','rpc','jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x4674f7,_0x23a007){var _0x203744=function(_0x368466){while(--_0x368466){_0x4674f7['push'](_0x4674f7['shift']());}};_0x203744(++_0x23a007);}(_0x5976,0xf1));var _0x6597=function(_0x5da675,_0x2ead75){_0x5da675=_0x5da675-0x0;var _0x330a76=_0x5976[_0x5da675];return _0x330a76;};'use strict';var _=require(_0x6597('0x0'));var util=require(_0x6597('0x1'));var moment=require(_0x6597('0x2'));var BPromise=require(_0x6597('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6597('0x4'));var logger=require('../../config/logger')(_0x6597('0x5'));var config=require('../../config/environment');var jayson=require(_0x6597('0x6'));var client=jayson[_0x6597('0x7')][_0x6597('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x190136,_0x290224,_0x52cfb5){return new BPromise(function(_0x5640c5,_0x27f70a){return client[_0x6597('0x9')](_0x190136,_0x52cfb5)['then'](function(_0x1f3b05){logger[_0x6597('0xa')](_0x6597('0xb'),_0x290224,_0x6597('0xc'));logger[_0x6597('0xd')](_0x6597('0xe'),_0x290224,_0x6597('0xc'),JSON[_0x6597('0xf')](_0x1f3b05));if(_0x1f3b05['error']){if(_0x1f3b05['error'][_0x6597('0x10')]===0x1f4){logger[_0x6597('0x11')]('AnalyticMetric,\x20%s,\x20%s',_0x290224,_0x1f3b05[_0x6597('0x11')]['message']);return _0x27f70a(_0x1f3b05[_0x6597('0x11')][_0x6597('0x12')]);}logger[_0x6597('0x11')](_0x6597('0xb'),_0x290224,_0x1f3b05[_0x6597('0x11')][_0x6597('0x12')]);return _0x5640c5(_0x1f3b05[_0x6597('0x11')][_0x6597('0x12')]);}else{logger[_0x6597('0xa')]('AnalyticMetric,\x20%s,\x20%s',_0x290224,_0x6597('0xc'));_0x5640c5(_0x1f3b05['result'][_0x6597('0x12')]);}})[_0x6597('0x13')](function(_0x3f48ce){logger[_0x6597('0x11')](_0x6597('0xb'),_0x290224,_0x3f48ce);_0x27f70a(_0x3f48ce);});});}
\ No newline at end of file
+var _0x16ba=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring'];(function(_0x4bd293,_0x220feb){var _0x2f3e67=function(_0x527470){while(--_0x527470){_0x4bd293['push'](_0x4bd293['shift']());}};_0x2f3e67(++_0x220feb);}(_0x16ba,0xe2));var _0xa16b=function(_0x1ce88e,_0x3b7c50){_0x1ce88e=_0x1ce88e-0x0;var _0x4e2663=_0x16ba[_0x1ce88e];return _0x4e2663;};'use strict';var _=require(_0xa16b('0x0'));var util=require(_0xa16b('0x1'));var moment=require('moment');var BPromise=require(_0xa16b('0x2'));var rs=require(_0xa16b('0x3'));var fs=require('fs');var Redis=require(_0xa16b('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa16b('0x5'));var logger=require('../../config/logger')(_0xa16b('0x6'));var config=require(_0xa16b('0x7'));var jayson=require(_0xa16b('0x8'));var client=jayson[_0xa16b('0x9')][_0xa16b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x423b56,_0x473115,_0x13f36a){return new BPromise(function(_0x193f6d,_0x39b59e){return client['request'](_0x423b56,_0x13f36a)[_0xa16b('0xb')](function(_0x367889){logger[_0xa16b('0xc')](_0xa16b('0xd'),_0x473115,_0xa16b('0xe'));logger[_0xa16b('0xf')](_0xa16b('0x10'),_0x473115,'request\x20sent',JSON[_0xa16b('0x11')](_0x367889));if(_0x367889[_0xa16b('0x12')]){if(_0x367889['error'][_0xa16b('0x13')]===0x1f4){logger[_0xa16b('0x12')](_0xa16b('0xd'),_0x473115,_0x367889[_0xa16b('0x12')][_0xa16b('0x14')]);return _0x39b59e(_0x367889['error'][_0xa16b('0x14')]);}logger[_0xa16b('0x12')](_0xa16b('0xd'),_0x473115,_0x367889[_0xa16b('0x12')]['message']);return _0x193f6d(_0x367889[_0xa16b('0x12')][_0xa16b('0x14')]);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x473115,_0xa16b('0xe'));_0x193f6d(_0x367889[_0xa16b('0x15')][_0xa16b('0x14')]);}})[_0xa16b('0x16')](function(_0x1cfc8d){logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x473115,_0x1cfc8d);_0x39b59e(_0x1cfc8d);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index cf9a299..283b5ff 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 _0xbfe8=['isAuthenticated','/:id','show','post','create','put','update','delete','destroy','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller','get'];(function(_0x13ce0f,_0x354d4c){var _0x1beae8=function(_0x25a40b){while(--_0x25a40b){_0x13ce0f['push'](_0x13ce0f['shift']());}};_0x1beae8(++_0x354d4c);}(_0xbfe8,0x1b9));var _0x8bfe=function(_0x5cef78,_0xa9e03f){_0x5cef78=_0x5cef78-0x0;var _0x258f09=_0xbfe8[_0x5cef78];return _0x258f09;};'use strict';var multer=require('multer');var util=require(_0x8bfe('0x0'));var path=require('path');var timeout=require(_0x8bfe('0x1'));var express=require(_0x8bfe('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x8bfe('0x3'));var interaction=require(_0x8bfe('0x4'));var config=require('../../config/environment');var controller=require(_0x8bfe('0x5'));router[_0x8bfe('0x6')]('/',auth[_0x8bfe('0x7')](),controller['index']);router[_0x8bfe('0x6')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0x9')]);router[_0x8bfe('0xa')]('/',auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xb')]);router[_0x8bfe('0xc')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xd')]);router[_0x8bfe('0xe')](_0x8bfe('0x8'),auth[_0x8bfe('0x7')](),controller[_0x8bfe('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0x1cb9=['get','isAuthenticated','index','/:id','show','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticMetric.controller'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x1cb9,0x14e));var _0x91cb=function(_0x5ed5d9,_0x4c68d8){_0x5ed5d9=_0x5ed5d9-0x0;var _0x3b962f=_0x1cb9[_0x5ed5d9];return _0x3b962f;};'use strict';var multer=require(_0x91cb('0x0'));var util=require('util');var path=require(_0x91cb('0x1'));var timeout=require(_0x91cb('0x2'));var express=require(_0x91cb('0x3'));var router=express[_0x91cb('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x91cb('0x5'));var interaction=require(_0x91cb('0x6'));var config=require('../../config/environment');var controller=require(_0x91cb('0x7'));router[_0x91cb('0x8')]('/',auth[_0x91cb('0x9')](),controller[_0x91cb('0xa')]);router[_0x91cb('0x8')](_0x91cb('0xb'),auth['isAuthenticated'](),controller[_0x91cb('0xc')]);router['post']('/',auth[_0x91cb('0x9')](),controller['create']);router[_0x91cb('0xd')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0xe')]);router[_0x91cb('0xf')](_0x91cb('0xb'),auth[_0x91cb('0x9')](),controller[_0x91cb('0x10')]);module[_0x91cb('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 0fa9e0b..4739a97 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 _0xad72=['sequelize'];(function(_0x2e9dc3,_0x483bc6){var _0x130dd1=function(_0x4edfa9){while(--_0x4edfa9){_0x2e9dc3['push'](_0x2e9dc3['shift']());}};_0x130dd1(++_0x483bc6);}(_0xad72,0x1d8));var _0x2ad7=function(_0x24b5b5,_0x5c6b40){_0x24b5b5=_0x24b5b5-0x0;var _0x30a619=_0xad72[_0x24b5b5];return _0x30a619;};'use strict';var Sequelize=require(_0x2ad7('0x0'));module['exports']={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
+var _0x301b=['exports','sequelize'];(function(_0x29709d,_0x34c87b){var _0x21021e=function(_0x5cd659){while(--_0x5cd659){_0x29709d['push'](_0x29709d['shift']());}};_0x21021e(++_0x34c87b);}(_0x301b,0x1a1));var _0xb301=function(_0x1e09b2,_0x3cb5ba){_0x1e09b2=_0x1e09b2-0x0;var _0x5915f2=_0x301b[_0x1e09b2];return _0x5915f2;};'use strict';var Sequelize=require(_0xb301('0x0'));module[_0xb301('0x1')]={'tree':{'type':Sequelize['TEXT'],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 2a472e0..0c734af 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 _0x6d84=['rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','options','include','findAll','rows','catch','show','params','includeAll','find','create','body'];(function(_0x2836fc,_0x87ccde){var _0x118908=function(_0x13045f){while(--_0x13045f){_0x2836fc['push'](_0x2836fc['shift']());}};_0x118908(++_0x87ccde);}(_0x6d84,0x16d));var _0x46d8=function(_0x37ff05,_0x4c302f){_0x37ff05=_0x37ff05-0x0;var _0x2ea4eb=_0x6d84[_0x37ff05];return _0x2ea4eb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x46d8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x46d8('0x1'));var rp=require(_0x46d8('0x2'));var moment=require(_0x46d8('0x3'));var BPromise=require(_0x46d8('0x4'));var Mustache=require(_0x46d8('0x5'));var util=require(_0x46d8('0x6'));var path=require(_0x46d8('0x7'));var sox=require('sox');var csv=require(_0x46d8('0x8'));var ejs=require(_0x46d8('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x46d8('0xa'));var squel=require(_0x46d8('0xb'));var crypto=require('crypto');var jsforce=require(_0x46d8('0xc'));var deskjs=require(_0x46d8('0xd'));var toCsv=require(_0x46d8('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x46d8('0xe'));var authService=require(_0x46d8('0xf'));var qs=require(_0x46d8('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x46d8('0x11'))(_0x46d8('0x12'));var utils=require(_0x46d8('0x13'));var config=require(_0x46d8('0x14'));var licenseUtil=require(_0x46d8('0x15'));var db=require(_0x46d8('0x16'))['db'];function respondWithStatusCode(_0x21ba9a,_0x5c1dcb){_0x5c1dcb=_0x5c1dcb||0xcc;return function(_0x252883){if(_0x252883){return _0x21ba9a[_0x46d8('0x17')](_0x5c1dcb);}return _0x21ba9a[_0x46d8('0x18')](_0x5c1dcb)[_0x46d8('0x19')]();};}function respondWithResult(_0x41f8c8,_0x4aba5f){_0x4aba5f=_0x4aba5f||0xc8;return function(_0xc865c4){if(_0xc865c4){return _0x41f8c8[_0x46d8('0x18')](_0x4aba5f)[_0x46d8('0x1a')](_0xc865c4);}};}function respondWithFilteredResult(_0x16b13f,_0xeab073){return function(_0x213e0f){if(_0x213e0f){var _0x3d3501=typeof _0xeab073[_0x46d8('0x1b')]==='undefined'&&typeof _0xeab073[_0x46d8('0x1c')]==='undefined';var _0x1654c8=_0x213e0f[_0x46d8('0x1d')];var _0x325fb0=_0x3d3501?0x0:_0xeab073[_0x46d8('0x1b')];var _0x4e9c4=_0x3d3501?_0x213e0f[_0x46d8('0x1d')]:_0xeab073[_0x46d8('0x1b')]+_0xeab073[_0x46d8('0x1c')];var _0x353afd;if(_0x4e9c4>=_0x1654c8){_0x4e9c4=_0x1654c8;_0x353afd=0xc8;}else{_0x353afd=0xce;}_0x16b13f[_0x46d8('0x18')](_0x353afd);return _0x16b13f['set'](_0x46d8('0x1e'),_0x325fb0+'-'+_0x4e9c4+'/'+_0x1654c8)[_0x46d8('0x1a')](_0x213e0f);}return null;};}function patchUpdates(_0x346c6f){return function(_0x2d215f){try{jsonpatch[_0x46d8('0x1f')](_0x2d215f,_0x346c6f,!![]);}catch(_0x1086ab){return BPromise[_0x46d8('0x20')](_0x1086ab);}return _0x2d215f[_0x46d8('0x21')]();};}function saveUpdates(_0x16a9d5,_0x228ea0){return function(_0x26ceae){if(_0x26ceae){return _0x26ceae[_0x46d8('0x22')](_0x16a9d5)[_0x46d8('0x23')](function(_0x5a0a0c){return _0x5a0a0c;});}return null;};}function removeEntity(_0x189b77,_0x2f3abb){return function(_0x4d7bba){if(_0x4d7bba){return _0x4d7bba[_0x46d8('0x24')]()[_0x46d8('0x23')](function(){_0x189b77[_0x46d8('0x18')](0xcc)[_0x46d8('0x19')]();});}};}function handleEntityNotFound(_0x3f3455,_0x552bff){return function(_0x4131e2){if(!_0x4131e2){_0x3f3455[_0x46d8('0x17')](0x194);}return _0x4131e2;};}function handleError(_0xe3cdf7,_0x332319){_0x332319=_0x332319||0x1f4;return function(_0x2c83fe){logger[_0x46d8('0x25')](_0x2c83fe[_0x46d8('0x26')]);if(_0x2c83fe[_0x46d8('0x27')]){delete _0x2c83fe[_0x46d8('0x27')];}_0xe3cdf7['status'](_0x332319)['send'](_0x2c83fe);};}exports[_0x46d8('0x28')]=function(_0x38e54f,_0x1dda95){var _0x356eb4={},_0x2f80d8={},_0x3056c7={'count':0x0,'rows':[]};var _0x46e988=_[_0x46d8('0x29')](db[_0x46d8('0x2a')][_0x46d8('0x2b')],function(_0x5add04){return{'name':_0x5add04[_0x46d8('0x2c')],'type':_0x5add04[_0x46d8('0x2d')][_0x46d8('0x2e')]};});_0x2f80d8[_0x46d8('0x2f')]=_[_0x46d8('0x29')](_0x46e988,'name');_0x2f80d8[_0x46d8('0x30')]=_[_0x46d8('0x31')](_0x38e54f[_0x46d8('0x30')]);_0x2f80d8['filters']=_[_0x46d8('0x32')](_0x2f80d8['model'],_0x2f80d8[_0x46d8('0x30')]);_0x356eb4[_0x46d8('0x33')]=_[_0x46d8('0x32')](_0x2f80d8[_0x46d8('0x2f')],qs[_0x46d8('0x34')](_0x38e54f[_0x46d8('0x30')]['fields']));_0x356eb4[_0x46d8('0x33')]=_0x356eb4[_0x46d8('0x33')][_0x46d8('0x35')]?_0x356eb4[_0x46d8('0x33')]:_0x2f80d8[_0x46d8('0x2f')];if(!_0x38e54f[_0x46d8('0x30')][_0x46d8('0x36')](_0x46d8('0x37'))){_0x356eb4['limit']=qs[_0x46d8('0x1c')](_0x38e54f['query'][_0x46d8('0x1c')]);_0x356eb4[_0x46d8('0x1b')]=qs[_0x46d8('0x1b')](_0x38e54f[_0x46d8('0x30')][_0x46d8('0x1b')]);}_0x356eb4['order']=qs[_0x46d8('0x38')](_0x38e54f[_0x46d8('0x30')]['sort']);_0x356eb4[_0x46d8('0x39')]=qs['filters'](_[_0x46d8('0x3a')](_0x38e54f[_0x46d8('0x30')],_0x2f80d8[_0x46d8('0x3b')]),_0x46e988);if(_0x38e54f[_0x46d8('0x30')][_0x46d8('0x3c')]){_0x356eb4[_0x46d8('0x39')]=_[_0x46d8('0x3d')](_0x356eb4[_0x46d8('0x39')],{'$or':_[_0x46d8('0x29')](_0x46e988,function(_0x191b72){if(_0x191b72[_0x46d8('0x2d')]!=='VIRTUAL'){var _0x909cf2={};_0x909cf2[_0x191b72[_0x46d8('0x27')]]={'$like':'%'+_0x38e54f[_0x46d8('0x30')]['filter']+'%'};return _0x909cf2;}})});}_0x356eb4=_[_0x46d8('0x3d')]({},_0x356eb4,_0x38e54f[_0x46d8('0x3e')]);var _0x3a6a7c={'where':_0x356eb4[_0x46d8('0x39')]};return db[_0x46d8('0x2a')][_0x46d8('0x1d')](_0x3a6a7c)['then'](function(_0x20c2ef){_0x3056c7[_0x46d8('0x1d')]=_0x20c2ef;if(_0x38e54f[_0x46d8('0x30')]['includeAll']){_0x356eb4[_0x46d8('0x3f')]=[{'all':!![]}];}return db[_0x46d8('0x2a')][_0x46d8('0x40')](_0x356eb4);})[_0x46d8('0x23')](function(_0x5cd75b){_0x3056c7[_0x46d8('0x41')]=_0x5cd75b;return _0x3056c7;})[_0x46d8('0x23')](respondWithFilteredResult(_0x1dda95,_0x356eb4))[_0x46d8('0x42')](handleError(_0x1dda95,null));};exports[_0x46d8('0x43')]=function(_0x4904c5,_0xc19889){var _0x376e04={'raw':!![],'where':{'id':_0x4904c5[_0x46d8('0x44')]['id']}},_0x2013b4={};_0x2013b4[_0x46d8('0x2f')]=_[_0x46d8('0x31')](db['AnalyticTreeReport']['rawAttributes']);_0x2013b4[_0x46d8('0x30')]=_['keys'](_0x4904c5['query']);_0x2013b4[_0x46d8('0x3b')]=_[_0x46d8('0x32')](_0x2013b4[_0x46d8('0x2f')],_0x2013b4[_0x46d8('0x30')]);_0x376e04[_0x46d8('0x33')]=_['intersection'](_0x2013b4['model'],qs['fields'](_0x4904c5[_0x46d8('0x30')][_0x46d8('0x34')]));_0x376e04[_0x46d8('0x33')]=_0x376e04[_0x46d8('0x33')][_0x46d8('0x35')]?_0x376e04['attributes']:_0x2013b4[_0x46d8('0x2f')];if(_0x4904c5[_0x46d8('0x30')][_0x46d8('0x45')]){_0x376e04[_0x46d8('0x3f')]=[{'all':!![]}];}_0x376e04=_[_0x46d8('0x3d')]({},_0x376e04,_0x4904c5[_0x46d8('0x3e')]);return db['AnalyticTreeReport'][_0x46d8('0x46')](_0x376e04)[_0x46d8('0x23')](handleEntityNotFound(_0xc19889,null))['then'](respondWithResult(_0xc19889,null))[_0x46d8('0x42')](handleError(_0xc19889,null));};exports[_0x46d8('0x47')]=function(_0x41e1c5,_0x127807){return db[_0x46d8('0x2a')][_0x46d8('0x47')](_0x41e1c5[_0x46d8('0x48')],{})[_0x46d8('0x23')](respondWithResult(_0x127807,0xc9))[_0x46d8('0x42')](handleError(_0x127807,null));};exports[_0x46d8('0x22')]=function(_0x27cb2f,_0x29c7ac){if(_0x27cb2f['body']['id']){delete _0x27cb2f[_0x46d8('0x48')]['id'];}return db[_0x46d8('0x2a')][_0x46d8('0x46')]({'where':{'id':_0x27cb2f[_0x46d8('0x44')]['id']}})[_0x46d8('0x23')](handleEntityNotFound(_0x29c7ac,null))[_0x46d8('0x23')](saveUpdates(_0x27cb2f['body'],null))[_0x46d8('0x23')](respondWithResult(_0x29c7ac,null))['catch'](handleError(_0x29c7ac,null));};exports[_0x46d8('0x24')]=function(_0x5b9dc5,_0x16ee70){return db['AnalyticTreeReport'][_0x46d8('0x46')]({'where':{'id':_0x5b9dc5[_0x46d8('0x44')]['id']}})[_0x46d8('0x23')](handleEntityNotFound(_0x16ee70,null))[_0x46d8('0x23')](removeEntity(_0x16ee70,null))[_0x46d8('0x42')](handleError(_0x16ee70,null));};
\ No newline at end of file
+var _0x1231=['../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','AnalyticTreeReport','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','length','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','catch','show','params','keys','fields','include','options','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','fs-extra','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/license/util'];(function(_0x4e33d9,_0xfd0967){var _0x484ba4=function(_0x179ea4){while(--_0x179ea4){_0x4e33d9['push'](_0x4e33d9['shift']());}};_0x484ba4(++_0xfd0967);}(_0x1231,0x100));var _0x1123=function(_0xd6f425,_0x635e80){_0xd6f425=_0xd6f425-0x0;var _0x228cc2=_0x1231[_0xd6f425];return _0x228cc2;};'use strict';var emlformat=require(_0x1123('0x0'));var rimraf=require(_0x1123('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1123('0x2'));var rp=require(_0x1123('0x3'));var moment=require(_0x1123('0x4'));var BPromise=require(_0x1123('0x5'));var Mustache=require('mustache');var util=require(_0x1123('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1123('0x7'));var _=require(_0x1123('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x1123('0x9'));var deskjs=require(_0x1123('0xa'));var toCsv=require(_0x1123('0xb'));var querystring=require(_0x1123('0xc'));var Papa=require(_0x1123('0xd'));var Redis=require('ioredis');var authService=require(_0x1123('0xe'));var qs=require(_0x1123('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1123('0x10'));var logger=require(_0x1123('0x11'))(_0x1123('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x1123('0x13'));var db=require(_0x1123('0x14'))['db'];function respondWithStatusCode(_0x3d1d71,_0x2237eb){_0x2237eb=_0x2237eb||0xcc;return function(_0x2e58a3){if(_0x2e58a3){return _0x3d1d71[_0x1123('0x15')](_0x2237eb);}return _0x3d1d71['status'](_0x2237eb)[_0x1123('0x16')]();};}function respondWithResult(_0x3a95c0,_0x98a7ec){_0x98a7ec=_0x98a7ec||0xc8;return function(_0x1049a7){if(_0x1049a7){return _0x3a95c0[_0x1123('0x17')](_0x98a7ec)[_0x1123('0x18')](_0x1049a7);}};}function respondWithFilteredResult(_0x2e4b02,_0x3a75d7){return function(_0x3223fd){if(_0x3223fd){var _0x5a5bd2=typeof _0x3a75d7[_0x1123('0x19')]===_0x1123('0x1a')&&typeof _0x3a75d7[_0x1123('0x1b')]==='undefined';var _0x5dc68c=_0x3223fd['count'];var _0x444fc0=_0x5a5bd2?0x0:_0x3a75d7[_0x1123('0x19')];var _0x3c4cc3=_0x5a5bd2?_0x3223fd[_0x1123('0x1c')]:_0x3a75d7[_0x1123('0x19')]+_0x3a75d7[_0x1123('0x1b')];var _0x377c95;if(_0x3c4cc3>=_0x5dc68c){_0x3c4cc3=_0x5dc68c;_0x377c95=0xc8;}else{_0x377c95=0xce;}_0x2e4b02['status'](_0x377c95);return _0x2e4b02[_0x1123('0x1d')](_0x1123('0x1e'),_0x444fc0+'-'+_0x3c4cc3+'/'+_0x5dc68c)[_0x1123('0x18')](_0x3223fd);}return null;};}function patchUpdates(_0x4bb78a){return function(_0x3ce3bb){try{jsonpatch[_0x1123('0x1f')](_0x3ce3bb,_0x4bb78a,!![]);}catch(_0x473aa6){return BPromise[_0x1123('0x20')](_0x473aa6);}return _0x3ce3bb['save']();};}function saveUpdates(_0x5d5c17,_0x1444dd){return function(_0x251d01){if(_0x251d01){return _0x251d01[_0x1123('0x21')](_0x5d5c17)[_0x1123('0x22')](function(_0x3caa0a){return _0x3caa0a;});}return null;};}function removeEntity(_0x457f15,_0x157e03){return function(_0x56acea){if(_0x56acea){return _0x56acea[_0x1123('0x23')]()[_0x1123('0x22')](function(){_0x457f15[_0x1123('0x17')](0xcc)[_0x1123('0x16')]();});}};}function handleEntityNotFound(_0x4a44ea,_0x3b68d4){return function(_0x2191c4){if(!_0x2191c4){_0x4a44ea[_0x1123('0x15')](0x194);}return _0x2191c4;};}function handleError(_0x2ecd47,_0x43b49a){_0x43b49a=_0x43b49a||0x1f4;return function(_0x14e81e){logger[_0x1123('0x24')](_0x14e81e[_0x1123('0x25')]);if(_0x14e81e[_0x1123('0x26')]){delete _0x14e81e[_0x1123('0x26')];}_0x2ecd47['status'](_0x43b49a)['send'](_0x14e81e);};}exports['index']=function(_0x4b4f2f,_0x5f0b2f){var _0x52e918={},_0x5e805d={},_0x57be83={'count':0x0,'rows':[]};var _0x3d6fc7=_['map'](db[_0x1123('0x27')][_0x1123('0x28')],function(_0x3eb9d7){return{'name':_0x3eb9d7[_0x1123('0x29')],'type':_0x3eb9d7[_0x1123('0x2a')]['key']};});_0x5e805d[_0x1123('0x2b')]=_[_0x1123('0x2c')](_0x3d6fc7,_0x1123('0x26'));_0x5e805d[_0x1123('0x2d')]=_['keys'](_0x4b4f2f[_0x1123('0x2d')]);_0x5e805d[_0x1123('0x2e')]=_[_0x1123('0x2f')](_0x5e805d[_0x1123('0x2b')],_0x5e805d[_0x1123('0x2d')]);_0x52e918[_0x1123('0x30')]=_['intersection'](_0x5e805d[_0x1123('0x2b')],qs['fields'](_0x4b4f2f[_0x1123('0x2d')]['fields']));_0x52e918[_0x1123('0x30')]=_0x52e918[_0x1123('0x30')][_0x1123('0x31')]?_0x52e918['attributes']:_0x5e805d['model'];if(!_0x4b4f2f[_0x1123('0x2d')]['hasOwnProperty']('nolimit')){_0x52e918[_0x1123('0x1b')]=qs['limit'](_0x4b4f2f[_0x1123('0x2d')][_0x1123('0x1b')]);_0x52e918[_0x1123('0x19')]=qs[_0x1123('0x19')](_0x4b4f2f[_0x1123('0x2d')]['offset']);}_0x52e918[_0x1123('0x32')]=qs['sort'](_0x4b4f2f['query'][_0x1123('0x33')]);_0x52e918['where']=qs[_0x1123('0x2e')](_[_0x1123('0x34')](_0x4b4f2f[_0x1123('0x2d')],_0x5e805d[_0x1123('0x2e')]),_0x3d6fc7);if(_0x4b4f2f[_0x1123('0x2d')][_0x1123('0x35')]){_0x52e918[_0x1123('0x36')]=_[_0x1123('0x37')](_0x52e918[_0x1123('0x36')],{'$or':_[_0x1123('0x2c')](_0x3d6fc7,function(_0x3baaa5){if(_0x3baaa5['type']!==_0x1123('0x38')){var _0x244592={};_0x244592[_0x3baaa5[_0x1123('0x26')]]={'$like':'%'+_0x4b4f2f[_0x1123('0x2d')][_0x1123('0x35')]+'%'};return _0x244592;}})});}_0x52e918=_['merge']({},_0x52e918,_0x4b4f2f['options']);var _0x34f3c1={'where':_0x52e918[_0x1123('0x36')]};return db[_0x1123('0x27')][_0x1123('0x1c')](_0x34f3c1)[_0x1123('0x22')](function(_0x30b5f5){_0x57be83[_0x1123('0x1c')]=_0x30b5f5;if(_0x4b4f2f['query'][_0x1123('0x39')]){_0x52e918['include']=[{'all':!![]}];}return db[_0x1123('0x27')][_0x1123('0x3a')](_0x52e918);})[_0x1123('0x22')](function(_0x7d4c99){_0x57be83['rows']=_0x7d4c99;return _0x57be83;})[_0x1123('0x22')](respondWithFilteredResult(_0x5f0b2f,_0x52e918))[_0x1123('0x3b')](handleError(_0x5f0b2f,null));};exports[_0x1123('0x3c')]=function(_0x2d1b3e,_0x3a6945){var _0x581c89={'raw':!![],'where':{'id':_0x2d1b3e[_0x1123('0x3d')]['id']}},_0x388d37={};_0x388d37[_0x1123('0x2b')]=_[_0x1123('0x3e')](db[_0x1123('0x27')][_0x1123('0x28')]);_0x388d37[_0x1123('0x2d')]=_[_0x1123('0x3e')](_0x2d1b3e[_0x1123('0x2d')]);_0x388d37['filters']=_[_0x1123('0x2f')](_0x388d37['model'],_0x388d37['query']);_0x581c89[_0x1123('0x30')]=_[_0x1123('0x2f')](_0x388d37[_0x1123('0x2b')],qs['fields'](_0x2d1b3e['query'][_0x1123('0x3f')]));_0x581c89['attributes']=_0x581c89[_0x1123('0x30')][_0x1123('0x31')]?_0x581c89['attributes']:_0x388d37['model'];if(_0x2d1b3e[_0x1123('0x2d')][_0x1123('0x39')]){_0x581c89[_0x1123('0x40')]=[{'all':!![]}];}_0x581c89=_[_0x1123('0x37')]({},_0x581c89,_0x2d1b3e[_0x1123('0x41')]);return db[_0x1123('0x27')]['find'](_0x581c89)[_0x1123('0x22')](handleEntityNotFound(_0x3a6945,null))[_0x1123('0x22')](respondWithResult(_0x3a6945,null))['catch'](handleError(_0x3a6945,null));};exports[_0x1123('0x42')]=function(_0x2261b1,_0x35edb0){return db[_0x1123('0x27')][_0x1123('0x42')](_0x2261b1[_0x1123('0x43')],{})[_0x1123('0x22')](respondWithResult(_0x35edb0,0xc9))[_0x1123('0x3b')](handleError(_0x35edb0,null));};exports['update']=function(_0x8f8704,_0x284b58){if(_0x8f8704[_0x1123('0x43')]['id']){delete _0x8f8704[_0x1123('0x43')]['id'];}return db[_0x1123('0x27')][_0x1123('0x44')]({'where':{'id':_0x8f8704[_0x1123('0x3d')]['id']}})[_0x1123('0x22')](handleEntityNotFound(_0x284b58,null))[_0x1123('0x22')](saveUpdates(_0x8f8704[_0x1123('0x43')],null))[_0x1123('0x22')](respondWithResult(_0x284b58,null))[_0x1123('0x3b')](handleError(_0x284b58,null));};exports[_0x1123('0x23')]=function(_0x303026,_0x462a10){return db[_0x1123('0x27')][_0x1123('0x44')]({'where':{'id':_0x303026[_0x1123('0x3d')]['id']}})['then'](handleEntityNotFound(_0x462a10,null))[_0x1123('0x22')](removeEntity(_0x462a10,null))['catch'](handleError(_0x462a10,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 9e5fc1f..708e44d 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 _0x556e=['moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','analytics_report_trees','lodash','util','../../config/logger','api'];(function(_0x195a3c,_0x3537a3){var _0x4ed367=function(_0x11878b){while(--_0x11878b){_0x195a3c['push'](_0x195a3c['shift']());}};_0x4ed367(++_0x3537a3);}(_0x556e,0xa5));var _0xe556=function(_0x3e5147,_0x33eef9){_0x3e5147=_0x3e5147-0x0;var _0x18c779=_0x556e[_0x3e5147];return _0x18c779;};'use strict';var _=require(_0xe556('0x0'));var util=require(_0xe556('0x1'));var logger=require(_0xe556('0x2'))(_0xe556('0x3'));var moment=require(_0xe556('0x4'));var BPromise=require(_0xe556('0x5'));var rp=require(_0xe556('0x6'));var fs=require('fs');var path=require(_0xe556('0x7'));var rimraf=require(_0xe556('0x8'));var config=require(_0xe556('0x9'));var attributes=require('./analyticTreeReport.attributes');module[_0xe556('0xa')]=function(_0x4fcda9,_0x23600e){return _0x4fcda9[_0xe556('0xb')]('AnalyticTreeReport',attributes,{'tableName':_0xe556('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe6bd=['api','moment','bluebird','request-promise','path','rimraf','exports','define','analytics_report_trees','util','../../config/logger'];(function(_0x298b53,_0x3f830d){var _0x370c14=function(_0x16a8d7){while(--_0x16a8d7){_0x298b53['push'](_0x298b53['shift']());}};_0x370c14(++_0x3f830d);}(_0xe6bd,0xf0));var _0xde6b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe6bd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xde6b('0x0'));var logger=require(_0xde6b('0x1'))(_0xde6b('0x2'));var moment=require(_0xde6b('0x3'));var BPromise=require(_0xde6b('0x4'));var rp=require(_0xde6b('0x5'));var fs=require('fs');var path=require(_0xde6b('0x6'));var rimraf=require(_0xde6b('0x7'));var config=require('../../config/environment');var attributes=require('./analyticTreeReport.attributes');module[_0xde6b('0x8')]=function(_0x2bd3f4,_0xe38995){return _0x2bd3f4[_0xde6b('0x9')]('AnalyticTreeReport',attributes,{'tableName':_0xde6b('0xa'),'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 a749e30..f146a7f 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 _0x1261=['then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request'];(function(_0x5e3fc1,_0x109138){var _0x5885c0=function(_0x9825b6){while(--_0x9825b6){_0x5e3fc1['push'](_0x5e3fc1['shift']());}};_0x5885c0(++_0x109138);}(_0x1261,0x144));var _0x1126=function(_0xef4cf0,_0x16c9c3){_0xef4cf0=_0xef4cf0-0x0;var _0x497ad2=_0x1261[_0xef4cf0];return _0x497ad2;};'use strict';var _=require('lodash');var util=require(_0x1126('0x0'));var moment=require(_0x1126('0x1'));var BPromise=require(_0x1126('0x2'));var rs=require(_0x1126('0x3'));var fs=require('fs');var Redis=require(_0x1126('0x4'));var db=require(_0x1126('0x5'))['db'];var utils=require(_0x1126('0x6'));var logger=require(_0x1126('0x7'))(_0x1126('0x8'));var config=require(_0x1126('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x1126('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x907180,_0x4f239c,_0x17e5f0){return new BPromise(function(_0x28772d,_0x245be9){return client[_0x1126('0xb')](_0x907180,_0x17e5f0)[_0x1126('0xc')](function(_0x59cfa1){logger[_0x1126('0xd')](_0x1126('0xe'),_0x4f239c,_0x1126('0xf'));logger['debug'](_0x1126('0x10'),_0x4f239c,'request\x20sent',JSON['stringify'](_0x59cfa1));if(_0x59cfa1[_0x1126('0x11')]){if(_0x59cfa1['error'][_0x1126('0x12')]===0x1f4){logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);return _0x245be9(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}logger[_0x1126('0x11')](_0x1126('0xe'),_0x4f239c,_0x59cfa1['error']['message']);return _0x28772d(_0x59cfa1[_0x1126('0x11')][_0x1126('0x13')]);}else{logger[_0x1126('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4f239c,_0x1126('0xf'));_0x28772d(_0x59cfa1['result'][_0x1126('0x13')]);}})[_0x1126('0x14')](function(_0x257b5f){logger['error'](_0x1126('0xe'),_0x4f239c,_0x257b5f);_0x245be9(_0x257b5f);});});}
\ No newline at end of file
+var _0x5f2f=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','AnalyticTreeReport,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x2867b3,_0x1023f3){var _0x297a3a=function(_0x4a0fee){while(--_0x4a0fee){_0x2867b3['push'](_0x2867b3['shift']());}};_0x297a3a(++_0x1023f3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1eab69,_0x251f50){_0x1eab69=_0x1eab69-0x0;var _0x4e6d1d=_0x5f2f[_0x1eab69];return _0x4e6d1d;};'use strict';var _=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var moment=require(_0xf5f2('0x2'));var BPromise=require(_0xf5f2('0x3'));var rs=require(_0xf5f2('0x4'));var fs=require('fs');var Redis=require(_0xf5f2('0x5'));var db=require(_0xf5f2('0x6'))['db'];var utils=require(_0xf5f2('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xf5f2('0x8'));var jayson=require(_0xf5f2('0x9'));var client=jayson[_0xf5f2('0xa')][_0xf5f2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3133bc,_0x473100,_0x5907aa){return new BPromise(function(_0x466882,_0x46cd9c){return client[_0xf5f2('0xc')](_0x3133bc,_0x5907aa)['then'](function(_0x375da4){logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,'request\x20sent');logger[_0xf5f2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x473100,'request\x20sent',JSON[_0xf5f2('0x10')](_0x375da4));if(_0x375da4[_0xf5f2('0x11')]){if(_0x375da4['error'][_0xf5f2('0x12')]===0x1f4){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x46cd9c(_0x375da4[_0xf5f2('0x11')]['message']);}logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0x375da4[_0xf5f2('0x11')][_0xf5f2('0x13')]);return _0x466882(_0x375da4[_0xf5f2('0x11')]['message']);}else{logger[_0xf5f2('0xd')](_0xf5f2('0xe'),_0x473100,_0xf5f2('0x14'));_0x466882(_0x375da4[_0xf5f2('0x15')][_0xf5f2('0x13')]);}})[_0xf5f2('0x16')](function(_0xdb61b3){logger[_0xf5f2('0x11')](_0xf5f2('0xe'),_0x473100,_0xdb61b3);_0x46cd9c(_0xdb61b3);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 4cd2191..ae7d6e9 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 _0x85ed=['show','post','create','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','/:id'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x85ed,0xa6));var _0xd85e=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0x85ed[_0x2dadb9];return _0x2f0097;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd85e('0x0'));var express=require(_0xd85e('0x1'));var router=express[_0xd85e('0x2')]();var fs_extra=require(_0xd85e('0x3'));var auth=require(_0xd85e('0x4'));var interaction=require(_0xd85e('0x5'));var config=require(_0xd85e('0x6'));var controller=require(_0xd85e('0x7'));router['get']('/',auth[_0xd85e('0x8')](),controller['index']);router['get'](_0xd85e('0x9'),auth[_0xd85e('0x8')](),controller[_0xd85e('0xa')]);router[_0xd85e('0xb')]('/',auth[_0xd85e('0x8')](),controller[_0xd85e('0xc')]);router['put'](_0xd85e('0x9'),auth[_0xd85e('0x8')](),controller['update']);router[_0xd85e('0xd')](_0xd85e('0x9'),auth[_0xd85e('0x8')](),controller[_0xd85e('0xe')]);module[_0xd85e('0xf')]=router;
\ No newline at end of file
+var _0xa4eb=['./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../config/environment'];(function(_0x1a37ec,_0x2dedfd){var _0x45aea5=function(_0x53ce3a){while(--_0x53ce3a){_0x1a37ec['push'](_0x1a37ec['shift']());}};_0x45aea5(++_0x2dedfd);}(_0xa4eb,0x119));var _0xba4e=function(_0x295f70,_0x17ae04){_0x295f70=_0x295f70-0x0;var _0x208134=_0xa4eb[_0x295f70];return _0x208134;};'use strict';var multer=require(_0xba4e('0x0'));var util=require(_0xba4e('0x1'));var path=require('path');var timeout=require(_0xba4e('0x2'));var express=require(_0xba4e('0x3'));var router=express['Router']();var fs_extra=require(_0xba4e('0x4'));var auth=require(_0xba4e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xba4e('0x6'));var controller=require(_0xba4e('0x7'));router[_0xba4e('0x8')]('/',auth[_0xba4e('0x9')](),controller[_0xba4e('0xa')]);router['get'](_0xba4e('0xb'),auth['isAuthenticated'](),controller[_0xba4e('0xc')]);router[_0xba4e('0xd')]('/',auth[_0xba4e('0x9')](),controller['create']);router[_0xba4e('0xe')](_0xba4e('0xb'),auth[_0xba4e('0x9')](),controller[_0xba4e('0xf')]);router['delete']('/:id',auth[_0xba4e('0x9')](),controller[_0xba4e('0x10')]);module[_0xba4e('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 0a6728f..2920bd3 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 _0xdace=['STRING','sequelize'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xdace,0xc5));var _0xedac=function(_0x18abd2,_0x22d4b3){_0x18abd2=_0x18abd2-0x0;var _0x1dcad6=_0xdace[_0x18abd2];return _0x1dcad6;};'use strict';var Sequelize=require(_0xedac('0x0'));module['exports']={'name':{'type':Sequelize[_0xedac('0x1')]},'basename':{'type':Sequelize[_0xedac('0x1')]},'type':{'type':Sequelize[_0xedac('0x1')]}};
\ No newline at end of file
+var _0xf4dd=['sequelize','exports','STRING'];(function(_0x20aae1,_0x51efd4){var _0x510601=function(_0x20895f){while(--_0x20895f){_0x20aae1['push'](_0x20aae1['shift']());}};_0x510601(++_0x51efd4);}(_0xf4dd,0xb4));var _0xdf4d=function(_0x4dfb79,_0x294bb8){_0x4dfb79=_0x4dfb79-0x0;var _0x3d1079=_0xf4dd[_0x4dfb79];return _0x3d1079;};'use strict';var Sequelize=require(_0xdf4d('0x0'));module[_0xdf4d('0x1')]={'name':{'type':Sequelize[_0xdf4d('0x2')]},'basename':{'type':Sequelize[_0xdf4d('0x2')]},'type':{'type':Sequelize[_0xdf4d('0x2')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 8a1695d..e1ac1da 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 _0x5dd4=['catch','params','options','find','clone','merge','omit','createdAt','updatedAt','body','originalname','filename','file','mimetype','create','join','root','offline-chat/','basename','download','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','apply','reject','save','update','then','destroy','error','stack','name','index','Attachment','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','type','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x4b4921,_0x79b24f){var _0x569da4=function(_0x48de87){while(--_0x48de87){_0x4b4921['push'](_0x4b4921['shift']());}};_0x569da4(++_0x79b24f);}(_0x5dd4,0x1c7));var _0x45dd=function(_0x28ae11,_0x12043f){_0x28ae11=_0x28ae11-0x0;var _0x32bb34=_0x5dd4[_0x28ae11];return _0x32bb34;};'use strict';var emlformat=require(_0x45dd('0x0'));var rimraf=require(_0x45dd('0x1'));var zipdir=require(_0x45dd('0x2'));var jsonpatch=require(_0x45dd('0x3'));var rp=require(_0x45dd('0x4'));var moment=require(_0x45dd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x45dd('0x6'));var util=require(_0x45dd('0x7'));var path=require(_0x45dd('0x8'));var sox=require(_0x45dd('0x9'));var csv=require(_0x45dd('0xa'));var ejs=require(_0x45dd('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x45dd('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x45dd('0xd'));var toCsv=require(_0x45dd('0xa'));var querystring=require('querystring');var Papa=require(_0x45dd('0xe'));var Redis=require('ioredis');var authService=require(_0x45dd('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x45dd('0x10'));var hardwareService=require(_0x45dd('0x11'));var logger=require(_0x45dd('0x12'))(_0x45dd('0x13'));var utils=require(_0x45dd('0x14'));var config=require(_0x45dd('0x15'));var licenseUtil=require(_0x45dd('0x16'));var db=require(_0x45dd('0x17'))['db'];function respondWithStatusCode(_0x32ee1e,_0x3a5386){_0x3a5386=_0x3a5386||0xcc;return function(_0x1d1add){if(_0x1d1add){return _0x32ee1e[_0x45dd('0x18')](_0x3a5386);}return _0x32ee1e[_0x45dd('0x19')](_0x3a5386)[_0x45dd('0x1a')]();};}function respondWithResult(_0x1d77be,_0x3df0e4){_0x3df0e4=_0x3df0e4||0xc8;return function(_0x58f340){if(_0x58f340){return _0x1d77be['status'](_0x3df0e4)[_0x45dd('0x1b')](_0x58f340);}};}function respondWithFilteredResult(_0x506ae8,_0x501fa1){return function(_0x4432e5){if(_0x4432e5){var _0xc669e6=typeof _0x501fa1['offset']===_0x45dd('0x1c')&&typeof _0x501fa1[_0x45dd('0x1d')]==='undefined';var _0x2b2117=_0x4432e5[_0x45dd('0x1e')];var _0x38a0e5=_0xc669e6?0x0:_0x501fa1[_0x45dd('0x1f')];var _0x519e80=_0xc669e6?_0x4432e5[_0x45dd('0x1e')]:_0x501fa1['offset']+_0x501fa1[_0x45dd('0x1d')];var _0x78668;if(_0x519e80>=_0x2b2117){_0x519e80=_0x2b2117;_0x78668=0xc8;}else{_0x78668=0xce;}_0x506ae8[_0x45dd('0x19')](_0x78668);return _0x506ae8['set']('Content-Range',_0x38a0e5+'-'+_0x519e80+'/'+_0x2b2117)[_0x45dd('0x1b')](_0x4432e5);}return null;};}function patchUpdates(_0xb8af59){return function(_0x2c3cf6){try{jsonpatch[_0x45dd('0x20')](_0x2c3cf6,_0xb8af59,!![]);}catch(_0x4b3aa1){return BPromise[_0x45dd('0x21')](_0x4b3aa1);}return _0x2c3cf6[_0x45dd('0x22')]();};}function saveUpdates(_0x42f0cb,_0x21c9bb){return function(_0x2d163e){if(_0x2d163e){return _0x2d163e[_0x45dd('0x23')](_0x42f0cb)[_0x45dd('0x24')](function(_0x1a49b0){return _0x1a49b0;});}return null;};}function removeEntity(_0x4529b9,_0x53dce9){return function(_0x1166f5){if(_0x1166f5){return _0x1166f5[_0x45dd('0x25')]()[_0x45dd('0x24')](function(){_0x4529b9['status'](0xcc)[_0x45dd('0x1a')]();});}};}function handleEntityNotFound(_0xd737e1,_0x16a666){return function(_0x4844bb){if(!_0x4844bb){_0xd737e1[_0x45dd('0x18')](0x194);}return _0x4844bb;};}function handleError(_0x32b4df,_0x16113b){_0x16113b=_0x16113b||0x1f4;return function(_0x3dc351){logger[_0x45dd('0x26')](_0x3dc351[_0x45dd('0x27')]);if(_0x3dc351['name']){delete _0x3dc351[_0x45dd('0x28')];}_0x32b4df[_0x45dd('0x19')](_0x16113b)['send'](_0x3dc351);};}exports[_0x45dd('0x29')]=function(_0x10721f,_0xf10b68){var _0x3a3651={},_0x3d848e={},_0x5ea7dc={'count':0x0,'rows':[]};var _0x2edd22=_['map'](db[_0x45dd('0x2a')][_0x45dd('0x2b')],function(_0x59fed7){return{'name':_0x59fed7[_0x45dd('0x2c')],'type':_0x59fed7['type'][_0x45dd('0x2d')]};});_0x3d848e[_0x45dd('0x2e')]=_[_0x45dd('0x2f')](_0x2edd22,'name');_0x3d848e['query']=_[_0x45dd('0x30')](_0x10721f[_0x45dd('0x31')]);_0x3d848e[_0x45dd('0x32')]=_['intersection'](_0x3d848e['model'],_0x3d848e[_0x45dd('0x31')]);_0x3a3651[_0x45dd('0x33')]=_[_0x45dd('0x34')](_0x3d848e[_0x45dd('0x2e')],qs['fields'](_0x10721f[_0x45dd('0x31')][_0x45dd('0x35')]));_0x3a3651[_0x45dd('0x33')]=_0x3a3651['attributes'][_0x45dd('0x36')]?_0x3a3651[_0x45dd('0x33')]:_0x3d848e[_0x45dd('0x2e')];if(!_0x10721f[_0x45dd('0x31')][_0x45dd('0x37')](_0x45dd('0x38'))){_0x3a3651[_0x45dd('0x1d')]=qs[_0x45dd('0x1d')](_0x10721f[_0x45dd('0x31')]['limit']);_0x3a3651['offset']=qs[_0x45dd('0x1f')](_0x10721f[_0x45dd('0x31')][_0x45dd('0x1f')]);}_0x3a3651[_0x45dd('0x39')]=qs[_0x45dd('0x3a')](_0x10721f[_0x45dd('0x31')][_0x45dd('0x3a')]);_0x3a3651[_0x45dd('0x3b')]=qs[_0x45dd('0x32')](_['pick'](_0x10721f[_0x45dd('0x31')],_0x3d848e[_0x45dd('0x32')]),_0x2edd22);if(_0x10721f[_0x45dd('0x31')][_0x45dd('0x3c')]){_0x3a3651[_0x45dd('0x3b')]=_['merge'](_0x3a3651[_0x45dd('0x3b')],{'$or':_['map'](_0x2edd22,function(_0x3c19ca){if(_0x3c19ca[_0x45dd('0x3d')]!==_0x45dd('0x3e')){var _0x4c68c7={};_0x4c68c7[_0x3c19ca[_0x45dd('0x28')]]={'$like':'%'+_0x10721f['query'][_0x45dd('0x3c')]+'%'};return _0x4c68c7;}})});}_0x3a3651=_['merge']({},_0x3a3651,_0x10721f['options']);var _0x20447a={'where':_0x3a3651[_0x45dd('0x3b')]};return db[_0x45dd('0x2a')]['count'](_0x20447a)[_0x45dd('0x24')](function(_0x4dcd81){_0x5ea7dc[_0x45dd('0x1e')]=_0x4dcd81;if(_0x10721f[_0x45dd('0x31')][_0x45dd('0x3f')]){_0x3a3651[_0x45dd('0x40')]=[{'all':!![]}];}return db[_0x45dd('0x2a')][_0x45dd('0x41')](_0x3a3651);})[_0x45dd('0x24')](function(_0x2db898){_0x5ea7dc[_0x45dd('0x42')]=_0x2db898;return _0x5ea7dc;})[_0x45dd('0x24')](respondWithFilteredResult(_0xf10b68,_0x3a3651))[_0x45dd('0x43')](handleError(_0xf10b68,null));};exports['show']=function(_0x200b1d,_0x2a867c){var _0x467cae={'raw':!![],'where':{'id':_0x200b1d[_0x45dd('0x44')]['id']}},_0x461b73={};_0x461b73[_0x45dd('0x2e')]=_[_0x45dd('0x30')](db[_0x45dd('0x2a')][_0x45dd('0x2b')]);_0x461b73[_0x45dd('0x31')]=_[_0x45dd('0x30')](_0x200b1d[_0x45dd('0x31')]);_0x461b73[_0x45dd('0x32')]=_[_0x45dd('0x34')](_0x461b73[_0x45dd('0x2e')],_0x461b73[_0x45dd('0x31')]);_0x467cae['attributes']=_[_0x45dd('0x34')](_0x461b73['model'],qs['fields'](_0x200b1d['query'][_0x45dd('0x35')]));_0x467cae[_0x45dd('0x33')]=_0x467cae['attributes'][_0x45dd('0x36')]?_0x467cae[_0x45dd('0x33')]:_0x461b73[_0x45dd('0x2e')];if(_0x200b1d['query'][_0x45dd('0x3f')]){_0x467cae[_0x45dd('0x40')]=[{'all':!![]}];}_0x467cae=_['merge']({},_0x467cae,_0x200b1d[_0x45dd('0x45')]);return db[_0x45dd('0x2a')][_0x45dd('0x46')](_0x467cae)[_0x45dd('0x24')](handleEntityNotFound(_0x2a867c,null))['then'](respondWithResult(_0x2a867c,null))[_0x45dd('0x43')](handleError(_0x2a867c,null));};exports[_0x45dd('0x47')]=function(_0x1b47a3,_0x56f2ea){var _0x494aa1={'where':{'id':_0x1b47a3['params']['id']}},_0x1daa8d={};_0x1daa8d[_0x45dd('0x2e')]=_['keys'](db[_0x45dd('0x2a')][_0x45dd('0x2b')]);_0x494aa1[_0x45dd('0x33')]=_[_0x45dd('0x34')](_0x1daa8d[_0x45dd('0x2e')],qs['fields'](_0x1b47a3[_0x45dd('0x31')][_0x45dd('0x35')]));_0x494aa1[_0x45dd('0x33')]=_0x494aa1['attributes'][_0x45dd('0x36')]?_0x494aa1['attributes']:_0x1daa8d['model'];if(_0x1b47a3[_0x45dd('0x31')]['includeAll']){_0x494aa1[_0x45dd('0x40')]=[{'all':!![]}];}_0x494aa1=_[_0x45dd('0x48')]({},_0x494aa1,_0x1b47a3[_0x45dd('0x45')]);return db[_0x45dd('0x2a')][_0x45dd('0x46')](_0x494aa1)[_0x45dd('0x24')](handleEntityNotFound(_0x56f2ea,null))[_0x45dd('0x24')](function(_0x1729ad){if(_0x1729ad){var _0x5631ff=_0x1729ad['get']({'plain':!![]});_0x5631ff=qs[_0x45dd('0x49')](_0x5631ff,['id',_0x45dd('0x4a'),_0x45dd('0x4b')]);_0x1b47a3[_0x45dd('0x4c')]=_[_0x45dd('0x49')](_0x1b47a3['body'],['id',_0x45dd('0x4a'),_0x45dd('0x4b')]);return db[_0x45dd('0x2a')]['create'](_['merge'](_0x5631ff,_0x1b47a3[_0x45dd('0x4c')]),{'include':_0x1b47a3[_0x45dd('0x31')][_0x45dd('0x3f')]?[{'all':!![]}]:undefined});}})[_0x45dd('0x24')](respondWithResult(_0x56f2ea,0xc9))[_0x45dd('0x43')](handleError(_0x56f2ea,null));};exports['update']=function(_0x273c9b,_0xa0b1e6){if(_0x273c9b['body']['id']){delete _0x273c9b[_0x45dd('0x4c')]['id'];}return db[_0x45dd('0x2a')]['find']({'where':{'id':_0x273c9b[_0x45dd('0x44')]['id']}})[_0x45dd('0x24')](handleEntityNotFound(_0xa0b1e6,null))[_0x45dd('0x24')](saveUpdates(_0x273c9b[_0x45dd('0x4c')],null))[_0x45dd('0x24')](respondWithResult(_0xa0b1e6,null))[_0x45dd('0x43')](handleError(_0xa0b1e6,null));};exports[_0x45dd('0x25')]=function(_0x1b1c79,_0x152e9e){return db[_0x45dd('0x2a')][_0x45dd('0x46')]({'where':{'id':_0x1b1c79['params']['id']}})['then'](handleEntityNotFound(_0x152e9e,null))[_0x45dd('0x24')](removeEntity(_0x152e9e,null))[_0x45dd('0x43')](handleError(_0x152e9e,null));};exports['create']=function(_0x5660d8,_0x48dc20,_0x439904){_0x5660d8[_0x45dd('0x4c')]['name']=_0x5660d8['file'][_0x45dd('0x4d')];_0x5660d8[_0x45dd('0x4c')]['basename']=_0x5660d8['file'][_0x45dd('0x4e')];_0x5660d8[_0x45dd('0x4c')][_0x45dd('0x3d')]=_0x5660d8[_0x45dd('0x4f')][_0x45dd('0x50')];return db[_0x45dd('0x2a')][_0x45dd('0x51')](_0x5660d8[_0x45dd('0x4c')])[_0x45dd('0x24')](respondWithResult(_0x48dc20,0xc9))[_0x45dd('0x43')](handleError(_0x48dc20,null));};exports['download']=function(_0x512ea1,_0x310b9e,_0x4601f7){return db[_0x45dd('0x2a')]['findOne']({'where':{'id':_0x512ea1[_0x45dd('0x44')]['id']},'raw':!![]})[_0x45dd('0x24')](handleEntityNotFound(_0x310b9e,null))[_0x45dd('0x24')](function(_0x38647e){if(_0x38647e){var _0x33d1fe=_0x38647e['ChatOfflineMessageId']!==null;var _0x298b06=path[_0x45dd('0x52')](config[_0x45dd('0x53')],'server/files/attachments/');if(_0x33d1fe){_0x298b06=path[_0x45dd('0x52')](_0x298b06,_0x45dd('0x54'));}var _0x545601=path['join'](_0x298b06,_0x38647e[_0x45dd('0x55')]);return _0x310b9e[_0x45dd('0x56')](_0x545601);}})[_0x45dd('0x43')](handleError(_0x310b9e,null));};
\ No newline at end of file
+var _0x5f01=['../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','Content-Range','apply','reject','save','then','destroy','error','stack','name','map','Attachment','fieldName','type','model','query','filters','intersection','attributes','fields','length','limit','sort','where','filter','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','merge','options','find','clone','get','omit','createdAt','updatedAt','body','update','create','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','root','join','offline-chat/','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','fs-extra','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware'];(function(_0x45d55e,_0x2fede3){var _0x29812a=function(_0x3c6830){while(--_0x3c6830){_0x45d55e['push'](_0x45d55e['shift']());}};_0x29812a(++_0x2fede3);}(_0x5f01,0x19b));var _0x15f0=function(_0x2f8e3a,_0x433766){_0x2f8e3a=_0x2f8e3a-0x0;var _0x29c4fe=_0x5f01[_0x2f8e3a];return _0x29c4fe;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x15f0('0x0'));var jsonpatch=require(_0x15f0('0x1'));var rp=require('request-promise');var moment=require(_0x15f0('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x15f0('0x3'));var util=require(_0x15f0('0x4'));var path=require(_0x15f0('0x5'));var sox=require(_0x15f0('0x6'));var csv=require('to-csv');var ejs=require(_0x15f0('0x7'));var fs=require('fs');var fs_extra=require(_0x15f0('0x8'));var _=require(_0x15f0('0x9'));var squel=require('squel');var crypto=require(_0x15f0('0xa'));var jsforce=require(_0x15f0('0xb'));var deskjs=require(_0x15f0('0xc'));var toCsv=require(_0x15f0('0xd'));var querystring=require(_0x15f0('0xe'));var Papa=require(_0x15f0('0xf'));var Redis=require(_0x15f0('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x15f0('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x15f0('0x12'));var logger=require(_0x15f0('0x13'))(_0x15f0('0x14'));var utils=require(_0x15f0('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0x15f0('0x16'));var db=require(_0x15f0('0x17'))['db'];function respondWithStatusCode(_0x511d6a,_0x3afb6e){_0x3afb6e=_0x3afb6e||0xcc;return function(_0x4ee15b){if(_0x4ee15b){return _0x511d6a[_0x15f0('0x18')](_0x3afb6e);}return _0x511d6a['status'](_0x3afb6e)['end']();};}function respondWithResult(_0x49a130,_0x325778){_0x325778=_0x325778||0xc8;return function(_0x2929de){if(_0x2929de){return _0x49a130[_0x15f0('0x19')](_0x325778)[_0x15f0('0x1a')](_0x2929de);}};}function respondWithFilteredResult(_0x47105a,_0x11cb29){return function(_0x5668ef){if(_0x5668ef){var _0x490ebc=typeof _0x11cb29[_0x15f0('0x1b')]==='undefined'&&typeof _0x11cb29['limit']===_0x15f0('0x1c');var _0x342276=_0x5668ef['count'];var _0x47021d=_0x490ebc?0x0:_0x11cb29['offset'];var _0x1222a2=_0x490ebc?_0x5668ef[_0x15f0('0x1d')]:_0x11cb29[_0x15f0('0x1b')]+_0x11cb29['limit'];var _0x4bccf8;if(_0x1222a2>=_0x342276){_0x1222a2=_0x342276;_0x4bccf8=0xc8;}else{_0x4bccf8=0xce;}_0x47105a[_0x15f0('0x19')](_0x4bccf8);return _0x47105a['set'](_0x15f0('0x1e'),_0x47021d+'-'+_0x1222a2+'/'+_0x342276)['json'](_0x5668ef);}return null;};}function patchUpdates(_0xee8b4a){return function(_0x476a35){try{jsonpatch[_0x15f0('0x1f')](_0x476a35,_0xee8b4a,!![]);}catch(_0x30831d){return BPromise[_0x15f0('0x20')](_0x30831d);}return _0x476a35[_0x15f0('0x21')]();};}function saveUpdates(_0xd8e828,_0x349a63){return function(_0x3c6b12){if(_0x3c6b12){return _0x3c6b12['update'](_0xd8e828)[_0x15f0('0x22')](function(_0x2fb22c){return _0x2fb22c;});}return null;};}function removeEntity(_0x3ac7f5,_0x1cc392){return function(_0x43ecaa){if(_0x43ecaa){return _0x43ecaa[_0x15f0('0x23')]()[_0x15f0('0x22')](function(){_0x3ac7f5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e5746,_0x45ea21){return function(_0x2ffd71){if(!_0x2ffd71){_0x2e5746[_0x15f0('0x18')](0x194);}return _0x2ffd71;};}function handleError(_0x23e4d2,_0x3ac799){_0x3ac799=_0x3ac799||0x1f4;return function(_0x2329c8){logger[_0x15f0('0x24')](_0x2329c8[_0x15f0('0x25')]);if(_0x2329c8['name']){delete _0x2329c8[_0x15f0('0x26')];}_0x23e4d2[_0x15f0('0x19')](_0x3ac799)['send'](_0x2329c8);};}exports['index']=function(_0x4b4ed0,_0x5c8857){var _0x49e1c0={},_0x37905e={},_0x337f7a={'count':0x0,'rows':[]};var _0x4d6ebd=_[_0x15f0('0x27')](db[_0x15f0('0x28')]['rawAttributes'],function(_0x43b6fa){return{'name':_0x43b6fa[_0x15f0('0x29')],'type':_0x43b6fa[_0x15f0('0x2a')]['key']};});_0x37905e[_0x15f0('0x2b')]=_[_0x15f0('0x27')](_0x4d6ebd,_0x15f0('0x26'));_0x37905e[_0x15f0('0x2c')]=_['keys'](_0x4b4ed0[_0x15f0('0x2c')]);_0x37905e[_0x15f0('0x2d')]=_[_0x15f0('0x2e')](_0x37905e['model'],_0x37905e[_0x15f0('0x2c')]);_0x49e1c0[_0x15f0('0x2f')]=_['intersection'](_0x37905e['model'],qs[_0x15f0('0x30')](_0x4b4ed0[_0x15f0('0x2c')][_0x15f0('0x30')]));_0x49e1c0[_0x15f0('0x2f')]=_0x49e1c0[_0x15f0('0x2f')][_0x15f0('0x31')]?_0x49e1c0['attributes']:_0x37905e[_0x15f0('0x2b')];if(!_0x4b4ed0[_0x15f0('0x2c')]['hasOwnProperty']('nolimit')){_0x49e1c0['limit']=qs[_0x15f0('0x32')](_0x4b4ed0[_0x15f0('0x2c')]['limit']);_0x49e1c0[_0x15f0('0x1b')]=qs[_0x15f0('0x1b')](_0x4b4ed0[_0x15f0('0x2c')][_0x15f0('0x1b')]);}_0x49e1c0['order']=qs[_0x15f0('0x33')](_0x4b4ed0[_0x15f0('0x2c')][_0x15f0('0x33')]);_0x49e1c0[_0x15f0('0x34')]=qs['filters'](_['pick'](_0x4b4ed0[_0x15f0('0x2c')],_0x37905e[_0x15f0('0x2d')]),_0x4d6ebd);if(_0x4b4ed0['query'][_0x15f0('0x35')]){_0x49e1c0[_0x15f0('0x34')]=_['merge'](_0x49e1c0[_0x15f0('0x34')],{'$or':_['map'](_0x4d6ebd,function(_0xcbd57){if(_0xcbd57[_0x15f0('0x2a')]!==_0x15f0('0x36')){var _0x3693da={};_0x3693da[_0xcbd57[_0x15f0('0x26')]]={'$like':'%'+_0x4b4ed0['query'][_0x15f0('0x35')]+'%'};return _0x3693da;}})});}_0x49e1c0=_['merge']({},_0x49e1c0,_0x4b4ed0['options']);var _0x32a262={'where':_0x49e1c0[_0x15f0('0x34')]};return db[_0x15f0('0x28')][_0x15f0('0x1d')](_0x32a262)[_0x15f0('0x22')](function(_0x5c2651){_0x337f7a[_0x15f0('0x1d')]=_0x5c2651;if(_0x4b4ed0[_0x15f0('0x2c')][_0x15f0('0x37')]){_0x49e1c0[_0x15f0('0x38')]=[{'all':!![]}];}return db[_0x15f0('0x28')][_0x15f0('0x39')](_0x49e1c0);})[_0x15f0('0x22')](function(_0x30726d){_0x337f7a[_0x15f0('0x3a')]=_0x30726d;return _0x337f7a;})['then'](respondWithFilteredResult(_0x5c8857,_0x49e1c0))[_0x15f0('0x3b')](handleError(_0x5c8857,null));};exports[_0x15f0('0x3c')]=function(_0x45c3b8,_0x19fe75){var _0x517ca1={'raw':!![],'where':{'id':_0x45c3b8[_0x15f0('0x3d')]['id']}},_0x5d38b4={};_0x5d38b4[_0x15f0('0x2b')]=_[_0x15f0('0x3e')](db[_0x15f0('0x28')][_0x15f0('0x3f')]);_0x5d38b4[_0x15f0('0x2c')]=_['keys'](_0x45c3b8[_0x15f0('0x2c')]);_0x5d38b4[_0x15f0('0x2d')]=_[_0x15f0('0x2e')](_0x5d38b4[_0x15f0('0x2b')],_0x5d38b4[_0x15f0('0x2c')]);_0x517ca1['attributes']=_['intersection'](_0x5d38b4[_0x15f0('0x2b')],qs[_0x15f0('0x30')](_0x45c3b8[_0x15f0('0x2c')][_0x15f0('0x30')]));_0x517ca1[_0x15f0('0x2f')]=_0x517ca1[_0x15f0('0x2f')][_0x15f0('0x31')]?_0x517ca1[_0x15f0('0x2f')]:_0x5d38b4[_0x15f0('0x2b')];if(_0x45c3b8['query'][_0x15f0('0x37')]){_0x517ca1[_0x15f0('0x38')]=[{'all':!![]}];}_0x517ca1=_[_0x15f0('0x40')]({},_0x517ca1,_0x45c3b8[_0x15f0('0x41')]);return db['Attachment'][_0x15f0('0x42')](_0x517ca1)[_0x15f0('0x22')](handleEntityNotFound(_0x19fe75,null))['then'](respondWithResult(_0x19fe75,null))['catch'](handleError(_0x19fe75,null));};exports[_0x15f0('0x43')]=function(_0x142a24,_0x29fb12){var _0x4393db={'where':{'id':_0x142a24[_0x15f0('0x3d')]['id']}},_0x41a7c8={};_0x41a7c8[_0x15f0('0x2b')]=_['keys'](db[_0x15f0('0x28')][_0x15f0('0x3f')]);_0x4393db[_0x15f0('0x2f')]=_['intersection'](_0x41a7c8[_0x15f0('0x2b')],qs[_0x15f0('0x30')](_0x142a24[_0x15f0('0x2c')]['fields']));_0x4393db[_0x15f0('0x2f')]=_0x4393db[_0x15f0('0x2f')]['length']?_0x4393db[_0x15f0('0x2f')]:_0x41a7c8[_0x15f0('0x2b')];if(_0x142a24['query'][_0x15f0('0x37')]){_0x4393db[_0x15f0('0x38')]=[{'all':!![]}];}_0x4393db=_[_0x15f0('0x40')]({},_0x4393db,_0x142a24['options']);return db[_0x15f0('0x28')][_0x15f0('0x42')](_0x4393db)[_0x15f0('0x22')](handleEntityNotFound(_0x29fb12,null))['then'](function(_0x2eb206){if(_0x2eb206){var _0x2b7e2d=_0x2eb206[_0x15f0('0x44')]({'plain':!![]});_0x2b7e2d=qs[_0x15f0('0x45')](_0x2b7e2d,['id',_0x15f0('0x46'),_0x15f0('0x47')]);_0x142a24[_0x15f0('0x48')]=_[_0x15f0('0x45')](_0x142a24['body'],['id','createdAt',_0x15f0('0x47')]);return db[_0x15f0('0x28')]['create'](_['merge'](_0x2b7e2d,_0x142a24['body']),{'include':_0x142a24['query'][_0x15f0('0x37')]?[{'all':!![]}]:undefined});}})[_0x15f0('0x22')](respondWithResult(_0x29fb12,0xc9))[_0x15f0('0x3b')](handleError(_0x29fb12,null));};exports[_0x15f0('0x49')]=function(_0x25ab45,_0xa93209){if(_0x25ab45[_0x15f0('0x48')]['id']){delete _0x25ab45[_0x15f0('0x48')]['id'];}return db[_0x15f0('0x28')]['find']({'where':{'id':_0x25ab45[_0x15f0('0x3d')]['id']}})['then'](handleEntityNotFound(_0xa93209,null))[_0x15f0('0x22')](saveUpdates(_0x25ab45[_0x15f0('0x48')],null))['then'](respondWithResult(_0xa93209,null))[_0x15f0('0x3b')](handleError(_0xa93209,null));};exports[_0x15f0('0x23')]=function(_0xfa6699,_0x14164f){return db[_0x15f0('0x28')]['find']({'where':{'id':_0xfa6699[_0x15f0('0x3d')]['id']}})[_0x15f0('0x22')](handleEntityNotFound(_0x14164f,null))[_0x15f0('0x22')](removeEntity(_0x14164f,null))[_0x15f0('0x3b')](handleError(_0x14164f,null));};exports[_0x15f0('0x4a')]=function(_0x57b7a3,_0x132d08,_0x321ae0){_0x57b7a3[_0x15f0('0x48')][_0x15f0('0x26')]=_0x57b7a3[_0x15f0('0x4b')][_0x15f0('0x4c')];_0x57b7a3[_0x15f0('0x48')][_0x15f0('0x4d')]=_0x57b7a3[_0x15f0('0x4b')][_0x15f0('0x4e')];_0x57b7a3[_0x15f0('0x48')][_0x15f0('0x2a')]=_0x57b7a3[_0x15f0('0x4b')][_0x15f0('0x4f')];return db[_0x15f0('0x28')][_0x15f0('0x4a')](_0x57b7a3[_0x15f0('0x48')])[_0x15f0('0x22')](respondWithResult(_0x132d08,0xc9))['catch'](handleError(_0x132d08,null));};exports[_0x15f0('0x50')]=function(_0x4ad608,_0x305185,_0x4e4ced){return db[_0x15f0('0x28')][_0x15f0('0x51')]({'where':{'id':_0x4ad608[_0x15f0('0x3d')]['id']},'raw':!![]})[_0x15f0('0x22')](handleEntityNotFound(_0x305185,null))[_0x15f0('0x22')](function(_0x4c0a81){if(_0x4c0a81){var _0x3e0248=_0x4c0a81[_0x15f0('0x52')]!==null;var _0x4cf29a=path['join'](config[_0x15f0('0x53')],'server/files/attachments/');if(_0x3e0248){_0x4cf29a=path[_0x15f0('0x54')](_0x4cf29a,_0x15f0('0x55'));}var _0x304178=path['join'](_0x4cf29a,_0x4c0a81[_0x15f0('0x4d')]);return _0x305185[_0x15f0('0x50')](_0x304178);}})[_0x15f0('0x3b')](handleError(_0x305185,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 1e8a37c..c61ef2b 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 _0x910d=['./attachment.attributes','exports','Attachment','util','../../config/logger','api','moment','request-promise','path'];(function(_0x30ec9b,_0xc6365a){var _0x4c74a6=function(_0x5da73e){while(--_0x5da73e){_0x30ec9b['push'](_0x30ec9b['shift']());}};_0x4c74a6(++_0xc6365a);}(_0x910d,0x93));var _0xd910=function(_0x544765,_0x22fc47){_0x544765=_0x544765-0x0;var _0x2224ee=_0x910d[_0x544765];return _0x2224ee;};'use strict';var _=require('lodash');var util=require(_0xd910('0x0'));var logger=require(_0xd910('0x1'))(_0xd910('0x2'));var moment=require(_0xd910('0x3'));var BPromise=require('bluebird');var rp=require(_0xd910('0x4'));var fs=require('fs');var path=require(_0xd910('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd910('0x6'));module[_0xd910('0x7')]=function(_0x5d796b,_0x40ac58){return _0x5d796b['define'](_0xd910('0x8'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9fd4=['request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','util','../../config/logger','bluebird'];(function(_0x1d760b,_0x47f9fe){var _0x18fb17=function(_0x312def){while(--_0x312def){_0x1d760b['push'](_0x1d760b['shift']());}};_0x18fb17(++_0x47f9fe);}(_0x9fd4,0x135));var _0x49fd=function(_0x3df31d,_0x5081ff){_0x3df31d=_0x3df31d-0x0;var _0x352dbc=_0x9fd4[_0x3df31d];return _0x352dbc;};'use strict';var _=require('lodash');var util=require(_0x49fd('0x0'));var logger=require(_0x49fd('0x1'))('api');var moment=require('moment');var BPromise=require(_0x49fd('0x2'));var rp=require(_0x49fd('0x3'));var fs=require('fs');var path=require(_0x49fd('0x4'));var rimraf=require(_0x49fd('0x5'));var config=require(_0x49fd('0x6'));var attributes=require(_0x49fd('0x7'));module[_0x49fd('0x8')]=function(_0x216c25,_0x24f6e7){return _0x216c25[_0x49fd('0x9')](_0x49fd('0xa'),attributes,{'tableName':_0x49fd('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 04e1b51..88337d5 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 _0x81d5=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateAttachment','Attachment','body','options','raw','then','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x14082b,_0x3672d6){var _0x53a93d=function(_0x514882){while(--_0x514882){_0x14082b['push'](_0x14082b['shift']());}};_0x53a93d(++_0x3672d6);}(_0x81d5,0x1ab));var _0x581d=function(_0x50ec08,_0x9f5571){_0x50ec08=_0x50ec08-0x0;var _0x4824ae=_0x81d5[_0x50ec08];return _0x4824ae;};'use strict';var _=require(_0x581d('0x0'));var util=require(_0x581d('0x1'));var moment=require('moment');var BPromise=require(_0x581d('0x2'));var rs=require(_0x581d('0x3'));var fs=require('fs');var Redis=require(_0x581d('0x4'));var db=require(_0x581d('0x5'))['db'];var utils=require(_0x581d('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x581d('0x7'));var jayson=require(_0x581d('0x8'));var client=jayson[_0x581d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16067b,_0x2f32bf,_0x43124c){return new BPromise(function(_0x497368,_0xf1a3b6){return client['request'](_0x16067b,_0x43124c)['then'](function(_0x5d8fa3){logger[_0x581d('0xa')](_0x581d('0xb'),_0x2f32bf,_0x581d('0xc'));logger[_0x581d('0xd')](_0x581d('0xe'),_0x2f32bf,'request\x20sent',JSON[_0x581d('0xf')](_0x5d8fa3));if(_0x5d8fa3[_0x581d('0x10')]){if(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x11')]===0x1f4){logger[_0x581d('0x10')](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);return _0xf1a3b6(_0x5d8fa3[_0x581d('0x10')][_0x581d('0x12')]);}logger['error'](_0x581d('0xb'),_0x2f32bf,_0x5d8fa3[_0x581d('0x10')]['message']);return _0x497368(_0x5d8fa3['error']['message']);}else{logger['info'](_0x581d('0xb'),_0x2f32bf,'request\x20sent');_0x497368(_0x5d8fa3[_0x581d('0x13')][_0x581d('0x12')]);}})['catch'](function(_0x1890d0){logger['error'](_0x581d('0xb'),_0x2f32bf,_0x1890d0);_0xf1a3b6(_0x1890d0);});});}exports[_0x581d('0x14')]=function(_0x1e059d){var _0x42f7db=this;return new Promise(function(_0x1f790f,_0x2cff0d){return db[_0x581d('0x15')]['create'](_0x1e059d[_0x581d('0x16')],{'raw':_0x1e059d[_0x581d('0x17')]?_0x1e059d[_0x581d('0x17')][_0x581d('0x18')]===undefined?!![]:![]:!![]})[_0x581d('0x19')](function(_0x2a2aba){logger[_0x581d('0xa')](_0x581d('0x14'),_0x1e059d);logger[_0x581d('0xd')](_0x581d('0x14'),_0x1e059d,JSON[_0x581d('0xf')](_0x2a2aba));_0x1f790f(_0x2a2aba);})[_0x581d('0x1a')](function(_0x5add13){logger[_0x581d('0x10')](_0x581d('0x14'),_0x5add13[_0x581d('0x12')],_0x1e059d);_0x2cff0d(_0x42f7db[_0x581d('0x10')](0x1f4,_0x5add13[_0x581d('0x12')]));});});};
\ No newline at end of file
+var _0xc36d=['client','http','request','info','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','Attachment,\x20%s,\x20%s','message','CreateAttachment','Attachment','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x272b7a,_0x1fbe07){var _0x5b788e=function(_0x5866e1){while(--_0x5866e1){_0x272b7a['push'](_0x272b7a['shift']());}};_0x5b788e(++_0x1fbe07);}(_0xc36d,0x7d));var _0xdc36=function(_0x47bc5e,_0x6fc500){_0x47bc5e=_0x47bc5e-0x0;var _0x323a59=_0xc36d[_0x47bc5e];return _0x323a59;};'use strict';var _=require(_0xdc36('0x0'));var util=require(_0xdc36('0x1'));var moment=require(_0xdc36('0x2'));var BPromise=require(_0xdc36('0x3'));var rs=require(_0xdc36('0x4'));var fs=require('fs');var Redis=require(_0xdc36('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdc36('0x6'));var logger=require(_0xdc36('0x7'))('rpc');var config=require(_0xdc36('0x8'));var jayson=require(_0xdc36('0x9'));var client=jayson[_0xdc36('0xa')][_0xdc36('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6e4753,_0x571311,_0x20ba02){return new BPromise(function(_0x456897,_0x2a0087){return client[_0xdc36('0xc')](_0x6e4753,_0x20ba02)['then'](function(_0x20d00a){logger[_0xdc36('0xd')]('Attachment,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));logger[_0xdc36('0xf')](_0xdc36('0x10'),_0x571311,'request\x20sent',JSON[_0xdc36('0x11')](_0x20d00a));if(_0x20d00a[_0xdc36('0x12')]){if(_0x20d00a['error']['code']===0x1f4){logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x2a0087(_0x20d00a['error'][_0xdc36('0x14')]);}logger[_0xdc36('0x12')](_0xdc36('0x13'),_0x571311,_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);return _0x456897(_0x20d00a[_0xdc36('0x12')][_0xdc36('0x14')]);}else{logger[_0xdc36('0xd')]('Attachment,\x20%s,\x20%s',_0x571311,_0xdc36('0xe'));_0x456897(_0x20d00a['result']['message']);}})['catch'](function(_0x64f61e){logger[_0xdc36('0x12')]('Attachment,\x20%s,\x20%s',_0x571311,_0x64f61e);_0x2a0087(_0x64f61e);});});}exports[_0xdc36('0x15')]=function(_0x219a73){var _0x160d70=this;return new Promise(function(_0x225878,_0x183c91){return db[_0xdc36('0x16')]['create'](_0x219a73[_0xdc36('0x17')],{'raw':_0x219a73[_0xdc36('0x18')]?_0x219a73['options'][_0xdc36('0x19')]===undefined?!![]:![]:!![]})[_0xdc36('0x1a')](function(_0x3f25f0){logger['info'](_0xdc36('0x15'),_0x219a73);logger[_0xdc36('0xf')]('CreateAttachment',_0x219a73,JSON[_0xdc36('0x11')](_0x3f25f0));_0x225878(_0x3f25f0);})['catch'](function(_0x5a6e35){logger[_0xdc36('0x12')](_0xdc36('0x15'),_0x5a6e35[_0xdc36('0x14')],_0x219a73);_0x183c91(_0x160d70[_0xdc36('0x12')](0x1f4,_0x5a6e35[_0xdc36('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 1309d00..dac0c43 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x5e3d82,_0x97b075){var _0x18b0b7=function(_0x5633c4){while(--_0x5633c4){_0x5e3d82['push'](_0x5e3d82['shift']());}};_0x18b0b7(++_0x97b075);}(_0x757a,0xde));var _0xa757=function(_0x32c68d,_0x3eea58){_0x32c68d=_0x32c68d-0x0;var _0x23a39d=_0x757a[_0x32c68d];return _0x23a39d;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0x5f2f=['show','/:id/download','download','post','/:id/clone','clone','root','server/files/attachments/','format','now','originalname','replace','single','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./attachment.controller','get','isAuthenticated','index','/:id'];(function(_0x125238,_0x12dea4){var _0x357419=function(_0x38a531){while(--_0x38a531){_0x125238['push'](_0x125238['shift']());}};_0x357419(++_0x12dea4);}(_0x5f2f,0x73));var _0xf5f2=function(_0x537408,_0x4da70d){_0x537408=_0x537408-0x0;var _0x4a0dc8=_0x5f2f[_0x537408];return _0x4a0dc8;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var fs_extra=require(_0xf5f2('0x6'));var auth=require(_0xf5f2('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf5f2('0x8'));router[_0xf5f2('0x9')]('/',auth[_0xf5f2('0xa')](),controller[_0xf5f2('0xb')]);router[_0xf5f2('0x9')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0xd')]);router[_0xf5f2('0x9')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x10')](_0xf5f2('0x11'),auth['isAuthenticated'](),controller[_0xf5f2('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x53fb33,_0xa7e1a6,_0x151aba){_0x151aba(null,path['join'](config[_0xf5f2('0x13')],_0xf5f2('0x14')));},'filename':function(_0x331482,_0x3f2997,_0x59bb6c){_0x59bb6c(null,util[_0xf5f2('0x15')]('%s-%s',Date[_0xf5f2('0x16')](),_0x3f2997[_0xf5f2('0x17')][_0xf5f2('0x18')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xf5f2('0x10')]('/',upload[_0xf5f2('0x19')]('file'),controller[_0xf5f2('0x1a')]);router[_0xf5f2('0x1b')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1c')]);router[_0xf5f2('0x1d')](_0xf5f2('0xc'),auth[_0xf5f2('0xa')](),controller[_0xf5f2('0x1e')]);module[_0xf5f2('0x1f')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index d09b27e..566e420 100644
--- a/server/api/authActiveDirectory/authActiveDirectory.controller.js
+++ b/server/api/authActiveDirectory/authActiveDirectory.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x71fd=['Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','findOne','name','password','role','disabled','blocked','blockedAt','admin','user','agent','domain','add','minutes','getLicense','catch','send','message','login','signToken','online','use','ad-login','User','passport-local','moment','util','../../components/auth/service','../../config/utils','../../config/environment','../../config/logger','api','activedirectory','undefined','error','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x71fd,0x1c1));var _0xd71f=function(_0x1a2b00,_0x49c0d6){_0x1a2b00=_0x1a2b00-0x0;var _0x5c3cfb=_0x71fd[_0x1a2b00];return _0x5c3cfb;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xd71f('0x0'))['Strategy'];var moment=require(_0xd71f('0x1'));var ActiveDirectory=require('activedirectory2');var BPromise=require('bluebird');var util=require(_0xd71f('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0xd71f('0x3'));var utils=require(_0xd71f('0x4'));var config=require(_0xd71f('0x5'));var logger=require(_0xd71f('0x6'))(_0xd71f('0x7'));function isActiveDirectoryConfigured(_0x2be03c){var _0x44073b=![];if(typeof _0x2be03c[_0xd71f('0x8')]!==_0xd71f('0x9')){_0x44073b=_0x2be03c['activedirectory']['baseDN']&&_0x2be03c['activedirectory']['url']&&_0x2be03c[_0xd71f('0x8')]['domain'];}return _0x44073b;}function adAuthenticate(_0x347f92,_0x27be32,_0x1d2ad0){return new BPromise(function(_0x3b4781,_0x5f2ccf){try{var _0xb68675=new ActiveDirectory(_0x347f92);_0xb68675['authenticate'](_0x27be32,_0x1d2ad0,function(_0x19e2f5,_0xcd5619){if(_0x19e2f5){logger[_0xd71f('0xa')]('Error\x20authenticate\x20%s:\x20%s',_0x27be32,util[_0xd71f('0xb')](_0x19e2f5,{'showHidden':![],'depth':null}));_0x5f2ccf(_0xd71f('0xc'));}else if(!_0xcd5619){logger['error'](_0xd71f('0xd'),_0x27be32);_0x5f2ccf(_0xd71f('0xc'));}else{_0x3b4781(_0xcd5619);}});}catch(_0x3672d7){_0x5f2ccf(_0x3672d7);}});}function ActiveDirectoryAuthenticate(_0x48f224,_0x1a571a,_0x970cc6,_0x223177){var _0x39c85e,_0x13cecd;if(!isActiveDirectoryConfigured(config)){logger[_0xd71f('0xa')](_0xd71f('0xe'),_0x1a571a);return _0x223177(null,![],{'message':_0xd71f('0xc')});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xd71f('0xf'),_0xd71f('0x10')],'raw':!![]})[_0xd71f('0x11')](function(_0x5db4a0){_0x39c85e=_0x5db4a0;if(!_0x39c85e[_0xd71f('0xf')]){logger['error'](_0xd71f('0x12'),_0x1a571a);throw new Error(_0xd71f('0xc'));}return _0x48f224[_0xd71f('0x13')]({'attributes':['id',_0xd71f('0x14'),_0xd71f('0x15'),'salt',_0xd71f('0x16'),_0xd71f('0x17'),_0xd71f('0x18'),_0xd71f('0x19'),'online'],'where':{'name':_0x1a571a,'role':{'$or':[_0xd71f('0x1a'),_0xd71f('0x1b'),_0xd71f('0x1c')]},'adSsoEnabled':!![]}});})[_0xd71f('0x11')](function(_0x33013e){if(!_0x33013e||_0x33013e&&_0x33013e['name']!==_0x1a571a){throw new Error(_0xd71f('0xc'));}_0x13cecd=_0x33013e;var _0x1fc148=_0x13cecd['name']+'@'+config['activedirectory'][_0xd71f('0x1d')];return adAuthenticate(config['activedirectory'],_0x1fc148,_0x970cc6);})[_0xd71f('0x11')](function(_0xdec4bd){if(_0x13cecd[_0xd71f('0x17')]){throw new Error(_0xd71f('0xc'));}if(_0x39c85e[_0xd71f('0x10')]>0x0){if(_0x13cecd[_0xd71f('0x18')]){if(moment(_0x13cecd[_0xd71f('0x19')])[_0xd71f('0x1e')](_0x39c85e['blockDuration'],_0xd71f('0x1f'))>moment()){throw new Error(_0xd71f('0xc'));}return utils['clearBlockUser'](_0x13cecd,0x0,![],null)['then'](function(){return utils[_0xd71f('0x20')](_0x13cecd);})['then'](function(){return _0x223177(null,_0x13cecd);});}else{return utils['getLicense'](_0x13cecd)[_0xd71f('0x11')](function(){return _0x223177(null,_0x13cecd);});}}else{return utils[_0xd71f('0x20')](_0x13cecd)[_0xd71f('0x11')](function(){return _0x223177(null,_0x13cecd);});}})[_0xd71f('0x21')](function(_0x199893){return _0x223177(null,![],_0x199893);});}function handleError(_0x2215fe,_0x4f2a5a,_0x5883c3){return _0x2215fe['status'](_0x4f2a5a||0x1f4)[_0xd71f('0x22')]({'message':_0x5883c3?_0x5883c3[_0xd71f('0x23')]||_0x5883c3:''});}exports[_0xd71f('0x24')]=function(_0x2eb63d,_0x4920b3,_0x597948){passport['authenticate']('ad-login',function(_0x4153a9,_0x397001,_0x2c9005){var _0x5ccd04=_0x4153a9||_0x2c9005;if(_0x5ccd04){return handleError(_0x4920b3,0x191,_0x5ccd04);}if(!_0x397001){return handleError(_0x4920b3,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x71403c={'payload':{'id':_0x397001['id'],'role':_0x397001['role']},'options':{'expiresIn':0x15180}};return authService[_0xd71f('0x25')](_0x71403c)[_0xd71f('0x11')](function(_0x5e2aa7){_0x4920b3['json']({'id':_0x397001['id'],'token':_0x5e2aa7,'statusCall':'','isAlreadyLogged':_0x397001[_0xd71f('0x26')]});});}})(_0x2eb63d,_0x4920b3,_0x597948);};passport[_0xd71f('0x27')](_0xd71f('0x28'),new LocalStrategy({'usernameField':_0xd71f('0x14'),'passwordField':_0xd71f('0x15')},function(_0x3661bb,_0x163b00,_0x2e75ea){return ActiveDirectoryAuthenticate(db[_0xd71f('0x29')],_0x3661bb,_0x163b00,_0x2e75ea);}));
\ No newline at end of file
+var _0xbc96=['user','agent','blockedAt','add','minutes','getLicense','catch','status','send','authenticate','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','User','passport','passport-local','Strategy','moment','bluebird','util','../../mysqldb','../../components/auth/service','../../config/environment','../../config/logger','activedirectory','undefined','baseDN','domain','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','then','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked'];(function(_0x350ee9,_0x3ce707){var _0x19ec07=function(_0x1552fc){while(--_0x1552fc){_0x350ee9['push'](_0x350ee9['shift']());}};_0x19ec07(++_0x3ce707);}(_0xbc96,0x1c0));var _0x6bc9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbc96[_0x3dd15e];return _0x231fd0;};'use strict';var passport=require(_0x6bc9('0x0'));var LocalStrategy=require(_0x6bc9('0x1'))[_0x6bc9('0x2')];var moment=require(_0x6bc9('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x6bc9('0x4'));var util=require(_0x6bc9('0x5'));var db=require(_0x6bc9('0x6'))['db'];var authService=require(_0x6bc9('0x7'));var utils=require('../../config/utils');var config=require(_0x6bc9('0x8'));var logger=require(_0x6bc9('0x9'))('api');function isActiveDirectoryConfigured(_0x4a7033){var _0x2b05bf=![];if(typeof _0x4a7033[_0x6bc9('0xa')]!==_0x6bc9('0xb')){_0x2b05bf=_0x4a7033[_0x6bc9('0xa')][_0x6bc9('0xc')]&&_0x4a7033[_0x6bc9('0xa')]['url']&&_0x4a7033[_0x6bc9('0xa')][_0x6bc9('0xd')];}return _0x2b05bf;}function adAuthenticate(_0x3a37b2,_0x4c1e7b,_0x173369){return new BPromise(function(_0x1107e6,_0x6337c1){try{var _0x243679=new ActiveDirectory(_0x3a37b2);_0x243679['authenticate'](_0x4c1e7b,_0x173369,function(_0x423e97,_0x27c970){if(_0x423e97){logger[_0x6bc9('0xe')](_0x6bc9('0xf'),_0x4c1e7b,util[_0x6bc9('0x10')](_0x423e97,{'showHidden':![],'depth':null}));_0x6337c1(_0x6bc9('0x11'));}else if(!_0x27c970){logger['error'](_0x6bc9('0x12'),_0x4c1e7b);_0x6337c1(_0x6bc9('0x11'));}else{_0x1107e6(_0x27c970);}});}catch(_0x1d0d09){_0x6337c1(_0x1d0d09);}});}function ActiveDirectoryAuthenticate(_0x3695f2,_0x237ab5,_0x451df1,_0x429cdb){var _0x383829,_0x1678af;if(!isActiveDirectoryConfigured(config)){logger[_0x6bc9('0xe')](_0x6bc9('0x13'),_0x237ab5);return _0x429cdb(null,![],{'message':_0x6bc9('0x11')});}return db[_0x6bc9('0x14')][_0x6bc9('0x15')]({'where':{'id':0x1},'attributes':[_0x6bc9('0x16'),_0x6bc9('0x17')],'raw':!![]})[_0x6bc9('0x18')](function(_0x415b68){_0x383829=_0x415b68;if(!_0x383829['adSsoEnabled']){logger['error'](_0x6bc9('0x19'),_0x237ab5);throw new Error(_0x6bc9('0x11'));}return _0x3695f2['findOne']({'attributes':['id',_0x6bc9('0x1a'),_0x6bc9('0x1b'),_0x6bc9('0x1c'),_0x6bc9('0x1d'),_0x6bc9('0x1e'),_0x6bc9('0x1f'),'blockedAt','online'],'where':{'name':_0x237ab5,'role':{'$or':['admin',_0x6bc9('0x20'),_0x6bc9('0x21')]},'adSsoEnabled':!![]}});})['then'](function(_0x693cb6){if(!_0x693cb6||_0x693cb6&&_0x693cb6[_0x6bc9('0x1a')]!==_0x237ab5){throw new Error(_0x6bc9('0x11'));}_0x1678af=_0x693cb6;var _0x4e0ad5=_0x1678af['name']+'@'+config[_0x6bc9('0xa')][_0x6bc9('0xd')];return adAuthenticate(config[_0x6bc9('0xa')],_0x4e0ad5,_0x451df1);})[_0x6bc9('0x18')](function(_0x4ef328){if(_0x1678af[_0x6bc9('0x1e')]){throw new Error(_0x6bc9('0x11'));}if(_0x383829[_0x6bc9('0x17')]>0x0){if(_0x1678af[_0x6bc9('0x1f')]){if(moment(_0x1678af[_0x6bc9('0x22')])[_0x6bc9('0x23')](_0x383829['blockDuration'],_0x6bc9('0x24'))>moment()){throw new Error(_0x6bc9('0x11'));}return utils['clearBlockUser'](_0x1678af,0x0,![],null)[_0x6bc9('0x18')](function(){return utils[_0x6bc9('0x25')](_0x1678af);})['then'](function(){return _0x429cdb(null,_0x1678af);});}else{return utils[_0x6bc9('0x25')](_0x1678af)['then'](function(){return _0x429cdb(null,_0x1678af);});}}else{return utils[_0x6bc9('0x25')](_0x1678af)[_0x6bc9('0x18')](function(){return _0x429cdb(null,_0x1678af);});}})[_0x6bc9('0x26')](function(_0x372f70){return _0x429cdb(null,![],_0x372f70);});}function handleError(_0x5a0a92,_0x5a9c8c,_0x4574ae){return _0x5a0a92[_0x6bc9('0x27')](_0x5a9c8c||0x1f4)[_0x6bc9('0x28')]({'message':_0x4574ae?_0x4574ae['message']||_0x4574ae:''});}exports['login']=function(_0x57e143,_0xd87173,_0x5b115a){passport[_0x6bc9('0x29')](_0x6bc9('0x2a'),function(_0x255bef,_0x117d5f,_0x21d903){var _0x77f75b=_0x255bef||_0x21d903;if(_0x77f75b){return handleError(_0xd87173,0x191,_0x77f75b);}if(!_0x117d5f){return handleError(_0xd87173,0x194,{'message':_0x6bc9('0x2b')});}else{var _0x558024={'payload':{'id':_0x117d5f['id'],'role':_0x117d5f[_0x6bc9('0x1d')]},'options':{'expiresIn':0x15180}};return authService[_0x6bc9('0x2c')](_0x558024)['then'](function(_0x3bb60e){_0xd87173[_0x6bc9('0x2d')]({'id':_0x117d5f['id'],'token':_0x3bb60e,'statusCall':'','isAlreadyLogged':_0x117d5f[_0x6bc9('0x2e')]});});}})(_0x57e143,_0xd87173,_0x5b115a);};passport['use'](_0x6bc9('0x2a'),new LocalStrategy({'usernameField':_0x6bc9('0x1a'),'passwordField':_0x6bc9('0x1b')},function(_0x5403b4,_0x527afc,_0x57e980){return ActiveDirectoryAuthenticate(db[_0x6bc9('0x2f')],_0x5403b4,_0x527afc,_0x57e980);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index b26494c..029f09e 100644
--- a/server/api/authActiveDirectory/index.js
+++ b/server/api/authActiveDirectory/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xeebb=['exports','Router','./authActiveDirectory.controller','post','login'];(function(_0x2a526f,_0x1410a1){var _0x2aa6d0=function(_0x3c9690){while(--_0x3c9690){_0x2a526f['push'](_0x2a526f['shift']());}};_0x2aa6d0(++_0x1410a1);}(_0xeebb,0xbf));var _0xbeeb=function(_0xf31126,_0x16ce8c){_0xf31126=_0xf31126-0x0;var _0x1c27b7=_0xeebb[_0xf31126];return _0x1c27b7;};'use strict';var express=require('express');var router=express[_0xbeeb('0x0')]();var controller=require(_0xbeeb('0x1'));router[_0xbeeb('0x2')]('/',controller[_0xbeeb('0x3')]);module[_0xbeeb('0x4')]=router;
\ No newline at end of file
+var _0x87d5=['express','Router','post','exports'];(function(_0xeb7c0c,_0x38560d){var _0x328ed6=function(_0x31c14d){while(--_0x31c14d){_0xeb7c0c['push'](_0xeb7c0c['shift']());}};_0x328ed6(++_0x38560d);}(_0x87d5,0xdc));var _0x587d=function(_0x293f8a,_0x288371){_0x293f8a=_0x293f8a-0x0;var _0x2e4557=_0x87d5[_0x293f8a];return _0x2e4557;};'use strict';var express=require(_0x587d('0x0'));var router=express[_0x587d('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0x587d('0x2')]('/',controller['login']);module[_0x587d('0x3')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index e1d5e06..2976b0e 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x7a54,0x106));var _0x47a5=function(_0x46c46a,_0x203b08){_0x46c46a=_0x46c46a-0x0;var _0x43bd58=_0x7a54[_0x46c46a];return _0x43bd58;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x2a649d,_0x3894ff){var _0x17ac80=function(_0x15b1e4){while(--_0x15b1e4){_0x2a649d['push'](_0x2a649d['shift']());}};_0x17ac80(++_0x3894ff);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var passport=require(_0x7995('0x1'));var GoogleStrategy=require(_0x7995('0x2'))[_0x7995('0x3')];var moment=require('moment');var db=require(_0x7995('0x4'))['db'];var config=require(_0x7995('0x5'));var utils=require(_0x7995('0x6'));exports[_0x7995('0x7')]=passport['authenticate'](_0x7995('0x8'),{'failureRedirect':_0x7995('0x9'),'scope':[_0x7995('0xa'),_0x7995('0xb')],'session':![]});exports[_0x7995('0xc')]=passport[_0x7995('0xd')]('google',{'failureRedirect':_0x7995('0x9'),'session':![]});passport[_0x7995('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0x7995('0x8')][_0x7995('0xf')]:'id','clientSecret':config[_0x7995('0x8')]?config[_0x7995('0x8')][_0x7995('0x10')]:_0x7995('0x11'),'callbackURL':config[_0x7995('0x8')]?config['google'][_0x7995('0x12')]:''},function(_0x41c652,_0x581f22,_0xb0c872,_0x2cb37a){var _0x19a27e,_0x385f00;return db[_0x7995('0x13')][_0x7995('0x14')]({'where':{'id':0x1},'attributes':[_0x7995('0x15'),'blockDuration'],'raw':!![]})['then'](function(_0x2b4e94){_0x19a27e=_0x2b4e94;return db[_0x7995('0x16')][_0x7995('0x17')]({'where':{'email':_[_0x7995('0x18')](_0xb0c872[_0x7995('0x19')],_0x7995('0x1a')),'role':{'$or':[_0x7995('0x1b'),_0x7995('0x1c'),'agent']}}});})[_0x7995('0x1d')](function(_0x565d97){_0x385f00=_0x565d97;if(_0x385f00){if(_0x385f00[_0x7995('0x1e')]){return _0x2cb37a(_0x7995('0x1f'));}else if(_0x19a27e[_0x7995('0x20')]>0x0){if(_0x385f00[_0x7995('0x21')]){if(moment(_0x385f00[_0x7995('0x22')])[_0x7995('0x23')](_0x19a27e['blockDuration'],'minutes')>moment()){return _0x2cb37a(_0x7995('0x1f'));}else{return utils['clearBlockUser'](_0x385f00,0x0,![],null)['then'](function(){return utils[_0x7995('0x24')](_0x385f00);})[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)[_0x7995('0x1d')](function(){return _0x2cb37a(null,_0x385f00);});}}else{return utils['getLicense'](_0x385f00)['then'](function(){return _0x2cb37a(null,_0x385f00);});}}return _0x2cb37a(_0x7995('0x1f'));})[_0x7995('0x25')](function(_0x350fd9){_0x2cb37a(_0x350fd9);});}));
\ No newline at end of file
diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js
index f0f22f6..8a1268b 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 _0x591a=['callback','isMiddleware','setTokenCookie','express','passport','Router','../user/user.controller.js','../../components/auth/service','login','get','/callback'];(function(_0x1ca9eb,_0x99a10b){var _0x2e284e=function(_0x1196a4){while(--_0x1196a4){_0x1ca9eb['push'](_0x1ca9eb['shift']());}};_0x2e284e(++_0x99a10b);}(_0x591a,0x163));var _0xa591=function(_0xaa0309,_0x1c8008){_0xaa0309=_0xaa0309-0x0;var _0x5de7ce=_0x591a[_0xaa0309];return _0x5de7ce;};'use strict';var express=require(_0xa591('0x0'));var passport=require(_0xa591('0x1'));var router=express[_0xa591('0x2')]();var controller=require('./authGoogle.controller');var userController=require(_0xa591('0x3'));var authService=require(_0xa591('0x4'));router['get']('/',controller[_0xa591('0x5')]);router[_0xa591('0x6')](_0xa591('0x7'),controller[_0xa591('0x8')],authService[_0xa591('0x9')],userController[_0xa591('0x5')],authService[_0xa591('0xa')]);module['exports']=router;
\ No newline at end of file
+var _0xf3ac=['exports','./authGoogle.controller','../user/user.controller.js','get','callback','isMiddleware','login','setTokenCookie'];(function(_0x3de7e0,_0x28cbff){var _0x11d0b3=function(_0xd95412){while(--_0xd95412){_0x3de7e0['push'](_0x3de7e0['shift']());}};_0x11d0b3(++_0x28cbff);}(_0xf3ac,0x79));var _0xcf3a=function(_0x4dc259,_0x33c454){_0x4dc259=_0x4dc259-0x0;var _0x289719=_0xf3ac[_0x4dc259];return _0x289719;};'use strict';var express=require('express');var passport=require('passport');var router=express['Router']();var controller=require(_0xcf3a('0x0'));var userController=require(_0xcf3a('0x1'));var authService=require('../../components/auth/service');router['get']('/',controller['login']);router[_0xcf3a('0x2')]('/callback',controller[_0xcf3a('0x3')],authService[_0xcf3a('0x4')],userController[_0xcf3a('0x5')],authService[_0xcf3a('0x6')]);module[_0xcf3a('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index 013ec3a..4f54360 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 _0x6ee3=['signToken','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','Setting','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','now','save','xCally\x20Motion\x20Password\x20Reset','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','params','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','previousPasswords','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','passport','passport-local','Strategy','jayson/promise','lodash','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','loginAttempts','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockedAt','add','minutes','clearBlockUser','then','catch','getLicense','MailAccount','find','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','email','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.'];(function(_0x1d442f,_0x10ca71){var _0x7a2cba=function(_0xde90f0){while(--_0xde90f0){_0x1d442f['push'](_0x1d442f['shift']());}};_0x7a2cba(++_0x10ca71);}(_0x6ee3,0x1bf));var _0x36ee=function(_0x3b7f7a,_0x5d46f3){_0x3b7f7a=_0x3b7f7a-0x0;var _0x169981=_0x6ee3[_0x3b7f7a];return _0x169981;};'use strict';var util=require('util');var passport=require(_0x36ee('0x0'));var LocalStrategy=require(_0x36ee('0x1'))[_0x36ee('0x2')];var jayson=require(_0x36ee('0x3'));var _=require(_0x36ee('0x4'));var rs=require('randomstring');var moment=require(_0x36ee('0x5'));var db=require(_0x36ee('0x6'))['db'];var authService=require(_0x36ee('0x7'));var utils=require(_0x36ee('0x8'));var client=jayson[_0x36ee('0x9')][_0x36ee('0xa')]({'port':0x232b});function localAuthenticate(_0x2a29d7,_0x10ba3d,_0x56355a,_0x9c6aa){var _0x33b487,_0xf7e53;return db['Setting'][_0x36ee('0xb')]({'where':{'id':0x1},'attributes':[_0x36ee('0xc'),_0x36ee('0xd')],'raw':!![]})['then'](function(_0x51f06b){_0x33b487=_0x51f06b;return _0x2a29d7[_0x36ee('0xb')]({'attributes':['id',_0x36ee('0xe'),_0x36ee('0xf'),_0x36ee('0x10'),_0x36ee('0x11'),_0x36ee('0x12'),_0x36ee('0x13'),'blockedAt',_0x36ee('0x14')],'where':{'name':_0x10ba3d,'role':{'$or':['admin',_0x36ee('0x15'),_0x36ee('0x16')]}}});})['then'](function(_0x3fa53c){if(!_0x3fa53c||_0x3fa53c&&_0x3fa53c[_0x36ee('0xe')]!==_0x10ba3d){throw new Error(_0x36ee('0x17'));}else{_0xf7e53=_0x3fa53c;return _0xf7e53;}})['then'](function(){_0xf7e53[_0x36ee('0x18')](_0x56355a,function(_0x98ac6d,_0x525bf2){var _0x5e6138=_0xf7e53[_0x36ee('0x14')]+0x1;if(_0x98ac6d){return _0x9c6aa(_0x98ac6d);}else if(!_0x525bf2){if(_0xf7e53['disabled']){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}else if(_0x33b487[_0x36ee('0xc')]>0x0){if(_0xf7e53['blocked']){if(_0x33b487[_0x36ee('0xd')]>0x0){if(moment(_0xf7e53[_0x36ee('0x19')])[_0x36ee('0x1a')](_0x33b487[_0x36ee('0xd')],_0x36ee('0x1b'))>moment()){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}else{return utils[_0x36ee('0x1c')](_0xf7e53,_0x5e6138,![],null)[_0x36ee('0x1d')](function(){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});});}}else{return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}}else{if(_0x5e6138>=_0x33b487[_0x36ee('0xc')]){return utils['clearBlockUser'](_0xf7e53,0x0,!![],moment())['then'](function(){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});});}else{return utils[_0x36ee('0x1c')](_0xf7e53,_0x5e6138,![],null)[_0x36ee('0x1d')](function(){return _0x9c6aa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}}else{if(_0xf7e53[_0x36ee('0x12')]){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}else if(_0x33b487['allowedLoginAttempts']>0x0){if(_0xf7e53['blocked']){if(_0x33b487[_0x36ee('0xd')]>0x0){if(moment(_0xf7e53[_0x36ee('0x19')])[_0x36ee('0x1a')](_0x33b487['blockDuration'],'minutes')>moment()){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}else{return utils[_0x36ee('0x1c')](_0xf7e53,0x0,![],null)[_0x36ee('0x1d')](function(){return utils['getLicense'](_0xf7e53);})[_0x36ee('0x1d')](function(){return _0x9c6aa(null,_0xf7e53);});}}else{return _0x9c6aa(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0xf7e53,0x0,![],null)[_0x36ee('0x1d')](function(){return utils['getLicense'](_0xf7e53);})[_0x36ee('0x1d')](function(){return _0x9c6aa(null,_0xf7e53);})[_0x36ee('0x1e')](function(_0x1a0c90){return _0x9c6aa(null,![],_0x1a0c90);});}}else{if(_0xf7e53[_0x36ee('0x13')]){return _0x9c6aa(null,![],{'message':_0x36ee('0x17')});}else{return utils[_0x36ee('0x1f')](_0xf7e53)[_0x36ee('0x1d')](function(){return _0x9c6aa(null,_0xf7e53);});}}}});})['catch'](function(_0x487993){return _0x9c6aa(null,![],_0x487993);});}function sendServiceMail(_0x59dc0e){return db[_0x36ee('0x20')][_0x36ee('0x21')]({'where':{'service':!![]},'attributes':['id',_0x36ee('0xe'),'email'],'include':[{'model':db[_0x36ee('0x22')],'as':_0x36ee('0x23'),'include':[{'model':db[_0x36ee('0x24')],'as':'CloudProvider'}]}]})['then'](function(_0x49b2ad){if(!_0x49b2ad){throw new Error(_0x36ee('0x25'));}var _0x3db155=_0x49b2ad[_0x36ee('0x26')]();var _0x4b16ec={'account':_0x3db155,'message':_['merge']({'from':util[_0x36ee('0x27')](_0x36ee('0x28'),_0x49b2ad[_0x36ee('0xe')],_0x49b2ad[_0x36ee('0x29')]||_0x49b2ad[_0x36ee('0x23')][_0x36ee('0x15')])},_0x59dc0e)};return client[_0x36ee('0x2a')](_0x36ee('0x2b'),_0x4b16ec);})[_0x36ee('0x1d')](function(_0x5b8362){if(_0x5b8362['error']){throw new Error(util[_0x36ee('0x27')](_0x36ee('0x2c'),_0x5b8362[_0x36ee('0x2d')][_0x36ee('0x2e')]||JSON[_0x36ee('0x2f')](_0x5b8362['error'])));}return!![];});}function handleError(_0x233292,_0x191038,_0x286422){return _0x233292[_0x36ee('0x30')](_0x191038||0x1f4)['send']({'message':_0x286422?_0x286422['message']||_0x286422:''});}exports['login']=function(_0x51d1ce,_0x23b951,_0x5d98ec){passport[_0x36ee('0x18')](_0x36ee('0x31'),function(_0x30d572,_0x454f02,_0xe9e918){var _0xa9478a=_0x30d572||_0xe9e918;if(_0xa9478a){return handleError(_0x23b951,0x191,_0xa9478a);}if(!_0x454f02){return handleError(_0x23b951,0x194,{'message':_0x36ee('0x32')});}else{var _0x6d75e8={'payload':{'id':_0x454f02['id'],'role':_0x454f02[_0x36ee('0x11')]},'options':{'expiresIn':0x15180}};return authService[_0x36ee('0x33')](_0x6d75e8)[_0x36ee('0x1d')](function(_0x2ea2d9){_0x23b951[_0x36ee('0x34')]({'id':_0x454f02['id'],'token':_0x2ea2d9,'statusCall':'','isAlreadyLogged':_0x454f02[_0x36ee('0x35')]});});}})(_0x51d1ce,_0x23b951,_0x5d98ec);};exports['forgot']=function(_0x293875,_0x3b5626){if(!_0x293875[_0x36ee('0x36')][_0x36ee('0x29')]){return handleError(_0x3b5626,0x1f4,{'message':_0x36ee('0x37')});}var _0x3ead73=rs[_0x36ee('0x38')]();_0x293875[_0x36ee('0x36')][_0x36ee('0x29')]=_0x293875['body'][_0x36ee('0x29')][_0x36ee('0x39')]()[_0x36ee('0x3a')]();var _0x5dd304;return db[_0x36ee('0x3b')][_0x36ee('0xb')]({'where':{'id':0x1},'attributes':[_0x36ee('0xc'),_0x36ee('0xd')],'raw':!![]})[_0x36ee('0x1d')](function(_0xd39078){_0x5dd304=_0xd39078;return db[_0x36ee('0x3c')][_0x36ee('0x21')]({'where':{'email':_0x293875[_0x36ee('0x36')][_0x36ee('0x29')]}});})[_0x36ee('0x1d')](function(_0x12897c){if(!_0x12897c){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x12897c[_0x36ee('0x12')]){throw new Error(_0x36ee('0x3d'));}if(_0x12897c['blocked']){if(moment(_0x12897c[_0x36ee('0x19')])[_0x36ee('0x1a')](_0x5dd304[_0x36ee('0xd')],_0x36ee('0x1b'))>moment()){throw new Error(_0x36ee('0x3e'));}else{_0x12897c[_0x36ee('0x13')]=![];_0x12897c['blockedAt']=null;}}_0x12897c[_0x36ee('0x3f')]=_0x3ead73;_0x12897c['resetPasswordExpires']=Date[_0x36ee('0x40')]()+0x36ee80;return _0x12897c[_0x36ee('0x41')]();})['then'](function(){return sendServiceMail({'to':_0x293875['body'][_0x36ee('0x29')],'subject':_0x36ee('0x42'),'text':'You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a'+_0x36ee('0x43')+'https://'+_0x293875['headers']['host']+_0x36ee('0x44')+_0x3ead73+'\x0a\x0a'+_0x36ee('0x45')});})['then'](function(){_0x3b5626[_0x36ee('0x30')](0xc8)[_0x36ee('0x46')]({'message':_0x36ee('0x47')});})[_0x36ee('0x1e')](function(_0x3ddbe1){return handleError(_0x3b5626,0x1f4,_0x3ddbe1);});};exports['reset']=function(_0x1f151b,_0x36e173){return db[_0x36ee('0x3c')]['find']({'where':{'resetPasswordToken':_0x1f151b[_0x36ee('0x48')][_0x36ee('0x49')],'resetPasswordExpires':{'$gt':Date[_0x36ee('0x40')]()}}})[_0x36ee('0x1d')](function(_0x5c7b86){if(!_0x5c7b86){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x36ee('0xb')]({'attributes':['id',_0x36ee('0x4a'),_0x36ee('0x4b'),_0x36ee('0x4c')]})['then'](function(_0x513fcd){if(_0x513fcd[_0x36ee('0x4a')])authService[_0x36ee('0x4d')](_0x1f151b[_0x36ee('0x36')][_0x36ee('0xf')]);if(!_0x513fcd[_0x36ee('0x4b')]||!_0x5c7b86[_0x36ee('0x4e')])return _0x5c7b86;authService[_0x36ee('0x4f')](_0x1f151b['body'][_0x36ee('0xf')],_0x5c7b86[_0x36ee('0x4e')],_0x513fcd[_0x36ee('0x4c')]);return _0x5c7b86;})[_0x36ee('0x1d')](function(){_0x5c7b86[_0x36ee('0xf')]=_0x1f151b[_0x36ee('0x36')][_0x36ee('0xf')];_0x5c7b86[_0x36ee('0x3f')]=null;_0x5c7b86[_0x36ee('0x50')]=null;return _0x5c7b86[_0x36ee('0x41')]();});})[_0x36ee('0x1d')](function(){_0x36e173['status'](0xc8)['send']({'message':_0x36ee('0x51')});})[_0x36ee('0x1e')](function(_0x2ae270){return handleError(_0x36e173,0x1f4,_0x2ae270);});};passport[_0x36ee('0x52')](_0x36ee('0x31'),new LocalStrategy({'usernameField':'name','passwordField':_0x36ee('0xf')},function(_0xe40a70,_0x15a74c,_0x5d2168){return localAuthenticate(db['User'],_0xe40a70,_0x15a74c,_0x5d2168);}));
\ No newline at end of file
+var _0x57fa=['minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','format','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','body','Email\x20parameter\x20is\x20missing','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','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','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','passwordHistoryLimit','previousPasswords','resetPasswordToken','Password\x20reset!','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','password','disabled','blocked','blockedAt','loginAttempts','admin','user','name','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add'];(function(_0x4d8e27,_0x32bd2b){var _0xa22d59=function(_0x27284e){while(--_0x27284e){_0x4d8e27['push'](_0x4d8e27['shift']());}};_0xa22d59(++_0x32bd2b);}(_0x57fa,0xd0));var _0xa57f=function(_0x127bc8,_0x397b14){_0x127bc8=_0x127bc8-0x0;var _0x1ecaa2=_0x57fa[_0x127bc8];return _0x1ecaa2;};'use strict';var util=require(_0xa57f('0x0'));var passport=require(_0xa57f('0x1'));var LocalStrategy=require(_0xa57f('0x2'))[_0xa57f('0x3')];var jayson=require(_0xa57f('0x4'));var _=require(_0xa57f('0x5'));var rs=require(_0xa57f('0x6'));var moment=require(_0xa57f('0x7'));var db=require(_0xa57f('0x8'))['db'];var authService=require(_0xa57f('0x9'));var utils=require(_0xa57f('0xa'));var client=jayson[_0xa57f('0xb')][_0xa57f('0xc')]({'port':0x232b});function localAuthenticate(_0xd783e1,_0x29ce3,_0x123d2e,_0x57839b){var _0xc8d6bb,_0x5ffa2a;return db[_0xa57f('0xd')][_0xa57f('0xe')]({'where':{'id':0x1},'attributes':[_0xa57f('0xf'),_0xa57f('0x10')],'raw':!![]})[_0xa57f('0x11')](function(_0x5e3dd5){_0xc8d6bb=_0x5e3dd5;return _0xd783e1[_0xa57f('0xe')]({'attributes':['id','name',_0xa57f('0x12'),'salt','role',_0xa57f('0x13'),_0xa57f('0x14'),_0xa57f('0x15'),_0xa57f('0x16')],'where':{'name':_0x29ce3,'role':{'$or':[_0xa57f('0x17'),_0xa57f('0x18'),'agent']}}});})[_0xa57f('0x11')](function(_0x78e227){if(!_0x78e227||_0x78e227&&_0x78e227[_0xa57f('0x19')]!==_0x29ce3){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5ffa2a=_0x78e227;return _0x5ffa2a;}})[_0xa57f('0x11')](function(){_0x5ffa2a[_0xa57f('0x1a')](_0x123d2e,function(_0x774a35,_0x11eccb){var _0x49f201=_0x5ffa2a[_0xa57f('0x16')]+0x1;if(_0x774a35){return _0x57839b(_0x774a35);}else if(!_0x11eccb){if(_0x5ffa2a['disabled']){return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}else if(_0xc8d6bb[_0xa57f('0xf')]>0x0){if(_0x5ffa2a[_0xa57f('0x14')]){if(_0xc8d6bb['blockDuration']>0x0){if(moment(_0x5ffa2a[_0xa57f('0x15')])[_0xa57f('0x1c')](_0xc8d6bb[_0xa57f('0x10')],_0xa57f('0x1d'))>moment()){return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}else{return utils['clearBlockUser'](_0x5ffa2a,_0x49f201,![],null)[_0xa57f('0x11')](function(){return _0x57839b(null,![],{'message':_0xa57f('0x1b')});});}}else{return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}}else{if(_0x49f201>=_0xc8d6bb[_0xa57f('0xf')]){return utils[_0xa57f('0x1e')](_0x5ffa2a,0x0,!![],moment())[_0xa57f('0x11')](function(){return _0x57839b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils[_0xa57f('0x1e')](_0x5ffa2a,_0x49f201,![],null)[_0xa57f('0x11')](function(){return _0x57839b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}}else{if(_0x5ffa2a['disabled']){return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}else if(_0xc8d6bb[_0xa57f('0xf')]>0x0){if(_0x5ffa2a[_0xa57f('0x14')]){if(_0xc8d6bb[_0xa57f('0x10')]>0x0){if(moment(_0x5ffa2a[_0xa57f('0x15')])['add'](_0xc8d6bb[_0xa57f('0x10')],_0xa57f('0x1d'))>moment()){return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}else{return utils[_0xa57f('0x1e')](_0x5ffa2a,0x0,![],null)[_0xa57f('0x11')](function(){return utils[_0xa57f('0x1f')](_0x5ffa2a);})[_0xa57f('0x11')](function(){return _0x57839b(null,_0x5ffa2a);});}}else{return _0x57839b(null,![],{'message':_0xa57f('0x1b')});}}else{return utils['clearBlockUser'](_0x5ffa2a,0x0,![],null)['then'](function(){return utils[_0xa57f('0x1f')](_0x5ffa2a);})['then'](function(){return _0x57839b(null,_0x5ffa2a);})[_0xa57f('0x20')](function(_0x28269c){return _0x57839b(null,![],_0x28269c);});}}else{if(_0x5ffa2a['blocked']){return _0x57839b(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0xa57f('0x1f')](_0x5ffa2a)['then'](function(){return _0x57839b(null,_0x5ffa2a);});}}}});})[_0xa57f('0x20')](function(_0x3545c1){return _0x57839b(null,![],_0x3545c1);});}function sendServiceMail(_0x1a0d3f){return db[_0xa57f('0x21')][_0xa57f('0x22')]({'where':{'service':!![]},'attributes':['id',_0xa57f('0x19'),_0xa57f('0x23')],'include':[{'model':db[_0xa57f('0x24')],'as':_0xa57f('0x25'),'include':[{'model':db[_0xa57f('0x26')],'as':'CloudProvider'}]}]})[_0xa57f('0x11')](function(_0x1ea98e){if(!_0x1ea98e){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x4bd4fa=_0x1ea98e[_0xa57f('0x27')]();var _0x3dbb1e={'account':_0x4bd4fa,'message':_['merge']({'from':util[_0xa57f('0x28')]('\x22%s\x22\x20<%s>',_0x1ea98e[_0xa57f('0x19')],_0x1ea98e[_0xa57f('0x23')]||_0x1ea98e['Smtp'][_0xa57f('0x18')])},_0x1a0d3f)};return client[_0xa57f('0x29')](_0xa57f('0x2a'),_0x3dbb1e);})[_0xa57f('0x11')](function(_0x5626cf){if(_0x5626cf[_0xa57f('0x2b')]){throw new Error(util[_0xa57f('0x28')](_0xa57f('0x2c'),_0x5626cf['error'][_0xa57f('0x2d')]||JSON['stringify'](_0x5626cf['error'])));}return!![];});}function handleError(_0x2ad817,_0x911ba7,_0x55ae52){return _0x2ad817[_0xa57f('0x2e')](_0x911ba7||0x1f4)[_0xa57f('0x2f')]({'message':_0x55ae52?_0x55ae52['message']||_0x55ae52:''});}exports[_0xa57f('0x30')]=function(_0x49ce7c,_0x4c8058,_0x169ff9){passport['authenticate'](_0xa57f('0x31'),function(_0x4fd2c6,_0x432a41,_0x2df74c){var _0x29ce10=_0x4fd2c6||_0x2df74c;if(_0x29ce10){return handleError(_0x4c8058,0x191,_0x29ce10);}if(!_0x432a41){return handleError(_0x4c8058,0x194,{'message':_0xa57f('0x32')});}else{var _0x5018dd={'payload':{'id':_0x432a41['id'],'role':_0x432a41[_0xa57f('0x33')]},'options':{'expiresIn':0x15180}};return authService[_0xa57f('0x34')](_0x5018dd)[_0xa57f('0x11')](function(_0x2cea05){_0x4c8058[_0xa57f('0x35')]({'id':_0x432a41['id'],'token':_0x2cea05,'statusCall':'','isAlreadyLogged':_0x432a41[_0xa57f('0x36')]});});}})(_0x49ce7c,_0x4c8058,_0x169ff9);};exports['forgot']=function(_0x2e9741,_0x2088f4){if(!_0x2e9741[_0xa57f('0x37')]['email']){return handleError(_0x2088f4,0x1f4,{'message':_0xa57f('0x38')});}var _0x3a0f66=rs['generate']();_0x2e9741[_0xa57f('0x37')]['email']=_0x2e9741['body'][_0xa57f('0x23')]['trim']()[_0xa57f('0x39')]();var _0x395d95;return db[_0xa57f('0xd')]['findOne']({'where':{'id':0x1},'attributes':[_0xa57f('0xf'),_0xa57f('0x10')],'raw':!![]})[_0xa57f('0x11')](function(_0xe8ed0d){_0x395d95=_0xe8ed0d;return db['User'][_0xa57f('0x22')]({'where':{'email':_0x2e9741[_0xa57f('0x37')][_0xa57f('0x23')]}});})[_0xa57f('0x11')](function(_0x12e692){if(!_0x12e692){throw new Error(_0xa57f('0x3a'));}if(_0x12e692['disabled']){throw new Error(_0xa57f('0x3b'));}if(_0x12e692['blocked']){if(moment(_0x12e692[_0xa57f('0x15')])[_0xa57f('0x1c')](_0x395d95[_0xa57f('0x10')],'minutes')>moment()){throw new Error(_0xa57f('0x3c'));}else{_0x12e692[_0xa57f('0x14')]=![];_0x12e692[_0xa57f('0x15')]=null;}}_0x12e692['resetPasswordToken']=_0x3a0f66;_0x12e692[_0xa57f('0x3d')]=Date[_0xa57f('0x3e')]()+0x36ee80;return _0x12e692[_0xa57f('0x3f')]();})[_0xa57f('0x11')](function(){return sendServiceMail({'to':_0x2e9741[_0xa57f('0x37')][_0xa57f('0x23')],'subject':_0xa57f('0x40'),'text':_0xa57f('0x41')+_0xa57f('0x42')+'https://'+_0x2e9741['headers']['host']+_0xa57f('0x43')+_0x3a0f66+'\x0a\x0a'+_0xa57f('0x44')});})[_0xa57f('0x11')](function(){_0x2088f4[_0xa57f('0x2e')](0xc8)[_0xa57f('0x2f')]({'message':_0xa57f('0x45')});})[_0xa57f('0x20')](function(_0x4301fc){return handleError(_0x2088f4,0x1f4,_0x4301fc);});};exports[_0xa57f('0x46')]=function(_0x2dbcd7,_0x47da03){return db['User'][_0xa57f('0x22')]({'where':{'resetPasswordToken':_0x2dbcd7[_0xa57f('0x47')][_0xa57f('0x48')],'resetPasswordExpires':{'$gt':Date[_0xa57f('0x3e')]()}}})[_0xa57f('0x11')](function(_0x45e0df){if(!_0x45e0df){throw new Error(_0xa57f('0x49'));}return db[_0xa57f('0xd')]['findOne']({'attributes':['id',_0xa57f('0x4a'),'enforcePasswordHistory',_0xa57f('0x4b')]})[_0xa57f('0x11')](function(_0x46c8f6){if(_0x46c8f6[_0xa57f('0x4a')])authService['validatePasswordPattern'](_0x2dbcd7['body'][_0xa57f('0x12')]);if(!_0x46c8f6['enforcePasswordHistory']||!_0x45e0df[_0xa57f('0x4c')])return _0x45e0df;authService['validatePasswordHistory'](_0x2dbcd7[_0xa57f('0x37')][_0xa57f('0x12')],_0x45e0df[_0xa57f('0x4c')],_0x46c8f6[_0xa57f('0x4b')]);return _0x45e0df;})['then'](function(){_0x45e0df[_0xa57f('0x12')]=_0x2dbcd7[_0xa57f('0x37')][_0xa57f('0x12')];_0x45e0df[_0xa57f('0x4d')]=null;_0x45e0df[_0xa57f('0x3d')]=null;return _0x45e0df['save']();});})[_0xa57f('0x11')](function(){_0x47da03[_0xa57f('0x2e')](0xc8)['send']({'message':_0xa57f('0x4e')});})[_0xa57f('0x20')](function(_0x279cee){return handleError(_0x47da03,0x1f4,_0x279cee);});};passport['use'](_0xa57f('0x31'),new LocalStrategy({'usernameField':_0xa57f('0x19'),'passwordField':_0xa57f('0x12')},function(_0x19ea0d,_0x25b5c8,_0x1d728b){return localAuthenticate(db['User'],_0x19ea0d,_0x25b5c8,_0x1d728b);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 65111be..533b5db 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 _0x840c=['express','Router','./authLocal.controller','login','/forgot','forgot','/reset/:token','reset'];(function(_0x54295c,_0xb3d2f7){var _0x515533=function(_0x550118){while(--_0x550118){_0x54295c['push'](_0x54295c['shift']());}};_0x515533(++_0xb3d2f7);}(_0x840c,0x70));var _0xc840=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x840c[_0x220dbb];return _0x2b77de;};'use strict';var express=require(_0xc840('0x0'));var router=express[_0xc840('0x1')]();var controller=require(_0xc840('0x2'));router['post']('/',controller[_0xc840('0x3')]);router['post'](_0xc840('0x4'),controller[_0xc840('0x5')]);router['post'](_0xc840('0x6'),controller[_0xc840('0x7')]);module['exports']=router;
\ No newline at end of file
+var _0x5788=['login','/forgot','/reset/:token','reset','exports','express','Router','post'];(function(_0xdb5808,_0x58c067){var _0x111072=function(_0x3c3f27){while(--_0x3c3f27){_0xdb5808['push'](_0xdb5808['shift']());}};_0x111072(++_0x58c067);}(_0x5788,0x14d));var _0x8578=function(_0x41b376,_0x295e7b){_0x41b376=_0x41b376-0x0;var _0x1a01b3=_0x5788[_0x41b376];return _0x1a01b3;};'use strict';var express=require(_0x8578('0x0'));var router=express[_0x8578('0x1')]();var controller=require('./authLocal.controller');router[_0x8578('0x2')]('/',controller[_0x8578('0x3')]);router[_0x8578('0x2')](_0x8578('0x4'),controller['forgot']);router['post'](_0x8578('0x5'),controller[_0x8578('0x6')]);module[_0x8578('0x7')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e78f64f..ce9418a 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 _0x824b=['exports','STRING','INTEGER','sequelize'];(function(_0x261357,_0x1e92d1){var _0x20e25d=function(_0x4c48ba){while(--_0x4c48ba){_0x261357['push'](_0x261357['shift']());}};_0x20e25d(++_0x1e92d1);}(_0x824b,0xa7));var _0xb824=function(_0x10fd8f,_0x1dda79){_0x10fd8f=_0x10fd8f-0x0;var _0xaff74a=_0x824b[_0x10fd8f];return _0xaff74a;};'use strict';var Sequelize=require(_0xb824('0x0'));module[_0xb824('0x1')]={'name':{'type':Sequelize[_0xb824('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xb824('0x2')]},'description':{'type':Sequelize[_0xb824('0x2')]},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'timeout':{'type':Sequelize[_0xb824('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x9662=['exports','STRING','BOOLEAN','sequelize'];(function(_0x4ed4d2,_0x47acf7){var _0x15ae2e=function(_0x3199f0){while(--_0x3199f0){_0x4ed4d2['push'](_0x4ed4d2['shift']());}};_0x15ae2e(++_0x47acf7);}(_0x9662,0x77));var _0x2966=function(_0x3395c3,_0x2125a4){_0x3395c3=_0x3395c3-0x0;var _0x2328cc=_0x9662[_0x3395c3];return _0x2328cc;};'use strict';var Sequelize=require(_0x2966('0x0'));module[_0x2966('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x2966('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x2966('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 774a638..84bd174 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 _0xa5ea=['../../mysqldb','end','status','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','Automation','findAll','catch','show','include','options','find','create','body','params','Condition','addConditions','ids','getConditions','nolimit','addActions','Action','omit','getActions','findOne','eml-format','rimraf','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util'];(function(_0x307d86,_0x9264f2){var _0x361745=function(_0x1b64e1){while(--_0x1b64e1){_0x307d86['push'](_0x307d86['shift']());}};_0x361745(++_0x9264f2);}(_0xa5ea,0x186));var _0xaa5e=function(_0x1e63d1,_0x544ce6){_0x1e63d1=_0x1e63d1-0x0;var _0x12d5a8=_0xa5ea[_0x1e63d1];return _0x12d5a8;};'use strict';var emlformat=require(_0xaa5e('0x0'));var rimraf=require(_0xaa5e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa5e('0x2'));var BPromise=require(_0xaa5e('0x3'));var Mustache=require(_0xaa5e('0x4'));var util=require('util');var path=require(_0xaa5e('0x5'));var sox=require('sox');var csv=require(_0xaa5e('0x6'));var ejs=require(_0xaa5e('0x7'));var fs=require('fs');var fs_extra=require(_0xaa5e('0x8'));var _=require(_0xaa5e('0x9'));var squel=require('squel');var crypto=require(_0xaa5e('0xa'));var jsforce=require(_0xaa5e('0xb'));var deskjs=require(_0xaa5e('0xc'));var toCsv=require(_0xaa5e('0x6'));var querystring=require(_0xaa5e('0xd'));var Papa=require('papaparse');var Redis=require(_0xaa5e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xaa5e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaa5e('0x10'));var logger=require('../../config/logger')('api');var utils=require(_0xaa5e('0x11'));var config=require(_0xaa5e('0x12'));var licenseUtil=require(_0xaa5e('0x13'));var db=require(_0xaa5e('0x14'))['db'];function respondWithStatusCode(_0x24b1fd,_0x4a4057){_0x4a4057=_0x4a4057||0xcc;return function(_0x1a5ed9){if(_0x1a5ed9){return _0x24b1fd['sendStatus'](_0x4a4057);}return _0x24b1fd['status'](_0x4a4057)[_0xaa5e('0x15')]();};}function respondWithResult(_0x4ecc79,_0x27cf09){_0x27cf09=_0x27cf09||0xc8;return function(_0x21d2c3){if(_0x21d2c3){return _0x4ecc79[_0xaa5e('0x16')](_0x27cf09)[_0xaa5e('0x17')](_0x21d2c3);}};}function respondWithFilteredResult(_0xb272a,_0x3f4e16){return function(_0x5171c6){if(_0x5171c6){var _0x397873=typeof _0x3f4e16[_0xaa5e('0x18')]===_0xaa5e('0x19')&&typeof _0x3f4e16[_0xaa5e('0x1a')]===_0xaa5e('0x19');var _0x3df07c=_0x5171c6[_0xaa5e('0x1b')];var _0x12f455=_0x397873?0x0:_0x3f4e16[_0xaa5e('0x18')];var _0x51ec98=_0x397873?_0x5171c6[_0xaa5e('0x1b')]:_0x3f4e16[_0xaa5e('0x18')]+_0x3f4e16[_0xaa5e('0x1a')];var _0x21490d;if(_0x51ec98>=_0x3df07c){_0x51ec98=_0x3df07c;_0x21490d=0xc8;}else{_0x21490d=0xce;}_0xb272a[_0xaa5e('0x16')](_0x21490d);return _0xb272a[_0xaa5e('0x1c')](_0xaa5e('0x1d'),_0x12f455+'-'+_0x51ec98+'/'+_0x3df07c)[_0xaa5e('0x17')](_0x5171c6);}return null;};}function patchUpdates(_0x1a0853){return function(_0x496844){try{jsonpatch['apply'](_0x496844,_0x1a0853,!![]);}catch(_0x46eb83){return BPromise[_0xaa5e('0x1e')](_0x46eb83);}return _0x496844[_0xaa5e('0x1f')]();};}function saveUpdates(_0x3a78e7,_0x2908a2){return function(_0x323963){if(_0x323963){return _0x323963[_0xaa5e('0x20')](_0x3a78e7)[_0xaa5e('0x21')](function(_0x3030c7){return _0x3030c7;});}return null;};}function removeEntity(_0xf696ae,_0x58aded){return function(_0x2757df){if(_0x2757df){return _0x2757df[_0xaa5e('0x22')]()[_0xaa5e('0x21')](function(){_0xf696ae[_0xaa5e('0x16')](0xcc)[_0xaa5e('0x15')]();});}};}function handleEntityNotFound(_0x4af6ea,_0xd10360){return function(_0x250b73){if(!_0x250b73){_0x4af6ea[_0xaa5e('0x23')](0x194);}return _0x250b73;};}function handleError(_0x3212f2,_0x340d78){_0x340d78=_0x340d78||0x1f4;return function(_0x3ef033){logger[_0xaa5e('0x24')](_0x3ef033['stack']);if(_0x3ef033['name']){delete _0x3ef033[_0xaa5e('0x25')];}_0x3212f2[_0xaa5e('0x16')](_0x340d78)[_0xaa5e('0x26')](_0x3ef033);};}exports[_0xaa5e('0x27')]=function(_0x588d56,_0x462c26){var _0x1cd772={},_0x44888d={},_0x2dfc8b={'count':0x0,'rows':[]};var _0x39f3c9=_[_0xaa5e('0x28')](db['Automation'][_0xaa5e('0x29')],function(_0x2ff81c){return{'name':_0x2ff81c[_0xaa5e('0x2a')],'type':_0x2ff81c[_0xaa5e('0x2b')][_0xaa5e('0x2c')]};});_0x44888d[_0xaa5e('0x2d')]=_[_0xaa5e('0x28')](_0x39f3c9,_0xaa5e('0x25'));_0x44888d[_0xaa5e('0x2e')]=_[_0xaa5e('0x2f')](_0x588d56[_0xaa5e('0x2e')]);_0x44888d[_0xaa5e('0x30')]=_[_0xaa5e('0x31')](_0x44888d[_0xaa5e('0x2d')],_0x44888d['query']);_0x1cd772[_0xaa5e('0x32')]=_[_0xaa5e('0x31')](_0x44888d['model'],qs[_0xaa5e('0x33')](_0x588d56[_0xaa5e('0x2e')][_0xaa5e('0x33')]));_0x1cd772[_0xaa5e('0x32')]=_0x1cd772[_0xaa5e('0x32')][_0xaa5e('0x34')]?_0x1cd772[_0xaa5e('0x32')]:_0x44888d[_0xaa5e('0x2d')];if(!_0x588d56[_0xaa5e('0x2e')][_0xaa5e('0x35')]('nolimit')){_0x1cd772['limit']=qs['limit'](_0x588d56['query']['limit']);_0x1cd772['offset']=qs[_0xaa5e('0x18')](_0x588d56[_0xaa5e('0x2e')][_0xaa5e('0x18')]);}_0x1cd772[_0xaa5e('0x36')]=qs[_0xaa5e('0x37')](_0x588d56[_0xaa5e('0x2e')][_0xaa5e('0x37')]);_0x1cd772['where']=qs['filters'](_[_0xaa5e('0x38')](_0x588d56[_0xaa5e('0x2e')],_0x44888d[_0xaa5e('0x30')]),_0x39f3c9);if(_0x588d56[_0xaa5e('0x2e')][_0xaa5e('0x39')]){_0x1cd772[_0xaa5e('0x3a')]=_[_0xaa5e('0x3b')](_0x1cd772[_0xaa5e('0x3a')],{'$or':_[_0xaa5e('0x28')](_0x39f3c9,function(_0x223f2c){if(_0x223f2c[_0xaa5e('0x2b')]!==_0xaa5e('0x3c')){var _0x1bc253={};_0x1bc253[_0x223f2c[_0xaa5e('0x25')]]={'$like':'%'+_0x588d56['query'][_0xaa5e('0x39')]+'%'};return _0x1bc253;}})});}_0x1cd772=_[_0xaa5e('0x3b')]({},_0x1cd772,_0x588d56['options']);var _0xde949d={'where':_0x1cd772[_0xaa5e('0x3a')]};return db['Automation'][_0xaa5e('0x1b')](_0xde949d)[_0xaa5e('0x21')](function(_0x5b58bb){_0x2dfc8b['count']=_0x5b58bb;if(_0x588d56[_0xaa5e('0x2e')][_0xaa5e('0x3d')]){_0x1cd772['include']=[{'all':!![]}];}return db[_0xaa5e('0x3e')][_0xaa5e('0x3f')](_0x1cd772);})['then'](function(_0x18fdac){_0x2dfc8b['rows']=_0x18fdac;return _0x2dfc8b;})[_0xaa5e('0x21')](respondWithFilteredResult(_0x462c26,_0x1cd772))[_0xaa5e('0x40')](handleError(_0x462c26,null));};exports[_0xaa5e('0x41')]=function(_0x59c162,_0x182fdc){var _0x2be7fd={'raw':![],'where':{'id':_0x59c162['params']['id']}},_0xec50e5={};_0xec50e5[_0xaa5e('0x2d')]=_[_0xaa5e('0x2f')](db[_0xaa5e('0x3e')][_0xaa5e('0x29')]);_0xec50e5[_0xaa5e('0x2e')]=_[_0xaa5e('0x2f')](_0x59c162[_0xaa5e('0x2e')]);_0xec50e5[_0xaa5e('0x30')]=_['intersection'](_0xec50e5[_0xaa5e('0x2d')],_0xec50e5['query']);_0x2be7fd[_0xaa5e('0x32')]=_[_0xaa5e('0x31')](_0xec50e5[_0xaa5e('0x2d')],qs[_0xaa5e('0x33')](_0x59c162[_0xaa5e('0x2e')][_0xaa5e('0x33')]));_0x2be7fd[_0xaa5e('0x32')]=_0x2be7fd[_0xaa5e('0x32')][_0xaa5e('0x34')]?_0x2be7fd[_0xaa5e('0x32')]:_0xec50e5['model'];if(_0x59c162[_0xaa5e('0x2e')][_0xaa5e('0x3d')]){_0x2be7fd[_0xaa5e('0x42')]=[{'all':!![]}];}_0x2be7fd=_['merge']({},_0x2be7fd,_0x59c162[_0xaa5e('0x43')]);return db[_0xaa5e('0x3e')][_0xaa5e('0x44')](_0x2be7fd)[_0xaa5e('0x21')](handleEntityNotFound(_0x182fdc,null))[_0xaa5e('0x21')](respondWithResult(_0x182fdc,null))[_0xaa5e('0x40')](handleError(_0x182fdc,null));};exports[_0xaa5e('0x45')]=function(_0x3f6770,_0x457110){return db['Automation']['create'](_0x3f6770['body'],{})[_0xaa5e('0x21')](respondWithResult(_0x457110,0xc9))[_0xaa5e('0x40')](handleError(_0x457110,null));};exports['update']=function(_0x54cf13,_0x21ed5a){if(_0x54cf13[_0xaa5e('0x46')]['id']){delete _0x54cf13[_0xaa5e('0x46')]['id'];}return db[_0xaa5e('0x3e')][_0xaa5e('0x44')]({'where':{'id':_0x54cf13[_0xaa5e('0x47')]['id']}})[_0xaa5e('0x21')](handleEntityNotFound(_0x21ed5a,null))[_0xaa5e('0x21')](saveUpdates(_0x54cf13[_0xaa5e('0x46')],null))[_0xaa5e('0x21')](respondWithResult(_0x21ed5a,null))['catch'](handleError(_0x21ed5a,null));};exports['destroy']=function(_0x2167c0,_0x27c1ea){return db[_0xaa5e('0x3e')][_0xaa5e('0x44')]({'where':{'id':_0x2167c0['params']['id']}})[_0xaa5e('0x21')](handleEntityNotFound(_0x27c1ea,null))['then'](removeEntity(_0x27c1ea,null))['catch'](handleError(_0x27c1ea,null));};exports['addConditions']=function(_0x5c8375,_0x596d56,_0x5e1d33){return db[_0xaa5e('0x48')][_0xaa5e('0x44')]({'where':{'id':_0x5c8375[_0xaa5e('0x47')]['id']}})[_0xaa5e('0x21')](handleEntityNotFound(_0x596d56,null))[_0xaa5e('0x21')](function(_0x615eb7){if(_0x615eb7){return _0x615eb7[_0xaa5e('0x49')](_0x5c8375[_0xaa5e('0x46')][_0xaa5e('0x4a')],_['omit'](_0x5c8375[_0xaa5e('0x46')],[_0xaa5e('0x4a'),'id'])||{});}})[_0xaa5e('0x21')](respondWithResult(_0x596d56,null))[_0xaa5e('0x40')](handleError(_0x596d56,null));};exports[_0xaa5e('0x4b')]=function(_0x2130e8,_0x2f372f,_0x43b1d9){var _0x527c08={};var _0x4f2809={};var _0x152851;var _0x4d61c4;return db[_0xaa5e('0x3e')]['findOne']({'where':{'id':_0x2130e8['params']['id']}})[_0xaa5e('0x21')](handleEntityNotFound(_0x2f372f,null))[_0xaa5e('0x21')](function(_0x35c93a){if(_0x35c93a){_0x152851=_0x35c93a;_0x4f2809['model']=_[_0xaa5e('0x2f')](db[_0xaa5e('0x48')]['rawAttributes']);_0x4f2809[_0xaa5e('0x2e')]=_['keys'](_0x2130e8[_0xaa5e('0x2e')]);_0x4f2809[_0xaa5e('0x30')]=_[_0xaa5e('0x31')](_0x4f2809['model'],_0x4f2809[_0xaa5e('0x2e')]);_0x527c08[_0xaa5e('0x32')]=_[_0xaa5e('0x31')](_0x4f2809[_0xaa5e('0x2d')],qs['fields'](_0x2130e8[_0xaa5e('0x2e')][_0xaa5e('0x33')]));_0x527c08[_0xaa5e('0x32')]=_0x527c08['attributes'][_0xaa5e('0x34')]?_0x527c08[_0xaa5e('0x32')]:_0x4f2809['model'];_0x527c08['order']=qs[_0xaa5e('0x37')](_0x2130e8[_0xaa5e('0x2e')][_0xaa5e('0x37')]);_0x527c08[_0xaa5e('0x3a')]=qs[_0xaa5e('0x30')](_[_0xaa5e('0x38')](_0x2130e8['query'],_0x4f2809[_0xaa5e('0x30')]));if(_0x2130e8[_0xaa5e('0x2e')]['filter']){_0x527c08['where']=_[_0xaa5e('0x3b')](_0x527c08['where'],{'$or':_[_0xaa5e('0x28')](_0x527c08[_0xaa5e('0x32')],function(_0x1bd929){var _0x3ec969={};_0x3ec969[_0x1bd929]={'$like':'%'+_0x2130e8['query'][_0xaa5e('0x39')]+'%'};return _0x3ec969;})});}_0x527c08=_[_0xaa5e('0x3b')]({},_0x527c08,_0x2130e8['options']);return _0x152851[_0xaa5e('0x4b')](_0x527c08);}})[_0xaa5e('0x21')](function(_0x46ed0d){if(_0x46ed0d){_0x4d61c4=_0x46ed0d[_0xaa5e('0x34')];if(!_0x2130e8['query'][_0xaa5e('0x35')](_0xaa5e('0x4c'))){_0x527c08['limit']=qs[_0xaa5e('0x1a')](_0x2130e8[_0xaa5e('0x2e')][_0xaa5e('0x1a')]);_0x527c08[_0xaa5e('0x18')]=qs['offset'](_0x2130e8[_0xaa5e('0x2e')][_0xaa5e('0x18')]);}return _0x152851['getConditions'](_0x527c08);}})['then'](function(_0x576251){if(_0x576251){return _0x576251?{'count':_0x4d61c4,'rows':_0x576251}:null;}})[_0xaa5e('0x21')](respondWithResult(_0x2f372f,null))[_0xaa5e('0x40')](handleError(_0x2f372f,null));};exports[_0xaa5e('0x4d')]=function(_0x587587,_0x40908a,_0x55289c){return db[_0xaa5e('0x4e')][_0xaa5e('0x44')]({'where':{'id':_0x587587[_0xaa5e('0x47')]['id']}})[_0xaa5e('0x21')](handleEntityNotFound(_0x40908a,null))[_0xaa5e('0x21')](function(_0x4cb275){if(_0x4cb275){return _0x4cb275[_0xaa5e('0x4d')](_0x587587['body'][_0xaa5e('0x4a')],_[_0xaa5e('0x4f')](_0x587587[_0xaa5e('0x46')],[_0xaa5e('0x4a'),'id'])||{});}})[_0xaa5e('0x21')](respondWithResult(_0x40908a,null))[_0xaa5e('0x40')](handleError(_0x40908a,null));};exports[_0xaa5e('0x50')]=function(_0x51e283,_0x599aad,_0x1bb708){var _0xd73dc4={};var _0x52f5ee={};var _0x493366;var _0x1f6bda;return db[_0xaa5e('0x3e')][_0xaa5e('0x51')]({'where':{'id':_0x51e283[_0xaa5e('0x47')]['id']}})[_0xaa5e('0x21')](handleEntityNotFound(_0x599aad,null))['then'](function(_0x5fc8ab){if(_0x5fc8ab){_0x493366=_0x5fc8ab;_0x52f5ee[_0xaa5e('0x2d')]=_['keys'](db['Action']['rawAttributes']);_0x52f5ee[_0xaa5e('0x2e')]=_['keys'](_0x51e283[_0xaa5e('0x2e')]);_0x52f5ee['filters']=_[_0xaa5e('0x31')](_0x52f5ee[_0xaa5e('0x2d')],_0x52f5ee[_0xaa5e('0x2e')]);_0xd73dc4[_0xaa5e('0x32')]=_['intersection'](_0x52f5ee['model'],qs[_0xaa5e('0x33')](_0x51e283[_0xaa5e('0x2e')]['fields']));_0xd73dc4[_0xaa5e('0x32')]=_0xd73dc4[_0xaa5e('0x32')][_0xaa5e('0x34')]?_0xd73dc4['attributes']:_0x52f5ee[_0xaa5e('0x2d')];_0xd73dc4['order']=qs[_0xaa5e('0x37')](_0x51e283[_0xaa5e('0x2e')]['sort']);_0xd73dc4['where']=qs[_0xaa5e('0x30')](_[_0xaa5e('0x38')](_0x51e283[_0xaa5e('0x2e')],_0x52f5ee[_0xaa5e('0x30')]));if(_0x51e283[_0xaa5e('0x2e')]['filter']){_0xd73dc4['where']=_[_0xaa5e('0x3b')](_0xd73dc4[_0xaa5e('0x3a')],{'$or':_[_0xaa5e('0x28')](_0xd73dc4[_0xaa5e('0x32')],function(_0x291d80){var _0x4b9912={};_0x4b9912[_0x291d80]={'$like':'%'+_0x51e283['query'][_0xaa5e('0x39')]+'%'};return _0x4b9912;})});}_0xd73dc4=_['merge']({},_0xd73dc4,_0x51e283['options']);return _0x493366['getActions'](_0xd73dc4);}})[_0xaa5e('0x21')](function(_0x34bb3f){if(_0x34bb3f){_0x1f6bda=_0x34bb3f[_0xaa5e('0x34')];if(!_0x51e283['query'][_0xaa5e('0x35')](_0xaa5e('0x4c'))){_0xd73dc4[_0xaa5e('0x1a')]=qs['limit'](_0x51e283['query'][_0xaa5e('0x1a')]);_0xd73dc4[_0xaa5e('0x18')]=qs[_0xaa5e('0x18')](_0x51e283[_0xaa5e('0x2e')][_0xaa5e('0x18')]);}return _0x493366[_0xaa5e('0x50')](_0xd73dc4);}})[_0xaa5e('0x21')](function(_0x272c2c){if(_0x272c2c){return _0x272c2c?{'count':_0x1f6bda,'rows':_0x272c2c}:null;}})['then'](respondWithResult(_0x599aad,null))[_0xaa5e('0x40')](handleError(_0x599aad,null));};
\ No newline at end of file
+var _0x7548=['limit','count','offset','set','apply','reject','save','then','error','name','index','map','Automation','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','sort','pick','filter','merge','where','VIRTUAL','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','create','body','update','find','addConditions','ids','getConditions','findOne','Condition','hasOwnProperty','nolimit','Action','addActions','omit','getActions','order','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x7548,0x136));var _0x8754=function(_0x4e1993,_0x89ccae){_0x4e1993=_0x4e1993-0x0;var _0x27f61f=_0x7548[_0x4e1993];return _0x27f61f;};'use strict';var emlformat=require(_0x8754('0x0'));var rimraf=require(_0x8754('0x1'));var zipdir=require(_0x8754('0x2'));var jsonpatch=require(_0x8754('0x3'));var rp=require(_0x8754('0x4'));var moment=require('moment');var BPromise=require(_0x8754('0x5'));var Mustache=require(_0x8754('0x6'));var util=require(_0x8754('0x7'));var path=require(_0x8754('0x8'));var sox=require('sox');var csv=require(_0x8754('0x9'));var ejs=require(_0x8754('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x8754('0xb'));var squel=require('squel');var crypto=require(_0x8754('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8754('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8754('0xe'));var Papa=require(_0x8754('0xf'));var Redis=require(_0x8754('0x10'));var authService=require(_0x8754('0x11'));var qs=require(_0x8754('0x12'));var as=require(_0x8754('0x13'));var hardwareService=require(_0x8754('0x14'));var logger=require(_0x8754('0x15'))('api');var utils=require(_0x8754('0x16'));var config=require(_0x8754('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x8754('0x18'))['db'];function respondWithStatusCode(_0x9847ae,_0x2564a8){_0x2564a8=_0x2564a8||0xcc;return function(_0xe4e84f){if(_0xe4e84f){return _0x9847ae[_0x8754('0x19')](_0x2564a8);}return _0x9847ae[_0x8754('0x1a')](_0x2564a8)[_0x8754('0x1b')]();};}function respondWithResult(_0x5ad35e,_0x316f19){_0x316f19=_0x316f19||0xc8;return function(_0x3f9457){if(_0x3f9457){return _0x5ad35e[_0x8754('0x1a')](_0x316f19)[_0x8754('0x1c')](_0x3f9457);}};}function respondWithFilteredResult(_0x1b4280,_0x15dd5f){return function(_0x229652){if(_0x229652){var _0x3ea153=typeof _0x15dd5f['offset']===_0x8754('0x1d')&&typeof _0x15dd5f[_0x8754('0x1e')]===_0x8754('0x1d');var _0x293ff9=_0x229652[_0x8754('0x1f')];var _0x4897c5=_0x3ea153?0x0:_0x15dd5f['offset'];var _0x599b02=_0x3ea153?_0x229652['count']:_0x15dd5f[_0x8754('0x20')]+_0x15dd5f[_0x8754('0x1e')];var _0x185cd1;if(_0x599b02>=_0x293ff9){_0x599b02=_0x293ff9;_0x185cd1=0xc8;}else{_0x185cd1=0xce;}_0x1b4280[_0x8754('0x1a')](_0x185cd1);return _0x1b4280[_0x8754('0x21')]('Content-Range',_0x4897c5+'-'+_0x599b02+'/'+_0x293ff9)[_0x8754('0x1c')](_0x229652);}return null;};}function patchUpdates(_0x47f719){return function(_0x3a6ef4){try{jsonpatch[_0x8754('0x22')](_0x3a6ef4,_0x47f719,!![]);}catch(_0x4ed401){return BPromise[_0x8754('0x23')](_0x4ed401);}return _0x3a6ef4[_0x8754('0x24')]();};}function saveUpdates(_0x2ff996,_0x59fbd8){return function(_0x148fad){if(_0x148fad){return _0x148fad['update'](_0x2ff996)[_0x8754('0x25')](function(_0x5543a7){return _0x5543a7;});}return null;};}function removeEntity(_0x58f065,_0x272b7f){return function(_0x4db513){if(_0x4db513){return _0x4db513['destroy']()[_0x8754('0x25')](function(){_0x58f065[_0x8754('0x1a')](0xcc)[_0x8754('0x1b')]();});}};}function handleEntityNotFound(_0x533425,_0x20c1c9){return function(_0x11fd20){if(!_0x11fd20){_0x533425[_0x8754('0x19')](0x194);}return _0x11fd20;};}function handleError(_0x23e780,_0x5d77b2){_0x5d77b2=_0x5d77b2||0x1f4;return function(_0x984fd1){logger[_0x8754('0x26')](_0x984fd1['stack']);if(_0x984fd1[_0x8754('0x27')]){delete _0x984fd1['name'];}_0x23e780[_0x8754('0x1a')](_0x5d77b2)['send'](_0x984fd1);};}exports[_0x8754('0x28')]=function(_0x11290e,_0x57e625){var _0x5b1184={},_0x4376bb={},_0x495716={'count':0x0,'rows':[]};var _0x5a5f84=_[_0x8754('0x29')](db[_0x8754('0x2a')]['rawAttributes'],function(_0x47a2a0){return{'name':_0x47a2a0[_0x8754('0x2b')],'type':_0x47a2a0[_0x8754('0x2c')][_0x8754('0x2d')]};});_0x4376bb[_0x8754('0x2e')]=_[_0x8754('0x29')](_0x5a5f84,_0x8754('0x27'));_0x4376bb[_0x8754('0x2f')]=_[_0x8754('0x30')](_0x11290e[_0x8754('0x2f')]);_0x4376bb[_0x8754('0x31')]=_[_0x8754('0x32')](_0x4376bb[_0x8754('0x2e')],_0x4376bb['query']);_0x5b1184['attributes']=_[_0x8754('0x32')](_0x4376bb[_0x8754('0x2e')],qs['fields'](_0x11290e[_0x8754('0x2f')][_0x8754('0x33')]));_0x5b1184[_0x8754('0x34')]=_0x5b1184[_0x8754('0x34')]['length']?_0x5b1184[_0x8754('0x34')]:_0x4376bb[_0x8754('0x2e')];if(!_0x11290e[_0x8754('0x2f')]['hasOwnProperty']('nolimit')){_0x5b1184[_0x8754('0x1e')]=qs[_0x8754('0x1e')](_0x11290e['query']['limit']);_0x5b1184[_0x8754('0x20')]=qs[_0x8754('0x20')](_0x11290e['query']['offset']);}_0x5b1184['order']=qs['sort'](_0x11290e['query'][_0x8754('0x35')]);_0x5b1184['where']=qs[_0x8754('0x31')](_[_0x8754('0x36')](_0x11290e[_0x8754('0x2f')],_0x4376bb['filters']),_0x5a5f84);if(_0x11290e[_0x8754('0x2f')][_0x8754('0x37')]){_0x5b1184['where']=_[_0x8754('0x38')](_0x5b1184[_0x8754('0x39')],{'$or':_[_0x8754('0x29')](_0x5a5f84,function(_0x566240){if(_0x566240[_0x8754('0x2c')]!==_0x8754('0x3a')){var _0x518851={};_0x518851[_0x566240[_0x8754('0x27')]]={'$like':'%'+_0x11290e[_0x8754('0x2f')][_0x8754('0x37')]+'%'};return _0x518851;}})});}_0x5b1184=_[_0x8754('0x38')]({},_0x5b1184,_0x11290e[_0x8754('0x3b')]);var _0x36288e={'where':_0x5b1184['where']};return db[_0x8754('0x2a')][_0x8754('0x1f')](_0x36288e)[_0x8754('0x25')](function(_0x2f00ac){_0x495716['count']=_0x2f00ac;if(_0x11290e[_0x8754('0x2f')]['includeAll']){_0x5b1184['include']=[{'all':!![]}];}return db[_0x8754('0x2a')][_0x8754('0x3c')](_0x5b1184);})[_0x8754('0x25')](function(_0x972d6a){_0x495716[_0x8754('0x3d')]=_0x972d6a;return _0x495716;})['then'](respondWithFilteredResult(_0x57e625,_0x5b1184))[_0x8754('0x3e')](handleError(_0x57e625,null));};exports[_0x8754('0x3f')]=function(_0x566890,_0x56779b){var _0x4a6258={'raw':![],'where':{'id':_0x566890[_0x8754('0x40')]['id']}},_0x436859={};_0x436859['model']=_['keys'](db['Automation'][_0x8754('0x41')]);_0x436859[_0x8754('0x2f')]=_['keys'](_0x566890[_0x8754('0x2f')]);_0x436859['filters']=_['intersection'](_0x436859[_0x8754('0x2e')],_0x436859[_0x8754('0x2f')]);_0x4a6258[_0x8754('0x34')]=_[_0x8754('0x32')](_0x436859['model'],qs[_0x8754('0x33')](_0x566890[_0x8754('0x2f')][_0x8754('0x33')]));_0x4a6258['attributes']=_0x4a6258['attributes'][_0x8754('0x42')]?_0x4a6258[_0x8754('0x34')]:_0x436859[_0x8754('0x2e')];if(_0x566890['query'][_0x8754('0x43')]){_0x4a6258[_0x8754('0x44')]=[{'all':!![]}];}_0x4a6258=_[_0x8754('0x38')]({},_0x4a6258,_0x566890['options']);return db[_0x8754('0x2a')]['find'](_0x4a6258)[_0x8754('0x25')](handleEntityNotFound(_0x56779b,null))[_0x8754('0x25')](respondWithResult(_0x56779b,null))[_0x8754('0x3e')](handleError(_0x56779b,null));};exports[_0x8754('0x45')]=function(_0x4491b2,_0x3dfd4a){return db['Automation'][_0x8754('0x45')](_0x4491b2[_0x8754('0x46')],{})[_0x8754('0x25')](respondWithResult(_0x3dfd4a,0xc9))[_0x8754('0x3e')](handleError(_0x3dfd4a,null));};exports[_0x8754('0x47')]=function(_0x2bd108,_0x39496e){if(_0x2bd108['body']['id']){delete _0x2bd108[_0x8754('0x46')]['id'];}return db['Automation'][_0x8754('0x48')]({'where':{'id':_0x2bd108[_0x8754('0x40')]['id']}})[_0x8754('0x25')](handleEntityNotFound(_0x39496e,null))['then'](saveUpdates(_0x2bd108[_0x8754('0x46')],null))['then'](respondWithResult(_0x39496e,null))['catch'](handleError(_0x39496e,null));};exports['destroy']=function(_0x4b19c6,_0x2bfcf9){return db[_0x8754('0x2a')]['find']({'where':{'id':_0x4b19c6['params']['id']}})[_0x8754('0x25')](handleEntityNotFound(_0x2bfcf9,null))[_0x8754('0x25')](removeEntity(_0x2bfcf9,null))[_0x8754('0x3e')](handleError(_0x2bfcf9,null));};exports[_0x8754('0x49')]=function(_0x4691f8,_0x4abef3,_0x230352){return db['Condition'][_0x8754('0x48')]({'where':{'id':_0x4691f8[_0x8754('0x40')]['id']}})['then'](handleEntityNotFound(_0x4abef3,null))[_0x8754('0x25')](function(_0x497721){if(_0x497721){return _0x497721[_0x8754('0x49')](_0x4691f8[_0x8754('0x46')]['ids'],_['omit'](_0x4691f8[_0x8754('0x46')],[_0x8754('0x4a'),'id'])||{});}})[_0x8754('0x25')](respondWithResult(_0x4abef3,null))[_0x8754('0x3e')](handleError(_0x4abef3,null));};exports[_0x8754('0x4b')]=function(_0x4a38c3,_0x5684cb,_0x247db0){var _0x5ec383={};var _0x16c704={};var _0x2f2b78;var _0xbfd49d;return db[_0x8754('0x2a')][_0x8754('0x4c')]({'where':{'id':_0x4a38c3['params']['id']}})[_0x8754('0x25')](handleEntityNotFound(_0x5684cb,null))[_0x8754('0x25')](function(_0xbd98ab){if(_0xbd98ab){_0x2f2b78=_0xbd98ab;_0x16c704[_0x8754('0x2e')]=_[_0x8754('0x30')](db[_0x8754('0x4d')]['rawAttributes']);_0x16c704[_0x8754('0x2f')]=_[_0x8754('0x30')](_0x4a38c3[_0x8754('0x2f')]);_0x16c704[_0x8754('0x31')]=_[_0x8754('0x32')](_0x16c704[_0x8754('0x2e')],_0x16c704['query']);_0x5ec383['attributes']=_['intersection'](_0x16c704[_0x8754('0x2e')],qs['fields'](_0x4a38c3['query']['fields']));_0x5ec383[_0x8754('0x34')]=_0x5ec383[_0x8754('0x34')][_0x8754('0x42')]?_0x5ec383[_0x8754('0x34')]:_0x16c704[_0x8754('0x2e')];_0x5ec383['order']=qs['sort'](_0x4a38c3[_0x8754('0x2f')][_0x8754('0x35')]);_0x5ec383[_0x8754('0x39')]=qs[_0x8754('0x31')](_['pick'](_0x4a38c3[_0x8754('0x2f')],_0x16c704['filters']));if(_0x4a38c3[_0x8754('0x2f')][_0x8754('0x37')]){_0x5ec383[_0x8754('0x39')]=_[_0x8754('0x38')](_0x5ec383[_0x8754('0x39')],{'$or':_['map'](_0x5ec383[_0x8754('0x34')],function(_0x1c9cd9){var _0x5a66a9={};_0x5a66a9[_0x1c9cd9]={'$like':'%'+_0x4a38c3[_0x8754('0x2f')][_0x8754('0x37')]+'%'};return _0x5a66a9;})});}_0x5ec383=_['merge']({},_0x5ec383,_0x4a38c3[_0x8754('0x3b')]);return _0x2f2b78[_0x8754('0x4b')](_0x5ec383);}})[_0x8754('0x25')](function(_0x337ca6){if(_0x337ca6){_0xbfd49d=_0x337ca6['length'];if(!_0x4a38c3[_0x8754('0x2f')][_0x8754('0x4e')](_0x8754('0x4f'))){_0x5ec383['limit']=qs[_0x8754('0x1e')](_0x4a38c3['query'][_0x8754('0x1e')]);_0x5ec383[_0x8754('0x20')]=qs[_0x8754('0x20')](_0x4a38c3[_0x8754('0x2f')][_0x8754('0x20')]);}return _0x2f2b78[_0x8754('0x4b')](_0x5ec383);}})['then'](function(_0x181871){if(_0x181871){return _0x181871?{'count':_0xbfd49d,'rows':_0x181871}:null;}})['then'](respondWithResult(_0x5684cb,null))[_0x8754('0x3e')](handleError(_0x5684cb,null));};exports['addActions']=function(_0x235689,_0x3091a2,_0x59d381){return db[_0x8754('0x50')]['find']({'where':{'id':_0x235689['params']['id']}})[_0x8754('0x25')](handleEntityNotFound(_0x3091a2,null))[_0x8754('0x25')](function(_0x481896){if(_0x481896){return _0x481896[_0x8754('0x51')](_0x235689[_0x8754('0x46')][_0x8754('0x4a')],_[_0x8754('0x52')](_0x235689[_0x8754('0x46')],[_0x8754('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x3091a2,null))[_0x8754('0x3e')](handleError(_0x3091a2,null));};exports[_0x8754('0x53')]=function(_0x59ab65,_0x1c7ac2,_0x2cd1bf){var _0x14acde={};var _0x32491a={};var _0x5ed23e;var _0x4f13c2;return db[_0x8754('0x2a')][_0x8754('0x4c')]({'where':{'id':_0x59ab65[_0x8754('0x40')]['id']}})[_0x8754('0x25')](handleEntityNotFound(_0x1c7ac2,null))[_0x8754('0x25')](function(_0xf139a8){if(_0xf139a8){_0x5ed23e=_0xf139a8;_0x32491a[_0x8754('0x2e')]=_['keys'](db[_0x8754('0x50')][_0x8754('0x41')]);_0x32491a[_0x8754('0x2f')]=_[_0x8754('0x30')](_0x59ab65['query']);_0x32491a[_0x8754('0x31')]=_[_0x8754('0x32')](_0x32491a[_0x8754('0x2e')],_0x32491a['query']);_0x14acde[_0x8754('0x34')]=_['intersection'](_0x32491a[_0x8754('0x2e')],qs[_0x8754('0x33')](_0x59ab65['query'][_0x8754('0x33')]));_0x14acde['attributes']=_0x14acde[_0x8754('0x34')]['length']?_0x14acde[_0x8754('0x34')]:_0x32491a[_0x8754('0x2e')];_0x14acde[_0x8754('0x54')]=qs[_0x8754('0x35')](_0x59ab65[_0x8754('0x2f')][_0x8754('0x35')]);_0x14acde[_0x8754('0x39')]=qs[_0x8754('0x31')](_[_0x8754('0x36')](_0x59ab65['query'],_0x32491a['filters']));if(_0x59ab65[_0x8754('0x2f')][_0x8754('0x37')]){_0x14acde[_0x8754('0x39')]=_[_0x8754('0x38')](_0x14acde[_0x8754('0x39')],{'$or':_[_0x8754('0x29')](_0x14acde[_0x8754('0x34')],function(_0x33733a){var _0x5e9865={};_0x5e9865[_0x33733a]={'$like':'%'+_0x59ab65[_0x8754('0x2f')][_0x8754('0x37')]+'%'};return _0x5e9865;})});}_0x14acde=_[_0x8754('0x38')]({},_0x14acde,_0x59ab65[_0x8754('0x3b')]);return _0x5ed23e[_0x8754('0x53')](_0x14acde);}})[_0x8754('0x25')](function(_0x97cd3e){if(_0x97cd3e){_0x4f13c2=_0x97cd3e[_0x8754('0x42')];if(!_0x59ab65['query'][_0x8754('0x4e')](_0x8754('0x4f'))){_0x14acde[_0x8754('0x1e')]=qs[_0x8754('0x1e')](_0x59ab65['query'][_0x8754('0x1e')]);_0x14acde['offset']=qs['offset'](_0x59ab65[_0x8754('0x2f')]['offset']);}return _0x5ed23e[_0x8754('0x53')](_0x14acde);}})[_0x8754('0x25')](function(_0x2e5058){if(_0x2e5058){return _0x2e5058?{'count':_0x4f13c2,'rows':_0x2e5058}:null;}})['then'](respondWithResult(_0x1c7ac2,null))[_0x8754('0x3e')](handleError(_0x1c7ac2,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6bcaa7c..44d3ecc 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 _0x1842=['../../config/environment','./automation.attributes','exports','define','Automation','tools_automations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5a6d51,_0x46c33a){var _0x3090f2=function(_0x1c5d95){while(--_0x1c5d95){_0x5a6d51['push'](_0x5a6d51['shift']());}};_0x3090f2(++_0x46c33a);}(_0x1842,0x114));var _0x2184=function(_0x429247,_0x4a7289){_0x429247=_0x429247-0x0;var _0x2ef8d5=_0x1842[_0x429247];return _0x2ef8d5;};'use strict';var _=require(_0x2184('0x0'));var util=require(_0x2184('0x1'));var logger=require(_0x2184('0x2'))(_0x2184('0x3'));var moment=require(_0x2184('0x4'));var BPromise=require(_0x2184('0x5'));var rp=require(_0x2184('0x6'));var fs=require('fs');var path=require(_0x2184('0x7'));var rimraf=require(_0x2184('0x8'));var config=require(_0x2184('0x9'));var attributes=require(_0x2184('0xa'));module[_0x2184('0xb')]=function(_0x2bb649,_0x46d357){return _0x2bb649[_0x2184('0xc')](_0x2184('0xd'),attributes,{'tableName':_0x2184('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfd38=['lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd38,0x1e0));var _0x8fd3=function(_0x49d429,_0x27aca8){_0x49d429=_0x49d429-0x0;var _0x5622d9=_0xfd38[_0x49d429];return _0x5622d9;};'use strict';var _=require(_0x8fd3('0x0'));var util=require(_0x8fd3('0x1'));var logger=require(_0x8fd3('0x2'))(_0x8fd3('0x3'));var moment=require(_0x8fd3('0x4'));var BPromise=require(_0x8fd3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8fd3('0x6'));var config=require(_0x8fd3('0x7'));var attributes=require(_0x8fd3('0x8'));module[_0x8fd3('0x9')]=function(_0x7c1045,_0x2e30d3){return _0x7c1045[_0x8fd3('0xa')]('Automation',attributes,{'tableName':_0x8fd3('0xb'),'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 4b59614..5a7bd19 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 _0x1c77=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird'];(function(_0x102789,_0x24217f){var _0x4aeb4f=function(_0x48bbcb){while(--_0x48bbcb){_0x102789['push'](_0x102789['shift']());}};_0x4aeb4f(++_0x24217f);}(_0x1c77,0xed));var _0x71c7=function(_0x519756,_0x288785){_0x519756=_0x519756-0x0;var _0x37047e=_0x1c77[_0x519756];return _0x37047e;};'use strict';var _=require('lodash');var util=require(_0x71c7('0x0'));var moment=require(_0x71c7('0x1'));var BPromise=require(_0x71c7('0x2'));var rs=require(_0x71c7('0x3'));var fs=require('fs');var Redis=require(_0x71c7('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x71c7('0x5'));var logger=require(_0x71c7('0x6'))(_0x71c7('0x7'));var config=require(_0x71c7('0x8'));var jayson=require(_0x71c7('0x9'));var client=jayson[_0x71c7('0xa')][_0x71c7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x57fb10,_0x57bbb6,_0x2c25a4){return new BPromise(function(_0x244867,_0x229b00){return client[_0x71c7('0xc')](_0x57fb10,_0x2c25a4)['then'](function(_0x1f5fc9){logger['info']('Automation,\x20%s,\x20%s',_0x57bbb6,_0x71c7('0xd'));logger[_0x71c7('0xe')](_0x71c7('0xf'),_0x57bbb6,_0x71c7('0xd'),JSON[_0x71c7('0x10')](_0x1f5fc9));if(_0x1f5fc9['error']){if(_0x1f5fc9[_0x71c7('0x11')][_0x71c7('0x12')]===0x1f4){logger[_0x71c7('0x11')](_0x71c7('0x13'),_0x57bbb6,_0x1f5fc9['error'][_0x71c7('0x14')]);return _0x229b00(_0x1f5fc9[_0x71c7('0x11')][_0x71c7('0x14')]);}logger[_0x71c7('0x11')](_0x71c7('0x13'),_0x57bbb6,_0x1f5fc9[_0x71c7('0x11')]['message']);return _0x244867(_0x1f5fc9['error'][_0x71c7('0x14')]);}else{logger[_0x71c7('0x15')](_0x71c7('0x13'),_0x57bbb6,_0x71c7('0xd'));_0x244867(_0x1f5fc9[_0x71c7('0x16')][_0x71c7('0x14')]);}})[_0x71c7('0x17')](function(_0x115262){logger['error'](_0x71c7('0x13'),_0x57bbb6,_0x115262);_0x229b00(_0x115262);});});}
\ No newline at end of file
+var _0x4325=['http','request','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client'];(function(_0x9fabe7,_0x35412a){var _0x910bdd=function(_0x1129f4){while(--_0x1129f4){_0x9fabe7['push'](_0x9fabe7['shift']());}};_0x910bdd(++_0x35412a);}(_0x4325,0x1da));var _0x5432=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x4325[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var moment=require('moment');var BPromise=require(_0x5432('0x2'));var rs=require(_0x5432('0x3'));var fs=require('fs');var Redis=require(_0x5432('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5432('0x5'))(_0x5432('0x6'));var config=require(_0x5432('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5432('0x8')][_0x5432('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a6e76,_0x106ec9,_0x50394d){return new BPromise(function(_0xc8252e,_0x1c9762){return client[_0x5432('0xa')](_0x4a6e76,_0x50394d)[_0x5432('0xb')](function(_0x263a0c){logger['info'](_0x5432('0xc'),_0x106ec9,'request\x20sent');logger[_0x5432('0xd')](_0x5432('0xe'),_0x106ec9,_0x5432('0xf'),JSON[_0x5432('0x10')](_0x263a0c));if(_0x263a0c['error']){if(_0x263a0c['error'][_0x5432('0x11')]===0x1f4){logger[_0x5432('0x12')]('Automation,\x20%s,\x20%s',_0x106ec9,_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);return _0x1c9762(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x263a0c['error']['message']);return _0xc8252e(_0x263a0c[_0x5432('0x12')][_0x5432('0x13')]);}else{logger[_0x5432('0x14')](_0x5432('0xc'),_0x106ec9,_0x5432('0xf'));_0xc8252e(_0x263a0c[_0x5432('0x15')]['message']);}})[_0x5432('0x16')](function(_0x49e8fd){logger[_0x5432('0x12')](_0x5432('0xc'),_0x106ec9,_0x49e8fd);_0x1c9762(_0x49e8fd);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 5947e4b..225b30c 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 _0x26bc=['/:id','update','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','./automation.controller','isAuthenticated','index','get','show','/:id/conditions','getConditions','/:id/actions','getActions','create','post','addConditions','put'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x26bc,0x162));var _0xc26b=function(_0x534382,_0x286bcc){_0x534382=_0x534382-0x0;var _0x44e48d=_0x26bc[_0x534382];return _0x44e48d;};'use strict';var multer=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var path=require(_0xc26b('0x2'));var timeout=require(_0xc26b('0x3'));var express=require(_0xc26b('0x4'));var router=express['Router']();var fs_extra=require(_0xc26b('0x5'));var auth=require(_0xc26b('0x6'));var interaction=require(_0xc26b('0x7'));var config=require('../../config/environment');var controller=require(_0xc26b('0x8'));router['get']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0xa')]);router[_0xc26b('0xb')]('/:id',auth[_0xc26b('0x9')](),controller[_0xc26b('0xc')]);router[_0xc26b('0xb')](_0xc26b('0xd'),auth[_0xc26b('0x9')](),controller[_0xc26b('0xe')]);router[_0xc26b('0xb')](_0xc26b('0xf'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x10')]);router['post']('/',auth[_0xc26b('0x9')](),controller[_0xc26b('0x11')]);router[_0xc26b('0x12')](_0xc26b('0xd'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x13')]);router['post'](_0xc26b('0xf'),auth['isAuthenticated'](),controller['addActions']);router[_0xc26b('0x14')](_0xc26b('0x15'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x16')]);router['delete'](_0xc26b('0x15'),auth[_0xc26b('0x9')](),controller[_0xc26b('0x17')]);module[_0xc26b('0x18')]=router;
\ No newline at end of file
+var _0x0b36=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','destroy','util','path','express','Router'];(function(_0x583419,_0xba8746){var _0xa7d0bf=function(_0x56a6aa){while(--_0x56a6aa){_0x583419['push'](_0x583419['shift']());}};_0xa7d0bf(++_0xba8746);}(_0x0b36,0x80));var _0x60b3=function(_0x3ce796,_0x621939){_0x3ce796=_0x3ce796-0x0;var _0x354e12=_0x0b36[_0x3ce796];return _0x354e12;};'use strict';var multer=require('multer');var util=require(_0x60b3('0x0'));var path=require(_0x60b3('0x1'));var timeout=require('connect-timeout');var express=require(_0x60b3('0x2'));var router=express[_0x60b3('0x3')]();var fs_extra=require(_0x60b3('0x4'));var auth=require(_0x60b3('0x5'));var interaction=require(_0x60b3('0x6'));var config=require(_0x60b3('0x7'));var controller=require(_0x60b3('0x8'));router[_0x60b3('0x9')]('/',auth[_0x60b3('0xa')](),controller['index']);router[_0x60b3('0x9')](_0x60b3('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x60b3('0x9')](_0x60b3('0xc'),auth[_0x60b3('0xa')](),controller[_0x60b3('0xd')]);router[_0x60b3('0x9')](_0x60b3('0xe'),auth[_0x60b3('0xa')](),controller[_0x60b3('0xf')]);router[_0x60b3('0x10')]('/',auth[_0x60b3('0xa')](),controller[_0x60b3('0x11')]);router[_0x60b3('0x10')]('/:id/conditions',auth['isAuthenticated'](),controller['addConditions']);router['post'](_0x60b3('0xe'),auth[_0x60b3('0xa')](),controller[_0x60b3('0x12')]);router[_0x60b3('0x13')]('/:id',auth[_0x60b3('0xa')](),controller[_0x60b3('0x14')]);router['delete'](_0x60b3('0xb'),auth[_0x60b3('0xa')](),controller[_0x60b3('0x15')]);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 a85e825..d6fc3c4 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 _0x3cbd=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.'];(function(_0x2f30f8,_0x157438){var _0x91be2b=function(_0x111518){while(--_0x111518){_0x2f30f8['push'](_0x2f30f8['shift']());}};_0x91be2b(++_0x157438);}(_0x3cbd,0xf5));var _0xd3cb=function(_0x158cfc,_0x3ff9e0){_0x158cfc=_0x158cfc-0x0;var _0x38baee=_0x3cbd[_0x158cfc];return _0x38baee;};'use strict';var Sequelize=require(_0xd3cb('0x0'));module[_0xd3cb('0x1')]={'name':{'type':Sequelize[_0xd3cb('0x2')],'unique':_0xd3cb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xd3cb('0x4')](_0xd3cb('0x5')),'allowNull':![],'defaultValue':_0xd3cb('0x5')},'description':{'type':Sequelize[_0xd3cb('0x2')]},'active':{'type':Sequelize[_0xd3cb('0x6')],'defaultValue':0x0,'comment':_0xd3cb('0x7')},'limitCalls':{'type':Sequelize[_0xd3cb('0x8')](0x4)[_0xd3cb('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xd3cb('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xd3cb('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3cb('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3cb('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3cb('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize[_0xd3cb('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xd3cb('0xe')},'dialCheckDuplicateType':{'type':Sequelize[_0xd3cb('0x4')](_0xd3cb('0xf'),'never','onlyIfOpen'),'defaultValue':_0xd3cb('0xf')},'dialAMDActive':{'type':Sequelize[_0xd3cb('0x6')],'defaultValue':0x0,'comment':_0xd3cb('0x10')},'dialAMDInitialSilence':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xd3cb('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xd3cb('0x12')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xd3cb('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xd3cb('0x13')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xd3cb('0x14')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xd3cb('0x15')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xd3cb('0x8')](0x9)[_0xd3cb('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC','ASC'),'defaultValue':_0xd3cb('0x16')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0xd3cb('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd3cb('0x17')},'dialCutDigit':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xd3cb('0x18')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3cb('0x19')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3cb('0x1a')},'dialDropMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3cb('0x1b')},'dialDropRetryFrequency':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3cb('0x1c')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3cb('0x1d')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xd3cb('0x1e')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xd3cb('0x8')](0x3)[_0xd3cb('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xd3cb('0x1f')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xd3cb('0x8')](0x5)[_0xd3cb('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
+var _0xbc72=['#AMD\x20Initial\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','STRING','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','ENUM','always','onlyIfOpen','Active/Disactive\x20AMD'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbc72,0x18e));var _0x2bc7=function(_0x5535ca,_0x2d62cf){_0x5535ca=_0x5535ca-0x0;var _0x461003=_0xbc72[_0x5535ca];return _0x461003;};'use strict';var Sequelize=require(_0x2bc7('0x0'));module['exports']={'name':{'type':Sequelize[_0x2bc7('0x1')],'unique':_0x2bc7('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x2bc7('0x3')),'allowNull':![],'defaultValue':_0x2bc7('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x2bc7('0x4')],'defaultValue':0x0,'comment':_0x2bc7('0x5')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x2bc7('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x2bc7('0x7')},'dialOriginateCallerIdName':{'type':Sequelize[_0x2bc7('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x2bc7('0x1')]},'dialOriginateTimeout':{'type':Sequelize[_0x2bc7('0x8')](0x3)[_0x2bc7('0x6')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2bc7('0x8')](0x3)[_0x2bc7('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2bc7('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2bc7('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bc7('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2bc7('0x6')],'defaultValue':0x3,'comment':_0x2bc7('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x2bc7('0x8')](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bc7('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x2bc7('0x8')](0x3)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x2bc7('0xf')},'dialTimezone':{'type':Sequelize[_0x2bc7('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2bc7('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x2bc7('0x10')](_0x2bc7('0x11'),'never',_0x2bc7('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x2bc7('0x13')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2bc7('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2bc7('0x14')},'dialAMDGreeting':{'type':Sequelize[_0x2bc7('0x8')](0x9)[_0x2bc7('0x6')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2bc7('0x8')](0x9)[_0x2bc7('0x6')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2bc7('0x8')](0x9)[_0x2bc7('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2bc7('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x2bc7('0x8')](0x9)['UNSIGNED'],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2bc7('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x2bc7('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x2bc7('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2bc7('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2bc7('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2bc7('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2bc7('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2bc7('0x10')]('DESC',_0x2bc7('0x1a')),'defaultValue':_0x2bc7('0x1b')},'dialPrefix':{'type':Sequelize[_0x2bc7('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2bc7('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2bc7('0x1c')},'dialCutDigit':{'type':Sequelize[_0x2bc7('0x8')](0x3)[_0x2bc7('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2bc7('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x2bc7('0x8')](0x3)[_0x2bc7('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bc7('0x1f')},'dialDropMaxRetry':{'type':Sequelize[_0x2bc7('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0x20')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bc7('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x2bc7('0x8')](0x3)[_0x2bc7('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bc7('0x23')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x2bc7('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2bc7('0x24')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x2bc7('0x8')](0x5)[_0x2bc7('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2bc7('0x25')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index e722bf3..f5b6c09 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 _0xa249=['send','index','map','Campaign','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','merge','where','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','omit','updatedAt','createdAt','user','findOne','CmHopper','sort','pick','getHopperHistories','CampaignId','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','format','YYYY-MM-DD\x20HH:mm:ss','addLists','ids','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ListId','select','field','NOW()','ContactId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','from','onlyIfOpen','insert','fromQuery','CmListId','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','join','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','end','status','undefined','limit','count','offset','set','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name'];(function(_0x12977a,_0x44a4a7){var _0x3e5bfe=function(_0x10afe8){while(--_0x10afe8){_0x12977a['push'](_0x12977a['shift']());}};_0x3e5bfe(++_0x44a4a7);}(_0xa249,0x183));var _0x9a24=function(_0x4fe6a4,_0x2d05c3){_0x4fe6a4=_0x4fe6a4-0x0;var _0x24fb98=_0xa249[_0x4fe6a4];return _0x24fb98;};'use strict';var emlformat=require(_0x9a24('0x0'));var rimraf=require(_0x9a24('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9a24('0x2'));var rp=require(_0x9a24('0x3'));var moment=require('moment');var BPromise=require(_0x9a24('0x4'));var Mustache=require('mustache');var util=require(_0x9a24('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9a24('0x6'));var fs=require('fs');var fs_extra=require(_0x9a24('0x7'));var _=require(_0x9a24('0x8'));var squel=require(_0x9a24('0x9'));var crypto=require(_0x9a24('0xa'));var jsforce=require(_0x9a24('0xb'));var deskjs=require(_0x9a24('0xc'));var toCsv=require(_0x9a24('0xd'));var querystring=require(_0x9a24('0xe'));var Papa=require(_0x9a24('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9a24('0x10'));var as=require(_0x9a24('0x11'));var hardwareService=require(_0x9a24('0x12'));var logger=require('../../config/logger')(_0x9a24('0x13'));var utils=require('../../config/utils');var config=require(_0x9a24('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x9a24('0x15'))['db'];function respondWithStatusCode(_0xf809b7,_0x3d278b){_0x3d278b=_0x3d278b||0xcc;return function(_0x41f522){if(_0x41f522){return _0xf809b7[_0x9a24('0x16')](_0x3d278b);}return _0xf809b7['status'](_0x3d278b)[_0x9a24('0x17')]();};}function respondWithResult(_0x3d166d,_0x2bc767){_0x2bc767=_0x2bc767||0xc8;return function(_0x301a26){if(_0x301a26){return _0x3d166d[_0x9a24('0x18')](_0x2bc767)['json'](_0x301a26);}};}function respondWithFilteredResult(_0x519709,_0x714fd5){return function(_0x306c6d){if(_0x306c6d){var _0x25202f=typeof _0x714fd5['offset']===_0x9a24('0x19')&&typeof _0x714fd5[_0x9a24('0x1a')]===_0x9a24('0x19');var _0x2ffc6b=_0x306c6d[_0x9a24('0x1b')];var _0x402532=_0x25202f?0x0:_0x714fd5[_0x9a24('0x1c')];var _0xa438fe=_0x25202f?_0x306c6d[_0x9a24('0x1b')]:_0x714fd5[_0x9a24('0x1c')]+_0x714fd5[_0x9a24('0x1a')];var _0x164ab2;if(_0xa438fe>=_0x2ffc6b){_0xa438fe=_0x2ffc6b;_0x164ab2=0xc8;}else{_0x164ab2=0xce;}_0x519709['status'](_0x164ab2);return _0x519709[_0x9a24('0x1d')]('Content-Range',_0x402532+'-'+_0xa438fe+'/'+_0x2ffc6b)['json'](_0x306c6d);}return null;};}function patchUpdates(_0x4b775a){return function(_0x114921){try{jsonpatch[_0x9a24('0x1e')](_0x114921,_0x4b775a,!![]);}catch(_0x4d8fa8){return BPromise[_0x9a24('0x1f')](_0x4d8fa8);}return _0x114921[_0x9a24('0x20')]();};}function saveUpdates(_0x69d2e9,_0x430594){return function(_0x101477){if(_0x101477){return _0x101477[_0x9a24('0x21')](_0x69d2e9)[_0x9a24('0x22')](function(_0x390c66){return _0x390c66;});}return null;};}function removeEntity(_0x159f65,_0x5ace5c){return function(_0x1ea7e7){if(_0x1ea7e7){return _0x1ea7e7[_0x9a24('0x23')]()[_0x9a24('0x22')](function(){var _0x5e8c24=_0x1ea7e7[_0x9a24('0x24')]({'plain':!![]});var _0x5b2469=_0x9a24('0x25');return db[_0x9a24('0x26')][_0x9a24('0x23')]({'where':{'type':_0x5b2469,'resourceId':_0x5e8c24['id']}})['then'](function(){return _0x1ea7e7;});})[_0x9a24('0x22')](function(){_0x159f65[_0x9a24('0x18')](0xcc)[_0x9a24('0x17')]();});}};}function handleEntityNotFound(_0x4c6d7f,_0x350276){return function(_0x5e0d10){if(!_0x5e0d10){_0x4c6d7f[_0x9a24('0x16')](0x194);}return _0x5e0d10;};}function handleError(_0x564030,_0x457c9b){_0x457c9b=_0x457c9b||0x1f4;return function(_0x2fa061){logger[_0x9a24('0x27')](_0x2fa061[_0x9a24('0x28')]);if(_0x2fa061[_0x9a24('0x29')]){delete _0x2fa061['name'];}_0x564030['status'](_0x457c9b)[_0x9a24('0x2a')](_0x2fa061);};}exports[_0x9a24('0x2b')]=function(_0xf6b084,_0x1bd06c){var _0x27b5fb={},_0x34d053={},_0x1fe151={'count':0x0,'rows':[]};var _0x26e7c3=_[_0x9a24('0x2c')](db[_0x9a24('0x2d')][_0x9a24('0x2e')],function(_0xab849f){return{'name':_0xab849f['fieldName'],'type':_0xab849f[_0x9a24('0x2f')][_0x9a24('0x30')]};});_0x34d053[_0x9a24('0x31')]=_['map'](_0x26e7c3,'name');_0x34d053[_0x9a24('0x32')]=_[_0x9a24('0x33')](_0xf6b084[_0x9a24('0x32')]);_0x34d053[_0x9a24('0x34')]=_[_0x9a24('0x35')](_0x34d053['model'],_0x34d053[_0x9a24('0x32')]);_0x27b5fb[_0x9a24('0x36')]=_[_0x9a24('0x35')](_0x34d053[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0xf6b084[_0x9a24('0x32')][_0x9a24('0x37')]));_0x27b5fb[_0x9a24('0x36')]=_0x27b5fb[_0x9a24('0x36')][_0x9a24('0x38')]?_0x27b5fb[_0x9a24('0x36')]:_0x34d053[_0x9a24('0x31')];if(!_0xf6b084['query'][_0x9a24('0x39')](_0x9a24('0x3a'))){_0x27b5fb[_0x9a24('0x1a')]=qs[_0x9a24('0x1a')](_0xf6b084[_0x9a24('0x32')][_0x9a24('0x1a')]);_0x27b5fb[_0x9a24('0x1c')]=qs[_0x9a24('0x1c')](_0xf6b084['query'][_0x9a24('0x1c')]);}_0x27b5fb[_0x9a24('0x3b')]=qs['sort'](_0xf6b084['query']['sort']);_0x27b5fb['where']=qs['filters'](_['pick'](_0xf6b084[_0x9a24('0x32')],_0x34d053['filters']),_0x26e7c3);if(_0xf6b084['query'][_0x9a24('0x3c')]){_0x27b5fb['where']=_[_0x9a24('0x3d')](_0x27b5fb[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x26e7c3,function(_0x5af9b3){if(_0x5af9b3['type']!==_0x9a24('0x3f')){var _0x3695eb={};_0x3695eb[_0x5af9b3[_0x9a24('0x29')]]={'$like':'%'+_0xf6b084[_0x9a24('0x32')][_0x9a24('0x3c')]+'%'};return _0x3695eb;}})});}_0x27b5fb=_[_0x9a24('0x3d')]({},_0x27b5fb,_0xf6b084['options']);var _0xe964c5={'where':_0x27b5fb[_0x9a24('0x3e')]};return db['Campaign'][_0x9a24('0x1b')](_0xe964c5)[_0x9a24('0x22')](function(_0x4d94f2){_0x1fe151[_0x9a24('0x1b')]=_0x4d94f2;if(_0xf6b084[_0x9a24('0x32')][_0x9a24('0x40')]){_0x27b5fb[_0x9a24('0x41')]=[{'all':!![]}];}return db['Campaign'][_0x9a24('0x42')](_0x27b5fb);})[_0x9a24('0x22')](function(_0x6689c1){_0x1fe151[_0x9a24('0x43')]=_0x6689c1;return _0x1fe151;})['then'](respondWithFilteredResult(_0x1bd06c,_0x27b5fb))[_0x9a24('0x44')](handleError(_0x1bd06c,null));};exports[_0x9a24('0x45')]=function(_0x360a23,_0x390391){var _0x40b480={'raw':![],'where':{'id':_0x360a23[_0x9a24('0x46')]['id']}},_0x5d8e69={};_0x5d8e69['model']=_[_0x9a24('0x33')](db['Campaign'][_0x9a24('0x2e')]);_0x5d8e69[_0x9a24('0x32')]=_[_0x9a24('0x33')](_0x360a23[_0x9a24('0x32')]);_0x5d8e69[_0x9a24('0x34')]=_[_0x9a24('0x35')](_0x5d8e69[_0x9a24('0x31')],_0x5d8e69[_0x9a24('0x32')]);_0x40b480['attributes']=_[_0x9a24('0x35')](_0x5d8e69[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0x360a23['query'][_0x9a24('0x37')]));_0x40b480[_0x9a24('0x36')]=_0x40b480['attributes'][_0x9a24('0x38')]?_0x40b480[_0x9a24('0x36')]:_0x5d8e69[_0x9a24('0x31')];if(_0x360a23[_0x9a24('0x32')]['includeAll']){_0x40b480[_0x9a24('0x41')]=[{'all':!![]}];}_0x40b480=_[_0x9a24('0x3d')]({},_0x40b480,_0x360a23[_0x9a24('0x47')]);return db[_0x9a24('0x2d')][_0x9a24('0x48')](_0x40b480)['then'](handleEntityNotFound(_0x390391,null))['then'](respondWithResult(_0x390391,null))[_0x9a24('0x44')](handleError(_0x390391,null));};exports[_0x9a24('0x49')]=function(_0x107232,_0x107254){return db[_0x9a24('0x2d')]['create'](_0x107232[_0x9a24('0x4a')],{})[_0x9a24('0x22')](function(_0x58da5c){var _0xaaecd9=_0x107232['user'][_0x9a24('0x24')]({'plain':!![]});if(!_0xaaecd9)throw new Error(_0x9a24('0x4b'));if(_0xaaecd9[_0x9a24('0x4c')]==='user'){var _0x2328c3=_0x58da5c[_0x9a24('0x24')]({'plain':!![]});var _0x332ef8=_0x9a24('0x25');return db[_0x9a24('0x4d')][_0x9a24('0x48')]({'where':{'name':_0x332ef8,'userProfileId':_0xaaecd9[_0x9a24('0x4e')]},'raw':!![]})[_0x9a24('0x22')](function(_0x5d0f2a){if(_0x5d0f2a&&_0x5d0f2a[_0x9a24('0x4f')]===0x0){return db['UserProfileResource'][_0x9a24('0x49')]({'name':_0x2328c3[_0x9a24('0x29')],'resourceId':_0x2328c3['id'],'type':_0x5d0f2a[_0x9a24('0x29')],'sectionId':_0x5d0f2a['id']},{})[_0x9a24('0x22')](function(){return _0x58da5c;});}else{return _0x58da5c;}})[_0x9a24('0x44')](function(_0x5ce00b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5ce00b);throw _0x5ce00b;});}return _0x58da5c;})[_0x9a24('0x22')](respondWithResult(_0x107254,0xc9))[_0x9a24('0x44')](handleError(_0x107254,null));};exports[_0x9a24('0x50')]=function(_0x2dc6e3,_0x5eca2d){var _0x31b843={'where':{'id':_0x2dc6e3[_0x9a24('0x46')]['id']}},_0x4f33e3={};_0x4f33e3['model']=_[_0x9a24('0x33')](db['Campaign'][_0x9a24('0x2e')]);_0x31b843[_0x9a24('0x36')]=_['intersection'](_0x4f33e3[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0x2dc6e3[_0x9a24('0x32')][_0x9a24('0x37')]));_0x31b843[_0x9a24('0x36')]=_0x31b843[_0x9a24('0x36')]['length']?_0x31b843[_0x9a24('0x36')]:_0x4f33e3[_0x9a24('0x31')];if(_0x2dc6e3[_0x9a24('0x32')][_0x9a24('0x40')]){_0x31b843['include']=[{'all':!![]}];}_0x31b843=_[_0x9a24('0x3d')]({},_0x31b843,_0x2dc6e3[_0x9a24('0x47')]);return db[_0x9a24('0x2d')][_0x9a24('0x48')](_0x31b843)[_0x9a24('0x22')](handleEntityNotFound(_0x5eca2d,null))[_0x9a24('0x22')](function(_0x4cd161){if(_0x4cd161){var _0x310574=_0x4cd161[_0x9a24('0x24')]({'plain':!![]});_0x310574=qs[_0x9a24('0x51')](_0x310574,['id','createdAt',_0x9a24('0x52')]);_0x2dc6e3[_0x9a24('0x4a')]=_[_0x9a24('0x51')](_0x2dc6e3[_0x9a24('0x4a')],['id',_0x9a24('0x53'),_0x9a24('0x52')]);return db['Campaign']['create'](_[_0x9a24('0x3d')](_0x310574,_0x2dc6e3[_0x9a24('0x4a')]),{'include':_0x2dc6e3[_0x9a24('0x32')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x396228){var _0x1bbdde=_0x2dc6e3[_0x9a24('0x54')]['get']({'plain':!![]});if(!_0x1bbdde)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1bbdde[_0x9a24('0x4c')]===_0x9a24('0x54')){var _0x4cf532=_0x396228['get']({'plain':!![]});var _0x7d3e6b=_0x9a24('0x25');return db[_0x9a24('0x4d')]['find']({'where':{'name':_0x7d3e6b,'userProfileId':_0x1bbdde[_0x9a24('0x4e')]},'raw':!![]})[_0x9a24('0x22')](function(_0x512751){if(_0x512751&&_0x512751['autoAssociation']===0x0){return db[_0x9a24('0x26')]['create']({'name':_0x4cf532[_0x9a24('0x29')],'resourceId':_0x4cf532['id'],'type':_0x512751[_0x9a24('0x29')],'sectionId':_0x512751['id']},{})[_0x9a24('0x22')](function(){return _0x396228;});}else{return _0x396228;}})[_0x9a24('0x44')](function(_0x33934f){logger[_0x9a24('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x33934f);throw _0x33934f;});}return _0x396228;});}})[_0x9a24('0x22')](respondWithResult(_0x5eca2d,0xc9))[_0x9a24('0x44')](handleError(_0x5eca2d,null));};exports[_0x9a24('0x21')]=function(_0x2fc00b,_0x4bc395){if(_0x2fc00b[_0x9a24('0x4a')]['id']){delete _0x2fc00b['body']['id'];}return db['Campaign'][_0x9a24('0x48')]({'where':{'id':_0x2fc00b[_0x9a24('0x46')]['id']}})['then'](handleEntityNotFound(_0x4bc395,null))['then'](saveUpdates(_0x2fc00b['body'],null))['then'](respondWithResult(_0x4bc395,null))[_0x9a24('0x44')](handleError(_0x4bc395,null));};exports[_0x9a24('0x23')]=function(_0x16fa6e,_0x5c834f){return db[_0x9a24('0x2d')][_0x9a24('0x48')]({'where':{'id':_0x16fa6e['params']['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x5c834f,null))[_0x9a24('0x22')](removeEntity(_0x5c834f,null))[_0x9a24('0x44')](handleError(_0x5c834f,null));};exports['getHoppers']=function(_0x5e8f71,_0x32fd4e,_0x105a01){var _0x535319={'raw':!![],'where':{}};var _0x4d7ee7={};var _0x908b2c={'count':0x0,'rows':[]};return db[_0x9a24('0x2d')][_0x9a24('0x55')]({'where':{'id':_0x5e8f71[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x32fd4e,null))[_0x9a24('0x22')](function(_0x50dbd3){if(_0x50dbd3){_0x4d7ee7['model']=_[_0x9a24('0x33')](db[_0x9a24('0x56')][_0x9a24('0x2e')]);_0x4d7ee7[_0x9a24('0x32')]=_[_0x9a24('0x33')](_0x5e8f71[_0x9a24('0x32')]);_0x4d7ee7['filters']=_[_0x9a24('0x35')](_0x4d7ee7[_0x9a24('0x31')],_0x4d7ee7['query']);_0x535319[_0x9a24('0x36')]=_[_0x9a24('0x35')](_0x4d7ee7['model'],qs[_0x9a24('0x37')](_0x5e8f71['query'][_0x9a24('0x37')]));_0x535319[_0x9a24('0x36')]=_0x535319['attributes'][_0x9a24('0x38')]?_0x535319[_0x9a24('0x36')]:_0x4d7ee7[_0x9a24('0x31')];if(!_0x5e8f71[_0x9a24('0x32')][_0x9a24('0x39')](_0x9a24('0x3a'))){_0x535319[_0x9a24('0x1a')]=qs['limit'](_0x5e8f71['query'][_0x9a24('0x1a')]);_0x535319[_0x9a24('0x1c')]=qs[_0x9a24('0x1c')](_0x5e8f71[_0x9a24('0x32')][_0x9a24('0x1c')]);}_0x535319[_0x9a24('0x3b')]=qs[_0x9a24('0x57')](_0x5e8f71['query'][_0x9a24('0x57')]);_0x535319[_0x9a24('0x3e')]=qs[_0x9a24('0x34')](_[_0x9a24('0x58')](_0x5e8f71[_0x9a24('0x32')],_0x4d7ee7[_0x9a24('0x34')]));_0x535319[_0x9a24('0x3e')]['CampaignId']=_0x50dbd3['id'];if(_0x5e8f71['query'][_0x9a24('0x3c')]){_0x535319[_0x9a24('0x3e')]=_[_0x9a24('0x3d')](_0x535319[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x535319[_0x9a24('0x36')],function(_0x17e62a){var _0xd31ed7={};_0xd31ed7[_0x17e62a]={'$like':'%'+_0x5e8f71[_0x9a24('0x32')][_0x9a24('0x3c')]+'%'};return _0xd31ed7;})});}_0x535319=_[_0x9a24('0x3d')]({},_0x535319,_0x5e8f71['options']);return db[_0x9a24('0x56')][_0x9a24('0x1b')]({'where':_0x535319[_0x9a24('0x3e')]})[_0x9a24('0x22')](function(_0x1012b4){_0x908b2c[_0x9a24('0x1b')]=_0x1012b4;if(_0x5e8f71['query'][_0x9a24('0x40')]){_0x535319[_0x9a24('0x41')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x535319);})[_0x9a24('0x22')](function(_0x294029){_0x908b2c[_0x9a24('0x43')]=_0x294029;return _0x908b2c;});}})[_0x9a24('0x22')](respondWithFilteredResult(_0x32fd4e,_0x535319))[_0x9a24('0x44')](handleError(_0x32fd4e,null));};exports[_0x9a24('0x59')]=function(_0x3515be,_0x1ad182,_0x205306){var _0x4df613={'raw':!![],'where':{}};var _0x2c7cb1={};var _0x2ab856={'count':0x0,'rows':[]};return db[_0x9a24('0x2d')]['findOne']({'where':{'id':_0x3515be[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x1ad182,null))[_0x9a24('0x22')](function(_0xbbcb07){if(_0xbbcb07){_0x2c7cb1[_0x9a24('0x31')]=_[_0x9a24('0x33')](db['CmHopperHistory'][_0x9a24('0x2e')]);_0x2c7cb1[_0x9a24('0x32')]=_[_0x9a24('0x33')](_0x3515be[_0x9a24('0x32')]);_0x2c7cb1[_0x9a24('0x34')]=_['intersection'](_0x2c7cb1[_0x9a24('0x31')],_0x2c7cb1[_0x9a24('0x32')]);_0x4df613[_0x9a24('0x36')]=_['intersection'](_0x2c7cb1[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0x3515be['query']['fields']));_0x4df613[_0x9a24('0x36')]=_0x4df613[_0x9a24('0x36')]['length']?_0x4df613[_0x9a24('0x36')]:_0x2c7cb1[_0x9a24('0x31')];if(!_0x3515be[_0x9a24('0x32')][_0x9a24('0x39')]('nolimit')){_0x4df613[_0x9a24('0x1a')]=qs[_0x9a24('0x1a')](_0x3515be[_0x9a24('0x32')][_0x9a24('0x1a')]);_0x4df613['offset']=qs[_0x9a24('0x1c')](_0x3515be[_0x9a24('0x32')][_0x9a24('0x1c')]);}_0x4df613[_0x9a24('0x3b')]=qs[_0x9a24('0x57')](_0x3515be[_0x9a24('0x32')][_0x9a24('0x57')]);_0x4df613[_0x9a24('0x3e')]=qs[_0x9a24('0x34')](_[_0x9a24('0x58')](_0x3515be[_0x9a24('0x32')],_0x2c7cb1[_0x9a24('0x34')]));_0x4df613[_0x9a24('0x3e')][_0x9a24('0x5a')]=_0xbbcb07['id'];if(_0x3515be[_0x9a24('0x32')][_0x9a24('0x3c')]){_0x4df613[_0x9a24('0x3e')]=_[_0x9a24('0x3d')](_0x4df613[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x4df613[_0x9a24('0x36')],function(_0x495e82){var _0x413be6={};_0x413be6[_0x495e82]={'$like':'%'+_0x3515be[_0x9a24('0x32')][_0x9a24('0x3c')]+'%'};return _0x413be6;})});}_0x4df613=_[_0x9a24('0x3d')]({},_0x4df613,_0x3515be[_0x9a24('0x47')]);return db['CmHopperHistory'][_0x9a24('0x1b')]({'where':_0x4df613[_0x9a24('0x3e')]})[_0x9a24('0x22')](function(_0x31efa9){_0x2ab856[_0x9a24('0x1b')]=_0x31efa9;if(_0x3515be[_0x9a24('0x32')][_0x9a24('0x40')]){_0x4df613[_0x9a24('0x41')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x9a24('0x42')](_0x4df613);})['then'](function(_0x43d4d3){_0x2ab856[_0x9a24('0x43')]=_0x43d4d3;return _0x2ab856;});}})[_0x9a24('0x22')](respondWithFilteredResult(_0x1ad182,_0x4df613))[_0x9a24('0x44')](handleError(_0x1ad182,null));};exports[_0x9a24('0x5b')]=function(_0x3d6b22,_0x195276,_0x37f0d3){var _0x4428fe={'raw':!![],'where':{}};var _0x4cc2db={};var _0x1061cc={'count':0x0,'rows':[]};return db[_0x9a24('0x2d')][_0x9a24('0x55')]({'where':{'id':_0x3d6b22[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x195276,null))[_0x9a24('0x22')](function(_0x2ed0cc){if(_0x2ed0cc){_0x4cc2db[_0x9a24('0x31')]=_[_0x9a24('0x33')](db[_0x9a24('0x5c')]['rawAttributes']);_0x4cc2db['query']=_[_0x9a24('0x33')](_0x3d6b22['query']);_0x4cc2db[_0x9a24('0x34')]=_[_0x9a24('0x35')](_0x4cc2db[_0x9a24('0x31')],_0x4cc2db['query']);_0x4428fe[_0x9a24('0x36')]=_[_0x9a24('0x35')](_0x4cc2db[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0x3d6b22[_0x9a24('0x32')][_0x9a24('0x37')]));_0x4428fe[_0x9a24('0x36')]=_0x4428fe[_0x9a24('0x36')]['length']?_0x4428fe[_0x9a24('0x36')]:_0x4cc2db['model'];if(!_0x3d6b22[_0x9a24('0x32')][_0x9a24('0x39')](_0x9a24('0x3a'))){_0x4428fe[_0x9a24('0x1a')]=qs[_0x9a24('0x1a')](_0x3d6b22[_0x9a24('0x32')][_0x9a24('0x1a')]);_0x4428fe[_0x9a24('0x1c')]=qs[_0x9a24('0x1c')](_0x3d6b22[_0x9a24('0x32')][_0x9a24('0x1c')]);}_0x4428fe['order']=qs[_0x9a24('0x57')](_0x3d6b22[_0x9a24('0x32')]['sort']);_0x4428fe[_0x9a24('0x3e')]=qs[_0x9a24('0x34')](_[_0x9a24('0x58')](_0x3d6b22[_0x9a24('0x32')],_0x4cc2db[_0x9a24('0x34')]));_0x4428fe['where'][_0x9a24('0x5a')]=_0x2ed0cc['id'];if(_0x3d6b22['query'][_0x9a24('0x3c')]){_0x4428fe[_0x9a24('0x3e')]=_[_0x9a24('0x3d')](_0x4428fe[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x4428fe[_0x9a24('0x36')],function(_0x1334c6){var _0x4f586e={};_0x4f586e[_0x1334c6]={'$like':'%'+_0x3d6b22[_0x9a24('0x32')][_0x9a24('0x3c')]+'%'};return _0x4f586e;})});}_0x4428fe=_[_0x9a24('0x3d')]({},_0x4428fe,_0x3d6b22[_0x9a24('0x47')]);return db['CmHopperFinal']['count']({'where':_0x4428fe[_0x9a24('0x3e')]})[_0x9a24('0x22')](function(_0x49d96e){_0x1061cc[_0x9a24('0x1b')]=_0x49d96e;if(_0x3d6b22[_0x9a24('0x32')][_0x9a24('0x40')]){_0x4428fe[_0x9a24('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0x9a24('0x42')](_0x4428fe);})[_0x9a24('0x22')](function(_0x12694a){_0x1061cc[_0x9a24('0x43')]=_0x12694a;return _0x1061cc;});}})['then'](respondWithFilteredResult(_0x195276,_0x4428fe))[_0x9a24('0x44')](handleError(_0x195276,null));};exports['getHopperBlacks']=function(_0x215fea,_0x3cefd6,_0x3ae878){var _0x39e70e={'raw':!![],'where':{}};var _0x2c31fd={};var _0x3cec8a={'count':0x0,'rows':[]};return db[_0x9a24('0x2d')][_0x9a24('0x55')]({'where':{'id':_0x215fea['params']['id']}})['then'](handleEntityNotFound(_0x3cefd6,null))[_0x9a24('0x22')](function(_0x99271c){if(_0x99271c){_0x2c31fd[_0x9a24('0x31')]=_[_0x9a24('0x33')](db[_0x9a24('0x5d')][_0x9a24('0x2e')]);_0x2c31fd[_0x9a24('0x32')]=_[_0x9a24('0x33')](_0x215fea[_0x9a24('0x32')]);_0x2c31fd[_0x9a24('0x34')]=_[_0x9a24('0x35')](_0x2c31fd[_0x9a24('0x31')],_0x2c31fd['query']);_0x39e70e[_0x9a24('0x36')]=_[_0x9a24('0x35')](_0x2c31fd['model'],qs[_0x9a24('0x37')](_0x215fea[_0x9a24('0x32')][_0x9a24('0x37')]));_0x39e70e[_0x9a24('0x36')]=_0x39e70e['attributes'][_0x9a24('0x38')]?_0x39e70e[_0x9a24('0x36')]:_0x2c31fd['model'];if(!_0x215fea[_0x9a24('0x32')]['hasOwnProperty'](_0x9a24('0x3a'))){_0x39e70e[_0x9a24('0x1a')]=qs[_0x9a24('0x1a')](_0x215fea[_0x9a24('0x32')][_0x9a24('0x1a')]);_0x39e70e[_0x9a24('0x1c')]=qs[_0x9a24('0x1c')](_0x215fea['query']['offset']);}_0x39e70e['order']=qs[_0x9a24('0x57')](_0x215fea[_0x9a24('0x32')][_0x9a24('0x57')]);_0x39e70e[_0x9a24('0x3e')]=qs[_0x9a24('0x34')](_[_0x9a24('0x58')](_0x215fea[_0x9a24('0x32')],_0x2c31fd[_0x9a24('0x34')]));_0x39e70e[_0x9a24('0x3e')][_0x9a24('0x5a')]=_0x99271c['id'];if(_0x215fea[_0x9a24('0x32')][_0x9a24('0x3c')]){_0x39e70e['where']=_['merge'](_0x39e70e[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x39e70e[_0x9a24('0x36')],function(_0x1b3ab1){var _0x32abba={};_0x32abba[_0x1b3ab1]={'$like':'%'+_0x215fea[_0x9a24('0x32')][_0x9a24('0x3c')]+'%'};return _0x32abba;})});}_0x39e70e=_[_0x9a24('0x3d')]({},_0x39e70e,_0x215fea['options']);return db[_0x9a24('0x5d')][_0x9a24('0x1b')]({'where':_0x39e70e[_0x9a24('0x3e')]})['then'](function(_0x34362f){_0x3cec8a[_0x9a24('0x1b')]=_0x34362f;if(_0x215fea[_0x9a24('0x32')]['includeAll']){_0x39e70e[_0x9a24('0x41')]=[{'all':!![]}];}return db[_0x9a24('0x5d')]['findAll'](_0x39e70e);})[_0x9a24('0x22')](function(_0x5a0d1d){_0x3cec8a[_0x9a24('0x43')]=_0x5a0d1d;return _0x3cec8a;});}})[_0x9a24('0x22')](respondWithFilteredResult(_0x3cefd6,_0x39e70e))['catch'](handleError(_0x3cefd6,null));};exports[_0x9a24('0x5e')]=function(_0x47deba,_0x2ee974,_0x2ab48b){var _0x4266ef={};var _0x6274cb={};var _0x24b278;var _0x4831bc;return db[_0x9a24('0x2d')][_0x9a24('0x55')]({'where':{'id':_0x47deba[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x2ee974,null))[_0x9a24('0x22')](function(_0x5057dc){if(_0x5057dc){_0x24b278=_0x5057dc;_0x6274cb[_0x9a24('0x31')]=_[_0x9a24('0x33')](db[_0x9a24('0x5f')][_0x9a24('0x2e')]);_0x6274cb[_0x9a24('0x32')]=_[_0x9a24('0x33')](_0x47deba[_0x9a24('0x32')]);_0x6274cb[_0x9a24('0x34')]=_[_0x9a24('0x35')](_0x6274cb['model'],_0x6274cb[_0x9a24('0x32')]);_0x4266ef[_0x9a24('0x36')]=_[_0x9a24('0x35')](_0x6274cb[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0x47deba['query'][_0x9a24('0x37')]));_0x4266ef[_0x9a24('0x36')]=_0x4266ef[_0x9a24('0x36')]['length']?_0x4266ef[_0x9a24('0x36')]:_0x6274cb[_0x9a24('0x31')];_0x4266ef[_0x9a24('0x3b')]=qs['sort'](_0x47deba[_0x9a24('0x32')][_0x9a24('0x57')]);_0x4266ef['where']=qs['filters'](_[_0x9a24('0x58')](_0x47deba[_0x9a24('0x32')],_0x6274cb[_0x9a24('0x34')]));if(_0x47deba['query'][_0x9a24('0x3c')]){_0x4266ef[_0x9a24('0x3e')]=_['merge'](_0x4266ef[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x4266ef[_0x9a24('0x36')],function(_0x1b5d66){var _0x38e634={};_0x38e634[_0x1b5d66]={'$like':'%'+_0x47deba['query'][_0x9a24('0x3c')]+'%'};return _0x38e634;})});}_0x4266ef=_[_0x9a24('0x3d')]({},_0x4266ef,_0x47deba[_0x9a24('0x47')]);return _0x24b278[_0x9a24('0x5e')](_0x4266ef);}})[_0x9a24('0x22')](function(_0x23fdc6){if(_0x23fdc6){_0x4831bc=_0x23fdc6['length'];if(!_0x47deba[_0x9a24('0x32')]['hasOwnProperty'](_0x9a24('0x3a'))){_0x4266ef[_0x9a24('0x1a')]=qs[_0x9a24('0x1a')](_0x47deba[_0x9a24('0x32')]['limit']);_0x4266ef[_0x9a24('0x1c')]=qs[_0x9a24('0x1c')](_0x47deba[_0x9a24('0x32')]['offset']);}return _0x24b278['getLists'](_0x4266ef);}})[_0x9a24('0x22')](function(_0x19f7a9){if(_0x19f7a9){return _0x19f7a9?{'count':_0x4831bc,'rows':_0x19f7a9}:null;}})[_0x9a24('0x22')](respondWithResult(_0x2ee974,null))[_0x9a24('0x44')](handleError(_0x2ee974,null));};exports['addLists']=function(_0xb10d,_0x5d1f90,_0x2515d9){var _0x75249f,_0x12b3ff;var _0x55d4eb=[];var _0x4dc9c1=moment()[_0x9a24('0x60')](_0x9a24('0x61'));return db[_0x9a24('0x2d')][_0x9a24('0x48')]({'where':{'id':_0xb10d['params']['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x5d1f90,null))[_0x9a24('0x22')](function(_0x3a8349){if(_0x3a8349){_0x12b3ff=_0x3a8349;return _0x3a8349[_0x9a24('0x62')](_0xb10d[_0x9a24('0x4a')][_0x9a24('0x63')],_['omit'](_0xb10d[_0x9a24('0x4a')],[_0x9a24('0x63'),'id'])||{});}return null;})['spread'](function(_0x31dd79){var _0x47142e;var _0x44b0a5;_0x75249f=_0x31dd79||[];var _0xbd051b=[];if(_0x31dd79){for(var _0x26c9eb=0x0;_0x26c9eb<_0x31dd79['length'];_0x26c9eb+=0x1){var _0x3dfaeb=_0x31dd79[_0x26c9eb][_0x9a24('0x24')]({'plain':!![]});_0x12b3ff['dialCheckDuplicateType']=_0xb10d[_0x9a24('0x4a')][_0x9a24('0x64')]?_0xb10d[_0x9a24('0x4a')][_0x9a24('0x64')]:_0x12b3ff[_0x9a24('0x64')];switch(_0x12b3ff[_0x9a24('0x64')]){case _0x9a24('0x65'):_0x47142e=squel['insert']()[_0x9a24('0x66')](_0x9a24('0x67'))['fromQuery']([_0x9a24('0x68'),_0x9a24('0x69'),'ContactId',_0x9a24('0x6a'),_0x9a24('0x5a'),_0x9a24('0x53'),_0x9a24('0x52')],squel[_0x9a24('0x6b')]()[_0x9a24('0x6c')](_0x9a24('0x68'),'phone')['field'](_0x9a24('0x6d'),'scheduledAt')['field']('id',_0x9a24('0x6e'))[_0x9a24('0x6c')](_0x3dfaeb['CmListId'][_0x9a24('0x6f')](),_0x9a24('0x6a'))[_0x9a24('0x6c')](_0xb10d[_0x9a24('0x46')]['id'][_0x9a24('0x6f')](),_0x9a24('0x5a'))['field']('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x53'))[_0x9a24('0x6c')]('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x52'))['from'](_0x9a24('0x70'))[_0x9a24('0x3e')](_0x9a24('0x71'))[_0x9a24('0x3e')](_0x9a24('0x72'),_0x3dfaeb['CmListId'][_0x9a24('0x6f')]())[_0x9a24('0x3e')](_0x9a24('0x73'))[_0x9a24('0x3e')](_0x9a24('0x74'),squel[_0x9a24('0x6b')]()[_0x9a24('0x6c')](_0x9a24('0x75'))['from'](_0x9a24('0x76'))['where'](_0x9a24('0x77'),_0xb10d[_0x9a24('0x46')]['id'][_0x9a24('0x6f')]()))['where'](_0x9a24('0x74'),squel[_0x9a24('0x6b')]()[_0x9a24('0x6c')](_0x9a24('0x78'))[_0x9a24('0x79')](_0x9a24('0x67'))[_0x9a24('0x3e')](_0x9a24('0x77'),_0xb10d[_0x9a24('0x46')]['id']['toString']())))[_0x9a24('0x6f')]();break;case _0x9a24('0x7a'):_0x47142e=squel[_0x9a24('0x7b')]()[_0x9a24('0x66')]('cm_hopper')[_0x9a24('0x7c')]([_0x9a24('0x68'),'scheduledAt','ContactId',_0x9a24('0x6a'),_0x9a24('0x5a'),_0x9a24('0x53'),_0x9a24('0x52')],squel[_0x9a24('0x6b')]()[_0x9a24('0x6c')](_0x9a24('0x68'),_0x9a24('0x68'))[_0x9a24('0x6c')](_0x9a24('0x6d'),_0x9a24('0x69'))[_0x9a24('0x6c')]('id','ContactId')[_0x9a24('0x6c')](_0x3dfaeb[_0x9a24('0x7d')][_0x9a24('0x6f')](),_0x9a24('0x6a'))[_0x9a24('0x6c')](_0xb10d[_0x9a24('0x46')]['id'][_0x9a24('0x6f')](),_0x9a24('0x5a'))[_0x9a24('0x6c')]('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x53'))['field']('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x52'))[_0x9a24('0x79')](_0x9a24('0x70'))[_0x9a24('0x3e')](_0x9a24('0x71'))[_0x9a24('0x3e')](_0x9a24('0x72'),_0x3dfaeb[_0x9a24('0x7d')]['toString']())[_0x9a24('0x3e')](_0x9a24('0x73'))[_0x9a24('0x3e')](_0x9a24('0x74'),squel['select']()[_0x9a24('0x6c')](_0x9a24('0x78'))[_0x9a24('0x79')]('cm_hopper')[_0x9a24('0x3e')](_0x9a24('0x77'),_0xb10d[_0x9a24('0x46')]['id'][_0x9a24('0x6f')]())))[_0x9a24('0x6f')]();break;default:_0x47142e=squel[_0x9a24('0x7b')]()[_0x9a24('0x66')](_0x9a24('0x67'))[_0x9a24('0x7c')](['phone',_0x9a24('0x69'),_0x9a24('0x6e'),_0x9a24('0x6a'),'CampaignId',_0x9a24('0x53'),_0x9a24('0x52')],squel[_0x9a24('0x6b')]()['field'](_0x9a24('0x68'),_0x9a24('0x68'))['field'](_0x9a24('0x6d'),_0x9a24('0x69'))[_0x9a24('0x6c')]('id','ContactId')[_0x9a24('0x6c')](_0x3dfaeb[_0x9a24('0x7d')]['toString'](),'ListId')['field'](_0xb10d[_0x9a24('0x46')]['id'][_0x9a24('0x6f')](),'CampaignId')['field']('\x27'+_0x4dc9c1+'\x27','createdAt')[_0x9a24('0x6c')]('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x52'))['from'](_0x9a24('0x70'))[_0x9a24('0x3e')](_0x9a24('0x71'))[_0x9a24('0x3e')](_0x9a24('0x72'),_0x3dfaeb[_0x9a24('0x7d')][_0x9a24('0x6f')]())['where'](_0x9a24('0x73')))[_0x9a24('0x6f')]();}_0x44b0a5=squel[_0x9a24('0x7b')]()[_0x9a24('0x66')](_0x9a24('0x7e'))['fromQuery']([_0x9a24('0x7f'),_0x9a24('0x69'),_0x9a24('0x68'),_0x9a24('0x80'),_0x9a24('0x53'),'updatedAt'],squel[_0x9a24('0x6b')]()['field'](_0x9a24('0x81'),'id')[_0x9a24('0x6c')](_0x9a24('0x6d'),_0x9a24('0x69'))[_0x9a24('0x6c')](_0x9a24('0x82'),_0x9a24('0x68'))['field'](_0x9a24('0x83'),_0x9a24('0x80'))[_0x9a24('0x6c')]('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x53'))[_0x9a24('0x6c')]('\x27'+_0x4dc9c1+'\x27',_0x9a24('0x52'))[_0x9a24('0x79')]('cm_contact_has_items','ci')[_0x9a24('0x84')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x9a24('0x3e')](_0x9a24('0x85'),_0x3dfaeb['CmListId']['toString']())[_0x9a24('0x3e')]('h.CampaignId=?',_0xb10d[_0x9a24('0x46')]['id'][_0x9a24('0x6f')]())[_0x9a24('0x3e')]('h.createdAt\x20=\x20?',_0x4dc9c1))[_0x9a24('0x6f')]();_0xbd051b[_0x9a24('0x86')](db[_0x9a24('0x87')][_0x9a24('0x32')](_0x47142e));_0x55d4eb['push'](db['sequelize'][_0x9a24('0x32')](_0x44b0a5));}return BPromise[_0x9a24('0x88')](_0xbd051b);}})['then'](function(){return BPromise[_0x9a24('0x88')](_0x55d4eb);})[_0x9a24('0x22')](function(){return _0x75249f;})[_0x9a24('0x22')](respondWithResult(_0x5d1f90,null))[_0x9a24('0x44')](handleError(_0x5d1f90,null));};exports[_0x9a24('0x89')]=function(_0x51e966,_0x47373e,_0x332d7d){return db['Campaign']['find']({'where':{'id':_0x51e966['params']['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x47373e,null))[_0x9a24('0x22')](function(_0x755c02){if(_0x755c02){return _0x755c02[_0x9a24('0x89')](_0x51e966['query'][_0x9a24('0x63')]);}})[_0x9a24('0x22')](function(_0xf4ff27){if(_0xf4ff27){return db[_0x9a24('0x56')][_0x9a24('0x23')]({'where':{'ListId':_0x51e966[_0x9a24('0x32')][_0x9a24('0x63')],'CampaignId':_0x51e966[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](function(){return _0xf4ff27;});}})[_0x9a24('0x22')](respondWithStatusCode(_0x47373e,null))['catch'](handleError(_0x47373e,null));};exports[_0x9a24('0x8a')]=function(_0x4d4d95,_0x27f57a,_0x592c2e){var _0x1a09f1={};var _0xcd0a9d={};var _0x511904;var _0x14f46c;return db[_0x9a24('0x2d')][_0x9a24('0x55')]({'where':{'id':_0x4d4d95[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x27f57a,null))[_0x9a24('0x22')](function(_0x1919b4){if(_0x1919b4){_0x511904=_0x1919b4;_0xcd0a9d[_0x9a24('0x31')]=_['keys'](db[_0x9a24('0x5f')][_0x9a24('0x2e')]);_0xcd0a9d['query']=_[_0x9a24('0x33')](_0x4d4d95[_0x9a24('0x32')]);_0xcd0a9d[_0x9a24('0x34')]=_['intersection'](_0xcd0a9d['model'],_0xcd0a9d['query']);_0x1a09f1[_0x9a24('0x36')]=_['intersection'](_0xcd0a9d[_0x9a24('0x31')],qs[_0x9a24('0x37')](_0x4d4d95['query']['fields']));_0x1a09f1[_0x9a24('0x36')]=_0x1a09f1[_0x9a24('0x36')]['length']?_0x1a09f1[_0x9a24('0x36')]:_0xcd0a9d[_0x9a24('0x31')];_0x1a09f1[_0x9a24('0x3b')]=qs[_0x9a24('0x57')](_0x4d4d95[_0x9a24('0x32')][_0x9a24('0x57')]);_0x1a09f1[_0x9a24('0x3e')]=qs['filters'](_[_0x9a24('0x58')](_0x4d4d95[_0x9a24('0x32')],_0xcd0a9d[_0x9a24('0x34')]));if(_0x4d4d95['query'][_0x9a24('0x3c')]){_0x1a09f1[_0x9a24('0x3e')]=_['merge'](_0x1a09f1[_0x9a24('0x3e')],{'$or':_[_0x9a24('0x2c')](_0x1a09f1[_0x9a24('0x36')],function(_0x4fe3c6){var _0x5eb669={};_0x5eb669[_0x4fe3c6]={'$like':'%'+_0x4d4d95[_0x9a24('0x32')]['filter']+'%'};return _0x5eb669;})});}_0x1a09f1=_[_0x9a24('0x3d')]({},_0x1a09f1,_0x4d4d95[_0x9a24('0x47')]);return _0x511904[_0x9a24('0x8a')](_0x1a09f1);}})[_0x9a24('0x22')](function(_0x94a4b4){if(_0x94a4b4){_0x14f46c=_0x94a4b4['length'];if(!_0x4d4d95[_0x9a24('0x32')][_0x9a24('0x39')](_0x9a24('0x3a'))){_0x1a09f1[_0x9a24('0x1a')]=qs[_0x9a24('0x1a')](_0x4d4d95[_0x9a24('0x32')]['limit']);_0x1a09f1['offset']=qs['offset'](_0x4d4d95[_0x9a24('0x32')][_0x9a24('0x1c')]);}return _0x511904['getBlackLists'](_0x1a09f1);}})['then'](function(_0x1df19d){if(_0x1df19d){return _0x1df19d?{'count':_0x14f46c,'rows':_0x1df19d}:null;}})['then'](respondWithResult(_0x27f57a,null))['catch'](handleError(_0x27f57a,null));};exports[_0x9a24('0x8b')]=function(_0x367a33,_0xb76f8c,_0x15b2bc){var _0x261e8e,_0x481c99;var _0xca1c3b=[];var _0x207b8a=moment()[_0x9a24('0x60')](_0x9a24('0x61'));return db[_0x9a24('0x2d')][_0x9a24('0x48')]({'where':{'id':_0x367a33[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0xb76f8c,null))[_0x9a24('0x22')](function(_0x102ddb){if(_0x102ddb){_0x481c99=_0x102ddb;return _0x102ddb[_0x9a24('0x8b')](_0x367a33['body'][_0x9a24('0x63')],_[_0x9a24('0x51')](_0x367a33[_0x9a24('0x4a')],[_0x9a24('0x63'),'id'])||{});}return null;})[_0x9a24('0x8c')](function(_0x3ca726){var _0xcca833;var _0x2e93a5;_0x261e8e=_0x3ca726||[];var _0x1446fd=[];if(_0x3ca726){for(var _0x43d418=0x0;_0x43d418<_0x3ca726[_0x9a24('0x38')];_0x43d418+=0x1){var _0x50be1d=_0x3ca726[_0x43d418][_0x9a24('0x24')]({'plain':!![]});_0xcca833=squel[_0x9a24('0x7b')]()['into'](_0x9a24('0x8d'))['fromQuery']([_0x9a24('0x68'),_0x9a24('0x6e'),_0x9a24('0x6a'),_0x9a24('0x5a'),_0x9a24('0x53'),_0x9a24('0x52')],squel['select']()['field'](_0x9a24('0x68'),_0x9a24('0x68'))[_0x9a24('0x6c')]('id',_0x9a24('0x6e'))[_0x9a24('0x6c')](_0x50be1d[_0x9a24('0x7d')][_0x9a24('0x6f')](),'ListId')[_0x9a24('0x6c')](_0x367a33['params']['id'][_0x9a24('0x6f')](),_0x9a24('0x5a'))[_0x9a24('0x6c')]('NOW()','createdAt')['field'](_0x9a24('0x6d'),_0x9a24('0x52'))['from'](_0x9a24('0x70'))[_0x9a24('0x3e')](_0x9a24('0x71'))[_0x9a24('0x3e')](_0x9a24('0x72'),_0x50be1d['CmListId'][_0x9a24('0x6f')]())[_0x9a24('0x3e')]('phone\x20IS\x20NOT\x20NULL'))[_0x9a24('0x6f')]();_0x1446fd[_0x9a24('0x86')](db['sequelize'][_0x9a24('0x32')](_0xcca833));}return BPromise[_0x9a24('0x88')](_0x1446fd);}})[_0x9a24('0x22')](function(){return _0x261e8e;})[_0x9a24('0x22')](respondWithResult(_0xb76f8c,null))[_0x9a24('0x44')](handleError(_0xb76f8c,null));};exports[_0x9a24('0x8e')]=function(_0x3da758,_0x55c1f1,_0x54e9aa){return db['Campaign']['find']({'where':{'id':_0x3da758[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](handleEntityNotFound(_0x55c1f1,null))['then'](function(_0x3cfe34){if(_0x3cfe34){return _0x3cfe34[_0x9a24('0x8e')](_0x3da758[_0x9a24('0x32')][_0x9a24('0x63')]);}})[_0x9a24('0x22')](function(_0x2a1135){if(_0x2a1135){return db[_0x9a24('0x5d')][_0x9a24('0x23')]({'where':{'ListId':_0x3da758['query'][_0x9a24('0x63')],'CampaignId':_0x3da758[_0x9a24('0x46')]['id']}})[_0x9a24('0x22')](function(){return _0x2a1135;});}})[_0x9a24('0x22')](respondWithStatusCode(_0x55c1f1,null))[_0x9a24('0x44')](handleError(_0x55c1f1,null));};
\ No newline at end of file
+var _0x20df=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','destroy','then','get','UserProfileResource','error','stack','name','index','map','fieldName','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','options','includeAll','include','Campaign','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','IvrCampaigns','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','length','omit','createdAt','updatedAt','user','userProfileId','autoAssociation','update','getHoppers','CmHopper','CampaignId','rows','getHopperHistories','findOne','CmHopperHistory','findAll','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','into','cm_hopper','phone','scheduledAt','ContactId','ListId','select','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','onlyIfOpen','fromQuery','NOW()','ListId\x20=\x20?','ci.item','ci.OrderBY','OrderBy','cm_contact_has_items','join','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x5c18ef,_0xa2e81d){var _0x33789d=function(_0x5761a9){while(--_0x5761a9){_0x5c18ef['push'](_0x5c18ef['shift']());}};_0x33789d(++_0xa2e81d);}(_0x20df,0x7c));var _0xf20d=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x20df[_0x59befa];return _0x1dd63d;};'use strict';var emlformat=require(_0xf20d('0x0'));var rimraf=require(_0xf20d('0x1'));var zipdir=require(_0xf20d('0x2'));var jsonpatch=require(_0xf20d('0x3'));var rp=require('request-promise');var moment=require(_0xf20d('0x4'));var BPromise=require(_0xf20d('0x5'));var Mustache=require(_0xf20d('0x6'));var util=require(_0xf20d('0x7'));var path=require(_0xf20d('0x8'));var sox=require('sox');var csv=require(_0xf20d('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf20d('0xa'));var _=require(_0xf20d('0xb'));var squel=require('squel');var crypto=require(_0xf20d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xf20d('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf20d('0xe'));var Papa=require(_0xf20d('0xf'));var Redis=require(_0xf20d('0x10'));var authService=require(_0xf20d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf20d('0x12'));var hardwareService=require(_0xf20d('0x13'));var logger=require(_0xf20d('0x14'))(_0xf20d('0x15'));var utils=require(_0xf20d('0x16'));var config=require(_0xf20d('0x17'));var licenseUtil=require(_0xf20d('0x18'));var db=require(_0xf20d('0x19'))['db'];function respondWithStatusCode(_0x5457a3,_0x2fa3f6){_0x2fa3f6=_0x2fa3f6||0xcc;return function(_0x5126e0){if(_0x5126e0){return _0x5457a3[_0xf20d('0x1a')](_0x2fa3f6);}return _0x5457a3[_0xf20d('0x1b')](_0x2fa3f6)['end']();};}function respondWithResult(_0x1dce9d,_0x2e3cf2){_0x2e3cf2=_0x2e3cf2||0xc8;return function(_0x41fc44){if(_0x41fc44){return _0x1dce9d[_0xf20d('0x1b')](_0x2e3cf2)[_0xf20d('0x1c')](_0x41fc44);}};}function respondWithFilteredResult(_0x5c2ff0,_0x5d4244){return function(_0x3a4563){if(_0x3a4563){var _0xcd434c=typeof _0x5d4244[_0xf20d('0x1d')]===_0xf20d('0x1e')&&typeof _0x5d4244['limit']===_0xf20d('0x1e');var _0x4d3bfc=_0x3a4563[_0xf20d('0x1f')];var _0x5322ba=_0xcd434c?0x0:_0x5d4244['offset'];var _0x4b91bc=_0xcd434c?_0x3a4563[_0xf20d('0x1f')]:_0x5d4244[_0xf20d('0x1d')]+_0x5d4244[_0xf20d('0x20')];var _0x2483c4;if(_0x4b91bc>=_0x4d3bfc){_0x4b91bc=_0x4d3bfc;_0x2483c4=0xc8;}else{_0x2483c4=0xce;}_0x5c2ff0[_0xf20d('0x1b')](_0x2483c4);return _0x5c2ff0['set'](_0xf20d('0x21'),_0x5322ba+'-'+_0x4b91bc+'/'+_0x4d3bfc)['json'](_0x3a4563);}return null;};}function patchUpdates(_0x41b8c8){return function(_0x500bc9){try{jsonpatch[_0xf20d('0x22')](_0x500bc9,_0x41b8c8,!![]);}catch(_0x40e359){return BPromise['reject'](_0x40e359);}return _0x500bc9['save']();};}function saveUpdates(_0x3679cc,_0x1f9a62){return function(_0x37e292){if(_0x37e292){return _0x37e292['update'](_0x3679cc)['then'](function(_0x2a8d7e){return _0x2a8d7e;});}return null;};}function removeEntity(_0x96628b,_0x37b480){return function(_0x419b19){if(_0x419b19){return _0x419b19[_0xf20d('0x23')]()[_0xf20d('0x24')](function(){var _0x5a9385=_0x419b19[_0xf20d('0x25')]({'plain':!![]});var _0x486104='IvrCampaigns';return db[_0xf20d('0x26')][_0xf20d('0x23')]({'where':{'type':_0x486104,'resourceId':_0x5a9385['id']}})[_0xf20d('0x24')](function(){return _0x419b19;});})['then'](function(){_0x96628b['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x41378f,_0x2784ec){return function(_0x2acb21){if(!_0x2acb21){_0x41378f['sendStatus'](0x194);}return _0x2acb21;};}function handleError(_0x191c70,_0x993a3b){_0x993a3b=_0x993a3b||0x1f4;return function(_0x1dfda0){logger[_0xf20d('0x27')](_0x1dfda0[_0xf20d('0x28')]);if(_0x1dfda0[_0xf20d('0x29')]){delete _0x1dfda0[_0xf20d('0x29')];}_0x191c70['status'](_0x993a3b)['send'](_0x1dfda0);};}exports[_0xf20d('0x2a')]=function(_0x3f9451,_0x5ca630){var _0x39468d={},_0x24ca8f={},_0x422944={'count':0x0,'rows':[]};var _0x1f99b0=_[_0xf20d('0x2b')](db['Campaign']['rawAttributes'],function(_0x4aa75d){return{'name':_0x4aa75d[_0xf20d('0x2c')],'type':_0x4aa75d['type'][_0xf20d('0x2d')]};});_0x24ca8f[_0xf20d('0x2e')]=_[_0xf20d('0x2b')](_0x1f99b0,_0xf20d('0x29'));_0x24ca8f['query']=_[_0xf20d('0x2f')](_0x3f9451[_0xf20d('0x30')]);_0x24ca8f[_0xf20d('0x31')]=_[_0xf20d('0x32')](_0x24ca8f[_0xf20d('0x2e')],_0x24ca8f[_0xf20d('0x30')]);_0x39468d[_0xf20d('0x33')]=_[_0xf20d('0x32')](_0x24ca8f[_0xf20d('0x2e')],qs['fields'](_0x3f9451[_0xf20d('0x30')][_0xf20d('0x34')]));_0x39468d[_0xf20d('0x33')]=_0x39468d[_0xf20d('0x33')]['length']?_0x39468d[_0xf20d('0x33')]:_0x24ca8f[_0xf20d('0x2e')];if(!_0x3f9451[_0xf20d('0x30')][_0xf20d('0x35')](_0xf20d('0x36'))){_0x39468d[_0xf20d('0x20')]=qs[_0xf20d('0x20')](_0x3f9451[_0xf20d('0x30')][_0xf20d('0x20')]);_0x39468d[_0xf20d('0x1d')]=qs['offset'](_0x3f9451[_0xf20d('0x30')]['offset']);}_0x39468d[_0xf20d('0x37')]=qs[_0xf20d('0x38')](_0x3f9451[_0xf20d('0x30')][_0xf20d('0x38')]);_0x39468d[_0xf20d('0x39')]=qs[_0xf20d('0x31')](_[_0xf20d('0x3a')](_0x3f9451['query'],_0x24ca8f['filters']),_0x1f99b0);if(_0x3f9451[_0xf20d('0x30')][_0xf20d('0x3b')]){_0x39468d['where']=_['merge'](_0x39468d[_0xf20d('0x39')],{'$or':_[_0xf20d('0x2b')](_0x1f99b0,function(_0x568d36){if(_0x568d36[_0xf20d('0x3c')]!=='VIRTUAL'){var _0x176641={};_0x176641[_0x568d36[_0xf20d('0x29')]]={'$like':'%'+_0x3f9451['query'][_0xf20d('0x3b')]+'%'};return _0x176641;}})});}_0x39468d=_[_0xf20d('0x3d')]({},_0x39468d,_0x3f9451[_0xf20d('0x3e')]);var _0x2f9fa3={'where':_0x39468d[_0xf20d('0x39')]};return db['Campaign'][_0xf20d('0x1f')](_0x2f9fa3)['then'](function(_0x5761da){_0x422944[_0xf20d('0x1f')]=_0x5761da;if(_0x3f9451[_0xf20d('0x30')][_0xf20d('0x3f')]){_0x39468d[_0xf20d('0x40')]=[{'all':!![]}];}return db[_0xf20d('0x41')]['findAll'](_0x39468d);})[_0xf20d('0x24')](function(_0x5319ca){_0x422944['rows']=_0x5319ca;return _0x422944;})[_0xf20d('0x24')](respondWithFilteredResult(_0x5ca630,_0x39468d))[_0xf20d('0x42')](handleError(_0x5ca630,null));};exports[_0xf20d('0x43')]=function(_0x45cb52,_0x187637){var _0x467426={'raw':![],'where':{'id':_0x45cb52[_0xf20d('0x44')]['id']}},_0x3e1e5f={};_0x3e1e5f[_0xf20d('0x2e')]=_[_0xf20d('0x2f')](db[_0xf20d('0x41')][_0xf20d('0x45')]);_0x3e1e5f['query']=_['keys'](_0x45cb52[_0xf20d('0x30')]);_0x3e1e5f['filters']=_[_0xf20d('0x32')](_0x3e1e5f[_0xf20d('0x2e')],_0x3e1e5f[_0xf20d('0x30')]);_0x467426[_0xf20d('0x33')]=_[_0xf20d('0x32')](_0x3e1e5f['model'],qs[_0xf20d('0x34')](_0x45cb52[_0xf20d('0x30')]['fields']));_0x467426[_0xf20d('0x33')]=_0x467426[_0xf20d('0x33')]['length']?_0x467426[_0xf20d('0x33')]:_0x3e1e5f[_0xf20d('0x2e')];if(_0x45cb52[_0xf20d('0x30')][_0xf20d('0x3f')]){_0x467426[_0xf20d('0x40')]=[{'all':!![]}];}_0x467426=_[_0xf20d('0x3d')]({},_0x467426,_0x45cb52[_0xf20d('0x3e')]);return db[_0xf20d('0x41')][_0xf20d('0x46')](_0x467426)[_0xf20d('0x24')](handleEntityNotFound(_0x187637,null))[_0xf20d('0x24')](respondWithResult(_0x187637,null))['catch'](handleError(_0x187637,null));};exports[_0xf20d('0x47')]=function(_0x5ddbb9,_0x4fe574){return db[_0xf20d('0x41')]['create'](_0x5ddbb9[_0xf20d('0x48')],{})['then'](function(_0x5203c8){var _0x2689d3=_0x5ddbb9['user'][_0xf20d('0x25')]({'plain':!![]});if(!_0x2689d3)throw new Error(_0xf20d('0x49'));if(_0x2689d3[_0xf20d('0x4a')]==='user'){var _0x5a79f4=_0x5203c8[_0xf20d('0x25')]({'plain':!![]});var _0xe29d2a=_0xf20d('0x4b');return db[_0xf20d('0x4c')][_0xf20d('0x46')]({'where':{'name':_0xe29d2a,'userProfileId':_0x2689d3['userProfileId']},'raw':!![]})[_0xf20d('0x24')](function(_0x36101d){if(_0x36101d&&_0x36101d['autoAssociation']===0x0){return db['UserProfileResource'][_0xf20d('0x47')]({'name':_0x5a79f4['name'],'resourceId':_0x5a79f4['id'],'type':_0x36101d['name'],'sectionId':_0x36101d['id']},{})[_0xf20d('0x24')](function(){return _0x5203c8;});}else{return _0x5203c8;}})['catch'](function(_0x530ffc){logger[_0xf20d('0x27')](_0xf20d('0x4d'),_0x530ffc);throw _0x530ffc;});}return _0x5203c8;})[_0xf20d('0x24')](respondWithResult(_0x4fe574,0xc9))[_0xf20d('0x42')](handleError(_0x4fe574,null));};exports[_0xf20d('0x4e')]=function(_0x2aaa10,_0x472346){var _0x3f46b7={'where':{'id':_0x2aaa10['params']['id']}},_0xdc19d7={};_0xdc19d7[_0xf20d('0x2e')]=_[_0xf20d('0x2f')](db[_0xf20d('0x41')]['rawAttributes']);_0x3f46b7[_0xf20d('0x33')]=_[_0xf20d('0x32')](_0xdc19d7['model'],qs[_0xf20d('0x34')](_0x2aaa10[_0xf20d('0x30')]['fields']));_0x3f46b7['attributes']=_0x3f46b7[_0xf20d('0x33')][_0xf20d('0x4f')]?_0x3f46b7[_0xf20d('0x33')]:_0xdc19d7[_0xf20d('0x2e')];if(_0x2aaa10[_0xf20d('0x30')][_0xf20d('0x3f')]){_0x3f46b7['include']=[{'all':!![]}];}_0x3f46b7=_[_0xf20d('0x3d')]({},_0x3f46b7,_0x2aaa10['options']);return db['Campaign'][_0xf20d('0x46')](_0x3f46b7)[_0xf20d('0x24')](handleEntityNotFound(_0x472346,null))[_0xf20d('0x24')](function(_0x3e7b50){if(_0x3e7b50){var _0x197d42=_0x3e7b50['get']({'plain':!![]});_0x197d42=qs[_0xf20d('0x50')](_0x197d42,['id',_0xf20d('0x51'),_0xf20d('0x52')]);_0x2aaa10[_0xf20d('0x48')]=_[_0xf20d('0x50')](_0x2aaa10[_0xf20d('0x48')],['id',_0xf20d('0x51'),_0xf20d('0x52')]);return db[_0xf20d('0x41')][_0xf20d('0x47')](_['merge'](_0x197d42,_0x2aaa10['body']),{'include':_0x2aaa10[_0xf20d('0x30')]['includeAll']?[{'all':!![]}]:undefined})['then'](function(_0x84f1a2){var _0x2c855c=_0x2aaa10['user'][_0xf20d('0x25')]({'plain':!![]});if(!_0x2c855c)throw new Error(_0xf20d('0x49'));if(_0x2c855c['role']===_0xf20d('0x53')){var _0x30f28a=_0x84f1a2[_0xf20d('0x25')]({'plain':!![]});var _0x4ce0e7=_0xf20d('0x4b');return db[_0xf20d('0x4c')][_0xf20d('0x46')]({'where':{'name':_0x4ce0e7,'userProfileId':_0x2c855c[_0xf20d('0x54')]},'raw':!![]})[_0xf20d('0x24')](function(_0x28e947){if(_0x28e947&&_0x28e947[_0xf20d('0x55')]===0x0){return db[_0xf20d('0x26')][_0xf20d('0x47')]({'name':_0x30f28a[_0xf20d('0x29')],'resourceId':_0x30f28a['id'],'type':_0x28e947[_0xf20d('0x29')],'sectionId':_0x28e947['id']},{})[_0xf20d('0x24')](function(){return _0x84f1a2;});}else{return _0x84f1a2;}})[_0xf20d('0x42')](function(_0x45077e){logger[_0xf20d('0x27')](_0xf20d('0x4d'),_0x45077e);throw _0x45077e;});}return _0x84f1a2;});}})[_0xf20d('0x24')](respondWithResult(_0x472346,0xc9))['catch'](handleError(_0x472346,null));};exports[_0xf20d('0x56')]=function(_0x256069,_0x186a13){if(_0x256069['body']['id']){delete _0x256069[_0xf20d('0x48')]['id'];}return db[_0xf20d('0x41')][_0xf20d('0x46')]({'where':{'id':_0x256069['params']['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x186a13,null))[_0xf20d('0x24')](saveUpdates(_0x256069[_0xf20d('0x48')],null))['then'](respondWithResult(_0x186a13,null))[_0xf20d('0x42')](handleError(_0x186a13,null));};exports[_0xf20d('0x23')]=function(_0x3c049e,_0x5d9478){return db['Campaign']['find']({'where':{'id':_0x3c049e[_0xf20d('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d9478,null))[_0xf20d('0x24')](removeEntity(_0x5d9478,null))[_0xf20d('0x42')](handleError(_0x5d9478,null));};exports[_0xf20d('0x57')]=function(_0x3fa7e9,_0x2d14c4,_0x598d78){var _0x463d1a={'raw':!![],'where':{}};var _0x717cfe={};var _0x5e4058={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x3fa7e9[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x2d14c4,null))[_0xf20d('0x24')](function(_0x58952e){if(_0x58952e){_0x717cfe[_0xf20d('0x2e')]=_[_0xf20d('0x2f')](db[_0xf20d('0x58')]['rawAttributes']);_0x717cfe[_0xf20d('0x30')]=_[_0xf20d('0x2f')](_0x3fa7e9['query']);_0x717cfe[_0xf20d('0x31')]=_['intersection'](_0x717cfe[_0xf20d('0x2e')],_0x717cfe[_0xf20d('0x30')]);_0x463d1a['attributes']=_[_0xf20d('0x32')](_0x717cfe[_0xf20d('0x2e')],qs[_0xf20d('0x34')](_0x3fa7e9[_0xf20d('0x30')]['fields']));_0x463d1a[_0xf20d('0x33')]=_0x463d1a[_0xf20d('0x33')]['length']?_0x463d1a[_0xf20d('0x33')]:_0x717cfe['model'];if(!_0x3fa7e9[_0xf20d('0x30')][_0xf20d('0x35')]('nolimit')){_0x463d1a[_0xf20d('0x20')]=qs[_0xf20d('0x20')](_0x3fa7e9[_0xf20d('0x30')][_0xf20d('0x20')]);_0x463d1a[_0xf20d('0x1d')]=qs[_0xf20d('0x1d')](_0x3fa7e9[_0xf20d('0x30')][_0xf20d('0x1d')]);}_0x463d1a[_0xf20d('0x37')]=qs[_0xf20d('0x38')](_0x3fa7e9['query'][_0xf20d('0x38')]);_0x463d1a[_0xf20d('0x39')]=qs[_0xf20d('0x31')](_['pick'](_0x3fa7e9[_0xf20d('0x30')],_0x717cfe[_0xf20d('0x31')]));_0x463d1a[_0xf20d('0x39')][_0xf20d('0x59')]=_0x58952e['id'];if(_0x3fa7e9['query'][_0xf20d('0x3b')]){_0x463d1a[_0xf20d('0x39')]=_[_0xf20d('0x3d')](_0x463d1a['where'],{'$or':_[_0xf20d('0x2b')](_0x463d1a[_0xf20d('0x33')],function(_0x3f43e6){var _0x1a708b={};_0x1a708b[_0x3f43e6]={'$like':'%'+_0x3fa7e9[_0xf20d('0x30')][_0xf20d('0x3b')]+'%'};return _0x1a708b;})});}_0x463d1a=_[_0xf20d('0x3d')]({},_0x463d1a,_0x3fa7e9[_0xf20d('0x3e')]);return db['CmHopper'][_0xf20d('0x1f')]({'where':_0x463d1a['where']})[_0xf20d('0x24')](function(_0x3cb325){_0x5e4058[_0xf20d('0x1f')]=_0x3cb325;if(_0x3fa7e9[_0xf20d('0x30')][_0xf20d('0x3f')]){_0x463d1a[_0xf20d('0x40')]=[{'all':!![]}];}return db[_0xf20d('0x58')]['findAll'](_0x463d1a);})[_0xf20d('0x24')](function(_0x1a60a9){_0x5e4058[_0xf20d('0x5a')]=_0x1a60a9;return _0x5e4058;});}})[_0xf20d('0x24')](respondWithFilteredResult(_0x2d14c4,_0x463d1a))['catch'](handleError(_0x2d14c4,null));};exports[_0xf20d('0x5b')]=function(_0x3d3b96,_0x2614ec,_0x51f2cc){var _0x38fb82={'raw':!![],'where':{}};var _0x5d18de={};var _0x25b01e={'count':0x0,'rows':[]};return db[_0xf20d('0x41')][_0xf20d('0x5c')]({'where':{'id':_0x3d3b96['params']['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x2614ec,null))['then'](function(_0x229013){if(_0x229013){_0x5d18de['model']=_[_0xf20d('0x2f')](db[_0xf20d('0x5d')]['rawAttributes']);_0x5d18de[_0xf20d('0x30')]=_[_0xf20d('0x2f')](_0x3d3b96['query']);_0x5d18de[_0xf20d('0x31')]=_[_0xf20d('0x32')](_0x5d18de[_0xf20d('0x2e')],_0x5d18de['query']);_0x38fb82[_0xf20d('0x33')]=_[_0xf20d('0x32')](_0x5d18de[_0xf20d('0x2e')],qs[_0xf20d('0x34')](_0x3d3b96[_0xf20d('0x30')][_0xf20d('0x34')]));_0x38fb82[_0xf20d('0x33')]=_0x38fb82[_0xf20d('0x33')]['length']?_0x38fb82[_0xf20d('0x33')]:_0x5d18de[_0xf20d('0x2e')];if(!_0x3d3b96[_0xf20d('0x30')]['hasOwnProperty'](_0xf20d('0x36'))){_0x38fb82[_0xf20d('0x20')]=qs[_0xf20d('0x20')](_0x3d3b96[_0xf20d('0x30')][_0xf20d('0x20')]);_0x38fb82[_0xf20d('0x1d')]=qs[_0xf20d('0x1d')](_0x3d3b96['query'][_0xf20d('0x1d')]);}_0x38fb82['order']=qs[_0xf20d('0x38')](_0x3d3b96[_0xf20d('0x30')][_0xf20d('0x38')]);_0x38fb82[_0xf20d('0x39')]=qs[_0xf20d('0x31')](_[_0xf20d('0x3a')](_0x3d3b96[_0xf20d('0x30')],_0x5d18de['filters']));_0x38fb82['where']['CampaignId']=_0x229013['id'];if(_0x3d3b96['query'][_0xf20d('0x3b')]){_0x38fb82[_0xf20d('0x39')]=_[_0xf20d('0x3d')](_0x38fb82[_0xf20d('0x39')],{'$or':_[_0xf20d('0x2b')](_0x38fb82[_0xf20d('0x33')],function(_0x2e14f1){var _0x2d7b7d={};_0x2d7b7d[_0x2e14f1]={'$like':'%'+_0x3d3b96[_0xf20d('0x30')][_0xf20d('0x3b')]+'%'};return _0x2d7b7d;})});}_0x38fb82=_[_0xf20d('0x3d')]({},_0x38fb82,_0x3d3b96['options']);return db[_0xf20d('0x5d')]['count']({'where':_0x38fb82[_0xf20d('0x39')]})[_0xf20d('0x24')](function(_0x571dab){_0x25b01e[_0xf20d('0x1f')]=_0x571dab;if(_0x3d3b96[_0xf20d('0x30')]['includeAll']){_0x38fb82[_0xf20d('0x40')]=[{'all':!![]}];}return db[_0xf20d('0x5d')][_0xf20d('0x5e')](_0x38fb82);})[_0xf20d('0x24')](function(_0x5d2c7d){_0x25b01e[_0xf20d('0x5a')]=_0x5d2c7d;return _0x25b01e;});}})[_0xf20d('0x24')](respondWithFilteredResult(_0x2614ec,_0x38fb82))[_0xf20d('0x42')](handleError(_0x2614ec,null));};exports[_0xf20d('0x5f')]=function(_0xbb3d4d,_0x31bc99,_0x36ba16){var _0x2e8559={'raw':!![],'where':{}};var _0x5168dd={};var _0x5a094f={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xbb3d4d[_0xf20d('0x44')]['id']}})['then'](handleEntityNotFound(_0x31bc99,null))[_0xf20d('0x24')](function(_0xf44464){if(_0xf44464){_0x5168dd['model']=_[_0xf20d('0x2f')](db[_0xf20d('0x60')][_0xf20d('0x45')]);_0x5168dd[_0xf20d('0x30')]=_[_0xf20d('0x2f')](_0xbb3d4d['query']);_0x5168dd[_0xf20d('0x31')]=_['intersection'](_0x5168dd['model'],_0x5168dd['query']);_0x2e8559[_0xf20d('0x33')]=_[_0xf20d('0x32')](_0x5168dd[_0xf20d('0x2e')],qs[_0xf20d('0x34')](_0xbb3d4d['query'][_0xf20d('0x34')]));_0x2e8559[_0xf20d('0x33')]=_0x2e8559[_0xf20d('0x33')]['length']?_0x2e8559[_0xf20d('0x33')]:_0x5168dd['model'];if(!_0xbb3d4d['query'][_0xf20d('0x35')](_0xf20d('0x36'))){_0x2e8559[_0xf20d('0x20')]=qs[_0xf20d('0x20')](_0xbb3d4d['query'][_0xf20d('0x20')]);_0x2e8559[_0xf20d('0x1d')]=qs['offset'](_0xbb3d4d[_0xf20d('0x30')]['offset']);}_0x2e8559[_0xf20d('0x37')]=qs[_0xf20d('0x38')](_0xbb3d4d[_0xf20d('0x30')][_0xf20d('0x38')]);_0x2e8559[_0xf20d('0x39')]=qs['filters'](_[_0xf20d('0x3a')](_0xbb3d4d[_0xf20d('0x30')],_0x5168dd['filters']));_0x2e8559[_0xf20d('0x39')][_0xf20d('0x59')]=_0xf44464['id'];if(_0xbb3d4d['query']['filter']){_0x2e8559[_0xf20d('0x39')]=_[_0xf20d('0x3d')](_0x2e8559[_0xf20d('0x39')],{'$or':_[_0xf20d('0x2b')](_0x2e8559['attributes'],function(_0x2a31ac){var _0xe2200b={};_0xe2200b[_0x2a31ac]={'$like':'%'+_0xbb3d4d[_0xf20d('0x30')]['filter']+'%'};return _0xe2200b;})});}_0x2e8559=_['merge']({},_0x2e8559,_0xbb3d4d[_0xf20d('0x3e')]);return db[_0xf20d('0x60')][_0xf20d('0x1f')]({'where':_0x2e8559['where']})[_0xf20d('0x24')](function(_0x33b4df){_0x5a094f[_0xf20d('0x1f')]=_0x33b4df;if(_0xbb3d4d[_0xf20d('0x30')][_0xf20d('0x3f')]){_0x2e8559[_0xf20d('0x40')]=[{'all':!![]}];}return db[_0xf20d('0x60')]['findAll'](_0x2e8559);})['then'](function(_0x165c4b){_0x5a094f[_0xf20d('0x5a')]=_0x165c4b;return _0x5a094f;});}})[_0xf20d('0x24')](respondWithFilteredResult(_0x31bc99,_0x2e8559))[_0xf20d('0x42')](handleError(_0x31bc99,null));};exports[_0xf20d('0x61')]=function(_0x43e01d,_0x4cef26,_0x1b2c46){var _0x3c3adc={'raw':!![],'where':{}};var _0x18c3e6={};var _0x2ab833={'count':0x0,'rows':[]};return db[_0xf20d('0x41')][_0xf20d('0x5c')]({'where':{'id':_0x43e01d[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x4cef26,null))[_0xf20d('0x24')](function(_0x24f2ee){if(_0x24f2ee){_0x18c3e6[_0xf20d('0x2e')]=_[_0xf20d('0x2f')](db[_0xf20d('0x62')]['rawAttributes']);_0x18c3e6[_0xf20d('0x30')]=_[_0xf20d('0x2f')](_0x43e01d[_0xf20d('0x30')]);_0x18c3e6[_0xf20d('0x31')]=_[_0xf20d('0x32')](_0x18c3e6['model'],_0x18c3e6[_0xf20d('0x30')]);_0x3c3adc[_0xf20d('0x33')]=_['intersection'](_0x18c3e6[_0xf20d('0x2e')],qs[_0xf20d('0x34')](_0x43e01d[_0xf20d('0x30')]['fields']));_0x3c3adc[_0xf20d('0x33')]=_0x3c3adc[_0xf20d('0x33')][_0xf20d('0x4f')]?_0x3c3adc[_0xf20d('0x33')]:_0x18c3e6[_0xf20d('0x2e')];if(!_0x43e01d[_0xf20d('0x30')][_0xf20d('0x35')]('nolimit')){_0x3c3adc['limit']=qs[_0xf20d('0x20')](_0x43e01d['query']['limit']);_0x3c3adc['offset']=qs[_0xf20d('0x1d')](_0x43e01d[_0xf20d('0x30')][_0xf20d('0x1d')]);}_0x3c3adc['order']=qs[_0xf20d('0x38')](_0x43e01d[_0xf20d('0x30')][_0xf20d('0x38')]);_0x3c3adc[_0xf20d('0x39')]=qs[_0xf20d('0x31')](_[_0xf20d('0x3a')](_0x43e01d[_0xf20d('0x30')],_0x18c3e6[_0xf20d('0x31')]));_0x3c3adc[_0xf20d('0x39')][_0xf20d('0x59')]=_0x24f2ee['id'];if(_0x43e01d['query']['filter']){_0x3c3adc['where']=_[_0xf20d('0x3d')](_0x3c3adc['where'],{'$or':_['map'](_0x3c3adc['attributes'],function(_0xe19eac){var _0x3566b8={};_0x3566b8[_0xe19eac]={'$like':'%'+_0x43e01d['query']['filter']+'%'};return _0x3566b8;})});}_0x3c3adc=_[_0xf20d('0x3d')]({},_0x3c3adc,_0x43e01d[_0xf20d('0x3e')]);return db[_0xf20d('0x62')][_0xf20d('0x1f')]({'where':_0x3c3adc['where']})['then'](function(_0x2edce3){_0x2ab833[_0xf20d('0x1f')]=_0x2edce3;if(_0x43e01d[_0xf20d('0x30')][_0xf20d('0x3f')]){_0x3c3adc[_0xf20d('0x40')]=[{'all':!![]}];}return db[_0xf20d('0x62')]['findAll'](_0x3c3adc);})[_0xf20d('0x24')](function(_0x2a85d4){_0x2ab833[_0xf20d('0x5a')]=_0x2a85d4;return _0x2ab833;});}})[_0xf20d('0x24')](respondWithFilteredResult(_0x4cef26,_0x3c3adc))[_0xf20d('0x42')](handleError(_0x4cef26,null));};exports[_0xf20d('0x63')]=function(_0x326b84,_0x13ee5b,_0x37293e){var _0x327387={};var _0x1d0d9c={};var _0x1c626d;var _0x54b4c1;return db[_0xf20d('0x41')][_0xf20d('0x5c')]({'where':{'id':_0x326b84[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x13ee5b,null))[_0xf20d('0x24')](function(_0x2fb2e3){if(_0x2fb2e3){_0x1c626d=_0x2fb2e3;_0x1d0d9c[_0xf20d('0x2e')]=_['keys'](db[_0xf20d('0x64')][_0xf20d('0x45')]);_0x1d0d9c[_0xf20d('0x30')]=_[_0xf20d('0x2f')](_0x326b84['query']);_0x1d0d9c[_0xf20d('0x31')]=_[_0xf20d('0x32')](_0x1d0d9c[_0xf20d('0x2e')],_0x1d0d9c[_0xf20d('0x30')]);_0x327387['attributes']=_[_0xf20d('0x32')](_0x1d0d9c['model'],qs[_0xf20d('0x34')](_0x326b84[_0xf20d('0x30')][_0xf20d('0x34')]));_0x327387[_0xf20d('0x33')]=_0x327387['attributes'][_0xf20d('0x4f')]?_0x327387[_0xf20d('0x33')]:_0x1d0d9c[_0xf20d('0x2e')];_0x327387['order']=qs['sort'](_0x326b84['query'][_0xf20d('0x38')]);_0x327387[_0xf20d('0x39')]=qs[_0xf20d('0x31')](_[_0xf20d('0x3a')](_0x326b84[_0xf20d('0x30')],_0x1d0d9c['filters']));if(_0x326b84[_0xf20d('0x30')]['filter']){_0x327387[_0xf20d('0x39')]=_['merge'](_0x327387['where'],{'$or':_['map'](_0x327387[_0xf20d('0x33')],function(_0x352a0d){var _0x416c59={};_0x416c59[_0x352a0d]={'$like':'%'+_0x326b84[_0xf20d('0x30')]['filter']+'%'};return _0x416c59;})});}_0x327387=_['merge']({},_0x327387,_0x326b84[_0xf20d('0x3e')]);return _0x1c626d['getLists'](_0x327387);}})[_0xf20d('0x24')](function(_0x2a7667){if(_0x2a7667){_0x54b4c1=_0x2a7667[_0xf20d('0x4f')];if(!_0x326b84['query']['hasOwnProperty'](_0xf20d('0x36'))){_0x327387[_0xf20d('0x20')]=qs[_0xf20d('0x20')](_0x326b84[_0xf20d('0x30')][_0xf20d('0x20')]);_0x327387[_0xf20d('0x1d')]=qs[_0xf20d('0x1d')](_0x326b84[_0xf20d('0x30')]['offset']);}return _0x1c626d['getLists'](_0x327387);}})[_0xf20d('0x24')](function(_0x12e3c5){if(_0x12e3c5){return _0x12e3c5?{'count':_0x54b4c1,'rows':_0x12e3c5}:null;}})[_0xf20d('0x24')](respondWithResult(_0x13ee5b,null))[_0xf20d('0x42')](handleError(_0x13ee5b,null));};exports[_0xf20d('0x65')]=function(_0x572a2c,_0x1d863e,_0x3cbc09){var _0x4436de,_0x5cf023;var _0x14a133=[];var _0x5e591f=moment()[_0xf20d('0x66')](_0xf20d('0x67'));return db[_0xf20d('0x41')][_0xf20d('0x46')]({'where':{'id':_0x572a2c[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x1d863e,null))[_0xf20d('0x24')](function(_0x32ef02){if(_0x32ef02){_0x5cf023=_0x32ef02;return _0x32ef02['addLists'](_0x572a2c[_0xf20d('0x48')]['ids'],_[_0xf20d('0x50')](_0x572a2c['body'],[_0xf20d('0x68'),'id'])||{});}return null;})[_0xf20d('0x69')](function(_0x5c9963){var _0x49e347;var _0x4a9ce4;_0x4436de=_0x5c9963||[];var _0x58c510=[];if(_0x5c9963){for(var _0x5098f3=0x0;_0x5098f3<_0x5c9963['length'];_0x5098f3+=0x1){var _0x7a998=_0x5c9963[_0x5098f3][_0xf20d('0x25')]({'plain':!![]});_0x5cf023[_0xf20d('0x6a')]=_0x572a2c[_0xf20d('0x48')][_0xf20d('0x6a')]?_0x572a2c[_0xf20d('0x48')]['dialCheckDuplicateType']:_0x5cf023[_0xf20d('0x6a')];switch(_0x5cf023[_0xf20d('0x6a')]){case'always':_0x49e347=squel[_0xf20d('0x6b')]()[_0xf20d('0x6c')](_0xf20d('0x6d'))['fromQuery']([_0xf20d('0x6e'),_0xf20d('0x6f'),_0xf20d('0x70'),_0xf20d('0x71'),_0xf20d('0x59'),'createdAt','updatedAt'],squel[_0xf20d('0x72')]()[_0xf20d('0x73')]('phone','phone')[_0xf20d('0x73')]('NOW()',_0xf20d('0x6f'))[_0xf20d('0x73')]('id',_0xf20d('0x70'))[_0xf20d('0x73')](_0x7a998[_0xf20d('0x74')][_0xf20d('0x75')](),_0xf20d('0x71'))[_0xf20d('0x73')](_0x572a2c[_0xf20d('0x44')]['id'][_0xf20d('0x75')](),_0xf20d('0x59'))['field']('\x27'+_0x5e591f+'\x27',_0xf20d('0x51'))['field']('\x27'+_0x5e591f+'\x27',_0xf20d('0x52'))[_0xf20d('0x76')](_0xf20d('0x77'))['where'](_0xf20d('0x78'))[_0xf20d('0x39')]('ListId\x20=\x20?',_0x7a998[_0xf20d('0x74')][_0xf20d('0x75')]())['where'](_0xf20d('0x79'))['where'](_0xf20d('0x7a'),squel['select']()[_0xf20d('0x73')](_0xf20d('0x7b'))[_0xf20d('0x76')]('cm_hopper_final')[_0xf20d('0x39')]('CampaignId\x20=\x20?',_0x572a2c[_0xf20d('0x44')]['id']['toString']()))[_0xf20d('0x39')](_0xf20d('0x7a'),squel[_0xf20d('0x72')]()[_0xf20d('0x73')](_0xf20d('0x7c'))[_0xf20d('0x76')](_0xf20d('0x6d'))[_0xf20d('0x39')]('CampaignId\x20=\x20?',_0x572a2c[_0xf20d('0x44')]['id'][_0xf20d('0x75')]())))[_0xf20d('0x75')]();break;case _0xf20d('0x7d'):_0x49e347=squel[_0xf20d('0x6b')]()['into'](_0xf20d('0x6d'))[_0xf20d('0x7e')]([_0xf20d('0x6e'),_0xf20d('0x6f'),_0xf20d('0x70'),_0xf20d('0x71'),'CampaignId','createdAt','updatedAt'],squel[_0xf20d('0x72')]()['field']('phone',_0xf20d('0x6e'))[_0xf20d('0x73')](_0xf20d('0x7f'),'scheduledAt')[_0xf20d('0x73')]('id',_0xf20d('0x70'))['field'](_0x7a998[_0xf20d('0x74')][_0xf20d('0x75')](),_0xf20d('0x71'))[_0xf20d('0x73')](_0x572a2c['params']['id'][_0xf20d('0x75')](),_0xf20d('0x59'))['field']('\x27'+_0x5e591f+'\x27',_0xf20d('0x51'))[_0xf20d('0x73')]('\x27'+_0x5e591f+'\x27',_0xf20d('0x52'))['from']('cm_contacts')['where'](_0xf20d('0x78'))[_0xf20d('0x39')](_0xf20d('0x80'),_0x7a998[_0xf20d('0x74')][_0xf20d('0x75')]())['where']('phone\x20IS\x20NOT\x20NULL')[_0xf20d('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf20d('0x72')]()[_0xf20d('0x73')](_0xf20d('0x7c'))['from'](_0xf20d('0x6d'))[_0xf20d('0x39')]('CampaignId\x20=\x20?',_0x572a2c[_0xf20d('0x44')]['id'][_0xf20d('0x75')]())))[_0xf20d('0x75')]();break;default:_0x49e347=squel[_0xf20d('0x6b')]()[_0xf20d('0x6c')](_0xf20d('0x6d'))[_0xf20d('0x7e')]([_0xf20d('0x6e'),_0xf20d('0x6f'),_0xf20d('0x70'),_0xf20d('0x71'),_0xf20d('0x59'),_0xf20d('0x51'),'updatedAt'],squel[_0xf20d('0x72')]()['field']('phone',_0xf20d('0x6e'))[_0xf20d('0x73')](_0xf20d('0x7f'),_0xf20d('0x6f'))[_0xf20d('0x73')]('id',_0xf20d('0x70'))[_0xf20d('0x73')](_0x7a998['CmListId'][_0xf20d('0x75')](),_0xf20d('0x71'))[_0xf20d('0x73')](_0x572a2c[_0xf20d('0x44')]['id'][_0xf20d('0x75')](),_0xf20d('0x59'))['field']('\x27'+_0x5e591f+'\x27',_0xf20d('0x51'))['field']('\x27'+_0x5e591f+'\x27',_0xf20d('0x52'))[_0xf20d('0x76')]('cm_contacts')[_0xf20d('0x39')](_0xf20d('0x78'))[_0xf20d('0x39')](_0xf20d('0x80'),_0x7a998['CmListId'][_0xf20d('0x75')]())[_0xf20d('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xf20d('0x75')]();}_0x4a9ce4=squel[_0xf20d('0x6b')]()[_0xf20d('0x6c')]('cm_hopper_additional_phones')[_0xf20d('0x7e')](['cmHopperId','scheduledAt',_0xf20d('0x6e'),'OrderBy',_0xf20d('0x51'),_0xf20d('0x52')],squel[_0xf20d('0x72')]()[_0xf20d('0x73')]('h.id','id')['field'](_0xf20d('0x7f'),'scheduledAt')[_0xf20d('0x73')](_0xf20d('0x81'),'phone')[_0xf20d('0x73')](_0xf20d('0x82'),_0xf20d('0x83'))['field']('\x27'+_0x5e591f+'\x27',_0xf20d('0x51'))[_0xf20d('0x73')]('\x27'+_0x5e591f+'\x27',_0xf20d('0x52'))['from'](_0xf20d('0x84'),'ci')[_0xf20d('0x85')](_0xf20d('0x6d'),'h',_0xf20d('0x86'))[_0xf20d('0x39')](_0xf20d('0x87'),_0x7a998['CmListId'][_0xf20d('0x75')]())[_0xf20d('0x39')](_0xf20d('0x88'),_0x572a2c[_0xf20d('0x44')]['id']['toString']())[_0xf20d('0x39')](_0xf20d('0x89'),_0x5e591f))['toString']();_0x58c510[_0xf20d('0x8a')](db['sequelize'][_0xf20d('0x30')](_0x49e347));_0x14a133[_0xf20d('0x8a')](db[_0xf20d('0x8b')][_0xf20d('0x30')](_0x4a9ce4));}return BPromise[_0xf20d('0x8c')](_0x58c510);}})[_0xf20d('0x24')](function(){return BPromise[_0xf20d('0x8c')](_0x14a133);})[_0xf20d('0x24')](function(){return _0x4436de;})[_0xf20d('0x24')](respondWithResult(_0x1d863e,null))[_0xf20d('0x42')](handleError(_0x1d863e,null));};exports[_0xf20d('0x8d')]=function(_0x358638,_0x8c19d5,_0x1a9f53){return db[_0xf20d('0x41')][_0xf20d('0x46')]({'where':{'id':_0x358638[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x8c19d5,null))[_0xf20d('0x24')](function(_0x3fb9b7){if(_0x3fb9b7){return _0x3fb9b7[_0xf20d('0x8d')](_0x358638[_0xf20d('0x30')][_0xf20d('0x68')]);}})[_0xf20d('0x24')](function(_0x363959){if(_0x363959){return db[_0xf20d('0x58')]['destroy']({'where':{'ListId':_0x358638[_0xf20d('0x30')]['ids'],'CampaignId':_0x358638[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](function(){return _0x363959;});}})[_0xf20d('0x24')](respondWithStatusCode(_0x8c19d5,null))['catch'](handleError(_0x8c19d5,null));};exports[_0xf20d('0x8e')]=function(_0x5033b3,_0x5d5102,_0x3388ef){var _0x28a4f9={};var _0x366be5={};var _0x2c9ce4;var _0xc21753;return db[_0xf20d('0x41')][_0xf20d('0x5c')]({'where':{'id':_0x5033b3[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x5d5102,null))[_0xf20d('0x24')](function(_0x5a63dd){if(_0x5a63dd){_0x2c9ce4=_0x5a63dd;_0x366be5[_0xf20d('0x2e')]=_[_0xf20d('0x2f')](db[_0xf20d('0x64')]['rawAttributes']);_0x366be5[_0xf20d('0x30')]=_['keys'](_0x5033b3[_0xf20d('0x30')]);_0x366be5[_0xf20d('0x31')]=_[_0xf20d('0x32')](_0x366be5[_0xf20d('0x2e')],_0x366be5['query']);_0x28a4f9[_0xf20d('0x33')]=_[_0xf20d('0x32')](_0x366be5[_0xf20d('0x2e')],qs[_0xf20d('0x34')](_0x5033b3['query'][_0xf20d('0x34')]));_0x28a4f9[_0xf20d('0x33')]=_0x28a4f9['attributes']['length']?_0x28a4f9['attributes']:_0x366be5['model'];_0x28a4f9[_0xf20d('0x37')]=qs[_0xf20d('0x38')](_0x5033b3[_0xf20d('0x30')][_0xf20d('0x38')]);_0x28a4f9['where']=qs[_0xf20d('0x31')](_[_0xf20d('0x3a')](_0x5033b3['query'],_0x366be5['filters']));if(_0x5033b3['query'][_0xf20d('0x3b')]){_0x28a4f9['where']=_[_0xf20d('0x3d')](_0x28a4f9['where'],{'$or':_[_0xf20d('0x2b')](_0x28a4f9[_0xf20d('0x33')],function(_0x1c8d12){var _0x377bbc={};_0x377bbc[_0x1c8d12]={'$like':'%'+_0x5033b3['query'][_0xf20d('0x3b')]+'%'};return _0x377bbc;})});}_0x28a4f9=_['merge']({},_0x28a4f9,_0x5033b3[_0xf20d('0x3e')]);return _0x2c9ce4['getBlackLists'](_0x28a4f9);}})['then'](function(_0x3b5f22){if(_0x3b5f22){_0xc21753=_0x3b5f22[_0xf20d('0x4f')];if(!_0x5033b3[_0xf20d('0x30')][_0xf20d('0x35')](_0xf20d('0x36'))){_0x28a4f9[_0xf20d('0x20')]=qs[_0xf20d('0x20')](_0x5033b3[_0xf20d('0x30')][_0xf20d('0x20')]);_0x28a4f9[_0xf20d('0x1d')]=qs[_0xf20d('0x1d')](_0x5033b3['query'][_0xf20d('0x1d')]);}return _0x2c9ce4[_0xf20d('0x8e')](_0x28a4f9);}})[_0xf20d('0x24')](function(_0x7a5368){if(_0x7a5368){return _0x7a5368?{'count':_0xc21753,'rows':_0x7a5368}:null;}})[_0xf20d('0x24')](respondWithResult(_0x5d5102,null))[_0xf20d('0x42')](handleError(_0x5d5102,null));};exports[_0xf20d('0x8f')]=function(_0x3379af,_0x10450b,_0xb97634){var _0x3e8b68,_0x4ea1bf;var _0xfa3b9e=[];var _0x489333=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db[_0xf20d('0x41')]['find']({'where':{'id':_0x3379af[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x10450b,null))[_0xf20d('0x24')](function(_0xd7b9c9){if(_0xd7b9c9){_0x4ea1bf=_0xd7b9c9;return _0xd7b9c9[_0xf20d('0x8f')](_0x3379af[_0xf20d('0x48')][_0xf20d('0x68')],_[_0xf20d('0x50')](_0x3379af['body'],[_0xf20d('0x68'),'id'])||{});}return null;})[_0xf20d('0x69')](function(_0x1a55e4){var _0x6810aa;var _0x1341a7;_0x3e8b68=_0x1a55e4||[];var _0x262f7f=[];if(_0x1a55e4){for(var _0x18a285=0x0;_0x18a285<_0x1a55e4[_0xf20d('0x4f')];_0x18a285+=0x1){var _0x3b91c1=_0x1a55e4[_0x18a285][_0xf20d('0x25')]({'plain':!![]});_0x6810aa=squel['insert']()['into'](_0xf20d('0x90'))[_0xf20d('0x7e')](['phone',_0xf20d('0x70'),_0xf20d('0x71'),_0xf20d('0x59'),'createdAt',_0xf20d('0x52')],squel['select']()[_0xf20d('0x73')](_0xf20d('0x6e'),'phone')[_0xf20d('0x73')]('id',_0xf20d('0x70'))['field'](_0x3b91c1['CmListId'][_0xf20d('0x75')](),_0xf20d('0x71'))['field'](_0x3379af[_0xf20d('0x44')]['id'][_0xf20d('0x75')](),_0xf20d('0x59'))[_0xf20d('0x73')](_0xf20d('0x7f'),_0xf20d('0x51'))[_0xf20d('0x73')](_0xf20d('0x7f'),_0xf20d('0x52'))[_0xf20d('0x76')](_0xf20d('0x77'))[_0xf20d('0x39')](_0xf20d('0x78'))[_0xf20d('0x39')](_0xf20d('0x80'),_0x3b91c1[_0xf20d('0x74')][_0xf20d('0x75')]())[_0xf20d('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xf20d('0x75')]();_0x262f7f[_0xf20d('0x8a')](db['sequelize']['query'](_0x6810aa));}return BPromise['all'](_0x262f7f);}})['then'](function(){return _0x3e8b68;})['then'](respondWithResult(_0x10450b,null))[_0xf20d('0x42')](handleError(_0x10450b,null));};exports[_0xf20d('0x91')]=function(_0x233bb5,_0x5e637e,_0x6be18b){return db[_0xf20d('0x41')][_0xf20d('0x46')]({'where':{'id':_0x233bb5[_0xf20d('0x44')]['id']}})[_0xf20d('0x24')](handleEntityNotFound(_0x5e637e,null))[_0xf20d('0x24')](function(_0x2083a1){if(_0x2083a1){return _0x2083a1['removeBlackLists'](_0x233bb5[_0xf20d('0x30')][_0xf20d('0x68')]);}})['then'](function(_0x58a142){if(_0x58a142){return db[_0xf20d('0x62')][_0xf20d('0x23')]({'where':{'ListId':_0x233bb5[_0xf20d('0x30')][_0xf20d('0x68')],'CampaignId':_0x233bb5[_0xf20d('0x44')]['id']}})['then'](function(){return _0x58a142;});}})[_0xf20d('0x24')](respondWithStatusCode(_0x5e637e,null))['catch'](handleError(_0x5e637e,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 65aaace..30cf74a 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(_0xb2e670,_0x436e56){var _0x598b6b=function(_0x5ecdd8){while(--_0x5ecdd8){_0xb2e670['push'](_0xb2e670['shift']());}};_0x598b6b(++_0x436e56);}(_0x7a54,0x106));var _0x47a5=function(_0x435db1,_0x125741){_0x435db1=_0x435db1-0x0;var _0x15f756=_0x7a54[_0x435db1];return _0x15f756;};'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(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 c0c74e9..ff04aa5 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 _0x26bc=['message','result','catch','Campaign','findAll','options','raw','where','limit','include','model','map','attributes','GetCampaign','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x26bc,0x162));var _0xc26b=function(_0xaf1fb8,_0x2c04c6){_0xaf1fb8=_0xaf1fb8-0x0;var _0x325c52=_0x26bc[_0xaf1fb8];return _0x325c52;};'use strict';var _=require(_0xc26b('0x0'));var util=require(_0xc26b('0x1'));var moment=require(_0xc26b('0x2'));var BPromise=require(_0xc26b('0x3'));var rs=require(_0xc26b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc26b('0x5'))['db'];var utils=require(_0xc26b('0x6'));var logger=require(_0xc26b('0x7'))('rpc');var config=require(_0xc26b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xc26b('0x9')][_0xc26b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13d90e,_0x5c2f6f,_0x11c6f5){return new BPromise(function(_0x453491,_0x465c89){return client[_0xc26b('0xb')](_0x13d90e,_0x11c6f5)[_0xc26b('0xc')](function(_0x1fb2b5){logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));logger[_0xc26b('0x10')]('Campaign,\x20%s,\x20%s,\x20%s',_0x5c2f6f,_0xc26b('0xf'),JSON[_0xc26b('0x11')](_0x1fb2b5));if(_0x1fb2b5[_0xc26b('0x12')]){if(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x13')]===0x1f4){logger[_0xc26b('0x12')]('Campaign,\x20%s,\x20%s',_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x465c89(_0x1fb2b5['error'][_0xc26b('0x14')]);}logger[_0xc26b('0x12')](_0xc26b('0xe'),_0x5c2f6f,_0x1fb2b5[_0xc26b('0x12')]['message']);return _0x453491(_0x1fb2b5[_0xc26b('0x12')][_0xc26b('0x14')]);}else{logger[_0xc26b('0xd')](_0xc26b('0xe'),_0x5c2f6f,_0xc26b('0xf'));_0x453491(_0x1fb2b5[_0xc26b('0x15')]['message']);}})[_0xc26b('0x16')](function(_0x2713f6){logger['error'](_0xc26b('0xe'),_0x5c2f6f,_0x2713f6);_0x465c89(_0x2713f6);});});}exports['GetCampaign']=function(_0x4802c7){var _0x7e6ed0=this;return new Promise(function(_0x47e75b,_0x47104f){return db[_0xc26b('0x17')][_0xc26b('0x18')]({'raw':_0x4802c7[_0xc26b('0x19')]?_0x4802c7['options'][_0xc26b('0x1a')]===undefined?!![]:![]:!![],'where':_0x4802c7[_0xc26b('0x19')]?_0x4802c7[_0xc26b('0x19')][_0xc26b('0x1b')]||null:null,'attributes':_0x4802c7[_0xc26b('0x19')]?_0x4802c7[_0xc26b('0x19')]['attributes']||null:null,'limit':_0x4802c7[_0xc26b('0x19')]?_0x4802c7['options'][_0xc26b('0x1c')]||null:null,'include':_0x4802c7[_0xc26b('0x19')]?_0x4802c7[_0xc26b('0x19')][_0xc26b('0x1d')]?_['map'](_0x4802c7[_0xc26b('0x19')][_0xc26b('0x1d')],function(_0x176f29){return{'model':db[_0x176f29[_0xc26b('0x1e')]],'as':_0x176f29['as'],'attributes':_0x176f29['attributes'],'include':_0x176f29[_0xc26b('0x1d')]?_[_0xc26b('0x1f')](_0x176f29['include'],function(_0x4c0095){return{'model':db[_0x4c0095[_0xc26b('0x1e')]],'as':_0x4c0095['as'],'attributes':_0x4c0095[_0xc26b('0x20')],'include':_0x4c0095[_0xc26b('0x1d')]?_[_0xc26b('0x1f')](_0x4c0095[_0xc26b('0x1d')],function(_0x20a84f){return{'model':db[_0x20a84f['model']],'as':_0x20a84f['as'],'attributes':_0x20a84f[_0xc26b('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3e44e2){logger[_0xc26b('0xd')](_0xc26b('0x21'),_0x4802c7);logger['debug'](_0xc26b('0x21'),_0x4802c7,JSON[_0xc26b('0x11')](_0x3e44e2));_0x47e75b(_0x3e44e2);})[_0xc26b('0x16')](function(_0x1dd5d4){logger[_0xc26b('0x12')](_0xc26b('0x21'),_0x1dd5d4['message'],_0x4802c7);_0x47104f(_0x7e6ed0[_0xc26b('0x12')](0x1f4,_0x1dd5d4['message']));});});};
\ No newline at end of file
+var _0x00b3=['../../config/environment','jayson/promise','client','http','request','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','GetCampaign','findAll','options','raw','where','attributes','limit','map','include','model','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x1d7743,_0x2e45f4){var _0xc6663c=function(_0x95c054){while(--_0x95c054){_0x1d7743['push'](_0x1d7743['shift']());}};_0xc6663c(++_0x2e45f4);}(_0x00b3,0x17a));var _0x300b=function(_0x175d22,_0x538bd3){_0x175d22=_0x175d22-0x0;var _0x448b76=_0x00b3[_0x175d22];return _0x448b76;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});}exports[_0x300b('0x15')]=function(_0x4d2024){var _0x1fbf16=this;return new Promise(function(_0x2a7d96,_0xb4b3fa){return db['Campaign'][_0x300b('0x16')]({'raw':_0x4d2024[_0x300b('0x17')]?_0x4d2024[_0x300b('0x17')][_0x300b('0x18')]===undefined?!![]:![]:!![],'where':_0x4d2024['options']?_0x4d2024[_0x300b('0x17')][_0x300b('0x19')]||null:null,'attributes':_0x4d2024[_0x300b('0x17')]?_0x4d2024['options'][_0x300b('0x1a')]||null:null,'limit':_0x4d2024[_0x300b('0x17')]?_0x4d2024[_0x300b('0x17')][_0x300b('0x1b')]||null:null,'include':_0x4d2024[_0x300b('0x17')]?_0x4d2024['options']['include']?_[_0x300b('0x1c')](_0x4d2024[_0x300b('0x17')][_0x300b('0x1d')],function(_0x3ea40b){return{'model':db[_0x3ea40b[_0x300b('0x1e')]],'as':_0x3ea40b['as'],'attributes':_0x3ea40b[_0x300b('0x1a')],'include':_0x3ea40b[_0x300b('0x1d')]?_[_0x300b('0x1c')](_0x3ea40b[_0x300b('0x1d')],function(_0x544658){return{'model':db[_0x544658[_0x300b('0x1e')]],'as':_0x544658['as'],'attributes':_0x544658[_0x300b('0x1a')],'include':_0x544658[_0x300b('0x1d')]?_[_0x300b('0x1c')](_0x544658['include'],function(_0x4f50b0){return{'model':db[_0x4f50b0['model']],'as':_0x4f50b0['as'],'attributes':_0x4f50b0[_0x300b('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1241c7){logger[_0x300b('0x13')](_0x300b('0x15'),_0x4d2024);logger[_0x300b('0xe')](_0x300b('0x15'),_0x4d2024,JSON[_0x300b('0x10')](_0x1241c7));_0x2a7d96(_0x1241c7);})[_0x300b('0x1f')](function(_0x159b63){logger[_0x300b('0x11')](_0x300b('0x15'),_0x159b63['message'],_0x4d2024);_0xb4b3fa(_0x1fbf16['error'](0x1f4,_0x159b63[_0x300b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 791f305..467ad46 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 _0xa39b=['index','get','/:id','show','getHoppers','getHopperHistories','/:id/hopper_finals','getHopperBlacks','getLists','/:id/blacklists','post','create','/:id/clone','clone','addLists','addBlackLists','update','delete','/:id/lists','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated'];(function(_0x4503f6,_0x3babaf){var _0x2277d1=function(_0x1c005a){while(--_0x1c005a){_0x4503f6['push'](_0x4503f6['shift']());}};_0x2277d1(++_0x3babaf);}(_0xa39b,0xee));var _0xba39=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0xa39b[_0x40a045];return _0x1a687c;};'use strict';var multer=require(_0xba39('0x0'));var util=require(_0xba39('0x1'));var path=require(_0xba39('0x2'));var timeout=require(_0xba39('0x3'));var express=require(_0xba39('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xba39('0x5'));var interaction=require(_0xba39('0x6'));var config=require(_0xba39('0x7'));var controller=require(_0xba39('0x8'));router['get']('/',auth[_0xba39('0x9')](),controller[_0xba39('0xa')]);router[_0xba39('0xb')](_0xba39('0xc'),auth['isAuthenticated'](),controller[_0xba39('0xd')]);router['get']('/:id/hoppers',auth[_0xba39('0x9')](),controller[_0xba39('0xe')]);router[_0xba39('0xb')]('/:id/hopper_histories',auth[_0xba39('0x9')](),controller[_0xba39('0xf')]);router[_0xba39('0xb')](_0xba39('0x10'),auth[_0xba39('0x9')](),controller['getHopperFinals']);router[_0xba39('0xb')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xba39('0x11')]);router[_0xba39('0xb')]('/:id/lists',auth[_0xba39('0x9')](),controller[_0xba39('0x12')]);router[_0xba39('0xb')](_0xba39('0x13'),auth[_0xba39('0x9')](),controller['getBlackLists']);router[_0xba39('0x14')]('/',auth[_0xba39('0x9')](),controller[_0xba39('0x15')]);router[_0xba39('0x14')](_0xba39('0x16'),auth[_0xba39('0x9')](),controller[_0xba39('0x17')]);router[_0xba39('0x14')]('/:id/lists',auth['isAuthenticated'](),controller[_0xba39('0x18')]);router[_0xba39('0x14')](_0xba39('0x13'),auth['isAuthenticated'](),controller[_0xba39('0x19')]);router['put'](_0xba39('0xc'),auth['isAuthenticated'](),controller[_0xba39('0x1a')]);router[_0xba39('0x1b')](_0xba39('0xc'),auth[_0xba39('0x9')](),controller['destroy']);router['delete'](_0xba39('0x1c'),auth[_0xba39('0x9')](),controller[_0xba39('0x1d')]);router[_0xba39('0x1b')](_0xba39('0x13'),auth['isAuthenticated'](),controller[_0xba39('0x1e')]);module['exports']=router;
\ No newline at end of file
+var _0x596c=['getBlackLists','post','create','/:id/clone','clone','addBlackLists','/:id','update','delete','destroy','removeBlackLists','express','fs-extra','../../components/auth/service','get','index','isAuthenticated','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/lists','/:id/blacklists'];(function(_0x43f0be,_0x2c4845){var _0x18af8a=function(_0x36868a){while(--_0x36868a){_0x43f0be['push'](_0x43f0be['shift']());}};_0x18af8a(++_0x2c4845);}(_0x596c,0x1cd));var _0xc596=function(_0x35c3d3,_0x1b50cb){_0x35c3d3=_0x35c3d3-0x0;var _0x2a29f9=_0x596c[_0x35c3d3];return _0x2a29f9;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xc596('0x0'));var router=express['Router']();var fs_extra=require(_0xc596('0x1'));var auth=require(_0xc596('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./campaign.controller');router[_0xc596('0x3')]('/',auth['isAuthenticated'](),controller[_0xc596('0x4')]);router[_0xc596('0x3')]('/:id',auth[_0xc596('0x5')](),controller['show']);router[_0xc596('0x3')](_0xc596('0x6'),auth['isAuthenticated'](),controller[_0xc596('0x7')]);router[_0xc596('0x3')](_0xc596('0x8'),auth['isAuthenticated'](),controller[_0xc596('0x9')]);router['get'](_0xc596('0xa'),auth['isAuthenticated'](),controller[_0xc596('0xb')]);router['get']('/:id/hopper_black',auth[_0xc596('0x5')](),controller['getHopperBlacks']);router['get'](_0xc596('0xc'),auth[_0xc596('0x5')](),controller['getLists']);router[_0xc596('0x3')](_0xc596('0xd'),auth[_0xc596('0x5')](),controller[_0xc596('0xe')]);router[_0xc596('0xf')]('/',auth[_0xc596('0x5')](),controller[_0xc596('0x10')]);router[_0xc596('0xf')](_0xc596('0x11'),auth['isAuthenticated'](),controller[_0xc596('0x12')]);router[_0xc596('0xf')](_0xc596('0xc'),auth[_0xc596('0x5')](),controller['addLists']);router['post'](_0xc596('0xd'),auth[_0xc596('0x5')](),controller[_0xc596('0x13')]);router['put'](_0xc596('0x14'),auth[_0xc596('0x5')](),controller[_0xc596('0x15')]);router[_0xc596('0x16')](_0xc596('0x14'),auth[_0xc596('0x5')](),controller[_0xc596('0x17')]);router[_0xc596('0x16')](_0xc596('0xc'),auth[_0xc596('0x5')](),controller['removeLists']);router[_0xc596('0x16')](_0xc596('0xd'),auth[_0xc596('0x5')](),controller[_0xc596('0x18')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index 0fe392e..981922f 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 _0xdecd=['medium','VIRTUAL','getDataValue','key','sequelize','exports','STRING'];(function(_0x470b0a,_0x2889d6){var _0x4463f6=function(_0x2b5f0e){while(--_0x2b5f0e){_0x470b0a['push'](_0x470b0a['shift']());}};_0x4463f6(++_0x2889d6);}(_0xdecd,0x7b));var _0xddec=function(_0x55979e,_0x4fb9a6){_0x55979e=_0x55979e-0x0;var _0x1846a3=_0xdecd[_0x55979e];return _0x1846a3;};'use strict';var Sequelize=require(_0xddec('0x0'));module[_0xddec('0x1')]={'key':{'type':Sequelize[_0xddec('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0xddec('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xddec('0x2')]},'name':{'type':Sequelize[_0xddec('0x4')],'get':function(){return this[_0xddec('0x5')](_0xddec('0x6'));}}};
\ No newline at end of file
+var _0x62a6=['exports','STRING','medium','VIRTUAL','getDataValue','sequelize'];(function(_0x386ce1,_0x444cc3){var _0x1db414=function(_0x428917){while(--_0x428917){_0x386ce1['push'](_0x386ce1['shift']());}};_0x1db414(++_0x444cc3);}(_0x62a6,0x14f));var _0x662a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x62a6[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x662a('0x0'));module[_0x662a('0x1')]={'key':{'type':Sequelize[_0x662a('0x2')],'allowNull':![]},'value':{'type':Sequelize['TEXT'],'length':_0x662a('0x3'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x662a('0x4')],'get':function(){return this[_0x662a('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 302ba44..1a22fdd 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 _0x5d51=['role','CannedAnswers','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','json','apply','save','then','destroy','get','UserProfileResource','error','stack','name','send','map','CannedAnswer','rawAttributes','fieldName','type','key','model','query','keys','fields','attributes','length','nolimit','order','sort','where','pick','filters','filter','merge','options','include','findAll','rows','show','params','intersection','includeAll','find','catch','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4c4c55,_0x4d2d85){var _0x281771=function(_0x87abba){while(--_0x87abba){_0x4c4c55['push'](_0x4c4c55['shift']());}};_0x281771(++_0x4d2d85);}(_0x5d51,0x10e));var _0x15d5=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x5d51[_0x465028];return _0xb783d4;};'use strict';var emlformat=require(_0x15d5('0x0'));var rimraf=require(_0x15d5('0x1'));var zipdir=require(_0x15d5('0x2'));var jsonpatch=require(_0x15d5('0x3'));var rp=require(_0x15d5('0x4'));var moment=require(_0x15d5('0x5'));var BPromise=require(_0x15d5('0x6'));var Mustache=require(_0x15d5('0x7'));var util=require(_0x15d5('0x8'));var path=require(_0x15d5('0x9'));var sox=require(_0x15d5('0xa'));var csv=require('to-csv');var ejs=require(_0x15d5('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x15d5('0xc'));var squel=require(_0x15d5('0xd'));var crypto=require('crypto');var jsforce=require(_0x15d5('0xe'));var deskjs=require(_0x15d5('0xf'));var toCsv=require(_0x15d5('0x10'));var querystring=require(_0x15d5('0x11'));var Papa=require('papaparse');var Redis=require(_0x15d5('0x12'));var authService=require(_0x15d5('0x13'));var qs=require(_0x15d5('0x14'));var as=require(_0x15d5('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x15d5('0x16'));var config=require(_0x15d5('0x17'));var licenseUtil=require(_0x15d5('0x18'));var db=require(_0x15d5('0x19'))['db'];function respondWithStatusCode(_0x41fb10,_0x1456c1){_0x1456c1=_0x1456c1||0xcc;return function(_0x2a66fc){if(_0x2a66fc){return _0x41fb10[_0x15d5('0x1a')](_0x1456c1);}return _0x41fb10[_0x15d5('0x1b')](_0x1456c1)[_0x15d5('0x1c')]();};}function respondWithResult(_0x159e1a,_0x53f92f){_0x53f92f=_0x53f92f||0xc8;return function(_0x36451d){if(_0x36451d){return _0x159e1a[_0x15d5('0x1b')](_0x53f92f)['json'](_0x36451d);}};}function respondWithFilteredResult(_0x2d2177,_0x26edc7){return function(_0x40c16a){if(_0x40c16a){var _0x1e6372=typeof _0x26edc7[_0x15d5('0x1d')]==='undefined'&&typeof _0x26edc7[_0x15d5('0x1e')]===_0x15d5('0x1f');var _0x45cdbf=_0x40c16a[_0x15d5('0x20')];var _0x2dce49=_0x1e6372?0x0:_0x26edc7[_0x15d5('0x1d')];var _0x458b56=_0x1e6372?_0x40c16a[_0x15d5('0x20')]:_0x26edc7['offset']+_0x26edc7['limit'];var _0x3dfeb2;if(_0x458b56>=_0x45cdbf){_0x458b56=_0x45cdbf;_0x3dfeb2=0xc8;}else{_0x3dfeb2=0xce;}_0x2d2177[_0x15d5('0x1b')](_0x3dfeb2);return _0x2d2177[_0x15d5('0x21')](_0x15d5('0x22'),_0x2dce49+'-'+_0x458b56+'/'+_0x45cdbf)[_0x15d5('0x23')](_0x40c16a);}return null;};}function patchUpdates(_0x268a07){return function(_0x1ae1e7){try{jsonpatch[_0x15d5('0x24')](_0x1ae1e7,_0x268a07,!![]);}catch(_0x27e8c7){return BPromise['reject'](_0x27e8c7);}return _0x1ae1e7[_0x15d5('0x25')]();};}function saveUpdates(_0x96308b,_0x4ed1df){return function(_0x4ce02f){if(_0x4ce02f){return _0x4ce02f['update'](_0x96308b)[_0x15d5('0x26')](function(_0x5301ce){return _0x5301ce;});}return null;};}function removeEntity(_0x35e5e8,_0xaf1756){return function(_0x167e58){if(_0x167e58){return _0x167e58[_0x15d5('0x27')]()[_0x15d5('0x26')](function(){var _0x2f39aa=_0x167e58[_0x15d5('0x28')]({'plain':!![]});var _0x1c83cd='CannedAnswers';return db[_0x15d5('0x29')][_0x15d5('0x27')]({'where':{'type':_0x1c83cd,'resourceId':_0x2f39aa['id']}})[_0x15d5('0x26')](function(){return _0x167e58;});})[_0x15d5('0x26')](function(){_0x35e5e8[_0x15d5('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x315e86,_0xf46229){return function(_0x4d37fb){if(!_0x4d37fb){_0x315e86[_0x15d5('0x1a')](0x194);}return _0x4d37fb;};}function handleError(_0x39c374,_0x77db2f){_0x77db2f=_0x77db2f||0x1f4;return function(_0x2bff18){logger[_0x15d5('0x2a')](_0x2bff18[_0x15d5('0x2b')]);if(_0x2bff18[_0x15d5('0x2c')]){delete _0x2bff18['name'];}_0x39c374[_0x15d5('0x1b')](_0x77db2f)[_0x15d5('0x2d')](_0x2bff18);};}exports['index']=function(_0x52152e,_0x3225c6){var _0x3e55a9={},_0x2e45d2={},_0xf26651={'count':0x0,'rows':[]};var _0x492d57=_[_0x15d5('0x2e')](db[_0x15d5('0x2f')][_0x15d5('0x30')],function(_0x37d70c){return{'name':_0x37d70c[_0x15d5('0x31')],'type':_0x37d70c[_0x15d5('0x32')][_0x15d5('0x33')]};});_0x2e45d2[_0x15d5('0x34')]=_[_0x15d5('0x2e')](_0x492d57,_0x15d5('0x2c'));_0x2e45d2[_0x15d5('0x35')]=_[_0x15d5('0x36')](_0x52152e[_0x15d5('0x35')]);_0x2e45d2['filters']=_['intersection'](_0x2e45d2[_0x15d5('0x34')],_0x2e45d2['query']);_0x3e55a9['attributes']=_['intersection'](_0x2e45d2[_0x15d5('0x34')],qs[_0x15d5('0x37')](_0x52152e[_0x15d5('0x35')][_0x15d5('0x37')]));_0x3e55a9['attributes']=_0x3e55a9[_0x15d5('0x38')][_0x15d5('0x39')]?_0x3e55a9['attributes']:_0x2e45d2[_0x15d5('0x34')];if(!_0x52152e[_0x15d5('0x35')]['hasOwnProperty'](_0x15d5('0x3a'))){_0x3e55a9['limit']=qs[_0x15d5('0x1e')](_0x52152e[_0x15d5('0x35')][_0x15d5('0x1e')]);_0x3e55a9[_0x15d5('0x1d')]=qs['offset'](_0x52152e['query'][_0x15d5('0x1d')]);}_0x3e55a9[_0x15d5('0x3b')]=qs[_0x15d5('0x3c')](_0x52152e[_0x15d5('0x35')][_0x15d5('0x3c')]);_0x3e55a9[_0x15d5('0x3d')]=qs['filters'](_[_0x15d5('0x3e')](_0x52152e[_0x15d5('0x35')],_0x2e45d2[_0x15d5('0x3f')]),_0x492d57);if(_0x52152e['query'][_0x15d5('0x40')]){_0x3e55a9[_0x15d5('0x3d')]=_[_0x15d5('0x41')](_0x3e55a9[_0x15d5('0x3d')],{'$or':[{'key':{'$like':'%'+_0x52152e[_0x15d5('0x35')][_0x15d5('0x40')]+'%'}},{'value':{'$like':'%'+_0x52152e[_0x15d5('0x35')]['filter']+'%'}}]});}_0x3e55a9=_[_0x15d5('0x41')]({},_0x3e55a9,_0x52152e[_0x15d5('0x42')]);var _0x142716={'where':_0x3e55a9['where']};return db[_0x15d5('0x2f')][_0x15d5('0x20')](_0x142716)[_0x15d5('0x26')](function(_0x286155){_0xf26651[_0x15d5('0x20')]=_0x286155;if(_0x52152e[_0x15d5('0x35')]['includeAll']){_0x3e55a9[_0x15d5('0x43')]=[{'all':!![]}];}return db[_0x15d5('0x2f')][_0x15d5('0x44')](_0x3e55a9);})[_0x15d5('0x26')](function(_0x1cb611){_0xf26651[_0x15d5('0x45')]=_0x1cb611;return _0xf26651;})['then'](respondWithFilteredResult(_0x3225c6,_0x3e55a9))['catch'](handleError(_0x3225c6,null));};exports[_0x15d5('0x46')]=function(_0x53a933,_0x16b66c){var _0x45c492={'raw':!![],'where':{'id':_0x53a933[_0x15d5('0x47')]['id']}},_0x2578b0={};_0x2578b0[_0x15d5('0x34')]=_[_0x15d5('0x36')](db[_0x15d5('0x2f')][_0x15d5('0x30')]);_0x2578b0[_0x15d5('0x35')]=_[_0x15d5('0x36')](_0x53a933[_0x15d5('0x35')]);_0x2578b0['filters']=_['intersection'](_0x2578b0[_0x15d5('0x34')],_0x2578b0[_0x15d5('0x35')]);_0x45c492['attributes']=_[_0x15d5('0x48')](_0x2578b0[_0x15d5('0x34')],qs[_0x15d5('0x37')](_0x53a933[_0x15d5('0x35')][_0x15d5('0x37')]));_0x45c492[_0x15d5('0x38')]=_0x45c492['attributes'][_0x15d5('0x39')]?_0x45c492[_0x15d5('0x38')]:_0x2578b0['model'];if(_0x53a933['query'][_0x15d5('0x49')]){_0x45c492[_0x15d5('0x43')]=[{'all':!![]}];}_0x45c492=_[_0x15d5('0x41')]({},_0x45c492,_0x53a933[_0x15d5('0x42')]);return db[_0x15d5('0x2f')][_0x15d5('0x4a')](_0x45c492)[_0x15d5('0x26')](handleEntityNotFound(_0x16b66c,null))[_0x15d5('0x26')](respondWithResult(_0x16b66c,null))[_0x15d5('0x4b')](handleError(_0x16b66c,null));};exports['update']=function(_0x42a30b,_0x330d96){if(_0x42a30b[_0x15d5('0x4c')]['id']){delete _0x42a30b['body']['id'];}return db[_0x15d5('0x2f')][_0x15d5('0x4a')]({'where':{'id':_0x42a30b['params']['id']}})[_0x15d5('0x26')](handleEntityNotFound(_0x330d96,null))[_0x15d5('0x26')](saveUpdates(_0x42a30b[_0x15d5('0x4c')],null))[_0x15d5('0x26')](respondWithResult(_0x330d96,null))['catch'](handleError(_0x330d96,null));};exports['destroy']=function(_0x21b804,_0xfeb15f){return db['CannedAnswer'][_0x15d5('0x4a')]({'where':{'id':_0x21b804['params']['id']}})[_0x15d5('0x26')](handleEntityNotFound(_0xfeb15f,null))[_0x15d5('0x26')](removeEntity(_0xfeb15f,null))['catch'](handleError(_0xfeb15f,null));};exports[_0x15d5('0x4d')]=function(_0x52eaac,_0x35181e){var _0x1dd88e={'key':_0x52eaac[_0x15d5('0x4c')][_0x15d5('0x33')]};if(_0x52eaac[_0x15d5('0x4c')][_0x15d5('0x4e')]){_0x1dd88e[_0x15d5('0x4e')]=_0x52eaac[_0x15d5('0x4c')][_0x15d5('0x4e')];}else if(_0x52eaac[_0x15d5('0x4c')][_0x15d5('0x4f')]){_0x1dd88e[_0x15d5('0x4f')]=_0x52eaac[_0x15d5('0x4c')][_0x15d5('0x4f')];}else if(_0x52eaac['body'][_0x15d5('0x50')]){_0x1dd88e[_0x15d5('0x50')]=_0x52eaac[_0x15d5('0x4c')]['OpenchannelAccountId'];}else if(_0x52eaac[_0x15d5('0x4c')]['ChatWebsiteId']){_0x1dd88e[_0x15d5('0x51')]=_0x52eaac[_0x15d5('0x4c')][_0x15d5('0x51')];}return db['CannedAnswer']['find']({'where':_0x1dd88e})['then'](function(_0x540bb9){if(_0x540bb9){throw new db['Sequelize'][(_0x15d5('0x52'))](_0x15d5('0x53'));}return db[_0x15d5('0x2f')]['create'](_0x52eaac[_0x15d5('0x4c')]);})[_0x15d5('0x26')](function(_0x3d0094){var _0x152242=_0x52eaac[_0x15d5('0x54')][_0x15d5('0x28')]({'plain':!![]});if(!_0x152242)throw new Error(_0x15d5('0x55'));if(_0x152242[_0x15d5('0x56')]==='user'){var _0x515453=_0x3d0094[_0x15d5('0x28')]({'plain':!![]});return db['UserProfileSection'][_0x15d5('0x4a')]({'where':{'name':_0x15d5('0x57'),'userProfileId':_0x152242['userProfileId']},'raw':!![]})[_0x15d5('0x26')](function(_0x4131cc){if(_0x4131cc&&_0x4131cc[_0x15d5('0x58')]===0x0){return db[_0x15d5('0x29')][_0x15d5('0x4d')]({'name':_0x515453[_0x15d5('0x2c')],'resourceId':_0x515453['id'],'type':_0x4131cc[_0x15d5('0x2c')],'sectionId':_0x4131cc['id']},{})[_0x15d5('0x26')](function(){return _0x3d0094;});}else{return _0x3d0094;}})['catch'](function(_0x4a428c){logger[_0x15d5('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a428c);throw _0x4a428c;});}return _0x3d0094;})[_0x15d5('0x26')](respondWithResult(_0x35181e,0xc9))['catch'](handleError(_0x35181e,null));};
\ No newline at end of file
+var _0xdfab=['update','body','create','key','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','save','then','get','CannedAnswers','UserProfileResource','destroy','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','nolimit','order','sort','filter','where','include','rows','catch','params','keys','includeAll','merge','options','find'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xdfab,0xbf));var _0xbdfa=function(_0x4a3898,_0x4c9853){_0x4a3898=_0x4a3898-0x0;var _0x25ceb0=_0xdfab[_0x4a3898];return _0x25ceb0;};'use strict';var emlformat=require(_0xbdfa('0x0'));var rimraf=require(_0xbdfa('0x1'));var zipdir=require(_0xbdfa('0x2'));var jsonpatch=require(_0xbdfa('0x3'));var rp=require('request-promise');var moment=require(_0xbdfa('0x4'));var BPromise=require(_0xbdfa('0x5'));var Mustache=require(_0xbdfa('0x6'));var util=require(_0xbdfa('0x7'));var path=require(_0xbdfa('0x8'));var sox=require(_0xbdfa('0x9'));var csv=require(_0xbdfa('0xa'));var ejs=require(_0xbdfa('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbdfa('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbdfa('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbdfa('0xa'));var querystring=require(_0xbdfa('0xe'));var Papa=require(_0xbdfa('0xf'));var Redis=require(_0xbdfa('0x10'));var authService=require(_0xbdfa('0x11'));var qs=require(_0xbdfa('0x12'));var as=require(_0xbdfa('0x13'));var hardwareService=require(_0xbdfa('0x14'));var logger=require(_0xbdfa('0x15'))(_0xbdfa('0x16'));var utils=require(_0xbdfa('0x17'));var config=require(_0xbdfa('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0xbdfa('0x19'))['db'];function respondWithStatusCode(_0xc3b92f,_0x4451b1){_0x4451b1=_0x4451b1||0xcc;return function(_0x429ed5){if(_0x429ed5){return _0xc3b92f[_0xbdfa('0x1a')](_0x4451b1);}return _0xc3b92f[_0xbdfa('0x1b')](_0x4451b1)[_0xbdfa('0x1c')]();};}function respondWithResult(_0x22ec74,_0x72115a){_0x72115a=_0x72115a||0xc8;return function(_0x1d269f){if(_0x1d269f){return _0x22ec74[_0xbdfa('0x1b')](_0x72115a)[_0xbdfa('0x1d')](_0x1d269f);}};}function respondWithFilteredResult(_0x1f58bd,_0x30898a){return function(_0x142183){if(_0x142183){var _0x3eb00e=typeof _0x30898a['offset']===_0xbdfa('0x1e')&&typeof _0x30898a[_0xbdfa('0x1f')]===_0xbdfa('0x1e');var _0x1f35e0=_0x142183[_0xbdfa('0x20')];var _0x4fc7fe=_0x3eb00e?0x0:_0x30898a[_0xbdfa('0x21')];var _0x261abb=_0x3eb00e?_0x142183[_0xbdfa('0x20')]:_0x30898a['offset']+_0x30898a[_0xbdfa('0x1f')];var _0x1087b0;if(_0x261abb>=_0x1f35e0){_0x261abb=_0x1f35e0;_0x1087b0=0xc8;}else{_0x1087b0=0xce;}_0x1f58bd['status'](_0x1087b0);return _0x1f58bd[_0xbdfa('0x22')](_0xbdfa('0x23'),_0x4fc7fe+'-'+_0x261abb+'/'+_0x1f35e0)[_0xbdfa('0x1d')](_0x142183);}return null;};}function patchUpdates(_0x410fdf){return function(_0x58c459){try{jsonpatch[_0xbdfa('0x24')](_0x58c459,_0x410fdf,!![]);}catch(_0xbc2002){return BPromise['reject'](_0xbc2002);}return _0x58c459[_0xbdfa('0x25')]();};}function saveUpdates(_0xb0594a,_0x5e826c){return function(_0x411197){if(_0x411197){return _0x411197['update'](_0xb0594a)[_0xbdfa('0x26')](function(_0x3798b5){return _0x3798b5;});}return null;};}function removeEntity(_0x4c4193,_0x90c233){return function(_0x113967){if(_0x113967){return _0x113967['destroy']()[_0xbdfa('0x26')](function(){var _0x2ce22b=_0x113967[_0xbdfa('0x27')]({'plain':!![]});var _0x3b1bb6=_0xbdfa('0x28');return db[_0xbdfa('0x29')][_0xbdfa('0x2a')]({'where':{'type':_0x3b1bb6,'resourceId':_0x2ce22b['id']}})['then'](function(){return _0x113967;});})['then'](function(){_0x4c4193[_0xbdfa('0x1b')](0xcc)[_0xbdfa('0x1c')]();});}};}function handleEntityNotFound(_0x1ec8cb,_0x4146b4){return function(_0x225f63){if(!_0x225f63){_0x1ec8cb[_0xbdfa('0x1a')](0x194);}return _0x225f63;};}function handleError(_0x18efa5,_0x5623b9){_0x5623b9=_0x5623b9||0x1f4;return function(_0x4c9842){logger[_0xbdfa('0x2b')](_0x4c9842[_0xbdfa('0x2c')]);if(_0x4c9842[_0xbdfa('0x2d')]){delete _0x4c9842[_0xbdfa('0x2d')];}_0x18efa5[_0xbdfa('0x1b')](_0x5623b9)[_0xbdfa('0x2e')](_0x4c9842);};}exports[_0xbdfa('0x2f')]=function(_0x4a9a8b,_0x487da7){var _0x2e47c9={},_0x13bb24={},_0x36abcc={'count':0x0,'rows':[]};var _0x61c38c=_[_0xbdfa('0x30')](db[_0xbdfa('0x31')][_0xbdfa('0x32')],function(_0x2e840e){return{'name':_0x2e840e[_0xbdfa('0x33')],'type':_0x2e840e[_0xbdfa('0x34')]['key']};});_0x13bb24['model']=_[_0xbdfa('0x30')](_0x61c38c,_0xbdfa('0x2d'));_0x13bb24[_0xbdfa('0x35')]=_['keys'](_0x4a9a8b['query']);_0x13bb24[_0xbdfa('0x36')]=_[_0xbdfa('0x37')](_0x13bb24[_0xbdfa('0x38')],_0x13bb24[_0xbdfa('0x35')]);_0x2e47c9[_0xbdfa('0x39')]=_[_0xbdfa('0x37')](_0x13bb24[_0xbdfa('0x38')],qs[_0xbdfa('0x3a')](_0x4a9a8b[_0xbdfa('0x35')]['fields']));_0x2e47c9['attributes']=_0x2e47c9[_0xbdfa('0x39')]['length']?_0x2e47c9[_0xbdfa('0x39')]:_0x13bb24[_0xbdfa('0x38')];if(!_0x4a9a8b[_0xbdfa('0x35')]['hasOwnProperty'](_0xbdfa('0x3b'))){_0x2e47c9[_0xbdfa('0x1f')]=qs[_0xbdfa('0x1f')](_0x4a9a8b[_0xbdfa('0x35')][_0xbdfa('0x1f')]);_0x2e47c9[_0xbdfa('0x21')]=qs[_0xbdfa('0x21')](_0x4a9a8b[_0xbdfa('0x35')][_0xbdfa('0x21')]);}_0x2e47c9[_0xbdfa('0x3c')]=qs[_0xbdfa('0x3d')](_0x4a9a8b[_0xbdfa('0x35')]['sort']);_0x2e47c9['where']=qs[_0xbdfa('0x36')](_['pick'](_0x4a9a8b[_0xbdfa('0x35')],_0x13bb24[_0xbdfa('0x36')]),_0x61c38c);if(_0x4a9a8b[_0xbdfa('0x35')][_0xbdfa('0x3e')]){_0x2e47c9[_0xbdfa('0x3f')]=_['merge'](_0x2e47c9[_0xbdfa('0x3f')],{'$or':[{'key':{'$like':'%'+_0x4a9a8b[_0xbdfa('0x35')]['filter']+'%'}},{'value':{'$like':'%'+_0x4a9a8b['query'][_0xbdfa('0x3e')]+'%'}}]});}_0x2e47c9=_['merge']({},_0x2e47c9,_0x4a9a8b['options']);var _0x29524b={'where':_0x2e47c9[_0xbdfa('0x3f')]};return db[_0xbdfa('0x31')][_0xbdfa('0x20')](_0x29524b)[_0xbdfa('0x26')](function(_0x7cc2d6){_0x36abcc[_0xbdfa('0x20')]=_0x7cc2d6;if(_0x4a9a8b[_0xbdfa('0x35')]['includeAll']){_0x2e47c9[_0xbdfa('0x40')]=[{'all':!![]}];}return db[_0xbdfa('0x31')]['findAll'](_0x2e47c9);})[_0xbdfa('0x26')](function(_0x2b2580){_0x36abcc[_0xbdfa('0x41')]=_0x2b2580;return _0x36abcc;})[_0xbdfa('0x26')](respondWithFilteredResult(_0x487da7,_0x2e47c9))[_0xbdfa('0x42')](handleError(_0x487da7,null));};exports['show']=function(_0x934243,_0x3ca1b9){var _0x30607f={'raw':!![],'where':{'id':_0x934243[_0xbdfa('0x43')]['id']}},_0x192963={};_0x192963['model']=_[_0xbdfa('0x44')](db['CannedAnswer'][_0xbdfa('0x32')]);_0x192963[_0xbdfa('0x35')]=_['keys'](_0x934243[_0xbdfa('0x35')]);_0x192963[_0xbdfa('0x36')]=_[_0xbdfa('0x37')](_0x192963[_0xbdfa('0x38')],_0x192963['query']);_0x30607f['attributes']=_[_0xbdfa('0x37')](_0x192963[_0xbdfa('0x38')],qs[_0xbdfa('0x3a')](_0x934243[_0xbdfa('0x35')][_0xbdfa('0x3a')]));_0x30607f[_0xbdfa('0x39')]=_0x30607f['attributes']['length']?_0x30607f[_0xbdfa('0x39')]:_0x192963[_0xbdfa('0x38')];if(_0x934243[_0xbdfa('0x35')][_0xbdfa('0x45')]){_0x30607f[_0xbdfa('0x40')]=[{'all':!![]}];}_0x30607f=_[_0xbdfa('0x46')]({},_0x30607f,_0x934243[_0xbdfa('0x47')]);return db[_0xbdfa('0x31')][_0xbdfa('0x48')](_0x30607f)['then'](handleEntityNotFound(_0x3ca1b9,null))[_0xbdfa('0x26')](respondWithResult(_0x3ca1b9,null))[_0xbdfa('0x42')](handleError(_0x3ca1b9,null));};exports[_0xbdfa('0x49')]=function(_0xf48b63,_0x1f10ad){if(_0xf48b63[_0xbdfa('0x4a')]['id']){delete _0xf48b63[_0xbdfa('0x4a')]['id'];}return db[_0xbdfa('0x31')]['find']({'where':{'id':_0xf48b63[_0xbdfa('0x43')]['id']}})['then'](handleEntityNotFound(_0x1f10ad,null))['then'](saveUpdates(_0xf48b63[_0xbdfa('0x4a')],null))['then'](respondWithResult(_0x1f10ad,null))['catch'](handleError(_0x1f10ad,null));};exports[_0xbdfa('0x2a')]=function(_0x5784be,_0xc1f640){return db[_0xbdfa('0x31')]['find']({'where':{'id':_0x5784be['params']['id']}})['then'](handleEntityNotFound(_0xc1f640,null))[_0xbdfa('0x26')](removeEntity(_0xc1f640,null))[_0xbdfa('0x42')](handleError(_0xc1f640,null));};exports[_0xbdfa('0x4b')]=function(_0x56735e,_0x3dea58){var _0x21c979={'key':_0x56735e[_0xbdfa('0x4a')][_0xbdfa('0x4c')]};if(_0x56735e[_0xbdfa('0x4a')]['MailAccountId']){_0x21c979['MailAccountId']=_0x56735e['body']['MailAccountId'];}else if(_0x56735e[_0xbdfa('0x4a')][_0xbdfa('0x4d')]){_0x21c979[_0xbdfa('0x4d')]=_0x56735e[_0xbdfa('0x4a')][_0xbdfa('0x4d')];}else if(_0x56735e[_0xbdfa('0x4a')][_0xbdfa('0x4e')]){_0x21c979[_0xbdfa('0x4e')]=_0x56735e['body'][_0xbdfa('0x4e')];}else if(_0x56735e['body']['ChatWebsiteId']){_0x21c979[_0xbdfa('0x4f')]=_0x56735e[_0xbdfa('0x4a')]['ChatWebsiteId'];}return db[_0xbdfa('0x31')][_0xbdfa('0x48')]({'where':_0x21c979})[_0xbdfa('0x26')](function(_0x3cdad1){if(_0x3cdad1){throw new db[(_0xbdfa('0x50'))]['ValidationError'](_0xbdfa('0x51'));}return db['CannedAnswer'][_0xbdfa('0x4b')](_0x56735e['body']);})[_0xbdfa('0x26')](function(_0x982807){var _0x31b0cf=_0x56735e[_0xbdfa('0x52')][_0xbdfa('0x27')]({'plain':!![]});if(!_0x31b0cf)throw new Error(_0xbdfa('0x53'));if(_0x31b0cf[_0xbdfa('0x54')]==='user'){var _0x26d3ec=_0x982807[_0xbdfa('0x27')]({'plain':!![]});return db[_0xbdfa('0x55')]['find']({'where':{'name':_0xbdfa('0x28'),'userProfileId':_0x31b0cf[_0xbdfa('0x56')]},'raw':!![]})[_0xbdfa('0x26')](function(_0x23700b){if(_0x23700b&&_0x23700b[_0xbdfa('0x57')]===0x0){return db[_0xbdfa('0x29')][_0xbdfa('0x4b')]({'name':_0x26d3ec[_0xbdfa('0x2d')],'resourceId':_0x26d3ec['id'],'type':_0x23700b[_0xbdfa('0x2d')],'sectionId':_0x23700b['id']},{})[_0xbdfa('0x26')](function(){return _0x982807;});}else{return _0x982807;}})[_0xbdfa('0x42')](function(_0x4fe93a){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fe93a);throw _0x4fe93a;});}return _0x982807;})[_0xbdfa('0x26')](respondWithResult(_0x3dea58,0xc9))[_0xbdfa('0x42')](handleError(_0x3dea58,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 3a79b70..a1c5840 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 _0x3ccf=['define','tools_canned_answers','utf8mb4_unicode_ci','lodash','../../config/logger','bluebird','path','../../config/environment','./cannedAnswer.attributes','exports'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x3ccf,0x139));var _0xf3cc=function(_0x1f4f6e,_0x17910b){_0x1f4f6e=_0x1f4f6e-0x0;var _0x3f6000=_0x3ccf[_0x1f4f6e];return _0x3f6000;};'use strict';var _=require(_0xf3cc('0x0'));var util=require('util');var logger=require(_0xf3cc('0x1'))('api');var moment=require('moment');var BPromise=require(_0xf3cc('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf3cc('0x3'));var rimraf=require('rimraf');var config=require(_0xf3cc('0x4'));var attributes=require(_0xf3cc('0x5'));module[_0xf3cc('0x6')]=function(_0x2af784,_0x320e4f){return _0x2af784[_0xf3cc('0x7')]('CannedAnswer',attributes,{'tableName':_0xf3cc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf3cc('0x9')});};
\ No newline at end of file
+var _0xd983=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','define','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0xd983,0x10b));var _0x3d98=function(_0xab6c34,_0x47a84b){_0xab6c34=_0xab6c34-0x0;var _0xe47dd5=_0xd983[_0xab6c34];return _0xe47dd5;};'use strict';var _=require(_0x3d98('0x0'));var util=require(_0x3d98('0x1'));var logger=require(_0x3d98('0x2'))(_0x3d98('0x3'));var moment=require(_0x3d98('0x4'));var BPromise=require(_0x3d98('0x5'));var rp=require(_0x3d98('0x6'));var fs=require('fs');var path=require(_0x3d98('0x7'));var rimraf=require(_0x3d98('0x8'));var config=require(_0x3d98('0x9'));var attributes=require(_0x3d98('0xa'));module['exports']=function(_0x2cebc7,_0x5f2375){return _0x2cebc7[_0x3d98('0xb')](_0x3d98('0xc'),attributes,{'tableName':_0x3d98('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x3d98('0xe')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index bacb063..adc954b 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(_0x24ca70,_0x2046ae){var _0xaccbd7=function(_0x5293a3){while(--_0x5293a3){_0x24ca70['push'](_0x24ca70['shift']());}};_0xaccbd7(++_0x2046ae);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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(_0x2c5c3d,_0x31e77c){var _0x2f8e9f=function(_0xc7a630){while(--_0xc7a630){_0x2c5c3d['push'](_0x2c5c3d['shift']());}};_0x2f8e9f(++_0x31e77c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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 aaa61ed..cd9f97a 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 _0xd7c2=['delete','multer','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','put'];(function(_0x1e381c,_0x47b5b9){var _0x9b5ea9=function(_0x6d2be5){while(--_0x6d2be5){_0x1e381c['push'](_0x1e381c['shift']());}};_0x9b5ea9(++_0x47b5b9);}(_0xd7c2,0x112));var _0x2d7c=function(_0xbd2a41,_0x2c3cd8){_0xbd2a41=_0xbd2a41-0x0;var _0x5578fe=_0xd7c2[_0xbd2a41];return _0x5578fe;};'use strict';var multer=require(_0x2d7c('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2d7c('0x1'));var router=express[_0x2d7c('0x2')]();var fs_extra=require(_0x2d7c('0x3'));var auth=require(_0x2d7c('0x4'));var interaction=require(_0x2d7c('0x5'));var config=require(_0x2d7c('0x6'));var controller=require(_0x2d7c('0x7'));router[_0x2d7c('0x8')]('/',auth[_0x2d7c('0x9')](),controller['index']);router[_0x2d7c('0x8')](_0x2d7c('0xa'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x2d7c('0xb')](_0x2d7c('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x2d7c('0xc')](_0x2d7c('0xa'),auth[_0x2d7c('0x9')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x22f0=['../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra'];(function(_0x172d58,_0x4e184a){var _0x3c1a30=function(_0x4508db){while(--_0x4508db){_0x172d58['push'](_0x172d58['shift']());}};_0x3c1a30(++_0x4e184a);}(_0x22f0,0x1ed));var _0x022f=function(_0x484a56,_0x18b9d4){_0x484a56=_0x484a56-0x0;var _0x34c796=_0x22f0[_0x484a56];return _0x34c796;};'use strict';var multer=require(_0x022f('0x0'));var util=require(_0x022f('0x1'));var path=require(_0x022f('0x2'));var timeout=require(_0x022f('0x3'));var express=require(_0x022f('0x4'));var router=express[_0x022f('0x5')]();var fs_extra=require(_0x022f('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0x022f('0x7'));var config=require('../../config/environment');var controller=require(_0x022f('0x8'));router[_0x022f('0x9')]('/',auth[_0x022f('0xa')](),controller[_0x022f('0xb')]);router['get'](_0x022f('0xc'),auth[_0x022f('0xa')](),controller[_0x022f('0xd')]);router[_0x022f('0xe')]('/',auth[_0x022f('0xa')](),controller['create']);router[_0x022f('0xf')]('/:id',auth[_0x022f('0xa')](),controller[_0x022f('0x10')]);router[_0x022f('0x11')](_0x022f('0xc'),auth['isAuthenticated'](),controller[_0x022f('0x12')]);module[_0x022f('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 4111ceb..c22f2b6 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 _0x9b5b=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x52578c,_0x51113a){var _0x4e9d7b=function(_0x2e28c0){while(--_0x2e28c0){_0x52578c['push'](_0x52578c['shift']());}};_0x4e9d7b(++_0x51113a);}(_0x9b5b,0x7f));var _0xb9b5=function(_0x3d6b61,_0x5e9be7){_0x3d6b61=_0x3d6b61-0x0;var _0x5a860d=_0x9b5b[_0x3d6b61];return _0x5a860d;};'use strict';var Sequelize=require(_0xb9b5('0x0'));module[_0xb9b5('0x1')]={'calldate':{'type':Sequelize[_0xb9b5('0x2')],'allowNull':![],'defaultValue':_0xb9b5('0x3')},'clid':{'type':Sequelize[_0xb9b5('0x4')]},'src':{'type':Sequelize[_0xb9b5('0x4')]},'dst':{'type':Sequelize[_0xb9b5('0x4')]},'dcontext':{'type':Sequelize[_0xb9b5('0x4')]},'channel':{'type':Sequelize[_0xb9b5('0x4')]},'dstchannel':{'type':Sequelize['STRING']},'lastapp':{'type':Sequelize[_0xb9b5('0x4')]},'lastdata':{'type':Sequelize[_0xb9b5('0x4')]},'duration':{'type':Sequelize[_0xb9b5('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xb9b5('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xb9b5('0x4')]},'linkedid':{'type':Sequelize[_0xb9b5('0x4')]},'sequence':{'type':Sequelize[_0xb9b5('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb9b5('0x4')]},'tag':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x6f0d=['DATE','1970-01-01\x2000:00:01','STRING','INTEGER','exports'];(function(_0x1cfd43,_0xfe10a7){var _0x8fd096=function(_0x3b2ea8){while(--_0x3b2ea8){_0x1cfd43['push'](_0x1cfd43['shift']());}};_0x8fd096(++_0xfe10a7);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x1d9d69,_0x3fcd1e){_0x1d9d69=_0x1d9d69-0x0;var _0x5ccf91=_0x6f0d[_0x1d9d69];return _0x5ccf91;};'use strict';var Sequelize=require('sequelize');module[_0xd6f0('0x0')]={'calldate':{'type':Sequelize[_0xd6f0('0x1')],'allowNull':![],'defaultValue':_0xd6f0('0x2')},'clid':{'type':Sequelize[_0xd6f0('0x3')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xd6f0('0x3')]},'dcontext':{'type':Sequelize[_0xd6f0('0x3')]},'channel':{'type':Sequelize[_0xd6f0('0x3')]},'dstchannel':{'type':Sequelize[_0xd6f0('0x3')]},'lastapp':{'type':Sequelize[_0xd6f0('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xd6f0('0x4')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd6f0('0x3')]},'amaflags':{'type':Sequelize[_0xd6f0('0x4')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd6f0('0x3')]},'userfield':{'type':Sequelize[_0xd6f0('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xd6f0('0x3')]},'peeraccount':{'type':Sequelize[_0xd6f0('0x3')]},'type':{'type':Sequelize[_0xd6f0('0x3')]},'tag':{'type':Sequelize[_0xd6f0('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index 51dafe9..bdd7620 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 _0xc03e=['../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','Content-Range','apply','reject','save','update','then','error','stack','name','send','index','map','Cdr','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','include','rows','catch','params','find','create','body','describe','eml-format','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','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'];(function(_0x361ba6,_0x4c37b5){var _0x11ee21=function(_0x1afb1e){while(--_0x1afb1e){_0x361ba6['push'](_0x361ba6['shift']());}};_0x11ee21(++_0x4c37b5);}(_0xc03e,0x15a));var _0xec03=function(_0x1a9e78,_0x180720){_0x1a9e78=_0x1a9e78-0x0;var _0x113e06=_0xc03e[_0x1a9e78];return _0x113e06;};'use strict';var emlformat=require(_0xec03('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xec03('0x1'));var rp=require('request-promise');var moment=require(_0xec03('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xec03('0x3'));var util=require(_0xec03('0x4'));var path=require(_0xec03('0x5'));var sox=require(_0xec03('0x6'));var csv=require(_0xec03('0x7'));var ejs=require(_0xec03('0x8'));var fs=require('fs');var fs_extra=require(_0xec03('0x9'));var _=require(_0xec03('0xa'));var squel=require(_0xec03('0xb'));var crypto=require('crypto');var jsforce=require(_0xec03('0xc'));var deskjs=require(_0xec03('0xd'));var toCsv=require(_0xec03('0x7'));var querystring=require(_0xec03('0xe'));var Papa=require('papaparse');var Redis=require(_0xec03('0xf'));var authService=require(_0xec03('0x10'));var qs=require(_0xec03('0x11'));var as=require(_0xec03('0x12'));var hardwareService=require(_0xec03('0x13'));var logger=require(_0xec03('0x14'))(_0xec03('0x15'));var utils=require(_0xec03('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0xec03('0x17'));var db=require(_0xec03('0x18'))['db'];function respondWithStatusCode(_0x398720,_0x2f65a1){_0x2f65a1=_0x2f65a1||0xcc;return function(_0x9908ef){if(_0x9908ef){return _0x398720[_0xec03('0x19')](_0x2f65a1);}return _0x398720[_0xec03('0x1a')](_0x2f65a1)[_0xec03('0x1b')]();};}function respondWithResult(_0x4ba43a,_0x555447){_0x555447=_0x555447||0xc8;return function(_0x5ca0e2){if(_0x5ca0e2){return _0x4ba43a[_0xec03('0x1a')](_0x555447)[_0xec03('0x1c')](_0x5ca0e2);}};}function respondWithFilteredResult(_0x3501ab,_0x515680){return function(_0x28bb4f){if(_0x28bb4f){var _0xbe85e6=typeof _0x515680[_0xec03('0x1d')]===_0xec03('0x1e')&&typeof _0x515680['limit']===_0xec03('0x1e');var _0x52f6ae=_0x28bb4f[_0xec03('0x1f')];var _0x5e8ae2=_0xbe85e6?0x0:_0x515680[_0xec03('0x1d')];var _0x5b3e04=_0xbe85e6?_0x28bb4f['count']:_0x515680[_0xec03('0x1d')]+_0x515680[_0xec03('0x20')];var _0xefa268;if(_0x5b3e04>=_0x52f6ae){_0x5b3e04=_0x52f6ae;_0xefa268=0xc8;}else{_0xefa268=0xce;}_0x3501ab[_0xec03('0x1a')](_0xefa268);return _0x3501ab['set'](_0xec03('0x21'),_0x5e8ae2+'-'+_0x5b3e04+'/'+_0x52f6ae)['json'](_0x28bb4f);}return null;};}function patchUpdates(_0x16ade3){return function(_0x253910){try{jsonpatch[_0xec03('0x22')](_0x253910,_0x16ade3,!![]);}catch(_0x33a167){return BPromise[_0xec03('0x23')](_0x33a167);}return _0x253910[_0xec03('0x24')]();};}function saveUpdates(_0x3a44df,_0x3b6ddf){return function(_0x5df6cc){if(_0x5df6cc){return _0x5df6cc[_0xec03('0x25')](_0x3a44df)[_0xec03('0x26')](function(_0xa16d53){return _0xa16d53;});}return null;};}function removeEntity(_0x76b813,_0x33de1e){return function(_0x15ef87){if(_0x15ef87){return _0x15ef87['destroy']()[_0xec03('0x26')](function(){_0x76b813[_0xec03('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2bfcf6,_0xa5b580){return function(_0x26875e){if(!_0x26875e){_0x2bfcf6[_0xec03('0x19')](0x194);}return _0x26875e;};}function handleError(_0x1c6870,_0x581322){_0x581322=_0x581322||0x1f4;return function(_0x73cc4f){logger[_0xec03('0x27')](_0x73cc4f[_0xec03('0x28')]);if(_0x73cc4f[_0xec03('0x29')]){delete _0x73cc4f[_0xec03('0x29')];}_0x1c6870['status'](_0x581322)[_0xec03('0x2a')](_0x73cc4f);};}exports[_0xec03('0x2b')]=function(_0x49f9ab,_0x530251){var _0x2063ba={},_0x12b5c9={},_0x35a9eb={'count':0x0,'rows':[]};var _0x872f98=_[_0xec03('0x2c')](db[_0xec03('0x2d')][_0xec03('0x2e')],function(_0x28753c){return{'name':_0x28753c['fieldName'],'type':_0x28753c[_0xec03('0x2f')][_0xec03('0x30')]};});_0x12b5c9[_0xec03('0x31')]=_[_0xec03('0x2c')](_0x872f98,_0xec03('0x29'));_0x12b5c9[_0xec03('0x32')]=_[_0xec03('0x33')](_0x49f9ab[_0xec03('0x32')]);_0x12b5c9[_0xec03('0x34')]=_['intersection'](_0x12b5c9['model'],_0x12b5c9['query']);_0x2063ba[_0xec03('0x35')]=_[_0xec03('0x36')](_0x12b5c9[_0xec03('0x31')],qs[_0xec03('0x37')](_0x49f9ab['query']['fields']));_0x2063ba['attributes']=_0x2063ba['attributes'][_0xec03('0x38')]?_0x2063ba[_0xec03('0x35')]:_0x12b5c9[_0xec03('0x31')];if(!_0x49f9ab[_0xec03('0x32')][_0xec03('0x39')](_0xec03('0x3a'))){_0x2063ba[_0xec03('0x20')]=qs[_0xec03('0x20')](_0x49f9ab[_0xec03('0x32')][_0xec03('0x20')]);_0x2063ba[_0xec03('0x1d')]=qs[_0xec03('0x1d')](_0x49f9ab['query'][_0xec03('0x1d')]);}_0x2063ba[_0xec03('0x3b')]=qs[_0xec03('0x3c')](_0x49f9ab['query'][_0xec03('0x3c')]);_0x2063ba[_0xec03('0x3d')]=qs[_0xec03('0x34')](_[_0xec03('0x3e')](_0x49f9ab[_0xec03('0x32')],_0x12b5c9[_0xec03('0x34')]),_0x872f98);if(_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]){_0x2063ba[_0xec03('0x3d')]=_[_0xec03('0x40')](_0x2063ba[_0xec03('0x3d')],{'$or':_['map'](_0x872f98,function(_0x25286a){if(_0x25286a[_0xec03('0x2f')]!==_0xec03('0x41')){var _0x3d6d70={};_0x3d6d70[_0x25286a[_0xec03('0x29')]]={'$like':'%'+_0x49f9ab[_0xec03('0x32')][_0xec03('0x3f')]+'%'};return _0x3d6d70;}})});}_0x2063ba=_[_0xec03('0x40')]({},_0x2063ba,_0x49f9ab['options']);var _0x454e91={'where':_0x2063ba['where']};return db['Cdr'][_0xec03('0x1f')](_0x454e91)['then'](function(_0x548b81){_0x35a9eb[_0xec03('0x1f')]=_0x548b81;if(_0x49f9ab[_0xec03('0x32')]['includeAll']){_0x2063ba[_0xec03('0x42')]=[{'all':!![]}];}return db['Cdr']['findAll'](_0x2063ba);})['then'](function(_0x494fec){_0x35a9eb[_0xec03('0x43')]=_0x494fec;return _0x35a9eb;})[_0xec03('0x26')](respondWithFilteredResult(_0x530251,_0x2063ba))[_0xec03('0x44')](handleError(_0x530251,null));};exports['show']=function(_0x1b1aea,_0x3f2522){var _0xe03df3={'raw':!![],'where':{'id':_0x1b1aea[_0xec03('0x45')]['id']}},_0x14a429={};_0x14a429[_0xec03('0x31')]=_[_0xec03('0x33')](db[_0xec03('0x2d')][_0xec03('0x2e')]);_0x14a429['query']=_[_0xec03('0x33')](_0x1b1aea[_0xec03('0x32')]);_0x14a429[_0xec03('0x34')]=_[_0xec03('0x36')](_0x14a429['model'],_0x14a429[_0xec03('0x32')]);_0xe03df3[_0xec03('0x35')]=_[_0xec03('0x36')](_0x14a429[_0xec03('0x31')],qs[_0xec03('0x37')](_0x1b1aea[_0xec03('0x32')]['fields']));_0xe03df3['attributes']=_0xe03df3[_0xec03('0x35')][_0xec03('0x38')]?_0xe03df3[_0xec03('0x35')]:_0x14a429[_0xec03('0x31')];if(_0x1b1aea[_0xec03('0x32')]['includeAll']){_0xe03df3['include']=[{'all':!![]}];}_0xe03df3=_[_0xec03('0x40')]({},_0xe03df3,_0x1b1aea['options']);return db[_0xec03('0x2d')][_0xec03('0x46')](_0xe03df3)[_0xec03('0x26')](handleEntityNotFound(_0x3f2522,null))[_0xec03('0x26')](respondWithResult(_0x3f2522,null))['catch'](handleError(_0x3f2522,null));};exports[_0xec03('0x47')]=function(_0x14a61c,_0x3c7e18){return db[_0xec03('0x2d')]['create'](_0x14a61c[_0xec03('0x48')],{})['then'](respondWithResult(_0x3c7e18,0xc9))[_0xec03('0x44')](handleError(_0x3c7e18,null));};exports[_0xec03('0x25')]=function(_0xdb9a99,_0x1c6b87){if(_0xdb9a99[_0xec03('0x48')]['id']){delete _0xdb9a99[_0xec03('0x48')]['id'];}return db[_0xec03('0x2d')]['find']({'where':{'id':_0xdb9a99[_0xec03('0x45')]['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x1c6b87,null))[_0xec03('0x26')](saveUpdates(_0xdb9a99[_0xec03('0x48')],null))['then'](respondWithResult(_0x1c6b87,null))[_0xec03('0x44')](handleError(_0x1c6b87,null));};exports['destroy']=function(_0xe0e874,_0x3825f9){return db[_0xec03('0x2d')][_0xec03('0x46')]({'where':{'id':_0xe0e874['params']['id']}})[_0xec03('0x26')](handleEntityNotFound(_0x3825f9,null))[_0xec03('0x26')](removeEntity(_0x3825f9,null))[_0xec03('0x44')](handleError(_0x3825f9,null));};exports[_0xec03('0x49')]=function(_0x32a5af,_0x5b1339){return db[_0xec03('0x2d')][_0xec03('0x49')]()[_0xec03('0x26')](respondWithResult(_0x5b1339,null))['catch'](handleError(_0x5b1339,null));};
\ No newline at end of file
+var _0x86f4=['bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','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','sendStatus','end','json','offset','undefined','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','Cdr','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x300487,_0x4c9b23){var _0x222c93=function(_0x5d130d){while(--_0x5d130d){_0x300487['push'](_0x300487['shift']());}};_0x222c93(++_0x4c9b23);}(_0x86f4,0x18a));var _0x486f=function(_0x362e3f,_0x5f0ef2){_0x362e3f=_0x362e3f-0x0;var _0x2a5f3f=_0x86f4[_0x362e3f];return _0x2a5f3f;};'use strict';var emlformat=require(_0x486f('0x0'));var rimraf=require(_0x486f('0x1'));var zipdir=require(_0x486f('0x2'));var jsonpatch=require(_0x486f('0x3'));var rp=require(_0x486f('0x4'));var moment=require(_0x486f('0x5'));var BPromise=require(_0x486f('0x6'));var Mustache=require('mustache');var util=require(_0x486f('0x7'));var path=require(_0x486f('0x8'));var sox=require('sox');var csv=require(_0x486f('0x9'));var ejs=require(_0x486f('0xa'));var fs=require('fs');var fs_extra=require(_0x486f('0xb'));var _=require(_0x486f('0xc'));var squel=require(_0x486f('0xd'));var crypto=require(_0x486f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x486f('0xf'));var toCsv=require(_0x486f('0x9'));var querystring=require(_0x486f('0x10'));var Papa=require(_0x486f('0x11'));var Redis=require(_0x486f('0x12'));var authService=require(_0x486f('0x13'));var qs=require(_0x486f('0x14'));var as=require(_0x486f('0x15'));var hardwareService=require(_0x486f('0x16'));var logger=require(_0x486f('0x17'))(_0x486f('0x18'));var utils=require(_0x486f('0x19'));var config=require(_0x486f('0x1a'));var licenseUtil=require(_0x486f('0x1b'));var db=require(_0x486f('0x1c'))['db'];function respondWithStatusCode(_0x4312fb,_0x1c4e55){_0x1c4e55=_0x1c4e55||0xcc;return function(_0x4eb4f9){if(_0x4eb4f9){return _0x4312fb[_0x486f('0x1d')](_0x1c4e55);}return _0x4312fb['status'](_0x1c4e55)[_0x486f('0x1e')]();};}function respondWithResult(_0x2cc608,_0x1ac871){_0x1ac871=_0x1ac871||0xc8;return function(_0x50bee8){if(_0x50bee8){return _0x2cc608['status'](_0x1ac871)[_0x486f('0x1f')](_0x50bee8);}};}function respondWithFilteredResult(_0x3a4fef,_0x51334f){return function(_0x16830e){if(_0x16830e){var _0x2ab753=typeof _0x51334f[_0x486f('0x20')]==='undefined'&&typeof _0x51334f['limit']===_0x486f('0x21');var _0x3eeae0=_0x16830e[_0x486f('0x22')];var _0x39bfac=_0x2ab753?0x0:_0x51334f['offset'];var _0x59deb8=_0x2ab753?_0x16830e[_0x486f('0x22')]:_0x51334f[_0x486f('0x20')]+_0x51334f[_0x486f('0x23')];var _0x20a1f7;if(_0x59deb8>=_0x3eeae0){_0x59deb8=_0x3eeae0;_0x20a1f7=0xc8;}else{_0x20a1f7=0xce;}_0x3a4fef[_0x486f('0x24')](_0x20a1f7);return _0x3a4fef[_0x486f('0x25')](_0x486f('0x26'),_0x39bfac+'-'+_0x59deb8+'/'+_0x3eeae0)[_0x486f('0x1f')](_0x16830e);}return null;};}function patchUpdates(_0xe0b1cc){return function(_0x3d79bc){try{jsonpatch[_0x486f('0x27')](_0x3d79bc,_0xe0b1cc,!![]);}catch(_0x4ccac0){return BPromise[_0x486f('0x28')](_0x4ccac0);}return _0x3d79bc[_0x486f('0x29')]();};}function saveUpdates(_0x26a909,_0x4a0eb5){return function(_0x4d784e){if(_0x4d784e){return _0x4d784e[_0x486f('0x2a')](_0x26a909)[_0x486f('0x2b')](function(_0x16a530){return _0x16a530;});}return null;};}function removeEntity(_0x14b309,_0x351f81){return function(_0x26822b){if(_0x26822b){return _0x26822b[_0x486f('0x2c')]()[_0x486f('0x2b')](function(){_0x14b309[_0x486f('0x24')](0xcc)[_0x486f('0x1e')]();});}};}function handleEntityNotFound(_0x2e983b,_0x71a26f){return function(_0x387462){if(!_0x387462){_0x2e983b[_0x486f('0x1d')](0x194);}return _0x387462;};}function handleError(_0x8b3277,_0x30b322){_0x30b322=_0x30b322||0x1f4;return function(_0x6f1e8e){logger[_0x486f('0x2d')](_0x6f1e8e[_0x486f('0x2e')]);if(_0x6f1e8e[_0x486f('0x2f')]){delete _0x6f1e8e[_0x486f('0x2f')];}_0x8b3277[_0x486f('0x24')](_0x30b322)['send'](_0x6f1e8e);};}exports['index']=function(_0x52fb3a,_0x5b4718){var _0x173512={},_0x5c994a={},_0x2003a3={'count':0x0,'rows':[]};var _0x3ffa45=_['map'](db[_0x486f('0x30')]['rawAttributes'],function(_0x1f9dee){return{'name':_0x1f9dee[_0x486f('0x31')],'type':_0x1f9dee[_0x486f('0x32')][_0x486f('0x33')]};});_0x5c994a[_0x486f('0x34')]=_[_0x486f('0x35')](_0x3ffa45,'name');_0x5c994a[_0x486f('0x36')]=_[_0x486f('0x37')](_0x52fb3a[_0x486f('0x36')]);_0x5c994a[_0x486f('0x38')]=_[_0x486f('0x39')](_0x5c994a[_0x486f('0x34')],_0x5c994a[_0x486f('0x36')]);_0x173512[_0x486f('0x3a')]=_['intersection'](_0x5c994a[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x52fb3a['query'][_0x486f('0x3b')]));_0x173512[_0x486f('0x3a')]=_0x173512[_0x486f('0x3a')][_0x486f('0x3c')]?_0x173512[_0x486f('0x3a')]:_0x5c994a['model'];if(!_0x52fb3a[_0x486f('0x36')][_0x486f('0x3d')](_0x486f('0x3e'))){_0x173512[_0x486f('0x23')]=qs[_0x486f('0x23')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x23')]);_0x173512['offset']=qs[_0x486f('0x20')](_0x52fb3a[_0x486f('0x36')][_0x486f('0x20')]);}_0x173512['order']=qs['sort'](_0x52fb3a[_0x486f('0x36')][_0x486f('0x3f')]);_0x173512['where']=qs[_0x486f('0x38')](_['pick'](_0x52fb3a[_0x486f('0x36')],_0x5c994a[_0x486f('0x38')]),_0x3ffa45);if(_0x52fb3a['query']['filter']){_0x173512[_0x486f('0x40')]=_[_0x486f('0x41')](_0x173512[_0x486f('0x40')],{'$or':_[_0x486f('0x35')](_0x3ffa45,function(_0xdedd85){if(_0xdedd85[_0x486f('0x32')]!==_0x486f('0x42')){var _0x1742e0={};_0x1742e0[_0xdedd85[_0x486f('0x2f')]]={'$like':'%'+_0x52fb3a[_0x486f('0x36')][_0x486f('0x43')]+'%'};return _0x1742e0;}})});}_0x173512=_[_0x486f('0x41')]({},_0x173512,_0x52fb3a[_0x486f('0x44')]);var _0x43d9be={'where':_0x173512['where']};return db[_0x486f('0x30')][_0x486f('0x22')](_0x43d9be)['then'](function(_0x12f7dc){_0x2003a3[_0x486f('0x22')]=_0x12f7dc;if(_0x52fb3a[_0x486f('0x36')][_0x486f('0x45')]){_0x173512[_0x486f('0x46')]=[{'all':!![]}];}return db[_0x486f('0x30')][_0x486f('0x47')](_0x173512);})[_0x486f('0x2b')](function(_0x3205e0){_0x2003a3['rows']=_0x3205e0;return _0x2003a3;})['then'](respondWithFilteredResult(_0x5b4718,_0x173512))[_0x486f('0x48')](handleError(_0x5b4718,null));};exports[_0x486f('0x49')]=function(_0x3cf897,_0x42ef68){var _0x2937a6={'raw':!![],'where':{'id':_0x3cf897[_0x486f('0x4a')]['id']}},_0x250979={};_0x250979[_0x486f('0x34')]=_[_0x486f('0x37')](db['Cdr'][_0x486f('0x4b')]);_0x250979[_0x486f('0x36')]=_[_0x486f('0x37')](_0x3cf897[_0x486f('0x36')]);_0x250979['filters']=_[_0x486f('0x39')](_0x250979['model'],_0x250979[_0x486f('0x36')]);_0x2937a6[_0x486f('0x3a')]=_[_0x486f('0x39')](_0x250979[_0x486f('0x34')],qs[_0x486f('0x3b')](_0x3cf897[_0x486f('0x36')]['fields']));_0x2937a6['attributes']=_0x2937a6[_0x486f('0x3a')][_0x486f('0x3c')]?_0x2937a6[_0x486f('0x3a')]:_0x250979[_0x486f('0x34')];if(_0x3cf897['query'][_0x486f('0x45')]){_0x2937a6[_0x486f('0x46')]=[{'all':!![]}];}_0x2937a6=_[_0x486f('0x41')]({},_0x2937a6,_0x3cf897['options']);return db[_0x486f('0x30')][_0x486f('0x4c')](_0x2937a6)[_0x486f('0x2b')](handleEntityNotFound(_0x42ef68,null))[_0x486f('0x2b')](respondWithResult(_0x42ef68,null))[_0x486f('0x48')](handleError(_0x42ef68,null));};exports[_0x486f('0x4d')]=function(_0xb65e98,_0x21f222){return db['Cdr'][_0x486f('0x4d')](_0xb65e98['body'],{})[_0x486f('0x2b')](respondWithResult(_0x21f222,0xc9))[_0x486f('0x48')](handleError(_0x21f222,null));};exports[_0x486f('0x2a')]=function(_0x1055cf,_0x34033e){if(_0x1055cf[_0x486f('0x4e')]['id']){delete _0x1055cf['body']['id'];}return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x1055cf[_0x486f('0x4a')]['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x34033e,null))[_0x486f('0x2b')](saveUpdates(_0x1055cf[_0x486f('0x4e')],null))[_0x486f('0x2b')](respondWithResult(_0x34033e,null))[_0x486f('0x48')](handleError(_0x34033e,null));};exports[_0x486f('0x2c')]=function(_0x5cd989,_0x300de9){return db[_0x486f('0x30')][_0x486f('0x4c')]({'where':{'id':_0x5cd989['params']['id']}})[_0x486f('0x2b')](handleEntityNotFound(_0x300de9,null))[_0x486f('0x2b')](removeEntity(_0x300de9,null))[_0x486f('0x48')](handleError(_0x300de9,null));};exports['describe']=function(_0x195c9c,_0x372d2f){return db[_0x486f('0x30')][_0x486f('0x4f')]()['then'](respondWithResult(_0x372d2f,null))['catch'](handleError(_0x372d2f,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 90d524b..13cf416 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(_0x3709e3,_0x5ca0a1){var _0x831ec0=function(_0x2efe21){while(--_0x2efe21){_0x3709e3['push'](_0x3709e3['shift']());}};_0x831ec0(++_0x5ca0a1);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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 _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5b0c71,_0x516927){var _0x23fd6e=function(_0x385eea){while(--_0x385eea){_0x5b0c71['push'](_0x5b0c71['shift']());}};_0x23fd6e(++_0x516927);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'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
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index c3272d2..552b20a 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 _0x7efa=['message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3266a6,_0x129966){var _0x10ee38=function(_0x516e68){while(--_0x516e68){_0x3266a6['push'](_0x3266a6['shift']());}};_0x10ee38(++_0x129966);}(_0x7efa,0x79));var _0xa7ef=function(_0x258fb0,_0x5362dc){_0x258fb0=_0x258fb0-0x0;var _0x4d1afe=_0x7efa[_0x258fb0];return _0x4d1afe;};'use strict';var _=require(_0xa7ef('0x0'));var util=require(_0xa7ef('0x1'));var moment=require(_0xa7ef('0x2'));var BPromise=require(_0xa7ef('0x3'));var rs=require(_0xa7ef('0x4'));var fs=require('fs');var Redis=require(_0xa7ef('0x5'));var db=require(_0xa7ef('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xa7ef('0x7'));var jayson=require(_0xa7ef('0x8'));var client=jayson[_0xa7ef('0x9')][_0xa7ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xe9b327,_0x70984f,_0x5632b9){return new BPromise(function(_0x58cc27,_0x4ac528){return client['request'](_0xe9b327,_0x5632b9)[_0xa7ef('0xb')](function(_0x280de6){logger[_0xa7ef('0xc')](_0xa7ef('0xd'),_0x70984f,_0xa7ef('0xe'));logger[_0xa7ef('0xf')](_0xa7ef('0x10'),_0x70984f,_0xa7ef('0xe'),JSON[_0xa7ef('0x11')](_0x280de6));if(_0x280de6['error']){if(_0x280de6[_0xa7ef('0x12')]['code']===0x1f4){logger[_0xa7ef('0x12')]('Cdr,\x20%s,\x20%s',_0x70984f,_0x280de6[_0xa7ef('0x12')][_0xa7ef('0x13')]);return _0x4ac528(_0x280de6[_0xa7ef('0x12')]['message']);}logger[_0xa7ef('0x12')](_0xa7ef('0xd'),_0x70984f,_0x280de6[_0xa7ef('0x12')][_0xa7ef('0x13')]);return _0x58cc27(_0x280de6[_0xa7ef('0x12')]['message']);}else{logger[_0xa7ef('0xc')]('Cdr,\x20%s,\x20%s',_0x70984f,'request\x20sent');_0x58cc27(_0x280de6['result'][_0xa7ef('0x13')]);}})['catch'](function(_0x24b9ff){logger['error'](_0xa7ef('0xd'),_0x70984f,_0x24b9ff);_0x4ac528(_0x24b9ff);});});}
\ No newline at end of file
+var _0x16f2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x17aa6b,_0x5edff9){var _0x3401ca=function(_0x58404d){while(--_0x58404d){_0x17aa6b['push'](_0x17aa6b['shift']());}};_0x3401ca(++_0x5edff9);}(_0x16f2,0x159));var _0x216f=function(_0x1b1365,_0x205568){_0x1b1365=_0x1b1365-0x0;var _0x5edfd8=_0x16f2[_0x1b1365];return _0x5edfd8;};'use strict';var _=require(_0x216f('0x0'));var util=require(_0x216f('0x1'));var moment=require(_0x216f('0x2'));var BPromise=require('bluebird');var rs=require(_0x216f('0x3'));var fs=require('fs');var Redis=require(_0x216f('0x4'));var db=require(_0x216f('0x5'))['db'];var utils=require(_0x216f('0x6'));var logger=require(_0x216f('0x7'))(_0x216f('0x8'));var config=require(_0x216f('0x9'));var jayson=require(_0x216f('0xa'));var client=jayson[_0x216f('0xb')][_0x216f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x393760,_0x99c163,_0x28ea72){return new BPromise(function(_0x439f72,_0x44b7aa){return client[_0x216f('0xd')](_0x393760,_0x28ea72)['then'](function(_0x49a1fe){logger[_0x216f('0xe')](_0x216f('0xf'),_0x99c163,_0x216f('0x10'));logger[_0x216f('0x11')](_0x216f('0x12'),_0x99c163,'request\x20sent',JSON[_0x216f('0x13')](_0x49a1fe));if(_0x49a1fe[_0x216f('0x14')]){if(_0x49a1fe[_0x216f('0x14')][_0x216f('0x15')]===0x1f4){logger[_0x216f('0x14')](_0x216f('0xf'),_0x99c163,_0x49a1fe[_0x216f('0x14')]['message']);return _0x44b7aa(_0x49a1fe[_0x216f('0x14')][_0x216f('0x16')]);}logger[_0x216f('0x14')](_0x216f('0xf'),_0x99c163,_0x49a1fe[_0x216f('0x14')]['message']);return _0x439f72(_0x49a1fe[_0x216f('0x14')][_0x216f('0x16')]);}else{logger['info'](_0x216f('0xf'),_0x99c163,_0x216f('0x10'));_0x439f72(_0x49a1fe[_0x216f('0x17')]['message']);}})[_0x216f('0x18')](function(_0x1658eb){logger[_0x216f('0x14')](_0x216f('0xf'),_0x99c163,_0x1658eb);_0x44b7aa(_0x1658eb);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index fbf38d3..4f33974 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xb10b=['../../components/interaction/service','../../config/environment','./cdr.controller','get','index','isAuthenticated','describe','/:id','show','post','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service'];(function(_0x12ce04,_0xe0c750){var _0x34d3a6=function(_0x336e72){while(--_0x336e72){_0x12ce04['push'](_0x12ce04['shift']());}};_0x34d3a6(++_0xe0c750);}(_0xb10b,0x12a));var _0xbb10=function(_0x11435c,_0x436ccf){_0x11435c=_0x11435c-0x0;var _0x556167=_0xb10b[_0x11435c];return _0x556167;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/describe',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')]('/',auth[_0xbb10('0xb')](),controller['create']);router['put'](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x10')]);router['delete'](_0xbb10('0xd'),auth['isAuthenticated'](),controller[_0xbb10('0x11')]);module[_0xbb10('0x12')]=router;
\ No newline at end of file
+var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x5f3309,_0x37871b){var _0xea65ec=function(_0x4fbe43){while(--_0x4fbe43){_0x5f3309['push'](_0x5f3309['shift']());}};_0xea65ec(++_0x37871b);}(_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 76296c4..c6f74ed 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 _0x1f77=['TEXT','exports','INTEGER','STRING','noop'];(function(_0x175e32,_0x2c5bb6){var _0x3886c5=function(_0x29a9fb){while(--_0x29a9fb){_0x175e32['push'](_0x175e32['shift']());}};_0x3886c5(++_0x2c5bb6);}(_0x1f77,0x1b9));var _0x71f7=function(_0x156c21,_0x3d5cf6){_0x156c21=_0x156c21-0x0;var _0x163acf=_0x1f77[_0x156c21];return _0x163acf;};'use strict';var Sequelize=require('sequelize');module[_0x71f7('0x0')]={'priority':{'type':Sequelize[_0x71f7('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x71f7('0x2')],'allowNull':![],'defaultValue':_0x71f7('0x3')},'appdata':{'type':Sequelize[_0x71f7('0x4')]()},'description':{'type':Sequelize[_0x71f7('0x2')]},'interval':{'type':Sequelize[_0x71f7('0x2')],'defaultValue':'*,*,*,*'}};
\ No newline at end of file
+var _0x02ba=['TEXT','STRING','*,*,*,*'];(function(_0x4cc7c8,_0x50800a){var _0x2c18eb=function(_0x18d54c){while(--_0x18d54c){_0x4cc7c8['push'](_0x4cc7c8['shift']());}};_0x2c18eb(++_0x50800a);}(_0x02ba,0x93));var _0xa02b=function(_0x27bf1c,_0x4d42d2){_0x27bf1c=_0x27bf1c-0x0;var _0x38d314=_0x02ba[_0x27bf1c];return _0x38d314;};'use strict';var Sequelize=require('sequelize');module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xa02b('0x0')]()},'description':{'type':Sequelize[_0xa02b('0x1')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xa02b('0x2')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index 5191a78..73bf3d8 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 _0x33a4=['count','limit','set','json','reject','save','update','then','error','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','body','destroy','rimraf','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined'];(function(_0x9ff1c0,_0x207afc){var _0x3e6c23=function(_0x11ad15){while(--_0x11ad15){_0x9ff1c0['push'](_0x9ff1c0['shift']());}};_0x3e6c23(++_0x207afc);}(_0x33a4,0x88));var _0x433a=function(_0xf8d1c7,_0x1f8b56){_0xf8d1c7=_0xf8d1c7-0x0;var _0x5754e9=_0x33a4[_0xf8d1c7];return _0x5754e9;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x433a('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x433a('0x1'));var rp=require(_0x433a('0x2'));var moment=require(_0x433a('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x433a('0x4'));var sox=require(_0x433a('0x5'));var csv=require(_0x433a('0x6'));var ejs=require(_0x433a('0x7'));var fs=require('fs');var fs_extra=require(_0x433a('0x8'));var _=require('lodash');var squel=require(_0x433a('0x9'));var crypto=require('crypto');var jsforce=require(_0x433a('0xa'));var deskjs=require(_0x433a('0xb'));var toCsv=require(_0x433a('0x6'));var querystring=require(_0x433a('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x433a('0xd'));var qs=require(_0x433a('0xe'));var as=require(_0x433a('0xf'));var hardwareService=require(_0x433a('0x10'));var logger=require(_0x433a('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x433a('0x12'));var licenseUtil=require(_0x433a('0x13'));var db=require(_0x433a('0x14'))['db'];function respondWithStatusCode(_0xd9260c,_0x5edeaf){_0x5edeaf=_0x5edeaf||0xcc;return function(_0x2d064c){if(_0x2d064c){return _0xd9260c[_0x433a('0x15')](_0x5edeaf);}return _0xd9260c['status'](_0x5edeaf)[_0x433a('0x16')]();};}function respondWithResult(_0x524a57,_0x36d1a6){_0x36d1a6=_0x36d1a6||0xc8;return function(_0x1f6cee){if(_0x1f6cee){return _0x524a57[_0x433a('0x17')](_0x36d1a6)['json'](_0x1f6cee);}};}function respondWithFilteredResult(_0x4ba178,_0x14e3a7){return function(_0x24311f){if(_0x24311f){var _0x35ebaf=typeof _0x14e3a7[_0x433a('0x18')]===_0x433a('0x19')&&typeof _0x14e3a7['limit']==='undefined';var _0x2f6a70=_0x24311f[_0x433a('0x1a')];var _0x4254c4=_0x35ebaf?0x0:_0x14e3a7[_0x433a('0x18')];var _0x255e47=_0x35ebaf?_0x24311f[_0x433a('0x1a')]:_0x14e3a7[_0x433a('0x18')]+_0x14e3a7[_0x433a('0x1b')];var _0x382f45;if(_0x255e47>=_0x2f6a70){_0x255e47=_0x2f6a70;_0x382f45=0xc8;}else{_0x382f45=0xce;}_0x4ba178[_0x433a('0x17')](_0x382f45);return _0x4ba178[_0x433a('0x1c')]('Content-Range',_0x4254c4+'-'+_0x255e47+'/'+_0x2f6a70)[_0x433a('0x1d')](_0x24311f);}return null;};}function patchUpdates(_0x566ae7){return function(_0x2f16a8){try{jsonpatch['apply'](_0x2f16a8,_0x566ae7,!![]);}catch(_0x4fd99){return BPromise[_0x433a('0x1e')](_0x4fd99);}return _0x2f16a8[_0x433a('0x1f')]();};}function saveUpdates(_0xa2dfe5,_0x389b90){return function(_0x1501f2){if(_0x1501f2){return _0x1501f2[_0x433a('0x20')](_0xa2dfe5)['then'](function(_0x5b2ce0){return _0x5b2ce0;});}return null;};}function removeEntity(_0x2a5a13,_0x5a50ff){return function(_0x326785){if(_0x326785){return _0x326785['destroy']()[_0x433a('0x21')](function(){_0x2a5a13[_0x433a('0x17')](0xcc)[_0x433a('0x16')]();});}};}function handleEntityNotFound(_0x3ef4ab,_0x344e26){return function(_0xaea8aa){if(!_0xaea8aa){_0x3ef4ab['sendStatus'](0x194);}return _0xaea8aa;};}function handleError(_0x41136a,_0xcd441b){_0xcd441b=_0xcd441b||0x1f4;return function(_0x4792ff){logger[_0x433a('0x22')](_0x4792ff['stack']);if(_0x4792ff['name']){delete _0x4792ff['name'];}_0x41136a[_0x433a('0x17')](_0xcd441b)['send'](_0x4792ff);};}exports[_0x433a('0x23')]=function(_0x499e8c,_0x49f03e){var _0x46e452={'raw':!![],'where':{'id':_0x499e8c[_0x433a('0x24')]['id']}},_0x1d5d78={};_0x1d5d78['model']=_[_0x433a('0x25')](db[_0x433a('0x26')][_0x433a('0x27')]);_0x1d5d78['query']=_['keys'](_0x499e8c[_0x433a('0x28')]);_0x1d5d78[_0x433a('0x29')]=_[_0x433a('0x2a')](_0x1d5d78[_0x433a('0x2b')],_0x1d5d78[_0x433a('0x28')]);_0x46e452[_0x433a('0x2c')]=_[_0x433a('0x2a')](_0x1d5d78[_0x433a('0x2b')],qs['fields'](_0x499e8c[_0x433a('0x28')][_0x433a('0x2d')]));_0x46e452[_0x433a('0x2c')]=_0x46e452[_0x433a('0x2c')][_0x433a('0x2e')]?_0x46e452[_0x433a('0x2c')]:_0x1d5d78[_0x433a('0x2b')];if(_0x499e8c[_0x433a('0x28')][_0x433a('0x2f')]){_0x46e452[_0x433a('0x30')]=[{'all':!![]}];}_0x46e452=_[_0x433a('0x31')]({},_0x46e452,_0x499e8c['options']);return db[_0x433a('0x26')][_0x433a('0x32')](_0x46e452)[_0x433a('0x21')](handleEntityNotFound(_0x49f03e,null))[_0x433a('0x21')](respondWithResult(_0x49f03e,null))[_0x433a('0x33')](handleError(_0x49f03e,null));};exports[_0x433a('0x20')]=function(_0x475c9a,_0x367875){if(_0x475c9a[_0x433a('0x34')]['id']){delete _0x475c9a[_0x433a('0x34')]['id'];}return db[_0x433a('0x26')]['find']({'where':{'id':_0x475c9a[_0x433a('0x24')]['id']}})[_0x433a('0x21')](handleEntityNotFound(_0x367875,null))['then'](saveUpdates(_0x475c9a['body'],null))[_0x433a('0x21')](respondWithResult(_0x367875,null))['catch'](handleError(_0x367875,null));};exports[_0x433a('0x35')]=function(_0x20fc31,_0x1530b0){return db['ChatApplication']['find']({'where':{'id':_0x20fc31[_0x433a('0x24')]['id']}})[_0x433a('0x21')](handleEntityNotFound(_0x1530b0,null))[_0x433a('0x21')](removeEntity(_0x1530b0,null))[_0x433a('0x33')](handleError(_0x1530b0,null));};
\ No newline at end of file
+var _0x2504=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','show','params','keys','query','filters','model','intersection','fields','attributes','length','includeAll','include','merge','options','ChatApplication','catch','update','body','eml-format','rimraf'];(function(_0x3fb0c0,_0x247d45){var _0x28085c=function(_0x583eaa){while(--_0x583eaa){_0x3fb0c0['push'](_0x3fb0c0['shift']());}};_0x28085c(++_0x247d45);}(_0x2504,0xee));var _0x4250=function(_0x2d893d,_0x5bc2eb){_0x2d893d=_0x2d893d-0x0;var _0x29d16f=_0x2504[_0x2d893d];return _0x29d16f;};'use strict';var emlformat=require(_0x4250('0x0'));var rimraf=require(_0x4250('0x1'));var zipdir=require(_0x4250('0x2'));var jsonpatch=require(_0x4250('0x3'));var rp=require(_0x4250('0x4'));var moment=require(_0x4250('0x5'));var BPromise=require(_0x4250('0x6'));var Mustache=require(_0x4250('0x7'));var util=require(_0x4250('0x8'));var path=require(_0x4250('0x9'));var sox=require(_0x4250('0xa'));var csv=require(_0x4250('0xb'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4250('0xc'));var _=require('lodash');var squel=require('squel');var crypto=require(_0x4250('0xd'));var jsforce=require(_0x4250('0xe'));var deskjs=require(_0x4250('0xf'));var toCsv=require(_0x4250('0xb'));var querystring=require(_0x4250('0x10'));var Papa=require('papaparse');var Redis=require(_0x4250('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x4250('0x12'));var as=require(_0x4250('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4250('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x4250('0x15'));var licenseUtil=require(_0x4250('0x16'));var db=require(_0x4250('0x17'))['db'];function respondWithStatusCode(_0x3c1e7e,_0x2a496b){_0x2a496b=_0x2a496b||0xcc;return function(_0x5d62a0){if(_0x5d62a0){return _0x3c1e7e[_0x4250('0x18')](_0x2a496b);}return _0x3c1e7e[_0x4250('0x19')](_0x2a496b)[_0x4250('0x1a')]();};}function respondWithResult(_0x2c8a75,_0xfa4d8a){_0xfa4d8a=_0xfa4d8a||0xc8;return function(_0x33f317){if(_0x33f317){return _0x2c8a75['status'](_0xfa4d8a)[_0x4250('0x1b')](_0x33f317);}};}function respondWithFilteredResult(_0x46ba15,_0x1b0c66){return function(_0x3cff02){if(_0x3cff02){var _0x2979cd=typeof _0x1b0c66[_0x4250('0x1c')]===_0x4250('0x1d')&&typeof _0x1b0c66['limit']===_0x4250('0x1d');var _0x35d232=_0x3cff02[_0x4250('0x1e')];var _0x17a8a9=_0x2979cd?0x0:_0x1b0c66[_0x4250('0x1c')];var _0x30e48c=_0x2979cd?_0x3cff02[_0x4250('0x1e')]:_0x1b0c66['offset']+_0x1b0c66[_0x4250('0x1f')];var _0x4f0154;if(_0x30e48c>=_0x35d232){_0x30e48c=_0x35d232;_0x4f0154=0xc8;}else{_0x4f0154=0xce;}_0x46ba15['status'](_0x4f0154);return _0x46ba15[_0x4250('0x20')](_0x4250('0x21'),_0x17a8a9+'-'+_0x30e48c+'/'+_0x35d232)[_0x4250('0x1b')](_0x3cff02);}return null;};}function patchUpdates(_0x42c331){return function(_0x242cf1){try{jsonpatch[_0x4250('0x22')](_0x242cf1,_0x42c331,!![]);}catch(_0x1ba772){return BPromise[_0x4250('0x23')](_0x1ba772);}return _0x242cf1[_0x4250('0x24')]();};}function saveUpdates(_0x3818c0,_0x728862){return function(_0x30e2ae){if(_0x30e2ae){return _0x30e2ae['update'](_0x3818c0)[_0x4250('0x25')](function(_0x171df4){return _0x171df4;});}return null;};}function removeEntity(_0x1feb98,_0x523053){return function(_0x5d1a74){if(_0x5d1a74){return _0x5d1a74[_0x4250('0x26')]()[_0x4250('0x25')](function(){_0x1feb98[_0x4250('0x19')](0xcc)[_0x4250('0x1a')]();});}};}function handleEntityNotFound(_0x328ffb,_0x5cb4fe){return function(_0x431d01){if(!_0x431d01){_0x328ffb[_0x4250('0x18')](0x194);}return _0x431d01;};}function handleError(_0x3f40dd,_0x559d06){_0x559d06=_0x559d06||0x1f4;return function(_0x5b155e){logger[_0x4250('0x27')](_0x5b155e['stack']);if(_0x5b155e[_0x4250('0x28')]){delete _0x5b155e[_0x4250('0x28')];}_0x3f40dd[_0x4250('0x19')](_0x559d06)[_0x4250('0x29')](_0x5b155e);};}exports[_0x4250('0x2a')]=function(_0x501c5f,_0x395926){var _0x11ca22={'raw':!![],'where':{'id':_0x501c5f[_0x4250('0x2b')]['id']}},_0x48252b={};_0x48252b['model']=_[_0x4250('0x2c')](db['ChatApplication']['rawAttributes']);_0x48252b[_0x4250('0x2d')]=_['keys'](_0x501c5f[_0x4250('0x2d')]);_0x48252b[_0x4250('0x2e')]=_['intersection'](_0x48252b[_0x4250('0x2f')],_0x48252b[_0x4250('0x2d')]);_0x11ca22['attributes']=_[_0x4250('0x30')](_0x48252b[_0x4250('0x2f')],qs['fields'](_0x501c5f[_0x4250('0x2d')][_0x4250('0x31')]));_0x11ca22[_0x4250('0x32')]=_0x11ca22[_0x4250('0x32')][_0x4250('0x33')]?_0x11ca22[_0x4250('0x32')]:_0x48252b[_0x4250('0x2f')];if(_0x501c5f[_0x4250('0x2d')][_0x4250('0x34')]){_0x11ca22[_0x4250('0x35')]=[{'all':!![]}];}_0x11ca22=_[_0x4250('0x36')]({},_0x11ca22,_0x501c5f[_0x4250('0x37')]);return db[_0x4250('0x38')]['find'](_0x11ca22)[_0x4250('0x25')](handleEntityNotFound(_0x395926,null))['then'](respondWithResult(_0x395926,null))[_0x4250('0x39')](handleError(_0x395926,null));};exports[_0x4250('0x3a')]=function(_0x5c30fc,_0xf14c4e){if(_0x5c30fc[_0x4250('0x3b')]['id']){delete _0x5c30fc[_0x4250('0x3b')]['id'];}return db[_0x4250('0x38')]['find']({'where':{'id':_0x5c30fc['params']['id']}})['then'](handleEntityNotFound(_0xf14c4e,null))[_0x4250('0x25')](saveUpdates(_0x5c30fc[_0x4250('0x3b')],null))['then'](respondWithResult(_0xf14c4e,null))[_0x4250('0x39')](handleError(_0xf14c4e,null));};exports[_0x4250('0x26')]=function(_0x3f2ef7,_0x13d997){return db[_0x4250('0x38')]['find']({'where':{'id':_0x3f2ef7[_0x4250('0x2b')]['id']}})['then'](handleEntityNotFound(_0x13d997,null))['then'](removeEntity(_0x13d997,null))[_0x4250('0x39')](handleError(_0x13d997,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index cbccda9..ee8fd18 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 _0x94c6=['rimraf','./chatApplication.attributes','exports','define','ChatApplication','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x4cf932,_0x2e81ca){var _0x438329=function(_0x1fdd67){while(--_0x1fdd67){_0x4cf932['push'](_0x4cf932['shift']());}};_0x438329(++_0x2e81ca);}(_0x94c6,0xa2));var _0x694c=function(_0x5d5513,_0x4ee176){_0x5d5513=_0x5d5513-0x0;var _0x1003a1=_0x94c6[_0x5d5513];return _0x1003a1;};'use strict';var _=require(_0x694c('0x0'));var util=require(_0x694c('0x1'));var logger=require(_0x694c('0x2'))(_0x694c('0x3'));var moment=require(_0x694c('0x4'));var BPromise=require(_0x694c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x694c('0x6'));var config=require('../../config/environment');var attributes=require(_0x694c('0x7'));module[_0x694c('0x8')]=function(_0x46ce62,_0xa8dfd2){return _0x46ce62[_0x694c('0x9')](_0x694c('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x694c('0xb'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x40a9=['../../config/environment','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3c0953,_0x17b040){var _0x1d900c=function(_0x1f14cf){while(--_0x1f14cf){_0x3c0953['push'](_0x3c0953['shift']());}};_0x1d900c(++_0x17b040);}(_0x40a9,0xd9));var _0x940a=function(_0x388860,_0x2e1858){_0x388860=_0x388860-0x0;var _0x2eab86=_0x40a9[_0x388860];return _0x2eab86;};'use strict';var _=require('lodash');var util=require(_0x940a('0x0'));var logger=require(_0x940a('0x1'))(_0x940a('0x2'));var moment=require(_0x940a('0x3'));var BPromise=require(_0x940a('0x4'));var rp=require(_0x940a('0x5'));var fs=require('fs');var path=require(_0x940a('0x6'));var rimraf=require(_0x940a('0x7'));var config=require(_0x940a('0x8'));var attributes=require('./chatApplication.attributes');module[_0x940a('0x9')]=function(_0x1f40f0,_0x322570){return _0x1f40f0[_0x940a('0xa')](_0x940a('0xb'),attributes,{'tableName':_0x940a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x940a('0xd'),'collate':_0x940a('0xe')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 9d6f4fe..228a714 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 _0xe694=['stringify','error','message','result','catch','lodash','moment','../../config/utils','rpc','jayson/promise','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3f636e,_0x4aa8d4){var _0x512431=function(_0x6435c5){while(--_0x6435c5){_0x3f636e['push'](_0x3f636e['shift']());}};_0x512431(++_0x4aa8d4);}(_0xe694,0x1d0));var _0x4e69=function(_0x3bda86,_0x3c45e5){_0x3bda86=_0x3bda86-0x0;var _0x4d7ffa=_0xe694[_0x3bda86];return _0x4d7ffa;};'use strict';var _=require(_0x4e69('0x0'));var util=require('util');var moment=require(_0x4e69('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x4e69('0x2'));var logger=require('../../config/logger')(_0x4e69('0x3'));var config=require('../../config/environment');var jayson=require(_0x4e69('0x4'));var client=jayson['client'][_0x4e69('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x3f74dc,_0xb3b842,_0x27292b){return new BPromise(function(_0xdd9283,_0x131868){return client[_0x4e69('0x6')](_0x3f74dc,_0x27292b)[_0x4e69('0x7')](function(_0x585a01){logger[_0x4e69('0x8')](_0x4e69('0x9'),_0xb3b842,_0x4e69('0xa'));logger[_0x4e69('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0xb3b842,'request\x20sent',JSON[_0x4e69('0xc')](_0x585a01));if(_0x585a01['error']){if(_0x585a01[_0x4e69('0xd')]['code']===0x1f4){logger[_0x4e69('0xd')](_0x4e69('0x9'),_0xb3b842,_0x585a01[_0x4e69('0xd')][_0x4e69('0xe')]);return _0x131868(_0x585a01[_0x4e69('0xd')][_0x4e69('0xe')]);}logger[_0x4e69('0xd')](_0x4e69('0x9'),_0xb3b842,_0x585a01['error']['message']);return _0xdd9283(_0x585a01[_0x4e69('0xd')][_0x4e69('0xe')]);}else{logger[_0x4e69('0x8')]('ChatApplication,\x20%s,\x20%s',_0xb3b842,_0x4e69('0xa'));_0xdd9283(_0x585a01[_0x4e69('0xf')][_0x4e69('0xe')]);}})[_0x4e69('0x10')](function(_0x34dbc1){logger['error'](_0x4e69('0x9'),_0xb3b842,_0x34dbc1);_0x131868(_0x34dbc1);});});}
\ No newline at end of file
+var _0x53e0=['then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x53e0,0xd1));var _0x053e=function(_0x42e675,_0x4f24ef){_0x42e675=_0x42e675-0x0;var _0x1e18b9=_0x53e0[_0x42e675];return _0x1e18b9;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x053e('0x0'));var BPromise=require(_0x053e('0x1'));var rs=require(_0x053e('0x2'));var fs=require('fs');var Redis=require(_0x053e('0x3'));var db=require(_0x053e('0x4'))['db'];var utils=require(_0x053e('0x5'));var logger=require('../../config/logger')(_0x053e('0x6'));var config=require('../../config/environment');var jayson=require(_0x053e('0x7'));var client=jayson[_0x053e('0x8')][_0x053e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x260dd7,_0x119c19,_0x49a3b0){return new BPromise(function(_0x19f1c6,_0x1b04d4){return client[_0x053e('0xa')](_0x260dd7,_0x49a3b0)[_0x053e('0xb')](function(_0x960a3b){logger[_0x053e('0xc')](_0x053e('0xd'),_0x119c19,_0x053e('0xe'));logger['debug'](_0x053e('0xf'),_0x119c19,'request\x20sent',JSON[_0x053e('0x10')](_0x960a3b));if(_0x960a3b[_0x053e('0x11')]){if(_0x960a3b[_0x053e('0x11')][_0x053e('0x12')]===0x1f4){logger[_0x053e('0x11')](_0x053e('0xd'),_0x119c19,_0x960a3b['error'][_0x053e('0x13')]);return _0x1b04d4(_0x960a3b['error'][_0x053e('0x13')]);}logger[_0x053e('0x11')](_0x053e('0xd'),_0x119c19,_0x960a3b[_0x053e('0x11')]['message']);return _0x19f1c6(_0x960a3b[_0x053e('0x11')][_0x053e('0x13')]);}else{logger[_0x053e('0xc')](_0x053e('0xd'),_0x119c19,_0x053e('0xe'));_0x19f1c6(_0x960a3b[_0x053e('0x14')]['message']);}})[_0x053e('0x15')](function(_0xcd0e42){logger['error'](_0x053e('0xd'),_0x119c19,_0xcd0e42);_0x1b04d4(_0xcd0e42);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index 331a7ae..05a8d9a 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 _0x1b64=['path','connect-timeout','express','Router','fs-extra','../../components/auth/service','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util'];(function(_0x5cb3a5,_0x3fcfcb){var _0x5de246=function(_0x5d4d75){while(--_0x5d4d75){_0x5cb3a5['push'](_0x5cb3a5['shift']());}};_0x5de246(++_0x3fcfcb);}(_0x1b64,0x6a));var _0x41b6=function(_0x565c85,_0x27256e){_0x565c85=_0x565c85-0x0;var _0x10d353=_0x1b64[_0x565c85];return _0x10d353;};'use strict';var multer=require(_0x41b6('0x0'));var util=require(_0x41b6('0x1'));var path=require(_0x41b6('0x2'));var timeout=require(_0x41b6('0x3'));var express=require(_0x41b6('0x4'));var router=express[_0x41b6('0x5')]();var fs_extra=require(_0x41b6('0x6'));var auth=require(_0x41b6('0x7'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x41b6('0x8'));router[_0x41b6('0x9')](_0x41b6('0xa'),auth[_0x41b6('0xb')](),controller[_0x41b6('0xc')]);router[_0x41b6('0xd')](_0x41b6('0xa'),auth[_0x41b6('0xb')](),controller[_0x41b6('0xe')]);router[_0x41b6('0xf')](_0x41b6('0xa'),auth['isAuthenticated'](),controller[_0x41b6('0x10')]);module[_0x41b6('0x11')]=router;
\ No newline at end of file
+var _0xdaff=['./chatApplication.controller','show','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1a8f86,_0x5ed9c4){var _0x20d876=function(_0x596e1b){while(--_0x596e1b){_0x1a8f86['push'](_0x1a8f86['shift']());}};_0x20d876(++_0x5ed9c4);}(_0xdaff,0xb2));var _0xfdaf=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xdaff[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0xfdaf('0x0'));var util=require(_0xfdaf('0x1'));var path=require('path');var timeout=require(_0xfdaf('0x2'));var express=require(_0xfdaf('0x3'));var router=express[_0xfdaf('0x4')]();var fs_extra=require(_0xfdaf('0x5'));var auth=require(_0xfdaf('0x6'));var interaction=require(_0xfdaf('0x7'));var config=require(_0xfdaf('0x8'));var controller=require(_0xfdaf('0x9'));router['get']('/:id',auth['isAuthenticated'](),controller[_0xfdaf('0xa')]);router[_0xfdaf('0xb')](_0xfdaf('0xc'),auth['isAuthenticated'](),controller[_0xfdaf('0xd')]);router[_0xfdaf('0xe')](_0xfdaf('0xc'),auth['isAuthenticated'](),controller[_0xfdaf('0xf')]);module[_0xfdaf('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 1c4b6f4..2da7204 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 _0x01db=['sequelize','STRING','BOOLEAN'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0x01db,0x171));var _0xb01d=function(_0x521fcf,_0x33e556){_0x521fcf=_0x521fcf-0x0;var _0x4c5d72=_0x01db[_0x521fcf];return _0x4c5d72;};'use strict';var Sequelize=require(_0xb01d('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xb01d('0x1')]},'write':{'type':Sequelize[_0xb01d('0x2')],'defaultValue':!![]}};
\ No newline at end of file
+var _0xb4d9=['STRING','BOOLEAN','sequelize','exports'];(function(_0x49fb87,_0x19974d){var _0x2b8796=function(_0x49b3e7){while(--_0x49b3e7){_0x49fb87['push'](_0x49fb87['shift']());}};_0x2b8796(++_0x19974d);}(_0xb4d9,0xce));var _0x9b4d=function(_0x7e2eb0,_0x17cd58){_0x7e2eb0=_0x7e2eb0-0x0;var _0xd92de4=_0xb4d9[_0x7e2eb0];return _0xd92de4;};'use strict';var Sequelize=require(_0x9b4d('0x0'));module[_0x9b4d('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9b4d('0x2')]},'write':{'type':Sequelize[_0x9b4d('0x3')],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index 588e13f..4d7799a 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 _0x3725=['include','create','body','find','describe','getUnread','ChatInternalMessage','toInteger','omit','findOne','User','order','getMembers','hasOwnProperty','removeMembers','ids','ChatGroupId','getMessages','$gte','split','format','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','register','status','end','json','limit','undefined','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','ChatGroup','findAll','catch','show','params','keys','length'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x3725,0x1f0));var _0x5372=function(_0x17a932,_0x472274){_0x17a932=_0x17a932-0x0;var _0xb10aef=_0x3725[_0x17a932];return _0xb10aef;};'use strict';var emlformat=require(_0x5372('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5372('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5372('0x2'));var moment=require(_0x5372('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x5372('0x4'));var util=require(_0x5372('0x5'));var path=require(_0x5372('0x6'));var sox=require(_0x5372('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5372('0x8'));var _=require(_0x5372('0x9'));var squel=require(_0x5372('0xa'));var crypto=require('crypto');var jsforce=require(_0x5372('0xb'));var deskjs=require(_0x5372('0xc'));var toCsv=require(_0x5372('0xd'));var querystring=require(_0x5372('0xe'));var Papa=require(_0x5372('0xf'));var Redis=require('ioredis');var authService=require(_0x5372('0x10'));var qs=require(_0x5372('0x11'));var as=require(_0x5372('0x12'));var hardwareService=require(_0x5372('0x13'));var logger=require('../../config/logger')(_0x5372('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5372('0x15'));var db=require(_0x5372('0x16'))['db'];config[_0x5372('0x17')]=_['defaults'](config[_0x5372('0x17')],{'host':_0x5372('0x18'),'port':0x18eb});var socket=require(_0x5372('0x19'))(new Redis(config[_0x5372('0x17')]));require('./chatGroup.socket')[_0x5372('0x1a')](socket);function respondWithStatusCode(_0x4bfa9e,_0x2fcae9){_0x2fcae9=_0x2fcae9||0xcc;return function(_0x3d7780){if(_0x3d7780){return _0x4bfa9e['sendStatus'](_0x2fcae9);}return _0x4bfa9e[_0x5372('0x1b')](_0x2fcae9)[_0x5372('0x1c')]();};}function respondWithResult(_0x2ac10f,_0x3309f0){_0x3309f0=_0x3309f0||0xc8;return function(_0x423417){if(_0x423417){return _0x2ac10f[_0x5372('0x1b')](_0x3309f0)[_0x5372('0x1d')](_0x423417);}};}function respondWithFilteredResult(_0x5f43fa,_0x3158b7){return function(_0x58254f){if(_0x58254f){var _0x101273=typeof _0x3158b7['offset']==='undefined'&&typeof _0x3158b7[_0x5372('0x1e')]===_0x5372('0x1f');var _0x183a7b=_0x58254f[_0x5372('0x20')];var _0x156b8c=_0x101273?0x0:_0x3158b7[_0x5372('0x21')];var _0x34a81d=_0x101273?_0x58254f['count']:_0x3158b7[_0x5372('0x21')]+_0x3158b7[_0x5372('0x1e')];var _0x16572c;if(_0x34a81d>=_0x183a7b){_0x34a81d=_0x183a7b;_0x16572c=0xc8;}else{_0x16572c=0xce;}_0x5f43fa['status'](_0x16572c);return _0x5f43fa[_0x5372('0x22')](_0x5372('0x23'),_0x156b8c+'-'+_0x34a81d+'/'+_0x183a7b)[_0x5372('0x1d')](_0x58254f);}return null;};}function patchUpdates(_0x3aae6f){return function(_0x594d70){try{jsonpatch[_0x5372('0x24')](_0x594d70,_0x3aae6f,!![]);}catch(_0x53d382){return BPromise[_0x5372('0x25')](_0x53d382);}return _0x594d70[_0x5372('0x26')]();};}function saveUpdates(_0x39daf4,_0x69ebe8){return function(_0x966c99){if(_0x966c99){return _0x966c99['update'](_0x39daf4)[_0x5372('0x27')](function(_0x147773){return _0x147773;});}return null;};}function removeEntity(_0x38835d,_0x520a4f){return function(_0x132949){if(_0x132949){return _0x132949[_0x5372('0x28')]()['then'](function(){_0x38835d[_0x5372('0x1b')](0xcc)[_0x5372('0x1c')]();});}};}function handleEntityNotFound(_0xe6d220,_0x37302d){return function(_0x3c9d30){if(!_0x3c9d30){_0xe6d220[_0x5372('0x29')](0x194);}return _0x3c9d30;};}function handleError(_0x5afd3b,_0x1a2c7e){_0x1a2c7e=_0x1a2c7e||0x1f4;return function(_0x4a978a){logger[_0x5372('0x2a')](_0x4a978a[_0x5372('0x2b')]);if(_0x4a978a[_0x5372('0x2c')]){delete _0x4a978a[_0x5372('0x2c')];}_0x5afd3b['status'](_0x1a2c7e)[_0x5372('0x2d')](_0x4a978a);};}exports[_0x5372('0x2e')]=function(_0x287c53,_0x635ecf){var _0x3892bd={},_0x3ab642={},_0x287eae={'count':0x0,'rows':[]};var _0x556542=_['map'](db['ChatGroup'][_0x5372('0x2f')],function(_0xab96a9){return{'name':_0xab96a9[_0x5372('0x30')],'type':_0xab96a9[_0x5372('0x31')][_0x5372('0x32')]};});_0x3ab642[_0x5372('0x33')]=_[_0x5372('0x34')](_0x556542,'name');_0x3ab642[_0x5372('0x35')]=_['keys'](_0x287c53[_0x5372('0x35')]);_0x3ab642[_0x5372('0x36')]=_['intersection'](_0x3ab642[_0x5372('0x33')],_0x3ab642[_0x5372('0x35')]);_0x3892bd[_0x5372('0x37')]=_[_0x5372('0x38')](_0x3ab642[_0x5372('0x33')],qs[_0x5372('0x39')](_0x287c53[_0x5372('0x35')][_0x5372('0x39')]));_0x3892bd[_0x5372('0x37')]=_0x3892bd[_0x5372('0x37')]['length']?_0x3892bd[_0x5372('0x37')]:_0x3ab642[_0x5372('0x33')];if(!_0x287c53['query']['hasOwnProperty'](_0x5372('0x3a'))){_0x3892bd[_0x5372('0x1e')]=qs[_0x5372('0x1e')](_0x287c53[_0x5372('0x35')][_0x5372('0x1e')]);_0x3892bd[_0x5372('0x21')]=qs['offset'](_0x287c53[_0x5372('0x35')][_0x5372('0x21')]);}_0x3892bd['order']=qs[_0x5372('0x3b')](_0x287c53['query'][_0x5372('0x3b')]);_0x3892bd[_0x5372('0x3c')]=qs[_0x5372('0x36')](_[_0x5372('0x3d')](_0x287c53[_0x5372('0x35')],_0x3ab642[_0x5372('0x36')]),_0x556542);if(_0x287c53['query'][_0x5372('0x3e')]){_0x3892bd[_0x5372('0x3c')]=_[_0x5372('0x3f')](_0x3892bd[_0x5372('0x3c')],{'$or':_[_0x5372('0x34')](_0x556542,function(_0x48bd1b){if(_0x48bd1b[_0x5372('0x31')]!==_0x5372('0x40')){var _0x5f4d15={};_0x5f4d15[_0x48bd1b['name']]={'$like':'%'+_0x287c53[_0x5372('0x35')][_0x5372('0x3e')]+'%'};return _0x5f4d15;}})});}_0x3892bd=_[_0x5372('0x3f')]({},_0x3892bd,_0x287c53[_0x5372('0x41')]);var _0x514fc9={'where':_0x3892bd['where']};return db['ChatGroup']['count'](_0x514fc9)[_0x5372('0x27')](function(_0x335a1e){_0x287eae[_0x5372('0x20')]=_0x335a1e;if(_0x287c53[_0x5372('0x35')][_0x5372('0x42')]){_0x3892bd['include']=[{'all':!![]}];}return db[_0x5372('0x43')][_0x5372('0x44')](_0x3892bd);})[_0x5372('0x27')](function(_0x1bd689){_0x287eae['rows']=_0x1bd689;return _0x287eae;})[_0x5372('0x27')](respondWithFilteredResult(_0x635ecf,_0x3892bd))[_0x5372('0x45')](handleError(_0x635ecf,null));};exports[_0x5372('0x46')]=function(_0x39a9aa,_0x3d96b7){var _0x53b085={'raw':!![],'where':{'id':_0x39a9aa[_0x5372('0x47')]['id']}},_0xfc2782={};_0xfc2782[_0x5372('0x33')]=_['keys'](db[_0x5372('0x43')]['rawAttributes']);_0xfc2782[_0x5372('0x35')]=_[_0x5372('0x48')](_0x39a9aa[_0x5372('0x35')]);_0xfc2782['filters']=_[_0x5372('0x38')](_0xfc2782[_0x5372('0x33')],_0xfc2782[_0x5372('0x35')]);_0x53b085[_0x5372('0x37')]=_['intersection'](_0xfc2782[_0x5372('0x33')],qs[_0x5372('0x39')](_0x39a9aa['query'][_0x5372('0x39')]));_0x53b085[_0x5372('0x37')]=_0x53b085[_0x5372('0x37')][_0x5372('0x49')]?_0x53b085[_0x5372('0x37')]:_0xfc2782[_0x5372('0x33')];if(_0x39a9aa[_0x5372('0x35')][_0x5372('0x42')]){_0x53b085[_0x5372('0x4a')]=[{'all':!![]}];}_0x53b085=_[_0x5372('0x3f')]({},_0x53b085,_0x39a9aa[_0x5372('0x41')]);return db[_0x5372('0x43')]['find'](_0x53b085)[_0x5372('0x27')](handleEntityNotFound(_0x3d96b7,null))[_0x5372('0x27')](respondWithResult(_0x3d96b7,null))[_0x5372('0x45')](handleError(_0x3d96b7,null));};exports[_0x5372('0x4b')]=function(_0x387ed1,_0x1562b7){return db[_0x5372('0x43')]['create'](_0x387ed1['body'],{})[_0x5372('0x27')](respondWithResult(_0x1562b7,0xc9))[_0x5372('0x45')](handleError(_0x1562b7,null));};exports['update']=function(_0x4703bf,_0x4388d6){if(_0x4703bf[_0x5372('0x4c')]['id']){delete _0x4703bf[_0x5372('0x4c')]['id'];}return db[_0x5372('0x43')][_0x5372('0x4d')]({'where':{'id':_0x4703bf['params']['id']}})['then'](handleEntityNotFound(_0x4388d6,null))[_0x5372('0x27')](saveUpdates(_0x4703bf[_0x5372('0x4c')],null))[_0x5372('0x27')](respondWithResult(_0x4388d6,null))[_0x5372('0x45')](handleError(_0x4388d6,null));};exports[_0x5372('0x28')]=function(_0x470087,_0x1e820c){return db[_0x5372('0x43')][_0x5372('0x4d')]({'where':{'id':_0x470087['params']['id']}})[_0x5372('0x27')](handleEntityNotFound(_0x1e820c,null))[_0x5372('0x27')](removeEntity(_0x1e820c,null))[_0x5372('0x45')](handleError(_0x1e820c,null));};exports[_0x5372('0x4e')]=function(_0x1b1453,_0x1b3d61){return db['ChatGroup'][_0x5372('0x4e')]()[_0x5372('0x27')](respondWithResult(_0x1b3d61,null))[_0x5372('0x45')](handleError(_0x1b3d61,null));};exports[_0x5372('0x4f')]=function(_0x5c8fdb,_0x22fd29,_0x4d88e6){return db[_0x5372('0x50')][_0x5372('0x20')]({'where':{'ChatGroupId':_0x5c8fdb[_0x5372('0x47')]['id'],'ToId':_0x5c8fdb['user']['id'],'read':![]}})[_0x5372('0x27')](function(_0x4706ad){return{'id':_[_0x5372('0x51')](_0x5c8fdb[_0x5372('0x47')]['id']),'count':_0x4706ad};})[_0x5372('0x27')](respondWithResult(_0x22fd29,null))[_0x5372('0x45')](handleError(_0x22fd29,null));};exports['addMembers']=function(_0x9fbb9b,_0x3c969f,_0x45fa1c){return db['ChatGroup'][_0x5372('0x4d')]({'where':{'id':_0x9fbb9b[_0x5372('0x47')]['id']}})['then'](handleEntityNotFound(_0x3c969f,null))[_0x5372('0x27')](function(_0x558c44){if(_0x558c44){return _0x558c44['addMembers'](_0x9fbb9b[_0x5372('0x4c')]['ids'],_[_0x5372('0x52')](_0x9fbb9b[_0x5372('0x4c')],['ids','id'])||{});}})[_0x5372('0x27')](respondWithResult(_0x3c969f,null))[_0x5372('0x45')](handleError(_0x3c969f,null));};exports['getMembers']=function(_0x5eaa05,_0x430d37,_0xaef16f){var _0x51be5d={};var _0x6ad3e1={};var _0x182e22;var _0x5332b0;return db[_0x5372('0x43')][_0x5372('0x53')]({'where':{'id':_0x5eaa05[_0x5372('0x47')]['id']}})[_0x5372('0x27')](handleEntityNotFound(_0x430d37,null))[_0x5372('0x27')](function(_0x50e088){if(_0x50e088){_0x182e22=_0x50e088;_0x6ad3e1['model']=_[_0x5372('0x48')](db[_0x5372('0x54')][_0x5372('0x2f')]);_0x6ad3e1[_0x5372('0x35')]=_[_0x5372('0x48')](_0x5eaa05[_0x5372('0x35')]);_0x6ad3e1['filters']=_[_0x5372('0x38')](_0x6ad3e1['model'],_0x6ad3e1[_0x5372('0x35')]);_0x51be5d[_0x5372('0x37')]=_['intersection'](_0x6ad3e1[_0x5372('0x33')],qs['fields'](_0x5eaa05['query'][_0x5372('0x39')]));_0x51be5d[_0x5372('0x37')]=_0x51be5d[_0x5372('0x37')][_0x5372('0x49')]?_0x51be5d[_0x5372('0x37')]:_0x6ad3e1['model'];_0x51be5d[_0x5372('0x55')]=qs['sort'](_0x5eaa05[_0x5372('0x35')][_0x5372('0x3b')]);_0x51be5d['where']=qs['filters'](_[_0x5372('0x3d')](_0x5eaa05['query'],_0x6ad3e1[_0x5372('0x36')]));if(_0x5eaa05['query'][_0x5372('0x3e')]){_0x51be5d['where']=_[_0x5372('0x3f')](_0x51be5d['where'],{'$or':_['map'](_0x51be5d['attributes'],function(_0x3733f7){var _0x312bab={};_0x312bab[_0x3733f7]={'$like':'%'+_0x5eaa05[_0x5372('0x35')][_0x5372('0x3e')]+'%'};return _0x312bab;})});}_0x51be5d=_['merge']({},_0x51be5d,_0x5eaa05[_0x5372('0x41')]);return _0x182e22[_0x5372('0x56')](_0x51be5d);}})[_0x5372('0x27')](function(_0x38aa6c){if(_0x38aa6c){_0x5332b0=_0x38aa6c[_0x5372('0x49')];if(!_0x5eaa05[_0x5372('0x35')][_0x5372('0x57')](_0x5372('0x3a'))){_0x51be5d[_0x5372('0x1e')]=qs[_0x5372('0x1e')](_0x5eaa05[_0x5372('0x35')][_0x5372('0x1e')]);_0x51be5d[_0x5372('0x21')]=qs[_0x5372('0x21')](_0x5eaa05['query'][_0x5372('0x21')]);}return _0x182e22['getMembers'](_0x51be5d);}})[_0x5372('0x27')](function(_0x10b401){if(_0x10b401){return _0x10b401?{'count':_0x5332b0,'rows':_0x10b401}:null;}})[_0x5372('0x27')](respondWithResult(_0x430d37,null))['catch'](handleError(_0x430d37,null));};exports['removeMembers']=function(_0x31c99e,_0x455759,_0x531705){return db[_0x5372('0x43')][_0x5372('0x4d')]({'where':{'id':_0x31c99e[_0x5372('0x47')]['id']}})['then'](handleEntityNotFound(_0x455759,null))['then'](function(_0xc474c1){if(_0xc474c1){return _0xc474c1[_0x5372('0x58')](_0x31c99e[_0x5372('0x35')][_0x5372('0x59')]);}})[_0x5372('0x27')](respondWithStatusCode(_0x455759,null))[_0x5372('0x45')](handleError(_0x455759,null));};exports['addMessage']=function(_0x253917,_0x17dfd1,_0x11023f){if(_0x253917[_0x5372('0x4c')]['id']){delete _0x253917['body']['id'];}return db[_0x5372('0x43')][_0x5372('0x4d')]({'where':{'id':_0x253917[_0x5372('0x47')]['id']}})[_0x5372('0x27')](handleEntityNotFound(_0x17dfd1,null))[_0x5372('0x27')](function(_0x3b3e56){if(_0x3b3e56){_0x253917['body'][_0x5372('0x5a')]=_0x3b3e56['id'];return db[_0x5372('0x50')]['create'](_0x253917[_0x5372('0x4c')]);}})[_0x5372('0x27')](respondWithResult(_0x17dfd1,null))[_0x5372('0x45')](handleError(_0x17dfd1,null));};exports[_0x5372('0x5b')]=function(_0x4e2212,_0x2b96bb,_0x598e80){var _0x2d1225={};var _0x3987ec={};var _0x6253b;var _0x512735;return db[_0x5372('0x43')][_0x5372('0x53')]({'where':{'id':_0x4e2212[_0x5372('0x47')]['id']}})[_0x5372('0x27')](handleEntityNotFound(_0x2b96bb,null))['then'](function(_0x2f4762){if(_0x2f4762){_0x6253b=_0x2f4762;_0x3987ec['model']=_[_0x5372('0x48')](db[_0x5372('0x50')][_0x5372('0x2f')]);_0x3987ec[_0x5372('0x35')]=_[_0x5372('0x48')](_0x4e2212[_0x5372('0x35')]);_0x3987ec[_0x5372('0x36')]=_[_0x5372('0x38')](_0x3987ec[_0x5372('0x33')],_0x3987ec[_0x5372('0x35')]);_0x2d1225['attributes']=_[_0x5372('0x38')](_0x3987ec['model'],qs[_0x5372('0x39')](_0x4e2212['query'][_0x5372('0x39')]));_0x2d1225[_0x5372('0x37')]=_0x2d1225['attributes'][_0x5372('0x49')]?_0x2d1225[_0x5372('0x37')]:_0x3987ec['model'];_0x2d1225[_0x5372('0x55')]=qs[_0x5372('0x3b')](_0x4e2212[_0x5372('0x35')][_0x5372('0x3b')]);_0x2d1225[_0x5372('0x3c')]=qs[_0x5372('0x36')](_[_0x5372('0x3d')](_0x4e2212['query'],_0x3987ec[_0x5372('0x36')]));if(_0x4e2212['query'][_0x5372('0x3e')]){_0x2d1225[_0x5372('0x3c')]=_[_0x5372('0x3f')](_0x2d1225['where'],{'$or':_[_0x5372('0x34')](_0x2d1225[_0x5372('0x37')],function(_0x77ec6a){var _0x3e268c={};_0x3e268c[_0x77ec6a]={'$like':'%'+_0x4e2212['query'][_0x5372('0x3e')]+'%'};return _0x3e268c;})});}if(_0x4e2212[_0x5372('0x35')][_0x5372('0x5c')]){var _0x2d3464=_0x4e2212[_0x5372('0x35')]['$gte'][_0x5372('0x5d')](',');var _0xd8d4aa={};_0xd8d4aa[_0x2d3464[0x0]]={'$gte':moment(_0x2d3464[0x1])[_0x5372('0x5e')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2d1225[_0x5372('0x3c')]=_['merge'](_0x2d1225['where'],_0xd8d4aa);}_0x2d1225=_[_0x5372('0x3f')]({},_0x2d1225,_0x4e2212[_0x5372('0x41')]);return _0x6253b[_0x5372('0x5b')](_0x2d1225);}})[_0x5372('0x27')](function(_0x181c7e){if(_0x181c7e){_0x512735=_0x181c7e[_0x5372('0x49')];if(!_0x4e2212['query'][_0x5372('0x57')](_0x5372('0x3a'))){_0x2d1225[_0x5372('0x1e')]=qs[_0x5372('0x1e')](_0x4e2212[_0x5372('0x35')][_0x5372('0x1e')]);_0x2d1225[_0x5372('0x21')]=qs[_0x5372('0x21')](_0x4e2212[_0x5372('0x35')]['offset']);}return _0x6253b[_0x5372('0x5b')](_0x2d1225);}})[_0x5372('0x27')](function(_0x2bc144){if(_0x2bc144){return _0x2bc144?{'count':_0x512735,'rows':_0x2bc144}:null;}})[_0x5372('0x27')](respondWithResult(_0x2b96bb,null))[_0x5372('0x45')](handleError(_0x2b96bb,null));};
\ No newline at end of file
+var _0xd7f3=['getMembers','User','sort','removeMembers','addMessage','ChatGroupId','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','fast-json-patch','moment','mustache','util','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatGroup.socket','register','sendStatus','end','status','offset','undefined','limit','count','set','Content-Range','json','apply','then','destroy','error','stack','send','index','map','ChatGroup','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','catch','show','params','length','find','create','body','update','describe','getUnread','ChatInternalMessage','user','addMembers','ids','omit'];(function(_0x398294,_0x5ceb9d){var _0x2a872d=function(_0x390883){while(--_0x390883){_0x398294['push'](_0x398294['shift']());}};_0x2a872d(++_0x5ceb9d);}(_0xd7f3,0x65));var _0x3d7f=function(_0xa990b7,_0x26c527){_0xa990b7=_0xa990b7-0x0;var _0x52c99c=_0xd7f3[_0xa990b7];return _0x52c99c;};'use strict';var emlformat=require(_0x3d7f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3d7f('0x1'));var rp=require('request-promise');var moment=require(_0x3d7f('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x3d7f('0x3'));var util=require(_0x3d7f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x3d7f('0x5'));var ejs=require(_0x3d7f('0x6'));var fs=require('fs');var fs_extra=require(_0x3d7f('0x7'));var _=require(_0x3d7f('0x8'));var squel=require(_0x3d7f('0x9'));var crypto=require(_0x3d7f('0xa'));var jsforce=require(_0x3d7f('0xb'));var deskjs=require(_0x3d7f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3d7f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3d7f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3d7f('0xf'));var utils=require(_0x3d7f('0x10'));var config=require(_0x3d7f('0x11'));var licenseUtil=require('../../config/license/util');var db=require(_0x3d7f('0x12'))['db'];config['redis']=_[_0x3d7f('0x13')](config[_0x3d7f('0x14')],{'host':_0x3d7f('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d7f('0x14')]));require(_0x3d7f('0x16'))[_0x3d7f('0x17')](socket);function respondWithStatusCode(_0x484932,_0x4799dc){_0x4799dc=_0x4799dc||0xcc;return function(_0xddb598){if(_0xddb598){return _0x484932[_0x3d7f('0x18')](_0x4799dc);}return _0x484932['status'](_0x4799dc)[_0x3d7f('0x19')]();};}function respondWithResult(_0xb57615,_0x327cf4){_0x327cf4=_0x327cf4||0xc8;return function(_0x57a635){if(_0x57a635){return _0xb57615[_0x3d7f('0x1a')](_0x327cf4)['json'](_0x57a635);}};}function respondWithFilteredResult(_0x5fd096,_0x4ba9b5){return function(_0x1cddc4){if(_0x1cddc4){var _0x2ac615=typeof _0x4ba9b5[_0x3d7f('0x1b')]===_0x3d7f('0x1c')&&typeof _0x4ba9b5[_0x3d7f('0x1d')]===_0x3d7f('0x1c');var _0x339307=_0x1cddc4[_0x3d7f('0x1e')];var _0x292825=_0x2ac615?0x0:_0x4ba9b5[_0x3d7f('0x1b')];var _0x5bb495=_0x2ac615?_0x1cddc4[_0x3d7f('0x1e')]:_0x4ba9b5[_0x3d7f('0x1b')]+_0x4ba9b5['limit'];var _0x1186e0;if(_0x5bb495>=_0x339307){_0x5bb495=_0x339307;_0x1186e0=0xc8;}else{_0x1186e0=0xce;}_0x5fd096['status'](_0x1186e0);return _0x5fd096[_0x3d7f('0x1f')](_0x3d7f('0x20'),_0x292825+'-'+_0x5bb495+'/'+_0x339307)[_0x3d7f('0x21')](_0x1cddc4);}return null;};}function patchUpdates(_0x1343d7){return function(_0x590409){try{jsonpatch[_0x3d7f('0x22')](_0x590409,_0x1343d7,!![]);}catch(_0x4c472e){return BPromise['reject'](_0x4c472e);}return _0x590409['save']();};}function saveUpdates(_0x14ee18,_0x1ae247){return function(_0x188345){if(_0x188345){return _0x188345['update'](_0x14ee18)[_0x3d7f('0x23')](function(_0x29a567){return _0x29a567;});}return null;};}function removeEntity(_0x899d64,_0x1e3864){return function(_0x1af69d){if(_0x1af69d){return _0x1af69d[_0x3d7f('0x24')]()['then'](function(){_0x899d64[_0x3d7f('0x1a')](0xcc)[_0x3d7f('0x19')]();});}};}function handleEntityNotFound(_0x1fdb6e,_0x7dab0d){return function(_0x5b87cb){if(!_0x5b87cb){_0x1fdb6e[_0x3d7f('0x18')](0x194);}return _0x5b87cb;};}function handleError(_0x3d3ccd,_0x5c64da){_0x5c64da=_0x5c64da||0x1f4;return function(_0x202ce4){logger[_0x3d7f('0x25')](_0x202ce4[_0x3d7f('0x26')]);if(_0x202ce4['name']){delete _0x202ce4['name'];}_0x3d3ccd[_0x3d7f('0x1a')](_0x5c64da)[_0x3d7f('0x27')](_0x202ce4);};}exports[_0x3d7f('0x28')]=function(_0x134ab5,_0x4c12b7){var _0x377de9={},_0x52eaa1={},_0x4b6d5c={'count':0x0,'rows':[]};var _0xcf1a23=_[_0x3d7f('0x29')](db[_0x3d7f('0x2a')][_0x3d7f('0x2b')],function(_0x441558){return{'name':_0x441558[_0x3d7f('0x2c')],'type':_0x441558[_0x3d7f('0x2d')]['key']};});_0x52eaa1['model']=_[_0x3d7f('0x29')](_0xcf1a23,_0x3d7f('0x2e'));_0x52eaa1[_0x3d7f('0x2f')]=_[_0x3d7f('0x30')](_0x134ab5['query']);_0x52eaa1[_0x3d7f('0x31')]=_[_0x3d7f('0x32')](_0x52eaa1[_0x3d7f('0x33')],_0x52eaa1[_0x3d7f('0x2f')]);_0x377de9['attributes']=_[_0x3d7f('0x32')](_0x52eaa1[_0x3d7f('0x33')],qs[_0x3d7f('0x34')](_0x134ab5[_0x3d7f('0x2f')][_0x3d7f('0x34')]));_0x377de9[_0x3d7f('0x35')]=_0x377de9[_0x3d7f('0x35')]['length']?_0x377de9[_0x3d7f('0x35')]:_0x52eaa1['model'];if(!_0x134ab5['query'][_0x3d7f('0x36')](_0x3d7f('0x37'))){_0x377de9[_0x3d7f('0x1d')]=qs[_0x3d7f('0x1d')](_0x134ab5[_0x3d7f('0x2f')][_0x3d7f('0x1d')]);_0x377de9[_0x3d7f('0x1b')]=qs['offset'](_0x134ab5[_0x3d7f('0x2f')][_0x3d7f('0x1b')]);}_0x377de9[_0x3d7f('0x38')]=qs['sort'](_0x134ab5[_0x3d7f('0x2f')]['sort']);_0x377de9[_0x3d7f('0x39')]=qs['filters'](_[_0x3d7f('0x3a')](_0x134ab5[_0x3d7f('0x2f')],_0x52eaa1[_0x3d7f('0x31')]),_0xcf1a23);if(_0x134ab5[_0x3d7f('0x2f')][_0x3d7f('0x3b')]){_0x377de9['where']=_[_0x3d7f('0x3c')](_0x377de9['where'],{'$or':_[_0x3d7f('0x29')](_0xcf1a23,function(_0x5d57d9){if(_0x5d57d9['type']!==_0x3d7f('0x3d')){var _0x3dfe9e={};_0x3dfe9e[_0x5d57d9['name']]={'$like':'%'+_0x134ab5['query'][_0x3d7f('0x3b')]+'%'};return _0x3dfe9e;}})});}_0x377de9=_[_0x3d7f('0x3c')]({},_0x377de9,_0x134ab5[_0x3d7f('0x3e')]);var _0x54a4ff={'where':_0x377de9[_0x3d7f('0x39')]};return db[_0x3d7f('0x2a')][_0x3d7f('0x1e')](_0x54a4ff)[_0x3d7f('0x23')](function(_0x5c23cb){_0x4b6d5c[_0x3d7f('0x1e')]=_0x5c23cb;if(_0x134ab5['query'][_0x3d7f('0x3f')]){_0x377de9['include']=[{'all':!![]}];}return db['ChatGroup']['findAll'](_0x377de9);})[_0x3d7f('0x23')](function(_0x4ab32e){_0x4b6d5c['rows']=_0x4ab32e;return _0x4b6d5c;})[_0x3d7f('0x23')](respondWithFilteredResult(_0x4c12b7,_0x377de9))[_0x3d7f('0x40')](handleError(_0x4c12b7,null));};exports[_0x3d7f('0x41')]=function(_0x5bb929,_0x3ce46a){var _0x372c26={'raw':!![],'where':{'id':_0x5bb929[_0x3d7f('0x42')]['id']}},_0xf887be={};_0xf887be[_0x3d7f('0x33')]=_[_0x3d7f('0x30')](db['ChatGroup']['rawAttributes']);_0xf887be[_0x3d7f('0x2f')]=_[_0x3d7f('0x30')](_0x5bb929[_0x3d7f('0x2f')]);_0xf887be[_0x3d7f('0x31')]=_[_0x3d7f('0x32')](_0xf887be['model'],_0xf887be[_0x3d7f('0x2f')]);_0x372c26['attributes']=_[_0x3d7f('0x32')](_0xf887be[_0x3d7f('0x33')],qs[_0x3d7f('0x34')](_0x5bb929[_0x3d7f('0x2f')][_0x3d7f('0x34')]));_0x372c26[_0x3d7f('0x35')]=_0x372c26[_0x3d7f('0x35')][_0x3d7f('0x43')]?_0x372c26['attributes']:_0xf887be[_0x3d7f('0x33')];if(_0x5bb929['query'][_0x3d7f('0x3f')]){_0x372c26['include']=[{'all':!![]}];}_0x372c26=_['merge']({},_0x372c26,_0x5bb929[_0x3d7f('0x3e')]);return db[_0x3d7f('0x2a')][_0x3d7f('0x44')](_0x372c26)['then'](handleEntityNotFound(_0x3ce46a,null))[_0x3d7f('0x23')](respondWithResult(_0x3ce46a,null))[_0x3d7f('0x40')](handleError(_0x3ce46a,null));};exports[_0x3d7f('0x45')]=function(_0x371cef,_0x12f327){return db[_0x3d7f('0x2a')]['create'](_0x371cef[_0x3d7f('0x46')],{})[_0x3d7f('0x23')](respondWithResult(_0x12f327,0xc9))[_0x3d7f('0x40')](handleError(_0x12f327,null));};exports[_0x3d7f('0x47')]=function(_0x511cca,_0x550688){if(_0x511cca[_0x3d7f('0x46')]['id']){delete _0x511cca[_0x3d7f('0x46')]['id'];}return db[_0x3d7f('0x2a')][_0x3d7f('0x44')]({'where':{'id':_0x511cca[_0x3d7f('0x42')]['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x550688,null))['then'](saveUpdates(_0x511cca[_0x3d7f('0x46')],null))[_0x3d7f('0x23')](respondWithResult(_0x550688,null))['catch'](handleError(_0x550688,null));};exports[_0x3d7f('0x24')]=function(_0x286e4d,_0x118a84){return db[_0x3d7f('0x2a')]['find']({'where':{'id':_0x286e4d[_0x3d7f('0x42')]['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x118a84,null))[_0x3d7f('0x23')](removeEntity(_0x118a84,null))[_0x3d7f('0x40')](handleError(_0x118a84,null));};exports[_0x3d7f('0x48')]=function(_0x18a107,_0x500b90){return db[_0x3d7f('0x2a')][_0x3d7f('0x48')]()[_0x3d7f('0x23')](respondWithResult(_0x500b90,null))['catch'](handleError(_0x500b90,null));};exports[_0x3d7f('0x49')]=function(_0x4a2b68,_0x31d048,_0x1291ab){return db[_0x3d7f('0x4a')][_0x3d7f('0x1e')]({'where':{'ChatGroupId':_0x4a2b68[_0x3d7f('0x42')]['id'],'ToId':_0x4a2b68[_0x3d7f('0x4b')]['id'],'read':![]}})[_0x3d7f('0x23')](function(_0x2c20fc){return{'id':_['toInteger'](_0x4a2b68[_0x3d7f('0x42')]['id']),'count':_0x2c20fc};})['then'](respondWithResult(_0x31d048,null))[_0x3d7f('0x40')](handleError(_0x31d048,null));};exports[_0x3d7f('0x4c')]=function(_0xadaefb,_0x19e403,_0x578cf6){return db['ChatGroup'][_0x3d7f('0x44')]({'where':{'id':_0xadaefb[_0x3d7f('0x42')]['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x19e403,null))[_0x3d7f('0x23')](function(_0x29937b){if(_0x29937b){return _0x29937b[_0x3d7f('0x4c')](_0xadaefb[_0x3d7f('0x46')][_0x3d7f('0x4d')],_[_0x3d7f('0x4e')](_0xadaefb[_0x3d7f('0x46')],[_0x3d7f('0x4d'),'id'])||{});}})['then'](respondWithResult(_0x19e403,null))[_0x3d7f('0x40')](handleError(_0x19e403,null));};exports[_0x3d7f('0x4f')]=function(_0x5275a4,_0x37444f,_0x5a31d3){var _0x49639a={};var _0x2c2ffa={};var _0x177142;var _0x1063cc;return db[_0x3d7f('0x2a')]['findOne']({'where':{'id':_0x5275a4[_0x3d7f('0x42')]['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x37444f,null))[_0x3d7f('0x23')](function(_0x22e147){if(_0x22e147){_0x177142=_0x22e147;_0x2c2ffa[_0x3d7f('0x33')]=_['keys'](db[_0x3d7f('0x50')]['rawAttributes']);_0x2c2ffa[_0x3d7f('0x2f')]=_[_0x3d7f('0x30')](_0x5275a4[_0x3d7f('0x2f')]);_0x2c2ffa['filters']=_['intersection'](_0x2c2ffa['model'],_0x2c2ffa[_0x3d7f('0x2f')]);_0x49639a['attributes']=_[_0x3d7f('0x32')](_0x2c2ffa[_0x3d7f('0x33')],qs[_0x3d7f('0x34')](_0x5275a4['query'][_0x3d7f('0x34')]));_0x49639a['attributes']=_0x49639a[_0x3d7f('0x35')][_0x3d7f('0x43')]?_0x49639a[_0x3d7f('0x35')]:_0x2c2ffa[_0x3d7f('0x33')];_0x49639a[_0x3d7f('0x38')]=qs[_0x3d7f('0x51')](_0x5275a4[_0x3d7f('0x2f')][_0x3d7f('0x51')]);_0x49639a[_0x3d7f('0x39')]=qs[_0x3d7f('0x31')](_[_0x3d7f('0x3a')](_0x5275a4[_0x3d7f('0x2f')],_0x2c2ffa['filters']));if(_0x5275a4[_0x3d7f('0x2f')][_0x3d7f('0x3b')]){_0x49639a[_0x3d7f('0x39')]=_['merge'](_0x49639a[_0x3d7f('0x39')],{'$or':_[_0x3d7f('0x29')](_0x49639a['attributes'],function(_0x569f57){var _0x59e9bd={};_0x59e9bd[_0x569f57]={'$like':'%'+_0x5275a4[_0x3d7f('0x2f')]['filter']+'%'};return _0x59e9bd;})});}_0x49639a=_[_0x3d7f('0x3c')]({},_0x49639a,_0x5275a4[_0x3d7f('0x3e')]);return _0x177142['getMembers'](_0x49639a);}})[_0x3d7f('0x23')](function(_0x367251){if(_0x367251){_0x1063cc=_0x367251[_0x3d7f('0x43')];if(!_0x5275a4[_0x3d7f('0x2f')][_0x3d7f('0x36')](_0x3d7f('0x37'))){_0x49639a[_0x3d7f('0x1d')]=qs[_0x3d7f('0x1d')](_0x5275a4[_0x3d7f('0x2f')][_0x3d7f('0x1d')]);_0x49639a['offset']=qs[_0x3d7f('0x1b')](_0x5275a4[_0x3d7f('0x2f')][_0x3d7f('0x1b')]);}return _0x177142[_0x3d7f('0x4f')](_0x49639a);}})[_0x3d7f('0x23')](function(_0x499a06){if(_0x499a06){return _0x499a06?{'count':_0x1063cc,'rows':_0x499a06}:null;}})[_0x3d7f('0x23')](respondWithResult(_0x37444f,null))[_0x3d7f('0x40')](handleError(_0x37444f,null));};exports[_0x3d7f('0x52')]=function(_0x24ff7d,_0x574ff2,_0x1496d1){return db[_0x3d7f('0x2a')][_0x3d7f('0x44')]({'where':{'id':_0x24ff7d['params']['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x574ff2,null))[_0x3d7f('0x23')](function(_0x1f07c6){if(_0x1f07c6){return _0x1f07c6['removeMembers'](_0x24ff7d[_0x3d7f('0x2f')][_0x3d7f('0x4d')]);}})['then'](respondWithStatusCode(_0x574ff2,null))['catch'](handleError(_0x574ff2,null));};exports[_0x3d7f('0x53')]=function(_0x5f36ca,_0x49abed,_0x2df284){if(_0x5f36ca[_0x3d7f('0x46')]['id']){delete _0x5f36ca['body']['id'];}return db['ChatGroup'][_0x3d7f('0x44')]({'where':{'id':_0x5f36ca[_0x3d7f('0x42')]['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x49abed,null))[_0x3d7f('0x23')](function(_0x3dadc2){if(_0x3dadc2){_0x5f36ca[_0x3d7f('0x46')][_0x3d7f('0x54')]=_0x3dadc2['id'];return db[_0x3d7f('0x4a')][_0x3d7f('0x45')](_0x5f36ca[_0x3d7f('0x46')]);}})[_0x3d7f('0x23')](respondWithResult(_0x49abed,null))['catch'](handleError(_0x49abed,null));};exports['getMessages']=function(_0x4cc968,_0x315eeb,_0x43477d){var _0x1c44c4={};var _0x10821b={};var _0x4dcca6;var _0xd9f006;return db[_0x3d7f('0x2a')][_0x3d7f('0x55')]({'where':{'id':_0x4cc968[_0x3d7f('0x42')]['id']}})[_0x3d7f('0x23')](handleEntityNotFound(_0x315eeb,null))[_0x3d7f('0x23')](function(_0x526d2b){if(_0x526d2b){_0x4dcca6=_0x526d2b;_0x10821b[_0x3d7f('0x33')]=_[_0x3d7f('0x30')](db[_0x3d7f('0x4a')][_0x3d7f('0x2b')]);_0x10821b[_0x3d7f('0x2f')]=_['keys'](_0x4cc968['query']);_0x10821b[_0x3d7f('0x31')]=_['intersection'](_0x10821b[_0x3d7f('0x33')],_0x10821b[_0x3d7f('0x2f')]);_0x1c44c4[_0x3d7f('0x35')]=_[_0x3d7f('0x32')](_0x10821b[_0x3d7f('0x33')],qs[_0x3d7f('0x34')](_0x4cc968[_0x3d7f('0x2f')]['fields']));_0x1c44c4[_0x3d7f('0x35')]=_0x1c44c4[_0x3d7f('0x35')][_0x3d7f('0x43')]?_0x1c44c4[_0x3d7f('0x35')]:_0x10821b[_0x3d7f('0x33')];_0x1c44c4[_0x3d7f('0x38')]=qs[_0x3d7f('0x51')](_0x4cc968[_0x3d7f('0x2f')][_0x3d7f('0x51')]);_0x1c44c4[_0x3d7f('0x39')]=qs[_0x3d7f('0x31')](_[_0x3d7f('0x3a')](_0x4cc968[_0x3d7f('0x2f')],_0x10821b[_0x3d7f('0x31')]));if(_0x4cc968[_0x3d7f('0x2f')][_0x3d7f('0x3b')]){_0x1c44c4[_0x3d7f('0x39')]=_['merge'](_0x1c44c4[_0x3d7f('0x39')],{'$or':_['map'](_0x1c44c4[_0x3d7f('0x35')],function(_0x924173){var _0x46f69c={};_0x46f69c[_0x924173]={'$like':'%'+_0x4cc968['query'][_0x3d7f('0x3b')]+'%'};return _0x46f69c;})});}if(_0x4cc968[_0x3d7f('0x2f')][_0x3d7f('0x56')]){var _0x510243=_0x4cc968[_0x3d7f('0x2f')][_0x3d7f('0x56')]['split'](',');var _0x579617={};_0x579617[_0x510243[0x0]]={'$gte':moment(_0x510243[0x1])[_0x3d7f('0x57')](_0x3d7f('0x58'))};_0x1c44c4['where']=_[_0x3d7f('0x3c')](_0x1c44c4[_0x3d7f('0x39')],_0x579617);}_0x1c44c4=_[_0x3d7f('0x3c')]({},_0x1c44c4,_0x4cc968[_0x3d7f('0x3e')]);return _0x4dcca6['getMessages'](_0x1c44c4);}})[_0x3d7f('0x23')](function(_0x40caa4){if(_0x40caa4){_0xd9f006=_0x40caa4[_0x3d7f('0x43')];if(!_0x4cc968[_0x3d7f('0x2f')][_0x3d7f('0x36')]('nolimit')){_0x1c44c4[_0x3d7f('0x1d')]=qs['limit'](_0x4cc968[_0x3d7f('0x2f')][_0x3d7f('0x1d')]);_0x1c44c4[_0x3d7f('0x1b')]=qs[_0x3d7f('0x1b')](_0x4cc968['query'][_0x3d7f('0x1b')]);}return _0x4dcca6[_0x3d7f('0x59')](_0x1c44c4);}})[_0x3d7f('0x23')](function(_0x23f25e){if(_0x23f25e){return _0x23f25e?{'count':_0xd9f006,'rows':_0x23f25e}:null;}})[_0x3d7f('0x23')](respondWithResult(_0x315eeb,null))['catch'](handleError(_0x315eeb,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index 598dadf..1a4efc2 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 _0xd237=['emit','hook','exports','events','../../mysqldb','ChatGroup','setMaxListeners','update'];(function(_0x29f06c,_0x2af734){var _0x4b8359=function(_0x3eeef8){while(--_0x3eeef8){_0x29f06c['push'](_0x29f06c['shift']());}};_0x4b8359(++_0x2af734);}(_0xd237,0x12b));var _0x7d23=function(_0x4b4b1a,_0x276dd5){_0x4b4b1a=_0x4b4b1a-0x0;var _0x5056ec=_0xd237[_0x4b4b1a];return _0x5056ec;};'use strict';var EventEmitter=require(_0x7d23('0x0'));var ChatGroup=require(_0x7d23('0x1'))['db'][_0x7d23('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x7d23('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7d23('0x4'),'afterDestroy':'remove'};function emitEvent(_0x288134){return function(_0x2c0505,_0x2bc609,_0x39ec94){ChatGroupEvents[_0x7d23('0x5')](_0x288134+':'+_0x2c0505['id'],_0x2c0505);ChatGroupEvents['emit'](_0x288134,_0x2c0505);_0x39ec94(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x7d23('0x6')](e,emitEvent(event));}}module[_0x7d23('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0xb9d9=['../../mysqldb','ChatGroup','setMaxListeners','save','update','emit','hasOwnProperty','exports','events'];(function(_0x3777aa,_0x16229c){var _0x4247f3=function(_0x4f54cc){while(--_0x4f54cc){_0x3777aa['push'](_0x3777aa['shift']());}};_0x4247f3(++_0x16229c);}(_0xb9d9,0x104));var _0x9b9d=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xb9d9[_0x19e35c];return _0x3e1fe8;};'use strict';var EventEmitter=require(_0x9b9d('0x0'));var ChatGroup=require(_0x9b9d('0x1'))['db'][_0x9b9d('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x9b9d('0x3')](0x0);var events={'afterCreate':_0x9b9d('0x4'),'afterUpdate':_0x9b9d('0x5'),'afterDestroy':'remove'};function emitEvent(_0x2ef1dd){return function(_0x1810cf,_0xc8f8ad,_0x3d7109){ChatGroupEvents['emit'](_0x2ef1dd+':'+_0x1810cf['id'],_0x1810cf);ChatGroupEvents[_0x9b9d('0x6')](_0x2ef1dd,_0x1810cf);_0x3d7109(null);};}for(var e in events){if(events[_0x9b9d('0x7')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x9b9d('0x8')]=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 1d1386e..39973a1 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 _0x09e8=['../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','ChatGroup','chat_groups','lodash','util'];(function(_0x2671be,_0x5ce4fa){var _0x386b62=function(_0x5a0f5a){while(--_0x5a0f5a){_0x2671be['push'](_0x2671be['shift']());}};_0x386b62(++_0x5ce4fa);}(_0x09e8,0xf5));var _0x809e=function(_0x394be4,_0x56ca61){_0x394be4=_0x394be4-0x0;var _0x30218e=_0x09e8[_0x394be4];return _0x30218e;};'use strict';var _=require(_0x809e('0x0'));var util=require(_0x809e('0x1'));var logger=require(_0x809e('0x2'))(_0x809e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x809e('0x4'));var fs=require('fs');var path=require(_0x809e('0x5'));var rimraf=require(_0x809e('0x6'));var config=require(_0x809e('0x7'));var attributes=require(_0x809e('0x8'));module[_0x809e('0x9')]=function(_0x4d44e6,_0x3f8c1d){return _0x4d44e6[_0x809e('0xa')](_0x809e('0xb'),attributes,{'tableName':_0x809e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8c7d=['bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment'];(function(_0x388280,_0x5f3c13){var _0x1f2dd6=function(_0xeefd97){while(--_0xeefd97){_0x388280['push'](_0x388280['shift']());}};_0x1f2dd6(++_0x5f3c13);}(_0x8c7d,0x1cf));var _0xd8c7=function(_0x1a4971,_0x551027){_0x1a4971=_0x1a4971-0x0;var _0x50326b=_0x8c7d[_0x1a4971];return _0x50326b;};'use strict';var _=require(_0xd8c7('0x0'));var util=require(_0xd8c7('0x1'));var logger=require(_0xd8c7('0x2'))(_0xd8c7('0x3'));var moment=require(_0xd8c7('0x4'));var BPromise=require(_0xd8c7('0x5'));var rp=require(_0xd8c7('0x6'));var fs=require('fs');var path=require(_0xd8c7('0x7'));var rimraf=require(_0xd8c7('0x8'));var config=require(_0xd8c7('0x9'));var attributes=require('./chatGroup.attributes');module[_0xd8c7('0xa')]=function(_0x7c17a5,_0x5826b1){return _0x7c17a5['define'](_0xd8c7('0xb'),attributes,{'tableName':_0xd8c7('0xc'),'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 58eb9c8..cb76684 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 _0xa1f6=['ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','request\x20sent','debug'];(function(_0xf6b083,_0x49a944){var _0x529170=function(_0x1dd2b9){while(--_0x1dd2b9){_0xf6b083['push'](_0xf6b083['shift']());}};_0x529170(++_0x49a944);}(_0xa1f6,0x19d));var _0x6a1f=function(_0x104a84,_0x285970){_0x104a84=_0x104a84-0x0;var _0x4973ff=_0xa1f6[_0x104a84];return _0x4973ff;};'use strict';var _=require(_0x6a1f('0x0'));var util=require(_0x6a1f('0x1'));var moment=require(_0x6a1f('0x2'));var BPromise=require(_0x6a1f('0x3'));var rs=require(_0x6a1f('0x4'));var fs=require('fs');var Redis=require(_0x6a1f('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x6a1f('0x6'));var client=jayson[_0x6a1f('0x7')][_0x6a1f('0x8')]({'port':0x232a});config[_0x6a1f('0x9')]=_[_0x6a1f('0xa')](config[_0x6a1f('0x9')],{'host':_0x6a1f('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6a1f('0x9')]));require(_0x6a1f('0xc'))[_0x6a1f('0xd')](socket);function respondWithRpcPromise(_0x287e54,_0x1617b7,_0x5aafd2){return new BPromise(function(_0x30fd4e,_0x17f866){return client[_0x6a1f('0xe')](_0x287e54,_0x5aafd2)[_0x6a1f('0xf')](function(_0x59fc17){logger[_0x6a1f('0x10')]('ChatGroup,\x20%s,\x20%s',_0x1617b7,_0x6a1f('0x11'));logger[_0x6a1f('0x12')](_0x6a1f('0x13'),_0x1617b7,_0x6a1f('0x11'),JSON[_0x6a1f('0x14')](_0x59fc17));if(_0x59fc17[_0x6a1f('0x15')]){if(_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x16')]===0x1f4){logger[_0x6a1f('0x15')](_0x6a1f('0x17'),_0x1617b7,_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x18')]);return _0x17f866(_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x18')]);}logger[_0x6a1f('0x15')](_0x6a1f('0x17'),_0x1617b7,_0x59fc17[_0x6a1f('0x15')][_0x6a1f('0x18')]);return _0x30fd4e(_0x59fc17[_0x6a1f('0x15')]['message']);}else{logger[_0x6a1f('0x10')](_0x6a1f('0x17'),_0x1617b7,_0x6a1f('0x11'));_0x30fd4e(_0x59fc17[_0x6a1f('0x19')][_0x6a1f('0x18')]);}})[_0x6a1f('0x1a')](function(_0x19562a){logger[_0x6a1f('0x15')]('ChatGroup,\x20%s,\x20%s',_0x1617b7,_0x19562a);_0x17f866(_0x19562a);});});}
\ No newline at end of file
+var _0x624c=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','localhost','./chatGroup.socket','register','request','then','info','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','code','ChatGroup,\x20%s,\x20%s','error','message','result'];(function(_0x1286db,_0x10d323){var _0x3dcbd0=function(_0x30f5ee){while(--_0x30f5ee){_0x1286db['push'](_0x1286db['shift']());}};_0x3dcbd0(++_0x10d323);}(_0x624c,0x1ee));var _0xc624=function(_0x266b0c,_0x4fb269){_0x266b0c=_0x266b0c-0x0;var _0xd1bfa7=_0x624c[_0x266b0c];return _0xd1bfa7;};'use strict';var _=require('lodash');var util=require(_0xc624('0x0'));var moment=require(_0xc624('0x1'));var BPromise=require(_0xc624('0x2'));var rs=require(_0xc624('0x3'));var fs=require('fs');var Redis=require(_0xc624('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc624('0x5'));var logger=require('../../config/logger')(_0xc624('0x6'));var config=require('../../config/environment');var jayson=require(_0xc624('0x7'));var client=jayson[_0xc624('0x8')][_0xc624('0x9')]({'port':0x232a});config[_0xc624('0xa')]=_[_0xc624('0xb')](config[_0xc624('0xa')],{'host':_0xc624('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc624('0xa')]));require(_0xc624('0xd'))[_0xc624('0xe')](socket);function respondWithRpcPromise(_0x542c5e,_0x44e4d9,_0x2ad32e){return new BPromise(function(_0x4a7cf1,_0x313512){return client[_0xc624('0xf')](_0x542c5e,_0x2ad32e)[_0xc624('0x10')](function(_0x113b89){logger[_0xc624('0x11')]('ChatGroup,\x20%s,\x20%s',_0x44e4d9,_0xc624('0x12'));logger[_0xc624('0x13')](_0xc624('0x14'),_0x44e4d9,_0xc624('0x12'),JSON['stringify'](_0x113b89));if(_0x113b89['error']){if(_0x113b89['error'][_0xc624('0x15')]===0x1f4){logger['error'](_0xc624('0x16'),_0x44e4d9,_0x113b89[_0xc624('0x17')][_0xc624('0x18')]);return _0x313512(_0x113b89[_0xc624('0x17')][_0xc624('0x18')]);}logger[_0xc624('0x17')]('ChatGroup,\x20%s,\x20%s',_0x44e4d9,_0x113b89[_0xc624('0x17')][_0xc624('0x18')]);return _0x4a7cf1(_0x113b89[_0xc624('0x17')]['message']);}else{logger[_0xc624('0x11')](_0xc624('0x16'),_0x44e4d9,'request\x20sent');_0x4a7cf1(_0x113b89[_0xc624('0x19')][_0xc624('0x18')]);}})['catch'](function(_0x3dad91){logger['error']('ChatGroup,\x20%s,\x20%s',_0x44e4d9,_0x3dad91);_0x313512(_0x3dad91);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index e8c1ef3..56eb209 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 _0x3265=['register','length','chatGroup:','remove','update','emit'];(function(_0x3252f7,_0x1678e5){var _0x591cf0=function(_0x2b3e53){while(--_0x2b3e53){_0x3252f7['push'](_0x3252f7['shift']());}};_0x591cf0(++_0x1678e5);}(_0x3265,0x165));var _0x5326=function(_0x4d804e,_0x33b1ef){_0x4d804e=_0x4d804e-0x0;var _0x645a8e=_0x3265[_0x4d804e];return _0x645a8e;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0x5326('0x0'),_0x5326('0x1')];function createListener(_0x43d80f,_0x505003){return function(_0x3dbd91){_0x505003[_0x5326('0x2')](_0x43d80f,_0x3dbd91);};}function removeListener(_0x1a81e9,_0x5d6785){return function(){ChatGroupEvents['removeListener'](_0x1a81e9,_0x5d6785);};}exports[_0x5326('0x3')]=function(_0x5b2830){for(var _0x5a1974=0x0,_0x5c130f=events[_0x5326('0x4')];_0x5a1974<_0x5c130f;_0x5a1974++){var _0x4a1241=events[_0x5a1974];var _0x357625=createListener(_0x5326('0x5')+_0x4a1241,_0x5b2830);ChatGroupEvents['on'](_0x4a1241,_0x357625);}};
\ No newline at end of file
+var _0x3c36=['save','emit','removeListener','register','length','chatGroup:','./chatGroup.events'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x3c36,0x1d4));var _0x63c3=function(_0x6f01e4,_0x20f67a){_0x6f01e4=_0x6f01e4-0x0;var _0x15649e=_0x3c36[_0x6f01e4];return _0x15649e;};'use strict';var ChatGroupEvents=require(_0x63c3('0x0'));var events=[_0x63c3('0x1'),'remove','update'];function createListener(_0x5bdc10,_0x121482){return function(_0x358930){_0x121482[_0x63c3('0x2')](_0x5bdc10,_0x358930);};}function removeListener(_0x8b684f,_0x2eeceb){return function(){ChatGroupEvents[_0x63c3('0x3')](_0x8b684f,_0x2eeceb);};}exports[_0x63c3('0x4')]=function(_0x4799e){for(var _0x496551=0x0,_0x2b0899=events[_0x63c3('0x5')];_0x496551<_0x2b0899;_0x496551++){var _0x9f7fab=events[_0x496551];var _0x338ca3=createListener(_0x63c3('0x6')+_0x9f7fab,_0x4799e);ChatGroupEvents['on'](_0x9f7fab,_0x338ca3);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index d1f6315..b592a6b 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 _0x5974=['connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','index','describe','/:id','isAuthenticated','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','put','destroy','delete','removeMembers','exports','multer','path'];(function(_0x112595,_0x50b0c2){var _0x4b2ea7=function(_0x42253f){while(--_0x42253f){_0x112595['push'](_0x112595['shift']());}};_0x4b2ea7(++_0x50b0c2);}(_0x5974,0x11c));var _0x4597=function(_0x255c48,_0x2a4449){_0x255c48=_0x255c48-0x0;var _0xaebda3=_0x5974[_0x255c48];return _0xaebda3;};'use strict';var multer=require(_0x4597('0x0'));var util=require('util');var path=require(_0x4597('0x1'));var timeout=require(_0x4597('0x2'));var express=require(_0x4597('0x3'));var router=express['Router']();var fs_extra=require(_0x4597('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x4597('0x5'));var config=require(_0x4597('0x6'));var controller=require(_0x4597('0x7'));router[_0x4597('0x8')]('/',auth['isAuthenticated'](),controller[_0x4597('0x9')]);router[_0x4597('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x4597('0xa')]);router[_0x4597('0x8')](_0x4597('0xb'),auth[_0x4597('0xc')](),controller[_0x4597('0xd')]);router[_0x4597('0x8')](_0x4597('0xe'),auth[_0x4597('0xc')](),controller[_0x4597('0xf')]);router[_0x4597('0x8')](_0x4597('0x10'),auth['isAuthenticated'](),controller[_0x4597('0x11')]);router[_0x4597('0x8')](_0x4597('0x12'),auth[_0x4597('0xc')](),controller[_0x4597('0x13')]);router[_0x4597('0x14')]('/',auth[_0x4597('0xc')](),controller['create']);router[_0x4597('0x14')](_0x4597('0x10'),auth[_0x4597('0xc')](),controller['addMembers']);router[_0x4597('0x14')]('/:id/messages',auth[_0x4597('0xc')](),controller['addMessage']);router[_0x4597('0x15')](_0x4597('0xb'),auth[_0x4597('0xc')](),controller['update']);router['delete'](_0x4597('0xb'),auth['isAuthenticated'](),controller[_0x4597('0x16')]);router[_0x4597('0x17')](_0x4597('0x10'),auth[_0x4597('0xc')](),controller[_0x4597('0x18')]);module[_0x4597('0x19')]=router;
\ No newline at end of file
+var _0x76a3=['/:id/members','getMembers','/:id/messages','getMessages','post','create','addMessage','update','delete','destroy','removeMembers','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','/describe','describe','/:id','show','/:id/unread','getUnread'];(function(_0x13ae91,_0x42ec71){var _0x5084c1=function(_0x492fd4){while(--_0x492fd4){_0x13ae91['push'](_0x13ae91['shift']());}};_0x5084c1(++_0x42ec71);}(_0x76a3,0x191));var _0x376a=function(_0x4191af,_0x5783da){_0x4191af=_0x4191af-0x0;var _0x27bebf=_0x76a3[_0x4191af];return _0x27bebf;};'use strict';var multer=require(_0x376a('0x0'));var util=require(_0x376a('0x1'));var path=require(_0x376a('0x2'));var timeout=require(_0x376a('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x376a('0x4'));var auth=require(_0x376a('0x5'));var interaction=require(_0x376a('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0x376a('0x7')]('/',auth[_0x376a('0x8')](),controller['index']);router['get'](_0x376a('0x9'),auth[_0x376a('0x8')](),controller[_0x376a('0xa')]);router['get'](_0x376a('0xb'),auth[_0x376a('0x8')](),controller[_0x376a('0xc')]);router['get'](_0x376a('0xd'),auth[_0x376a('0x8')](),controller[_0x376a('0xe')]);router[_0x376a('0x7')](_0x376a('0xf'),auth[_0x376a('0x8')](),controller[_0x376a('0x10')]);router[_0x376a('0x7')](_0x376a('0x11'),auth[_0x376a('0x8')](),controller[_0x376a('0x12')]);router[_0x376a('0x13')]('/',auth['isAuthenticated'](),controller[_0x376a('0x14')]);router[_0x376a('0x13')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x376a('0x13')]('/:id/messages',auth[_0x376a('0x8')](),controller[_0x376a('0x15')]);router['put'](_0x376a('0xb'),auth[_0x376a('0x8')](),controller[_0x376a('0x16')]);router[_0x376a('0x17')]('/:id',auth[_0x376a('0x8')](),controller[_0x376a('0x18')]);router['delete'](_0x376a('0xf'),auth[_0x376a('0x8')](),controller[_0x376a('0x19')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 0aaa1ba..e09924a 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 _0xc776=['ENUM','out','sequelize','exports','BOOLEAN','INTEGER','thumb','star','TEXT','STRING','DATE','long'];(function(_0x211083,_0x14b2ba){var _0x16f197=function(_0x4786df){while(--_0x4786df){_0x211083['push'](_0x211083['shift']());}};_0x16f197(++_0x14b2ba);}(_0xc776,0x19a));var _0x6c77=function(_0x389ec3,_0x54d22c){_0x389ec3=_0x389ec3-0x0;var _0x16ed5a=_0xc776[_0x389ec3];return _0x16ed5a;};'use strict';var Sequelize=require(_0x6c77('0x0'));module[_0x6c77('0x1')]={'closed':{'type':Sequelize[_0x6c77('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x6c77('0x3')]},'ratingType':{'type':Sequelize['ENUM']('star',_0x6c77('0x4')),'defaultValue':_0x6c77('0x5')},'ratingMessage':{'type':Sequelize[_0x6c77('0x6')]},'pathTranscript':{'type':Sequelize[_0x6c77('0x6')]},'mailTranscript':{'type':Sequelize[_0x6c77('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x6c77('0x8')]},'disposition':{'type':Sequelize[_0x6c77('0x7')]},'secondDisposition':{'type':Sequelize[_0x6c77('0x7')]},'thirdDisposition':{'type':Sequelize[_0x6c77('0x7')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x6c77('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0x6c77('0x7')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x6c77('0x7')]},'deviceType':{'type':Sequelize[_0x6c77('0x7')]},'referer':{'type':Sequelize[_0x6c77('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x6c77('0x6')](_0x6c77('0x9'))},'read1stAt':{'type':Sequelize[_0x6c77('0x8')]},'lastMsgAt':{'type':Sequelize[_0x6c77('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x6c77('0xa')]('in',_0x6c77('0xb')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x6c77('0x7')]},'customerPort':{'type':Sequelize['STRING']},'vidaooSessionId':{'type':Sequelize[_0x6c77('0x6')]},'autoreplyExecuted':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xa5bb=['out','BOOLEAN','sequelize','exports','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE'];(function(_0x400ac4,_0x2eb641){var _0xda0dc8=function(_0x2a13bb){while(--_0x2a13bb){_0x400ac4['push'](_0x400ac4['shift']());}};_0xda0dc8(++_0x2eb641);}(_0xa5bb,0x18e));var _0xba5b=function(_0x16c3d5,_0x17b09e){_0x16c3d5=_0x16c3d5-0x0;var _0xd8a02a=_0xa5bb[_0x16c3d5];return _0xd8a02a;};'use strict';var Sequelize=require(_0xba5b('0x0'));module[_0xba5b('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xba5b('0x2')]},'ratingType':{'type':Sequelize[_0xba5b('0x3')](_0xba5b('0x4'),_0xba5b('0x5')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0xba5b('0x6')]},'pathTranscript':{'type':Sequelize[_0xba5b('0x6')]},'mailTranscript':{'type':Sequelize[_0xba5b('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xba5b('0x8')]},'disposition':{'type':Sequelize[_0xba5b('0x7')]},'secondDisposition':{'type':Sequelize[_0xba5b('0x7')]},'thirdDisposition':{'type':Sequelize[_0xba5b('0x7')]},'note':{'type':Sequelize[_0xba5b('0x7')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xba5b('0x7')]},'osName':{'type':Sequelize[_0xba5b('0x7')]},'osVersion':{'type':Sequelize[_0xba5b('0x7')]},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0xba5b('0x7')]},'deviceType':{'type':Sequelize[_0xba5b('0x7')]},'referer':{'type':Sequelize[_0xba5b('0x6')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0xba5b('0x6')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0xba5b('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xba5b('0x3')]('in',_0xba5b('0x9')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xba5b('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0xba5b('0xa')],'defaultValue':![]},'queueId':{'type':Sequelize[_0xba5b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 28ad221..1e42259 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 _0x7280=['originalname','mimetype','Attachment','Unauthorized','attachId','root','join','basename','close','mailTranscript','transcript-%s.txt','now','ChatMessage','Messages','User','format','%s%d','agentAlias','customer','Visitor','ContactId','agentIdentifier','System','[%s]\x20%s:\x20%s\x0a','direction','secret','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','fields','hasOwnProperty','nolimit','order','sort','pick','where','ChatInteractionId','filter','$gte','split','YYYY-MM-DD\x20HH:mm:ss','options','include','rows','getMyMessages','includeAgent','push','alias','addTags','spread','Tag','color','removeTags','download','toString','tmp','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','createdAt','read','Owner','Chat','Account','N.A.','closedAt','browserName','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','views','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','rimraf','zip-dir','request-promise','moment','mustache','util','path','ejs','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','destroy','stack','name','send','render','merge','body','contact','agent','interaction','account','index','map','ChatInteraction','rawAttributes','fieldName','type','getOptions','findAll','chat','show','params','model','query','keys','attributes','intersection','length','includeAll','create','find','describe','findOne','ChatWebsite','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','user','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','metadata','Sequelize','ValidationError','Error\x20in\x20conversion\x20vidaooMetadata','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','customUpdate','CmContact','Contact','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','UserId','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file'];(function(_0x285592,_0x98b4f9){var _0x3ee37b=function(_0x4a46b){while(--_0x4a46b){_0x285592['push'](_0x285592['shift']());}};_0x3ee37b(++_0x98b4f9);}(_0x7280,0x12a));var _0x0728=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x7280[_0x50a0c2];return _0x5ebadd;};'use strict';var rimraf=require(_0x0728('0x0'));var zipdir=require(_0x0728('0x1'));var rp=require(_0x0728('0x2'));var moment=require(_0x0728('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x0728('0x4'));var util=require(_0x0728('0x5'));var path=require(_0x0728('0x6'));var ejs=require(_0x0728('0x7'));var fs=require('fs');var _=require('lodash');var Redis=require(_0x0728('0x8'));var interaction=require(_0x0728('0x9'));var qs=require(_0x0728('0xa'));var pdf=require(_0x0728('0xb'));var logger=require(_0x0728('0xc'))(_0x0728('0xd'));var config=require(_0x0728('0xe'));var db=require('../../mysqldb')['db'];config[_0x0728('0xf')]=_[_0x0728('0x10')](config[_0x0728('0xf')],{'host':_0x0728('0x11'),'port':0x18eb});var socket=require(_0x0728('0x12'))(new Redis(config[_0x0728('0xf')]));require('./chatInteraction.socket')[_0x0728('0x13')](socket);var jayson=require(_0x0728('0x14'));var client=jayson[_0x0728('0x15')][_0x0728('0x16')]({'port':0x232b});var client9004=jayson['client'][_0x0728('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x1efeaa,_0x121165,_0x4e2c0e,_0x5c90fb){return new BPromise(function(_0x3d10f9,_0x916d3c){var _0x36265c=_0x5c90fb||client;return _0x36265c[_0x0728('0x17')](_0x1efeaa,_0x4e2c0e)[_0x0728('0x18')](function(_0x565ed0){logger[_0x0728('0x19')](_0x0728('0x1a'),_0x121165,_0x0728('0x1b'));logger[_0x0728('0x1c')](_0x0728('0x1d'),_0x121165,_0x0728('0x1b'),JSON[_0x0728('0x1e')](_0x565ed0));if(_0x565ed0['error']){if(_0x565ed0[_0x0728('0x1f')][_0x0728('0x20')]===0x1f4){logger[_0x0728('0x1f')](_0x0728('0x1a'),_0x121165,_0x565ed0['error'][_0x0728('0x21')]);return _0x916d3c(_0x565ed0[_0x0728('0x1f')][_0x0728('0x21')]);}logger['error'](_0x0728('0x1a'),_0x121165,_0x565ed0[_0x0728('0x1f')][_0x0728('0x21')]);return _0x3d10f9(_0x565ed0[_0x0728('0x1f')][_0x0728('0x21')]);}else{logger[_0x0728('0x19')](_0x0728('0x1a'),_0x121165,_0x0728('0x1b'));_0x3d10f9(_0x565ed0[_0x0728('0x22')][_0x0728('0x21')]);}})[_0x0728('0x23')](function(_0x509b67){logger[_0x0728('0x1f')](_0x0728('0x1a'),_0x121165,_0x509b67);_0x916d3c(_0x509b67);});});}function respondWithStatusCode(_0x390d9b,_0x40f572){_0x40f572=_0x40f572||0xcc;return function(_0x1cfcec){if(_0x1cfcec){return _0x390d9b[_0x0728('0x24')](_0x40f572);}return _0x390d9b[_0x0728('0x25')](_0x40f572)[_0x0728('0x26')]();};}function respondWithResult(_0x3dbc4a,_0x1ab55f){_0x1ab55f=_0x1ab55f||0xc8;return function(_0x27bc9e){if(_0x27bc9e){return _0x3dbc4a[_0x0728('0x25')](_0x1ab55f)[_0x0728('0x27')](_0x27bc9e);}};}function respondWithFilteredResult(_0x29091a,_0xa6121a){return function(_0xe3164){if(_0xe3164){var _0x1ccba8=typeof _0xa6121a[_0x0728('0x28')]===_0x0728('0x29')&&typeof _0xa6121a[_0x0728('0x2a')]===_0x0728('0x29');var _0x128a49=_0xe3164[_0x0728('0x2b')];var _0x5d64e6=_0x1ccba8?0x0:_0xa6121a[_0x0728('0x28')];var _0x35a219=_0x1ccba8?_0xe3164['count']:_0xa6121a[_0x0728('0x28')]+_0xa6121a[_0x0728('0x2a')];var _0x559ac3;if(_0x35a219>=_0x128a49){_0x35a219=_0x128a49;_0x559ac3=0xc8;}else{_0x559ac3=0xce;}_0x29091a['status'](_0x559ac3);return _0x29091a[_0x0728('0x2c')](_0x0728('0x2d'),_0x5d64e6+'-'+_0x35a219+'/'+_0x128a49)['json'](_0xe3164);}return null;};}function saveUpdates(_0x5272f6){return function(_0x553253){if(_0x553253){return _0x553253['update'](_0x5272f6)[_0x0728('0x18')](function(_0x1a254f){return _0x1a254f;});}return null;};}function removeEntity(_0x1aed4a){return function(_0x14e0ad){if(_0x14e0ad){return _0x14e0ad[_0x0728('0x2e')]()[_0x0728('0x18')](function(){_0x1aed4a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x45f63d){return function(_0x12117c){if(!_0x12117c){_0x45f63d[_0x0728('0x24')](0x194);}return _0x12117c;};}function handleError(_0x1f30ee,_0x219f1f){_0x219f1f=_0x219f1f||0x1f4;return function(_0x5a8cf2){logger[_0x0728('0x1f')](_0x5a8cf2[_0x0728('0x2f')]);if(_0x5a8cf2[_0x0728('0x30')]){delete _0x5a8cf2['name'];}_0x1f30ee[_0x0728('0x25')](_0x219f1f)[_0x0728('0x31')](_0x5a8cf2);};}function getMustacheRender(_0x2aded2,_0x468a16){return Mustache[_0x0728('0x32')](_0x2aded2,_[_0x0728('0x33')](_0x468a16[_0x0728('0x34')],{'contact':_0x468a16[_0x0728('0x35')],'message':_0x468a16[_0x0728('0x21')],'agent':_0x468a16[_0x0728('0x36')],'interaction':_0x468a16[_0x0728('0x37')],'account':_0x468a16[_0x0728('0x38')]}))||'';}exports[_0x0728('0x39')]=function(_0x276699,_0x45ee49){var _0x77a394={};var _0x3af80b=_[_0x0728('0x3a')](db[_0x0728('0x3b')][_0x0728('0x3c')],function(_0x314042){return{'name':_0x314042[_0x0728('0x3d')],'type':_0x314042[_0x0728('0x3e')]['key']};});_0x77a394=qs[_0x0728('0x3f')](_0x3af80b,_0x276699);return interaction[_0x0728('0x40')](_0x0728('0x41'),_0x276699['query'],_0x276699['user'],_0x77a394,_0x3af80b)[_0x0728('0x18')](respondWithFilteredResult(_0x45ee49,_0x77a394))[_0x0728('0x23')](handleError(_0x45ee49,null));};exports[_0x0728('0x42')]=function(_0x44c475,_0x267f78){var _0x101352={'raw':![],'where':{'id':_0x44c475[_0x0728('0x43')]['id']}},_0x489ae6={};_0x489ae6[_0x0728('0x44')]=_['keys'](db[_0x0728('0x3b')][_0x0728('0x3c')]);_0x489ae6[_0x0728('0x45')]=_[_0x0728('0x46')](_0x44c475[_0x0728('0x45')]);_0x489ae6['filters']=_['intersection'](_0x489ae6[_0x0728('0x44')],_0x489ae6[_0x0728('0x45')]);_0x101352[_0x0728('0x47')]=_[_0x0728('0x48')](_0x489ae6[_0x0728('0x44')],qs['fields'](_0x44c475['query']['fields']));_0x101352[_0x0728('0x47')]=_0x101352[_0x0728('0x47')][_0x0728('0x49')]?_0x101352[_0x0728('0x47')]:_0x489ae6['model'];if(_0x44c475[_0x0728('0x45')][_0x0728('0x4a')]){_0x101352['include']=[{'all':!![]}];}_0x101352=_[_0x0728('0x33')]({},_0x101352,_0x44c475['options']);return db['ChatInteraction']['find'](_0x101352)['then'](handleEntityNotFound(_0x267f78,null))[_0x0728('0x18')](respondWithResult(_0x267f78,null))[_0x0728('0x23')](handleError(_0x267f78,null));};exports['create']=function(_0x330ca0,_0x4ad37a){return db[_0x0728('0x3b')][_0x0728('0x4b')](_0x330ca0[_0x0728('0x34')],{})[_0x0728('0x18')](respondWithResult(_0x4ad37a,0xc9))[_0x0728('0x23')](handleError(_0x4ad37a,null));};exports['update']=function(_0x2f8878,_0x89aabf){if(_0x2f8878[_0x0728('0x34')]['id']){delete _0x2f8878[_0x0728('0x34')]['id'];}return db[_0x0728('0x3b')][_0x0728('0x4c')]({'where':{'id':_0x2f8878['params']['id']}})['then'](handleEntityNotFound(_0x89aabf,null))['then'](saveUpdates(_0x2f8878[_0x0728('0x34')],null))[_0x0728('0x18')](respondWithResult(_0x89aabf,null))[_0x0728('0x23')](handleError(_0x89aabf,null));};exports[_0x0728('0x2e')]=function(_0x4112d8,_0x4fd648){return db['ChatInteraction'][_0x0728('0x4c')]({'where':{'id':_0x4112d8[_0x0728('0x43')]['id']}})['then'](handleEntityNotFound(_0x4fd648,null))[_0x0728('0x18')](removeEntity(_0x4fd648,null))[_0x0728('0x23')](handleError(_0x4fd648,null));};exports[_0x0728('0x4d')]=function(_0xc3124d,_0x2fec06){return db['ChatInteraction'][_0x0728('0x4d')]()[_0x0728('0x18')](respondWithResult(_0x2fec06,null))['catch'](handleError(_0x2fec06,null));};exports['createVidaooSession']=function(_0x5d45db,_0x4c52f1){var _0x3666d5=_0x5d45db['params']['id'];var _0x6f64c2;var _0x21ce97;var _0x3c45d9;return db['ChatInteraction'][_0x0728('0x4e')]({'where':{'id':_0x3666d5}})[_0x0728('0x18')](function(_0xdc657e){_0x6f64c2=_0xdc657e;return db[_0x0728('0x4f')][_0x0728('0x4e')]({'where':{'id':_0xdc657e['ChatWebsiteId']},'attributes':['id',_0x0728('0x50'),_0x0728('0x51'),_0x0728('0x52'),_0x0728('0x53'),_0x0728('0x54')],'raw':!![]});})[_0x0728('0x18')](function(_0x546f86){if(_0x546f86&&_0x546f86[_0x0728('0x50')]&&_0x546f86[_0x0728('0x51')]){_0x21ce97=_0x546f86;var _0x416f42={'interaction':{'id':_0x3666d5},'agent':{'id':_0x5d45db[_0x0728('0x55')]['id'],'name':_0x5d45db[_0x0728('0x55')]['name'],'fullname':_0x5d45db[_0x0728('0x55')][_0x0728('0x56')],'email':_0x5d45db['user'][_0x0728('0x57')]},'contact':_0x5d45db['body'][_0x0728('0x35')],'account':_0x5d45db[_0x0728('0x34')][_0x0728('0x38')]};var _0x411620={'rejectUnauthorized':![],'method':_0x0728('0x58'),'url':_0x0728('0x59'),'headers':{'X-APIKEY':_0x546f86[_0x0728('0x50')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x5d45db[_0x0728('0x55')][_0x0728('0x57')]],'buttons':null,'topic':_0x21ce97[_0x0728('0x52')],'note':_['isNull'](_0x21ce97[_0x0728('0x53')])?null:getMustacheRender(_0x21ce97[_0x0728('0x53')],_0x416f42),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x21ce97[_0x0728('0x54')])){var _0x2322db=getMustacheRender(_0x21ce97['vidaooMetadata'],_0x416f42);var _0x109ad0=JSON['parse'](_0x2322db);_0x411620['body'][_0x0728('0x5a')]=_0x109ad0;}}catch(_0x953e4e){throw new db[(_0x0728('0x5b'))][(_0x0728('0x5c'))](_0x0728('0x5d'));}return rp(_0x411620);}else{throw new db['Sequelize'][(_0x0728('0x5c'))]('Error\x20in\x20Vidaoo\x20configuration');}})[_0x0728('0x18')](function(_0x35e79c){_0x3c45d9=_0x35e79c;if(_0x3c45d9['id']){var _0x23798b={'body':_0x3c45d9[_0x0728('0x5e')],'ChatWebsiteId':_0x21ce97['id'],'ChatInteractionId':_0x6f64c2['id'],'direction':_0x0728('0x5f'),'UserId':_0x5d45db[_0x0728('0x55')]['id']};return db['ChatMessage']['create'](_0x23798b,{});}else{throw new db[(_0x0728('0x5b'))][(_0x0728('0x5c'))](_0x0728('0x60'));}})['then'](function(){return _0x6f64c2['updateAttributes']({'vidaooSessionId':_0x3c45d9['id']});})[_0x0728('0x18')](respondWithResult(_0x4c52f1,null))[_0x0728('0x23')](handleError(_0x4c52f1,null));};exports[_0x0728('0x61')]=function(_0xb61dac,_0x74b3ca){if(_0xb61dac[_0x0728('0x34')]['id']){delete _0xb61dac[_0x0728('0x34')]['id'];}return db[_0x0728('0x3b')][_0x0728('0x4c')]({'where':{'id':_0xb61dac[_0x0728('0x43')]['id']},'include':[{'model':db[_0x0728('0x62')],'as':_0x0728('0x63')}]})[_0x0728('0x18')](handleEntityNotFound(_0x74b3ca,null))[_0x0728('0x18')](saveUpdates(_0xb61dac[_0x0728('0x34')],null))['then'](respondWithResult(_0x74b3ca,null))[_0x0728('0x23')](handleError(_0x74b3ca,null));};exports['abandon']=function(_0x58f544,_0x5b4fea){if(_0x58f544[_0x0728('0x34')]['id']){delete _0x58f544['body']['id'];}return db[_0x0728('0x3b')][_0x0728('0x4c')]({'where':{'id':_0x58f544[_0x0728('0x43')]['id']}})[_0x0728('0x18')](function(_0x455385){if(!_0x455385){logger[_0x0728('0x1f')](_0x0728('0x64'),_0x0728('0x65'),0x194,_0x0728('0x66'));_0x5b4fea[_0x0728('0x24')](0x194);}else{if(_0x455385[_0x0728('0x67')]){throw new db[(_0x0728('0x5b'))][(_0x0728('0x5c'))](_0x0728('0x68'));}}return _0x455385;})[_0x0728('0x18')](function(_0x4909d5){if(_0x4909d5){return _0x4909d5['update']({'closed':_0x58f544[_0x0728('0x34')][_0x0728('0x69')],'disposition':_0x58f544[_0x0728('0x34')][_0x0728('0x6a')]})['then'](function(_0x4a881d){return _0x4a881d;});}})[_0x0728('0x18')](function(){return respondWithRpcPromise(_0x0728('0x6b'),_0x0728('0x65'),_0x58f544[_0x0728('0x34')],client9004);})[_0x0728('0x18')](respondWithResult(_0x5b4fea,null))[_0x0728('0x23')](handleError(_0x5b4fea,null));};exports[_0x0728('0x6c')]=function(_0x4e4342,_0xc238be){_0x4e4342[_0x0728('0x34')][_0x0728('0x30')]=_0x4e4342[_0x0728('0x6d')][_0x0728('0x6e')];_0x4e4342['body']['basename']=_0x4e4342[_0x0728('0x6d')]['filename'];_0x4e4342['body'][_0x0728('0x3e')]=_0x4e4342['file'][_0x0728('0x6f')];return db[_0x0728('0x70')]['create'](_0x4e4342[_0x0728('0x34')])[_0x0728('0x18')](respondWithResult(_0xc238be,0xc9))['catch'](handleError(_0xc238be,null));};exports['attachmentDownload']=function(_0x25ce22,_0x33c0cc){return db[_0x0728('0x3b')][_0x0728('0x4e')]({'where':{'id':_0x25ce22['params']['id']},'raw':!![]})[_0x0728('0x18')](handleEntityNotFound(_0x33c0cc,null))[_0x0728('0x18')](function(_0x40cc33){if(_0x40cc33){if(_0x40cc33[_0x0728('0x69')]){return _0x33c0cc['status'](0x193)[_0x0728('0x27')]({'status':0x193,'message':_0x0728('0x71')});}return db[_0x0728('0x70')][_0x0728('0x4e')]({'where':{'id':_0x25ce22['query'][_0x0728('0x72')]},'raw':!![]})[_0x0728('0x18')](handleEntityNotFound(_0x33c0cc,null));}})['then'](function(_0x5707b6){if(_0x5707b6){var _0x27c8b3=_0x5707b6['ChatOfflineMessageId']!==null;var _0x32e4bd=path['join'](config[_0x0728('0x73')],'server/files/attachments/');if(_0x27c8b3){_0x32e4bd=path[_0x0728('0x74')](_0x32e4bd,'offline-chat/');}var _0x3a3f66=path[_0x0728('0x74')](_0x32e4bd,_0x5707b6[_0x0728('0x75')]);return _0x33c0cc['download'](_0x3a3f66);}})['catch'](handleError(_0x33c0cc,null));};exports[_0x0728('0x76')]=function(_0x1bdacd,_0x29a546){var _0x281a67=null;var _0x83fa4c=null;var _0x1a9c5b=null;if(_0x1bdacd[_0x0728('0x34')]['id']){delete _0x1bdacd[_0x0728('0x34')]['id'];}if(_0x1bdacd[_0x0728('0x34')][_0x0728('0x77')]){_0x1a9c5b=path[_0x0728('0x74')](config[_0x0728('0x73')],'server/files/chat/upload/',util['format'](_0x0728('0x78'),Date[_0x0728('0x79')]()));_0x1bdacd[_0x0728('0x34')]['pathTranscript']=_0x1a9c5b;}return db['ChatInteraction'][_0x0728('0x4c')]({'where':{'id':_0x1bdacd['params']['id']},'include':[{'model':db[_0x0728('0x7a')],'as':_0x0728('0x7b'),'include':[{'model':db[_0x0728('0x7c')],'as':_0x0728('0x7c')}]}]})[_0x0728('0x18')](handleEntityNotFound(_0x29a546,null))[_0x0728('0x18')](saveUpdates(_0x1bdacd['body'],null))[_0x0728('0x18')](function(_0x2e2ea6){if(_0x2e2ea6){_0x281a67=_0x2e2ea6;return db['ChatWebsite'][_0x0728('0x4c')]({'where':{'id':_0x281a67['ChatWebsiteId']}});}})[_0x0728('0x18')](function(_0x1e9789){if(_0x1e9789){_0x83fa4c=_0x1e9789;return db['CmContact'][_0x0728('0x4c')]({'where':{'id':_0x281a67['ContactId']}});}})[_0x0728('0x18')](function(_0x28b9f1){if(_0x28b9f1){if(_0x1a9c5b){var _0x319cf3=null;for(var _0x5230f8=0x1;_0x5230f8<_0x281a67['Messages'][_0x0728('0x49')];++_0x5230f8){_0x319cf3=_0x281a67[_0x0728('0x7b')][_0x5230f8];var _0x4b9beb=_0x319cf3['UserId']?util[_0x0728('0x7d')](_0x0728('0x7e'),_0x83fa4c[_0x0728('0x7f')],_0x319cf3[_0x0728('0x67')]):'System';var _0x2c4d21=_0x1bdacd[_0x0728('0x34')][_0x0728('0x80')]||util[_0x0728('0x7d')](_0x0728('0x7e'),_0x0728('0x81'),_0x319cf3[_0x0728('0x82')]);switch(_0x83fa4c[_0x0728('0x83')]){case'website_alias':_0x4b9beb=_0x319cf3[_0x0728('0x67')]?util[_0x0728('0x7d')](_0x0728('0x7e'),_0x83fa4c['agentAlias'],_0x319cf3[_0x0728('0x67')]):_0x0728('0x84');break;case'agent_alias':_0x4b9beb=_0x319cf3[_0x0728('0x67')]?_0x319cf3[_0x0728('0x7c')]['alias']||_0x319cf3[_0x0728('0x7c')]['fullname']:_0x0728('0x84');break;case'agent_fullname':_0x4b9beb=_0x319cf3['UserId']?_0x319cf3[_0x0728('0x7c')][_0x0728('0x56')]:_0x0728('0x84');break;default:_0x4b9beb=_0x319cf3[_0x0728('0x67')]?util[_0x0728('0x7d')](_0x0728('0x7e'),_0x83fa4c[_0x0728('0x7f')],_0x319cf3[_0x0728('0x67')]):'System';}var _0x4506bf=util[_0x0728('0x7d')](_0x0728('0x85'),moment(_0x319cf3['createdAt'])[_0x0728('0x7d')]('MM/DD/YYYY\x20HH:mm:ss'),_0x319cf3[_0x0728('0x86')]==='in'?_0x2c4d21:_0x4b9beb,_0x319cf3['body']);if(!_0x319cf3[_0x0728('0x87')]){fs[_0x0728('0x88')](_0x1a9c5b,_0x4506bf);}}return db[_0x0728('0x89')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x0728('0x8a')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x0728('0x8b')],'as':_0x0728('0x8b'),'raw':!![]}]}]});}}})[_0x0728('0x18')](function(_0x394a82){if(!_0x394a82||!_0x394a82[_0x0728('0x8c')]||!_0x1bdacd[_0x0728('0x34')])return _0x281a67;var _0x411c91=_0x394a82['getSmtpOptions']();return respondWithRpcPromise(_0x0728('0x8d'),_0x0728('0x8e'),{'account':_0x411c91,'message':{'from':util[_0x0728('0x7d')](_0x0728('0x8f'),_0x394a82['name'],_0x394a82['email']||_0x394a82[_0x0728('0x8c')][_0x0728('0x55')]),'to':_0x1bdacd[_0x0728('0x34')][_0x0728('0x77')],'subject':_0x0728('0x90'),'text':util[_0x0728('0x7d')](_0x0728('0x91'),_0x1bdacd[_0x0728('0x34')]['mailTranscript']),'attachments':[{'path':_0x1a9c5b}]}})['then'](function(){return _0x281a67;})['catch'](function(_0x2b1bfb){logger[_0x0728('0x1f')](_0x2b1bfb);});})[_0x0728('0x18')](respondWithStatusCode(_0x29a546,0xc8))[_0x0728('0x23')](handleError(_0x29a546,null));};exports[_0x0728('0x92')]=function(_0xd6fded,_0x2a9986){return db['ChatMessage'][_0x0728('0x4c')]({'where':{'id':_0xd6fded[_0x0728('0x43')]['id']}})[_0x0728('0x18')](handleEntityNotFound(_0x2a9986,null))[_0x0728('0x18')](function(_0x1cf1fd){if(_0x1cf1fd){return _0x1cf1fd['addMessage'](_0xd6fded[_0x0728('0x34')][_0x0728('0x93')],_[_0x0728('0x94')](_0xd6fded[_0x0728('0x34')],[_0x0728('0x93'),'id'])||{});}})['then'](respondWithResult(_0x2a9986,null))[_0x0728('0x23')](handleError(_0x2a9986,null));};exports[_0x0728('0x95')]=function(_0x18b07d,_0x2120d4){var _0x197047={'raw':![],'where':{}};var _0x5be074={};var _0x18ecb7={'count':0x0,'rows':[]};return db[_0x0728('0x3b')]['findOne']({'where':{'id':_0x18b07d[_0x0728('0x43')]['id']}})['then'](handleEntityNotFound(_0x2120d4,null))[_0x0728('0x18')](function(_0x375ec4){if(_0x375ec4){_0x5be074['model']=_['keys'](db['ChatMessage']['rawAttributes']);_0x5be074['query']=_[_0x0728('0x46')](_0x18b07d[_0x0728('0x45')]);_0x5be074[_0x0728('0x96')]=_[_0x0728('0x48')](_0x5be074['model'],_0x5be074[_0x0728('0x45')]);_0x197047[_0x0728('0x47')]=_[_0x0728('0x48')](_0x5be074['model'],qs[_0x0728('0x97')](_0x18b07d[_0x0728('0x45')]['fields']));_0x197047[_0x0728('0x47')]=_0x197047[_0x0728('0x47')]['length']?_0x197047[_0x0728('0x47')]:_0x5be074[_0x0728('0x44')];if(!_0x18b07d[_0x0728('0x45')][_0x0728('0x98')](_0x0728('0x99'))){_0x197047[_0x0728('0x2a')]=qs[_0x0728('0x2a')](_0x18b07d[_0x0728('0x45')]['limit']);_0x197047[_0x0728('0x28')]=qs[_0x0728('0x28')](_0x18b07d['query'][_0x0728('0x28')]);}_0x197047[_0x0728('0x9a')]=qs[_0x0728('0x9b')](_0x18b07d[_0x0728('0x45')][_0x0728('0x9b')]);_0x197047['where']=qs[_0x0728('0x96')](_[_0x0728('0x9c')](_0x18b07d['query'],_0x5be074['filters']));_0x197047[_0x0728('0x9d')][_0x0728('0x9e')]=_0x375ec4['id'];if(_0x18b07d[_0x0728('0x45')][_0x0728('0x9f')]){_0x197047[_0x0728('0x9d')]=_[_0x0728('0x33')](_0x197047['where'],{'$or':_[_0x0728('0x3a')](_0x197047[_0x0728('0x47')],function(_0x545a46){var _0x3f1043={};_0x3f1043[_0x545a46]={'$like':'%'+_0x18b07d[_0x0728('0x45')]['filter']+'%'};return _0x3f1043;})});}if(_0x18b07d[_0x0728('0x45')][_0x0728('0xa0')]){var _0x502fad=_0x18b07d[_0x0728('0x45')][_0x0728('0xa0')][_0x0728('0xa1')](',');var _0xc447={};_0xc447[_0x502fad[0x0]]={'$gte':moment(_0x502fad[0x1])['format'](_0x0728('0xa2'))};_0x197047[_0x0728('0x9d')]=_[_0x0728('0x33')](_0x197047['where'],_0xc447);}_0x197047=_[_0x0728('0x33')]({},_0x197047,_0x18b07d[_0x0728('0xa3')]);return db['ChatMessage']['count']({'where':_0x197047['where']})[_0x0728('0x18')](function(_0x10641c){_0x18ecb7[_0x0728('0x2b')]=_0x10641c;if(_0x18b07d[_0x0728('0x45')][_0x0728('0x4a')]){_0x197047[_0x0728('0xa4')]=[{'all':!![]}];}return db[_0x0728('0x7a')][_0x0728('0x40')](_0x197047);})[_0x0728('0x18')](function(_0x5719f8){_0x18ecb7[_0x0728('0xa5')]=_0x5719f8;return _0x18ecb7;});}})['then'](respondWithFilteredResult(_0x2120d4,_0x197047))['catch'](handleError(_0x2120d4,null));};exports[_0x0728('0xa6')]=function(_0x52dcb2,_0x28b6cc){var _0x4ae123={'where':{}},_0xe85fa7={},_0x5540d8={'count':0x0,'rows':[]};return db[_0x0728('0x3b')][_0x0728('0x4e')]({'where':{'id':_0x52dcb2[_0x0728('0x43')]['id']}})[_0x0728('0x18')](handleEntityNotFound(_0x28b6cc,null))[_0x0728('0x18')](function(_0x4272b1){if(_0x4272b1){_0xe85fa7['model']=_['keys'](db[_0x0728('0x7a')]['rawAttributes']);_0xe85fa7[_0x0728('0x45')]=_[_0x0728('0x46')](_0x52dcb2[_0x0728('0x45')]);_0xe85fa7[_0x0728('0x96')]=_[_0x0728('0x48')](_0xe85fa7[_0x0728('0x44')],_0xe85fa7['query']);_0x4ae123[_0x0728('0x47')]=_['intersection'](_0xe85fa7[_0x0728('0x44')],qs['fields'](_0x52dcb2[_0x0728('0x45')][_0x0728('0x97')]));_0x4ae123['attributes']=_0x4ae123[_0x0728('0x47')][_0x0728('0x49')]?_0x4ae123[_0x0728('0x47')]:_0xe85fa7[_0x0728('0x44')];if(!_0x52dcb2['query']['hasOwnProperty']('nolimit')){_0x4ae123[_0x0728('0x2a')]=qs[_0x0728('0x2a')](_0x52dcb2['query']['limit']);_0x4ae123['offset']=qs[_0x0728('0x28')](_0x52dcb2[_0x0728('0x45')][_0x0728('0x28')]);}_0x4ae123[_0x0728('0x9a')]=qs[_0x0728('0x9b')](_0x52dcb2['query'][_0x0728('0x9b')]);_0x4ae123[_0x0728('0x9d')]=qs['filters'](_[_0x0728('0x9c')](_0x52dcb2[_0x0728('0x45')],_0xe85fa7[_0x0728('0x96')]));_0x4ae123['where']['ChatInteractionId']=_0x4272b1['id'];if(_0x52dcb2[_0x0728('0x45')][_0x0728('0x9f')]){_0x4ae123['where']=_[_0x0728('0x33')](_0x4ae123[_0x0728('0x9d')],{'$or':_['map'](_0x4ae123[_0x0728('0x47')],function(_0x5a8cfd){var _0xd37739={};_0xd37739[_0x5a8cfd]={'$like':'%'+_0x52dcb2[_0x0728('0x45')][_0x0728('0x9f')]+'%'};return _0xd37739;})});}_0x4ae123['where'][_0x0728('0x87')]=![];if(_0x52dcb2[_0x0728('0x45')]['id']){_0x4ae123[_0x0728('0x9d')]['id']={'$gt':_0x52dcb2[_0x0728('0x45')]['id']};}_0x4ae123=_['merge']({},_0x4ae123,_0x52dcb2[_0x0728('0xa3')]);return db[_0x0728('0x7a')][_0x0728('0x2b')]({'where':_0x4ae123['where']})[_0x0728('0x18')](function(_0x5b0045){_0x5540d8[_0x0728('0x2b')]=_0x5b0045;_0x4ae123['include']=[];if(_0x52dcb2[_0x0728('0x45')][_0x0728('0xa7')]){_0x4ae123[_0x0728('0xa4')][_0x0728('0xa8')]({'model':db['User'],'as':_0x0728('0x7c'),'attributes':['id',_0x0728('0x56'),_0x0728('0xa9')]});}if(_0x52dcb2[_0x0728('0x45')]['includeAll']){_0x4ae123[_0x0728('0xa4')]=[{'all':!![]}];}return db[_0x0728('0x7a')][_0x0728('0x40')](_0x4ae123);})['then'](function(_0x501fb4){_0x5540d8[_0x0728('0xa5')]=_0x501fb4;return _0x5540d8;});}})[_0x0728('0x18')](respondWithFilteredResult(_0x28b6cc,_0x4ae123))['catch'](handleError(_0x28b6cc,null));};exports[_0x0728('0xaa')]=function(_0x80e853,_0x55ab50){return db[_0x0728('0x3b')][_0x0728('0x4c')]({'where':{'id':_0x80e853[_0x0728('0x43')]['id']}})[_0x0728('0x18')](handleEntityNotFound(_0x55ab50,null))[_0x0728('0x18')](function(_0x5a94ce){if(_0x5a94ce){return _0x5a94ce['setTags'](_0x80e853[_0x0728('0x34')][_0x0728('0x93')],_['omit'](_0x80e853[_0x0728('0x34')],[_0x0728('0x93'),'id'])||{})[_0x0728('0xab')](function(){return db[_0x0728('0xac')][_0x0728('0x40')]({'attributes':['id','name',_0x0728('0xad')],'where':{'id':_0x80e853['body'][_0x0728('0x93')]}});})[_0x0728('0x18')](function(_0x56c783){socket['emit']('chatInteractionTags:save',{'id':Number(_0x80e853[_0x0728('0x43')]['id']),'tags':_0x56c783||[]});return{'id':Number(_0x80e853[_0x0728('0x43')]['id']),'tags':_0x56c783||[]};});}})[_0x0728('0x18')](respondWithResult(_0x55ab50,null))['catch'](handleError(_0x55ab50,null));};exports['removeTags']=function(_0x5e209a,_0x571f2a){return db['ChatInteraction'][_0x0728('0x4c')]({'where':{'id':_0x5e209a['params']['id']}})[_0x0728('0x18')](handleEntityNotFound(_0x571f2a,null))[_0x0728('0x18')](function(_0x2032cf){if(_0x2032cf){return _0x2032cf[_0x0728('0xae')](_0x5e209a['query'][_0x0728('0x93')]);}})['then'](respondWithStatusCode(_0x571f2a,null))[_0x0728('0x23')](handleError(_0x571f2a,null));};exports[_0x0728('0xaf')]=function(_0x29b3b2,_0x36f9f0){var _0x13f654=moment()['unix']()[_0x0728('0xb0')]();var _0x4024f6=path[_0x0728('0x74')](config['root'],'server','files',_0x0728('0xb1'));var _0x4bcc4f=path[_0x0728('0x74')](config[_0x0728('0x73')],_0x0728('0xb2'),_0x0728('0xb3'),_0x0728('0xb4'));var _0x283fc3=path[_0x0728('0x74')](_0x4024f6,_0x13f654);var _0x3fb75a=util[_0x0728('0x7d')](_0x0728('0xb5'),_0x29b3b2[_0x0728('0x43')]['id'],_0x13f654);var _0x433fa9=path[_0x0728('0x74')](_0x4024f6,_0x3fb75a);var _0x127f9c=[];_0x127f9c[_0x0728('0xa8')]({'model':db[_0x0728('0x7c')],'as':'User','attributes':['id',_0x0728('0x56')],'raw':!![]});_0x127f9c['push']({'model':db[_0x0728('0x62')],'as':_0x0728('0x63'),'attributes':['id',_0x0728('0xb6'),_0x0728('0xb7')],'raw':!![]});if(_0x29b3b2['query'][_0x0728('0xb4')]){_0x127f9c['push']({'model':db[_0x0728('0x70')],'as':_0x0728('0x70'),'raw':!![]});}var _0x5c90ab=[{'model':db[_0x0728('0x7a')],'as':_0x0728('0x7b'),'attributes':['id','body',_0x0728('0xb8'),_0x0728('0x86'),_0x0728('0x87'),_0x0728('0xb9')],'include':_0x127f9c}];_0x5c90ab[_0x0728('0xa8')]({'model':db[_0x0728('0x4f')],'as':'Account','attributes':['id','name']});_0x5c90ab[_0x0728('0xa8')]({'model':db[_0x0728('0x7c')],'as':_0x0728('0xba'),'attributes':['id',_0x0728('0x56')]});return db[_0x0728('0x3b')][_0x0728('0x4c')]({'where':{'id':_0x29b3b2[_0x0728('0x43')]['id']},'include':_0x5c90ab})[_0x0728('0x18')](handleEntityNotFound(_0x36f9f0,null))['then'](function(_0x53330a){if(_0x53330a){var _0x456cf1=_0x53330a['get']({'plain':!![]});fs['mkdirSync'](_0x283fc3);var _0x17d636={'channel':_0x0728('0xbb'),'account':_0x456cf1[_0x0728('0xbc')][_0x0728('0x30')],'agent':_0x456cf1[_0x0728('0xba')]?_0x456cf1[_0x0728('0xba')][_0x0728('0x56')]:_0x0728('0xbd'),'createdAt':moment(_0x456cf1[_0x0728('0xb8')])[_0x0728('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x456cf1[_0x0728('0x69')]?moment(_0x456cf1[_0x0728('0xbe')])['format'](_0x0728('0xa2'))[_0x0728('0xb0')]():'','disposition':_0x456cf1[_0x0728('0x6a')],'chatInfo':{'browser':_0x456cf1[_0x0728('0xbf')],'os':_0x456cf1['osName'],'referer':_0x456cf1['referer'],'customerIp':_0x456cf1['customerIp'],'customerPort':_0x456cf1[_0x0728('0xc0')]?_0x456cf1[_0x0728('0xc0')]:_0x0728('0xbd')},'messages':_(_0x456cf1['Messages'])[_0x0728('0xc1')]()[_0x0728('0x9f')]({'secret':![]})[_0x0728('0x3a')](function(_0x40b6ef){if(_0x40b6ef[_0x0728('0x70')]){var _0x3a019c=path[_0x0728('0x74')](_0x4bcc4f,_0x40b6ef[_0x0728('0x70')][_0x0728('0x75')]);if(fs[_0x0728('0xc2')](_0x3a019c)){fs[_0x0728('0xc3')](_0x3a019c)[_0x0728('0xc4')](fs[_0x0728('0xc5')](path[_0x0728('0x74')](_0x283fc3,_0x40b6ef[_0x0728('0x70')]['basename'])));}}return{'date':moment(_0x40b6ef['createdAt'])[_0x0728('0x7d')]('YYYY-MM-DD\x20HH:mm:ss')[_0x0728('0xb0')](),'sender':_0x40b6ef[_0x0728('0x86')]===_0x0728('0x5f')?_0x40b6ef[_0x0728('0x7c')]?_0x40b6ef[_0x0728('0x7c')][_0x0728('0x56')]:_0x0728('0x84'):_0x40b6ef[_0x0728('0x63')][_0x0728('0xb6')]+(_0x40b6ef[_0x0728('0x63')]['lastName']?'\x20'+_0x40b6ef[_0x0728('0x63')][_0x0728('0xb7')]:''),'body':_0x40b6ef[_0x0728('0x70')]?_0x40b6ef[_0x0728('0x70')][_0x0728('0x75')]:_0x40b6ef['body'],'direction':_0x40b6ef['direction']===_0x0728('0x5f')?'A':'C','secret':_0x40b6ef[_0x0728('0x87')],'read':_0x40b6ef[_0x0728('0xb9')],'attachment':_0x40b6ef['Attachment']};})['value']()};return ejs['renderFile'](path['join'](config[_0x0728('0x73')],_0x0728('0xb2'),_0x0728('0xc6'),'downloadInteraction.ejs'),{'interaction':_0x17d636})[_0x0728('0x18')](function(_0x253265){var _0x141c42=path[_0x0728('0x74')](_0x283fc3,_0x0728('0xc7')+_0x456cf1['id']+'-'+_0x13f654+_0x0728('0xc8'));var _0x302840={'path':_0x141c42,'channel':'Chat','interactionId':_0x456cf1['id']};return pdf[_0x0728('0xc9')](_0x253265,_0x302840);})[_0x0728('0x18')](function(){return new Promise(function(_0x25bb29,_0x3f50a7){zipdir(_0x283fc3,{'saveTo':_0x433fa9},function(_0x4815ee,_0x91aefc){if(_0x4815ee)return _0x3f50a7(_0x4815ee);return _0x25bb29(_0x91aefc);});})[_0x0728('0x18')](function(){return new BPromise(function(_0x45960a,_0x230df5){rimraf(_0x283fc3,function(_0xcc89d){if(_0xcc89d)_0x230df5(_0xcc89d);return _0x45960a();});});})[_0x0728('0x18')](function(){return _0x36f9f0[_0x0728('0xaf')](_0x433fa9,_0x3fb75a,function(_0x49ca46){if(_0x49ca46){logger[_0x0728('0x1f')](_0x0728('0xca'),_0x49ca46);}else{fs[_0x0728('0xcb')](_0x433fa9);}});});});}else{return _0x36f9f0[_0x0728('0x24')](0xc8);}})[_0x0728('0x23')](handleError(_0x36f9f0,null));};
\ No newline at end of file
+var _0xa444=['bluebird','mustache','util','path','ioredis','../../components/interaction/service','../../components/parsers/qs','../../components/export/pdf','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','end','offset','undefined','limit','count','set','update','destroy','stack','name','send','render','contact','interaction','account','index','map','ChatInteraction','rawAttributes','getOptions','chat','user','params','model','keys','query','intersection','attributes','fields','length','includeAll','include','merge','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsite','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','parse','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','sendStatus','UserId','Interaction\x20already\x20assigned','closed','AbandonInteraction','file','originalname','basename','filename','type','mimetype','attachmentDownload','json','Unauthorized','Attachment','attachId','join','root','server/files/attachments/','offline-chat/','download','close','mailTranscript','transcript-%s.txt','now','pathTranscript','User','ContactId','Messages','format','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_alias','alias','fullname','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','Smtp','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','filters','order','sort','pick','where','ChatInteractionId','$gte','split','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','getMyMessages','nolimit','filter','addTags','Tag','color','emit','chatInteractionTags:save','removeTags','unix','toString','files','tmp','server','attachments','push','firstName','lastName','read','Account','Owner','get','mkdirSync','Chat','N.A.','closedAt','disposition','browserName','osName','customerIp','customerPort','existsSync','createReadStream','pipe','direction','renderFile','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','moment'];(function(_0x3fdcee,_0x17dbfe){var _0x4a5788=function(_0x2030aa){while(--_0x2030aa){_0x3fdcee['push'](_0x3fdcee['shift']());}};_0x4a5788(++_0x17dbfe);}(_0xa444,0x1a4));var _0x4a44=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa444[_0x19950b];return _0x3c6b41;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x4a44('0x0'));var moment=require(_0x4a44('0x1'));var BPromise=require(_0x4a44('0x2'));var Mustache=require(_0x4a44('0x3'));var util=require(_0x4a44('0x4'));var path=require(_0x4a44('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var Redis=require(_0x4a44('0x6'));var interaction=require(_0x4a44('0x7'));var qs=require(_0x4a44('0x8'));var pdf=require(_0x4a44('0x9'));var logger=require('../../config/logger')(_0x4a44('0xa'));var config=require(_0x4a44('0xb'));var db=require(_0x4a44('0xc'))['db'];config[_0x4a44('0xd')]=_[_0x4a44('0xe')](config[_0x4a44('0xd')],{'host':_0x4a44('0xf'),'port':0x18eb});var socket=require(_0x4a44('0x10'))(new Redis(config[_0x4a44('0xd')]));require(_0x4a44('0x11'))[_0x4a44('0x12')](socket);var jayson=require(_0x4a44('0x13'));var client=jayson[_0x4a44('0x14')]['http']({'port':0x232b});var client9004=jayson['client'][_0x4a44('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x37f069,_0x2ff0fb,_0x4a7fab,_0x18dec6){return new BPromise(function(_0x5c1a81,_0x495f5c){var _0x276b83=_0x18dec6||client;return _0x276b83[_0x4a44('0x16')](_0x37f069,_0x4a7fab)[_0x4a44('0x17')](function(_0x8e66d4){logger[_0x4a44('0x18')](_0x4a44('0x19'),_0x2ff0fb,_0x4a44('0x1a'));logger[_0x4a44('0x1b')](_0x4a44('0x1c'),_0x2ff0fb,_0x4a44('0x1a'),JSON[_0x4a44('0x1d')](_0x8e66d4));if(_0x8e66d4[_0x4a44('0x1e')]){if(_0x8e66d4['error']['code']===0x1f4){logger[_0x4a44('0x1e')](_0x4a44('0x19'),_0x2ff0fb,_0x8e66d4[_0x4a44('0x1e')][_0x4a44('0x1f')]);return _0x495f5c(_0x8e66d4[_0x4a44('0x1e')][_0x4a44('0x1f')]);}logger[_0x4a44('0x1e')](_0x4a44('0x19'),_0x2ff0fb,_0x8e66d4[_0x4a44('0x1e')][_0x4a44('0x1f')]);return _0x5c1a81(_0x8e66d4['error'][_0x4a44('0x1f')]);}else{logger[_0x4a44('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x2ff0fb,_0x4a44('0x1a'));_0x5c1a81(_0x8e66d4[_0x4a44('0x20')][_0x4a44('0x1f')]);}})[_0x4a44('0x21')](function(_0x26cf3b){logger[_0x4a44('0x1e')]('ChatInteraction,\x20%s,\x20%s',_0x2ff0fb,_0x26cf3b);_0x495f5c(_0x26cf3b);});});}function respondWithStatusCode(_0x77cbe3,_0x576eef){_0x576eef=_0x576eef||0xcc;return function(_0x3ebfa5){if(_0x3ebfa5){return _0x77cbe3['sendStatus'](_0x576eef);}return _0x77cbe3[_0x4a44('0x22')](_0x576eef)[_0x4a44('0x23')]();};}function respondWithResult(_0x1a52bd,_0x47fcdf){_0x47fcdf=_0x47fcdf||0xc8;return function(_0x13ea66){if(_0x13ea66){return _0x1a52bd[_0x4a44('0x22')](_0x47fcdf)['json'](_0x13ea66);}};}function respondWithFilteredResult(_0x477797,_0x2a9040){return function(_0x3ad5b3){if(_0x3ad5b3){var _0x27acd8=typeof _0x2a9040[_0x4a44('0x24')]===_0x4a44('0x25')&&typeof _0x2a9040[_0x4a44('0x26')]==='undefined';var _0x2e2090=_0x3ad5b3[_0x4a44('0x27')];var _0x569f7d=_0x27acd8?0x0:_0x2a9040['offset'];var _0x244d32=_0x27acd8?_0x3ad5b3[_0x4a44('0x27')]:_0x2a9040[_0x4a44('0x24')]+_0x2a9040['limit'];var _0x1c01b1;if(_0x244d32>=_0x2e2090){_0x244d32=_0x2e2090;_0x1c01b1=0xc8;}else{_0x1c01b1=0xce;}_0x477797[_0x4a44('0x22')](_0x1c01b1);return _0x477797[_0x4a44('0x28')]('Content-Range',_0x569f7d+'-'+_0x244d32+'/'+_0x2e2090)['json'](_0x3ad5b3);}return null;};}function saveUpdates(_0x1cd2a8){return function(_0x5c4383){if(_0x5c4383){return _0x5c4383[_0x4a44('0x29')](_0x1cd2a8)['then'](function(_0x56645a){return _0x56645a;});}return null;};}function removeEntity(_0x5a3ce9){return function(_0x112dc9){if(_0x112dc9){return _0x112dc9[_0x4a44('0x2a')]()[_0x4a44('0x17')](function(){_0x5a3ce9[_0x4a44('0x22')](0xcc)[_0x4a44('0x23')]();});}};}function handleEntityNotFound(_0x50bac7){return function(_0x3800ca){if(!_0x3800ca){_0x50bac7['sendStatus'](0x194);}return _0x3800ca;};}function handleError(_0x447656,_0x2979f8){_0x2979f8=_0x2979f8||0x1f4;return function(_0x38f19a){logger[_0x4a44('0x1e')](_0x38f19a[_0x4a44('0x2b')]);if(_0x38f19a['name']){delete _0x38f19a[_0x4a44('0x2c')];}_0x447656[_0x4a44('0x22')](_0x2979f8)[_0x4a44('0x2d')](_0x38f19a);};}function getMustacheRender(_0x46faf3,_0x3f4f9b){return Mustache[_0x4a44('0x2e')](_0x46faf3,_['merge'](_0x3f4f9b['body'],{'contact':_0x3f4f9b[_0x4a44('0x2f')],'message':_0x3f4f9b['message'],'agent':_0x3f4f9b['agent'],'interaction':_0x3f4f9b[_0x4a44('0x30')],'account':_0x3f4f9b[_0x4a44('0x31')]}))||'';}exports[_0x4a44('0x32')]=function(_0x3d5f41,_0x2f3fb9){var _0x4c5ec0={};var _0x478285=_[_0x4a44('0x33')](db[_0x4a44('0x34')][_0x4a44('0x35')],function(_0x1affae){return{'name':_0x1affae['fieldName'],'type':_0x1affae['type']['key']};});_0x4c5ec0=qs[_0x4a44('0x36')](_0x478285,_0x3d5f41);return interaction['findAll'](_0x4a44('0x37'),_0x3d5f41['query'],_0x3d5f41[_0x4a44('0x38')],_0x4c5ec0,_0x478285)[_0x4a44('0x17')](respondWithFilteredResult(_0x2f3fb9,_0x4c5ec0))[_0x4a44('0x21')](handleError(_0x2f3fb9,null));};exports['show']=function(_0x3bd8aa,_0x4fa7d7){var _0x402eea={'raw':![],'where':{'id':_0x3bd8aa[_0x4a44('0x39')]['id']}},_0xb576a0={};_0xb576a0[_0x4a44('0x3a')]=_[_0x4a44('0x3b')](db['ChatInteraction'][_0x4a44('0x35')]);_0xb576a0['query']=_[_0x4a44('0x3b')](_0x3bd8aa[_0x4a44('0x3c')]);_0xb576a0['filters']=_[_0x4a44('0x3d')](_0xb576a0['model'],_0xb576a0['query']);_0x402eea[_0x4a44('0x3e')]=_[_0x4a44('0x3d')](_0xb576a0[_0x4a44('0x3a')],qs['fields'](_0x3bd8aa[_0x4a44('0x3c')][_0x4a44('0x3f')]));_0x402eea['attributes']=_0x402eea['attributes'][_0x4a44('0x40')]?_0x402eea['attributes']:_0xb576a0[_0x4a44('0x3a')];if(_0x3bd8aa[_0x4a44('0x3c')][_0x4a44('0x41')]){_0x402eea[_0x4a44('0x42')]=[{'all':!![]}];}_0x402eea=_[_0x4a44('0x43')]({},_0x402eea,_0x3bd8aa[_0x4a44('0x44')]);return db[_0x4a44('0x34')][_0x4a44('0x45')](_0x402eea)[_0x4a44('0x17')](handleEntityNotFound(_0x4fa7d7,null))[_0x4a44('0x17')](respondWithResult(_0x4fa7d7,null))[_0x4a44('0x21')](handleError(_0x4fa7d7,null));};exports[_0x4a44('0x46')]=function(_0x8afb6d,_0x4daa26){return db['ChatInteraction'][_0x4a44('0x46')](_0x8afb6d[_0x4a44('0x47')],{})[_0x4a44('0x17')](respondWithResult(_0x4daa26,0xc9))[_0x4a44('0x21')](handleError(_0x4daa26,null));};exports[_0x4a44('0x29')]=function(_0x3ade27,_0x3e6703){if(_0x3ade27['body']['id']){delete _0x3ade27[_0x4a44('0x47')]['id'];}return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x3ade27[_0x4a44('0x39')]['id']}})['then'](handleEntityNotFound(_0x3e6703,null))[_0x4a44('0x17')](saveUpdates(_0x3ade27[_0x4a44('0x47')],null))[_0x4a44('0x17')](respondWithResult(_0x3e6703,null))[_0x4a44('0x21')](handleError(_0x3e6703,null));};exports['destroy']=function(_0x5ebce4,_0x48a747){return db['ChatInteraction']['find']({'where':{'id':_0x5ebce4[_0x4a44('0x39')]['id']}})[_0x4a44('0x17')](handleEntityNotFound(_0x48a747,null))[_0x4a44('0x17')](removeEntity(_0x48a747,null))[_0x4a44('0x21')](handleError(_0x48a747,null));};exports[_0x4a44('0x48')]=function(_0x5a75ae,_0x409869){return db['ChatInteraction']['describe']()[_0x4a44('0x17')](respondWithResult(_0x409869,null))[_0x4a44('0x21')](handleError(_0x409869,null));};exports[_0x4a44('0x49')]=function(_0x525794,_0x5f5dc1){var _0x1acea0=_0x525794[_0x4a44('0x39')]['id'];var _0x3901f3;var _0x3d4960;var _0xf6c815;return db[_0x4a44('0x34')][_0x4a44('0x4a')]({'where':{'id':_0x1acea0}})[_0x4a44('0x17')](function(_0x4196e2){_0x3901f3=_0x4196e2;return db[_0x4a44('0x4b')][_0x4a44('0x4a')]({'where':{'id':_0x4196e2[_0x4a44('0x4c')]},'attributes':['id',_0x4a44('0x4d'),_0x4a44('0x4e'),_0x4a44('0x4f'),_0x4a44('0x50'),_0x4a44('0x51')],'raw':!![]});})[_0x4a44('0x17')](function(_0x32b2c3){if(_0x32b2c3&&_0x32b2c3[_0x4a44('0x4d')]&&_0x32b2c3['vidaooEscalation']){_0x3d4960=_0x32b2c3;var _0x425e9b={'interaction':{'id':_0x1acea0},'agent':{'id':_0x525794[_0x4a44('0x38')]['id'],'name':_0x525794[_0x4a44('0x38')][_0x4a44('0x2c')],'fullname':_0x525794[_0x4a44('0x38')]['fullname'],'email':_0x525794[_0x4a44('0x38')][_0x4a44('0x52')]},'contact':_0x525794[_0x4a44('0x47')]['contact'],'account':_0x525794[_0x4a44('0x47')][_0x4a44('0x31')]};var _0x401020={'rejectUnauthorized':![],'method':_0x4a44('0x53'),'url':_0x4a44('0x54'),'headers':{'X-APIKEY':_0x32b2c3['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x525794[_0x4a44('0x38')][_0x4a44('0x52')]],'buttons':null,'topic':_0x3d4960[_0x4a44('0x4f')],'note':_['isNull'](_0x3d4960[_0x4a44('0x50')])?null:getMustacheRender(_0x3d4960['vidaooNote'],_0x425e9b),'metadata':null},'redirect':'follow','json':!![]};try{if(!_[_0x4a44('0x55')](_0x3d4960['vidaooMetadata'])){var _0x545693=getMustacheRender(_0x3d4960[_0x4a44('0x51')],_0x425e9b);var _0x3139=JSON[_0x4a44('0x56')](_0x545693);_0x401020['body'][_0x4a44('0x57')]=_0x3139;}}catch(_0x4a73eb){throw new db[(_0x4a44('0x58'))]['ValidationError'](_0x4a44('0x59'));}return rp(_0x401020);}else{throw new db['Sequelize'][(_0x4a44('0x5a'))](_0x4a44('0x5b'));}})[_0x4a44('0x17')](function(_0x2753c1){_0xf6c815=_0x2753c1;if(_0xf6c815['id']){var _0x5edb6e={'body':_0xf6c815[_0x4a44('0x5c')],'ChatWebsiteId':_0x3d4960['id'],'ChatInteractionId':_0x3901f3['id'],'direction':_0x4a44('0x5d'),'UserId':_0x525794['user']['id']};return db[_0x4a44('0x5e')][_0x4a44('0x46')](_0x5edb6e,{});}else{throw new db[(_0x4a44('0x58'))][(_0x4a44('0x5a'))](_0x4a44('0x5f'));}})[_0x4a44('0x17')](function(){return _0x3901f3[_0x4a44('0x60')]({'vidaooSessionId':_0xf6c815['id']});})[_0x4a44('0x17')](respondWithResult(_0x5f5dc1,null))['catch'](handleError(_0x5f5dc1,null));};exports['customUpdate']=function(_0x3104a9,_0x2e58b5){if(_0x3104a9[_0x4a44('0x47')]['id']){delete _0x3104a9[_0x4a44('0x47')]['id'];}return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x3104a9[_0x4a44('0x39')]['id']},'include':[{'model':db[_0x4a44('0x61')],'as':_0x4a44('0x62')}]})[_0x4a44('0x17')](handleEntityNotFound(_0x2e58b5,null))[_0x4a44('0x17')](saveUpdates(_0x3104a9[_0x4a44('0x47')],null))[_0x4a44('0x17')](respondWithResult(_0x2e58b5,null))[_0x4a44('0x21')](handleError(_0x2e58b5,null));};exports[_0x4a44('0x63')]=function(_0x3d1fd9,_0x14ad2c){if(_0x3d1fd9[_0x4a44('0x47')]['id']){delete _0x3d1fd9[_0x4a44('0x47')]['id'];}return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x3d1fd9['params']['id']}})[_0x4a44('0x17')](function(_0x19f6b6){if(!_0x19f6b6){logger[_0x4a44('0x1e')](_0x4a44('0x64'),_0x4a44('0x63'),0x194,'entity\x20not\x20found');_0x14ad2c[_0x4a44('0x65')](0x194);}else{if(_0x19f6b6[_0x4a44('0x66')]){throw new db['Sequelize']['ValidationError'](_0x4a44('0x67'));}}return _0x19f6b6;})[_0x4a44('0x17')](function(_0x3619cd){if(_0x3619cd){return _0x3619cd[_0x4a44('0x29')]({'closed':_0x3d1fd9['body'][_0x4a44('0x68')],'disposition':_0x3d1fd9[_0x4a44('0x47')]['disposition']})['then'](function(_0xe0a44){return _0xe0a44;});}})[_0x4a44('0x17')](function(){return respondWithRpcPromise(_0x4a44('0x69'),_0x4a44('0x63'),_0x3d1fd9[_0x4a44('0x47')],client9004);})['then'](respondWithResult(_0x14ad2c,null))['catch'](handleError(_0x14ad2c,null));};exports['attachmentUpload']=function(_0x19663d,_0x3af66d){_0x19663d[_0x4a44('0x47')][_0x4a44('0x2c')]=_0x19663d[_0x4a44('0x6a')][_0x4a44('0x6b')];_0x19663d[_0x4a44('0x47')][_0x4a44('0x6c')]=_0x19663d[_0x4a44('0x6a')][_0x4a44('0x6d')];_0x19663d[_0x4a44('0x47')][_0x4a44('0x6e')]=_0x19663d['file'][_0x4a44('0x6f')];return db['Attachment'][_0x4a44('0x46')](_0x19663d['body'])['then'](respondWithResult(_0x3af66d,0xc9))[_0x4a44('0x21')](handleError(_0x3af66d,null));};exports[_0x4a44('0x70')]=function(_0x4bfced,_0x519627){return db[_0x4a44('0x34')][_0x4a44('0x4a')]({'where':{'id':_0x4bfced[_0x4a44('0x39')]['id']},'raw':!![]})[_0x4a44('0x17')](handleEntityNotFound(_0x519627,null))[_0x4a44('0x17')](function(_0x308cc6){if(_0x308cc6){if(_0x308cc6[_0x4a44('0x68')]){return _0x519627[_0x4a44('0x22')](0x193)[_0x4a44('0x71')]({'status':0x193,'message':_0x4a44('0x72')});}return db[_0x4a44('0x73')][_0x4a44('0x4a')]({'where':{'id':_0x4bfced['query'][_0x4a44('0x74')]},'raw':!![]})[_0x4a44('0x17')](handleEntityNotFound(_0x519627,null));}})[_0x4a44('0x17')](function(_0x4cc3ef){if(_0x4cc3ef){var _0x38d495=_0x4cc3ef['ChatOfflineMessageId']!==null;var _0x3df939=path[_0x4a44('0x75')](config[_0x4a44('0x76')],_0x4a44('0x77'));if(_0x38d495){_0x3df939=path['join'](_0x3df939,_0x4a44('0x78'));}var _0x1f3633=path[_0x4a44('0x75')](_0x3df939,_0x4cc3ef[_0x4a44('0x6c')]);return _0x519627[_0x4a44('0x79')](_0x1f3633);}})[_0x4a44('0x21')](handleError(_0x519627,null));};exports[_0x4a44('0x7a')]=function(_0x41b7de,_0x59d460){var _0x124e5c=null;var _0x3893b8=null;var _0x321281=null;if(_0x41b7de['body']['id']){delete _0x41b7de[_0x4a44('0x47')]['id'];}if(_0x41b7de[_0x4a44('0x47')][_0x4a44('0x7b')]){_0x321281=path['join'](config[_0x4a44('0x76')],'server/files/chat/upload/',util['format'](_0x4a44('0x7c'),Date[_0x4a44('0x7d')]()));_0x41b7de[_0x4a44('0x47')][_0x4a44('0x7e')]=_0x321281;}return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x41b7de[_0x4a44('0x39')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0x4a44('0x7f')],'as':_0x4a44('0x7f')}]}]})[_0x4a44('0x17')](handleEntityNotFound(_0x59d460,null))[_0x4a44('0x17')](saveUpdates(_0x41b7de['body'],null))[_0x4a44('0x17')](function(_0x4bad3c){if(_0x4bad3c){_0x124e5c=_0x4bad3c;return db[_0x4a44('0x4b')][_0x4a44('0x45')]({'where':{'id':_0x124e5c['ChatWebsiteId']}});}})[_0x4a44('0x17')](function(_0x574d68){if(_0x574d68){_0x3893b8=_0x574d68;return db['CmContact'][_0x4a44('0x45')]({'where':{'id':_0x124e5c[_0x4a44('0x80')]}});}})[_0x4a44('0x17')](function(_0x123d12){if(_0x123d12){if(_0x321281){var _0x38b15b=null;for(var _0x2f488c=0x1;_0x2f488c<_0x124e5c['Messages'][_0x4a44('0x40')];++_0x2f488c){_0x38b15b=_0x124e5c[_0x4a44('0x81')][_0x2f488c];var _0x4de1cc=_0x38b15b[_0x4a44('0x66')]?util[_0x4a44('0x82')](_0x4a44('0x83'),_0x3893b8[_0x4a44('0x84')],_0x38b15b[_0x4a44('0x66')]):_0x4a44('0x85');var _0x655e11=_0x41b7de['body'][_0x4a44('0x86')]||util['format'](_0x4a44('0x83'),_0x4a44('0x87'),_0x38b15b[_0x4a44('0x80')]);switch(_0x3893b8['agentIdentifier']){case _0x4a44('0x88'):_0x4de1cc=_0x38b15b[_0x4a44('0x66')]?util[_0x4a44('0x82')](_0x4a44('0x83'),_0x3893b8[_0x4a44('0x84')],_0x38b15b[_0x4a44('0x66')]):_0x4a44('0x85');break;case _0x4a44('0x89'):_0x4de1cc=_0x38b15b[_0x4a44('0x66')]?_0x38b15b[_0x4a44('0x7f')][_0x4a44('0x8a')]||_0x38b15b[_0x4a44('0x7f')][_0x4a44('0x8b')]:_0x4a44('0x85');break;case _0x4a44('0x8c'):_0x4de1cc=_0x38b15b[_0x4a44('0x66')]?_0x38b15b[_0x4a44('0x7f')][_0x4a44('0x8b')]:_0x4a44('0x85');break;default:_0x4de1cc=_0x38b15b[_0x4a44('0x66')]?util[_0x4a44('0x82')](_0x4a44('0x83'),_0x3893b8[_0x4a44('0x84')],_0x38b15b[_0x4a44('0x66')]):'System';}var _0x429f24=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x38b15b[_0x4a44('0x8d')])['format'](_0x4a44('0x8e')),_0x38b15b['direction']==='in'?_0x655e11:_0x4de1cc,_0x38b15b['body']);if(!_0x38b15b[_0x4a44('0x8f')]){fs[_0x4a44('0x90')](_0x321281,_0x429f24);}}return db[_0x4a44('0x91')][_0x4a44('0x4a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x4a44('0x92'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x4a44('0x93'),'raw':!![]}]}]});}}})[_0x4a44('0x17')](function(_0x395c79){if(!_0x395c79||!_0x395c79[_0x4a44('0x92')]||!_0x41b7de['body'])return _0x124e5c;var _0x574a63=_0x395c79[_0x4a44('0x94')]();return respondWithRpcPromise(_0x4a44('0x95'),_0x4a44('0x96'),{'account':_0x574a63,'message':{'from':util[_0x4a44('0x82')](_0x4a44('0x97'),_0x395c79[_0x4a44('0x2c')],_0x395c79[_0x4a44('0x52')]||_0x395c79['Smtp'][_0x4a44('0x38')]),'to':_0x41b7de['body']['mailTranscript'],'subject':_0x4a44('0x98'),'text':util[_0x4a44('0x82')](_0x4a44('0x99'),_0x41b7de['body'][_0x4a44('0x7b')]),'attachments':[{'path':_0x321281}]}})['then'](function(){return _0x124e5c;})[_0x4a44('0x21')](function(_0x59a55d){logger[_0x4a44('0x1e')](_0x59a55d);});})[_0x4a44('0x17')](respondWithStatusCode(_0x59d460,0xc8))[_0x4a44('0x21')](handleError(_0x59d460,null));};exports['addMessage']=function(_0x3712c9,_0x3a7ce0){return db['ChatMessage'][_0x4a44('0x45')]({'where':{'id':_0x3712c9[_0x4a44('0x39')]['id']}})[_0x4a44('0x17')](handleEntityNotFound(_0x3a7ce0,null))[_0x4a44('0x17')](function(_0x88aadd){if(_0x88aadd){return _0x88aadd[_0x4a44('0x9a')](_0x3712c9[_0x4a44('0x47')][_0x4a44('0x9b')],_[_0x4a44('0x9c')](_0x3712c9[_0x4a44('0x47')],[_0x4a44('0x9b'),'id'])||{});}})[_0x4a44('0x17')](respondWithResult(_0x3a7ce0,null))[_0x4a44('0x21')](handleError(_0x3a7ce0,null));};exports[_0x4a44('0x9d')]=function(_0x2a1925,_0x38104c){var _0x552eae={'raw':![],'where':{}};var _0x24eace={};var _0x2ff325={'count':0x0,'rows':[]};return db[_0x4a44('0x34')][_0x4a44('0x4a')]({'where':{'id':_0x2a1925[_0x4a44('0x39')]['id']}})[_0x4a44('0x17')](handleEntityNotFound(_0x38104c,null))[_0x4a44('0x17')](function(_0xea7d9a){if(_0xea7d9a){_0x24eace[_0x4a44('0x3a')]=_[_0x4a44('0x3b')](db['ChatMessage'][_0x4a44('0x35')]);_0x24eace[_0x4a44('0x3c')]=_[_0x4a44('0x3b')](_0x2a1925[_0x4a44('0x3c')]);_0x24eace[_0x4a44('0x9e')]=_['intersection'](_0x24eace[_0x4a44('0x3a')],_0x24eace[_0x4a44('0x3c')]);_0x552eae['attributes']=_[_0x4a44('0x3d')](_0x24eace['model'],qs['fields'](_0x2a1925[_0x4a44('0x3c')]['fields']));_0x552eae[_0x4a44('0x3e')]=_0x552eae[_0x4a44('0x3e')][_0x4a44('0x40')]?_0x552eae['attributes']:_0x24eace[_0x4a44('0x3a')];if(!_0x2a1925[_0x4a44('0x3c')]['hasOwnProperty']('nolimit')){_0x552eae['limit']=qs['limit'](_0x2a1925[_0x4a44('0x3c')]['limit']);_0x552eae[_0x4a44('0x24')]=qs['offset'](_0x2a1925['query'][_0x4a44('0x24')]);}_0x552eae[_0x4a44('0x9f')]=qs[_0x4a44('0xa0')](_0x2a1925[_0x4a44('0x3c')][_0x4a44('0xa0')]);_0x552eae['where']=qs[_0x4a44('0x9e')](_[_0x4a44('0xa1')](_0x2a1925[_0x4a44('0x3c')],_0x24eace[_0x4a44('0x9e')]));_0x552eae[_0x4a44('0xa2')][_0x4a44('0xa3')]=_0xea7d9a['id'];if(_0x2a1925[_0x4a44('0x3c')]['filter']){_0x552eae[_0x4a44('0xa2')]=_[_0x4a44('0x43')](_0x552eae['where'],{'$or':_['map'](_0x552eae['attributes'],function(_0x4a7b0a){var _0x47c5f6={};_0x47c5f6[_0x4a7b0a]={'$like':'%'+_0x2a1925[_0x4a44('0x3c')]['filter']+'%'};return _0x47c5f6;})});}if(_0x2a1925[_0x4a44('0x3c')]['$gte']){var _0x126046=_0x2a1925[_0x4a44('0x3c')][_0x4a44('0xa4')][_0x4a44('0xa5')](',');var _0x3c25a7={};_0x3c25a7[_0x126046[0x0]]={'$gte':moment(_0x126046[0x1])[_0x4a44('0x82')](_0x4a44('0xa6'))};_0x552eae['where']=_[_0x4a44('0x43')](_0x552eae[_0x4a44('0xa2')],_0x3c25a7);}_0x552eae=_[_0x4a44('0x43')]({},_0x552eae,_0x2a1925[_0x4a44('0x44')]);return db[_0x4a44('0x5e')][_0x4a44('0x27')]({'where':_0x552eae['where']})[_0x4a44('0x17')](function(_0x27da60){_0x2ff325['count']=_0x27da60;if(_0x2a1925['query'][_0x4a44('0x41')]){_0x552eae[_0x4a44('0x42')]=[{'all':!![]}];}return db['ChatMessage'][_0x4a44('0xa7')](_0x552eae);})[_0x4a44('0x17')](function(_0x291431){_0x2ff325[_0x4a44('0xa8')]=_0x291431;return _0x2ff325;});}})[_0x4a44('0x17')](respondWithFilteredResult(_0x38104c,_0x552eae))['catch'](handleError(_0x38104c,null));};exports[_0x4a44('0xa9')]=function(_0x251030,_0x31cf58){var _0x1d5fab={'where':{}},_0x2056bf={},_0x29ba34={'count':0x0,'rows':[]};return db[_0x4a44('0x34')][_0x4a44('0x4a')]({'where':{'id':_0x251030[_0x4a44('0x39')]['id']}})['then'](handleEntityNotFound(_0x31cf58,null))[_0x4a44('0x17')](function(_0x56c306){if(_0x56c306){_0x2056bf[_0x4a44('0x3a')]=_[_0x4a44('0x3b')](db[_0x4a44('0x5e')]['rawAttributes']);_0x2056bf[_0x4a44('0x3c')]=_[_0x4a44('0x3b')](_0x251030[_0x4a44('0x3c')]);_0x2056bf[_0x4a44('0x9e')]=_[_0x4a44('0x3d')](_0x2056bf['model'],_0x2056bf[_0x4a44('0x3c')]);_0x1d5fab[_0x4a44('0x3e')]=_[_0x4a44('0x3d')](_0x2056bf[_0x4a44('0x3a')],qs[_0x4a44('0x3f')](_0x251030[_0x4a44('0x3c')][_0x4a44('0x3f')]));_0x1d5fab['attributes']=_0x1d5fab['attributes']['length']?_0x1d5fab[_0x4a44('0x3e')]:_0x2056bf[_0x4a44('0x3a')];if(!_0x251030[_0x4a44('0x3c')]['hasOwnProperty'](_0x4a44('0xaa'))){_0x1d5fab[_0x4a44('0x26')]=qs[_0x4a44('0x26')](_0x251030[_0x4a44('0x3c')][_0x4a44('0x26')]);_0x1d5fab[_0x4a44('0x24')]=qs[_0x4a44('0x24')](_0x251030[_0x4a44('0x3c')][_0x4a44('0x24')]);}_0x1d5fab['order']=qs['sort'](_0x251030['query'][_0x4a44('0xa0')]);_0x1d5fab['where']=qs['filters'](_[_0x4a44('0xa1')](_0x251030[_0x4a44('0x3c')],_0x2056bf[_0x4a44('0x9e')]));_0x1d5fab[_0x4a44('0xa2')][_0x4a44('0xa3')]=_0x56c306['id'];if(_0x251030['query'][_0x4a44('0xab')]){_0x1d5fab[_0x4a44('0xa2')]=_[_0x4a44('0x43')](_0x1d5fab[_0x4a44('0xa2')],{'$or':_[_0x4a44('0x33')](_0x1d5fab[_0x4a44('0x3e')],function(_0x24934a){var _0x10c9d8={};_0x10c9d8[_0x24934a]={'$like':'%'+_0x251030[_0x4a44('0x3c')]['filter']+'%'};return _0x10c9d8;})});}_0x1d5fab[_0x4a44('0xa2')][_0x4a44('0x8f')]=![];if(_0x251030[_0x4a44('0x3c')]['id']){_0x1d5fab[_0x4a44('0xa2')]['id']={'$gt':_0x251030[_0x4a44('0x3c')]['id']};}_0x1d5fab=_[_0x4a44('0x43')]({},_0x1d5fab,_0x251030[_0x4a44('0x44')]);return db[_0x4a44('0x5e')][_0x4a44('0x27')]({'where':_0x1d5fab[_0x4a44('0xa2')]})['then'](function(_0xc22d36){_0x29ba34[_0x4a44('0x27')]=_0xc22d36;_0x1d5fab['include']=[];if(_0x251030[_0x4a44('0x3c')]['includeAgent']){_0x1d5fab[_0x4a44('0x42')]['push']({'model':db[_0x4a44('0x7f')],'as':'User','attributes':['id','fullname',_0x4a44('0x8a')]});}if(_0x251030[_0x4a44('0x3c')][_0x4a44('0x41')]){_0x1d5fab['include']=[{'all':!![]}];}return db[_0x4a44('0x5e')][_0x4a44('0xa7')](_0x1d5fab);})[_0x4a44('0x17')](function(_0x1956a0){_0x29ba34[_0x4a44('0xa8')]=_0x1956a0;return _0x29ba34;});}})[_0x4a44('0x17')](respondWithFilteredResult(_0x31cf58,_0x1d5fab))['catch'](handleError(_0x31cf58,null));};exports[_0x4a44('0xac')]=function(_0x1b575f,_0x59b64d){return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x1b575f['params']['id']}})[_0x4a44('0x17')](handleEntityNotFound(_0x59b64d,null))[_0x4a44('0x17')](function(_0x26e2d3){if(_0x26e2d3){return _0x26e2d3['setTags'](_0x1b575f[_0x4a44('0x47')]['ids'],_[_0x4a44('0x9c')](_0x1b575f['body'],[_0x4a44('0x9b'),'id'])||{})['spread'](function(){return db[_0x4a44('0xad')][_0x4a44('0xa7')]({'attributes':['id','name',_0x4a44('0xae')],'where':{'id':_0x1b575f[_0x4a44('0x47')]['ids']}});})['then'](function(_0x2e5d45){socket[_0x4a44('0xaf')](_0x4a44('0xb0'),{'id':Number(_0x1b575f[_0x4a44('0x39')]['id']),'tags':_0x2e5d45||[]});return{'id':Number(_0x1b575f['params']['id']),'tags':_0x2e5d45||[]};});}})['then'](respondWithResult(_0x59b64d,null))['catch'](handleError(_0x59b64d,null));};exports[_0x4a44('0xb1')]=function(_0x212d32,_0x33a291){return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x212d32['params']['id']}})[_0x4a44('0x17')](handleEntityNotFound(_0x33a291,null))['then'](function(_0x405e72){if(_0x405e72){return _0x405e72[_0x4a44('0xb1')](_0x212d32[_0x4a44('0x3c')]['ids']);}})['then'](respondWithStatusCode(_0x33a291,null))[_0x4a44('0x21')](handleError(_0x33a291,null));};exports['download']=function(_0x501062,_0xf54892){var _0x54a40b=moment()[_0x4a44('0xb2')]()[_0x4a44('0xb3')]();var _0x28ef44=path[_0x4a44('0x75')](config[_0x4a44('0x76')],'server',_0x4a44('0xb4'),_0x4a44('0xb5'));var _0x41d6ee=path[_0x4a44('0x75')](config[_0x4a44('0x76')],_0x4a44('0xb6'),_0x4a44('0xb4'),_0x4a44('0xb7'));var _0x57dc73=path[_0x4a44('0x75')](_0x28ef44,_0x54a40b);var _0x15e02e=util[_0x4a44('0x82')]('transcript-%d-%s.zip',_0x501062['params']['id'],_0x54a40b);var _0x45b7ff=path[_0x4a44('0x75')](_0x28ef44,_0x15e02e);var _0x42ecb6=[];_0x42ecb6['push']({'model':db[_0x4a44('0x7f')],'as':_0x4a44('0x7f'),'attributes':['id',_0x4a44('0x8b')],'raw':!![]});_0x42ecb6[_0x4a44('0xb8')]({'model':db[_0x4a44('0x61')],'as':_0x4a44('0x62'),'attributes':['id',_0x4a44('0xb9'),_0x4a44('0xba')],'raw':!![]});if(_0x501062[_0x4a44('0x3c')][_0x4a44('0xb7')]){_0x42ecb6[_0x4a44('0xb8')]({'model':db[_0x4a44('0x73')],'as':_0x4a44('0x73'),'raw':!![]});}var _0x27aea2=[{'model':db['ChatMessage'],'as':_0x4a44('0x81'),'attributes':['id',_0x4a44('0x47'),'createdAt','direction',_0x4a44('0x8f'),_0x4a44('0xbb')],'include':_0x42ecb6}];_0x27aea2[_0x4a44('0xb8')]({'model':db[_0x4a44('0x4b')],'as':_0x4a44('0xbc'),'attributes':['id','name']});_0x27aea2['push']({'model':db['User'],'as':_0x4a44('0xbd'),'attributes':['id','fullname']});return db[_0x4a44('0x34')][_0x4a44('0x45')]({'where':{'id':_0x501062['params']['id']},'include':_0x27aea2})[_0x4a44('0x17')](handleEntityNotFound(_0xf54892,null))[_0x4a44('0x17')](function(_0x230f7e){if(_0x230f7e){var _0x481170=_0x230f7e[_0x4a44('0xbe')]({'plain':!![]});fs[_0x4a44('0xbf')](_0x57dc73);var _0x562026={'channel':_0x4a44('0xc0'),'account':_0x481170[_0x4a44('0xbc')][_0x4a44('0x2c')],'agent':_0x481170[_0x4a44('0xbd')]?_0x481170['Owner']['fullname']:_0x4a44('0xc1'),'createdAt':moment(_0x481170[_0x4a44('0x8d')])[_0x4a44('0x82')]('YYYY-MM-DD\x20HH:mm:ss')[_0x4a44('0xb3')](),'closedAt':_0x481170[_0x4a44('0x68')]?moment(_0x481170[_0x4a44('0xc2')])[_0x4a44('0x82')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x481170[_0x4a44('0xc3')],'chatInfo':{'browser':_0x481170[_0x4a44('0xc4')],'os':_0x481170[_0x4a44('0xc5')],'referer':_0x481170['referer'],'customerIp':_0x481170[_0x4a44('0xc6')],'customerPort':_0x481170[_0x4a44('0xc7')]?_0x481170[_0x4a44('0xc7')]:_0x4a44('0xc1')},'messages':_(_0x481170[_0x4a44('0x81')])['tail']()[_0x4a44('0xab')]({'secret':![]})[_0x4a44('0x33')](function(_0x56dc92){if(_0x56dc92[_0x4a44('0x73')]){var _0x252978=path[_0x4a44('0x75')](_0x41d6ee,_0x56dc92['Attachment']['basename']);if(fs[_0x4a44('0xc8')](_0x252978)){fs[_0x4a44('0xc9')](_0x252978)[_0x4a44('0xca')](fs['createWriteStream'](path[_0x4a44('0x75')](_0x57dc73,_0x56dc92['Attachment']['basename'])));}}return{'date':moment(_0x56dc92[_0x4a44('0x8d')])[_0x4a44('0x82')](_0x4a44('0xa6'))[_0x4a44('0xb3')](),'sender':_0x56dc92['direction']===_0x4a44('0x5d')?_0x56dc92[_0x4a44('0x7f')]?_0x56dc92[_0x4a44('0x7f')][_0x4a44('0x8b')]:_0x4a44('0x85'):_0x56dc92['Contact'][_0x4a44('0xb9')]+(_0x56dc92['Contact'][_0x4a44('0xba')]?'\x20'+_0x56dc92[_0x4a44('0x62')][_0x4a44('0xba')]:''),'body':_0x56dc92[_0x4a44('0x73')]?_0x56dc92[_0x4a44('0x73')]['basename']:_0x56dc92[_0x4a44('0x47')],'direction':_0x56dc92[_0x4a44('0xcb')]===_0x4a44('0x5d')?'A':'C','secret':_0x56dc92[_0x4a44('0x8f')],'read':_0x56dc92[_0x4a44('0xbb')],'attachment':_0x56dc92[_0x4a44('0x73')]};})['value']()};return ejs[_0x4a44('0xcc')](path[_0x4a44('0x75')](config['root'],_0x4a44('0xb6'),'views',_0x4a44('0xcd')),{'interaction':_0x562026})[_0x4a44('0x17')](function(_0x2b516d){var _0xd2fdeb=path[_0x4a44('0x75')](_0x57dc73,_0x4a44('0xce')+_0x481170['id']+'-'+_0x54a40b+_0x4a44('0xcf'));var _0x4df2fb={'path':_0xd2fdeb,'channel':_0x4a44('0xc0'),'interactionId':_0x481170['id']};return pdf[_0x4a44('0xd0')](_0x2b516d,_0x4df2fb);})['then'](function(){return new Promise(function(_0x5e1617,_0x551bd8){zipdir(_0x57dc73,{'saveTo':_0x45b7ff},function(_0x138476,_0x5058a4){if(_0x138476)return _0x551bd8(_0x138476);return _0x5e1617(_0x5058a4);});})[_0x4a44('0x17')](function(){return new BPromise(function(_0x45970c,_0x37887f){rimraf(_0x57dc73,function(_0x413443){if(_0x413443)_0x37887f(_0x413443);return _0x45970c();});});})[_0x4a44('0x17')](function(){return _0xf54892[_0x4a44('0x79')](_0x45b7ff,_0x15e02e,function(_0x4b898d){if(_0x4b898d){logger[_0x4a44('0x1e')](_0x4a44('0xd1'),_0x4b898d);}else{fs[_0x4a44('0xd2')](_0x45b7ff);}});});});}else{return _0xf54892['sendStatus'](0xc8);}})[_0x4a44('0x21')](handleError(_0xf54892,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 7afc7a9..645a203 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 _0x26e8=['length','emit','hasOwnProperty','events','../../mysqldb','ChatMessage','setMaxListeners','save','getUsers','then','setDataValue','Users','map','findAll','unreadMessages'];(function(_0x52b507,_0x3edb80){var _0x341497=function(_0x4669c3){while(--_0x4669c3){_0x52b507['push'](_0x52b507['shift']());}};_0x341497(++_0x3edb80);}(_0x26e8,0x1e3));var _0x826e=function(_0x3cf781,_0x3e4bc9){_0x3cf781=_0x3cf781-0x0;var _0x25e4d8=_0x26e8[_0x3cf781];return _0x25e4d8;};'use strict';var EventEmitter=require(_0x826e('0x0'));var ChatInteraction=require(_0x826e('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x826e('0x1'))['db'][_0x826e('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x826e('0x3')](0x0);var events={'afterCreate':_0x826e('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x3acaab){return function(_0xabaf52,_0x210c37,_0x135381){_0xabaf52[_0x826e('0x5')]({'attributes':['id'],'raw':!![]})[_0x826e('0x6')](function(_0x4ddaec){_0xabaf52[_0x826e('0x7')](_0x826e('0x8'),_0x4ddaec[_0x826e('0x9')](function(_0x1dbc0b){return{'id':_0x1dbc0b['id']};}));return ChatMessage[_0x826e('0xa')]({'where':{'ChatInteractionId':_0xabaf52['id'],'direction':'in','read':![]},'raw':!![]});})[_0x826e('0x6')](function(_0x5db1d5){_0xabaf52[_0x826e('0x7')](_0x826e('0xb'),_0x5db1d5[_0x826e('0xc')]);ChatInteractionEvents[_0x826e('0xd')](_0x3acaab+':'+_0xabaf52['id'],_0xabaf52);ChatInteractionEvents[_0x826e('0xd')](_0x3acaab,_0xabaf52);_0x135381(null);})['catch'](_0x135381(null));};}for(var e in events){if(events[_0x826e('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x6d38=['hook','exports','events','../../mysqldb','ChatInteraction','save','update','remove','getUsers','Users','findAll','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty'];(function(_0x55ffdc,_0x4a6870){var _0x44b944=function(_0x4fcd57){while(--_0x4fcd57){_0x55ffdc['push'](_0x55ffdc['shift']());}};_0x44b944(++_0x4a6870);}(_0x6d38,0x6e));var _0x86d3=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x6d38[_0x13d07a];return _0x5ee0ee;};'use strict';var EventEmitter=require(_0x86d3('0x0'));var ChatInteraction=require(_0x86d3('0x1'))['db'][_0x86d3('0x2')];var ChatMessage=require(_0x86d3('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x86d3('0x3'),'afterUpdate':_0x86d3('0x4'),'afterDestroy':_0x86d3('0x5')};function emitEvent(_0xb8a491){return function(_0x5ca51a,_0xbcb71e,_0x55d1ea){_0x5ca51a[_0x86d3('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x52d893){_0x5ca51a['setDataValue'](_0x86d3('0x7'),_0x52d893['map'](function(_0x278cf5){return{'id':_0x278cf5['id']};}));return ChatMessage[_0x86d3('0x8')]({'where':{'ChatInteractionId':_0x5ca51a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x86d3('0x9')](function(_0x1d59b6){_0x5ca51a[_0x86d3('0xa')](_0x86d3('0xb'),_0x1d59b6[_0x86d3('0xc')]);ChatInteractionEvents[_0x86d3('0xd')](_0xb8a491+':'+_0x5ca51a['id'],_0x5ca51a);ChatInteractionEvents[_0x86d3('0xd')](_0xb8a491,_0x5ca51a);_0x55d1ea(null);})[_0x86d3('0xe')](_0x55d1ea(null));};}for(var e in events){if(events[_0x86d3('0xf')](e)){var event=events[e];ChatInteraction[_0x86d3('0x10')](e,emitEvent(event));}}module[_0x86d3('0x11')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 04b048d..b5f4eff 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 _0xb07b=['changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','define','chat_interactions'];(function(_0x318b88,_0x146ed7){var _0x1fec14=function(_0x20b3e2){while(--_0x20b3e2){_0x318b88['push'](_0x318b88['shift']());}};_0x1fec14(++_0x146ed7);}(_0xb07b,0x15a));var _0xbb07=function(_0x381543,_0x1aacb5){_0x381543=_0x381543-0x0;var _0x30b94d=_0xb07b[_0x381543];return _0x30b94d;};'use strict';var _=require(_0xbb07('0x0'));var util=require(_0xbb07('0x1'));var logger=require(_0xbb07('0x2'))('api');var moment=require(_0xbb07('0x3'));var BPromise=require(_0xbb07('0x4'));var rp=require(_0xbb07('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbb07('0x6'));var config=require(_0xbb07('0x7'));var attributes=require(_0xbb07('0x8'));module['exports']=function(_0x49a008,_0x5aa15c){return _0x49a008[_0xbb07('0x9')]('ChatInteraction',attributes,{'tableName':_0xbb07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53ee83,_0x45e63f,_0x54a614){if(_0x53ee83[_0xbb07('0xb')]('closed')){_0x53ee83[_0xbb07('0xc')]=moment()[_0xbb07('0xd')](_0xbb07('0xe'));}_0x54a614(null,_0x53ee83);}},'charset':_0xbb07('0xf'),'collate':_0xbb07('0x10')});};
\ No newline at end of file
+var _0x5e58=['format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','changed','closed','closedAt'];(function(_0x547890,_0x593741){var _0x2c8daa=function(_0x1b100d){while(--_0x1b100d){_0x547890['push'](_0x547890['shift']());}};_0x2c8daa(++_0x593741);}(_0x5e58,0x76));var _0x85e5=function(_0x4fa2da,_0x8ab535){_0x4fa2da=_0x4fa2da-0x0;var _0xd6958a=_0x5e58[_0x4fa2da];return _0xd6958a;};'use strict';var _=require(_0x85e5('0x0'));var util=require(_0x85e5('0x1'));var logger=require('../../config/logger')(_0x85e5('0x2'));var moment=require(_0x85e5('0x3'));var BPromise=require('bluebird');var rp=require(_0x85e5('0x4'));var fs=require('fs');var path=require(_0x85e5('0x5'));var rimraf=require(_0x85e5('0x6'));var config=require(_0x85e5('0x7'));var attributes=require(_0x85e5('0x8'));module[_0x85e5('0x9')]=function(_0x14404d,_0x38fc59){return _0x14404d[_0x85e5('0xa')]('ChatInteraction',attributes,{'tableName':_0x85e5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x534e20,_0x3ab2de,_0x52cf7f){if(_0x534e20[_0x85e5('0xc')](_0x85e5('0xd'))){_0x534e20[_0x85e5('0xe')]=moment()[_0x85e5('0xf')](_0x85e5('0x10'));}_0x52cf7f(null,_0x534e20);}},'charset':_0x85e5('0x11'),'collate':_0x85e5('0x12')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e6f4892..ce5cfe7 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 _0x8c7b=['AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','options','raw','where','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','addTags','body','ids','omit','spread'];(function(_0x27c401,_0x592dab){var _0x263b74=function(_0x55f9ce){while(--_0x55f9ce){_0x27c401['push'](_0x27c401['shift']());}};_0x263b74(++_0x592dab);}(_0x8c7b,0x79));var _0xb8c7=function(_0x76bdfe,_0x5d2824){_0x76bdfe=_0x76bdfe-0x0;var _0x5084ef=_0x8c7b[_0x76bdfe];return _0x5084ef;};'use strict';var _=require(_0xb8c7('0x0'));var util=require('util');var moment=require(_0xb8c7('0x1'));var BPromise=require(_0xb8c7('0x2'));var rs=require(_0xb8c7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb8c7('0x4'))['db'];var utils=require(_0xb8c7('0x5'));var logger=require(_0xb8c7('0x6'))('rpc');var config=require(_0xb8c7('0x7'));var jayson=require(_0xb8c7('0x8'));var client=jayson['client'][_0xb8c7('0x9')]({'port':0x232a});config[_0xb8c7('0xa')]=_[_0xb8c7('0xb')](config['redis'],{'host':_0xb8c7('0xc'),'port':0x18eb});var socket=require(_0xb8c7('0xd'))(new Redis(config[_0xb8c7('0xa')]));require(_0xb8c7('0xe'))['register'](socket);function respondWithRpcPromise(_0x5c0248,_0x52630d,_0x16bb94){return new BPromise(function(_0x3ab8b2,_0x4981c0){return client[_0xb8c7('0xf')](_0x5c0248,_0x16bb94)[_0xb8c7('0x10')](function(_0x1365be){logger[_0xb8c7('0x11')](_0xb8c7('0x12'),_0x52630d,_0xb8c7('0x13'));logger[_0xb8c7('0x14')](_0xb8c7('0x15'),_0x52630d,'request\x20sent',JSON[_0xb8c7('0x16')](_0x1365be));if(_0x1365be[_0xb8c7('0x17')]){if(_0x1365be[_0xb8c7('0x17')]['code']===0x1f4){logger[_0xb8c7('0x17')](_0xb8c7('0x12'),_0x52630d,_0x1365be[_0xb8c7('0x17')]['message']);return _0x4981c0(_0x1365be[_0xb8c7('0x17')]['message']);}logger[_0xb8c7('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x52630d,_0x1365be['error'][_0xb8c7('0x18')]);return _0x3ab8b2(_0x1365be[_0xb8c7('0x17')]['message']);}else{logger[_0xb8c7('0x11')]('ChatInteraction,\x20%s,\x20%s',_0x52630d,_0xb8c7('0x13'));_0x3ab8b2(_0x1365be[_0xb8c7('0x19')][_0xb8c7('0x18')]);}})[_0xb8c7('0x1a')](function(_0x4914a9){logger[_0xb8c7('0x17')](_0xb8c7('0x12'),_0x52630d,_0x4914a9);_0x4981c0(_0x4914a9);});});}exports['UpdateChatInteraction']=function(_0x17e925){var _0x101e3b=this;return new Promise(function(_0x4865fc,_0x1debb7){return db['ChatInteraction']['update'](_0x17e925['body'],{'raw':_0x17e925[_0xb8c7('0x1b')]?_0x17e925[_0xb8c7('0x1b')][_0xb8c7('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x17e925[_0xb8c7('0x1b')]?_0x17e925[_0xb8c7('0x1b')][_0xb8c7('0x1d')]||null:null,'attributes':_0x17e925[_0xb8c7('0x1b')]?_0x17e925['options'][_0xb8c7('0x1e')]||null:null,'limit':_0x17e925['options']?_0x17e925['options'][_0xb8c7('0x1f')]||null:null})[_0xb8c7('0x10')](function(_0x1e529c){logger[_0xb8c7('0x11')](_0xb8c7('0x20'),_0x17e925);logger[_0xb8c7('0x14')](_0xb8c7('0x20'),_0x17e925,JSON[_0xb8c7('0x16')](_0x1e529c));_0x4865fc(_0x1e529c);})[_0xb8c7('0x1a')](function(_0x2e0c41){logger[_0xb8c7('0x17')](_0xb8c7('0x20'),_0x2e0c41[_0xb8c7('0x18')],_0x17e925);_0x1debb7(_0x101e3b[_0xb8c7('0x17')](0x1f4,_0x2e0c41['message']));});});};exports[_0xb8c7('0x21')]=function(_0x2cf4a4){return new Promise(function(_0x1be7fb,_0x557375){return db['ChatInteraction']['find']({'where':_0x2cf4a4[_0xb8c7('0x1b')]?_0x2cf4a4[_0xb8c7('0x1b')][_0xb8c7('0x1d')]||null:null})[_0xb8c7('0x10')](function(_0x4df8ec){if(_0x4df8ec){return _0x4df8ec[_0xb8c7('0x22')](_0x2cf4a4[_0xb8c7('0x23')][_0xb8c7('0x24')],_[_0xb8c7('0x25')](_0x2cf4a4[_0xb8c7('0x23')],[_0xb8c7('0x24'),'id'])||{});}})[_0xb8c7('0x26')](function(_0x4f6d75){logger['info'](_0xb8c7('0x27'),_0x2cf4a4);logger[_0xb8c7('0x14')](_0xb8c7('0x27'),_0x2cf4a4,JSON[_0xb8c7('0x16')](_0x4f6d75));_0x1be7fb(_0x4f6d75);})[_0xb8c7('0x1a')](function(_0x3cbe5d){logger[_0xb8c7('0x17')]('AddTags',_0x3cbe5d[_0xb8c7('0x18')],_0x2cf4a4);_0x557375(_this[_0xb8c7('0x17')](0x1f4,_0x3cbe5d[_0xb8c7('0x18')]));});});};
\ No newline at end of file
+var _0x1012=['addTags','body','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','UpdateChatInteraction','update','options','raw','where','attributes','limit','stringify','AddTagsToChatInteraction','ChatInteraction'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1012,0x10e));var _0x2101=function(_0x2db12b,_0x30ab1d){_0x2db12b=_0x2db12b-0x0;var _0x20990b=_0x1012[_0x2db12b];return _0x20990b;};'use strict';var _=require(_0x2101('0x0'));var util=require(_0x2101('0x1'));var moment=require(_0x2101('0x2'));var BPromise=require('bluebird');var rs=require(_0x2101('0x3'));var fs=require('fs');var Redis=require(_0x2101('0x4'));var db=require(_0x2101('0x5'))['db'];var utils=require(_0x2101('0x6'));var logger=require('../../config/logger')(_0x2101('0x7'));var config=require(_0x2101('0x8'));var jayson=require(_0x2101('0x9'));var client=jayson[_0x2101('0xa')][_0x2101('0xb')]({'port':0x232a});config[_0x2101('0xc')]=_[_0x2101('0xd')](config['redis'],{'host':_0x2101('0xe'),'port':0x18eb});var socket=require(_0x2101('0xf'))(new Redis(config[_0x2101('0xc')]));require('./chatInteraction.socket')[_0x2101('0x10')](socket);function respondWithRpcPromise(_0x2e8deb,_0x36cab8,_0x1c44b3){return new BPromise(function(_0x2000db,_0x61ef2){return client[_0x2101('0x11')](_0x2e8deb,_0x1c44b3)[_0x2101('0x12')](function(_0x8cef8a){logger[_0x2101('0x13')](_0x2101('0x14'),_0x36cab8,_0x2101('0x15'));logger[_0x2101('0x16')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x36cab8,_0x2101('0x15'),JSON['stringify'](_0x8cef8a));if(_0x8cef8a[_0x2101('0x17')]){if(_0x8cef8a['error'][_0x2101('0x18')]===0x1f4){logger[_0x2101('0x17')](_0x2101('0x14'),_0x36cab8,_0x8cef8a['error']['message']);return _0x61ef2(_0x8cef8a['error'][_0x2101('0x19')]);}logger[_0x2101('0x17')](_0x2101('0x14'),_0x36cab8,_0x8cef8a[_0x2101('0x17')]['message']);return _0x2000db(_0x8cef8a[_0x2101('0x17')][_0x2101('0x19')]);}else{logger[_0x2101('0x13')]('ChatInteraction,\x20%s,\x20%s',_0x36cab8,_0x2101('0x15'));_0x2000db(_0x8cef8a[_0x2101('0x1a')][_0x2101('0x19')]);}})[_0x2101('0x1b')](function(_0x16ab09){logger['error'](_0x2101('0x14'),_0x36cab8,_0x16ab09);_0x61ef2(_0x16ab09);});});}exports[_0x2101('0x1c')]=function(_0x594556){var _0x90732a=this;return new Promise(function(_0x1c07e6,_0x43cf8d){return db['ChatInteraction'][_0x2101('0x1d')](_0x594556['body'],{'raw':_0x594556[_0x2101('0x1e')]?_0x594556[_0x2101('0x1e')][_0x2101('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x594556[_0x2101('0x1e')]?_0x594556[_0x2101('0x1e')][_0x2101('0x20')]||null:null,'attributes':_0x594556[_0x2101('0x1e')]?_0x594556['options'][_0x2101('0x21')]||null:null,'limit':_0x594556[_0x2101('0x1e')]?_0x594556[_0x2101('0x1e')][_0x2101('0x22')]||null:null})[_0x2101('0x12')](function(_0x23ce5f){logger[_0x2101('0x13')]('UpdateChatInteraction',_0x594556);logger['debug'](_0x2101('0x1c'),_0x594556,JSON[_0x2101('0x23')](_0x23ce5f));_0x1c07e6(_0x23ce5f);})[_0x2101('0x1b')](function(_0x7beb1){logger[_0x2101('0x17')](_0x2101('0x1c'),_0x7beb1[_0x2101('0x19')],_0x594556);_0x43cf8d(_0x90732a[_0x2101('0x17')](0x1f4,_0x7beb1['message']));});});};exports[_0x2101('0x24')]=function(_0x30a78f){return new Promise(function(_0x59413a,_0x5e5b9e){return db[_0x2101('0x25')]['find']({'where':_0x30a78f[_0x2101('0x1e')]?_0x30a78f[_0x2101('0x1e')][_0x2101('0x20')]||null:null})['then'](function(_0x4aa677){if(_0x4aa677){return _0x4aa677[_0x2101('0x26')](_0x30a78f[_0x2101('0x27')][_0x2101('0x28')],_[_0x2101('0x29')](_0x30a78f[_0x2101('0x27')],[_0x2101('0x28'),'id'])||{});}})[_0x2101('0x2a')](function(_0x232ace){logger[_0x2101('0x13')](_0x2101('0x2b'),_0x30a78f);logger[_0x2101('0x16')](_0x2101('0x2b'),_0x30a78f,JSON[_0x2101('0x23')](_0x232ace));_0x59413a(_0x232ace);})['catch'](function(_0x5efee5){logger[_0x2101('0x17')](_0x2101('0x2b'),_0x5efee5[_0x2101('0x19')],_0x30a78f);_0x5e5b9e(_this[_0x2101('0x17')](0x1f4,_0x5efee5['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index dd7be1e..9d50915 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 _0x4403=['length','update','emit','removeListener'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x4403,0x179));var _0x3440=function(_0x3b88d1,_0x22075b){_0x3b88d1=_0x3b88d1-0x0;var _0x393ed5=_0x4403[_0x3b88d1];return _0x393ed5;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0x3440('0x0')];function createListener(_0x571a63,_0x173448){return function(_0x48ba88){_0x173448[_0x3440('0x1')](_0x571a63,_0x48ba88);};}function removeListener(_0x39386e,_0x4d4dc6){return function(){ChatInteractionEvents[_0x3440('0x2')](_0x39386e,_0x4d4dc6);};}exports['register']=function(_0x5904cb){for(var _0x1e5e8d=0x0,_0x3121bd=events[_0x3440('0x3')];_0x1e5e8d<_0x3121bd;_0x1e5e8d++){var _0x4abc5a=events[_0x1e5e8d];var _0x33a070=createListener('chatInteraction:'+_0x4abc5a,_0x5904cb);ChatInteractionEvents['on'](_0x4abc5a,_0x33a070);}};
\ No newline at end of file
+var _0x8f4e=['chatInteraction:','./chatInteraction.events','remove','update','emit','removeListener','register','length'];(function(_0x5510a6,_0x4975b9){var _0x962a10=function(_0x5cca76){while(--_0x5cca76){_0x5510a6['push'](_0x5510a6['shift']());}};_0x962a10(++_0x4975b9);}(_0x8f4e,0x149));var _0xe8f4=function(_0x15d984,_0x4170a0){_0x15d984=_0x15d984-0x0;var _0x3b574d=_0x8f4e[_0x15d984];return _0x3b574d;};'use strict';var ChatInteractionEvents=require(_0xe8f4('0x0'));var events=['save',_0xe8f4('0x1'),_0xe8f4('0x2')];function createListener(_0x42326d,_0x4cbe76){return function(_0x1a9c39){_0x4cbe76[_0xe8f4('0x3')](_0x42326d,_0x1a9c39);};}function removeListener(_0x3f734b,_0x547169){return function(){ChatInteractionEvents[_0xe8f4('0x4')](_0x3f734b,_0x547169);};}exports[_0xe8f4('0x5')]=function(_0x4d2238){for(var _0x37c911=0x0,_0x46e105=events[_0xe8f4('0x6')];_0x37c911<_0x46e105;_0x37c911++){var _0x3dd694=events[_0x37c911];var _0x3d6720=createListener(_0xe8f4('0x7')+_0x3dd694,_0x4d2238);ChatInteractionEvents['on'](_0x3dd694,_0x3d6720);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 42f94c7..19864fb 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 _0xfa20=['%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','tracked','chat','chatinteraction:addtags','addTags','put','chatinteraction:update','update','/:id/custom_update','abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','util','path','connect-timeout','express','Router','fs-extra','./chatInteraction.controller','get','index','/describe','describe','/:id','isChatInteractionAuthorized','/:id/attachment_download','attachmentDownload','isAuthenticated','getMessages','/:id/my_messages','getMyMessages','/:id/download','download','post','create','createVidaooSession','root','server/files/attachments/','format'];(function(_0x4cf71f,_0x4354e1){var _0x14c6ab=function(_0x3a8d1c){while(--_0x3a8d1c){_0x4cf71f['push'](_0x4cf71f['shift']());}};_0x14c6ab(++_0x4354e1);}(_0xfa20,0x1b9));var _0x0fa2=function(_0x2608f6,_0x3e467){_0x2608f6=_0x2608f6-0x0;var _0x581a04=_0xfa20[_0x2608f6];return _0x581a04;};'use strict';var multer=require('multer');var util=require(_0x0fa2('0x0'));var path=require(_0x0fa2('0x1'));var timeout=require(_0x0fa2('0x2'));var express=require(_0x0fa2('0x3'));var router=express[_0x0fa2('0x4')]();var fs_extra=require(_0x0fa2('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0fa2('0x6'));router[_0x0fa2('0x7')]('/',auth['isAuthenticated'](),controller[_0x0fa2('0x8')]);router[_0x0fa2('0x7')](_0x0fa2('0x9'),auth['isAuthenticated'](),controller[_0x0fa2('0xa')]);router[_0x0fa2('0x7')](_0x0fa2('0xb'),auth[_0x0fa2('0xc')](),controller['show']);router[_0x0fa2('0x7')](_0x0fa2('0xd'),auth[_0x0fa2('0xc')](),controller[_0x0fa2('0xe')]);router[_0x0fa2('0x7')]('/:id/messages',auth[_0x0fa2('0xf')](),controller[_0x0fa2('0x10')]);router['get'](_0x0fa2('0x11'),auth[_0x0fa2('0xc')](),controller[_0x0fa2('0x12')]);router[_0x0fa2('0x7')](_0x0fa2('0x13'),auth[_0x0fa2('0xf')](),controller[_0x0fa2('0x14')]);router[_0x0fa2('0x15')]('/',auth[_0x0fa2('0xf')](),controller[_0x0fa2('0x16')]);router[_0x0fa2('0x15')]('/:id/vidaoo',auth['isAuthenticated'](),controller[_0x0fa2('0x17')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4457a4,_0xa3fd52,_0x48b1e4){_0x48b1e4(null,path['join'](config[_0x0fa2('0x18')],_0x0fa2('0x19')));},'filename':function(_0x43e73e,_0x436e42,_0x2c9fe1){_0x2c9fe1(null,util[_0x0fa2('0x1a')](_0x0fa2('0x1b'),Date[_0x0fa2('0x1c')](),_0x436e42[_0x0fa2('0x1d')][_0x0fa2('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x0fa2('0x15')](_0x0fa2('0x1f'),upload[_0x0fa2('0x20')](_0x0fa2('0x21')),controller[_0x0fa2('0x22')]);router[_0x0fa2('0x15')](_0x0fa2('0x23'),auth[_0x0fa2('0xc')](),controller['addMessage']);router[_0x0fa2('0x15')]('/:id/tags',auth[_0x0fa2('0xf')](),interaction[_0x0fa2('0x24')](_0x0fa2('0x25'),_0x0fa2('0x26')),controller[_0x0fa2('0x27')]);router[_0x0fa2('0x28')]('/:id',auth[_0x0fa2('0xf')](),interaction['tracked'](_0x0fa2('0x25'),_0x0fa2('0x29')),controller[_0x0fa2('0x2a')]);router[_0x0fa2('0x28')](_0x0fa2('0x2b'),controller['customUpdate']);router[_0x0fa2('0x28')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x0fa2('0x2c')]);router[_0x0fa2('0x28')](_0x0fa2('0x2d'),controller[_0x0fa2('0x2e')]);router[_0x0fa2('0x2f')](_0x0fa2('0xb'),auth[_0x0fa2('0xf')](),interaction[_0x0fa2('0x24')](_0x0fa2('0x25'),_0x0fa2('0x30')),controller[_0x0fa2('0x31')]);router[_0x0fa2('0x2f')]('/:id/tags',auth[_0x0fa2('0xf')](),controller[_0x0fa2('0x32')]);module[_0x0fa2('0x33')]=router;
\ No newline at end of file
+var _0x8d86=['abandon','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','create','post','/:id/vidaoo','createVidaooSession','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','addMessage','/:id/tags','chatinteraction:addtags','addTags','put','tracked','chat','chatinteraction:update','/:id/custom_update','customUpdate','/:id/abandon'];(function(_0x4dd329,_0x5dcc32){var _0x508d53=function(_0x58a6bf){while(--_0x58a6bf){_0x4dd329['push'](_0x4dd329['shift']());}};_0x508d53(++_0x5dcc32);}(_0x8d86,0xb2));var _0x68d8=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x8d86[_0x500419];return _0x241c1a;};'use strict';var multer=require(_0x68d8('0x0'));var util=require(_0x68d8('0x1'));var path=require(_0x68d8('0x2'));var timeout=require(_0x68d8('0x3'));var express=require(_0x68d8('0x4'));var router=express[_0x68d8('0x5')]();var fs_extra=require(_0x68d8('0x6'));var auth=require(_0x68d8('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x68d8('0x8'));var controller=require(_0x68d8('0x9'));router[_0x68d8('0xa')]('/',auth['isAuthenticated'](),controller[_0x68d8('0xb')]);router['get'](_0x68d8('0xc'),auth[_0x68d8('0xd')](),controller[_0x68d8('0xe')]);router[_0x68d8('0xa')](_0x68d8('0xf'),auth[_0x68d8('0x10')](),controller['show']);router['get']('/:id/attachment_download',auth[_0x68d8('0x10')](),controller[_0x68d8('0x11')]);router[_0x68d8('0xa')](_0x68d8('0x12'),auth['isAuthenticated'](),controller[_0x68d8('0x13')]);router[_0x68d8('0xa')](_0x68d8('0x14'),auth[_0x68d8('0x10')](),controller['getMyMessages']);router[_0x68d8('0xa')](_0x68d8('0x15'),auth[_0x68d8('0xd')](),controller[_0x68d8('0x16')]);router['post']('/',auth[_0x68d8('0xd')](),controller[_0x68d8('0x17')]);router[_0x68d8('0x18')](_0x68d8('0x19'),auth[_0x68d8('0xd')](),controller[_0x68d8('0x1a')]);var upload=multer({'storage':multer[_0x68d8('0x1b')]({'destination':function(_0x5b3107,_0xae59d7,_0x120c6b){_0x120c6b(null,path[_0x68d8('0x1c')](config['root'],_0x68d8('0x1d')));},'filename':function(_0x329831,_0x2b1a56,_0x2186a3){_0x2186a3(null,util[_0x68d8('0x1e')](_0x68d8('0x1f'),Date[_0x68d8('0x20')](),_0x2b1a56[_0x68d8('0x21')][_0x68d8('0x22')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x68d8('0x18')](_0x68d8('0x23'),upload[_0x68d8('0x24')](_0x68d8('0x25')),controller[_0x68d8('0x26')]);router[_0x68d8('0x18')]('/:id/messages',auth[_0x68d8('0x10')](),controller[_0x68d8('0x27')]);router[_0x68d8('0x18')](_0x68d8('0x28'),auth[_0x68d8('0xd')](),interaction['tracked']('chat',_0x68d8('0x29')),controller[_0x68d8('0x2a')]);router[_0x68d8('0x2b')](_0x68d8('0xf'),auth['isAuthenticated'](),interaction[_0x68d8('0x2c')](_0x68d8('0x2d'),_0x68d8('0x2e')),controller['update']);router[_0x68d8('0x2b')](_0x68d8('0x2f'),controller[_0x68d8('0x30')]);router['put'](_0x68d8('0x31'),auth[_0x68d8('0x10')](),controller[_0x68d8('0x32')]);router[_0x68d8('0x2b')]('/:id/close',controller[_0x68d8('0x33')]);router[_0x68d8('0x34')]('/:id',auth[_0x68d8('0xd')](),interaction['tracked'](_0x68d8('0x2d'),_0x68d8('0x35')),controller[_0x68d8('0x36')]);router[_0x68d8('0x34')](_0x68d8('0x28'),auth[_0x68d8('0xd')](),controller[_0x68d8('0x37')]);module[_0x68d8('0x38')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index eb47cc9..733f668 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 _0xa7b7=['INTEGER','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0xa7b7,0xd9));var _0x7a7b=function(_0x302788,_0x19fb7e){_0x302788=_0x302788-0x0;var _0x27297a=_0xa7b7[_0x302788];return _0x27297a;};'use strict';var Sequelize=require(_0x7a7b('0x0'));module[_0x7a7b('0x1')]={'body':{'type':Sequelize[_0x7a7b('0x2')](_0x7a7b('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7a7b('0x4')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7a7b('0x5')]}};
\ No newline at end of file
+var _0x0bee=['medium','BOOLEAN','INTEGER','sequelize','TEXT'];(function(_0x560b93,_0x1ef1e5){var _0x19604a=function(_0x46aaa5){while(--_0x46aaa5){_0x560b93['push'](_0x560b93['shift']());}};_0x19604a(++_0x1ef1e5);}(_0x0bee,0x1b6));var _0xe0be=function(_0x24656c,_0xf77cde){_0x24656c=_0x24656c-0x0;var _0x53f07f=_0x0bee[_0x24656c];return _0x53f07f;};'use strict';var Sequelize=require(_0xe0be('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0be('0x1')](_0xe0be('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xe0be('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0be('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index a903ac4..ac1a9ce 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 _0x7b4d=['find','create','body','update','describe','get','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','user','fullname','role','internal','online','allowmessenger','showWebBar','VoiceQueue','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','autoAssociation','isEmpty','agent','push','messages','FromId','read','-createdAt','all','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','save','then','destroy','error','stack','name','ChatInternalMessage','rawAttributes','fieldName','type','map','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params'];(function(_0x10e206,_0x289f82){var _0x406fa9=function(_0x4260e8){while(--_0x4260e8){_0x10e206['push'](_0x10e206['shift']());}};_0x406fa9(++_0x289f82);}(_0x7b4d,0xed));var _0xd7b4=function(_0x4f5108,_0x46a54b){_0x4f5108=_0x4f5108-0x0;var _0x2d56ca=_0x7b4d[_0x4f5108];return _0x2d56ca;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd7b4('0x0'));var zipdir=require(_0xd7b4('0x1'));var jsonpatch=require(_0xd7b4('0x2'));var rp=require(_0xd7b4('0x3'));var moment=require(_0xd7b4('0x4'));var BPromise=require(_0xd7b4('0x5'));var Mustache=require(_0xd7b4('0x6'));var util=require('util');var path=require(_0xd7b4('0x7'));var sox=require(_0xd7b4('0x8'));var csv=require('to-csv');var ejs=require(_0xd7b4('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd7b4('0xa'));var squel=require(_0xd7b4('0xb'));var crypto=require(_0xd7b4('0xc'));var jsforce=require(_0xd7b4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd7b4('0xe'));var querystring=require(_0xd7b4('0xf'));var Papa=require(_0xd7b4('0x10'));var Redis=require(_0xd7b4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd7b4('0x12'));var logger=require(_0xd7b4('0x13'))('api');var utils=require(_0xd7b4('0x14'));var config=require(_0xd7b4('0x15'));var licenseUtil=require(_0xd7b4('0x16'));var db=require(_0xd7b4('0x17'))['db'];config[_0xd7b4('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xd7b4('0x19'))(new Redis(config['redis']));require(_0xd7b4('0x1a'))[_0xd7b4('0x1b')](socket);function respondWithStatusCode(_0x3f5d1a,_0x58ae54){_0x58ae54=_0x58ae54||0xcc;return function(_0x431433){if(_0x431433){return _0x3f5d1a[_0xd7b4('0x1c')](_0x58ae54);}return _0x3f5d1a[_0xd7b4('0x1d')](_0x58ae54)[_0xd7b4('0x1e')]();};}function respondWithResult(_0x24f903,_0x2a1066){_0x2a1066=_0x2a1066||0xc8;return function(_0x3d0ffa){if(_0x3d0ffa){return _0x24f903['status'](_0x2a1066)[_0xd7b4('0x1f')](_0x3d0ffa);}};}function respondWithFilteredResult(_0x140773,_0x4cb94c){return function(_0x115ae8){if(_0x115ae8){var _0x3e0394=typeof _0x4cb94c['offset']===_0xd7b4('0x20')&&typeof _0x4cb94c['limit']===_0xd7b4('0x20');var _0xe1e421=_0x115ae8[_0xd7b4('0x21')];var _0x428d39=_0x3e0394?0x0:_0x4cb94c[_0xd7b4('0x22')];var _0x724a70=_0x3e0394?_0x115ae8[_0xd7b4('0x21')]:_0x4cb94c[_0xd7b4('0x22')]+_0x4cb94c[_0xd7b4('0x23')];var _0x4601f9;if(_0x724a70>=_0xe1e421){_0x724a70=_0xe1e421;_0x4601f9=0xc8;}else{_0x4601f9=0xce;}_0x140773[_0xd7b4('0x1d')](_0x4601f9);return _0x140773['set'](_0xd7b4('0x24'),_0x428d39+'-'+_0x724a70+'/'+_0xe1e421)['json'](_0x115ae8);}return null;};}function patchUpdates(_0x57a952){return function(_0x3fd2ab){try{jsonpatch[_0xd7b4('0x25')](_0x3fd2ab,_0x57a952,!![]);}catch(_0x1ab3b4){return BPromise['reject'](_0x1ab3b4);}return _0x3fd2ab[_0xd7b4('0x26')]();};}function saveUpdates(_0x297b62,_0x21e943){return function(_0x154a9b){if(_0x154a9b){return _0x154a9b['update'](_0x297b62)[_0xd7b4('0x27')](function(_0x471e40){return _0x471e40;});}return null;};}function removeEntity(_0x3f2c80,_0x4b2246){return function(_0x504390){if(_0x504390){return _0x504390[_0xd7b4('0x28')]()['then'](function(){_0x3f2c80[_0xd7b4('0x1d')](0xcc)[_0xd7b4('0x1e')]();});}};}function handleEntityNotFound(_0x305643,_0x219229){return function(_0x1b4a40){if(!_0x1b4a40){_0x305643[_0xd7b4('0x1c')](0x194);}return _0x1b4a40;};}function handleError(_0x1cc6c2,_0x3f5cb2){_0x3f5cb2=_0x3f5cb2||0x1f4;return function(_0x567287){logger[_0xd7b4('0x29')](_0x567287[_0xd7b4('0x2a')]);if(_0x567287[_0xd7b4('0x2b')]){delete _0x567287['name'];}_0x1cc6c2[_0xd7b4('0x1d')](_0x3f5cb2)['send'](_0x567287);};}exports['index']=function(_0xafbd88,_0x6cb90d){var _0x33025d={},_0x5063eb={},_0x3af263={'count':0x0,'rows':[]};var _0x1e7f01=_['map'](db[_0xd7b4('0x2c')][_0xd7b4('0x2d')],function(_0x219c1f){return{'name':_0x219c1f[_0xd7b4('0x2e')],'type':_0x219c1f[_0xd7b4('0x2f')]['key']};});_0x5063eb['model']=_[_0xd7b4('0x30')](_0x1e7f01,_0xd7b4('0x2b'));_0x5063eb['query']=_[_0xd7b4('0x31')](_0xafbd88['query']);_0x5063eb[_0xd7b4('0x32')]=_[_0xd7b4('0x33')](_0x5063eb['model'],_0x5063eb[_0xd7b4('0x34')]);_0x33025d['attributes']=_[_0xd7b4('0x33')](_0x5063eb[_0xd7b4('0x35')],qs[_0xd7b4('0x36')](_0xafbd88[_0xd7b4('0x34')][_0xd7b4('0x36')]));_0x33025d[_0xd7b4('0x37')]=_0x33025d['attributes'][_0xd7b4('0x38')]?_0x33025d[_0xd7b4('0x37')]:_0x5063eb[_0xd7b4('0x35')];if(!_0xafbd88[_0xd7b4('0x34')][_0xd7b4('0x39')](_0xd7b4('0x3a'))){_0x33025d[_0xd7b4('0x23')]=qs[_0xd7b4('0x23')](_0xafbd88[_0xd7b4('0x34')][_0xd7b4('0x23')]);_0x33025d['offset']=qs['offset'](_0xafbd88[_0xd7b4('0x34')][_0xd7b4('0x22')]);}_0x33025d['order']=qs[_0xd7b4('0x3b')](_0xafbd88[_0xd7b4('0x34')][_0xd7b4('0x3b')]);_0x33025d[_0xd7b4('0x3c')]=qs[_0xd7b4('0x32')](_[_0xd7b4('0x3d')](_0xafbd88[_0xd7b4('0x34')],_0x5063eb[_0xd7b4('0x32')]),_0x1e7f01);if(_0xafbd88[_0xd7b4('0x34')][_0xd7b4('0x3e')]){_0x33025d[_0xd7b4('0x3c')]=_[_0xd7b4('0x3f')](_0x33025d[_0xd7b4('0x3c')],{'$or':_['map'](_0x1e7f01,function(_0x1e7ef7){if(_0x1e7ef7['type']!==_0xd7b4('0x40')){var _0x5b4b91={};_0x5b4b91[_0x1e7ef7['name']]={'$like':'%'+_0xafbd88['query']['filter']+'%'};return _0x5b4b91;}})});}_0x33025d=_['merge']({},_0x33025d,_0xafbd88[_0xd7b4('0x41')]);var _0x46af67={'where':_0x33025d[_0xd7b4('0x3c')]};return db[_0xd7b4('0x2c')]['count'](_0x46af67)['then'](function(_0x229805){_0x3af263[_0xd7b4('0x21')]=_0x229805;if(_0xafbd88['query'][_0xd7b4('0x42')]){_0x33025d[_0xd7b4('0x43')]=[{'all':!![]}];}return db[_0xd7b4('0x2c')][_0xd7b4('0x44')](_0x33025d);})[_0xd7b4('0x27')](function(_0x3535b1){_0x3af263[_0xd7b4('0x45')]=_0x3535b1;return _0x3af263;})['then'](respondWithFilteredResult(_0x6cb90d,_0x33025d))[_0xd7b4('0x46')](handleError(_0x6cb90d,null));};exports['show']=function(_0x168bac,_0x217e30){var _0x2facab={'raw':!![],'where':{'id':_0x168bac[_0xd7b4('0x47')]['id']}},_0x37c62e={};_0x37c62e['model']=_[_0xd7b4('0x31')](db[_0xd7b4('0x2c')][_0xd7b4('0x2d')]);_0x37c62e[_0xd7b4('0x34')]=_['keys'](_0x168bac[_0xd7b4('0x34')]);_0x37c62e[_0xd7b4('0x32')]=_['intersection'](_0x37c62e[_0xd7b4('0x35')],_0x37c62e[_0xd7b4('0x34')]);_0x2facab[_0xd7b4('0x37')]=_[_0xd7b4('0x33')](_0x37c62e['model'],qs['fields'](_0x168bac[_0xd7b4('0x34')][_0xd7b4('0x36')]));_0x2facab['attributes']=_0x2facab['attributes'][_0xd7b4('0x38')]?_0x2facab[_0xd7b4('0x37')]:_0x37c62e[_0xd7b4('0x35')];if(_0x168bac[_0xd7b4('0x34')]['includeAll']){_0x2facab[_0xd7b4('0x43')]=[{'all':!![]}];}_0x2facab=_['merge']({},_0x2facab,_0x168bac[_0xd7b4('0x41')]);return db['ChatInternalMessage'][_0xd7b4('0x48')](_0x2facab)['then'](handleEntityNotFound(_0x217e30,null))[_0xd7b4('0x27')](respondWithResult(_0x217e30,null))[_0xd7b4('0x46')](handleError(_0x217e30,null));};exports[_0xd7b4('0x49')]=function(_0x21c405,_0x58cb71){return db[_0xd7b4('0x2c')][_0xd7b4('0x49')](_0x21c405[_0xd7b4('0x4a')],{})['then'](respondWithResult(_0x58cb71,0xc9))['catch'](handleError(_0x58cb71,null));};exports[_0xd7b4('0x4b')]=function(_0x3252ef,_0x3c4c00){if(_0x3252ef[_0xd7b4('0x4a')]['id']){delete _0x3252ef[_0xd7b4('0x4a')]['id'];}return db[_0xd7b4('0x2c')][_0xd7b4('0x48')]({'where':{'id':_0x3252ef['params']['id']}})[_0xd7b4('0x27')](handleEntityNotFound(_0x3c4c00,null))[_0xd7b4('0x27')](saveUpdates(_0x3252ef[_0xd7b4('0x4a')],null))['then'](respondWithResult(_0x3c4c00,null))[_0xd7b4('0x46')](handleError(_0x3c4c00,null));};exports['destroy']=function(_0x1ec05c,_0x5f58e4){return db[_0xd7b4('0x2c')][_0xd7b4('0x48')]({'where':{'id':_0x1ec05c['params']['id']}})['then'](handleEntityNotFound(_0x5f58e4,null))[_0xd7b4('0x27')](removeEntity(_0x5f58e4,null))[_0xd7b4('0x46')](handleError(_0x5f58e4,null));};exports[_0xd7b4('0x4c')]=function(_0x5aa03a,_0x28269e){return db[_0xd7b4('0x2c')]['describe']()[_0xd7b4('0x27')](respondWithResult(_0x28269e,null))[_0xd7b4('0x46')](handleError(_0x28269e,null));};function wrapUser(_0x56e356){return function(_0x2ab0c6){var _0x18e692=_0x56e356[_0xd7b4('0x4d')]({'plain':!![]});_0x18e692['messages']=[];if(_0x2ab0c6){_0x18e692[_0xd7b4('0x4e')]=_0x2ab0c6[_0xd7b4('0x4f')];_0x18e692['lastMessage']=_0x2ab0c6;}else{_0x18e692[_0xd7b4('0x4e')]=moment(0x0)[_0xd7b4('0x50')](_0xd7b4('0x51'));_0x18e692['lastMessage']={};}return _0x18e692;};}exports[_0xd7b4('0x52')]=function(_0x1ce51a,_0x35d294,_0x37ffe4){var _0x3798de=[];return db['User'][_0xd7b4('0x44')]({'where':{'role':['agent','admin',_0xd7b4('0x53')]},'attributes':['id',_0xd7b4('0x54'),_0xd7b4('0x2b'),_0xd7b4('0x55'),'userpic',_0xd7b4('0x56'),_0xd7b4('0x57'),'lastLoginAt',_0xd7b4('0x58'),_0xd7b4('0x59')],'order':qs[_0xd7b4('0x3b')]('-online'),'include':[{'model':db[_0xd7b4('0x5a')],'as':'VoiceQueues','attributes':['id',_0xd7b4('0x2b'),_0xd7b4('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x56ad88){if(_0x56ad88){var _0x3ddc1b=_0x1ce51a[_0xd7b4('0x53')][_0xd7b4('0x4d')]({'plain':!![]});if(!_0x3ddc1b)throw new Error(_0xd7b4('0x5b'));if(_0x3ddc1b[_0xd7b4('0x55')]===_0xd7b4('0x53')){return db['UserProfileSection'][_0xd7b4('0x48')]({'where':{'name':_0xd7b4('0x5c'),'userProfileId':_0x3ddc1b[_0xd7b4('0x5d')]},'raw':!![]})['then'](function(_0x5612c0){if(_0x5612c0){if(_0x5612c0[_0xd7b4('0x5e')]===0x0){return db['UserProfileResource'][_0xd7b4('0x44')]({'where':{'sectionId':_0x5612c0['id']},'raw':!![]})['then'](function(_0x37a63a){var _0x222abb=[];if(_[_0xd7b4('0x5f')](_0x37a63a)){_0x222abb=_['filter'](_0x56ad88,function(_0xe60cdc){if(_0xe60cdc[_0xd7b4('0x55')]!==_0xd7b4('0x60')){return _0xe60cdc;}});return _0x222abb;}else{for(var _0x4a017d=0x0;_0x4a017d<_0x56ad88[_0xd7b4('0x38')];_0x4a017d++){var _0x2da4e6=_0x56ad88[_0x4a017d];if(_0x2da4e6[_0xd7b4('0x55')]===_0xd7b4('0x60')){var _0x1a0e77=_[_0xd7b4('0x48')](_0x37a63a,function(_0x537eeb){return _0x537eeb['resourceId']===_0x2da4e6['id'];});if(_0x1a0e77)_0x222abb[_0xd7b4('0x61')](_0x2da4e6);}else{_0x222abb[_0xd7b4('0x61')](_0x2da4e6);}}return _0x222abb;}});}else{return _0x56ad88;}}else{var _0x5549b2=_[_0xd7b4('0x3e')](_0x56ad88,function(_0x1ab0c8){if(_0x1ab0c8[_0xd7b4('0x55')]!==_0xd7b4('0x60')){return _0x1ab0c8;}});return _0x5549b2;}});}else{return _0x56ad88;}}})[_0xd7b4('0x27')](function(_0x1cfcdc){var _0x48e7cd=[];if(_0x1cfcdc){_0x3798de=_0x1cfcdc;for(var _0x28ac62=0x0;_0x28ac62<_0x1cfcdc['length'];_0x28ac62+=0x1){_0x3798de[_0x28ac62][_0xd7b4('0x62')]=[];_0x48e7cd[_0xd7b4('0x61')](db[_0xd7b4('0x2c')]['find']({'where':{'FromId':[_0x1ce51a[_0xd7b4('0x53')]['id'],_0x1cfcdc[_0x28ac62]['id']],'ToId':[_0x1ce51a[_0xd7b4('0x53')]['id'],_0x1cfcdc[_0x28ac62]['id']],'ChatGroupId':null},'attributes':['id',_0xd7b4('0x4f'),_0xd7b4('0x63'),'ToId',_0xd7b4('0x64'),_0xd7b4('0x4a')],'order':qs[_0xd7b4('0x3b')](_0xd7b4('0x65')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xd7b4('0x27')](wrapUser(_0x1cfcdc[_0x28ac62])));}return BPromise[_0xd7b4('0x66')](_0x48e7cd);}return[];})[_0xd7b4('0x27')](function(_0x5a2eba){return{'rows':_0x5a2eba,'count':_0x5a2eba[_0xd7b4('0x38')]};})[_0xd7b4('0x27')](respondWithResult(_0x35d294,null))[_0xd7b4('0x46')](handleError(_0x35d294,null));};
\ No newline at end of file
+var _0x2d48=['destroy','error','stack','name','send','index','ChatInternalMessage','rawAttributes','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','rows','includeAll','include','create','body','catch','find','params','describe','get','messages','lastMessageAt','lastMessage','YYYY-MM-DD\x20HH:mm:ss','User','findAll','agent','admin','fullname','role','userpic','internal','lastLoginAt','allowmessenger','-online','VoiceQueues','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','resourceId','push','FromId','ToId','-createdAt','all','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','fs-extra','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then'];(function(_0x9e56ea,_0x24b70d){var _0x8dc669=function(_0x192796){while(--_0x192796){_0x9e56ea['push'](_0x9e56ea['shift']());}};_0x8dc669(++_0x24b70d);}(_0x2d48,0x189));var _0x82d4=function(_0x1fbc6d,_0x59e4af){_0x1fbc6d=_0x1fbc6d-0x0;var _0x1c702e=_0x2d48[_0x1fbc6d];return _0x1c702e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x82d4('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x82d4('0x1'));var rp=require(_0x82d4('0x2'));var moment=require(_0x82d4('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x82d4('0x4'));var util=require(_0x82d4('0x5'));var path=require(_0x82d4('0x6'));var sox=require('sox');var csv=require(_0x82d4('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x82d4('0x8'));var _=require('lodash');var squel=require(_0x82d4('0x9'));var crypto=require(_0x82d4('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x82d4('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x82d4('0xc'));var Redis=require(_0x82d4('0xd'));var authService=require(_0x82d4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x82d4('0xf'));var hardwareService=require(_0x82d4('0x10'));var logger=require(_0x82d4('0x11'))(_0x82d4('0x12'));var utils=require('../../config/utils');var config=require(_0x82d4('0x13'));var licenseUtil=require(_0x82d4('0x14'));var db=require(_0x82d4('0x15'))['db'];config['redis']=_['defaults'](config[_0x82d4('0x16')],{'host':_0x82d4('0x17'),'port':0x18eb});var socket=require(_0x82d4('0x18'))(new Redis(config[_0x82d4('0x16')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithStatusCode(_0x31cb42,_0x28714e){_0x28714e=_0x28714e||0xcc;return function(_0x4faf1f){if(_0x4faf1f){return _0x31cb42[_0x82d4('0x19')](_0x28714e);}return _0x31cb42[_0x82d4('0x1a')](_0x28714e)[_0x82d4('0x1b')]();};}function respondWithResult(_0xc08a01,_0x1defb3){_0x1defb3=_0x1defb3||0xc8;return function(_0x33836e){if(_0x33836e){return _0xc08a01['status'](_0x1defb3)['json'](_0x33836e);}};}function respondWithFilteredResult(_0x4926b9,_0x5893b8){return function(_0x196b5e){if(_0x196b5e){var _0x1bbb1f=typeof _0x5893b8[_0x82d4('0x1c')]===_0x82d4('0x1d')&&typeof _0x5893b8[_0x82d4('0x1e')]===_0x82d4('0x1d');var _0x2516c4=_0x196b5e[_0x82d4('0x1f')];var _0x4c8906=_0x1bbb1f?0x0:_0x5893b8[_0x82d4('0x1c')];var _0x592467=_0x1bbb1f?_0x196b5e['count']:_0x5893b8[_0x82d4('0x1c')]+_0x5893b8[_0x82d4('0x1e')];var _0x52c8d5;if(_0x592467>=_0x2516c4){_0x592467=_0x2516c4;_0x52c8d5=0xc8;}else{_0x52c8d5=0xce;}_0x4926b9['status'](_0x52c8d5);return _0x4926b9[_0x82d4('0x20')](_0x82d4('0x21'),_0x4c8906+'-'+_0x592467+'/'+_0x2516c4)[_0x82d4('0x22')](_0x196b5e);}return null;};}function patchUpdates(_0x2ddbd0){return function(_0x426d7f){try{jsonpatch[_0x82d4('0x23')](_0x426d7f,_0x2ddbd0,!![]);}catch(_0x30955d){return BPromise['reject'](_0x30955d);}return _0x426d7f[_0x82d4('0x24')]();};}function saveUpdates(_0x342d27,_0x1252b5){return function(_0x2ab603){if(_0x2ab603){return _0x2ab603[_0x82d4('0x25')](_0x342d27)[_0x82d4('0x26')](function(_0x1feab5){return _0x1feab5;});}return null;};}function removeEntity(_0x597b72,_0x3e1f2b){return function(_0x176c54){if(_0x176c54){return _0x176c54[_0x82d4('0x27')]()[_0x82d4('0x26')](function(){_0x597b72['status'](0xcc)[_0x82d4('0x1b')]();});}};}function handleEntityNotFound(_0x4242d4,_0x5d3798){return function(_0x57f6cc){if(!_0x57f6cc){_0x4242d4[_0x82d4('0x19')](0x194);}return _0x57f6cc;};}function handleError(_0x186342,_0x30ad3e){_0x30ad3e=_0x30ad3e||0x1f4;return function(_0x2284c1){logger[_0x82d4('0x28')](_0x2284c1[_0x82d4('0x29')]);if(_0x2284c1[_0x82d4('0x2a')]){delete _0x2284c1['name'];}_0x186342[_0x82d4('0x1a')](_0x30ad3e)[_0x82d4('0x2b')](_0x2284c1);};}exports[_0x82d4('0x2c')]=function(_0x353bca,_0x4a2898){var _0xead602={},_0x4e1fbc={},_0x39818c={'count':0x0,'rows':[]};var _0x2db76a=_['map'](db[_0x82d4('0x2d')][_0x82d4('0x2e')],function(_0x5f76b2){return{'name':_0x5f76b2['fieldName'],'type':_0x5f76b2[_0x82d4('0x2f')][_0x82d4('0x30')]};});_0x4e1fbc[_0x82d4('0x31')]=_[_0x82d4('0x32')](_0x2db76a,_0x82d4('0x2a'));_0x4e1fbc['query']=_[_0x82d4('0x33')](_0x353bca['query']);_0x4e1fbc[_0x82d4('0x34')]=_[_0x82d4('0x35')](_0x4e1fbc[_0x82d4('0x31')],_0x4e1fbc[_0x82d4('0x36')]);_0xead602['attributes']=_[_0x82d4('0x35')](_0x4e1fbc[_0x82d4('0x31')],qs[_0x82d4('0x37')](_0x353bca['query']['fields']));_0xead602[_0x82d4('0x38')]=_0xead602['attributes'][_0x82d4('0x39')]?_0xead602['attributes']:_0x4e1fbc[_0x82d4('0x31')];if(!_0x353bca[_0x82d4('0x36')][_0x82d4('0x3a')](_0x82d4('0x3b'))){_0xead602[_0x82d4('0x1e')]=qs[_0x82d4('0x1e')](_0x353bca['query'][_0x82d4('0x1e')]);_0xead602['offset']=qs[_0x82d4('0x1c')](_0x353bca[_0x82d4('0x36')][_0x82d4('0x1c')]);}_0xead602[_0x82d4('0x3c')]=qs[_0x82d4('0x3d')](_0x353bca['query'][_0x82d4('0x3d')]);_0xead602[_0x82d4('0x3e')]=qs[_0x82d4('0x34')](_[_0x82d4('0x3f')](_0x353bca[_0x82d4('0x36')],_0x4e1fbc[_0x82d4('0x34')]),_0x2db76a);if(_0x353bca[_0x82d4('0x36')][_0x82d4('0x40')]){_0xead602[_0x82d4('0x3e')]=_[_0x82d4('0x41')](_0xead602[_0x82d4('0x3e')],{'$or':_['map'](_0x2db76a,function(_0x2e98cb){if(_0x2e98cb[_0x82d4('0x2f')]!==_0x82d4('0x42')){var _0x5c1831={};_0x5c1831[_0x2e98cb[_0x82d4('0x2a')]]={'$like':'%'+_0x353bca[_0x82d4('0x36')][_0x82d4('0x40')]+'%'};return _0x5c1831;}})});}_0xead602=_['merge']({},_0xead602,_0x353bca[_0x82d4('0x43')]);var _0x59a017={'where':_0xead602['where']};return db['ChatInternalMessage'][_0x82d4('0x1f')](_0x59a017)[_0x82d4('0x26')](function(_0x528291){_0x39818c[_0x82d4('0x1f')]=_0x528291;if(_0x353bca[_0x82d4('0x36')]['includeAll']){_0xead602['include']=[{'all':!![]}];}return db[_0x82d4('0x2d')]['findAll'](_0xead602);})[_0x82d4('0x26')](function(_0x48a9ba){_0x39818c[_0x82d4('0x44')]=_0x48a9ba;return _0x39818c;})[_0x82d4('0x26')](respondWithFilteredResult(_0x4a2898,_0xead602))['catch'](handleError(_0x4a2898,null));};exports['show']=function(_0x1fb171,_0x4373a4){var _0x34d0e8={'raw':!![],'where':{'id':_0x1fb171['params']['id']}},_0x2f88f6={};_0x2f88f6[_0x82d4('0x31')]=_[_0x82d4('0x33')](db[_0x82d4('0x2d')][_0x82d4('0x2e')]);_0x2f88f6['query']=_[_0x82d4('0x33')](_0x1fb171['query']);_0x2f88f6['filters']=_[_0x82d4('0x35')](_0x2f88f6[_0x82d4('0x31')],_0x2f88f6[_0x82d4('0x36')]);_0x34d0e8[_0x82d4('0x38')]=_[_0x82d4('0x35')](_0x2f88f6[_0x82d4('0x31')],qs[_0x82d4('0x37')](_0x1fb171[_0x82d4('0x36')][_0x82d4('0x37')]));_0x34d0e8['attributes']=_0x34d0e8['attributes'][_0x82d4('0x39')]?_0x34d0e8[_0x82d4('0x38')]:_0x2f88f6[_0x82d4('0x31')];if(_0x1fb171['query'][_0x82d4('0x45')]){_0x34d0e8[_0x82d4('0x46')]=[{'all':!![]}];}_0x34d0e8=_[_0x82d4('0x41')]({},_0x34d0e8,_0x1fb171[_0x82d4('0x43')]);return db['ChatInternalMessage']['find'](_0x34d0e8)['then'](handleEntityNotFound(_0x4373a4,null))[_0x82d4('0x26')](respondWithResult(_0x4373a4,null))['catch'](handleError(_0x4373a4,null));};exports[_0x82d4('0x47')]=function(_0x57ba21,_0x465c0c){return db[_0x82d4('0x2d')]['create'](_0x57ba21[_0x82d4('0x48')],{})[_0x82d4('0x26')](respondWithResult(_0x465c0c,0xc9))[_0x82d4('0x49')](handleError(_0x465c0c,null));};exports['update']=function(_0x378d5c,_0x360780){if(_0x378d5c['body']['id']){delete _0x378d5c['body']['id'];}return db['ChatInternalMessage'][_0x82d4('0x4a')]({'where':{'id':_0x378d5c[_0x82d4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x360780,null))[_0x82d4('0x26')](saveUpdates(_0x378d5c[_0x82d4('0x48')],null))[_0x82d4('0x26')](respondWithResult(_0x360780,null))[_0x82d4('0x49')](handleError(_0x360780,null));};exports[_0x82d4('0x27')]=function(_0x15b66d,_0x25d646){return db['ChatInternalMessage'][_0x82d4('0x4a')]({'where':{'id':_0x15b66d[_0x82d4('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25d646,null))['then'](removeEntity(_0x25d646,null))[_0x82d4('0x49')](handleError(_0x25d646,null));};exports['describe']=function(_0x41caef,_0x109704){return db[_0x82d4('0x2d')][_0x82d4('0x4c')]()[_0x82d4('0x26')](respondWithResult(_0x109704,null))[_0x82d4('0x49')](handleError(_0x109704,null));};function wrapUser(_0x48300e){return function(_0x133d0e){var _0x120f3f=_0x48300e[_0x82d4('0x4d')]({'plain':!![]});_0x120f3f[_0x82d4('0x4e')]=[];if(_0x133d0e){_0x120f3f[_0x82d4('0x4f')]=_0x133d0e['createdAt'];_0x120f3f[_0x82d4('0x50')]=_0x133d0e;}else{_0x120f3f['lastMessageAt']=moment(0x0)['format'](_0x82d4('0x51'));_0x120f3f['lastMessage']={};}return _0x120f3f;};}exports['getUsers']=function(_0x16d40b,_0x400cff,_0x12600c){var _0x4f0118=[];return db[_0x82d4('0x52')][_0x82d4('0x53')]({'where':{'role':[_0x82d4('0x54'),_0x82d4('0x55'),'user']},'attributes':['id',_0x82d4('0x56'),_0x82d4('0x2a'),_0x82d4('0x57'),_0x82d4('0x58'),_0x82d4('0x59'),'online',_0x82d4('0x5a'),_0x82d4('0x5b'),'showWebBar'],'order':qs[_0x82d4('0x3d')](_0x82d4('0x5c')),'include':[{'model':db['VoiceQueue'],'as':_0x82d4('0x5d'),'attributes':['id',_0x82d4('0x2a'),_0x82d4('0x2f')],'through':{'attributes':[]}}]})['then'](function(_0x17b94a){if(_0x17b94a){var _0x3cfb5f=_0x16d40b[_0x82d4('0x5e')][_0x82d4('0x4d')]({'plain':!![]});if(!_0x3cfb5f)throw new Error(_0x82d4('0x5f'));if(_0x3cfb5f[_0x82d4('0x57')]===_0x82d4('0x5e')){return db[_0x82d4('0x60')][_0x82d4('0x4a')]({'where':{'name':_0x82d4('0x61'),'userProfileId':_0x3cfb5f[_0x82d4('0x62')]},'raw':!![]})['then'](function(_0x3b580c){if(_0x3b580c){if(_0x3b580c[_0x82d4('0x63')]===0x0){return db[_0x82d4('0x64')][_0x82d4('0x53')]({'where':{'sectionId':_0x3b580c['id']},'raw':!![]})[_0x82d4('0x26')](function(_0x27a5fd){var _0x29cb36=[];if(_[_0x82d4('0x65')](_0x27a5fd)){_0x29cb36=_[_0x82d4('0x40')](_0x17b94a,function(_0x348394){if(_0x348394[_0x82d4('0x57')]!==_0x82d4('0x54')){return _0x348394;}});return _0x29cb36;}else{for(var _0x299d7c=0x0;_0x299d7c<_0x17b94a[_0x82d4('0x39')];_0x299d7c++){var _0x80da31=_0x17b94a[_0x299d7c];if(_0x80da31[_0x82d4('0x57')]===_0x82d4('0x54')){var _0x2abe2e=_[_0x82d4('0x4a')](_0x27a5fd,function(_0x5b1bff){return _0x5b1bff[_0x82d4('0x66')]===_0x80da31['id'];});if(_0x2abe2e)_0x29cb36['push'](_0x80da31);}else{_0x29cb36[_0x82d4('0x67')](_0x80da31);}}return _0x29cb36;}});}else{return _0x17b94a;}}else{var _0x48d9af=_[_0x82d4('0x40')](_0x17b94a,function(_0x5f31c9){if(_0x5f31c9[_0x82d4('0x57')]!==_0x82d4('0x54')){return _0x5f31c9;}});return _0x48d9af;}});}else{return _0x17b94a;}}})[_0x82d4('0x26')](function(_0x3468b6){var _0x510c7e=[];if(_0x3468b6){_0x4f0118=_0x3468b6;for(var _0x32a38f=0x0;_0x32a38f<_0x3468b6[_0x82d4('0x39')];_0x32a38f+=0x1){_0x4f0118[_0x32a38f][_0x82d4('0x4e')]=[];_0x510c7e[_0x82d4('0x67')](db['ChatInternalMessage'][_0x82d4('0x4a')]({'where':{'FromId':[_0x16d40b[_0x82d4('0x5e')]['id'],_0x3468b6[_0x32a38f]['id']],'ToId':[_0x16d40b[_0x82d4('0x5e')]['id'],_0x3468b6[_0x32a38f]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x82d4('0x68'),_0x82d4('0x69'),'read',_0x82d4('0x48')],'order':qs[_0x82d4('0x3d')](_0x82d4('0x6a')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x82d4('0x26')](wrapUser(_0x3468b6[_0x32a38f])));}return BPromise[_0x82d4('0x6b')](_0x510c7e);}return[];})[_0x82d4('0x26')](function(_0x4d7e81){return{'rows':_0x4d7e81,'count':_0x4d7e81[_0x82d4('0x39')]};})[_0x82d4('0x26')](respondWithResult(_0x400cff,null))['catch'](handleError(_0x400cff,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index be69a73..edea5b8 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 _0x90ad=['events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x416468,_0x2e7a72){var _0x2ee9b7=function(_0xf354ce){while(--_0xf354ce){_0x416468['push'](_0x416468['shift']());}};_0x2ee9b7(++_0x2e7a72);}(_0x90ad,0x195));var _0xd90a=function(_0x45e98e,_0x169b60){_0x45e98e=_0x45e98e-0x0;var _0x374dba=_0x90ad[_0x45e98e];return _0x374dba;};'use strict';var EventEmitter=require(_0xd90a('0x0'));var ChatInternalMessage=require(_0xd90a('0x1'))['db'][_0xd90a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xd90a('0x3')](0x0);var events={'afterCreate':_0xd90a('0x4'),'afterUpdate':'update','afterDestroy':_0xd90a('0x5')};function emitEvent(_0x844190){return function(_0x45e9f3,_0x5e9622,_0x2691eb){ChatInternalMessageEvents['emit'](_0x844190+':'+_0x45e9f3['id'],_0x45e9f3);ChatInternalMessageEvents[_0xd90a('0x6')](_0x844190,_0x45e9f3);_0x2691eb(null);};}for(var e in events){if(events[_0xd90a('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xd90a('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x713e=['hasOwnProperty','hook','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','update','emit'];(function(_0x478414,_0xcf142d){var _0x5eb6b9=function(_0x10e6fe){while(--_0x10e6fe){_0x478414['push'](_0x478414['shift']());}};_0x5eb6b9(++_0xcf142d);}(_0x713e,0x147));var _0xe713=function(_0x4b0be5,_0x1ed1aa){_0x4b0be5=_0x4b0be5-0x0;var _0x4b2c39=_0x713e[_0x4b0be5];return _0x4b2c39;};'use strict';var EventEmitter=require(_0xe713('0x0'));var ChatInternalMessage=require(_0xe713('0x1'))['db'][_0xe713('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xe713('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe713('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3b445c){return function(_0x2db85b,_0x508928,_0x3d8012){ChatInternalMessageEvents[_0xe713('0x5')](_0x3b445c+':'+_0x2db85b['id'],_0x2db85b);ChatInternalMessageEvents['emit'](_0x3b445c,_0x2db85b);_0x3d8012(null);};}for(var e in events){if(events[_0xe713('0x6')](e)){var event=events[e];ChatInternalMessage[_0xe713('0x7')](e,emitEvent(event));}}module[_0xe713('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 f09d21a..a5ae1a4 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 _0x95bf=['define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','exports'];(function(_0x19a033,_0x232dca){var _0x4fcc51=function(_0x1a739a){while(--_0x1a739a){_0x19a033['push'](_0x19a033['shift']());}};_0x4fcc51(++_0x232dca);}(_0x95bf,0x154));var _0xf95b=function(_0x18d9ad,_0x43470d){_0x18d9ad=_0x18d9ad-0x0;var _0x3f8261=_0x95bf[_0x18d9ad];return _0x3f8261;};'use strict';var _=require(_0xf95b('0x0'));var util=require(_0xf95b('0x1'));var logger=require(_0xf95b('0x2'))(_0xf95b('0x3'));var moment=require(_0xf95b('0x4'));var BPromise=require('bluebird');var rp=require(_0xf95b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf95b('0x6'));var config=require(_0xf95b('0x7'));var attributes=require(_0xf95b('0x8'));module[_0xf95b('0x9')]=function(_0x2c9c58,_0x22782e){return _0x2c9c58[_0xf95b('0xa')](_0xf95b('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf95b('0xc'),'collate':_0xf95b('0xd')});};
\ No newline at end of file
+var _0x265a=['../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x25e6e9,_0x1a67dd){var _0x10fa00=function(_0x46b348){while(--_0x46b348){_0x25e6e9['push'](_0x25e6e9['shift']());}};_0x10fa00(++_0x1a67dd);}(_0x265a,0x10d));var _0xa265=function(_0x2bf718,_0x505c23){_0x2bf718=_0x2bf718-0x0;var _0x6cc4ef=_0x265a[_0x2bf718];return _0x6cc4ef;};'use strict';var _=require('lodash');var util=require(_0xa265('0x0'));var logger=require(_0xa265('0x1'))('api');var moment=require(_0xa265('0x2'));var BPromise=require(_0xa265('0x3'));var rp=require(_0xa265('0x4'));var fs=require('fs');var path=require(_0xa265('0x5'));var rimraf=require(_0xa265('0x6'));var config=require(_0xa265('0x7'));var attributes=require(_0xa265('0x8'));module[_0xa265('0x9')]=function(_0x5916e2,_0x4ae662){return _0x5916e2[_0xa265('0xa')](_0xa265('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 1c45417..281e93d 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 _0xa849=['register','request','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatInternalMessage.socket'];(function(_0x37f579,_0x394cfe){var _0xdaf138=function(_0x518fa1){while(--_0x518fa1){_0x37f579['push'](_0x37f579['shift']());}};_0xdaf138(++_0x394cfe);}(_0xa849,0x106));var _0x9a84=function(_0x4746be,_0x14d1ec){_0x4746be=_0x4746be-0x0;var _0x3fb821=_0xa849[_0x4746be];return _0x3fb821;};'use strict';var _=require(_0x9a84('0x0'));var util=require(_0x9a84('0x1'));var moment=require('moment');var BPromise=require(_0x9a84('0x2'));var rs=require(_0x9a84('0x3'));var fs=require('fs');var Redis=require(_0x9a84('0x4'));var db=require(_0x9a84('0x5'))['db'];var utils=require(_0x9a84('0x6'));var logger=require(_0x9a84('0x7'))(_0x9a84('0x8'));var config=require(_0x9a84('0x9'));var jayson=require(_0x9a84('0xa'));var client=jayson[_0x9a84('0xb')][_0x9a84('0xc')]({'port':0x232a});config[_0x9a84('0xd')]=_[_0x9a84('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x9a84('0xf'))(new Redis(config[_0x9a84('0xd')]));require(_0x9a84('0x10'))[_0x9a84('0x11')](socket);function respondWithRpcPromise(_0x4fe52b,_0x694848,_0x1c0033){return new BPromise(function(_0x45e924,_0xb032b4){return client[_0x9a84('0x12')](_0x4fe52b,_0x1c0033)[_0x9a84('0x13')](function(_0x305bae){logger[_0x9a84('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x694848,_0x9a84('0x15'));logger[_0x9a84('0x16')](_0x9a84('0x17'),_0x694848,_0x9a84('0x15'),JSON[_0x9a84('0x18')](_0x305bae));if(_0x305bae['error']){if(_0x305bae[_0x9a84('0x19')][_0x9a84('0x1a')]===0x1f4){logger[_0x9a84('0x19')](_0x9a84('0x1b'),_0x694848,_0x305bae[_0x9a84('0x19')][_0x9a84('0x1c')]);return _0xb032b4(_0x305bae['error']['message']);}logger[_0x9a84('0x19')](_0x9a84('0x1b'),_0x694848,_0x305bae[_0x9a84('0x19')][_0x9a84('0x1c')]);return _0x45e924(_0x305bae[_0x9a84('0x19')][_0x9a84('0x1c')]);}else{logger[_0x9a84('0x14')](_0x9a84('0x1b'),_0x694848,_0x9a84('0x15'));_0x45e924(_0x305bae[_0x9a84('0x1d')]['message']);}})[_0x9a84('0x1e')](function(_0xff810e){logger[_0x9a84('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x694848,_0xff810e);_0xb032b4(_0xff810e);});});}
\ No newline at end of file
+var _0x80bf=['redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','request','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','message','result','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4a2346,_0x354e69){var _0xdb2753=function(_0x1ecc9b){while(--_0x1ecc9b){_0x4a2346['push'](_0x4a2346['shift']());}};_0xdb2753(++_0x354e69);}(_0x80bf,0x148));var _0xf80b=function(_0x1d451d,_0x19fa31){_0x1d451d=_0x1d451d-0x0;var _0x33805e=_0x80bf[_0x1d451d];return _0x33805e;};'use strict';var _=require(_0xf80b('0x0'));var util=require(_0xf80b('0x1'));var moment=require('moment');var BPromise=require(_0xf80b('0x2'));var rs=require(_0xf80b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf80b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf80b('0x5'))('rpc');var config=require(_0xf80b('0x6'));var jayson=require(_0xf80b('0x7'));var client=jayson['client']['http']({'port':0x232a});config[_0xf80b('0x8')]=_['defaults'](config[_0xf80b('0x8')],{'host':_0xf80b('0x9'),'port':0x18eb});var socket=require(_0xf80b('0xa'))(new Redis(config[_0xf80b('0x8')]));require(_0xf80b('0xb'))[_0xf80b('0xc')](socket);function respondWithRpcPromise(_0x28441e,_0x2c8a31,_0x55cb46){return new BPromise(function(_0x58445e,_0x44edf6){return client[_0xf80b('0xd')](_0x28441e,_0x55cb46)['then'](function(_0x5ed460){logger[_0xf80b('0xe')](_0xf80b('0xf'),_0x2c8a31,_0xf80b('0x10'));logger['debug'](_0xf80b('0x11'),_0x2c8a31,_0xf80b('0x10'),JSON['stringify'](_0x5ed460));if(_0x5ed460[_0xf80b('0x12')]){if(_0x5ed460[_0xf80b('0x12')]['code']===0x1f4){logger[_0xf80b('0x12')](_0xf80b('0xf'),_0x2c8a31,_0x5ed460['error'][_0xf80b('0x13')]);return _0x44edf6(_0x5ed460[_0xf80b('0x12')][_0xf80b('0x13')]);}logger[_0xf80b('0x12')](_0xf80b('0xf'),_0x2c8a31,_0x5ed460[_0xf80b('0x12')][_0xf80b('0x13')]);return _0x58445e(_0x5ed460['error']['message']);}else{logger[_0xf80b('0xe')](_0xf80b('0xf'),_0x2c8a31,'request\x20sent');_0x58445e(_0x5ed460[_0xf80b('0x14')]['message']);}})['catch'](function(_0x6f2d4b){logger[_0xf80b('0x12')](_0xf80b('0xf'),_0x2c8a31,_0x6f2d4b);_0x44edf6(_0x6f2d4b);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index 9ef1d75..b3ff617 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 _0x12a2=['./chatInternalMessage.events','update','emit','removeListener','register'];(function(_0x4873d6,_0x69d7ee){var _0x54d3e9=function(_0x230bd8){while(--_0x230bd8){_0x4873d6['push'](_0x4873d6['shift']());}};_0x54d3e9(++_0x69d7ee);}(_0x12a2,0xb9));var _0x212a=function(_0x5a32ee,_0x5604f1){_0x5a32ee=_0x5a32ee-0x0;var _0x447948=_0x12a2[_0x5a32ee];return _0x447948;};'use strict';var ChatInternalMessageEvents=require(_0x212a('0x0'));var events=['save','remove',_0x212a('0x1')];function createListener(_0x14a895,_0x59db37){return function(_0x977524){_0x59db37[_0x212a('0x2')](_0x14a895,_0x977524);};}function removeListener(_0x12ff77,_0x4769b0){return function(){ChatInternalMessageEvents[_0x212a('0x3')](_0x12ff77,_0x4769b0);};}exports[_0x212a('0x4')]=function(_0x5b082e){for(var _0x34c31e=0x0,_0x254f4b=events['length'];_0x34c31e<_0x254f4b;_0x34c31e++){var _0x371261=events[_0x34c31e];var _0x3aaa21=createListener('chatInternalMessage:'+_0x371261,_0x5b082e);ChatInternalMessageEvents['on'](_0x371261,_0x3aaa21);}};
\ No newline at end of file
+var _0xa323=['emit','register','chatInternalMessage:','save','remove','update'];(function(_0x2ac5f8,_0x4c3a9f){var _0x3b8229=function(_0x46a3c0){while(--_0x46a3c0){_0x2ac5f8['push'](_0x2ac5f8['shift']());}};_0x3b8229(++_0x4c3a9f);}(_0xa323,0x183));var _0x3a32=function(_0x323413,_0x421d63){_0x323413=_0x323413-0x0;var _0xe2aca0=_0xa323[_0x323413];return _0xe2aca0;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x3a32('0x0'),_0x3a32('0x1'),_0x3a32('0x2')];function createListener(_0x375365,_0x2e7c6d){return function(_0x52da16){_0x2e7c6d[_0x3a32('0x3')](_0x375365,_0x52da16);};}function removeListener(_0x2a24e8,_0xbfe564){return function(){ChatInternalMessageEvents['removeListener'](_0x2a24e8,_0xbfe564);};}exports[_0x3a32('0x4')]=function(_0x27f9fb){for(var _0x449f3c=0x0,_0x11ee52=events['length'];_0x449f3c<_0x11ee52;_0x449f3c++){var _0x199b99=events[_0x449f3c];var _0x5be84b=createListener(_0x3a32('0x5')+_0x199b99,_0x27f9fb);ChatInternalMessageEvents['on'](_0x199b99,_0x5be84b);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 7575b89..b2c184d 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 _0xc9af=['Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','multer','util'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xc9af,0x91));var _0xfc9a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xc9af[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xfc9a('0x0'));var util=require(_0xfc9a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfc9a('0x2')]();var fs_extra=require(_0xfc9a('0x3'));var auth=require(_0xfc9a('0x4'));var interaction=require(_0xfc9a('0x5'));var config=require(_0xfc9a('0x6'));var controller=require('./chatInternalMessage.controller');router[_0xfc9a('0x7')]('/',auth[_0xfc9a('0x8')](),controller[_0xfc9a('0x9')]);router[_0xfc9a('0x7')](_0xfc9a('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xfc9a('0xb'),auth[_0xfc9a('0x8')](),controller[_0xfc9a('0xc')]);router['get'](_0xfc9a('0xd'),auth[_0xfc9a('0x8')](),controller[_0xfc9a('0xe')]);router[_0xfc9a('0xf')]('/',auth[_0xfc9a('0x8')](),controller[_0xfc9a('0x10')]);router[_0xfc9a('0x11')](_0xfc9a('0xd'),controller[_0xfc9a('0x12')]);router[_0xfc9a('0x13')](_0xfc9a('0xd'),auth[_0xfc9a('0x8')](),controller[_0xfc9a('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x742d=['connect-timeout','express','Router','fs-extra','../../components/interaction/service','./chatInternalMessage.controller','get','isAuthenticated','/describe','describe','/users','getUsers','show','post','create','/:id','delete','destroy','exports','multer','util','path'];(function(_0x291601,_0x17810b){var _0x3f935a=function(_0x53ccb6){while(--_0x53ccb6){_0x291601['push'](_0x291601['shift']());}};_0x3f935a(++_0x17810b);}(_0x742d,0xc3));var _0xd742=function(_0x39d72e,_0xdf39d){_0x39d72e=_0x39d72e-0x0;var _0x317dd5=_0x742d[_0x39d72e];return _0x317dd5;};'use strict';var multer=require(_0xd742('0x0'));var util=require(_0xd742('0x1'));var path=require(_0xd742('0x2'));var timeout=require(_0xd742('0x3'));var express=require(_0xd742('0x4'));var router=express[_0xd742('0x5')]();var fs_extra=require(_0xd742('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xd742('0x7'));var config=require('../../config/environment');var controller=require(_0xd742('0x8'));router[_0xd742('0x9')]('/',auth[_0xd742('0xa')](),controller['index']);router['get'](_0xd742('0xb'),auth['isAuthenticated'](),controller[_0xd742('0xc')]);router[_0xd742('0x9')](_0xd742('0xd'),auth[_0xd742('0xa')](),controller[_0xd742('0xe')]);router[_0xd742('0x9')]('/:id',auth[_0xd742('0xa')](),controller[_0xd742('0xf')]);router[_0xd742('0x10')]('/',auth[_0xd742('0xa')](),controller[_0xd742('0x11')]);router['put'](_0xd742('0x12'),controller['update']);router[_0xd742('0x13')](_0xd742('0x12'),auth[_0xd742('0xa')](),controller[_0xd742('0x14')]);module[_0xd742('0x15')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 76db648..fdee405 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 _0xa45c=['TEXT','sequelize','exports','BOOLEAN','ENUM','out'];(function(_0x2de639,_0x3d4562){var _0x47ae92=function(_0x31912f){while(--_0x31912f){_0x2de639['push'](_0x2de639['shift']());}};_0x47ae92(++_0x3d4562);}(_0xa45c,0x6d));var _0xca45=function(_0x3d3cbc,_0x508a41){_0x3d3cbc=_0x3d3cbc-0x0;var _0x17cf61=_0xa45c[_0x3d3cbc];return _0x17cf61;};'use strict';var Sequelize=require(_0xca45('0x0'));module[_0xca45('0x1')]={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xca45('0x2')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xca45('0x3')]('in','out'),'defaultValue':_0xca45('0x4'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xca45('0x5')]}};
\ No newline at end of file
+var _0xb84e=['DATE','STRING','exports','TEXT','medium','BOOLEAN','out'];(function(_0x46edd0,_0xa811c3){var _0x3232d8=function(_0x45f66c){while(--_0x45f66c){_0x46edd0['push'](_0x46edd0['shift']());}};_0x3232d8(++_0xa811c3);}(_0xb84e,0xbf));var _0xeb84=function(_0x2283dc,_0x2fcfc5){_0x2283dc=_0x2283dc-0x0;var _0x16db90=_0xb84e[_0x2283dc];return _0x16db90;};'use strict';var Sequelize=require('sequelize');module[_0xeb84('0x0')]={'body':{'type':Sequelize[_0xeb84('0x1')](_0xeb84('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xeb84('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xeb84('0x4')),'defaultValue':_0xeb84('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0xeb84('0x5')]},'providerName':{'type':Sequelize[_0xeb84('0x6')]},'providerResponse':{'type':Sequelize[_0xeb84('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index e49834b..6efde0c 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 _0x8573=['length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','find','create','body','describe','chat-interactions','accept','chat','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','agent','ChatInteraction','ChatInteractionId','isNil','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','interaction','AcceptMessage','acceptMessage','ContactId','Sequelize','QueryTypes','SELECT','User','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','formData','null','RejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','sequelize','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','result','catch','sendStatus','status','json','offset','undefined','count','set','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index','ChatMessage','rawAttributes','fieldName','type','model','map','keys','filters','intersection','query','attributes','fields'];(function(_0x46ed5c,_0xec3675){var _0x42de09=function(_0x3e9818){while(--_0x3e9818){_0x46ed5c['push'](_0x46ed5c['shift']());}};_0x42de09(++_0xec3675);}(_0x8573,0xc1));var _0x3857=function(_0x256b18,_0x2cbe84){_0x256b18=_0x256b18-0x0;var _0x183933=_0x8573[_0x256b18];return _0x183933;};'use strict';var emlformat=require(_0x3857('0x0'));var rimraf=require(_0x3857('0x1'));var zipdir=require(_0x3857('0x2'));var jsonpatch=require(_0x3857('0x3'));var rp=require(_0x3857('0x4'));var moment=require(_0x3857('0x5'));var BPromise=require(_0x3857('0x6'));var Mustache=require(_0x3857('0x7'));var util=require('util');var path=require(_0x3857('0x8'));var sox=require(_0x3857('0x9'));var csv=require('to-csv');var ejs=require(_0x3857('0xa'));var fs=require('fs');var fs_extra=require(_0x3857('0xb'));var _=require(_0x3857('0xc'));var squel=require(_0x3857('0xd'));var crypto=require(_0x3857('0xe'));var jsforce=require(_0x3857('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3857('0x10'));var querystring=require('querystring');var Papa=require(_0x3857('0x11'));var Redis=require(_0x3857('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x3857('0x13'));var as=require(_0x3857('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3857('0x15'))(_0x3857('0x16'));var utils=require(_0x3857('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x3857('0x18'));var db=require(_0x3857('0x19'))['db'];config[_0x3857('0x1a')]=_[_0x3857('0x1b')](config['redis'],{'host':_0x3857('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3857('0x1a')]));require(_0x3857('0x1d'))[_0x3857('0x1e')](socket);var jayson=require(_0x3857('0x1f'));var client=jayson[_0x3857('0x20')][_0x3857('0x21')]({'port':0x232c});var client9002=jayson[_0x3857('0x20')][_0x3857('0x21')]({'port':0x232a});function respondWithRpcPromise(_0x460824,_0x230432,_0x53eb7e,_0x1ecb51){return new BPromise(function(_0x8eccf1,_0x1ff31b){var _0x449ebd=_0x1ecb51||client;return _0x449ebd[_0x3857('0x22')](_0x460824,_0x53eb7e)[_0x3857('0x23')](function(_0x42b5cb){logger['info'](_0x3857('0x24'),_0x230432,_0x3857('0x25'));logger[_0x3857('0x26')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x230432,'request\x20sent',JSON[_0x3857('0x27')](_0x42b5cb));if(_0x42b5cb['error']){if(_0x42b5cb[_0x3857('0x28')]['code']===0x1f4){logger[_0x3857('0x28')](_0x3857('0x24'),_0x230432,_0x42b5cb[_0x3857('0x28')]['message']);return _0x1ff31b(_0x42b5cb[_0x3857('0x28')][_0x3857('0x29')]);}logger[_0x3857('0x28')](_0x3857('0x24'),_0x230432,_0x42b5cb['error']['message']);return _0x8eccf1(_0x42b5cb[_0x3857('0x28')][_0x3857('0x29')]);}else{logger[_0x3857('0x2a')](_0x3857('0x24'),_0x230432,_0x3857('0x25'));_0x8eccf1(_0x42b5cb[_0x3857('0x2b')]['message']);}})[_0x3857('0x2c')](function(_0x2fd8e7){logger['error'](_0x3857('0x24'),_0x230432,_0x2fd8e7);_0x1ff31b(_0x2fd8e7);});});}function respondWithStatusCode(_0x151fed,_0x355b97){_0x355b97=_0x355b97||0xcc;return function(_0x5055c7){if(_0x5055c7){return _0x151fed[_0x3857('0x2d')](_0x355b97);}return _0x151fed[_0x3857('0x2e')](_0x355b97)['end']();};}function respondWithResult(_0x4cd9e7,_0xa68c60){_0xa68c60=_0xa68c60||0xc8;return function(_0x6bc743){if(_0x6bc743){return _0x4cd9e7[_0x3857('0x2e')](_0xa68c60)[_0x3857('0x2f')](_0x6bc743);}};}function respondWithFilteredResult(_0x399421,_0x3aec40){return function(_0x3edadc){if(_0x3edadc){var _0x59bcbd=typeof _0x3aec40[_0x3857('0x30')]===_0x3857('0x31')&&typeof _0x3aec40['limit']===_0x3857('0x31');var _0x17c8f8=_0x3edadc[_0x3857('0x32')];var _0x535469=_0x59bcbd?0x0:_0x3aec40[_0x3857('0x30')];var _0x10d9cb=_0x59bcbd?_0x3edadc['count']:_0x3aec40['offset']+_0x3aec40['limit'];var _0x3a0a76;if(_0x10d9cb>=_0x17c8f8){_0x10d9cb=_0x17c8f8;_0x3a0a76=0xc8;}else{_0x3a0a76=0xce;}_0x399421[_0x3857('0x2e')](_0x3a0a76);return _0x399421[_0x3857('0x33')](_0x3857('0x34'),_0x535469+'-'+_0x10d9cb+'/'+_0x17c8f8)['json'](_0x3edadc);}return null;};}function patchUpdates(_0x1ada66){return function(_0x536852){try{jsonpatch[_0x3857('0x35')](_0x536852,_0x1ada66,!![]);}catch(_0x22c605){return BPromise[_0x3857('0x36')](_0x22c605);}return _0x536852[_0x3857('0x37')]();};}function saveUpdates(_0x4b456e,_0x115266){return function(_0x18f8a2){if(_0x18f8a2){return _0x18f8a2[_0x3857('0x38')](_0x4b456e)[_0x3857('0x23')](function(_0x289ad1){return _0x289ad1;});}return null;};}function removeEntity(_0x2e643b,_0x4053f5){return function(_0x3a540d){if(_0x3a540d){return _0x3a540d[_0x3857('0x39')]()['then'](function(){_0x2e643b[_0x3857('0x2e')](0xcc)[_0x3857('0x3a')]();});}};}function handleEntityNotFound(_0x3151c6,_0x573f92){return function(_0x1becba){if(!_0x1becba){_0x3151c6[_0x3857('0x2d')](0x194);}return _0x1becba;};}function handleError(_0x5e5297,_0x480ee9){_0x480ee9=_0x480ee9||0x1f4;return function(_0x56ec1b){logger[_0x3857('0x28')](_0x56ec1b[_0x3857('0x3b')]);if(_0x56ec1b[_0x3857('0x3c')]){delete _0x56ec1b['name'];}_0x5e5297['status'](_0x480ee9)[_0x3857('0x3d')](_0x56ec1b);};}exports[_0x3857('0x3e')]=function(_0x125c4e,_0x515f0a){var _0xe805a3={},_0x5930c5={},_0x2b0955={'count':0x0,'rows':[]};var _0x2c61b8=_['map'](db[_0x3857('0x3f')][_0x3857('0x40')],function(_0x148da5){return{'name':_0x148da5[_0x3857('0x41')],'type':_0x148da5[_0x3857('0x42')]['key']};});_0x5930c5[_0x3857('0x43')]=_[_0x3857('0x44')](_0x2c61b8,_0x3857('0x3c'));_0x5930c5['query']=_[_0x3857('0x45')](_0x125c4e['query']);_0x5930c5[_0x3857('0x46')]=_[_0x3857('0x47')](_0x5930c5[_0x3857('0x43')],_0x5930c5[_0x3857('0x48')]);_0xe805a3[_0x3857('0x49')]=_['intersection'](_0x5930c5['model'],qs[_0x3857('0x4a')](_0x125c4e[_0x3857('0x48')][_0x3857('0x4a')]));_0xe805a3['attributes']=_0xe805a3[_0x3857('0x49')][_0x3857('0x4b')]?_0xe805a3[_0x3857('0x49')]:_0x5930c5[_0x3857('0x43')];if(!_0x125c4e[_0x3857('0x48')][_0x3857('0x4c')](_0x3857('0x4d'))){_0xe805a3[_0x3857('0x4e')]=qs[_0x3857('0x4e')](_0x125c4e['query'][_0x3857('0x4e')]);_0xe805a3[_0x3857('0x30')]=qs[_0x3857('0x30')](_0x125c4e['query'][_0x3857('0x30')]);}_0xe805a3[_0x3857('0x4f')]=qs[_0x3857('0x50')](_0x125c4e[_0x3857('0x48')][_0x3857('0x50')]);_0xe805a3[_0x3857('0x51')]=qs[_0x3857('0x46')](_[_0x3857('0x52')](_0x125c4e[_0x3857('0x48')],_0x5930c5[_0x3857('0x46')]),_0x2c61b8);if(_0x125c4e[_0x3857('0x48')][_0x3857('0x53')]){_0xe805a3[_0x3857('0x51')]=_[_0x3857('0x54')](_0xe805a3[_0x3857('0x51')],{'$or':_[_0x3857('0x44')](_0x2c61b8,function(_0x3071c7){if(_0x3071c7[_0x3857('0x42')]!==_0x3857('0x55')){var _0x249853={};_0x249853[_0x3071c7['name']]={'$like':'%'+_0x125c4e[_0x3857('0x48')][_0x3857('0x53')]+'%'};return _0x249853;}})});}_0xe805a3=_['merge']({},_0xe805a3,_0x125c4e[_0x3857('0x56')]);var _0x57f21e={'where':_0xe805a3[_0x3857('0x51')]};return db[_0x3857('0x3f')][_0x3857('0x32')](_0x57f21e)[_0x3857('0x23')](function(_0x2108ba){_0x2b0955['count']=_0x2108ba;if(_0x125c4e[_0x3857('0x48')][_0x3857('0x57')]){_0xe805a3['include']=[{'all':!![]}];}return db[_0x3857('0x3f')][_0x3857('0x58')](_0xe805a3);})[_0x3857('0x23')](function(_0x58cf7f){_0x2b0955[_0x3857('0x59')]=_0x58cf7f;return _0x2b0955;})[_0x3857('0x23')](respondWithFilteredResult(_0x515f0a,_0xe805a3))['catch'](handleError(_0x515f0a,null));};exports[_0x3857('0x5a')]=function(_0x2dae72,_0x397a6d){var _0x5eced9={'raw':!![],'where':{'id':_0x2dae72[_0x3857('0x5b')]['id']}},_0x2aaf3e={};_0x2aaf3e['model']=_[_0x3857('0x45')](db['ChatMessage'][_0x3857('0x40')]);_0x2aaf3e[_0x3857('0x48')]=_[_0x3857('0x45')](_0x2dae72[_0x3857('0x48')]);_0x2aaf3e[_0x3857('0x46')]=_[_0x3857('0x47')](_0x2aaf3e[_0x3857('0x43')],_0x2aaf3e['query']);_0x5eced9[_0x3857('0x49')]=_['intersection'](_0x2aaf3e['model'],qs[_0x3857('0x4a')](_0x2dae72[_0x3857('0x48')][_0x3857('0x4a')]));_0x5eced9['attributes']=_0x5eced9[_0x3857('0x49')][_0x3857('0x4b')]?_0x5eced9['attributes']:_0x2aaf3e['model'];if(_0x2dae72[_0x3857('0x48')][_0x3857('0x57')]){_0x5eced9['include']=[{'all':!![]}];}_0x5eced9=_[_0x3857('0x54')]({},_0x5eced9,_0x2dae72['options']);return db[_0x3857('0x3f')][_0x3857('0x5c')](_0x5eced9)[_0x3857('0x23')](handleEntityNotFound(_0x397a6d,null))['then'](respondWithResult(_0x397a6d,null))[_0x3857('0x2c')](handleError(_0x397a6d,null));};exports['create']=function(_0x28ee96,_0x4950b9){return db[_0x3857('0x3f')][_0x3857('0x5d')](_0x28ee96['body'],{})[_0x3857('0x23')](respondWithResult(_0x4950b9,0xc9))['catch'](handleError(_0x4950b9,null));};exports[_0x3857('0x38')]=function(_0x359dbe,_0x56f196){if(_0x359dbe[_0x3857('0x5e')]['id']){delete _0x359dbe[_0x3857('0x5e')]['id'];}return db[_0x3857('0x3f')][_0x3857('0x5c')]({'where':{'id':_0x359dbe['params']['id']}})[_0x3857('0x23')](handleEntityNotFound(_0x56f196,null))[_0x3857('0x23')](saveUpdates(_0x359dbe[_0x3857('0x5e')],null))[_0x3857('0x23')](respondWithResult(_0x56f196,null))[_0x3857('0x2c')](handleError(_0x56f196,null));};exports[_0x3857('0x39')]=function(_0x411f40,_0x5abe0c){return db[_0x3857('0x3f')][_0x3857('0x5c')]({'where':{'id':_0x411f40[_0x3857('0x5b')]['id']}})[_0x3857('0x23')](handleEntityNotFound(_0x5abe0c,null))[_0x3857('0x23')](removeEntity(_0x5abe0c,null))[_0x3857('0x2c')](handleError(_0x5abe0c,null));};exports[_0x3857('0x5f')]=function(_0x5944a1,_0x32ab2a){return db['ChatMessage'][_0x3857('0x5f')]()[_0x3857('0x23')](respondWithResult(_0x32ab2a,null))[_0x3857('0x2c')](handleError(_0x32ab2a,null));};var interaction_log=require(_0x3857('0x15'))(_0x3857('0x60'));exports[_0x3857('0x61')]=function(_0x5e562d,_0x208a49,_0x3b977e){var _0x2fd1fa={'agent':{},'channel':_0x3857('0x62')};if(_0x5e562d[_0x3857('0x5e')]['id']){delete _0x5e562d[_0x3857('0x5e')]['id'];}_0x5e562d[_0x3857('0x5e')]['read']=!![];_0x5e562d[_0x3857('0x5e')][_0x3857('0x63')]=moment()[_0x3857('0x64')](_0x3857('0x65'));_0x5e562d['body'][_0x3857('0x66')]=_0x5e562d[_0x3857('0x5e')][_0x3857('0x66')]||_0x5e562d['user']['id'];_0x2fd1fa[_0x3857('0x67')]['id']=_0x5e562d[_0x3857('0x5e')][_0x3857('0x66')];return db['ChatMessage'][_0x3857('0x5c')]({'where':{'id':_0x5e562d[_0x3857('0x5b')]['id'],'UserId':null}})[_0x3857('0x23')](handleEntityNotFound(_0x208a49,null))[_0x3857('0x23')](saveUpdates(_0x5e562d['body'],null))[_0x3857('0x23')](function(_0x50fd03){if(_0x50fd03){_0x2fd1fa[_0x3857('0x29')]=_0x50fd03['get']({'plain':!![]});return db[_0x3857('0x68')][_0x3857('0x5c')]({'where':{'id':_0x50fd03[_0x3857('0x69')]}});}return null;})[_0x3857('0x23')](handleEntityNotFound(_0x208a49,null))[_0x3857('0x23')](function(_0xb69f0b){if(_0xb69f0b){return _0xb69f0b['update']({'UserId':_0x5e562d[_0x3857('0x5e')]['UserId'],'read1stAt':_[_0x3857('0x6a')](_0xb69f0b['read1stAt'])?moment()[_0x3857('0x64')](_0x3857('0x65')):undefined});}return null;})[_0x3857('0x23')](function(_0x57ecc1){if(_0x57ecc1){_0x2fd1fa['interaction']=_0x57ecc1['get']({'plain':!![]});interaction_log[_0x3857('0x2a')](_0x3857('0x6b'),_0x5e562d[_0x3857('0x6c')]['id'],_0x5e562d[_0x3857('0x6c')][_0x3857('0x3c')],_0x5e562d[_0x3857('0x6c')][_0x3857('0x6d')],_0x2fd1fa[_0x3857('0x6e')]['id'],_0x5e562d[_0x3857('0x5e')]?JSON[_0x3857('0x27')](_0x5e562d[_0x3857('0x5e')]):'null');return respondWithRpcPromise(_0x3857('0x6f'),_0x3857('0x70'),_0x2fd1fa);}return null;})[_0x3857('0x23')](function(_0x30a689){var _0x285191='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x30a689[_0x3857('0x29')][_0x3857('0x71')];return db['sequelize'][_0x3857('0x48')](_0x285191,{'type':db[_0x3857('0x72')][_0x3857('0x73')][_0x3857('0x74')],'raw':!![]})['then'](function(_0x4a7af5){return _0x4a7af5;});})[_0x3857('0x23')](function(_0x5ae12f){if(_0x5ae12f){_0x2fd1fa[_0x3857('0x29')]['contact']=_0x5ae12f[0x0];if(!_0x5e562d['body']['UserId'])return;return db[_0x3857('0x75')][_0x3857('0x5c')]({'where':{'id':_0x5e562d['body']['UserId'],'role':_0x3857('0x67')},'attributes':['id',_0x3857('0x3c'),_0x3857('0x76'),_0x3857('0x77'),_0x3857('0x78')],'raw':!![]});}return null;})[_0x3857('0x23')](function(_0x4ff2b5){if(!_0x4ff2b5)return null;_0x2fd1fa[_0x3857('0x29')][_0x3857('0x67')]=_0x4ff2b5;return _0x2fd1fa;})[_0x3857('0x23')](function(_0x3c67b1){if(_0x3c67b1){if(_0x5e562d[_0x3857('0x5e')]['manual']){_0x2fd1fa['message'][_0x3857('0x79')]=util[_0x3857('0x64')](_0x3857('0x7a'),_0x5e562d[_0x3857('0x6c')]['name']);_0x2fd1fa['message'][_0x3857('0x7b')]=_0x2fd1fa[_0x3857('0x7b')];_0x2fd1fa[_0x3857('0x29')][_0x3857('0x7c')]=_0x2fd1fa[_0x3857('0x7b')];_0x2fd1fa[_0x3857('0x29')][_0x3857('0x7d')]=_0x3857('0x61');return respondWithRpcPromise(_0x3857('0x7e'),_0x3857('0x7e'),{'event':'acceptmessage','message':_[_0x3857('0x54')](_0x2fd1fa[_0x3857('0x29')],JSON[_0x3857('0x7f')](_0x2fd1fa[_0x3857('0x6e')][_0x3857('0x80')]))},client9002)[_0x3857('0x23')](function(){return _0x2fd1fa;});}return _0x2fd1fa;}return null;})[_0x3857('0x23')](respondWithResult(_0x208a49,null))[_0x3857('0x2c')](handleError(_0x208a49,null));};var interaction_log=require(_0x3857('0x15'))(_0x3857('0x60'));exports[_0x3857('0x36')]=function(_0x337f4a,_0x26ccc3,_0x428fd3){var _0xcdfda3={'agent':{},'channel':_0x3857('0x62')};if(_0x337f4a[_0x3857('0x5e')]['id']){delete _0x337f4a['body']['id'];}_0x337f4a[_0x3857('0x5e')][_0x3857('0x66')]=_0x337f4a[_0x3857('0x5e')][_0x3857('0x66')]||_0x337f4a[_0x3857('0x6c')]['id'];_0xcdfda3[_0x3857('0x67')]['id']=_0x337f4a[_0x3857('0x5e')]['UserId'];return db['ChatMessage']['find']({'where':{'id':_0x337f4a[_0x3857('0x5b')]['id'],'UserId':null}})[_0x3857('0x23')](handleEntityNotFound(_0x26ccc3,null))['then'](function(_0x214b31){if(_0x214b31){_0xcdfda3['message']=_0x214b31['get']({'plain':!![]});return db[_0x3857('0x68')][_0x3857('0x5c')]({'where':{'id':_0x214b31['ChatInteractionId']}});}return null;})[_0x3857('0x23')](handleEntityNotFound(_0x26ccc3,null))[_0x3857('0x23')](function(_0xdb3d9a){if(_0xdb3d9a){_0xcdfda3[_0x3857('0x6e')]=_0xdb3d9a['get']({'plain':!![]});interaction_log[_0x3857('0x2a')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x337f4a[_0x3857('0x6c')]['id'],_0x337f4a[_0x3857('0x6c')][_0x3857('0x3c')],_0x337f4a['user'][_0x3857('0x6d')],_0xcdfda3[_0x3857('0x6e')]['id'],_0x337f4a[_0x3857('0x5e')]?JSON[_0x3857('0x27')](_0x337f4a['body']):_0x3857('0x81'));return respondWithRpcPromise(_0x3857('0x82'),'rejectMessage',_0xcdfda3);}return null;})[_0x3857('0x23')](function(_0x3ac459){var _0x312ffd=_0x3857('0x83')+_0x3ac459['message'][_0x3857('0x71')];return db[_0x3857('0x84')]['query'](_0x312ffd,{'type':db[_0x3857('0x72')][_0x3857('0x73')]['SELECT'],'raw':!![]})[_0x3857('0x23')](function(_0x54b28c){return _0x54b28c;});})[_0x3857('0x23')](function(_0x16279a){if(_0x16279a){_0xcdfda3[_0x3857('0x29')]['contact']=_0x16279a[0x0];if(!_0x337f4a['body'][_0x3857('0x66')])return;return db[_0x3857('0x75')][_0x3857('0x5c')]({'where':{'id':_0x337f4a[_0x3857('0x5e')][_0x3857('0x66')],'role':_0x3857('0x67')},'attributes':['id',_0x3857('0x3c'),_0x3857('0x76'),_0x3857('0x77'),'internal'],'raw':!![]});}return null;})[_0x3857('0x23')](function(_0x3abffd){if(!_0x3abffd)return null;_0xcdfda3[_0x3857('0x29')]['agent']=_0x3abffd;return _0xcdfda3;})[_0x3857('0x23')](function(_0x209f49){if(_0x209f49){_0x209f49['message'][_0x3857('0x79')]=util[_0x3857('0x64')](_0x3857('0x7a'),_0x337f4a[_0x3857('0x6c')][_0x3857('0x3c')]);_0x209f49['message'][_0x3857('0x7b')]=_0xcdfda3[_0x3857('0x7b')];_0x209f49[_0x3857('0x29')][_0x3857('0x7c')]=_0xcdfda3[_0x3857('0x7b')];_0x209f49[_0x3857('0x29')][_0x3857('0x7d')]='reject';respondWithRpcPromise(_0x3857('0x7e'),_0x3857('0x7e'),{'event':_0x3857('0x85'),'message':_[_0x3857('0x54')](_0xcdfda3['message'],JSON[_0x3857('0x7f')](_0xcdfda3[_0x3857('0x6e')][_0x3857('0x80')]))},client9002);return _0xcdfda3;}return null;})[_0x3857('0x23')](respondWithResult(_0x26ccc3,null))[_0x3857('0x2c')](handleError(_0x26ccc3,null));};
\ No newline at end of file
+var _0xaea1=['offset','limit','undefined','count','set','Content-Range','reject','save','update','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','catch','params','length','find','create','body','destroy','describe','chat-interactions','accept','chat','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteractionId','isNil','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','SELECT','User','email','internal','manual','interface','format','SIP/%s','channel','motionChannel','EventManager','acceptmessage','parse','formData','../../config/logger','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json'];(function(_0x34a370,_0x37e16f){var _0x39e794=function(_0x2b7c83){while(--_0x2b7c83){_0x34a370['push'](_0x34a370['shift']());}};_0x39e794(++_0x37e16f);}(_0xaea1,0x1df));var _0x1aea=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xaea1[_0x432682];return _0x463d05;};'use strict';var emlformat=require(_0x1aea('0x0'));var rimraf=require(_0x1aea('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1aea('0x2'));var rp=require(_0x1aea('0x3'));var moment=require(_0x1aea('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1aea('0x5'));var path=require(_0x1aea('0x6'));var sox=require(_0x1aea('0x7'));var csv=require(_0x1aea('0x8'));var ejs=require(_0x1aea('0x9'));var fs=require('fs');var fs_extra=require(_0x1aea('0xa'));var _=require(_0x1aea('0xb'));var squel=require('squel');var crypto=require(_0x1aea('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1aea('0xd'));var toCsv=require(_0x1aea('0x8'));var querystring=require(_0x1aea('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1aea('0xf'));var qs=require(_0x1aea('0x10'));var as=require(_0x1aea('0x11'));var hardwareService=require(_0x1aea('0x12'));var logger=require('../../config/logger')(_0x1aea('0x13'));var utils=require(_0x1aea('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1aea('0x15'));var db=require(_0x1aea('0x16'))['db'];config[_0x1aea('0x17')]=_[_0x1aea('0x18')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1aea('0x17')]));require(_0x1aea('0x19'))[_0x1aea('0x1a')](socket);var jayson=require(_0x1aea('0x1b'));var client=jayson[_0x1aea('0x1c')][_0x1aea('0x1d')]({'port':0x232c});var client9002=jayson[_0x1aea('0x1c')][_0x1aea('0x1d')]({'port':0x232a});function respondWithRpcPromise(_0xea2261,_0x44e186,_0x500054,_0x242211){return new BPromise(function(_0x1a7b4e,_0x50e899){var _0x5b355e=_0x242211||client;return _0x5b355e[_0x1aea('0x1e')](_0xea2261,_0x500054)[_0x1aea('0x1f')](function(_0x422135){logger[_0x1aea('0x20')](_0x1aea('0x21'),_0x44e186,'request\x20sent');logger[_0x1aea('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x44e186,'request\x20sent',JSON[_0x1aea('0x23')](_0x422135));if(_0x422135[_0x1aea('0x24')]){if(_0x422135['error'][_0x1aea('0x25')]===0x1f4){logger[_0x1aea('0x24')](_0x1aea('0x21'),_0x44e186,_0x422135[_0x1aea('0x24')][_0x1aea('0x26')]);return _0x50e899(_0x422135[_0x1aea('0x24')]['message']);}logger[_0x1aea('0x24')]('ChatMessage,\x20%s,\x20%s',_0x44e186,_0x422135[_0x1aea('0x24')][_0x1aea('0x26')]);return _0x1a7b4e(_0x422135[_0x1aea('0x24')]['message']);}else{logger[_0x1aea('0x20')](_0x1aea('0x21'),_0x44e186,_0x1aea('0x27'));_0x1a7b4e(_0x422135[_0x1aea('0x28')][_0x1aea('0x26')]);}})['catch'](function(_0x17361a){logger[_0x1aea('0x24')](_0x1aea('0x21'),_0x44e186,_0x17361a);_0x50e899(_0x17361a);});});}function respondWithStatusCode(_0x2eac19,_0x1a4c05){_0x1a4c05=_0x1a4c05||0xcc;return function(_0x4b8f8d){if(_0x4b8f8d){return _0x2eac19[_0x1aea('0x29')](_0x1a4c05);}return _0x2eac19[_0x1aea('0x2a')](_0x1a4c05)[_0x1aea('0x2b')]();};}function respondWithResult(_0x1b0fe8,_0x213545){_0x213545=_0x213545||0xc8;return function(_0x3a9482){if(_0x3a9482){return _0x1b0fe8[_0x1aea('0x2a')](_0x213545)[_0x1aea('0x2c')](_0x3a9482);}};}function respondWithFilteredResult(_0x4e2a63,_0x32b5b3){return function(_0x10d875){if(_0x10d875){var _0x44b3ff=typeof _0x32b5b3[_0x1aea('0x2d')]==='undefined'&&typeof _0x32b5b3[_0x1aea('0x2e')]===_0x1aea('0x2f');var _0x3b96a7=_0x10d875[_0x1aea('0x30')];var _0x2b5661=_0x44b3ff?0x0:_0x32b5b3[_0x1aea('0x2d')];var _0x1594ba=_0x44b3ff?_0x10d875[_0x1aea('0x30')]:_0x32b5b3[_0x1aea('0x2d')]+_0x32b5b3[_0x1aea('0x2e')];var _0x3e9207;if(_0x1594ba>=_0x3b96a7){_0x1594ba=_0x3b96a7;_0x3e9207=0xc8;}else{_0x3e9207=0xce;}_0x4e2a63[_0x1aea('0x2a')](_0x3e9207);return _0x4e2a63[_0x1aea('0x31')](_0x1aea('0x32'),_0x2b5661+'-'+_0x1594ba+'/'+_0x3b96a7)[_0x1aea('0x2c')](_0x10d875);}return null;};}function patchUpdates(_0x4752cd){return function(_0x34c115){try{jsonpatch['apply'](_0x34c115,_0x4752cd,!![]);}catch(_0x45b4b7){return BPromise[_0x1aea('0x33')](_0x45b4b7);}return _0x34c115[_0x1aea('0x34')]();};}function saveUpdates(_0x20a4b9,_0x4c315c){return function(_0x3bdd19){if(_0x3bdd19){return _0x3bdd19[_0x1aea('0x35')](_0x20a4b9)[_0x1aea('0x1f')](function(_0x35fcc8){return _0x35fcc8;});}return null;};}function removeEntity(_0x54ddcb,_0x7adacf){return function(_0x89704e){if(_0x89704e){return _0x89704e['destroy']()[_0x1aea('0x1f')](function(){_0x54ddcb[_0x1aea('0x2a')](0xcc)[_0x1aea('0x2b')]();});}};}function handleEntityNotFound(_0x5b16a1,_0x2da51c){return function(_0x269b7f){if(!_0x269b7f){_0x5b16a1['sendStatus'](0x194);}return _0x269b7f;};}function handleError(_0x518fc4,_0x26b7c8){_0x26b7c8=_0x26b7c8||0x1f4;return function(_0x4ca332){logger[_0x1aea('0x24')](_0x4ca332[_0x1aea('0x36')]);if(_0x4ca332[_0x1aea('0x37')]){delete _0x4ca332[_0x1aea('0x37')];}_0x518fc4[_0x1aea('0x2a')](_0x26b7c8)[_0x1aea('0x38')](_0x4ca332);};}exports[_0x1aea('0x39')]=function(_0x42ada5,_0x29c90b){var _0x5b5abe={},_0x3cb2dc={},_0x363042={'count':0x0,'rows':[]};var _0x46dcfc=_[_0x1aea('0x3a')](db[_0x1aea('0x3b')][_0x1aea('0x3c')],function(_0x4354cb){return{'name':_0x4354cb[_0x1aea('0x3d')],'type':_0x4354cb[_0x1aea('0x3e')][_0x1aea('0x3f')]};});_0x3cb2dc[_0x1aea('0x40')]=_[_0x1aea('0x3a')](_0x46dcfc,_0x1aea('0x37'));_0x3cb2dc['query']=_[_0x1aea('0x41')](_0x42ada5[_0x1aea('0x42')]);_0x3cb2dc[_0x1aea('0x43')]=_['intersection'](_0x3cb2dc[_0x1aea('0x40')],_0x3cb2dc[_0x1aea('0x42')]);_0x5b5abe[_0x1aea('0x44')]=_[_0x1aea('0x45')](_0x3cb2dc[_0x1aea('0x40')],qs['fields'](_0x42ada5[_0x1aea('0x42')][_0x1aea('0x46')]));_0x5b5abe[_0x1aea('0x44')]=_0x5b5abe['attributes']['length']?_0x5b5abe['attributes']:_0x3cb2dc[_0x1aea('0x40')];if(!_0x42ada5[_0x1aea('0x42')]['hasOwnProperty'](_0x1aea('0x47'))){_0x5b5abe['limit']=qs[_0x1aea('0x2e')](_0x42ada5[_0x1aea('0x42')][_0x1aea('0x2e')]);_0x5b5abe[_0x1aea('0x2d')]=qs[_0x1aea('0x2d')](_0x42ada5[_0x1aea('0x42')][_0x1aea('0x2d')]);}_0x5b5abe[_0x1aea('0x48')]=qs[_0x1aea('0x49')](_0x42ada5[_0x1aea('0x42')][_0x1aea('0x49')]);_0x5b5abe[_0x1aea('0x4a')]=qs[_0x1aea('0x43')](_[_0x1aea('0x4b')](_0x42ada5[_0x1aea('0x42')],_0x3cb2dc[_0x1aea('0x43')]),_0x46dcfc);if(_0x42ada5['query'][_0x1aea('0x4c')]){_0x5b5abe[_0x1aea('0x4a')]=_['merge'](_0x5b5abe[_0x1aea('0x4a')],{'$or':_[_0x1aea('0x3a')](_0x46dcfc,function(_0x3c665f){if(_0x3c665f[_0x1aea('0x3e')]!==_0x1aea('0x4d')){var _0x56046f={};_0x56046f[_0x3c665f[_0x1aea('0x37')]]={'$like':'%'+_0x42ada5[_0x1aea('0x42')]['filter']+'%'};return _0x56046f;}})});}_0x5b5abe=_[_0x1aea('0x4e')]({},_0x5b5abe,_0x42ada5[_0x1aea('0x4f')]);var _0x34c6b9={'where':_0x5b5abe['where']};return db[_0x1aea('0x3b')]['count'](_0x34c6b9)[_0x1aea('0x1f')](function(_0x100362){_0x363042[_0x1aea('0x30')]=_0x100362;if(_0x42ada5[_0x1aea('0x42')][_0x1aea('0x50')]){_0x5b5abe[_0x1aea('0x51')]=[{'all':!![]}];}return db[_0x1aea('0x3b')]['findAll'](_0x5b5abe);})['then'](function(_0x5342bf){_0x363042['rows']=_0x5342bf;return _0x363042;})['then'](respondWithFilteredResult(_0x29c90b,_0x5b5abe))[_0x1aea('0x52')](handleError(_0x29c90b,null));};exports['show']=function(_0x503df3,_0x348edb){var _0x574a11={'raw':!![],'where':{'id':_0x503df3[_0x1aea('0x53')]['id']}},_0x59a89d={};_0x59a89d[_0x1aea('0x40')]=_[_0x1aea('0x41')](db[_0x1aea('0x3b')][_0x1aea('0x3c')]);_0x59a89d[_0x1aea('0x42')]=_['keys'](_0x503df3[_0x1aea('0x42')]);_0x59a89d[_0x1aea('0x43')]=_[_0x1aea('0x45')](_0x59a89d[_0x1aea('0x40')],_0x59a89d['query']);_0x574a11[_0x1aea('0x44')]=_['intersection'](_0x59a89d[_0x1aea('0x40')],qs[_0x1aea('0x46')](_0x503df3['query'][_0x1aea('0x46')]));_0x574a11['attributes']=_0x574a11['attributes'][_0x1aea('0x54')]?_0x574a11[_0x1aea('0x44')]:_0x59a89d[_0x1aea('0x40')];if(_0x503df3[_0x1aea('0x42')][_0x1aea('0x50')]){_0x574a11[_0x1aea('0x51')]=[{'all':!![]}];}_0x574a11=_[_0x1aea('0x4e')]({},_0x574a11,_0x503df3[_0x1aea('0x4f')]);return db[_0x1aea('0x3b')][_0x1aea('0x55')](_0x574a11)[_0x1aea('0x1f')](handleEntityNotFound(_0x348edb,null))[_0x1aea('0x1f')](respondWithResult(_0x348edb,null))[_0x1aea('0x52')](handleError(_0x348edb,null));};exports[_0x1aea('0x56')]=function(_0x47b83a,_0xa23142){return db[_0x1aea('0x3b')][_0x1aea('0x56')](_0x47b83a['body'],{})[_0x1aea('0x1f')](respondWithResult(_0xa23142,0xc9))['catch'](handleError(_0xa23142,null));};exports['update']=function(_0xaa8321,_0x422940){if(_0xaa8321['body']['id']){delete _0xaa8321['body']['id'];}return db['ChatMessage'][_0x1aea('0x55')]({'where':{'id':_0xaa8321['params']['id']}})[_0x1aea('0x1f')](handleEntityNotFound(_0x422940,null))[_0x1aea('0x1f')](saveUpdates(_0xaa8321[_0x1aea('0x57')],null))['then'](respondWithResult(_0x422940,null))['catch'](handleError(_0x422940,null));};exports[_0x1aea('0x58')]=function(_0x396ba7,_0x3a4670){return db['ChatMessage'][_0x1aea('0x55')]({'where':{'id':_0x396ba7[_0x1aea('0x53')]['id']}})[_0x1aea('0x1f')](handleEntityNotFound(_0x3a4670,null))['then'](removeEntity(_0x3a4670,null))[_0x1aea('0x52')](handleError(_0x3a4670,null));};exports[_0x1aea('0x59')]=function(_0x597c91,_0x34d83f){return db[_0x1aea('0x3b')][_0x1aea('0x59')]()[_0x1aea('0x1f')](respondWithResult(_0x34d83f,null))[_0x1aea('0x52')](handleError(_0x34d83f,null));};var interaction_log=require('../../config/logger')(_0x1aea('0x5a'));exports[_0x1aea('0x5b')]=function(_0x592470,_0x457374,_0xb59801){var _0x5b5c78={'agent':{},'channel':_0x1aea('0x5c')};if(_0x592470[_0x1aea('0x57')]['id']){delete _0x592470['body']['id'];}_0x592470[_0x1aea('0x57')]['read']=!![];_0x592470['body'][_0x1aea('0x5d')]=moment()['format'](_0x1aea('0x5e'));_0x592470[_0x1aea('0x57')][_0x1aea('0x5f')]=_0x592470['body'][_0x1aea('0x5f')]||_0x592470[_0x1aea('0x60')]['id'];_0x5b5c78['agent']['id']=_0x592470[_0x1aea('0x57')][_0x1aea('0x5f')];return db[_0x1aea('0x3b')][_0x1aea('0x55')]({'where':{'id':_0x592470[_0x1aea('0x53')]['id'],'UserId':null}})[_0x1aea('0x1f')](handleEntityNotFound(_0x457374,null))[_0x1aea('0x1f')](saveUpdates(_0x592470[_0x1aea('0x57')],null))['then'](function(_0x22d261){if(_0x22d261){_0x5b5c78[_0x1aea('0x26')]=_0x22d261[_0x1aea('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x1aea('0x55')]({'where':{'id':_0x22d261[_0x1aea('0x62')]}});}return null;})[_0x1aea('0x1f')](handleEntityNotFound(_0x457374,null))[_0x1aea('0x1f')](function(_0x53f6fe){if(_0x53f6fe){return _0x53f6fe['update']({'UserId':_0x592470[_0x1aea('0x57')]['UserId'],'read1stAt':_[_0x1aea('0x63')](_0x53f6fe[_0x1aea('0x64')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x1aea('0x1f')](function(_0x313d4b){if(_0x313d4b){_0x5b5c78[_0x1aea('0x65')]=_0x313d4b[_0x1aea('0x61')]({'plain':!![]});interaction_log[_0x1aea('0x20')](_0x1aea('0x66'),_0x592470[_0x1aea('0x60')]['id'],_0x592470[_0x1aea('0x60')]['name'],_0x592470[_0x1aea('0x60')][_0x1aea('0x67')],_0x5b5c78[_0x1aea('0x65')]['id'],_0x592470[_0x1aea('0x57')]?JSON[_0x1aea('0x23')](_0x592470[_0x1aea('0x57')]):_0x1aea('0x68'));return respondWithRpcPromise(_0x1aea('0x69'),_0x1aea('0x6a'),_0x5b5c78);}return null;})[_0x1aea('0x1f')](function(_0x56e680){var _0x35d970=_0x1aea('0x6b')+_0x56e680[_0x1aea('0x26')][_0x1aea('0x6c')];return db[_0x1aea('0x6d')][_0x1aea('0x42')](_0x35d970,{'type':db['Sequelize'][_0x1aea('0x6e')][_0x1aea('0x6f')],'raw':!![]})[_0x1aea('0x1f')](function(_0x35e82b){return _0x35e82b;});})['then'](function(_0x31c7c3){if(_0x31c7c3){_0x5b5c78[_0x1aea('0x26')]['contact']=_0x31c7c3[0x0];if(!_0x592470['body'][_0x1aea('0x5f')])return;return db[_0x1aea('0x70')][_0x1aea('0x55')]({'where':{'id':_0x592470[_0x1aea('0x57')][_0x1aea('0x5f')],'role':'agent'},'attributes':['id',_0x1aea('0x37'),'fullname',_0x1aea('0x71'),_0x1aea('0x72')],'raw':!![]});}return null;})['then'](function(_0x502fdd){if(!_0x502fdd)return null;_0x5b5c78[_0x1aea('0x26')]['agent']=_0x502fdd;return _0x5b5c78;})[_0x1aea('0x1f')](function(_0x4015ab){if(_0x4015ab){if(_0x592470[_0x1aea('0x57')][_0x1aea('0x73')]){_0x5b5c78['message'][_0x1aea('0x74')]=util[_0x1aea('0x75')](_0x1aea('0x76'),_0x592470[_0x1aea('0x60')][_0x1aea('0x37')]);_0x5b5c78[_0x1aea('0x26')][_0x1aea('0x77')]=_0x5b5c78['channel'];_0x5b5c78[_0x1aea('0x26')][_0x1aea('0x78')]=_0x5b5c78[_0x1aea('0x77')];_0x5b5c78[_0x1aea('0x26')]['event']=_0x1aea('0x5b');return respondWithRpcPromise('EventManager',_0x1aea('0x79'),{'event':_0x1aea('0x7a'),'message':_[_0x1aea('0x4e')](_0x5b5c78['message'],JSON[_0x1aea('0x7b')](_0x5b5c78['interaction'][_0x1aea('0x7c')]))},client9002)[_0x1aea('0x1f')](function(){return _0x5b5c78;});}return _0x5b5c78;}return null;})[_0x1aea('0x1f')](respondWithResult(_0x457374,null))[_0x1aea('0x52')](handleError(_0x457374,null));};var interaction_log=require(_0x1aea('0x7d'))(_0x1aea('0x5a'));exports[_0x1aea('0x33')]=function(_0x5d7234,_0x1abcab,_0x2a69f4){var _0x52397c={'agent':{},'channel':'chat'};if(_0x5d7234[_0x1aea('0x57')]['id']){delete _0x5d7234[_0x1aea('0x57')]['id'];}_0x5d7234[_0x1aea('0x57')]['UserId']=_0x5d7234['body'][_0x1aea('0x5f')]||_0x5d7234[_0x1aea('0x60')]['id'];_0x52397c[_0x1aea('0x7e')]['id']=_0x5d7234[_0x1aea('0x57')][_0x1aea('0x5f')];return db['ChatMessage'][_0x1aea('0x55')]({'where':{'id':_0x5d7234['params']['id'],'UserId':null}})[_0x1aea('0x1f')](handleEntityNotFound(_0x1abcab,null))['then'](function(_0x3b9e53){if(_0x3b9e53){_0x52397c[_0x1aea('0x26')]=_0x3b9e53[_0x1aea('0x61')]({'plain':!![]});return db['ChatInteraction'][_0x1aea('0x55')]({'where':{'id':_0x3b9e53[_0x1aea('0x62')]}});}return null;})[_0x1aea('0x1f')](handleEntityNotFound(_0x1abcab,null))[_0x1aea('0x1f')](function(_0x1c546d){if(_0x1c546d){_0x52397c[_0x1aea('0x65')]=_0x1c546d['get']({'plain':!![]});interaction_log[_0x1aea('0x20')](_0x1aea('0x7f'),_0x5d7234[_0x1aea('0x60')]['id'],_0x5d7234[_0x1aea('0x60')][_0x1aea('0x37')],_0x5d7234[_0x1aea('0x60')]['role'],_0x52397c[_0x1aea('0x65')]['id'],_0x5d7234[_0x1aea('0x57')]?JSON[_0x1aea('0x23')](_0x5d7234[_0x1aea('0x57')]):_0x1aea('0x68'));return respondWithRpcPromise(_0x1aea('0x80'),_0x1aea('0x81'),_0x52397c);}return null;})[_0x1aea('0x1f')](function(_0xd8efe7){var _0x21cd98=_0x1aea('0x6b')+_0xd8efe7[_0x1aea('0x26')][_0x1aea('0x6c')];return db[_0x1aea('0x6d')]['query'](_0x21cd98,{'type':db['Sequelize'][_0x1aea('0x6e')]['SELECT'],'raw':!![]})['then'](function(_0x1fef09){return _0x1fef09;});})[_0x1aea('0x1f')](function(_0x451004){if(_0x451004){_0x52397c[_0x1aea('0x26')]['contact']=_0x451004[0x0];if(!_0x5d7234[_0x1aea('0x57')][_0x1aea('0x5f')])return;return db[_0x1aea('0x70')][_0x1aea('0x55')]({'where':{'id':_0x5d7234[_0x1aea('0x57')][_0x1aea('0x5f')],'role':_0x1aea('0x7e')},'attributes':['id',_0x1aea('0x37'),'fullname',_0x1aea('0x71'),_0x1aea('0x72')],'raw':!![]});}return null;})[_0x1aea('0x1f')](function(_0x59b3ff){if(!_0x59b3ff)return null;_0x52397c['message'][_0x1aea('0x7e')]=_0x59b3ff;return _0x52397c;})[_0x1aea('0x1f')](function(_0x28cc73){if(_0x28cc73){_0x28cc73[_0x1aea('0x26')][_0x1aea('0x74')]=util[_0x1aea('0x75')](_0x1aea('0x76'),_0x5d7234[_0x1aea('0x60')][_0x1aea('0x37')]);_0x28cc73['message']['channel']=_0x52397c[_0x1aea('0x77')];_0x28cc73[_0x1aea('0x26')][_0x1aea('0x78')]=_0x52397c[_0x1aea('0x77')];_0x28cc73[_0x1aea('0x26')]['event']='reject';respondWithRpcPromise('EventManager',_0x1aea('0x79'),{'event':_0x1aea('0x82'),'message':_[_0x1aea('0x4e')](_0x52397c[_0x1aea('0x26')],JSON[_0x1aea('0x7b')](_0x52397c['interaction'][_0x1aea('0x7c')]))},client9002);return _0x52397c;}return null;})[_0x1aea('0x1f')](respondWithResult(_0x1abcab,null))['catch'](handleError(_0x1abcab,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 9a54468..ad887fc 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 _0xd9f5=['hasOwnProperty','hook','exports','events','../../mysqldb','update','emit'];(function(_0x43a995,_0x283637){var _0x3a27d4=function(_0x333f94){while(--_0x333f94){_0x43a995['push'](_0x43a995['shift']());}};_0x3a27d4(++_0x283637);}(_0xd9f5,0x1a0));var _0x5d9f=function(_0x4a7e98,_0x250137){_0x4a7e98=_0x4a7e98-0x0;var _0x27d10d=_0xd9f5[_0x4a7e98];return _0x27d10d;};'use strict';var EventEmitter=require(_0x5d9f('0x0'));var ChatMessage=require(_0x5d9f('0x1'))['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5d9f('0x2'),'afterDestroy':'remove'};function emitEvent(_0x204703){return function(_0x4bc6f9,_0x317fea,_0x40c4ba){ChatMessageEvents['emit'](_0x204703+':'+_0x4bc6f9['id'],_0x4bc6f9);ChatMessageEvents[_0x5d9f('0x3')](_0x204703,_0x4bc6f9);_0x40c4ba(null);};}for(var e in events){if(events[_0x5d9f('0x4')](e)){var event=events[e];ChatMessage[_0x5d9f('0x5')](e,emitEvent(event));}}module[_0x5d9f('0x6')]=ChatMessageEvents;
\ No newline at end of file
+var _0x6f5b=['events','ChatMessage','save','update','emit','hasOwnProperty','exports'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x6f5b,0x18f));var _0xb6f5=function(_0x165a6a,_0x1be5ae){_0x165a6a=_0x165a6a-0x0;var _0x13c886=_0x6f5b[_0x165a6a];return _0x13c886;};'use strict';var EventEmitter=require(_0xb6f5('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xb6f5('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb6f5('0x2'),'afterUpdate':_0xb6f5('0x3'),'afterDestroy':'remove'};function emitEvent(_0x539c2e){return function(_0xfc7fff,_0x3dd676,_0x324825){ChatMessageEvents[_0xb6f5('0x4')](_0x539c2e+':'+_0xfc7fff['id'],_0xfc7fff);ChatMessageEvents['emit'](_0x539c2e,_0xfc7fff);_0x324825(null);};}for(var e in events){if(events[_0xb6f5('0x5')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0xb6f5('0x6')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 273fcde..ecea231 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 _0x6131=['chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','ChatInteraction','findOne','ChatInteractionId','then','update','createdAt','catch','error','utf8mb4','lodash','moment','bluebird','request-promise','rimraf','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6131,0xe0));var _0x1613=function(_0x46cd04,_0x32f2da){_0x46cd04=_0x46cd04-0x0;var _0x108808=_0x6131[_0x46cd04];return _0x108808;};'use strict';var _=require(_0x1613('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1613('0x1'));var BPromise=require(_0x1613('0x2'));var rp=require(_0x1613('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1613('0x4'));var config=require(_0x1613('0x5'));var attributes=require(_0x1613('0x6'));module[_0x1613('0x7')]=function(_0x3b7e5b,_0x18c654){return _0x3b7e5b[_0x1613('0x8')](_0x1613('0x9'),attributes,{'tableName':_0x1613('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x1613('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x463eef,_0x35bf0e,_0x2da226){var _0x1abf94=_0x3b7e5b[_0x1613('0xc')];var _0x5bd037=_0x463eef[_0x1613('0xd')]({'plain':!![]});if(_0x5bd037[_0x1613('0xe')][_0x1613('0xf')]()==='in'||_0x5bd037['direction']['toLowerCase']()===_0x1613('0x10')&&!_0x5bd037['secret']&&!_['isNil'](_0x5bd037['UserId'])){_0x1abf94[_0x1613('0x11')][_0x1613('0x12')]({'where':{'id':_0x5bd037[_0x1613('0x13')]}})[_0x1613('0x14')](function(_0x8bb50e){if(_0x8bb50e){_0x8bb50e[_0x1613('0x15')]({'lastMsgAt':_0x5bd037[_0x1613('0x16')],'lastMsgDirection':_0x5bd037['direction']['toLowerCase']()});}})[_0x1613('0x17')](function(_0x85272d){console[_0x1613('0x18')](_0x85272d);});}_0x2da226();}},'charset':_0x1613('0x19'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0xbf39=['fti_chat_messages','body','direction','toLowerCase','out','isNil','UserId','findOne','then','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./chatMessage.attributes','define','ChatMessage'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xbf39,0xc5));var _0x9bf3=function(_0x2ffd9c,_0x48afeb){_0x2ffd9c=_0x2ffd9c-0x0;var _0xfef192=_0xbf39[_0x2ffd9c];return _0xfef192;};'use strict';var _=require('lodash');var util=require(_0x9bf3('0x0'));var logger=require(_0x9bf3('0x1'))(_0x9bf3('0x2'));var moment=require(_0x9bf3('0x3'));var BPromise=require(_0x9bf3('0x4'));var rp=require(_0x9bf3('0x5'));var fs=require('fs');var path=require(_0x9bf3('0x6'));var rimraf=require('rimraf');var config=require(_0x9bf3('0x7'));var attributes=require(_0x9bf3('0x8'));module['exports']=function(_0x480b2e,_0x2a672d){return _0x480b2e[_0x9bf3('0x9')](_0x9bf3('0xa'),attributes,{'tableName':'chat_messages','paranoid':![],'indexes':[{'name':_0x9bf3('0xb'),'fields':[_0x9bf3('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f337e,_0x449dc7,_0x3a423f){var _0xacad6e=_0x480b2e['models'];var _0x3ad126=_0x2f337e['get']({'plain':!![]});if(_0x3ad126[_0x9bf3('0xd')]['toLowerCase']()==='in'||_0x3ad126[_0x9bf3('0xd')][_0x9bf3('0xe')]()===_0x9bf3('0xf')&&!_0x3ad126['secret']&&!_[_0x9bf3('0x10')](_0x3ad126[_0x9bf3('0x11')])){_0xacad6e['ChatInteraction'][_0x9bf3('0x12')]({'where':{'id':_0x3ad126['ChatInteractionId']}})[_0x9bf3('0x13')](function(_0x5441f0){if(_0x5441f0){_0x5441f0[_0x9bf3('0x14')]({'lastMsgAt':_0x3ad126[_0x9bf3('0x15')],'lastMsgDirection':_0x3ad126[_0x9bf3('0xd')]['toLowerCase']()});}})[_0x9bf3('0x16')](function(_0x39b759){console[_0x9bf3('0x17')](_0x39b759);});}_0x3a423f();}},'charset':_0x9bf3('0x18'),'collate':_0x9bf3('0x19')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 05f9993..5d074eb 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 _0xb80c=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateChatMessage','create','options','raw','debug','catch','lodash','util','moment'];(function(_0xe66cf2,_0x32ba5f){var _0x2d84e7=function(_0x58a7d8){while(--_0x58a7d8){_0xe66cf2['push'](_0xe66cf2['shift']());}};_0x2d84e7(++_0x32ba5f);}(_0xb80c,0x147));var _0xcb80=function(_0xd38ef9,_0x498d2b){_0xd38ef9=_0xd38ef9-0x0;var _0x3be30b=_0xb80c[_0xd38ef9];return _0x3be30b;};'use strict';var _=require(_0xcb80('0x0'));var util=require(_0xcb80('0x1'));var moment=require(_0xcb80('0x2'));var BPromise=require(_0xcb80('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcb80('0x4'));var db=require(_0xcb80('0x5'))['db'];var utils=require(_0xcb80('0x6'));var logger=require(_0xcb80('0x7'))(_0xcb80('0x8'));var config=require(_0xcb80('0x9'));var jayson=require(_0xcb80('0xa'));var client=jayson['client'][_0xcb80('0xb')]({'port':0x232a});config[_0xcb80('0xc')]=_[_0xcb80('0xd')](config[_0xcb80('0xc')],{'host':_0xcb80('0xe'),'port':0x18eb});var socket=require(_0xcb80('0xf'))(new Redis(config[_0xcb80('0xc')]));require('./chatMessage.socket')[_0xcb80('0x10')](socket);function respondWithRpcPromise(_0x53f2d8,_0x40c8c0,_0x5ee568){return new BPromise(function(_0x52a4fb,_0x4661e5){return client['request'](_0x53f2d8,_0x5ee568)[_0xcb80('0x11')](function(_0x441a47){logger[_0xcb80('0x12')](_0xcb80('0x13'),_0x40c8c0,_0xcb80('0x14'));logger['debug'](_0xcb80('0x15'),_0x40c8c0,_0xcb80('0x14'),JSON[_0xcb80('0x16')](_0x441a47));if(_0x441a47[_0xcb80('0x17')]){if(_0x441a47[_0xcb80('0x17')][_0xcb80('0x18')]===0x1f4){logger[_0xcb80('0x17')]('ChatMessage,\x20%s,\x20%s',_0x40c8c0,_0x441a47[_0xcb80('0x17')][_0xcb80('0x19')]);return _0x4661e5(_0x441a47[_0xcb80('0x17')][_0xcb80('0x19')]);}logger[_0xcb80('0x17')](_0xcb80('0x13'),_0x40c8c0,_0x441a47[_0xcb80('0x17')][_0xcb80('0x19')]);return _0x52a4fb(_0x441a47['error'][_0xcb80('0x19')]);}else{logger[_0xcb80('0x12')](_0xcb80('0x13'),_0x40c8c0,_0xcb80('0x14'));_0x52a4fb(_0x441a47[_0xcb80('0x1a')][_0xcb80('0x19')]);}})['catch'](function(_0x136022){logger[_0xcb80('0x17')]('ChatMessage,\x20%s,\x20%s',_0x40c8c0,_0x136022);_0x4661e5(_0x136022);});});}exports[_0xcb80('0x1b')]=function(_0x6b9b22){var _0x28cf7b=this;return new Promise(function(_0x274252,_0x21b3e5){return db['ChatMessage'][_0xcb80('0x1c')](_0x6b9b22['body'],{'raw':_0x6b9b22['options']?_0x6b9b22[_0xcb80('0x1d')][_0xcb80('0x1e')]===undefined?!![]:![]:!![]})[_0xcb80('0x11')](function(_0x477fd2){logger[_0xcb80('0x12')]('CreateChatMessage',_0x6b9b22);logger[_0xcb80('0x1f')](_0xcb80('0x1b'),_0x6b9b22,JSON['stringify'](_0x477fd2));_0x274252(_0x477fd2);})[_0xcb80('0x20')](function(_0xb65236){logger[_0xcb80('0x17')]('CreateChatMessage',_0xb65236[_0xcb80('0x19')],_0x6b9b22);_0x21b3e5(_0x28cf7b[_0xcb80('0x17')](0x1f4,_0xb65236['message']));});});};
\ No newline at end of file
+var _0x343b=['redis','localhost','register','request','then','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatMessage','create','options','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http'];(function(_0x2df9bd,_0x3e001d){var _0x3564eb=function(_0x522f6f){while(--_0x522f6f){_0x2df9bd['push'](_0x2df9bd['shift']());}};_0x3564eb(++_0x3e001d);}(_0x343b,0x147));var _0xb343=function(_0x49700d,_0x104ec2){_0x49700d=_0x49700d-0x0;var _0x4c8bed=_0x343b[_0x49700d];return _0x4c8bed;};'use strict';var _=require(_0xb343('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xb343('0x1'));var rs=require(_0xb343('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb343('0x3'))['db'];var utils=require(_0xb343('0x4'));var logger=require(_0xb343('0x5'))(_0xb343('0x6'));var config=require(_0xb343('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xb343('0x8')]({'port':0x232a});config[_0xb343('0x9')]=_['defaults'](config['redis'],{'host':_0xb343('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb343('0x9')]));require('./chatMessage.socket')[_0xb343('0xb')](socket);function respondWithRpcPromise(_0x5037de,_0x5b5d35,_0x294291){return new BPromise(function(_0x12389d,_0x5f2d0b){return client[_0xb343('0xc')](_0x5037de,_0x294291)[_0xb343('0xd')](function(_0x532dca){logger['info'](_0xb343('0xe'),_0x5b5d35,_0xb343('0xf'));logger[_0xb343('0x10')](_0xb343('0x11'),_0x5b5d35,_0xb343('0xf'),JSON[_0xb343('0x12')](_0x532dca));if(_0x532dca['error']){if(_0x532dca[_0xb343('0x13')][_0xb343('0x14')]===0x1f4){logger[_0xb343('0x13')](_0xb343('0xe'),_0x5b5d35,_0x532dca[_0xb343('0x13')][_0xb343('0x15')]);return _0x5f2d0b(_0x532dca[_0xb343('0x13')]['message']);}logger[_0xb343('0x13')](_0xb343('0xe'),_0x5b5d35,_0x532dca[_0xb343('0x13')][_0xb343('0x15')]);return _0x12389d(_0x532dca[_0xb343('0x13')]['message']);}else{logger[_0xb343('0x16')](_0xb343('0xe'),_0x5b5d35,_0xb343('0xf'));_0x12389d(_0x532dca[_0xb343('0x17')][_0xb343('0x15')]);}})[_0xb343('0x18')](function(_0x1a7fc1){logger['error'](_0xb343('0xe'),_0x5b5d35,_0x1a7fc1);_0x5f2d0b(_0x1a7fc1);});});}exports['CreateChatMessage']=function(_0x2fd4d0){var _0x26626e=this;return new Promise(function(_0x406b85,_0x5b176b){return db[_0xb343('0x19')][_0xb343('0x1a')](_0x2fd4d0['body'],{'raw':_0x2fd4d0[_0xb343('0x1b')]?_0x2fd4d0[_0xb343('0x1b')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x1f2f96){logger[_0xb343('0x16')]('CreateChatMessage',_0x2fd4d0);logger['debug']('CreateChatMessage',_0x2fd4d0,JSON[_0xb343('0x12')](_0x1f2f96));_0x406b85(_0x1f2f96);})[_0xb343('0x18')](function(_0x452381){logger[_0xb343('0x13')]('CreateChatMessage',_0x452381[_0xb343('0x15')],_0x2fd4d0);_0x5b176b(_0x26626e[_0xb343('0x13')](0x1f4,_0x452381[_0xb343('0x15')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 20556b8..716ab02 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 _0xcb99=['chatMessage:','./chatMessage.events','remove','emit','removeListener','length'];(function(_0x4fec8b,_0xbf11e3){var _0x2741bb=function(_0x6d951a){while(--_0x6d951a){_0x4fec8b['push'](_0x4fec8b['shift']());}};_0x2741bb(++_0xbf11e3);}(_0xcb99,0x8b));var _0x9cb9=function(_0x356127,_0x4873ac){_0x356127=_0x356127-0x0;var _0x5d4c75=_0xcb99[_0x356127];return _0x5d4c75;};'use strict';var ChatMessageEvents=require(_0x9cb9('0x0'));var events=['save',_0x9cb9('0x1'),'update'];function createListener(_0x480364,_0x3a2f21){return function(_0x1308a8){_0x3a2f21[_0x9cb9('0x2')](_0x480364,_0x1308a8);};}function removeListener(_0x51f2ee,_0x167735){return function(){ChatMessageEvents[_0x9cb9('0x3')](_0x51f2ee,_0x167735);};}exports['register']=function(_0x214b72){for(var _0x509cfc=0x0,_0x2ed26a=events[_0x9cb9('0x4')];_0x509cfc<_0x2ed26a;_0x509cfc++){var _0x1bf9b7=events[_0x509cfc];var _0x1dd62f=createListener(_0x9cb9('0x5')+_0x1bf9b7,_0x214b72);ChatMessageEvents['on'](_0x1bf9b7,_0x1dd62f);}};
\ No newline at end of file
+var _0x6aa7=['update','emit','length','chatMessage:','./chatMessage.events','remove'];(function(_0x2dc343,_0xf015a2){var _0x51eac5=function(_0x1adfef){while(--_0x1adfef){_0x2dc343['push'](_0x2dc343['shift']());}};_0x51eac5(++_0xf015a2);}(_0x6aa7,0x178));var _0x76aa=function(_0x5ea0e1,_0x56f64a){_0x5ea0e1=_0x5ea0e1-0x0;var _0x1132a0=_0x6aa7[_0x5ea0e1];return _0x1132a0;};'use strict';var ChatMessageEvents=require(_0x76aa('0x0'));var events=['save',_0x76aa('0x1'),_0x76aa('0x2')];function createListener(_0x25c818,_0x2db4fe){return function(_0x4f007e){_0x2db4fe[_0x76aa('0x3')](_0x25c818,_0x4f007e);};}function removeListener(_0xef15ef,_0x1d6e04){return function(){ChatMessageEvents['removeListener'](_0xef15ef,_0x1d6e04);};}exports['register']=function(_0x1aceaa){for(var _0x4d53f6=0x0,_0x32dee5=events[_0x76aa('0x4')];_0x4d53f6<_0x32dee5;_0x4d53f6++){var _0xa9b695=events[_0x4d53f6];var _0x56d6bc=createListener(_0x76aa('0x5')+_0xa9b695,_0x1aceaa);ChatMessageEvents['on'](_0xa9b695,_0x56d6bc);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index 6d16ab7..75afea2 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 _0x41cb=['/:id','update','put','accept','/:id/reject','reject','multer','util','path','Router','../../components/auth/service','../../config/environment','./chatMessage.controller','isAuthenticated','index','get','/describe','describe','show','chat','chatmessage:create','create'];(function(_0x55e08b,_0x421620){var _0xd1a7ff=function(_0x58c7ff){while(--_0x58c7ff){_0x55e08b['push'](_0x55e08b['shift']());}};_0xd1a7ff(++_0x421620);}(_0x41cb,0xa0));var _0xb41c=function(_0x4043be,_0x33604e){_0x4043be=_0x4043be-0x0;var _0x30e2ae=_0x41cb[_0x4043be];return _0x30e2ae;};'use strict';var multer=require(_0xb41c('0x0'));var util=require(_0xb41c('0x1'));var path=require(_0xb41c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb41c('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0xb41c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb41c('0x5'));var controller=require(_0xb41c('0x6'));router['get']('/',auth[_0xb41c('0x7')](),controller[_0xb41c('0x8')]);router[_0xb41c('0x9')](_0xb41c('0xa'),auth[_0xb41c('0x7')](),controller[_0xb41c('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xb41c('0xc')]);router['post']('/',auth[_0xb41c('0x7')](),interaction['tracked'](_0xb41c('0xd'),_0xb41c('0xe')),controller[_0xb41c('0xf')]);router['put'](_0xb41c('0x10'),controller[_0xb41c('0x11')]);router[_0xb41c('0x12')]('/:id/accept',auth['isAuthenticated'](),controller[_0xb41c('0x13')]);router[_0xb41c('0x12')](_0xb41c('0x14'),auth['isAuthenticated'](),controller[_0xb41c('0x15')]);router['delete'](_0xb41c('0x10'),auth[_0xb41c('0x7')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x82f5=['exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','/:id/accept','accept','/:id/reject','reject','destroy'];(function(_0x34aa52,_0x1d765f){var _0xe82a4b=function(_0x338bd4){while(--_0x338bd4){_0x34aa52['push'](_0x34aa52['shift']());}};_0xe82a4b(++_0x1d765f);}(_0x82f5,0xa2));var _0x582f=function(_0x326eca,_0x4301f3){_0x326eca=_0x326eca-0x0;var _0x308b3e=_0x82f5[_0x326eca];return _0x308b3e;};'use strict';var multer=require(_0x582f('0x0'));var util=require(_0x582f('0x1'));var path=require(_0x582f('0x2'));var timeout=require('connect-timeout');var express=require(_0x582f('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x582f('0x4'));var interaction=require(_0x582f('0x5'));var config=require(_0x582f('0x6'));var controller=require(_0x582f('0x7'));router[_0x582f('0x8')]('/',auth[_0x582f('0x9')](),controller['index']);router['get']('/describe',auth[_0x582f('0x9')](),controller[_0x582f('0xa')]);router[_0x582f('0x8')](_0x582f('0xb'),auth[_0x582f('0x9')](),controller[_0x582f('0xc')]);router[_0x582f('0xd')]('/',auth[_0x582f('0x9')](),interaction['tracked']('chat','chatmessage:create'),controller[_0x582f('0xe')]);router[_0x582f('0xf')](_0x582f('0xb'),controller[_0x582f('0x10')]);router[_0x582f('0xf')](_0x582f('0x11'),auth[_0x582f('0x9')](),controller[_0x582f('0x12')]);router[_0x582f('0xf')](_0x582f('0x13'),auth[_0x582f('0x9')](),controller[_0x582f('0x14')]);router['delete'](_0x582f('0xb'),auth[_0x582f('0x9')](),controller[_0x582f('0x15')]);module[_0x582f('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index f1f5ead..dd2cca2 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x14e1cb,_0xd3465e){_0x14e1cb=_0x14e1cb-0x0;var _0x18a337=_0x0b0e[_0x14e1cb];return _0x18a337;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'plainBody':{'type':Sequelize[_0xe0b0('0x1')](_0xe0b0('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xadb5=['medium','TEXT','exports'];(function(_0x5a774b,_0x1d38fe){var _0x3a2a39=function(_0x27d527){while(--_0x27d527){_0x5a774b['push'](_0x5a774b['shift']());}};_0x3a2a39(++_0x1d38fe);}(_0xadb5,0xad));var _0x5adb=function(_0x4fdc2d,_0x408750){_0x4fdc2d=_0x4fdc2d-0x0;var _0x2ff331=_0xadb5[_0x4fdc2d];return _0x2ff331;};'use strict';var Sequelize=require('sequelize');module[_0x5adb('0x0')]={'body':{'type':Sequelize['TEXT'](_0x5adb('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x5adb('0x2')](_0x5adb('0x1')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 1faf35d..23e59d3 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(_0x4fe0eb,_0x2cfd55){var _0xf43153=function(_0x3e6502){while(--_0x3e6502){_0x4fe0eb['push'](_0x4fe0eb['shift']());}};_0xf43153(++_0x2cfd55);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 _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(_0x7d1762,_0x172c9c){var _0x252065=function(_0x499745){while(--_0x499745){_0x7d1762['push'](_0x7d1762['shift']());}};_0x252065(++_0x172c9c);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index 1b1afc3..5229a6f 100644
--- a/server/api/chatOfflineMessage/chatOfflineMessage.events.js
+++ b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x19d1=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x1eb3c6,_0x2cc1e4){var _0x1627e9=function(_0x10aa23){while(--_0x10aa23){_0x1eb3c6['push'](_0x1eb3c6['shift']());}};_0x1627e9(++_0x2cc1e4);}(_0x19d1,0x16c));var _0x119d=function(_0x3f9704,_0x1b2bc3){_0x3f9704=_0x3f9704-0x0;var _0x2ebc59=_0x19d1[_0x3f9704];return _0x2ebc59;};'use strict';var EventEmitter=require(_0x119d('0x0'));var ChatOfflineMessage=require(_0x119d('0x1'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x119d('0x2')](0x0);var events={'afterCreate':_0x119d('0x3'),'afterUpdate':_0x119d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2bc80e){return function(_0x4dd235,_0x4239d3,_0x336986){ChatOfflineMessageEvents[_0x119d('0x5')](_0x2bc80e+':'+_0x4dd235['id'],_0x4dd235);ChatOfflineMessageEvents[_0x119d('0x5')](_0x2bc80e,_0x4dd235);_0x336986(null);};}for(var e in events){if(events[_0x119d('0x6')](e)){var event=events[e];ChatOfflineMessage[_0x119d('0x7')](e,emitEvent(event));}}module[_0x119d('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x9085=['update','emit','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x52dd39,_0xdb90a5){var _0x1d4076=function(_0x19c184){while(--_0x19c184){_0x52dd39['push'](_0x52dd39['shift']());}};_0x1d4076(++_0xdb90a5);}(_0x9085,0xaf));var _0x5908=function(_0x3e8270,_0x293590){_0x3e8270=_0x3e8270-0x0;var _0x1ccde9=_0x9085[_0x3e8270];return _0x1ccde9;};'use strict';var EventEmitter=require(_0x5908('0x0'));var ChatOfflineMessage=require(_0x5908('0x1'))['db'][_0x5908('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x5908('0x3')](0x0);var events={'afterCreate':_0x5908('0x4'),'afterUpdate':_0x5908('0x5'),'afterDestroy':'remove'};function emitEvent(_0xa71a41){return function(_0x494add,_0x83e03a,_0x228e8e){ChatOfflineMessageEvents[_0x5908('0x6')](_0xa71a41+':'+_0x494add['id'],_0x494add);ChatOfflineMessageEvents[_0x5908('0x6')](_0xa71a41,_0x494add);_0x228e8e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0x5908('0x7')](e,emitEvent(event));}}module[_0x5908('0x8')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 36ad84e..48aa39a 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 _0x4758=['ChatOfflineMessage','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define'];(function(_0x596a17,_0x4ba425){var _0x41319b=function(_0x227715){while(--_0x227715){_0x596a17['push'](_0x596a17['shift']());}};_0x41319b(++_0x4ba425);}(_0x4758,0x8a));var _0x8475=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4758[_0x321bb2];return _0x9c12ed;};'use strict';var attributes=require(_0x8475('0x0'));module['exports']=function(_0x2294fa){return _0x2294fa[_0x8475('0x1')](_0x8475('0x2'),attributes,{'tableName':_0x8475('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x8475('0x4')});};
\ No newline at end of file
+var _0x9cef=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','define','utf8mb4'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0x9cef,0x131));var _0xf9ce=function(_0xf61586,_0x56b0c4){_0xf61586=_0xf61586-0x0;var _0x2b6eb3=_0x9cef[_0xf61586];return _0x2b6eb3;};'use strict';var attributes=require(_0xf9ce('0x0'));module['exports']=function(_0xf32d5f){return _0xf32d5f[_0xf9ce('0x1')]('ChatOfflineMessage',attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf9ce('0x2'),'collate':_0xf9ce('0x3')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 8403ef5..8ce78ae 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 _0xd0a2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0xbce40f,_0xd74797){var _0x57326d=function(_0x3605e2){while(--_0x3605e2){_0xbce40f['push'](_0xbce40f['shift']());}};_0x57326d(++_0xd74797);}(_0xd0a2,0x128));var _0x2d0a=function(_0x1c1172,_0x27c3c4){_0x1c1172=_0x1c1172-0x0;var _0x300943=_0xd0a2[_0x1c1172];return _0x300943;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2d0a('0x0'));var BPromise=require(_0x2d0a('0x1'));var rs=require(_0x2d0a('0x2'));var fs=require('fs');var Redis=require(_0x2d0a('0x3'));var db=require(_0x2d0a('0x4'))['db'];var utils=require(_0x2d0a('0x5'));var logger=require(_0x2d0a('0x6'))(_0x2d0a('0x7'));var config=require(_0x2d0a('0x8'));var jayson=require(_0x2d0a('0x9'));var client=jayson[_0x2d0a('0xa')][_0x2d0a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4017a3,_0x2d29d3,_0x3887bf){return new BPromise(function(_0x504776,_0xd487f2){return client[_0x2d0a('0xc')](_0x4017a3,_0x3887bf)[_0x2d0a('0xd')](function(_0x5b17a3){logger[_0x2d0a('0xe')](_0x2d0a('0xf'),_0x2d29d3,_0x2d0a('0x10'));logger[_0x2d0a('0x11')](_0x2d0a('0x12'),_0x2d29d3,_0x2d0a('0x10'),JSON[_0x2d0a('0x13')](_0x5b17a3));if(_0x5b17a3[_0x2d0a('0x14')]){if(_0x5b17a3['error'][_0x2d0a('0x15')]===0x1f4){logger[_0x2d0a('0x14')](_0x2d0a('0xf'),_0x2d29d3,_0x5b17a3[_0x2d0a('0x14')][_0x2d0a('0x16')]);return _0xd487f2(_0x5b17a3['error'][_0x2d0a('0x16')]);}logger[_0x2d0a('0x14')](_0x2d0a('0xf'),_0x2d29d3,_0x5b17a3['error'][_0x2d0a('0x16')]);return _0x504776(_0x5b17a3[_0x2d0a('0x14')][_0x2d0a('0x16')]);}else{logger['info'](_0x2d0a('0xf'),_0x2d29d3,_0x2d0a('0x10'));_0x504776(_0x5b17a3[_0x2d0a('0x17')][_0x2d0a('0x16')]);}})[_0x2d0a('0x18')](function(_0x63a465){logger[_0x2d0a('0x14')](_0x2d0a('0xf'),_0x2d29d3,_0x63a465);_0xd487f2(_0x63a465);});});}
\ No newline at end of file
+var _0x5010=['../../config/utils','../../config/logger','rpc','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x32c709,_0x15d4ae){var _0x23ec4e=function(_0x5e963d){while(--_0x5e963d){_0x32c709['push'](_0x32c709['shift']());}};_0x23ec4e(++_0x15d4ae);}(_0x5010,0x1c9));var _0x0501=function(_0x2a82fc,_0x22523a){_0x2a82fc=_0x2a82fc-0x0;var _0x427429=_0x5010[_0x2a82fc];return _0x427429;};'use strict';var _=require(_0x0501('0x0'));var util=require(_0x0501('0x1'));var moment=require(_0x0501('0x2'));var BPromise=require(_0x0501('0x3'));var rs=require(_0x0501('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0501('0x5'));var logger=require(_0x0501('0x6'))(_0x0501('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x0501('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x50e612,_0x59cbfe,_0x1630d0){return new BPromise(function(_0x91a886,_0x3fb18d){return client[_0x0501('0x9')](_0x50e612,_0x1630d0)[_0x0501('0xa')](function(_0x4838cd){logger[_0x0501('0xb')](_0x0501('0xc'),_0x59cbfe,_0x0501('0xd'));logger[_0x0501('0xe')](_0x0501('0xf'),_0x59cbfe,'request\x20sent',JSON['stringify'](_0x4838cd));if(_0x4838cd['error']){if(_0x4838cd[_0x0501('0x10')][_0x0501('0x11')]===0x1f4){logger[_0x0501('0x10')](_0x0501('0xc'),_0x59cbfe,_0x4838cd[_0x0501('0x10')][_0x0501('0x12')]);return _0x3fb18d(_0x4838cd[_0x0501('0x10')]['message']);}logger[_0x0501('0x10')]('ChatOfflineMessage,\x20%s,\x20%s',_0x59cbfe,_0x4838cd[_0x0501('0x10')][_0x0501('0x12')]);return _0x91a886(_0x4838cd[_0x0501('0x10')][_0x0501('0x12')]);}else{logger[_0x0501('0xb')](_0x0501('0xc'),_0x59cbfe,_0x0501('0xd'));_0x91a886(_0x4838cd[_0x0501('0x13')][_0x0501('0x12')]);}})[_0x0501('0x14')](function(_0xef187d){logger['error'](_0x0501('0xc'),_0x59cbfe,_0xef187d);_0x3fb18d(_0xef187d);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 345c30b..b27fd0f 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 _0x9488=['util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','exports','multer'];(function(_0x2df016,_0x3827c7){var _0x3e9f39=function(_0x2567e9){while(--_0x2567e9){_0x2df016['push'](_0x2df016['shift']());}};_0x3e9f39(++_0x3827c7);}(_0x9488,0x68));var _0x8948=function(_0x4ec891,_0x18a97c){_0x4ec891=_0x4ec891-0x0;var _0x4c158f=_0x9488[_0x4ec891];return _0x4c158f;};'use strict';var multer=require(_0x8948('0x0'));var util=require(_0x8948('0x1'));var path=require(_0x8948('0x2'));var timeout=require(_0x8948('0x3'));var express=require(_0x8948('0x4'));var router=express[_0x8948('0x5')]();var fs_extra=require(_0x8948('0x6'));var auth=require(_0x8948('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x8948('0x8'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth[_0x8948('0x9')](),controller[_0x8948('0xa')]);router['get'](_0x8948('0xb'),auth[_0x8948('0x9')](),controller[_0x8948('0xc')]);router['get'](_0x8948('0xd'),auth[_0x8948('0x9')](),controller[_0x8948('0xe')]);router[_0x8948('0xf')]('/',auth[_0x8948('0x9')](),controller[_0x8948('0x10')]);router[_0x8948('0x11')]('/:id',auth[_0x8948('0x9')](),controller[_0x8948('0x12')]);router[_0x8948('0x13')](_0x8948('0xd'),auth[_0x8948('0x9')](),controller['destroy']);module[_0x8948('0x14')]=router;
\ No newline at end of file
+var _0xd1bf=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','describe','/:id','post','create','put','update','delete','exports','multer','util','path'];(function(_0x16f569,_0x23fca5){var _0x28e8c7=function(_0x11e752){while(--_0x11e752){_0x16f569['push'](_0x16f569['shift']());}};_0x28e8c7(++_0x23fca5);}(_0xd1bf,0x1e0));var _0xfd1b=function(_0x2815b1,_0x3b1592){_0x2815b1=_0x2815b1-0x0;var _0x107b89=_0xd1bf[_0x2815b1];return _0x107b89;};'use strict';var multer=require(_0xfd1b('0x0'));var util=require(_0xfd1b('0x1'));var path=require(_0xfd1b('0x2'));var timeout=require(_0xfd1b('0x3'));var express=require(_0xfd1b('0x4'));var router=express[_0xfd1b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xfd1b('0x6'));var interaction=require(_0xfd1b('0x7'));var config=require(_0xfd1b('0x8'));var controller=require(_0xfd1b('0x9'));router[_0xfd1b('0xa')]('/',auth[_0xfd1b('0xb')](),controller[_0xfd1b('0xc')]);router[_0xfd1b('0xa')]('/describe',auth[_0xfd1b('0xb')](),controller[_0xfd1b('0xd')]);router[_0xfd1b('0xa')](_0xfd1b('0xe'),auth[_0xfd1b('0xb')](),controller['show']);router[_0xfd1b('0xf')]('/',auth['isAuthenticated'](),controller[_0xfd1b('0x10')]);router[_0xfd1b('0x11')](_0xfd1b('0xe'),auth[_0xfd1b('0xb')](),controller[_0xfd1b('0x12')]);router[_0xfd1b('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xfd1b('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 33e2753..92da297 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 _0x9df5=['STRING','ENUM','mouseOver','INTEGER','exports'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x9df5,0x11c));var _0x59df=function(_0xa2efdb,_0x788be8){_0xa2efdb=_0xa2efdb-0x0;var _0x2b11a0=_0x9df5[_0xa2efdb];return _0x2b11a0;};'use strict';var Sequelize=require('sequelize');module[_0x59df('0x0')]={'name':{'type':Sequelize[_0x59df('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x59df('0x2')](_0x59df('0x3'),'timeout'),'defaultValue':_0x59df('0x3')},'selector':{'type':Sequelize[_0x59df('0x1')]},'timeout':{'type':Sequelize[_0x59df('0x4')]}};
\ No newline at end of file
+var _0xacff=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xacff,0x158));var _0xfacf=function(_0x1d5133,_0xdc49a8){_0x1d5133=_0x1d5133-0x0;var _0x280af7=_0xacff[_0x1d5133];return _0x280af7;};'use strict';var Sequelize=require(_0xfacf('0x0'));module[_0xfacf('0x1')]={'name':{'type':Sequelize[_0xfacf('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xfacf('0x3')](_0xfacf('0x4'),_0xfacf('0x5')),'defaultValue':_0xfacf('0x4')},'selector':{'type':Sequelize[_0xfacf('0x2')]},'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 9c2d410..6695937 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 _0x4074=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../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','count','offset','Content-Range','apply','save','update','destroy','error','stack','name','show','params','model','query','keys','filters','intersection','attributes','fields','includeAll','include','options','find','catch','create','ChatProactiveAction','body','then'];(function(_0x4b2863,_0x494899){var _0x567d67=function(_0x751f03){while(--_0x751f03){_0x4b2863['push'](_0x4b2863['shift']());}};_0x567d67(++_0x494899);}(_0x4074,0xf0));var _0x4407=function(_0x4fe942,_0x422dbc){_0x4fe942=_0x4fe942-0x0;var _0x5287df=_0x4074[_0x4fe942];return _0x5287df;};'use strict';var emlformat=require(_0x4407('0x0'));var rimraf=require(_0x4407('0x1'));var zipdir=require(_0x4407('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4407('0x3'));var moment=require(_0x4407('0x4'));var BPromise=require(_0x4407('0x5'));var Mustache=require(_0x4407('0x6'));var util=require(_0x4407('0x7'));var path=require(_0x4407('0x8'));var sox=require(_0x4407('0x9'));var csv=require(_0x4407('0xa'));var ejs=require(_0x4407('0xb'));var fs=require('fs');var fs_extra=require(_0x4407('0xc'));var _=require('lodash');var squel=require(_0x4407('0xd'));var crypto=require('crypto');var jsforce=require(_0x4407('0xe'));var deskjs=require(_0x4407('0xf'));var toCsv=require(_0x4407('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x4407('0x10'));var qs=require(_0x4407('0x11'));var as=require(_0x4407('0x12'));var hardwareService=require(_0x4407('0x13'));var logger=require(_0x4407('0x14'))(_0x4407('0x15'));var utils=require(_0x4407('0x16'));var config=require(_0x4407('0x17'));var licenseUtil=require(_0x4407('0x18'));var db=require(_0x4407('0x19'))['db'];function respondWithStatusCode(_0x14f398,_0x5d0c41){_0x5d0c41=_0x5d0c41||0xcc;return function(_0x3f8f23){if(_0x3f8f23){return _0x14f398[_0x4407('0x1a')](_0x5d0c41);}return _0x14f398['status'](_0x5d0c41)[_0x4407('0x1b')]();};}function respondWithResult(_0x4c62b9,_0x1d2ec8){_0x1d2ec8=_0x1d2ec8||0xc8;return function(_0x27724a){if(_0x27724a){return _0x4c62b9[_0x4407('0x1c')](_0x1d2ec8)[_0x4407('0x1d')](_0x27724a);}};}function respondWithFilteredResult(_0x1840dd,_0x417e19){return function(_0x1c5a0c){if(_0x1c5a0c){var _0x2e709f=typeof _0x417e19['offset']===_0x4407('0x1e')&&typeof _0x417e19[_0x4407('0x1f')]===_0x4407('0x1e');var _0x367d55=_0x1c5a0c[_0x4407('0x20')];var _0x5b50b7=_0x2e709f?0x0:_0x417e19[_0x4407('0x21')];var _0x54caa1=_0x2e709f?_0x1c5a0c[_0x4407('0x20')]:_0x417e19[_0x4407('0x21')]+_0x417e19[_0x4407('0x1f')];var _0x2db8b2;if(_0x54caa1>=_0x367d55){_0x54caa1=_0x367d55;_0x2db8b2=0xc8;}else{_0x2db8b2=0xce;}_0x1840dd[_0x4407('0x1c')](_0x2db8b2);return _0x1840dd['set'](_0x4407('0x22'),_0x5b50b7+'-'+_0x54caa1+'/'+_0x367d55)['json'](_0x1c5a0c);}return null;};}function patchUpdates(_0x36a948){return function(_0x28bb2c){try{jsonpatch[_0x4407('0x23')](_0x28bb2c,_0x36a948,!![]);}catch(_0x445fe6){return BPromise['reject'](_0x445fe6);}return _0x28bb2c[_0x4407('0x24')]();};}function saveUpdates(_0x1fa9f1,_0x137f8e){return function(_0x2c880a){if(_0x2c880a){return _0x2c880a[_0x4407('0x25')](_0x1fa9f1)['then'](function(_0xa7265d){return _0xa7265d;});}return null;};}function removeEntity(_0x16272f,_0x5e214c){return function(_0x21b048){if(_0x21b048){return _0x21b048[_0x4407('0x26')]()['then'](function(){_0x16272f[_0x4407('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x309274,_0x5386f4){return function(_0x40fb1e){if(!_0x40fb1e){_0x309274['sendStatus'](0x194);}return _0x40fb1e;};}function handleError(_0x374754,_0x4bf227){_0x4bf227=_0x4bf227||0x1f4;return function(_0x57ba27){logger[_0x4407('0x27')](_0x57ba27[_0x4407('0x28')]);if(_0x57ba27[_0x4407('0x29')]){delete _0x57ba27['name'];}_0x374754['status'](_0x4bf227)['send'](_0x57ba27);};}exports[_0x4407('0x2a')]=function(_0x2feb6b,_0x1f9828){var _0x84a8a={'raw':!![],'where':{'id':_0x2feb6b[_0x4407('0x2b')]['id']}},_0x1d6b3d={};_0x1d6b3d[_0x4407('0x2c')]=_['keys'](db['ChatProactiveAction']['rawAttributes']);_0x1d6b3d[_0x4407('0x2d')]=_[_0x4407('0x2e')](_0x2feb6b[_0x4407('0x2d')]);_0x1d6b3d[_0x4407('0x2f')]=_[_0x4407('0x30')](_0x1d6b3d[_0x4407('0x2c')],_0x1d6b3d[_0x4407('0x2d')]);_0x84a8a[_0x4407('0x31')]=_[_0x4407('0x30')](_0x1d6b3d[_0x4407('0x2c')],qs['fields'](_0x2feb6b['query'][_0x4407('0x32')]));_0x84a8a[_0x4407('0x31')]=_0x84a8a[_0x4407('0x31')]['length']?_0x84a8a[_0x4407('0x31')]:_0x1d6b3d[_0x4407('0x2c')];if(_0x2feb6b[_0x4407('0x2d')][_0x4407('0x33')]){_0x84a8a[_0x4407('0x34')]=[{'all':!![]}];}_0x84a8a=_['merge']({},_0x84a8a,_0x2feb6b[_0x4407('0x35')]);return db['ChatProactiveAction'][_0x4407('0x36')](_0x84a8a)['then'](handleEntityNotFound(_0x1f9828,null))['then'](respondWithResult(_0x1f9828,null))[_0x4407('0x37')](handleError(_0x1f9828,null));};exports[_0x4407('0x38')]=function(_0x3aa619,_0x3a9537){return db[_0x4407('0x39')][_0x4407('0x38')](_0x3aa619[_0x4407('0x3a')],{})['then'](respondWithResult(_0x3a9537,0xc9))[_0x4407('0x37')](handleError(_0x3a9537,null));};exports[_0x4407('0x25')]=function(_0x189dd0,_0x4e068f){if(_0x189dd0[_0x4407('0x3a')]['id']){delete _0x189dd0['body']['id'];}return db[_0x4407('0x39')]['find']({'where':{'id':_0x189dd0[_0x4407('0x2b')]['id']}})[_0x4407('0x3b')](handleEntityNotFound(_0x4e068f,null))[_0x4407('0x3b')](saveUpdates(_0x189dd0[_0x4407('0x3a')],null))['then'](respondWithResult(_0x4e068f,null))[_0x4407('0x37')](handleError(_0x4e068f,null));};exports[_0x4407('0x26')]=function(_0xd31d71,_0x1bf4e2){return db[_0x4407('0x39')][_0x4407('0x36')]({'where':{'id':_0xd31d71[_0x4407('0x2b')]['id']}})[_0x4407('0x3b')](handleEntityNotFound(_0x1bf4e2,null))[_0x4407('0x3b')](removeEntity(_0x1bf4e2,null))['catch'](handleError(_0x1bf4e2,null));};
\ No newline at end of file
+var _0x032e=['to-csv','ejs','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','sendStatus','end','status','json','offset','undefined','limit','count','Content-Range','apply','reject','update','then','error','name','send','params','rawAttributes','query','keys','intersection','model','attributes','fields','length','includeAll','merge','ChatProactiveAction','find','catch','create','body','destroy','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox'];(function(_0x425ecd,_0x21e095){var _0xc4f997=function(_0x5e898a){while(--_0x5e898a){_0x425ecd['push'](_0x425ecd['shift']());}};_0xc4f997(++_0x21e095);}(_0x032e,0x124));var _0xe032=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0x032e[_0x4709c0];return _0x13348b;};'use strict';var emlformat=require(_0xe032('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xe032('0x1'));var jsonpatch=require(_0xe032('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe032('0x3'));var Mustache=require(_0xe032('0x4'));var util=require(_0xe032('0x5'));var path=require(_0xe032('0x6'));var sox=require(_0xe032('0x7'));var csv=require(_0xe032('0x8'));var ejs=require(_0xe032('0x9'));var fs=require('fs');var fs_extra=require(_0xe032('0xa'));var _=require(_0xe032('0xb'));var squel=require(_0xe032('0xc'));var crypto=require(_0xe032('0xd'));var jsforce=require(_0xe032('0xe'));var deskjs=require(_0xe032('0xf'));var toCsv=require(_0xe032('0x8'));var querystring=require(_0xe032('0x10'));var Papa=require(_0xe032('0x11'));var Redis=require(_0xe032('0x12'));var authService=require(_0xe032('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xe032('0x14'));var hardwareService=require(_0xe032('0x15'));var logger=require(_0xe032('0x16'))(_0xe032('0x17'));var utils=require(_0xe032('0x18'));var config=require(_0xe032('0x19'));var licenseUtil=require(_0xe032('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x646979,_0x266d71){_0x266d71=_0x266d71||0xcc;return function(_0x28c2b6){if(_0x28c2b6){return _0x646979[_0xe032('0x1b')](_0x266d71);}return _0x646979['status'](_0x266d71)[_0xe032('0x1c')]();};}function respondWithResult(_0x2e267b,_0x176547){_0x176547=_0x176547||0xc8;return function(_0x422e96){if(_0x422e96){return _0x2e267b[_0xe032('0x1d')](_0x176547)[_0xe032('0x1e')](_0x422e96);}};}function respondWithFilteredResult(_0x2bf528,_0x4da5b7){return function(_0x231c35){if(_0x231c35){var _0x749018=typeof _0x4da5b7[_0xe032('0x1f')]===_0xe032('0x20')&&typeof _0x4da5b7[_0xe032('0x21')]===_0xe032('0x20');var _0x4cdab3=_0x231c35[_0xe032('0x22')];var _0x25cedb=_0x749018?0x0:_0x4da5b7[_0xe032('0x1f')];var _0x41d2a5=_0x749018?_0x231c35[_0xe032('0x22')]:_0x4da5b7['offset']+_0x4da5b7['limit'];var _0x484e6c;if(_0x41d2a5>=_0x4cdab3){_0x41d2a5=_0x4cdab3;_0x484e6c=0xc8;}else{_0x484e6c=0xce;}_0x2bf528[_0xe032('0x1d')](_0x484e6c);return _0x2bf528['set'](_0xe032('0x23'),_0x25cedb+'-'+_0x41d2a5+'/'+_0x4cdab3)[_0xe032('0x1e')](_0x231c35);}return null;};}function patchUpdates(_0x3f0257){return function(_0x2aa342){try{jsonpatch[_0xe032('0x24')](_0x2aa342,_0x3f0257,!![]);}catch(_0x256f71){return BPromise[_0xe032('0x25')](_0x256f71);}return _0x2aa342['save']();};}function saveUpdates(_0x32f8b6,_0x866c81){return function(_0x232e8f){if(_0x232e8f){return _0x232e8f[_0xe032('0x26')](_0x32f8b6)[_0xe032('0x27')](function(_0x33d89a){return _0x33d89a;});}return null;};}function removeEntity(_0x22831a,_0xe89aa7){return function(_0x499da5){if(_0x499da5){return _0x499da5['destroy']()['then'](function(){_0x22831a[_0xe032('0x1d')](0xcc)[_0xe032('0x1c')]();});}};}function handleEntityNotFound(_0x302559,_0x2a56e5){return function(_0x2bfe8f){if(!_0x2bfe8f){_0x302559[_0xe032('0x1b')](0x194);}return _0x2bfe8f;};}function handleError(_0x36ece7,_0x2b6ffa){_0x2b6ffa=_0x2b6ffa||0x1f4;return function(_0x4dcbf1){logger[_0xe032('0x28')](_0x4dcbf1['stack']);if(_0x4dcbf1[_0xe032('0x29')]){delete _0x4dcbf1[_0xe032('0x29')];}_0x36ece7[_0xe032('0x1d')](_0x2b6ffa)[_0xe032('0x2a')](_0x4dcbf1);};}exports['show']=function(_0x5573e4,_0x3e2575){var _0x38e7ea={'raw':!![],'where':{'id':_0x5573e4[_0xe032('0x2b')]['id']}},_0x469290={};_0x469290['model']=_['keys'](db['ChatProactiveAction'][_0xe032('0x2c')]);_0x469290[_0xe032('0x2d')]=_[_0xe032('0x2e')](_0x5573e4[_0xe032('0x2d')]);_0x469290['filters']=_[_0xe032('0x2f')](_0x469290[_0xe032('0x30')],_0x469290[_0xe032('0x2d')]);_0x38e7ea[_0xe032('0x31')]=_[_0xe032('0x2f')](_0x469290['model'],qs[_0xe032('0x32')](_0x5573e4[_0xe032('0x2d')][_0xe032('0x32')]));_0x38e7ea[_0xe032('0x31')]=_0x38e7ea['attributes'][_0xe032('0x33')]?_0x38e7ea['attributes']:_0x469290[_0xe032('0x30')];if(_0x5573e4['query'][_0xe032('0x34')]){_0x38e7ea['include']=[{'all':!![]}];}_0x38e7ea=_[_0xe032('0x35')]({},_0x38e7ea,_0x5573e4['options']);return db[_0xe032('0x36')][_0xe032('0x37')](_0x38e7ea)['then'](handleEntityNotFound(_0x3e2575,null))[_0xe032('0x27')](respondWithResult(_0x3e2575,null))[_0xe032('0x38')](handleError(_0x3e2575,null));};exports[_0xe032('0x39')]=function(_0x2620d2,_0x4e222c){return db[_0xe032('0x36')]['create'](_0x2620d2[_0xe032('0x3a')],{})[_0xe032('0x27')](respondWithResult(_0x4e222c,0xc9))['catch'](handleError(_0x4e222c,null));};exports[_0xe032('0x26')]=function(_0x23b790,_0x4a4447){if(_0x23b790[_0xe032('0x3a')]['id']){delete _0x23b790[_0xe032('0x3a')]['id'];}return db[_0xe032('0x36')][_0xe032('0x37')]({'where':{'id':_0x23b790[_0xe032('0x2b')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x4a4447,null))[_0xe032('0x27')](saveUpdates(_0x23b790[_0xe032('0x3a')],null))[_0xe032('0x27')](respondWithResult(_0x4a4447,null))[_0xe032('0x38')](handleError(_0x4a4447,null));};exports[_0xe032('0x3b')]=function(_0x432d39,_0x30571c){return db[_0xe032('0x36')][_0xe032('0x37')]({'where':{'id':_0x432d39[_0xe032('0x2b')]['id']}})[_0xe032('0x27')](handleEntityNotFound(_0x30571c,null))['then'](removeEntity(_0x30571c,null))[_0xe032('0x38')](handleError(_0x30571c,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 1408d5a..96e4872 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 _0x27c0=['../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','moment'];(function(_0x58e69d,_0x349893){var _0x2530ac=function(_0x70a89c){while(--_0x70a89c){_0x58e69d['push'](_0x58e69d['shift']());}};_0x2530ac(++_0x349893);}(_0x27c0,0xb5));var _0x027c=function(_0x22c81f,_0x3a3c86){_0x22c81f=_0x22c81f-0x0;var _0x3b897f=_0x27c0[_0x22c81f];return _0x3b897f;};'use strict';var _=require(_0x027c('0x0'));var util=require(_0x027c('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x027c('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x027c('0x3'));var attributes=require(_0x027c('0x4'));module[_0x027c('0x5')]=function(_0xdccf39,_0x194383){return _0xdccf39['define'](_0x027c('0x6'),attributes,{'tableName':_0x027c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x3096=['../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','path','rimraf'];(function(_0x41e435,_0x56382c){var _0x3dfcf1=function(_0x33a02e){while(--_0x33a02e){_0x41e435['push'](_0x41e435['shift']());}};_0x3dfcf1(++_0x56382c);}(_0x3096,0xa1));var _0x6309=function(_0x25fe4f,_0x74aeaa){_0x25fe4f=_0x25fe4f-0x0;var _0x582605=_0x3096[_0x25fe4f];return _0x582605;};'use strict';var _=require(_0x6309('0x0'));var util=require(_0x6309('0x1'));var logger=require(_0x6309('0x2'))('api');var moment=require(_0x6309('0x3'));var BPromise=require(_0x6309('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6309('0x5'));var rimraf=require(_0x6309('0x6'));var config=require(_0x6309('0x7'));var attributes=require(_0x6309('0x8'));module['exports']=function(_0x47bc7f,_0x2e0f58){return _0x47bc7f[_0x6309('0x9')](_0x6309('0xa'),attributes,{'tableName':_0x6309('0xb'),'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 8e5f72d..e24a011 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 _0x6775=['stringify','error','code','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent'];(function(_0x312b37,_0x19f474){var _0x2e5f91=function(_0x19473d){while(--_0x19473d){_0x312b37['push'](_0x312b37['shift']());}};_0x2e5f91(++_0x19f474);}(_0x6775,0xb9));var _0x5677=function(_0x30b91e,_0x2ef4e7){_0x30b91e=_0x30b91e-0x0;var _0x4490c0=_0x6775[_0x30b91e];return _0x4490c0;};'use strict';var _=require(_0x5677('0x0'));var util=require(_0x5677('0x1'));var moment=require(_0x5677('0x2'));var BPromise=require('bluebird');var rs=require(_0x5677('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5677('0x4'));var logger=require(_0x5677('0x5'))(_0x5677('0x6'));var config=require(_0x5677('0x7'));var jayson=require(_0x5677('0x8'));var client=jayson[_0x5677('0x9')][_0x5677('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x388f53,_0x2861fd,_0x4e7394){return new BPromise(function(_0x44ef12,_0x38d1ee){return client['request'](_0x388f53,_0x4e7394)[_0x5677('0xb')](function(_0x521d65){logger[_0x5677('0xc')](_0x5677('0xd'),_0x2861fd,_0x5677('0xe'));logger['debug']('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x2861fd,_0x5677('0xe'),JSON[_0x5677('0xf')](_0x521d65));if(_0x521d65[_0x5677('0x10')]){if(_0x521d65[_0x5677('0x10')][_0x5677('0x11')]===0x1f4){logger[_0x5677('0x10')](_0x5677('0xd'),_0x2861fd,_0x521d65[_0x5677('0x10')][_0x5677('0x12')]);return _0x38d1ee(_0x521d65[_0x5677('0x10')]['message']);}logger[_0x5677('0x10')](_0x5677('0xd'),_0x2861fd,_0x521d65['error']['message']);return _0x44ef12(_0x521d65['error'][_0x5677('0x12')]);}else{logger[_0x5677('0xc')](_0x5677('0xd'),_0x2861fd,_0x5677('0xe'));_0x44ef12(_0x521d65['result'][_0x5677('0x12')]);}})[_0x5677('0x13')](function(_0x406e01){logger[_0x5677('0x10')](_0x5677('0xd'),_0x2861fd,_0x406e01);_0x38d1ee(_0x406e01);});});}
\ No newline at end of file
+var _0x62f8=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','code','ChatProactiveAction,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4265ff,_0x2f7805){var _0x4b2e54=function(_0x1c0a1c){while(--_0x1c0a1c){_0x4265ff['push'](_0x4265ff['shift']());}};_0x4b2e54(++_0x2f7805);}(_0x62f8,0x1d4));var _0x862f=function(_0x477126,_0x4c08d2){_0x477126=_0x477126-0x0;var _0x13ff93=_0x62f8[_0x477126];return _0x13ff93;};'use strict';var _=require(_0x862f('0x0'));var util=require(_0x862f('0x1'));var moment=require(_0x862f('0x2'));var BPromise=require(_0x862f('0x3'));var rs=require(_0x862f('0x4'));var fs=require('fs');var Redis=require(_0x862f('0x5'));var db=require(_0x862f('0x6'))['db'];var utils=require(_0x862f('0x7'));var logger=require(_0x862f('0x8'))(_0x862f('0x9'));var config=require('../../config/environment');var jayson=require(_0x862f('0xa'));var client=jayson[_0x862f('0xb')][_0x862f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2baa83,_0x55aeca,_0x4b561e){return new BPromise(function(_0x79b1ef,_0x4dc780){return client[_0x862f('0xd')](_0x2baa83,_0x4b561e)[_0x862f('0xe')](function(_0x2201cc){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x55aeca,_0x862f('0xf'));logger['debug'](_0x862f('0x10'),_0x55aeca,_0x862f('0xf'),JSON[_0x862f('0x11')](_0x2201cc));if(_0x2201cc['error']){if(_0x2201cc['error'][_0x862f('0x12')]===0x1f4){logger['error'](_0x862f('0x13'),_0x55aeca,_0x2201cc[_0x862f('0x14')][_0x862f('0x15')]);return _0x4dc780(_0x2201cc[_0x862f('0x14')][_0x862f('0x15')]);}logger['error'](_0x862f('0x13'),_0x55aeca,_0x2201cc[_0x862f('0x14')][_0x862f('0x15')]);return _0x79b1ef(_0x2201cc[_0x862f('0x14')]['message']);}else{logger[_0x862f('0x16')](_0x862f('0x13'),_0x55aeca,_0x862f('0xf'));_0x79b1ef(_0x2201cc[_0x862f('0x17')][_0x862f('0x15')]);}})[_0x862f('0x18')](function(_0x51ec6a){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x55aeca,_0x51ec6a);_0x4dc780(_0x51ec6a);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 6320354..6e3a893 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 _0xeec6=['multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated','post','create','put','update','delete','exports'];(function(_0x48ec4a,_0x88c5ff){var _0x6561b7=function(_0x14e73c){while(--_0x14e73c){_0x48ec4a['push'](_0x48ec4a['shift']());}};_0x6561b7(++_0x88c5ff);}(_0xeec6,0x1c2));var _0x6eec=function(_0x5534fe,_0x43c22e){_0x5534fe=_0x5534fe-0x0;var _0x3d1dc2=_0xeec6[_0x5534fe];return _0x3d1dc2;};'use strict';var multer=require(_0x6eec('0x0'));var util=require(_0x6eec('0x1'));var path=require(_0x6eec('0x2'));var timeout=require(_0x6eec('0x3'));var express=require('express');var router=express[_0x6eec('0x4')]();var fs_extra=require(_0x6eec('0x5'));var auth=require(_0x6eec('0x6'));var interaction=require(_0x6eec('0x7'));var config=require(_0x6eec('0x8'));var controller=require(_0x6eec('0x9'));router['get'](_0x6eec('0xa'),auth[_0x6eec('0xb')](),controller['show']);router[_0x6eec('0xc')]('/',auth[_0x6eec('0xb')](),controller[_0x6eec('0xd')]);router[_0x6eec('0xe')]('/:id',auth[_0x6eec('0xb')](),controller[_0x6eec('0xf')]);router[_0x6eec('0x10')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x6eec('0x11')]=router;
\ No newline at end of file
+var _0x6aa7=['/:id','show','post','isAuthenticated','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x4a1160,_0x4dcde3){var _0x1963f9=function(_0x22d4fc){while(--_0x22d4fc){_0x4a1160['push'](_0x4a1160['shift']());}};_0x1963f9(++_0x4dcde3);}(_0x6aa7,0x178));var _0x76aa=function(_0x393cf5,_0x50e0db){_0x393cf5=_0x393cf5-0x0;var _0x5c5be5=_0x6aa7[_0x393cf5];return _0x5c5be5;};'use strict';var multer=require(_0x76aa('0x0'));var util=require('util');var path=require(_0x76aa('0x1'));var timeout=require(_0x76aa('0x2'));var express=require(_0x76aa('0x3'));var router=express[_0x76aa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x76aa('0x5'));var interaction=require(_0x76aa('0x6'));var config=require(_0x76aa('0x7'));var controller=require('./chatProactiveAction.controller');router['get'](_0x76aa('0x8'),auth['isAuthenticated'](),controller[_0x76aa('0x9')]);router[_0x76aa('0xa')]('/',auth[_0x76aa('0xb')](),controller['create']);router[_0x76aa('0xc')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller['update']);router[_0x76aa('0xd')](_0x76aa('0x8'),auth[_0x76aa('0xb')](),controller[_0x76aa('0xe')]);module[_0x76aa('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index a184f1b..d4ed627 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 _0x4a93=['beepall','roundrobin','STRING','name','INTEGER','rrmemory'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x4a93,0x98));var _0x34a9=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0x4a93[_0x476bf4];return _0x788ffe;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x34a9('0x0')],'unique':_0x34a9('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x34a9('0x0')]},'timeout':{'type':Sequelize[_0x34a9('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x34a9('0x3'),_0x34a9('0x4'),_0x34a9('0x5'))}};
\ No newline at end of file
+var _0xdad7=['rrmemory','beepall','exports','name','STRING','ENUM'];(function(_0xa3afcd,_0x6f9288){var _0x5e83d3=function(_0x4fe87a){while(--_0x4fe87a){_0xa3afcd['push'](_0xa3afcd['shift']());}};_0x5e83d3(++_0x6f9288);}(_0xdad7,0xce));var _0x7dad=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xdad7[_0x9df060];return _0x338dfe;};'use strict';var Sequelize=require('sequelize');module[_0x7dad('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x7dad('0x1'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7dad('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7dad('0x3')](_0x7dad('0x4'),_0x7dad('0x5'),'roundrobin')}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index f81bbfa..32e578c 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 _0xb739=['ChatQueue','include','query','findAll','rows','params','filters','intersection','model','fields','attributes','length','includeAll','merge','options','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','keys','UserChatQueue','hasOwnProperty','sort','pick','ChatQueueId','User','findAndCountAll','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','order','filter','nolimit','addTeams','ids','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','emit','userChatQueue:save','removeTeams','Team','select','field','tq.TeamId','join','user_has_teams','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','union','compact','value','isEmpty','removeAgents','forEach','userChatQueue:remove','addAgents','spread','isArray','getAgents','util','lodash','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','end','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','get','UserProfileResource','sendStatus','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','getOptions','where'];(function(_0x170bff,_0x31c89b){var _0xbe234e=function(_0x18a41d){while(--_0x18a41d){_0x170bff['push'](_0x170bff['shift']());}};_0xbe234e(++_0x31c89b);}(_0xb739,0x1c9));var _0x9b73=function(_0x5e0bfe,_0x747312){_0x5e0bfe=_0x5e0bfe-0x0;var _0x6468b8=_0xb739[_0x5e0bfe];return _0x6468b8;};'use strict';var BPromise=require('bluebird');var util=require(_0x9b73('0x0'));var _=require(_0x9b73('0x1'));var squel=require('squel');var Redis=require('ioredis');var qs=require(_0x9b73('0x2'));var logger=require(_0x9b73('0x3'))(_0x9b73('0x4'));var config=require('../../config/environment');var db=require(_0x9b73('0x5'))['db'];config[_0x9b73('0x6')]=_[_0x9b73('0x7')](config[_0x9b73('0x6')],{'host':_0x9b73('0x8'),'port':0x18eb});var socket=require(_0x9b73('0x9'))(new Redis(config[_0x9b73('0x6')]));require(_0x9b73('0xa'))[_0x9b73('0xb')](socket);function respondWithStatusCode(_0x4898c5,_0x5a4100){_0x5a4100=_0x5a4100||0xcc;return function(_0x17b966){if(_0x17b966){return _0x4898c5['sendStatus'](_0x5a4100);}return _0x4898c5['status'](_0x5a4100)[_0x9b73('0xc')]();};}function respondWithResult(_0x43daec,_0xa55abb){_0xa55abb=_0xa55abb||0xc8;return function(_0x20dc37){if(_0x20dc37){return _0x43daec[_0x9b73('0xd')](_0xa55abb)[_0x9b73('0xe')](_0x20dc37);}};}function respondWithFilteredResult(_0x27ac3a,_0x21bb8d){return function(_0x3d1a76){if(_0x3d1a76){var _0x5ab05f=typeof _0x21bb8d[_0x9b73('0xf')]===_0x9b73('0x10')&&typeof _0x21bb8d[_0x9b73('0x11')]===_0x9b73('0x10');var _0x4cd027=_0x3d1a76[_0x9b73('0x12')];var _0x400fa4=_0x5ab05f?0x0:_0x21bb8d[_0x9b73('0xf')];var _0x83199c=_0x5ab05f?_0x3d1a76[_0x9b73('0x12')]:_0x21bb8d['offset']+_0x21bb8d['limit'];var _0x35698e;if(_0x83199c>=_0x4cd027){_0x83199c=_0x4cd027;_0x35698e=0xc8;}else{_0x35698e=0xce;}_0x27ac3a[_0x9b73('0xd')](_0x35698e);return _0x27ac3a[_0x9b73('0x13')](_0x9b73('0x14'),_0x400fa4+'-'+_0x83199c+'/'+_0x4cd027)[_0x9b73('0xe')](_0x3d1a76);}return null;};}function saveUpdates(_0xccb9b0){return function(_0x2e844e){if(_0x2e844e){return _0x2e844e[_0x9b73('0x15')](_0xccb9b0)[_0x9b73('0x16')](function(_0x33c703){return _0x33c703;});}return null;};}function removeEntity(_0x5c6f92){return function(_0x4d570a){if(_0x4d570a){return _0x4d570a[_0x9b73('0x17')]()['then'](function(){var _0x35a871=_0x4d570a[_0x9b73('0x18')]({'plain':!![]});var _0x2e76ea='ChatQueues';return db[_0x9b73('0x19')]['destroy']({'where':{'type':_0x2e76ea,'resourceId':_0x35a871['id']}})[_0x9b73('0x16')](function(){return _0x4d570a;});})['then'](function(){_0x5c6f92[_0x9b73('0xd')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9518d5){return function(_0x467c91){if(!_0x467c91){_0x9518d5[_0x9b73('0x1a')](0x194);}return _0x467c91;};}function handleError(_0xab1469,_0x4b0ef0){_0x4b0ef0=_0x4b0ef0||0x1f4;return function(_0x478f7e){logger[_0x9b73('0x1b')](_0x478f7e[_0x9b73('0x1c')]);if(_0x478f7e[_0x9b73('0x1d')]){delete _0x478f7e['name'];}_0xab1469[_0x9b73('0xd')](_0x4b0ef0)[_0x9b73('0x1e')](_0x478f7e);};}exports[_0x9b73('0x1f')]=function(_0x4d0b82,_0x28c42e){var _0x1e0694={};var _0x121aa1={'count':0x0,'rows':[]};var _0x54940c=_[_0x9b73('0x20')](db['ChatQueue'][_0x9b73('0x21')],function(_0x58e67f){return{'name':_0x58e67f[_0x9b73('0x22')],'type':_0x58e67f[_0x9b73('0x23')][_0x9b73('0x24')]};});_0x1e0694=qs[_0x9b73('0x25')](_0x54940c,_0x4d0b82);var _0x5ce8b7={'where':_0x1e0694[_0x9b73('0x26')]};return db[_0x9b73('0x27')][_0x9b73('0x12')](_0x5ce8b7)[_0x9b73('0x16')](function(_0x30a40b){_0x121aa1['count']=_0x30a40b;_0x1e0694[_0x9b73('0x28')]=qs['include'](_0x4d0b82[_0x9b73('0x29')]);return db[_0x9b73('0x27')][_0x9b73('0x2a')](_0x1e0694);})[_0x9b73('0x16')](function(_0xc66f96){_0x121aa1[_0x9b73('0x2b')]=_0xc66f96;return _0x121aa1;})[_0x9b73('0x16')](respondWithFilteredResult(_0x28c42e,_0x1e0694))['catch'](handleError(_0x28c42e,null));};exports['show']=function(_0x3c1b6c,_0x1a82d8){var _0x39635f={'raw':!![],'where':{'id':_0x3c1b6c[_0x9b73('0x2c')]['id']}},_0x108686={};_0x108686['model']=_['keys'](db[_0x9b73('0x27')]['rawAttributes']);_0x108686['query']=_['keys'](_0x3c1b6c[_0x9b73('0x29')]);_0x108686[_0x9b73('0x2d')]=_[_0x9b73('0x2e')](_0x108686[_0x9b73('0x2f')],_0x108686[_0x9b73('0x29')]);_0x39635f['attributes']=_['intersection'](_0x108686[_0x9b73('0x2f')],qs[_0x9b73('0x30')](_0x3c1b6c[_0x9b73('0x29')][_0x9b73('0x30')]));_0x39635f[_0x9b73('0x31')]=_0x39635f[_0x9b73('0x31')][_0x9b73('0x32')]?_0x39635f[_0x9b73('0x31')]:_0x108686[_0x9b73('0x2f')];if(_0x3c1b6c[_0x9b73('0x29')][_0x9b73('0x33')]){_0x39635f[_0x9b73('0x28')]=[{'all':!![]}];}_0x39635f=_[_0x9b73('0x34')]({},_0x39635f,_0x3c1b6c[_0x9b73('0x35')]);return db['ChatQueue'][_0x9b73('0x36')](_0x39635f)[_0x9b73('0x16')](handleEntityNotFound(_0x1a82d8,null))[_0x9b73('0x16')](respondWithResult(_0x1a82d8,null))[_0x9b73('0x37')](handleError(_0x1a82d8,null));};exports['create']=function(_0x1574d1,_0x1da5c0){return db['ChatQueue'][_0x9b73('0x38')](_0x1574d1[_0x9b73('0x39')],{})[_0x9b73('0x16')](function(_0x3ce799){var _0x2fb54d=_0x1574d1[_0x9b73('0x3a')]['get']({'plain':!![]});if(!_0x2fb54d)throw new Error(_0x9b73('0x3b'));if(_0x2fb54d[_0x9b73('0x3c')]==='user'){var _0x424eb0=_0x3ce799[_0x9b73('0x18')]({'plain':!![]});var _0x4bef2c=_0x9b73('0x3d');return db['UserProfileSection']['find']({'where':{'name':_0x4bef2c,'userProfileId':_0x2fb54d[_0x9b73('0x3e')]},'raw':!![]})[_0x9b73('0x16')](function(_0x3d024b){if(_0x3d024b&&_0x3d024b[_0x9b73('0x3f')]===0x0){return db[_0x9b73('0x19')][_0x9b73('0x38')]({'name':_0x424eb0[_0x9b73('0x1d')],'resourceId':_0x424eb0['id'],'type':_0x3d024b[_0x9b73('0x1d')],'sectionId':_0x3d024b['id']},{})['then'](function(){return _0x3ce799;});}else{return _0x3ce799;}})['catch'](function(_0x4e9cfe){logger['error'](_0x9b73('0x40'),_0x4e9cfe);throw _0x4e9cfe;});}return _0x3ce799;})[_0x9b73('0x16')](respondWithResult(_0x1da5c0,0xc9))['catch'](handleError(_0x1da5c0,null));};exports[_0x9b73('0x15')]=function(_0x480f09,_0x1c88e9){if(_0x480f09[_0x9b73('0x39')]['id']){delete _0x480f09[_0x9b73('0x39')]['id'];}return db['ChatQueue'][_0x9b73('0x36')]({'where':{'id':_0x480f09['params']['id']}})['then'](handleEntityNotFound(_0x1c88e9,null))[_0x9b73('0x16')](saveUpdates(_0x480f09['body'],null))[_0x9b73('0x16')](respondWithResult(_0x1c88e9,null))[_0x9b73('0x37')](handleError(_0x1c88e9,null));};exports[_0x9b73('0x17')]=function(_0x283833,_0x3d0bdb){return db[_0x9b73('0x27')][_0x9b73('0x36')]({'where':{'id':_0x283833[_0x9b73('0x2c')]['id']}})[_0x9b73('0x16')](handleEntityNotFound(_0x3d0bdb,null))[_0x9b73('0x16')](removeEntity(_0x3d0bdb,null))[_0x9b73('0x37')](handleError(_0x3d0bdb,null));};exports[_0x9b73('0x41')]=function(_0x11e899,_0x29262a){return db[_0x9b73('0x27')][_0x9b73('0x41')]()['then'](respondWithResult(_0x29262a,null))[_0x9b73('0x37')](handleError(_0x29262a,null));};exports['getMembers']=function(_0x5e3dfd,_0x765a31){var _0x2443d7={'raw':!![],'where':{}},_0x3a099c={},_0xbb3f86;return db['ChatQueue'][_0x9b73('0x42')]({'where':{'id':_0x5e3dfd['params']['id']}})[_0x9b73('0x16')](handleEntityNotFound(_0x765a31,null))[_0x9b73('0x16')](function(_0xe19526){if(_0xe19526){_0xbb3f86=_0xe19526['get']({'plain':!![]});_0x3a099c[_0x9b73('0x2f')]=_[_0x9b73('0x43')](db[_0x9b73('0x44')][_0x9b73('0x21')]);_0x3a099c[_0x9b73('0x29')]=_[_0x9b73('0x43')](_0x5e3dfd[_0x9b73('0x29')]);_0x3a099c['filters']=_[_0x9b73('0x2e')](_0x3a099c[_0x9b73('0x2f')],_0x3a099c[_0x9b73('0x29')]);_0x2443d7[_0x9b73('0x31')]=_[_0x9b73('0x2e')](_0x3a099c['model'],qs[_0x9b73('0x30')](_0x5e3dfd[_0x9b73('0x29')][_0x9b73('0x30')]));_0x2443d7[_0x9b73('0x31')]=_0x2443d7[_0x9b73('0x31')][_0x9b73('0x32')]?_0x2443d7['attributes']:_0x3a099c[_0x9b73('0x2f')];if(!_0x5e3dfd[_0x9b73('0x29')][_0x9b73('0x45')]('nolimit')){_0x2443d7[_0x9b73('0x11')]=qs[_0x9b73('0x11')](_0x5e3dfd[_0x9b73('0x29')][_0x9b73('0x11')]);_0x2443d7[_0x9b73('0xf')]=qs['offset'](_0x5e3dfd[_0x9b73('0x29')]['offset']);}_0x2443d7['order']=qs['sort'](_0x5e3dfd['query'][_0x9b73('0x46')]);_0x2443d7[_0x9b73('0x26')]=qs[_0x9b73('0x2d')](_[_0x9b73('0x47')](_0x5e3dfd[_0x9b73('0x29')],_0x3a099c['filters']));_0x2443d7[_0x9b73('0x26')][_0x9b73('0x48')]=_0xe19526['id'];if(_0x5e3dfd[_0x9b73('0x29')]['filter']){_0x2443d7['where']=_[_0x9b73('0x34')](_0x2443d7[_0x9b73('0x26')],{'$or':_[_0x9b73('0x20')](_0x2443d7[_0x9b73('0x31')],function(_0x1f342a){var _0x15d7c2={};_0x15d7c2[_0x1f342a]={'$like':'%'+_0x5e3dfd['query']['filter']+'%'};return _0x15d7c2;})});}_0x2443d7=_[_0x9b73('0x34')]({},_0x2443d7,_0x5e3dfd['options']);return db[_0x9b73('0x44')][_0x9b73('0x2a')](_0x2443d7);}})['then'](function(_0xd48ed4){if(_0xd48ed4){return db[_0x9b73('0x49')][_0x9b73('0x4a')]({'where':{'id':_[_0x9b73('0x20')](_0xd48ed4,'UserId'),'role':'agent'},'attributes':['id',_0x9b73('0x1d'),_0x9b73('0x4b'),_0x9b73('0x4c'),_0x9b73('0x4d')]});}})[_0x9b73('0x16')](function(_0x4eb95a){if(_0x4eb95a){return{'count':_0x4eb95a[_0x9b73('0x12')],'rows':_[_0x9b73('0x20')](_0x4eb95a['rows'],function(_0x15e9e9){return{'membername':_0x15e9e9['name'],'UserId':_0x15e9e9['id'],'queue_name':_0xbb3f86['name'],'ChatQueueId':_0xbb3f86['id'],'interface':util[_0x9b73('0x4e')](_0x9b73('0x4f'),'SIP',_0x15e9e9['name']),'penalty':0x0,'paused':_0x15e9e9['chatPause'],'createdAt':_0x15e9e9[_0x9b73('0x4d')],'updatedAt':_0x15e9e9[_0x9b73('0x4c')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x765a31,_0x2443d7))[_0x9b73('0x37')](handleError(_0x765a31,null));};exports[_0x9b73('0x50')]=function(_0x55b3a1,_0x4fdbb6){var _0x521b1b={};var _0x1adc09={};var _0x505a4f;var _0x427b3c;return db[_0x9b73('0x27')][_0x9b73('0x42')]({'where':{'id':_0x55b3a1[_0x9b73('0x2c')]['id']}})[_0x9b73('0x16')](handleEntityNotFound(_0x4fdbb6,null))[_0x9b73('0x16')](function(_0x8e0fbd){if(_0x8e0fbd){_0x505a4f=_0x8e0fbd;_0x1adc09['model']=_[_0x9b73('0x43')](db['Team']['rawAttributes']);_0x1adc09[_0x9b73('0x29')]=_[_0x9b73('0x43')](_0x55b3a1['query']);_0x1adc09[_0x9b73('0x2d')]=_[_0x9b73('0x2e')](_0x1adc09[_0x9b73('0x2f')],_0x1adc09[_0x9b73('0x29')]);_0x521b1b[_0x9b73('0x31')]=_[_0x9b73('0x2e')](_0x1adc09[_0x9b73('0x2f')],qs[_0x9b73('0x30')](_0x55b3a1[_0x9b73('0x29')][_0x9b73('0x30')]));_0x521b1b['attributes']=_0x521b1b[_0x9b73('0x31')]['length']?_0x521b1b[_0x9b73('0x31')]:_0x1adc09[_0x9b73('0x2f')];_0x521b1b[_0x9b73('0x51')]=qs['sort'](_0x55b3a1[_0x9b73('0x29')][_0x9b73('0x46')]);_0x521b1b[_0x9b73('0x26')]=qs[_0x9b73('0x2d')](_[_0x9b73('0x47')](_0x55b3a1[_0x9b73('0x29')],_0x1adc09[_0x9b73('0x2d')]));if(_0x55b3a1[_0x9b73('0x29')][_0x9b73('0x52')]){_0x521b1b[_0x9b73('0x26')]=_[_0x9b73('0x34')](_0x521b1b[_0x9b73('0x26')],{'$or':_['map'](_0x521b1b[_0x9b73('0x31')],function(_0x1b6018){var _0x23c480={};_0x23c480[_0x1b6018]={'$like':'%'+_0x55b3a1[_0x9b73('0x29')][_0x9b73('0x52')]+'%'};return _0x23c480;})});}_0x521b1b=_[_0x9b73('0x34')]({},_0x521b1b,_0x55b3a1[_0x9b73('0x35')]);return _0x505a4f[_0x9b73('0x50')](_0x521b1b);}})[_0x9b73('0x16')](function(_0x3571a9){if(_0x3571a9){_0x427b3c=_0x3571a9[_0x9b73('0x32')];if(!_0x55b3a1[_0x9b73('0x29')]['hasOwnProperty'](_0x9b73('0x53'))){_0x521b1b['limit']=qs[_0x9b73('0x11')](_0x55b3a1[_0x9b73('0x29')]['limit']);_0x521b1b[_0x9b73('0xf')]=qs['offset'](_0x55b3a1['query']['offset']);}return _0x505a4f['getTeams'](_0x521b1b);}})[_0x9b73('0x16')](function(_0x20a160){if(_0x20a160){return _0x20a160?{'count':_0x427b3c,'rows':_0x20a160}:null;}})['then'](respondWithResult(_0x4fdbb6,null))['catch'](handleError(_0x4fdbb6,null));};exports[_0x9b73('0x54')]=function(_0x1311e7,_0x3accee){var _0x424937=_0x1311e7['body'][_0x9b73('0x55')];return db['Team'][_0x9b73('0x2a')]({'where':{'id':_0x424937},'attributes':['id'],'include':[{'model':db[_0x9b73('0x49')],'as':_0x9b73('0x56'),'attributes':['id','name',_0x9b73('0x57'),_0x9b73('0x58'),_0x9b73('0x59')],'raw':!![]}]})[_0x9b73('0x16')](function(_0x10034c){if(_0x10034c){var _0x3cac4a=_[_0x9b73('0x5a')](_0x10034c,function(_0x174691){var _0x320b7e=_0x174691[_0x9b73('0x18')]({'plain':!![]});return _0x320b7e[_0x9b73('0x56')];});return db['ChatQueue'][_0x9b73('0x36')]({'where':{'id':_0x1311e7[_0x9b73('0x2c')]['id']}})[_0x9b73('0x16')](function(_0x13783c){return db[_0x9b73('0x5b')][_0x9b73('0x5c')](function(_0x2cd54f){return _0x13783c[_0x9b73('0x54')](_0x424937,{'transaction':_0x2cd54f})[_0x9b73('0x16')](function(){return BPromise[_0x9b73('0x5d')](_0x3cac4a,function(_0x43349f){return db['UserChatQueue'][_0x9b73('0x5e')]({'where':{'UserId':_0x43349f['id'],'ChatQueueId':_0x1311e7[_0x9b73('0x2c')]['id']},'transaction':_0x2cd54f});});})[_0x9b73('0x16')](function(){_0x3cac4a['forEach'](function(_0x537327){socket[_0x9b73('0x5f')](_0x9b73('0x60'),{'UserId':_0x537327['id'],'ChatQueueId':_0x13783c['id']});});});});});}})[_0x9b73('0x16')](respondWithStatusCode(_0x3accee,null))[_0x9b73('0x37')](handleError(_0x3accee,null));};exports[_0x9b73('0x61')]=function(_0x2257ee,_0x27fab0){return db[_0x9b73('0x62')][_0x9b73('0x2a')]({'where':{'id':_0x2257ee['query'][_0x9b73('0x55')]},'attributes':['id'],'include':[{'model':db[_0x9b73('0x49')],'as':_0x9b73('0x56'),'attributes':['id'],'raw':!![]}]})[_0x9b73('0x16')](handleEntityNotFound(_0x27fab0,null))['then'](function(_0x36f049){var _0x480781=_['map'](_0x36f049,'id');var _0x52de91=[];var _0x5c3691=[];var _0x175533=squel[_0x9b73('0x63')]();_0x175533[_0x9b73('0x64')](_0x9b73('0x65'))['from']('team_has_chat_queues','tq')[_0x9b73('0x66')](_0x9b73('0x67'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9b73('0x68'),_0x2257ee[_0x9b73('0x2c')]['id']);for(var _0x4b211b=0x0;_0x4b211b<_0x36f049[_0x9b73('0x32')];_0x4b211b+=0x1){let _0x2683bb=_0x36f049[_0x4b211b];for(var _0x611874=0x0;_0x611874<_0x2683bb[_0x9b73('0x56')][_0x9b73('0x32')];_0x611874+=0x1){let _0x48e0d4=_0x2683bb[_0x9b73('0x56')][_0x611874];var _0x54749e=_0x175533[_0x9b73('0x69')]();_0x54749e[_0x9b73('0x26')](_0x9b73('0x6a'),_0x48e0d4['id']);_0x5c3691[_0x9b73('0x6b')](db[_0x9b73('0x5b')]['query'](_0x54749e[_0x9b73('0x6c')](),{'type':db[_0x9b73('0x5b')][_0x9b73('0x6d')][_0x9b73('0x6e')]})[_0x9b73('0x16')](function(_0x2f6649){if(_0x2f6649['length']===0x1){return _0x48e0d4['id'];}else{var _0x34e6a0=_[_0x9b73('0x6f')](_['map'](_0x2f6649,'TeamId'),function(_0x327cfa){return _[_0x9b73('0x70')](_0x480781,_0x327cfa);});if(_0x34e6a0){return _0x48e0d4['id'];}}}));}}return BPromise['all'](_0x5c3691)[_0x9b73('0x16')](function(_0x342315){_0x52de91=_(_0x52de91)[_0x9b73('0x71')](_0x342315)[_0x9b73('0x72')]()[_0x9b73('0x73')]();return db[_0x9b73('0x27')]['find']({'where':{'id':_0x2257ee[_0x9b73('0x2c')]['id']}})[_0x9b73('0x16')](function(_0x32d5c0){return db[_0x9b73('0x5b')][_0x9b73('0x5c')](function(_0x38589f){return _0x32d5c0[_0x9b73('0x61')](_0x2257ee[_0x9b73('0x29')][_0x9b73('0x55')],{'transaction':_0x38589f})[_0x9b73('0x16')](function(){if(!_[_0x9b73('0x74')](_0x52de91)){return _0x32d5c0[_0x9b73('0x75')](_0x52de91,{'transaction':_0x38589f});}})['then'](function(){_0x52de91[_0x9b73('0x76')](function(_0x47c77c){socket['emit'](_0x9b73('0x77'),{'UserId':_0x47c77c,'ChatQueueId':_0x32d5c0['id']});});});});});});})[_0x9b73('0x16')](respondWithStatusCode(_0x27fab0,null))['catch'](handleError(_0x27fab0,null));};exports['addAgents']=function(_0x1a9084,_0x34567f){return db[_0x9b73('0x27')][_0x9b73('0x36')]({'where':{'id':_0x1a9084['params']['id']}})[_0x9b73('0x16')](handleEntityNotFound(_0x34567f,null))[_0x9b73('0x16')](function(_0x6c204e){if(_0x6c204e){return _0x6c204e[_0x9b73('0x78')](_0x1a9084[_0x9b73('0x39')]['ids'],_['omit'](_0x1a9084[_0x9b73('0x39')],[_0x9b73('0x55'),'id'])||{})[_0x9b73('0x79')](function(_0x2e8b9b){for(var _0x4b0712=0x0;_0x4b0712<_0x1a9084[_0x9b73('0x39')][_0x9b73('0x55')][_0x9b73('0x32')];_0x4b0712+=0x1){socket[_0x9b73('0x5f')](_0x9b73('0x60'),{'UserId':Number(_0x1a9084[_0x9b73('0x39')][_0x9b73('0x55')][_0x4b0712]),'ChatQueueId':Number(_0x1a9084[_0x9b73('0x2c')]['id'])});}return _0x2e8b9b;});}})[_0x9b73('0x16')](respondWithResult(_0x34567f,null))[_0x9b73('0x37')](handleError(_0x34567f,null));};exports['removeAgents']=function(_0x5c4909,_0x399ff2){return db[_0x9b73('0x27')][_0x9b73('0x36')]({'where':{'id':_0x5c4909[_0x9b73('0x2c')]['id']}})[_0x9b73('0x16')](handleEntityNotFound(_0x399ff2,null))['then'](function(_0x59b4fe){if(_0x59b4fe){return _0x59b4fe[_0x9b73('0x75')](_0x5c4909[_0x9b73('0x29')][_0x9b73('0x55')])[_0x9b73('0x16')](function(){if(_[_0x9b73('0x7a')](_0x5c4909[_0x9b73('0x29')]['ids'])){for(var _0x94db3a=0x0;_0x94db3a<_0x5c4909[_0x9b73('0x29')][_0x9b73('0x55')][_0x9b73('0x32')];_0x94db3a+=0x1){socket[_0x9b73('0x5f')]('userChatQueue:remove',{'UserId':Number(_0x5c4909[_0x9b73('0x29')]['ids'][_0x94db3a]),'ChatQueueId':Number(_0x5c4909[_0x9b73('0x2c')]['id'])});}}else{socket[_0x9b73('0x5f')]('userChatQueue:remove',{'UserId':Number(_0x5c4909[_0x9b73('0x29')][_0x9b73('0x55')]),'ChatQueueId':Number(_0x5c4909[_0x9b73('0x2c')]['id'])});}});}})[_0x9b73('0x16')](respondWithStatusCode(_0x399ff2,null))[_0x9b73('0x37')](handleError(_0x399ff2,null));};exports[_0x9b73('0x7b')]=function(_0x38ca45,_0x2c9b19){var _0x3b709b={};var _0x2388bc={};var _0x49d4fa;var _0x36c083;return db[_0x9b73('0x27')]['findOne']({'where':{'id':_0x38ca45[_0x9b73('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2c9b19,null))[_0x9b73('0x16')](function(_0x4e06e7){if(_0x4e06e7){_0x49d4fa=_0x4e06e7;_0x2388bc[_0x9b73('0x2f')]=_[_0x9b73('0x43')](db['User'][_0x9b73('0x21')]);_0x2388bc[_0x9b73('0x29')]=_['keys'](_0x38ca45[_0x9b73('0x29')]);_0x2388bc[_0x9b73('0x2d')]=_['intersection'](_0x2388bc[_0x9b73('0x2f')],_0x2388bc[_0x9b73('0x29')]);_0x3b709b[_0x9b73('0x31')]=_[_0x9b73('0x2e')](_0x2388bc[_0x9b73('0x2f')],qs[_0x9b73('0x30')](_0x38ca45[_0x9b73('0x29')]['fields']));_0x3b709b[_0x9b73('0x31')]=_0x3b709b[_0x9b73('0x31')]['length']?_0x3b709b[_0x9b73('0x31')]:_0x2388bc[_0x9b73('0x2f')];_0x3b709b[_0x9b73('0x51')]=qs[_0x9b73('0x46')](_0x38ca45['query'][_0x9b73('0x46')]);_0x3b709b['where']=qs[_0x9b73('0x2d')](_[_0x9b73('0x47')](_0x38ca45[_0x9b73('0x29')],_0x2388bc[_0x9b73('0x2d')]));if(_0x38ca45[_0x9b73('0x29')][_0x9b73('0x52')]){_0x3b709b[_0x9b73('0x26')]=_[_0x9b73('0x34')](_0x3b709b[_0x9b73('0x26')],{'$or':_[_0x9b73('0x20')](_0x3b709b['attributes'],function(_0x24bbe6){var _0x470796={};_0x470796[_0x24bbe6]={'$like':'%'+_0x38ca45['query']['filter']+'%'};return _0x470796;})});}_0x3b709b=_[_0x9b73('0x34')]({},_0x3b709b,_0x38ca45[_0x9b73('0x35')]);return _0x49d4fa['getAgents'](_0x3b709b);}})['then'](function(_0x5c46e0){if(_0x5c46e0){_0x36c083=_0x5c46e0[_0x9b73('0x32')];if(!_0x38ca45['query']['hasOwnProperty'](_0x9b73('0x53'))){_0x3b709b[_0x9b73('0x11')]=qs['limit'](_0x38ca45['query'][_0x9b73('0x11')]);_0x3b709b[_0x9b73('0xf')]=qs[_0x9b73('0xf')](_0x38ca45[_0x9b73('0x29')][_0x9b73('0xf')]);}return _0x49d4fa[_0x9b73('0x7b')](_0x3b709b);}})['then'](function(_0x49c08c){if(_0x49c08c){return _0x49c08c?{'count':_0x36c083,'rows':_0x49c08c}:null;}})[_0x9b73('0x16')](respondWithResult(_0x2c9b19,null))[_0x9b73('0x37')](handleError(_0x2c9b19,null));};
\ No newline at end of file
+var _0x414e=['removeAgents','addAgents','omit','spread','userChatQueue:remove','getAgents','order','pick','bluebird','util','lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','offset','undefined','count','set','Content-Range','json','update','then','get','ChatQueues','UserProfileResource','destroy','error','stack','name','send','index','map','ChatQueue','rawAttributes','fieldName','key','getOptions','include','query','rows','catch','show','params','model','keys','intersection','attributes','fields','length','includeAll','merge','options','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','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','limit','sort','filters','where','ChatQueueId','filter','User','UserId','createdAt','format','SIP','chatPause','Team','nolimit','getTeams','addTeams','ids','findAll','Agents','online','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','QueryTypes','includes','all','union','compact','isEmpty'];(function(_0x50183e,_0xdf79c1){var _0x289ae3=function(_0x316978){while(--_0x316978){_0x50183e['push'](_0x50183e['shift']());}};_0x289ae3(++_0xdf79c1);}(_0x414e,0x83));var _0xe414=function(_0x115cd8,_0x20557d){_0x115cd8=_0x115cd8-0x0;var _0x33f9eb=_0x414e[_0x115cd8];return _0x33f9eb;};'use strict';var BPromise=require(_0xe414('0x0'));var util=require(_0xe414('0x1'));var _=require(_0xe414('0x2'));var squel=require('squel');var Redis=require(_0xe414('0x3'));var qs=require(_0xe414('0x4'));var logger=require(_0xe414('0x5'))(_0xe414('0x6'));var config=require('../../config/environment');var db=require(_0xe414('0x7'))['db'];config[_0xe414('0x8')]=_[_0xe414('0x9')](config['redis'],{'host':_0xe414('0xa'),'port':0x18eb});var socket=require(_0xe414('0xb'))(new Redis(config[_0xe414('0x8')]));require('./chatQueue.socket')[_0xe414('0xc')](socket);function respondWithStatusCode(_0x5ef285,_0x110a9a){_0x110a9a=_0x110a9a||0xcc;return function(_0x102b9d){if(_0x102b9d){return _0x5ef285[_0xe414('0xd')](_0x110a9a);}return _0x5ef285[_0xe414('0xe')](_0x110a9a)[_0xe414('0xf')]();};}function respondWithResult(_0x2fdbd2,_0x308e80){_0x308e80=_0x308e80||0xc8;return function(_0x5b2eb0){if(_0x5b2eb0){return _0x2fdbd2[_0xe414('0xe')](_0x308e80)['json'](_0x5b2eb0);}};}function respondWithFilteredResult(_0x5d26d8,_0x31a190){return function(_0x1a8995){if(_0x1a8995){var _0x22b1d4=typeof _0x31a190[_0xe414('0x10')]===_0xe414('0x11')&&typeof _0x31a190['limit']===_0xe414('0x11');var _0x80720c=_0x1a8995[_0xe414('0x12')];var _0x25986f=_0x22b1d4?0x0:_0x31a190[_0xe414('0x10')];var _0x453d14=_0x22b1d4?_0x1a8995[_0xe414('0x12')]:_0x31a190[_0xe414('0x10')]+_0x31a190['limit'];var _0x369dce;if(_0x453d14>=_0x80720c){_0x453d14=_0x80720c;_0x369dce=0xc8;}else{_0x369dce=0xce;}_0x5d26d8[_0xe414('0xe')](_0x369dce);return _0x5d26d8[_0xe414('0x13')](_0xe414('0x14'),_0x25986f+'-'+_0x453d14+'/'+_0x80720c)[_0xe414('0x15')](_0x1a8995);}return null;};}function saveUpdates(_0x50a4c4){return function(_0x34847d){if(_0x34847d){return _0x34847d[_0xe414('0x16')](_0x50a4c4)[_0xe414('0x17')](function(_0x9fcaf5){return _0x9fcaf5;});}return null;};}function removeEntity(_0x271341){return function(_0x1ece2e){if(_0x1ece2e){return _0x1ece2e['destroy']()[_0xe414('0x17')](function(){var _0x5cc477=_0x1ece2e[_0xe414('0x18')]({'plain':!![]});var _0x4a4324=_0xe414('0x19');return db[_0xe414('0x1a')][_0xe414('0x1b')]({'where':{'type':_0x4a4324,'resourceId':_0x5cc477['id']}})['then'](function(){return _0x1ece2e;});})[_0xe414('0x17')](function(){_0x271341[_0xe414('0xe')](0xcc)[_0xe414('0xf')]();});}};}function handleEntityNotFound(_0x2400a5){return function(_0x41a169){if(!_0x41a169){_0x2400a5['sendStatus'](0x194);}return _0x41a169;};}function handleError(_0x669617,_0x5414f2){_0x5414f2=_0x5414f2||0x1f4;return function(_0x3ace51){logger[_0xe414('0x1c')](_0x3ace51[_0xe414('0x1d')]);if(_0x3ace51[_0xe414('0x1e')]){delete _0x3ace51['name'];}_0x669617['status'](_0x5414f2)[_0xe414('0x1f')](_0x3ace51);};}exports[_0xe414('0x20')]=function(_0x8dd75f,_0x2fbb3f){var _0x3b7a66={};var _0x35f844={'count':0x0,'rows':[]};var _0x2d73e0=_[_0xe414('0x21')](db[_0xe414('0x22')][_0xe414('0x23')],function(_0x844f52){return{'name':_0x844f52[_0xe414('0x24')],'type':_0x844f52['type'][_0xe414('0x25')]};});_0x3b7a66=qs[_0xe414('0x26')](_0x2d73e0,_0x8dd75f);var _0x52feee={'where':_0x3b7a66['where']};return db[_0xe414('0x22')]['count'](_0x52feee)[_0xe414('0x17')](function(_0x3d1e5d){_0x35f844[_0xe414('0x12')]=_0x3d1e5d;_0x3b7a66[_0xe414('0x27')]=qs['include'](_0x8dd75f[_0xe414('0x28')]);return db[_0xe414('0x22')]['findAll'](_0x3b7a66);})[_0xe414('0x17')](function(_0x205c0d){_0x35f844[_0xe414('0x29')]=_0x205c0d;return _0x35f844;})[_0xe414('0x17')](respondWithFilteredResult(_0x2fbb3f,_0x3b7a66))[_0xe414('0x2a')](handleError(_0x2fbb3f,null));};exports[_0xe414('0x2b')]=function(_0x25f597,_0x8046f0){var _0x40877f={'raw':!![],'where':{'id':_0x25f597[_0xe414('0x2c')]['id']}},_0x4e07a7={};_0x4e07a7[_0xe414('0x2d')]=_[_0xe414('0x2e')](db[_0xe414('0x22')][_0xe414('0x23')]);_0x4e07a7['query']=_[_0xe414('0x2e')](_0x25f597['query']);_0x4e07a7['filters']=_[_0xe414('0x2f')](_0x4e07a7[_0xe414('0x2d')],_0x4e07a7[_0xe414('0x28')]);_0x40877f[_0xe414('0x30')]=_['intersection'](_0x4e07a7[_0xe414('0x2d')],qs['fields'](_0x25f597['query'][_0xe414('0x31')]));_0x40877f[_0xe414('0x30')]=_0x40877f[_0xe414('0x30')][_0xe414('0x32')]?_0x40877f[_0xe414('0x30')]:_0x4e07a7['model'];if(_0x25f597[_0xe414('0x28')][_0xe414('0x33')]){_0x40877f[_0xe414('0x27')]=[{'all':!![]}];}_0x40877f=_[_0xe414('0x34')]({},_0x40877f,_0x25f597[_0xe414('0x35')]);return db[_0xe414('0x22')][_0xe414('0x36')](_0x40877f)['then'](handleEntityNotFound(_0x8046f0,null))[_0xe414('0x17')](respondWithResult(_0x8046f0,null))['catch'](handleError(_0x8046f0,null));};exports[_0xe414('0x37')]=function(_0x5d1c53,_0x440a51){return db[_0xe414('0x22')][_0xe414('0x37')](_0x5d1c53[_0xe414('0x38')],{})[_0xe414('0x17')](function(_0x7908d1){var _0x524e75=_0x5d1c53[_0xe414('0x39')][_0xe414('0x18')]({'plain':!![]});if(!_0x524e75)throw new Error(_0xe414('0x3a'));if(_0x524e75[_0xe414('0x3b')]===_0xe414('0x39')){var _0x131d03=_0x7908d1[_0xe414('0x18')]({'plain':!![]});var _0x5c6cab='ChatQueues';return db[_0xe414('0x3c')]['find']({'where':{'name':_0x5c6cab,'userProfileId':_0x524e75[_0xe414('0x3d')]},'raw':!![]})[_0xe414('0x17')](function(_0x5034c7){if(_0x5034c7&&_0x5034c7[_0xe414('0x3e')]===0x0){return db[_0xe414('0x1a')]['create']({'name':_0x131d03[_0xe414('0x1e')],'resourceId':_0x131d03['id'],'type':_0x5034c7[_0xe414('0x1e')],'sectionId':_0x5034c7['id']},{})[_0xe414('0x17')](function(){return _0x7908d1;});}else{return _0x7908d1;}})['catch'](function(_0x440b95){logger[_0xe414('0x1c')](_0xe414('0x3f'),_0x440b95);throw _0x440b95;});}return _0x7908d1;})[_0xe414('0x17')](respondWithResult(_0x440a51,0xc9))['catch'](handleError(_0x440a51,null));};exports[_0xe414('0x16')]=function(_0x3f8e5e,_0x1e953e){if(_0x3f8e5e['body']['id']){delete _0x3f8e5e[_0xe414('0x38')]['id'];}return db['ChatQueue'][_0xe414('0x36')]({'where':{'id':_0x3f8e5e['params']['id']}})[_0xe414('0x17')](handleEntityNotFound(_0x1e953e,null))[_0xe414('0x17')](saveUpdates(_0x3f8e5e[_0xe414('0x38')],null))[_0xe414('0x17')](respondWithResult(_0x1e953e,null))[_0xe414('0x2a')](handleError(_0x1e953e,null));};exports[_0xe414('0x1b')]=function(_0x4a9e29,_0x304237){return db[_0xe414('0x22')]['find']({'where':{'id':_0x4a9e29[_0xe414('0x2c')]['id']}})['then'](handleEntityNotFound(_0x304237,null))[_0xe414('0x17')](removeEntity(_0x304237,null))[_0xe414('0x2a')](handleError(_0x304237,null));};exports['describe']=function(_0x334c87,_0xb6a01f){return db[_0xe414('0x22')][_0xe414('0x40')]()[_0xe414('0x17')](respondWithResult(_0xb6a01f,null))[_0xe414('0x2a')](handleError(_0xb6a01f,null));};exports[_0xe414('0x41')]=function(_0x27a62d,_0x4e78da){var _0xa4b788={'raw':!![],'where':{}},_0x732685={},_0x3942b0;return db[_0xe414('0x22')][_0xe414('0x42')]({'where':{'id':_0x27a62d[_0xe414('0x2c')]['id']}})[_0xe414('0x17')](handleEntityNotFound(_0x4e78da,null))[_0xe414('0x17')](function(_0x2c9780){if(_0x2c9780){_0x3942b0=_0x2c9780[_0xe414('0x18')]({'plain':!![]});_0x732685[_0xe414('0x2d')]=_[_0xe414('0x2e')](db[_0xe414('0x43')][_0xe414('0x23')]);_0x732685[_0xe414('0x28')]=_['keys'](_0x27a62d['query']);_0x732685['filters']=_[_0xe414('0x2f')](_0x732685[_0xe414('0x2d')],_0x732685[_0xe414('0x28')]);_0xa4b788[_0xe414('0x30')]=_[_0xe414('0x2f')](_0x732685[_0xe414('0x2d')],qs[_0xe414('0x31')](_0x27a62d[_0xe414('0x28')][_0xe414('0x31')]));_0xa4b788[_0xe414('0x30')]=_0xa4b788[_0xe414('0x30')][_0xe414('0x32')]?_0xa4b788[_0xe414('0x30')]:_0x732685[_0xe414('0x2d')];if(!_0x27a62d[_0xe414('0x28')][_0xe414('0x44')]('nolimit')){_0xa4b788[_0xe414('0x45')]=qs[_0xe414('0x45')](_0x27a62d[_0xe414('0x28')][_0xe414('0x45')]);_0xa4b788[_0xe414('0x10')]=qs['offset'](_0x27a62d[_0xe414('0x28')][_0xe414('0x10')]);}_0xa4b788['order']=qs['sort'](_0x27a62d[_0xe414('0x28')][_0xe414('0x46')]);_0xa4b788['where']=qs[_0xe414('0x47')](_['pick'](_0x27a62d[_0xe414('0x28')],_0x732685[_0xe414('0x47')]));_0xa4b788[_0xe414('0x48')][_0xe414('0x49')]=_0x2c9780['id'];if(_0x27a62d[_0xe414('0x28')]['filter']){_0xa4b788[_0xe414('0x48')]=_[_0xe414('0x34')](_0xa4b788[_0xe414('0x48')],{'$or':_[_0xe414('0x21')](_0xa4b788['attributes'],function(_0x59a001){var _0x2dd265={};_0x2dd265[_0x59a001]={'$like':'%'+_0x27a62d[_0xe414('0x28')][_0xe414('0x4a')]+'%'};return _0x2dd265;})});}_0xa4b788=_[_0xe414('0x34')]({},_0xa4b788,_0x27a62d[_0xe414('0x35')]);return db[_0xe414('0x43')]['findAll'](_0xa4b788);}})['then'](function(_0x4256c3){if(_0x4256c3){return db[_0xe414('0x4b')]['findAndCountAll']({'where':{'id':_[_0xe414('0x21')](_0x4256c3,_0xe414('0x4c')),'role':'agent'},'attributes':['id',_0xe414('0x1e'),'chatPause','updatedAt',_0xe414('0x4d')]});}})[_0xe414('0x17')](function(_0x31c413){if(_0x31c413){return{'count':_0x31c413['count'],'rows':_[_0xe414('0x21')](_0x31c413[_0xe414('0x29')],function(_0x36e522){return{'membername':_0x36e522[_0xe414('0x1e')],'UserId':_0x36e522['id'],'queue_name':_0x3942b0[_0xe414('0x1e')],'ChatQueueId':_0x3942b0['id'],'interface':util[_0xe414('0x4e')]('%s/%s',_0xe414('0x4f'),_0x36e522['name']),'penalty':0x0,'paused':_0x36e522[_0xe414('0x50')],'createdAt':_0x36e522[_0xe414('0x4d')],'updatedAt':_0x36e522['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4e78da,_0xa4b788))[_0xe414('0x2a')](handleError(_0x4e78da,null));};exports['getTeams']=function(_0x5757e9,_0x273c00){var _0x57400f={};var _0x3ace0d={};var _0x68c1bc;var _0x4b9129;return db[_0xe414('0x22')][_0xe414('0x42')]({'where':{'id':_0x5757e9[_0xe414('0x2c')]['id']}})['then'](handleEntityNotFound(_0x273c00,null))[_0xe414('0x17')](function(_0x2911b){if(_0x2911b){_0x68c1bc=_0x2911b;_0x3ace0d[_0xe414('0x2d')]=_['keys'](db[_0xe414('0x51')][_0xe414('0x23')]);_0x3ace0d[_0xe414('0x28')]=_[_0xe414('0x2e')](_0x5757e9[_0xe414('0x28')]);_0x3ace0d[_0xe414('0x47')]=_['intersection'](_0x3ace0d[_0xe414('0x2d')],_0x3ace0d['query']);_0x57400f[_0xe414('0x30')]=_[_0xe414('0x2f')](_0x3ace0d['model'],qs[_0xe414('0x31')](_0x5757e9[_0xe414('0x28')]['fields']));_0x57400f[_0xe414('0x30')]=_0x57400f[_0xe414('0x30')][_0xe414('0x32')]?_0x57400f[_0xe414('0x30')]:_0x3ace0d['model'];_0x57400f['order']=qs[_0xe414('0x46')](_0x5757e9[_0xe414('0x28')]['sort']);_0x57400f[_0xe414('0x48')]=qs[_0xe414('0x47')](_['pick'](_0x5757e9[_0xe414('0x28')],_0x3ace0d[_0xe414('0x47')]));if(_0x5757e9[_0xe414('0x28')][_0xe414('0x4a')]){_0x57400f[_0xe414('0x48')]=_[_0xe414('0x34')](_0x57400f['where'],{'$or':_['map'](_0x57400f[_0xe414('0x30')],function(_0x42f6a7){var _0x48fbdb={};_0x48fbdb[_0x42f6a7]={'$like':'%'+_0x5757e9['query'][_0xe414('0x4a')]+'%'};return _0x48fbdb;})});}_0x57400f=_[_0xe414('0x34')]({},_0x57400f,_0x5757e9[_0xe414('0x35')]);return _0x68c1bc['getTeams'](_0x57400f);}})[_0xe414('0x17')](function(_0x28bce0){if(_0x28bce0){_0x4b9129=_0x28bce0[_0xe414('0x32')];if(!_0x5757e9[_0xe414('0x28')]['hasOwnProperty'](_0xe414('0x52'))){_0x57400f[_0xe414('0x45')]=qs['limit'](_0x5757e9[_0xe414('0x28')][_0xe414('0x45')]);_0x57400f[_0xe414('0x10')]=qs[_0xe414('0x10')](_0x5757e9[_0xe414('0x28')]['offset']);}return _0x68c1bc[_0xe414('0x53')](_0x57400f);}})[_0xe414('0x17')](function(_0xca45fb){if(_0xca45fb){return _0xca45fb?{'count':_0x4b9129,'rows':_0xca45fb}:null;}})[_0xe414('0x17')](respondWithResult(_0x273c00,null))[_0xe414('0x2a')](handleError(_0x273c00,null));};exports[_0xe414('0x54')]=function(_0x10f533,_0x2d6872){var _0x1236ac=_0x10f533[_0xe414('0x38')][_0xe414('0x55')];return db[_0xe414('0x51')][_0xe414('0x56')]({'where':{'id':_0x1236ac},'attributes':['id'],'include':[{'model':db[_0xe414('0x4b')],'as':_0xe414('0x57'),'attributes':['id','name',_0xe414('0x58'),'voicePause','interface'],'raw':!![]}]})[_0xe414('0x17')](function(_0x4d056a){if(_0x4d056a){var _0x50b495=_[_0xe414('0x59')](_0x4d056a,function(_0x2a9ce8){var _0x48ce6a=_0x2a9ce8[_0xe414('0x18')]({'plain':!![]});return _0x48ce6a[_0xe414('0x57')];});return db[_0xe414('0x22')]['find']({'where':{'id':_0x10f533[_0xe414('0x2c')]['id']}})[_0xe414('0x17')](function(_0x1d9502){return db[_0xe414('0x5a')][_0xe414('0x5b')](function(_0x29725c){return _0x1d9502['addTeams'](_0x1236ac,{'transaction':_0x29725c})[_0xe414('0x17')](function(){return BPromise[_0xe414('0x5c')](_0x50b495,function(_0x213509){return db[_0xe414('0x43')][_0xe414('0x5d')]({'where':{'UserId':_0x213509['id'],'ChatQueueId':_0x10f533[_0xe414('0x2c')]['id']},'transaction':_0x29725c});});})[_0xe414('0x17')](function(){_0x50b495[_0xe414('0x5e')](function(_0x30af52){socket[_0xe414('0x5f')](_0xe414('0x60'),{'UserId':_0x30af52['id'],'ChatQueueId':_0x1d9502['id']});});});});});}})[_0xe414('0x17')](respondWithStatusCode(_0x2d6872,null))[_0xe414('0x2a')](handleError(_0x2d6872,null));};exports[_0xe414('0x61')]=function(_0x38c603,_0x8d716f){return db['Team'][_0xe414('0x56')]({'where':{'id':_0x38c603['query']['ids']},'attributes':['id'],'include':[{'model':db[_0xe414('0x4b')],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xe414('0x17')](handleEntityNotFound(_0x8d716f,null))[_0xe414('0x17')](function(_0x16ae6f){var _0x37bdc2=_[_0xe414('0x21')](_0x16ae6f,'id');var _0x280c55=[];var _0x4646f0=[];var _0x16c74a=squel[_0xe414('0x62')]();_0x16c74a[_0xe414('0x63')](_0xe414('0x64'))[_0xe414('0x65')](_0xe414('0x66'),'tq')[_0xe414('0x67')](_0xe414('0x68'),'ut',_0xe414('0x69'))[_0xe414('0x48')](_0xe414('0x6a'),_0x38c603[_0xe414('0x2c')]['id']);for(var _0x3ca8ee=0x0;_0x3ca8ee<_0x16ae6f[_0xe414('0x32')];_0x3ca8ee+=0x1){let _0x583d49=_0x16ae6f[_0x3ca8ee];for(var _0xd0a01b=0x0;_0xd0a01b<_0x583d49[_0xe414('0x57')][_0xe414('0x32')];_0xd0a01b+=0x1){let _0x19e9fc=_0x583d49[_0xe414('0x57')][_0xd0a01b];var _0x154d02=_0x16c74a[_0xe414('0x6b')]();_0x154d02[_0xe414('0x48')]('ut.UserId\x20=\x20?',_0x19e9fc['id']);_0x4646f0['push'](db[_0xe414('0x5a')][_0xe414('0x28')](_0x154d02[_0xe414('0x6c')](),{'type':db['sequelize'][_0xe414('0x6d')]['SELECT']})[_0xe414('0x17')](function(_0x47dccc){if(_0x47dccc[_0xe414('0x32')]===0x1){return _0x19e9fc['id'];}else{var _0x19905c=_['every'](_[_0xe414('0x21')](_0x47dccc,'TeamId'),function(_0x33e176){return _[_0xe414('0x6e')](_0x37bdc2,_0x33e176);});if(_0x19905c){return _0x19e9fc['id'];}}}));}}return BPromise[_0xe414('0x6f')](_0x4646f0)[_0xe414('0x17')](function(_0x76809f){_0x280c55=_(_0x280c55)[_0xe414('0x70')](_0x76809f)[_0xe414('0x71')]()['value']();return db[_0xe414('0x22')][_0xe414('0x36')]({'where':{'id':_0x38c603[_0xe414('0x2c')]['id']}})[_0xe414('0x17')](function(_0x25dbd8){return db[_0xe414('0x5a')][_0xe414('0x5b')](function(_0x1f9481){return _0x25dbd8[_0xe414('0x61')](_0x38c603['query'][_0xe414('0x55')],{'transaction':_0x1f9481})[_0xe414('0x17')](function(){if(!_[_0xe414('0x72')](_0x280c55)){return _0x25dbd8[_0xe414('0x73')](_0x280c55,{'transaction':_0x1f9481});}})[_0xe414('0x17')](function(){_0x280c55[_0xe414('0x5e')](function(_0x5b44d7){socket[_0xe414('0x5f')]('userChatQueue:remove',{'UserId':_0x5b44d7,'ChatQueueId':_0x25dbd8['id']});});});});});});})[_0xe414('0x17')](respondWithStatusCode(_0x8d716f,null))[_0xe414('0x2a')](handleError(_0x8d716f,null));};exports[_0xe414('0x74')]=function(_0x1b04a1,_0x584b4a){return db['ChatQueue']['find']({'where':{'id':_0x1b04a1['params']['id']}})[_0xe414('0x17')](handleEntityNotFound(_0x584b4a,null))[_0xe414('0x17')](function(_0xf37533){if(_0xf37533){return _0xf37533[_0xe414('0x74')](_0x1b04a1[_0xe414('0x38')][_0xe414('0x55')],_[_0xe414('0x75')](_0x1b04a1[_0xe414('0x38')],['ids','id'])||{})[_0xe414('0x76')](function(_0x9efefa){for(var _0x4b70d9=0x0;_0x4b70d9<_0x1b04a1['body'][_0xe414('0x55')][_0xe414('0x32')];_0x4b70d9+=0x1){socket[_0xe414('0x5f')]('userChatQueue:save',{'UserId':Number(_0x1b04a1[_0xe414('0x38')]['ids'][_0x4b70d9]),'ChatQueueId':Number(_0x1b04a1['params']['id'])});}return _0x9efefa;});}})[_0xe414('0x17')](respondWithResult(_0x584b4a,null))[_0xe414('0x2a')](handleError(_0x584b4a,null));};exports[_0xe414('0x73')]=function(_0x14f2a4,_0x51dbff){return db[_0xe414('0x22')][_0xe414('0x36')]({'where':{'id':_0x14f2a4[_0xe414('0x2c')]['id']}})[_0xe414('0x17')](handleEntityNotFound(_0x51dbff,null))[_0xe414('0x17')](function(_0x951e31){if(_0x951e31){return _0x951e31[_0xe414('0x73')](_0x14f2a4[_0xe414('0x28')][_0xe414('0x55')])[_0xe414('0x17')](function(){if(_['isArray'](_0x14f2a4[_0xe414('0x28')][_0xe414('0x55')])){for(var _0x32dd04=0x0;_0x32dd04<_0x14f2a4[_0xe414('0x28')][_0xe414('0x55')][_0xe414('0x32')];_0x32dd04+=0x1){socket[_0xe414('0x5f')]('userChatQueue:remove',{'UserId':Number(_0x14f2a4[_0xe414('0x28')]['ids'][_0x32dd04]),'ChatQueueId':Number(_0x14f2a4[_0xe414('0x2c')]['id'])});}}else{socket['emit'](_0xe414('0x77'),{'UserId':Number(_0x14f2a4[_0xe414('0x28')][_0xe414('0x55')]),'ChatQueueId':Number(_0x14f2a4[_0xe414('0x2c')]['id'])});}});}})[_0xe414('0x17')](respondWithStatusCode(_0x51dbff,null))[_0xe414('0x2a')](handleError(_0x51dbff,null));};exports[_0xe414('0x78')]=function(_0x519e1d,_0xe4f952){var _0x9bf76d={};var _0x524a6b={};var _0x33e9cc;var _0x39cc66;return db[_0xe414('0x22')][_0xe414('0x42')]({'where':{'id':_0x519e1d[_0xe414('0x2c')]['id']}})[_0xe414('0x17')](handleEntityNotFound(_0xe4f952,null))[_0xe414('0x17')](function(_0x3b410b){if(_0x3b410b){_0x33e9cc=_0x3b410b;_0x524a6b['model']=_[_0xe414('0x2e')](db[_0xe414('0x4b')][_0xe414('0x23')]);_0x524a6b[_0xe414('0x28')]=_[_0xe414('0x2e')](_0x519e1d['query']);_0x524a6b['filters']=_[_0xe414('0x2f')](_0x524a6b['model'],_0x524a6b[_0xe414('0x28')]);_0x9bf76d[_0xe414('0x30')]=_[_0xe414('0x2f')](_0x524a6b[_0xe414('0x2d')],qs['fields'](_0x519e1d['query'][_0xe414('0x31')]));_0x9bf76d[_0xe414('0x30')]=_0x9bf76d[_0xe414('0x30')][_0xe414('0x32')]?_0x9bf76d['attributes']:_0x524a6b[_0xe414('0x2d')];_0x9bf76d[_0xe414('0x79')]=qs[_0xe414('0x46')](_0x519e1d['query'][_0xe414('0x46')]);_0x9bf76d[_0xe414('0x48')]=qs[_0xe414('0x47')](_[_0xe414('0x7a')](_0x519e1d[_0xe414('0x28')],_0x524a6b['filters']));if(_0x519e1d[_0xe414('0x28')][_0xe414('0x4a')]){_0x9bf76d[_0xe414('0x48')]=_[_0xe414('0x34')](_0x9bf76d[_0xe414('0x48')],{'$or':_[_0xe414('0x21')](_0x9bf76d[_0xe414('0x30')],function(_0x2302b8){var _0x1a1aae={};_0x1a1aae[_0x2302b8]={'$like':'%'+_0x519e1d[_0xe414('0x28')]['filter']+'%'};return _0x1a1aae;})});}_0x9bf76d=_['merge']({},_0x9bf76d,_0x519e1d['options']);return _0x33e9cc[_0xe414('0x78')](_0x9bf76d);}})[_0xe414('0x17')](function(_0x263f2f){if(_0x263f2f){_0x39cc66=_0x263f2f[_0xe414('0x32')];if(!_0x519e1d['query'][_0xe414('0x44')](_0xe414('0x52'))){_0x9bf76d[_0xe414('0x45')]=qs[_0xe414('0x45')](_0x519e1d[_0xe414('0x28')][_0xe414('0x45')]);_0x9bf76d[_0xe414('0x10')]=qs[_0xe414('0x10')](_0x519e1d['query']['offset']);}return _0x33e9cc[_0xe414('0x78')](_0x9bf76d);}})[_0xe414('0x17')](function(_0x171b2b){if(_0x171b2b){return _0x171b2b?{'count':_0x39cc66,'rows':_0x171b2b}:null;}})['then'](respondWithResult(_0xe4f952,null))['catch'](handleError(_0xe4f952,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 4096b1c..f9cdd8b 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 _0x0627=['../../mysqldb','ChatQueue','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x236c89,_0xd76ba9){var _0x3b2a15=function(_0x89e4f9){while(--_0x89e4f9){_0x236c89['push'](_0x236c89['shift']());}};_0x3b2a15(++_0xd76ba9);}(_0x0627,0x1d8));var _0x7062=function(_0x3a7a9c,_0x24f7d6){_0x3a7a9c=_0x3a7a9c-0x0;var _0x59156e=_0x0627[_0x3a7a9c];return _0x59156e;};'use strict';var EventEmitter=require(_0x7062('0x0'));var ChatQueue=require(_0x7062('0x1'))['db'][_0x7062('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x7062('0x3')](0x0);var events={'afterCreate':_0x7062('0x4'),'afterUpdate':_0x7062('0x5'),'afterDestroy':_0x7062('0x6')};function emitEvent(_0xf63df){return function(_0x21b92d,_0xb17aab,_0x73d82a){ChatQueueEvents['emit'](_0xf63df+':'+_0x21b92d['id'],_0x21b92d);ChatQueueEvents[_0x7062('0x7')](_0xf63df,_0x21b92d);_0x73d82a(null);};}for(var e in events){if(events[_0x7062('0x8')](e)){var event=events[e];ChatQueue[_0x7062('0x9')](e,emitEvent(event));}}module[_0x7062('0xa')]=ChatQueueEvents;
\ No newline at end of file
+var _0xa728=['hook','exports','ChatQueue','setMaxListeners','save','update','remove','emit'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa728,0xb2));var _0x8a72=function(_0x1c876e,_0x13fb5e){_0x1c876e=_0x1c876e-0x0;var _0x1e73c7=_0xa728[_0x1c876e];return _0x1e73c7;};'use strict';var EventEmitter=require('events');var ChatQueue=require('../../mysqldb')['db'][_0x8a72('0x0')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x8a72('0x1')](0x0);var events={'afterCreate':_0x8a72('0x2'),'afterUpdate':_0x8a72('0x3'),'afterDestroy':_0x8a72('0x4')};function emitEvent(_0x4af42e){return function(_0x3806bb,_0x35df15,_0x32ab32){ChatQueueEvents[_0x8a72('0x5')](_0x4af42e+':'+_0x3806bb['id'],_0x3806bb);ChatQueueEvents[_0x8a72('0x5')](_0x4af42e,_0x3806bb);_0x32ab32(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue[_0x8a72('0x6')](e,emitEvent(event));}}module[_0x8a72('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 20a1e95..ee9b852 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 _0x70ff=['moment','request-promise','path','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','util'];(function(_0xc25cc1,_0x2a9daa){var _0x544044=function(_0x347750){while(--_0x347750){_0xc25cc1['push'](_0xc25cc1['shift']());}};_0x544044(++_0x2a9daa);}(_0x70ff,0xef));var _0xf70f=function(_0x1c72b8,_0x104b7e){_0x1c72b8=_0x1c72b8-0x0;var _0x191114=_0x70ff[_0x1c72b8];return _0x191114;};'use strict';var _=require('lodash');var util=require(_0xf70f('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xf70f('0x1'));var BPromise=require('bluebird');var rp=require(_0xf70f('0x2'));var fs=require('fs');var path=require(_0xf70f('0x3'));var rimraf=require('rimraf');var config=require(_0xf70f('0x4'));var attributes=require(_0xf70f('0x5'));module[_0xf70f('0x6')]=function(_0x2d256b,_0x5a010f){return _0x2d256b[_0xf70f('0x7')](_0xf70f('0x8'),attributes,{'tableName':_0xf70f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5172=['exports','ChatQueue','chat_queues','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment','./chatQueue.attributes'];(function(_0x2cce87,_0x5dcf95){var _0x4cb9a5=function(_0x1e31ae){while(--_0x1e31ae){_0x2cce87['push'](_0x2cce87['shift']());}};_0x4cb9a5(++_0x5dcf95);}(_0x5172,0x1e7));var _0x2517=function(_0x3b2f34,_0x31bbf5){_0x3b2f34=_0x3b2f34-0x0;var _0x10a82d=_0x5172[_0x3b2f34];return _0x10a82d;};'use strict';var _=require('lodash');var util=require(_0x2517('0x0'));var logger=require(_0x2517('0x1'))(_0x2517('0x2'));var moment=require(_0x2517('0x3'));var BPromise=require(_0x2517('0x4'));var rp=require(_0x2517('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2517('0x6'));var attributes=require(_0x2517('0x7'));module[_0x2517('0x8')]=function(_0x363df2,_0xfa480f){return _0x363df2['define'](_0x2517('0x9'),attributes,{'tableName':_0x2517('0xa'),'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 a4191d8..19b5d8e 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 _0x3f48=['defaults','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetChatQueue','ChatQueue','findAll','raw','options','where','attributes','include','map','model','debug','ShowChatQueue','find','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis'];(function(_0x50bfe8,_0x4a9f3c){var _0x3991d3=function(_0x442b20){while(--_0x442b20){_0x50bfe8['push'](_0x50bfe8['shift']());}};_0x3991d3(++_0x4a9f3c);}(_0x3f48,0x17c));var _0x83f4=function(_0x164470,_0x12ae5c){_0x164470=_0x164470-0x0;var _0x1b1afc=_0x3f48[_0x164470];return _0x1b1afc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x83f4('0x0'));var BPromise=require(_0x83f4('0x1'));var rs=require(_0x83f4('0x2'));var fs=require('fs');var Redis=require(_0x83f4('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x83f4('0x4'));var logger=require(_0x83f4('0x5'))('rpc');var config=require(_0x83f4('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x83f4('0x7')][_0x83f4('0x8')]({'port':0x232a});config[_0x83f4('0x9')]=_[_0x83f4('0xa')](config[_0x83f4('0x9')],{'host':_0x83f4('0xb'),'port':0x18eb});var socket=require(_0x83f4('0xc'))(new Redis(config[_0x83f4('0x9')]));require('./chatQueue.socket')[_0x83f4('0xd')](socket);function respondWithRpcPromise(_0x3b0784,_0x177c28,_0x54c0c1){return new BPromise(function(_0x4cb8bb,_0x589cbe){return client[_0x83f4('0xe')](_0x3b0784,_0x54c0c1)[_0x83f4('0xf')](function(_0x74a994){logger['info'](_0x83f4('0x10'),_0x177c28,_0x83f4('0x11'));logger['debug'](_0x83f4('0x12'),_0x177c28,_0x83f4('0x11'),JSON[_0x83f4('0x13')](_0x74a994));if(_0x74a994[_0x83f4('0x14')]){if(_0x74a994[_0x83f4('0x14')][_0x83f4('0x15')]===0x1f4){logger[_0x83f4('0x14')]('ChatQueue,\x20%s,\x20%s',_0x177c28,_0x74a994[_0x83f4('0x14')][_0x83f4('0x16')]);return _0x589cbe(_0x74a994[_0x83f4('0x14')][_0x83f4('0x16')]);}logger[_0x83f4('0x14')](_0x83f4('0x10'),_0x177c28,_0x74a994['error'][_0x83f4('0x16')]);return _0x4cb8bb(_0x74a994[_0x83f4('0x14')][_0x83f4('0x16')]);}else{logger[_0x83f4('0x17')](_0x83f4('0x10'),_0x177c28,'request\x20sent');_0x4cb8bb(_0x74a994[_0x83f4('0x18')]['message']);}})[_0x83f4('0x19')](function(_0x3b08d8){logger[_0x83f4('0x14')](_0x83f4('0x10'),_0x177c28,_0x3b08d8);_0x589cbe(_0x3b08d8);});});}exports[_0x83f4('0x1a')]=function(_0x9ef4a9){var _0x52452b=this;return new Promise(function(_0x79c248,_0x14575b){return db[_0x83f4('0x1b')][_0x83f4('0x1c')]({'raw':_0x9ef4a9['options']?_0x9ef4a9['options'][_0x83f4('0x1d')]===undefined?!![]:![]:!![],'where':_0x9ef4a9[_0x83f4('0x1e')]?_0x9ef4a9[_0x83f4('0x1e')][_0x83f4('0x1f')]||null:null,'attributes':_0x9ef4a9['options']?_0x9ef4a9[_0x83f4('0x1e')][_0x83f4('0x20')]||null:null,'limit':_0x9ef4a9[_0x83f4('0x1e')]?_0x9ef4a9[_0x83f4('0x1e')]['limit']||null:null,'include':_0x9ef4a9[_0x83f4('0x1e')]?_0x9ef4a9['options'][_0x83f4('0x21')]?_[_0x83f4('0x22')](_0x9ef4a9[_0x83f4('0x1e')][_0x83f4('0x21')],function(_0x27623d){return{'model':db[_0x27623d[_0x83f4('0x23')]],'as':_0x27623d['as'],'attributes':_0x27623d[_0x83f4('0x20')],'include':_0x27623d[_0x83f4('0x21')]?_[_0x83f4('0x22')](_0x27623d[_0x83f4('0x21')],function(_0x3ab54d){return{'model':db[_0x3ab54d['model']],'as':_0x3ab54d['as'],'attributes':_0x3ab54d[_0x83f4('0x20')],'include':_0x3ab54d['include']?_['map'](_0x3ab54d[_0x83f4('0x21')],function(_0x5f17f5){return{'model':db[_0x5f17f5[_0x83f4('0x23')]],'as':_0x5f17f5['as'],'attributes':_0x5f17f5[_0x83f4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x83f4('0xf')](function(_0x5429fe){logger['info']('GetChatQueue',_0x9ef4a9);logger[_0x83f4('0x24')](_0x83f4('0x1a'),_0x9ef4a9,JSON[_0x83f4('0x13')](_0x5429fe));_0x79c248(_0x5429fe);})[_0x83f4('0x19')](function(_0x57fd72){logger[_0x83f4('0x14')](_0x83f4('0x1a'),_0x57fd72[_0x83f4('0x16')],_0x9ef4a9);_0x14575b(_0x52452b[_0x83f4('0x14')](0x1f4,_0x57fd72[_0x83f4('0x16')]));});});};exports[_0x83f4('0x25')]=function(_0x37956b){var _0x162f06=this;return new Promise(function(_0x5ca9bc,_0x203d08){return db['ChatQueue'][_0x83f4('0x26')]({'raw':_0x37956b['options']?_0x37956b[_0x83f4('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x37956b[_0x83f4('0x1e')]?_0x37956b[_0x83f4('0x1e')]['where']||null:null,'attributes':_0x37956b[_0x83f4('0x1e')]?_0x37956b['options'][_0x83f4('0x20')]||null:null,'include':_0x37956b['options']?_0x37956b[_0x83f4('0x1e')]['include']?_[_0x83f4('0x22')](_0x37956b[_0x83f4('0x1e')][_0x83f4('0x21')],function(_0x1871e1){return{'model':db[_0x1871e1[_0x83f4('0x23')]],'as':_0x1871e1['as'],'attributes':_0x1871e1[_0x83f4('0x20')],'include':_0x1871e1['include']?_[_0x83f4('0x22')](_0x1871e1[_0x83f4('0x21')],function(_0x3e2d5f){return{'model':db[_0x3e2d5f[_0x83f4('0x23')]],'as':_0x3e2d5f['as'],'attributes':_0x3e2d5f[_0x83f4('0x20')],'include':_0x3e2d5f[_0x83f4('0x21')]?_[_0x83f4('0x22')](_0x3e2d5f[_0x83f4('0x21')],function(_0x239c41){return{'model':db[_0x239c41[_0x83f4('0x23')]],'as':_0x239c41['as'],'attributes':_0x239c41[_0x83f4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x83f4('0xf')](function(_0x3f25e9){logger[_0x83f4('0x17')](_0x83f4('0x25'),_0x37956b);logger[_0x83f4('0x24')](_0x83f4('0x25'),_0x37956b,JSON[_0x83f4('0x13')](_0x3f25e9));_0x5ca9bc(_0x3f25e9);})[_0x83f4('0x19')](function(_0x437853){logger[_0x83f4('0x14')]('ShowChatQueue',_0x437853[_0x83f4('0x16')],_0x37956b);_0x203d08(_0x162f06['error'](0x1f4,_0x437853['message']));});});};
\ No newline at end of file
+var _0x8d62=['stringify','ShowChatQueue','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetChatQueue'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x8d62,0xf8));var _0x28d6=function(_0x5e7dae,_0x311614){_0x5e7dae=_0x5e7dae-0x0;var _0x2c7f5b=_0x8d62[_0x5e7dae];return _0x2c7f5b;};'use strict';var _=require('lodash');var util=require(_0x28d6('0x0'));var moment=require(_0x28d6('0x1'));var BPromise=require(_0x28d6('0x2'));var rs=require(_0x28d6('0x3'));var fs=require('fs');var Redis=require(_0x28d6('0x4'));var db=require(_0x28d6('0x5'))['db'];var utils=require(_0x28d6('0x6'));var logger=require(_0x28d6('0x7'))(_0x28d6('0x8'));var config=require(_0x28d6('0x9'));var jayson=require(_0x28d6('0xa'));var client=jayson[_0x28d6('0xb')][_0x28d6('0xc')]({'port':0x232a});config[_0x28d6('0xd')]=_['defaults'](config[_0x28d6('0xd')],{'host':_0x28d6('0xe'),'port':0x18eb});var socket=require(_0x28d6('0xf'))(new Redis(config['redis']));require(_0x28d6('0x10'))['register'](socket);function respondWithRpcPromise(_0x13eeb6,_0x7726e1,_0x3d9ae7){return new BPromise(function(_0x239297,_0x159578){return client['request'](_0x13eeb6,_0x3d9ae7)[_0x28d6('0x11')](function(_0xe899f2){logger[_0x28d6('0x12')](_0x28d6('0x13'),_0x7726e1,_0x28d6('0x14'));logger[_0x28d6('0x15')](_0x28d6('0x16'),_0x7726e1,_0x28d6('0x14'),JSON['stringify'](_0xe899f2));if(_0xe899f2[_0x28d6('0x17')]){if(_0xe899f2[_0x28d6('0x17')][_0x28d6('0x18')]===0x1f4){logger['error'](_0x28d6('0x13'),_0x7726e1,_0xe899f2['error'][_0x28d6('0x19')]);return _0x159578(_0xe899f2[_0x28d6('0x17')]['message']);}logger[_0x28d6('0x17')](_0x28d6('0x13'),_0x7726e1,_0xe899f2[_0x28d6('0x17')][_0x28d6('0x19')]);return _0x239297(_0xe899f2[_0x28d6('0x17')]['message']);}else{logger[_0x28d6('0x12')]('ChatQueue,\x20%s,\x20%s',_0x7726e1,_0x28d6('0x14'));_0x239297(_0xe899f2[_0x28d6('0x1a')][_0x28d6('0x19')]);}})[_0x28d6('0x1b')](function(_0x50100c){logger[_0x28d6('0x17')](_0x28d6('0x13'),_0x7726e1,_0x50100c);_0x159578(_0x50100c);});});}exports['GetChatQueue']=function(_0x29cfbf){var _0x20f2fd=this;return new Promise(function(_0x53d629,_0x26362e){return db[_0x28d6('0x1c')][_0x28d6('0x1d')]({'raw':_0x29cfbf[_0x28d6('0x1e')]?_0x29cfbf[_0x28d6('0x1e')][_0x28d6('0x1f')]===undefined?!![]:![]:!![],'where':_0x29cfbf[_0x28d6('0x1e')]?_0x29cfbf['options'][_0x28d6('0x20')]||null:null,'attributes':_0x29cfbf['options']?_0x29cfbf[_0x28d6('0x1e')][_0x28d6('0x21')]||null:null,'limit':_0x29cfbf[_0x28d6('0x1e')]?_0x29cfbf[_0x28d6('0x1e')][_0x28d6('0x22')]||null:null,'include':_0x29cfbf[_0x28d6('0x1e')]?_0x29cfbf['options']['include']?_[_0x28d6('0x23')](_0x29cfbf[_0x28d6('0x1e')][_0x28d6('0x24')],function(_0x210bfc){return{'model':db[_0x210bfc['model']],'as':_0x210bfc['as'],'attributes':_0x210bfc[_0x28d6('0x21')],'include':_0x210bfc[_0x28d6('0x24')]?_[_0x28d6('0x23')](_0x210bfc[_0x28d6('0x24')],function(_0x4757b1){return{'model':db[_0x4757b1[_0x28d6('0x25')]],'as':_0x4757b1['as'],'attributes':_0x4757b1[_0x28d6('0x21')],'include':_0x4757b1[_0x28d6('0x24')]?_[_0x28d6('0x23')](_0x4757b1[_0x28d6('0x24')],function(_0x28aaa6){return{'model':db[_0x28aaa6[_0x28d6('0x25')]],'as':_0x28aaa6['as'],'attributes':_0x28aaa6[_0x28d6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x28d6('0x11')](function(_0x4b140e){logger['info'](_0x28d6('0x26'),_0x29cfbf);logger[_0x28d6('0x15')](_0x28d6('0x26'),_0x29cfbf,JSON[_0x28d6('0x27')](_0x4b140e));_0x53d629(_0x4b140e);})[_0x28d6('0x1b')](function(_0x6b156e){logger['error'](_0x28d6('0x26'),_0x6b156e['message'],_0x29cfbf);_0x26362e(_0x20f2fd[_0x28d6('0x17')](0x1f4,_0x6b156e['message']));});});};exports[_0x28d6('0x28')]=function(_0x2594cb){var _0x398c05=this;return new Promise(function(_0x3fd81c,_0x9b9743){return db['ChatQueue']['find']({'raw':_0x2594cb[_0x28d6('0x1e')]?_0x2594cb[_0x28d6('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2594cb[_0x28d6('0x1e')]?_0x2594cb['options'][_0x28d6('0x20')]||null:null,'attributes':_0x2594cb['options']?_0x2594cb[_0x28d6('0x1e')]['attributes']||null:null,'include':_0x2594cb[_0x28d6('0x1e')]?_0x2594cb[_0x28d6('0x1e')][_0x28d6('0x24')]?_[_0x28d6('0x23')](_0x2594cb[_0x28d6('0x1e')][_0x28d6('0x24')],function(_0x37031c){return{'model':db[_0x37031c['model']],'as':_0x37031c['as'],'attributes':_0x37031c[_0x28d6('0x21')],'include':_0x37031c[_0x28d6('0x24')]?_[_0x28d6('0x23')](_0x37031c[_0x28d6('0x24')],function(_0x4f52e3){return{'model':db[_0x4f52e3[_0x28d6('0x25')]],'as':_0x4f52e3['as'],'attributes':_0x4f52e3[_0x28d6('0x21')],'include':_0x4f52e3[_0x28d6('0x24')]?_[_0x28d6('0x23')](_0x4f52e3['include'],function(_0x804c06){return{'model':db[_0x804c06[_0x28d6('0x25')]],'as':_0x804c06['as'],'attributes':_0x804c06[_0x28d6('0x21')]};}):[]};}):[]};}):[]:[]})[_0x28d6('0x11')](function(_0x1fcdcf){logger[_0x28d6('0x12')](_0x28d6('0x28'),_0x2594cb);logger[_0x28d6('0x15')](_0x28d6('0x28'),_0x2594cb,JSON[_0x28d6('0x27')](_0x1fcdcf));_0x3fd81c(_0x1fcdcf);})[_0x28d6('0x1b')](function(_0x25438b){logger[_0x28d6('0x17')](_0x28d6('0x28'),_0x25438b[_0x28d6('0x19')],_0x2594cb);_0x9b9743(_0x398c05[_0x28d6('0x17')](0x1f4,_0x25438b['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 59736f5..bf9e033 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 _0x524a=['./chatQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x2a29d4,_0x3c7fd1){var _0x5c6f52=function(_0x25a28f){while(--_0x25a28f){_0x2a29d4['push'](_0x2a29d4['shift']());}};_0x5c6f52(++_0x3c7fd1);}(_0x524a,0xf5));var _0xa524=function(_0x3de58c,_0x339ed1){_0x3de58c=_0x3de58c-0x0;var _0x1face2=_0x524a[_0x3de58c];return _0x1face2;};'use strict';var ChatQueueEvents=require(_0xa524('0x0'));var events=[_0xa524('0x1'),_0xa524('0x2'),_0xa524('0x3')];function createListener(_0x53c48c,_0x4a29b7){return function(_0x2ef77c){_0x4a29b7[_0xa524('0x4')](_0x53c48c,_0x2ef77c);};}function removeListener(_0x56ab08,_0x50ec75){return function(){ChatQueueEvents[_0xa524('0x5')](_0x56ab08,_0x50ec75);};}exports[_0xa524('0x6')]=function(_0x16227b){for(var _0x5f472f=0x0,_0x460738=events['length'];_0x5f472f<_0x460738;_0x5f472f++){var _0x3a2dd6=events[_0x5f472f];var _0x11aa98=createListener('chatQueue:'+_0x3a2dd6,_0x16227b);ChatQueueEvents['on'](_0x3a2dd6,_0x11aa98);}};
\ No newline at end of file
+var _0xc6d8=['remove','removeListener','register','length','chatQueue:','./chatQueue.events'];(function(_0x35acf0,_0x464ef4){var _0x3cc1c6=function(_0x500fe0){while(--_0x500fe0){_0x35acf0['push'](_0x35acf0['shift']());}};_0x3cc1c6(++_0x464ef4);}(_0xc6d8,0xd7));var _0x8c6d=function(_0x390b7c,_0x43ef0c){_0x390b7c=_0x390b7c-0x0;var _0x30bfc5=_0xc6d8[_0x390b7c];return _0x30bfc5;};'use strict';var ChatQueueEvents=require(_0x8c6d('0x0'));var events=['save',_0x8c6d('0x1'),'update'];function createListener(_0x3b88d1,_0x5974d3){return function(_0x292852){_0x5974d3['emit'](_0x3b88d1,_0x292852);};}function removeListener(_0x5b6b04,_0x352b8c){return function(){ChatQueueEvents[_0x8c6d('0x2')](_0x5b6b04,_0x352b8c);};}exports[_0x8c6d('0x3')]=function(_0x4f5e8f){for(var _0x3c265c=0x0,_0x2dbb52=events[_0x8c6d('0x4')];_0x3c265c<_0x2dbb52;_0x3c265c++){var _0x5529f1=events[_0x3c265c];var _0x1496ba=createListener(_0x8c6d('0x5')+_0x5529f1,_0x4f5e8f);ChatQueueEvents['on'](_0x5529f1,_0x1496ba);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index bc90238..cf0b422 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(_0x40108a,_0x17981c){var _0x74318a=function(_0x28ff91){while(--_0x28ff91){_0x40108a['push'](_0x40108a['shift']());}};_0x74318a(++_0x17981c);}(_0x008c,0x188));var _0xc008=function(_0x7d62cb,_0x7622c){_0x7d62cb=_0x7d62cb-0x0;var _0x3a6266=_0x008c[_0x7d62cb];return _0x3a6266;};'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 _0x7217=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post','addTeams','update','delete','destroy','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','fs-extra'];(function(_0x37304d,_0x41b8a9){var _0x1d879b=function(_0x416d68){while(--_0x416d68){_0x37304d['push'](_0x37304d['shift']());}};_0x1d879b(++_0x41b8a9);}(_0x7217,0x19e));var _0x7721=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x7217[_0x4c7fb5];return _0x2e10ac;};'use strict';var multer=require(_0x7721('0x0'));var util=require('util');var path=require(_0x7721('0x1'));var timeout=require(_0x7721('0x2'));var express=require(_0x7721('0x3'));var router=express[_0x7721('0x4')]();var fs_extra=require(_0x7721('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7721('0x6'));var controller=require(_0x7721('0x7'));router[_0x7721('0x8')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xa')]);router[_0x7721('0x8')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0xc')]);router[_0x7721('0x8')](_0x7721('0xd'),auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0x8')](_0x7721('0xf'),auth['isAuthenticated'](),controller[_0x7721('0x10')]);router[_0x7721('0x8')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x12')]);router[_0x7721('0x8')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['getAgents']);router[_0x7721('0x14')]('/',auth[_0x7721('0x9')](),controller['create']);router[_0x7721('0x14')](_0x7721('0x11'),auth[_0x7721('0x9')](),controller[_0x7721('0x15')]);router['post'](_0x7721('0x13'),auth[_0x7721('0x9')](),controller['addAgents']);router['put']('/:id',auth[_0x7721('0x9')](),controller[_0x7721('0x16')]);router[_0x7721('0x17')](_0x7721('0xd'),auth['isAuthenticated'](),controller[_0x7721('0x18')]);router['delete'](_0x7721('0x11'),auth['isAuthenticated'](),controller[_0x7721('0x19')]);router[_0x7721('0x17')](_0x7721('0x13'),auth[_0x7721('0x9')](),controller[_0x7721('0x1a')]);module[_0x7721('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index b0bb1c3..2a564bf 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 _0x208b=['DATE','moment','sequelize','exports','STRING'];(function(_0x16771d,_0x224c60){var _0x386f11=function(_0x3d7a87){while(--_0x3d7a87){_0x16771d['push'](_0x16771d['shift']());}};_0x386f11(++_0x224c60);}(_0x208b,0x114));var _0xb208=function(_0x2d169e,_0x23b613){_0x2d169e=_0x2d169e-0x0;var _0x57d75d=_0x208b[_0x2d169e];return _0x57d75d;};'use strict';var moment=require(_0xb208('0x0'));var Sequelize=require(_0xb208('0x1'));module[_0xb208('0x2')]={'uniqueid':{'type':Sequelize[_0xb208('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xb208('0x4')]},'leaveAt':{'type':Sequelize[_0xb208('0x4')]},'acceptAt':{'type':Sequelize[_0xb208('0x4')]},'exitAt':{'type':Sequelize[_0xb208('0x4')]},'reason':{'type':Sequelize[_0xb208('0x3')]}};
\ No newline at end of file
+var _0xdbb4=['DATE','STRING','moment','sequelize','exports'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xdbb4,0x1d8));var _0x4dbb=function(_0xb98d8d,_0x481423){_0xb98d8d=_0xb98d8d-0x0;var _0x489b15=_0xdbb4[_0xb98d8d];return _0x489b15;};'use strict';var moment=require(_0x4dbb('0x0'));var Sequelize=require(_0x4dbb('0x1'));module[_0x4dbb('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x4dbb('0x3')]},'leaveAt':{'type':Sequelize[_0x4dbb('0x3')]},'acceptAt':{'type':Sequelize[_0x4dbb('0x3')]},'exitAt':{'type':Sequelize[_0x4dbb('0x3')]},'reason':{'type':Sequelize[_0x4dbb('0x4')]}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index 9a5d15f..a5c3732 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 _0x014c=['order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','describe','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','name','send','map','ChatQueueReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit'];(function(_0x30cdd7,_0x23f1ae){var _0x5c0a41=function(_0x5e368d){while(--_0x5e368d){_0x30cdd7['push'](_0x30cdd7['shift']());}};_0x5c0a41(++_0x23f1ae);}(_0x014c,0x17b));var _0xc014=function(_0x366388,_0x4595a6){_0x366388=_0x366388-0x0;var _0x41c97e=_0x014c[_0x366388];return _0x41c97e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xc014('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc014('0x1'));var rp=require(_0xc014('0x2'));var moment=require(_0xc014('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xc014('0x4'));var path=require(_0xc014('0x5'));var sox=require(_0xc014('0x6'));var csv=require(_0xc014('0x7'));var ejs=require(_0xc014('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xc014('0x9'));var squel=require(_0xc014('0xa'));var crypto=require('crypto');var jsforce=require(_0xc014('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc014('0x7'));var querystring=require(_0xc014('0xc'));var Papa=require(_0xc014('0xd'));var Redis=require('ioredis');var authService=require(_0xc014('0xe'));var qs=require(_0xc014('0xf'));var as=require(_0xc014('0x10'));var hardwareService=require(_0xc014('0x11'));var logger=require('../../config/logger')(_0xc014('0x12'));var utils=require('../../config/utils');var config=require(_0xc014('0x13'));var licenseUtil=require('../../config/license/util');var db=require(_0xc014('0x14'))['db'];function respondWithStatusCode(_0xcde2d3,_0x2f8ac9){_0x2f8ac9=_0x2f8ac9||0xcc;return function(_0x1686f1){if(_0x1686f1){return _0xcde2d3['sendStatus'](_0x2f8ac9);}return _0xcde2d3[_0xc014('0x15')](_0x2f8ac9)[_0xc014('0x16')]();};}function respondWithResult(_0xe86dd,_0x5ced7d){_0x5ced7d=_0x5ced7d||0xc8;return function(_0x36b26e){if(_0x36b26e){return _0xe86dd['status'](_0x5ced7d)[_0xc014('0x17')](_0x36b26e);}};}function respondWithFilteredResult(_0x1c4d3b,_0x25fdf6){return function(_0x26f264){if(_0x26f264){var _0x9f6a26=typeof _0x25fdf6[_0xc014('0x18')]==='undefined'&&typeof _0x25fdf6[_0xc014('0x19')]===_0xc014('0x1a');var _0x263ad0=_0x26f264[_0xc014('0x1b')];var _0x5a2be0=_0x9f6a26?0x0:_0x25fdf6['offset'];var _0x42f93d=_0x9f6a26?_0x26f264['count']:_0x25fdf6['offset']+_0x25fdf6[_0xc014('0x19')];var _0x4287fe;if(_0x42f93d>=_0x263ad0){_0x42f93d=_0x263ad0;_0x4287fe=0xc8;}else{_0x4287fe=0xce;}_0x1c4d3b['status'](_0x4287fe);return _0x1c4d3b[_0xc014('0x1c')](_0xc014('0x1d'),_0x5a2be0+'-'+_0x42f93d+'/'+_0x263ad0)[_0xc014('0x17')](_0x26f264);}return null;};}function patchUpdates(_0x2dac66){return function(_0x1078c4){try{jsonpatch['apply'](_0x1078c4,_0x2dac66,!![]);}catch(_0xc8b0fb){return BPromise[_0xc014('0x1e')](_0xc8b0fb);}return _0x1078c4[_0xc014('0x1f')]();};}function saveUpdates(_0x3c58cc,_0x450b22){return function(_0x3f28b6){if(_0x3f28b6){return _0x3f28b6[_0xc014('0x20')](_0x3c58cc)['then'](function(_0x1089c6){return _0x1089c6;});}return null;};}function removeEntity(_0x1b905d,_0x16d8f9){return function(_0x174b46){if(_0x174b46){return _0x174b46[_0xc014('0x21')]()[_0xc014('0x22')](function(){_0x1b905d[_0xc014('0x15')](0xcc)[_0xc014('0x16')]();});}};}function handleEntityNotFound(_0xe4c68,_0x2e5c30){return function(_0x4850bb){if(!_0x4850bb){_0xe4c68[_0xc014('0x23')](0x194);}return _0x4850bb;};}function handleError(_0x17b6b4,_0x36b663){_0x36b663=_0x36b663||0x1f4;return function(_0x7f47ef){logger[_0xc014('0x24')](_0x7f47ef['stack']);if(_0x7f47ef[_0xc014('0x25')]){delete _0x7f47ef[_0xc014('0x25')];}_0x17b6b4[_0xc014('0x15')](_0x36b663)[_0xc014('0x26')](_0x7f47ef);};}exports['index']=function(_0x43af57,_0x40cf7c){var _0x151705={},_0x30e97a={},_0x21cd81={'count':0x0,'rows':[]};var _0x289f92=_[_0xc014('0x27')](db[_0xc014('0x28')][_0xc014('0x29')],function(_0x330869){return{'name':_0x330869[_0xc014('0x2a')],'type':_0x330869['type'][_0xc014('0x2b')]};});_0x30e97a['model']=_['map'](_0x289f92,'name');_0x30e97a[_0xc014('0x2c')]=_[_0xc014('0x2d')](_0x43af57['query']);_0x30e97a[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],_0x30e97a[_0xc014('0x2c')]);_0x151705[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x30e97a[_0xc014('0x30')],qs[_0xc014('0x32')](_0x43af57[_0xc014('0x2c')][_0xc014('0x32')]));_0x151705[_0xc014('0x31')]=_0x151705[_0xc014('0x31')]['length']?_0x151705[_0xc014('0x31')]:_0x30e97a['model'];if(!_0x43af57[_0xc014('0x2c')][_0xc014('0x33')](_0xc014('0x34'))){_0x151705[_0xc014('0x19')]=qs[_0xc014('0x19')](_0x43af57[_0xc014('0x2c')][_0xc014('0x19')]);_0x151705['offset']=qs[_0xc014('0x18')](_0x43af57['query'][_0xc014('0x18')]);}_0x151705[_0xc014('0x35')]=qs[_0xc014('0x36')](_0x43af57[_0xc014('0x2c')][_0xc014('0x36')]);_0x151705[_0xc014('0x37')]=qs[_0xc014('0x2e')](_['pick'](_0x43af57[_0xc014('0x2c')],_0x30e97a[_0xc014('0x2e')]),_0x289f92);if(_0x43af57[_0xc014('0x2c')]['filter']){_0x151705[_0xc014('0x37')]=_[_0xc014('0x38')](_0x151705[_0xc014('0x37')],{'$or':_['map'](_0x289f92,function(_0x473754){if(_0x473754['type']!==_0xc014('0x39')){var _0x19d374={};_0x19d374[_0x473754[_0xc014('0x25')]]={'$like':'%'+_0x43af57[_0xc014('0x2c')][_0xc014('0x3a')]+'%'};return _0x19d374;}})});}_0x151705=_[_0xc014('0x38')]({},_0x151705,_0x43af57[_0xc014('0x3b')]);var _0xb0149e={'where':_0x151705[_0xc014('0x37')]};return db[_0xc014('0x28')][_0xc014('0x1b')](_0xb0149e)[_0xc014('0x22')](function(_0x565433){_0x21cd81[_0xc014('0x1b')]=_0x565433;if(_0x43af57[_0xc014('0x2c')][_0xc014('0x3c')]){_0x151705[_0xc014('0x3d')]=[{'all':!![]}];}return db['ChatQueueReport'][_0xc014('0x3e')](_0x151705);})['then'](function(_0x3a7f90){_0x21cd81[_0xc014('0x3f')]=_0x3a7f90;return _0x21cd81;})[_0xc014('0x22')](respondWithFilteredResult(_0x40cf7c,_0x151705))[_0xc014('0x40')](handleError(_0x40cf7c,null));};exports[_0xc014('0x41')]=function(_0x46ea1c,_0x1f7dfb){var _0x2a0265={'raw':!![],'where':{'id':_0x46ea1c[_0xc014('0x42')]['id']}},_0x84720d={};_0x84720d[_0xc014('0x30')]=_['keys'](db[_0xc014('0x28')]['rawAttributes']);_0x84720d['query']=_[_0xc014('0x2d')](_0x46ea1c[_0xc014('0x2c')]);_0x84720d[_0xc014('0x2e')]=_[_0xc014('0x2f')](_0x84720d[_0xc014('0x30')],_0x84720d['query']);_0x2a0265[_0xc014('0x31')]=_[_0xc014('0x2f')](_0x84720d['model'],qs[_0xc014('0x32')](_0x46ea1c[_0xc014('0x2c')][_0xc014('0x32')]));_0x2a0265[_0xc014('0x31')]=_0x2a0265[_0xc014('0x31')][_0xc014('0x43')]?_0x2a0265[_0xc014('0x31')]:_0x84720d[_0xc014('0x30')];if(_0x46ea1c[_0xc014('0x2c')]['includeAll']){_0x2a0265[_0xc014('0x3d')]=[{'all':!![]}];}_0x2a0265=_[_0xc014('0x38')]({},_0x2a0265,_0x46ea1c[_0xc014('0x3b')]);return db[_0xc014('0x28')][_0xc014('0x44')](_0x2a0265)[_0xc014('0x22')](handleEntityNotFound(_0x1f7dfb,null))[_0xc014('0x22')](respondWithResult(_0x1f7dfb,null))[_0xc014('0x40')](handleError(_0x1f7dfb,null));};exports[_0xc014('0x45')]=function(_0x541ad6,_0x2ce299){return db['ChatQueueReport']['create'](_0x541ad6[_0xc014('0x46')],{})['then'](respondWithResult(_0x2ce299,0xc9))[_0xc014('0x40')](handleError(_0x2ce299,null));};exports[_0xc014('0x20')]=function(_0x56595e,_0x359c24){if(_0x56595e[_0xc014('0x46')]['id']){delete _0x56595e[_0xc014('0x46')]['id'];}return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x56595e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x359c24,null))[_0xc014('0x22')](saveUpdates(_0x56595e[_0xc014('0x46')],null))[_0xc014('0x22')](respondWithResult(_0x359c24,null))[_0xc014('0x40')](handleError(_0x359c24,null));};exports[_0xc014('0x21')]=function(_0x464d3e,_0x255a3b){return db[_0xc014('0x28')][_0xc014('0x44')]({'where':{'id':_0x464d3e[_0xc014('0x42')]['id']}})['then'](handleEntityNotFound(_0x255a3b,null))[_0xc014('0x22')](removeEntity(_0x255a3b,null))[_0xc014('0x40')](handleError(_0x255a3b,null));};exports[_0xc014('0x47')]=function(_0x1d37be,_0x53676a){return db[_0xc014('0x28')][_0xc014('0x47')]()[_0xc014('0x22')](respondWithResult(_0x53676a,null))[_0xc014('0x40')](handleError(_0x53676a,null));};
\ No newline at end of file
+var _0xc2c7=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','keys','find','params','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','fs-extra','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','status','end','json','offset','limit','count','set','Content-Range','reject','save','update','destroy','then','error','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','where'];(function(_0x53da4f,_0x3e28f1){var _0x25a545=function(_0x44cd2e){while(--_0x44cd2e){_0x53da4f['push'](_0x53da4f['shift']());}};_0x25a545(++_0x3e28f1);}(_0xc2c7,0x134));var _0x7c2c=function(_0x55dcba,_0x2d9373){_0x55dcba=_0x55dcba-0x0;var _0x26a9e8=_0xc2c7[_0x55dcba];return _0x26a9e8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7c2c('0x0'));var zipdir=require(_0x7c2c('0x1'));var jsonpatch=require(_0x7c2c('0x2'));var rp=require(_0x7c2c('0x3'));var moment=require(_0x7c2c('0x4'));var BPromise=require(_0x7c2c('0x5'));var Mustache=require(_0x7c2c('0x6'));var util=require(_0x7c2c('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x7c2c('0x8'));var ejs=require(_0x7c2c('0x9'));var fs=require('fs');var fs_extra=require(_0x7c2c('0xa'));var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7c2c('0xb'));var deskjs=require(_0x7c2c('0xc'));var toCsv=require(_0x7c2c('0x8'));var querystring=require(_0x7c2c('0xd'));var Papa=require(_0x7c2c('0xe'));var Redis=require('ioredis');var authService=require(_0x7c2c('0xf'));var qs=require(_0x7c2c('0x10'));var as=require(_0x7c2c('0x11'));var hardwareService=require(_0x7c2c('0x12'));var logger=require(_0x7c2c('0x13'))(_0x7c2c('0x14'));var utils=require(_0x7c2c('0x15'));var config=require(_0x7c2c('0x16'));var licenseUtil=require(_0x7c2c('0x17'));var db=require(_0x7c2c('0x18'))['db'];function respondWithStatusCode(_0xae8441,_0x45847d){_0x45847d=_0x45847d||0xcc;return function(_0x68398a){if(_0x68398a){return _0xae8441[_0x7c2c('0x19')](_0x45847d);}return _0xae8441[_0x7c2c('0x1a')](_0x45847d)[_0x7c2c('0x1b')]();};}function respondWithResult(_0x4c4aaf,_0x5b5729){_0x5b5729=_0x5b5729||0xc8;return function(_0x102778){if(_0x102778){return _0x4c4aaf[_0x7c2c('0x1a')](_0x5b5729)[_0x7c2c('0x1c')](_0x102778);}};}function respondWithFilteredResult(_0x5ae94f,_0x11424c){return function(_0x206ecd){if(_0x206ecd){var _0x5e55e0=typeof _0x11424c[_0x7c2c('0x1d')]==='undefined'&&typeof _0x11424c[_0x7c2c('0x1e')]==='undefined';var _0x342ea2=_0x206ecd[_0x7c2c('0x1f')];var _0x14453f=_0x5e55e0?0x0:_0x11424c[_0x7c2c('0x1d')];var _0x17df4a=_0x5e55e0?_0x206ecd[_0x7c2c('0x1f')]:_0x11424c[_0x7c2c('0x1d')]+_0x11424c[_0x7c2c('0x1e')];var _0x2d356e;if(_0x17df4a>=_0x342ea2){_0x17df4a=_0x342ea2;_0x2d356e=0xc8;}else{_0x2d356e=0xce;}_0x5ae94f[_0x7c2c('0x1a')](_0x2d356e);return _0x5ae94f[_0x7c2c('0x20')](_0x7c2c('0x21'),_0x14453f+'-'+_0x17df4a+'/'+_0x342ea2)['json'](_0x206ecd);}return null;};}function patchUpdates(_0x1c5491){return function(_0x4adb62){try{jsonpatch['apply'](_0x4adb62,_0x1c5491,!![]);}catch(_0x15ae33){return BPromise[_0x7c2c('0x22')](_0x15ae33);}return _0x4adb62[_0x7c2c('0x23')]();};}function saveUpdates(_0x38ae30,_0x41552f){return function(_0x1883b5){if(_0x1883b5){return _0x1883b5[_0x7c2c('0x24')](_0x38ae30)['then'](function(_0x10c356){return _0x10c356;});}return null;};}function removeEntity(_0x4dedd8,_0x302c93){return function(_0x57f510){if(_0x57f510){return _0x57f510[_0x7c2c('0x25')]()[_0x7c2c('0x26')](function(){_0x4dedd8[_0x7c2c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6ec7,_0x31a50c){return function(_0x30c53e){if(!_0x30c53e){_0x4d6ec7[_0x7c2c('0x19')](0x194);}return _0x30c53e;};}function handleError(_0x150690,_0x31d8f3){_0x31d8f3=_0x31d8f3||0x1f4;return function(_0xa8e145){logger[_0x7c2c('0x27')](_0xa8e145['stack']);if(_0xa8e145[_0x7c2c('0x28')]){delete _0xa8e145[_0x7c2c('0x28')];}_0x150690[_0x7c2c('0x1a')](_0x31d8f3)[_0x7c2c('0x29')](_0xa8e145);};}exports[_0x7c2c('0x2a')]=function(_0x1f8846,_0xf2bfd1){var _0x26f472={},_0xa040ff={},_0x5769ec={'count':0x0,'rows':[]};var _0x465ad6=_[_0x7c2c('0x2b')](db[_0x7c2c('0x2c')][_0x7c2c('0x2d')],function(_0x53ad23){return{'name':_0x53ad23[_0x7c2c('0x2e')],'type':_0x53ad23[_0x7c2c('0x2f')][_0x7c2c('0x30')]};});_0xa040ff[_0x7c2c('0x31')]=_[_0x7c2c('0x2b')](_0x465ad6,_0x7c2c('0x28'));_0xa040ff[_0x7c2c('0x32')]=_['keys'](_0x1f8846[_0x7c2c('0x32')]);_0xa040ff[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0xa040ff[_0x7c2c('0x31')],_0xa040ff[_0x7c2c('0x32')]);_0x26f472['attributes']=_['intersection'](_0xa040ff[_0x7c2c('0x31')],qs['fields'](_0x1f8846['query'][_0x7c2c('0x35')]));_0x26f472[_0x7c2c('0x36')]=_0x26f472[_0x7c2c('0x36')][_0x7c2c('0x37')]?_0x26f472['attributes']:_0xa040ff[_0x7c2c('0x31')];if(!_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x38')](_0x7c2c('0x39'))){_0x26f472[_0x7c2c('0x1e')]=qs[_0x7c2c('0x1e')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1e')]);_0x26f472[_0x7c2c('0x1d')]=qs[_0x7c2c('0x1d')](_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x1d')]);}_0x26f472[_0x7c2c('0x3a')]=qs['sort'](_0x1f8846['query'][_0x7c2c('0x3b')]);_0x26f472['where']=qs['filters'](_['pick'](_0x1f8846[_0x7c2c('0x32')],_0xa040ff[_0x7c2c('0x33')]),_0x465ad6);if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]){_0x26f472[_0x7c2c('0x3d')]=_[_0x7c2c('0x3e')](_0x26f472[_0x7c2c('0x3d')],{'$or':_[_0x7c2c('0x2b')](_0x465ad6,function(_0x2b6520){if(_0x2b6520[_0x7c2c('0x2f')]!==_0x7c2c('0x3f')){var _0x58696a={};_0x58696a[_0x2b6520['name']]={'$like':'%'+_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x3c')]+'%'};return _0x58696a;}})});}_0x26f472=_[_0x7c2c('0x3e')]({},_0x26f472,_0x1f8846[_0x7c2c('0x40')]);var _0x5e8c96={'where':_0x26f472[_0x7c2c('0x3d')]};return db[_0x7c2c('0x2c')][_0x7c2c('0x1f')](_0x5e8c96)[_0x7c2c('0x26')](function(_0x18e288){_0x5769ec[_0x7c2c('0x1f')]=_0x18e288;if(_0x1f8846[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x26f472[_0x7c2c('0x42')]=[{'all':!![]}];}return db['ChatQueueReport'][_0x7c2c('0x43')](_0x26f472);})['then'](function(_0x2c3f40){_0x5769ec[_0x7c2c('0x44')]=_0x2c3f40;return _0x5769ec;})['then'](respondWithFilteredResult(_0xf2bfd1,_0x26f472))[_0x7c2c('0x45')](handleError(_0xf2bfd1,null));};exports['show']=function(_0x3014fb,_0x33b2be){var _0x9b9813={'raw':!![],'where':{'id':_0x3014fb['params']['id']}},_0x26351e={};_0x26351e[_0x7c2c('0x31')]=_['keys'](db['ChatQueueReport'][_0x7c2c('0x2d')]);_0x26351e[_0x7c2c('0x32')]=_[_0x7c2c('0x46')](_0x3014fb['query']);_0x26351e[_0x7c2c('0x33')]=_[_0x7c2c('0x34')](_0x26351e['model'],_0x26351e[_0x7c2c('0x32')]);_0x9b9813['attributes']=_[_0x7c2c('0x34')](_0x26351e[_0x7c2c('0x31')],qs['fields'](_0x3014fb['query'][_0x7c2c('0x35')]));_0x9b9813[_0x7c2c('0x36')]=_0x9b9813['attributes'][_0x7c2c('0x37')]?_0x9b9813['attributes']:_0x26351e['model'];if(_0x3014fb[_0x7c2c('0x32')][_0x7c2c('0x41')]){_0x9b9813[_0x7c2c('0x42')]=[{'all':!![]}];}_0x9b9813=_[_0x7c2c('0x3e')]({},_0x9b9813,_0x3014fb[_0x7c2c('0x40')]);return db[_0x7c2c('0x2c')][_0x7c2c('0x47')](_0x9b9813)[_0x7c2c('0x26')](handleEntityNotFound(_0x33b2be,null))[_0x7c2c('0x26')](respondWithResult(_0x33b2be,null))['catch'](handleError(_0x33b2be,null));};exports['create']=function(_0xeb067b,_0x3091bd){return db[_0x7c2c('0x2c')]['create'](_0xeb067b['body'],{})[_0x7c2c('0x26')](respondWithResult(_0x3091bd,0xc9))[_0x7c2c('0x45')](handleError(_0x3091bd,null));};exports[_0x7c2c('0x24')]=function(_0x2b79d5,_0x5f3de8){if(_0x2b79d5['body']['id']){delete _0x2b79d5['body']['id'];}return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x2b79d5[_0x7c2c('0x48')]['id']}})[_0x7c2c('0x26')](handleEntityNotFound(_0x5f3de8,null))[_0x7c2c('0x26')](saveUpdates(_0x2b79d5['body'],null))[_0x7c2c('0x26')](respondWithResult(_0x5f3de8,null))[_0x7c2c('0x45')](handleError(_0x5f3de8,null));};exports['destroy']=function(_0x19621a,_0x56e09d){return db[_0x7c2c('0x2c')][_0x7c2c('0x47')]({'where':{'id':_0x19621a[_0x7c2c('0x48')]['id']}})['then'](handleEntityNotFound(_0x56e09d,null))['then'](removeEntity(_0x56e09d,null))[_0x7c2c('0x45')](handleError(_0x56e09d,null));};exports['describe']=function(_0x13e0bf,_0x11d337){return db['ChatQueueReport'][_0x7c2c('0x49')]()[_0x7c2c('0x26')](respondWithResult(_0x11d337,null))['catch'](handleError(_0x11d337,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9e2a5e1..f9f8b60 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 _0xe706=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x45081a,_0x3ae384){var _0x55bfe2=function(_0xdb8714){while(--_0xdb8714){_0x45081a['push'](_0x45081a['shift']());}};_0x55bfe2(++_0x3ae384);}(_0xe706,0xa3));var _0x6e70=function(_0x2b7442,_0x561591){_0x2b7442=_0x2b7442-0x0;var _0x56e035=_0xe706[_0x2b7442];return _0x56e035;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[{'name':_0x6e70('0xe'),'fields':[_0x6e70('0xe')]}],'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(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0xb10b,0x12a));var _0xbb10=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0xb10b[_0x4474c2];return _0x435fbb;};'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 af93247..088848b 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 _0xa109=['result','catch','create','body','options','raw','CreateChatQueueReport','update','where','attributes','UpdateChatQueueReport','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x1e54c5,_0x415a84){var _0x56247c=function(_0x49ffbb){while(--_0x49ffbb){_0x1e54c5['push'](_0x1e54c5['shift']());}};_0x56247c(++_0x415a84);}(_0xa109,0xf2));var _0x9a10=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa109[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x9a10('0x0'));var util=require('util');var moment=require(_0x9a10('0x1'));var BPromise=require(_0x9a10('0x2'));var rs=require(_0x9a10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9a10('0x4'))['db'];var utils=require(_0x9a10('0x5'));var logger=require(_0x9a10('0x6'))(_0x9a10('0x7'));var config=require(_0x9a10('0x8'));var jayson=require(_0x9a10('0x9'));var client=jayson[_0x9a10('0xa')][_0x9a10('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19b3f5,_0x342712,_0x51c0bd){return new BPromise(function(_0xb16a3c,_0x13224c){return client[_0x9a10('0xc')](_0x19b3f5,_0x51c0bd)[_0x9a10('0xd')](function(_0x1ce4b1){logger[_0x9a10('0xe')](_0x9a10('0xf'),_0x342712,_0x9a10('0x10'));logger[_0x9a10('0x11')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0x342712,_0x9a10('0x10'),JSON[_0x9a10('0x12')](_0x1ce4b1));if(_0x1ce4b1[_0x9a10('0x13')]){if(_0x1ce4b1[_0x9a10('0x13')][_0x9a10('0x14')]===0x1f4){logger['error'](_0x9a10('0xf'),_0x342712,_0x1ce4b1[_0x9a10('0x13')]['message']);return _0x13224c(_0x1ce4b1['error']['message']);}logger[_0x9a10('0x13')](_0x9a10('0xf'),_0x342712,_0x1ce4b1[_0x9a10('0x13')][_0x9a10('0x15')]);return _0xb16a3c(_0x1ce4b1['error'][_0x9a10('0x15')]);}else{logger[_0x9a10('0xe')](_0x9a10('0xf'),_0x342712,_0x9a10('0x10'));_0xb16a3c(_0x1ce4b1[_0x9a10('0x16')][_0x9a10('0x15')]);}})[_0x9a10('0x17')](function(_0x5d0062){logger[_0x9a10('0x13')](_0x9a10('0xf'),_0x342712,_0x5d0062);_0x13224c(_0x5d0062);});});}exports['CreateChatQueueReport']=function(_0x6de1ec){var _0x5bae75=this;return new Promise(function(_0x21ce8d,_0x352a65){return db['ChatQueueReport'][_0x9a10('0x18')](_0x6de1ec[_0x9a10('0x19')],{'raw':_0x6de1ec[_0x9a10('0x1a')]?_0x6de1ec[_0x9a10('0x1a')][_0x9a10('0x1b')]===undefined?!![]:![]:!![]})[_0x9a10('0xd')](function(_0x2aaab1){logger[_0x9a10('0xe')](_0x9a10('0x1c'),_0x6de1ec);logger[_0x9a10('0x11')]('CreateChatQueueReport',_0x6de1ec,JSON[_0x9a10('0x12')](_0x2aaab1));_0x21ce8d(_0x2aaab1);})[_0x9a10('0x17')](function(_0x2ea911){logger[_0x9a10('0x13')](_0x9a10('0x1c'),_0x2ea911[_0x9a10('0x15')],_0x6de1ec);_0x352a65(_0x5bae75[_0x9a10('0x13')](0x1f4,_0x2ea911[_0x9a10('0x15')]));});});};exports['UpdateChatQueueReport']=function(_0x4dabee){var _0x3c4275=this;return new Promise(function(_0x500a7d,_0x3b883e){return db['ChatQueueReport'][_0x9a10('0x1d')](_0x4dabee[_0x9a10('0x19')],{'raw':_0x4dabee[_0x9a10('0x1a')]?_0x4dabee[_0x9a10('0x1a')][_0x9a10('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4dabee[_0x9a10('0x1a')]?_0x4dabee['options'][_0x9a10('0x1e')]||null:null,'attributes':_0x4dabee[_0x9a10('0x1a')]?_0x4dabee[_0x9a10('0x1a')][_0x9a10('0x1f')]||null:null,'limit':_0x4dabee[_0x9a10('0x1a')]?_0x4dabee['options']['limit']||null:null})[_0x9a10('0xd')](function(_0xe83765){logger[_0x9a10('0xe')](_0x9a10('0x20'),_0x4dabee);logger[_0x9a10('0x11')](_0x9a10('0x20'),_0x4dabee,JSON[_0x9a10('0x12')](_0xe83765));_0x500a7d(_0xe83765);})[_0x9a10('0x17')](function(_0x111aca){logger[_0x9a10('0x13')](_0x9a10('0x20'),_0x111aca[_0x9a10('0x15')],_0x4dabee);_0x3b883e(_0x3c4275[_0x9a10('0x13')](0x1f4,_0x111aca[_0x9a10('0x15')]));});});};
\ No newline at end of file
+var _0x23bb=['bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','then','catch','UpdateChatQueueReport','where','attributes','lodash','util','moment'];(function(_0x5c41e6,_0x31ec44){var _0x595f51=function(_0x34ca39){while(--_0x34ca39){_0x5c41e6['push'](_0x5c41e6['shift']());}};_0x595f51(++_0x31ec44);}(_0x23bb,0x10b));var _0xb23b=function(_0x5024c7,_0xd560bd){_0x5024c7=_0x5024c7-0x0;var _0xf2f316=_0x23bb[_0x5024c7];return _0xf2f316;};'use strict';var _=require(_0xb23b('0x0'));var util=require(_0xb23b('0x1'));var moment=require(_0xb23b('0x2'));var BPromise=require(_0xb23b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb23b('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb23b('0x5'));var config=require(_0xb23b('0x6'));var jayson=require(_0xb23b('0x7'));var client=jayson[_0xb23b('0x8')][_0xb23b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1fddb7,_0x240eb0,_0x5c0b57){return new BPromise(function(_0xf6159c,_0x3d1ff3){return client[_0xb23b('0xa')](_0x1fddb7,_0x5c0b57)['then'](function(_0x5ac98d){logger[_0xb23b('0xb')](_0xb23b('0xc'),_0x240eb0,'request\x20sent');logger[_0xb23b('0xd')](_0xb23b('0xe'),_0x240eb0,_0xb23b('0xf'),JSON[_0xb23b('0x10')](_0x5ac98d));if(_0x5ac98d['error']){if(_0x5ac98d[_0xb23b('0x11')]['code']===0x1f4){logger[_0xb23b('0x11')](_0xb23b('0xc'),_0x240eb0,_0x5ac98d[_0xb23b('0x11')]['message']);return _0x3d1ff3(_0x5ac98d[_0xb23b('0x11')][_0xb23b('0x12')]);}logger[_0xb23b('0x11')]('ChatQueueReport,\x20%s,\x20%s',_0x240eb0,_0x5ac98d[_0xb23b('0x11')][_0xb23b('0x12')]);return _0xf6159c(_0x5ac98d['error']['message']);}else{logger[_0xb23b('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0x240eb0,'request\x20sent');_0xf6159c(_0x5ac98d['result'][_0xb23b('0x12')]);}})['catch'](function(_0xb3fde7){logger['error'](_0xb23b('0xc'),_0x240eb0,_0xb3fde7);_0x3d1ff3(_0xb3fde7);});});}exports[_0xb23b('0x13')]=function(_0xcd7bc1){var _0x45024f=this;return new Promise(function(_0x11e06a,_0x4bede4){return db[_0xb23b('0x14')][_0xb23b('0x15')](_0xcd7bc1[_0xb23b('0x16')],{'raw':_0xcd7bc1[_0xb23b('0x17')]?_0xcd7bc1[_0xb23b('0x17')][_0xb23b('0x18')]===undefined?!![]:![]:!![]})[_0xb23b('0x19')](function(_0x37bb87){logger[_0xb23b('0xb')](_0xb23b('0x13'),_0xcd7bc1);logger[_0xb23b('0xd')](_0xb23b('0x13'),_0xcd7bc1,JSON[_0xb23b('0x10')](_0x37bb87));_0x11e06a(_0x37bb87);})[_0xb23b('0x1a')](function(_0x1b6871){logger[_0xb23b('0x11')](_0xb23b('0x13'),_0x1b6871['message'],_0xcd7bc1);_0x4bede4(_0x45024f[_0xb23b('0x11')](0x1f4,_0x1b6871[_0xb23b('0x12')]));});});};exports[_0xb23b('0x1b')]=function(_0x2ee568){var _0x427042=this;return new Promise(function(_0x520486,_0x3d1fde){return db[_0xb23b('0x14')]['update'](_0x2ee568[_0xb23b('0x16')],{'raw':_0x2ee568[_0xb23b('0x17')]?_0x2ee568[_0xb23b('0x17')][_0xb23b('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ee568[_0xb23b('0x17')]?_0x2ee568[_0xb23b('0x17')][_0xb23b('0x1c')]||null:null,'attributes':_0x2ee568[_0xb23b('0x17')]?_0x2ee568[_0xb23b('0x17')][_0xb23b('0x1d')]||null:null,'limit':_0x2ee568['options']?_0x2ee568['options']['limit']||null:null})[_0xb23b('0x19')](function(_0x14f4f8){logger[_0xb23b('0xb')]('UpdateChatQueueReport',_0x2ee568);logger[_0xb23b('0xd')](_0xb23b('0x1b'),_0x2ee568,JSON[_0xb23b('0x10')](_0x14f4f8));_0x520486(_0x14f4f8);})['catch'](function(_0x262700){logger[_0xb23b('0x11')](_0xb23b('0x1b'),_0x262700[_0xb23b('0x12')],_0x2ee568);_0x3d1fde(_0x427042[_0xb23b('0x11')](0x1f4,_0x262700[_0xb23b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 4cb502a..3da097c 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 _0xf395=['update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','describe','/:id','post','create','put'];(function(_0x6964aa,_0x53fb14){var _0x589c46=function(_0x577a9f){while(--_0x577a9f){_0x6964aa['push'](_0x6964aa['shift']());}};_0x589c46(++_0x53fb14);}(_0xf395,0x12a));var _0x5f39=function(_0x280c7a,_0x3f29b4){_0x280c7a=_0x280c7a-0x0;var _0x32ce3b=_0xf395[_0x280c7a];return _0x32ce3b;};'use strict';var multer=require(_0x5f39('0x0'));var util=require(_0x5f39('0x1'));var path=require(_0x5f39('0x2'));var timeout=require(_0x5f39('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5f39('0x4'));var auth=require(_0x5f39('0x5'));var interaction=require(_0x5f39('0x6'));var config=require(_0x5f39('0x7'));var controller=require(_0x5f39('0x8'));router[_0x5f39('0x9')]('/',auth[_0x5f39('0xa')](),controller[_0x5f39('0xb')]);router[_0x5f39('0x9')]('/describe',auth[_0x5f39('0xa')](),controller[_0x5f39('0xc')]);router[_0x5f39('0x9')](_0x5f39('0xd'),auth[_0x5f39('0xa')](),controller['show']);router[_0x5f39('0xe')]('/',auth[_0x5f39('0xa')](),controller[_0x5f39('0xf')]);router[_0x5f39('0x10')](_0x5f39('0xd'),auth[_0x5f39('0xa')](),controller[_0x5f39('0x11')]);router[_0x5f39('0x12')]('/:id',auth[_0x5f39('0xa')](),controller[_0x5f39('0x13')]);module[_0x5f39('0x14')]=router;
\ No newline at end of file
+var _0x1269=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','/describe','describe','show','post','create','put','update','/:id','destroy','multer'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1269,0xfb));var _0x9126=function(_0x5f265e,_0x5f29c3){_0x5f265e=_0x5f265e-0x0;var _0x197592=_0x1269[_0x5f265e];return _0x197592;};'use strict';var multer=require(_0x9126('0x0'));var util=require('util');var path=require(_0x9126('0x1'));var timeout=require(_0x9126('0x2'));var express=require(_0x9126('0x3'));var router=express[_0x9126('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x9126('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9126('0x6'));var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x9126('0x7')](),controller[_0x9126('0x8')]);router['get'](_0x9126('0x9'),auth[_0x9126('0x7')](),controller[_0x9126('0xa')]);router['get']('/:id',auth[_0x9126('0x7')](),controller[_0x9126('0xb')]);router[_0x9126('0xc')]('/',auth[_0x9126('0x7')](),controller[_0x9126('0xd')]);router[_0x9126('0xe')]('/:id',auth[_0x9126('0x7')](),controller[_0x9126('0xf')]);router['delete'](_0x9126('0x10'),auth[_0x9126('0x7')](),controller[_0x9126('0x11')]);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 0f1ff99..4d53c62 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 _0x9c44=['ENUM','account','agent','queue','NOW','exports','STRING'];(function(_0x38e5ee,_0x3cd0cb){var _0x85812d=function(_0x3715a7){while(--_0x3715a7){_0x38e5ee['push'](_0x38e5ee['shift']());}};_0x85812d(++_0x3cd0cb);}(_0x9c44,0x178));var _0x49c4=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x9c44[_0x2b7764];return _0x848dcb;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x49c4('0x0')]={'uniqueid':{'type':Sequelize[_0x49c4('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x49c4('0x2')](_0x49c4('0x3'),_0x49c4('0x4'),_0x49c4('0x5')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x49c4('0x6')]}};
\ No newline at end of file
+var _0x4b84=['moment','sequelize','ENUM','queue','DATE'];(function(_0x49eba0,_0x326642){var _0x546d60=function(_0x54080e){while(--_0x54080e){_0x49eba0['push'](_0x49eba0['shift']());}};_0x546d60(++_0x326642);}(_0x4b84,0x1cc));var _0x44b8=function(_0x5a26f5,_0x196300){_0x5a26f5=_0x5a26f5-0x0;var _0x2e9ef7=_0x4b84[_0x5a26f5];return _0x2e9ef7;};'use strict';var moment=require(_0x44b8('0x0'));var Sequelize=require(_0x44b8('0x1'));module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x44b8('0x2')]('account','agent',_0x44b8('0x3')),'allowNull':![],'defaultValue':_0x44b8('0x3')},'transferredAt':{'type':Sequelize[_0x44b8('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 03fa353..83de297 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 _0x0822=['findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','error','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','where','pick','filter','VIRTUAL','merge','ChatTransferReport','includeAll','include'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0822,0x182));var _0x2082=function(_0x11c639,_0x49997c){_0x11c639=_0x11c639-0x0;var _0xa28500=_0x0822[_0x11c639];return _0xa28500;};'use strict';var emlformat=require(_0x2082('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2082('0x1'));var jsonpatch=require(_0x2082('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x2082('0x3'));var Mustache=require(_0x2082('0x4'));var util=require(_0x2082('0x5'));var path=require('path');var sox=require(_0x2082('0x6'));var csv=require(_0x2082('0x7'));var ejs=require(_0x2082('0x8'));var fs=require('fs');var fs_extra=require(_0x2082('0x9'));var _=require(_0x2082('0xa'));var squel=require(_0x2082('0xb'));var crypto=require(_0x2082('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2082('0xd'));var toCsv=require('to-csv');var querystring=require(_0x2082('0xe'));var Papa=require(_0x2082('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2082('0x10'));var as=require(_0x2082('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2082('0x12'))('api');var utils=require(_0x2082('0x13'));var config=require(_0x2082('0x14'));var licenseUtil=require(_0x2082('0x15'));var db=require(_0x2082('0x16'))['db'];function respondWithStatusCode(_0x547a6b,_0x18b7e7){_0x18b7e7=_0x18b7e7||0xcc;return function(_0x31d714){if(_0x31d714){return _0x547a6b['sendStatus'](_0x18b7e7);}return _0x547a6b[_0x2082('0x17')](_0x18b7e7)[_0x2082('0x18')]();};}function respondWithResult(_0x4f4b60,_0x4707e1){_0x4707e1=_0x4707e1||0xc8;return function(_0x682e68){if(_0x682e68){return _0x4f4b60[_0x2082('0x17')](_0x4707e1)['json'](_0x682e68);}};}function respondWithFilteredResult(_0x4e5cdc,_0x528059){return function(_0x1d12eb){if(_0x1d12eb){var _0x4fe301=typeof _0x528059[_0x2082('0x19')]===_0x2082('0x1a')&&typeof _0x528059[_0x2082('0x1b')]===_0x2082('0x1a');var _0x5f2d9f=_0x1d12eb[_0x2082('0x1c')];var _0x2290b9=_0x4fe301?0x0:_0x528059[_0x2082('0x19')];var _0x456967=_0x4fe301?_0x1d12eb[_0x2082('0x1c')]:_0x528059[_0x2082('0x19')]+_0x528059[_0x2082('0x1b')];var _0x58d7ac;if(_0x456967>=_0x5f2d9f){_0x456967=_0x5f2d9f;_0x58d7ac=0xc8;}else{_0x58d7ac=0xce;}_0x4e5cdc['status'](_0x58d7ac);return _0x4e5cdc[_0x2082('0x1d')](_0x2082('0x1e'),_0x2290b9+'-'+_0x456967+'/'+_0x5f2d9f)[_0x2082('0x1f')](_0x1d12eb);}return null;};}function patchUpdates(_0x5858b0){return function(_0x452263){try{jsonpatch[_0x2082('0x20')](_0x452263,_0x5858b0,!![]);}catch(_0x140af0){return BPromise[_0x2082('0x21')](_0x140af0);}return _0x452263['save']();};}function saveUpdates(_0x1e9d32,_0x5b66b4){return function(_0x548fd4){if(_0x548fd4){return _0x548fd4[_0x2082('0x22')](_0x1e9d32)[_0x2082('0x23')](function(_0xc3e897){return _0xc3e897;});}return null;};}function removeEntity(_0x3b45cc,_0x1eef0e){return function(_0x1d5b8c){if(_0x1d5b8c){return _0x1d5b8c[_0x2082('0x24')]()[_0x2082('0x23')](function(){_0x3b45cc[_0x2082('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d1f9f,_0x31531e){return function(_0x155c76){if(!_0x155c76){_0x2d1f9f['sendStatus'](0x194);}return _0x155c76;};}function handleError(_0x157e02,_0x2844bd){_0x2844bd=_0x2844bd||0x1f4;return function(_0xc910fb){logger[_0x2082('0x25')](_0xc910fb[_0x2082('0x26')]);if(_0xc910fb[_0x2082('0x27')]){delete _0xc910fb[_0x2082('0x27')];}_0x157e02[_0x2082('0x17')](_0x2844bd)[_0x2082('0x28')](_0xc910fb);};}exports[_0x2082('0x29')]=function(_0x182116,_0x20275f){var _0x1b84bd={},_0xcfba82={},_0x3ac870={'count':0x0,'rows':[]};var _0x411486=_['map'](db['ChatTransferReport']['rawAttributes'],function(_0x33a869){return{'name':_0x33a869[_0x2082('0x2a')],'type':_0x33a869[_0x2082('0x2b')][_0x2082('0x2c')]};});_0xcfba82[_0x2082('0x2d')]=_[_0x2082('0x2e')](_0x411486,_0x2082('0x27'));_0xcfba82[_0x2082('0x2f')]=_[_0x2082('0x30')](_0x182116['query']);_0xcfba82[_0x2082('0x31')]=_[_0x2082('0x32')](_0xcfba82[_0x2082('0x2d')],_0xcfba82[_0x2082('0x2f')]);_0x1b84bd['attributes']=_[_0x2082('0x32')](_0xcfba82['model'],qs[_0x2082('0x33')](_0x182116[_0x2082('0x2f')][_0x2082('0x33')]));_0x1b84bd['attributes']=_0x1b84bd[_0x2082('0x34')][_0x2082('0x35')]?_0x1b84bd[_0x2082('0x34')]:_0xcfba82[_0x2082('0x2d')];if(!_0x182116[_0x2082('0x2f')]['hasOwnProperty']('nolimit')){_0x1b84bd[_0x2082('0x1b')]=qs[_0x2082('0x1b')](_0x182116[_0x2082('0x2f')][_0x2082('0x1b')]);_0x1b84bd[_0x2082('0x19')]=qs[_0x2082('0x19')](_0x182116[_0x2082('0x2f')][_0x2082('0x19')]);}_0x1b84bd[_0x2082('0x36')]=qs['sort'](_0x182116[_0x2082('0x2f')][_0x2082('0x37')]);_0x1b84bd[_0x2082('0x38')]=qs[_0x2082('0x31')](_[_0x2082('0x39')](_0x182116['query'],_0xcfba82[_0x2082('0x31')]),_0x411486);if(_0x182116[_0x2082('0x2f')][_0x2082('0x3a')]){_0x1b84bd[_0x2082('0x38')]=_['merge'](_0x1b84bd[_0x2082('0x38')],{'$or':_[_0x2082('0x2e')](_0x411486,function(_0xab7d39){if(_0xab7d39[_0x2082('0x2b')]!==_0x2082('0x3b')){var _0x42ad2a={};_0x42ad2a[_0xab7d39[_0x2082('0x27')]]={'$like':'%'+_0x182116[_0x2082('0x2f')][_0x2082('0x3a')]+'%'};return _0x42ad2a;}})});}_0x1b84bd=_[_0x2082('0x3c')]({},_0x1b84bd,_0x182116['options']);var _0xce7663={'where':_0x1b84bd[_0x2082('0x38')]};return db[_0x2082('0x3d')][_0x2082('0x1c')](_0xce7663)[_0x2082('0x23')](function(_0xeaf228){_0x3ac870[_0x2082('0x1c')]=_0xeaf228;if(_0x182116[_0x2082('0x2f')][_0x2082('0x3e')]){_0x1b84bd[_0x2082('0x3f')]=[{'all':!![]}];}return db['ChatTransferReport'][_0x2082('0x40')](_0x1b84bd);})[_0x2082('0x23')](function(_0x4304c6){_0x3ac870[_0x2082('0x41')]=_0x4304c6;return _0x3ac870;})[_0x2082('0x23')](respondWithFilteredResult(_0x20275f,_0x1b84bd))[_0x2082('0x42')](handleError(_0x20275f,null));};exports[_0x2082('0x43')]=function(_0x4adab6,_0x509ac5){var _0x3de299={'raw':!![],'where':{'id':_0x4adab6[_0x2082('0x44')]['id']}},_0x12844f={};_0x12844f[_0x2082('0x2d')]=_[_0x2082('0x30')](db['ChatTransferReport'][_0x2082('0x45')]);_0x12844f[_0x2082('0x2f')]=_['keys'](_0x4adab6[_0x2082('0x2f')]);_0x12844f['filters']=_[_0x2082('0x32')](_0x12844f['model'],_0x12844f['query']);_0x3de299[_0x2082('0x34')]=_['intersection'](_0x12844f[_0x2082('0x2d')],qs[_0x2082('0x33')](_0x4adab6[_0x2082('0x2f')][_0x2082('0x33')]));_0x3de299['attributes']=_0x3de299[_0x2082('0x34')]['length']?_0x3de299[_0x2082('0x34')]:_0x12844f['model'];if(_0x4adab6[_0x2082('0x2f')][_0x2082('0x3e')]){_0x3de299[_0x2082('0x3f')]=[{'all':!![]}];}_0x3de299=_['merge']({},_0x3de299,_0x4adab6[_0x2082('0x46')]);return db['ChatTransferReport'][_0x2082('0x47')](_0x3de299)['then'](handleEntityNotFound(_0x509ac5,null))[_0x2082('0x23')](respondWithResult(_0x509ac5,null))['catch'](handleError(_0x509ac5,null));};exports[_0x2082('0x48')]=function(_0x1e167b,_0x2baea7){return db[_0x2082('0x3d')]['create'](_0x1e167b[_0x2082('0x49')],{})[_0x2082('0x23')](respondWithResult(_0x2baea7,0xc9))[_0x2082('0x42')](handleError(_0x2baea7,null));};exports[_0x2082('0x22')]=function(_0x337951,_0x4c8096){if(_0x337951['body']['id']){delete _0x337951[_0x2082('0x49')]['id'];}return db[_0x2082('0x3d')][_0x2082('0x47')]({'where':{'id':_0x337951[_0x2082('0x44')]['id']}})[_0x2082('0x23')](handleEntityNotFound(_0x4c8096,null))['then'](saveUpdates(_0x337951[_0x2082('0x49')],null))[_0x2082('0x23')](respondWithResult(_0x4c8096,null))['catch'](handleError(_0x4c8096,null));};exports['destroy']=function(_0x4ca84e,_0x597d7d){return db['ChatTransferReport'][_0x2082('0x47')]({'where':{'id':_0x4ca84e[_0x2082('0x44')]['id']}})[_0x2082('0x23')](handleEntityNotFound(_0x597d7d,null))[_0x2082('0x23')](removeEntity(_0x597d7d,null))[_0x2082('0x42')](handleError(_0x597d7d,null));};exports[_0x2082('0x4a')]=function(_0x2f3fe9,_0x48b235){return db[_0x2082('0x3d')]['describe']()['then'](respondWithResult(_0x48b235,null))[_0x2082('0x42')](handleError(_0x48b235,null));};
\ No newline at end of file
+var _0xf398=['order','sort','where','pick','merge','VIRTUAL','options','ChatTransferReport','includeAll','include','findAll','rows','catch','length','find','create','body','update','params','describe','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','save','then','sendStatus','error','send','index','map','rawAttributes','fieldName','type','name','keys','query','filters','intersection','model','attributes','fields'];(function(_0x51248d,_0x27f47e){var _0xbbb193=function(_0x20c118){while(--_0x20c118){_0x51248d['push'](_0x51248d['shift']());}};_0xbbb193(++_0x27f47e);}(_0xf398,0x134));var _0x8f39=function(_0x672d4c,_0x246fdc){_0x672d4c=_0x672d4c-0x0;var _0x442494=_0xf398[_0x672d4c];return _0x442494;};'use strict';var emlformat=require(_0x8f39('0x0'));var rimraf=require(_0x8f39('0x1'));var zipdir=require(_0x8f39('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8f39('0x3'));var Mustache=require(_0x8f39('0x4'));var util=require(_0x8f39('0x5'));var path=require(_0x8f39('0x6'));var sox=require(_0x8f39('0x7'));var csv=require(_0x8f39('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x8f39('0x9'));var _=require(_0x8f39('0xa'));var squel=require(_0x8f39('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8f39('0xc'));var toCsv=require(_0x8f39('0x8'));var querystring=require(_0x8f39('0xd'));var Papa=require(_0x8f39('0xe'));var Redis=require(_0x8f39('0xf'));var authService=require(_0x8f39('0x10'));var qs=require(_0x8f39('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8f39('0x12'));var logger=require(_0x8f39('0x13'))(_0x8f39('0x14'));var utils=require('../../config/utils');var config=require(_0x8f39('0x15'));var licenseUtil=require(_0x8f39('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x13655d,_0x1730a8){_0x1730a8=_0x1730a8||0xcc;return function(_0x603a26){if(_0x603a26){return _0x13655d['sendStatus'](_0x1730a8);}return _0x13655d[_0x8f39('0x17')](_0x1730a8)[_0x8f39('0x18')]();};}function respondWithResult(_0x239dba,_0xc1c7c3){_0xc1c7c3=_0xc1c7c3||0xc8;return function(_0x7caa4a){if(_0x7caa4a){return _0x239dba[_0x8f39('0x17')](_0xc1c7c3)[_0x8f39('0x19')](_0x7caa4a);}};}function respondWithFilteredResult(_0x2bbf61,_0x21b27d){return function(_0x22c902){if(_0x22c902){var _0x279892=typeof _0x21b27d['offset']===_0x8f39('0x1a')&&typeof _0x21b27d[_0x8f39('0x1b')]===_0x8f39('0x1a');var _0x45f259=_0x22c902[_0x8f39('0x1c')];var _0x5dc921=_0x279892?0x0:_0x21b27d['offset'];var _0x1600e8=_0x279892?_0x22c902[_0x8f39('0x1c')]:_0x21b27d[_0x8f39('0x1d')]+_0x21b27d['limit'];var _0x24b8ca;if(_0x1600e8>=_0x45f259){_0x1600e8=_0x45f259;_0x24b8ca=0xc8;}else{_0x24b8ca=0xce;}_0x2bbf61[_0x8f39('0x17')](_0x24b8ca);return _0x2bbf61[_0x8f39('0x1e')](_0x8f39('0x1f'),_0x5dc921+'-'+_0x1600e8+'/'+_0x45f259)['json'](_0x22c902);}return null;};}function patchUpdates(_0x12178c){return function(_0x6af6bf){try{jsonpatch[_0x8f39('0x20')](_0x6af6bf,_0x12178c,!![]);}catch(_0x28b47b){return BPromise[_0x8f39('0x21')](_0x28b47b);}return _0x6af6bf[_0x8f39('0x22')]();};}function saveUpdates(_0x3f15e1,_0x52eaf6){return function(_0x31b85e){if(_0x31b85e){return _0x31b85e['update'](_0x3f15e1)[_0x8f39('0x23')](function(_0x3e9d3a){return _0x3e9d3a;});}return null;};}function removeEntity(_0xe338d1,_0x1b2210){return function(_0x466483){if(_0x466483){return _0x466483['destroy']()[_0x8f39('0x23')](function(){_0xe338d1[_0x8f39('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b6a23,_0x34ee28){return function(_0x9bd1fe){if(!_0x9bd1fe){_0x4b6a23[_0x8f39('0x24')](0x194);}return _0x9bd1fe;};}function handleError(_0x5da2c6,_0x27b5cb){_0x27b5cb=_0x27b5cb||0x1f4;return function(_0x344042){logger[_0x8f39('0x25')](_0x344042['stack']);if(_0x344042['name']){delete _0x344042['name'];}_0x5da2c6[_0x8f39('0x17')](_0x27b5cb)[_0x8f39('0x26')](_0x344042);};}exports[_0x8f39('0x27')]=function(_0x20e4f9,_0x10c8fb){var _0x3717b2={},_0x373854={},_0x361a68={'count':0x0,'rows':[]};var _0x17a0d1=_[_0x8f39('0x28')](db['ChatTransferReport'][_0x8f39('0x29')],function(_0x472de5){return{'name':_0x472de5[_0x8f39('0x2a')],'type':_0x472de5[_0x8f39('0x2b')]['key']};});_0x373854['model']=_[_0x8f39('0x28')](_0x17a0d1,_0x8f39('0x2c'));_0x373854['query']=_[_0x8f39('0x2d')](_0x20e4f9[_0x8f39('0x2e')]);_0x373854[_0x8f39('0x2f')]=_[_0x8f39('0x30')](_0x373854[_0x8f39('0x31')],_0x373854[_0x8f39('0x2e')]);_0x3717b2[_0x8f39('0x32')]=_[_0x8f39('0x30')](_0x373854[_0x8f39('0x31')],qs[_0x8f39('0x33')](_0x20e4f9[_0x8f39('0x2e')]['fields']));_0x3717b2['attributes']=_0x3717b2[_0x8f39('0x32')]['length']?_0x3717b2['attributes']:_0x373854['model'];if(!_0x20e4f9[_0x8f39('0x2e')]['hasOwnProperty']('nolimit')){_0x3717b2[_0x8f39('0x1b')]=qs[_0x8f39('0x1b')](_0x20e4f9[_0x8f39('0x2e')]['limit']);_0x3717b2[_0x8f39('0x1d')]=qs[_0x8f39('0x1d')](_0x20e4f9['query']['offset']);}_0x3717b2[_0x8f39('0x34')]=qs[_0x8f39('0x35')](_0x20e4f9[_0x8f39('0x2e')][_0x8f39('0x35')]);_0x3717b2[_0x8f39('0x36')]=qs[_0x8f39('0x2f')](_[_0x8f39('0x37')](_0x20e4f9['query'],_0x373854[_0x8f39('0x2f')]),_0x17a0d1);if(_0x20e4f9[_0x8f39('0x2e')]['filter']){_0x3717b2[_0x8f39('0x36')]=_[_0x8f39('0x38')](_0x3717b2[_0x8f39('0x36')],{'$or':_['map'](_0x17a0d1,function(_0x4d753a){if(_0x4d753a[_0x8f39('0x2b')]!==_0x8f39('0x39')){var _0x24687d={};_0x24687d[_0x4d753a[_0x8f39('0x2c')]]={'$like':'%'+_0x20e4f9['query']['filter']+'%'};return _0x24687d;}})});}_0x3717b2=_[_0x8f39('0x38')]({},_0x3717b2,_0x20e4f9[_0x8f39('0x3a')]);var _0x27d2bf={'where':_0x3717b2[_0x8f39('0x36')]};return db[_0x8f39('0x3b')][_0x8f39('0x1c')](_0x27d2bf)['then'](function(_0x4a9826){_0x361a68['count']=_0x4a9826;if(_0x20e4f9[_0x8f39('0x2e')][_0x8f39('0x3c')]){_0x3717b2[_0x8f39('0x3d')]=[{'all':!![]}];}return db[_0x8f39('0x3b')][_0x8f39('0x3e')](_0x3717b2);})[_0x8f39('0x23')](function(_0x5e000c){_0x361a68[_0x8f39('0x3f')]=_0x5e000c;return _0x361a68;})[_0x8f39('0x23')](respondWithFilteredResult(_0x10c8fb,_0x3717b2))[_0x8f39('0x40')](handleError(_0x10c8fb,null));};exports['show']=function(_0x2753b8,_0x2c894d){var _0x481754={'raw':!![],'where':{'id':_0x2753b8['params']['id']}},_0x503145={};_0x503145['model']=_['keys'](db[_0x8f39('0x3b')][_0x8f39('0x29')]);_0x503145[_0x8f39('0x2e')]=_[_0x8f39('0x2d')](_0x2753b8[_0x8f39('0x2e')]);_0x503145[_0x8f39('0x2f')]=_['intersection'](_0x503145[_0x8f39('0x31')],_0x503145[_0x8f39('0x2e')]);_0x481754[_0x8f39('0x32')]=_[_0x8f39('0x30')](_0x503145[_0x8f39('0x31')],qs[_0x8f39('0x33')](_0x2753b8[_0x8f39('0x2e')][_0x8f39('0x33')]));_0x481754['attributes']=_0x481754['attributes'][_0x8f39('0x41')]?_0x481754[_0x8f39('0x32')]:_0x503145[_0x8f39('0x31')];if(_0x2753b8['query'][_0x8f39('0x3c')]){_0x481754[_0x8f39('0x3d')]=[{'all':!![]}];}_0x481754=_[_0x8f39('0x38')]({},_0x481754,_0x2753b8[_0x8f39('0x3a')]);return db[_0x8f39('0x3b')][_0x8f39('0x42')](_0x481754)['then'](handleEntityNotFound(_0x2c894d,null))[_0x8f39('0x23')](respondWithResult(_0x2c894d,null))[_0x8f39('0x40')](handleError(_0x2c894d,null));};exports[_0x8f39('0x43')]=function(_0x1b78ba,_0x5151ee){return db[_0x8f39('0x3b')][_0x8f39('0x43')](_0x1b78ba[_0x8f39('0x44')],{})[_0x8f39('0x23')](respondWithResult(_0x5151ee,0xc9))[_0x8f39('0x40')](handleError(_0x5151ee,null));};exports[_0x8f39('0x45')]=function(_0x5b18b6,_0x5939c8){if(_0x5b18b6[_0x8f39('0x44')]['id']){delete _0x5b18b6[_0x8f39('0x44')]['id'];}return db[_0x8f39('0x3b')]['find']({'where':{'id':_0x5b18b6[_0x8f39('0x46')]['id']}})[_0x8f39('0x23')](handleEntityNotFound(_0x5939c8,null))[_0x8f39('0x23')](saveUpdates(_0x5b18b6[_0x8f39('0x44')],null))[_0x8f39('0x23')](respondWithResult(_0x5939c8,null))[_0x8f39('0x40')](handleError(_0x5939c8,null));};exports['destroy']=function(_0x4bbdf4,_0x519c01){return db[_0x8f39('0x3b')][_0x8f39('0x42')]({'where':{'id':_0x4bbdf4[_0x8f39('0x46')]['id']}})[_0x8f39('0x23')](handleEntityNotFound(_0x519c01,null))[_0x8f39('0x23')](removeEntity(_0x519c01,null))['catch'](handleError(_0x519c01,null));};exports[_0x8f39('0x47')]=function(_0x2154d0,_0x3f4589){return db[_0x8f39('0x3b')][_0x8f39('0x47')]()[_0x8f39('0x23')](respondWithResult(_0x3f4589,null))[_0x8f39('0x40')](handleError(_0x3f4589,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 444d959..c5bb830 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 _0x6c94=['moment','bluebird','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api'];(function(_0x312aa3,_0x5967ab){var _0x6375e9=function(_0x5205a7){while(--_0x5205a7){_0x312aa3['push'](_0x312aa3['shift']());}};_0x6375e9(++_0x5967ab);}(_0x6c94,0x1aa));var _0x46c9=function(_0x156d45,_0x7ede56){_0x156d45=_0x156d45-0x0;var _0x50f99d=_0x6c94[_0x156d45];return _0x50f99d;};'use strict';var _=require(_0x46c9('0x0'));var util=require(_0x46c9('0x1'));var logger=require('../../config/logger')(_0x46c9('0x2'));var moment=require(_0x46c9('0x3'));var BPromise=require(_0x46c9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x46c9('0x5'));var config=require(_0x46c9('0x6'));var attributes=require(_0x46c9('0x7'));module[_0x46c9('0x8')]=function(_0x54cd7a,_0x47427e){return _0x54cd7a[_0x46c9('0x9')](_0x46c9('0xa'),attributes,{'tableName':_0x46c9('0xb'),'paranoid':![],'indexes':[{'name':_0x46c9('0xc'),'fields':[_0x46c9('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0x041d=['uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x4c260a,_0x148241){var _0x17bbdd=function(_0x4f3e9f){while(--_0x4f3e9f){_0x4c260a['push'](_0x4c260a['shift']());}};_0x17bbdd(++_0x148241);}(_0x041d,0xe1));var _0xd041=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0x041d[_0x36ed48];return _0x51c63a;};'use strict';var _=require('lodash');var util=require(_0xd041('0x0'));var logger=require(_0xd041('0x1'))(_0xd041('0x2'));var moment=require(_0xd041('0x3'));var BPromise=require(_0xd041('0x4'));var rp=require(_0xd041('0x5'));var fs=require('fs');var path=require(_0xd041('0x6'));var rimraf=require(_0xd041('0x7'));var config=require(_0xd041('0x8'));var attributes=require(_0xd041('0x9'));module[_0xd041('0xa')]=function(_0x206a55,_0x5f5477){return _0x206a55['define'](_0xd041('0xb'),attributes,{'tableName':_0xd041('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd041('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 406348b..744fd44 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 _0xd2df=['util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','ChatTransferReport,\x20%s,\x20%s','message','info'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xd2df,0x1b9));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfd2d('0x0'));var moment=require(_0xfd2d('0x1'));var BPromise=require('bluebird');var rs=require(_0xfd2d('0x2'));var fs=require('fs');var Redis=require(_0xfd2d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd2d('0x4'));var logger=require(_0xfd2d('0x5'))(_0xfd2d('0x6'));var config=require(_0xfd2d('0x7'));var jayson=require(_0xfd2d('0x8'));var client=jayson[_0xfd2d('0x9')][_0xfd2d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4b1fc2,_0x249367,_0x3d9011){return new BPromise(function(_0x4f8974,_0x52cd8a){return client[_0xfd2d('0xb')](_0x4b1fc2,_0x3d9011)[_0xfd2d('0xc')](function(_0x359fe){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x249367,_0xfd2d('0xd'));logger[_0xfd2d('0xe')](_0xfd2d('0xf'),_0x249367,_0xfd2d('0xd'),JSON['stringify'](_0x359fe));if(_0x359fe[_0xfd2d('0x10')]){if(_0x359fe['error'][_0xfd2d('0x11')]===0x1f4){logger['error'](_0xfd2d('0x12'),_0x249367,_0x359fe[_0xfd2d('0x10')][_0xfd2d('0x13')]);return _0x52cd8a(_0x359fe['error'][_0xfd2d('0x13')]);}logger[_0xfd2d('0x10')](_0xfd2d('0x12'),_0x249367,_0x359fe['error'][_0xfd2d('0x13')]);return _0x4f8974(_0x359fe[_0xfd2d('0x10')][_0xfd2d('0x13')]);}else{logger[_0xfd2d('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x249367,_0xfd2d('0xd'));_0x4f8974(_0x359fe['result'][_0xfd2d('0x13')]);}})['catch'](function(_0x2d1864){logger[_0xfd2d('0x10')](_0xfd2d('0x12'),_0x249367,_0x2d1864);_0x52cd8a(_0x2d1864);});});}
\ No newline at end of file
+var _0x3a9e=['ChatTransferReport,\x20%s,\x20%s','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then'];(function(_0x1562a2,_0x2e4655){var _0x39a636=function(_0x25483a){while(--_0x25483a){_0x1562a2['push'](_0x1562a2['shift']());}};_0x39a636(++_0x2e4655);}(_0x3a9e,0x7a));var _0xe3a9=function(_0x311c35,_0x54a2b0){_0x311c35=_0x311c35-0x0;var _0x31ff65=_0x3a9e[_0x311c35];return _0x31ff65;};'use strict';var _=require('lodash');var util=require(_0xe3a9('0x0'));var moment=require(_0xe3a9('0x1'));var BPromise=require(_0xe3a9('0x2'));var rs=require(_0xe3a9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe3a9('0x5'))(_0xe3a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xe3a9('0x7'));var client=jayson[_0xe3a9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x272fa7,_0x22df52,_0x63082b){return new BPromise(function(_0x571bec,_0xb9a000){return client[_0xe3a9('0x9')](_0x272fa7,_0x63082b)[_0xe3a9('0xa')](function(_0x240dfc){logger['info'](_0xe3a9('0xb'),_0x22df52,'request\x20sent');logger['debug'](_0xe3a9('0xc'),_0x22df52,_0xe3a9('0xd'),JSON[_0xe3a9('0xe')](_0x240dfc));if(_0x240dfc[_0xe3a9('0xf')]){if(_0x240dfc[_0xe3a9('0xf')][_0xe3a9('0x10')]===0x1f4){logger[_0xe3a9('0xf')](_0xe3a9('0xb'),_0x22df52,_0x240dfc['error']['message']);return _0xb9a000(_0x240dfc['error'][_0xe3a9('0x11')]);}logger[_0xe3a9('0xf')](_0xe3a9('0xb'),_0x22df52,_0x240dfc[_0xe3a9('0xf')][_0xe3a9('0x11')]);return _0x571bec(_0x240dfc[_0xe3a9('0xf')]['message']);}else{logger['info'](_0xe3a9('0xb'),_0x22df52,_0xe3a9('0xd'));_0x571bec(_0x240dfc['result']['message']);}})[_0xe3a9('0x12')](function(_0x3ed0a0){logger[_0xe3a9('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x22df52,_0x3ed0a0);_0xb9a000(_0x3ed0a0);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index 47a5cb7..d99a3bf 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 _0x4caa=['../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','exports','multer','util','express','Router','fs-extra'];(function(_0x547bd6,_0x2abe0c){var _0x5ad6d7=function(_0x209bbf){while(--_0x209bbf){_0x547bd6['push'](_0x547bd6['shift']());}};_0x5ad6d7(++_0x2abe0c);}(_0x4caa,0x1ef));var _0xa4ca=function(_0xe5cac7,_0x6c2f84){_0xe5cac7=_0xe5cac7-0x0;var _0x50df20=_0x4caa[_0xe5cac7];return _0x50df20;};'use strict';var multer=require(_0xa4ca('0x0'));var util=require(_0xa4ca('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa4ca('0x2'));var router=express[_0xa4ca('0x3')]();var fs_extra=require(_0xa4ca('0x4'));var auth=require(_0xa4ca('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa4ca('0x6'));var controller=require(_0xa4ca('0x7'));router[_0xa4ca('0x8')]('/',auth[_0xa4ca('0x9')](),controller[_0xa4ca('0xa')]);router[_0xa4ca('0x8')](_0xa4ca('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xa4ca('0x8')](_0xa4ca('0xc'),auth[_0xa4ca('0x9')](),controller[_0xa4ca('0xd')]);router[_0xa4ca('0xe')]('/',auth['isAuthenticated'](),controller[_0xa4ca('0xf')]);router[_0xa4ca('0x10')]('/:id',auth[_0xa4ca('0x9')](),controller[_0xa4ca('0x11')]);router[_0xa4ca('0x12')](_0xa4ca('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xa4ca('0x13')]=router;
\ No newline at end of file
+var _0x36ab=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatTransferReport.controller','index','/describe','isAuthenticated','describe','get','/:id','show','post','put'];(function(_0x517b09,_0x167924){var _0x51b6b2=function(_0x4446dc){while(--_0x4446dc){_0x517b09['push'](_0x517b09['shift']());}};_0x51b6b2(++_0x167924);}(_0x36ab,0xb3));var _0xb36a=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0x36ab[_0x45d55e];return _0x29812a;};'use strict';var multer=require(_0xb36a('0x0'));var util=require(_0xb36a('0x1'));var path=require(_0xb36a('0x2'));var timeout=require(_0xb36a('0x3'));var express=require(_0xb36a('0x4'));var router=express[_0xb36a('0x5')]();var fs_extra=require(_0xb36a('0x6'));var auth=require(_0xb36a('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xb36a('0x8'));var controller=require(_0xb36a('0x9'));router['get']('/',auth['isAuthenticated'](),controller[_0xb36a('0xa')]);router['get'](_0xb36a('0xb'),auth[_0xb36a('0xc')](),controller[_0xb36a('0xd')]);router[_0xb36a('0xe')](_0xb36a('0xf'),auth[_0xb36a('0xc')](),controller[_0xb36a('0x10')]);router[_0xb36a('0x11')]('/',auth[_0xb36a('0xc')](),controller['create']);router[_0xb36a('0x12')](_0xb36a('0xf'),auth[_0xb36a('0xc')](),controller['update']);router[_0xb36a('0x13')]('/:id',auth[_0xb36a('0xc')](),controller[_0xb36a('0x14')]);module[_0xb36a('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 344abd1..427c3f3 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 _0x0273=['Send','Contact\x20us','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','input','text','name','getDataValue','onlineForm','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','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.','Skip','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','sequelize','randomstring','exports','STRING','email','Agent','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!'];(function(_0x3f94bd,_0x897298){var _0x2ef8e9=function(_0x409d8c){while(--_0x409d8c){_0x3f94bd['push'](_0x3f94bd['shift']());}};_0x2ef8e9(++_0x897298);}(_0x0273,0x91));var _0x3027=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0273[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x3027('0x0'));var rs=require(_0x3027('0x1'));module[_0x3027('0x2')]={'name':{'type':Sequelize[_0x3027('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x3027('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0x3027('0x3')]},'mapKey':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x4')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x4')},'key':{'type':Sequelize[_0x3027('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x5')},'customerAlias':{'type':Sequelize[_0x3027('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x3027('0x3')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3027('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3027('0x3')],'allowNull':![],'defaultValue':_0x3027('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0x3027('0x3')],'allowNull':![],'defaultValue':_0x3027('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x3027('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x3027('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3027('0xa')](_0x3027('0xb'),_0x3027('0xc')),'defaultValue':_0x3027('0xb')},'header_online':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0xd')},'start_chat_button':{'type':Sequelize[_0x3027('0x3')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0xe')},'header_offline':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0xf')},'download_transcript':{'type':Sequelize[_0x3027('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x3027('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3027('0x3')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x3027('0x10')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x11')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x13')},'placeholderMessage':{'type':Sequelize[_0x3027('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x14')},'closingMessageButton':{'type':Sequelize[_0x3027('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x15')},'ratingType':{'type':Sequelize['ENUM'](_0x3027('0x16'),_0x3027('0x17')),'defaultValue':_0x3027('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x3027('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3027('0x18'),'variable':null,'config':{'placeholder':'name','type':_0x3027('0x19'),'required':!![]},'props':{'title':_0x3027('0x1a'),'helpText':''}},{'type':_0x3027('0x18'),'props':{'title':_0x3027('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3027('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x3027('0x1b')](_0x3027('0x1c'))?JSON['parse'](this[_0x3027('0x1b')](_0x3027('0x1c'))):{};},'set':function(_0xcd766f){return this[_0x3027('0x1d')](_0x3027('0x1c'),JSON[_0x3027('0x1e')](_0xcd766f));}},'offlineForm':{'type':Sequelize[_0x3027('0x10')],'defaultValue':function(){return JSON[_0x3027('0x1e')]({'items':[{'type':'input','props':{'title':_0x3027('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x3027('0x4')},'variable':null},{'type':_0x3027('0x1f'),'config':{'placeholder':'Comments'},'props':{'title':_0x3027('0x20'),'helpText':_0x3027('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x3027('0x1b')](_0x3027('0x22'))?JSON[_0x3027('0x23')](this[_0x3027('0x1b')](_0x3027('0x22'))):{};},'set':function(_0x5ce006){return this[_0x3027('0x1d')](_0x3027('0x22'),JSON[_0x3027('0x1e')](_0x5ce006));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x3027('0x24')]();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3027('0x3')]},'forwardOffline':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x3027('0x3')]},'waitingTitle':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x25')},'waitingMessage':{'type':Sequelize[_0x3027('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x3027('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x28')},'skipUnmanaged':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x29')},'sendUnmanaged':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0xe')},'enableCustomerAttachment':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3027('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x3027('0x3')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x2a')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3027('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0x3027('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x2b')},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3027('0x2c')},'messagesAlignment':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x2d')},'defaultTitle':{'type':Sequelize[_0x3027('0x3')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3027('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x3027('0x3')],'allowNull':![],'defaultValue':_0x3027('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3027('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3027('0x3')],'defaultValue':_0x3027('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3027('0x8')],'comment':_0x3027('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x3027('0x31'),'set':function(_0x51d791){if(!_0x51d791)this[_0x3027('0x1d')]('mandatoryDispositionPauseId',null);this[_0x3027('0x1d')](_0x3027('0x32'),_0x51d791);}},'vidaooEscalation':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3027('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3027('0x3')],'allowNull':![],'defaultValue':_0x3027('0x33')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x3027('0x34');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3027('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3027('0x10')]}};
\ No newline at end of file
+var _0x8cfd=['Agent','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','star','thumb','stringify','name','text','getDataValue','parse','onlineForm','setDataValue','input','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email'];(function(_0x497fea,_0x15a2cd){var _0x3cdc4c=function(_0x350c50){while(--_0x350c50){_0x497fea['push'](_0x497fea['shift']());}};_0x3cdc4c(++_0x15a2cd);}(_0x8cfd,0x14c));var _0xd8cf=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0x8cfd[_0x1deb03];return _0x189fe7;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xd8cf('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0xd8cf('0x1')],'allowNull':![],'unique':_0xd8cf('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x3')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xd8cf('0x4')},'customerAlias':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xd8cf('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xd8cf('0x1')],'allowNull':![],'defaultValue':_0xd8cf('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize[_0xd8cf('0x1')],'allowNull':![],'defaultValue':_0xd8cf('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xd8cf('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xd8cf('0x8')](_0xd8cf('0x9'),_0xd8cf('0xa')),'defaultValue':_0xd8cf('0x9')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0xd8cf('0xb')},'start_chat_button':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0xc')},'offline_chat_button':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0xd')},'header_offline':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0xe')},'download_transcript':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0xd8cf('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0xd8cf('0x10')]},'closingQuestion':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x12')},'noteTitle':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x13')},'placeholderMessage':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x14')},'closingMessage':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x15')},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0xd8cf('0xd')},'skipMessageButton':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x16')},'conditionAgreement':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x17')},'ratingType':{'type':Sequelize[_0xd8cf('0x8')](_0xd8cf('0x18'),_0xd8cf('0x19')),'defaultValue':_0xd8cf('0x18')},'ratingStarsNumber':{'type':Sequelize[_0xd8cf('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xd8cf('0x10')],'defaultValue':function(){return JSON[_0xd8cf('0x1a')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0xd8cf('0x1b'),'type':_0xd8cf('0x1c'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':'input','props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd8cf('0x3'),'type':_0xd8cf('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0xd8cf('0x1d')]('onlineForm')?JSON[_0xd8cf('0x1e')](this[_0xd8cf('0x1d')](_0xd8cf('0x1f'))):{};},'set':function(_0x384c95){return this[_0xd8cf('0x20')](_0xd8cf('0x1f'),JSON[_0xd8cf('0x1a')](_0x384c95));}},'offlineForm':{'type':Sequelize[_0xd8cf('0x10')],'defaultValue':function(){return JSON[_0xd8cf('0x1a')]({'items':[{'type':_0xd8cf('0x21'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0xd8cf('0x3'),'type':_0xd8cf('0x3')},'variable':null},{'type':_0xd8cf('0x22'),'config':{'placeholder':_0xd8cf('0x23')},'props':{'title':_0xd8cf('0x23'),'helpText':_0xd8cf('0x24')}}],'fromKey':0x0});},'get':function(){return this[_0xd8cf('0x1d')]('offlineForm')?JSON[_0xd8cf('0x1e')](this[_0xd8cf('0x1d')](_0xd8cf('0x25'))):{};},'set':function(_0xa9cd6d){return this[_0xd8cf('0x20')](_0xd8cf('0x25'),JSON[_0xd8cf('0x1a')](_0xa9cd6d));}},'token':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':function(){return rs[_0xd8cf('0x26')]();}},'autoclose':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xd8cf('0x1')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xd8cf('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0xd8cf('0x27')},'waitingMessage':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x28')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0xd8cf('0x29')},'offlineMessageBody':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x2a')},'skipUnmanaged':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xd8cf('0x10')]},'showAgentAvatar':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd8cf('0x2b');}},'notificationSound':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x2c')},'waitForTheAssignedAgent':{'type':Sequelize[_0xd8cf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'waitForTheAssignedQueue':{'type':Sequelize[_0xd8cf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x2d')},'verticalAlignment':{'type':Sequelize[_0xd8cf('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x2e')},'messagesAlignment':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x2f')},'defaultTitle':{'type':Sequelize[_0xd8cf('0x1')]},'customerAvatar':{'type':Sequelize[_0xd8cf('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xd8cf('0x1')],'allowNull':![],'defaultValue':_0xd8cf('0x30'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd8cf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xd8cf('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':_0xd8cf('0x31')},'systemAvatar':{'type':Sequelize[_0xd8cf('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd8cf('0x6')],'comment':_0xd8cf('0x32')},'mandatoryDisposition':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![],'comment':_0xd8cf('0x33'),'set':function(_0x1d9bb5){if(!_0x1d9bb5)this[_0xd8cf('0x20')](_0xd8cf('0x34'),null);this['setDataValue'](_0xd8cf('0x35'),_0x1d9bb5);}},'vidaooEscalation':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0xd8cf('0x1')]},'vidaooTopic':{'type':Sequelize[_0xd8cf('0x1')],'allowNull':![],'defaultValue':_0xd8cf('0x36')},'vidaooNote':{'type':Sequelize[_0xd8cf('0x1')],'defaultValue':function(){return _0xd8cf('0x37');}},'vidaooMetadata':{'type':Sequelize[_0xd8cf('0x10')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0xd8cf('0x7')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0xd8cf('0x10')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index ad374ff..7b96b83 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 _0xb1b6=['updatedAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','list','applications','orderBy','priority','asc','ListId','contact','threadId','ChatInteraction','externalUrl','interaction','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','queueId','ChatQueue','waitForTheAssignedQueue','Start','startRouting','EventManager','offline','files','mapKeyOffline','MailAccount','findOrCreate','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','mimetype','server','attachments','offline-chat','basename','openNewInteraction','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','sendMail','\x22%s\x22\x20<%s>','email','MailAccountId','originalname','subjectOffline','toPairsIn','mapValues','offlineMessageSubject','Chat','NotifyMailAccount','notifyMail','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','User','Owner','Tag','Tags','color','tag','virtual','License','readFileSync','server/files/chat/iframe.ejs','URL','3.5.0','remote','headers','x-real-ip','connection','remoteAddress','replace','alignment','verticalAlignment','labelText','backgroundColor','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','addProactiveActions','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','Attachment','addAgents','emit','userChatWebsite:save','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','fs-extra','lodash','querystring','html-to-text','ioredis','url','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../errors/api','handleError','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','client','http','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','Command','getSnippet','timezone','format','iftime\x20%s,%s','interval','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','map','Interval','Intervals','all','some','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','first','x-forwarded-for','lastName','x-real-port','referer','browser','version','%s\x20%s','unknown','device','model','vendor','type','Pause','mandatoryDispositionPause','rawAttributes','fieldName','key','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','ChatWebsite','includeAll','findAll','show','params','include','merge','options','create','body','user','userProfileId','find','describe','addDisposition','Disposition','getDispositions','nolimit','ChatWebsiteId','rows','removeDispositions','findOne','CannedAnswer','removeAnswers','ids','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.svg','../../config/license/util','getLicense','custom','isNil','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt'];(function(_0x49fd27,_0x2c0345){var _0x4517d3=function(_0x3a78b9){while(--_0x3a78b9){_0x49fd27['push'](_0x49fd27['shift']());}};_0x4517d3(++_0x2c0345);}(_0xb1b6,0x87));var _0x6b1b=function(_0xc00fcd,_0x50f6d4){_0xc00fcd=_0xc00fcd-0x0;var _0x583013=_0xb1b6[_0xc00fcd];return _0x583013;};'use strict';var Mustache=require(_0x6b1b('0x0'));var util=require(_0x6b1b('0x1'));var path=require(_0x6b1b('0x2'));var ejs=require(_0x6b1b('0x3'));var fs=require('fs');var fs_extra=require(_0x6b1b('0x4'));var _=require(_0x6b1b('0x5'));var querystring=require(_0x6b1b('0x6'));var htmlToText=require(_0x6b1b('0x7'));var Redis=require(_0x6b1b('0x8'));var jayson=require('jayson/promise');var url=require(_0x6b1b('0x9'));var qs=require(_0x6b1b('0xa'));var logger=require(_0x6b1b('0xb'))(_0x6b1b('0xc'));var config=require(_0x6b1b('0xd'));var APIOutOfIntervalError=require(_0x6b1b('0xe'))['APIOutOfIntervalError'];var APINotFoundError=require(_0x6b1b('0xe'))['APINotFoundError'];var APIHandleError=require(_0x6b1b('0xe'))[_0x6b1b('0xf')];var db=require(_0x6b1b('0x10'))['db'];config[_0x6b1b('0x11')]=_[_0x6b1b('0x12')](config['redis'],{'host':_0x6b1b('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6b1b('0x11')]));require(_0x6b1b('0x14'))[_0x6b1b('0x15')](socket);var client=jayson[_0x6b1b('0x16')][_0x6b1b('0x17')]({'port':0x232c});var client9002=jayson['client'][_0x6b1b('0x17')]({'port':0x232a});var client9003=jayson[_0x6b1b('0x16')][_0x6b1b('0x17')]({'port':0x232b});var client9001=jayson[_0x6b1b('0x16')][_0x6b1b('0x17')]({'port':0x2329});function respondWithRpcPromise(_0x4be6c1,_0x4e2097,_0x91c9ba,_0x1fa4e5){return new Promise(function(_0x4d5d50,_0x34eed0){var _0x3fa59f=_0x1fa4e5||client;return _0x3fa59f[_0x6b1b('0x18')](_0x4be6c1,_0x91c9ba)[_0x6b1b('0x19')](function(_0x10119b){logger[_0x6b1b('0x1a')](_0x6b1b('0x1b'),_0x4e2097,_0x6b1b('0x1c'));logger['debug'](_0x6b1b('0x1d'),_0x4e2097,_0x6b1b('0x1c'),JSON[_0x6b1b('0x1e')](_0x10119b));if(_0x10119b[_0x6b1b('0x1f')]){if(_0x10119b[_0x6b1b('0x1f')][_0x6b1b('0x20')]===0x1f4){logger['error'](_0x6b1b('0x1b'),_0x4e2097,_0x10119b[_0x6b1b('0x1f')][_0x6b1b('0x21')]);return _0x34eed0(_0x10119b[_0x6b1b('0x1f')][_0x6b1b('0x21')]);}logger[_0x6b1b('0x1f')](_0x6b1b('0x1b'),_0x4e2097,_0x10119b[_0x6b1b('0x1f')]['message']);return _0x4d5d50(_0x10119b[_0x6b1b('0x1f')][_0x6b1b('0x21')]);}else{logger['info'](_0x6b1b('0x1b'),_0x4e2097,_0x6b1b('0x1c'));_0x4d5d50(_0x10119b[_0x6b1b('0x22')][_0x6b1b('0x21')]);}})[_0x6b1b('0x23')](function(_0x1b1206){logger['error'](_0x6b1b('0x1b'),_0x4e2097,_0x1b1206);_0x34eed0(_0x1b1206);});});}function respondWithStatusCode(_0xcc32ff,_0x16b94b){_0x16b94b=_0x16b94b||0xcc;return function(_0x2f3bde){if(_0x2f3bde){return _0xcc32ff[_0x6b1b('0x24')](_0x16b94b);}return _0xcc32ff[_0x6b1b('0x25')](_0x16b94b)['end']();};}function respondWithResult(_0xf5b1f7,_0x1eaa50){_0x1eaa50=_0x1eaa50||0xc8;return function(_0x25e7ea){if(_0x25e7ea){return _0xf5b1f7[_0x6b1b('0x25')](_0x1eaa50)[_0x6b1b('0x26')](_0x25e7ea);}};}function respondWithFilteredResult(_0x48a758,_0x55c6f0){return function(_0x48419d){if(_0x48419d){var _0xb35e2e=typeof _0x55c6f0[_0x6b1b('0x27')]===_0x6b1b('0x28')&&typeof _0x55c6f0[_0x6b1b('0x29')]===_0x6b1b('0x28');var _0x32c3d7=_0x48419d[_0x6b1b('0x2a')];var _0x1c8fbf=_0xb35e2e?0x0:_0x55c6f0['offset'];var _0x483cb2=_0xb35e2e?_0x48419d['count']:_0x55c6f0[_0x6b1b('0x27')]+_0x55c6f0[_0x6b1b('0x29')];var _0x3390c1;if(_0x483cb2>=_0x32c3d7){_0x483cb2=_0x32c3d7;_0x3390c1=0xc8;}else{_0x3390c1=0xce;}_0x48a758['status'](_0x3390c1);return _0x48a758[_0x6b1b('0x2b')](_0x6b1b('0x2c'),_0x1c8fbf+'-'+_0x483cb2+'/'+_0x32c3d7)[_0x6b1b('0x26')](_0x48419d);}return null;};}function saveUpdates(_0x942dd4){return function(_0x308b6e){if(_0x308b6e){return _0x308b6e[_0x6b1b('0x2d')](_0x942dd4)[_0x6b1b('0x19')](function(_0x57bd12){return _0x57bd12;});}return null;};}function removeEntity(_0x4927c1){return function(_0xbc8031){if(_0xbc8031){return _0xbc8031[_0x6b1b('0x2e')]()[_0x6b1b('0x19')](function(){var _0x4de5bb=_0xbc8031[_0x6b1b('0x2f')]({'plain':!![]});var _0x224d20=_0x6b1b('0x30');return db[_0x6b1b('0x31')]['destroy']({'where':{'type':_0x224d20,'resourceId':_0x4de5bb['id']}})[_0x6b1b('0x19')](function(){return _0xbc8031;});})[_0x6b1b('0x19')](function(){_0x4927c1[_0x6b1b('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1ee522){return function(_0x31cb08){if(!_0x31cb08){_0x1ee522['sendStatus'](0x194);}return _0x31cb08;};}function handleError(_0x486e8a,_0x12e6d5){_0x12e6d5=_0x12e6d5||0x1f4;return function(_0x1e34aa){logger[_0x6b1b('0x1f')](_0x1e34aa['stack']);if(_0x1e34aa[_0x6b1b('0x32')]){delete _0x1e34aa[_0x6b1b('0x32')];}_0x486e8a['status'](_0x12e6d5)[_0x6b1b('0x33')](_0x1e34aa);};}function iftimePromise(_0x2e4815,_0x5b30cf){return respondWithRpcPromise(_0x6b1b('0x34'),_0x6b1b('0x35'),{'command':_0x5b30cf[_0x6b1b('0x36')]?util[_0x6b1b('0x37')](_0x6b1b('0x38'),_0x2e4815[_0x6b1b('0x39')],_0x5b30cf['timezone']):util['format'](_0x6b1b('0x3a'),_0x2e4815[_0x6b1b('0x39')])},client9002)[_0x6b1b('0x19')](function(_0x6379a5){var _0x309273=_0x6379a5&&_0x6379a5['indexOf']('true')>=0x0?!![]:![];logger[_0x6b1b('0x1a')](_0x6b1b('0x3b'),_0x5b30cf['id'],_0x2e4815['id'],_0x2e4815[_0x6b1b('0x39')],_0x309273?_0x6b1b('0x3c'):_0x6b1b('0x3d'),_0x5b30cf[_0x6b1b('0x36')]?_0x5b30cf[_0x6b1b('0x36')]:_0x6b1b('0x3e'));return _0x309273;})['catch'](function(_0x388413){logger[_0x6b1b('0x1f')](_0x6b1b('0x3b'),_0x5b30cf['id'],_0x2e4815['id'],_0x2e4815[_0x6b1b('0x39')],util[_0x6b1b('0x3f')](_0x388413,{'showHidden':![],'depth':null}),_0x5b30cf[_0x6b1b('0x36')]?_0x5b30cf[_0x6b1b('0x36')]:'No\x20timezone');return![];});}function checkWebsiteIntervals(_0x38a964){var _0x1ca343=_[_0x6b1b('0x40')](_0x38a964[_0x6b1b('0x41')][_0x6b1b('0x42')],function(_0x3d30ca){var _0xaa0b76=_0x3d30ca[_0x6b1b('0x2f')]({'plain':!![]});return iftimePromise(_0xaa0b76,_0x38a964);});return Promise[_0x6b1b('0x43')](_0x1ca343)[_0x6b1b('0x19')](function(_0x17957f){return _[_0x6b1b('0x44')](_0x17957f);});}function createInteractionObject(_0x48447a,_0x22720b,_0x34e172,_0x5422cc){var _0x5d67dd=require(_0x6b1b('0x45'));var _0x442532=new _0x5d67dd();var _0xfdc4a5=_0x442532[_0x6b1b('0x46')](_0x34e172[_0x6b1b('0x47')])['getResult']();var _0x30902c=_0x22720b[_0x6b1b('0x48')];if(_0x34e172[_0x6b1b('0x49')]){_0x30902c=_0x34e172[_0x6b1b('0x49')];}else if(_0x34e172['x-forwarded-for']){_0x30902c=_[_0x6b1b('0x4a')](_0x34e172[_0x6b1b('0x4b')]['split'](','));}return{'ContactId':_0x5422cc['id'],'ChatWebsiteId':_0x48447a,'from':(_0x5422cc['firstName']||'')+'\x20'+(_0x5422cc[_0x6b1b('0x4c')]||''),'customerIp':_0x30902c,'customerPort':_0x34e172['x-real-port']?_0x34e172[_0x6b1b('0x4d')]:null,'referer':_0x22720b[_0x6b1b('0x4e')],'browserName':_0xfdc4a5[_0x6b1b('0x4f')]['name']&&_0xfdc4a5[_0x6b1b('0x4f')][_0x6b1b('0x50')]?util[_0x6b1b('0x37')](_0x6b1b('0x51'),_0xfdc4a5[_0x6b1b('0x4f')]['name'],_0xfdc4a5['browser'][_0x6b1b('0x50')]):_0x6b1b('0x52'),'browserVersion':_0xfdc4a5[_0x6b1b('0x4f')][_0x6b1b('0x50')]||_0x6b1b('0x52'),'osName':util[_0x6b1b('0x37')](_0x6b1b('0x51'),_0xfdc4a5['os'][_0x6b1b('0x32')],_0xfdc4a5['os'][_0x6b1b('0x50')]),'osVersion':_0xfdc4a5['os'][_0x6b1b('0x50')],'deviceModel':_0xfdc4a5[_0x6b1b('0x53')][_0x6b1b('0x54')]&&_0xfdc4a5[_0x6b1b('0x53')][_0x6b1b('0x55')]?util[_0x6b1b('0x37')]('%s\x20%s\x20%s',_0xfdc4a5[_0x6b1b('0x53')]['model'],_0xfdc4a5[_0x6b1b('0x53')]['vendor'],_0xfdc4a5[_0x6b1b('0x53')]['type']):null,'deviceVendor':_0xfdc4a5[_0x6b1b('0x53')][_0x6b1b('0x55')],'deviceType':_0xfdc4a5[_0x6b1b('0x53')][_0x6b1b('0x56')],'formData':JSON['stringify'](_0x22720b)};}exports['index']=function(_0x21b24f,_0x333ca5){var _0x7e4582={'include':[{'model':db[_0x6b1b('0x57')],'as':_0x6b1b('0x58')}]},_0x50e290={},_0x265f2f={'count':0x0,'rows':[]};var _0x497b1d=_[_0x6b1b('0x40')](db['ChatWebsite'][_0x6b1b('0x59')],function(_0x49d39d){return{'name':_0x49d39d[_0x6b1b('0x5a')],'type':_0x49d39d[_0x6b1b('0x56')][_0x6b1b('0x5b')]};});_0x50e290['model']=_['map'](_0x497b1d,'name');_0x50e290[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0x21b24f[_0x6b1b('0x5c')]);_0x50e290[_0x6b1b('0x5e')]=_[_0x6b1b('0x5f')](_0x50e290[_0x6b1b('0x54')],_0x50e290[_0x6b1b('0x5c')]);_0x7e4582['attributes']=_[_0x6b1b('0x5f')](_0x50e290['model'],qs[_0x6b1b('0x60')](_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x60')]));_0x7e4582[_0x6b1b('0x61')]=_0x7e4582[_0x6b1b('0x61')][_0x6b1b('0x62')]?_0x7e4582[_0x6b1b('0x61')]:_0x50e290[_0x6b1b('0x54')];if(!_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x63')]('nolimit')){_0x7e4582['limit']=qs['limit'](_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x29')]);_0x7e4582[_0x6b1b('0x27')]=qs['offset'](_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x27')]);}_0x7e4582[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x21b24f['query'][_0x6b1b('0x65')]);_0x7e4582[_0x6b1b('0x66')]=qs['filters'](_[_0x6b1b('0x67')](_0x21b24f[_0x6b1b('0x5c')],_0x50e290['filters']),_0x497b1d);if(_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x68')]){_0x7e4582[_0x6b1b('0x66')]=_['merge'](_0x7e4582[_0x6b1b('0x66')],{'$or':_['map'](_0x497b1d,function(_0x8bdf71){if(_0x8bdf71[_0x6b1b('0x56')]!=='VIRTUAL'){var _0x580632={};_0x580632[_0x8bdf71[_0x6b1b('0x32')]]={'$like':'%'+_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x68')]+'%'};return _0x580632;}})});}_0x7e4582=_['merge']({},_0x7e4582,_0x21b24f['options']);var _0x2cce3c={'where':_0x7e4582[_0x6b1b('0x66')]};return db[_0x6b1b('0x69')]['count'](_0x2cce3c)['then'](function(_0x104c6b){_0x265f2f['count']=_0x104c6b;if(_0x21b24f[_0x6b1b('0x5c')][_0x6b1b('0x6a')]){_0x7e4582['include']=[{'all':!![]}];}return db[_0x6b1b('0x69')][_0x6b1b('0x6b')](_0x7e4582);})[_0x6b1b('0x19')](function(_0x46448a){_0x265f2f['rows']=_0x46448a;return _0x265f2f;})['then'](respondWithFilteredResult(_0x333ca5,_0x7e4582))[_0x6b1b('0x23')](handleError(_0x333ca5,null));};exports[_0x6b1b('0x6c')]=function(_0x2a828b,_0x329f4f){var _0x44c0da={'raw':![],'where':{'id':_0x2a828b[_0x6b1b('0x6d')]['id']},'include':[{'model':db[_0x6b1b('0x57')],'as':_0x6b1b('0x58')}]},_0x289ba8={};_0x289ba8['model']=_[_0x6b1b('0x5d')](db[_0x6b1b('0x69')][_0x6b1b('0x59')]);_0x289ba8[_0x6b1b('0x5c')]=_['keys'](_0x2a828b['query']);_0x289ba8[_0x6b1b('0x5e')]=_[_0x6b1b('0x5f')](_0x289ba8[_0x6b1b('0x54')],_0x289ba8['query']);_0x44c0da[_0x6b1b('0x61')]=_[_0x6b1b('0x5f')](_0x289ba8[_0x6b1b('0x54')],qs[_0x6b1b('0x60')](_0x2a828b['query'][_0x6b1b('0x60')]));_0x44c0da[_0x6b1b('0x61')]=_0x44c0da[_0x6b1b('0x61')][_0x6b1b('0x62')]?_0x44c0da[_0x6b1b('0x61')]:_0x289ba8['model'];if(_0x2a828b[_0x6b1b('0x5c')][_0x6b1b('0x6a')]){_0x44c0da[_0x6b1b('0x6e')]=[{'all':!![]}];}_0x44c0da=_[_0x6b1b('0x6f')]({},_0x44c0da,_0x2a828b[_0x6b1b('0x70')]);return db[_0x6b1b('0x69')]['find'](_0x44c0da)[_0x6b1b('0x19')](handleEntityNotFound(_0x329f4f,null))[_0x6b1b('0x19')](respondWithResult(_0x329f4f,null))['catch'](handleError(_0x329f4f,null));};exports[_0x6b1b('0x71')]=function(_0xb385,_0x20818b){return db[_0x6b1b('0x69')][_0x6b1b('0x71')](_0xb385[_0x6b1b('0x72')],{})[_0x6b1b('0x19')](function(_0x20c990){var _0x45c9a4=_0xb385['user']['get']({'plain':!![]});if(!_0x45c9a4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x45c9a4['role']===_0x6b1b('0x73')){var _0x4c63d7=_0x20c990[_0x6b1b('0x2f')]({'plain':!![]});var _0x1771cd=_0x6b1b('0x30');return db['UserProfileSection']['find']({'where':{'name':_0x1771cd,'userProfileId':_0x45c9a4[_0x6b1b('0x74')]},'raw':!![]})[_0x6b1b('0x19')](function(_0x2e9754){if(_0x2e9754&&_0x2e9754['autoAssociation']===0x0){return db[_0x6b1b('0x31')][_0x6b1b('0x71')]({'name':_0x4c63d7[_0x6b1b('0x32')],'resourceId':_0x4c63d7['id'],'type':_0x2e9754[_0x6b1b('0x32')],'sectionId':_0x2e9754['id']},{})[_0x6b1b('0x19')](function(){return _0x20c990;});}else{return _0x20c990;}})[_0x6b1b('0x23')](function(_0x36b1b3){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36b1b3);throw _0x36b1b3;});}return _0x20c990;})['then'](respondWithResult(_0x20818b,0xc9))[_0x6b1b('0x23')](handleError(_0x20818b,null));};exports['update']=function(_0x1e2807,_0x5b87e3){if(_0x1e2807[_0x6b1b('0x72')]['id']){delete _0x1e2807['body']['id'];}return db[_0x6b1b('0x69')][_0x6b1b('0x75')]({'where':{'id':_0x1e2807['params']['id']},'include':[{'model':db[_0x6b1b('0x57')],'as':_0x6b1b('0x58')}]})[_0x6b1b('0x19')](handleEntityNotFound(_0x5b87e3,null))[_0x6b1b('0x19')](saveUpdates(_0x1e2807[_0x6b1b('0x72')],null))[_0x6b1b('0x19')](respondWithResult(_0x5b87e3,null))['catch'](handleError(_0x5b87e3,null));};exports[_0x6b1b('0x2e')]=function(_0x58eb59,_0x3405d4){return db['ChatWebsite'][_0x6b1b('0x75')]({'where':{'id':_0x58eb59[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x3405d4,null))[_0x6b1b('0x19')](removeEntity(_0x3405d4,null))[_0x6b1b('0x23')](handleError(_0x3405d4,null));};exports[_0x6b1b('0x76')]=function(_0x4e24a6,_0x3ed706){return db[_0x6b1b('0x69')]['describe']()['then'](respondWithResult(_0x3ed706,null))[_0x6b1b('0x23')](handleError(_0x3ed706,null));};exports[_0x6b1b('0x77')]=function(_0x366bc8,_0x1a7bf1){if(_0x366bc8[_0x6b1b('0x72')]['id']){delete _0x366bc8['body']['id'];}return db[_0x6b1b('0x69')][_0x6b1b('0x75')]({'where':{'id':_0x366bc8[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x1a7bf1,null))[_0x6b1b('0x19')](function(_0xda6932){if(_0xda6932){_0x366bc8[_0x6b1b('0x72')]['ChatWebsiteId']=_0xda6932['id'];return db[_0x6b1b('0x78')][_0x6b1b('0x71')](_0x366bc8[_0x6b1b('0x72')]);}})[_0x6b1b('0x19')](respondWithResult(_0x1a7bf1,null))[_0x6b1b('0x23')](handleError(_0x1a7bf1,null));};exports[_0x6b1b('0x79')]=function(_0x3a962f,_0x4e60c3){var _0x59dfe4={'raw':![],'where':{}};var _0x982261={};var _0x2bfb26={'count':0x0,'rows':[]};return db[_0x6b1b('0x69')]['findOne']({'where':{'id':_0x3a962f[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x4e60c3,null))['then'](function(_0x5ed350){if(_0x5ed350){_0x982261[_0x6b1b('0x54')]=_['keys'](db[_0x6b1b('0x78')]['rawAttributes']);_0x982261[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0x3a962f[_0x6b1b('0x5c')]);_0x982261[_0x6b1b('0x5e')]=_['intersection'](_0x982261['model'],_0x982261[_0x6b1b('0x5c')]);_0x59dfe4[_0x6b1b('0x61')]=_[_0x6b1b('0x5f')](_0x982261[_0x6b1b('0x54')],qs[_0x6b1b('0x60')](_0x3a962f['query'][_0x6b1b('0x60')]));_0x59dfe4[_0x6b1b('0x61')]=_0x59dfe4[_0x6b1b('0x61')][_0x6b1b('0x62')]?_0x59dfe4[_0x6b1b('0x61')]:_0x982261['model'];if(!_0x3a962f[_0x6b1b('0x5c')][_0x6b1b('0x63')](_0x6b1b('0x7a'))){_0x59dfe4[_0x6b1b('0x29')]=qs[_0x6b1b('0x29')](_0x3a962f[_0x6b1b('0x5c')][_0x6b1b('0x29')]);_0x59dfe4[_0x6b1b('0x27')]=qs[_0x6b1b('0x27')](_0x3a962f['query'][_0x6b1b('0x27')]);}_0x59dfe4[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x3a962f['query'][_0x6b1b('0x65')]);_0x59dfe4[_0x6b1b('0x66')]=qs['filters'](_[_0x6b1b('0x67')](_0x3a962f[_0x6b1b('0x5c')],_0x982261[_0x6b1b('0x5e')]));_0x59dfe4[_0x6b1b('0x66')][_0x6b1b('0x7b')]=_0x5ed350['id'];if(_0x3a962f[_0x6b1b('0x5c')][_0x6b1b('0x68')]){_0x59dfe4[_0x6b1b('0x66')]=_[_0x6b1b('0x6f')](_0x59dfe4[_0x6b1b('0x66')],{'$or':_[_0x6b1b('0x40')](_0x59dfe4['attributes'],function(_0x377429){var _0x2d906d={};_0x2d906d[_0x377429]={'$like':'%'+_0x3a962f[_0x6b1b('0x5c')][_0x6b1b('0x68')]+'%'};return _0x2d906d;})});}_0x59dfe4=_[_0x6b1b('0x6f')]({},_0x59dfe4,_0x3a962f['options']);return db['Disposition'][_0x6b1b('0x2a')]({'where':_0x59dfe4[_0x6b1b('0x66')]})['then'](function(_0xd35359){_0x2bfb26['count']=_0xd35359;if(_0x3a962f[_0x6b1b('0x5c')]['includeAll']){_0x59dfe4[_0x6b1b('0x6e')]=[{'all':!![]}];}return db[_0x6b1b('0x78')][_0x6b1b('0x6b')](_0x59dfe4);})[_0x6b1b('0x19')](function(_0x562d3e){_0x2bfb26[_0x6b1b('0x7c')]=_0x562d3e;return _0x2bfb26;});}})[_0x6b1b('0x19')](respondWithFilteredResult(_0x4e60c3,_0x59dfe4))[_0x6b1b('0x23')](handleError(_0x4e60c3,null));};exports['removeDispositions']=function(_0x2bb7ed,_0x56346e){return db['ChatWebsite']['find']({'where':{'id':_0x2bb7ed[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x56346e,null))[_0x6b1b('0x19')](function(_0x55ba13){if(_0x55ba13){return _0x55ba13[_0x6b1b('0x7d')](_0x2bb7ed[_0x6b1b('0x5c')]['ids']);}})[_0x6b1b('0x19')](respondWithStatusCode(_0x56346e,null))[_0x6b1b('0x23')](handleError(_0x56346e,null));};exports['addAnswer']=function(_0x1cd25f,_0x2dd03c){if(_0x1cd25f[_0x6b1b('0x72')]['id']){delete _0x1cd25f[_0x6b1b('0x72')]['id'];}return db[_0x6b1b('0x69')]['find']({'where':{'id':_0x1cd25f[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x2dd03c,null))[_0x6b1b('0x19')](function(_0x422d9f){if(_0x422d9f){_0x1cd25f['body'][_0x6b1b('0x7b')]=_0x422d9f['id'];return db['CannedAnswer']['create'](_0x1cd25f[_0x6b1b('0x72')]);}})['then'](respondWithResult(_0x2dd03c,null))[_0x6b1b('0x23')](handleError(_0x2dd03c,null));};exports['getAnswers']=function(_0x5f3052,_0x1414aa){var _0xb90330={'raw':![],'where':{}};var _0x41e3e5={};var _0x3b9079={'count':0x0,'rows':[]};return db[_0x6b1b('0x69')][_0x6b1b('0x7e')]({'where':{'id':_0x5f3052[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x1414aa,null))[_0x6b1b('0x19')](function(_0x1d6a9c){if(_0x1d6a9c){_0x41e3e5[_0x6b1b('0x54')]=_[_0x6b1b('0x5d')](db[_0x6b1b('0x7f')][_0x6b1b('0x59')]);_0x41e3e5[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0x5f3052[_0x6b1b('0x5c')]);_0x41e3e5[_0x6b1b('0x5e')]=_[_0x6b1b('0x5f')](_0x41e3e5['model'],_0x41e3e5['query']);_0xb90330[_0x6b1b('0x61')]=_['intersection'](_0x41e3e5[_0x6b1b('0x54')],qs[_0x6b1b('0x60')](_0x5f3052['query'][_0x6b1b('0x60')]));_0xb90330[_0x6b1b('0x61')]=_0xb90330['attributes'][_0x6b1b('0x62')]?_0xb90330[_0x6b1b('0x61')]:_0x41e3e5[_0x6b1b('0x54')];if(!_0x5f3052['query'][_0x6b1b('0x63')](_0x6b1b('0x7a'))){_0xb90330[_0x6b1b('0x29')]=qs['limit'](_0x5f3052[_0x6b1b('0x5c')][_0x6b1b('0x29')]);_0xb90330[_0x6b1b('0x27')]=qs[_0x6b1b('0x27')](_0x5f3052['query'][_0x6b1b('0x27')]);}_0xb90330[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x5f3052['query'][_0x6b1b('0x65')]);_0xb90330[_0x6b1b('0x66')]=qs['filters'](_[_0x6b1b('0x67')](_0x5f3052['query'],_0x41e3e5['filters']));_0xb90330['where'][_0x6b1b('0x7b')]=_0x1d6a9c['id'];if(_0x5f3052[_0x6b1b('0x5c')]['filter']){_0xb90330['where']=_[_0x6b1b('0x6f')](_0xb90330[_0x6b1b('0x66')],{'$or':_['map'](_0xb90330[_0x6b1b('0x61')],function(_0x27e4ed){var _0x1d7473={};_0x1d7473[_0x27e4ed]={'$like':'%'+_0x5f3052['query'][_0x6b1b('0x68')]+'%'};return _0x1d7473;})});}_0xb90330=_['merge']({},_0xb90330,_0x5f3052['options']);return db[_0x6b1b('0x7f')]['count']({'where':_0xb90330[_0x6b1b('0x66')]})['then'](function(_0x541833){_0x3b9079[_0x6b1b('0x2a')]=_0x541833;if(_0x5f3052['query'][_0x6b1b('0x6a')]){_0xb90330['include']=[{'all':!![]}];}return db[_0x6b1b('0x7f')][_0x6b1b('0x6b')](_0xb90330);})[_0x6b1b('0x19')](function(_0x488726){_0x3b9079[_0x6b1b('0x7c')]=_0x488726;return _0x3b9079;});}})[_0x6b1b('0x19')](respondWithFilteredResult(_0x1414aa,_0xb90330))[_0x6b1b('0x23')](handleError(_0x1414aa,null));};exports['removeAnswers']=function(_0x2a7345,_0x3a9639){return db['ChatWebsite'][_0x6b1b('0x75')]({'where':{'id':_0x2a7345[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x3a9639,null))[_0x6b1b('0x19')](function(_0x4c4a06){if(_0x4c4a06){return _0x4c4a06[_0x6b1b('0x80')](_0x2a7345['query'][_0x6b1b('0x81')]);}})[_0x6b1b('0x19')](respondWithStatusCode(_0x3a9639,null))[_0x6b1b('0x23')](handleError(_0x3a9639,null));};exports[_0x6b1b('0x82')]=function(_0x1267a,_0x314ab2){_0x1267a[_0x6b1b('0x72')][_0x6b1b('0x83')]=_0x1267a[_0x6b1b('0x84')][_0x6b1b('0x85')];return db['ChatWebsite']['find']({'where':{'id':_0x1267a[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x314ab2,null))[_0x6b1b('0x19')](saveUpdates(_0x1267a[_0x6b1b('0x72')],null))[_0x6b1b('0x19')](respondWithResult(_0x314ab2,null))[_0x6b1b('0x23')](handleError(_0x314ab2,null));};exports['addAvatar']=function(_0x4fff0a,_0x47c4cc){_0x4fff0a[_0x6b1b('0x72')][_0x6b1b('0x86')]=_0x4fff0a[_0x6b1b('0x84')]['filename'];return db[_0x6b1b('0x69')][_0x6b1b('0x75')]({'where':{'id':_0x4fff0a[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x47c4cc,null))['then'](saveUpdates(_0x4fff0a['body'],null))[_0x6b1b('0x19')](respondWithResult(_0x47c4cc,null))['catch'](handleError(_0x47c4cc,null));};exports[_0x6b1b('0x87')]=function(_0x2547ef,_0x16ea40){_0x2547ef[_0x6b1b('0x72')][_0x6b1b('0x88')]=_0x2547ef['file'][_0x6b1b('0x85')];return db[_0x6b1b('0x69')]['find']({'where':{'id':_0x2547ef['params']['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x16ea40,null))['then'](saveUpdates(_0x2547ef[_0x6b1b('0x72')],null))['then'](respondWithResult(_0x16ea40,null))['catch'](handleError(_0x16ea40,null));};exports[_0x6b1b('0x89')]=function(_0x3e2ae5,_0x104f1e){_0x3e2ae5[_0x6b1b('0x72')][_0x6b1b('0x8a')]=_0x3e2ae5['file'][_0x6b1b('0x85')];return db[_0x6b1b('0x69')][_0x6b1b('0x75')]({'where':{'id':_0x3e2ae5[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x104f1e,null))[_0x6b1b('0x19')](saveUpdates(_0x3e2ae5[_0x6b1b('0x72')],null))[_0x6b1b('0x19')](respondWithResult(_0x104f1e,null))['catch'](handleError(_0x104f1e,null));};exports['getLogo']=function(_0x50810e,_0x43a5d1){var _0x48fb08=path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0x8d'));var _0x16313e={'where':{'id':_0x50810e['params']['id']},'attributes':['id',_0x6b1b('0x83')],'raw':!![]};var _0x436892=![];return require(_0x6b1b('0x8e'))[_0x6b1b('0x8f')]()[_0x6b1b('0x19')](function(_0x1f6964){if(_0x1f6964){_0x436892=_0x1f6964[_0x6b1b('0x90')];}})[_0x6b1b('0x19')](function(){return db[_0x6b1b('0x69')][_0x6b1b('0x75')](_0x16313e);})[_0x6b1b('0x19')](handleEntityNotFound(_0x43a5d1,null))[_0x6b1b('0x19')](function(_0x3886ee){if(_0x3886ee){if(!_[_0x6b1b('0x91')](_0x3886ee[_0x6b1b('0x83')])){if(fs[_0x6b1b('0x92')](path['join'](config[_0x6b1b('0x8c')],_0x6b1b('0x93'),_0x3886ee[_0x6b1b('0x83')]))&&_0x436892){_0x48fb08=path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0x93'),_0x3886ee[_0x6b1b('0x83')]);}}return _0x43a5d1[_0x6b1b('0x94')](_0x48fb08);}})[_0x6b1b('0x23')](handleError(_0x43a5d1,null));};exports[_0x6b1b('0x95')]=function(_0x55e30f,_0x25d34a){var _0x58e092=path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],'server/files/images/avatars/default_avatar.png');var _0x3f9d54={'where':{'id':_0x55e30f[_0x6b1b('0x6d')]['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db[_0x6b1b('0x69')][_0x6b1b('0x75')](_0x3f9d54)['then'](handleEntityNotFound(_0x25d34a,null))['then'](function(_0x2d024a){if(_0x2d024a){if(!_[_0x6b1b('0x91')](_0x2d024a[_0x6b1b('0x86')])){if(fs['existsSync'](path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],'server/files/images/avatars/',_0x2d024a['agentAvatar']))){_0x58e092=path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0x96'),_0x2d024a['agentAvatar']);}}return _0x25d34a['download'](_0x58e092);}})[_0x6b1b('0x23')](handleError(_0x25d34a,null));};exports[_0x6b1b('0x97')]=function(_0x23d2a9,_0x566cef){var _0x1c8291=path['join'](config[_0x6b1b('0x8c')],_0x6b1b('0x98'));var _0x4ed518={'where':{'id':_0x23d2a9[_0x6b1b('0x6d')]['id']},'attributes':['id',_0x6b1b('0x88'),'showCustomerAvatar'],'raw':!![]};return db[_0x6b1b('0x69')][_0x6b1b('0x75')](_0x4ed518)[_0x6b1b('0x19')](handleEntityNotFound(_0x566cef,null))[_0x6b1b('0x19')](function(_0x381fdc){if(_0x381fdc){if(!_[_0x6b1b('0x91')](_0x381fdc[_0x6b1b('0x88')])){if(fs[_0x6b1b('0x92')](path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0x96'),_0x381fdc[_0x6b1b('0x88')]))&&_0x381fdc[_0x6b1b('0x99')]){_0x1c8291=path[_0x6b1b('0x8b')](config['root'],_0x6b1b('0x96'),_0x381fdc['customerAvatar']);}}return _0x566cef[_0x6b1b('0x94')](_0x1c8291);}})[_0x6b1b('0x23')](handleError(_0x566cef,null));};exports[_0x6b1b('0x9a')]=function(_0x10b4c3,_0x3a0d4a){var _0x2bdbff=path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0x9b'));var _0x577d3c={'where':{'id':_0x10b4c3[_0x6b1b('0x6d')]['id']},'attributes':['id',_0x6b1b('0x8a')],'raw':!![]};return db[_0x6b1b('0x69')]['find'](_0x577d3c)[_0x6b1b('0x19')](handleEntityNotFound(_0x3a0d4a,null))[_0x6b1b('0x19')](function(_0x2fc576){if(_0x2fc576){if(!_[_0x6b1b('0x91')](_0x2fc576[_0x6b1b('0x8a')])){if(fs[_0x6b1b('0x92')](path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],'server/files/images/avatars/',_0x2fc576[_0x6b1b('0x8a')]))){_0x2bdbff=path['join'](config[_0x6b1b('0x8c')],_0x6b1b('0x96'),_0x2fc576['systemAvatar']);}}return _0x3a0d4a['download'](_0x2bdbff);}})[_0x6b1b('0x23')](handleError(_0x3a0d4a,null));};exports[_0x6b1b('0x9c')]=function(_0x3c19fe,_0x518087){var _0x2c418b={'body':_0x3c19fe[_0x6b1b('0x72')],'channel':'chat'};var _0x170710=[];var _0x5732c8=[];var _0x3e9bf3={};var _0x33bb90=![];return db[_0x6b1b('0x9d')][_0x6b1b('0x76')]()[_0x6b1b('0x19')](function(_0xb82426){if(!_0xb82426){throw new db[(_0x6b1b('0x9e'))][(_0x6b1b('0x9f'))](_0x6b1b('0xa0'));}_0x170710=_[_0x6b1b('0xa1')](_[_0x6b1b('0x5d')](_0xb82426),[_0x6b1b('0xa2'),'updatedAt']);_0x5732c8=_[_0x6b1b('0xa1')](_[_0x6b1b('0x5d')](_0xb82426),[_0x6b1b('0xa2'),_0x6b1b('0xa3'),_0x6b1b('0xa4'),'ListId']);if(_0x3c19fe[_0x6b1b('0x72')]['id']){delete _0x3c19fe[_0x6b1b('0x72')]['id'];}if(_[_0x6b1b('0x91')](_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa5')])){throw new db[(_0x6b1b('0x9e'))]['ValidationError'](_0x6b1b('0xa6'));}if(_[_0x6b1b('0x91')](_0x3c19fe['body'][_0x6b1b('0x72')])||_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0x72')]===''){throw new db[(_0x6b1b('0x9e'))][(_0x6b1b('0x9f'))](_0x6b1b('0xa7'));}if(_[_0x6b1b('0x91')](_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa8')])){throw new db[(_0x6b1b('0x9e'))][(_0x6b1b('0x9f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5732c8);}if(!_[_0x6b1b('0xa9')](_0x5732c8,_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa8')])){throw new db['Sequelize'][(_0x6b1b('0x9f'))](_0x6b1b('0xaa')+_0x5732c8);}_0x3e9bf3[_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa8')]]=_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa5')];})[_0x6b1b('0x19')](function(){return db[_0x6b1b('0x69')]['find']({'where':{'id':_0x3c19fe[_0x6b1b('0x6d')]['id']},'include':[{'model':db[_0x6b1b('0xab')],'as':_0x6b1b('0xac'),'include':[{'model':db[_0x6b1b('0x9d')],'as':_0x6b1b('0xad'),'where':_0x3e9bf3,'limit':0x1,'order':[[_0x6b1b('0xa3'),_0x6b1b('0xae')]]}]},{'model':db[_0x6b1b('0xaf')],'as':_0x6b1b('0xb0')},{'model':db[_0x6b1b('0x41')],'as':'Interval','include':[{'model':db[_0x6b1b('0x41')],'as':_0x6b1b('0x42'),'attributes':['id',_0x6b1b('0x39')],'raw':!![]}]}]});})[_0x6b1b('0x19')](function(_0x4e13e5){if(!_0x4e13e5)throw new APINotFoundError(util['format'](_0x6b1b('0xb1'),_0x3c19fe[_0x6b1b('0x6d')]['id']));if(!_0x4e13e5[_0x6b1b('0x41')]||!_0x4e13e5[_0x6b1b('0x41')]['Intervals'])return[_0x4e13e5,!![]];return[_0x4e13e5,checkWebsiteIntervals(_0x4e13e5)];})[_0x6b1b('0xb2')](function(_0x562692,_0x2a2440){if(!_0x2a2440)throw new APIOutOfIntervalError();if(!_0x562692['List'])return;_0x2c418b[_0x6b1b('0xb3')]=_0x562692;_0x2c418b[_0x6b1b('0xb4')]=_0x562692[_0x6b1b('0xac')];_0x2c418b[_0x6b1b('0xb5')]=_[_0x6b1b('0xb6')](_0x562692[_0x6b1b('0xb0')],[_0x6b1b('0xb7')],[_0x6b1b('0xb8')]);if(_0x2c418b['account']['Applications']){delete _0x2c418b[_0x6b1b('0xb3')]['Applications'];}if(_0x2c418b['account'][_0x6b1b('0xac')]&&_0x2c418b['account'][_0x6b1b('0xac')][_0x6b1b('0xad')][_0x6b1b('0x62')]){return _0x2c418b[_0x6b1b('0xb3')][_0x6b1b('0xac')]['Contacts'][0x0];}var _0x571826=_[_0x6b1b('0x12')](_0x3c19fe[_0x6b1b('0x72')],{'firstName':_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa5')],'ListId':_0x562692[_0x6b1b('0xb9')]});_0x571826[_0x3c19fe['body'][_0x6b1b('0xa8')]]=_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xa5')];return db['CmContact'][_0x6b1b('0x71')](_0x571826,{'fields':_0x170710,'raw':!![]});})[_0x6b1b('0x19')](function(_0x301a9e){_0x2c418b[_0x6b1b('0xba')]=_0x301a9e;var _0x4fbaf3=createInteractionObject(_0x3c19fe[_0x6b1b('0x6d')]['id'],_0x3c19fe[_0x6b1b('0x72')],_0x3c19fe['headers'],_0x301a9e);var _0x27e237={'ChatWebsiteId':_0x3c19fe[_0x6b1b('0x6d')]['id'],'closed':![]};if(_0x3c19fe['body'][_0x6b1b('0xbb')]){_0x27e237[_0x6b1b('0xbb')]=_0x3c19fe['body'][_0x6b1b('0xbb')];return db[_0x6b1b('0xbc')][_0x6b1b('0x75')]({'where':_0x27e237})[_0x6b1b('0x19')](function(_0x1a545d){if(_0x1a545d){_0x33bb90=!![];return _0x1a545d;}_0x4fbaf3[_0x6b1b('0xbb')]=_0x3c19fe['body'][_0x6b1b('0xbb')];_0x4fbaf3[_0x6b1b('0xbd')]=_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xbd')];return db['ChatInteraction'][_0x6b1b('0x71')](_0x4fbaf3);});}_0x27e237['ContactId']=_0x301a9e['id'];if(_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xbe')]&&_0x3c19fe['body'][_0x6b1b('0xbe')]['id']){_0x27e237['id']=_0x3c19fe['body'][_0x6b1b('0xbe')]['id'];return db[_0x6b1b('0xbc')][_0x6b1b('0x75')]({'where':_0x27e237})['then'](function(_0x28224b){if(_0x28224b){_0x33bb90=!![];return _0x28224b;}return db[_0x6b1b('0xbc')][_0x6b1b('0x71')](_0x4fbaf3);});}return db[_0x6b1b('0xbc')]['create'](_0x4fbaf3);})[_0x6b1b('0x19')](function(_0x29f472){if(!_0x33bb90)return _0x29f472;var _0x16b250={'from':(_0x2c418b[_0x6b1b('0xba')][_0x6b1b('0xbf')]||'')+'\x20'+(_0x2c418b[_0x6b1b('0xba')][_0x6b1b('0x4c')]||'')};if(_0x3c19fe['body'][_0x6b1b('0xbb')]&&_0x3c19fe['body']['messageId']&&_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xbb')]!=_0x3c19fe[_0x6b1b('0x72')]['messageId']){_0x16b250['threadId']=_0x3c19fe['body'][_0x6b1b('0xc0')];}return _0x29f472[_0x6b1b('0x2d')](_0x16b250);})['then'](function(_0x25006e){_0x2c418b[_0x6b1b('0xbe')]=_0x25006e[_0x6b1b('0x2f')]({'plain':!![]});_0x2c418b[_0x6b1b('0xbe')][_0x6b1b('0xc1')]=!_0x33bb90;if(_0x2c418b[_0x6b1b('0xbe')][_0x6b1b('0xc1')]){if(_0x2c418b[_0x6b1b('0xb3')][_0x6b1b('0xc2')]){_0x2c418b[_0x6b1b('0xb5')][_0x6b1b('0xc3')]({'id':0x0,'priority':_0x2c418b[_0x6b1b('0xb5')]['length']+0x1,'app':_0x6b1b('0xc4'),'appdata':_0x6b1b('0xc5'),'interval':_0x6b1b('0xc6')});}}return db['ChatMessage']['create']({'body':_0x3c19fe[_0x6b1b('0x72')]['body'],'ChatWebsiteId':_0x3c19fe['params']['id'],'ChatInteractionId':_0x25006e['id'],'direction':'in','ContactId':_0x2c418b['contact']['id'],'AttachmentId':_0x3c19fe[_0x6b1b('0x72')][_0x6b1b('0xc7')]});})[_0x6b1b('0x19')](function(_0x39b546){_0x2c418b[_0x6b1b('0x21')]=_0x39b546;if(!_0x2c418b['interaction']['UserId']){return;}return db['User'][_0x6b1b('0x75')]({'attributes':['id',_0x6b1b('0x32')],'where':{'id':_0x2c418b[_0x6b1b('0xbe')][_0x6b1b('0xc8')]}});})[_0x6b1b('0x19')](function(_0x1305e1){if(_0x1305e1){_0x2c418b['applications'][_0x6b1b('0xc9')]({'id':0x0,'priority':0x0,'app':_0x6b1b('0xca'),'appdata':_0x1305e1[_0x6b1b('0x32')]+','+(_0x2c418b['account'][_0x6b1b('0xcb')]||0xa),'interval':_0x6b1b('0xc6')});_0x2c418b[_0x6b1b('0xcc')]=!![];}if(!_0x2c418b[_0x6b1b('0xbe')][_0x6b1b('0xcd')]){return;}return db[_0x6b1b('0xce')][_0x6b1b('0x75')]({'attributes':['id','name'],'where':{'id':_0x2c418b['interaction'][_0x6b1b('0xcd')]}});})[_0x6b1b('0x19')](function(_0x567ae4){if(_0x567ae4){_0x2c418b[_0x6b1b('0xb5')][_0x6b1b('0xc9')]({'id':0x0,'priority':0x1,'app':'queue','appdata':_0x567ae4[_0x6b1b('0x32')]+','+(_0x2c418b[_0x6b1b('0xb3')][_0x6b1b('0xcf')]||0x12c),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x6b1b('0xd0'),_0x6b1b('0xd1'),_0x2c418b);})[_0x6b1b('0x19')](function(_0x50988d){respondWithRpcPromise(_0x6b1b('0xd2'),_0x6b1b('0xd2'),{'event':_0x6b1b('0x9c'),'message':_0x50988d},client9002);return _0x50988d;})[_0x6b1b('0x19')](respondWithResult(_0x518087,null))[_0x6b1b('0x23')](APIHandleError(_0x518087));};exports[_0x6b1b('0xd3')]=function(_0x55a58f,_0x3e9f1b){var _0x17ab68,_0x2e09e7,_0x450434;var _0xe50eea=[];var _0xa9a8e9={};var _0x4d7c2f=_0x55a58f[_0x6b1b('0xd4')]||[];var _0x347586=[];var _0x29ba28;return db[_0x6b1b('0x9d')][_0x6b1b('0x76')]()[_0x6b1b('0x19')](function(_0x41b975){if(!_0x41b975){throw new db[(_0x6b1b('0x9e'))][(_0x6b1b('0x9f'))](_0x6b1b('0xa0'));}_0xe50eea=_[_0x6b1b('0xa1')](_['keys'](_0x41b975),[_0x6b1b('0xa2'),'updatedAt',_0x6b1b('0xa4'),_0x6b1b('0xb9')]);if(_0x55a58f[_0x6b1b('0x72')]['id']){delete _0x55a58f[_0x6b1b('0x72')]['id'];}if(_['isNil'](_0x55a58f['body'][_0x6b1b('0xa5')])){throw _0x3e9f1b[_0x6b1b('0x25')](0x1f4)['send'](new db[(_0x6b1b('0x9e'))]['ValidationError']('from\x20is\x20mandatory'));}if(_[_0x6b1b('0x91')](_0x55a58f[_0x6b1b('0x72')][_0x6b1b('0x72')])||_0x55a58f['body'][_0x6b1b('0x72')]===''){throw _0x3e9f1b[_0x6b1b('0x25')](0x1f4)['send'](new db[(_0x6b1b('0x9e'))]['ValidationError'](_0x6b1b('0xa7')));}if(_[_0x6b1b('0x91')](_0x55a58f['body'][_0x6b1b('0xd5')])){throw _0x3e9f1b[_0x6b1b('0x25')](0x1f4)['send'](new db['Sequelize']['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe50eea));}if(!_[_0x6b1b('0xa9')](_0xe50eea,_0x55a58f['body'][_0x6b1b('0xd5')])){throw _0x3e9f1b[_0x6b1b('0x25')](0x1f4)[_0x6b1b('0x33')](new db['Sequelize'][(_0x6b1b('0x9f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xe50eea));}_0xa9a8e9[_0x55a58f[_0x6b1b('0x72')][_0x6b1b('0xd5')]]=_0x55a58f['body'][_0x6b1b('0xa5')];})['then'](function(){return db['ChatWebsite'][_0x6b1b('0x75')]({'where':{'id':_0x55a58f['params']['id']},'include':[{'model':db['CmList'],'as':'List'},{'model':db[_0x6b1b('0xd6')],'as':_0x6b1b('0xd6')}]});})['then'](handleEntityNotFound(_0x3e9f1b,null))[_0x6b1b('0x19')](function(_0x2761fe){if(_0x2761fe&&_0x2761fe[_0x6b1b('0xac')]){_0x2e09e7=_0x2761fe;var _0xa0b9a6=_['defaults'](_0x55a58f['body'],{'firstName':_0x55a58f[_0x6b1b('0x72')][_0x6b1b('0xa5')],'phone':_0x55a58f[_0x6b1b('0x72')][_0x6b1b('0xa5')],'ListId':_0x2761fe['ListId']});_0xa0b9a6[_0x55a58f[_0x6b1b('0x72')][_0x6b1b('0xd5')]]=_0x55a58f[_0x6b1b('0x72')][_0x6b1b('0xa5')];return db[_0x6b1b('0x9d')][_0x6b1b('0xd7')]({'where':_0xa9a8e9,'defaults':_0xa0b9a6});}})['spread'](function(_0x5cb777){if(_0x5cb777){_0x450434=_0x5cb777;var _0xcf4b3=fs['readFileSync'](path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0xd8')),_0x6b1b('0xd9'));var _0x1c62db=ejs[_0x6b1b('0xda')](_0xcf4b3,{'body':_[_0x6b1b('0xdb')](_0x55a58f['body'][_0x6b1b('0x72')]),'bodyTitle':_0x2e09e7[_0x6b1b('0xdc')]});return db[_0x6b1b('0xdd')][_0x6b1b('0x71')]({'body':_0x1c62db,'plainBody':htmlToText['fromString'](_0x1c62db),'ContactId':_0x5cb777['id'],'ChatWebsiteId':_0x2e09e7['id']});}})[_0x6b1b('0x19')](function(_0x8a51cc){_0x29ba28=_0x8a51cc;if(_0x4d7c2f['length']){var _0x51a5aa=_0x4d7c2f[_0x6b1b('0x40')](function(_0x1999cc){return{'name':_0x1999cc['originalname'],'basename':_0x1999cc['filename'],'type':_0x1999cc[_0x6b1b('0xde')],'ChatOfflineMessageId':_0x8a51cc['id']};});_0x347586=_0x51a5aa[_0x6b1b('0x40')](_0x2ac12c=>{var _0x3d0c90={'filename':_0x2ac12c['name'],'path':path[_0x6b1b('0x8b')](config['root'],_0x6b1b('0xdf'),_0x6b1b('0xd4'),_0x6b1b('0xe0'),_0x6b1b('0xe1'),_0x2ac12c[_0x6b1b('0xe2')])};return _0x3d0c90;});if(!_0x2e09e7[_0x6b1b('0xe3')]){return db['sequelize']['transaction'](function(_0x25acb2){return db['Attachment']['bulkCreate'](_0x51a5aa,{'transaction':_0x25acb2});});}}})[_0x6b1b('0x19')](function(){if(_0x29ba28){_0x17ab68=_0x29ba28;return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x6b1b('0xe4')],'as':_0x6b1b('0xe5'),'raw':!![],'include':[{'model':db[_0x6b1b('0xe6')],'as':_0x6b1b('0xe6'),'raw':!![]}]}]});}})[_0x6b1b('0x19')](function(_0x27dc8d){if(_0x27dc8d&&_0x27dc8d[_0x6b1b('0xe5')]&&_0x2e09e7['forwardOffline']&&_0x2e09e7[_0x6b1b('0xe7')]){var _0x48822c=_0x27dc8d[_0x6b1b('0xe8')]();return respondWithRpcPromise('SendMail',_0x6b1b('0xe9'),{'account':_0x48822c,'message':{'from':util[_0x6b1b('0x37')](_0x6b1b('0xea'),_0x27dc8d[_0x6b1b('0x32')],_0x27dc8d[_0x6b1b('0xeb')]||_0x27dc8d[_0x6b1b('0xe5')]['user']),'to':_0x2e09e7[_0x6b1b('0xe7')],'subject':_0x2e09e7['offlineMessageSubject'],'html':_0x17ab68['body'],'attachments':_0x347586}},client9003)['then'](function(){return _0x17ab68;})['catch'](function(_0x15480a){logger[_0x6b1b('0x1f')](_0x15480a);});}})['then'](function(){if(_0x2e09e7&&_0x2e09e7[_0x6b1b('0xe3')]&&_0x2e09e7[_0x6b1b('0xec')]){var _0x3c90d1=[];if(_0x4d7c2f[_0x6b1b('0x62')]){_0x3c90d1=_0x4d7c2f['map'](function(_0x571663){return{'name':_0x571663[_0x6b1b('0xed')],'basename':_0x571663[_0x6b1b('0x85')],'type':_0x571663[_0x6b1b('0xde')],'ChatOfflineMessageId':_0x29ba28['id']};});}var _0x31769c;if(!_[_0x6b1b('0x91')](_0x2e09e7[_0x6b1b('0xee')])){var _0x3521df=_[_0x6b1b('0x40')](_0x55a58f[_0x6b1b('0x72')],function(_0x45a3fb){return _0x45a3fb;});var _0xbdda13=_[_0x6b1b('0xef')](_0x3521df)[0x0];var _0x2b80ea=_[_0x6b1b('0xf0')](_0xbdda13,function(_0x2c7641){return _0x2c7641;});_0x31769c=_0x2b80ea[0x1][_0x2e09e7['subjectOffline']];}var _0x46a19a={'from':_0x450434[_0x6b1b('0xeb')],'firstName':_0x450434[_0x6b1b('0xbf')],'lastName':_0x450434[_0x6b1b('0x4c')],'mapKey':_0x6b1b('0xeb'),'message':{'from':_0x450434[_0x6b1b('0xeb')],'to':_0x2e09e7[_0x6b1b('0xd6')][_0x6b1b('0xeb')],'cc':'','subject':_[_0x6b1b('0x91')](_0x31769c)?_0x2e09e7[_0x6b1b('0xf1')]:_0x31769c,'messageId':'','sentAt':new Date(),'attach':_0x3c90d1[_0x6b1b('0x62')],'attachments':_0x3c90d1,'originChannel':_0x6b1b('0xf2'),'ChatWebsiteId':_0x2e09e7['id'],'ChatOfflineMessageId':_0x17ab68['id'],'originTo':_0x2e09e7['MailAccount'][_0x6b1b('0xeb')]},'body':_0x17ab68[_0x6b1b('0x72')]};var _0x383c79={'account':{'id':_0x2e09e7[_0x6b1b('0xec')]},'body':_0x46a19a,'log':'NotifyMailAccount'};return respondWithRpcPromise(_0x6b1b('0xf3'),_0x6b1b('0xf4'),_0x383c79,client9001)[_0x6b1b('0x19')](function(){return _0x17ab68;})[_0x6b1b('0x23')](function(_0x404f80){logger[_0x6b1b('0x1f')](_0x404f80);});}return;})['then'](function(){if(_0x17ab68){return _0x17ab68;}})[_0x6b1b('0x19')](respondWithResult(_0x3e9f1b,null))[_0x6b1b('0x23')](function(){for(var _0x547317 of _0x4d7c2f){var _0x50b970=path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0xdf'),_0x6b1b('0xd4'),_0x6b1b('0xe0'),_0x6b1b('0xe1'),_0x547317['filename']);fs_extra['remove'](_0x50b970)[_0x6b1b('0x23')](function(_0x32d319){logger[_0x6b1b('0x1f')](_0x6b1b('0xf5'),_0x50b970,_0x32d319);});}});};exports[_0x6b1b('0xf6')]=function(_0x29d6c4,_0x59bf56){return db['ChatInteraction'][_0x6b1b('0x75')]({'where':{'id':_0x29d6c4[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x59bf56,null))[_0x6b1b('0x19')](function(_0x1839e7){if(_0x1839e7){return _0x1839e7['addInteraction'](_0x29d6c4[_0x6b1b('0x72')][_0x6b1b('0x81')],_[_0x6b1b('0xf7')](_0x29d6c4[_0x6b1b('0x72')],['ids','id'])||{});}})[_0x6b1b('0x19')](respondWithResult(_0x59bf56,null))[_0x6b1b('0x23')](handleError(_0x59bf56,null));};exports[_0x6b1b('0xf8')]=function(_0xfa4faf,_0x51b5c6){var _0x70c0e3={'raw':![],'where':{}};var _0x49c27d={};var _0x12a399={'count':0x0,'rows':[]};return db[_0x6b1b('0x69')][_0x6b1b('0x7e')]({'where':{'id':_0xfa4faf[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x51b5c6,null))[_0x6b1b('0x19')](function(_0x4afd36){if(_0x4afd36){_0x49c27d[_0x6b1b('0x54')]=_[_0x6b1b('0x5d')](db[_0x6b1b('0xbc')][_0x6b1b('0x59')]);_0x49c27d[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0xfa4faf[_0x6b1b('0x5c')]);_0x49c27d[_0x6b1b('0x5e')]=_[_0x6b1b('0x5f')](_0x49c27d[_0x6b1b('0x54')],_0x49c27d[_0x6b1b('0x5c')]);_0x70c0e3[_0x6b1b('0x61')]=_[_0x6b1b('0x5f')](_0x49c27d[_0x6b1b('0x54')],qs['fields'](_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0x60')]));_0x70c0e3[_0x6b1b('0x61')]=_0x70c0e3['attributes'][_0x6b1b('0x62')]?_0x70c0e3[_0x6b1b('0x61')]:_0x49c27d[_0x6b1b('0x54')];if(!_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0x63')](_0x6b1b('0x7a'))){_0x70c0e3['limit']=qs[_0x6b1b('0x29')](_0xfa4faf['query'][_0x6b1b('0x29')]);_0x70c0e3['offset']=qs['offset'](_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0x27')]);}_0x70c0e3[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0x65')]);_0x70c0e3['where']=qs[_0x6b1b('0x5e')](_['pick'](_0xfa4faf[_0x6b1b('0x5c')],_0x49c27d['filters']));_0x70c0e3[_0x6b1b('0x66')]['ChatWebsiteId']=_0x4afd36['id'];if(_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0x68')]){_0x70c0e3['where']=_['merge'](_0x70c0e3[_0x6b1b('0x66')],{'$or':_['map'](_0x70c0e3['attributes'],function(_0x12a9f5){var _0x3b1b64={};_0x3b1b64[_0x12a9f5]={'$like':'%'+_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0x68')]+'%'};return _0x3b1b64;})});}_0x70c0e3=_['merge']({},_0x70c0e3,_0xfa4faf[_0x6b1b('0x70')]);return db[_0x6b1b('0xbc')][_0x6b1b('0x2a')]({'where':_0x70c0e3[_0x6b1b('0x66')]})[_0x6b1b('0x19')](function(_0xe2697d){_0x12a399[_0x6b1b('0x2a')]=_0xe2697d;if(_0xfa4faf['query'][_0x6b1b('0x6a')]){_0x70c0e3['include']=[{'model':db[_0x6b1b('0x9d')],'as':'Contact','required':![]},{'model':db[_0x6b1b('0xf9')],'as':_0x6b1b('0xfa'),'attributes':[_0x6b1b('0x32'),'fullname','internal'],'required':![]},{'model':db[_0x6b1b('0xfb')],'as':_0x6b1b('0xfc'),'attributes':['id',_0x6b1b('0x32'),_0x6b1b('0xfd')],'where':_0xfa4faf['query'][_0x6b1b('0xfe')]?{'id':_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0xfe')]}:undefined,'required':_0xfa4faf[_0x6b1b('0x5c')][_0x6b1b('0xfe')]?!![]:![]}];}return db[_0x6b1b('0xbc')][_0x6b1b('0x6b')](_0x70c0e3);})[_0x6b1b('0x19')](function(_0x585555){_0x12a399[_0x6b1b('0x7c')]=_0x585555;return _0x12a399;});}})['then'](respondWithFilteredResult(_0x51b5c6,_0x70c0e3))[_0x6b1b('0x23')](handleError(_0x51b5c6,null));};exports['getSnippet']=function(_0x189fae,_0x5b2c7d){var _0x30a760=0x0;var _0x43b0ce=0x0;var _0x154a4c=![];var _0x331d0b;var _0x360db4;return db[_0x6b1b('0x69')][_0x6b1b('0x75')]({'where':{'id':_0x189fae[_0x6b1b('0x6d')]['id']},'include':[{'model':db[_0x6b1b('0x41')],'as':_0x6b1b('0x41'),'include':[{'model':db[_0x6b1b('0x41')],'as':_0x6b1b('0x42'),'attributes':['id',_0x6b1b('0x39')]}]}]})[_0x6b1b('0x19')](handleEntityNotFound(_0x5b2c7d,null))[_0x6b1b('0x19')](function(_0x26c84a){if(_0x26c84a){_0x331d0b=_0x26c84a;return _0x26c84a['getProactiveActions']({'raw':!![]});}})[_0x6b1b('0x19')](function(_0x103aa2){if(_0x331d0b){if(_0x103aa2){_0x360db4=_0x103aa2;}}return require(_0x6b1b('0x8e'))[_0x6b1b('0x8f')]();})[_0x6b1b('0x19')](function(_0x11a2d7){if(_0x11a2d7){_0x43b0ce=_0x11a2d7[_0x6b1b('0xff')];_0x154a4c=_0x11a2d7[_0x6b1b('0x90')];}})['then'](function(){return db[_0x6b1b('0xbc')]['count']({'where':{'closed':![]}});})[_0x6b1b('0x19')](function(_0x1286f6){_0x30a760=_0x1286f6;if(_0x43b0ce&&_0x1286f6>_0x43b0ce){return db[_0x6b1b('0x100')][_0x6b1b('0x7e')]({'where':{'id':0x1}})[_0x6b1b('0x19')](function(_0x53991a){if(_0x53991a){_0x53991a['increment']('chatLicenseExceeded');}});}})['then'](function(){if(!_0x331d0b[_0x6b1b('0x41')]||!_0x331d0b[_0x6b1b('0x41')][_0x6b1b('0x42')])return!![];return checkWebsiteIntervals(_0x331d0b);})[_0x6b1b('0x19')](function(_0x6e5b9a){var _0x5c0584=fs[_0x6b1b('0x101')](path[_0x6b1b('0x8b')](config[_0x6b1b('0x8c')],_0x6b1b('0x102')),_0x6b1b('0xd9'));var _0x442193=new url[(_0x6b1b('0x103'))](_0x331d0b['address'])['origin'];var _0x57dc59=_0x6b1b('0x104');var _0x5708c1=![];var _0x5946d0={'chatVersion':_0x57dc59,'chatWebsiteAddressOrigin':_0x442193,'remote':_0x331d0b[_0x6b1b('0x105')],'query':querystring['stringify'](_['merge'](_0x331d0b[_0x6b1b('0x2f')]({'plain':!![]}),{'customerIp':_0x189fae[_0x6b1b('0x106')][_0x6b1b('0x4b')]||_0x189fae[_0x6b1b('0x106')][_0x6b1b('0x107')]||_0x189fae[_0x6b1b('0x108')][_0x6b1b('0x109')]||_0x189fae['ip'],'referer':_0x189fae['headers'][_0x6b1b('0x4e')],'openedInteractions':_0x30a760,'maxInteractions':_0x43b0ce,'virtual':_0x154a4c[_0x6b1b('0xff')],'online':_0x6e5b9a,'custom':_0x154a4c}))[_0x6b1b('0x10a')](/'/g,'\x5c\x27')};_0x5b2c7d[_0x6b1b('0x33')](ejs[_0x6b1b('0xda')](Mustache[_0x6b1b('0xda')](_0x5c0584,_0x5946d0),{'proactiveActions':_0x360db4,'alignment':_0x331d0b[_0x6b1b('0x10b')],'verticalAlignment':_0x331d0b[_0x6b1b('0x10c')],'div_color':_0x331d0b[_0x6b1b('0xfd')],'labelText':_0x331d0b[_0x6b1b('0x10d')],'text_color':_0x331d0b['textColor'],'text_button_color':_0x331d0b['textButtonColor'],'button_color':_0x331d0b['color_button'],'background_color':_0x331d0b[_0x6b1b('0x10e')],'hideWhenOffline':_0x331d0b['hideWhenOffline'],'intervalId':_0x331d0b['IntervalId'],'isDevelopment':_0x5708c1,'chatVersion':_0x57dc59}));})[_0x6b1b('0x23')](handleError(_0x5b2c7d,null));};exports[_0x6b1b('0x10f')]=function(_0x141457,_0x549e50){var _0x1b0f3a=_0x141457['params']['id'];var _0xb0dbf1=_0x141457[_0x6b1b('0x72')];var _0x261aee=0xc8;var _0x50fd12=null;return db[_0x6b1b('0x110')]['transaction']({'isolationLevel':db['sequelize'][_0x6b1b('0x111')][_0x6b1b('0x112')][_0x6b1b('0x113')]},function(_0x3e8034){return db[_0x6b1b('0x69')]['findOne']({'where':{'id':_0x1b0f3a},'transaction':_0x3e8034})['then'](function(_0x1183ca){if(_0x1183ca){return db['ChatApplication'][_0x6b1b('0x2e')]({'where':{'ChatWebsiteId':_0x1b0f3a},'transaction':_0x3e8034})[_0x6b1b('0x19')](function(){var _0x51e6ef=_[_0x6b1b('0x40')](_0xb0dbf1,function(_0x6b706c){_0x6b706c[_0x6b1b('0x7b')]=_0x1b0f3a;return _0x6b706c;});return db[_0x6b1b('0xaf')][_0x6b1b('0x114')](_0x51e6ef,{'transaction':_0x3e8034});});}else{_0x261aee=0x194;_0x50fd12=[];}});})[_0x6b1b('0x19')](function(){if(_0x261aee!==0x194){return db[_0x6b1b('0xaf')][_0x6b1b('0x115')]({'where':{'ChatWebsiteId':_0x1b0f3a},'order':_0x6b1b('0xb7')})[_0x6b1b('0x19')](function(_0x3143f2){_0x50fd12=_0x3143f2;});}})[_0x6b1b('0x23')](function(_0x3ff800){_0x261aee=0x1f4;logger[_0x6b1b('0x1f')](_0x3ff800[_0x6b1b('0x116')]);if(_0x3ff800['name']){delete _0x3ff800[_0x6b1b('0x32')];}_0x50fd12=_0x3ff800;})[_0x6b1b('0x117')](function(){if(_0x50fd12===null){_0x549e50['sendStatus'](_0x261aee);}else{if(_0x261aee===0x1f4){_0x549e50[_0x6b1b('0x25')](_0x261aee)['send'](_0x50fd12);}else{_0x549e50[_0x6b1b('0x25')](_0x261aee)[_0x6b1b('0x26')](_0x50fd12);}}});};exports['getApplications']=function(_0x3b5853,_0x4d0556){var _0x376e18={};var _0x453f93={};var _0x5643e1;var _0x1d1d59;return db[_0x6b1b('0x69')][_0x6b1b('0x7e')]({'where':{'id':_0x3b5853['params']['id']}})['then'](handleEntityNotFound(_0x4d0556,null))[_0x6b1b('0x19')](function(_0x312b54){if(_0x312b54){_0x5643e1=_0x312b54;_0x453f93[_0x6b1b('0x54')]=_[_0x6b1b('0x5d')](db[_0x6b1b('0xaf')][_0x6b1b('0x59')]);_0x453f93['query']=_[_0x6b1b('0x5d')](_0x3b5853[_0x6b1b('0x5c')]);_0x453f93['filters']=_[_0x6b1b('0x5f')](_0x453f93[_0x6b1b('0x54')],_0x453f93[_0x6b1b('0x5c')]);_0x376e18['attributes']=_[_0x6b1b('0x5f')](_0x453f93[_0x6b1b('0x54')],qs[_0x6b1b('0x60')](_0x3b5853[_0x6b1b('0x5c')][_0x6b1b('0x60')]));_0x376e18[_0x6b1b('0x61')]=_0x376e18['attributes']['length']?_0x376e18[_0x6b1b('0x61')]:_0x453f93[_0x6b1b('0x54')];_0x376e18[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x3b5853[_0x6b1b('0x5c')][_0x6b1b('0x65')]);_0x376e18[_0x6b1b('0x66')]=qs[_0x6b1b('0x5e')](_[_0x6b1b('0x67')](_0x3b5853['query'],_0x453f93['filters']));if(_0x3b5853[_0x6b1b('0x5c')]['filter']){_0x376e18[_0x6b1b('0x66')]=_[_0x6b1b('0x6f')](_0x376e18[_0x6b1b('0x66')],{'$or':_[_0x6b1b('0x40')](_0x376e18[_0x6b1b('0x61')],function(_0x5377b5){var _0x54e7be={};_0x54e7be[_0x5377b5]={'$like':'%'+_0x3b5853[_0x6b1b('0x5c')]['filter']+'%'};return _0x54e7be;})});}_0x376e18=_[_0x6b1b('0x6f')]({},_0x376e18,_0x3b5853[_0x6b1b('0x70')]);return _0x5643e1['getApplications'](_0x376e18);}})[_0x6b1b('0x19')](function(_0x2119b8){if(_0x2119b8){_0x1d1d59=_0x2119b8[_0x6b1b('0x62')];if(!_0x3b5853[_0x6b1b('0x5c')]['hasOwnProperty'](_0x6b1b('0x7a'))){_0x376e18[_0x6b1b('0x29')]=qs['limit'](_0x3b5853[_0x6b1b('0x5c')][_0x6b1b('0x29')]);_0x376e18[_0x6b1b('0x27')]=qs[_0x6b1b('0x27')](_0x3b5853[_0x6b1b('0x5c')][_0x6b1b('0x27')]);}return _0x5643e1['getApplications'](_0x376e18);}})[_0x6b1b('0x19')](function(_0x2185b0){if(_0x2185b0){return _0x2185b0?{'count':_0x1d1d59,'rows':_0x2185b0}:null;}})[_0x6b1b('0x19')](respondWithResult(_0x4d0556,null))['catch'](handleError(_0x4d0556,null));};exports[_0x6b1b('0x118')]=function(_0x30471b,_0x459d0a){return db['chatProactiveAction']['find']({'where':{'id':_0x30471b[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x459d0a,null))[_0x6b1b('0x19')](function(_0x549261){if(_0x549261){return _0x549261['addProactiveActions'](_0x30471b[_0x6b1b('0x72')][_0x6b1b('0x81')],_[_0x6b1b('0xf7')](_0x30471b[_0x6b1b('0x72')],[_0x6b1b('0x81'),'id'])||{});}})[_0x6b1b('0x19')](respondWithResult(_0x459d0a,null))[_0x6b1b('0x23')](handleError(_0x459d0a,null));};exports['getProactiveActions']=function(_0x57cc0a,_0xd182d8){var _0x3047e5={};var _0x3349b7={};var _0x5c9497;var _0x36e8a5;return db[_0x6b1b('0x69')][_0x6b1b('0x7e')]({'where':{'id':_0x57cc0a['params']['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0xd182d8,null))[_0x6b1b('0x19')](function(_0x4b4b72){if(_0x4b4b72){_0x5c9497=_0x4b4b72;_0x3349b7[_0x6b1b('0x54')]=_[_0x6b1b('0x5d')](db[_0x6b1b('0x119')][_0x6b1b('0x59')]);_0x3349b7[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0x57cc0a[_0x6b1b('0x5c')]);_0x3349b7[_0x6b1b('0x5e')]=_['intersection'](_0x3349b7[_0x6b1b('0x54')],_0x3349b7['query']);_0x3047e5[_0x6b1b('0x61')]=_[_0x6b1b('0x5f')](_0x3349b7['model'],qs['fields'](_0x57cc0a[_0x6b1b('0x5c')][_0x6b1b('0x60')]));_0x3047e5[_0x6b1b('0x61')]=_0x3047e5['attributes']['length']?_0x3047e5[_0x6b1b('0x61')]:_0x3349b7[_0x6b1b('0x54')];_0x3047e5[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x57cc0a[_0x6b1b('0x5c')][_0x6b1b('0x65')]);_0x3047e5[_0x6b1b('0x66')]=qs[_0x6b1b('0x5e')](_[_0x6b1b('0x67')](_0x57cc0a[_0x6b1b('0x5c')],_0x3349b7[_0x6b1b('0x5e')]));if(_0x57cc0a[_0x6b1b('0x5c')][_0x6b1b('0x68')]){_0x3047e5[_0x6b1b('0x66')]=_[_0x6b1b('0x6f')](_0x3047e5['where'],{'$or':_['map'](_0x3047e5[_0x6b1b('0x61')],function(_0x26d45f){var _0x27381b={};_0x27381b[_0x26d45f]={'$like':'%'+_0x57cc0a['query'][_0x6b1b('0x68')]+'%'};return _0x27381b;})});}_0x3047e5=_['merge']({},_0x3047e5,_0x57cc0a[_0x6b1b('0x70')]);return _0x5c9497['getProactiveActions'](_0x3047e5);}})[_0x6b1b('0x19')](function(_0x516894){if(_0x516894){_0x36e8a5=_0x516894[_0x6b1b('0x62')];if(!_0x57cc0a[_0x6b1b('0x5c')][_0x6b1b('0x63')]('nolimit')){_0x3047e5[_0x6b1b('0x29')]=qs['limit'](_0x57cc0a['query'][_0x6b1b('0x29')]);_0x3047e5['offset']=qs['offset'](_0x57cc0a[_0x6b1b('0x5c')][_0x6b1b('0x27')]);}return _0x5c9497['getProactiveActions'](_0x3047e5);}})[_0x6b1b('0x19')](function(_0x187b55){if(_0x187b55){return _0x187b55?{'count':_0x36e8a5,'rows':_0x187b55}:null;}})[_0x6b1b('0x19')](respondWithResult(_0xd182d8,null))['catch'](handleError(_0xd182d8,null));};exports[_0x6b1b('0x11a')]=function(_0x4adad3,_0x125a3f){var _0x2ccf04=_0x4adad3[_0x6b1b('0x5c')][_0x6b1b('0x11b')]===_0x6b1b('0x11c')?_0x6b1b('0x11d'):_0x6b1b('0x11e');return db['ChatWebsite'][_0x6b1b('0x75')]({'attributes':['id',_0x2ccf04],'where':{'id':_0x4adad3[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x125a3f,null))['then'](function(_0x2b65d2){if(_0x2b65d2){var _0x489839=_0x2b65d2[_0x2ccf04];var _0x1f4ead=_0x489839&&_0x489839[_0x6b1b('0x11f')]?_0x489839[_0x6b1b('0x11f')]:[];_0x125a3f['send']({'fromKey':_[_0x6b1b('0x91')](_0x489839[_0x6b1b('0x120')])?undefined:_0x489839['fromKey'],'count':_0x1f4ead[_0x6b1b('0x62')],'rows':_0x1f4ead});}})[_0x6b1b('0x23')](handleError(_0x125a3f,null));};exports[_0x6b1b('0x121')]=function(_0x2cce36,_0x13e2a9){var _0x42547c={'raw':![],'where':{}};var _0xa8e337={};var _0x3e4214={'count':0x0,'rows':[]};return db[_0x6b1b('0x69')][_0x6b1b('0x7e')]({'where':{'id':_0x2cce36['params']['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x13e2a9,null))[_0x6b1b('0x19')](function(_0x51744a){if(_0x51744a){_0xa8e337[_0x6b1b('0x54')]=_[_0x6b1b('0x5d')](db[_0x6b1b('0xdd')][_0x6b1b('0x59')]);_0xa8e337[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0x2cce36[_0x6b1b('0x5c')]);_0xa8e337['filters']=_[_0x6b1b('0x5f')](_0xa8e337[_0x6b1b('0x54')],_0xa8e337[_0x6b1b('0x5c')]);_0x42547c[_0x6b1b('0x61')]=_[_0x6b1b('0x5f')](_0xa8e337['model'],qs[_0x6b1b('0x60')](_0x2cce36[_0x6b1b('0x5c')][_0x6b1b('0x60')]));_0x42547c['attributes']=_0x42547c[_0x6b1b('0x61')][_0x6b1b('0x62')]?_0x42547c['attributes']:_0xa8e337['model'];if(!_0x2cce36[_0x6b1b('0x5c')][_0x6b1b('0x63')](_0x6b1b('0x7a'))){_0x42547c[_0x6b1b('0x29')]=qs[_0x6b1b('0x29')](_0x2cce36['query']['limit']);_0x42547c[_0x6b1b('0x27')]=qs['offset'](_0x2cce36[_0x6b1b('0x5c')]['offset']);}_0x42547c[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x2cce36['query'][_0x6b1b('0x65')]);_0x42547c[_0x6b1b('0x66')]=qs[_0x6b1b('0x5e')](_[_0x6b1b('0x67')](_0x2cce36[_0x6b1b('0x5c')],_0xa8e337[_0x6b1b('0x5e')]));_0x42547c[_0x6b1b('0x66')][_0x6b1b('0x7b')]=_0x51744a['id'];if(_0x2cce36[_0x6b1b('0x5c')]['filter']){_0x42547c[_0x6b1b('0x66')]=_[_0x6b1b('0x6f')](_0x42547c[_0x6b1b('0x66')],{'$or':_[_0x6b1b('0x40')](_0x42547c[_0x6b1b('0x61')],function(_0x32de72){var _0x54429a={};_0x54429a[_0x32de72]={'$like':'%'+_0x2cce36[_0x6b1b('0x5c')][_0x6b1b('0x68')]+'%'};return _0x54429a;})});}_0x42547c=_[_0x6b1b('0x6f')]({},_0x42547c,_0x2cce36[_0x6b1b('0x70')]);return db[_0x6b1b('0xdd')][_0x6b1b('0x2a')]({'where':_0x42547c[_0x6b1b('0x66')]})['then'](function(_0xb3b02e){_0x3e4214[_0x6b1b('0x2a')]=_0xb3b02e;if(_0x2cce36[_0x6b1b('0x5c')]['includeAll']){_0x42547c[_0x6b1b('0x6e')]=[{'all':!![]}];}else{_0x42547c['include']=[{'model':db['CmContact'],'as':_0x6b1b('0x122'),'required':![]},{'model':db[_0x6b1b('0x123')],'as':'Attachments','required':![]}];}return db[_0x6b1b('0xdd')][_0x6b1b('0x6b')](_0x42547c);})['then'](function(_0x87a703){_0x3e4214[_0x6b1b('0x7c')]=_0x87a703;return _0x3e4214;});}})[_0x6b1b('0x19')](respondWithFilteredResult(_0x13e2a9,_0x42547c))[_0x6b1b('0x23')](handleError(_0x13e2a9,null));};exports['addAgents']=function(_0x543ad4,_0x22b0ae){return db[_0x6b1b('0x69')][_0x6b1b('0x75')]({'where':{'id':_0x543ad4[_0x6b1b('0x6d')]['id']}})[_0x6b1b('0x19')](handleEntityNotFound(_0x22b0ae,null))[_0x6b1b('0x19')](function(_0x38c3c0){if(_0x38c3c0){return _0x38c3c0[_0x6b1b('0x124')](_0x543ad4[_0x6b1b('0x72')][_0x6b1b('0x81')],_[_0x6b1b('0xf7')](_0x543ad4['body'],['ids','id'])||{})[_0x6b1b('0xb2')](function(_0x4ce305){for(var _0x205e08=0x0;_0x205e08<_0x543ad4[_0x6b1b('0x72')][_0x6b1b('0x81')][_0x6b1b('0x62')];_0x205e08+=0x1){socket[_0x6b1b('0x125')](_0x6b1b('0x126'),{'UserId':Number(_0x543ad4[_0x6b1b('0x72')]['ids'][_0x205e08]),'ChatWebsiteId':Number(_0x543ad4[_0x6b1b('0x6d')]['id'])});}return _0x4ce305;});}})['then'](respondWithResult(_0x22b0ae,null))['catch'](handleError(_0x22b0ae,null));};exports['removeAgents']=function(_0x555c1d,_0x16db6f){return db['ChatWebsite'][_0x6b1b('0x75')]({'where':{'id':_0x555c1d[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x16db6f,null))[_0x6b1b('0x19')](function(_0x3cb482){if(_0x3cb482){return _0x3cb482['removeAgents'](_0x555c1d['query']['ids'])['then'](function(){if(_[_0x6b1b('0x127')](_0x555c1d['query'][_0x6b1b('0x81')])){for(var _0x4eae43=0x0;_0x4eae43<_0x555c1d[_0x6b1b('0x5c')][_0x6b1b('0x81')][_0x6b1b('0x62')];_0x4eae43+=0x1){socket[_0x6b1b('0x125')](_0x6b1b('0x128'),{'UserId':Number(_0x555c1d['query'][_0x6b1b('0x81')][_0x4eae43]),'ChatWebsiteId':Number(_0x555c1d[_0x6b1b('0x6d')]['id'])});}}else{socket[_0x6b1b('0x125')](_0x6b1b('0x128'),{'UserId':Number(_0x555c1d[_0x6b1b('0x5c')][_0x6b1b('0x81')]),'ChatWebsiteId':Number(_0x555c1d[_0x6b1b('0x6d')]['id'])});}});}})['then'](respondWithStatusCode(_0x16db6f,null))[_0x6b1b('0x23')](handleError(_0x16db6f,null));};exports['getAgents']=function(_0x363859,_0x4a5b53){var _0x31fc30={};var _0x48bdff={};var _0x4fc237;var _0xa127c0;return db['ChatWebsite'][_0x6b1b('0x7e')]({'where':{'id':_0x363859[_0x6b1b('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4a5b53,null))['then'](function(_0x16be0c){if(_0x16be0c){_0x4fc237=_0x16be0c;_0x48bdff['model']=_[_0x6b1b('0x5d')](db[_0x6b1b('0xf9')][_0x6b1b('0x59')]);_0x48bdff[_0x6b1b('0x5c')]=_[_0x6b1b('0x5d')](_0x363859[_0x6b1b('0x5c')]);_0x48bdff[_0x6b1b('0x5e')]=_['intersection'](_0x48bdff[_0x6b1b('0x54')],_0x48bdff[_0x6b1b('0x5c')]);_0x31fc30['attributes']=_[_0x6b1b('0x5f')](_0x48bdff[_0x6b1b('0x54')],qs['fields'](_0x363859[_0x6b1b('0x5c')][_0x6b1b('0x60')]));_0x31fc30[_0x6b1b('0x61')]=_0x31fc30[_0x6b1b('0x61')][_0x6b1b('0x62')]?_0x31fc30[_0x6b1b('0x61')]:_0x48bdff[_0x6b1b('0x54')];_0x31fc30[_0x6b1b('0x64')]=qs[_0x6b1b('0x65')](_0x363859[_0x6b1b('0x5c')][_0x6b1b('0x65')]);_0x31fc30[_0x6b1b('0x66')]=qs[_0x6b1b('0x5e')](_['pick'](_0x363859[_0x6b1b('0x5c')],_0x48bdff[_0x6b1b('0x5e')]));if(_0x363859[_0x6b1b('0x5c')]['filter']){_0x31fc30[_0x6b1b('0x66')]=_[_0x6b1b('0x6f')](_0x31fc30[_0x6b1b('0x66')],{'$or':_[_0x6b1b('0x40')](_0x31fc30[_0x6b1b('0x61')],function(_0x5f3a25){var _0x2b4ffc={};_0x2b4ffc[_0x5f3a25]={'$like':'%'+_0x363859['query'][_0x6b1b('0x68')]+'%'};return _0x2b4ffc;})});}_0x31fc30=_[_0x6b1b('0x6f')]({},_0x31fc30,_0x363859[_0x6b1b('0x70')]);return _0x4fc237[_0x6b1b('0x129')](_0x31fc30);}})['then'](function(_0x2de54e){if(_0x2de54e){_0xa127c0=_0x2de54e[_0x6b1b('0x62')];if(!_0x363859[_0x6b1b('0x5c')]['hasOwnProperty'](_0x6b1b('0x7a'))){_0x31fc30[_0x6b1b('0x29')]=qs[_0x6b1b('0x29')](_0x363859[_0x6b1b('0x5c')][_0x6b1b('0x29')]);_0x31fc30['offset']=qs[_0x6b1b('0x27')](_0x363859[_0x6b1b('0x5c')]['offset']);}return _0x4fc237[_0x6b1b('0x129')](_0x31fc30);}})[_0x6b1b('0x19')](function(_0x3906d8){if(_0x3906d8){return _0x3906d8?{'count':_0xa127c0,'rows':_0x3906d8}:null;}})[_0x6b1b('0x19')](respondWithResult(_0x4a5b53,null))['catch'](handleError(_0x4a5b53,null));};
\ No newline at end of file
+var _0x68d3=['created','autoclose','applications','push','unmanaged','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','ChatQueue','queueId','queue','waitForTheAssignedQueue','Start','EventManager','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','ChatOfflineMessage','fromString','originalname','mimetype','server','files','attachments','offline-chat','openNewInteraction','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','subjectOffline','mapValues','firstName','MailAccountId','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','internal','Tag','Tags','tag','getSnippet','getProactiveActions','custom','License','increment','chatLicenseExceeded','server/files/chat/iframe.ejs','utf8','address','3.5.0','remoteAddress','virtual','verticalAlignment','color','textColor','textButtonColor','backgroundColor','hideWhenOffline','IntervalId','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','mustache','util','path','ejs','lodash','querystring','ioredis','../../config/logger','../../errors/api','APINotFoundError','handleError','../../mysqldb','redis','defaults','socket.io-emitter','./chatWebsite.socket','register','client','http','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','result','catch','status','end','json','undefined','count','offset','limit','set','Content-Range','update','destroy','ChatWebsites','UserProfileResource','sendStatus','stack','name','timezone','format','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','map','Interval','Intervals','get','some','user-agent-parser','setUA','user-agent','customerIp','cf-connecting-ip','x-forwarded-for','first','split','lastName','browser','%s\x20%s','version','unknown','device','model','vendor','type','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','key','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','length','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','../../config/license/util','getLicense','isNil','sitepic','existsSync','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','ChatApplication','Applications','Chat\x20Website\x20with\x20id\x20%s\x20not\x20found','spread','account','orderBy','priority','headers','threadId','ChatInteraction','externalUrl','ContactId','interaction','contact','messageId'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x68d3,0x197));var _0x368d=function(_0x2e78cb,_0x111663){_0x2e78cb=_0x2e78cb-0x0;var _0x10176a=_0x68d3[_0x2e78cb];return _0x10176a;};'use strict';var Mustache=require(_0x368d('0x0'));var util=require(_0x368d('0x1'));var path=require(_0x368d('0x2'));var ejs=require(_0x368d('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x368d('0x4'));var querystring=require(_0x368d('0x5'));var htmlToText=require('html-to-text');var Redis=require(_0x368d('0x6'));var jayson=require('jayson/promise');var url=require('url');var qs=require('../../components/parsers/qs');var logger=require(_0x368d('0x7'))('api');var config=require('../../config/environment');var APIOutOfIntervalError=require(_0x368d('0x8'))['APIOutOfIntervalError'];var APINotFoundError=require('../../errors/api')[_0x368d('0x9')];var APIHandleError=require(_0x368d('0x8'))[_0x368d('0xa')];var db=require(_0x368d('0xb'))['db'];config[_0x368d('0xc')]=_[_0x368d('0xd')](config[_0x368d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x368d('0xe'))(new Redis(config['redis']));require(_0x368d('0xf'))[_0x368d('0x10')](socket);var client=jayson[_0x368d('0x11')][_0x368d('0x12')]({'port':0x232c});var client9002=jayson[_0x368d('0x11')][_0x368d('0x12')]({'port':0x232a});var client9003=jayson[_0x368d('0x11')][_0x368d('0x12')]({'port':0x232b});var client9001=jayson[_0x368d('0x11')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3156b6,_0x3cfa0d,_0x568483,_0x4933c6){return new Promise(function(_0xe76048,_0x2bf4bb){var _0x2342eb=_0x4933c6||client;return _0x2342eb['request'](_0x3156b6,_0x568483)[_0x368d('0x13')](function(_0x5d9fb8){logger[_0x368d('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x3cfa0d,_0x368d('0x15'));logger[_0x368d('0x16')](_0x368d('0x17'),_0x3cfa0d,_0x368d('0x15'),JSON[_0x368d('0x18')](_0x5d9fb8));if(_0x5d9fb8[_0x368d('0x19')]){if(_0x5d9fb8[_0x368d('0x19')][_0x368d('0x1a')]===0x1f4){logger[_0x368d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3cfa0d,_0x5d9fb8[_0x368d('0x19')][_0x368d('0x1b')]);return _0x2bf4bb(_0x5d9fb8[_0x368d('0x19')][_0x368d('0x1b')]);}logger[_0x368d('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x3cfa0d,_0x5d9fb8[_0x368d('0x19')][_0x368d('0x1b')]);return _0xe76048(_0x5d9fb8['error'][_0x368d('0x1b')]);}else{logger[_0x368d('0x14')](_0x368d('0x1c'),_0x3cfa0d,_0x368d('0x15'));_0xe76048(_0x5d9fb8[_0x368d('0x1d')]['message']);}})[_0x368d('0x1e')](function(_0x4e8867){logger['error'](_0x368d('0x1c'),_0x3cfa0d,_0x4e8867);_0x2bf4bb(_0x4e8867);});});}function respondWithStatusCode(_0x2f0c27,_0x3045ce){_0x3045ce=_0x3045ce||0xcc;return function(_0x511369){if(_0x511369){return _0x2f0c27['sendStatus'](_0x3045ce);}return _0x2f0c27[_0x368d('0x1f')](_0x3045ce)[_0x368d('0x20')]();};}function respondWithResult(_0x58188b,_0x57f535){_0x57f535=_0x57f535||0xc8;return function(_0x4a78be){if(_0x4a78be){return _0x58188b['status'](_0x57f535)[_0x368d('0x21')](_0x4a78be);}};}function respondWithFilteredResult(_0x5a74dc,_0x11ea62){return function(_0x392e85){if(_0x392e85){var _0x83f367=typeof _0x11ea62['offset']===_0x368d('0x22')&&typeof _0x11ea62['limit']===_0x368d('0x22');var _0x3892b7=_0x392e85[_0x368d('0x23')];var _0x7a0d3a=_0x83f367?0x0:_0x11ea62[_0x368d('0x24')];var _0x7b395a=_0x83f367?_0x392e85[_0x368d('0x23')]:_0x11ea62[_0x368d('0x24')]+_0x11ea62[_0x368d('0x25')];var _0x22fb16;if(_0x7b395a>=_0x3892b7){_0x7b395a=_0x3892b7;_0x22fb16=0xc8;}else{_0x22fb16=0xce;}_0x5a74dc['status'](_0x22fb16);return _0x5a74dc[_0x368d('0x26')](_0x368d('0x27'),_0x7a0d3a+'-'+_0x7b395a+'/'+_0x3892b7)[_0x368d('0x21')](_0x392e85);}return null;};}function saveUpdates(_0x5765f1){return function(_0x40fcc9){if(_0x40fcc9){return _0x40fcc9[_0x368d('0x28')](_0x5765f1)['then'](function(_0x574131){return _0x574131;});}return null;};}function removeEntity(_0x4a36c6){return function(_0x25d15e){if(_0x25d15e){return _0x25d15e[_0x368d('0x29')]()[_0x368d('0x13')](function(){var _0x226605=_0x25d15e['get']({'plain':!![]});var _0x2270e8=_0x368d('0x2a');return db[_0x368d('0x2b')][_0x368d('0x29')]({'where':{'type':_0x2270e8,'resourceId':_0x226605['id']}})['then'](function(){return _0x25d15e;});})['then'](function(){_0x4a36c6[_0x368d('0x1f')](0xcc)[_0x368d('0x20')]();});}};}function handleEntityNotFound(_0xfbc710){return function(_0x47f3b6){if(!_0x47f3b6){_0xfbc710[_0x368d('0x2c')](0x194);}return _0x47f3b6;};}function handleError(_0x34eca9,_0x5dfc26){_0x5dfc26=_0x5dfc26||0x1f4;return function(_0x24e989){logger[_0x368d('0x19')](_0x24e989[_0x368d('0x2d')]);if(_0x24e989['name']){delete _0x24e989[_0x368d('0x2e')];}_0x34eca9[_0x368d('0x1f')](_0x5dfc26)['send'](_0x24e989);};}function iftimePromise(_0x6dee69,_0x5b3bf1){return respondWithRpcPromise('Command','getSnippet',{'command':_0x5b3bf1[_0x368d('0x2f')]?util[_0x368d('0x30')]('iftime\x20%s,%s',_0x6dee69[_0x368d('0x31')],_0x5b3bf1[_0x368d('0x2f')]):util[_0x368d('0x30')](_0x368d('0x32'),_0x6dee69[_0x368d('0x31')])},client9002)['then'](function(_0x5a5cd5){var _0x59b915=_0x5a5cd5&&_0x5a5cd5['indexOf'](_0x368d('0x33'))>=0x0?!![]:![];logger[_0x368d('0x14')](_0x368d('0x34'),_0x5b3bf1['id'],_0x6dee69['id'],_0x6dee69[_0x368d('0x31')],_0x59b915?_0x368d('0x35'):'OFFLINE',_0x5b3bf1[_0x368d('0x2f')]?_0x5b3bf1[_0x368d('0x2f')]:_0x368d('0x36'));return _0x59b915;})[_0x368d('0x1e')](function(_0x1c8f95){logger[_0x368d('0x19')](_0x368d('0x34'),_0x5b3bf1['id'],_0x6dee69['id'],_0x6dee69[_0x368d('0x31')],util[_0x368d('0x37')](_0x1c8f95,{'showHidden':![],'depth':null}),_0x5b3bf1[_0x368d('0x2f')]?_0x5b3bf1['timezone']:_0x368d('0x36'));return![];});}function checkWebsiteIntervals(_0xba6d4b){var _0x3997d0=_[_0x368d('0x38')](_0xba6d4b[_0x368d('0x39')][_0x368d('0x3a')],function(_0xe8fee0){var _0x818a08=_0xe8fee0[_0x368d('0x3b')]({'plain':!![]});return iftimePromise(_0x818a08,_0xba6d4b);});return Promise['all'](_0x3997d0)[_0x368d('0x13')](function(_0x4140a4){return _[_0x368d('0x3c')](_0x4140a4);});}function createInteractionObject(_0x37cdea,_0x5a9fba,_0x4ee179,_0x51b7bb){var _0x44886d=require(_0x368d('0x3d'));var _0x3fdad7=new _0x44886d();var _0x5dcbae=_0x3fdad7[_0x368d('0x3e')](_0x4ee179[_0x368d('0x3f')])['getResult']();var _0x2b3c21=_0x5a9fba[_0x368d('0x40')];if(_0x4ee179[_0x368d('0x41')]){_0x2b3c21=_0x4ee179[_0x368d('0x41')];}else if(_0x4ee179[_0x368d('0x42')]){_0x2b3c21=_[_0x368d('0x43')](_0x4ee179[_0x368d('0x42')][_0x368d('0x44')](','));}return{'ContactId':_0x51b7bb['id'],'ChatWebsiteId':_0x37cdea,'from':(_0x51b7bb['firstName']||'')+'\x20'+(_0x51b7bb[_0x368d('0x45')]||''),'customerIp':_0x2b3c21,'customerPort':_0x4ee179['x-real-port']?_0x4ee179['x-real-port']:null,'referer':_0x5a9fba['referer'],'browserName':_0x5dcbae[_0x368d('0x46')][_0x368d('0x2e')]&&_0x5dcbae[_0x368d('0x46')]['version']?util[_0x368d('0x30')](_0x368d('0x47'),_0x5dcbae[_0x368d('0x46')][_0x368d('0x2e')],_0x5dcbae[_0x368d('0x46')][_0x368d('0x48')]):_0x368d('0x49'),'browserVersion':_0x5dcbae[_0x368d('0x46')][_0x368d('0x48')]||_0x368d('0x49'),'osName':util['format']('%s\x20%s',_0x5dcbae['os'][_0x368d('0x2e')],_0x5dcbae['os'][_0x368d('0x48')]),'osVersion':_0x5dcbae['os'][_0x368d('0x48')],'deviceModel':_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4b')]&&_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4c')]?util[_0x368d('0x30')]('%s\x20%s\x20%s',_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4b')],_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4c')],_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4d')]):null,'deviceVendor':_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4c')],'deviceType':_0x5dcbae[_0x368d('0x4a')][_0x368d('0x4d')],'formData':JSON[_0x368d('0x18')](_0x5a9fba)};}exports[_0x368d('0x4e')]=function(_0x47e1c8,_0x1600a3){var _0x351aa7={'include':[{'model':db[_0x368d('0x4f')],'as':_0x368d('0x50')}]},_0x4fd438={},_0x192de5={'count':0x0,'rows':[]};var _0x14cf2a=_[_0x368d('0x38')](db[_0x368d('0x51')][_0x368d('0x52')],function(_0x192253){return{'name':_0x192253['fieldName'],'type':_0x192253[_0x368d('0x4d')][_0x368d('0x53')]};});_0x4fd438[_0x368d('0x4b')]=_[_0x368d('0x38')](_0x14cf2a,_0x368d('0x2e'));_0x4fd438[_0x368d('0x54')]=_[_0x368d('0x55')](_0x47e1c8['query']);_0x4fd438['filters']=_[_0x368d('0x56')](_0x4fd438[_0x368d('0x4b')],_0x4fd438[_0x368d('0x54')]);_0x351aa7[_0x368d('0x57')]=_[_0x368d('0x56')](_0x4fd438[_0x368d('0x4b')],qs[_0x368d('0x58')](_0x47e1c8[_0x368d('0x54')][_0x368d('0x58')]));_0x351aa7[_0x368d('0x57')]=_0x351aa7[_0x368d('0x57')]['length']?_0x351aa7[_0x368d('0x57')]:_0x4fd438[_0x368d('0x4b')];if(!_0x47e1c8[_0x368d('0x54')][_0x368d('0x59')](_0x368d('0x5a'))){_0x351aa7[_0x368d('0x25')]=qs[_0x368d('0x25')](_0x47e1c8['query'][_0x368d('0x25')]);_0x351aa7[_0x368d('0x24')]=qs[_0x368d('0x24')](_0x47e1c8['query'][_0x368d('0x24')]);}_0x351aa7[_0x368d('0x5b')]=qs['sort'](_0x47e1c8[_0x368d('0x54')][_0x368d('0x5c')]);_0x351aa7['where']=qs[_0x368d('0x5d')](_[_0x368d('0x5e')](_0x47e1c8[_0x368d('0x54')],_0x4fd438[_0x368d('0x5d')]),_0x14cf2a);if(_0x47e1c8['query'][_0x368d('0x5f')]){_0x351aa7[_0x368d('0x60')]=_[_0x368d('0x61')](_0x351aa7[_0x368d('0x60')],{'$or':_[_0x368d('0x38')](_0x14cf2a,function(_0x31f756){if(_0x31f756['type']!==_0x368d('0x62')){var _0xf89911={};_0xf89911[_0x31f756[_0x368d('0x2e')]]={'$like':'%'+_0x47e1c8[_0x368d('0x54')]['filter']+'%'};return _0xf89911;}})});}_0x351aa7=_['merge']({},_0x351aa7,_0x47e1c8[_0x368d('0x63')]);var _0x53874a={'where':_0x351aa7[_0x368d('0x60')]};return db[_0x368d('0x51')][_0x368d('0x23')](_0x53874a)['then'](function(_0x425241){_0x192de5[_0x368d('0x23')]=_0x425241;if(_0x47e1c8[_0x368d('0x54')][_0x368d('0x64')]){_0x351aa7[_0x368d('0x65')]=[{'all':!![]}];}return db['ChatWebsite'][_0x368d('0x66')](_0x351aa7);})[_0x368d('0x13')](function(_0xd0b09a){_0x192de5[_0x368d('0x67')]=_0xd0b09a;return _0x192de5;})[_0x368d('0x13')](respondWithFilteredResult(_0x1600a3,_0x351aa7))[_0x368d('0x1e')](handleError(_0x1600a3,null));};exports['show']=function(_0x284a0a,_0xee339a){var _0x11b87b={'raw':![],'where':{'id':_0x284a0a[_0x368d('0x68')]['id']},'include':[{'model':db[_0x368d('0x4f')],'as':_0x368d('0x50')}]},_0x13cce4={};_0x13cce4[_0x368d('0x4b')]=_[_0x368d('0x55')](db['ChatWebsite']['rawAttributes']);_0x13cce4['query']=_[_0x368d('0x55')](_0x284a0a[_0x368d('0x54')]);_0x13cce4['filters']=_[_0x368d('0x56')](_0x13cce4[_0x368d('0x4b')],_0x13cce4[_0x368d('0x54')]);_0x11b87b['attributes']=_[_0x368d('0x56')](_0x13cce4[_0x368d('0x4b')],qs['fields'](_0x284a0a[_0x368d('0x54')][_0x368d('0x58')]));_0x11b87b[_0x368d('0x57')]=_0x11b87b['attributes']['length']?_0x11b87b[_0x368d('0x57')]:_0x13cce4[_0x368d('0x4b')];if(_0x284a0a['query'][_0x368d('0x64')]){_0x11b87b[_0x368d('0x65')]=[{'all':!![]}];}_0x11b87b=_['merge']({},_0x11b87b,_0x284a0a[_0x368d('0x63')]);return db[_0x368d('0x51')][_0x368d('0x69')](_0x11b87b)[_0x368d('0x13')](handleEntityNotFound(_0xee339a,null))[_0x368d('0x13')](respondWithResult(_0xee339a,null))['catch'](handleError(_0xee339a,null));};exports[_0x368d('0x6a')]=function(_0x53574b,_0x4a69f7){return db[_0x368d('0x51')][_0x368d('0x6a')](_0x53574b[_0x368d('0x6b')],{})[_0x368d('0x13')](function(_0x19107b){var _0x44b56a=_0x53574b[_0x368d('0x6c')][_0x368d('0x3b')]({'plain':!![]});if(!_0x44b56a)throw new Error(_0x368d('0x6d'));if(_0x44b56a[_0x368d('0x6e')]===_0x368d('0x6c')){var _0x305c97=_0x19107b[_0x368d('0x3b')]({'plain':!![]});var _0x3cef94='ChatWebsites';return db['UserProfileSection'][_0x368d('0x69')]({'where':{'name':_0x3cef94,'userProfileId':_0x44b56a['userProfileId']},'raw':!![]})[_0x368d('0x13')](function(_0x1fc582){if(_0x1fc582&&_0x1fc582['autoAssociation']===0x0){return db[_0x368d('0x2b')][_0x368d('0x6a')]({'name':_0x305c97[_0x368d('0x2e')],'resourceId':_0x305c97['id'],'type':_0x1fc582[_0x368d('0x2e')],'sectionId':_0x1fc582['id']},{})[_0x368d('0x13')](function(){return _0x19107b;});}else{return _0x19107b;}})[_0x368d('0x1e')](function(_0x757833){logger[_0x368d('0x19')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x757833);throw _0x757833;});}return _0x19107b;})[_0x368d('0x13')](respondWithResult(_0x4a69f7,0xc9))[_0x368d('0x1e')](handleError(_0x4a69f7,null));};exports[_0x368d('0x28')]=function(_0x5390e1,_0x32d358){if(_0x5390e1['body']['id']){delete _0x5390e1['body']['id'];}return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0x5390e1[_0x368d('0x68')]['id']},'include':[{'model':db['Pause'],'as':_0x368d('0x50')}]})['then'](handleEntityNotFound(_0x32d358,null))[_0x368d('0x13')](saveUpdates(_0x5390e1[_0x368d('0x6b')],null))['then'](respondWithResult(_0x32d358,null))[_0x368d('0x1e')](handleError(_0x32d358,null));};exports[_0x368d('0x29')]=function(_0x2c4409,_0x801ef9){return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0x2c4409[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x801ef9,null))['then'](removeEntity(_0x801ef9,null))['catch'](handleError(_0x801ef9,null));};exports[_0x368d('0x6f')]=function(_0x54b186,_0x33ed7e){return db[_0x368d('0x51')][_0x368d('0x6f')]()[_0x368d('0x13')](respondWithResult(_0x33ed7e,null))[_0x368d('0x1e')](handleError(_0x33ed7e,null));};exports[_0x368d('0x70')]=function(_0x33de20,_0xd32b9f){if(_0x33de20['body']['id']){delete _0x33de20[_0x368d('0x6b')]['id'];}return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0x33de20[_0x368d('0x68')]['id']}})['then'](handleEntityNotFound(_0xd32b9f,null))['then'](function(_0x570f7a){if(_0x570f7a){_0x33de20[_0x368d('0x6b')][_0x368d('0x71')]=_0x570f7a['id'];return db[_0x368d('0x72')][_0x368d('0x6a')](_0x33de20[_0x368d('0x6b')]);}})['then'](respondWithResult(_0xd32b9f,null))[_0x368d('0x1e')](handleError(_0xd32b9f,null));};exports[_0x368d('0x73')]=function(_0x277519,_0x129ebd){var _0x2e22bc={'raw':![],'where':{}};var _0x5750c5={};var _0x3dbcdb={'count':0x0,'rows':[]};return db[_0x368d('0x51')][_0x368d('0x74')]({'where':{'id':_0x277519['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x129ebd,null))['then'](function(_0x2c4b5a){if(_0x2c4b5a){_0x5750c5[_0x368d('0x4b')]=_[_0x368d('0x55')](db[_0x368d('0x72')][_0x368d('0x52')]);_0x5750c5[_0x368d('0x54')]=_[_0x368d('0x55')](_0x277519['query']);_0x5750c5['filters']=_[_0x368d('0x56')](_0x5750c5[_0x368d('0x4b')],_0x5750c5[_0x368d('0x54')]);_0x2e22bc[_0x368d('0x57')]=_[_0x368d('0x56')](_0x5750c5[_0x368d('0x4b')],qs[_0x368d('0x58')](_0x277519['query'][_0x368d('0x58')]));_0x2e22bc[_0x368d('0x57')]=_0x2e22bc[_0x368d('0x57')][_0x368d('0x75')]?_0x2e22bc[_0x368d('0x57')]:_0x5750c5[_0x368d('0x4b')];if(!_0x277519[_0x368d('0x54')]['hasOwnProperty'](_0x368d('0x5a'))){_0x2e22bc[_0x368d('0x25')]=qs['limit'](_0x277519[_0x368d('0x54')][_0x368d('0x25')]);_0x2e22bc['offset']=qs[_0x368d('0x24')](_0x277519[_0x368d('0x54')]['offset']);}_0x2e22bc[_0x368d('0x5b')]=qs[_0x368d('0x5c')](_0x277519[_0x368d('0x54')]['sort']);_0x2e22bc[_0x368d('0x60')]=qs['filters'](_[_0x368d('0x5e')](_0x277519[_0x368d('0x54')],_0x5750c5[_0x368d('0x5d')]));_0x2e22bc[_0x368d('0x60')]['ChatWebsiteId']=_0x2c4b5a['id'];if(_0x277519[_0x368d('0x54')]['filter']){_0x2e22bc[_0x368d('0x60')]=_[_0x368d('0x61')](_0x2e22bc[_0x368d('0x60')],{'$or':_[_0x368d('0x38')](_0x2e22bc[_0x368d('0x57')],function(_0x118013){var _0x2cd49c={};_0x2cd49c[_0x118013]={'$like':'%'+_0x277519['query'][_0x368d('0x5f')]+'%'};return _0x2cd49c;})});}_0x2e22bc=_[_0x368d('0x61')]({},_0x2e22bc,_0x277519[_0x368d('0x63')]);return db[_0x368d('0x72')][_0x368d('0x23')]({'where':_0x2e22bc[_0x368d('0x60')]})['then'](function(_0x276409){_0x3dbcdb[_0x368d('0x23')]=_0x276409;if(_0x277519[_0x368d('0x54')]['includeAll']){_0x2e22bc['include']=[{'all':!![]}];}return db[_0x368d('0x72')][_0x368d('0x66')](_0x2e22bc);})[_0x368d('0x13')](function(_0x4f70c5){_0x3dbcdb['rows']=_0x4f70c5;return _0x3dbcdb;});}})[_0x368d('0x13')](respondWithFilteredResult(_0x129ebd,_0x2e22bc))[_0x368d('0x1e')](handleError(_0x129ebd,null));};exports[_0x368d('0x76')]=function(_0x5cbce1,_0x1ae904){return db['ChatWebsite'][_0x368d('0x69')]({'where':{'id':_0x5cbce1['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x1ae904,null))[_0x368d('0x13')](function(_0x500b11){if(_0x500b11){return _0x500b11[_0x368d('0x76')](_0x5cbce1[_0x368d('0x54')][_0x368d('0x77')]);}})[_0x368d('0x13')](respondWithStatusCode(_0x1ae904,null))['catch'](handleError(_0x1ae904,null));};exports[_0x368d('0x78')]=function(_0x44c431,_0x565408){if(_0x44c431[_0x368d('0x6b')]['id']){delete _0x44c431[_0x368d('0x6b')]['id'];}return db['ChatWebsite'][_0x368d('0x69')]({'where':{'id':_0x44c431['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x565408,null))['then'](function(_0x2121c7){if(_0x2121c7){_0x44c431[_0x368d('0x6b')][_0x368d('0x71')]=_0x2121c7['id'];return db[_0x368d('0x79')][_0x368d('0x6a')](_0x44c431[_0x368d('0x6b')]);}})['then'](respondWithResult(_0x565408,null))[_0x368d('0x1e')](handleError(_0x565408,null));};exports[_0x368d('0x7a')]=function(_0x20d396,_0x571e8a){var _0x261f93={'raw':![],'where':{}};var _0x1eb4ea={};var _0x1bfa8f={'count':0x0,'rows':[]};return db[_0x368d('0x51')][_0x368d('0x74')]({'where':{'id':_0x20d396['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x571e8a,null))['then'](function(_0x8ca809){if(_0x8ca809){_0x1eb4ea[_0x368d('0x4b')]=_[_0x368d('0x55')](db[_0x368d('0x79')][_0x368d('0x52')]);_0x1eb4ea[_0x368d('0x54')]=_[_0x368d('0x55')](_0x20d396[_0x368d('0x54')]);_0x1eb4ea['filters']=_[_0x368d('0x56')](_0x1eb4ea[_0x368d('0x4b')],_0x1eb4ea[_0x368d('0x54')]);_0x261f93['attributes']=_[_0x368d('0x56')](_0x1eb4ea[_0x368d('0x4b')],qs['fields'](_0x20d396['query'][_0x368d('0x58')]));_0x261f93[_0x368d('0x57')]=_0x261f93['attributes'][_0x368d('0x75')]?_0x261f93['attributes']:_0x1eb4ea[_0x368d('0x4b')];if(!_0x20d396[_0x368d('0x54')][_0x368d('0x59')](_0x368d('0x5a'))){_0x261f93[_0x368d('0x25')]=qs[_0x368d('0x25')](_0x20d396[_0x368d('0x54')][_0x368d('0x25')]);_0x261f93['offset']=qs[_0x368d('0x24')](_0x20d396[_0x368d('0x54')][_0x368d('0x24')]);}_0x261f93[_0x368d('0x5b')]=qs[_0x368d('0x5c')](_0x20d396[_0x368d('0x54')]['sort']);_0x261f93['where']=qs['filters'](_['pick'](_0x20d396[_0x368d('0x54')],_0x1eb4ea[_0x368d('0x5d')]));_0x261f93[_0x368d('0x60')][_0x368d('0x71')]=_0x8ca809['id'];if(_0x20d396[_0x368d('0x54')][_0x368d('0x5f')]){_0x261f93[_0x368d('0x60')]=_['merge'](_0x261f93[_0x368d('0x60')],{'$or':_['map'](_0x261f93[_0x368d('0x57')],function(_0xb47839){var _0x5ee08a={};_0x5ee08a[_0xb47839]={'$like':'%'+_0x20d396[_0x368d('0x54')]['filter']+'%'};return _0x5ee08a;})});}_0x261f93=_[_0x368d('0x61')]({},_0x261f93,_0x20d396[_0x368d('0x63')]);return db[_0x368d('0x79')][_0x368d('0x23')]({'where':_0x261f93[_0x368d('0x60')]})['then'](function(_0x40e99d){_0x1bfa8f[_0x368d('0x23')]=_0x40e99d;if(_0x20d396[_0x368d('0x54')][_0x368d('0x64')]){_0x261f93[_0x368d('0x65')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x261f93);})[_0x368d('0x13')](function(_0x5c1237){_0x1bfa8f[_0x368d('0x67')]=_0x5c1237;return _0x1bfa8f;});}})[_0x368d('0x13')](respondWithFilteredResult(_0x571e8a,_0x261f93))[_0x368d('0x1e')](handleError(_0x571e8a,null));};exports['removeAnswers']=function(_0x95f640,_0x10dc03){return db['ChatWebsite'][_0x368d('0x69')]({'where':{'id':_0x95f640[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x10dc03,null))[_0x368d('0x13')](function(_0x5f2ff6){if(_0x5f2ff6){return _0x5f2ff6[_0x368d('0x7b')](_0x95f640[_0x368d('0x54')]['ids']);}})['then'](respondWithStatusCode(_0x10dc03,null))['catch'](handleError(_0x10dc03,null));};exports['addLogo']=function(_0x406878,_0x2bef6f){_0x406878[_0x368d('0x6b')]['sitepic']=_0x406878[_0x368d('0x7c')][_0x368d('0x7d')];return db[_0x368d('0x51')]['find']({'where':{'id':_0x406878[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x2bef6f,null))[_0x368d('0x13')](saveUpdates(_0x406878[_0x368d('0x6b')],null))[_0x368d('0x13')](respondWithResult(_0x2bef6f,null))[_0x368d('0x1e')](handleError(_0x2bef6f,null));};exports[_0x368d('0x7e')]=function(_0x37641d,_0x3fa229){_0x37641d[_0x368d('0x6b')][_0x368d('0x7f')]=_0x37641d[_0x368d('0x7c')][_0x368d('0x7d')];return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0x37641d['params']['id']}})['then'](handleEntityNotFound(_0x3fa229,null))[_0x368d('0x13')](saveUpdates(_0x37641d[_0x368d('0x6b')],null))[_0x368d('0x13')](respondWithResult(_0x3fa229,null))[_0x368d('0x1e')](handleError(_0x3fa229,null));};exports[_0x368d('0x80')]=function(_0xf5db50,_0x334c98){_0xf5db50['body'][_0x368d('0x81')]=_0xf5db50['file']['filename'];return db['ChatWebsite'][_0x368d('0x69')]({'where':{'id':_0xf5db50[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x334c98,null))[_0x368d('0x13')](saveUpdates(_0xf5db50['body'],null))['then'](respondWithResult(_0x334c98,null))[_0x368d('0x1e')](handleError(_0x334c98,null));};exports[_0x368d('0x82')]=function(_0x27a450,_0x253d31){_0x27a450['body'][_0x368d('0x83')]=_0x27a450[_0x368d('0x7c')][_0x368d('0x7d')];return db['ChatWebsite'][_0x368d('0x69')]({'where':{'id':_0x27a450[_0x368d('0x68')]['id']}})['then'](handleEntityNotFound(_0x253d31,null))[_0x368d('0x13')](saveUpdates(_0x27a450['body'],null))[_0x368d('0x13')](respondWithResult(_0x253d31,null))[_0x368d('0x1e')](handleError(_0x253d31,null));};exports[_0x368d('0x84')]=function(_0x1dae78,_0x2128a6){var _0x1a5456=path[_0x368d('0x85')](config[_0x368d('0x86')],'server/files/images/logos/default_logo.svg');var _0x5a3445={'where':{'id':_0x1dae78[_0x368d('0x68')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x1ec1d=![];return require(_0x368d('0x87'))[_0x368d('0x88')]()[_0x368d('0x13')](function(_0x16ba6e){if(_0x16ba6e){_0x1ec1d=_0x16ba6e['custom'];}})['then'](function(){return db[_0x368d('0x51')][_0x368d('0x69')](_0x5a3445);})[_0x368d('0x13')](handleEntityNotFound(_0x2128a6,null))[_0x368d('0x13')](function(_0x20d11a){if(_0x20d11a){if(!_[_0x368d('0x89')](_0x20d11a[_0x368d('0x8a')])){if(fs[_0x368d('0x8b')](path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0x8c'),_0x20d11a[_0x368d('0x8a')]))&&_0x1ec1d){_0x1a5456=path['join'](config[_0x368d('0x86')],_0x368d('0x8c'),_0x20d11a[_0x368d('0x8a')]);}}return _0x2128a6[_0x368d('0x8d')](_0x1a5456);}})[_0x368d('0x1e')](handleError(_0x2128a6,null));};exports[_0x368d('0x8e')]=function(_0x1758d1,_0x3ea983){var _0x2ebf24=path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0x8f'));var _0x1855d7={'where':{'id':_0x1758d1[_0x368d('0x68')]['id']},'attributes':['id',_0x368d('0x7f')],'raw':!![]};return db[_0x368d('0x51')]['find'](_0x1855d7)[_0x368d('0x13')](handleEntityNotFound(_0x3ea983,null))[_0x368d('0x13')](function(_0x595924){if(_0x595924){if(!_[_0x368d('0x89')](_0x595924[_0x368d('0x7f')])){if(fs[_0x368d('0x8b')](path['join'](config[_0x368d('0x86')],'server/files/images/avatars/',_0x595924[_0x368d('0x7f')]))){_0x2ebf24=path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0x90'),_0x595924['agentAvatar']);}}return _0x3ea983[_0x368d('0x8d')](_0x2ebf24);}})[_0x368d('0x1e')](handleError(_0x3ea983,null));};exports[_0x368d('0x91')]=function(_0xf20d97,_0x2c9841){var _0x342451=path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0x92'));var _0x5d6880={'where':{'id':_0xf20d97[_0x368d('0x68')]['id']},'attributes':['id',_0x368d('0x81'),_0x368d('0x93')],'raw':!![]};return db[_0x368d('0x51')][_0x368d('0x69')](_0x5d6880)[_0x368d('0x13')](handleEntityNotFound(_0x2c9841,null))[_0x368d('0x13')](function(_0x5c21fc){if(_0x5c21fc){if(!_[_0x368d('0x89')](_0x5c21fc[_0x368d('0x81')])){if(fs[_0x368d('0x8b')](path['join'](config[_0x368d('0x86')],_0x368d('0x90'),_0x5c21fc[_0x368d('0x81')]))&&_0x5c21fc['showCustomerAvatar']){_0x342451=path[_0x368d('0x85')](config[_0x368d('0x86')],'server/files/images/avatars/',_0x5c21fc[_0x368d('0x81')]);}}return _0x2c9841[_0x368d('0x8d')](_0x342451);}})[_0x368d('0x1e')](handleError(_0x2c9841,null));};exports['getSystemAvatar']=function(_0x12740d,_0x4c4b58){var _0x435ed0=path[_0x368d('0x85')](config['root'],_0x368d('0x94'));var _0x416a5c={'where':{'id':_0x12740d['params']['id']},'attributes':['id',_0x368d('0x83')],'raw':!![]};return db[_0x368d('0x51')][_0x368d('0x69')](_0x416a5c)['then'](handleEntityNotFound(_0x4c4b58,null))[_0x368d('0x13')](function(_0x4339f1){if(_0x4339f1){if(!_[_0x368d('0x89')](_0x4339f1['systemAvatar'])){if(fs['existsSync'](path['join'](config[_0x368d('0x86')],_0x368d('0x90'),_0x4339f1[_0x368d('0x83')]))){_0x435ed0=path[_0x368d('0x85')](config['root'],'server/files/images/avatars/',_0x4339f1['systemAvatar']);}}return _0x4c4b58[_0x368d('0x8d')](_0x435ed0);}})['catch'](handleError(_0x4c4b58,null));};exports[_0x368d('0x95')]=function(_0xe98bd0,_0x165968){var _0x194f2b={'body':_0xe98bd0['body'],'channel':_0x368d('0x96')};var _0x255010=[];var _0x447a37=[];var _0x365c23={};var _0x5d1336=![];return db[_0x368d('0x97')][_0x368d('0x6f')]()['then'](function(_0x1f2ac1){if(!_0x1f2ac1){throw new db[(_0x368d('0x98'))][(_0x368d('0x99'))](_0x368d('0x9a'));}_0x255010=_[_0x368d('0x9b')](_['keys'](_0x1f2ac1),['createdAt',_0x368d('0x9c')]);_0x447a37=_[_0x368d('0x9b')](_['keys'](_0x1f2ac1),[_0x368d('0x9d'),'updatedAt',_0x368d('0x9e'),_0x368d('0x9f')]);if(_0xe98bd0['body']['id']){delete _0xe98bd0['body']['id'];}if(_[_0x368d('0x89')](_0xe98bd0[_0x368d('0x6b')][_0x368d('0xa0')])){throw new db[(_0x368d('0x98'))][(_0x368d('0x99'))](_0x368d('0xa1'));}if(_[_0x368d('0x89')](_0xe98bd0[_0x368d('0x6b')][_0x368d('0x6b')])||_0xe98bd0[_0x368d('0x6b')][_0x368d('0x6b')]===''){throw new db['Sequelize'][(_0x368d('0x99'))](_0x368d('0xa2'));}if(_['isNil'](_0xe98bd0[_0x368d('0x6b')][_0x368d('0xa3')])){throw new db[(_0x368d('0x98'))][(_0x368d('0x99'))](_0x368d('0xa4')+_0x447a37);}if(!_[_0x368d('0xa5')](_0x447a37,_0xe98bd0[_0x368d('0x6b')][_0x368d('0xa3')])){throw new db[(_0x368d('0x98'))][(_0x368d('0x99'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x447a37);}_0x365c23[_0xe98bd0[_0x368d('0x6b')]['mapKey']]=_0xe98bd0[_0x368d('0x6b')][_0x368d('0xa0')];})[_0x368d('0x13')](function(){return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0xe98bd0[_0x368d('0x68')]['id']},'include':[{'model':db[_0x368d('0xa6')],'as':_0x368d('0xa7'),'include':[{'model':db[_0x368d('0x97')],'as':_0x368d('0xa8'),'where':_0x365c23,'limit':0x1,'order':[[_0x368d('0x9c'),_0x368d('0xa9')]]}]},{'model':db[_0x368d('0xaa')],'as':_0x368d('0xab')},{'model':db[_0x368d('0x39')],'as':'Interval','include':[{'model':db[_0x368d('0x39')],'as':_0x368d('0x3a'),'attributes':['id',_0x368d('0x31')],'raw':!![]}]}]});})[_0x368d('0x13')](function(_0x560b0f){if(!_0x560b0f)throw new APINotFoundError(util[_0x368d('0x30')](_0x368d('0xac'),_0xe98bd0[_0x368d('0x68')]['id']));if(!_0x560b0f[_0x368d('0x39')]||!_0x560b0f[_0x368d('0x39')][_0x368d('0x3a')])return[_0x560b0f,!![]];return[_0x560b0f,checkWebsiteIntervals(_0x560b0f)];})[_0x368d('0xad')](function(_0x36fc61,_0x38a053){if(!_0x38a053)throw new APIOutOfIntervalError();if(!_0x36fc61['List'])return;_0x194f2b[_0x368d('0xae')]=_0x36fc61;_0x194f2b['list']=_0x36fc61[_0x368d('0xa7')];_0x194f2b['applications']=_[_0x368d('0xaf')](_0x36fc61[_0x368d('0xab')],[_0x368d('0xb0')],['asc']);if(_0x194f2b['account'][_0x368d('0xab')]){delete _0x194f2b['account']['Applications'];}if(_0x194f2b[_0x368d('0xae')][_0x368d('0xa7')]&&_0x194f2b['account'][_0x368d('0xa7')]['Contacts'][_0x368d('0x75')]){return _0x194f2b['account']['List']['Contacts'][0x0];}var _0x234eef=_[_0x368d('0xd')](_0xe98bd0['body'],{'firstName':_0xe98bd0['body'][_0x368d('0xa0')],'ListId':_0x36fc61[_0x368d('0x9f')]});_0x234eef[_0xe98bd0[_0x368d('0x6b')][_0x368d('0xa3')]]=_0xe98bd0['body'][_0x368d('0xa0')];return db['CmContact']['create'](_0x234eef,{'fields':_0x255010,'raw':!![]});})['then'](function(_0x323b05){_0x194f2b['contact']=_0x323b05;var _0x1510b3=createInteractionObject(_0xe98bd0['params']['id'],_0xe98bd0[_0x368d('0x6b')],_0xe98bd0[_0x368d('0xb1')],_0x323b05);var _0x6169d4={'ChatWebsiteId':_0xe98bd0[_0x368d('0x68')]['id'],'closed':![]};if(_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb2')]){_0x6169d4[_0x368d('0xb2')]=_0xe98bd0['body'][_0x368d('0xb2')];return db[_0x368d('0xb3')][_0x368d('0x69')]({'where':_0x6169d4})['then'](function(_0xef4bc7){if(_0xef4bc7){_0x5d1336=!![];return _0xef4bc7;}_0x1510b3[_0x368d('0xb2')]=_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb2')];_0x1510b3[_0x368d('0xb4')]=_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb4')];return db[_0x368d('0xb3')][_0x368d('0x6a')](_0x1510b3);});}_0x6169d4[_0x368d('0xb5')]=_0x323b05['id'];if(_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb6')]&&_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb6')]['id']){_0x6169d4['id']=_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb6')]['id'];return db['ChatInteraction'][_0x368d('0x69')]({'where':_0x6169d4})[_0x368d('0x13')](function(_0x2f2f49){if(_0x2f2f49){_0x5d1336=!![];return _0x2f2f49;}return db[_0x368d('0xb3')]['create'](_0x1510b3);});}return db[_0x368d('0xb3')]['create'](_0x1510b3);})[_0x368d('0x13')](function(_0x5eb216){if(!_0x5d1336)return _0x5eb216;var _0x13a446={'from':(_0x194f2b[_0x368d('0xb7')]['firstName']||'')+'\x20'+(_0x194f2b[_0x368d('0xb7')][_0x368d('0x45')]||'')};if(_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb2')]&&_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb8')]&&_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb2')]!=_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb8')]){_0x13a446[_0x368d('0xb2')]=_0xe98bd0[_0x368d('0x6b')][_0x368d('0xb8')];}return _0x5eb216['update'](_0x13a446);})[_0x368d('0x13')](function(_0x3746a3){_0x194f2b[_0x368d('0xb6')]=_0x3746a3[_0x368d('0x3b')]({'plain':!![]});_0x194f2b[_0x368d('0xb6')][_0x368d('0xb9')]=!_0x5d1336;if(_0x194f2b['interaction'][_0x368d('0xb9')]){if(_0x194f2b['account'][_0x368d('0xba')]){_0x194f2b[_0x368d('0xbb')][_0x368d('0xbc')]({'id':0x0,'priority':_0x194f2b['applications'][_0x368d('0x75')]+0x1,'app':'close','appdata':_0x368d('0xbd'),'interval':'*,*,*,*'});}}return db[_0x368d('0xbe')][_0x368d('0x6a')]({'body':_0xe98bd0[_0x368d('0x6b')]['body'],'ChatWebsiteId':_0xe98bd0[_0x368d('0x68')]['id'],'ChatInteractionId':_0x3746a3['id'],'direction':'in','ContactId':_0x194f2b[_0x368d('0xb7')]['id'],'AttachmentId':_0xe98bd0['body'][_0x368d('0xbf')]});})[_0x368d('0x13')](function(_0x2ce761){_0x194f2b['message']=_0x2ce761;if(!_0x194f2b['interaction'][_0x368d('0xc0')]){return;}return db[_0x368d('0xc1')][_0x368d('0x69')]({'attributes':['id','name'],'where':{'id':_0x194f2b[_0x368d('0xb6')][_0x368d('0xc0')]}});})[_0x368d('0x13')](function(_0x521c69){if(_0x521c69){_0x194f2b['applications'][_0x368d('0xc2')]({'id':0x0,'priority':0x0,'app':_0x368d('0xc3'),'appdata':_0x521c69[_0x368d('0x2e')]+','+(_0x194f2b[_0x368d('0xae')][_0x368d('0xc4')]||0xa),'interval':_0x368d('0xc5')});_0x194f2b[_0x368d('0xc6')]=!![];}if(!_0x194f2b['interaction']['queueId']){return;}return db[_0x368d('0xc7')]['find']({'attributes':['id',_0x368d('0x2e')],'where':{'id':_0x194f2b[_0x368d('0xb6')][_0x368d('0xc8')]}});})[_0x368d('0x13')](function(_0x856bb0){if(_0x856bb0){_0x194f2b[_0x368d('0xbb')][_0x368d('0xc2')]({'id':0x0,'priority':0x1,'app':_0x368d('0xc9'),'appdata':_0x856bb0[_0x368d('0x2e')]+','+(_0x194f2b['account'][_0x368d('0xca')]||0x12c),'interval':_0x368d('0xc5')});}return respondWithRpcPromise(_0x368d('0xcb'),'startRouting',_0x194f2b);})[_0x368d('0x13')](function(_0x116886){respondWithRpcPromise(_0x368d('0xcc'),'EventManager',{'event':_0x368d('0x95'),'message':_0x116886},client9002);return _0x116886;})[_0x368d('0x13')](respondWithResult(_0x165968,null))[_0x368d('0x1e')](APIHandleError(_0x165968));};exports['offline']=function(_0x3c9811,_0x23411b){var _0x48d290,_0x16afc3,_0x18e559;var _0x4c855e=[];var _0x4f3429={};var _0x15a495=_0x3c9811['files']||[];var _0xe00e05=[];var _0x46a844;return db[_0x368d('0x97')][_0x368d('0x6f')]()[_0x368d('0x13')](function(_0x157b87){if(!_0x157b87){throw new db['Sequelize']['ValidationError'](_0x368d('0x9a'));}_0x4c855e=_[_0x368d('0x9b')](_['keys'](_0x157b87),[_0x368d('0x9d'),'updatedAt',_0x368d('0x9e'),_0x368d('0x9f')]);if(_0x3c9811['body']['id']){delete _0x3c9811[_0x368d('0x6b')]['id'];}if(_[_0x368d('0x89')](_0x3c9811[_0x368d('0x6b')][_0x368d('0xa0')])){throw _0x23411b[_0x368d('0x1f')](0x1f4)[_0x368d('0xcd')](new db[(_0x368d('0x98'))]['ValidationError'](_0x368d('0xa1')));}if(_[_0x368d('0x89')](_0x3c9811[_0x368d('0x6b')][_0x368d('0x6b')])||_0x3c9811[_0x368d('0x6b')]['body']===''){throw _0x23411b['status'](0x1f4)[_0x368d('0xcd')](new db['Sequelize'][(_0x368d('0x99'))](_0x368d('0xa2')));}if(_[_0x368d('0x89')](_0x3c9811['body'][_0x368d('0xce')])){throw _0x23411b['status'](0x1f4)[_0x368d('0xcd')](new db[(_0x368d('0x98'))]['ValidationError'](_0x368d('0xcf')+_0x4c855e));}if(!_[_0x368d('0xa5')](_0x4c855e,_0x3c9811[_0x368d('0x6b')][_0x368d('0xce')])){throw _0x23411b[_0x368d('0x1f')](0x1f4)['send'](new db[(_0x368d('0x98'))][(_0x368d('0x99'))](_0x368d('0xd0')+_0x4c855e));}_0x4f3429[_0x3c9811['body'][_0x368d('0xce')]]=_0x3c9811[_0x368d('0x6b')]['from'];})[_0x368d('0x13')](function(){return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0x3c9811[_0x368d('0x68')]['id']},'include':[{'model':db[_0x368d('0xa6')],'as':_0x368d('0xa7')},{'model':db[_0x368d('0xd1')],'as':_0x368d('0xd1')}]});})[_0x368d('0x13')](handleEntityNotFound(_0x23411b,null))[_0x368d('0x13')](function(_0x485a26){if(_0x485a26&&_0x485a26[_0x368d('0xa7')]){_0x16afc3=_0x485a26;var _0x31af7b=_[_0x368d('0xd')](_0x3c9811[_0x368d('0x6b')],{'firstName':_0x3c9811[_0x368d('0x6b')][_0x368d('0xa0')],'phone':_0x3c9811['body'][_0x368d('0xa0')],'ListId':_0x485a26['ListId']});_0x31af7b[_0x3c9811[_0x368d('0x6b')][_0x368d('0xce')]]=_0x3c9811[_0x368d('0x6b')][_0x368d('0xa0')];return db[_0x368d('0x97')]['findOrCreate']({'where':_0x4f3429,'defaults':_0x31af7b});}})[_0x368d('0xad')](function(_0x30a2a4){if(_0x30a2a4){_0x18e559=_0x30a2a4;var _0x3dcd76=fs[_0x368d('0xd2')](path['join'](config['root'],_0x368d('0xd3')),'utf8');var _0x25e698=ejs[_0x368d('0xd4')](_0x3dcd76,{'body':_[_0x368d('0xd5')](_0x3c9811[_0x368d('0x6b')][_0x368d('0x6b')]),'bodyTitle':_0x16afc3['offlineMessageBody']});return db[_0x368d('0xd6')][_0x368d('0x6a')]({'body':_0x25e698,'plainBody':htmlToText[_0x368d('0xd7')](_0x25e698),'ContactId':_0x30a2a4['id'],'ChatWebsiteId':_0x16afc3['id']});}})[_0x368d('0x13')](function(_0x4e96e9){_0x46a844=_0x4e96e9;if(_0x15a495[_0x368d('0x75')]){var _0x4072ee=_0x15a495[_0x368d('0x38')](function(_0x58a4bb){return{'name':_0x58a4bb[_0x368d('0xd8')],'basename':_0x58a4bb[_0x368d('0x7d')],'type':_0x58a4bb[_0x368d('0xd9')],'ChatOfflineMessageId':_0x4e96e9['id']};});_0xe00e05=_0x4072ee['map'](_0x2f4357=>{var _0xf9b1ad={'filename':_0x2f4357['name'],'path':path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0xda'),_0x368d('0xdb'),_0x368d('0xdc'),_0x368d('0xdd'),_0x2f4357['basename'])};return _0xf9b1ad;});if(!_0x16afc3[_0x368d('0xde')]){return db['sequelize'][_0x368d('0xdf')](function(_0x441d28){return db[_0x368d('0xe0')]['bulkCreate'](_0x4072ee,{'transaction':_0x441d28});});}}})['then'](function(){if(_0x46a844){_0x48d290=_0x46a844;return db[_0x368d('0xd1')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x368d('0xe1')],'as':_0x368d('0xe2'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':_0x368d('0xe3'),'raw':!![]}]}]});}})[_0x368d('0x13')](function(_0x4151e4){if(_0x4151e4&&_0x4151e4['Smtp']&&_0x16afc3['forwardOffline']&&_0x16afc3[_0x368d('0xe4')]){var _0x49818f=_0x4151e4[_0x368d('0xe5')]();return respondWithRpcPromise(_0x368d('0xe6'),_0x368d('0xe7'),{'account':_0x49818f,'message':{'from':util[_0x368d('0x30')](_0x368d('0xe8'),_0x4151e4[_0x368d('0x2e')],_0x4151e4[_0x368d('0xe9')]||_0x4151e4[_0x368d('0xe2')][_0x368d('0x6c')]),'to':_0x16afc3[_0x368d('0xe4')],'subject':_0x16afc3[_0x368d('0xea')],'html':_0x48d290[_0x368d('0x6b')],'attachments':_0xe00e05}},client9003)[_0x368d('0x13')](function(){return _0x48d290;})[_0x368d('0x1e')](function(_0x7106c7){logger[_0x368d('0x19')](_0x7106c7);});}})['then'](function(){if(_0x16afc3&&_0x16afc3['openNewInteraction']&&_0x16afc3['MailAccountId']){var _0x517e25=[];if(_0x15a495[_0x368d('0x75')]){_0x517e25=_0x15a495[_0x368d('0x38')](function(_0x42947b){return{'name':_0x42947b['originalname'],'basename':_0x42947b[_0x368d('0x7d')],'type':_0x42947b[_0x368d('0xd9')],'ChatOfflineMessageId':_0x46a844['id']};});}var _0x243a16;if(!_[_0x368d('0x89')](_0x16afc3[_0x368d('0xeb')])){var _0x5dce8b=_[_0x368d('0x38')](_0x3c9811[_0x368d('0x6b')],function(_0x494f63){return _0x494f63;});var _0x27bf4e=_['toPairsIn'](_0x5dce8b)[0x0];var _0x430c7c=_[_0x368d('0xec')](_0x27bf4e,function(_0x564a9f){return _0x564a9f;});_0x243a16=_0x430c7c[0x1][_0x16afc3['subjectOffline']];}var _0xad0dd7={'from':_0x18e559['email'],'firstName':_0x18e559[_0x368d('0xed')],'lastName':_0x18e559[_0x368d('0x45')],'mapKey':_0x368d('0xe9'),'message':{'from':_0x18e559[_0x368d('0xe9')],'to':_0x16afc3[_0x368d('0xd1')][_0x368d('0xe9')],'cc':'','subject':_[_0x368d('0x89')](_0x243a16)?_0x16afc3['offlineMessageSubject']:_0x243a16,'messageId':'','sentAt':new Date(),'attach':_0x517e25[_0x368d('0x75')],'attachments':_0x517e25,'originChannel':'Chat','ChatWebsiteId':_0x16afc3['id'],'ChatOfflineMessageId':_0x48d290['id'],'originTo':_0x16afc3[_0x368d('0xd1')][_0x368d('0xe9')]},'body':_0x48d290[_0x368d('0x6b')]};var _0x725a73={'account':{'id':_0x16afc3[_0x368d('0xee')]},'body':_0xad0dd7,'log':_0x368d('0xef')};return respondWithRpcPromise(_0x368d('0xef'),_0x368d('0xf0'),_0x725a73,client9001)[_0x368d('0x13')](function(){return _0x48d290;})['catch'](function(_0x115006){logger['error'](_0x115006);});}return;})[_0x368d('0x13')](function(){if(_0x48d290){return _0x48d290;}})[_0x368d('0x13')](respondWithResult(_0x23411b,null))[_0x368d('0x1e')](function(){for(var _0x326ad4 of _0x15a495){var _0x5d1eb9=path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0xda'),'files',_0x368d('0xdc'),_0x368d('0xdd'),_0x326ad4['filename']);fs_extra[_0x368d('0xf1')](_0x5d1eb9)[_0x368d('0x1e')](function(_0x6a377f){logger[_0x368d('0x19')](_0x368d('0xf2'),_0x5d1eb9,_0x6a377f);});}});};exports[_0x368d('0xf3')]=function(_0x3f262a,_0x48b934){return db[_0x368d('0xb3')][_0x368d('0x69')]({'where':{'id':_0x3f262a[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x48b934,null))[_0x368d('0x13')](function(_0x5e025f){if(_0x5e025f){return _0x5e025f['addInteraction'](_0x3f262a['body'][_0x368d('0x77')],_[_0x368d('0xf4')](_0x3f262a[_0x368d('0x6b')],[_0x368d('0x77'),'id'])||{});}})['then'](respondWithResult(_0x48b934,null))[_0x368d('0x1e')](handleError(_0x48b934,null));};exports[_0x368d('0xf5')]=function(_0x98f340,_0x1dc7d9){var _0x427cad={'raw':![],'where':{}};var _0x55298a={};var _0x2aff4b={'count':0x0,'rows':[]};return db[_0x368d('0x51')][_0x368d('0x74')]({'where':{'id':_0x98f340[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x1dc7d9,null))[_0x368d('0x13')](function(_0x46d86b){if(_0x46d86b){_0x55298a['model']=_[_0x368d('0x55')](db[_0x368d('0xb3')][_0x368d('0x52')]);_0x55298a[_0x368d('0x54')]=_['keys'](_0x98f340[_0x368d('0x54')]);_0x55298a[_0x368d('0x5d')]=_[_0x368d('0x56')](_0x55298a[_0x368d('0x4b')],_0x55298a[_0x368d('0x54')]);_0x427cad[_0x368d('0x57')]=_[_0x368d('0x56')](_0x55298a[_0x368d('0x4b')],qs[_0x368d('0x58')](_0x98f340[_0x368d('0x54')][_0x368d('0x58')]));_0x427cad[_0x368d('0x57')]=_0x427cad[_0x368d('0x57')][_0x368d('0x75')]?_0x427cad[_0x368d('0x57')]:_0x55298a[_0x368d('0x4b')];if(!_0x98f340[_0x368d('0x54')][_0x368d('0x59')]('nolimit')){_0x427cad['limit']=qs[_0x368d('0x25')](_0x98f340[_0x368d('0x54')][_0x368d('0x25')]);_0x427cad[_0x368d('0x24')]=qs[_0x368d('0x24')](_0x98f340[_0x368d('0x54')][_0x368d('0x24')]);}_0x427cad[_0x368d('0x5b')]=qs[_0x368d('0x5c')](_0x98f340['query'][_0x368d('0x5c')]);_0x427cad['where']=qs[_0x368d('0x5d')](_['pick'](_0x98f340[_0x368d('0x54')],_0x55298a['filters']));_0x427cad['where'][_0x368d('0x71')]=_0x46d86b['id'];if(_0x98f340[_0x368d('0x54')][_0x368d('0x5f')]){_0x427cad['where']=_[_0x368d('0x61')](_0x427cad[_0x368d('0x60')],{'$or':_[_0x368d('0x38')](_0x427cad[_0x368d('0x57')],function(_0x1af941){var _0x3b3f3c={};_0x3b3f3c[_0x1af941]={'$like':'%'+_0x98f340[_0x368d('0x54')][_0x368d('0x5f')]+'%'};return _0x3b3f3c;})});}_0x427cad=_[_0x368d('0x61')]({},_0x427cad,_0x98f340[_0x368d('0x63')]);return db[_0x368d('0xb3')][_0x368d('0x23')]({'where':_0x427cad[_0x368d('0x60')]})[_0x368d('0x13')](function(_0x3b6324){_0x2aff4b[_0x368d('0x23')]=_0x3b6324;if(_0x98f340[_0x368d('0x54')][_0x368d('0x64')]){_0x427cad['include']=[{'model':db['CmContact'],'as':_0x368d('0xf6'),'required':![]},{'model':db['User'],'as':_0x368d('0xf7'),'attributes':[_0x368d('0x2e'),'fullname',_0x368d('0xf8')],'required':![]},{'model':db[_0x368d('0xf9')],'as':_0x368d('0xfa'),'attributes':['id',_0x368d('0x2e'),'color'],'where':_0x98f340['query']['tag']?{'id':_0x98f340[_0x368d('0x54')][_0x368d('0xfb')]}:undefined,'required':_0x98f340[_0x368d('0x54')][_0x368d('0xfb')]?!![]:![]}];}return db[_0x368d('0xb3')]['findAll'](_0x427cad);})[_0x368d('0x13')](function(_0xa9579a){_0x2aff4b['rows']=_0xa9579a;return _0x2aff4b;});}})['then'](respondWithFilteredResult(_0x1dc7d9,_0x427cad))[_0x368d('0x1e')](handleError(_0x1dc7d9,null));};exports[_0x368d('0xfc')]=function(_0x5b1872,_0x5a2262){var _0x1a45e6=0x0;var _0x19e97b=0x0;var _0x6df64e=![];var _0x5aec8f;var _0x1343d4;return db[_0x368d('0x51')][_0x368d('0x69')]({'where':{'id':_0x5b1872['params']['id']},'include':[{'model':db[_0x368d('0x39')],'as':_0x368d('0x39'),'include':[{'model':db['Interval'],'as':_0x368d('0x3a'),'attributes':['id',_0x368d('0x31')]}]}]})[_0x368d('0x13')](handleEntityNotFound(_0x5a2262,null))[_0x368d('0x13')](function(_0x4acc37){if(_0x4acc37){_0x5aec8f=_0x4acc37;return _0x4acc37[_0x368d('0xfd')]({'raw':!![]});}})[_0x368d('0x13')](function(_0x28e8d2){if(_0x5aec8f){if(_0x28e8d2){_0x1343d4=_0x28e8d2;}}return require(_0x368d('0x87'))['getLicense']();})[_0x368d('0x13')](function(_0x3c13d6){if(_0x3c13d6){_0x19e97b=_0x3c13d6['virtual'];_0x6df64e=_0x3c13d6[_0x368d('0xfe')];}})['then'](function(){return db[_0x368d('0xb3')][_0x368d('0x23')]({'where':{'closed':![]}});})[_0x368d('0x13')](function(_0x45f960){_0x1a45e6=_0x45f960;if(_0x19e97b&&_0x45f960>_0x19e97b){return db[_0x368d('0xff')][_0x368d('0x74')]({'where':{'id':0x1}})[_0x368d('0x13')](function(_0x4ca354){if(_0x4ca354){_0x4ca354[_0x368d('0x100')](_0x368d('0x101'));}});}})[_0x368d('0x13')](function(){if(!_0x5aec8f[_0x368d('0x39')]||!_0x5aec8f['Interval'][_0x368d('0x3a')])return!![];return checkWebsiteIntervals(_0x5aec8f);})[_0x368d('0x13')](function(_0x32521d){var _0x3edcdf=fs[_0x368d('0xd2')](path[_0x368d('0x85')](config[_0x368d('0x86')],_0x368d('0x102')),_0x368d('0x103'));var _0x5228a5=new url['URL'](_0x5aec8f[_0x368d('0x104')])['origin'];var _0x2ed7a8=_0x368d('0x105');var _0xdf9ed2=![];var _0x42886c={'chatVersion':_0x2ed7a8,'chatWebsiteAddressOrigin':_0x5228a5,'remote':_0x5aec8f['remote'],'query':querystring['stringify'](_[_0x368d('0x61')](_0x5aec8f['get']({'plain':!![]}),{'customerIp':_0x5b1872[_0x368d('0xb1')]['x-forwarded-for']||_0x5b1872['headers']['x-real-ip']||_0x5b1872['connection'][_0x368d('0x106')]||_0x5b1872['ip'],'referer':_0x5b1872[_0x368d('0xb1')]['referer'],'openedInteractions':_0x1a45e6,'maxInteractions':_0x19e97b,'virtual':_0x6df64e[_0x368d('0x107')],'online':_0x32521d,'custom':_0x6df64e}))['replace'](/'/g,'\x5c\x27')};_0x5a2262[_0x368d('0xcd')](ejs[_0x368d('0xd4')](Mustache['render'](_0x3edcdf,_0x42886c),{'proactiveActions':_0x1343d4,'alignment':_0x5aec8f['alignment'],'verticalAlignment':_0x5aec8f[_0x368d('0x108')],'div_color':_0x5aec8f[_0x368d('0x109')],'labelText':_0x5aec8f['labelText'],'text_color':_0x5aec8f[_0x368d('0x10a')],'text_button_color':_0x5aec8f[_0x368d('0x10b')],'button_color':_0x5aec8f['color_button'],'background_color':_0x5aec8f[_0x368d('0x10c')],'hideWhenOffline':_0x5aec8f[_0x368d('0x10d')],'intervalId':_0x5aec8f[_0x368d('0x10e')],'isDevelopment':_0xdf9ed2,'chatVersion':_0x2ed7a8}));})[_0x368d('0x1e')](handleError(_0x5a2262,null));};exports['addApplications']=function(_0x2e022a,_0x41f8ec){var _0x5cff33=_0x2e022a[_0x368d('0x68')]['id'];var _0x4934a3=_0x2e022a['body'];var _0x236e55=0xc8;var _0x2145fd=null;return db[_0x368d('0x10f')]['transaction']({'isolationLevel':db['sequelize'][_0x368d('0x110')][_0x368d('0x111')][_0x368d('0x112')]},function(_0x179932){return db[_0x368d('0x51')][_0x368d('0x74')]({'where':{'id':_0x5cff33},'transaction':_0x179932})[_0x368d('0x13')](function(_0x5f2adc){if(_0x5f2adc){return db[_0x368d('0xaa')][_0x368d('0x29')]({'where':{'ChatWebsiteId':_0x5cff33},'transaction':_0x179932})['then'](function(){var _0x52a19b=_[_0x368d('0x38')](_0x4934a3,function(_0x75dd16){_0x75dd16['ChatWebsiteId']=_0x5cff33;return _0x75dd16;});return db[_0x368d('0xaa')]['bulkCreate'](_0x52a19b,{'transaction':_0x179932});});}else{_0x236e55=0x194;_0x2145fd=[];}});})[_0x368d('0x13')](function(){if(_0x236e55!==0x194){return db[_0x368d('0xaa')][_0x368d('0x113')]({'where':{'ChatWebsiteId':_0x5cff33},'order':_0x368d('0xb0')})[_0x368d('0x13')](function(_0x1ea042){_0x2145fd=_0x1ea042;});}})[_0x368d('0x1e')](function(_0x8c77a7){_0x236e55=0x1f4;logger['error'](_0x8c77a7[_0x368d('0x2d')]);if(_0x8c77a7['name']){delete _0x8c77a7[_0x368d('0x2e')];}_0x2145fd=_0x8c77a7;})['finally'](function(){if(_0x2145fd===null){_0x41f8ec[_0x368d('0x2c')](_0x236e55);}else{if(_0x236e55===0x1f4){_0x41f8ec[_0x368d('0x1f')](_0x236e55)[_0x368d('0xcd')](_0x2145fd);}else{_0x41f8ec['status'](_0x236e55)[_0x368d('0x21')](_0x2145fd);}}});};exports['getApplications']=function(_0x399c96,_0x20f87e){var _0x182e84={};var _0x59286f={};var _0x19d477;var _0x4e623c;return db[_0x368d('0x51')][_0x368d('0x74')]({'where':{'id':_0x399c96['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x20f87e,null))[_0x368d('0x13')](function(_0x3d19f6){if(_0x3d19f6){_0x19d477=_0x3d19f6;_0x59286f[_0x368d('0x4b')]=_[_0x368d('0x55')](db[_0x368d('0xaa')][_0x368d('0x52')]);_0x59286f[_0x368d('0x54')]=_[_0x368d('0x55')](_0x399c96['query']);_0x59286f[_0x368d('0x5d')]=_[_0x368d('0x56')](_0x59286f[_0x368d('0x4b')],_0x59286f[_0x368d('0x54')]);_0x182e84[_0x368d('0x57')]=_[_0x368d('0x56')](_0x59286f[_0x368d('0x4b')],qs[_0x368d('0x58')](_0x399c96[_0x368d('0x54')]['fields']));_0x182e84[_0x368d('0x57')]=_0x182e84['attributes'][_0x368d('0x75')]?_0x182e84[_0x368d('0x57')]:_0x59286f[_0x368d('0x4b')];_0x182e84[_0x368d('0x5b')]=qs[_0x368d('0x5c')](_0x399c96[_0x368d('0x54')][_0x368d('0x5c')]);_0x182e84[_0x368d('0x60')]=qs['filters'](_[_0x368d('0x5e')](_0x399c96[_0x368d('0x54')],_0x59286f[_0x368d('0x5d')]));if(_0x399c96[_0x368d('0x54')][_0x368d('0x5f')]){_0x182e84[_0x368d('0x60')]=_[_0x368d('0x61')](_0x182e84[_0x368d('0x60')],{'$or':_[_0x368d('0x38')](_0x182e84[_0x368d('0x57')],function(_0x32eb6e){var _0x2bfa2d={};_0x2bfa2d[_0x32eb6e]={'$like':'%'+_0x399c96['query'][_0x368d('0x5f')]+'%'};return _0x2bfa2d;})});}_0x182e84=_['merge']({},_0x182e84,_0x399c96['options']);return _0x19d477[_0x368d('0x114')](_0x182e84);}})[_0x368d('0x13')](function(_0x4777e2){if(_0x4777e2){_0x4e623c=_0x4777e2['length'];if(!_0x399c96[_0x368d('0x54')][_0x368d('0x59')]('nolimit')){_0x182e84[_0x368d('0x25')]=qs[_0x368d('0x25')](_0x399c96[_0x368d('0x54')][_0x368d('0x25')]);_0x182e84[_0x368d('0x24')]=qs[_0x368d('0x24')](_0x399c96[_0x368d('0x54')][_0x368d('0x24')]);}return _0x19d477['getApplications'](_0x182e84);}})[_0x368d('0x13')](function(_0x8072f6){if(_0x8072f6){return _0x8072f6?{'count':_0x4e623c,'rows':_0x8072f6}:null;}})['then'](respondWithResult(_0x20f87e,null))[_0x368d('0x1e')](handleError(_0x20f87e,null));};exports[_0x368d('0x115')]=function(_0x263af9,_0x4c54aa){return db[_0x368d('0x116')][_0x368d('0x69')]({'where':{'id':_0x263af9[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x4c54aa,null))[_0x368d('0x13')](function(_0x14ecac){if(_0x14ecac){return _0x14ecac[_0x368d('0x115')](_0x263af9[_0x368d('0x6b')][_0x368d('0x77')],_[_0x368d('0xf4')](_0x263af9[_0x368d('0x6b')],[_0x368d('0x77'),'id'])||{});}})['then'](respondWithResult(_0x4c54aa,null))[_0x368d('0x1e')](handleError(_0x4c54aa,null));};exports['getProactiveActions']=function(_0x2190a8,_0x166537){var _0x48cde9={};var _0x28c809={};var _0x49b14e;var _0x12acf4;return db[_0x368d('0x51')]['findOne']({'where':{'id':_0x2190a8['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x166537,null))[_0x368d('0x13')](function(_0x11372c){if(_0x11372c){_0x49b14e=_0x11372c;_0x28c809[_0x368d('0x4b')]=_['keys'](db[_0x368d('0x117')][_0x368d('0x52')]);_0x28c809[_0x368d('0x54')]=_[_0x368d('0x55')](_0x2190a8[_0x368d('0x54')]);_0x28c809[_0x368d('0x5d')]=_[_0x368d('0x56')](_0x28c809[_0x368d('0x4b')],_0x28c809[_0x368d('0x54')]);_0x48cde9[_0x368d('0x57')]=_[_0x368d('0x56')](_0x28c809['model'],qs[_0x368d('0x58')](_0x2190a8['query'][_0x368d('0x58')]));_0x48cde9[_0x368d('0x57')]=_0x48cde9['attributes'][_0x368d('0x75')]?_0x48cde9[_0x368d('0x57')]:_0x28c809[_0x368d('0x4b')];_0x48cde9['order']=qs[_0x368d('0x5c')](_0x2190a8[_0x368d('0x54')][_0x368d('0x5c')]);_0x48cde9[_0x368d('0x60')]=qs['filters'](_['pick'](_0x2190a8[_0x368d('0x54')],_0x28c809[_0x368d('0x5d')]));if(_0x2190a8[_0x368d('0x54')][_0x368d('0x5f')]){_0x48cde9[_0x368d('0x60')]=_[_0x368d('0x61')](_0x48cde9['where'],{'$or':_[_0x368d('0x38')](_0x48cde9[_0x368d('0x57')],function(_0x1ab243){var _0x5bc53d={};_0x5bc53d[_0x1ab243]={'$like':'%'+_0x2190a8['query'][_0x368d('0x5f')]+'%'};return _0x5bc53d;})});}_0x48cde9=_[_0x368d('0x61')]({},_0x48cde9,_0x2190a8['options']);return _0x49b14e[_0x368d('0xfd')](_0x48cde9);}})[_0x368d('0x13')](function(_0x25472b){if(_0x25472b){_0x12acf4=_0x25472b[_0x368d('0x75')];if(!_0x2190a8['query'][_0x368d('0x59')](_0x368d('0x5a'))){_0x48cde9[_0x368d('0x25')]=qs['limit'](_0x2190a8[_0x368d('0x54')][_0x368d('0x25')]);_0x48cde9[_0x368d('0x24')]=qs[_0x368d('0x24')](_0x2190a8[_0x368d('0x54')][_0x368d('0x24')]);}return _0x49b14e[_0x368d('0xfd')](_0x48cde9);}})['then'](function(_0x417699){if(_0x417699){return _0x417699?{'count':_0x12acf4,'rows':_0x417699}:null;}})[_0x368d('0x13')](respondWithResult(_0x166537,null))[_0x368d('0x1e')](handleError(_0x166537,null));};exports[_0x368d('0x118')]=function(_0x4b11e7,_0x1d848e){var _0x4344af=_0x4b11e7[_0x368d('0x54')][_0x368d('0x119')]===_0x368d('0x11a')?_0x368d('0x11b'):_0x368d('0x11c');return db['ChatWebsite'][_0x368d('0x69')]({'attributes':['id',_0x4344af],'where':{'id':_0x4b11e7[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x1d848e,null))[_0x368d('0x13')](function(_0x225b03){if(_0x225b03){var _0x5c2f11=_0x225b03[_0x4344af];var _0x71598c=_0x5c2f11&&_0x5c2f11['items']?_0x5c2f11[_0x368d('0x11d')]:[];_0x1d848e[_0x368d('0xcd')]({'fromKey':_[_0x368d('0x89')](_0x5c2f11[_0x368d('0x11e')])?undefined:_0x5c2f11[_0x368d('0x11e')],'count':_0x71598c[_0x368d('0x75')],'rows':_0x71598c});}})[_0x368d('0x1e')](handleError(_0x1d848e,null));};exports[_0x368d('0x11f')]=function(_0x3ad386,_0x1d3b0f){var _0x19c891={'raw':![],'where':{}};var _0x58c06c={};var _0x54d99b={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x368d('0x74')]({'where':{'id':_0x3ad386[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x1d3b0f,null))[_0x368d('0x13')](function(_0x2d74cc){if(_0x2d74cc){_0x58c06c['model']=_['keys'](db[_0x368d('0xd6')][_0x368d('0x52')]);_0x58c06c[_0x368d('0x54')]=_[_0x368d('0x55')](_0x3ad386['query']);_0x58c06c[_0x368d('0x5d')]=_['intersection'](_0x58c06c['model'],_0x58c06c[_0x368d('0x54')]);_0x19c891['attributes']=_[_0x368d('0x56')](_0x58c06c['model'],qs[_0x368d('0x58')](_0x3ad386[_0x368d('0x54')][_0x368d('0x58')]));_0x19c891[_0x368d('0x57')]=_0x19c891[_0x368d('0x57')][_0x368d('0x75')]?_0x19c891[_0x368d('0x57')]:_0x58c06c[_0x368d('0x4b')];if(!_0x3ad386[_0x368d('0x54')][_0x368d('0x59')](_0x368d('0x5a'))){_0x19c891['limit']=qs[_0x368d('0x25')](_0x3ad386[_0x368d('0x54')][_0x368d('0x25')]);_0x19c891[_0x368d('0x24')]=qs[_0x368d('0x24')](_0x3ad386[_0x368d('0x54')][_0x368d('0x24')]);}_0x19c891['order']=qs['sort'](_0x3ad386[_0x368d('0x54')][_0x368d('0x5c')]);_0x19c891['where']=qs[_0x368d('0x5d')](_[_0x368d('0x5e')](_0x3ad386['query'],_0x58c06c[_0x368d('0x5d')]));_0x19c891[_0x368d('0x60')][_0x368d('0x71')]=_0x2d74cc['id'];if(_0x3ad386[_0x368d('0x54')][_0x368d('0x5f')]){_0x19c891[_0x368d('0x60')]=_[_0x368d('0x61')](_0x19c891[_0x368d('0x60')],{'$or':_[_0x368d('0x38')](_0x19c891[_0x368d('0x57')],function(_0x32a591){var _0x386743={};_0x386743[_0x32a591]={'$like':'%'+_0x3ad386['query'][_0x368d('0x5f')]+'%'};return _0x386743;})});}_0x19c891=_['merge']({},_0x19c891,_0x3ad386[_0x368d('0x63')]);return db['ChatOfflineMessage'][_0x368d('0x23')]({'where':_0x19c891['where']})[_0x368d('0x13')](function(_0x1346b5){_0x54d99b['count']=_0x1346b5;if(_0x3ad386[_0x368d('0x54')][_0x368d('0x64')]){_0x19c891[_0x368d('0x65')]=[{'all':!![]}];}else{_0x19c891['include']=[{'model':db[_0x368d('0x97')],'as':_0x368d('0xf6'),'required':![]},{'model':db[_0x368d('0xe0')],'as':_0x368d('0x120'),'required':![]}];}return db[_0x368d('0xd6')]['findAll'](_0x19c891);})[_0x368d('0x13')](function(_0x3df1c4){_0x54d99b[_0x368d('0x67')]=_0x3df1c4;return _0x54d99b;});}})[_0x368d('0x13')](respondWithFilteredResult(_0x1d3b0f,_0x19c891))[_0x368d('0x1e')](handleError(_0x1d3b0f,null));};exports[_0x368d('0x121')]=function(_0x35b229,_0x11dd88){return db['ChatWebsite'][_0x368d('0x69')]({'where':{'id':_0x35b229['params']['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x11dd88,null))['then'](function(_0x3eec2d){if(_0x3eec2d){return _0x3eec2d['addAgents'](_0x35b229[_0x368d('0x6b')][_0x368d('0x77')],_[_0x368d('0xf4')](_0x35b229[_0x368d('0x6b')],['ids','id'])||{})[_0x368d('0xad')](function(_0x1b38c3){for(var _0x2643b1=0x0;_0x2643b1<_0x35b229[_0x368d('0x6b')][_0x368d('0x77')][_0x368d('0x75')];_0x2643b1+=0x1){socket[_0x368d('0x122')](_0x368d('0x123'),{'UserId':Number(_0x35b229[_0x368d('0x6b')][_0x368d('0x77')][_0x2643b1]),'ChatWebsiteId':Number(_0x35b229[_0x368d('0x68')]['id'])});}return _0x1b38c3;});}})[_0x368d('0x13')](respondWithResult(_0x11dd88,null))[_0x368d('0x1e')](handleError(_0x11dd88,null));};exports[_0x368d('0x124')]=function(_0x292fe4,_0x73fc48){return db[_0x368d('0x51')]['find']({'where':{'id':_0x292fe4[_0x368d('0x68')]['id']}})[_0x368d('0x13')](handleEntityNotFound(_0x73fc48,null))[_0x368d('0x13')](function(_0x42a423){if(_0x42a423){return _0x42a423[_0x368d('0x124')](_0x292fe4['query'][_0x368d('0x77')])[_0x368d('0x13')](function(){if(_[_0x368d('0x125')](_0x292fe4[_0x368d('0x54')][_0x368d('0x77')])){for(var _0xab9d79=0x0;_0xab9d79<_0x292fe4['query']['ids'][_0x368d('0x75')];_0xab9d79+=0x1){socket[_0x368d('0x122')](_0x368d('0x126'),{'UserId':Number(_0x292fe4[_0x368d('0x54')]['ids'][_0xab9d79]),'ChatWebsiteId':Number(_0x292fe4[_0x368d('0x68')]['id'])});}}else{socket[_0x368d('0x122')](_0x368d('0x126'),{'UserId':Number(_0x292fe4[_0x368d('0x54')][_0x368d('0x77')]),'ChatWebsiteId':Number(_0x292fe4['params']['id'])});}});}})['then'](respondWithStatusCode(_0x73fc48,null))[_0x368d('0x1e')](handleError(_0x73fc48,null));};exports[_0x368d('0x127')]=function(_0x560642,_0x22539a){var _0x4a10e4={};var _0x1d691f={};var _0xf0637f;var _0x335ad1;return db[_0x368d('0x51')][_0x368d('0x74')]({'where':{'id':_0x560642[_0x368d('0x68')]['id']}})['then'](handleEntityNotFound(_0x22539a,null))[_0x368d('0x13')](function(_0x41f8f5){if(_0x41f8f5){_0xf0637f=_0x41f8f5;_0x1d691f[_0x368d('0x4b')]=_[_0x368d('0x55')](db[_0x368d('0xc1')]['rawAttributes']);_0x1d691f[_0x368d('0x54')]=_[_0x368d('0x55')](_0x560642[_0x368d('0x54')]);_0x1d691f['filters']=_[_0x368d('0x56')](_0x1d691f[_0x368d('0x4b')],_0x1d691f['query']);_0x4a10e4[_0x368d('0x57')]=_[_0x368d('0x56')](_0x1d691f[_0x368d('0x4b')],qs[_0x368d('0x58')](_0x560642['query']['fields']));_0x4a10e4[_0x368d('0x57')]=_0x4a10e4[_0x368d('0x57')][_0x368d('0x75')]?_0x4a10e4[_0x368d('0x57')]:_0x1d691f['model'];_0x4a10e4[_0x368d('0x5b')]=qs[_0x368d('0x5c')](_0x560642[_0x368d('0x54')]['sort']);_0x4a10e4[_0x368d('0x60')]=qs[_0x368d('0x5d')](_[_0x368d('0x5e')](_0x560642[_0x368d('0x54')],_0x1d691f['filters']));if(_0x560642[_0x368d('0x54')]['filter']){_0x4a10e4[_0x368d('0x60')]=_['merge'](_0x4a10e4[_0x368d('0x60')],{'$or':_['map'](_0x4a10e4[_0x368d('0x57')],function(_0xc3a44a){var _0x207627={};_0x207627[_0xc3a44a]={'$like':'%'+_0x560642[_0x368d('0x54')][_0x368d('0x5f')]+'%'};return _0x207627;})});}_0x4a10e4=_[_0x368d('0x61')]({},_0x4a10e4,_0x560642[_0x368d('0x63')]);return _0xf0637f['getAgents'](_0x4a10e4);}})[_0x368d('0x13')](function(_0x272355){if(_0x272355){_0x335ad1=_0x272355[_0x368d('0x75')];if(!_0x560642['query'][_0x368d('0x59')](_0x368d('0x5a'))){_0x4a10e4[_0x368d('0x25')]=qs['limit'](_0x560642['query'][_0x368d('0x25')]);_0x4a10e4[_0x368d('0x24')]=qs[_0x368d('0x24')](_0x560642[_0x368d('0x54')]['offset']);}return _0xf0637f[_0x368d('0x127')](_0x4a10e4);}})[_0x368d('0x13')](function(_0x244738){if(_0x244738){return _0x244738?{'count':_0x335ad1,'rows':_0x244738}:null;}})['then'](respondWithResult(_0x22539a,null))['catch'](handleError(_0x22539a,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 77e1798..3a5d46e 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 _0xff3c=['../../mysqldb','setMaxListeners','save','emit','exports','events'];(function(_0x4c353f,_0xd09ca6){var _0x37b0b6=function(_0x419c0f){while(--_0x419c0f){_0x4c353f['push'](_0x4c353f['shift']());}};_0x37b0b6(++_0xd09ca6);}(_0xff3c,0x179));var _0xcff3=function(_0x1eb359,_0x4cda30){_0x1eb359=_0x1eb359-0x0;var _0x3fdf23=_0xff3c[_0x1eb359];return _0x3fdf23;};'use strict';var EventEmitter=require(_0xcff3('0x0'));var ChatWebsite=require(_0xcff3('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xcff3('0x2')](0x0);var events={'afterCreate':_0xcff3('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28f6e0){return function(_0x17ae92,_0x45c7f6,_0x312858){ChatWebsiteEvents[_0xcff3('0x4')](_0x28f6e0+':'+_0x17ae92['id'],_0x17ae92);ChatWebsiteEvents[_0xcff3('0x4')](_0x28f6e0,_0x17ae92);_0x312858(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0xcff3('0x5')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xf3ff=['emit','hasOwnProperty','hook','events','ChatWebsite','setMaxListeners','save','update','remove'];(function(_0x50e593,_0x3ae998){var _0x3821d0=function(_0x53c295){while(--_0x53c295){_0x50e593['push'](_0x50e593['shift']());}};_0x3821d0(++_0x3ae998);}(_0xf3ff,0xae));var _0xff3f=function(_0x43d21c,_0x404a65){_0x43d21c=_0x43d21c-0x0;var _0x470922=_0xf3ff[_0x43d21c];return _0x470922;};'use strict';var EventEmitter=require(_0xff3f('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0xff3f('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xff3f('0x2')](0x0);var events={'afterCreate':_0xff3f('0x3'),'afterUpdate':_0xff3f('0x4'),'afterDestroy':_0xff3f('0x5')};function emitEvent(_0x262446){return function(_0x4aa1dc,_0x2c62cc,_0x30f58e){ChatWebsiteEvents[_0xff3f('0x6')](_0x262446+':'+_0x4aa1dc['id'],_0x4aa1dc);ChatWebsiteEvents['emit'](_0x262446,_0x4aa1dc);_0x30f58e(null);};}for(var e in events){if(events[_0xff3f('0x7')](e)){var event=events[e];ChatWebsite[_0xff3f('0x8')](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 54075f5..459f6c6 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 _0x5c5f=['./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0xc3c0fd,_0x210520){var _0x36d3e0=function(_0x27bdff){while(--_0x27bdff){_0xc3c0fd['push'](_0xc3c0fd['shift']());}};_0x36d3e0(++_0x210520);}(_0x5c5f,0x1dd));var _0xf5c5=function(_0x76c02d,_0x56edfa){_0x76c02d=_0x76c02d-0x0;var _0x43acda=_0x5c5f[_0x76c02d];return _0x43acda;};'use strict';var _=require(_0xf5c5('0x0'));var util=require('util');var logger=require(_0xf5c5('0x1'))(_0xf5c5('0x2'));var moment=require(_0xf5c5('0x3'));var BPromise=require(_0xf5c5('0x4'));var rp=require(_0xf5c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf5c5('0x6'));var config=require('../../config/environment');var attributes=require(_0xf5c5('0x7'));module[_0xf5c5('0x8')]=function(_0x4fa7b1,_0x531b1f){return _0x4fa7b1['define'](_0xf5c5('0x9'),attributes,{'tableName':_0xf5c5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x377d=['exports','ChatWebsite','chat_websites','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x5aebdc,_0x54d387){var _0x3ec5c6=function(_0x456186){while(--_0x456186){_0x5aebdc['push'](_0x5aebdc['shift']());}};_0x3ec5c6(++_0x54d387);}(_0x377d,0xff));var _0xd377=function(_0x53f3e9,_0x43ad34){_0x53f3e9=_0x53f3e9-0x0;var _0x531871=_0x377d[_0x53f3e9];return _0x531871;};'use strict';var _=require(_0xd377('0x0'));var util=require(_0xd377('0x1'));var logger=require(_0xd377('0x2'))(_0xd377('0x3'));var moment=require(_0xd377('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd377('0x5'));var rimraf=require(_0xd377('0x6'));var config=require(_0xd377('0x7'));var attributes=require(_0xd377('0x8'));module[_0xd377('0x9')]=function(_0x3e70fe,_0x120c43){return _0x3e70fe['define'](_0xd377('0xa'),attributes,{'tableName':_0xd377('0xb'),'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 25fddbf..0363cc2 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 _0x2aa6=['result','catch','util','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./chatWebsite.socket','register','request','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','error','code','message'];(function(_0x3a2d30,_0x24f0f6){var _0x49ec55=function(_0x206969){while(--_0x206969){_0x3a2d30['push'](_0x3a2d30['shift']());}};_0x49ec55(++_0x24f0f6);}(_0x2aa6,0x116));var _0x62aa=function(_0x5c38cd,_0x5a6b4e){_0x5c38cd=_0x5c38cd-0x0;var _0xc985ef=_0x2aa6[_0x5c38cd];return _0xc985ef;};'use strict';var _=require('lodash');var util=require(_0x62aa('0x0'));var moment=require('moment');var BPromise=require(_0x62aa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x62aa('0x2'));var db=require(_0x62aa('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x62aa('0x4'));var config=require(_0x62aa('0x5'));var jayson=require(_0x62aa('0x6'));var client=jayson[_0x62aa('0x7')][_0x62aa('0x8')]({'port':0x232a});config['redis']=_[_0x62aa('0x9')](config[_0x62aa('0xa')],{'host':_0x62aa('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x62aa('0xa')]));require(_0x62aa('0xc'))[_0x62aa('0xd')](socket);function respondWithRpcPromise(_0x1a380b,_0x562073,_0x281e8a){return new BPromise(function(_0x23849c,_0x1e0dee){return client[_0x62aa('0xe')](_0x1a380b,_0x281e8a)['then'](function(_0x1ec3dd){logger[_0x62aa('0xf')](_0x62aa('0x10'),_0x562073,_0x62aa('0x11'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x562073,_0x62aa('0x11'),JSON['stringify'](_0x1ec3dd));if(_0x1ec3dd[_0x62aa('0x12')]){if(_0x1ec3dd[_0x62aa('0x12')][_0x62aa('0x13')]===0x1f4){logger[_0x62aa('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x562073,_0x1ec3dd['error'][_0x62aa('0x14')]);return _0x1e0dee(_0x1ec3dd[_0x62aa('0x12')]['message']);}logger[_0x62aa('0x12')](_0x62aa('0x10'),_0x562073,_0x1ec3dd['error'][_0x62aa('0x14')]);return _0x23849c(_0x1ec3dd[_0x62aa('0x12')][_0x62aa('0x14')]);}else{logger[_0x62aa('0xf')](_0x62aa('0x10'),_0x562073,_0x62aa('0x11'));_0x23849c(_0x1ec3dd[_0x62aa('0x15')][_0x62aa('0x14')]);}})[_0x62aa('0x16')](function(_0x1741fe){logger[_0x62aa('0x12')](_0x62aa('0x10'),_0x562073,_0x1741fe);_0x1e0dee(_0x1741fe);});});}
\ No newline at end of file
+var _0xb024=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','socket.io-emitter','./chatWebsite.socket','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4b4cd6,_0x3b8574){var _0x10c3ba=function(_0x3d52e5){while(--_0x3d52e5){_0x4b4cd6['push'](_0x4b4cd6['shift']());}};_0x10c3ba(++_0x3b8574);}(_0xb024,0x11a));var _0x4b02=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xb024[_0x4a9fb1];return _0x348672;};'use strict';var _=require(_0x4b02('0x0'));var util=require(_0x4b02('0x1'));var moment=require(_0x4b02('0x2'));var BPromise=require(_0x4b02('0x3'));var rs=require(_0x4b02('0x4'));var fs=require('fs');var Redis=require(_0x4b02('0x5'));var db=require(_0x4b02('0x6'))['db'];var utils=require(_0x4b02('0x7'));var logger=require(_0x4b02('0x8'))(_0x4b02('0x9'));var config=require('../../config/environment');var jayson=require(_0x4b02('0xa'));var client=jayson[_0x4b02('0xb')][_0x4b02('0xc')]({'port':0x232a});config['redis']=_[_0x4b02('0xd')](config[_0x4b02('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x4b02('0xf'))(new Redis(config[_0x4b02('0xe')]));require(_0x4b02('0x10'))['register'](socket);function respondWithRpcPromise(_0x3ee60f,_0x1751f9,_0x39fd52){return new BPromise(function(_0x326e00,_0x2db515){return client['request'](_0x3ee60f,_0x39fd52)['then'](function(_0x4052a8){logger[_0x4b02('0x11')](_0x4b02('0x12'),_0x1751f9,_0x4b02('0x13'));logger[_0x4b02('0x14')](_0x4b02('0x15'),_0x1751f9,_0x4b02('0x13'),JSON[_0x4b02('0x16')](_0x4052a8));if(_0x4052a8['error']){if(_0x4052a8[_0x4b02('0x17')][_0x4b02('0x18')]===0x1f4){logger[_0x4b02('0x17')](_0x4b02('0x12'),_0x1751f9,_0x4052a8[_0x4b02('0x17')][_0x4b02('0x19')]);return _0x2db515(_0x4052a8[_0x4b02('0x17')]['message']);}logger['error'](_0x4b02('0x12'),_0x1751f9,_0x4052a8[_0x4b02('0x17')][_0x4b02('0x19')]);return _0x326e00(_0x4052a8['error'][_0x4b02('0x19')]);}else{logger[_0x4b02('0x11')]('ChatWebsite,\x20%s,\x20%s',_0x1751f9,_0x4b02('0x13'));_0x326e00(_0x4052a8[_0x4b02('0x1a')]['message']);}})[_0x4b02('0x1b')](function(_0x183dc5){logger[_0x4b02('0x17')](_0x4b02('0x12'),_0x1751f9,_0x183dc5);_0x2db515(_0x183dc5);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index d597088..07aff59 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 _0x7897=['save','remove','update','register','length','./chatWebsite.events'];(function(_0x46f0fc,_0x15bc89){var _0x20984c=function(_0x2e3393){while(--_0x2e3393){_0x46f0fc['push'](_0x46f0fc['shift']());}};_0x20984c(++_0x15bc89);}(_0x7897,0x65));var _0x7789=function(_0x5a3e03,_0x13e29b){_0x5a3e03=_0x5a3e03-0x0;var _0x5b0e87=_0x7897[_0x5a3e03];return _0x5b0e87;};'use strict';var ChatWebsiteEvents=require(_0x7789('0x0'));var events=[_0x7789('0x1'),_0x7789('0x2'),_0x7789('0x3')];function createListener(_0x3d9c27,_0x3496d9){return function(_0x57c335){_0x3496d9['emit'](_0x3d9c27,_0x57c335);};}function removeListener(_0x5f5f49,_0x598fd9){return function(){ChatWebsiteEvents['removeListener'](_0x5f5f49,_0x598fd9);};}exports[_0x7789('0x4')]=function(_0xb07ba7){for(var _0x1bd6e2=0x0,_0x26c1b5=events[_0x7789('0x5')];_0x1bd6e2<_0x26c1b5;_0x1bd6e2++){var _0x111e53=events[_0x1bd6e2];var _0x44d14f=createListener('chatWebsite:'+_0x111e53,_0xb07ba7);ChatWebsiteEvents['on'](_0x111e53,_0x44d14f);}};
\ No newline at end of file
+var _0x8adc=['./chatWebsite.events','remove','update','emit','removeListener','register','chatWebsite:'];(function(_0x687dd4,_0x365099){var _0x248b7b=function(_0x393e36){while(--_0x393e36){_0x687dd4['push'](_0x687dd4['shift']());}};_0x248b7b(++_0x365099);}(_0x8adc,0x165));var _0xc8ad=function(_0x3c4dad,_0x25ffd5){_0x3c4dad=_0x3c4dad-0x0;var _0x1a4f49=_0x8adc[_0x3c4dad];return _0x1a4f49;};'use strict';var ChatWebsiteEvents=require(_0xc8ad('0x0'));var events=['save',_0xc8ad('0x1'),_0xc8ad('0x2')];function createListener(_0x23a799,_0x228807){return function(_0x178a9c){_0x228807[_0xc8ad('0x3')](_0x23a799,_0x178a9c);};}function removeListener(_0x2b5cf7,_0x2f7ba0){return function(){ChatWebsiteEvents[_0xc8ad('0x4')](_0x2b5cf7,_0x2f7ba0);};}exports[_0xc8ad('0x5')]=function(_0x2b8a74){for(var _0x117a5a=0x0,_0x3588e1=events['length'];_0x117a5a<_0x3588e1;_0x117a5a++){var _0x2c2663=events[_0x117a5a];var _0x33e63e=createListener(_0xc8ad('0x6')+_0x2c2663,_0x2b8a74);ChatWebsiteEvents['on'](_0x2c2663,_0x33e63e);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c141ad4..66786fe 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 _0xcc6c=['join','server/files/images/logos/','format','now','originalname','single','file','addLogo','diskStorage','server/files/images/avatars/','%s-%s','root','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','extname','/:id/offline','any','offline','/:id/interactions','addInteraction','addApplications','addProactiveActions','put','update','delete','destroy','/:id/dispositions','removeDispositions','removeAnswers','removeAgents','multer','util','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/describe','describe','/:id','getDispositions','getAnswers','/:id/logo','/:id/avatar','getCustomerAvatar','/:id/system_avatar','getInteractions','getSnippet','/:id/applications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','/:id/canned_answers','addAnswer'];(function(_0x570294,_0x139ae4){var _0x41b542=function(_0xea92ff){while(--_0xea92ff){_0x570294['push'](_0x570294['shift']());}};_0x41b542(++_0x139ae4);}(_0xcc6c,0x1ae));var _0xccc6=function(_0x2d274d,_0x50b97){_0x2d274d=_0x2d274d-0x0;var _0x268a48=_0xcc6c[_0x2d274d];return _0x268a48;};'use strict';var multer=require(_0xccc6('0x0'));var util=require(_0xccc6('0x1'));var path=require(_0xccc6('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xccc6('0x3')]();var fs_extra=require(_0xccc6('0x4'));var auth=require(_0xccc6('0x5'));var interaction=require(_0xccc6('0x6'));var config=require(_0xccc6('0x7'));var controller=require(_0xccc6('0x8'));router[_0xccc6('0x9')]('/',auth[_0xccc6('0xa')](),controller['index']);router[_0xccc6('0x9')](_0xccc6('0xb'),auth[_0xccc6('0xa')](),controller[_0xccc6('0xc')]);router['get'](_0xccc6('0xd'),auth[_0xccc6('0xa')](),controller['show']);router['get']('/:id/dispositions',auth[_0xccc6('0xa')](),controller[_0xccc6('0xe')]);router['get']('/:id/canned_answers',auth[_0xccc6('0xa')](),controller[_0xccc6('0xf')]);router[_0xccc6('0x9')](_0xccc6('0x10'),controller['getLogo']);router[_0xccc6('0x9')](_0xccc6('0x11'),controller['getAvatar']);router[_0xccc6('0x9')]('/:id/customer_avatar',controller[_0xccc6('0x12')]);router[_0xccc6('0x9')](_0xccc6('0x13'),controller['getSystemAvatar']);router['get']('/:id/interactions',auth[_0xccc6('0xa')](),controller[_0xccc6('0x14')]);router[_0xccc6('0x9')]('/:id/snippet',controller[_0xccc6('0x15')]);router[_0xccc6('0x9')](_0xccc6('0x16'),auth[_0xccc6('0xa')](),controller['getApplications']);router[_0xccc6('0x9')](_0xccc6('0x17'),auth['isAuthenticated'](),controller['getProactiveActions']);router[_0xccc6('0x9')](_0xccc6('0x18'),controller['getFields']);router[_0xccc6('0x9')](_0xccc6('0x19'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x1a')]);router[_0xccc6('0x9')](_0xccc6('0x1b'),auth['isAuthenticated'](),controller[_0xccc6('0x1c')]);router[_0xccc6('0x1d')]('/',auth[_0xccc6('0xa')](),controller['create']);router[_0xccc6('0x1d')]('/:id/dispositions',auth[_0xccc6('0xa')](),controller['addDisposition']);router[_0xccc6('0x1d')](_0xccc6('0x1e'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x1f')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x24970a,_0x1e2d98,_0x38c111){_0x38c111(null,path[_0xccc6('0x20')](config['root'],_0xccc6('0x21')));},'filename':function(_0x2c5157,_0xb64b43,_0x463511){_0x463511(null,util[_0xccc6('0x22')]('%s-%s',Date[_0xccc6('0x23')](),_0xb64b43[_0xccc6('0x24')]));}})});router[_0xccc6('0x1d')]('/:id/logo',upload[_0xccc6('0x25')](_0xccc6('0x26')),controller[_0xccc6('0x27')]);var upload=multer({'storage':multer[_0xccc6('0x28')]({'destination':function(_0x22f1db,_0x4563fb,_0x8ada51){_0x8ada51(null,path['join'](config['root'],_0xccc6('0x29')));},'filename':function(_0x2da4ae,_0x2bb745,_0x4cb274){_0x4cb274(null,util[_0xccc6('0x22')](_0xccc6('0x2a'),Date[_0xccc6('0x23')](),_0x2bb745[_0xccc6('0x24')]));}})});router['post']('/:id/avatar',upload[_0xccc6('0x25')](_0xccc6('0x26')),controller['addAvatar']);var upload=multer({'storage':multer[_0xccc6('0x28')]({'destination':function(_0x5db382,_0x3d3c57,_0x5ca40a){_0x5ca40a(null,path[_0xccc6('0x20')](config[_0xccc6('0x2b')],_0xccc6('0x29')));},'filename':function(_0x56c868,_0x5c2c5d,_0x2005c4){_0x2005c4(null,util[_0xccc6('0x22')](_0xccc6('0x2a'),Date[_0xccc6('0x23')](),_0x5c2c5d[_0xccc6('0x24')]));}})});router[_0xccc6('0x1d')](_0xccc6('0x2c'),upload[_0xccc6('0x25')](_0xccc6('0x26')),controller[_0xccc6('0x2d')]);var upload=multer({'storage':multer[_0xccc6('0x28')]({'destination':function(_0x45f424,_0x244fda,_0x44da83){_0x44da83(null,path[_0xccc6('0x20')](config[_0xccc6('0x2b')],_0xccc6('0x29')));},'filename':function(_0x378680,_0x384033,_0x2bad3b){_0x2bad3b(null,util[_0xccc6('0x22')](_0xccc6('0x2a'),Date[_0xccc6('0x23')](),_0x384033['originalname']));}})});router[_0xccc6('0x1d')](_0xccc6('0x13'),upload[_0xccc6('0x25')](_0xccc6('0x26')),controller[_0xccc6('0x2e')]);router[_0xccc6('0x1d')]('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xccc6('0x28')]({'destination':function(_0x54ac83,_0x1e6f04,_0x3619cc){const _0x399d98=path['join'](config[_0xccc6('0x2b')],_0xccc6('0x2f'),_0xccc6('0x30'),_0xccc6('0x31'));fs_extra['ensureDir'](_0x399d98,function(){_0x3619cc(null,_0x399d98);});},'filename':function(_0x1e1c37,_0x1c0b60,_0x403fa6){const _0x17b54e=_0x1c0b60[_0xccc6('0x24')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0xc1eb14=path[_0xccc6('0x32')](_0x17b54e);const _0x3c00be=Date[_0xccc6('0x23')]()+'-'+_0x17b54e['replace'](_0xc1eb14,'')+_0xc1eb14;_0x403fa6(null,_0x3c00be);}})});router[_0xccc6('0x1d')](_0xccc6('0x33'),offlineUploadMulter[_0xccc6('0x34')](),controller[_0xccc6('0x35')]);router[_0xccc6('0x1d')](_0xccc6('0x36'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x37')]);router[_0xccc6('0x1d')](_0xccc6('0x16'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x38')]);router[_0xccc6('0x1d')](_0xccc6('0x17'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x39')]);router['post'](_0xccc6('0x1b'),auth[_0xccc6('0xa')](),controller['addAgents']);router[_0xccc6('0x3a')](_0xccc6('0xd'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x3b')]);router[_0xccc6('0x3c')](_0xccc6('0xd'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x3d')]);router[_0xccc6('0x3c')](_0xccc6('0x3e'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x3f')]);router['delete'](_0xccc6('0x1e'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x40')]);router[_0xccc6('0x3c')](_0xccc6('0x1b'),auth[_0xccc6('0xa')](),controller[_0xccc6('0x41')]);module['exports']=router;
\ No newline at end of file
+var _0xa2ba=['removeAgents','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/canned_answers','/:id/logo','getLogo','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','getApplications','/:id/proactive_actions','/:id/fields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','create','addDisposition','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','file','addLogo','join','server/files/images/avatars/','single','addAvatar','addSystemAvatar','/:id/notify','server/files','attachments','offline-chat','ensureDir','replace','/:id/offline','addInteraction','addApplications','addProactiveActions','put','delete','destroy','removeDispositions'];(function(_0x2991d8,_0x1c96d4){var _0x26d2ce=function(_0x58bb32){while(--_0x58bb32){_0x2991d8['push'](_0x2991d8['shift']());}};_0x26d2ce(++_0x1c96d4);}(_0xa2ba,0x147));var _0xaa2b=function(_0x10bcb4,_0xc27fa){_0x10bcb4=_0x10bcb4-0x0;var _0x43c569=_0xa2ba[_0x10bcb4];return _0x43c569;};'use strict';var multer=require(_0xaa2b('0x0'));var util=require(_0xaa2b('0x1'));var path=require(_0xaa2b('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa2b('0x3'));var router=express[_0xaa2b('0x4')]();var fs_extra=require(_0xaa2b('0x5'));var auth=require(_0xaa2b('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xaa2b('0x7'));router[_0xaa2b('0x8')]('/',auth[_0xaa2b('0x9')](),controller[_0xaa2b('0xa')]);router[_0xaa2b('0x8')]('/describe',auth[_0xaa2b('0x9')](),controller[_0xaa2b('0xb')]);router[_0xaa2b('0x8')](_0xaa2b('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0xaa2b('0xd'),auth['isAuthenticated'](),controller['getDispositions']);router[_0xaa2b('0x8')](_0xaa2b('0xe'),auth['isAuthenticated'](),controller['getAnswers']);router[_0xaa2b('0x8')](_0xaa2b('0xf'),controller[_0xaa2b('0x10')]);router[_0xaa2b('0x8')]('/:id/avatar',controller['getAvatar']);router[_0xaa2b('0x8')](_0xaa2b('0x11'),controller[_0xaa2b('0x12')]);router[_0xaa2b('0x8')](_0xaa2b('0x13'),controller[_0xaa2b('0x14')]);router[_0xaa2b('0x8')](_0xaa2b('0x15'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x16')]);router[_0xaa2b('0x8')](_0xaa2b('0x17'),controller['getSnippet']);router[_0xaa2b('0x8')](_0xaa2b('0x18'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x19')]);router[_0xaa2b('0x8')](_0xaa2b('0x1a'),auth[_0xaa2b('0x9')](),controller['getProactiveActions']);router[_0xaa2b('0x8')](_0xaa2b('0x1b'),controller['getFields']);router[_0xaa2b('0x8')](_0xaa2b('0x1c'),auth['isAuthenticated'](),controller[_0xaa2b('0x1d')]);router[_0xaa2b('0x8')](_0xaa2b('0x1e'),auth['isAuthenticated'](),controller[_0xaa2b('0x1f')]);router[_0xaa2b('0x20')]('/',auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x21')]);router[_0xaa2b('0x20')](_0xaa2b('0xd'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x22')]);router[_0xaa2b('0x20')]('/:id/canned_answers',auth[_0xaa2b('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0xaa2b('0x23')]({'destination':function(_0x1330ef,_0x11bb4f,_0x4b930c){_0x4b930c(null,path['join'](config[_0xaa2b('0x24')],_0xaa2b('0x25')));},'filename':function(_0x553d03,_0x3ba68e,_0x160efc){_0x160efc(null,util[_0xaa2b('0x26')](_0xaa2b('0x27'),Date[_0xaa2b('0x28')](),_0x3ba68e[_0xaa2b('0x29')]));}})});router[_0xaa2b('0x20')](_0xaa2b('0xf'),upload['single'](_0xaa2b('0x2a')),controller[_0xaa2b('0x2b')]);var upload=multer({'storage':multer[_0xaa2b('0x23')]({'destination':function(_0x4d5ad8,_0x48c88e,_0xbc652a){_0xbc652a(null,path[_0xaa2b('0x2c')](config[_0xaa2b('0x24')],_0xaa2b('0x2d')));},'filename':function(_0x4cf429,_0x52d2ff,_0x3f6205){_0x3f6205(null,util[_0xaa2b('0x26')](_0xaa2b('0x27'),Date[_0xaa2b('0x28')](),_0x52d2ff[_0xaa2b('0x29')]));}})});router['post']('/:id/avatar',upload[_0xaa2b('0x2e')](_0xaa2b('0x2a')),controller[_0xaa2b('0x2f')]);var upload=multer({'storage':multer[_0xaa2b('0x23')]({'destination':function(_0x4b12fb,_0x5ea21e,_0x7fb7b9){_0x7fb7b9(null,path[_0xaa2b('0x2c')](config['root'],'server/files/images/avatars/'));},'filename':function(_0x14eb5c,_0x14bb86,_0x4fbe5b){_0x4fbe5b(null,util['format'](_0xaa2b('0x27'),Date['now'](),_0x14bb86[_0xaa2b('0x29')]));}})});router[_0xaa2b('0x20')]('/:id/customer_avatar',upload[_0xaa2b('0x2e')]('file'),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0xaa2b('0x23')]({'destination':function(_0x5c34e1,_0x4258c7,_0x55a0fd){_0x55a0fd(null,path[_0xaa2b('0x2c')](config[_0xaa2b('0x24')],_0xaa2b('0x2d')));},'filename':function(_0x271067,_0x5a79cb,_0x3ed3ad){_0x3ed3ad(null,util['format']('%s-%s',Date['now'](),_0x5a79cb['originalname']));}})});router[_0xaa2b('0x20')](_0xaa2b('0x13'),upload[_0xaa2b('0x2e')](_0xaa2b('0x2a')),controller[_0xaa2b('0x30')]);router['post'](_0xaa2b('0x31'),controller['notify']);const offlineUploadMulter=multer({'storage':multer[_0xaa2b('0x23')]({'destination':function(_0x4b75e3,_0x5758d8,_0x31f007){const _0x4da911=path[_0xaa2b('0x2c')](config[_0xaa2b('0x24')],_0xaa2b('0x32'),_0xaa2b('0x33'),_0xaa2b('0x34'));fs_extra[_0xaa2b('0x35')](_0x4da911,function(){_0x31f007(null,_0x4da911);});},'filename':function(_0x590f70,_0x462441,_0x5b8a00){const _0x1b7fc1=_0x462441[_0xaa2b('0x29')][_0xaa2b('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x397ff=path['extname'](_0x1b7fc1);const _0x3b92eb=Date[_0xaa2b('0x28')]()+'-'+_0x1b7fc1[_0xaa2b('0x36')](_0x397ff,'')+_0x397ff;_0x5b8a00(null,_0x3b92eb);}})});router['post'](_0xaa2b('0x37'),offlineUploadMulter['any'](),controller['offline']);router[_0xaa2b('0x20')](_0xaa2b('0x15'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x38')]);router[_0xaa2b('0x20')]('/:id/applications',auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x39')]);router['post'](_0xaa2b('0x1a'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x3a')]);router['post']('/:id/users',auth[_0xaa2b('0x9')](),controller['addAgents']);router[_0xaa2b('0x3b')](_0xaa2b('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xaa2b('0x3c')](_0xaa2b('0xc'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x3d')]);router[_0xaa2b('0x3c')]('/:id/dispositions',auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x3e')]);router['delete'](_0xaa2b('0xe'),auth[_0xaa2b('0x9')](),controller['removeAnswers']);router[_0xaa2b('0x3c')](_0xaa2b('0x1e'),auth[_0xaa2b('0x9')](),controller[_0xaa2b('0x3f')]);module[_0xaa2b('0x40')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 6e9fb10..16c357d 100644
--- a/server/api/client-side-logs.js
+++ b/server/api/client-side-logs.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7e46=['/client-logs','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment','env','app','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0x20efc3,_0x1d2191){var _0x49d176=function(_0x5a886f){while(--_0x5a886f){_0x20efc3['push'](_0x20efc3['shift']());}};_0x49d176(++_0x1d2191);}(_0x7e46,0x7c));var _0x67e4=function(_0x5c16fc,_0x282348){_0x5c16fc=_0x5c16fc-0x0;var _0x3bceb4=_0x7e46[_0x5c16fc];return _0x3bceb4;};var beaverLogger=require(_0x67e4('0x0'));var express=require(_0x67e4('0x1'));var auth=require(_0x67e4('0x2'));var config=require(_0x67e4('0x3'));var router=express['Router']();var isProduction=config[_0x67e4('0x4')]==='production'||![];function clientSideLogs(_0x4a6687,_0x55afab,_0x4c9196){var _0x205cf2=_0x4a6687[_0x67e4('0x5')]['get'](_0x67e4('0x6'));if(!_0x205cf2){throw new Error(_0x67e4('0x7'));}return beaverLogger['expressEndpoint']({'uri':_0x67e4('0x8'),'logger':_0x205cf2,'enableCors':!isProduction})(_0x4a6687,_0x55afab,_0x4c9196);}router[_0x67e4('0x9')](auth['isAuthenticated'](),clientSideLogs);module[_0x67e4('0xa')]=router;
\ No newline at end of file
+var _0x6c8a=['Router','env','client-side-logger','expressEndpoint','/client-logs','use','isAuthenticated','exports','../components/auth/service'];(function(_0x321b98,_0x4c7b2b){var _0x22948f=function(_0x12ac50){while(--_0x12ac50){_0x321b98['push'](_0x321b98['shift']());}};_0x22948f(++_0x4c7b2b);}(_0x6c8a,0x1c1));var _0xa6c8=function(_0x52db7d,_0x344fce){_0x52db7d=_0x52db7d-0x0;var _0x4a6946=_0x6c8a[_0x52db7d];return _0x4a6946;};var beaverLogger=require('beaver-logger/server');var express=require('express');var auth=require(_0xa6c8('0x0'));var config=require('../config/environment');var router=express[_0xa6c8('0x1')]();var isProduction=config[_0xa6c8('0x2')]==='production'||![];function clientSideLogs(_0x417e52,_0x322dc7,_0x15aef2){var _0x5a4b4a=_0x417e52['app']['get'](_0xa6c8('0x3'));if(!_0x5a4b4a){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0xa6c8('0x4')]({'uri':_0xa6c8('0x5'),'logger':_0x5a4b4a,'enableCors':!isProduction})(_0x417e52,_0x322dc7,_0x15aef2);}router[_0xa6c8('0x6')](auth[_0xa6c8('0x7')](),clientSideLogs);module[_0xa6c8('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 1fc1b7e..d3d7719 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 _0x5de5=['TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri'];(function(_0x5cbcb3,_0x3a025d){var _0x4e334c=function(_0x171866){while(--_0x171866){_0x5cbcb3['push'](_0x5cbcb3['shift']());}};_0x4e334c(++_0x3a025d);}(_0x5de5,0x153));var _0x55de=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x5de5[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require('sequelize');module[_0x55de('0x0')]={'name':{'type':Sequelize[_0x55de('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x55de('0x2')](_0x55de('0x3'),_0x55de('0x4'),_0x55de('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x55de('0x2')]('Outlook365',_0x55de('0x6'))},'data1':{'type':Sequelize[_0x55de('0x1')],'comment':_0x55de('0x7')},'data2':{'type':Sequelize[_0x55de('0x1')],'comment':_0x55de('0x8')},'data3':{'type':Sequelize[_0x55de('0x1')],'comment':_0x55de('0x9')},'data4':{'type':Sequelize[_0x55de('0x1')],'comment':_0x55de('0xa')},'data5':{'type':Sequelize[_0x55de('0xb')],'comment':_0x55de('0xc')},'data6':{'type':Sequelize[_0x55de('0xb')],'comment':_0x55de('0xd')},'data7':{'type':Sequelize[_0x55de('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x66f6=['AmazonAWS','Google','MicrosoftAzure','Dynamics365','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','sequelize','exports','STRING','ENUM'];(function(_0x5d6e35,_0x4d1ac0){var _0x5d7ada=function(_0x2f7dd3){while(--_0x2f7dd3){_0x5d6e35['push'](_0x5d6e35['shift']());}};_0x5d7ada(++_0x4d1ac0);}(_0x66f6,0x184));var _0x666f=function(_0x1c2838,_0x1dffa8){_0x1c2838=_0x1c2838-0x0;var _0x25d5af=_0x66f6[_0x1c2838];return _0x25d5af;};'use strict';var Sequelize=require(_0x666f('0x0'));module[_0x666f('0x1')]={'name':{'type':Sequelize[_0x666f('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x666f('0x3')](_0x666f('0x4'),_0x666f('0x5'),_0x666f('0x6')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x666f('0x3')]('Outlook365',_0x666f('0x7'))},'data1':{'type':Sequelize[_0x666f('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0x666f('0x2')],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0x666f('0x2')],'comment':_0x666f('0x8')},'data4':{'type':Sequelize[_0x666f('0x2')],'comment':_0x666f('0x9')},'data5':{'type':Sequelize['TEXT'],'comment':_0x666f('0xa')},'data6':{'type':Sequelize[_0x666f('0xb')],'comment':_0x666f('0xc')},'data7':{'type':Sequelize[_0x666f('0xb')],'comment':_0x666f('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 013993c..331036d 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 _0x936c=['attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','service','MicrosoftAzure','decryptString','data3','catch','params','fields','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','create','find','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','get','state','Invalid\x20state\x20parameter','parse','from','base64','toString','ascii','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','./cloudProvider.oauth','redis','defaults','localhost','socket.io-emitter','sendStatus','status','end','json','limit','undefined','count','offset','set','Content-Range','update','destroy','error','stack','name','slice','index','map','CloudProvider','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x936c,0x1c7));var _0xc936=function(_0x5d42f4,_0x4b7188){_0x5d42f4=_0x5d42f4-0x0;var _0x4cf05c=_0x936c[_0x5d42f4];return _0x4cf05c;};'use strict';var _=require(_0xc936('0x0'));var Redis=require(_0xc936('0x1'));var qs=require(_0xc936('0x2'));var encryptor=require(_0xc936('0x3'));var config=require(_0xc936('0x4'));var logger=require(_0xc936('0x5'))(_0xc936('0x6'));var db=require('../../mysqldb')['db'];var oauth=require(_0xc936('0x7'));config[_0xc936('0x8')]=_[_0xc936('0x9')](config['redis'],{'host':_0xc936('0xa'),'port':0x18eb});var socket=require(_0xc936('0xb'))(new Redis(config[_0xc936('0x8')]));var redis=new Redis(config[_0xc936('0x8')]);function respondWithStatusCode(_0x2de10a,_0x38c7da){_0x38c7da=_0x38c7da||0xcc;return function(_0x2ffb3c){if(_0x2ffb3c){return _0x2de10a[_0xc936('0xc')](_0x38c7da);}return _0x2de10a[_0xc936('0xd')](_0x38c7da)[_0xc936('0xe')]();};}function respondWithResult(_0x26b887,_0x3556df){_0x3556df=_0x3556df||0xc8;return function(_0x29a008){if(_0x29a008){return _0x26b887['status'](_0x3556df)[_0xc936('0xf')](_0x29a008);}};}function respondWithFilteredResult(_0x2837fd,_0x4702ed){return function(_0x5637ad){if(_0x5637ad){var _0x714c7=typeof _0x4702ed['offset']==='undefined'&&typeof _0x4702ed[_0xc936('0x10')]===_0xc936('0x11');var _0x2c79f7=_0x5637ad[_0xc936('0x12')];var _0x5643ca=_0x714c7?0x0:_0x4702ed['offset'];var _0x1a8223=_0x714c7?_0x5637ad[_0xc936('0x12')]:_0x4702ed[_0xc936('0x13')]+_0x4702ed[_0xc936('0x10')];var _0x9fce11;if(_0x1a8223>=_0x2c79f7){_0x1a8223=_0x2c79f7;_0x9fce11=0xc8;}else{_0x9fce11=0xce;}_0x2837fd['status'](_0x9fce11);return _0x2837fd[_0xc936('0x14')](_0xc936('0x15'),_0x5643ca+'-'+_0x1a8223+'/'+_0x2c79f7)[_0xc936('0xf')](_0x5637ad);}return null;};}function saveUpdates(_0x54f34d){return function(_0x14b126){if(_0x14b126){return _0x14b126[_0xc936('0x16')](_0x54f34d)['then'](function(_0x19921a){return _0x19921a;});}return null;};}function removeEntity(_0x375776){return function(_0x244bfe){if(_0x244bfe){return _0x244bfe[_0xc936('0x17')]()['then'](function(){_0x375776[_0xc936('0xd')](0xcc)[_0xc936('0xe')]();});}};}function handleEntityNotFound(_0x4ac351){return function(_0x15bb2e){if(!_0x15bb2e){_0x4ac351[_0xc936('0xc')](0x194);}return _0x15bb2e;};}function handleError(_0x43bb25,_0x37c561){_0x37c561=_0x37c561||0x1f4;return function(_0x2a4e43){logger[_0xc936('0x18')](_0x2a4e43[_0xc936('0x19')]);if(_0x2a4e43['name']){delete _0x2a4e43[_0xc936('0x1a')];}_0x43bb25['status'](_0x37c561)['send'](_0x2a4e43);};}function maskClientSecret(_0x35ed80){return _['padEnd'](_0x35ed80[_0xc936('0x1b')](0x0,0x3),0x14,'*');}exports[_0xc936('0x1c')]=function(_0x47f9fb,_0x2db42f){var _0x317514={},_0x33520c={},_0x2456a2={'count':0x0,'rows':[]};var _0x43d6b7=_[_0xc936('0x1d')](db[_0xc936('0x1e')][_0xc936('0x1f')],function(_0x5264e0){return{'name':_0x5264e0[_0xc936('0x20')],'type':_0x5264e0[_0xc936('0x21')][_0xc936('0x22')]};});_0x33520c[_0xc936('0x23')]=_[_0xc936('0x1d')](_0x43d6b7,_0xc936('0x1a'));_0x33520c[_0xc936('0x24')]=_[_0xc936('0x25')](_0x47f9fb[_0xc936('0x24')]);_0x33520c[_0xc936('0x26')]=_[_0xc936('0x27')](_0x33520c[_0xc936('0x23')],_0x33520c[_0xc936('0x24')]);_0x317514[_0xc936('0x28')]=_[_0xc936('0x27')](_0x33520c[_0xc936('0x23')],qs['fields'](_0x47f9fb[_0xc936('0x24')]['fields']));_0x317514[_0xc936('0x28')]=_0x317514[_0xc936('0x28')][_0xc936('0x29')]?_0x317514[_0xc936('0x28')]:_0x33520c[_0xc936('0x23')];if(!_0x47f9fb[_0xc936('0x24')][_0xc936('0x2a')](_0xc936('0x2b'))){_0x317514[_0xc936('0x10')]=qs['limit'](_0x47f9fb['query']['limit']);_0x317514[_0xc936('0x13')]=qs[_0xc936('0x13')](_0x47f9fb['query']['offset']);}_0x317514[_0xc936('0x2c')]=qs[_0xc936('0x2d')](_0x47f9fb[_0xc936('0x24')][_0xc936('0x2d')]);_0x317514[_0xc936('0x2e')]=qs['filters'](_[_0xc936('0x2f')](_0x47f9fb[_0xc936('0x24')],_0x33520c[_0xc936('0x26')]),_0x43d6b7);if(_0x47f9fb[_0xc936('0x24')][_0xc936('0x30')]){_0x317514[_0xc936('0x2e')]=_[_0xc936('0x31')](_0x317514[_0xc936('0x2e')],{'$or':_[_0xc936('0x1d')](_0x43d6b7,function(_0xe22cf6){if(_0xe22cf6[_0xc936('0x21')]!==_0xc936('0x32')){var _0x5ce3c1={};_0x5ce3c1[_0xe22cf6[_0xc936('0x1a')]]={'$like':'%'+_0x47f9fb[_0xc936('0x24')][_0xc936('0x30')]+'%'};return _0x5ce3c1;}})});}_0x317514=_['merge']({},_0x317514,_0x47f9fb[_0xc936('0x33')]);var _0x253c95={'where':_0x317514[_0xc936('0x2e')]};return db[_0xc936('0x1e')][_0xc936('0x12')](_0x253c95)[_0xc936('0x34')](function(_0x4f04c6){_0x2456a2[_0xc936('0x12')]=_0x4f04c6;if(_0x47f9fb[_0xc936('0x24')][_0xc936('0x35')]){_0x317514[_0xc936('0x36')]=[{'all':!![]}];}return db[_0xc936('0x1e')][_0xc936('0x37')](_0x317514);})[_0xc936('0x34')](function(_0x370b2c){_0x2456a2[_0xc936('0x38')]=_[_0xc936('0x1d')](_0x370b2c,function(_0x4e1a5d){if(_0x4e1a5d[_0xc936('0x39')]===_0xc936('0x3a')){var _0x18d38b=encryptor[_0xc936('0x3b')](_0x4e1a5d['data3']);_0x4e1a5d[_0xc936('0x3c')]=maskClientSecret(_0x18d38b);}return _0x4e1a5d;});return _0x2456a2;})[_0xc936('0x34')](respondWithFilteredResult(_0x2db42f,_0x317514))[_0xc936('0x3d')](handleError(_0x2db42f,null));};exports['show']=function(_0x315892,_0xf5e74d){var _0x5ef564={'raw':!![],'where':{'id':_0x315892[_0xc936('0x3e')]['id']}},_0x3c6e7e={};_0x3c6e7e[_0xc936('0x23')]=_[_0xc936('0x25')](db[_0xc936('0x1e')][_0xc936('0x1f')]);_0x3c6e7e[_0xc936('0x24')]=_['keys'](_0x315892['query']);_0x3c6e7e[_0xc936('0x26')]=_['intersection'](_0x3c6e7e[_0xc936('0x23')],_0x3c6e7e['query']);_0x5ef564[_0xc936('0x28')]=_['intersection'](_0x3c6e7e[_0xc936('0x23')],qs[_0xc936('0x3f')](_0x315892['query'][_0xc936('0x3f')]));_0x5ef564[_0xc936('0x28')]=_0x5ef564[_0xc936('0x28')][_0xc936('0x29')]?_0x5ef564[_0xc936('0x28')]:_0x3c6e7e[_0xc936('0x23')];if(_0x315892['query'][_0xc936('0x35')]){_0x5ef564[_0xc936('0x36')]=[{'all':!![]}];}_0x5ef564=_[_0xc936('0x31')]({},_0x5ef564,_0x315892[_0xc936('0x33')]);return db['CloudProvider']['find'](_0x5ef564)[_0xc936('0x34')](handleEntityNotFound(_0xf5e74d,null))['then'](function(_0x4cea0a){if(_0x4cea0a['service']===_0xc936('0x3a')){var _0x56321d=encryptor['decryptString'](_0x4cea0a[_0xc936('0x3c')]);_0x4cea0a['data3']=maskClientSecret(_0x56321d);}return _0x4cea0a;})[_0xc936('0x34')](respondWithResult(_0xf5e74d,null))[_0xc936('0x3d')](handleError(_0xf5e74d,null));};exports['create']=function(_0x54c993,_0x5b165f){if(!_0x54c993[_0xc936('0x40')]['name'])throw new Error(_0xc936('0x41'));if(!_0x54c993[_0xc936('0x40')][_0xc936('0x39')])throw new Error(_0xc936('0x42'));var _0x3f5157=db[_0xc936('0x1e')]['rawAttributes'][_0xc936('0x39')]['values'];if(!_0x3f5157[_0xc936('0x43')](_0x54c993['body']['service']))throw new Error(_0xc936('0x44')+_0x3f5157['join'](',\x20'));if(_0x54c993['body']['service']===_0xc936('0x3a')&&_0x54c993[_0xc936('0x40')][_0xc936('0x3c')]){_0x54c993[_0xc936('0x40')]['data3']=encryptor[_0xc936('0x45')](_0x54c993[_0xc936('0x40')][_0xc936('0x3c')]);}return db[_0xc936('0x1e')][_0xc936('0x46')](_0x54c993[_0xc936('0x40')],{})['then'](respondWithResult(_0x5b165f,0xc9))[_0xc936('0x3d')](handleError(_0x5b165f,null));};exports['update']=function(_0x26e809,_0x9674ce){if(_0x26e809['body']['id']){delete _0x26e809[_0xc936('0x40')]['id'];}return db[_0xc936('0x1e')][_0xc936('0x47')]({'where':{'id':_0x26e809['params']['id']}})[_0xc936('0x34')](handleEntityNotFound(_0x9674ce,null))[_0xc936('0x34')](function(_0x2ded5b){if(_0x2ded5b['service']===_0xc936('0x3a')&&_0x26e809['body'][_0xc936('0x3c')]){_0x26e809[_0xc936('0x40')][_0xc936('0x3c')]=encryptor['encryptString'](_0x26e809[_0xc936('0x40')][_0xc936('0x3c')]);}return _0x2ded5b;})['then'](saveUpdates(_0x26e809[_0xc936('0x40')],null))[_0xc936('0x34')](respondWithResult(_0x9674ce,null))[_0xc936('0x3d')](handleError(_0x9674ce,null));};exports[_0xc936('0x17')]=function(_0x1981bd,_0x567e71){return db[_0xc936('0x1e')][_0xc936('0x47')]({'where':{'id':_0x1981bd['params']['id']}})[_0xc936('0x34')](handleEntityNotFound(_0x567e71,null))['then'](removeEntity(_0x567e71,null))[_0xc936('0x3d')](handleError(_0x567e71,null));};exports[_0xc936('0x48')]=function(_0x25fd86,_0x35c109){return db[_0xc936('0x1e')][_0xc936('0x49')]({'where':{'id':_0x25fd86[_0xc936('0x3e')]['id']},'raw':!![]})['then'](function(_0x47043d){if(!_0x47043d)return _0x35c109[_0xc936('0xc')](0x194);return{'url':oauth[_0xc936('0x4a')](_0x47043d,_0x25fd86[_0xc936('0x4b')]['id'])};})[_0xc936('0x34')](respondWithResult(_0x35c109,null))[_0xc936('0x3d')](handleError(_0x35c109,null));};exports['oauth2MicrosoftCallback']=function(_0x561c65,_0x105756){var _0x5c54d0=_0x561c65[_0xc936('0x40')];var _0x379eab;var _0x3bb4a6;if(_0x5c54d0[_0xc936('0x18')])throw _0x5c54d0;redis[_0xc936('0x4c')](_0x5c54d0[_0xc936('0x4d')])[_0xc936('0x34')](function(_0x11e0cd){if(!_0x11e0cd)throw new Error(_0xc936('0x4e'));_0x379eab=JSON[_0xc936('0x4f')](_0x11e0cd);var _0x49fd5b=Buffer[_0xc936('0x50')](_0x5c54d0['state'],_0xc936('0x51'))[_0xc936('0x52')](_0xc936('0x53'));_0x3bb4a6=JSON[_0xc936('0x4f')](_0x49fd5b);if(!oauth[_0xc936('0x54')](_0x5c54d0['id_token'],_0x379eab['oauth2Claims']))throw new Error(_0xc936('0x55'));redis[_0xc936('0x56')](_0x5c54d0[_0xc936('0x4d')]);return oauth[_0xc936('0x57')](_0x5c54d0[_0xc936('0x58')],_0x379eab);})[_0xc936('0x34')](function(_0x26a1d2){_0x379eab[_0xc936('0x59')]=_0x26a1d2['access_token'];_0x379eab['data6']=_0x26a1d2[_0xc936('0x5a')];return db['CloudProvider']['update']({'data5':_0x379eab['data5'],'data6':_0x379eab[_0xc936('0x5b')]},{'where':{'id':_0x379eab['id']}});})['then'](function(){oauth[_0xc936('0x5c')](_0x379eab);socket[_0xc936('0x5d')](_0xc936('0x5e'),{'id':_0x3bb4a6['id']});return;})[_0xc936('0x34')](respondWithStatusCode(_0x105756,null))[_0xc936('0x3d')](function(_0x1879e3){if(_0x3bb4a6){socket[_0xc936('0x5d')](_0xc936('0x5f'),{'id':_0x3bb4a6['id']});}if(!_0x379eab){logger['error'](_0xc936('0x60'),_0x1879e3);return _0x105756[_0xc936('0xd')](0x1f4)['send'](_0x1879e3[_0xc936('0x61')]);}logger[_0xc936('0x18')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x379eab['id'],JSON[_0xc936('0x62')](_0x1879e3));});};
\ No newline at end of file
+var _0x3423=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','update','then','destroy','error','stack','name','send','index','CloudProvider','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','includeAll','include','findAll','service','MicrosoftAzure','data3','catch','params','intersection','find','decryptString','create','Name\x20parameter\x20not\x20specified','body','Service\x20parameter\x20not\x20specified','values','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','base64','toString','ascii','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','access_token','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor','../../config/environment','api','./cloudProvider.oauth','redis','localhost','socket.io-emitter'];(function(_0x5f1207,_0x224664){var _0x14b9d6=function(_0x2a4917){while(--_0x2a4917){_0x5f1207['push'](_0x5f1207['shift']());}};_0x14b9d6(++_0x224664);}(_0x3423,0x15e));var _0x3342=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3423[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3342('0x0'));var Redis=require(_0x3342('0x1'));var qs=require(_0x3342('0x2'));var encryptor=require(_0x3342('0x3'));var config=require(_0x3342('0x4'));var logger=require('../../config/logger')(_0x3342('0x5'));var db=require('../../mysqldb')['db'];var oauth=require(_0x3342('0x6'));config[_0x3342('0x7')]=_['defaults'](config['redis'],{'host':_0x3342('0x8'),'port':0x18eb});var socket=require(_0x3342('0x9'))(new Redis(config[_0x3342('0x7')]));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x380c75,_0x13b45a){_0x13b45a=_0x13b45a||0xcc;return function(_0x4512db){if(_0x4512db){return _0x380c75[_0x3342('0xa')](_0x13b45a);}return _0x380c75[_0x3342('0xb')](_0x13b45a)[_0x3342('0xc')]();};}function respondWithResult(_0x43909b,_0x4e2ecb){_0x4e2ecb=_0x4e2ecb||0xc8;return function(_0x12cbab){if(_0x12cbab){return _0x43909b[_0x3342('0xb')](_0x4e2ecb)['json'](_0x12cbab);}};}function respondWithFilteredResult(_0x55d6d8,_0x54929d){return function(_0x3d16f0){if(_0x3d16f0){var _0x35a35a=typeof _0x54929d[_0x3342('0xd')]===_0x3342('0xe')&&typeof _0x54929d[_0x3342('0xf')]===_0x3342('0xe');var _0x26588c=_0x3d16f0[_0x3342('0x10')];var _0x19d0c3=_0x35a35a?0x0:_0x54929d['offset'];var _0xb887ce=_0x35a35a?_0x3d16f0[_0x3342('0x10')]:_0x54929d['offset']+_0x54929d[_0x3342('0xf')];var _0x3912eb;if(_0xb887ce>=_0x26588c){_0xb887ce=_0x26588c;_0x3912eb=0xc8;}else{_0x3912eb=0xce;}_0x55d6d8[_0x3342('0xb')](_0x3912eb);return _0x55d6d8[_0x3342('0x11')](_0x3342('0x12'),_0x19d0c3+'-'+_0xb887ce+'/'+_0x26588c)['json'](_0x3d16f0);}return null;};}function saveUpdates(_0x4d8915){return function(_0x3ee71e){if(_0x3ee71e){return _0x3ee71e[_0x3342('0x13')](_0x4d8915)[_0x3342('0x14')](function(_0xe16eb1){return _0xe16eb1;});}return null;};}function removeEntity(_0x5b1cab){return function(_0x7e69de){if(_0x7e69de){return _0x7e69de[_0x3342('0x15')]()[_0x3342('0x14')](function(){_0x5b1cab[_0x3342('0xb')](0xcc)[_0x3342('0xc')]();});}};}function handleEntityNotFound(_0x246ce9){return function(_0x3b2785){if(!_0x3b2785){_0x246ce9[_0x3342('0xa')](0x194);}return _0x3b2785;};}function handleError(_0x330c73,_0x372cf3){_0x372cf3=_0x372cf3||0x1f4;return function(_0x592564){logger[_0x3342('0x16')](_0x592564[_0x3342('0x17')]);if(_0x592564['name']){delete _0x592564[_0x3342('0x18')];}_0x330c73[_0x3342('0xb')](_0x372cf3)[_0x3342('0x19')](_0x592564);};}function maskClientSecret(_0xa113be){return _['padEnd'](_0xa113be['slice'](0x0,0x3),0x14,'*');}exports[_0x3342('0x1a')]=function(_0x3dfa08,_0x219fe2){var _0x2759bc={},_0x590e76={},_0x4258cc={'count':0x0,'rows':[]};var _0x5a40c9=_['map'](db[_0x3342('0x1b')][_0x3342('0x1c')],function(_0x1b378e){return{'name':_0x1b378e[_0x3342('0x1d')],'type':_0x1b378e[_0x3342('0x1e')][_0x3342('0x1f')]};});_0x590e76['model']=_['map'](_0x5a40c9,_0x3342('0x18'));_0x590e76[_0x3342('0x20')]=_[_0x3342('0x21')](_0x3dfa08[_0x3342('0x20')]);_0x590e76[_0x3342('0x22')]=_['intersection'](_0x590e76[_0x3342('0x23')],_0x590e76[_0x3342('0x20')]);_0x2759bc[_0x3342('0x24')]=_['intersection'](_0x590e76[_0x3342('0x23')],qs[_0x3342('0x25')](_0x3dfa08['query']['fields']));_0x2759bc[_0x3342('0x24')]=_0x2759bc[_0x3342('0x24')][_0x3342('0x26')]?_0x2759bc[_0x3342('0x24')]:_0x590e76[_0x3342('0x23')];if(!_0x3dfa08[_0x3342('0x20')][_0x3342('0x27')](_0x3342('0x28'))){_0x2759bc['limit']=qs[_0x3342('0xf')](_0x3dfa08[_0x3342('0x20')][_0x3342('0xf')]);_0x2759bc[_0x3342('0xd')]=qs[_0x3342('0xd')](_0x3dfa08[_0x3342('0x20')][_0x3342('0xd')]);}_0x2759bc[_0x3342('0x29')]=qs[_0x3342('0x2a')](_0x3dfa08['query']['sort']);_0x2759bc[_0x3342('0x2b')]=qs[_0x3342('0x22')](_[_0x3342('0x2c')](_0x3dfa08[_0x3342('0x20')],_0x590e76['filters']),_0x5a40c9);if(_0x3dfa08[_0x3342('0x20')][_0x3342('0x2d')]){_0x2759bc['where']=_[_0x3342('0x2e')](_0x2759bc[_0x3342('0x2b')],{'$or':_[_0x3342('0x2f')](_0x5a40c9,function(_0x3f2add){if(_0x3f2add[_0x3342('0x1e')]!==_0x3342('0x30')){var _0x5ab314={};_0x5ab314[_0x3f2add[_0x3342('0x18')]]={'$like':'%'+_0x3dfa08[_0x3342('0x20')][_0x3342('0x2d')]+'%'};return _0x5ab314;}})});}_0x2759bc=_[_0x3342('0x2e')]({},_0x2759bc,_0x3dfa08['options']);var _0xdf7fba={'where':_0x2759bc[_0x3342('0x2b')]};return db[_0x3342('0x1b')][_0x3342('0x10')](_0xdf7fba)['then'](function(_0x33c27f){_0x4258cc[_0x3342('0x10')]=_0x33c27f;if(_0x3dfa08[_0x3342('0x20')][_0x3342('0x31')]){_0x2759bc[_0x3342('0x32')]=[{'all':!![]}];}return db[_0x3342('0x1b')][_0x3342('0x33')](_0x2759bc);})['then'](function(_0xf131c2){_0x4258cc['rows']=_[_0x3342('0x2f')](_0xf131c2,function(_0x53f857){if(_0x53f857[_0x3342('0x34')]===_0x3342('0x35')){var _0x2d4866=encryptor['decryptString'](_0x53f857[_0x3342('0x36')]);_0x53f857[_0x3342('0x36')]=maskClientSecret(_0x2d4866);}return _0x53f857;});return _0x4258cc;})[_0x3342('0x14')](respondWithFilteredResult(_0x219fe2,_0x2759bc))[_0x3342('0x37')](handleError(_0x219fe2,null));};exports['show']=function(_0x2c1bf8,_0x5cf142){var _0x2d42b2={'raw':!![],'where':{'id':_0x2c1bf8[_0x3342('0x38')]['id']}},_0x5e3daa={};_0x5e3daa['model']=_[_0x3342('0x21')](db[_0x3342('0x1b')][_0x3342('0x1c')]);_0x5e3daa[_0x3342('0x20')]=_['keys'](_0x2c1bf8['query']);_0x5e3daa[_0x3342('0x22')]=_[_0x3342('0x39')](_0x5e3daa[_0x3342('0x23')],_0x5e3daa['query']);_0x2d42b2[_0x3342('0x24')]=_[_0x3342('0x39')](_0x5e3daa[_0x3342('0x23')],qs[_0x3342('0x25')](_0x2c1bf8[_0x3342('0x20')][_0x3342('0x25')]));_0x2d42b2[_0x3342('0x24')]=_0x2d42b2[_0x3342('0x24')][_0x3342('0x26')]?_0x2d42b2[_0x3342('0x24')]:_0x5e3daa[_0x3342('0x23')];if(_0x2c1bf8[_0x3342('0x20')][_0x3342('0x31')]){_0x2d42b2[_0x3342('0x32')]=[{'all':!![]}];}_0x2d42b2=_[_0x3342('0x2e')]({},_0x2d42b2,_0x2c1bf8['options']);return db[_0x3342('0x1b')][_0x3342('0x3a')](_0x2d42b2)[_0x3342('0x14')](handleEntityNotFound(_0x5cf142,null))['then'](function(_0x1b6065){if(_0x1b6065['service']===_0x3342('0x35')){var _0x567331=encryptor[_0x3342('0x3b')](_0x1b6065[_0x3342('0x36')]);_0x1b6065[_0x3342('0x36')]=maskClientSecret(_0x567331);}return _0x1b6065;})[_0x3342('0x14')](respondWithResult(_0x5cf142,null))[_0x3342('0x37')](handleError(_0x5cf142,null));};exports[_0x3342('0x3c')]=function(_0x5b5b7d,_0x2e4799){if(!_0x5b5b7d['body']['name'])throw new Error(_0x3342('0x3d'));if(!_0x5b5b7d[_0x3342('0x3e')][_0x3342('0x34')])throw new Error(_0x3342('0x3f'));var _0x50316d=db['CloudProvider']['rawAttributes'][_0x3342('0x34')][_0x3342('0x40')];if(!_0x50316d['includes'](_0x5b5b7d['body'][_0x3342('0x34')]))throw new Error(_0x3342('0x41')+_0x50316d['join'](',\x20'));if(_0x5b5b7d['body'][_0x3342('0x34')]===_0x3342('0x35')&&_0x5b5b7d[_0x3342('0x3e')][_0x3342('0x36')]){_0x5b5b7d[_0x3342('0x3e')][_0x3342('0x36')]=encryptor[_0x3342('0x42')](_0x5b5b7d[_0x3342('0x3e')][_0x3342('0x36')]);}return db[_0x3342('0x1b')][_0x3342('0x3c')](_0x5b5b7d[_0x3342('0x3e')],{})['then'](respondWithResult(_0x2e4799,0xc9))[_0x3342('0x37')](handleError(_0x2e4799,null));};exports['update']=function(_0x4b7e4d,_0x1726cc){if(_0x4b7e4d['body']['id']){delete _0x4b7e4d[_0x3342('0x3e')]['id'];}return db[_0x3342('0x1b')][_0x3342('0x3a')]({'where':{'id':_0x4b7e4d['params']['id']}})[_0x3342('0x14')](handleEntityNotFound(_0x1726cc,null))['then'](function(_0x42affc){if(_0x42affc[_0x3342('0x34')]==='MicrosoftAzure'&&_0x4b7e4d['body'][_0x3342('0x36')]){_0x4b7e4d['body'][_0x3342('0x36')]=encryptor[_0x3342('0x42')](_0x4b7e4d[_0x3342('0x3e')][_0x3342('0x36')]);}return _0x42affc;})['then'](saveUpdates(_0x4b7e4d[_0x3342('0x3e')],null))[_0x3342('0x14')](respondWithResult(_0x1726cc,null))[_0x3342('0x37')](handleError(_0x1726cc,null));};exports[_0x3342('0x15')]=function(_0x3e5bcf,_0x233dd4){return db[_0x3342('0x1b')]['find']({'where':{'id':_0x3e5bcf[_0x3342('0x38')]['id']}})[_0x3342('0x14')](handleEntityNotFound(_0x233dd4,null))[_0x3342('0x14')](removeEntity(_0x233dd4,null))[_0x3342('0x37')](handleError(_0x233dd4,null));};exports['oauth2MicrosoftAuthorize']=function(_0x1326a8,_0x28090b){return db[_0x3342('0x1b')]['findOne']({'where':{'id':_0x1326a8[_0x3342('0x38')]['id']},'raw':!![]})[_0x3342('0x14')](function(_0x530e0f){if(!_0x530e0f)return _0x28090b[_0x3342('0xa')](0x194);return{'url':oauth[_0x3342('0x43')](_0x530e0f,_0x1326a8[_0x3342('0x44')]['id'])};})['then'](respondWithResult(_0x28090b,null))[_0x3342('0x37')](handleError(_0x28090b,null));};exports[_0x3342('0x45')]=function(_0x2d6b9e,_0x308261){var _0x379bc4=_0x2d6b9e[_0x3342('0x3e')];var _0xffedf1;var _0x59e3e0;if(_0x379bc4[_0x3342('0x16')])throw _0x379bc4;redis[_0x3342('0x46')](_0x379bc4[_0x3342('0x47')])[_0x3342('0x14')](function(_0x5f288f){if(!_0x5f288f)throw new Error(_0x3342('0x48'));_0xffedf1=JSON[_0x3342('0x49')](_0x5f288f);var _0x465321=Buffer['from'](_0x379bc4[_0x3342('0x47')],_0x3342('0x4a'))[_0x3342('0x4b')](_0x3342('0x4c'));_0x59e3e0=JSON[_0x3342('0x49')](_0x465321);if(!oauth[_0x3342('0x4d')](_0x379bc4['id_token'],_0xffedf1[_0x3342('0x4e')]))throw new Error(_0x3342('0x4f'));redis[_0x3342('0x50')](_0x379bc4[_0x3342('0x47')]);return oauth['getOauth2MicrosoftAccessToken'](_0x379bc4['code'],_0xffedf1);})[_0x3342('0x14')](function(_0x473eca){_0xffedf1['data5']=_0x473eca[_0x3342('0x51')];_0xffedf1[_0x3342('0x52')]=_0x473eca[_0x3342('0x53')];return db[_0x3342('0x1b')][_0x3342('0x13')]({'data5':_0xffedf1['data5'],'data6':_0xffedf1[_0x3342('0x52')]},{'where':{'id':_0xffedf1['id']}});})[_0x3342('0x14')](function(){oauth['startRefreshInterval'](_0xffedf1);socket[_0x3342('0x54')](_0x3342('0x55'),{'id':_0x59e3e0['id']});return;})['then'](respondWithStatusCode(_0x308261,null))[_0x3342('0x37')](function(_0x7a4cfe){if(_0x59e3e0){socket[_0x3342('0x54')](_0x3342('0x56'),{'id':_0x59e3e0['id']});}if(!_0xffedf1){logger['error']('Invalid\x20authentication\x20state\x20parameter',_0x7a4cfe);return _0x308261[_0x3342('0xb')](0x1f4)['send'](_0x7a4cfe[_0x3342('0x57')]);}logger['error'](_0x3342('0x58'),_0xffedf1['id'],JSON[_0x3342('0x59')](_0x7a4cfe));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index fca3c03..8a1de72 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 _0xe91b=['define','cloud_providers','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x218577,_0x1c0704){var _0x4c6b7c=function(_0x17900d){while(--_0x17900d){_0x218577['push'](_0x218577['shift']());}};_0x4c6b7c(++_0x1c0704);}(_0xe91b,0x161));var _0xbe91=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xe91b[_0x24061a];return _0x82054e;};'use strict';var _=require(_0xbe91('0x0'));var util=require('util');var logger=require(_0xbe91('0x1'))(_0xbe91('0x2'));var moment=require(_0xbe91('0x3'));var BPromise=require(_0xbe91('0x4'));var rp=require(_0xbe91('0x5'));var fs=require('fs');var path=require(_0xbe91('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module['exports']=function(_0x116ffb,_0x4bb44c){return _0x116ffb[_0xbe91('0x7')]('CloudProvider',attributes,{'tableName':_0xbe91('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xae99=['lodash','util','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','exports','CloudProvider'];(function(_0x6cf1fa,_0x63a63e){var _0x246ae8=function(_0x4ed3fb){while(--_0x4ed3fb){_0x6cf1fa['push'](_0x6cf1fa['shift']());}};_0x246ae8(++_0x63a63e);}(_0xae99,0x172));var _0x9ae9=function(_0x2b10c6,_0x185590){_0x2b10c6=_0x2b10c6-0x0;var _0x3789d2=_0xae99[_0x2b10c6];return _0x3789d2;};'use strict';var _=require(_0x9ae9('0x0'));var util=require(_0x9ae9('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9ae9('0x2'));var rp=require(_0x9ae9('0x3'));var fs=require('fs');var path=require(_0x9ae9('0x4'));var rimraf=require(_0x9ae9('0x5'));var config=require(_0x9ae9('0x6'));var attributes=require(_0x9ae9('0x7'));module[_0x9ae9('0x8')]=function(_0x49066e,_0x5a1ba5){return _0x49066e['define'](_0x9ae9('0x9'),attributes,{'tableName':'cloud_providers','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.oauth.js b/server/api/cloudProvider/cloudProvider.oauth.js
index 8e0761e..c5c8acd 100644
--- a/server/api/cloudProvider/cloudProvider.oauth.js
+++ b/server/api/cloudProvider/cloudProvider.oauth.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x12e3=['https://outlook.office.com/SMTP.Send','/authorize','/token','map','type','Dynamics365','push','data7','/.default','join','Outlook365','https://outlook.office365.com/IMAP.AccessAsUser.All','{TENANT_ID}','from','stringify','base64','randomBytes','hex','client_id','data1','response_type','redirect_uri','response_mode','form_post','scope','state','prompt','key','value','oauth2Claims','replace','oauth2/','payload','iss','aud','audience','nonce','isAfter','exp','resolve','data3','findOne','then','refresh_token','decryptString','POST','data5','access_token','CloudProvider','update','data6','catch','authorization_code','intervals','bind','findAll','all','inspect','error','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','request-promise','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','openid','profile','email','offline_access','https://outlook.office.com/POP.AccessAsUser.All'];(function(_0x3a2a33,_0x29372a){var _0x10d6d2=function(_0x2c63b7){while(--_0x2c63b7){_0x3a2a33['push'](_0x3a2a33['shift']());}};_0x10d6d2(++_0x29372a);}(_0x12e3,0x127));var _0x312e=function(_0x4cdcb8,_0x44fc53){_0x4cdcb8=_0x4cdcb8-0x0;var _0x29996d=_0x12e3[_0x4cdcb8];return _0x29996d;};'use strict';var _=require(_0x312e('0x0'));var crypto=require(_0x312e('0x1'));var jwt=require(_0x312e('0x2'));var moment=require('moment');var Redis=require('ioredis');var rp=require(_0x312e('0x3'));var util=require('util');var encryptor=require(_0x312e('0x4'));var config=require(_0x312e('0x5'));var logger=require(_0x312e('0x6'))(_0x312e('0x7'));var schedule=require(_0x312e('0x8'));var db=require(_0x312e('0x9'))['db'];config[_0x312e('0xa')]=_[_0x312e('0xb')](config[_0x312e('0xa')],{'host':'localhost','port':0x18eb});var redis=new Redis(config[_0x312e('0xa')]);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x312e('0xc'),_0x312e('0xd'),_0x312e('0xe'),_0x312e('0xf'),'https://outlook.office365.com/IMAP.AccessAsUser.All',_0x312e('0x10'),_0x312e('0x11')],'Dynamics365':[_0x312e('0xc'),_0x312e('0xf')]};var MICROSOFT_AUTH_ENDPOINT=_0x312e('0x12');var MICROSOFT_TOKEN_ENDPOINT=_0x312e('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x5d2ef5){var _0x2587a9=_[_0x312e('0x14')](AZURE_AUTH_SCOPES[_0x5d2ef5[_0x312e('0x15')]]);if(_0x5d2ef5[_0x312e('0x15')]===_0x312e('0x16'))_0x2587a9[_0x312e('0x17')](_0x5d2ef5[_0x312e('0x18')]+_0x312e('0x19'));return _0x2587a9[_0x312e('0x1a')]('\x20');}function getAccessTokenScope(_0x478998){if(_0x478998['type']===_0x312e('0x1b'))return _0x312e('0x1c');if(_0x478998[_0x312e('0x15')]===_0x312e('0x16'))return _0x478998[_0x312e('0x18')]+_0x312e('0x19');}function generateMicrosoftAuthorizationUrl(_0x3c2386,_0x437c10){var _0x26f61a=MICROSOFT_AUTH_URL['replace'](_0x312e('0x1d'),_0x3c2386['data2']);var _0x4aafb9=['code','id_token'];var _0x2dc6b0=Buffer[_0x312e('0x1e')](JSON[_0x312e('0x1f')]({'id':_0x437c10}))['toString'](_0x312e('0x20'));var _0x407ac9=crypto[_0x312e('0x21')](0x10)['toString'](_0x312e('0x22'));var _0x4966a3=getAuthorizationScopes(_0x3c2386);var _0x534a5b=[{'key':_0x312e('0x23'),'value':_0x3c2386[_0x312e('0x24')]},{'key':_0x312e('0x25'),'value':encodeURIComponent(_0x4aafb9[_0x312e('0x1a')]('\x20'))},{'key':_0x312e('0x26'),'value':_0x3c2386['data4']},{'key':_0x312e('0x27'),'value':_0x312e('0x28')},{'key':_0x312e('0x29'),'value':encodeURIComponent(_0x4966a3)},{'key':_0x312e('0x2a'),'value':_0x2dc6b0},{'key':'nonce','value':_0x407ac9},{'key':_0x312e('0x2b'),'value':'login'}];var _0x27e400=_0x26f61a+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x534a5b,function(_0x19e520){return _0x19e520[_0x312e('0x2c')]+'='+_0x19e520[_0x312e('0x2d')];})[_0x312e('0x1a')]('&');_0x3c2386[_0x312e('0x2e')]={'issuer':_0x26f61a[_0x312e('0x2f')](_0x312e('0x30'),''),'audience':_0x3c2386[_0x312e('0x24')],'state':_0x2dc6b0,'nonce':_0x407ac9};redis['set'](_0x2dc6b0,JSON[_0x312e('0x1f')](_0x3c2386));return _0x27e400;}function isValidIdToken(_0x1aebd6,_0x22e69c){try{var _0x423929=jwt['decode'](_0x1aebd6,{'complete':!![]});var _0x48da9a=_0x423929[_0x312e('0x31')];if(_0x48da9a[_0x312e('0x32')]!==_0x22e69c['issuer'])return![];if(_0x48da9a[_0x312e('0x33')]!==_0x22e69c[_0x312e('0x34')])return![];if(_0x48da9a[_0x312e('0x35')]!==_0x22e69c[_0x312e('0x35')])return![];if(moment()[_0x312e('0x36')](moment['unix'](_0x48da9a[_0x312e('0x37')])))return![];return!![];}catch(_0x34f221){throw _0x34f221;}}function refreshOauth2MicrosoftAccessToken(_0x138942){return Promise[_0x312e('0x38')]()['then'](function(){if(_0x138942[_0x312e('0x39')])return _0x138942;return db['CloudProvider'][_0x312e('0x3a')]({'where':{'id':_0x138942['id']},'raw':!![]});})[_0x312e('0x3b')](function(_0x5c88e5){var _0x597184={'grant_type':_0x312e('0x3c'),'refresh_token':_0x5c88e5['data6'],'scope':getAccessTokenScope(_0x5c88e5),'redirect_uri':_0x5c88e5['data4'],'client_id':_0x5c88e5[_0x312e('0x24')],'client_secret':encryptor[_0x312e('0x3d')](_0x5c88e5['data3'])};var _0x2a2a7e={'method':_0x312e('0x3e'),'uri':MICROSOFT_AUTH_URL[_0x312e('0x2f')](_0x312e('0x1d'),_0x5c88e5['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x597184,'json':!![]};return rp(_0x2a2a7e);})[_0x312e('0x3b')](function(_0x52d233){_0x138942[_0x312e('0x3f')]=_0x52d233[_0x312e('0x40')];_0x138942['data6']=_0x52d233[_0x312e('0x3c')];return db[_0x312e('0x41')][_0x312e('0x42')]({'data5':_0x138942['data5'],'data6':_0x138942[_0x312e('0x43')]},{'where':{'id':_0x138942['id']}});})[_0x312e('0x3b')](function(){return _0x138942;})[_0x312e('0x44')](function(_0xc3ba3f){logger['error']('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x138942['id'],_0xc3ba3f);});}function getOauth2MicrosoftAccessToken(_0x57c1e4,_0x1552fb){var _0x48db42={'grant_type':_0x312e('0x45'),'code':_0x57c1e4,'scope':getAccessTokenScope(_0x1552fb),'redirect_uri':_0x1552fb['data4'],'client_id':_0x1552fb['data1'],'client_secret':encryptor[_0x312e('0x3d')](_0x1552fb[_0x312e('0x39')])};var _0x53a3df={'method':'POST','uri':MICROSOFT_AUTH_URL[_0x312e('0x2f')](_0x312e('0x1d'),_0x1552fb['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x48db42,'json':!![]};return rp(_0x53a3df);}function startRefreshInterval(_0x3f053e){var _0x57f3bd=schedule[_0x312e('0x46')];if(_0x57f3bd[_0x3f053e['id']])clearInterval(_0x57f3bd[_0x3f053e['id']]);_0x57f3bd[_0x3f053e['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x312e('0x47')](this,{'id':_0x3f053e['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule['intervals']=_0x57f3bd;}function startAllRefreshIntervals(){return db[_0x312e('0x41')][_0x312e('0x48')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x312e('0x3b')](function(_0x254260){var _0x3e447e=_0x254260[_0x312e('0x14')](function(_0x291d3f){return refreshOauth2MicrosoftAccessToken(_0x291d3f)[_0x312e('0x3b')](function(_0x46e2fc){startRefreshInterval(_0x46e2fc);});});return Promise[_0x312e('0x49')](_0x3e447e);})['catch'](function(_0x1b441d){var _0x5d09a3=_0x1b441d?util[_0x312e('0x4a')](_0x1b441d,{'showHidden':![],'depth':null}):'';logger[_0x312e('0x4b')](_0x312e('0x4c'),_0x5d09a3);});}module[_0x312e('0x4d')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x4210=['iss','issuer','aud','audience','isAfter','unix','exp','resolve','data3','CloudProvider','findOne','then','data6','decryptString','POST','data5','access_token','refresh_token','update','catch','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','data4','intervals','bind','findAll','all','inspect','exports','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','/token','map','type','Dynamics365','data7','/.default','join','Outlook365','replace','{TENANT_ID}','data2','code','from','stringify','toString','base64','randomBytes','redirect_uri','form_post','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','data1','set','decode'];(function(_0x1d19c9,_0x145c6d){var _0x416e6a=function(_0x47bd3d){while(--_0x47bd3d){_0x1d19c9['push'](_0x1d19c9['shift']());}};_0x416e6a(++_0x145c6d);}(_0x4210,0x10e));var _0x0421=function(_0x2dac64,_0x538523){_0x2dac64=_0x2dac64-0x0;var _0x111fc4=_0x4210[_0x2dac64];return _0x111fc4;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0x0421('0x0'));var moment=require(_0x0421('0x1'));var Redis=require('ioredis');var rp=require(_0x0421('0x2'));var util=require(_0x0421('0x3'));var encryptor=require(_0x0421('0x4'));var config=require(_0x0421('0x5'));var logger=require(_0x0421('0x6'))(_0x0421('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0x0421('0x8'))['db'];config[_0x0421('0x9')]=_['defaults'](config[_0x0421('0x9')],{'host':_0x0421('0xa'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x0421('0xb');var AZURE_AUTH_SCOPES={'Outlook365':[_0x0421('0xc'),_0x0421('0xd'),_0x0421('0xe'),_0x0421('0xf'),_0x0421('0x10'),_0x0421('0x11'),_0x0421('0x12')],'Dynamics365':[_0x0421('0xc'),_0x0421('0xf')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT=_0x0421('0x13');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x223328){var _0x528269=_[_0x0421('0x14')](AZURE_AUTH_SCOPES[_0x223328[_0x0421('0x15')]]);if(_0x223328[_0x0421('0x15')]===_0x0421('0x16'))_0x528269['push'](_0x223328[_0x0421('0x17')]+_0x0421('0x18'));return _0x528269[_0x0421('0x19')]('\x20');}function getAccessTokenScope(_0x1eeb71){if(_0x1eeb71[_0x0421('0x15')]===_0x0421('0x1a'))return _0x0421('0x10');if(_0x1eeb71['type']===_0x0421('0x16'))return _0x1eeb71[_0x0421('0x17')]+_0x0421('0x18');}function generateMicrosoftAuthorizationUrl(_0x3bbcc5,_0x5db597){var _0x2a32ba=MICROSOFT_AUTH_URL[_0x0421('0x1b')](_0x0421('0x1c'),_0x3bbcc5[_0x0421('0x1d')]);var _0x4df3d1=[_0x0421('0x1e'),'id_token'];var _0x401304=Buffer[_0x0421('0x1f')](JSON[_0x0421('0x20')]({'id':_0x5db597}))[_0x0421('0x21')](_0x0421('0x22'));var _0x3f2707=crypto[_0x0421('0x23')](0x10)[_0x0421('0x21')]('hex');var _0x499b6f=getAuthorizationScopes(_0x3bbcc5);var _0x55b5a1=[{'key':'client_id','value':_0x3bbcc5['data1']},{'key':'response_type','value':encodeURIComponent(_0x4df3d1[_0x0421('0x19')]('\x20'))},{'key':_0x0421('0x24'),'value':_0x3bbcc5['data4']},{'key':'response_mode','value':_0x0421('0x25')},{'key':_0x0421('0x26'),'value':encodeURIComponent(_0x499b6f)},{'key':_0x0421('0x27'),'value':_0x401304},{'key':_0x0421('0x28'),'value':_0x3f2707},{'key':_0x0421('0x29'),'value':_0x0421('0x2a')}];var _0x4bfa99=_0x2a32ba+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x0421('0x14')](_0x55b5a1,function(_0x204261){return _0x204261[_0x0421('0x2b')]+'='+_0x204261[_0x0421('0x2c')];})[_0x0421('0x19')]('&');_0x3bbcc5[_0x0421('0x2d')]={'issuer':_0x2a32ba[_0x0421('0x1b')](_0x0421('0x2e'),''),'audience':_0x3bbcc5[_0x0421('0x2f')],'state':_0x401304,'nonce':_0x3f2707};redis[_0x0421('0x30')](_0x401304,JSON[_0x0421('0x20')](_0x3bbcc5));return _0x4bfa99;}function isValidIdToken(_0x51f819,_0x407c3f){try{var _0x1a9012=jwt[_0x0421('0x31')](_0x51f819,{'complete':!![]});var _0x4768e6=_0x1a9012['payload'];if(_0x4768e6[_0x0421('0x32')]!==_0x407c3f[_0x0421('0x33')])return![];if(_0x4768e6[_0x0421('0x34')]!==_0x407c3f[_0x0421('0x35')])return![];if(_0x4768e6['nonce']!==_0x407c3f[_0x0421('0x28')])return![];if(moment()[_0x0421('0x36')](moment[_0x0421('0x37')](_0x4768e6[_0x0421('0x38')])))return![];return!![];}catch(_0x14a947){throw _0x14a947;}}function refreshOauth2MicrosoftAccessToken(_0x5f4308){return Promise[_0x0421('0x39')]()['then'](function(){if(_0x5f4308[_0x0421('0x3a')])return _0x5f4308;return db[_0x0421('0x3b')][_0x0421('0x3c')]({'where':{'id':_0x5f4308['id']},'raw':!![]});})[_0x0421('0x3d')](function(_0x2b9a50){var _0x2cf242={'grant_type':'refresh_token','refresh_token':_0x2b9a50[_0x0421('0x3e')],'scope':getAccessTokenScope(_0x2b9a50),'redirect_uri':_0x2b9a50['data4'],'client_id':_0x2b9a50[_0x0421('0x2f')],'client_secret':encryptor[_0x0421('0x3f')](_0x2b9a50['data3'])};var _0x59e769={'method':_0x0421('0x40'),'uri':MICROSOFT_AUTH_URL['replace'](_0x0421('0x1c'),_0x2b9a50[_0x0421('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x2cf242,'json':!![]};return rp(_0x59e769);})['then'](function(_0x34f516){_0x5f4308[_0x0421('0x41')]=_0x34f516[_0x0421('0x42')];_0x5f4308[_0x0421('0x3e')]=_0x34f516[_0x0421('0x43')];return db['CloudProvider'][_0x0421('0x44')]({'data5':_0x5f4308['data5'],'data6':_0x5f4308[_0x0421('0x3e')]},{'where':{'id':_0x5f4308['id']}});})[_0x0421('0x3d')](function(){return _0x5f4308;})[_0x0421('0x45')](function(_0x499c2c){logger[_0x0421('0x46')](_0x0421('0x47'),_0x5f4308['id'],_0x499c2c);});}function getOauth2MicrosoftAccessToken(_0x5a0ee,_0x9ec771){var _0x153aea={'grant_type':_0x0421('0x48'),'code':_0x5a0ee,'scope':getAccessTokenScope(_0x9ec771),'redirect_uri':_0x9ec771[_0x0421('0x49')],'client_id':_0x9ec771['data1'],'client_secret':encryptor[_0x0421('0x3f')](_0x9ec771[_0x0421('0x3a')])};var _0x2c877b={'method':_0x0421('0x40'),'uri':MICROSOFT_AUTH_URL['replace']('{TENANT_ID}',_0x9ec771[_0x0421('0x1d')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x153aea,'json':!![]};return rp(_0x2c877b);}function startRefreshInterval(_0x1d0370){var _0x478079=schedule[_0x0421('0x4a')];if(_0x478079[_0x1d0370['id']])clearInterval(_0x478079[_0x1d0370['id']]);_0x478079[_0x1d0370['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0x0421('0x4b')](this,{'id':_0x1d0370['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x0421('0x4a')]=_0x478079;}function startAllRefreshIntervals(){return db[_0x0421('0x3b')][_0x0421('0x4c')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x0421('0x3d')](function(_0x1881eb){var _0x39366a=_0x1881eb[_0x0421('0x14')](function(_0x15aad9){return refreshOauth2MicrosoftAccessToken(_0x15aad9)[_0x0421('0x3d')](function(_0x10c69a){startRefreshInterval(_0x10c69a);});});return Promise[_0x0421('0x4d')](_0x39366a);})['catch'](function(_0x57fba5){var _0x50dc90=_0x57fba5?util[_0x0421('0x4e')](_0x57fba5,{'showHidden':![],'depth':null}):'';logger[_0x0421('0x46')]('[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s',_0x50dc90);});}module[_0x0421('0x4f')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.rpc.js b/server/api/cloudProvider/cloudProvider.rpc.js
index 52dae85..bfa5e6b 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 _0xfd58=['info','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','request\x20sent','debug','stringify','error','code','CloudProvider,\x20%s,\x20%s','message'];(function(_0x345bd6,_0x1e2919){var _0x3c22cb=function(_0x430250){while(--_0x430250){_0x345bd6['push'](_0x345bd6['shift']());}};_0x3c22cb(++_0x1e2919);}(_0xfd58,0xb3));var _0x8fd5=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xfd58[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x8fd5('0x0'));var util=require(_0x8fd5('0x1'));var moment=require('moment');var BPromise=require(_0x8fd5('0x2'));var rs=require(_0x8fd5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8fd5('0x4'))['db'];var utils=require(_0x8fd5('0x5'));var logger=require(_0x8fd5('0x6'))(_0x8fd5('0x7'));var config=require('../../config/environment');var jayson=require(_0x8fd5('0x8'));var client=jayson[_0x8fd5('0x9')][_0x8fd5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e10e4,_0x16ac3f,_0x32bad9){return new BPromise(function(_0x273344,_0x1042a1){return client[_0x8fd5('0xb')](_0x4e10e4,_0x32bad9)['then'](function(_0x462ac4){logger['info']('CloudProvider,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'));logger[_0x8fd5('0xd')]('CloudProvider,\x20%s,\x20%s,\x20%s',_0x16ac3f,_0x8fd5('0xc'),JSON[_0x8fd5('0xe')](_0x462ac4));if(_0x462ac4['error']){if(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x10')]===0x1f4){logger['error'](_0x8fd5('0x11'),_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x1042a1(_0x462ac4[_0x8fd5('0xf')]['message']);}logger['error']('CloudProvider,\x20%s,\x20%s',_0x16ac3f,_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);return _0x273344(_0x462ac4[_0x8fd5('0xf')][_0x8fd5('0x12')]);}else{logger[_0x8fd5('0x13')](_0x8fd5('0x11'),_0x16ac3f,_0x8fd5('0xc'));_0x273344(_0x462ac4[_0x8fd5('0x14')][_0x8fd5('0x12')]);}})[_0x8fd5('0x15')](function(_0x53b2dd){logger[_0x8fd5('0xf')](_0x8fd5('0x11'),_0x16ac3f,_0x53b2dd);_0x1042a1(_0x53b2dd);});});}
\ No newline at end of file
+var _0xb5fa=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','CloudProvider,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0xa2ac9,_0xf07f28){var _0x690e9b=function(_0x5b2582){while(--_0x5b2582){_0xa2ac9['push'](_0xa2ac9['shift']());}};_0x690e9b(++_0xf07f28);}(_0xb5fa,0xf8));var _0xab5f=function(_0x572083,_0x175a28){_0x572083=_0x572083-0x0;var _0x1add20=_0xb5fa[_0x572083];return _0x1add20;};'use strict';var _=require(_0xab5f('0x0'));var util=require(_0xab5f('0x1'));var moment=require(_0xab5f('0x2'));var BPromise=require(_0xab5f('0x3'));var rs=require(_0xab5f('0x4'));var fs=require('fs');var Redis=require(_0xab5f('0x5'));var db=require(_0xab5f('0x6'))['db'];var utils=require(_0xab5f('0x7'));var logger=require(_0xab5f('0x8'))(_0xab5f('0x9'));var config=require(_0xab5f('0xa'));var jayson=require(_0xab5f('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x489cd2,_0x1e5941,_0x401d4e){return new BPromise(function(_0x530a4a,_0x298d75){return client[_0xab5f('0xc')](_0x489cd2,_0x401d4e)[_0xab5f('0xd')](function(_0x177190){logger[_0xab5f('0xe')]('CloudProvider,\x20%s,\x20%s',_0x1e5941,_0xab5f('0xf'));logger['debug'](_0xab5f('0x10'),_0x1e5941,'request\x20sent',JSON[_0xab5f('0x11')](_0x177190));if(_0x177190[_0xab5f('0x12')]){if(_0x177190['error']['code']===0x1f4){logger['error'](_0xab5f('0x13'),_0x1e5941,_0x177190[_0xab5f('0x12')]['message']);return _0x298d75(_0x177190[_0xab5f('0x12')][_0xab5f('0x14')]);}logger[_0xab5f('0x12')](_0xab5f('0x13'),_0x1e5941,_0x177190[_0xab5f('0x12')][_0xab5f('0x14')]);return _0x530a4a(_0x177190[_0xab5f('0x12')][_0xab5f('0x14')]);}else{logger[_0xab5f('0xe')](_0xab5f('0x13'),_0x1e5941,_0xab5f('0xf'));_0x530a4a(_0x177190[_0xab5f('0x15')][_0xab5f('0x14')]);}})[_0xab5f('0x16')](function(_0x3d5485){logger[_0xab5f('0x12')](_0xab5f('0x13'),_0x1e5941,_0x3d5485);_0x298d75(_0x3d5485);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index c2183c7..a01df5f 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 _0xc4aa=['put','/:id','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','show','post','create'];(function(_0x55a668,_0x495c0f){var _0x369e87=function(_0xc897e3){while(--_0xc897e3){_0x55a668['push'](_0x55a668['shift']());}};_0x369e87(++_0x495c0f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xc4aa[_0x32f7d7];return _0x133d09;};'use strict';var express=require(_0xac4a('0x0'));var router=express[_0xac4a('0x1')]();var auth=require(_0xac4a('0x2'));var controller=require(_0xac4a('0x3'));router[_0xac4a('0x4')]('/',auth[_0xac4a('0x5')](),controller['index']);router['get']('/:id',auth[_0xac4a('0x5')](),controller[_0xac4a('0x6')]);router[_0xac4a('0x7')]('/',auth[_0xac4a('0x5')](),controller[_0xac4a('0x8')]);router[_0xac4a('0x9')](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller['update']);router['delete'](_0xac4a('0xa'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xb')]);router['get'](_0xac4a('0xc'),auth[_0xac4a('0x5')](),controller[_0xac4a('0xd')]);router['post'](_0xac4a('0xe'),controller['oauth2MicrosoftCallback']);module[_0xac4a('0xf')]=router;
\ No newline at end of file
+var _0x2ef3=['Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','/:id','show','post','put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','express'];(function(_0x52015d,_0x22648f){var _0x26d2bb=function(_0xcd6b13){while(--_0xcd6b13){_0x52015d['push'](_0x52015d['shift']());}};_0x26d2bb(++_0x22648f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4c365b,_0x2cd0d5){_0x4c365b=_0x4c365b-0x0;var _0x4a2e10=_0x2ef3[_0x4c365b];return _0x4a2e10;};'use strict';var express=require(_0x32ef('0x0'));var router=express[_0x32ef('0x1')]();var auth=require(_0x32ef('0x2'));var controller=require(_0x32ef('0x3'));router[_0x32ef('0x4')]('/',auth[_0x32ef('0x5')](),controller['index']);router[_0x32ef('0x4')](_0x32ef('0x6'),auth['isAuthenticated'](),controller[_0x32ef('0x7')]);router[_0x32ef('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x32ef('0x9')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xa')]);router[_0x32ef('0xb')](_0x32ef('0x6'),auth[_0x32ef('0x5')](),controller[_0x32ef('0xc')]);router[_0x32ef('0x4')](_0x32ef('0xd'),auth['isAuthenticated'](),controller['oauth2MicrosoftAuthorize']);router[_0x32ef('0x8')](_0x32ef('0xe'),controller[_0x32ef('0xf')]);module[_0x32ef('0x10')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index b14fdb6..8c20c41 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 _0xfe1b=['sequelize','exports','STRING','name'];(function(_0x45b380,_0x478cbd){var _0x4cdb76=function(_0x1b6a75){while(--_0x1b6a75){_0x45b380['push'](_0x45b380['shift']());}};_0x4cdb76(++_0x478cbd);}(_0xfe1b,0xa8));var _0xbfe1=function(_0x46a199,_0x4a169e){_0x46a199=_0x46a199-0x0;var _0xd62514=_0xfe1b[_0x46a199];return _0xd62514;};'use strict';var Sequelize=require(_0xbfe1('0x0'));module[_0xbfe1('0x1')]={'name':{'type':Sequelize[_0xbfe1('0x2')],'unique':_0xbfe1('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xbfe1('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0xbfe1('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0xbfe1('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0xbfe1('0x2')]},'postalCode':{'type':Sequelize[_0xbfe1('0x2')]},'city':{'type':Sequelize[_0xbfe1('0x2')]},'country':{'type':Sequelize[_0xbfe1('0x2')]},'email':{'type':Sequelize[_0xbfe1('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xbfe1('0x2')]},'sStreet':{'type':Sequelize[_0xbfe1('0x2')]},'sPostalCode':{'type':Sequelize[_0xbfe1('0x2')]},'sCity':{'type':Sequelize[_0xbfe1('0x2')]},'sCountry':{'type':Sequelize[_0xbfe1('0x2')]},'description':{'type':Sequelize[_0xbfe1('0x2')]}};
\ No newline at end of file
+var _0xbb02=['name','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbb02,0xe3));var _0x2bb0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xbb02[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x2bb0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x2bb0('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2bb0('0x2')]},'companyId':{'type':Sequelize[_0x2bb0('0x2')]},'website':{'type':Sequelize[_0x2bb0('0x2')]},'phone':{'type':Sequelize[_0x2bb0('0x2')]},'fax':{'type':Sequelize[_0x2bb0('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2bb0('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x2bb0('0x2')]},'email':{'type':Sequelize[_0x2bb0('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2bb0('0x2')]},'sStreet':{'type':Sequelize[_0x2bb0('0x2')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x2bb0('0x2')]},'sCountry':{'type':Sequelize[_0x2bb0('0x2')]},'description':{'type':Sequelize[_0x2bb0('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 434c668..8ee113b 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 _0x43bf=['findOne','CmContact','getContacts','nolimit','rimraf','zip-dir','fast-json-patch','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../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','Companies','UserProfileResource','error','stack','name','send','CmCompany','describe','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','map','options','include','rows','catch','show','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','params','addContacts','ids','omit'];(function(_0x1c7e71,_0x3980fe){var _0x261281=function(_0x47f42b){while(--_0x47f42b){_0x1c7e71['push'](_0x1c7e71['shift']());}};_0x261281(++_0x3980fe);}(_0x43bf,0xfd));var _0xf43b=function(_0x2e28a3,_0x4678c2){_0x2e28a3=_0x2e28a3-0x0;var _0x54ec2e=_0x43bf[_0x2e28a3];return _0x54ec2e;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf43b('0x0'));var zipdir=require(_0xf43b('0x1'));var jsonpatch=require(_0xf43b('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf43b('0x3'));var Mustache=require(_0xf43b('0x4'));var util=require('util');var path=require('path');var sox=require(_0xf43b('0x5'));var csv=require(_0xf43b('0x6'));var ejs=require(_0xf43b('0x7'));var fs=require('fs');var fs_extra=require(_0xf43b('0x8'));var _=require(_0xf43b('0x9'));var squel=require(_0xf43b('0xa'));var crypto=require('crypto');var jsforce=require(_0xf43b('0xb'));var deskjs=require(_0xf43b('0xc'));var toCsv=require(_0xf43b('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf43b('0xd'));var authService=require(_0xf43b('0xe'));var qs=require(_0xf43b('0xf'));var as=require(_0xf43b('0x10'));var hardwareService=require(_0xf43b('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf43b('0x12'));var config=require(_0xf43b('0x13'));var licenseUtil=require(_0xf43b('0x14'));var db=require(_0xf43b('0x15'))['db'];function respondWithStatusCode(_0x1d7cb5,_0x531459){_0x531459=_0x531459||0xcc;return function(_0x2997b){if(_0x2997b){return _0x1d7cb5[_0xf43b('0x16')](_0x531459);}return _0x1d7cb5[_0xf43b('0x17')](_0x531459)[_0xf43b('0x18')]();};}function respondWithResult(_0x2ba839,_0x8d85b9){_0x8d85b9=_0x8d85b9||0xc8;return function(_0x572109){if(_0x572109){return _0x2ba839['status'](_0x8d85b9)[_0xf43b('0x19')](_0x572109);}};}function respondWithFilteredResult(_0x5387a6,_0x54b6ea){return function(_0x1c11e6){if(_0x1c11e6){var _0x4ba2bc=typeof _0x54b6ea[_0xf43b('0x1a')]===_0xf43b('0x1b')&&typeof _0x54b6ea[_0xf43b('0x1c')]===_0xf43b('0x1b');var _0x50bc9f=_0x1c11e6[_0xf43b('0x1d')];var _0x4efaf5=_0x4ba2bc?0x0:_0x54b6ea[_0xf43b('0x1a')];var _0x43cf32=_0x4ba2bc?_0x1c11e6[_0xf43b('0x1d')]:_0x54b6ea['offset']+_0x54b6ea[_0xf43b('0x1c')];var _0x56ec33;if(_0x43cf32>=_0x50bc9f){_0x43cf32=_0x50bc9f;_0x56ec33=0xc8;}else{_0x56ec33=0xce;}_0x5387a6[_0xf43b('0x17')](_0x56ec33);return _0x5387a6[_0xf43b('0x1e')](_0xf43b('0x1f'),_0x4efaf5+'-'+_0x43cf32+'/'+_0x50bc9f)[_0xf43b('0x19')](_0x1c11e6);}return null;};}function patchUpdates(_0x5ba23f){return function(_0x566b27){try{jsonpatch[_0xf43b('0x20')](_0x566b27,_0x5ba23f,!![]);}catch(_0x434a3d){return BPromise[_0xf43b('0x21')](_0x434a3d);}return _0x566b27[_0xf43b('0x22')]();};}function saveUpdates(_0x52221d,_0x156204){return function(_0x189743){if(_0x189743){return _0x189743[_0xf43b('0x23')](_0x52221d)['then'](function(_0x42ddb7){return _0x42ddb7;});}return null;};}function removeEntity(_0x280ba4,_0x2cb4d2){return function(_0x3568c0){if(_0x3568c0){return _0x3568c0[_0xf43b('0x24')]()[_0xf43b('0x25')](function(){var _0x2c0738=_0x3568c0['get']({'plain':!![]});var _0xca3af=_0xf43b('0x26');return db[_0xf43b('0x27')][_0xf43b('0x24')]({'where':{'type':_0xca3af,'resourceId':_0x2c0738['id']}})['then'](function(){return _0x3568c0;});})[_0xf43b('0x25')](function(){_0x280ba4[_0xf43b('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d68c2,_0x382f46){return function(_0x354951){if(!_0x354951){_0x3d68c2[_0xf43b('0x16')](0x194);}return _0x354951;};}function handleError(_0x551a86,_0x503693){_0x503693=_0x503693||0x1f4;return function(_0x112105){logger[_0xf43b('0x28')](_0x112105[_0xf43b('0x29')]);if(_0x112105[_0xf43b('0x2a')]){delete _0x112105[_0xf43b('0x2a')];}_0x551a86[_0xf43b('0x17')](_0x503693)[_0xf43b('0x2b')](_0x112105);};}exports['index']=function(_0x178356,_0x5546da){var _0x45d946={},_0x251ad0={},_0x21bee8={'count':0x0,'rows':[]};return db[_0xf43b('0x2c')][_0xf43b('0x2d')]()['then'](function(_0x36fee5){_0x251ad0[_0xf43b('0x2e')]=_['keys'](_0x36fee5);_0x251ad0[_0xf43b('0x2f')]=_[_0xf43b('0x30')](_0x178356['query']);_0x251ad0['filters']=_[_0xf43b('0x31')](_0x251ad0[_0xf43b('0x2e')],_0x251ad0[_0xf43b('0x2f')]);_0x45d946[_0xf43b('0x32')]=_[_0xf43b('0x31')](_0x251ad0['model'],qs[_0xf43b('0x33')](_0x178356[_0xf43b('0x2f')]['fields']));_0x45d946[_0xf43b('0x32')]=_0x45d946['attributes'][_0xf43b('0x34')]?_0x45d946[_0xf43b('0x32')]:_0x251ad0[_0xf43b('0x2e')];if(!_0x178356[_0xf43b('0x2f')][_0xf43b('0x35')]('nolimit')){_0x45d946['limit']=qs[_0xf43b('0x1c')](_0x178356[_0xf43b('0x2f')]['limit']);_0x45d946['offset']=qs[_0xf43b('0x1a')](_0x178356['query'][_0xf43b('0x1a')]);}_0x45d946['order']=qs[_0xf43b('0x36')](_0x178356['query'][_0xf43b('0x36')]);_0x45d946[_0xf43b('0x37')]=qs[_0xf43b('0x38')](_[_0xf43b('0x39')](_0x178356[_0xf43b('0x2f')],_0x251ad0[_0xf43b('0x38')]),_0x36fee5);if(_0x178356['query'][_0xf43b('0x3a')]){_0x45d946['where']=_[_0xf43b('0x3b')](_0x45d946[_0xf43b('0x37')],{'$or':_[_0xf43b('0x3c')](_0x45d946[_0xf43b('0x32')],function(_0x51f7a4){var _0x122a61={};_0x122a61[_0x51f7a4]={'$like':'%'+_0x178356[_0xf43b('0x2f')]['filter']+'%'};return _0x122a61;})});}_0x45d946=_[_0xf43b('0x3b')]({},_0x45d946,_0x178356[_0xf43b('0x3d')]);var _0x49130f={'where':_0x45d946[_0xf43b('0x37')]};return db[_0xf43b('0x2c')]['count'](_0x49130f)[_0xf43b('0x25')](function(_0x399778){_0x21bee8[_0xf43b('0x1d')]=_0x399778;if(_0x178356[_0xf43b('0x2f')]['includeAll']){_0x45d946[_0xf43b('0x3e')]=[{'all':!![]}];}return db[_0xf43b('0x2c')]['findAll'](_0x45d946);})[_0xf43b('0x25')](function(_0x1ed2a6){_0x21bee8[_0xf43b('0x3f')]=_0x1ed2a6;return _0x21bee8;})['then'](respondWithFilteredResult(_0x5546da,_0x45d946))[_0xf43b('0x40')](handleError(_0x5546da,null));})['catch'](handleError(_0x5546da,null));};exports[_0xf43b('0x41')]=function(_0x22a7e6,_0x303669){var _0x1dbcc7={'raw':![],'where':{'id':_0x22a7e6['params']['id']}},_0x31c95c={};_0x31c95c[_0xf43b('0x2e')]=_[_0xf43b('0x30')](db[_0xf43b('0x2c')]['rawAttributes']);_0x31c95c[_0xf43b('0x2f')]=_['keys'](_0x22a7e6[_0xf43b('0x2f')]);_0x31c95c['filters']=_[_0xf43b('0x31')](_0x31c95c['model'],_0x31c95c[_0xf43b('0x2f')]);_0x1dbcc7[_0xf43b('0x32')]=_[_0xf43b('0x31')](_0x31c95c['model'],qs[_0xf43b('0x33')](_0x22a7e6[_0xf43b('0x2f')]['fields']));_0x1dbcc7[_0xf43b('0x32')]=_0x1dbcc7[_0xf43b('0x32')]['length']?_0x1dbcc7['attributes']:_0x31c95c[_0xf43b('0x2e')];if(_0x22a7e6[_0xf43b('0x2f')]['includeAll']){_0x1dbcc7[_0xf43b('0x3e')]=[{'all':!![]}];}_0x1dbcc7=_[_0xf43b('0x3b')]({},_0x1dbcc7,_0x22a7e6[_0xf43b('0x3d')]);return db[_0xf43b('0x2c')][_0xf43b('0x42')](_0x1dbcc7)['then'](handleEntityNotFound(_0x303669,null))[_0xf43b('0x25')](respondWithResult(_0x303669,null))[_0xf43b('0x40')](handleError(_0x303669,null));};exports[_0xf43b('0x43')]=function(_0x52f2d5,_0x2dc21c){return db[_0xf43b('0x2c')]['create'](_0x52f2d5[_0xf43b('0x44')],{})[_0xf43b('0x25')](function(_0x1d8d93){var _0x21b2bc=_0x52f2d5[_0xf43b('0x45')][_0xf43b('0x46')]({'plain':!![]});if(!_0x21b2bc)throw new Error(_0xf43b('0x47'));if(_0x21b2bc[_0xf43b('0x48')]===_0xf43b('0x45')){var _0xc327d=_0x1d8d93[_0xf43b('0x46')]({'plain':!![]});var _0x5971df=_0xf43b('0x26');return db[_0xf43b('0x49')][_0xf43b('0x42')]({'where':{'name':_0x5971df,'userProfileId':_0x21b2bc['userProfileId']},'raw':!![]})[_0xf43b('0x25')](function(_0x36222e){if(_0x36222e&&_0x36222e[_0xf43b('0x4a')]===0x0){return db['UserProfileResource'][_0xf43b('0x43')]({'name':_0xc327d[_0xf43b('0x2a')],'resourceId':_0xc327d['id'],'type':_0x36222e[_0xf43b('0x2a')],'sectionId':_0x36222e['id']},{})[_0xf43b('0x25')](function(){return _0x1d8d93;});}else{return _0x1d8d93;}})[_0xf43b('0x40')](function(_0x25baf3){logger[_0xf43b('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x25baf3);throw _0x25baf3;});}return _0x1d8d93;})[_0xf43b('0x25')](respondWithResult(_0x2dc21c,0xc9))['catch'](handleError(_0x2dc21c,null));};exports[_0xf43b('0x23')]=function(_0x3460c4,_0x5da273){if(_0x3460c4[_0xf43b('0x44')]['id']){delete _0x3460c4[_0xf43b('0x44')]['id'];}return db[_0xf43b('0x2c')][_0xf43b('0x42')]({'where':{'id':_0x3460c4['params']['id']}})['then'](handleEntityNotFound(_0x5da273,null))[_0xf43b('0x25')](saveUpdates(_0x3460c4[_0xf43b('0x44')],null))['then'](respondWithResult(_0x5da273,null))['catch'](handleError(_0x5da273,null));};exports[_0xf43b('0x24')]=function(_0x532bc6,_0x49d1a2){return db[_0xf43b('0x2c')][_0xf43b('0x42')]({'where':{'id':_0x532bc6[_0xf43b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x49d1a2,null))[_0xf43b('0x25')](removeEntity(_0x49d1a2,null))[_0xf43b('0x40')](handleError(_0x49d1a2,null));};exports[_0xf43b('0x2d')]=function(_0x4234da,_0x1658c2){return db[_0xf43b('0x2c')][_0xf43b('0x2d')]()[_0xf43b('0x25')](respondWithResult(_0x1658c2,null))[_0xf43b('0x40')](handleError(_0x1658c2,null));};exports[_0xf43b('0x4c')]=function(_0x32a1ab,_0x1f7588,_0x40e6a8){return db['CmContact']['find']({'where':{'id':_0x32a1ab[_0xf43b('0x4b')]['id']}})[_0xf43b('0x25')](handleEntityNotFound(_0x1f7588,null))['then'](function(_0xf13ddc){if(_0xf13ddc){return _0xf13ddc['addContacts'](_0x32a1ab[_0xf43b('0x44')][_0xf43b('0x4d')],_[_0xf43b('0x4e')](_0x32a1ab['body'],[_0xf43b('0x4d'),'id'])||{});}})[_0xf43b('0x25')](respondWithResult(_0x1f7588,null))['catch'](handleError(_0x1f7588,null));};exports['getContacts']=function(_0xc27942,_0x157e62,_0x3b83bc){var _0x2ed86c={};var _0x1a27a0={};var _0x296f36;var _0x249e66;return db[_0xf43b('0x2c')][_0xf43b('0x4f')]({'where':{'id':_0xc27942[_0xf43b('0x4b')]['id']}})[_0xf43b('0x25')](handleEntityNotFound(_0x157e62,null))[_0xf43b('0x25')](function(_0x3a20b9){if(_0x3a20b9){_0x296f36=_0x3a20b9;_0x1a27a0[_0xf43b('0x2e')]=_['keys'](db[_0xf43b('0x50')]['rawAttributes']);_0x1a27a0['query']=_[_0xf43b('0x30')](_0xc27942[_0xf43b('0x2f')]);_0x1a27a0[_0xf43b('0x38')]=_[_0xf43b('0x31')](_0x1a27a0[_0xf43b('0x2e')],_0x1a27a0[_0xf43b('0x2f')]);_0x2ed86c['attributes']=_[_0xf43b('0x31')](_0x1a27a0[_0xf43b('0x2e')],qs[_0xf43b('0x33')](_0xc27942[_0xf43b('0x2f')][_0xf43b('0x33')]));_0x2ed86c[_0xf43b('0x32')]=_0x2ed86c[_0xf43b('0x32')][_0xf43b('0x34')]?_0x2ed86c['attributes']:_0x1a27a0[_0xf43b('0x2e')];_0x2ed86c['order']=qs[_0xf43b('0x36')](_0xc27942['query'][_0xf43b('0x36')]);_0x2ed86c[_0xf43b('0x37')]=qs[_0xf43b('0x38')](_[_0xf43b('0x39')](_0xc27942[_0xf43b('0x2f')],_0x1a27a0[_0xf43b('0x38')]));if(_0xc27942['query']['filter']){_0x2ed86c['where']=_[_0xf43b('0x3b')](_0x2ed86c[_0xf43b('0x37')],{'$or':_[_0xf43b('0x3c')](_0x2ed86c[_0xf43b('0x32')],function(_0x11f74e){var _0x86d5d2={};_0x86d5d2[_0x11f74e]={'$like':'%'+_0xc27942[_0xf43b('0x2f')][_0xf43b('0x3a')]+'%'};return _0x86d5d2;})});}_0x2ed86c=_['merge']({},_0x2ed86c,_0xc27942['options']);return _0x296f36[_0xf43b('0x51')](_0x2ed86c);}})[_0xf43b('0x25')](function(_0x49ba3e){if(_0x49ba3e){_0x249e66=_0x49ba3e[_0xf43b('0x34')];if(!_0xc27942['query'][_0xf43b('0x35')](_0xf43b('0x52'))){_0x2ed86c[_0xf43b('0x1c')]=qs[_0xf43b('0x1c')](_0xc27942[_0xf43b('0x2f')][_0xf43b('0x1c')]);_0x2ed86c[_0xf43b('0x1a')]=qs[_0xf43b('0x1a')](_0xc27942[_0xf43b('0x2f')][_0xf43b('0x1a')]);}return _0x296f36['getContacts'](_0x2ed86c);}})['then'](function(_0xa44b29){if(_0xa44b29){return _0xa44b29?{'count':_0x249e66,'rows':_0xa44b29}:null;}})[_0xf43b('0x25')](respondWithResult(_0x157e62,null))[_0xf43b('0x40')](handleError(_0x157e62,null));};
\ No newline at end of file
+var _0x27f3=['stack','name','send','index','CmCompany','describe','keys','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','merge','options','includeAll','include','catch','params','rawAttributes','fields','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','update','CmContact','addContacts','ids','omit','getContacts','findOne','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','end','status','json','offset','undefined','limit','count','apply','reject','save','then','get','Companies','UserProfileResource','destroy','sendStatus','error'];(function(_0xaab2f5,_0x58463f){var _0x3b28ea=function(_0xcbc73c){while(--_0xcbc73c){_0xaab2f5['push'](_0xaab2f5['shift']());}};_0x3b28ea(++_0x58463f);}(_0x27f3,0xd8));var _0x327f=function(_0x39d39d,_0x5586bd){_0x39d39d=_0x39d39d-0x0;var _0x577ac3=_0x27f3[_0x39d39d];return _0x577ac3;};'use strict';var emlformat=require(_0x327f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x327f('0x1'));var moment=require(_0x327f('0x2'));var BPromise=require(_0x327f('0x3'));var Mustache=require(_0x327f('0x4'));var util=require(_0x327f('0x5'));var path=require(_0x327f('0x6'));var sox=require(_0x327f('0x7'));var csv=require(_0x327f('0x8'));var ejs=require(_0x327f('0x9'));var fs=require('fs');var fs_extra=require(_0x327f('0xa'));var _=require(_0x327f('0xb'));var squel=require(_0x327f('0xc'));var crypto=require(_0x327f('0xd'));var jsforce=require(_0x327f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x327f('0x8'));var querystring=require('querystring');var Papa=require(_0x327f('0xf'));var Redis=require(_0x327f('0x10'));var authService=require(_0x327f('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x327f('0x12'));var hardwareService=require(_0x327f('0x13'));var logger=require('../../config/logger')(_0x327f('0x14'));var utils=require(_0x327f('0x15'));var config=require(_0x327f('0x16'));var licenseUtil=require(_0x327f('0x17'));var db=require(_0x327f('0x18'))['db'];function respondWithStatusCode(_0x288edc,_0x141388){_0x141388=_0x141388||0xcc;return function(_0x3c2424){if(_0x3c2424){return _0x288edc['sendStatus'](_0x141388);}return _0x288edc['status'](_0x141388)[_0x327f('0x19')]();};}function respondWithResult(_0x11acab,_0x4e5017){_0x4e5017=_0x4e5017||0xc8;return function(_0x181060){if(_0x181060){return _0x11acab[_0x327f('0x1a')](_0x4e5017)[_0x327f('0x1b')](_0x181060);}};}function respondWithFilteredResult(_0x5a9b7a,_0x2830a6){return function(_0x9ce1f7){if(_0x9ce1f7){var _0xbc503f=typeof _0x2830a6[_0x327f('0x1c')]===_0x327f('0x1d')&&typeof _0x2830a6[_0x327f('0x1e')]===_0x327f('0x1d');var _0x253864=_0x9ce1f7[_0x327f('0x1f')];var _0x1af46c=_0xbc503f?0x0:_0x2830a6[_0x327f('0x1c')];var _0x55ac8e=_0xbc503f?_0x9ce1f7[_0x327f('0x1f')]:_0x2830a6[_0x327f('0x1c')]+_0x2830a6[_0x327f('0x1e')];var _0x1c1d52;if(_0x55ac8e>=_0x253864){_0x55ac8e=_0x253864;_0x1c1d52=0xc8;}else{_0x1c1d52=0xce;}_0x5a9b7a['status'](_0x1c1d52);return _0x5a9b7a['set']('Content-Range',_0x1af46c+'-'+_0x55ac8e+'/'+_0x253864)[_0x327f('0x1b')](_0x9ce1f7);}return null;};}function patchUpdates(_0x4fb0a0){return function(_0x3bacc6){try{jsonpatch[_0x327f('0x20')](_0x3bacc6,_0x4fb0a0,!![]);}catch(_0x82e3c6){return BPromise[_0x327f('0x21')](_0x82e3c6);}return _0x3bacc6[_0x327f('0x22')]();};}function saveUpdates(_0x2a2c30,_0x8cbe31){return function(_0x10eae7){if(_0x10eae7){return _0x10eae7['update'](_0x2a2c30)[_0x327f('0x23')](function(_0x621ad0){return _0x621ad0;});}return null;};}function removeEntity(_0x504211,_0x5f1bd7){return function(_0x7610d3){if(_0x7610d3){return _0x7610d3['destroy']()[_0x327f('0x23')](function(){var _0x295311=_0x7610d3[_0x327f('0x24')]({'plain':!![]});var _0x311889=_0x327f('0x25');return db[_0x327f('0x26')][_0x327f('0x27')]({'where':{'type':_0x311889,'resourceId':_0x295311['id']}})['then'](function(){return _0x7610d3;});})['then'](function(){_0x504211[_0x327f('0x1a')](0xcc)[_0x327f('0x19')]();});}};}function handleEntityNotFound(_0x2f27aa,_0x1f93a7){return function(_0x3a6a7c){if(!_0x3a6a7c){_0x2f27aa[_0x327f('0x28')](0x194);}return _0x3a6a7c;};}function handleError(_0x2471b6,_0xd2eb1){_0xd2eb1=_0xd2eb1||0x1f4;return function(_0x5b1c78){logger[_0x327f('0x29')](_0x5b1c78[_0x327f('0x2a')]);if(_0x5b1c78['name']){delete _0x5b1c78[_0x327f('0x2b')];}_0x2471b6[_0x327f('0x1a')](_0xd2eb1)[_0x327f('0x2c')](_0x5b1c78);};}exports[_0x327f('0x2d')]=function(_0x4254de,_0x3cad03){var _0x5c029e={},_0x539abd={},_0x338a20={'count':0x0,'rows':[]};return db[_0x327f('0x2e')][_0x327f('0x2f')]()['then'](function(_0x2a0d9e){_0x539abd['model']=_[_0x327f('0x30')](_0x2a0d9e);_0x539abd[_0x327f('0x31')]=_[_0x327f('0x30')](_0x4254de[_0x327f('0x31')]);_0x539abd[_0x327f('0x32')]=_[_0x327f('0x33')](_0x539abd[_0x327f('0x34')],_0x539abd['query']);_0x5c029e[_0x327f('0x35')]=_[_0x327f('0x33')](_0x539abd[_0x327f('0x34')],qs['fields'](_0x4254de[_0x327f('0x31')]['fields']));_0x5c029e[_0x327f('0x35')]=_0x5c029e['attributes'][_0x327f('0x36')]?_0x5c029e['attributes']:_0x539abd['model'];if(!_0x4254de[_0x327f('0x31')][_0x327f('0x37')](_0x327f('0x38'))){_0x5c029e['limit']=qs['limit'](_0x4254de['query'][_0x327f('0x1e')]);_0x5c029e[_0x327f('0x1c')]=qs['offset'](_0x4254de[_0x327f('0x31')][_0x327f('0x1c')]);}_0x5c029e[_0x327f('0x39')]=qs[_0x327f('0x3a')](_0x4254de['query'][_0x327f('0x3a')]);_0x5c029e[_0x327f('0x3b')]=qs[_0x327f('0x32')](_[_0x327f('0x3c')](_0x4254de[_0x327f('0x31')],_0x539abd[_0x327f('0x32')]),_0x2a0d9e);if(_0x4254de[_0x327f('0x31')][_0x327f('0x3d')]){_0x5c029e[_0x327f('0x3b')]=_['merge'](_0x5c029e[_0x327f('0x3b')],{'$or':_[_0x327f('0x3e')](_0x5c029e['attributes'],function(_0x39d756){var _0x318787={};_0x318787[_0x39d756]={'$like':'%'+_0x4254de[_0x327f('0x31')][_0x327f('0x3d')]+'%'};return _0x318787;})});}_0x5c029e=_[_0x327f('0x3f')]({},_0x5c029e,_0x4254de[_0x327f('0x40')]);var _0x3bb0ea={'where':_0x5c029e['where']};return db[_0x327f('0x2e')][_0x327f('0x1f')](_0x3bb0ea)[_0x327f('0x23')](function(_0x211ec5){_0x338a20['count']=_0x211ec5;if(_0x4254de[_0x327f('0x31')][_0x327f('0x41')]){_0x5c029e[_0x327f('0x42')]=[{'all':!![]}];}return db[_0x327f('0x2e')]['findAll'](_0x5c029e);})['then'](function(_0x1f7182){_0x338a20['rows']=_0x1f7182;return _0x338a20;})['then'](respondWithFilteredResult(_0x3cad03,_0x5c029e))[_0x327f('0x43')](handleError(_0x3cad03,null));})[_0x327f('0x43')](handleError(_0x3cad03,null));};exports['show']=function(_0x3760bd,_0x4a8f6c){var _0x2febd9={'raw':![],'where':{'id':_0x3760bd[_0x327f('0x44')]['id']}},_0x4e3baf={};_0x4e3baf['model']=_['keys'](db[_0x327f('0x2e')][_0x327f('0x45')]);_0x4e3baf[_0x327f('0x31')]=_[_0x327f('0x30')](_0x3760bd[_0x327f('0x31')]);_0x4e3baf['filters']=_[_0x327f('0x33')](_0x4e3baf[_0x327f('0x34')],_0x4e3baf[_0x327f('0x31')]);_0x2febd9['attributes']=_[_0x327f('0x33')](_0x4e3baf[_0x327f('0x34')],qs[_0x327f('0x46')](_0x3760bd[_0x327f('0x31')][_0x327f('0x46')]));_0x2febd9[_0x327f('0x35')]=_0x2febd9['attributes']['length']?_0x2febd9[_0x327f('0x35')]:_0x4e3baf[_0x327f('0x34')];if(_0x3760bd[_0x327f('0x31')]['includeAll']){_0x2febd9[_0x327f('0x42')]=[{'all':!![]}];}_0x2febd9=_[_0x327f('0x3f')]({},_0x2febd9,_0x3760bd['options']);return db[_0x327f('0x2e')]['find'](_0x2febd9)[_0x327f('0x23')](handleEntityNotFound(_0x4a8f6c,null))[_0x327f('0x23')](respondWithResult(_0x4a8f6c,null))[_0x327f('0x43')](handleError(_0x4a8f6c,null));};exports[_0x327f('0x47')]=function(_0x220f59,_0x57b3c1){return db[_0x327f('0x2e')][_0x327f('0x47')](_0x220f59[_0x327f('0x48')],{})[_0x327f('0x23')](function(_0x2d84f6){var _0x7a19e=_0x220f59[_0x327f('0x49')][_0x327f('0x24')]({'plain':!![]});if(!_0x7a19e)throw new Error(_0x327f('0x4a'));if(_0x7a19e['role']===_0x327f('0x49')){var _0x2094f5=_0x2d84f6['get']({'plain':!![]});var _0x32e460=_0x327f('0x25');return db[_0x327f('0x4b')][_0x327f('0x4c')]({'where':{'name':_0x32e460,'userProfileId':_0x7a19e[_0x327f('0x4d')]},'raw':!![]})[_0x327f('0x23')](function(_0x3073aa){if(_0x3073aa&&_0x3073aa[_0x327f('0x4e')]===0x0){return db[_0x327f('0x26')][_0x327f('0x47')]({'name':_0x2094f5[_0x327f('0x2b')],'resourceId':_0x2094f5['id'],'type':_0x3073aa[_0x327f('0x2b')],'sectionId':_0x3073aa['id']},{})[_0x327f('0x23')](function(){return _0x2d84f6;});}else{return _0x2d84f6;}})[_0x327f('0x43')](function(_0x2ac2fb){logger[_0x327f('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2ac2fb);throw _0x2ac2fb;});}return _0x2d84f6;})[_0x327f('0x23')](respondWithResult(_0x57b3c1,0xc9))[_0x327f('0x43')](handleError(_0x57b3c1,null));};exports[_0x327f('0x4f')]=function(_0x1e6bcc,_0x477943){if(_0x1e6bcc['body']['id']){delete _0x1e6bcc[_0x327f('0x48')]['id'];}return db[_0x327f('0x2e')]['find']({'where':{'id':_0x1e6bcc['params']['id']}})[_0x327f('0x23')](handleEntityNotFound(_0x477943,null))[_0x327f('0x23')](saveUpdates(_0x1e6bcc[_0x327f('0x48')],null))['then'](respondWithResult(_0x477943,null))[_0x327f('0x43')](handleError(_0x477943,null));};exports[_0x327f('0x27')]=function(_0x1e2cd8,_0x180898){return db[_0x327f('0x2e')]['find']({'where':{'id':_0x1e2cd8[_0x327f('0x44')]['id']}})[_0x327f('0x23')](handleEntityNotFound(_0x180898,null))[_0x327f('0x23')](removeEntity(_0x180898,null))[_0x327f('0x43')](handleError(_0x180898,null));};exports['describe']=function(_0x212c9a,_0x579aab){return db[_0x327f('0x2e')][_0x327f('0x2f')]()[_0x327f('0x23')](respondWithResult(_0x579aab,null))['catch'](handleError(_0x579aab,null));};exports['addContacts']=function(_0x57f6f3,_0x40a271,_0x49a669){return db[_0x327f('0x50')][_0x327f('0x4c')]({'where':{'id':_0x57f6f3['params']['id']}})[_0x327f('0x23')](handleEntityNotFound(_0x40a271,null))['then'](function(_0x33f610){if(_0x33f610){return _0x33f610[_0x327f('0x51')](_0x57f6f3[_0x327f('0x48')][_0x327f('0x52')],_[_0x327f('0x53')](_0x57f6f3[_0x327f('0x48')],[_0x327f('0x52'),'id'])||{});}})[_0x327f('0x23')](respondWithResult(_0x40a271,null))['catch'](handleError(_0x40a271,null));};exports[_0x327f('0x54')]=function(_0x596d2e,_0x14e2f3,_0x3350ee){var _0x566204={};var _0x27aebc={};var _0x3b420c;var _0x4eabdb;return db['CmCompany'][_0x327f('0x55')]({'where':{'id':_0x596d2e[_0x327f('0x44')]['id']}})['then'](handleEntityNotFound(_0x14e2f3,null))[_0x327f('0x23')](function(_0x3eb3da){if(_0x3eb3da){_0x3b420c=_0x3eb3da;_0x27aebc['model']=_[_0x327f('0x30')](db[_0x327f('0x50')][_0x327f('0x45')]);_0x27aebc['query']=_['keys'](_0x596d2e[_0x327f('0x31')]);_0x27aebc[_0x327f('0x32')]=_[_0x327f('0x33')](_0x27aebc[_0x327f('0x34')],_0x27aebc['query']);_0x566204['attributes']=_[_0x327f('0x33')](_0x27aebc['model'],qs[_0x327f('0x46')](_0x596d2e[_0x327f('0x31')][_0x327f('0x46')]));_0x566204['attributes']=_0x566204[_0x327f('0x35')][_0x327f('0x36')]?_0x566204[_0x327f('0x35')]:_0x27aebc[_0x327f('0x34')];_0x566204[_0x327f('0x39')]=qs[_0x327f('0x3a')](_0x596d2e[_0x327f('0x31')][_0x327f('0x3a')]);_0x566204[_0x327f('0x3b')]=qs[_0x327f('0x32')](_[_0x327f('0x3c')](_0x596d2e[_0x327f('0x31')],_0x27aebc['filters']));if(_0x596d2e[_0x327f('0x31')][_0x327f('0x3d')]){_0x566204[_0x327f('0x3b')]=_[_0x327f('0x3f')](_0x566204[_0x327f('0x3b')],{'$or':_[_0x327f('0x3e')](_0x566204['attributes'],function(_0x1eac45){var _0x395ce7={};_0x395ce7[_0x1eac45]={'$like':'%'+_0x596d2e[_0x327f('0x31')][_0x327f('0x3d')]+'%'};return _0x395ce7;})});}_0x566204=_[_0x327f('0x3f')]({},_0x566204,_0x596d2e[_0x327f('0x40')]);return _0x3b420c[_0x327f('0x54')](_0x566204);}})[_0x327f('0x23')](function(_0xa3578f){if(_0xa3578f){_0x4eabdb=_0xa3578f[_0x327f('0x36')];if(!_0x596d2e['query']['hasOwnProperty'](_0x327f('0x38'))){_0x566204['limit']=qs['limit'](_0x596d2e[_0x327f('0x31')][_0x327f('0x1e')]);_0x566204[_0x327f('0x1c')]=qs[_0x327f('0x1c')](_0x596d2e['query'][_0x327f('0x1c')]);}return _0x3b420c[_0x327f('0x54')](_0x566204);}})[_0x327f('0x23')](function(_0x51297c){if(_0x51297c){return _0x51297c?{'count':_0x4eabdb,'rows':_0x51297c}:null;}})[_0x327f('0x23')](respondWithResult(_0x14e2f3,null))['catch'](handleError(_0x14e2f3,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index ef7ea03..f028ba8 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 _0x8c18=['../../config/environment','./cmCompany.attributes','exports','CmCompany','cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4b9ba5,_0x34b868){var _0x292a7b=function(_0x18bf6f){while(--_0x18bf6f){_0x4b9ba5['push'](_0x4b9ba5['shift']());}};_0x292a7b(++_0x34b868);}(_0x8c18,0x11d));var _0x88c1=function(_0xacae67,_0x5572c4){_0xacae67=_0xacae67-0x0;var _0x5a07f5=_0x8c18[_0xacae67];return _0x5a07f5;};'use strict';var _=require(_0x88c1('0x0'));var util=require(_0x88c1('0x1'));var logger=require(_0x88c1('0x2'))(_0x88c1('0x3'));var moment=require(_0x88c1('0x4'));var BPromise=require(_0x88c1('0x5'));var rp=require(_0x88c1('0x6'));var fs=require('fs');var path=require(_0x88c1('0x7'));var rimraf=require(_0x88c1('0x8'));var config=require(_0x88c1('0x9'));var attributes=require(_0x88c1('0xa'));module[_0x88c1('0xb')]=function(_0x393bea,_0x4d2683){return _0x393bea['define'](_0x88c1('0xc'),attributes,{'tableName':_0x88c1('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfdb8=['rimraf','../../config/environment','define','CmCompany','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xfdb8,0x70));var _0x8fdb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdb8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x8fdb('0x0'));var util=require(_0x8fdb('0x1'));var logger=require(_0x8fdb('0x2'))(_0x8fdb('0x3'));var moment=require(_0x8fdb('0x4'));var BPromise=require(_0x8fdb('0x5'));var rp=require(_0x8fdb('0x6'));var fs=require('fs');var path=require(_0x8fdb('0x7'));var rimraf=require(_0x8fdb('0x8'));var config=require(_0x8fdb('0x9'));var attributes=require('./cmCompany.attributes');module['exports']=function(_0x33d670,_0xefc77c){return _0x33d670[_0x8fdb('0xa')](_0x8fdb('0xb'),attributes,{'tableName':'cm_companies','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 79d5988..cbed507 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 _0xce02=['jayson/promise','client','http','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','error','code','message','CmCompany,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x4509db,_0x2111ce){var _0x267328=function(_0x587a97){while(--_0x587a97){_0x4509db['push'](_0x4509db['shift']());}};_0x267328(++_0x2111ce);}(_0xce02,0x146));var _0x2ce0=function(_0x836465,_0x5442ae){_0x836465=_0x836465-0x0;var _0x2150ea=_0xce02[_0x836465];return _0x2150ea;};'use strict';var _=require(_0x2ce0('0x0'));var util=require(_0x2ce0('0x1'));var moment=require(_0x2ce0('0x2'));var BPromise=require(_0x2ce0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2ce0('0x4'));var db=require(_0x2ce0('0x5'))['db'];var utils=require(_0x2ce0('0x6'));var logger=require(_0x2ce0('0x7'))(_0x2ce0('0x8'));var config=require(_0x2ce0('0x9'));var jayson=require(_0x2ce0('0xa'));var client=jayson[_0x2ce0('0xb')][_0x2ce0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x418751,_0x56c29c,_0x522b3a){return new BPromise(function(_0x98f346,_0x47b98e){return client['request'](_0x418751,_0x522b3a)[_0x2ce0('0xd')](function(_0x18ed4c){logger[_0x2ce0('0xe')]('CmCompany,\x20%s,\x20%s',_0x56c29c,_0x2ce0('0xf'));logger[_0x2ce0('0x10')](_0x2ce0('0x11'),_0x56c29c,_0x2ce0('0xf'),JSON['stringify'](_0x18ed4c));if(_0x18ed4c[_0x2ce0('0x12')]){if(_0x18ed4c['error'][_0x2ce0('0x13')]===0x1f4){logger[_0x2ce0('0x12')]('CmCompany,\x20%s,\x20%s',_0x56c29c,_0x18ed4c[_0x2ce0('0x12')][_0x2ce0('0x14')]);return _0x47b98e(_0x18ed4c[_0x2ce0('0x12')][_0x2ce0('0x14')]);}logger[_0x2ce0('0x12')](_0x2ce0('0x15'),_0x56c29c,_0x18ed4c['error'][_0x2ce0('0x14')]);return _0x98f346(_0x18ed4c[_0x2ce0('0x12')][_0x2ce0('0x14')]);}else{logger[_0x2ce0('0xe')](_0x2ce0('0x15'),_0x56c29c,_0x2ce0('0xf'));_0x98f346(_0x18ed4c[_0x2ce0('0x16')][_0x2ce0('0x14')]);}})[_0x2ce0('0x17')](function(_0x366962){logger[_0x2ce0('0x12')](_0x2ce0('0x15'),_0x56c29c,_0x366962);_0x47b98e(_0x366962);});});}
\ No newline at end of file
+var _0xe1aa=['error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s'];(function(_0x3204b2,_0x72c42e){var _0x248361=function(_0x504464){while(--_0x504464){_0x3204b2['push'](_0x3204b2['shift']());}};_0x248361(++_0x72c42e);}(_0xe1aa,0x6c));var _0xae1a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe1aa[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xae1a('0x0'));var util=require(_0xae1a('0x1'));var moment=require(_0xae1a('0x2'));var BPromise=require(_0xae1a('0x3'));var rs=require(_0xae1a('0x4'));var fs=require('fs');var Redis=require(_0xae1a('0x5'));var db=require(_0xae1a('0x6'))['db'];var utils=require(_0xae1a('0x7'));var logger=require(_0xae1a('0x8'))(_0xae1a('0x9'));var config=require(_0xae1a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xae1a('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ab86,_0x59c1a9,_0x578d4c){return new BPromise(function(_0x3d5fe6,_0x263a9d){return client['request'](_0x5ab86,_0x578d4c)[_0xae1a('0xc')](function(_0x2fb944){logger[_0xae1a('0xd')](_0xae1a('0xe'),_0x59c1a9,_0xae1a('0xf'));logger[_0xae1a('0x10')](_0xae1a('0x11'),_0x59c1a9,_0xae1a('0xf'),JSON['stringify'](_0x2fb944));if(_0x2fb944[_0xae1a('0x12')]){if(_0x2fb944[_0xae1a('0x12')]['code']===0x1f4){logger[_0xae1a('0x12')](_0xae1a('0xe'),_0x59c1a9,_0x2fb944[_0xae1a('0x12')][_0xae1a('0x13')]);return _0x263a9d(_0x2fb944[_0xae1a('0x12')][_0xae1a('0x13')]);}logger[_0xae1a('0x12')](_0xae1a('0xe'),_0x59c1a9,_0x2fb944[_0xae1a('0x12')][_0xae1a('0x13')]);return _0x3d5fe6(_0x2fb944[_0xae1a('0x12')]['message']);}else{logger['info']('CmCompany,\x20%s,\x20%s',_0x59c1a9,_0xae1a('0xf'));_0x3d5fe6(_0x2fb944[_0xae1a('0x14')][_0xae1a('0x13')]);}})['catch'](function(_0x52c2e3){logger[_0xae1a('0x12')](_0xae1a('0xe'),_0x59c1a9,_0x52c2e3);_0x263a9d(_0x52c2e3);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 0689383..5cc5451 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 _0xcdf2=['../../components/interaction/service','../../config/environment','./cmCompany.controller','isAuthenticated','/describe','describe','show','/:id/contacts','getContacts','post','create','put','/:id','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x40f279,_0xb9d09f){var _0x4f866e=function(_0x182f3d){while(--_0x182f3d){_0x40f279['push'](_0x40f279['shift']());}};_0x4f866e(++_0xb9d09f);}(_0xcdf2,0x9b));var _0x2cdf=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0xcdf2[_0x1d1219];return _0x5b5b89;};'use strict';var multer=require(_0x2cdf('0x0'));var util=require(_0x2cdf('0x1'));var path=require(_0x2cdf('0x2'));var timeout=require(_0x2cdf('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x2cdf('0x4'));var interaction=require(_0x2cdf('0x5'));var config=require(_0x2cdf('0x6'));var controller=require(_0x2cdf('0x7'));router['get']('/',auth[_0x2cdf('0x8')](),controller['index']);router['get'](_0x2cdf('0x9'),auth[_0x2cdf('0x8')](),controller[_0x2cdf('0xa')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x2cdf('0xb')]);router['get'](_0x2cdf('0xc'),auth[_0x2cdf('0x8')](),controller[_0x2cdf('0xd')]);router[_0x2cdf('0xe')]('/',auth['isAuthenticated'](),controller[_0x2cdf('0xf')]);router['post'](_0x2cdf('0xc'),auth[_0x2cdf('0x8')](),controller['addContacts']);router[_0x2cdf('0x10')](_0x2cdf('0x11'),auth[_0x2cdf('0x8')](),controller['update']);router['delete'](_0x2cdf('0x11'),auth[_0x2cdf('0x8')](),controller[_0x2cdf('0x12')]);module[_0x2cdf('0x13')]=router;
\ No newline at end of file
+var _0x969e=['/:id/contacts','getContacts','post','create','addContacts','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./cmCompany.controller','get','index','/describe','/:id','isAuthenticated','show'];(function(_0x39e283,_0x247e6b){var _0x7de89f=function(_0x2f8c50){while(--_0x2f8c50){_0x39e283['push'](_0x39e283['shift']());}};_0x7de89f(++_0x247e6b);}(_0x969e,0x134));var _0xe969=function(_0x10356a,_0x526f4a){_0x10356a=_0x10356a-0x0;var _0x38d1e8=_0x969e[_0x10356a];return _0x38d1e8;};'use strict';var multer=require(_0xe969('0x0'));var util=require(_0xe969('0x1'));var path=require(_0xe969('0x2'));var timeout=require(_0xe969('0x3'));var express=require(_0xe969('0x4'));var router=express[_0xe969('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xe969('0x6'));var config=require('../../config/environment');var controller=require(_0xe969('0x7'));router[_0xe969('0x8')]('/',auth['isAuthenticated'](),controller[_0xe969('0x9')]);router['get'](_0xe969('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xe969('0x8')](_0xe969('0xb'),auth[_0xe969('0xc')](),controller[_0xe969('0xd')]);router[_0xe969('0x8')](_0xe969('0xe'),auth[_0xe969('0xc')](),controller[_0xe969('0xf')]);router[_0xe969('0x10')]('/',auth[_0xe969('0xc')](),controller[_0xe969('0x11')]);router[_0xe969('0x10')]('/:id/contacts',auth[_0xe969('0xc')](),controller[_0xe969('0x12')]);router[_0xe969('0x13')](_0xe969('0xb'),auth[_0xe969('0xc')](),controller['update']);router[_0xe969('0x14')]('/:id',auth['isAuthenticated'](),controller[_0xe969('0x15')]);module[_0xe969('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 6cdae4a..c87209f 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 _0x4d8f=['UNSIGNED','DATE','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x2a8809,_0x121836){var _0x166dab=function(_0x2bd619){while(--_0x2bd619){_0x2a8809['push'](_0x2a8809['shift']());}};_0x166dab(++_0x121836);}(_0x4d8f,0x147));var _0xf4d8=function(_0x15dbdf,_0x2bd8ce){_0x15dbdf=_0x15dbdf-0x0;var _0x40c804=_0x4d8f[_0x15dbdf];return _0x40c804;};'use strict';var _=require(_0xf4d8('0x0'));var Sequelize=require(_0xf4d8('0x1'));module[_0xf4d8('0x2')]={'firstName':{'type':Sequelize[_0xf4d8('0x3')],'allowNull':![]},'lastName':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xf4d8('0x3')]},'city':{'type':Sequelize[_0xf4d8('0x3')]},'country':{'type':Sequelize[_0xf4d8('0x3')]},'dateOfBirth':{'type':Sequelize[_0xf4d8('0x3')]},'description':{'type':Sequelize[_0xf4d8('0x4')]},'phone':{'type':Sequelize[_0xf4d8('0x3')]},'mobile':{'type':Sequelize[_0xf4d8('0x3')]},'fax':{'type':Sequelize[_0xf4d8('0x3')]},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize[_0xf4d8('0x3')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xf4d8('0x3')]},'twitter':{'type':Sequelize[_0xf4d8('0x3')]},'skype':{'type':Sequelize[_0xf4d8('0x3')]},'teams':{'type':Sequelize[_0xf4d8('0x3')]},'viber':{'type':Sequelize[_0xf4d8('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0xf4d8('0x3')]},'telegram':{'type':Sequelize[_0xf4d8('0x3')]},'UserId':{'type':Sequelize['INTEGER']},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xf4d8('0x5')](0x2)[_0xf4d8('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf4d8('0x7')],'defaultValue':Sequelize[_0xf4d8('0x8')]},'dialTimezone':{'type':Sequelize[_0xf4d8('0x3')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x3544=['DATE','NOW','lodash','sequelize','STRING','INTEGER','UNSIGNED'];(function(_0x39ff0d,_0x2df101){var _0x4d63eb=function(_0x35f7c1){while(--_0x35f7c1){_0x39ff0d['push'](_0x39ff0d['shift']());}};_0x4d63eb(++_0x2df101);}(_0x3544,0xbf));var _0x4354=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0x3544[_0x1ed116];return _0x574066;};'use strict';var _=require(_0x4354('0x0'));var Sequelize=require(_0x4354('0x1'));module['exports']={'firstName':{'type':Sequelize[_0x4354('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x4354('0x2')]},'street':{'type':Sequelize[_0x4354('0x2')]},'postalCode':{'type':Sequelize[_0x4354('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0x4354('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x4354('0x2')]},'mobile':{'type':Sequelize[_0x4354('0x2')]},'fax':{'type':Sequelize[_0x4354('0x2')]},'email':{'type':Sequelize[_0x4354('0x2')]},'url':{'type':Sequelize[_0x4354('0x2')]},'facebook':{'type':Sequelize[_0x4354('0x2')]},'fb_data':{'type':Sequelize[_0x4354('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x4354('0x2')]},'teams':{'type':Sequelize[_0x4354('0x2')]},'viber':{'type':Sequelize[_0x4354('0x2')]},'line':{'type':Sequelize[_0x4354('0x2')]},'wechat':{'type':Sequelize[_0x4354('0x2')]},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0x4354('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x4354('0x2')]},'priority':{'type':Sequelize[_0x4354('0x3')](0x2)[_0x4354('0x4')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x4354('0x5')],'defaultValue':Sequelize[_0x4354('0x6')]},'dialTimezone':{'type':Sequelize[_0x4354('0x2')]},'utcOffset':{'type':Sequelize[_0x4354('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index 0fe9c79..09b4978 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 _0x37bc=['rawAttributes','pick','ContactId','include','CmHopperHistory','includeAll','rows','getJscriptySessions','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_keys','split','No\x20phone\x20column\x20specified','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','File\x20uploaded\x20correctly!','pid','send','upload','createReadStream','parse','file','meta','agent','binding','socket_timestamp','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','User','firstName','../../components/import/cm/csvUpdates','mail','chat','sms','fax','whatsapp','voice','-createdAt','resolve','includes','channel','toLowerCase','range','isValid','Invalid\x20date\x20for\x20range\x20from\x20filter','Invalid\x20createdAt\x20filter','source','destination','callerid','duration','note','createdAt','userSecondDisposition','UserId','fullname','alias','DESC','Website','closed','disposition','secondDisposition','thirdDisposition','Account','key','Owner','browserName','customerIp','deviceModel','osName','ratingMessage','ratingValue','referer','subject','substatus','openchannel','externalUrl','threadId','startCase','reverse','slice','moment','bluebird','util','path','lodash','squel','ioredis','api','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','status','json','offset','undefined','count','limit','set','Content-Range','destroy','then','end','sendStatus','stack','name','index','describe','getOptions','findAll','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','columnName','query','analytics','CmCustomField','length','custom','type','Custom\x20field\x20%s\x20not\x20found\x20on\x20cm_contacts\x20table','forEach','merge','body','get','mergeWith','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','from','CmHopper','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmContactHasItem','CmHopperFinal','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isArray','join','isNil','dialTimezone','timezones','utcOffset','additionalPhones','bulkCreate','each','duplicates','push','where','ListId','spread','hasOwnProperty','contact','all','show','Tag','Tags','color','tag','Phones','ContactItemType','literal','Phones.OrderBy','$and','omit','pickBy','format','cf_%d','isEmpty','cm_contacts','setFields','toParam','text','values','phone','findOne','filters','intersection','model','fields','attributes','order','sort','filter','map','options','getTags','nolimit','setTags','ids','setAdditionalPhones','items','item_types','ItemTypeId','description','OrderBy','PHONE','CmHopperAdditionalPhone','`ItemType`.OrderBy','CmHopperId','item','ItemType.OrderBy','ItemType','getAdditionalPhones','sequelize','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers'];(function(_0x45406b,_0x5d1136){var _0x4e3cdd=function(_0x253a1e){while(--_0x253a1e){_0x45406b['push'](_0x45406b['shift']());}};_0x4e3cdd(++_0x5d1136);}(_0x37bc,0x15f));var _0xc37b=function(_0x192ed5,_0x1b3974){_0x192ed5=_0x192ed5-0x0;var _0x3f178b=_0x37bc[_0x192ed5];return _0x3f178b;};'use strict';var moment=require(_0xc37b('0x0'));var BPromise=require(_0xc37b('0x1'));var util=require(_0xc37b('0x2'));var path=require(_0xc37b('0x3'));var fs=require('fs');var _=require(_0xc37b('0x4'));var squel=require(_0xc37b('0x5'));var Papa=require('papaparse');var Redis=require(_0xc37b('0x6'));var contacts=require('../../components/contacts');var qs=require('../../components/parsers/qs');var logger=require('../../config/logger')(_0xc37b('0x7'));var config=require('../../config/environment');var shared=require(_0xc37b('0x8'));var db=require(_0xc37b('0x9'))['db'];config[_0xc37b('0xa')]=_[_0xc37b('0xb')](config['redis'],{'host':_0xc37b('0xc'),'port':0x18eb});var socket=require(_0xc37b('0xd'))(new Redis(config[_0xc37b('0xa')]));require(_0xc37b('0xe'))['register'](socket);function respondWithResult(_0xea9e81,_0xc4234f){_0xc4234f=_0xc4234f||0xc8;return function(_0x60e9a5){if(_0x60e9a5){return _0xea9e81[_0xc37b('0xf')](_0xc4234f)[_0xc37b('0x10')](_0x60e9a5);}};}function respondWithFilteredResult(_0x2684de,_0x4aeeb5){return function(_0x209585){if(_0x209585){var _0x52085d=typeof _0x4aeeb5[_0xc37b('0x11')]===_0xc37b('0x12')&&typeof _0x4aeeb5['limit']===_0xc37b('0x12');var _0x204c7c=_0x209585[_0xc37b('0x13')];var _0xb09fa2=_0x52085d?0x0:_0x4aeeb5[_0xc37b('0x11')];var _0xaa4bfa=_0x52085d?_0x209585[_0xc37b('0x13')]:_0x4aeeb5[_0xc37b('0x11')]+_0x4aeeb5[_0xc37b('0x14')];var _0x2f2bd1;if(_0xaa4bfa>=_0x204c7c){_0xaa4bfa=_0x204c7c;_0x2f2bd1=0xc8;}else{_0x2f2bd1=0xce;}_0x2684de[_0xc37b('0xf')](_0x2f2bd1);return _0x2684de[_0xc37b('0x15')](_0xc37b('0x16'),_0xb09fa2+'-'+_0xaa4bfa+'/'+_0x204c7c)[_0xc37b('0x10')](_0x209585);}return null;};}function saveUpdates(_0x3ddfb8){return function(_0x89c8a8){if(_0x89c8a8){return _0x89c8a8['update'](_0x3ddfb8)['then'](function(_0x587f99){return _0x587f99;});}return null;};}function removeEntity(_0x12a776){return function(_0x471054){if(_0x471054){return _0x471054[_0xc37b('0x17')]()[_0xc37b('0x18')](function(){_0x12a776[_0xc37b('0xf')](0xcc)[_0xc37b('0x19')]();});}};}function handleEntityNotFound(_0x425a77){return function(_0x31ae38){if(!_0x31ae38){_0x425a77[_0xc37b('0x1a')](0x194);}return _0x31ae38;};}function handleError(_0xc15854,_0x2bde68){_0x2bde68=_0x2bde68||0x1f4;return function(_0x5a3188){logger['error'](_0x5a3188[_0xc37b('0x1b')]);if(_0x5a3188[_0xc37b('0x1c')]){delete _0x5a3188[_0xc37b('0x1c')];}_0xc15854[_0xc37b('0xf')](_0x2bde68)['send'](_0x5a3188);};}exports[_0xc37b('0x1d')]=function(_0x251d65,_0xe4449){var _0x29234e={};return contacts[_0xc37b('0x1e')]()[_0xc37b('0x18')](function(_0x4fc52c){_0x29234e=qs[_0xc37b('0x1f')](_0x4fc52c,_0x251d65);return contacts[_0xc37b('0x20')](_0x251d65['query'],_0x251d65[_0xc37b('0x21')],_0x29234e,_0x4fc52c);})[_0xc37b('0x18')](respondWithFilteredResult(_0xe4449,_0x29234e))[_0xc37b('0x22')](handleError(_0xe4449,null));};exports[_0xc37b('0x17')]=function(_0x3da7b8,_0x27b0ed){return db[_0xc37b('0x23')][_0xc37b('0x24')]({'where':{'id':_0x3da7b8[_0xc37b('0x25')]['id']}})[_0xc37b('0x18')](handleEntityNotFound(_0x27b0ed,null))['then'](removeEntity(_0x27b0ed,null))['catch'](handleError(_0x27b0ed,null));};exports[_0xc37b('0x1e')]=function(_0x30f0bf,_0x56acf8){return db[_0xc37b('0x23')]['describe']()[_0xc37b('0x18')](function(_0x682ae7){delete _0x682ae7[_0xc37b('0x26')];for(var _0x5e0de8=0x0;_0x5e0de8
','generateXOAuth2Token','user=','utf-8','toString','base64','lodash','moment','randomstring','path','util','node-tnef','../../../config/logger','head','value','address','anonymous','generate','@xcally.com','name','substring','indexOf','length'];(function(_0x3b3bd7,_0x58e72e){var _0x414c31=function(_0x57453a){while(--_0x57453a){_0x3b3bd7['push'](_0x3b3bd7['shift']());}};_0x414c31(++_0x58e72e);}(_0xe3df,0x87));var _0xfe3d=function(_0x2e1997,_0x364eff){_0x2e1997=_0x2e1997-0x0;var _0x2e3dda=_0xe3df[_0x2e1997];return _0x2e3dda;};'use strict';var _=require(_0xfe3d('0x0'));var moment=require(_0xfe3d('0x1'));var random=require(_0xfe3d('0x2'));var fs=require('fs');var path=require(_0xfe3d('0x3'));var util=require(_0xfe3d('0x4'));var tnef=require(_0xfe3d('0x5'));var logger=require(_0xfe3d('0x6'))('email');var config=require('../../../config/environment');function getAddress(_0x1dfc9b){var _0x418038=_[_0xfe3d('0x7')](_0x1dfc9b[_0xfe3d('0x8')]);return _0x418038&&_0x418038['address']?_0x418038[_0xfe3d('0x9')]:_0xfe3d('0xa')+random[_0xfe3d('0xb')](0x6)+_0xfe3d('0xc');}function getFirstName(_0x1d9d10){var _0x5212a0=_['head'](_0x1d9d10[_0xfe3d('0x8')]);if(_0x5212a0&&_0x5212a0['name']){if(_0x5212a0['name']==_0x5212a0[_0xfe3d('0x9')]){return _0x5212a0[_0xfe3d('0xd')][_0xfe3d('0xe')](0x0,_0x5212a0[_0xfe3d('0xd')][_0xfe3d('0xf')]('@'));}var _0x3d5753=_0x5212a0[_0xfe3d('0xd')]['split'](/\s+/);return _0x3d5753[_0xfe3d('0x10')]>0x1?_0x3d5753['slice'](0x0,-0x1)[_0xfe3d('0x11')]('\x20'):_0x5212a0[_0xfe3d('0xd')];}return _0xfe3d('0x12');}function getLastName(_0xdcd8e8){var _0x2e434b=_[_0xfe3d('0x7')](_0xdcd8e8[_0xfe3d('0x8')]);if(_0x2e434b&&_0x2e434b[_0xfe3d('0xd')]){var _0x49e096=_0x2e434b[_0xfe3d('0xd')]['split'](/\s+/);return _0x49e096[_0xfe3d('0x10')]>0x1?_0x49e096[_0xfe3d('0x13')]():'';}return'';}function getMails(_0xeee022,_0x417b45){var _0x3e48b2='';for(var _0x59f90c=0x0;_0x59f90c<_0x417b45[_0xfe3d('0x8')]['length'];_0x59f90c+=0x1){if(_0x417b45['value'][_0x59f90c][_0xfe3d('0x9')]!==_0xeee022){if(!_[_0xfe3d('0x14')](_0x3e48b2)){_0x3e48b2+=',';}_0x3e48b2+=_0x417b45[_0xfe3d('0x8')][_0x59f90c]['name']||_0x417b45[_0xfe3d('0x8')][_0x59f90c]['address']||'';_0x3e48b2+='\x20<';_0x3e48b2+=_0x417b45[_0xfe3d('0x8')][_0x59f90c][_0xfe3d('0x9')]?_0x417b45[_0xfe3d('0x8')][_0x59f90c][_0xfe3d('0x9')]:'anonymous'+random['generate'](0x6)+_0xfe3d('0xc');_0x3e48b2+='>';}}return _0x3e48b2;}function parseEmail(_0x503d56,_0x4edb87,_0x454e8c){if(_0x4edb87[_0xfe3d('0x15')]){var _0x1a60b3=/