From: support
Date: Mon, 7 Mar 2022 10:13:46 +0000 (+0000)
Subject: Built motion from commit a52505e5.|2.6.4
X-Git-Url: http://repos.xcallymotion.com/base/%22angular-material.themes.css//%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%20%7B%20%20%20%20%2011license.mail?a=commitdiff_plain;h=dfd0087a7a9a8838094aeb5058084923f4045743;p=motion2.git
Built motion from commit a52505e5.|2.6.4
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index c3a2209..6783da7 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-03-07T09:20:10.099Z",
+ "time": "2022-03-07T10:02:28.544Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index f5f017e..a091943 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-03-07T09:20:10.099Z",
+ "time": "2022-03-07T10:02:28.544Z",
"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 abafc5d..22d421e 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 _0x138c=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','exports','VIRTUAL','STRING','contactManager','integration','motionbar','jscripty'];(function(_0x1b1d83,_0x24d157){var _0x486daf=function(_0x217919){while(--_0x217919){_0x1b1d83['push'](_0x1b1d83['shift']());}};_0x486daf(++_0x24d157);}(_0x138c,0x13c));var _0xc138=function(_0x5a0cc6,_0x317d1c){_0x5a0cc6=_0x5a0cc6-0x0;var _0x7af8cd=_0x138c[_0x5a0cc6];return _0x7af8cd;};'use strict';var Sequelize=require('sequelize');module[_0xc138('0x0')]={'name':{'type':Sequelize[_0xc138('0x1')],'get':function(_0x1000a6){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0xc138('0x2')],'allowNull':![],'validate':{'isIn':{'args':[[_0xc138('0x3'),_0xc138('0x4'),_0xc138('0x5'),_0xc138('0x6'),'urlForward',_0xc138('0x7'),_0xc138('0x8'),_0xc138('0x9')]],'msg':_0xc138('0xa')}},'comment':_0xc138('0xa')},'data1':{'type':Sequelize[_0xc138('0x2')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]'},'data3':{'type':Sequelize[_0xc138('0x2')](0x1000),'comment':_0xc138('0xb')},'data4':{'type':Sequelize['STRING'](0x1000),'comments':_0xc138('0xc')},'data5':{'type':Sequelize[_0xc138('0x2')](0x1000),'comments':_0xc138('0xd')},'data6':{'type':Sequelize[_0xc138('0x2')],'comments':_0xc138('0xe')},'data7':{'type':Sequelize[_0xc138('0xf')],'comments':_0xc138('0x10')}};
\ No newline at end of file
+var _0x5556=['browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','sequelize','exports','VIRTUAL','STRING','contactManager','motionbar','jscripty','urlForward'];(function(_0x385380,_0x1a8069){var _0x1cfcd3=function(_0x516f91){while(--_0x516f91){_0x385380['push'](_0x385380['shift']());}};_0x1cfcd3(++_0x1a8069);}(_0x5556,0x138));var _0x6555=function(_0x3a1dec,_0x1f943f){_0x3a1dec=_0x3a1dec-0x0;var _0x60ede0=_0x5556[_0x3a1dec];return _0x60ede0;};'use strict';var Sequelize=require(_0x6555('0x0'));module[_0x6555('0x1')]={'name':{'type':Sequelize[_0x6555('0x2')],'get':function(_0x50e4d7){return this['getDataValue']('action');}},'action':{'type':Sequelize[_0x6555('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6555('0x4'),'integration',_0x6555('0x5'),_0x6555('0x6'),_0x6555('0x7'),_0x6555('0x8'),_0x6555('0x9'),_0x6555('0xa')]],'msg':_0x6555('0xb')}},'comment':_0x6555('0xb')},'data1':{'type':Sequelize[_0x6555('0x3')](0x1000),'comment':'jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]'},'data2':{'type':Sequelize[_0x6555('0x3')](0x1000),'comment':_0x6555('0xc')},'data3':{'type':Sequelize[_0x6555('0x3')](0x1000),'comment':_0x6555('0xd')},'data4':{'type':Sequelize[_0x6555('0x3')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6555('0x3')](0x1000),'comments':'urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]'},'data6':{'type':Sequelize[_0x6555('0x3')],'comments':_0x6555('0xe')},'data7':{'type':Sequelize[_0x6555('0xf')],'comments':'urlForward[body]'}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 59dea49..6b0a59d 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 _0x7136=['error','name','send','body','Action','catch','destroy','params','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then'];(function(_0x444cdd,_0x33adf9){var _0x5ddc14=function(_0x1e638b){while(--_0x1e638b){_0x444cdd['push'](_0x444cdd['shift']());}};_0x5ddc14(++_0x33adf9);}(_0x7136,0x1c0));var _0x6713=function(_0x1bfabd,_0x58170c){_0x1bfabd=_0x1bfabd-0x0;var _0xce22c9=_0x7136[_0x1bfabd];return _0xce22c9;};'use strict';var emlformat=require(_0x6713('0x0'));var rimraf=require(_0x6713('0x1'));var zipdir=require(_0x6713('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6713('0x3'));var moment=require(_0x6713('0x4'));var BPromise=require(_0x6713('0x5'));var Mustache=require(_0x6713('0x6'));var util=require('util');var path=require(_0x6713('0x7'));var sox=require(_0x6713('0x8'));var csv=require(_0x6713('0x9'));var ejs=require(_0x6713('0xa'));var fs=require('fs');var fs_extra=require(_0x6713('0xb'));var _=require(_0x6713('0xc'));var squel=require(_0x6713('0xd'));var crypto=require(_0x6713('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x6713('0xf'));var toCsv=require(_0x6713('0x9'));var querystring=require(_0x6713('0x10'));var Papa=require(_0x6713('0x11'));var Redis=require('ioredis');var authService=require(_0x6713('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6713('0x13'));var logger=require('../../config/logger')(_0x6713('0x14'));var utils=require('../../config/utils');var config=require(_0x6713('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x6713('0x16'))['db'];function respondWithStatusCode(_0x4564a6,_0xe0ce69){_0xe0ce69=_0xe0ce69||0xcc;return function(_0x19cedd){if(_0x19cedd){return _0x4564a6[_0x6713('0x17')](_0xe0ce69);}return _0x4564a6[_0x6713('0x18')](_0xe0ce69)[_0x6713('0x19')]();};}function respondWithResult(_0x278532,_0x548e88){_0x548e88=_0x548e88||0xc8;return function(_0xe520c7){if(_0xe520c7){return _0x278532[_0x6713('0x18')](_0x548e88)['json'](_0xe520c7);}};}function respondWithFilteredResult(_0x1c3970,_0x43d616){return function(_0x1620ce){if(_0x1620ce){var _0x579a79=typeof _0x43d616[_0x6713('0x1a')]===_0x6713('0x1b')&&typeof _0x43d616[_0x6713('0x1c')]===_0x6713('0x1b');var _0x9bf426=_0x1620ce[_0x6713('0x1d')];var _0x219578=_0x579a79?0x0:_0x43d616[_0x6713('0x1a')];var _0xdaa8ba=_0x579a79?_0x1620ce[_0x6713('0x1d')]:_0x43d616['offset']+_0x43d616[_0x6713('0x1c')];var _0x4498d8;if(_0xdaa8ba>=_0x9bf426){_0xdaa8ba=_0x9bf426;_0x4498d8=0xc8;}else{_0x4498d8=0xce;}_0x1c3970[_0x6713('0x18')](_0x4498d8);return _0x1c3970[_0x6713('0x1e')](_0x6713('0x1f'),_0x219578+'-'+_0xdaa8ba+'/'+_0x9bf426)['json'](_0x1620ce);}return null;};}function patchUpdates(_0x13ac93){return function(_0xf00b84){try{jsonpatch[_0x6713('0x20')](_0xf00b84,_0x13ac93,!![]);}catch(_0x36c598){return BPromise['reject'](_0x36c598);}return _0xf00b84[_0x6713('0x21')]();};}function saveUpdates(_0x13a635,_0x19bcc1){return function(_0x4ca20c){if(_0x4ca20c){return _0x4ca20c[_0x6713('0x22')](_0x13a635)['then'](function(_0x308bee){return _0x308bee;});}return null;};}function removeEntity(_0x57d3cc,_0x238dfa){return function(_0xfb8cb8){if(_0xfb8cb8){return _0xfb8cb8['destroy']()[_0x6713('0x23')](function(){_0x57d3cc[_0x6713('0x18')](0xcc)[_0x6713('0x19')]();});}};}function handleEntityNotFound(_0x208147,_0x1a5451){return function(_0x4121eb){if(!_0x4121eb){_0x208147[_0x6713('0x17')](0x194);}return _0x4121eb;};}function handleError(_0x3ad7e0,_0x2abc0a){_0x2abc0a=_0x2abc0a||0x1f4;return function(_0x275c20){logger[_0x6713('0x24')](_0x275c20['stack']);if(_0x275c20[_0x6713('0x25')]){delete _0x275c20[_0x6713('0x25')];}_0x3ad7e0[_0x6713('0x18')](_0x2abc0a)[_0x6713('0x26')](_0x275c20);};}exports[_0x6713('0x22')]=function(_0x559d01,_0x4ffb3b){if(_0x559d01['body']['id']){delete _0x559d01[_0x6713('0x27')]['id'];}return db[_0x6713('0x28')]['find']({'where':{'id':_0x559d01['params']['id']}})[_0x6713('0x23')](handleEntityNotFound(_0x4ffb3b,null))[_0x6713('0x23')](saveUpdates(_0x559d01[_0x6713('0x27')],null))[_0x6713('0x23')](respondWithResult(_0x4ffb3b,null))[_0x6713('0x29')](handleError(_0x4ffb3b,null));};exports[_0x6713('0x2a')]=function(_0x4c9725,_0x23fa0b){return db[_0x6713('0x28')]['find']({'where':{'id':_0x4c9725[_0x6713('0x2b')]['id']}})[_0x6713('0x23')](handleEntityNotFound(_0x23fa0b,null))[_0x6713('0x23')](removeEntity(_0x23fa0b,null))[_0x6713('0x29')](handleError(_0x23fa0b,null));};
\ No newline at end of file
+var _0xe613=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','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','limit','undefined','count','offset','set','apply','save','update','then','stack','name','send','body','Action','find','catch','eml-format','rimraf','fast-json-patch'];(function(_0x482d01,_0x49c24){var _0x2f928b=function(_0x40e293){while(--_0x40e293){_0x482d01['push'](_0x482d01['shift']());}};_0x2f928b(++_0x49c24);}(_0xe613,0x111));var _0x3e61=function(_0x227588,_0x392465){_0x227588=_0x227588-0x0;var _0x1197d1=_0xe613[_0x227588];return _0x1197d1;};'use strict';var emlformat=require(_0x3e61('0x0'));var rimraf=require(_0x3e61('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3e61('0x2'));var rp=require(_0x3e61('0x3'));var moment=require(_0x3e61('0x4'));var BPromise=require(_0x3e61('0x5'));var Mustache=require(_0x3e61('0x6'));var util=require(_0x3e61('0x7'));var path=require(_0x3e61('0x8'));var sox=require(_0x3e61('0x9'));var csv=require(_0x3e61('0xa'));var ejs=require(_0x3e61('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x3e61('0xc'));var squel=require('squel');var crypto=require(_0x3e61('0xd'));var jsforce=require(_0x3e61('0xe'));var deskjs=require(_0x3e61('0xf'));var toCsv=require(_0x3e61('0xa'));var querystring=require('querystring');var Papa=require(_0x3e61('0x10'));var Redis=require(_0x3e61('0x11'));var authService=require(_0x3e61('0x12'));var qs=require(_0x3e61('0x13'));var as=require(_0x3e61('0x14'));var hardwareService=require(_0x3e61('0x15'));var logger=require(_0x3e61('0x16'))('api');var utils=require(_0x3e61('0x17'));var config=require(_0x3e61('0x18'));var licenseUtil=require('../../config/license/util');var db=require(_0x3e61('0x19'))['db'];function respondWithStatusCode(_0x52b504,_0x5205d2){_0x5205d2=_0x5205d2||0xcc;return function(_0x4bbb93){if(_0x4bbb93){return _0x52b504[_0x3e61('0x1a')](_0x5205d2);}return _0x52b504[_0x3e61('0x1b')](_0x5205d2)[_0x3e61('0x1c')]();};}function respondWithResult(_0x10e3b8,_0x3a3be8){_0x3a3be8=_0x3a3be8||0xc8;return function(_0x62e870){if(_0x62e870){return _0x10e3b8[_0x3e61('0x1b')](_0x3a3be8)[_0x3e61('0x1d')](_0x62e870);}};}function respondWithFilteredResult(_0x4c831a,_0x306ab1){return function(_0x43fc2d){if(_0x43fc2d){var _0x29d2e3=typeof _0x306ab1['offset']==='undefined'&&typeof _0x306ab1[_0x3e61('0x1e')]===_0x3e61('0x1f');var _0x236737=_0x43fc2d[_0x3e61('0x20')];var _0x21eee4=_0x29d2e3?0x0:_0x306ab1[_0x3e61('0x21')];var _0x4218a0=_0x29d2e3?_0x43fc2d[_0x3e61('0x20')]:_0x306ab1[_0x3e61('0x21')]+_0x306ab1['limit'];var _0x3487c0;if(_0x4218a0>=_0x236737){_0x4218a0=_0x236737;_0x3487c0=0xc8;}else{_0x3487c0=0xce;}_0x4c831a[_0x3e61('0x1b')](_0x3487c0);return _0x4c831a[_0x3e61('0x22')]('Content-Range',_0x21eee4+'-'+_0x4218a0+'/'+_0x236737)['json'](_0x43fc2d);}return null;};}function patchUpdates(_0x1e8159){return function(_0x1f20d2){try{jsonpatch[_0x3e61('0x23')](_0x1f20d2,_0x1e8159,!![]);}catch(_0x298e22){return BPromise['reject'](_0x298e22);}return _0x1f20d2[_0x3e61('0x24')]();};}function saveUpdates(_0x5275b1,_0xd447e9){return function(_0x13dba3){if(_0x13dba3){return _0x13dba3[_0x3e61('0x25')](_0x5275b1)[_0x3e61('0x26')](function(_0x16a466){return _0x16a466;});}return null;};}function removeEntity(_0x27d29a,_0x5f1575){return function(_0x12ea08){if(_0x12ea08){return _0x12ea08['destroy']()['then'](function(){_0x27d29a[_0x3e61('0x1b')](0xcc)[_0x3e61('0x1c')]();});}};}function handleEntityNotFound(_0x548163,_0x1d4c3d){return function(_0x40ab07){if(!_0x40ab07){_0x548163['sendStatus'](0x194);}return _0x40ab07;};}function handleError(_0x19122a,_0x1d1804){_0x1d1804=_0x1d1804||0x1f4;return function(_0x27d8e0){logger['error'](_0x27d8e0[_0x3e61('0x27')]);if(_0x27d8e0['name']){delete _0x27d8e0[_0x3e61('0x28')];}_0x19122a[_0x3e61('0x1b')](_0x1d1804)[_0x3e61('0x29')](_0x27d8e0);};}exports[_0x3e61('0x25')]=function(_0x3c55f3,_0x46f1af){if(_0x3c55f3[_0x3e61('0x2a')]['id']){delete _0x3c55f3['body']['id'];}return db[_0x3e61('0x2b')][_0x3e61('0x2c')]({'where':{'id':_0x3c55f3['params']['id']}})[_0x3e61('0x26')](handleEntityNotFound(_0x46f1af,null))[_0x3e61('0x26')](saveUpdates(_0x3c55f3[_0x3e61('0x2a')],null))['then'](respondWithResult(_0x46f1af,null))[_0x3e61('0x2d')](handleError(_0x46f1af,null));};exports['destroy']=function(_0x28a462,_0x545c45){return db['Action'][_0x3e61('0x2c')]({'where':{'id':_0x28a462['params']['id']}})[_0x3e61('0x26')](handleEntityNotFound(_0x545c45,null))['then'](removeEntity(_0x545c45,null))[_0x3e61('0x2d')](handleError(_0x545c45,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 4f16d72..2ebe007 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 _0x05a0=['tools_actions','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./action.attributes','exports','define'];(function(_0x5d1d25,_0x763b36){var _0x5d5dce=function(_0x4e813c){while(--_0x4e813c){_0x5d1d25['push'](_0x5d1d25['shift']());}};_0x5d5dce(++_0x763b36);}(_0x05a0,0x12d));var _0x005a=function(_0x22dffb,_0x52906e){_0x22dffb=_0x22dffb-0x0;var _0x8e5f15=_0x05a0[_0x22dffb];return _0x8e5f15;};'use strict';var _=require('lodash');var util=require(_0x005a('0x0'));var logger=require(_0x005a('0x1'))(_0x005a('0x2'));var moment=require(_0x005a('0x3'));var BPromise=require(_0x005a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x005a('0x5'));var rimraf=require(_0x005a('0x6'));var config=require(_0x005a('0x7'));var attributes=require(_0x005a('0x8'));module[_0x005a('0x9')]=function(_0x2c974d,_0x5f4b77){return _0x2c974d[_0x005a('0xa')]('Action',attributes,{'tableName':_0x005a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd21d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','Action','tools_actions','util','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd21d,0x14e));var _0xdd21=function(_0x51539c,_0x25f587){_0x51539c=_0x51539c-0x0;var _0x4f7914=_0xd21d[_0x51539c];return _0x4f7914;};'use strict';var _=require('lodash');var util=require(_0xdd21('0x0'));var logger=require(_0xdd21('0x1'))(_0xdd21('0x2'));var moment=require(_0xdd21('0x3'));var BPromise=require(_0xdd21('0x4'));var rp=require(_0xdd21('0x5'));var fs=require('fs');var path=require(_0xdd21('0x6'));var rimraf=require(_0xdd21('0x7'));var config=require(_0xdd21('0x8'));var attributes=require(_0xdd21('0x9'));module[_0xdd21('0xa')]=function(_0x1791e6,_0x55c2fc){return _0x1791e6[_0xdd21('0xb')](_0xdd21('0xc'),attributes,{'tableName':_0xdd21('0xd'),'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 e6111f2..3ff1b46 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 _0xe14b=['../../config/environment','jayson/promise','client','http','then','info','Action,\x20%s,\x20%s','Action,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','randomstring','ioredis','../../config/utils'];(function(_0x2c7462,_0x1d2a67){var _0x238edb=function(_0x35a6c5){while(--_0x35a6c5){_0x2c7462['push'](_0x2c7462['shift']());}};_0x238edb(++_0x1d2a67);}(_0xe14b,0x93));var _0xbe14=function(_0x3806c6,_0x8cfed){_0x3806c6=_0x3806c6-0x0;var _0x4ea3c6=_0xe14b[_0x3806c6];return _0x4ea3c6;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbe14('0x2'));var fs=require('fs');var Redis=require(_0xbe14('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe14('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xbe14('0x5'));var jayson=require(_0xbe14('0x6'));var client=jayson[_0xbe14('0x7')][_0xbe14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d9ade,_0x39387e,_0x196fca){return new BPromise(function(_0x566ae7,_0x50f909){return client['request'](_0x1d9ade,_0x196fca)[_0xbe14('0x9')](function(_0x6fceff){logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,'request\x20sent');logger['debug'](_0xbe14('0xc'),_0x39387e,_0xbe14('0xd'),JSON['stringify'](_0x6fceff));if(_0x6fceff[_0xbe14('0xe')]){if(_0x6fceff[_0xbe14('0xe')][_0xbe14('0xf')]===0x1f4){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x50f909(_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);}logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0x6fceff[_0xbe14('0xe')][_0xbe14('0x10')]);return _0x566ae7(_0x6fceff['error']['message']);}else{logger[_0xbe14('0xa')](_0xbe14('0xb'),_0x39387e,_0xbe14('0xd'));_0x566ae7(_0x6fceff[_0xbe14('0x11')]['message']);}})[_0xbe14('0x12')](function(_0xe9c3ec){logger[_0xbe14('0xe')](_0xbe14('0xb'),_0x39387e,_0xe9c3ec);_0x50f909(_0xe9c3ec);});});}
\ No newline at end of file
+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(_0x5dcbaa,_0xbe8cf7){_0x5dcbaa=_0x5dcbaa-0x0;var _0x553930=_0x7a54[_0x5dcbaa];return _0x553930;};'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
diff --git a/server/api/action/index.js b/server/api/action/index.js
index 7d0446b..4d246c4 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 _0x2cf6=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util'];(function(_0x420c7e,_0x2fb00d){var _0x1fdcb0=function(_0xe73be0){while(--_0xe73be0){_0x420c7e['push'](_0x420c7e['shift']());}};_0x1fdcb0(++_0x2fb00d);}(_0x2cf6,0xa3));var _0x62cf=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x2cf6[_0x110c3d];return _0x226d67;};'use strict';var multer=require(_0x62cf('0x0'));var util=require(_0x62cf('0x1'));var path=require(_0x62cf('0x2'));var timeout=require('connect-timeout');var express=require(_0x62cf('0x3'));var router=express[_0x62cf('0x4')]();var fs_extra=require(_0x62cf('0x5'));var auth=require(_0x62cf('0x6'));var interaction=require(_0x62cf('0x7'));var config=require('../../config/environment');var controller=require('./action.controller');router[_0x62cf('0x8')](_0x62cf('0x9'),auth[_0x62cf('0xa')](),controller[_0x62cf('0xb')]);router[_0x62cf('0xc')]('/:id',auth[_0x62cf('0xa')](),controller[_0x62cf('0xd')]);module[_0x62cf('0xe')]=router;
\ No newline at end of file
+var _0x51fd=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','isAuthenticated','update','delete','destroy','multer','path','connect-timeout','express'];(function(_0x4aa11a,_0x3be0ea){var _0x26559b=function(_0x5c559c){while(--_0x5c559c){_0x4aa11a['push'](_0x4aa11a['shift']());}};_0x26559b(++_0x3be0ea);}(_0x51fd,0x1bc));var _0xd51f=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x51fd[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0xd51f('0x0'));var util=require('util');var path=require(_0xd51f('0x1'));var timeout=require(_0xd51f('0x2'));var express=require(_0xd51f('0x3'));var router=express['Router']();var fs_extra=require(_0xd51f('0x4'));var auth=require(_0xd51f('0x5'));var interaction=require(_0xd51f('0x6'));var config=require(_0xd51f('0x7'));var controller=require(_0xd51f('0x8'));router['put'](_0xd51f('0x9'),auth[_0xd51f('0xa')](),controller[_0xd51f('0xb')]);router[_0xd51f('0xc')](_0xd51f('0x9'),auth[_0xd51f('0xa')](),controller[_0xd51f('0xd')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 23cc12f..77ce71f 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 _0x6f47=['TEXT','exports','STRING'];(function(_0x357fad,_0x42dbdb){var _0xd81521=function(_0x11b54a){while(--_0x11b54a){_0x357fad['push'](_0x357fad['shift']());}};_0xd81521(++_0x42dbdb);}(_0x6f47,0xc7));var _0x76f4=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0x6f47[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require('sequelize');module[_0x76f4('0x0')]={'name':{'type':Sequelize[_0x76f4('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x76f4('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x76f4('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x31f0=['sequelize','STRING','TEXT'];(function(_0x1aa4bd,_0xf7b1ba){var _0xebaf39=function(_0x41b54e){while(--_0x41b54e){_0x1aa4bd['push'](_0x1aa4bd['shift']());}};_0xebaf39(++_0xf7b1ba);}(_0x31f0,0xb7));var _0x031f=function(_0xfca315,_0xd1fdca){_0xfca315=_0xfca315-0x0;var _0x2d1eac=_0x31f0[_0xfca315];return _0x2d1eac;};'use strict';var Sequelize=require(_0x031f('0x0'));module['exports']={'name':{'type':Sequelize[_0x031f('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x031f('0x1')]},'table':{'type':Sequelize[_0x031f('0x1')]},'conditions':{'type':Sequelize[_0x031f('0x2')]},'joins':{'type':Sequelize[_0x031f('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index ed56831..beffbb5 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 _0xde7a=['child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','runReport','COUNT(%s)','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','alias','Limited\x20Query:','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','save','update','then','destroy','get','CustomReports','UserProfileResource','error','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','AnalyticCustomReport','findAll','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','preview','join','left_join','right_join','SUM(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','order','DESC','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','cross_join','MAX(%s)','HOUR(%s)','ROUND(%s)','IS\x20EMPTY','ValidationErrorItem','output','web','fullPath','%s-%s.%s','randomstring','generate','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','Run\x20Query:'];(function(_0x34bc30,_0x177cb0){var _0x5706de=function(_0x535a8c){while(--_0x535a8c){_0x34bc30['push'](_0x34bc30['shift']());}};_0x5706de(++_0x177cb0);}(_0xde7a,0x15c));var _0xade7=function(_0x561088,_0x282dab){_0x561088=_0x561088-0x0;var _0x2af325=_0xde7a[_0x561088];return _0x2af325;};'use strict';var emlformat=require(_0xade7('0x0'));var rimraf=require(_0xade7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xade7('0x2'));var rp=require(_0xade7('0x3'));var moment=require(_0xade7('0x4'));var BPromise=require(_0xade7('0x5'));var Mustache=require(_0xade7('0x6'));var util=require(_0xade7('0x7'));var path=require(_0xade7('0x8'));var sox=require(_0xade7('0x9'));var csv=require(_0xade7('0xa'));var ejs=require(_0xade7('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xade7('0xc'));var squel=require(_0xade7('0xd'));var crypto=require(_0xade7('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xade7('0xa'));var querystring=require(_0xade7('0xf'));var Papa=require(_0xade7('0x10'));var Redis=require('ioredis');var authService=require(_0xade7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xade7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xade7('0x13'))(_0xade7('0x14'));var utils=require(_0xade7('0x15'));var config=require(_0xade7('0x16'));var licenseUtil=require(_0xade7('0x17'));var db=require(_0xade7('0x18'))['db'];var dbH=require('../../mysqldb')[_0xade7('0x19')];function respondWithStatusCode(_0x5f6e9d,_0x47cf37){_0x47cf37=_0x47cf37||0xcc;return function(_0x206009){if(_0x206009){return _0x5f6e9d[_0xade7('0x1a')](_0x47cf37);}return _0x5f6e9d[_0xade7('0x1b')](_0x47cf37)[_0xade7('0x1c')]();};}function respondWithResult(_0x2eca51,_0x4a1cf7){_0x4a1cf7=_0x4a1cf7||0xc8;return function(_0x3fb9d6){if(_0x3fb9d6){return _0x2eca51[_0xade7('0x1b')](_0x4a1cf7)[_0xade7('0x1d')](_0x3fb9d6);}};}function respondWithFilteredResult(_0x19f202,_0x375ee1){return function(_0xf07f87){if(_0xf07f87){var _0x39d0cd=typeof _0x375ee1[_0xade7('0x1e')]===_0xade7('0x1f')&&typeof _0x375ee1[_0xade7('0x20')]===_0xade7('0x1f');var _0x49251e=_0xf07f87['count'];var _0x3259fc=_0x39d0cd?0x0:_0x375ee1['offset'];var _0x2b5f00=_0x39d0cd?_0xf07f87[_0xade7('0x21')]:_0x375ee1[_0xade7('0x1e')]+_0x375ee1['limit'];var _0x324543;if(_0x2b5f00>=_0x49251e){_0x2b5f00=_0x49251e;_0x324543=0xc8;}else{_0x324543=0xce;}_0x19f202[_0xade7('0x1b')](_0x324543);return _0x19f202[_0xade7('0x22')](_0xade7('0x23'),_0x3259fc+'-'+_0x2b5f00+'/'+_0x49251e)[_0xade7('0x1d')](_0xf07f87);}return null;};}function patchUpdates(_0x1a90aa){return function(_0x12a22a){try{jsonpatch['apply'](_0x12a22a,_0x1a90aa,!![]);}catch(_0x412f6a){return BPromise['reject'](_0x412f6a);}return _0x12a22a[_0xade7('0x24')]();};}function saveUpdates(_0x71f8de,_0x131081){return function(_0x168fac){if(_0x168fac){return _0x168fac[_0xade7('0x25')](_0x71f8de)[_0xade7('0x26')](function(_0x469653){return _0x469653;});}return null;};}function removeEntity(_0x42f42d,_0x5a942b){return function(_0x482ac3){if(_0x482ac3){return _0x482ac3[_0xade7('0x27')]()['then'](function(){var _0x21bf15=_0x482ac3[_0xade7('0x28')]({'plain':!![]});var _0x306f71=_0xade7('0x29');return db[_0xade7('0x2a')][_0xade7('0x27')]({'where':{'type':_0x306f71,'resourceId':_0x21bf15['id']}})[_0xade7('0x26')](function(){return _0x482ac3;});})['then'](function(){_0x42f42d[_0xade7('0x1b')](0xcc)[_0xade7('0x1c')]();});}};}function handleEntityNotFound(_0xa07655,_0x1476fa){return function(_0x473779){if(!_0x473779){_0xa07655[_0xade7('0x1a')](0x194);}return _0x473779;};}function handleError(_0x51dce1,_0x6bbffe){_0x6bbffe=_0x6bbffe||0x1f4;return function(_0x523b4a){logger[_0xade7('0x2b')](_0x523b4a['stack']);if(_0x523b4a['name']){delete _0x523b4a['name'];}_0x51dce1['status'](_0x6bbffe)[_0xade7('0x2c')](_0x523b4a);};}exports[_0xade7('0x2d')]=function(_0x25f81c,_0x1640b4){var _0x334275={},_0x757297={},_0x4bd255={'count':0x0,'rows':[]};var _0x401c5c=_[_0xade7('0x2e')](db['AnalyticCustomReport'][_0xade7('0x2f')],function(_0x24deaf){return{'name':_0x24deaf[_0xade7('0x30')],'type':_0x24deaf[_0xade7('0x31')][_0xade7('0x32')]};});_0x757297[_0xade7('0x33')]=_[_0xade7('0x2e')](_0x401c5c,_0xade7('0x34'));_0x757297[_0xade7('0x35')]=_[_0xade7('0x36')](_0x25f81c[_0xade7('0x35')]);_0x757297[_0xade7('0x37')]=_[_0xade7('0x38')](_0x757297[_0xade7('0x33')],_0x757297['query']);_0x334275[_0xade7('0x39')]=_[_0xade7('0x38')](_0x757297[_0xade7('0x33')],qs[_0xade7('0x3a')](_0x25f81c[_0xade7('0x35')][_0xade7('0x3a')]));_0x334275[_0xade7('0x39')]=_0x334275[_0xade7('0x39')][_0xade7('0x3b')]?_0x334275[_0xade7('0x39')]:_0x757297['model'];if(!_0x25f81c[_0xade7('0x35')][_0xade7('0x3c')]('nolimit')){_0x334275['limit']=qs[_0xade7('0x20')](_0x25f81c[_0xade7('0x35')][_0xade7('0x20')]);_0x334275[_0xade7('0x1e')]=qs[_0xade7('0x1e')](_0x25f81c[_0xade7('0x35')]['offset']);}_0x334275['order']=qs[_0xade7('0x3d')](_0x25f81c[_0xade7('0x35')][_0xade7('0x3d')]);_0x334275[_0xade7('0x3e')]=qs[_0xade7('0x37')](_[_0xade7('0x3f')](_0x25f81c[_0xade7('0x35')],_0x757297['filters']),_0x401c5c);if(_0x25f81c[_0xade7('0x35')][_0xade7('0x40')]){_0x334275[_0xade7('0x3e')]=_[_0xade7('0x41')](_0x334275['where'],{'$or':_[_0xade7('0x2e')](_0x401c5c,function(_0xd7b1db){if(_0xd7b1db['type']!==_0xade7('0x42')){var _0x2f8e8f={};_0x2f8e8f[_0xd7b1db['name']]={'$like':'%'+_0x25f81c['query'][_0xade7('0x40')]+'%'};return _0x2f8e8f;}})});}_0x334275=_['merge']({},_0x334275,_0x25f81c['options']);var _0x11e8c5={'where':_0x334275[_0xade7('0x3e')]};return db['AnalyticCustomReport']['count'](_0x11e8c5)['then'](function(_0x20b345){_0x4bd255[_0xade7('0x21')]=_0x20b345;if(_0x25f81c[_0xade7('0x35')][_0xade7('0x43')]){_0x334275[_0xade7('0x44')]=[{'all':!![]}];}return db[_0xade7('0x45')][_0xade7('0x46')](_0x334275);})[_0xade7('0x26')](function(_0x10b328){_0x4bd255[_0xade7('0x47')]=_0x10b328;return _0x4bd255;})['then'](respondWithFilteredResult(_0x1640b4,_0x334275))[_0xade7('0x48')](handleError(_0x1640b4,null));};exports[_0xade7('0x49')]=function(_0x2ca539,_0x205393){var _0x502dfd={'raw':![],'where':{'id':_0x2ca539[_0xade7('0x4a')]['id']}},_0x561c5f={};_0x561c5f[_0xade7('0x33')]=_[_0xade7('0x36')](db[_0xade7('0x45')][_0xade7('0x2f')]);_0x561c5f[_0xade7('0x35')]=_[_0xade7('0x36')](_0x2ca539[_0xade7('0x35')]);_0x561c5f[_0xade7('0x37')]=_[_0xade7('0x38')](_0x561c5f[_0xade7('0x33')],_0x561c5f[_0xade7('0x35')]);_0x502dfd['attributes']=_[_0xade7('0x38')](_0x561c5f[_0xade7('0x33')],qs[_0xade7('0x3a')](_0x2ca539[_0xade7('0x35')][_0xade7('0x3a')]));_0x502dfd[_0xade7('0x39')]=_0x502dfd[_0xade7('0x39')][_0xade7('0x3b')]?_0x502dfd[_0xade7('0x39')]:_0x561c5f[_0xade7('0x33')];if(_0x2ca539[_0xade7('0x35')][_0xade7('0x43')]){_0x502dfd[_0xade7('0x44')]=[{'all':!![]}];}_0x502dfd=_[_0xade7('0x41')]({},_0x502dfd,_0x2ca539[_0xade7('0x4b')]);return db[_0xade7('0x45')][_0xade7('0x4c')](_0x502dfd)[_0xade7('0x26')](handleEntityNotFound(_0x205393,null))[_0xade7('0x26')](respondWithResult(_0x205393,null))[_0xade7('0x48')](handleError(_0x205393,null));};exports[_0xade7('0x4d')]=function(_0x2ae3db,_0x57119d){return db[_0xade7('0x45')]['create'](_0x2ae3db[_0xade7('0x4e')],{})[_0xade7('0x26')](function(_0x367df9){var _0x576f3f=_0x2ae3db[_0xade7('0x4f')][_0xade7('0x28')]({'plain':!![]});if(!_0x576f3f)throw new Error(_0xade7('0x50'));if(_0x576f3f[_0xade7('0x51')]===_0xade7('0x4f')){var _0x536859=_0x367df9['get']({'plain':!![]});var _0x3148df='Reports';return db[_0xade7('0x52')][_0xade7('0x4c')]({'where':{'name':_0x3148df,'userProfileId':_0x576f3f['userProfileId']},'raw':!![]})[_0xade7('0x26')](function(_0x4d4064){if(_0x4d4064&&_0x4d4064[_0xade7('0x53')]===0x0){return db['UserProfileResource']['create']({'name':_0x536859['name'],'resourceId':_0x536859['id'],'type':_0xade7('0x29'),'sectionId':_0x4d4064['id']},{})['then'](function(){return _0x367df9;});}else{return _0x367df9;}})[_0xade7('0x48')](function(_0x305725){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x305725);throw _0x305725;});}return _0x367df9;})[_0xade7('0x26')](respondWithResult(_0x57119d,0xc9))[_0xade7('0x48')](handleError(_0x57119d,null));};exports[_0xade7('0x25')]=function(_0x2f225b,_0x11f5d9){if(_0x2f225b[_0xade7('0x4e')]['id']){delete _0x2f225b[_0xade7('0x4e')]['id'];}return db[_0xade7('0x45')][_0xade7('0x4c')]({'where':{'id':_0x2f225b[_0xade7('0x4a')]['id']}})[_0xade7('0x26')](handleEntityNotFound(_0x11f5d9,null))[_0xade7('0x26')](saveUpdates(_0x2f225b[_0xade7('0x4e')],null))[_0xade7('0x26')](respondWithResult(_0x11f5d9,null))[_0xade7('0x48')](handleError(_0x11f5d9,null));};exports[_0xade7('0x27')]=function(_0xc8e22a,_0x5473d6){return db[_0xade7('0x45')][_0xade7('0x4c')]({'where':{'id':_0xc8e22a[_0xade7('0x4a')]['id']}})[_0xade7('0x26')](handleEntityNotFound(_0x5473d6,null))[_0xade7('0x26')](removeEntity(_0x5473d6,null))[_0xade7('0x48')](handleError(_0x5473d6,null));};exports[_0xade7('0x54')]=function(_0x2eb49f,_0x58c137){var _0x4831d5=0xa;var _0x2c51ef=[_0xade7('0x55'),_0xade7('0x56'),_0xade7('0x57'),'cross_join'];var _0x12fc62={'SUM':_0xade7('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xade7('0x59'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xade7('0x5a'),'GROUP_CONCAT':_0xade7('0x5b'),'GROUP_CONCAT ASC':_0xade7('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x687978={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xade7('0x5d'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xade7('0x5e')};var _0x4cc6c0=function(_0x4ce4f1){return!_[_0xade7('0x5f')]([_0xade7('0x60'),_0xade7('0x61'),'IS\x20EMPTY',_0xade7('0x62')],_0x4ce4f1);};var _0x406a3d=function(_0xcf6c4c){if(!_0xcf6c4c||!_0xcf6c4c[_0xade7('0x63')]['length']){return'';}for(var _0xc6498f='(',_0x4d5255=0x0;_0x4d5255<_0xcf6c4c[_0xade7('0x63')][_0xade7('0x3b')];_0x4d5255+=0x1){_0x4d5255>0x0&&(_0xc6498f+='\x20'+_0xcf6c4c[_0xade7('0x64')]+'\x20');_0xc6498f+=_0xcf6c4c['rules'][_0x4d5255][_0xade7('0x65')]?_0x406a3d(_0xcf6c4c[_0xade7('0x63')][_0x4d5255][_0xade7('0x65')]):_0xcf6c4c[_0xade7('0x63')][_0x4d5255][_0xade7('0x66')]+'\x20'+_0xcf6c4c[_0xade7('0x63')][_0x4d5255]['condition']+(_0x4cc6c0(_0xcf6c4c[_0xade7('0x63')][_0x4d5255][_0xade7('0x67')])?'\x20'+_0xcf6c4c[_0xade7('0x63')][_0x4d5255][_0xade7('0x68')]:'');}return _0xc6498f+')';};var _0x68c83f={'where':{'id':_0x2eb49f[_0xade7('0x4a')]['id']}},_0x506d52,_0x47f06e,_0x1fdbdf,_0x4e0137,_0x484e4f;_0x68c83f=_[_0xade7('0x41')]({},_0x68c83f,_0x2eb49f['options']);return db[_0xade7('0x45')][_0xade7('0x4c')](_0x68c83f)[_0xade7('0x26')](function(_0x5d7ade){if(_0x5d7ade){_0x506d52=_0x5d7ade;return _0x5d7ade[_0xade7('0x69')]();}return null;})[_0xade7('0x26')](function(_0xd03af8){if(_0xd03af8){if(!_0xd03af8[_0xade7('0x3b')]){throw new db[(_0xade7('0x6a'))]['ValidationErrorItem'](_0xade7('0x6b'),0x193);}_0x47f06e=_0xd03af8;return db[_0xade7('0x6c')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x21dc77){if(_0x21dc77){_0x1fdbdf=_[_0xade7('0x6d')](_0x21dc77,'id');var _0x158b3e;var _0x1d792b=squel[_0xade7('0x6e')]();_0x1d792b[_0xade7('0x6f')](_0x506d52[_0xade7('0x70')]);for(var _0x41650c=0x0;_0x41650c<_0x47f06e[_0xade7('0x3b')];_0x41650c+=0x1){_0x158b3e=_0x47f06e[_0x41650c][_0xade7('0x71')]?_0x1fdbdf[_0x47f06e[_0x41650c][_0xade7('0x71')]][_0xade7('0x72')]:_0x47f06e[_0x41650c][_0xade7('0x66')];_0x158b3e=_0x47f06e[_0x41650c][_0xade7('0x73')]?_['replace'](_0x12fc62[_0x47f06e[_0x41650c][_0xade7('0x73')]],'%s',_0x158b3e):_0x158b3e;_0x158b3e=_0x47f06e[_0x41650c]['format']?_[_0xade7('0x74')](_0x687978[_0x47f06e[_0x41650c][_0xade7('0x75')]],'%s',_0x158b3e):_0x158b3e;if(_0x47f06e[_0x41650c][_0xade7('0x76')]){_0x1d792b['group'](_0x158b3e);}_0x47f06e[_0x41650c][_0xade7('0x77')]&&_0x1d792b[_0xade7('0x78')](_0x158b3e,_0x47f06e[_0x41650c][_0xade7('0x77')]===_0xade7('0x79')?![]:!![]);_0x1d792b['field'](_0x158b3e,_0x47f06e[_0x41650c]['alias']||_0x158b3e);}if(_0x506d52[_0xade7('0x7a')]){_0x506d52[_0xade7('0x7a')]=JSON[_0xade7('0x7b')](_0x506d52[_0xade7('0x7a')]);for(var _0x16a49e=0x0;_0x16a49e<_0x506d52[_0xade7('0x7a')][_0xade7('0x3b')];_0x16a49e+=0x1){if(_0x506d52[_0xade7('0x7a')][_0x16a49e][_0xade7('0x31')]&&_['includes'](_0x2c51ef,_0x506d52['joins'][_0x16a49e][_0xade7('0x31')])&&_0x506d52[_0xade7('0x7a')][_0x16a49e][_0xade7('0x7c')]&&_0x506d52[_0xade7('0x7a')][_0x16a49e]['foreignTable']&&_0x506d52[_0xade7('0x7a')][_0x16a49e][_0xade7('0x7d')]){_0x1d792b[_0x506d52[_0xade7('0x7a')][_0x16a49e][_0xade7('0x31')]](_0x506d52[_0xade7('0x7a')][_0x16a49e]['foreignTable'],null,util[_0xade7('0x75')](_0xade7('0x7e'),_0x506d52[_0xade7('0x70')],_0x506d52['joins'][_0x16a49e][_0xade7('0x7c')],_0x506d52[_0xade7('0x7a')][_0x16a49e][_0xade7('0x7f')],_0x506d52['joins'][_0x16a49e]['foreignKey']));}}}if(_0x506d52[_0xade7('0x80')]){_0x506d52[_0xade7('0x80')]=JSON[_0xade7('0x7b')](_0x506d52[_0xade7('0x80')]);_0x1d792b[_0xade7('0x3e')](_0x406a3d(_0x506d52['conditions'][_0xade7('0x65')]));}_0x484e4f=_0x1d792b[_0xade7('0x81')]();_0x1d792b[_0xade7('0x20')](_0x4831d5);_0x1d792b[_0xade7('0x1e')](0x0);logger[_0xade7('0x82')]('Limited\x20Query:',_0x1d792b[_0xade7('0x83')]());return dbH[_0xade7('0x84')][_0xade7('0x35')](_0x1d792b[_0xade7('0x83')](),{'type':dbH[_0xade7('0x84')][_0xade7('0x85')][_0xade7('0x86')]});}})[_0xade7('0x26')](respondWithResult(_0x58c137,null))[_0xade7('0x48')](handleError(_0x58c137,null));};function runReport(_0x1ecd6b,_0x1bef7e,_0x45b604){var _0x17cb05=_0x1bef7e[_0xade7('0x34')];var _0x27e29e=0xa;var _0x3c95de=[_0xade7('0x55'),_0xade7('0x56'),_0xade7('0x57'),_0xade7('0x87')];var _0x546fca={'SUM':_0xade7('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xade7('0x88'),'MIN':'MIN(%s)','AVG':_0xade7('0x5a'),'GROUP_CONCAT':_0xade7('0x5b'),'GROUP_CONCAT ASC':_0xade7('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x235393={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xade7('0x5d'),'HOUR':_0xade7('0x89'),'ROUND':_0xade7('0x8a'),'UNIX_TIMESTAMP':_0xade7('0x5e')};var _0x35a1c3=function(_0x5bce9b){return!_[_0xade7('0x5f')]([_0xade7('0x60'),_0xade7('0x61'),_0xade7('0x8b'),'IS\x20NOT\x20EMPTY'],_0x5bce9b);};var _0xfa3347=function(_0x4527b4){if(!_0x4527b4||!_0x4527b4['rules'][_0xade7('0x3b')]){return'';}for(var _0x1968d5='(',_0x4ae649=0x0;_0x4ae649<_0x4527b4['rules'][_0xade7('0x3b')];_0x4ae649+=0x1){_0x4ae649>0x0&&(_0x1968d5+='\x20'+_0x4527b4[_0xade7('0x64')]+'\x20');_0x1968d5+=_0x4527b4[_0xade7('0x63')][_0x4ae649]['group']?_0xfa3347(_0x4527b4[_0xade7('0x63')][_0x4ae649][_0xade7('0x65')]):_0x4527b4['rules'][_0x4ae649]['field']+'\x20'+_0x4527b4[_0xade7('0x63')][_0x4ae649][_0xade7('0x67')]+(_0x35a1c3(_0x4527b4[_0xade7('0x63')][_0x4ae649][_0xade7('0x67')])?'\x20'+_0x4527b4[_0xade7('0x63')][_0x4ae649][_0xade7('0x68')]:'');}return _0x1968d5+')';};var _0x1fbaa0={'where':{'id':_0x1ecd6b['id']}},_0x28405,_0xb0e210,_0x51e0c2,_0x39cb6d,_0x1170d3;_0x1fbaa0=_[_0xade7('0x41')]({},_0x1fbaa0,_0x45b604);return db[_0xade7('0x45')][_0xade7('0x4c')](_0x1fbaa0)[_0xade7('0x26')](function(_0x598f68){if(_0x598f68){_0x28405=_0x598f68;return _0x598f68[_0xade7('0x69')]();}return null;})[_0xade7('0x26')](function(_0x1d05a8){if(_0x1d05a8){if(!_0x1d05a8[_0xade7('0x3b')]){throw new db[(_0xade7('0x6a'))][(_0xade7('0x8c'))](_0xade7('0x6b'),0x193);}_0xb0e210=_0x1d05a8;return db[_0xade7('0x6c')][_0xade7('0x46')]({'raw':!![]});}return null;})[_0xade7('0x26')](function(_0x5cdb94){if(_0x5cdb94){_0x51e0c2=_[_0xade7('0x6d')](_0x5cdb94,'id');var _0x518598;var _0x8ea91f=squel[_0xade7('0x6e')]();_0x8ea91f[_0xade7('0x6f')](_0x28405[_0xade7('0x70')]);for(var _0x2370cb=0x0;_0x2370cb<_0xb0e210[_0xade7('0x3b')];_0x2370cb+=0x1){_0x518598=_0xb0e210[_0x2370cb]['MetricId']?_0x51e0c2[_0xb0e210[_0x2370cb][_0xade7('0x71')]]['metric']:_0xb0e210[_0x2370cb][_0xade7('0x66')];_0x518598=_0xb0e210[_0x2370cb][_0xade7('0x73')]?_[_0xade7('0x74')](_0x546fca[_0xb0e210[_0x2370cb][_0xade7('0x73')]],'%s',_0x518598):_0x518598;_0x518598=_0xb0e210[_0x2370cb][_0xade7('0x75')]?_[_0xade7('0x74')](_0x235393[_0xb0e210[_0x2370cb][_0xade7('0x75')]],'%s',_0x518598):_0x518598;if(_0xb0e210[_0x2370cb][_0xade7('0x76')]){_0x8ea91f[_0xade7('0x65')](_0x518598);}_0xb0e210[_0x2370cb][_0xade7('0x77')]&&_0x8ea91f[_0xade7('0x78')](_0x518598,_0xb0e210[_0x2370cb][_0xade7('0x77')]===_0xade7('0x79')?![]:!![]);_0x8ea91f[_0xade7('0x66')](_0x518598,_0xb0e210[_0x2370cb]['alias']||_0x518598);}if(_0x28405['joins']){_0x28405[_0xade7('0x7a')]=JSON[_0xade7('0x7b')](_0x28405[_0xade7('0x7a')]);for(var _0x2bffb3=0x0;_0x2bffb3<_0x28405[_0xade7('0x7a')][_0xade7('0x3b')];_0x2bffb3+=0x1){if(_0x28405[_0xade7('0x7a')][_0x2bffb3]['type']&&_[_0xade7('0x5f')](_0x3c95de,_0x28405[_0xade7('0x7a')][_0x2bffb3][_0xade7('0x31')])&&_0x28405['joins'][_0x2bffb3]['parentKey']&&_0x28405[_0xade7('0x7a')][_0x2bffb3]['foreignTable']&&_0x28405[_0xade7('0x7a')][_0x2bffb3][_0xade7('0x7d')]){_0x8ea91f[_0x28405['joins'][_0x2bffb3][_0xade7('0x31')]](_0x28405['joins'][_0x2bffb3][_0xade7('0x7f')],null,util[_0xade7('0x75')]('%s.%s\x20=\x20%s.%s',_0x28405[_0xade7('0x70')],_0x28405['joins'][_0x2bffb3][_0xade7('0x7c')],_0x28405[_0xade7('0x7a')][_0x2bffb3][_0xade7('0x7f')],_0x28405[_0xade7('0x7a')][_0x2bffb3][_0xade7('0x7d')]));}}}if(_0x28405[_0xade7('0x80')]){_0x28405[_0xade7('0x80')]=JSON['parse'](_0x28405[_0xade7('0x80')]);_0x8ea91f['where'](_0xfa3347(_0x28405[_0xade7('0x80')][_0xade7('0x65')]));}_0x1170d3=_0x8ea91f['clone']();_0x8ea91f[_0xade7('0x20')](_0x27e29e);_0x8ea91f[_0xade7('0x1e')](0x0);return;}})[_0xade7('0x26')](function(){if(_0x1bef7e[_0xade7('0x8d')]===_0xade7('0x8e')){return null;}var _0x2758d3=_['merge'](_0x1bef7e,{'name':_0x1bef7e[_0xade7('0x8f')]||_0x1bef7e[_0xade7('0x34')]||_0x28405[_0xade7('0x34')],'basename':_0x17cb05,'savename':util['format'](_0xade7('0x90'),_0x1bef7e[_0xade7('0x34')]||_0x28405['name'],require(_0xade7('0x91'))[_0xade7('0x92')](0x4),_0x1bef7e[_0xade7('0x8d')]||'csv'),'reportId':_0x28405['id'],'reportType':'custom'});return db[_0xade7('0x93')][_0xade7('0x4d')](_0x2758d3,{'raw':!![]});})['then'](function(_0x3bbfba){if(_0x28405[_0xade7('0x70')]===_0xade7('0x94')){_0x1170d3[_0xade7('0x3e')](_0x28405['table']+_0xade7('0x95'),_0x1bef7e['startDate'],_0x1bef7e[_0xade7('0x96')]);}else{_0x1170d3[_0xade7('0x3e')](_0x28405[_0xade7('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x1bef7e[_0xade7('0x97')],_0x1bef7e[_0xade7('0x96')]);}if(_0x3bbfba){logger['info'](_0xade7('0x98'),_0x1170d3[_0xade7('0x83')]());require(_0xade7('0x99'))[_0xade7('0x9a')](path[_0xade7('0x55')](__dirname,_0xade7('0x9b'),_0x3bbfba[_0xade7('0x8d')]),[_0x3bbfba['id'],_0x1170d3[_0xade7('0x83')](),path[_0xade7('0x55')](__dirname,_0xade7('0x9c'),_0x3bbfba[_0xade7('0x9d')]),_0x17cb05]);return _0x3bbfba;}else{var _0xb78644=squel[_0xade7('0x6e')]();_0xb78644[_0xade7('0x6f')]('('+_0x1170d3[_0xade7('0x83')]()+')',_0xade7('0x9e'));_0xb78644[_0xade7('0x66')](_0xade7('0x9f'),_0xade7('0x21'));_0x1170d3[_0xade7('0x20')](_0x1bef7e[_0xade7('0x20')]||_0x27e29e);_0x1170d3['offset'](_0x1bef7e[_0xade7('0x1e')]||0x0);return dbH[_0xade7('0x84')][_0xade7('0x35')](_0xb78644[_0xade7('0x83')](),{'type':dbH['sequelize'][_0xade7('0x85')][_0xade7('0x86')]})['then'](function(_0x41c054){if(!_0x41c054[_0xade7('0x3b')]){_0x39cb6d=0x0;}else{_0x39cb6d=_0x41c054[0x0][_0xade7('0x21')]||0x0;}return dbH['sequelize'][_0xade7('0x35')](_0x1170d3[_0xade7('0x83')](),{'type':dbH['sequelize'][_0xade7('0x85')]['SELECT']});})['then'](function(_0x58e43f){return{'rows':_0x58e43f||[],'count':_0x39cb6d};});}});}exports['run']=function(_0x3f2c0e,_0x1f5e58){return runReport(_0x3f2c0e[_0xade7('0x4a')],_0x3f2c0e['query'],_0x3f2c0e[_0xade7('0x4b')])[_0xade7('0x26')](respondWithResult(_0x1f5e58,null))[_0xade7('0x48')](handleError(_0x1f5e58,null));};exports[_0xade7('0xa0')]=runReport;exports[_0xade7('0x35')]=function(_0xc14a92,_0x301f7d){var _0x16764f=0xa;var _0x2df7d7=[_0xade7('0x55'),_0xade7('0x56'),_0xade7('0x57'),_0xade7('0x87')];var _0x5917bd={'SUM':_0xade7('0x58'),'COUNT':_0xade7('0xa1'),'COUNT DISTINCT':_0xade7('0x59'),'MAX':_0xade7('0x88'),'MIN':_0xade7('0xa2'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xade7('0x5c'),'GROUP_CONCAT DESC':_0xade7('0xa3')};var _0x1678e9={'SEC_TO_TIME':_0xade7('0xa4'),'DATE':_0xade7('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xade7('0x8a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1cc52f=function(_0x29b49c){return!_[_0xade7('0x5f')](['IS\x20NULL',_0xade7('0x61'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x29b49c);};var _0x3d7b8d=function(_0x16622f){if(!_0x16622f||!_0x16622f['rules']['length']){return'';}for(var _0x49c8be='(',_0x39ce5a=0x0;_0x39ce5a<_0x16622f['rules'][_0xade7('0x3b')];_0x39ce5a+=0x1){_0x39ce5a>0x0&&(_0x49c8be+='\x20'+_0x16622f[_0xade7('0x64')]+'\x20');_0x49c8be+=_0x16622f[_0xade7('0x63')][_0x39ce5a]['group']?_0x3d7b8d(_0x16622f[_0xade7('0x63')][_0x39ce5a][_0xade7('0x65')]):_0x16622f['rules'][_0x39ce5a][_0xade7('0x66')]+'\x20'+_0x16622f['rules'][_0x39ce5a][_0xade7('0x67')]+(_0x1cc52f(_0x16622f[_0xade7('0x63')][_0x39ce5a]['condition'])?'\x20'+_0x16622f[_0xade7('0x63')][_0x39ce5a][_0xade7('0x68')]:'');}return _0x49c8be+')';};var _0x15392e={'where':{'id':_0xc14a92[_0xade7('0x4a')]['id']}},_0x252cad,_0x2e815a,_0x4f140a,_0xbd9a54,_0x41b46d;_0x15392e=_[_0xade7('0x41')]({},_0x15392e,_0xc14a92[_0xade7('0x4b')]);return db['AnalyticCustomReport'][_0xade7('0x4c')](_0x15392e)[_0xade7('0x26')](function(_0x1316fb){if(_0x1316fb){_0x252cad=_0x1316fb;return _0x1316fb[_0xade7('0x69')]();}return null;})['then'](function(_0xe661db){if(_0xe661db){if(!_0xe661db[_0xade7('0x3b')]){throw new db[(_0xade7('0x6a'))][(_0xade7('0x8c'))](_0xade7('0x6b'),0x193);}_0x2e815a=_0xe661db;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xade7('0x26')](function(_0x2a54dd){if(_0x2a54dd){_0x4f140a=_[_0xade7('0x6d')](_0x2a54dd,'id');var _0x5cb448;var _0x1bf475=squel['select']();_0x1bf475[_0xade7('0x6f')](_0x252cad[_0xade7('0x70')]);for(var _0x965e25=0x0;_0x965e25<_0x2e815a[_0xade7('0x3b')];_0x965e25+=0x1){_0x5cb448=_0x2e815a[_0x965e25]['MetricId']?_0x4f140a[_0x2e815a[_0x965e25][_0xade7('0x71')]][_0xade7('0x72')]:_0x2e815a[_0x965e25][_0xade7('0x66')];_0x5cb448=_0x2e815a[_0x965e25]['function']?_['replace'](_0x5917bd[_0x2e815a[_0x965e25][_0xade7('0x73')]],'%s',_0x5cb448):_0x5cb448;_0x5cb448=_0x2e815a[_0x965e25]['format']?_[_0xade7('0x74')](_0x1678e9[_0x2e815a[_0x965e25][_0xade7('0x75')]],'%s',_0x5cb448):_0x5cb448;if(_0x2e815a[_0x965e25][_0xade7('0x76')]){_0x1bf475['group'](_0x5cb448);}_0x2e815a[_0x965e25]['orderBy']&&_0x1bf475[_0xade7('0x78')](_0x5cb448,_0x2e815a[_0x965e25][_0xade7('0x77')]===_0xade7('0x79')?![]:!![]);_0x1bf475[_0xade7('0x66')](_0x5cb448,_0x2e815a[_0x965e25][_0xade7('0xa5')]||_0x5cb448);}if(_0x252cad[_0xade7('0x7a')]){_0x252cad[_0xade7('0x7a')]=JSON[_0xade7('0x7b')](_0x252cad[_0xade7('0x7a')]);for(var _0x3a9910=0x0;_0x3a9910<_0x252cad[_0xade7('0x7a')][_0xade7('0x3b')];_0x3a9910+=0x1){if(_0x252cad[_0xade7('0x7a')][_0x3a9910][_0xade7('0x31')]&&_[_0xade7('0x5f')](_0x2df7d7,_0x252cad['joins'][_0x3a9910][_0xade7('0x31')])&&_0x252cad['joins'][_0x3a9910]['parentKey']&&_0x252cad[_0xade7('0x7a')][_0x3a9910][_0xade7('0x7f')]&&_0x252cad['joins'][_0x3a9910][_0xade7('0x7d')]){_0x1bf475[_0x252cad['joins'][_0x3a9910]['type']](_0x252cad['joins'][_0x3a9910]['foreignTable'],null,util['format'](_0xade7('0x7e'),_0x252cad[_0xade7('0x70')],_0x252cad[_0xade7('0x7a')][_0x3a9910][_0xade7('0x7c')],_0x252cad[_0xade7('0x7a')][_0x3a9910][_0xade7('0x7f')],_0x252cad[_0xade7('0x7a')][_0x3a9910][_0xade7('0x7d')]));}}}if(_0x252cad[_0xade7('0x80')]){_0x252cad['conditions']=JSON[_0xade7('0x7b')](_0x252cad['conditions']);_0x1bf475['where'](_0x3d7b8d(_0x252cad[_0xade7('0x80')]['group']));}_0x41b46d=_0x1bf475[_0xade7('0x81')]();_0x1bf475[_0xade7('0x20')](_0x16764f);_0x1bf475['offset'](0x0);logger[_0xade7('0x82')](_0xade7('0xa6'),_0x1bf475[_0xade7('0x83')]());return dbH[_0xade7('0x84')][_0xade7('0x35')](_0x1bf475['toString'](),{'type':dbH[_0xade7('0x84')]['QueryTypes']['SELECT']});}})[_0xade7('0x26')](function(){return{'sql':_0x41b46d[_0xade7('0x83')]()};})['then'](respondWithResult(_0x301f7d,null))[_0xade7('0x48')](handleError(_0x301f7d,null));};
\ No newline at end of file
+var _0x38e9=['keys','filters','intersection','query','fields','attributes','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','AnalyticMetric','keyBy','from','MetricId','metric','function','replace','format','groupBy','order','orderBy','DESC','alias','joins','parse','type','parentKey','foreignKey','foreignTable','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','GROUP_CONCAT(%s)','HOUR(%s)','IS\x20NOT\x20NULL','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','select','table','clone','output','web','%s-%s.%s','randomstring','generate','custom','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','savename','countTable','COUNT(*)','SELECT','run','runReport','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ValidationErrorItem','%s.%s\x20=\x20%s.%s','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','dbH','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','update','then','destroy','CustomReports','error','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','model'];(function(_0x506b51,_0x2d2b6d){var _0xca5779=function(_0x5f0fcb){while(--_0x5f0fcb){_0x506b51['push'](_0x506b51['shift']());}};_0xca5779(++_0x2d2b6d);}(_0x38e9,0x1c5));var _0x938e=function(_0x26973e,_0x4d1d08){_0x26973e=_0x26973e-0x0;var _0x26893c=_0x38e9[_0x26973e];return _0x26893c;};'use strict';var emlformat=require(_0x938e('0x0'));var rimraf=require(_0x938e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x938e('0x2'));var rp=require(_0x938e('0x3'));var moment=require(_0x938e('0x4'));var BPromise=require(_0x938e('0x5'));var Mustache=require('mustache');var util=require(_0x938e('0x6'));var path=require(_0x938e('0x7'));var sox=require(_0x938e('0x8'));var csv=require(_0x938e('0x9'));var ejs=require(_0x938e('0xa'));var fs=require('fs');var fs_extra=require(_0x938e('0xb'));var _=require('lodash');var squel=require(_0x938e('0xc'));var crypto=require(_0x938e('0xd'));var jsforce=require(_0x938e('0xe'));var deskjs=require(_0x938e('0xf'));var toCsv=require(_0x938e('0x9'));var querystring=require(_0x938e('0x10'));var Papa=require(_0x938e('0x11'));var Redis=require(_0x938e('0x12'));var authService=require(_0x938e('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x938e('0x14'));var hardwareService=require(_0x938e('0x15'));var logger=require(_0x938e('0x16'))(_0x938e('0x17'));var utils=require(_0x938e('0x18'));var config=require(_0x938e('0x19'));var licenseUtil=require(_0x938e('0x1a'));var db=require(_0x938e('0x1b'))['db'];var dbH=require(_0x938e('0x1b'))[_0x938e('0x1c')];function respondWithStatusCode(_0x452293,_0x485fa7){_0x485fa7=_0x485fa7||0xcc;return function(_0x48dbf7){if(_0x48dbf7){return _0x452293[_0x938e('0x1d')](_0x485fa7);}return _0x452293[_0x938e('0x1e')](_0x485fa7)[_0x938e('0x1f')]();};}function respondWithResult(_0x5a4c23,_0x1282a4){_0x1282a4=_0x1282a4||0xc8;return function(_0x2bd82a){if(_0x2bd82a){return _0x5a4c23['status'](_0x1282a4)['json'](_0x2bd82a);}};}function respondWithFilteredResult(_0x30e031,_0x3c8475){return function(_0xbfd001){if(_0xbfd001){var _0x2761d5=typeof _0x3c8475[_0x938e('0x20')]===_0x938e('0x21')&&typeof _0x3c8475[_0x938e('0x22')]===_0x938e('0x21');var _0x3d7505=_0xbfd001[_0x938e('0x23')];var _0xae96e8=_0x2761d5?0x0:_0x3c8475[_0x938e('0x20')];var _0x5076f3=_0x2761d5?_0xbfd001[_0x938e('0x23')]:_0x3c8475['offset']+_0x3c8475[_0x938e('0x22')];var _0x518b90;if(_0x5076f3>=_0x3d7505){_0x5076f3=_0x3d7505;_0x518b90=0xc8;}else{_0x518b90=0xce;}_0x30e031[_0x938e('0x1e')](_0x518b90);return _0x30e031[_0x938e('0x24')](_0x938e('0x25'),_0xae96e8+'-'+_0x5076f3+'/'+_0x3d7505)[_0x938e('0x26')](_0xbfd001);}return null;};}function patchUpdates(_0x35ead3){return function(_0x5cf3d6){try{jsonpatch[_0x938e('0x27')](_0x5cf3d6,_0x35ead3,!![]);}catch(_0x290c2a){return BPromise[_0x938e('0x28')](_0x290c2a);}return _0x5cf3d6['save']();};}function saveUpdates(_0x385cc8,_0x226b07){return function(_0x407c15){if(_0x407c15){return _0x407c15[_0x938e('0x29')](_0x385cc8)[_0x938e('0x2a')](function(_0x9b03b4){return _0x9b03b4;});}return null;};}function removeEntity(_0x180103,_0x42eb08){return function(_0x40477a){if(_0x40477a){return _0x40477a[_0x938e('0x2b')]()[_0x938e('0x2a')](function(){var _0x17b1e9=_0x40477a['get']({'plain':!![]});var _0x52a78a=_0x938e('0x2c');return db['UserProfileResource']['destroy']({'where':{'type':_0x52a78a,'resourceId':_0x17b1e9['id']}})['then'](function(){return _0x40477a;});})['then'](function(){_0x180103[_0x938e('0x1e')](0xcc)[_0x938e('0x1f')]();});}};}function handleEntityNotFound(_0x5e09b2,_0x444664){return function(_0x312a18){if(!_0x312a18){_0x5e09b2[_0x938e('0x1d')](0x194);}return _0x312a18;};}function handleError(_0xeb1750,_0x335a16){_0x335a16=_0x335a16||0x1f4;return function(_0x1ec01e){logger[_0x938e('0x2d')](_0x1ec01e[_0x938e('0x2e')]);if(_0x1ec01e[_0x938e('0x2f')]){delete _0x1ec01e[_0x938e('0x2f')];}_0xeb1750[_0x938e('0x1e')](_0x335a16)[_0x938e('0x30')](_0x1ec01e);};}exports[_0x938e('0x31')]=function(_0x5957c1,_0x563b1b){var _0x4f5056={},_0x4b4f70={},_0x1c9d48={'count':0x0,'rows':[]};var _0x40bfb7=_[_0x938e('0x32')](db[_0x938e('0x33')][_0x938e('0x34')],function(_0x227da6){return{'name':_0x227da6['fieldName'],'type':_0x227da6['type']['key']};});_0x4b4f70[_0x938e('0x35')]=_['map'](_0x40bfb7,'name');_0x4b4f70['query']=_[_0x938e('0x36')](_0x5957c1['query']);_0x4b4f70[_0x938e('0x37')]=_[_0x938e('0x38')](_0x4b4f70[_0x938e('0x35')],_0x4b4f70[_0x938e('0x39')]);_0x4f5056['attributes']=_[_0x938e('0x38')](_0x4b4f70[_0x938e('0x35')],qs[_0x938e('0x3a')](_0x5957c1[_0x938e('0x39')]['fields']));_0x4f5056[_0x938e('0x3b')]=_0x4f5056['attributes']['length']?_0x4f5056[_0x938e('0x3b')]:_0x4b4f70[_0x938e('0x35')];if(!_0x5957c1['query'][_0x938e('0x3c')](_0x938e('0x3d'))){_0x4f5056['limit']=qs['limit'](_0x5957c1['query'][_0x938e('0x22')]);_0x4f5056['offset']=qs[_0x938e('0x20')](_0x5957c1['query'][_0x938e('0x20')]);}_0x4f5056['order']=qs[_0x938e('0x3e')](_0x5957c1['query'][_0x938e('0x3e')]);_0x4f5056['where']=qs[_0x938e('0x37')](_[_0x938e('0x3f')](_0x5957c1[_0x938e('0x39')],_0x4b4f70['filters']),_0x40bfb7);if(_0x5957c1[_0x938e('0x39')][_0x938e('0x40')]){_0x4f5056[_0x938e('0x41')]=_[_0x938e('0x42')](_0x4f5056['where'],{'$or':_[_0x938e('0x32')](_0x40bfb7,function(_0x42a41f){if(_0x42a41f['type']!==_0x938e('0x43')){var _0xe13fda={};_0xe13fda[_0x42a41f['name']]={'$like':'%'+_0x5957c1[_0x938e('0x39')][_0x938e('0x40')]+'%'};return _0xe13fda;}})});}_0x4f5056=_['merge']({},_0x4f5056,_0x5957c1[_0x938e('0x44')]);var _0x33a0a2={'where':_0x4f5056[_0x938e('0x41')]};return db[_0x938e('0x33')][_0x938e('0x23')](_0x33a0a2)[_0x938e('0x2a')](function(_0x380f12){_0x1c9d48['count']=_0x380f12;if(_0x5957c1[_0x938e('0x39')]['includeAll']){_0x4f5056[_0x938e('0x45')]=[{'all':!![]}];}return db[_0x938e('0x33')][_0x938e('0x46')](_0x4f5056);})['then'](function(_0x4c2a77){_0x1c9d48[_0x938e('0x47')]=_0x4c2a77;return _0x1c9d48;})[_0x938e('0x2a')](respondWithFilteredResult(_0x563b1b,_0x4f5056))[_0x938e('0x48')](handleError(_0x563b1b,null));};exports[_0x938e('0x49')]=function(_0x29b054,_0x1d5c82){var _0x3a5909={'raw':![],'where':{'id':_0x29b054[_0x938e('0x4a')]['id']}},_0x3e5ed7={};_0x3e5ed7[_0x938e('0x35')]=_[_0x938e('0x36')](db[_0x938e('0x33')][_0x938e('0x34')]);_0x3e5ed7[_0x938e('0x39')]=_[_0x938e('0x36')](_0x29b054['query']);_0x3e5ed7[_0x938e('0x37')]=_['intersection'](_0x3e5ed7[_0x938e('0x35')],_0x3e5ed7['query']);_0x3a5909[_0x938e('0x3b')]=_['intersection'](_0x3e5ed7[_0x938e('0x35')],qs[_0x938e('0x3a')](_0x29b054[_0x938e('0x39')][_0x938e('0x3a')]));_0x3a5909['attributes']=_0x3a5909[_0x938e('0x3b')][_0x938e('0x4b')]?_0x3a5909[_0x938e('0x3b')]:_0x3e5ed7[_0x938e('0x35')];if(_0x29b054[_0x938e('0x39')]['includeAll']){_0x3a5909['include']=[{'all':!![]}];}_0x3a5909=_[_0x938e('0x42')]({},_0x3a5909,_0x29b054[_0x938e('0x44')]);return db['AnalyticCustomReport'][_0x938e('0x4c')](_0x3a5909)[_0x938e('0x2a')](handleEntityNotFound(_0x1d5c82,null))[_0x938e('0x2a')](respondWithResult(_0x1d5c82,null))[_0x938e('0x48')](handleError(_0x1d5c82,null));};exports[_0x938e('0x4d')]=function(_0x332aee,_0x11f66e){return db['AnalyticCustomReport'][_0x938e('0x4d')](_0x332aee['body'],{})['then'](function(_0x22fd89){var _0x38cdf3=_0x332aee[_0x938e('0x4e')][_0x938e('0x4f')]({'plain':!![]});if(!_0x38cdf3)throw new Error(_0x938e('0x50'));if(_0x38cdf3[_0x938e('0x51')]===_0x938e('0x4e')){var _0x3dd1d1=_0x22fd89[_0x938e('0x4f')]({'plain':!![]});var _0x55eae7='Reports';return db[_0x938e('0x52')][_0x938e('0x4c')]({'where':{'name':_0x55eae7,'userProfileId':_0x38cdf3[_0x938e('0x53')]},'raw':!![]})[_0x938e('0x2a')](function(_0x20e80e){if(_0x20e80e&&_0x20e80e['autoAssociation']===0x0){return db[_0x938e('0x54')]['create']({'name':_0x3dd1d1[_0x938e('0x2f')],'resourceId':_0x3dd1d1['id'],'type':_0x938e('0x2c'),'sectionId':_0x20e80e['id']},{})[_0x938e('0x2a')](function(){return _0x22fd89;});}else{return _0x22fd89;}})[_0x938e('0x48')](function(_0x4f24c0){logger[_0x938e('0x2d')](_0x938e('0x55'),_0x4f24c0);throw _0x4f24c0;});}return _0x22fd89;})[_0x938e('0x2a')](respondWithResult(_0x11f66e,0xc9))[_0x938e('0x48')](handleError(_0x11f66e,null));};exports['update']=function(_0x4a005f,_0x2e8a13){if(_0x4a005f[_0x938e('0x56')]['id']){delete _0x4a005f[_0x938e('0x56')]['id'];}return db[_0x938e('0x33')]['find']({'where':{'id':_0x4a005f[_0x938e('0x4a')]['id']}})[_0x938e('0x2a')](handleEntityNotFound(_0x2e8a13,null))[_0x938e('0x2a')](saveUpdates(_0x4a005f['body'],null))[_0x938e('0x2a')](respondWithResult(_0x2e8a13,null))[_0x938e('0x48')](handleError(_0x2e8a13,null));};exports[_0x938e('0x2b')]=function(_0x57a63a,_0x5121d6){return db['AnalyticCustomReport']['find']({'where':{'id':_0x57a63a[_0x938e('0x4a')]['id']}})[_0x938e('0x2a')](handleEntityNotFound(_0x5121d6,null))[_0x938e('0x2a')](removeEntity(_0x5121d6,null))[_0x938e('0x48')](handleError(_0x5121d6,null));};exports['preview']=function(_0x2056d6,_0x309b1c){var _0x5e8905=0xa;var _0xa8c757=[_0x938e('0x57'),_0x938e('0x58'),'right_join',_0x938e('0x59')];var _0x33d2be={'SUM':'SUM(%s)','COUNT':_0x938e('0x5a'),'COUNT DISTINCT':_0x938e('0x5b'),'MAX':_0x938e('0x5c'),'MIN':_0x938e('0x5d'),'AVG':_0x938e('0x5e'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x938e('0x5f')};var _0x478d93={'SEC_TO_TIME':_0x938e('0x60'),'DATE':_0x938e('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x938e('0x62'),'UNIX_TIMESTAMP':_0x938e('0x63')};var _0x2f1dc2=function(_0x2b219e){return!_[_0x938e('0x64')]([_0x938e('0x65'),'IS\x20NOT\x20NULL','IS\x20EMPTY',_0x938e('0x66')],_0x2b219e);};var _0x385007=function(_0x4bcda1){if(!_0x4bcda1||!_0x4bcda1[_0x938e('0x67')][_0x938e('0x4b')]){return'';}for(var _0x112867='(',_0x540b63=0x0;_0x540b63<_0x4bcda1['rules'][_0x938e('0x4b')];_0x540b63+=0x1){_0x540b63>0x0&&(_0x112867+='\x20'+_0x4bcda1[_0x938e('0x68')]+'\x20');_0x112867+=_0x4bcda1[_0x938e('0x67')][_0x540b63][_0x938e('0x69')]?_0x385007(_0x4bcda1[_0x938e('0x67')][_0x540b63][_0x938e('0x69')]):_0x4bcda1[_0x938e('0x67')][_0x540b63][_0x938e('0x6a')]+'\x20'+_0x4bcda1['rules'][_0x540b63][_0x938e('0x6b')]+(_0x2f1dc2(_0x4bcda1[_0x938e('0x67')][_0x540b63][_0x938e('0x6b')])?'\x20'+_0x4bcda1[_0x938e('0x67')][_0x540b63][_0x938e('0x6c')]:'');}return _0x112867+')';};var _0x118fea={'where':{'id':_0x2056d6[_0x938e('0x4a')]['id']}},_0x59606c,_0x2d9d2c,_0x59a5ee,_0x33321e,_0x31ad92;_0x118fea=_[_0x938e('0x42')]({},_0x118fea,_0x2056d6[_0x938e('0x44')]);return db[_0x938e('0x33')][_0x938e('0x4c')](_0x118fea)['then'](function(_0x3e6273){if(_0x3e6273){_0x59606c=_0x3e6273;return _0x3e6273[_0x938e('0x6d')]();}return null;})[_0x938e('0x2a')](function(_0x464102){if(_0x464102){if(!_0x464102[_0x938e('0x4b')]){throw new db[(_0x938e('0x6e'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d9d2c=_0x464102;return db[_0x938e('0x6f')][_0x938e('0x46')]({'raw':!![]});}return null;})[_0x938e('0x2a')](function(_0x43b5d8){if(_0x43b5d8){_0x59a5ee=_[_0x938e('0x70')](_0x43b5d8,'id');var _0x2961d3;var _0x2a4bb6=squel['select']();_0x2a4bb6[_0x938e('0x71')](_0x59606c['table']);for(var _0x47919e=0x0;_0x47919e<_0x2d9d2c[_0x938e('0x4b')];_0x47919e+=0x1){_0x2961d3=_0x2d9d2c[_0x47919e][_0x938e('0x72')]?_0x59a5ee[_0x2d9d2c[_0x47919e]['MetricId']][_0x938e('0x73')]:_0x2d9d2c[_0x47919e][_0x938e('0x6a')];_0x2961d3=_0x2d9d2c[_0x47919e][_0x938e('0x74')]?_[_0x938e('0x75')](_0x33d2be[_0x2d9d2c[_0x47919e][_0x938e('0x74')]],'%s',_0x2961d3):_0x2961d3;_0x2961d3=_0x2d9d2c[_0x47919e][_0x938e('0x76')]?_[_0x938e('0x75')](_0x478d93[_0x2d9d2c[_0x47919e][_0x938e('0x76')]],'%s',_0x2961d3):_0x2961d3;if(_0x2d9d2c[_0x47919e][_0x938e('0x77')]){_0x2a4bb6['group'](_0x2961d3);}_0x2d9d2c[_0x47919e]['orderBy']&&_0x2a4bb6[_0x938e('0x78')](_0x2961d3,_0x2d9d2c[_0x47919e][_0x938e('0x79')]===_0x938e('0x7a')?![]:!![]);_0x2a4bb6[_0x938e('0x6a')](_0x2961d3,_0x2d9d2c[_0x47919e][_0x938e('0x7b')]||_0x2961d3);}if(_0x59606c[_0x938e('0x7c')]){_0x59606c[_0x938e('0x7c')]=JSON[_0x938e('0x7d')](_0x59606c[_0x938e('0x7c')]);for(var _0x4ca690=0x0;_0x4ca690<_0x59606c[_0x938e('0x7c')][_0x938e('0x4b')];_0x4ca690+=0x1){if(_0x59606c[_0x938e('0x7c')][_0x4ca690][_0x938e('0x7e')]&&_[_0x938e('0x64')](_0xa8c757,_0x59606c[_0x938e('0x7c')][_0x4ca690]['type'])&&_0x59606c['joins'][_0x4ca690][_0x938e('0x7f')]&&_0x59606c['joins'][_0x4ca690]['foreignTable']&&_0x59606c[_0x938e('0x7c')][_0x4ca690][_0x938e('0x80')]){_0x2a4bb6[_0x59606c[_0x938e('0x7c')][_0x4ca690][_0x938e('0x7e')]](_0x59606c[_0x938e('0x7c')][_0x4ca690][_0x938e('0x81')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x59606c['table'],_0x59606c[_0x938e('0x7c')][_0x4ca690][_0x938e('0x7f')],_0x59606c[_0x938e('0x7c')][_0x4ca690][_0x938e('0x81')],_0x59606c['joins'][_0x4ca690][_0x938e('0x80')]));}}}if(_0x59606c['conditions']){_0x59606c[_0x938e('0x82')]=JSON[_0x938e('0x7d')](_0x59606c[_0x938e('0x82')]);_0x2a4bb6[_0x938e('0x41')](_0x385007(_0x59606c[_0x938e('0x82')][_0x938e('0x69')]));}_0x31ad92=_0x2a4bb6['clone']();_0x2a4bb6['limit'](_0x5e8905);_0x2a4bb6[_0x938e('0x20')](0x0);logger[_0x938e('0x83')](_0x938e('0x84'),_0x2a4bb6['toString']());return dbH[_0x938e('0x85')][_0x938e('0x39')](_0x2a4bb6[_0x938e('0x86')](),{'type':dbH[_0x938e('0x85')][_0x938e('0x87')]['SELECT']});}})[_0x938e('0x2a')](respondWithResult(_0x309b1c,null))[_0x938e('0x48')](handleError(_0x309b1c,null));};function runReport(_0x3323c9,_0x1de096,_0xf528bc){var _0xd8c6eb=_0x1de096[_0x938e('0x2f')];var _0x55a67a=0xa;var _0x5d69bd=[_0x938e('0x57'),'left_join',_0x938e('0x88'),_0x938e('0x59')];var _0x46d5ac={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x938e('0x5b'),'MAX':_0x938e('0x5c'),'MIN':_0x938e('0x5d'),'AVG':_0x938e('0x5e'),'GROUP_CONCAT':_0x938e('0x89'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4ce2d7={'SEC_TO_TIME':_0x938e('0x60'),'DATE':'DATE(%s)','HOUR':_0x938e('0x8a'),'ROUND':_0x938e('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28949c=function(_0xc5d731){return!_['includes']([_0x938e('0x65'),_0x938e('0x8b'),_0x938e('0x8c'),_0x938e('0x66')],_0xc5d731);};var _0x40a872=function(_0xf46f3c){if(!_0xf46f3c||!_0xf46f3c['rules'][_0x938e('0x4b')]){return'';}for(var _0x10aa33='(',_0xfce163=0x0;_0xfce163<_0xf46f3c['rules'][_0x938e('0x4b')];_0xfce163+=0x1){_0xfce163>0x0&&(_0x10aa33+='\x20'+_0xf46f3c[_0x938e('0x68')]+'\x20');_0x10aa33+=_0xf46f3c[_0x938e('0x67')][_0xfce163][_0x938e('0x69')]?_0x40a872(_0xf46f3c[_0x938e('0x67')][_0xfce163]['group']):_0xf46f3c[_0x938e('0x67')][_0xfce163][_0x938e('0x6a')]+'\x20'+_0xf46f3c[_0x938e('0x67')][_0xfce163][_0x938e('0x6b')]+(_0x28949c(_0xf46f3c[_0x938e('0x67')][_0xfce163][_0x938e('0x6b')])?'\x20'+_0xf46f3c['rules'][_0xfce163][_0x938e('0x6c')]:'');}return _0x10aa33+')';};var _0x4a4ce1={'where':{'id':_0x3323c9['id']}},_0x2a5280,_0x5e22ad,_0x3b34d,_0x590d6d,_0x340639;_0x4a4ce1=_[_0x938e('0x42')]({},_0x4a4ce1,_0xf528bc);return db[_0x938e('0x33')][_0x938e('0x4c')](_0x4a4ce1)[_0x938e('0x2a')](function(_0x3572a0){if(_0x3572a0){_0x2a5280=_0x3572a0;return _0x3572a0[_0x938e('0x6d')]();}return null;})[_0x938e('0x2a')](function(_0x14163e){if(_0x14163e){if(!_0x14163e[_0x938e('0x4b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x938e('0x8d'),0x193);}_0x5e22ad=_0x14163e;return db[_0x938e('0x6f')][_0x938e('0x46')]({'raw':!![]});}return null;})['then'](function(_0x29a809){if(_0x29a809){_0x3b34d=_[_0x938e('0x70')](_0x29a809,'id');var _0x5f4c62;var _0x36e618=squel[_0x938e('0x8e')]();_0x36e618[_0x938e('0x71')](_0x2a5280['table']);for(var _0x5741b7=0x0;_0x5741b7<_0x5e22ad[_0x938e('0x4b')];_0x5741b7+=0x1){_0x5f4c62=_0x5e22ad[_0x5741b7]['MetricId']?_0x3b34d[_0x5e22ad[_0x5741b7][_0x938e('0x72')]][_0x938e('0x73')]:_0x5e22ad[_0x5741b7][_0x938e('0x6a')];_0x5f4c62=_0x5e22ad[_0x5741b7][_0x938e('0x74')]?_['replace'](_0x46d5ac[_0x5e22ad[_0x5741b7][_0x938e('0x74')]],'%s',_0x5f4c62):_0x5f4c62;_0x5f4c62=_0x5e22ad[_0x5741b7]['format']?_[_0x938e('0x75')](_0x4ce2d7[_0x5e22ad[_0x5741b7]['format']],'%s',_0x5f4c62):_0x5f4c62;if(_0x5e22ad[_0x5741b7]['groupBy']){_0x36e618[_0x938e('0x69')](_0x5f4c62);}_0x5e22ad[_0x5741b7][_0x938e('0x79')]&&_0x36e618[_0x938e('0x78')](_0x5f4c62,_0x5e22ad[_0x5741b7][_0x938e('0x79')]===_0x938e('0x7a')?![]:!![]);_0x36e618['field'](_0x5f4c62,_0x5e22ad[_0x5741b7][_0x938e('0x7b')]||_0x5f4c62);}if(_0x2a5280[_0x938e('0x7c')]){_0x2a5280[_0x938e('0x7c')]=JSON[_0x938e('0x7d')](_0x2a5280[_0x938e('0x7c')]);for(var _0x4a74ea=0x0;_0x4a74ea<_0x2a5280[_0x938e('0x7c')][_0x938e('0x4b')];_0x4a74ea+=0x1){if(_0x2a5280[_0x938e('0x7c')][_0x4a74ea]['type']&&_[_0x938e('0x64')](_0x5d69bd,_0x2a5280[_0x938e('0x7c')][_0x4a74ea][_0x938e('0x7e')])&&_0x2a5280[_0x938e('0x7c')][_0x4a74ea][_0x938e('0x7f')]&&_0x2a5280['joins'][_0x4a74ea][_0x938e('0x81')]&&_0x2a5280['joins'][_0x4a74ea][_0x938e('0x80')]){_0x36e618[_0x2a5280['joins'][_0x4a74ea][_0x938e('0x7e')]](_0x2a5280[_0x938e('0x7c')][_0x4a74ea][_0x938e('0x81')],null,util[_0x938e('0x76')]('%s.%s\x20=\x20%s.%s',_0x2a5280[_0x938e('0x8f')],_0x2a5280[_0x938e('0x7c')][_0x4a74ea][_0x938e('0x7f')],_0x2a5280[_0x938e('0x7c')][_0x4a74ea]['foreignTable'],_0x2a5280[_0x938e('0x7c')][_0x4a74ea][_0x938e('0x80')]));}}}if(_0x2a5280['conditions']){_0x2a5280[_0x938e('0x82')]=JSON['parse'](_0x2a5280[_0x938e('0x82')]);_0x36e618[_0x938e('0x41')](_0x40a872(_0x2a5280['conditions'][_0x938e('0x69')]));}_0x340639=_0x36e618[_0x938e('0x90')]();_0x36e618[_0x938e('0x22')](_0x55a67a);_0x36e618[_0x938e('0x20')](0x0);return;}})[_0x938e('0x2a')](function(){if(_0x1de096[_0x938e('0x91')]===_0x938e('0x92')){return null;}var _0x42d6e2=_[_0x938e('0x42')](_0x1de096,{'name':_0x1de096['fullPath']||_0x1de096[_0x938e('0x2f')]||_0x2a5280[_0x938e('0x2f')],'basename':_0xd8c6eb,'savename':util[_0x938e('0x76')](_0x938e('0x93'),_0x1de096['name']||_0x2a5280[_0x938e('0x2f')],require(_0x938e('0x94'))[_0x938e('0x95')](0x4),_0x1de096[_0x938e('0x91')]||'csv'),'reportId':_0x2a5280['id'],'reportType':_0x938e('0x96')});return db['AnalyticExtractedReport'][_0x938e('0x4d')](_0x42d6e2,{'raw':!![]});})['then'](function(_0x21f3b4){if(_0x2a5280[_0x938e('0x8f')]===_0x938e('0x97')){_0x340639[_0x938e('0x41')](_0x2a5280[_0x938e('0x8f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1de096[_0x938e('0x98')],_0x1de096[_0x938e('0x99')]);}else{_0x340639[_0x938e('0x41')](_0x2a5280[_0x938e('0x8f')]+_0x938e('0x9a'),_0x1de096['startDate'],_0x1de096[_0x938e('0x99')]);}if(_0x21f3b4){logger[_0x938e('0x9b')](_0x938e('0x9c'),_0x340639[_0x938e('0x86')]());require(_0x938e('0x9d'))['fork'](path[_0x938e('0x57')](__dirname,_0x938e('0x9e'),_0x21f3b4[_0x938e('0x91')]),[_0x21f3b4['id'],_0x340639['toString'](),path[_0x938e('0x57')](__dirname,'../../files/reports',_0x21f3b4[_0x938e('0x9f')]),_0xd8c6eb]);return _0x21f3b4;}else{var _0x4e1a5d=squel[_0x938e('0x8e')]();_0x4e1a5d[_0x938e('0x71')]('('+_0x340639[_0x938e('0x86')]()+')',_0x938e('0xa0'));_0x4e1a5d[_0x938e('0x6a')](_0x938e('0xa1'),_0x938e('0x23'));_0x340639[_0x938e('0x22')](_0x1de096[_0x938e('0x22')]||_0x55a67a);_0x340639[_0x938e('0x20')](_0x1de096[_0x938e('0x20')]||0x0);return dbH[_0x938e('0x85')][_0x938e('0x39')](_0x4e1a5d[_0x938e('0x86')](),{'type':dbH['sequelize'][_0x938e('0x87')]['SELECT']})[_0x938e('0x2a')](function(_0x1e0e76){if(!_0x1e0e76[_0x938e('0x4b')]){_0x590d6d=0x0;}else{_0x590d6d=_0x1e0e76[0x0]['count']||0x0;}return dbH['sequelize']['query'](_0x340639[_0x938e('0x86')](),{'type':dbH['sequelize']['QueryTypes'][_0x938e('0xa2')]});})['then'](function(_0x37c070){return{'rows':_0x37c070||[],'count':_0x590d6d};});}});}exports[_0x938e('0xa3')]=function(_0x46f827,_0x4e2e46){return runReport(_0x46f827[_0x938e('0x4a')],_0x46f827['query'],_0x46f827[_0x938e('0x44')])[_0x938e('0x2a')](respondWithResult(_0x4e2e46,null))[_0x938e('0x48')](handleError(_0x4e2e46,null));};exports[_0x938e('0xa4')]=runReport;exports[_0x938e('0x39')]=function(_0x12345a,_0x5a4e0b){var _0x4b0dad=0xa;var _0x59d786=[_0x938e('0x57'),_0x938e('0x58'),_0x938e('0x88'),'cross_join'];var _0x6001fd={'SUM':_0x938e('0xa5'),'COUNT':_0x938e('0x5a'),'COUNT DISTINCT':_0x938e('0x5b'),'MAX':_0x938e('0x5c'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0x938e('0x89'),'GROUP_CONCAT ASC':_0x938e('0xa6'),'GROUP_CONCAT DESC':_0x938e('0x5f')};var _0x41f375={'SEC_TO_TIME':_0x938e('0x60'),'DATE':'DATE(%s)','HOUR':_0x938e('0x8a'),'ROUND':_0x938e('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3c811d=function(_0xc70ff6){return!_['includes']([_0x938e('0x65'),_0x938e('0x8b'),'IS\x20EMPTY',_0x938e('0x66')],_0xc70ff6);};var _0x2e5393=function(_0x1d439c){if(!_0x1d439c||!_0x1d439c[_0x938e('0x67')]['length']){return'';}for(var _0x41a960='(',_0x1a9686=0x0;_0x1a9686<_0x1d439c['rules']['length'];_0x1a9686+=0x1){_0x1a9686>0x0&&(_0x41a960+='\x20'+_0x1d439c[_0x938e('0x68')]+'\x20');_0x41a960+=_0x1d439c['rules'][_0x1a9686]['group']?_0x2e5393(_0x1d439c[_0x938e('0x67')][_0x1a9686][_0x938e('0x69')]):_0x1d439c[_0x938e('0x67')][_0x1a9686][_0x938e('0x6a')]+'\x20'+_0x1d439c['rules'][_0x1a9686]['condition']+(_0x3c811d(_0x1d439c[_0x938e('0x67')][_0x1a9686][_0x938e('0x6b')])?'\x20'+_0x1d439c['rules'][_0x1a9686]['value']:'');}return _0x41a960+')';};var _0x424510={'where':{'id':_0x12345a[_0x938e('0x4a')]['id']}},_0x5aca5f,_0x47e358,_0x219f30,_0x288dfa,_0x38f9ac;_0x424510=_[_0x938e('0x42')]({},_0x424510,_0x12345a['options']);return db[_0x938e('0x33')][_0x938e('0x4c')](_0x424510)[_0x938e('0x2a')](function(_0x58f689){if(_0x58f689){_0x5aca5f=_0x58f689;return _0x58f689[_0x938e('0x6d')]();}return null;})[_0x938e('0x2a')](function(_0x5e0c56){if(_0x5e0c56){if(!_0x5e0c56[_0x938e('0x4b')]){throw new db[(_0x938e('0x6e'))][(_0x938e('0xa7'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x47e358=_0x5e0c56;return db[_0x938e('0x6f')][_0x938e('0x46')]({'raw':!![]});}return null;})['then'](function(_0x213335){if(_0x213335){_0x219f30=_[_0x938e('0x70')](_0x213335,'id');var _0x3cc393;var _0x3a28a7=squel[_0x938e('0x8e')]();_0x3a28a7[_0x938e('0x71')](_0x5aca5f[_0x938e('0x8f')]);for(var _0x13a857=0x0;_0x13a857<_0x47e358[_0x938e('0x4b')];_0x13a857+=0x1){_0x3cc393=_0x47e358[_0x13a857][_0x938e('0x72')]?_0x219f30[_0x47e358[_0x13a857]['MetricId']]['metric']:_0x47e358[_0x13a857][_0x938e('0x6a')];_0x3cc393=_0x47e358[_0x13a857][_0x938e('0x74')]?_['replace'](_0x6001fd[_0x47e358[_0x13a857][_0x938e('0x74')]],'%s',_0x3cc393):_0x3cc393;_0x3cc393=_0x47e358[_0x13a857][_0x938e('0x76')]?_[_0x938e('0x75')](_0x41f375[_0x47e358[_0x13a857][_0x938e('0x76')]],'%s',_0x3cc393):_0x3cc393;if(_0x47e358[_0x13a857]['groupBy']){_0x3a28a7['group'](_0x3cc393);}_0x47e358[_0x13a857][_0x938e('0x79')]&&_0x3a28a7[_0x938e('0x78')](_0x3cc393,_0x47e358[_0x13a857][_0x938e('0x79')]===_0x938e('0x7a')?![]:!![]);_0x3a28a7[_0x938e('0x6a')](_0x3cc393,_0x47e358[_0x13a857][_0x938e('0x7b')]||_0x3cc393);}if(_0x5aca5f[_0x938e('0x7c')]){_0x5aca5f[_0x938e('0x7c')]=JSON[_0x938e('0x7d')](_0x5aca5f[_0x938e('0x7c')]);for(var _0x171bf8=0x0;_0x171bf8<_0x5aca5f[_0x938e('0x7c')][_0x938e('0x4b')];_0x171bf8+=0x1){if(_0x5aca5f['joins'][_0x171bf8][_0x938e('0x7e')]&&_[_0x938e('0x64')](_0x59d786,_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x7e')])&&_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x7f')]&&_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x81')]&&_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x80')]){_0x3a28a7[_0x5aca5f['joins'][_0x171bf8][_0x938e('0x7e')]](_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x81')],null,util[_0x938e('0x76')](_0x938e('0xa8'),_0x5aca5f[_0x938e('0x8f')],_0x5aca5f['joins'][_0x171bf8]['parentKey'],_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x81')],_0x5aca5f[_0x938e('0x7c')][_0x171bf8][_0x938e('0x80')]));}}}if(_0x5aca5f['conditions']){_0x5aca5f[_0x938e('0x82')]=JSON[_0x938e('0x7d')](_0x5aca5f['conditions']);_0x3a28a7['where'](_0x2e5393(_0x5aca5f['conditions']['group']));}_0x38f9ac=_0x3a28a7[_0x938e('0x90')]();_0x3a28a7[_0x938e('0x22')](_0x4b0dad);_0x3a28a7[_0x938e('0x20')](0x0);logger[_0x938e('0x83')](_0x938e('0x84'),_0x3a28a7[_0x938e('0x86')]());return dbH['sequelize']['query'](_0x3a28a7['toString'](),{'type':dbH['sequelize'][_0x938e('0x87')][_0x938e('0xa2')]});}})['then'](function(){return{'sql':_0x38f9ac[_0x938e('0x86')]()};})[_0x938e('0x2a')](respondWithResult(_0x5a4e0b,null))[_0x938e('0x48')](handleError(_0x5a4e0b,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index a649afc..6f502ea 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 _0xb8b3=['define','analytics_custom_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./analyticCustomReport.attributes','exports'];(function(_0x5a6452,_0xbfc8b8){var _0x358889=function(_0x230ee6){while(--_0x230ee6){_0x5a6452['push'](_0x5a6452['shift']());}};_0x358889(++_0xbfc8b8);}(_0xb8b3,0x9e));var _0x3b8b=function(_0xa3463d,_0x32f8da){_0xa3463d=_0xa3463d-0x0;var _0x50fd67=_0xb8b3[_0xa3463d];return _0x50fd67;};'use strict';var _=require(_0x3b8b('0x0'));var util=require(_0x3b8b('0x1'));var logger=require(_0x3b8b('0x2'))(_0x3b8b('0x3'));var moment=require(_0x3b8b('0x4'));var BPromise=require(_0x3b8b('0x5'));var rp=require(_0x3b8b('0x6'));var fs=require('fs');var path=require(_0x3b8b('0x7'));var rimraf=require(_0x3b8b('0x8'));var config=require('../../config/environment');var attributes=require(_0x3b8b('0x9'));module[_0x3b8b('0xa')]=function(_0x5ddc5b,_0x65a78f){return _0x5ddc5b[_0x3b8b('0xb')]('AnalyticCustomReport',attributes,{'tableName':_0x3b8b('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x0d05=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','define','AnalyticCustomReport'];(function(_0x590861,_0x42c7f3){var _0x1d0a80=function(_0x42d3de){while(--_0x42d3de){_0x590861['push'](_0x590861['shift']());}};_0x1d0a80(++_0x42c7f3);}(_0x0d05,0x171));var _0x50d0=function(_0x19fadd,_0x2757eb){_0x19fadd=_0x19fadd-0x0;var _0x247641=_0x0d05[_0x19fadd];return _0x247641;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x50d0('0x0'))(_0x50d0('0x1'));var moment=require('moment');var BPromise=require(_0x50d0('0x2'));var rp=require(_0x50d0('0x3'));var fs=require('fs');var path=require(_0x50d0('0x4'));var rimraf=require(_0x50d0('0x5'));var config=require(_0x50d0('0x6'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x132290,_0x1cf8c6){return _0x132290[_0x50d0('0x7')](_0x50d0('0x8'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index 9f6ddf2..a662501 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 _0xd80a=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x1b778c,_0x5cc298){var _0xbca7d3=function(_0x5b97a9){while(--_0x5b97a9){_0x1b778c['push'](_0x1b778c['shift']());}};_0xbca7d3(++_0x5cc298);}(_0xd80a,0x197));var _0xad80=function(_0x3b565d,_0x511fce){_0x3b565d=_0x3b565d-0x0;var _0x1849d3=_0xd80a[_0x3b565d];return _0x1849d3;};'use strict';var _=require(_0xad80('0x0'));var util=require(_0xad80('0x1'));var moment=require(_0xad80('0x2'));var BPromise=require(_0xad80('0x3'));var rs=require(_0xad80('0x4'));var fs=require('fs');var Redis=require(_0xad80('0x5'));var db=require(_0xad80('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xad80('0x7'))(_0xad80('0x8'));var config=require(_0xad80('0x9'));var jayson=require(_0xad80('0xa'));var client=jayson[_0xad80('0xb')][_0xad80('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x39bf56,_0x106a25,_0x4d1db7){return new BPromise(function(_0x4377cf,_0x41dc59){return client['request'](_0x39bf56,_0x4d1db7)['then'](function(_0x300763){logger[_0xad80('0xd')](_0xad80('0xe'),_0x106a25,_0xad80('0xf'));logger[_0xad80('0x10')](_0xad80('0x11'),_0x106a25,_0xad80('0xf'),JSON[_0xad80('0x12')](_0x300763));if(_0x300763[_0xad80('0x13')]){if(_0x300763[_0xad80('0x13')]['code']===0x1f4){logger[_0xad80('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x106a25,_0x300763[_0xad80('0x13')][_0xad80('0x14')]);return _0x41dc59(_0x300763['error'][_0xad80('0x14')]);}logger[_0xad80('0x13')](_0xad80('0xe'),_0x106a25,_0x300763[_0xad80('0x13')]['message']);return _0x4377cf(_0x300763[_0xad80('0x13')][_0xad80('0x14')]);}else{logger['info'](_0xad80('0xe'),_0x106a25,_0xad80('0xf'));_0x4377cf(_0x300763[_0xad80('0x15')][_0xad80('0x14')]);}})[_0xad80('0x16')](function(_0x1cfa37){logger[_0xad80('0x13')](_0xad80('0xe'),_0x106a25,_0x1cfa37);_0x41dc59(_0x1cfa37);});});}
\ No newline at end of file
+var _0xcb85=['http','then','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticCustomReport,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x64bb04,_0x5f4f72){var _0x21f87d=function(_0x4a0253){while(--_0x4a0253){_0x64bb04['push'](_0x64bb04['shift']());}};_0x21f87d(++_0x5f4f72);}(_0xcb85,0xe8));var _0x5cb8=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xcb85[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x5cb8('0x0'));var util=require('util');var moment=require(_0x5cb8('0x1'));var BPromise=require(_0x5cb8('0x2'));var rs=require(_0x5cb8('0x3'));var fs=require('fs');var Redis=require(_0x5cb8('0x4'));var db=require(_0x5cb8('0x5'))['db'];var utils=require(_0x5cb8('0x6'));var logger=require(_0x5cb8('0x7'))(_0x5cb8('0x8'));var config=require('../../config/environment');var jayson=require(_0x5cb8('0x9'));var client=jayson['client'][_0x5cb8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4e4fec,_0x3cf8a6,_0x5e4b51){return new BPromise(function(_0x2a1ad3,_0x28829d){return client['request'](_0x4e4fec,_0x5e4b51)[_0x5cb8('0xb')](function(_0x12519a){logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x3cf8a6,_0x5cb8('0xc'));logger[_0x5cb8('0xd')](_0x5cb8('0xe'),_0x3cf8a6,_0x5cb8('0xc'),JSON['stringify'](_0x12519a));if(_0x12519a['error']){if(_0x12519a[_0x5cb8('0xf')][_0x5cb8('0x10')]===0x1f4){logger['error'](_0x5cb8('0x11'),_0x3cf8a6,_0x12519a[_0x5cb8('0xf')]['message']);return _0x28829d(_0x12519a[_0x5cb8('0xf')][_0x5cb8('0x12')]);}logger[_0x5cb8('0xf')](_0x5cb8('0x11'),_0x3cf8a6,_0x12519a[_0x5cb8('0xf')][_0x5cb8('0x12')]);return _0x2a1ad3(_0x12519a[_0x5cb8('0xf')][_0x5cb8('0x12')]);}else{logger[_0x5cb8('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3cf8a6,_0x5cb8('0xc'));_0x2a1ad3(_0x12519a[_0x5cb8('0x14')][_0x5cb8('0x12')]);}})[_0x5cb8('0x15')](function(_0xc085b){logger[_0x5cb8('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3cf8a6,_0xc085b);_0x28829d(_0xc085b);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index 8ce0e64..3460774 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 _0x82d9=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','preview','run','query','post','put','update','delete'];(function(_0x541dfb,_0x45ebee){var _0x9607f9=function(_0x15475d){while(--_0x15475d){_0x541dfb['push'](_0x541dfb['shift']());}};_0x9607f9(++_0x45ebee);}(_0x82d9,0x1b0));var _0x982d=function(_0x2082af,_0xb25312){_0x2082af=_0x2082af-0x0;var _0x1d82b6=_0x82d9[_0x2082af];return _0x1d82b6;};'use strict';var multer=require(_0x982d('0x0'));var util=require('util');var path=require(_0x982d('0x1'));var timeout=require(_0x982d('0x2'));var express=require(_0x982d('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x982d('0x4'));var interaction=require(_0x982d('0x5'));var config=require('../../config/environment');var controller=require(_0x982d('0x6'));router[_0x982d('0x7')]('/',auth[_0x982d('0x8')](),controller[_0x982d('0x9')]);router[_0x982d('0x7')](_0x982d('0xa'),auth[_0x982d('0x8')](),controller['show']);router[_0x982d('0x7')]('/:id/preview',auth[_0x982d('0x8')](),controller[_0x982d('0xb')]);router[_0x982d('0x7')]('/:id/run',auth['isAuthenticated'](),controller[_0x982d('0xc')]);router[_0x982d('0x7')]('/:id/query',auth[_0x982d('0x8')](),controller[_0x982d('0xd')]);router[_0x982d('0xe')]('/',auth[_0x982d('0x8')](),controller['create']);router[_0x982d('0xf')](_0x982d('0xa'),auth[_0x982d('0x8')](),controller[_0x982d('0x10')]);router[_0x982d('0x11')](_0x982d('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x33f1=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','preview','/:id/run','run','/:id/query','post','create','put','/:id','update','delete','destroy','exports','multer','util','path'];(function(_0x1e691f,_0x215f5f){var _0x5b37cb=function(_0x1ffe30){while(--_0x1ffe30){_0x1e691f['push'](_0x1e691f['shift']());}};_0x5b37cb(++_0x215f5f);}(_0x33f1,0x126));var _0x133f=function(_0x3cc05d,_0x4b8f88){_0x3cc05d=_0x3cc05d-0x0;var _0x28b736=_0x33f1[_0x3cc05d];return _0x28b736;};'use strict';var multer=require(_0x133f('0x0'));var util=require(_0x133f('0x1'));var path=require(_0x133f('0x2'));var timeout=require(_0x133f('0x3'));var express=require(_0x133f('0x4'));var router=express[_0x133f('0x5')]();var fs_extra=require(_0x133f('0x6'));var auth=require(_0x133f('0x7'));var interaction=require(_0x133f('0x8'));var config=require(_0x133f('0x9'));var controller=require(_0x133f('0xa'));router[_0x133f('0xb')]('/',auth[_0x133f('0xc')](),controller[_0x133f('0xd')]);router[_0x133f('0xb')]('/:id',auth[_0x133f('0xc')](),controller[_0x133f('0xe')]);router[_0x133f('0xb')]('/:id/preview',auth[_0x133f('0xc')](),controller[_0x133f('0xf')]);router['get'](_0x133f('0x10'),auth['isAuthenticated'](),controller[_0x133f('0x11')]);router[_0x133f('0xb')](_0x133f('0x12'),auth['isAuthenticated'](),controller['query']);router[_0x133f('0x13')]('/',auth[_0x133f('0xc')](),controller[_0x133f('0x14')]);router[_0x133f('0x15')](_0x133f('0x16'),auth[_0x133f('0xc')](),controller[_0x133f('0x17')]);router[_0x133f('0x18')](_0x133f('0x16'),auth['isAuthenticated'](),controller[_0x133f('0x19')]);module[_0x133f('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index 29328b9..f3b23bb 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 _0xabce=['exports','STRING','TEXT','sequelize'];(function(_0x5490fa,_0x42eb1c){var _0x47b560=function(_0x3f2906){while(--_0x3f2906){_0x5490fa['push'](_0x5490fa['shift']());}};_0x47b560(++_0x42eb1c);}(_0xabce,0x103));var _0xeabc=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xabce[_0x4e1d03];return _0x362d4b;};'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
+var _0x3f8a=['TEXT','sequelize','exports','STRING'];(function(_0x39cd16,_0x5dfe1c){var _0xa7b510=function(_0x3714c6){while(--_0x3714c6){_0x39cd16['push'](_0x39cd16['shift']());}};_0xa7b510(++_0x5dfe1c);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x3d90f1,_0xf25e08){_0x3d90f1=_0x3d90f1-0x0;var _0x3af913=_0x3f8a[_0x3d90f1];return _0x3af913;};'use strict';var Sequelize=require(_0xa3f8('0x0'));module[_0xa3f8('0x1')]={'name':{'type':Sequelize[_0xa3f8('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa3f8('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xa3f8('0x2')]},'conditions':{'type':Sequelize[_0xa3f8('0x3')]},'joins':{'type':Sequelize[_0xa3f8('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 44bcf5e..6c0f75c 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 _0xf494=['name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','catch','show','includeAll','find','create','body','user','Reports','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','cross_join','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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','value','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','parse','foreignTable','%s.%s\x20=\x20%s.%s','parentKey','foreignKey','conditions','debug','Limited\x20Query:','sequelize','toString','QueryTypes','right_join','SUM(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','ROUND(%s)','IS\x20NULL','operator','condition','getFields','groupBy','clone','output','fullPath','%s-%s.%s','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','SELECT','run','runReport','IS\x20NOT\x20EMPTY','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','reject','save','update','then','destroy','get','DefaultReports','error','stack'];(function(_0x160ed3,_0x1ee9ed){var _0x293631=function(_0x18dff4){while(--_0x18dff4){_0x160ed3['push'](_0x160ed3['shift']());}};_0x293631(++_0x1ee9ed);}(_0xf494,0x1c6));var _0x4f49=function(_0x11f4d7,_0xfabaa5){_0x11f4d7=_0x11f4d7-0x0;var _0x410105=_0xf494[_0x11f4d7];return _0x410105;};'use strict';var emlformat=require(_0x4f49('0x0'));var rimraf=require(_0x4f49('0x1'));var zipdir=require(_0x4f49('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f49('0x3'));var moment=require(_0x4f49('0x4'));var BPromise=require(_0x4f49('0x5'));var Mustache=require(_0x4f49('0x6'));var util=require(_0x4f49('0x7'));var path=require(_0x4f49('0x8'));var sox=require(_0x4f49('0x9'));var csv=require(_0x4f49('0xa'));var ejs=require(_0x4f49('0xb'));var fs=require('fs');var fs_extra=require(_0x4f49('0xc'));var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xa'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x4f49('0x18'))['db'];var dbH=require(_0x4f49('0x18'))['dbH'];function respondWithStatusCode(_0x1e1c37,_0x111a8b){_0x111a8b=_0x111a8b||0xcc;return function(_0x1b9145){if(_0x1b9145){return _0x1e1c37[_0x4f49('0x19')](_0x111a8b);}return _0x1e1c37[_0x4f49('0x1a')](_0x111a8b)[_0x4f49('0x1b')]();};}function respondWithResult(_0xfdb477,_0x5c373e){_0x5c373e=_0x5c373e||0xc8;return function(_0x515ace){if(_0x515ace){return _0xfdb477[_0x4f49('0x1a')](_0x5c373e)[_0x4f49('0x1c')](_0x515ace);}};}function respondWithFilteredResult(_0x5878f4,_0x5bdfaf){return function(_0x2f0a0d){if(_0x2f0a0d){var _0x2ecaaa=typeof _0x5bdfaf[_0x4f49('0x1d')]==='undefined'&&typeof _0x5bdfaf[_0x4f49('0x1e')]===_0x4f49('0x1f');var _0x4e85df=_0x2f0a0d['count'];var _0x5bb23b=_0x2ecaaa?0x0:_0x5bdfaf['offset'];var _0x47f1e8=_0x2ecaaa?_0x2f0a0d[_0x4f49('0x20')]:_0x5bdfaf[_0x4f49('0x1d')]+_0x5bdfaf[_0x4f49('0x1e')];var _0x407042;if(_0x47f1e8>=_0x4e85df){_0x47f1e8=_0x4e85df;_0x407042=0xc8;}else{_0x407042=0xce;}_0x5878f4['status'](_0x407042);return _0x5878f4[_0x4f49('0x21')](_0x4f49('0x22'),_0x5bb23b+'-'+_0x47f1e8+'/'+_0x4e85df)[_0x4f49('0x1c')](_0x2f0a0d);}return null;};}function patchUpdates(_0xaab5e7){return function(_0xea82f8){try{jsonpatch['apply'](_0xea82f8,_0xaab5e7,!![]);}catch(_0x3e7e28){return BPromise[_0x4f49('0x23')](_0x3e7e28);}return _0xea82f8[_0x4f49('0x24')]();};}function saveUpdates(_0x53b57d,_0x40755e){return function(_0x1d70a7){if(_0x1d70a7){return _0x1d70a7[_0x4f49('0x25')](_0x53b57d)[_0x4f49('0x26')](function(_0x9d30aa){return _0x9d30aa;});}return null;};}function removeEntity(_0x36187b,_0x559d98){return function(_0x4e9041){if(_0x4e9041){return _0x4e9041[_0x4f49('0x27')]()[_0x4f49('0x26')](function(){var _0x4fedbb=_0x4e9041[_0x4f49('0x28')]({'plain':!![]});var _0x2c1519=_0x4f49('0x29');return db['UserProfileResource'][_0x4f49('0x27')]({'where':{'type':_0x2c1519,'resourceId':_0x4fedbb['id']}})[_0x4f49('0x26')](function(){return _0x4e9041;});})[_0x4f49('0x26')](function(){_0x36187b[_0x4f49('0x1a')](0xcc)[_0x4f49('0x1b')]();});}};}function handleEntityNotFound(_0x122404,_0x4915af){return function(_0x50c571){if(!_0x50c571){_0x122404[_0x4f49('0x19')](0x194);}return _0x50c571;};}function handleError(_0x2c00ee,_0x605c91){_0x605c91=_0x605c91||0x1f4;return function(_0x560050){logger[_0x4f49('0x2a')](_0x560050[_0x4f49('0x2b')]);if(_0x560050[_0x4f49('0x2c')]){delete _0x560050['name'];}_0x2c00ee['status'](_0x605c91)[_0x4f49('0x2d')](_0x560050);};}exports[_0x4f49('0x2e')]=function(_0x7a6ea0,_0x5e7076){var _0x1eaac6={},_0x35aa33={},_0x173657={'count':0x0,'rows':[]};var _0x2ceda4=_[_0x4f49('0x2f')](db[_0x4f49('0x30')][_0x4f49('0x31')],function(_0x45ae19){return{'name':_0x45ae19[_0x4f49('0x32')],'type':_0x45ae19[_0x4f49('0x33')][_0x4f49('0x34')]};});_0x35aa33[_0x4f49('0x35')]=_[_0x4f49('0x2f')](_0x2ceda4,_0x4f49('0x2c'));_0x35aa33[_0x4f49('0x36')]=_[_0x4f49('0x37')](_0x7a6ea0[_0x4f49('0x36')]);_0x35aa33[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x35aa33['model'],_0x35aa33[_0x4f49('0x36')]);_0x1eaac6[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x35aa33[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3b')]));_0x1eaac6[_0x4f49('0x3a')]=_0x1eaac6[_0x4f49('0x3a')][_0x4f49('0x3c')]?_0x1eaac6[_0x4f49('0x3a')]:_0x35aa33[_0x4f49('0x35')];if(!_0x7a6ea0[_0x4f49('0x36')]['hasOwnProperty'](_0x4f49('0x3d'))){_0x1eaac6[_0x4f49('0x1e')]=qs[_0x4f49('0x1e')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1e')]);_0x1eaac6[_0x4f49('0x1d')]=qs[_0x4f49('0x1d')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x1d')]);}_0x1eaac6[_0x4f49('0x3e')]=qs[_0x4f49('0x3f')](_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x3f')]);_0x1eaac6[_0x4f49('0x40')]=qs['filters'](_[_0x4f49('0x41')](_0x7a6ea0[_0x4f49('0x36')],_0x35aa33['filters']),_0x2ceda4);if(_0x7a6ea0[_0x4f49('0x36')][_0x4f49('0x42')]){_0x1eaac6['where']=_[_0x4f49('0x43')](_0x1eaac6[_0x4f49('0x40')],{'$or':_[_0x4f49('0x2f')](_0x2ceda4,function(_0x200b1d){if(_0x200b1d[_0x4f49('0x33')]!==_0x4f49('0x44')){var _0x29e910={};_0x29e910[_0x200b1d['name']]={'$like':'%'+_0x7a6ea0['query']['filter']+'%'};return _0x29e910;}})});}_0x1eaac6=_[_0x4f49('0x43')]({},_0x1eaac6,_0x7a6ea0[_0x4f49('0x45')]);var _0x2e4355={'where':_0x1eaac6[_0x4f49('0x40')]};return db[_0x4f49('0x30')][_0x4f49('0x20')](_0x2e4355)[_0x4f49('0x26')](function(_0x23720a){_0x173657[_0x4f49('0x20')]=_0x23720a;if(_0x7a6ea0['query']['includeAll']){_0x1eaac6[_0x4f49('0x46')]=[{'all':!![]}];}return db[_0x4f49('0x30')][_0x4f49('0x47')](_0x1eaac6);})['then'](function(_0x2d6b56){_0x173657['rows']=_0x2d6b56;return _0x173657;})['then'](respondWithFilteredResult(_0x5e7076,_0x1eaac6))[_0x4f49('0x48')](handleError(_0x5e7076,null));};exports[_0x4f49('0x49')]=function(_0x40eadc,_0x497cb8){var _0x287781={'raw':!![],'where':{'id':_0x40eadc['params']['id']}},_0x11b4df={};_0x11b4df[_0x4f49('0x35')]=_['keys'](db[_0x4f49('0x30')][_0x4f49('0x31')]);_0x11b4df[_0x4f49('0x36')]=_['keys'](_0x40eadc[_0x4f49('0x36')]);_0x11b4df[_0x4f49('0x38')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],_0x11b4df[_0x4f49('0x36')]);_0x287781[_0x4f49('0x3a')]=_[_0x4f49('0x39')](_0x11b4df[_0x4f49('0x35')],qs[_0x4f49('0x3b')](_0x40eadc[_0x4f49('0x36')]['fields']));_0x287781[_0x4f49('0x3a')]=_0x287781[_0x4f49('0x3a')]['length']?_0x287781[_0x4f49('0x3a')]:_0x11b4df['model'];if(_0x40eadc[_0x4f49('0x36')][_0x4f49('0x4a')]){_0x287781[_0x4f49('0x46')]=[{'all':!![]}];}_0x287781=_[_0x4f49('0x43')]({},_0x287781,_0x40eadc['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x287781)[_0x4f49('0x26')](handleEntityNotFound(_0x497cb8,null))[_0x4f49('0x26')](respondWithResult(_0x497cb8,null))[_0x4f49('0x48')](handleError(_0x497cb8,null));};exports[_0x4f49('0x4c')]=function(_0x37fdb7,_0xd282c){return db[_0x4f49('0x30')][_0x4f49('0x4c')](_0x37fdb7[_0x4f49('0x4d')],{})[_0x4f49('0x26')](function(_0x148031){var _0x2104d0=_0x37fdb7[_0x4f49('0x4e')][_0x4f49('0x28')]({'plain':!![]});if(!_0x2104d0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2104d0['role']===_0x4f49('0x4e')){var _0x197670=_0x148031[_0x4f49('0x28')]({'plain':!![]});var _0xe46c90=_0x4f49('0x4f');return db[_0x4f49('0x50')][_0x4f49('0x4b')]({'where':{'name':_0xe46c90,'userProfileId':_0x2104d0['userProfileId']},'raw':!![]})[_0x4f49('0x26')](function(_0x4ff0a2){if(_0x4ff0a2&&_0x4ff0a2[_0x4f49('0x51')]===0x0){return db[_0x4f49('0x52')][_0x4f49('0x4c')]({'name':_0x197670[_0x4f49('0x2c')],'resourceId':_0x197670['id'],'type':'DefaultReports','sectionId':_0x4ff0a2['id']},{})[_0x4f49('0x26')](function(){return _0x148031;});}else{return _0x148031;}})['catch'](function(_0x52d18c){logger[_0x4f49('0x2a')](_0x4f49('0x53'),_0x52d18c);throw _0x52d18c;});}return _0x148031;})[_0x4f49('0x26')](respondWithResult(_0xd282c,0xc9))[_0x4f49('0x48')](handleError(_0xd282c,null));};exports['update']=function(_0x599c51,_0xd7f47b){if(_0x599c51[_0x4f49('0x4d')]['id']){delete _0x599c51['body']['id'];}return db[_0x4f49('0x30')]['find']({'where':{'id':_0x599c51['params']['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0xd7f47b,null))['then'](saveUpdates(_0x599c51[_0x4f49('0x4d')],null))['then'](respondWithResult(_0xd7f47b,null))[_0x4f49('0x48')](handleError(_0xd7f47b,null));};exports[_0x4f49('0x27')]=function(_0x2472c9,_0x883408){return db[_0x4f49('0x30')][_0x4f49('0x4b')]({'where':{'id':_0x2472c9[_0x4f49('0x54')]['id']}})[_0x4f49('0x26')](handleEntityNotFound(_0x883408,null))['then'](removeEntity(_0x883408,null))[_0x4f49('0x48')](handleError(_0x883408,null));};exports['preview']=function(_0x213608,_0x1f640d){var _0xc4fc6b=0xa;var _0x467f12=[_0x4f49('0x55'),_0x4f49('0x56'),'right_join',_0x4f49('0x57')];var _0xd3689c={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x564bf5={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x21807e=function(_0x265988){return!_[_0x4f49('0x62')](['IS\x20NULL',_0x4f49('0x63'),_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x265988);};var _0x293839=function(_0x17b15){if(!_0x17b15||!_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x28ea73='(',_0x1b80f2=0x0;_0x1b80f2<_0x17b15[_0x4f49('0x65')][_0x4f49('0x3c')];_0x1b80f2+=0x1){_0x1b80f2>0x0&&(_0x28ea73+='\x20'+_0x17b15['operator']+'\x20');_0x28ea73+=_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]?_0x293839(_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x66')]):_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x67')]+'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition']+(_0x21807e(_0x17b15[_0x4f49('0x65')][_0x1b80f2]['condition'])?'\x20'+_0x17b15[_0x4f49('0x65')][_0x1b80f2][_0x4f49('0x68')]:'');}return _0x28ea73+')';};var _0x4714c7={'where':{'id':_0x213608[_0x4f49('0x54')]['id']}},_0xf29378,_0xc7743e,_0x3f2f3f,_0x61a565,_0x297698;_0x4714c7=_[_0x4f49('0x43')]({},_0x4714c7,_0x213608['options']);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x4714c7)[_0x4f49('0x26')](function(_0x2cdaa4){if(_0x2cdaa4){_0xf29378=_0x2cdaa4;return _0x2cdaa4['getFields']();}return null;})['then'](function(_0x28e8ae){if(_0x28e8ae){if(!_0x28e8ae['length']){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0xc7743e=_0x28e8ae;return db[_0x4f49('0x6c')][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x179431){if(_0x179431){_0x3f2f3f=_[_0x4f49('0x6d')](_0x179431,'id');var _0x3823f0;var _0x3e9b47=squel[_0x4f49('0x6e')]();_0x3e9b47[_0x4f49('0x6f')](_0xf29378[_0x4f49('0x70')]);for(var _0xd53de8=0x0;_0xd53de8<_0xc7743e[_0x4f49('0x3c')];_0xd53de8+=0x1){_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x71')]?_0x3f2f3f[_0xc7743e[_0xd53de8][_0x4f49('0x71')]][_0x4f49('0x72')]:_0xc7743e[_0xd53de8][_0x4f49('0x67')];_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0xd3689c[_0xc7743e[_0xd53de8][_0x4f49('0x73')]],'%s',_0x3823f0):_0x3823f0;_0x3823f0=_0xc7743e[_0xd53de8][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x564bf5[_0xc7743e[_0xd53de8][_0x4f49('0x75')]],'%s',_0x3823f0):_0x3823f0;if(_0xc7743e[_0xd53de8]['groupBy']){_0x3e9b47[_0x4f49('0x66')](_0x3823f0);}_0xc7743e[_0xd53de8]['orderBy']&&_0x3e9b47[_0x4f49('0x3e')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x76')]===_0x4f49('0x77')?![]:!![]);_0x3e9b47[_0x4f49('0x67')](_0x3823f0,_0xc7743e[_0xd53de8][_0x4f49('0x78')]||_0x3823f0);}if(_0xf29378[_0x4f49('0x79')]){_0xf29378[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0xf29378[_0x4f49('0x79')]);for(var _0x541ac6=0x0;_0x541ac6<_0xf29378['joins'][_0x4f49('0x3c')];_0x541ac6+=0x1){if(_0xf29378['joins'][_0x541ac6][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x467f12,_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')])&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['parentKey']&&_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')]&&_0xf29378[_0x4f49('0x79')][_0x541ac6]['foreignKey']){_0x3e9b47[_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x33')]](_0xf29378['joins'][_0x541ac6][_0x4f49('0x7b')],null,util['format'](_0x4f49('0x7c'),_0xf29378[_0x4f49('0x70')],_0xf29378['joins'][_0x541ac6][_0x4f49('0x7d')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7b')],_0xf29378[_0x4f49('0x79')][_0x541ac6][_0x4f49('0x7e')]));}}}if(_0xf29378[_0x4f49('0x7f')]){_0xf29378['conditions']=JSON[_0x4f49('0x7a')](_0xf29378['conditions']);_0x3e9b47[_0x4f49('0x40')](_0x293839(_0xf29378['conditions'][_0x4f49('0x66')]));}_0x297698=_0x3e9b47['clone']();_0x3e9b47[_0x4f49('0x1e')](_0xc4fc6b);_0x3e9b47[_0x4f49('0x1d')](0x0);logger[_0x4f49('0x80')](_0x4f49('0x81'),_0x3e9b47['toString']());return dbH[_0x4f49('0x82')]['query'](_0x3e9b47[_0x4f49('0x83')](),{'type':dbH['sequelize'][_0x4f49('0x84')]['SELECT']});}})['then'](respondWithResult(_0x1f640d,null))[_0x4f49('0x48')](handleError(_0x1f640d,null));};function runReport(_0x20b2be,_0x16cb4d,_0x4c0e7a){var _0x289810=_0x16cb4d[_0x4f49('0x2c')];var _0x5c33c9=0xa;var _0x5d52ae=['join',_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x87439={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':_0x4f49('0x59'),'MIN':_0x4f49('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0x2902a1={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x4f49('0x5f'),'HOUR':_0x4f49('0x60'),'ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x389679=function(_0x5304c3){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),'IS\x20NOT\x20NULL',_0x4f49('0x64'),'IS\x20NOT\x20EMPTY'],_0x5304c3);};var _0x351a33=function(_0x4d72a0){if(!_0x4d72a0||!_0x4d72a0[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x2ef19e='(',_0x6ad599=0x0;_0x6ad599<_0x4d72a0[_0x4f49('0x65')]['length'];_0x6ad599+=0x1){_0x6ad599>0x0&&(_0x2ef19e+='\x20'+_0x4d72a0[_0x4f49('0x8a')]+'\x20');_0x2ef19e+=_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x66')]?_0x351a33(_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['group']):_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['field']+'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599]['condition']+(_0x389679(_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x8b')])?'\x20'+_0x4d72a0[_0x4f49('0x65')][_0x6ad599][_0x4f49('0x68')]:'');}return _0x2ef19e+')';};var _0x111e90={'where':{'id':_0x20b2be['id']}},_0xd253ed,_0x323a3a,_0xe0adc3,_0x3a26ff,_0x64f0ee;_0x111e90=_['merge']({},_0x111e90,_0x4c0e7a);return db[_0x4f49('0x30')][_0x4f49('0x4b')](_0x111e90)[_0x4f49('0x26')](function(_0x299849){if(_0x299849){_0xd253ed=_0x299849;return _0x299849[_0x4f49('0x8c')]();}return null;})[_0x4f49('0x26')](function(_0x55b28b){if(_0x55b28b){if(!_0x55b28b[_0x4f49('0x3c')]){throw new db[(_0x4f49('0x69'))][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x323a3a=_0x55b28b;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})['then'](function(_0x3c4e88){if(_0x3c4e88){_0xe0adc3=_[_0x4f49('0x6d')](_0x3c4e88,'id');var _0x5c5d2;var _0xa880a2=squel['select']();_0xa880a2[_0x4f49('0x6f')](_0xd253ed[_0x4f49('0x70')]);for(var _0x11c0a0=0x0;_0x11c0a0<_0x323a3a[_0x4f49('0x3c')];_0x11c0a0+=0x1){_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x71')]?_0xe0adc3[_0x323a3a[_0x11c0a0][_0x4f49('0x71')]][_0x4f49('0x72')]:_0x323a3a[_0x11c0a0][_0x4f49('0x67')];_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x73')]?_[_0x4f49('0x74')](_0x87439[_0x323a3a[_0x11c0a0][_0x4f49('0x73')]],'%s',_0x5c5d2):_0x5c5d2;_0x5c5d2=_0x323a3a[_0x11c0a0][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0x2902a1[_0x323a3a[_0x11c0a0][_0x4f49('0x75')]],'%s',_0x5c5d2):_0x5c5d2;if(_0x323a3a[_0x11c0a0][_0x4f49('0x8d')]){_0xa880a2[_0x4f49('0x66')](_0x5c5d2);}_0x323a3a[_0x11c0a0][_0x4f49('0x76')]&&_0xa880a2[_0x4f49('0x3e')](_0x5c5d2,_0x323a3a[_0x11c0a0]['orderBy']===_0x4f49('0x77')?![]:!![]);_0xa880a2[_0x4f49('0x67')](_0x5c5d2,_0x323a3a[_0x11c0a0][_0x4f49('0x78')]||_0x5c5d2);}if(_0xd253ed[_0x4f49('0x79')]){_0xd253ed['joins']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x79')]);for(var _0x594460=0x0;_0x594460<_0xd253ed[_0x4f49('0x79')]['length'];_0x594460+=0x1){if(_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x5d52ae,_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x33')])&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7d')]&&_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')]&&_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']){_0xa880a2[_0xd253ed['joins'][_0x594460][_0x4f49('0x33')]](_0xd253ed['joins'][_0x594460][_0x4f49('0x7b')],null,util[_0x4f49('0x75')]('%s.%s\x20=\x20%s.%s',_0xd253ed['table'],_0xd253ed[_0x4f49('0x79')][_0x594460]['parentKey'],_0xd253ed[_0x4f49('0x79')][_0x594460][_0x4f49('0x7b')],_0xd253ed[_0x4f49('0x79')][_0x594460]['foreignKey']));}}}if(_0xd253ed[_0x4f49('0x7f')]){_0xd253ed['conditions']=JSON[_0x4f49('0x7a')](_0xd253ed[_0x4f49('0x7f')]);_0xa880a2[_0x4f49('0x40')](_0x351a33(_0xd253ed['conditions'][_0x4f49('0x66')]));}_0x64f0ee=_0xa880a2[_0x4f49('0x8e')]();_0xa880a2[_0x4f49('0x1e')](_0x5c33c9);_0xa880a2['offset'](0x0);return;}})['then'](function(){if(_0x16cb4d[_0x4f49('0x8f')]==='web'){return null;}var _0x2bc9df=_[_0x4f49('0x43')](_0x16cb4d,{'name':_0x16cb4d[_0x4f49('0x90')]||_0x16cb4d['name']||_0xd253ed[_0x4f49('0x2c')],'basename':_0x289810,'savename':util['format'](_0x4f49('0x91'),_0x16cb4d[_0x4f49('0x2c')]||_0xd253ed[_0x4f49('0x2c')],require('randomstring')[_0x4f49('0x92')](0x4),_0x16cb4d[_0x4f49('0x8f')]||_0x4f49('0x93')),'reportId':_0xd253ed['id'],'reportType':_0x4f49('0x94')});return db[_0x4f49('0x95')][_0x4f49('0x4c')](_0x2bc9df,{'raw':!![]});})['then'](function(_0x5b6ac7){if(_0xd253ed[_0x4f49('0x70')]===_0x4f49('0x96')){_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+_0x4f49('0x97'),_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}else{_0x64f0ee[_0x4f49('0x40')](_0xd253ed[_0x4f49('0x70')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x16cb4d[_0x4f49('0x98')],_0x16cb4d[_0x4f49('0x99')]);}if(_0x5b6ac7){logger[_0x4f49('0x9a')]('Run\x20Query:',_0x64f0ee[_0x4f49('0x83')]());require(_0x4f49('0x9b'))[_0x4f49('0x9c')](path['join'](__dirname,_0x4f49('0x9d'),_0x5b6ac7[_0x4f49('0x8f')]),[_0x5b6ac7['id'],_0x64f0ee[_0x4f49('0x83')](),path['join'](__dirname,_0x4f49('0x9e'),_0x5b6ac7[_0x4f49('0x9f')]),_0x289810]);return _0x5b6ac7;}else{var _0x5efb11=squel['select']();_0x5efb11[_0x4f49('0x6f')]('('+_0x64f0ee[_0x4f49('0x83')]()+')',_0x4f49('0xa0'));_0x5efb11[_0x4f49('0x67')](_0x4f49('0xa1'),_0x4f49('0x20'));_0x64f0ee['limit'](_0x16cb4d['limit']||_0x5c33c9);_0x64f0ee['offset'](_0x16cb4d[_0x4f49('0x1d')]||0x0);return dbH[_0x4f49('0x82')]['query'](_0x5efb11[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')]['SELECT']})['then'](function(_0x3633b5){if(!_0x3633b5['length']){_0x3a26ff=0x0;}else{_0x3a26ff=_0x3633b5[0x0][_0x4f49('0x20')]||0x0;}return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x64f0ee[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')]['QueryTypes'][_0x4f49('0xa2')]});})[_0x4f49('0x26')](function(_0x45c938){return{'rows':_0x45c938||[],'count':_0x3a26ff};});}});}exports[_0x4f49('0xa3')]=function(_0x4a4d75,_0x93e85d){return runReport(_0x4a4d75[_0x4f49('0x54')],_0x4a4d75['query'],_0x4a4d75[_0x4f49('0x45')])[_0x4f49('0x26')](respondWithResult(_0x93e85d,null))[_0x4f49('0x48')](handleError(_0x93e85d,null));};exports[_0x4f49('0xa4')]=runReport;exports[_0x4f49('0x36')]=function(_0x40991b,_0x56290f){var _0x4994b6=0xa;var _0x1c7d87=[_0x4f49('0x55'),_0x4f49('0x56'),_0x4f49('0x85'),_0x4f49('0x57')];var _0x5cd00a={'SUM':_0x4f49('0x86'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x4f49('0x58'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x4f49('0x5b'),'GROUP_CONCAT':_0x4f49('0x5c'),'GROUP_CONCAT ASC':_0x4f49('0x87'),'GROUP_CONCAT DESC':_0x4f49('0x5d')};var _0xd876f1={'SEC_TO_TIME':_0x4f49('0x5e'),'DATE':_0x4f49('0x5f'),'HOUR':'HOUR(%s)','ROUND':_0x4f49('0x88'),'UNIX_TIMESTAMP':_0x4f49('0x61')};var _0x1ae2c9=function(_0x566634){return!_[_0x4f49('0x62')]([_0x4f49('0x89'),_0x4f49('0x63'),'IS\x20EMPTY',_0x4f49('0xa5')],_0x566634);};var _0x541dc2=function(_0x4061bf){if(!_0x4061bf||!_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')]){return'';}for(var _0x1bc18d='(',_0x5e6103=0x0;_0x5e6103<_0x4061bf[_0x4f49('0x65')][_0x4f49('0x3c')];_0x5e6103+=0x1){_0x5e6103>0x0&&(_0x1bc18d+='\x20'+_0x4061bf[_0x4f49('0x8a')]+'\x20');_0x1bc18d+=_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]?_0x541dc2(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x66')]):_0x4061bf[_0x4f49('0x65')][_0x5e6103]['field']+'\x20'+_0x4061bf['rules'][_0x5e6103][_0x4f49('0x8b')]+(_0x1ae2c9(_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x8b')])?'\x20'+_0x4061bf[_0x4f49('0x65')][_0x5e6103][_0x4f49('0x68')]:'');}return _0x1bc18d+')';};var _0x29dbab={'where':{'id':_0x40991b[_0x4f49('0x54')]['id']}},_0x5f459b,_0x1d090f,_0x37d2f4,_0x5bcb36,_0x3f04fa;_0x29dbab=_[_0x4f49('0x43')]({},_0x29dbab,_0x40991b['options']);return db['AnalyticDefaultReport'][_0x4f49('0x4b')](_0x29dbab)[_0x4f49('0x26')](function(_0x200848){if(_0x200848){_0x5f459b=_0x200848;return _0x200848['getFields']();}return null;})[_0x4f49('0x26')](function(_0x48f4bc){if(_0x48f4bc){if(!_0x48f4bc[_0x4f49('0x3c')]){throw new db['Sequelize'][(_0x4f49('0x6a'))](_0x4f49('0x6b'),0x193);}_0x1d090f=_0x48f4bc;return db['AnalyticMetric'][_0x4f49('0x47')]({'raw':!![]});}return null;})[_0x4f49('0x26')](function(_0x513bc9){if(_0x513bc9){_0x37d2f4=_[_0x4f49('0x6d')](_0x513bc9,'id');var _0x47567c;var _0x5f1538=squel[_0x4f49('0x6e')]();_0x5f1538[_0x4f49('0x6f')](_0x5f459b[_0x4f49('0x70')]);for(var _0xd91e48=0x0;_0xd91e48<_0x1d090f[_0x4f49('0x3c')];_0xd91e48+=0x1){_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x71')]?_0x37d2f4[_0x1d090f[_0xd91e48]['MetricId']][_0x4f49('0x72')]:_0x1d090f[_0xd91e48][_0x4f49('0x67')];_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x73')]?_['replace'](_0x5cd00a[_0x1d090f[_0xd91e48][_0x4f49('0x73')]],'%s',_0x47567c):_0x47567c;_0x47567c=_0x1d090f[_0xd91e48][_0x4f49('0x75')]?_[_0x4f49('0x74')](_0xd876f1[_0x1d090f[_0xd91e48][_0x4f49('0x75')]],'%s',_0x47567c):_0x47567c;if(_0x1d090f[_0xd91e48][_0x4f49('0x8d')]){_0x5f1538[_0x4f49('0x66')](_0x47567c);}_0x1d090f[_0xd91e48][_0x4f49('0x76')]&&_0x5f1538['order'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x76')]==='DESC'?![]:!![]);_0x5f1538['field'](_0x47567c,_0x1d090f[_0xd91e48][_0x4f49('0x78')]||_0x47567c);}if(_0x5f459b['joins']){_0x5f459b[_0x4f49('0x79')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x79')]);for(var _0x85eb3f=0x0;_0x85eb3f<_0x5f459b[_0x4f49('0x79')][_0x4f49('0x3c')];_0x85eb3f+=0x1){if(_0x5f459b['joins'][_0x85eb3f][_0x4f49('0x33')]&&_[_0x4f49('0x62')](_0x1c7d87,_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')])&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')]&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable']&&_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]){_0x5f1538[_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x33')]](_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7b')],null,util[_0x4f49('0x75')](_0x4f49('0x7c'),_0x5f459b[_0x4f49('0x70')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7d')],_0x5f459b[_0x4f49('0x79')][_0x85eb3f]['foreignTable'],_0x5f459b[_0x4f49('0x79')][_0x85eb3f][_0x4f49('0x7e')]));}}}if(_0x5f459b['conditions']){_0x5f459b[_0x4f49('0x7f')]=JSON[_0x4f49('0x7a')](_0x5f459b[_0x4f49('0x7f')]);_0x5f1538[_0x4f49('0x40')](_0x541dc2(_0x5f459b[_0x4f49('0x7f')][_0x4f49('0x66')]));}_0x3f04fa=_0x5f1538['clone']();_0x5f1538['limit'](_0x4994b6);_0x5f1538['offset'](0x0);logger['debug'](_0x4f49('0x81'),_0x5f1538['toString']());return dbH[_0x4f49('0x82')][_0x4f49('0x36')](_0x5f1538[_0x4f49('0x83')](),{'type':dbH[_0x4f49('0x82')][_0x4f49('0x84')][_0x4f49('0xa2')]});}})['then'](function(){return{'sql':_0x3f04fa[_0x4f49('0x83')]()};})['then'](respondWithResult(_0x56290f,null))[_0x4f49('0x48')](handleError(_0x56290f,null));};
\ No newline at end of file
+var _0xc6ac=['keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','dbH','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','DefaultReports','UserProfileResource','stack','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','model','name','query','keys','filters','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','params','intersection','length','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','left_join','right_join','cross_join','SUM(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','operator','field','condition','value','Sequelize','AnalyticMetric','select','from','table','MetricId','replace','format','group','DESC','alias','joins','parse','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','COUNT(DISTINCT\x20%s)','IS\x20NOT\x20EMPTY','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','metric','function','groupBy','orderBy','output','web','fullPath','%s-%s.%s','randomstring','generate','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','getFields'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xc6ac,0x15b));var _0xcc6a=function(_0x55131f,_0x4ea454){_0x55131f=_0x55131f-0x0;var _0x136eb0=_0xc6ac[_0x55131f];return _0x136eb0;};'use strict';var emlformat=require(_0xcc6a('0x0'));var rimraf=require(_0xcc6a('0x1'));var zipdir=require(_0xcc6a('0x2'));var jsonpatch=require(_0xcc6a('0x3'));var rp=require(_0xcc6a('0x4'));var moment=require(_0xcc6a('0x5'));var BPromise=require(_0xcc6a('0x6'));var Mustache=require(_0xcc6a('0x7'));var util=require(_0xcc6a('0x8'));var path=require(_0xcc6a('0x9'));var sox=require(_0xcc6a('0xa'));var csv=require(_0xcc6a('0xb'));var ejs=require(_0xcc6a('0xc'));var fs=require('fs');var fs_extra=require(_0xcc6a('0xd'));var _=require('lodash');var squel=require(_0xcc6a('0xe'));var crypto=require(_0xcc6a('0xf'));var jsforce=require(_0xcc6a('0x10'));var deskjs=require('desk.js');var toCsv=require(_0xcc6a('0xb'));var querystring=require(_0xcc6a('0x11'));var Papa=require(_0xcc6a('0x12'));var Redis=require(_0xcc6a('0x13'));var authService=require(_0xcc6a('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xcc6a('0x15'));var hardwareService=require(_0xcc6a('0x16'));var logger=require(_0xcc6a('0x17'))('api');var utils=require(_0xcc6a('0x18'));var config=require(_0xcc6a('0x19'));var licenseUtil=require(_0xcc6a('0x1a'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xcc6a('0x1b')];function respondWithStatusCode(_0x211444,_0x4300c0){_0x4300c0=_0x4300c0||0xcc;return function(_0x559a0a){if(_0x559a0a){return _0x211444['sendStatus'](_0x4300c0);}return _0x211444[_0xcc6a('0x1c')](_0x4300c0)[_0xcc6a('0x1d')]();};}function respondWithResult(_0x43710d,_0x348af7){_0x348af7=_0x348af7||0xc8;return function(_0x96f9de){if(_0x96f9de){return _0x43710d[_0xcc6a('0x1c')](_0x348af7)[_0xcc6a('0x1e')](_0x96f9de);}};}function respondWithFilteredResult(_0x403b18,_0x56ffb0){return function(_0x4e628f){if(_0x4e628f){var _0x4d021a=typeof _0x56ffb0[_0xcc6a('0x1f')]===_0xcc6a('0x20')&&typeof _0x56ffb0[_0xcc6a('0x21')]===_0xcc6a('0x20');var _0x33079c=_0x4e628f[_0xcc6a('0x22')];var _0x2d9585=_0x4d021a?0x0:_0x56ffb0[_0xcc6a('0x1f')];var _0x374e51=_0x4d021a?_0x4e628f[_0xcc6a('0x22')]:_0x56ffb0[_0xcc6a('0x1f')]+_0x56ffb0['limit'];var _0xfec60f;if(_0x374e51>=_0x33079c){_0x374e51=_0x33079c;_0xfec60f=0xc8;}else{_0xfec60f=0xce;}_0x403b18[_0xcc6a('0x1c')](_0xfec60f);return _0x403b18[_0xcc6a('0x23')](_0xcc6a('0x24'),_0x2d9585+'-'+_0x374e51+'/'+_0x33079c)[_0xcc6a('0x1e')](_0x4e628f);}return null;};}function patchUpdates(_0x30b8ed){return function(_0x36c80f){try{jsonpatch[_0xcc6a('0x25')](_0x36c80f,_0x30b8ed,!![]);}catch(_0x2254a8){return BPromise[_0xcc6a('0x26')](_0x2254a8);}return _0x36c80f[_0xcc6a('0x27')]();};}function saveUpdates(_0x845088,_0x51be9a){return function(_0x41c4c8){if(_0x41c4c8){return _0x41c4c8[_0xcc6a('0x28')](_0x845088)[_0xcc6a('0x29')](function(_0x581aae){return _0x581aae;});}return null;};}function removeEntity(_0x10016a,_0x294486){return function(_0x3a00e5){if(_0x3a00e5){return _0x3a00e5[_0xcc6a('0x2a')]()[_0xcc6a('0x29')](function(){var _0x5fc697=_0x3a00e5['get']({'plain':!![]});var _0x26def8=_0xcc6a('0x2b');return db[_0xcc6a('0x2c')]['destroy']({'where':{'type':_0x26def8,'resourceId':_0x5fc697['id']}})[_0xcc6a('0x29')](function(){return _0x3a00e5;});})[_0xcc6a('0x29')](function(){_0x10016a['status'](0xcc)[_0xcc6a('0x1d')]();});}};}function handleEntityNotFound(_0x8b1b2b,_0x3233d1){return function(_0x473f88){if(!_0x473f88){_0x8b1b2b['sendStatus'](0x194);}return _0x473f88;};}function handleError(_0x194aab,_0x3cf14c){_0x3cf14c=_0x3cf14c||0x1f4;return function(_0x2c6d88){logger['error'](_0x2c6d88[_0xcc6a('0x2d')]);if(_0x2c6d88['name']){delete _0x2c6d88['name'];}_0x194aab[_0xcc6a('0x1c')](_0x3cf14c)[_0xcc6a('0x2e')](_0x2c6d88);};}exports[_0xcc6a('0x2f')]=function(_0x11b481,_0x2b575d){var _0x131138={},_0x4e2de4={},_0x7b2b54={'count':0x0,'rows':[]};var _0x28e3c3=_[_0xcc6a('0x30')](db[_0xcc6a('0x31')][_0xcc6a('0x32')],function(_0x152ebd){return{'name':_0x152ebd[_0xcc6a('0x33')],'type':_0x152ebd[_0xcc6a('0x34')]['key']};});_0x4e2de4[_0xcc6a('0x35')]=_[_0xcc6a('0x30')](_0x28e3c3,_0xcc6a('0x36'));_0x4e2de4[_0xcc6a('0x37')]=_[_0xcc6a('0x38')](_0x11b481[_0xcc6a('0x37')]);_0x4e2de4[_0xcc6a('0x39')]=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],_0x4e2de4['query']);_0x131138['attributes']=_['intersection'](_0x4e2de4[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3a')]));_0x131138[_0xcc6a('0x3b')]=_0x131138['attributes']['length']?_0x131138[_0xcc6a('0x3b')]:_0x4e2de4[_0xcc6a('0x35')];if(!_0x11b481[_0xcc6a('0x37')]['hasOwnProperty'](_0xcc6a('0x3c'))){_0x131138[_0xcc6a('0x21')]=qs[_0xcc6a('0x21')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x21')]);_0x131138[_0xcc6a('0x1f')]=qs[_0xcc6a('0x1f')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x1f')]);}_0x131138[_0xcc6a('0x3d')]=qs[_0xcc6a('0x3e')](_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x3e')]);_0x131138[_0xcc6a('0x3f')]=qs[_0xcc6a('0x39')](_[_0xcc6a('0x40')](_0x11b481[_0xcc6a('0x37')],_0x4e2de4[_0xcc6a('0x39')]),_0x28e3c3);if(_0x11b481['query']['filter']){_0x131138[_0xcc6a('0x3f')]=_[_0xcc6a('0x41')](_0x131138[_0xcc6a('0x3f')],{'$or':_[_0xcc6a('0x30')](_0x28e3c3,function(_0x1e628b){if(_0x1e628b[_0xcc6a('0x34')]!==_0xcc6a('0x42')){var _0x1199f1={};_0x1199f1[_0x1e628b['name']]={'$like':'%'+_0x11b481['query'][_0xcc6a('0x43')]+'%'};return _0x1199f1;}})});}_0x131138=_['merge']({},_0x131138,_0x11b481['options']);var _0x5cf1ba={'where':_0x131138[_0xcc6a('0x3f')]};return db[_0xcc6a('0x31')][_0xcc6a('0x22')](_0x5cf1ba)[_0xcc6a('0x29')](function(_0xe8056f){_0x7b2b54['count']=_0xe8056f;if(_0x11b481[_0xcc6a('0x37')][_0xcc6a('0x44')]){_0x131138[_0xcc6a('0x45')]=[{'all':!![]}];}return db[_0xcc6a('0x31')][_0xcc6a('0x46')](_0x131138);})[_0xcc6a('0x29')](function(_0x54f862){_0x7b2b54[_0xcc6a('0x47')]=_0x54f862;return _0x7b2b54;})[_0xcc6a('0x29')](respondWithFilteredResult(_0x2b575d,_0x131138))[_0xcc6a('0x48')](handleError(_0x2b575d,null));};exports[_0xcc6a('0x49')]=function(_0x494904,_0x1fe723){var _0x4a9cea={'raw':!![],'where':{'id':_0x494904[_0xcc6a('0x4a')]['id']}},_0x351529={};_0x351529[_0xcc6a('0x35')]=_['keys'](db[_0xcc6a('0x31')][_0xcc6a('0x32')]);_0x351529[_0xcc6a('0x37')]=_['keys'](_0x494904['query']);_0x351529[_0xcc6a('0x39')]=_[_0xcc6a('0x4b')](_0x351529[_0xcc6a('0x35')],_0x351529[_0xcc6a('0x37')]);_0x4a9cea[_0xcc6a('0x3b')]=_['intersection'](_0x351529[_0xcc6a('0x35')],qs[_0xcc6a('0x3a')](_0x494904['query'][_0xcc6a('0x3a')]));_0x4a9cea[_0xcc6a('0x3b')]=_0x4a9cea[_0xcc6a('0x3b')][_0xcc6a('0x4c')]?_0x4a9cea[_0xcc6a('0x3b')]:_0x351529[_0xcc6a('0x35')];if(_0x494904['query']['includeAll']){_0x4a9cea['include']=[{'all':!![]}];}_0x4a9cea=_[_0xcc6a('0x41')]({},_0x4a9cea,_0x494904[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4a9cea)['then'](handleEntityNotFound(_0x1fe723,null))[_0xcc6a('0x29')](respondWithResult(_0x1fe723,null))['catch'](handleError(_0x1fe723,null));};exports[_0xcc6a('0x4f')]=function(_0x4299ca,_0xcfc540){return db[_0xcc6a('0x31')][_0xcc6a('0x4f')](_0x4299ca[_0xcc6a('0x50')],{})['then'](function(_0x1a3b82){var _0x7288b2=_0x4299ca[_0xcc6a('0x51')][_0xcc6a('0x52')]({'plain':!![]});if(!_0x7288b2)throw new Error(_0xcc6a('0x53'));if(_0x7288b2[_0xcc6a('0x54')]===_0xcc6a('0x51')){var _0x392805=_0x1a3b82[_0xcc6a('0x52')]({'plain':!![]});var _0x30d0ef='Reports';return db[_0xcc6a('0x55')][_0xcc6a('0x4e')]({'where':{'name':_0x30d0ef,'userProfileId':_0x7288b2[_0xcc6a('0x56')]},'raw':!![]})[_0xcc6a('0x29')](function(_0x14f5e5){if(_0x14f5e5&&_0x14f5e5[_0xcc6a('0x57')]===0x0){return db['UserProfileResource']['create']({'name':_0x392805[_0xcc6a('0x36')],'resourceId':_0x392805['id'],'type':'DefaultReports','sectionId':_0x14f5e5['id']},{})[_0xcc6a('0x29')](function(){return _0x1a3b82;});}else{return _0x1a3b82;}})[_0xcc6a('0x48')](function(_0x2b5782){logger[_0xcc6a('0x58')](_0xcc6a('0x59'),_0x2b5782);throw _0x2b5782;});}return _0x1a3b82;})[_0xcc6a('0x29')](respondWithResult(_0xcfc540,0xc9))[_0xcc6a('0x48')](handleError(_0xcfc540,null));};exports[_0xcc6a('0x28')]=function(_0x68b823,_0x27b074){if(_0x68b823[_0xcc6a('0x50')]['id']){delete _0x68b823['body']['id'];}return db[_0xcc6a('0x31')]['find']({'where':{'id':_0x68b823[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x27b074,null))[_0xcc6a('0x29')](saveUpdates(_0x68b823['body'],null))[_0xcc6a('0x29')](respondWithResult(_0x27b074,null))['catch'](handleError(_0x27b074,null));};exports[_0xcc6a('0x2a')]=function(_0x5db3b5,_0x3c0b1c){return db[_0xcc6a('0x31')][_0xcc6a('0x4e')]({'where':{'id':_0x5db3b5[_0xcc6a('0x4a')]['id']}})[_0xcc6a('0x29')](handleEntityNotFound(_0x3c0b1c,null))[_0xcc6a('0x29')](removeEntity(_0x3c0b1c,null))[_0xcc6a('0x48')](handleError(_0x3c0b1c,null));};exports[_0xcc6a('0x5a')]=function(_0x506311,_0x14d3ff){var _0x56d512=0xa;var _0x3a6b7e=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x586789={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x389e5f={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2cc561=function(_0x483aa4){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x483aa4);};var _0x46d93b=function(_0x4ed702){if(!_0x4ed702||!_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x20a16b='(',_0x19a578=0x0;_0x19a578<_0x4ed702[_0xcc6a('0x6e')][_0xcc6a('0x4c')];_0x19a578+=0x1){_0x19a578>0x0&&(_0x20a16b+='\x20'+_0x4ed702[_0xcc6a('0x6f')]+'\x20');_0x20a16b+=_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['group']?_0x46d93b(_0x4ed702['rules'][_0x19a578]['group']):_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x70')]+'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578]['condition']+(_0x2cc561(_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x71')])?'\x20'+_0x4ed702[_0xcc6a('0x6e')][_0x19a578][_0xcc6a('0x72')]:'');}return _0x20a16b+')';};var _0x5e1c69={'where':{'id':_0x506311['params']['id']}},_0x481d25,_0xaec5e8,_0x41527b,_0x4403d3,_0x386a74;_0x5e1c69=_[_0xcc6a('0x41')]({},_0x5e1c69,_0x506311[_0xcc6a('0x4d')]);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x5e1c69)[_0xcc6a('0x29')](function(_0x55d129){if(_0x55d129){_0x481d25=_0x55d129;return _0x55d129['getFields']();}return null;})[_0xcc6a('0x29')](function(_0xd1a27b){if(_0xd1a27b){if(!_0xd1a27b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xaec5e8=_0xd1a27b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x421d0b){if(_0x421d0b){_0x41527b=_['keyBy'](_0x421d0b,'id');var _0x4a8863;var _0x58e6b4=squel[_0xcc6a('0x75')]();_0x58e6b4[_0xcc6a('0x76')](_0x481d25[_0xcc6a('0x77')]);for(var _0x729b2=0x0;_0x729b2<_0xaec5e8['length'];_0x729b2+=0x1){_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x78')]?_0x41527b[_0xaec5e8[_0x729b2][_0xcc6a('0x78')]]['metric']:_0xaec5e8[_0x729b2][_0xcc6a('0x70')];_0x4a8863=_0xaec5e8[_0x729b2]['function']?_[_0xcc6a('0x79')](_0x586789[_0xaec5e8[_0x729b2]['function']],'%s',_0x4a8863):_0x4a8863;_0x4a8863=_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x389e5f[_0xaec5e8[_0x729b2][_0xcc6a('0x7a')]],'%s',_0x4a8863):_0x4a8863;if(_0xaec5e8[_0x729b2]['groupBy']){_0x58e6b4[_0xcc6a('0x7b')](_0x4a8863);}_0xaec5e8[_0x729b2]['orderBy']&&_0x58e6b4[_0xcc6a('0x3d')](_0x4a8863,_0xaec5e8[_0x729b2]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x58e6b4[_0xcc6a('0x70')](_0x4a8863,_0xaec5e8[_0x729b2][_0xcc6a('0x7d')]||_0x4a8863);}if(_0x481d25[_0xcc6a('0x7e')]){_0x481d25[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x481d25['joins']);for(var _0x18f5dc=0x0;_0x18f5dc<_0x481d25[_0xcc6a('0x7e')][_0xcc6a('0x4c')];_0x18f5dc+=0x1){if(_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]&&_['includes'](_0x3a6b7e,_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')])&&_0x481d25['joins'][_0x18f5dc]['parentKey']&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x80')]&&_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]){_0x58e6b4[_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x34')]](_0x481d25['joins'][_0x18f5dc][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x481d25[_0xcc6a('0x77')],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x83')],_0x481d25['joins'][_0x18f5dc]['foreignTable'],_0x481d25[_0xcc6a('0x7e')][_0x18f5dc][_0xcc6a('0x81')]));}}}if(_0x481d25[_0xcc6a('0x84')]){_0x481d25[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x481d25[_0xcc6a('0x84')]);_0x58e6b4[_0xcc6a('0x3f')](_0x46d93b(_0x481d25['conditions'][_0xcc6a('0x7b')]));}_0x386a74=_0x58e6b4[_0xcc6a('0x85')]();_0x58e6b4[_0xcc6a('0x21')](_0x56d512);_0x58e6b4[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x58e6b4['toString']());return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x58e6b4[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')][_0xcc6a('0x8b')]});}})[_0xcc6a('0x29')](respondWithResult(_0x14d3ff,null))[_0xcc6a('0x48')](handleError(_0x14d3ff,null));};function runReport(_0x2a25df,_0x1f1ff7,_0x565bcd){var _0x45c45f=_0x1f1ff7[_0xcc6a('0x36')];var _0x58cd56=0xa;var _0x1848dd=[_0xcc6a('0x8c'),_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x5abd5c={'SUM':_0xcc6a('0x5e'),'COUNT':_0xcc6a('0x8d'),'COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':_0xcc6a('0x5f'),'MIN':_0xcc6a('0x60'),'AVG':_0xcc6a('0x61'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x5be65b={'SEC_TO_TIME':_0xcc6a('0x65'),'DATE':_0xcc6a('0x66'),'HOUR':_0xcc6a('0x67'),'ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x2b5c15=function(_0x3207b2){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),_0xcc6a('0x6c'),_0xcc6a('0x6d'),_0xcc6a('0x8f')],_0x3207b2);};var _0x58fdb3=function(_0xb4b2b4){if(!_0xb4b2b4||!_0xb4b2b4[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x275e15='(',_0x53b419=0x0;_0x53b419<_0xb4b2b4[_0xcc6a('0x6e')]['length'];_0x53b419+=0x1){_0x53b419>0x0&&(_0x275e15+='\x20'+_0xb4b2b4[_0xcc6a('0x6f')]+'\x20');_0x275e15+=_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]?_0x58fdb3(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x7b')]):_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x70')]+'\x20'+_0xb4b2b4['rules'][_0x53b419][_0xcc6a('0x71')]+(_0x2b5c15(_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x71')])?'\x20'+_0xb4b2b4[_0xcc6a('0x6e')][_0x53b419][_0xcc6a('0x72')]:'');}return _0x275e15+')';};var _0x4473ab={'where':{'id':_0x2a25df['id']}},_0x558e2f,_0x14a957,_0x350766,_0x589bff,_0x5661b5;_0x4473ab=_[_0xcc6a('0x41')]({},_0x4473ab,_0x565bcd);return db[_0xcc6a('0x31')][_0xcc6a('0x4e')](_0x4473ab)[_0xcc6a('0x29')](function(_0x2f0b79){if(_0x2f0b79){_0x558e2f=_0x2f0b79;return _0x2f0b79['getFields']();}return null;})[_0xcc6a('0x29')](function(_0x4a268b){if(_0x4a268b){if(!_0x4a268b[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x14a957=_0x4a268b;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x1f4c4e){if(_0x1f4c4e){_0x350766=_['keyBy'](_0x1f4c4e,'id');var _0x312431;var _0x2a850c=squel[_0xcc6a('0x75')]();_0x2a850c['from'](_0x558e2f[_0xcc6a('0x77')]);for(var _0xd5b9f3=0x0;_0xd5b9f3<_0x14a957[_0xcc6a('0x4c')];_0xd5b9f3+=0x1){_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]?_0x350766[_0x14a957[_0xd5b9f3][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x14a957[_0xd5b9f3][_0xcc6a('0x70')];_0x312431=_0x14a957[_0xd5b9f3]['function']?_[_0xcc6a('0x79')](_0x5abd5c[_0x14a957[_0xd5b9f3][_0xcc6a('0x93')]],'%s',_0x312431):_0x312431;_0x312431=_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]?_[_0xcc6a('0x79')](_0x5be65b[_0x14a957[_0xd5b9f3][_0xcc6a('0x7a')]],'%s',_0x312431):_0x312431;if(_0x14a957[_0xd5b9f3][_0xcc6a('0x94')]){_0x2a850c[_0xcc6a('0x7b')](_0x312431);}_0x14a957[_0xd5b9f3][_0xcc6a('0x95')]&&_0x2a850c['order'](_0x312431,_0x14a957[_0xd5b9f3]['orderBy']===_0xcc6a('0x7c')?![]:!![]);_0x2a850c['field'](_0x312431,_0x14a957[_0xd5b9f3][_0xcc6a('0x7d')]||_0x312431);}if(_0x558e2f[_0xcc6a('0x7e')]){_0x558e2f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x7e')]);for(var _0x1f7ee5=0x0;_0x1f7ee5<_0x558e2f[_0xcc6a('0x7e')]['length'];_0x1f7ee5+=0x1){if(_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type']&&_['includes'](_0x1848dd,_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['type'])&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')]&&_0x558e2f['joins'][_0x1f7ee5]['foreignTable']&&_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5]['foreignKey']){_0x2a850c[_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x34')]](_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x558e2f['table'],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x83')],_0x558e2f[_0xcc6a('0x7e')][_0x1f7ee5][_0xcc6a('0x80')],_0x558e2f['joins'][_0x1f7ee5][_0xcc6a('0x81')]));}}}if(_0x558e2f[_0xcc6a('0x84')]){_0x558e2f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x558e2f[_0xcc6a('0x84')]);_0x2a850c[_0xcc6a('0x3f')](_0x58fdb3(_0x558e2f[_0xcc6a('0x84')]['group']));}_0x5661b5=_0x2a850c[_0xcc6a('0x85')]();_0x2a850c[_0xcc6a('0x21')](_0x58cd56);_0x2a850c['offset'](0x0);return;}})[_0xcc6a('0x29')](function(){if(_0x1f1ff7[_0xcc6a('0x96')]===_0xcc6a('0x97')){return null;}var _0x2297ea=_[_0xcc6a('0x41')](_0x1f1ff7,{'name':_0x1f1ff7[_0xcc6a('0x98')]||_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],'basename':_0x45c45f,'savename':util[_0xcc6a('0x7a')](_0xcc6a('0x99'),_0x1f1ff7[_0xcc6a('0x36')]||_0x558e2f[_0xcc6a('0x36')],require(_0xcc6a('0x9a'))[_0xcc6a('0x9b')](0x4),_0x1f1ff7['output']||'csv'),'reportId':_0x558e2f['id'],'reportType':_0xcc6a('0x9c')});return db[_0xcc6a('0x9d')]['create'](_0x2297ea,{'raw':!![]});})[_0xcc6a('0x29')](function(_0x1e74a4){if(_0x558e2f[_0xcc6a('0x77')]==='cdr'){_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0x9e'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7['endDate']);}else{_0x5661b5[_0xcc6a('0x3f')](_0x558e2f['table']+_0xcc6a('0xa0'),_0x1f1ff7[_0xcc6a('0x9f')],_0x1f1ff7[_0xcc6a('0xa1')]);}if(_0x1e74a4){logger[_0xcc6a('0xa2')](_0xcc6a('0xa3'),_0x5661b5[_0xcc6a('0x89')]());require('child_process')['fork'](path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa4'),_0x1e74a4[_0xcc6a('0x96')]),[_0x1e74a4['id'],_0x5661b5['toString'](),path[_0xcc6a('0x8c')](__dirname,_0xcc6a('0xa5'),_0x1e74a4[_0xcc6a('0xa6')]),_0x45c45f]);return _0x1e74a4;}else{var _0x3b7b43=squel['select']();_0x3b7b43[_0xcc6a('0x76')]('('+_0x5661b5[_0xcc6a('0x89')]()+')',_0xcc6a('0xa7'));_0x3b7b43['field'](_0xcc6a('0xa8'),'count');_0x5661b5[_0xcc6a('0x21')](_0x1f1ff7[_0xcc6a('0x21')]||_0x58cd56);_0x5661b5['offset'](_0x1f1ff7[_0xcc6a('0x1f')]||0x0);return dbH[_0xcc6a('0x88')][_0xcc6a('0x37')](_0x3b7b43[_0xcc6a('0x89')](),{'type':dbH[_0xcc6a('0x88')][_0xcc6a('0x8a')][_0xcc6a('0x8b')]})[_0xcc6a('0x29')](function(_0x25ba57){if(!_0x25ba57[_0xcc6a('0x4c')]){_0x589bff=0x0;}else{_0x589bff=_0x25ba57[0x0][_0xcc6a('0x22')]||0x0;}return dbH['sequelize']['query'](_0x5661b5[_0xcc6a('0x89')](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});})['then'](function(_0x32ced0){return{'rows':_0x32ced0||[],'count':_0x589bff};});}});}exports[_0xcc6a('0xa9')]=function(_0xc638ae,_0x3367e8){return runReport(_0xc638ae['params'],_0xc638ae[_0xcc6a('0x37')],_0xc638ae['options'])['then'](respondWithResult(_0x3367e8,null))[_0xcc6a('0x48')](handleError(_0x3367e8,null));};exports[_0xcc6a('0xaa')]=runReport;exports[_0xcc6a('0x37')]=function(_0x38d805,_0x3f5f97){var _0x399eb6=0xa;var _0x2ae391=['join',_0xcc6a('0x5b'),_0xcc6a('0x5c'),_0xcc6a('0x5d')];var _0x50b948={'SUM':_0xcc6a('0x5e'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcc6a('0x8e'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcc6a('0x61'),'GROUP_CONCAT':_0xcc6a('0x62'),'GROUP_CONCAT ASC':_0xcc6a('0x63'),'GROUP_CONCAT DESC':_0xcc6a('0x64')};var _0x1d2ae0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':_0xcc6a('0x68'),'UNIX_TIMESTAMP':_0xcc6a('0x69')};var _0x41d17b=function(_0x1827e6){return!_[_0xcc6a('0x6a')]([_0xcc6a('0x6b'),'IS\x20NOT\x20NULL',_0xcc6a('0x6d'),'IS\x20NOT\x20EMPTY'],_0x1827e6);};var _0xa70fa=function(_0x33ec76){if(!_0x33ec76||!_0x33ec76[_0xcc6a('0x6e')][_0xcc6a('0x4c')]){return'';}for(var _0x30162c='(',_0x48746a=0x0;_0x48746a<_0x33ec76['rules'][_0xcc6a('0x4c')];_0x48746a+=0x1){_0x48746a>0x0&&(_0x30162c+='\x20'+_0x33ec76[_0xcc6a('0x6f')]+'\x20');_0x30162c+=_0x33ec76['rules'][_0x48746a][_0xcc6a('0x7b')]?_0xa70fa(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x7b')]):_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x70')]+'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['condition']+(_0x41d17b(_0x33ec76[_0xcc6a('0x6e')][_0x48746a][_0xcc6a('0x71')])?'\x20'+_0x33ec76[_0xcc6a('0x6e')][_0x48746a]['value']:'');}return _0x30162c+')';};var _0x54f0e4={'where':{'id':_0x38d805[_0xcc6a('0x4a')]['id']}},_0x559f4f,_0x545b15,_0x17a4e1,_0x5a7da7,_0x434c8b;_0x54f0e4=_['merge']({},_0x54f0e4,_0x38d805[_0xcc6a('0x4d')]);return db['AnalyticDefaultReport'][_0xcc6a('0x4e')](_0x54f0e4)[_0xcc6a('0x29')](function(_0xe9231f){if(_0xe9231f){_0x559f4f=_0xe9231f;return _0xe9231f[_0xcc6a('0xab')]();}return null;})[_0xcc6a('0x29')](function(_0x197961){if(_0x197961){if(!_0x197961[_0xcc6a('0x4c')]){throw new db[(_0xcc6a('0x73'))][(_0xcc6a('0x90'))](_0xcc6a('0x91'),0x193);}_0x545b15=_0x197961;return db[_0xcc6a('0x74')][_0xcc6a('0x46')]({'raw':!![]});}return null;})[_0xcc6a('0x29')](function(_0x171a2a){if(_0x171a2a){_0x17a4e1=_[_0xcc6a('0xac')](_0x171a2a,'id');var _0x13860b;var _0x3b52f7=squel[_0xcc6a('0x75')]();_0x3b52f7[_0xcc6a('0x76')](_0x559f4f[_0xcc6a('0x77')]);for(var _0x319f4a=0x0;_0x319f4a<_0x545b15[_0xcc6a('0x4c')];_0x319f4a+=0x1){_0x13860b=_0x545b15[_0x319f4a]['MetricId']?_0x17a4e1[_0x545b15[_0x319f4a][_0xcc6a('0x78')]][_0xcc6a('0x92')]:_0x545b15[_0x319f4a][_0xcc6a('0x70')];_0x13860b=_0x545b15[_0x319f4a]['function']?_[_0xcc6a('0x79')](_0x50b948[_0x545b15[_0x319f4a][_0xcc6a('0x93')]],'%s',_0x13860b):_0x13860b;_0x13860b=_0x545b15[_0x319f4a]['format']?_[_0xcc6a('0x79')](_0x1d2ae0[_0x545b15[_0x319f4a][_0xcc6a('0x7a')]],'%s',_0x13860b):_0x13860b;if(_0x545b15[_0x319f4a]['groupBy']){_0x3b52f7[_0xcc6a('0x7b')](_0x13860b);}_0x545b15[_0x319f4a][_0xcc6a('0x95')]&&_0x3b52f7[_0xcc6a('0x3d')](_0x13860b,_0x545b15[_0x319f4a][_0xcc6a('0x95')]===_0xcc6a('0x7c')?![]:!![]);_0x3b52f7[_0xcc6a('0x70')](_0x13860b,_0x545b15[_0x319f4a]['alias']||_0x13860b);}if(_0x559f4f['joins']){_0x559f4f[_0xcc6a('0x7e')]=JSON[_0xcc6a('0x7f')](_0x559f4f['joins']);for(var _0x154885=0x0;_0x154885<_0x559f4f['joins'][_0xcc6a('0x4c')];_0x154885+=0x1){if(_0x559f4f['joins'][_0x154885][_0xcc6a('0x34')]&&_[_0xcc6a('0x6a')](_0x2ae391,_0x559f4f[_0xcc6a('0x7e')][_0x154885]['type'])&&_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')]&&_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignTable']&&_0x559f4f['joins'][_0x154885]['foreignKey']){_0x3b52f7[_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x34')]](_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],null,util[_0xcc6a('0x7a')](_0xcc6a('0x82'),_0x559f4f[_0xcc6a('0x77')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x83')],_0x559f4f[_0xcc6a('0x7e')][_0x154885][_0xcc6a('0x80')],_0x559f4f[_0xcc6a('0x7e')][_0x154885]['foreignKey']));}}}if(_0x559f4f[_0xcc6a('0x84')]){_0x559f4f[_0xcc6a('0x84')]=JSON[_0xcc6a('0x7f')](_0x559f4f['conditions']);_0x3b52f7[_0xcc6a('0x3f')](_0xa70fa(_0x559f4f[_0xcc6a('0x84')][_0xcc6a('0x7b')]));}_0x434c8b=_0x3b52f7['clone']();_0x3b52f7[_0xcc6a('0x21')](_0x399eb6);_0x3b52f7[_0xcc6a('0x1f')](0x0);logger[_0xcc6a('0x86')](_0xcc6a('0x87'),_0x3b52f7['toString']());return dbH[_0xcc6a('0x88')]['query'](_0x3b52f7['toString'](),{'type':dbH['sequelize'][_0xcc6a('0x8a')]['SELECT']});}})['then'](function(){return{'sql':_0x434c8b[_0xcc6a('0x89')]()};})[_0xcc6a('0x29')](respondWithResult(_0x3f5f97,null))[_0xcc6a('0x48')](handleError(_0x3f5f97,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 2b9dfd8..25a374a 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 _0xda86=['rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','util','moment','bluebird','request-promise','path'];(function(_0x4b1e96,_0x4af1ad){var _0x50616d=function(_0x3087f7){while(--_0x3087f7){_0x4b1e96['push'](_0x4b1e96['shift']());}};_0x50616d(++_0x4af1ad);}(_0xda86,0xb6));var _0x6da8=function(_0x201859,_0x52f6e7){_0x201859=_0x201859-0x0;var _0x23896b=_0xda86[_0x201859];return _0x23896b;};'use strict';var _=require('lodash');var util=require(_0x6da8('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x6da8('0x1'));var BPromise=require(_0x6da8('0x2'));var rp=require(_0x6da8('0x3'));var fs=require('fs');var path=require(_0x6da8('0x4'));var rimraf=require(_0x6da8('0x5'));var config=require(_0x6da8('0x6'));var attributes=require(_0x6da8('0x7'));module[_0x6da8('0x8')]=function(_0x175f35,_0x581e34){return _0x175f35[_0x6da8('0x9')](_0x6da8('0xa'),attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5f27=['exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0xe1269d,_0x57b7c3){var _0x261ca1=function(_0x13b234){while(--_0x13b234){_0xe1269d['push'](_0xe1269d['shift']());}};_0x261ca1(++_0x57b7c3);}(_0x5f27,0xad));var _0x75f2=function(_0x2610db,_0x1ff983){_0x2610db=_0x2610db-0x0;var _0x5dd7bb=_0x5f27[_0x2610db];return _0x5dd7bb;};'use strict';var _=require(_0x75f2('0x0'));var util=require(_0x75f2('0x1'));var logger=require(_0x75f2('0x2'))(_0x75f2('0x3'));var moment=require(_0x75f2('0x4'));var BPromise=require('bluebird');var rp=require(_0x75f2('0x5'));var fs=require('fs');var path=require(_0x75f2('0x6'));var rimraf=require(_0x75f2('0x7'));var config=require(_0x75f2('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x75f2('0x9')]=function(_0x3c48a5,_0xecde1c){return _0x3c48a5[_0x75f2('0xa')](_0x75f2('0xb'),attributes,{'tableName':_0x75f2('0xc'),'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 65c57c8..4216eae 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 _0x1d45=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x41b4dc,_0x2967f9){var _0x39caa7=function(_0x4af918){while(--_0x4af918){_0x41b4dc['push'](_0x41b4dc['shift']());}};_0x39caa7(++_0x2967f9);}(_0x1d45,0x166));var _0x51d4=function(_0xef8146,_0x459c34){_0xef8146=_0xef8146-0x0;var _0x5a6cb0=_0x1d45[_0xef8146];return _0x5a6cb0;};'use strict';var _=require(_0x51d4('0x0'));var util=require('util');var moment=require(_0x51d4('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x51d4('0x2'));var db=require(_0x51d4('0x3'))['db'];var utils=require(_0x51d4('0x4'));var logger=require('../../config/logger')(_0x51d4('0x5'));var config=require(_0x51d4('0x6'));var jayson=require(_0x51d4('0x7'));var client=jayson[_0x51d4('0x8')][_0x51d4('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x56dfc,_0x73c8dc,_0x4c8775){return new BPromise(function(_0x566505,_0x2c6ea1){return client[_0x51d4('0xa')](_0x56dfc,_0x4c8775)[_0x51d4('0xb')](function(_0x14d0b4){logger[_0x51d4('0xc')](_0x51d4('0xd'),_0x73c8dc,_0x51d4('0xe'));logger[_0x51d4('0xf')](_0x51d4('0x10'),_0x73c8dc,_0x51d4('0xe'),JSON[_0x51d4('0x11')](_0x14d0b4));if(_0x14d0b4['error']){if(_0x14d0b4[_0x51d4('0x12')][_0x51d4('0x13')]===0x1f4){logger['error'](_0x51d4('0xd'),_0x73c8dc,_0x14d0b4[_0x51d4('0x12')][_0x51d4('0x14')]);return _0x2c6ea1(_0x14d0b4[_0x51d4('0x12')][_0x51d4('0x14')]);}logger[_0x51d4('0x12')](_0x51d4('0xd'),_0x73c8dc,_0x14d0b4[_0x51d4('0x12')][_0x51d4('0x14')]);return _0x566505(_0x14d0b4[_0x51d4('0x12')][_0x51d4('0x14')]);}else{logger[_0x51d4('0xc')](_0x51d4('0xd'),_0x73c8dc,_0x51d4('0xe'));_0x566505(_0x14d0b4[_0x51d4('0x15')][_0x51d4('0x14')]);}})[_0x51d4('0x16')](function(_0x26821a){logger[_0x51d4('0x12')](_0x51d4('0xd'),_0x73c8dc,_0x26821a);_0x2c6ea1(_0x26821a);});});}
\ No newline at end of file
+var _0x9438=['catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9438,0x112));var _0x8943=function(_0x574f89,_0x1d75f4){_0x574f89=_0x574f89-0x0;var _0x35aaf3=_0x9438[_0x574f89];return _0x35aaf3;};'use strict';var _=require(_0x8943('0x0'));var util=require('util');var moment=require(_0x8943('0x1'));var BPromise=require(_0x8943('0x2'));var rs=require(_0x8943('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8943('0x4'))['db'];var utils=require(_0x8943('0x5'));var logger=require(_0x8943('0x6'))(_0x8943('0x7'));var config=require(_0x8943('0x8'));var jayson=require(_0x8943('0x9'));var client=jayson[_0x8943('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x343639,_0x42e5b1,_0x1b12d3){return new BPromise(function(_0x295606,_0x338b5b){return client['request'](_0x343639,_0x1b12d3)[_0x8943('0xb')](function(_0x52837d){logger['info'](_0x8943('0xc'),_0x42e5b1,_0x8943('0xd'));logger[_0x8943('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x42e5b1,_0x8943('0xd'),JSON['stringify'](_0x52837d));if(_0x52837d[_0x8943('0xf')]){if(_0x52837d[_0x8943('0xf')][_0x8943('0x10')]===0x1f4){logger[_0x8943('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x42e5b1,_0x52837d[_0x8943('0xf')][_0x8943('0x11')]);return _0x338b5b(_0x52837d['error'][_0x8943('0x11')]);}logger[_0x8943('0xf')](_0x8943('0xc'),_0x42e5b1,_0x52837d[_0x8943('0xf')]['message']);return _0x295606(_0x52837d['error'][_0x8943('0x11')]);}else{logger[_0x8943('0x12')](_0x8943('0xc'),_0x42e5b1,_0x8943('0xd'));_0x295606(_0x52837d[_0x8943('0x13')][_0x8943('0x11')]);}})[_0x8943('0x14')](function(_0x17d42c){logger[_0x8943('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x42e5b1,_0x17d42c);_0x338b5b(_0x17d42c);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 857a76b..be9f761 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 _0xcec9=['/:id/query','query','post','create','put','update','delete','destroy','path','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','run'];(function(_0x18ac58,_0x567d3a){var _0x31406f=function(_0x34564b){while(--_0x34564b){_0x18ac58['push'](_0x18ac58['shift']());}};_0x31406f(++_0x567d3a);}(_0xcec9,0x7b));var _0x9cec=function(_0x2ecaeb,_0x14a35d){_0x2ecaeb=_0x2ecaeb-0x0;var _0x1f3e62=_0xcec9[_0x2ecaeb];return _0x1f3e62;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9cec('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9cec('0x1')]();var fs_extra=require(_0x9cec('0x2'));var auth=require(_0x9cec('0x3'));var interaction=require(_0x9cec('0x4'));var config=require(_0x9cec('0x5'));var controller=require(_0x9cec('0x6'));router[_0x9cec('0x7')]('/',auth[_0x9cec('0x8')](),controller[_0x9cec('0x9')]);router[_0x9cec('0x7')](_0x9cec('0xa'),auth[_0x9cec('0x8')](),controller[_0x9cec('0xb')]);router[_0x9cec('0x7')](_0x9cec('0xc'),auth['isAuthenticated'](),controller['preview']);router['get'](_0x9cec('0xd'),auth[_0x9cec('0x8')](),controller[_0x9cec('0xe')]);router[_0x9cec('0x7')](_0x9cec('0xf'),auth['isAuthenticated'](),controller[_0x9cec('0x10')]);router[_0x9cec('0x11')]('/',auth[_0x9cec('0x8')](),controller[_0x9cec('0x12')]);router[_0x9cec('0x13')](_0x9cec('0xa'),auth[_0x9cec('0x8')](),controller[_0x9cec('0x14')]);router[_0x9cec('0x15')](_0x9cec('0xa'),auth[_0x9cec('0x8')](),controller[_0x9cec('0x16')]);module['exports']=router;
\ No newline at end of file
+var _0x2630=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','/:id','show','get','/:id/preview','preview','/:id/run','run','/:id/query','query','post','put','delete','destroy','exports','multer','util','path','Router'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x2630,0x79));var _0x0263=function(_0x2e8373,_0x49c02c){_0x2e8373=_0x2e8373-0x0;var _0x3cafdb=_0x2630[_0x2e8373];return _0x3cafdb;};'use strict';var multer=require(_0x0263('0x0'));var util=require(_0x0263('0x1'));var path=require(_0x0263('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0263('0x3')]();var fs_extra=require(_0x0263('0x4'));var auth=require(_0x0263('0x5'));var interaction=require(_0x0263('0x6'));var config=require(_0x0263('0x7'));var controller=require(_0x0263('0x8'));router['get']('/',auth[_0x0263('0x9')](),controller[_0x0263('0xa')]);router['get'](_0x0263('0xb'),auth[_0x0263('0x9')](),controller[_0x0263('0xc')]);router[_0x0263('0xd')](_0x0263('0xe'),auth['isAuthenticated'](),controller[_0x0263('0xf')]);router[_0x0263('0xd')](_0x0263('0x10'),auth[_0x0263('0x9')](),controller[_0x0263('0x11')]);router['get'](_0x0263('0x12'),auth['isAuthenticated'](),controller[_0x0263('0x13')]);router[_0x0263('0x14')]('/',auth[_0x0263('0x9')](),controller['create']);router[_0x0263('0x15')]('/:id',auth[_0x0263('0x9')](),controller['update']);router[_0x0263('0x16')](_0x0263('0xb'),auth[_0x0263('0x9')](),controller[_0x0263('0x17')]);module[_0x0263('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js
index 8b8a9ae..7353dff 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 _0x6af3=['scheduled','exports','STRING','ENUM','csv','pdf','DATE','manual'];(function(_0x27a60d,_0x5e5917){var _0x53b6f1=function(_0xb75da0){while(--_0xb75da0){_0x27a60d['push'](_0x27a60d['shift']());}};_0x53b6f1(++_0x5e5917);}(_0x6af3,0x1e9));var _0x36af=function(_0x2014d0,_0x42bb9d){_0x2014d0=_0x2014d0-0x0;var _0xa02e35=_0x6af3[_0x2014d0];return _0xa02e35;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x36af('0x0')]={'name':{'type':Sequelize[_0x36af('0x1')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x36af('0x2')](_0x36af('0x3'),_0x36af('0x4'),'xlsx'),'allowNull':![],'defaultValue':_0x36af('0x3')},'savename':{'type':Sequelize[_0x36af('0x1')],'allowNull':![]},'startDate':{'type':Sequelize[_0x36af('0x5')]},'endDate':{'type':Sequelize[_0x36af('0x5')]},'status':{'type':Sequelize[_0x36af('0x1')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x36af('0x2')](_0x36af('0x6'),_0x36af('0x7')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize['INTEGER'](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x36af('0x1')]}};
\ No newline at end of file
+var _0x6115=['DATE','Loading','manual','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf','xlsx','csv'];(function(_0x1cfba6,_0x35adc8){var _0x4697d3=function(_0x34cacb){while(--_0x34cacb){_0x1cfba6['push'](_0x1cfba6['shift']());}};_0x4697d3(++_0x35adc8);}(_0x6115,0xad));var _0x5611=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x6115[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x5611('0x0'));var moment=require(_0x5611('0x1'));module['exports']={'name':{'type':Sequelize[_0x5611('0x2')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x5611('0x3')]('csv',_0x5611('0x4'),_0x5611('0x5')),'allowNull':![],'defaultValue':_0x5611('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0x5611('0x7')]},'status':{'type':Sequelize[_0x5611('0x2')],'defaultValue':_0x5611('0x8')},'type':{'type':Sequelize[_0x5611('0x3')](_0x5611('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x5611('0x9')},'reportId':{'type':Sequelize[_0x5611('0xa')](0xb)[_0x5611('0xb')]},'reportType':{'type':Sequelize[_0x5611('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 305a1af..deb245b 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 _0xdff7=['reject','save','update','destroy','then','get','ExtractedReports','sendStatus','error','name','send','map','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','AnalyticExtractedReport','findAll','rows','catch','show','params','includeAll','find','create','body','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','download','basename','output','existsSync','join','root','server/files/reports','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','format','%s.%s','toLowerCase','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xdff7,0x15f));var _0x7dff=function(_0x2affbe,_0x1114b2){_0x2affbe=_0x2affbe-0x0;var _0x111955=_0xdff7[_0x2affbe];return _0x111955;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x7dff('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7dff('0x1'));var rp=require('request-promise');var moment=require(_0x7dff('0x2'));var BPromise=require(_0x7dff('0x3'));var Mustache=require(_0x7dff('0x4'));var util=require(_0x7dff('0x5'));var path=require(_0x7dff('0x6'));var sox=require(_0x7dff('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7dff('0x8'));var _=require(_0x7dff('0x9'));var squel=require(_0x7dff('0xa'));var crypto=require(_0x7dff('0xb'));var jsforce=require(_0x7dff('0xc'));var deskjs=require(_0x7dff('0xd'));var toCsv=require(_0x7dff('0xe'));var querystring=require('querystring');var Papa=require(_0x7dff('0xf'));var Redis=require(_0x7dff('0x10'));var authService=require(_0x7dff('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7dff('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7dff('0x13'));var utils=require(_0x7dff('0x14'));var config=require(_0x7dff('0x15'));var licenseUtil=require(_0x7dff('0x16'));var db=require(_0x7dff('0x17'))['db'];function respondWithStatusCode(_0x2a21de,_0x269320){_0x269320=_0x269320||0xcc;return function(_0x260e81){if(_0x260e81){return _0x2a21de['sendStatus'](_0x269320);}return _0x2a21de[_0x7dff('0x18')](_0x269320)[_0x7dff('0x19')]();};}function respondWithResult(_0x558042,_0x10ff77){_0x10ff77=_0x10ff77||0xc8;return function(_0x47a0af){if(_0x47a0af){return _0x558042['status'](_0x10ff77)['json'](_0x47a0af);}};}function respondWithFilteredResult(_0xf15d23,_0x23c953){return function(_0x272ff8){if(_0x272ff8){var _0xf54b07=typeof _0x23c953[_0x7dff('0x1a')]===_0x7dff('0x1b')&&typeof _0x23c953[_0x7dff('0x1c')]===_0x7dff('0x1b');var _0x2b403d=_0x272ff8[_0x7dff('0x1d')];var _0x10ec4c=_0xf54b07?0x0:_0x23c953['offset'];var _0x4c719c=_0xf54b07?_0x272ff8[_0x7dff('0x1d')]:_0x23c953[_0x7dff('0x1a')]+_0x23c953[_0x7dff('0x1c')];var _0x44524d;if(_0x4c719c>=_0x2b403d){_0x4c719c=_0x2b403d;_0x44524d=0xc8;}else{_0x44524d=0xce;}_0xf15d23[_0x7dff('0x18')](_0x44524d);return _0xf15d23[_0x7dff('0x1e')](_0x7dff('0x1f'),_0x10ec4c+'-'+_0x4c719c+'/'+_0x2b403d)['json'](_0x272ff8);}return null;};}function patchUpdates(_0x427ed3){return function(_0x525427){try{jsonpatch[_0x7dff('0x20')](_0x525427,_0x427ed3,!![]);}catch(_0x2dddcc){return BPromise[_0x7dff('0x21')](_0x2dddcc);}return _0x525427[_0x7dff('0x22')]();};}function saveUpdates(_0x35b9f1,_0xa5917b){return function(_0xdb9ac5){if(_0xdb9ac5){return _0xdb9ac5[_0x7dff('0x23')](_0x35b9f1)['then'](function(_0x54c9ec){return _0x54c9ec;});}return null;};}function removeEntity(_0x5d600a,_0x3634d2){return function(_0x3e2f84){if(_0x3e2f84){return _0x3e2f84[_0x7dff('0x24')]()[_0x7dff('0x25')](function(){var _0x432dd8=_0x3e2f84[_0x7dff('0x26')]({'plain':!![]});var _0x13954e=_0x7dff('0x27');return db['UserProfileResource'][_0x7dff('0x24')]({'where':{'type':_0x13954e,'resourceId':_0x432dd8['id']}})[_0x7dff('0x25')](function(){return _0x3e2f84;});})['then'](function(){_0x5d600a[_0x7dff('0x18')](0xcc)[_0x7dff('0x19')]();});}};}function handleEntityNotFound(_0x443faf,_0x18ec1e){return function(_0x1c6311){if(!_0x1c6311){_0x443faf[_0x7dff('0x28')](0x194);}return _0x1c6311;};}function handleError(_0x52c88c,_0x302b0a){_0x302b0a=_0x302b0a||0x1f4;return function(_0x57328f){logger[_0x7dff('0x29')](_0x57328f['stack']);if(_0x57328f[_0x7dff('0x2a')]){delete _0x57328f[_0x7dff('0x2a')];}_0x52c88c[_0x7dff('0x18')](_0x302b0a)[_0x7dff('0x2b')](_0x57328f);};}exports['index']=function(_0x522c0d,_0x2f1bfe){var _0x132871={},_0x50f295={},_0x2fd604={'count':0x0,'rows':[]};var _0xd296c6=_[_0x7dff('0x2c')](db['AnalyticExtractedReport'][_0x7dff('0x2d')],function(_0x340997){return{'name':_0x340997['fieldName'],'type':_0x340997['type'][_0x7dff('0x2e')]};});_0x50f295['model']=_['map'](_0xd296c6,_0x7dff('0x2a'));_0x50f295[_0x7dff('0x2f')]=_[_0x7dff('0x30')](_0x522c0d[_0x7dff('0x2f')]);_0x50f295[_0x7dff('0x31')]=_[_0x7dff('0x32')](_0x50f295['model'],_0x50f295[_0x7dff('0x2f')]);_0x132871[_0x7dff('0x33')]=_[_0x7dff('0x32')](_0x50f295[_0x7dff('0x34')],qs[_0x7dff('0x35')](_0x522c0d['query'][_0x7dff('0x35')]));_0x132871['attributes']=_0x132871['attributes'][_0x7dff('0x36')]?_0x132871[_0x7dff('0x33')]:_0x50f295[_0x7dff('0x34')];if(!_0x522c0d[_0x7dff('0x2f')][_0x7dff('0x37')](_0x7dff('0x38'))){_0x132871['limit']=qs['limit'](_0x522c0d[_0x7dff('0x2f')][_0x7dff('0x1c')]);_0x132871[_0x7dff('0x1a')]=qs[_0x7dff('0x1a')](_0x522c0d[_0x7dff('0x2f')][_0x7dff('0x1a')]);}_0x132871[_0x7dff('0x39')]=qs[_0x7dff('0x3a')](_0x522c0d[_0x7dff('0x2f')]['sort']);_0x132871[_0x7dff('0x3b')]=qs[_0x7dff('0x31')](_[_0x7dff('0x3c')](_0x522c0d['query'],_0x50f295[_0x7dff('0x31')]),_0xd296c6);if(_0x522c0d['query'][_0x7dff('0x3d')]){_0x132871[_0x7dff('0x3b')]=_[_0x7dff('0x3e')](_0x132871['where'],{'$or':_[_0x7dff('0x2c')](_0xd296c6,function(_0x14255b){if(_0x14255b['type']!==_0x7dff('0x3f')){var _0x31fbc8={};_0x31fbc8[_0x14255b[_0x7dff('0x2a')]]={'$like':'%'+_0x522c0d[_0x7dff('0x2f')][_0x7dff('0x3d')]+'%'};return _0x31fbc8;}})});}_0x132871=_[_0x7dff('0x3e')]({},_0x132871,_0x522c0d[_0x7dff('0x40')]);var _0x59376d={'where':_0x132871[_0x7dff('0x3b')]};return db['AnalyticExtractedReport'][_0x7dff('0x1d')](_0x59376d)[_0x7dff('0x25')](function(_0x1752a8){_0x2fd604[_0x7dff('0x1d')]=_0x1752a8;if(_0x522c0d[_0x7dff('0x2f')]['includeAll']){_0x132871[_0x7dff('0x41')]=[{'all':!![]}];}return db[_0x7dff('0x42')][_0x7dff('0x43')](_0x132871);})[_0x7dff('0x25')](function(_0x250ac7){_0x2fd604[_0x7dff('0x44')]=_0x250ac7;return _0x2fd604;})[_0x7dff('0x25')](respondWithFilteredResult(_0x2f1bfe,_0x132871))[_0x7dff('0x45')](handleError(_0x2f1bfe,null));};exports[_0x7dff('0x46')]=function(_0x55a415,_0x531da){var _0x147f8f={'raw':!![],'where':{'id':_0x55a415[_0x7dff('0x47')]['id']}},_0x972d0={};_0x972d0['model']=_[_0x7dff('0x30')](db['AnalyticExtractedReport'][_0x7dff('0x2d')]);_0x972d0[_0x7dff('0x2f')]=_['keys'](_0x55a415[_0x7dff('0x2f')]);_0x972d0[_0x7dff('0x31')]=_['intersection'](_0x972d0['model'],_0x972d0[_0x7dff('0x2f')]);_0x147f8f[_0x7dff('0x33')]=_['intersection'](_0x972d0['model'],qs[_0x7dff('0x35')](_0x55a415[_0x7dff('0x2f')][_0x7dff('0x35')]));_0x147f8f[_0x7dff('0x33')]=_0x147f8f[_0x7dff('0x33')][_0x7dff('0x36')]?_0x147f8f['attributes']:_0x972d0[_0x7dff('0x34')];if(_0x55a415['query'][_0x7dff('0x48')]){_0x147f8f[_0x7dff('0x41')]=[{'all':!![]}];}_0x147f8f=_[_0x7dff('0x3e')]({},_0x147f8f,_0x55a415['options']);return db[_0x7dff('0x42')][_0x7dff('0x49')](_0x147f8f)[_0x7dff('0x25')](handleEntityNotFound(_0x531da,null))[_0x7dff('0x25')](respondWithResult(_0x531da,null))[_0x7dff('0x45')](handleError(_0x531da,null));};exports[_0x7dff('0x4a')]=function(_0x366fe2,_0x1d16d2){return db[_0x7dff('0x42')][_0x7dff('0x4a')](_0x366fe2[_0x7dff('0x4b')],{})[_0x7dff('0x25')](function(_0xfd8ac9){var _0x22af80=_0x366fe2[_0x7dff('0x4c')][_0x7dff('0x26')]({'plain':!![]});if(!_0x22af80)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x22af80[_0x7dff('0x4d')]==='user'){var _0x69a3a4=_0xfd8ac9[_0x7dff('0x26')]({'plain':!![]});var _0x3e1bb7='ExtractedReports';return db['UserProfileSection'][_0x7dff('0x49')]({'where':{'name':_0x3e1bb7,'userProfileId':_0x22af80[_0x7dff('0x4e')]},'raw':!![]})[_0x7dff('0x25')](function(_0x5528bf){if(_0x5528bf&&_0x5528bf[_0x7dff('0x4f')]===0x0){return db[_0x7dff('0x50')]['create']({'name':_0x69a3a4['name'],'resourceId':_0x69a3a4['id'],'type':_0x5528bf['name'],'sectionId':_0x5528bf['id']},{})[_0x7dff('0x25')](function(){return _0xfd8ac9;});}else{return _0xfd8ac9;}})[_0x7dff('0x45')](function(_0x1b0e8f){logger[_0x7dff('0x29')](_0x7dff('0x51'),_0x1b0e8f);throw _0x1b0e8f;});}return _0xfd8ac9;})['then'](respondWithResult(_0x1d16d2,0xc9))['catch'](handleError(_0x1d16d2,null));};exports['update']=function(_0x151f58,_0x2164c0){if(_0x151f58[_0x7dff('0x4b')]['id']){delete _0x151f58[_0x7dff('0x4b')]['id'];}return db[_0x7dff('0x42')][_0x7dff('0x49')]({'where':{'id':_0x151f58[_0x7dff('0x47')]['id']}})[_0x7dff('0x25')](handleEntityNotFound(_0x2164c0,null))[_0x7dff('0x25')](saveUpdates(_0x151f58[_0x7dff('0x4b')],null))[_0x7dff('0x25')](respondWithResult(_0x2164c0,null))['catch'](handleError(_0x2164c0,null));};exports[_0x7dff('0x24')]=function(_0x395643,_0x541e7e){return db['AnalyticExtractedReport'][_0x7dff('0x49')]({'where':{'id':_0x395643['params']['id']}})[_0x7dff('0x25')](handleEntityNotFound(_0x541e7e,null))[_0x7dff('0x25')](removeEntity(_0x541e7e,null))[_0x7dff('0x45')](handleError(_0x541e7e,null));};exports[_0x7dff('0x52')]=function(_0x3fae8b,_0x49bbf5,_0xc129d9){return db['AnalyticExtractedReport']['find']({'where':{'id':_0x3fae8b[_0x7dff('0x47')]['id']},'attributes':[_0x7dff('0x2a'),_0x7dff('0x53'),'savename',_0x7dff('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x49bbf5,null))['then'](function(_0x1b133c){if(_0x1b133c){if(!fs[_0x7dff('0x55')](path[_0x7dff('0x56')](config[_0x7dff('0x57')],_0x7dff('0x58'),_0x1b133c[_0x7dff('0x59')]))){throw new db[(_0x7dff('0x5a'))][(_0x7dff('0x5b'))](_0x7dff('0x5c'));}if(_0x3fae8b[_0x7dff('0x2f')]['exists']){return _0x49bbf5[_0x7dff('0x28')](0xc8);}return _0x49bbf5[_0x7dff('0x52')](path[_0x7dff('0x56')](config[_0x7dff('0x57')],_0x7dff('0x58'),_0x1b133c[_0x7dff('0x59')]),util[_0x7dff('0x5d')](_0x7dff('0x5e'),_0x1b133c['basename']||_0x1b133c[_0x7dff('0x2a')],_0x1b133c[_0x7dff('0x54')][_0x7dff('0x5f')]()));}})['catch'](handleError(_0x49bbf5,null));};
\ No newline at end of file
+var _0xab61=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','ExtractedReports','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','existsSync','root','server/files/reports','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','format','output','toLowerCase','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','update','destroy','then','get','UserProfileResource','error','stack','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','order','sort','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','keys','find','create','body'];(function(_0x38cd76,_0x4f59c1){var _0x98b362=function(_0x8b6c4){while(--_0x8b6c4){_0x38cd76['push'](_0x38cd76['shift']());}};_0x98b362(++_0x4f59c1);}(_0xab61,0xd4));var _0x1ab6=function(_0x1f9115,_0x33a742){_0x1f9115=_0x1f9115-0x0;var _0x533c79=_0xab61[_0x1f9115];return _0x533c79;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1ab6('0x0'));var zipdir=require(_0x1ab6('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1ab6('0x2'));var moment=require(_0x1ab6('0x3'));var BPromise=require(_0x1ab6('0x4'));var Mustache=require(_0x1ab6('0x5'));var util=require(_0x1ab6('0x6'));var path=require('path');var sox=require(_0x1ab6('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1ab6('0x8'));var squel=require(_0x1ab6('0x9'));var crypto=require(_0x1ab6('0xa'));var jsforce=require(_0x1ab6('0xb'));var deskjs=require(_0x1ab6('0xc'));var toCsv=require(_0x1ab6('0xd'));var querystring=require(_0x1ab6('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ab6('0xf'));var authService=require(_0x1ab6('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x1ab6('0x11'));var hardwareService=require(_0x1ab6('0x12'));var logger=require(_0x1ab6('0x13'))(_0x1ab6('0x14'));var utils=require(_0x1ab6('0x15'));var config=require(_0x1ab6('0x16'));var licenseUtil=require(_0x1ab6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xe5d9eb,_0x30640a){_0x30640a=_0x30640a||0xcc;return function(_0x19ec09){if(_0x19ec09){return _0xe5d9eb[_0x1ab6('0x18')](_0x30640a);}return _0xe5d9eb[_0x1ab6('0x19')](_0x30640a)[_0x1ab6('0x1a')]();};}function respondWithResult(_0x28dd94,_0x100598){_0x100598=_0x100598||0xc8;return function(_0x374e59){if(_0x374e59){return _0x28dd94[_0x1ab6('0x19')](_0x100598)[_0x1ab6('0x1b')](_0x374e59);}};}function respondWithFilteredResult(_0x113d2b,_0x5d71e7){return function(_0x50df0a){if(_0x50df0a){var _0x455828=typeof _0x5d71e7[_0x1ab6('0x1c')]===_0x1ab6('0x1d')&&typeof _0x5d71e7[_0x1ab6('0x1e')]===_0x1ab6('0x1d');var _0x41128b=_0x50df0a[_0x1ab6('0x1f')];var _0x4b5919=_0x455828?0x0:_0x5d71e7[_0x1ab6('0x1c')];var _0x4434ad=_0x455828?_0x50df0a['count']:_0x5d71e7[_0x1ab6('0x1c')]+_0x5d71e7[_0x1ab6('0x1e')];var _0x3d0acc;if(_0x4434ad>=_0x41128b){_0x4434ad=_0x41128b;_0x3d0acc=0xc8;}else{_0x3d0acc=0xce;}_0x113d2b[_0x1ab6('0x19')](_0x3d0acc);return _0x113d2b['set'](_0x1ab6('0x20'),_0x4b5919+'-'+_0x4434ad+'/'+_0x41128b)[_0x1ab6('0x1b')](_0x50df0a);}return null;};}function patchUpdates(_0x5882c5){return function(_0x406937){try{jsonpatch[_0x1ab6('0x21')](_0x406937,_0x5882c5,!![]);}catch(_0x574b6d){return BPromise['reject'](_0x574b6d);}return _0x406937['save']();};}function saveUpdates(_0x42a34d,_0x1a4ade){return function(_0x5d31a3){if(_0x5d31a3){return _0x5d31a3[_0x1ab6('0x22')](_0x42a34d)['then'](function(_0x196b0f){return _0x196b0f;});}return null;};}function removeEntity(_0x545fa7,_0x5ce42d){return function(_0x2f4b64){if(_0x2f4b64){return _0x2f4b64[_0x1ab6('0x23')]()[_0x1ab6('0x24')](function(){var _0x40c240=_0x2f4b64[_0x1ab6('0x25')]({'plain':!![]});var _0x57e2e3='ExtractedReports';return db[_0x1ab6('0x26')][_0x1ab6('0x23')]({'where':{'type':_0x57e2e3,'resourceId':_0x40c240['id']}})[_0x1ab6('0x24')](function(){return _0x2f4b64;});})[_0x1ab6('0x24')](function(){_0x545fa7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e6c4a,_0x91a475){return function(_0x311b24){if(!_0x311b24){_0x2e6c4a[_0x1ab6('0x18')](0x194);}return _0x311b24;};}function handleError(_0x9b1b2,_0x586119){_0x586119=_0x586119||0x1f4;return function(_0x545e79){logger[_0x1ab6('0x27')](_0x545e79[_0x1ab6('0x28')]);if(_0x545e79[_0x1ab6('0x29')]){delete _0x545e79[_0x1ab6('0x29')];}_0x9b1b2[_0x1ab6('0x19')](_0x586119)[_0x1ab6('0x2a')](_0x545e79);};}exports[_0x1ab6('0x2b')]=function(_0x4f2b1d,_0x150b35){var _0x11608b={},_0x578099={},_0x3819f9={'count':0x0,'rows':[]};var _0xc0d2bb=_[_0x1ab6('0x2c')](db[_0x1ab6('0x2d')][_0x1ab6('0x2e')],function(_0x55eb38){return{'name':_0x55eb38[_0x1ab6('0x2f')],'type':_0x55eb38[_0x1ab6('0x30')][_0x1ab6('0x31')]};});_0x578099[_0x1ab6('0x32')]=_[_0x1ab6('0x2c')](_0xc0d2bb,_0x1ab6('0x29'));_0x578099[_0x1ab6('0x33')]=_['keys'](_0x4f2b1d[_0x1ab6('0x33')]);_0x578099[_0x1ab6('0x34')]=_[_0x1ab6('0x35')](_0x578099[_0x1ab6('0x32')],_0x578099[_0x1ab6('0x33')]);_0x11608b[_0x1ab6('0x36')]=_['intersection'](_0x578099[_0x1ab6('0x32')],qs[_0x1ab6('0x37')](_0x4f2b1d[_0x1ab6('0x33')][_0x1ab6('0x37')]));_0x11608b[_0x1ab6('0x36')]=_0x11608b[_0x1ab6('0x36')][_0x1ab6('0x38')]?_0x11608b['attributes']:_0x578099[_0x1ab6('0x32')];if(!_0x4f2b1d['query']['hasOwnProperty']('nolimit')){_0x11608b[_0x1ab6('0x1e')]=qs[_0x1ab6('0x1e')](_0x4f2b1d[_0x1ab6('0x33')]['limit']);_0x11608b[_0x1ab6('0x1c')]=qs['offset'](_0x4f2b1d['query'][_0x1ab6('0x1c')]);}_0x11608b[_0x1ab6('0x39')]=qs['sort'](_0x4f2b1d[_0x1ab6('0x33')][_0x1ab6('0x3a')]);_0x11608b[_0x1ab6('0x3b')]=qs[_0x1ab6('0x34')](_[_0x1ab6('0x3c')](_0x4f2b1d['query'],_0x578099[_0x1ab6('0x34')]),_0xc0d2bb);if(_0x4f2b1d[_0x1ab6('0x33')]['filter']){_0x11608b[_0x1ab6('0x3b')]=_['merge'](_0x11608b['where'],{'$or':_[_0x1ab6('0x2c')](_0xc0d2bb,function(_0x56ce50){if(_0x56ce50[_0x1ab6('0x30')]!==_0x1ab6('0x3d')){var _0x4f7f9f={};_0x4f7f9f[_0x56ce50[_0x1ab6('0x29')]]={'$like':'%'+_0x4f2b1d[_0x1ab6('0x33')]['filter']+'%'};return _0x4f7f9f;}})});}_0x11608b=_['merge']({},_0x11608b,_0x4f2b1d[_0x1ab6('0x3e')]);var _0x59bfb3={'where':_0x11608b['where']};return db[_0x1ab6('0x2d')]['count'](_0x59bfb3)[_0x1ab6('0x24')](function(_0x32afec){_0x3819f9[_0x1ab6('0x1f')]=_0x32afec;if(_0x4f2b1d[_0x1ab6('0x33')][_0x1ab6('0x3f')]){_0x11608b[_0x1ab6('0x40')]=[{'all':!![]}];}return db[_0x1ab6('0x2d')][_0x1ab6('0x41')](_0x11608b);})[_0x1ab6('0x24')](function(_0x529d8d){_0x3819f9[_0x1ab6('0x42')]=_0x529d8d;return _0x3819f9;})[_0x1ab6('0x24')](respondWithFilteredResult(_0x150b35,_0x11608b))[_0x1ab6('0x43')](handleError(_0x150b35,null));};exports[_0x1ab6('0x44')]=function(_0x58fff1,_0x2c8726){var _0x29181f={'raw':!![],'where':{'id':_0x58fff1['params']['id']}},_0x182043={};_0x182043[_0x1ab6('0x32')]=_[_0x1ab6('0x45')](db[_0x1ab6('0x2d')][_0x1ab6('0x2e')]);_0x182043[_0x1ab6('0x33')]=_[_0x1ab6('0x45')](_0x58fff1[_0x1ab6('0x33')]);_0x182043[_0x1ab6('0x34')]=_['intersection'](_0x182043[_0x1ab6('0x32')],_0x182043[_0x1ab6('0x33')]);_0x29181f['attributes']=_[_0x1ab6('0x35')](_0x182043[_0x1ab6('0x32')],qs[_0x1ab6('0x37')](_0x58fff1[_0x1ab6('0x33')][_0x1ab6('0x37')]));_0x29181f[_0x1ab6('0x36')]=_0x29181f[_0x1ab6('0x36')][_0x1ab6('0x38')]?_0x29181f['attributes']:_0x182043[_0x1ab6('0x32')];if(_0x58fff1['query'][_0x1ab6('0x3f')]){_0x29181f[_0x1ab6('0x40')]=[{'all':!![]}];}_0x29181f=_['merge']({},_0x29181f,_0x58fff1[_0x1ab6('0x3e')]);return db[_0x1ab6('0x2d')][_0x1ab6('0x46')](_0x29181f)[_0x1ab6('0x24')](handleEntityNotFound(_0x2c8726,null))['then'](respondWithResult(_0x2c8726,null))['catch'](handleError(_0x2c8726,null));};exports[_0x1ab6('0x47')]=function(_0x2c759f,_0x1cd0ec){return db[_0x1ab6('0x2d')][_0x1ab6('0x47')](_0x2c759f[_0x1ab6('0x48')],{})['then'](function(_0x310ee0){var _0x289de8=_0x2c759f['user']['get']({'plain':!![]});if(!_0x289de8)throw new Error(_0x1ab6('0x49'));if(_0x289de8[_0x1ab6('0x4a')]===_0x1ab6('0x4b')){var _0x72bab2=_0x310ee0['get']({'plain':!![]});var _0x1c219=_0x1ab6('0x4c');return db[_0x1ab6('0x4d')][_0x1ab6('0x46')]({'where':{'name':_0x1c219,'userProfileId':_0x289de8[_0x1ab6('0x4e')]},'raw':!![]})[_0x1ab6('0x24')](function(_0x1cee03){if(_0x1cee03&&_0x1cee03[_0x1ab6('0x4f')]===0x0){return db[_0x1ab6('0x26')][_0x1ab6('0x47')]({'name':_0x72bab2[_0x1ab6('0x29')],'resourceId':_0x72bab2['id'],'type':_0x1cee03[_0x1ab6('0x29')],'sectionId':_0x1cee03['id']},{})[_0x1ab6('0x24')](function(){return _0x310ee0;});}else{return _0x310ee0;}})[_0x1ab6('0x43')](function(_0x4850ff){logger[_0x1ab6('0x27')](_0x1ab6('0x50'),_0x4850ff);throw _0x4850ff;});}return _0x310ee0;})[_0x1ab6('0x24')](respondWithResult(_0x1cd0ec,0xc9))[_0x1ab6('0x43')](handleError(_0x1cd0ec,null));};exports[_0x1ab6('0x22')]=function(_0x323327,_0x595c3a){if(_0x323327[_0x1ab6('0x48')]['id']){delete _0x323327['body']['id'];}return db[_0x1ab6('0x2d')][_0x1ab6('0x46')]({'where':{'id':_0x323327[_0x1ab6('0x51')]['id']}})[_0x1ab6('0x24')](handleEntityNotFound(_0x595c3a,null))[_0x1ab6('0x24')](saveUpdates(_0x323327[_0x1ab6('0x48')],null))[_0x1ab6('0x24')](respondWithResult(_0x595c3a,null))[_0x1ab6('0x43')](handleError(_0x595c3a,null));};exports[_0x1ab6('0x23')]=function(_0x45a233,_0x73216){return db['AnalyticExtractedReport'][_0x1ab6('0x46')]({'where':{'id':_0x45a233['params']['id']}})['then'](handleEntityNotFound(_0x73216,null))[_0x1ab6('0x24')](removeEntity(_0x73216,null))['catch'](handleError(_0x73216,null));};exports[_0x1ab6('0x52')]=function(_0x6fc596,_0x4e8228,_0x299db3){return db[_0x1ab6('0x2d')][_0x1ab6('0x46')]({'where':{'id':_0x6fc596[_0x1ab6('0x51')]['id']},'attributes':[_0x1ab6('0x29'),_0x1ab6('0x53'),_0x1ab6('0x54'),'output'],'raw':!![]})[_0x1ab6('0x24')](handleEntityNotFound(_0x4e8228,null))[_0x1ab6('0x24')](function(_0x37f9b9){if(_0x37f9b9){if(!fs[_0x1ab6('0x55')](path['join'](config[_0x1ab6('0x56')],_0x1ab6('0x57'),_0x37f9b9[_0x1ab6('0x54')]))){throw new db[(_0x1ab6('0x58'))][(_0x1ab6('0x59'))](_0x1ab6('0x5a'));}if(_0x6fc596[_0x1ab6('0x33')][_0x1ab6('0x5b')]){return _0x4e8228[_0x1ab6('0x18')](0xc8);}return _0x4e8228[_0x1ab6('0x52')](path['join'](config[_0x1ab6('0x56')],'server/files/reports',_0x37f9b9['savename']),util[_0x1ab6('0x5c')]('%s.%s',_0x37f9b9['basename']||_0x37f9b9[_0x1ab6('0x29')],_0x37f9b9[_0x1ab6('0x5d')][_0x1ab6('0x5e')]()));}})['catch'](handleError(_0x4e8228,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index bad3754..e0e7103 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 _0x6877=['../../config/environment','./analyticExtractedReport.attributes','exports','define','analytics_extracted_reports','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3dd26d,_0x130365){var _0x1cc76c=function(_0x2f743c){while(--_0x2f743c){_0x3dd26d['push'](_0x3dd26d['shift']());}};_0x1cc76c(++_0x130365);}(_0x6877,0x131));var _0x7687=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x6877[_0xd22d95];return _0x15d7a3;};'use strict';var _=require(_0x7687('0x0'));var util=require(_0x7687('0x1'));var logger=require(_0x7687('0x2'))('api');var moment=require(_0x7687('0x3'));var BPromise=require(_0x7687('0x4'));var rp=require(_0x7687('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7687('0x6'));var config=require(_0x7687('0x7'));var attributes=require(_0x7687('0x8'));module[_0x7687('0x9')]=function(_0x2c9a28,_0x2da20d){return _0x2c9a28[_0x7687('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x7687('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd978=['bluebird','request-promise','path','../../config/environment','AnalyticExtractedReport','analytics_extracted_reports','lodash','util','../../config/logger','api','moment'];(function(_0x4885d6,_0x1f0743){var _0x5a2334=function(_0x4d01e1){while(--_0x4d01e1){_0x4885d6['push'](_0x4885d6['shift']());}};_0x5a2334(++_0x1f0743);}(_0xd978,0x187));var _0x8d97=function(_0x257841,_0x389b4d){_0x257841=_0x257841-0x0;var _0x1b87ed=_0xd978[_0x257841];return _0x1b87ed;};'use strict';var _=require(_0x8d97('0x0'));var util=require(_0x8d97('0x1'));var logger=require(_0x8d97('0x2'))(_0x8d97('0x3'));var moment=require(_0x8d97('0x4'));var BPromise=require(_0x8d97('0x5'));var rp=require(_0x8d97('0x6'));var fs=require('fs');var path=require(_0x8d97('0x7'));var rimraf=require('rimraf');var config=require(_0x8d97('0x8'));var attributes=require('./analyticExtractedReport.attributes');module['exports']=function(_0x39bf55,_0x4a95b2){return _0x39bf55['define'](_0x8d97('0x9'),attributes,{'tableName':_0x8d97('0xa'),'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 6477024..52eb2cb 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 _0xe5b5=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x44ca6e,_0x5e2c91){var _0x2edab2=function(_0x3afa91){while(--_0x3afa91){_0x44ca6e['push'](_0x44ca6e['shift']());}};_0x2edab2(++_0x5e2c91);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0xe5b5[_0x489b87];return _0x1823b6;};'use strict';var _=require(_0x5e5b('0x0'));var util=require(_0x5e5b('0x1'));var moment=require(_0x5e5b('0x2'));var BPromise=require(_0x5e5b('0x3'));var rs=require(_0x5e5b('0x4'));var fs=require('fs');var Redis=require(_0x5e5b('0x5'));var db=require(_0x5e5b('0x6'))['db'];var utils=require(_0x5e5b('0x7'));var logger=require(_0x5e5b('0x8'))(_0x5e5b('0x9'));var config=require(_0x5e5b('0xa'));var jayson=require(_0x5e5b('0xb'));var client=jayson[_0x5e5b('0xc')][_0x5e5b('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x545eb3,_0x29db2c,_0xe089b1){return new BPromise(function(_0xcbd478,_0x258414){return client[_0x5e5b('0xe')](_0x545eb3,_0xe089b1)[_0x5e5b('0xf')](function(_0x3a37db){logger[_0x5e5b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x29db2c,_0x5e5b('0x11'));logger['debug'](_0x5e5b('0x12'),_0x29db2c,_0x5e5b('0x11'),JSON[_0x5e5b('0x13')](_0x3a37db));if(_0x3a37db[_0x5e5b('0x14')]){if(_0x3a37db['error']['code']===0x1f4){logger['error'](_0x5e5b('0x15'),_0x29db2c,_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);return _0x258414(_0x3a37db[_0x5e5b('0x14')][_0x5e5b('0x16')]);}logger[_0x5e5b('0x14')](_0x5e5b('0x15'),_0x29db2c,_0x3a37db['error'][_0x5e5b('0x16')]);return _0xcbd478(_0x3a37db[_0x5e5b('0x14')]['message']);}else{logger[_0x5e5b('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x29db2c,'request\x20sent');_0xcbd478(_0x3a37db[_0x5e5b('0x17')][_0x5e5b('0x16')]);}})[_0x5e5b('0x18')](function(_0x5c7148){logger[_0x5e5b('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x29db2c,_0x5c7148);_0x258414(_0x5c7148);});});}
\ No newline at end of file
+var _0xf9b7=['rpc','../../config/environment','client','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x82db7a,_0x1b9129){var _0x76f85=function(_0x51e389){while(--_0x51e389){_0x82db7a['push'](_0x82db7a['shift']());}};_0x76f85(++_0x1b9129);}(_0xf9b7,0x13d));var _0x7f9b=function(_0x506ac7,_0x5db19b){_0x506ac7=_0x506ac7-0x0;var _0x5d4ce5=_0xf9b7[_0x506ac7];return _0x5d4ce5;};'use strict';var _=require(_0x7f9b('0x0'));var util=require('util');var moment=require(_0x7f9b('0x1'));var BPromise=require('bluebird');var rs=require(_0x7f9b('0x2'));var fs=require('fs');var Redis=require(_0x7f9b('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7f9b('0x4'));var logger=require(_0x7f9b('0x5'))(_0x7f9b('0x6'));var config=require(_0x7f9b('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7f9b('0x8')][_0x7f9b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d08cd,_0x27d722,_0x2a8aa8){return new BPromise(function(_0xbb9f4,_0x58f78b){return client['request'](_0x3d08cd,_0x2a8aa8)[_0x7f9b('0xa')](function(_0x4e751a){logger[_0x7f9b('0xb')](_0x7f9b('0xc'),_0x27d722,_0x7f9b('0xd'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x27d722,_0x7f9b('0xd'),JSON[_0x7f9b('0xe')](_0x4e751a));if(_0x4e751a[_0x7f9b('0xf')]){if(_0x4e751a[_0x7f9b('0xf')]['code']===0x1f4){logger[_0x7f9b('0xf')](_0x7f9b('0xc'),_0x27d722,_0x4e751a[_0x7f9b('0xf')]['message']);return _0x58f78b(_0x4e751a['error'][_0x7f9b('0x10')]);}logger[_0x7f9b('0xf')](_0x7f9b('0xc'),_0x27d722,_0x4e751a[_0x7f9b('0xf')][_0x7f9b('0x10')]);return _0xbb9f4(_0x4e751a[_0x7f9b('0xf')]['message']);}else{logger[_0x7f9b('0xb')](_0x7f9b('0xc'),_0x27d722,'request\x20sent');_0xbb9f4(_0x4e751a[_0x7f9b('0x11')][_0x7f9b('0x10')]);}})[_0x7f9b('0x12')](function(_0x420702){logger[_0x7f9b('0xf')](_0x7f9b('0xc'),_0x27d722,_0x420702);_0x58f78b(_0x420702);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index 6b9540f..a4d244a 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 _0xdddc=['isAuthenticated','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticExtractedReport.controller','get','/:id'];(function(_0x4f991d,_0xbc504a){var _0x40efe1=function(_0x36a8eb){while(--_0x36a8eb){_0x4f991d['push'](_0x4f991d['shift']());}};_0x40efe1(++_0xbc504a);}(_0xdddc,0x11f));var _0xcddd=function(_0x377017,_0x16042d){_0x377017=_0x377017-0x0;var _0x1e44fb=_0xdddc[_0x377017];return _0x1e44fb;};'use strict';var multer=require(_0xcddd('0x0'));var util=require(_0xcddd('0x1'));var path=require(_0xcddd('0x2'));var timeout=require(_0xcddd('0x3'));var express=require(_0xcddd('0x4'));var router=express[_0xcddd('0x5')]();var fs_extra=require(_0xcddd('0x6'));var auth=require(_0xcddd('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0xcddd('0x8'));var controller=require(_0xcddd('0x9'));router[_0xcddd('0xa')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcddd('0xa')](_0xcddd('0xb'),auth[_0xcddd('0xc')](),controller[_0xcddd('0xd')]);router['get'](_0xcddd('0xe'),auth[_0xcddd('0xc')](),controller[_0xcddd('0xf')]);router[_0xcddd('0x10')]('/',auth[_0xcddd('0xc')](),controller[_0xcddd('0x11')]);router[_0xcddd('0x12')]('/:id',auth[_0xcddd('0xc')](),controller[_0xcddd('0x13')]);router[_0xcddd('0x14')](_0xcddd('0xb'),auth[_0xcddd('0xc')](),controller[_0xcddd('0x15')]);module[_0xcddd('0x16')]=router;
\ No newline at end of file
+var _0xa4b5=['delete','destroy','exports','multer','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','update'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa4b5,0x12f));var _0x5a4b=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0xa4b5[_0x288f5e];return _0x476cc9;};'use strict';var multer=require(_0x5a4b('0x0'));var util=require('util');var path=require(_0x5a4b('0x1'));var timeout=require(_0x5a4b('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x5a4b('0x3'));var auth=require(_0x5a4b('0x4'));var interaction=require(_0x5a4b('0x5'));var config=require(_0x5a4b('0x6'));var controller=require('./analyticExtractedReport.controller');router[_0x5a4b('0x7')]('/',auth[_0x5a4b('0x8')](),controller[_0x5a4b('0x9')]);router[_0x5a4b('0x7')](_0x5a4b('0xa'),auth[_0x5a4b('0x8')](),controller[_0x5a4b('0xb')]);router[_0x5a4b('0x7')](_0x5a4b('0xc'),auth['isAuthenticated'](),controller[_0x5a4b('0xd')]);router[_0x5a4b('0xe')]('/',auth[_0x5a4b('0x8')](),controller[_0x5a4b('0xf')]);router['put'](_0x5a4b('0xa'),auth[_0x5a4b('0x8')](),controller[_0x5a4b('0x10')]);router[_0x5a4b('0x11')](_0x5a4b('0xa'),auth[_0x5a4b('0x8')](),controller[_0x5a4b('0x12')]);module[_0x5a4b('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 8db3edf..3c73e86 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 _0xb0ef=['STRING','BOOLEAN','sequelize','exports','TEXT'];(function(_0x206261,_0x518fdb){var _0x19908c=function(_0x2ac9af){while(--_0x2ac9af){_0x206261['push'](_0x206261['shift']());}};_0x19908c(++_0x518fdb);}(_0xb0ef,0x8e));var _0xfb0e=function(_0x4ea5aa,_0x12c1a3){_0x4ea5aa=_0x4ea5aa-0x0;var _0x4e319f=_0xb0ef[_0x4ea5aa];return _0x4e319f;};'use strict';var Sequelize=require(_0xfb0e('0x0'));module[_0xfb0e('0x1')]={'field':{'type':Sequelize[_0xfb0e('0x2')]},'alias':{'type':Sequelize[_0xfb0e('0x3')]},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize['STRING']},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xfb0e('0x3')]},'custom':{'type':Sequelize[_0xfb0e('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0x63f8=['TEXT','STRING','BOOLEAN','sequelize','exports'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x63f8,0xee));var _0x863f=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0x63f8[_0xe66cf2];return _0x2d84e7;};'use strict';var Sequelize=require(_0x863f('0x0'));module[_0x863f('0x1')]={'field':{'type':Sequelize[_0x863f('0x2')]},'alias':{'type':Sequelize[_0x863f('0x3')]},'function':{'type':Sequelize[_0x863f('0x3')]},'format':{'type':Sequelize[_0x863f('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x863f('0x4')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index 0b36c81..a9a9f62 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 _0x39a1=['AnalyticFieldReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','attributes','nolimit','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','rows','params','fields','length','merge','find','catch','create','bulkCreate','body','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','findAll','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','end','status','offset','undefined','count','limit','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send'];(function(_0x3e1600,_0x2571ff){var _0x219628=function(_0x2d1597){while(--_0x2d1597){_0x3e1600['push'](_0x3e1600['shift']());}};_0x219628(++_0x2571ff);}(_0x39a1,0x7b));var _0x139a=function(_0x4cd9b9,_0x23884f){_0x4cd9b9=_0x4cd9b9-0x0;var _0x24a223=_0x39a1[_0x4cd9b9];return _0x24a223;};'use strict';var emlformat=require(_0x139a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x139a('0x1'));var jsonpatch=require(_0x139a('0x2'));var rp=require(_0x139a('0x3'));var moment=require(_0x139a('0x4'));var BPromise=require(_0x139a('0x5'));var Mustache=require(_0x139a('0x6'));var util=require(_0x139a('0x7'));var path=require(_0x139a('0x8'));var sox=require('sox');var csv=require(_0x139a('0x9'));var ejs=require(_0x139a('0xa'));var fs=require('fs');var fs_extra=require(_0x139a('0xb'));var _=require(_0x139a('0xc'));var squel=require(_0x139a('0xd'));var crypto=require(_0x139a('0xe'));var jsforce=require(_0x139a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x139a('0x9'));var querystring=require(_0x139a('0x10'));var Papa=require(_0x139a('0x11'));var Redis=require(_0x139a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x139a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x139a('0x14'));var logger=require(_0x139a('0x15'))(_0x139a('0x16'));var utils=require(_0x139a('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0x139a('0x18'));var db=require(_0x139a('0x19'))['db'];function respondWithStatusCode(_0x506ee9,_0x5833f4){_0x5833f4=_0x5833f4||0xcc;return function(_0x32fe6d){if(_0x32fe6d){return _0x506ee9[_0x139a('0x1a')](_0x5833f4);}return _0x506ee9['status'](_0x5833f4)[_0x139a('0x1b')]();};}function respondWithResult(_0x58b74f,_0x465660){_0x465660=_0x465660||0xc8;return function(_0x175efb){if(_0x175efb){return _0x58b74f[_0x139a('0x1c')](_0x465660)['json'](_0x175efb);}};}function respondWithFilteredResult(_0x3196de,_0x2859ea){return function(_0x5c1de8){if(_0x5c1de8){var _0x34b525=typeof _0x2859ea[_0x139a('0x1d')]===_0x139a('0x1e')&&typeof _0x2859ea['limit']===_0x139a('0x1e');var _0x3f7740=_0x5c1de8['count'];var _0x1183ca=_0x34b525?0x0:_0x2859ea['offset'];var _0x2da79b=_0x34b525?_0x5c1de8[_0x139a('0x1f')]:_0x2859ea[_0x139a('0x1d')]+_0x2859ea[_0x139a('0x20')];var _0xca372e;if(_0x2da79b>=_0x3f7740){_0x2da79b=_0x3f7740;_0xca372e=0xc8;}else{_0xca372e=0xce;}_0x3196de[_0x139a('0x1c')](_0xca372e);return _0x3196de['set'](_0x139a('0x21'),_0x1183ca+'-'+_0x2da79b+'/'+_0x3f7740)[_0x139a('0x22')](_0x5c1de8);}return null;};}function patchUpdates(_0xcfa755){return function(_0x26b14a){try{jsonpatch[_0x139a('0x23')](_0x26b14a,_0xcfa755,!![]);}catch(_0x4e44f4){return BPromise[_0x139a('0x24')](_0x4e44f4);}return _0x26b14a[_0x139a('0x25')]();};}function saveUpdates(_0x389f39,_0x47dfc6){return function(_0x4c3e7c){if(_0x4c3e7c){return _0x4c3e7c[_0x139a('0x26')](_0x389f39)[_0x139a('0x27')](function(_0x37de99){return _0x37de99;});}return null;};}function removeEntity(_0x23822d,_0x5eff81){return function(_0xc685ec){if(_0xc685ec){return _0xc685ec[_0x139a('0x28')]()[_0x139a('0x27')](function(){_0x23822d['status'](0xcc)[_0x139a('0x1b')]();});}};}function handleEntityNotFound(_0x19cab0,_0x170a96){return function(_0x8f3b54){if(!_0x8f3b54){_0x19cab0[_0x139a('0x1a')](0x194);}return _0x8f3b54;};}function handleError(_0x2a9f35,_0x2e202e){_0x2e202e=_0x2e202e||0x1f4;return function(_0x56f3db){logger[_0x139a('0x29')](_0x56f3db[_0x139a('0x2a')]);if(_0x56f3db[_0x139a('0x2b')]){delete _0x56f3db[_0x139a('0x2b')];}_0x2a9f35[_0x139a('0x1c')](_0x2e202e)[_0x139a('0x2c')](_0x56f3db);};}exports['index']=function(_0x5db270,_0x104c68){var _0x390817={},_0x8c446c={},_0x54ed18={'count':0x0,'rows':[]};var _0x4bbc0d=_['map'](db[_0x139a('0x2d')][_0x139a('0x2e')],function(_0x13c130){return{'name':_0x13c130[_0x139a('0x2f')],'type':_0x13c130[_0x139a('0x30')][_0x139a('0x31')]};});_0x8c446c[_0x139a('0x32')]=_[_0x139a('0x33')](_0x4bbc0d,_0x139a('0x2b'));_0x8c446c['query']=_[_0x139a('0x34')](_0x5db270[_0x139a('0x35')]);_0x8c446c['filters']=_[_0x139a('0x36')](_0x8c446c[_0x139a('0x32')],_0x8c446c['query']);_0x390817['attributes']=_[_0x139a('0x36')](_0x8c446c['model'],qs['fields'](_0x5db270['query']['fields']));_0x390817['attributes']=_0x390817['attributes']['length']?_0x390817[_0x139a('0x37')]:_0x8c446c[_0x139a('0x32')];if(!_0x5db270['query']['hasOwnProperty'](_0x139a('0x38'))){_0x390817[_0x139a('0x20')]=qs['limit'](_0x5db270[_0x139a('0x35')][_0x139a('0x20')]);_0x390817[_0x139a('0x1d')]=qs[_0x139a('0x1d')](_0x5db270[_0x139a('0x35')][_0x139a('0x1d')]);}_0x390817[_0x139a('0x39')]=qs['sort'](_0x5db270[_0x139a('0x35')][_0x139a('0x3a')]);_0x390817[_0x139a('0x3b')]=qs[_0x139a('0x3c')](_['pick'](_0x5db270[_0x139a('0x35')],_0x8c446c['filters']),_0x4bbc0d);if(_0x5db270[_0x139a('0x35')][_0x139a('0x3d')]){_0x390817[_0x139a('0x3b')]=_['merge'](_0x390817['where'],{'$or':_[_0x139a('0x33')](_0x4bbc0d,function(_0x1843db){if(_0x1843db[_0x139a('0x30')]!==_0x139a('0x3e')){var _0x398059={};_0x398059[_0x1843db[_0x139a('0x2b')]]={'$like':'%'+_0x5db270['query']['filter']+'%'};return _0x398059;}})});}_0x390817=_['merge']({},_0x390817,_0x5db270[_0x139a('0x3f')]);var _0x529d04={'where':_0x390817[_0x139a('0x3b')]};return db['AnalyticFieldReport'][_0x139a('0x1f')](_0x529d04)[_0x139a('0x27')](function(_0x1ec47e){_0x54ed18[_0x139a('0x1f')]=_0x1ec47e;if(_0x5db270[_0x139a('0x35')][_0x139a('0x40')]){_0x390817[_0x139a('0x41')]=[{'all':!![]}];}return db[_0x139a('0x2d')]['findAll'](_0x390817);})['then'](function(_0x223259){_0x54ed18[_0x139a('0x42')]=_0x223259;return _0x54ed18;})[_0x139a('0x27')](respondWithFilteredResult(_0x104c68,_0x390817))['catch'](handleError(_0x104c68,null));};exports['show']=function(_0x410d60,_0x434ea4){var _0xa69e77={'raw':![],'where':{'id':_0x410d60[_0x139a('0x43')]['id']}},_0x38cc61={};_0x38cc61[_0x139a('0x32')]=_['keys'](db['AnalyticFieldReport'][_0x139a('0x2e')]);_0x38cc61['query']=_[_0x139a('0x34')](_0x410d60[_0x139a('0x35')]);_0x38cc61[_0x139a('0x3c')]=_['intersection'](_0x38cc61[_0x139a('0x32')],_0x38cc61[_0x139a('0x35')]);_0xa69e77[_0x139a('0x37')]=_[_0x139a('0x36')](_0x38cc61[_0x139a('0x32')],qs[_0x139a('0x44')](_0x410d60[_0x139a('0x35')][_0x139a('0x44')]));_0xa69e77[_0x139a('0x37')]=_0xa69e77[_0x139a('0x37')][_0x139a('0x45')]?_0xa69e77[_0x139a('0x37')]:_0x38cc61[_0x139a('0x32')];if(_0x410d60[_0x139a('0x35')][_0x139a('0x40')]){_0xa69e77[_0x139a('0x41')]=[{'all':!![]}];}_0xa69e77=_[_0x139a('0x46')]({},_0xa69e77,_0x410d60[_0x139a('0x3f')]);return db[_0x139a('0x2d')][_0x139a('0x47')](_0xa69e77)[_0x139a('0x27')](handleEntityNotFound(_0x434ea4,null))[_0x139a('0x27')](respondWithResult(_0x434ea4,null))[_0x139a('0x48')](handleError(_0x434ea4,null));};exports[_0x139a('0x49')]=function(_0x31112f,_0x50956d){return db['AnalyticFieldReport'][_0x139a('0x49')](_0x31112f['body'],{})[_0x139a('0x27')](respondWithResult(_0x50956d,0xc9))['catch'](handleError(_0x50956d,null));};exports[_0x139a('0x4a')]=function(_0x46697b,_0x361efe){return db[_0x139a('0x2d')][_0x139a('0x4a')](_0x46697b['body'],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x361efe,0xc9))[_0x139a('0x48')](handleError(_0x361efe,null));};exports[_0x139a('0x26')]=function(_0x309174,_0x23d34d){if(_0x309174[_0x139a('0x4b')]['id']){delete _0x309174[_0x139a('0x4b')]['id'];}return db[_0x139a('0x2d')][_0x139a('0x47')]({'where':{'id':_0x309174[_0x139a('0x43')]['id']}})[_0x139a('0x27')](handleEntityNotFound(_0x23d34d,null))[_0x139a('0x27')](saveUpdates(_0x309174[_0x139a('0x4b')],null))[_0x139a('0x27')](respondWithResult(_0x23d34d,null))[_0x139a('0x48')](handleError(_0x23d34d,null));};exports[_0x139a('0x28')]=function(_0x4f006c,_0x2a2355){return db['AnalyticFieldReport']['find']({'where':{'id':_0x4f006c[_0x139a('0x43')]['id']}})[_0x139a('0x27')](handleEntityNotFound(_0x2a2355,null))['then'](removeEntity(_0x2a2355,null))[_0x139a('0x48')](handleError(_0x2a2355,null));};exports[_0x139a('0x4c')]=function(_0x141ec0,_0x4cb642){return db[_0x139a('0x2d')][_0x139a('0x28')]({'where':{'id':_0x141ec0[_0x139a('0x35')][_0x139a('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4cb642,0xcc))[_0x139a('0x48')](handleError(_0x4cb642,null));};exports[_0x139a('0x4e')]=function(_0x4b82c1,_0x1e8a78,_0x40e412){return db[_0x139a('0x4f')][_0x139a('0x50')]({'where':{'id':_0x4b82c1['params']['id']}})['then'](handleEntityNotFound(_0x1e8a78,null))[_0x139a('0x27')](function(_0x314e33){if(_0x314e33){return db[_0x139a('0x51')][_0x139a('0x52')](function(_0x1ad5c){return db[_0x139a('0x2d')][_0x139a('0x28')]({'where':{'CustomReportId':_0x4b82c1[_0x139a('0x43')]['id']},'transaction':_0x1ad5c})[_0x139a('0x27')](function(_0x2e1182){var _0x14844e=_[_0x139a('0x33')](_0x4b82c1[_0x139a('0x4b')],function(_0x4ed522){delete _0x4ed522['id'];_0x4ed522['CustomReportId']=_0x4b82c1[_0x139a('0x43')]['id'];return _0x4ed522;});return db['AnalyticFieldReport'][_0x139a('0x4a')](_0x14844e,{'transaction':_0x1ad5c});});})[_0x139a('0x27')](function(){return db[_0x139a('0x2d')][_0x139a('0x53')]({'where':{'CustomReportId':_0x4b82c1['params']['id']}});});}})[_0x139a('0x27')](respondWithResult(_0x1e8a78,null))['catch'](handleError(_0x1e8a78,null));};
\ No newline at end of file
+var _0x2b15=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','save','update','then','end','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','query','intersection','model','attributes','length','hasOwnProperty','where','filters','pick','merge','VIRTUAL','filter','options','includeAll','catch','show','keys','fields','include','find','create','body','bulkCreate','params','destroy','ids','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','eml-format'];(function(_0x2dcf38,_0x33765a){var _0x2295dc=function(_0x1aff4f){while(--_0x1aff4f){_0x2dcf38['push'](_0x2dcf38['shift']());}};_0x2295dc(++_0x33765a);}(_0x2b15,0x147));var _0x52b1=function(_0x3195af,_0x536c46){_0x3195af=_0x3195af-0x0;var _0x358a02=_0x2b15[_0x3195af];return _0x358a02;};'use strict';var emlformat=require(_0x52b1('0x0'));var rimraf=require(_0x52b1('0x1'));var zipdir=require(_0x52b1('0x2'));var jsonpatch=require(_0x52b1('0x3'));var rp=require(_0x52b1('0x4'));var moment=require(_0x52b1('0x5'));var BPromise=require(_0x52b1('0x6'));var Mustache=require('mustache');var util=require(_0x52b1('0x7'));var path=require(_0x52b1('0x8'));var sox=require('sox');var csv=require(_0x52b1('0x9'));var ejs=require(_0x52b1('0xa'));var fs=require('fs');var fs_extra=require(_0x52b1('0xb'));var _=require('lodash');var squel=require(_0x52b1('0xc'));var crypto=require(_0x52b1('0xd'));var jsforce=require(_0x52b1('0xe'));var deskjs=require(_0x52b1('0xf'));var toCsv=require(_0x52b1('0x9'));var querystring=require(_0x52b1('0x10'));var Papa=require(_0x52b1('0x11'));var Redis=require(_0x52b1('0x12'));var authService=require(_0x52b1('0x13'));var qs=require(_0x52b1('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x52b1('0x15'));var logger=require(_0x52b1('0x16'))(_0x52b1('0x17'));var utils=require(_0x52b1('0x18'));var config=require(_0x52b1('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0x52b1('0x1a'))['db'];function respondWithStatusCode(_0xf737be,_0xc1eb9e){_0xc1eb9e=_0xc1eb9e||0xcc;return function(_0x16f4e9){if(_0x16f4e9){return _0xf737be[_0x52b1('0x1b')](_0xc1eb9e);}return _0xf737be[_0x52b1('0x1c')](_0xc1eb9e)['end']();};}function respondWithResult(_0x345c6f,_0x48b78e){_0x48b78e=_0x48b78e||0xc8;return function(_0x2c7d3f){if(_0x2c7d3f){return _0x345c6f[_0x52b1('0x1c')](_0x48b78e)[_0x52b1('0x1d')](_0x2c7d3f);}};}function respondWithFilteredResult(_0xe96369,_0x1cb5c8){return function(_0x2b8fca){if(_0x2b8fca){var _0x49919a=typeof _0x1cb5c8[_0x52b1('0x1e')]===_0x52b1('0x1f')&&typeof _0x1cb5c8[_0x52b1('0x20')]==='undefined';var _0xb176e5=_0x2b8fca['count'];var _0x5d33e6=_0x49919a?0x0:_0x1cb5c8[_0x52b1('0x1e')];var _0x566528=_0x49919a?_0x2b8fca[_0x52b1('0x21')]:_0x1cb5c8[_0x52b1('0x1e')]+_0x1cb5c8[_0x52b1('0x20')];var _0x2bf5a5;if(_0x566528>=_0xb176e5){_0x566528=_0xb176e5;_0x2bf5a5=0xc8;}else{_0x2bf5a5=0xce;}_0xe96369['status'](_0x2bf5a5);return _0xe96369[_0x52b1('0x22')](_0x52b1('0x23'),_0x5d33e6+'-'+_0x566528+'/'+_0xb176e5)[_0x52b1('0x1d')](_0x2b8fca);}return null;};}function patchUpdates(_0xddfc53){return function(_0x558ae1){try{jsonpatch['apply'](_0x558ae1,_0xddfc53,!![]);}catch(_0x4a316a){return BPromise['reject'](_0x4a316a);}return _0x558ae1[_0x52b1('0x24')]();};}function saveUpdates(_0x1b0357,_0x387523){return function(_0x3f66a5){if(_0x3f66a5){return _0x3f66a5[_0x52b1('0x25')](_0x1b0357)[_0x52b1('0x26')](function(_0x30c04d){return _0x30c04d;});}return null;};}function removeEntity(_0x29bb1d,_0x2dedbb){return function(_0x3ddea8){if(_0x3ddea8){return _0x3ddea8['destroy']()[_0x52b1('0x26')](function(){_0x29bb1d[_0x52b1('0x1c')](0xcc)[_0x52b1('0x27')]();});}};}function handleEntityNotFound(_0x532b75,_0x568b45){return function(_0x160d75){if(!_0x160d75){_0x532b75[_0x52b1('0x1b')](0x194);}return _0x160d75;};}function handleError(_0x121874,_0x4eefb6){_0x4eefb6=_0x4eefb6||0x1f4;return function(_0x133427){logger[_0x52b1('0x28')](_0x133427[_0x52b1('0x29')]);if(_0x133427[_0x52b1('0x2a')]){delete _0x133427['name'];}_0x121874[_0x52b1('0x1c')](_0x4eefb6)[_0x52b1('0x2b')](_0x133427);};}exports[_0x52b1('0x2c')]=function(_0x2d772c,_0x4ebb96){var _0x3b0e63={},_0x3397ff={},_0x5e4a90={'count':0x0,'rows':[]};var _0x40c736=_[_0x52b1('0x2d')](db[_0x52b1('0x2e')][_0x52b1('0x2f')],function(_0x46c3be){return{'name':_0x46c3be[_0x52b1('0x30')],'type':_0x46c3be[_0x52b1('0x31')]['key']};});_0x3397ff['model']=_[_0x52b1('0x2d')](_0x40c736,_0x52b1('0x2a'));_0x3397ff[_0x52b1('0x32')]=_['keys'](_0x2d772c['query']);_0x3397ff['filters']=_[_0x52b1('0x33')](_0x3397ff[_0x52b1('0x34')],_0x3397ff['query']);_0x3b0e63['attributes']=_[_0x52b1('0x33')](_0x3397ff['model'],qs['fields'](_0x2d772c['query']['fields']));_0x3b0e63['attributes']=_0x3b0e63[_0x52b1('0x35')][_0x52b1('0x36')]?_0x3b0e63['attributes']:_0x3397ff[_0x52b1('0x34')];if(!_0x2d772c[_0x52b1('0x32')][_0x52b1('0x37')]('nolimit')){_0x3b0e63[_0x52b1('0x20')]=qs['limit'](_0x2d772c[_0x52b1('0x32')][_0x52b1('0x20')]);_0x3b0e63['offset']=qs['offset'](_0x2d772c[_0x52b1('0x32')][_0x52b1('0x1e')]);}_0x3b0e63['order']=qs['sort'](_0x2d772c[_0x52b1('0x32')]['sort']);_0x3b0e63[_0x52b1('0x38')]=qs[_0x52b1('0x39')](_[_0x52b1('0x3a')](_0x2d772c[_0x52b1('0x32')],_0x3397ff[_0x52b1('0x39')]),_0x40c736);if(_0x2d772c[_0x52b1('0x32')]['filter']){_0x3b0e63[_0x52b1('0x38')]=_[_0x52b1('0x3b')](_0x3b0e63[_0x52b1('0x38')],{'$or':_[_0x52b1('0x2d')](_0x40c736,function(_0x2a6c1b){if(_0x2a6c1b['type']!==_0x52b1('0x3c')){var _0x272c93={};_0x272c93[_0x2a6c1b[_0x52b1('0x2a')]]={'$like':'%'+_0x2d772c[_0x52b1('0x32')][_0x52b1('0x3d')]+'%'};return _0x272c93;}})});}_0x3b0e63=_[_0x52b1('0x3b')]({},_0x3b0e63,_0x2d772c[_0x52b1('0x3e')]);var _0x35162d={'where':_0x3b0e63[_0x52b1('0x38')]};return db[_0x52b1('0x2e')][_0x52b1('0x21')](_0x35162d)[_0x52b1('0x26')](function(_0x20f1d3){_0x5e4a90[_0x52b1('0x21')]=_0x20f1d3;if(_0x2d772c[_0x52b1('0x32')][_0x52b1('0x3f')]){_0x3b0e63['include']=[{'all':!![]}];}return db[_0x52b1('0x2e')]['findAll'](_0x3b0e63);})[_0x52b1('0x26')](function(_0x1ddf03){_0x5e4a90['rows']=_0x1ddf03;return _0x5e4a90;})[_0x52b1('0x26')](respondWithFilteredResult(_0x4ebb96,_0x3b0e63))[_0x52b1('0x40')](handleError(_0x4ebb96,null));};exports[_0x52b1('0x41')]=function(_0xfa4b7a,_0x1aea91){var _0x51af0c={'raw':![],'where':{'id':_0xfa4b7a['params']['id']}},_0xddd384={};_0xddd384[_0x52b1('0x34')]=_[_0x52b1('0x42')](db['AnalyticFieldReport'][_0x52b1('0x2f')]);_0xddd384['query']=_[_0x52b1('0x42')](_0xfa4b7a[_0x52b1('0x32')]);_0xddd384[_0x52b1('0x39')]=_['intersection'](_0xddd384[_0x52b1('0x34')],_0xddd384[_0x52b1('0x32')]);_0x51af0c[_0x52b1('0x35')]=_[_0x52b1('0x33')](_0xddd384[_0x52b1('0x34')],qs[_0x52b1('0x43')](_0xfa4b7a['query']['fields']));_0x51af0c[_0x52b1('0x35')]=_0x51af0c[_0x52b1('0x35')]['length']?_0x51af0c['attributes']:_0xddd384['model'];if(_0xfa4b7a[_0x52b1('0x32')][_0x52b1('0x3f')]){_0x51af0c[_0x52b1('0x44')]=[{'all':!![]}];}_0x51af0c=_[_0x52b1('0x3b')]({},_0x51af0c,_0xfa4b7a['options']);return db[_0x52b1('0x2e')][_0x52b1('0x45')](_0x51af0c)[_0x52b1('0x26')](handleEntityNotFound(_0x1aea91,null))[_0x52b1('0x26')](respondWithResult(_0x1aea91,null))[_0x52b1('0x40')](handleError(_0x1aea91,null));};exports[_0x52b1('0x46')]=function(_0x459b72,_0x238c92){return db[_0x52b1('0x2e')][_0x52b1('0x46')](_0x459b72[_0x52b1('0x47')],{})[_0x52b1('0x26')](respondWithResult(_0x238c92,0xc9))[_0x52b1('0x40')](handleError(_0x238c92,null));};exports[_0x52b1('0x48')]=function(_0xfab58f,_0x13b3c0){return db[_0x52b1('0x2e')][_0x52b1('0x48')](_0xfab58f['body'],{'raw':![],'individualHooks':!![]})[_0x52b1('0x26')](respondWithResult(_0x13b3c0,0xc9))[_0x52b1('0x40')](handleError(_0x13b3c0,null));};exports[_0x52b1('0x25')]=function(_0x5926f1,_0x50a3de){if(_0x5926f1[_0x52b1('0x47')]['id']){delete _0x5926f1[_0x52b1('0x47')]['id'];}return db[_0x52b1('0x2e')][_0x52b1('0x45')]({'where':{'id':_0x5926f1[_0x52b1('0x49')]['id']}})[_0x52b1('0x26')](handleEntityNotFound(_0x50a3de,null))[_0x52b1('0x26')](saveUpdates(_0x5926f1[_0x52b1('0x47')],null))[_0x52b1('0x26')](respondWithResult(_0x50a3de,null))[_0x52b1('0x40')](handleError(_0x50a3de,null));};exports[_0x52b1('0x4a')]=function(_0x5b4ef6,_0x3afba6){return db[_0x52b1('0x2e')][_0x52b1('0x45')]({'where':{'id':_0x5b4ef6[_0x52b1('0x49')]['id']}})['then'](handleEntityNotFound(_0x3afba6,null))['then'](removeEntity(_0x3afba6,null))[_0x52b1('0x40')](handleError(_0x3afba6,null));};exports['bulkDestroy']=function(_0x1e7bc7,_0xd268db){return db['AnalyticFieldReport'][_0x52b1('0x4a')]({'where':{'id':_0x1e7bc7[_0x52b1('0x32')][_0x52b1('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x52b1('0x26')](respondWithResult(_0xd268db,0xcc))[_0x52b1('0x40')](handleError(_0xd268db,null));};exports['addFields']=function(_0x29e194,_0x100ae9,_0x4d16a7){return db[_0x52b1('0x4c')][_0x52b1('0x4d')]({'where':{'id':_0x29e194['params']['id']}})['then'](handleEntityNotFound(_0x100ae9,null))[_0x52b1('0x26')](function(_0x206975){if(_0x206975){return db[_0x52b1('0x4e')][_0x52b1('0x4f')](function(_0x238cf2){return db[_0x52b1('0x2e')][_0x52b1('0x4a')]({'where':{'CustomReportId':_0x29e194[_0x52b1('0x49')]['id']},'transaction':_0x238cf2})['then'](function(_0x8ac284){var _0x279797=_[_0x52b1('0x2d')](_0x29e194[_0x52b1('0x47')],function(_0x25652f){delete _0x25652f['id'];_0x25652f[_0x52b1('0x50')]=_0x29e194[_0x52b1('0x49')]['id'];return _0x25652f;});return db['AnalyticFieldReport'][_0x52b1('0x48')](_0x279797,{'transaction':_0x238cf2});});})[_0x52b1('0x26')](function(){return db[_0x52b1('0x2e')][_0x52b1('0x51')]({'where':{'CustomReportId':_0x29e194['params']['id']}});});}})[_0x52b1('0x26')](respondWithResult(_0x100ae9,null))[_0x52b1('0x40')](handleError(_0x100ae9,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index ea484d0..3d22608 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 _0xa083=['exports','define','AnalyticFieldReport','analytics_report_fields','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes'];(function(_0x11443c,_0x274b15){var _0x27736a=function(_0x50fee1){while(--_0x50fee1){_0x11443c['push'](_0x11443c['shift']());}};_0x27736a(++_0x274b15);}(_0xa083,0x122));var _0x3a08=function(_0x4ca280,_0x1a1c4b){_0x4ca280=_0x4ca280-0x0;var _0x4bff7a=_0xa083[_0x4ca280];return _0x4bff7a;};'use strict';var _=require(_0x3a08('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3a08('0x1'));var moment=require(_0x3a08('0x2'));var BPromise=require(_0x3a08('0x3'));var rp=require(_0x3a08('0x4'));var fs=require('fs');var path=require(_0x3a08('0x5'));var rimraf=require(_0x3a08('0x6'));var config=require(_0x3a08('0x7'));var attributes=require(_0x3a08('0x8'));module[_0x3a08('0x9')]=function(_0x44d99c,_0x2cabdc){return _0x44d99c[_0x3a08('0xa')](_0x3a08('0xb'),attributes,{'tableName':_0x3a08('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1c0f=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields','lodash','../../config/logger','moment','request-promise'];(function(_0x20d45a,_0x14ae45){var _0x511390=function(_0x420c5b){while(--_0x420c5b){_0x20d45a['push'](_0x20d45a['shift']());}};_0x511390(++_0x14ae45);}(_0x1c0f,0x100));var _0xf1c0=function(_0x146a62,_0x388b09){_0x146a62=_0x146a62-0x0;var _0x83ff3b=_0x1c0f[_0x146a62];return _0x83ff3b;};'use strict';var _=require(_0xf1c0('0x0'));var util=require('util');var logger=require(_0xf1c0('0x1'))('api');var moment=require(_0xf1c0('0x2'));var BPromise=require('bluebird');var rp=require(_0xf1c0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf1c0('0x4'));var config=require(_0xf1c0('0x5'));var attributes=require(_0xf1c0('0x6'));module[_0xf1c0('0x7')]=function(_0x8ca3e7,_0x354273){return _0x8ca3e7['define'](_0xf1c0('0x8'),attributes,{'tableName':_0xf1c0('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js
index 8b6ca5f..c37a40c 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 _0x8794=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch'];(function(_0x17789b,_0x4ad07b){var _0x2e64b6=function(_0x55f445){while(--_0x55f445){_0x17789b['push'](_0x17789b['shift']());}};_0x2e64b6(++_0x4ad07b);}(_0x8794,0xc6));var _0x4879=function(_0x1b2971,_0xc76e70){_0x1b2971=_0x1b2971-0x0;var _0x2882d1=_0x8794[_0x1b2971];return _0x2882d1;};'use strict';var _=require(_0x4879('0x0'));var util=require('util');var moment=require(_0x4879('0x1'));var BPromise=require(_0x4879('0x2'));var rs=require(_0x4879('0x3'));var fs=require('fs');var Redis=require(_0x4879('0x4'));var db=require(_0x4879('0x5'))['db'];var utils=require(_0x4879('0x6'));var logger=require(_0x4879('0x7'))(_0x4879('0x8'));var config=require('../../config/environment');var jayson=require(_0x4879('0x9'));var client=jayson[_0x4879('0xa')][_0x4879('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2681f6,_0x129f33,_0x64803b){return new BPromise(function(_0x3a726d,_0x2cd9ca){return client[_0x4879('0xc')](_0x2681f6,_0x64803b)['then'](function(_0x29c5ca){logger['info'](_0x4879('0xd'),_0x129f33,_0x4879('0xe'));logger[_0x4879('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x129f33,'request\x20sent',JSON['stringify'](_0x29c5ca));if(_0x29c5ca[_0x4879('0x10')]){if(_0x29c5ca[_0x4879('0x10')][_0x4879('0x11')]===0x1f4){logger[_0x4879('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x129f33,_0x29c5ca[_0x4879('0x10')][_0x4879('0x12')]);return _0x2cd9ca(_0x29c5ca[_0x4879('0x10')][_0x4879('0x12')]);}logger[_0x4879('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x129f33,_0x29c5ca[_0x4879('0x10')][_0x4879('0x12')]);return _0x3a726d(_0x29c5ca['error'][_0x4879('0x12')]);}else{logger[_0x4879('0x13')](_0x4879('0xd'),_0x129f33,'request\x20sent');_0x3a726d(_0x29c5ca[_0x4879('0x14')][_0x4879('0x12')]);}})[_0x4879('0x15')](function(_0x1aada8){logger[_0x4879('0x10')](_0x4879('0xd'),_0x129f33,_0x1aada8);_0x2cd9ca(_0x1aada8);});});}
\ No newline at end of file
+var _0x55b6=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a38a3,_0x3f13bc){var _0x4034fa=function(_0x11141f){while(--_0x11141f){_0x2a38a3['push'](_0x2a38a3['shift']());}};_0x4034fa(++_0x3f13bc);}(_0x55b6,0x74));var _0x655b=function(_0x18a79c,_0x1e3536){_0x18a79c=_0x18a79c-0x0;var _0x365cf3=_0x55b6[_0x18a79c];return _0x365cf3;};'use strict';var _=require(_0x655b('0x0'));var util=require(_0x655b('0x1'));var moment=require(_0x655b('0x2'));var BPromise=require(_0x655b('0x3'));var rs=require(_0x655b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x655b('0x5'));var config=require(_0x655b('0x6'));var jayson=require(_0x655b('0x7'));var client=jayson['client'][_0x655b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2f46e0,_0x1318ea,_0x19ee25){return new BPromise(function(_0x2f972b,_0x258620){return client[_0x655b('0x9')](_0x2f46e0,_0x19ee25)[_0x655b('0xa')](function(_0x1b104a){logger['info'](_0x655b('0xb'),_0x1318ea,_0x655b('0xc'));logger[_0x655b('0xd')](_0x655b('0xe'),_0x1318ea,_0x655b('0xc'),JSON[_0x655b('0xf')](_0x1b104a));if(_0x1b104a[_0x655b('0x10')]){if(_0x1b104a[_0x655b('0x10')][_0x655b('0x11')]===0x1f4){logger[_0x655b('0x10')](_0x655b('0xb'),_0x1318ea,_0x1b104a[_0x655b('0x10')][_0x655b('0x12')]);return _0x258620(_0x1b104a[_0x655b('0x10')][_0x655b('0x12')]);}logger[_0x655b('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1318ea,_0x1b104a[_0x655b('0x10')][_0x655b('0x12')]);return _0x2f972b(_0x1b104a[_0x655b('0x10')][_0x655b('0x12')]);}else{logger[_0x655b('0x13')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1318ea,_0x655b('0xc'));_0x2f972b(_0x1b104a[_0x655b('0x14')][_0x655b('0x12')]);}})[_0x655b('0x15')](function(_0xc77331){logger[_0x655b('0x10')](_0x655b('0xb'),_0x1318ea,_0xc77331);_0x258620(_0xc77331);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index 5c1110c..fa92706 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(_0xd9e9d3,_0x124002){var _0x1d860d=function(_0x37c8e5){while(--_0x37c8e5){_0xd9e9d3['push'](_0xd9e9d3['shift']());}};_0x1d860d(++_0x124002);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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(_0x2715d9,_0x4d2846){var _0x4d0b12=function(_0x26914e){while(--_0x26914e){_0x2715d9['push'](_0x2715d9['shift']());}};_0x4d0b12(++_0x4d2846);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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 3963023..3f287a7 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 _0x7fee=['name','TEXT','sequelize','exports','STRING'];(function(_0x2e183b,_0x112c86){var _0x9d4842=function(_0x38b269){while(--_0x38b269){_0x2e183b['push'](_0x2e183b['shift']());}};_0x9d4842(++_0x112c86);}(_0x7fee,0x1a6));var _0xe7fe=function(_0x541260,_0x4c7f2e){_0x541260=_0x541260-0x0;var _0x1dd2b5=_0x7fee[_0x541260];return _0x1dd2b5;};'use strict';var Sequelize=require(_0xe7fe('0x0'));module[_0xe7fe('0x1')]={'name':{'type':Sequelize[_0xe7fe('0x2')],'allowNull':![],'unique':_0xe7fe('0x3')},'table':{'type':Sequelize[_0xe7fe('0x2')]},'metric':{'type':Sequelize[_0xe7fe('0x4')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0xb9be=['name','TEXT','sequelize','exports','STRING'];(function(_0x4708fa,_0x4cac01){var _0x2831ea=function(_0x58f98e){while(--_0x58f98e){_0x4708fa['push'](_0x4708fa['shift']());}};_0x2831ea(++_0x4cac01);}(_0xb9be,0xc5));var _0xeb9b=function(_0x3df9dd,_0x26f5cd){_0x3df9dd=_0x3df9dd-0x0;var _0x4f11e4=_0xb9be[_0x3df9dd];return _0x4f11e4;};'use strict';var Sequelize=require(_0xeb9b('0x0'));module[_0xeb9b('0x1')]={'name':{'type':Sequelize[_0xeb9b('0x2')],'allowNull':![],'unique':_0xeb9b('0x3')},'table':{'type':Sequelize[_0xeb9b('0x2')]},'metric':{'type':Sequelize[_0xeb9b('0x4')]},'description':{'type':Sequelize[_0xeb9b('0x2')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 2d2643b..baec7f5 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 _0xabce=['includeAll','rows','show','params','intersection','length','include','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','limit','count','offset','Content-Range','apply','reject','save','update','then','get','Metrics','UserProfileResource','destroy','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','type','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','order','filter','merge','VIRTUAL','options'];(function(_0x21647b,_0x1d4436){var _0x3e9644=function(_0x3823c6){while(--_0x3823c6){_0x21647b['push'](_0x21647b['shift']());}};_0x3e9644(++_0x1d4436);}(_0xabce,0x103));var _0xeabc=function(_0x1eda20,_0x1149f4){_0x1eda20=_0x1eda20-0x0;var _0x31b953=_0xabce[_0x1eda20];return _0x31b953;};'use strict';var emlformat=require(_0xeabc('0x0'));var rimraf=require(_0xeabc('0x1'));var zipdir=require(_0xeabc('0x2'));var jsonpatch=require(_0xeabc('0x3'));var rp=require(_0xeabc('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeabc('0x5'));var util=require(_0xeabc('0x6'));var path=require(_0xeabc('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xeabc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeabc('0x9'));var squel=require('squel');var crypto=require(_0xeabc('0xa'));var jsforce=require(_0xeabc('0xb'));var deskjs=require(_0xeabc('0xc'));var toCsv=require('to-csv');var querystring=require(_0xeabc('0xd'));var Papa=require(_0xeabc('0xe'));var Redis=require(_0xeabc('0xf'));var authService=require(_0xeabc('0x10'));var qs=require(_0xeabc('0x11'));var as=require(_0xeabc('0x12'));var hardwareService=require(_0xeabc('0x13'));var logger=require(_0xeabc('0x14'))(_0xeabc('0x15'));var utils=require(_0xeabc('0x16'));var config=require(_0xeabc('0x17'));var licenseUtil=require(_0xeabc('0x18'));var db=require(_0xeabc('0x19'))['db'];function respondWithStatusCode(_0x3fd0b5,_0x36a92e){_0x36a92e=_0x36a92e||0xcc;return function(_0xcfbf06){if(_0xcfbf06){return _0x3fd0b5['sendStatus'](_0x36a92e);}return _0x3fd0b5[_0xeabc('0x1a')](_0x36a92e)[_0xeabc('0x1b')]();};}function respondWithResult(_0x3251c6,_0x55f0de){_0x55f0de=_0x55f0de||0xc8;return function(_0x5f4ee8){if(_0x5f4ee8){return _0x3251c6[_0xeabc('0x1a')](_0x55f0de)[_0xeabc('0x1c')](_0x5f4ee8);}};}function respondWithFilteredResult(_0x326bac,_0x53d5cb){return function(_0xf913d7){if(_0xf913d7){var _0x638976=typeof _0x53d5cb['offset']==='undefined'&&typeof _0x53d5cb[_0xeabc('0x1d')]==='undefined';var _0x3d0e21=_0xf913d7[_0xeabc('0x1e')];var _0x58a3c0=_0x638976?0x0:_0x53d5cb[_0xeabc('0x1f')];var _0x31dd53=_0x638976?_0xf913d7[_0xeabc('0x1e')]:_0x53d5cb[_0xeabc('0x1f')]+_0x53d5cb[_0xeabc('0x1d')];var _0x5d92e5;if(_0x31dd53>=_0x3d0e21){_0x31dd53=_0x3d0e21;_0x5d92e5=0xc8;}else{_0x5d92e5=0xce;}_0x326bac[_0xeabc('0x1a')](_0x5d92e5);return _0x326bac['set'](_0xeabc('0x20'),_0x58a3c0+'-'+_0x31dd53+'/'+_0x3d0e21)[_0xeabc('0x1c')](_0xf913d7);}return null;};}function patchUpdates(_0x502947){return function(_0x28063a){try{jsonpatch[_0xeabc('0x21')](_0x28063a,_0x502947,!![]);}catch(_0x254590){return BPromise[_0xeabc('0x22')](_0x254590);}return _0x28063a[_0xeabc('0x23')]();};}function saveUpdates(_0x4e99a4,_0xecdbf){return function(_0x10c675){if(_0x10c675){return _0x10c675[_0xeabc('0x24')](_0x4e99a4)['then'](function(_0x457f27){return _0x457f27;});}return null;};}function removeEntity(_0x3854d2,_0x214953){return function(_0x319119){if(_0x319119){return _0x319119['destroy']()[_0xeabc('0x25')](function(){var _0x480440=_0x319119[_0xeabc('0x26')]({'plain':!![]});var _0x4d4e29=_0xeabc('0x27');return db[_0xeabc('0x28')][_0xeabc('0x29')]({'where':{'type':_0x4d4e29,'resourceId':_0x480440['id']}})[_0xeabc('0x25')](function(){return _0x319119;});})[_0xeabc('0x25')](function(){_0x3854d2[_0xeabc('0x1a')](0xcc)[_0xeabc('0x1b')]();});}};}function handleEntityNotFound(_0x4c2693,_0x5b2934){return function(_0x459c8a){if(!_0x459c8a){_0x4c2693['sendStatus'](0x194);}return _0x459c8a;};}function handleError(_0x3c1b5b,_0x2b342c){_0x2b342c=_0x2b342c||0x1f4;return function(_0x48fb52){logger[_0xeabc('0x2a')](_0x48fb52[_0xeabc('0x2b')]);if(_0x48fb52[_0xeabc('0x2c')]){delete _0x48fb52[_0xeabc('0x2c')];}_0x3c1b5b[_0xeabc('0x1a')](_0x2b342c)[_0xeabc('0x2d')](_0x48fb52);};}exports[_0xeabc('0x2e')]=function(_0x38dc0a,_0x2915c1){var _0x5ebb86={},_0x5b34dd={},_0x5bb1f1={'count':0x0,'rows':[]};var _0x2f03e8=_[_0xeabc('0x2f')](db[_0xeabc('0x30')][_0xeabc('0x31')],function(_0x73c8d4){return{'name':_0x73c8d4[_0xeabc('0x32')],'type':_0x73c8d4[_0xeabc('0x33')]['key']};});_0x5b34dd[_0xeabc('0x34')]=_[_0xeabc('0x2f')](_0x2f03e8,_0xeabc('0x2c'));_0x5b34dd['query']=_[_0xeabc('0x35')](_0x38dc0a[_0xeabc('0x36')]);_0x5b34dd[_0xeabc('0x37')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],_0x5b34dd[_0xeabc('0x36')]);_0x5ebb86[_0xeabc('0x38')]=_['intersection'](_0x5b34dd[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x38dc0a['query']['fields']));_0x5ebb86[_0xeabc('0x38')]=_0x5ebb86[_0xeabc('0x38')]['length']?_0x5ebb86[_0xeabc('0x38')]:_0x5b34dd[_0xeabc('0x34')];if(!_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3a')](_0xeabc('0x3b'))){_0x5ebb86['limit']=qs[_0xeabc('0x1d')](_0x38dc0a['query'][_0xeabc('0x1d')]);_0x5ebb86[_0xeabc('0x1f')]=qs[_0xeabc('0x1f')](_0x38dc0a['query']['offset']);}_0x5ebb86[_0xeabc('0x3c')]=qs['sort'](_0x38dc0a[_0xeabc('0x36')]['sort']);_0x5ebb86['where']=qs['filters'](_['pick'](_0x38dc0a[_0xeabc('0x36')],_0x5b34dd['filters']),_0x2f03e8);if(_0x38dc0a[_0xeabc('0x36')][_0xeabc('0x3d')]){_0x5ebb86['where']=_[_0xeabc('0x3e')](_0x5ebb86['where'],{'$or':_[_0xeabc('0x2f')](_0x2f03e8,function(_0x58aafe){if(_0x58aafe[_0xeabc('0x33')]!==_0xeabc('0x3f')){var _0xeeef02={};_0xeeef02[_0x58aafe['name']]={'$like':'%'+_0x38dc0a['query']['filter']+'%'};return _0xeeef02;}})});}_0x5ebb86=_[_0xeabc('0x3e')]({},_0x5ebb86,_0x38dc0a[_0xeabc('0x40')]);var _0xafa59b={'where':_0x5ebb86['where']};return db['AnalyticMetric'][_0xeabc('0x1e')](_0xafa59b)[_0xeabc('0x25')](function(_0x5e9cb3){_0x5bb1f1[_0xeabc('0x1e')]=_0x5e9cb3;if(_0x38dc0a['query'][_0xeabc('0x41')]){_0x5ebb86['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x5ebb86);})[_0xeabc('0x25')](function(_0x37c926){_0x5bb1f1[_0xeabc('0x42')]=_0x37c926;return _0x5bb1f1;})[_0xeabc('0x25')](respondWithFilteredResult(_0x2915c1,_0x5ebb86))['catch'](handleError(_0x2915c1,null));};exports[_0xeabc('0x43')]=function(_0x555d26,_0x7d5add){var _0x1a4bbe={'raw':!![],'where':{'id':_0x555d26[_0xeabc('0x44')]['id']}},_0x3a7807={};_0x3a7807[_0xeabc('0x34')]=_['keys'](db['AnalyticMetric'][_0xeabc('0x31')]);_0x3a7807['query']=_[_0xeabc('0x35')](_0x555d26[_0xeabc('0x36')]);_0x3a7807['filters']=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],_0x3a7807[_0xeabc('0x36')]);_0x1a4bbe[_0xeabc('0x38')]=_[_0xeabc('0x45')](_0x3a7807[_0xeabc('0x34')],qs[_0xeabc('0x39')](_0x555d26['query'][_0xeabc('0x39')]));_0x1a4bbe[_0xeabc('0x38')]=_0x1a4bbe[_0xeabc('0x38')][_0xeabc('0x46')]?_0x1a4bbe[_0xeabc('0x38')]:_0x3a7807[_0xeabc('0x34')];if(_0x555d26[_0xeabc('0x36')][_0xeabc('0x41')]){_0x1a4bbe[_0xeabc('0x47')]=[{'all':!![]}];}_0x1a4bbe=_[_0xeabc('0x3e')]({},_0x1a4bbe,_0x555d26['options']);return db[_0xeabc('0x30')][_0xeabc('0x48')](_0x1a4bbe)[_0xeabc('0x25')](handleEntityNotFound(_0x7d5add,null))[_0xeabc('0x25')](respondWithResult(_0x7d5add,null))[_0xeabc('0x49')](handleError(_0x7d5add,null));};exports[_0xeabc('0x4a')]=function(_0x268d95,_0x48df43){return db[_0xeabc('0x30')][_0xeabc('0x4a')](_0x268d95[_0xeabc('0x4b')],{})[_0xeabc('0x25')](function(_0x47440e){var _0x58e2c1=_0x268d95[_0xeabc('0x4c')][_0xeabc('0x26')]({'plain':!![]});if(!_0x58e2c1)throw new Error(_0xeabc('0x4d'));if(_0x58e2c1[_0xeabc('0x4e')]==='user'){var _0x400b82=_0x47440e[_0xeabc('0x26')]({'plain':!![]});var _0x568847=_0xeabc('0x27');return db['UserProfileSection'][_0xeabc('0x48')]({'where':{'name':_0x568847,'userProfileId':_0x58e2c1['userProfileId']},'raw':!![]})[_0xeabc('0x25')](function(_0x2ec94c){if(_0x2ec94c&&_0x2ec94c[_0xeabc('0x4f')]===0x0){return db[_0xeabc('0x28')][_0xeabc('0x4a')]({'name':_0x400b82[_0xeabc('0x2c')],'resourceId':_0x400b82['id'],'type':_0x2ec94c[_0xeabc('0x2c')],'sectionId':_0x2ec94c['id']},{})[_0xeabc('0x25')](function(){return _0x47440e;});}else{return _0x47440e;}})[_0xeabc('0x49')](function(_0x6423f3){logger['error'](_0xeabc('0x50'),_0x6423f3);throw _0x6423f3;});}return _0x47440e;})[_0xeabc('0x25')](respondWithResult(_0x48df43,0xc9))[_0xeabc('0x49')](handleError(_0x48df43,null));};exports[_0xeabc('0x24')]=function(_0x555d6b,_0x1cef45){if(_0x555d6b[_0xeabc('0x4b')]['id']){delete _0x555d6b[_0xeabc('0x4b')]['id'];}return db[_0xeabc('0x30')]['find']({'where':{'id':_0x555d6b[_0xeabc('0x44')]['id']}})[_0xeabc('0x25')](handleEntityNotFound(_0x1cef45,null))[_0xeabc('0x25')](saveUpdates(_0x555d6b[_0xeabc('0x4b')],null))[_0xeabc('0x25')](respondWithResult(_0x1cef45,null))[_0xeabc('0x49')](handleError(_0x1cef45,null));};exports[_0xeabc('0x29')]=function(_0x3ff38c,_0x17acf8){return db['AnalyticMetric'][_0xeabc('0x48')]({'where':{'id':_0x3ff38c['params']['id']}})['then'](handleEntityNotFound(_0x17acf8,null))['then'](removeEntity(_0x17acf8,null))[_0xeabc('0x49')](handleError(_0x17acf8,null));};
\ No newline at end of file
+var _0x24ca=['find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','limit','undefined','count','offset','set','apply','reject','save','update','then','destroy','get','Metrics','UserProfileResource','sendStatus','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params'];(function(_0x3dde35,_0x2459ee){var _0x23f33d=function(_0x2cf59e){while(--_0x2cf59e){_0x3dde35['push'](_0x3dde35['shift']());}};_0x23f33d(++_0x2459ee);}(_0x24ca,0x1bc));var _0xa24c=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x24ca[_0x2df724];return _0x1b2504;};'use strict';var emlformat=require(_0xa24c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa24c('0x1'));var jsonpatch=require(_0xa24c('0x2'));var rp=require(_0xa24c('0x3'));var moment=require('moment');var BPromise=require(_0xa24c('0x4'));var Mustache=require(_0xa24c('0x5'));var util=require(_0xa24c('0x6'));var path=require(_0xa24c('0x7'));var sox=require(_0xa24c('0x8'));var csv=require(_0xa24c('0x9'));var ejs=require(_0xa24c('0xa'));var fs=require('fs');var fs_extra=require(_0xa24c('0xb'));var _=require(_0xa24c('0xc'));var squel=require(_0xa24c('0xd'));var crypto=require(_0xa24c('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xa24c('0xf'));var toCsv=require(_0xa24c('0x9'));var querystring=require(_0xa24c('0x10'));var Papa=require('papaparse');var Redis=require(_0xa24c('0x11'));var authService=require(_0xa24c('0x12'));var qs=require(_0xa24c('0x13'));var as=require(_0xa24c('0x14'));var hardwareService=require(_0xa24c('0x15'));var logger=require(_0xa24c('0x16'))(_0xa24c('0x17'));var utils=require(_0xa24c('0x18'));var config=require(_0xa24c('0x19'));var licenseUtil=require('../../config/license/util');var db=require(_0xa24c('0x1a'))['db'];function respondWithStatusCode(_0x11090c,_0xcee4fe){_0xcee4fe=_0xcee4fe||0xcc;return function(_0x2c2af8){if(_0x2c2af8){return _0x11090c['sendStatus'](_0xcee4fe);}return _0x11090c[_0xa24c('0x1b')](_0xcee4fe)[_0xa24c('0x1c')]();};}function respondWithResult(_0x26ff28,_0x2fcd8b){_0x2fcd8b=_0x2fcd8b||0xc8;return function(_0x1cb08e){if(_0x1cb08e){return _0x26ff28[_0xa24c('0x1b')](_0x2fcd8b)[_0xa24c('0x1d')](_0x1cb08e);}};}function respondWithFilteredResult(_0x5d4727,_0x47a063){return function(_0xb80781){if(_0xb80781){var _0x87aa90=typeof _0x47a063['offset']==='undefined'&&typeof _0x47a063[_0xa24c('0x1e')]===_0xa24c('0x1f');var _0x5c479e=_0xb80781[_0xa24c('0x20')];var _0x5de3e6=_0x87aa90?0x0:_0x47a063[_0xa24c('0x21')];var _0x2a610a=_0x87aa90?_0xb80781[_0xa24c('0x20')]:_0x47a063[_0xa24c('0x21')]+_0x47a063['limit'];var _0x16d363;if(_0x2a610a>=_0x5c479e){_0x2a610a=_0x5c479e;_0x16d363=0xc8;}else{_0x16d363=0xce;}_0x5d4727[_0xa24c('0x1b')](_0x16d363);return _0x5d4727[_0xa24c('0x22')]('Content-Range',_0x5de3e6+'-'+_0x2a610a+'/'+_0x5c479e)['json'](_0xb80781);}return null;};}function patchUpdates(_0x506424){return function(_0x4cd77e){try{jsonpatch[_0xa24c('0x23')](_0x4cd77e,_0x506424,!![]);}catch(_0x174b69){return BPromise[_0xa24c('0x24')](_0x174b69);}return _0x4cd77e[_0xa24c('0x25')]();};}function saveUpdates(_0x51a275,_0x30ec21){return function(_0x5f299e){if(_0x5f299e){return _0x5f299e[_0xa24c('0x26')](_0x51a275)[_0xa24c('0x27')](function(_0x4a1cda){return _0x4a1cda;});}return null;};}function removeEntity(_0x346ee8,_0x363d52){return function(_0x43a0c0){if(_0x43a0c0){return _0x43a0c0[_0xa24c('0x28')]()[_0xa24c('0x27')](function(){var _0x47e0eb=_0x43a0c0[_0xa24c('0x29')]({'plain':!![]});var _0x5cc9cb=_0xa24c('0x2a');return db[_0xa24c('0x2b')][_0xa24c('0x28')]({'where':{'type':_0x5cc9cb,'resourceId':_0x47e0eb['id']}})['then'](function(){return _0x43a0c0;});})[_0xa24c('0x27')](function(){_0x346ee8[_0xa24c('0x1b')](0xcc)[_0xa24c('0x1c')]();});}};}function handleEntityNotFound(_0x314121,_0x11e4e0){return function(_0x3ad0e6){if(!_0x3ad0e6){_0x314121[_0xa24c('0x2c')](0x194);}return _0x3ad0e6;};}function handleError(_0x5b23f4,_0xa0c48e){_0xa0c48e=_0xa0c48e||0x1f4;return function(_0x28675f){logger[_0xa24c('0x2d')](_0x28675f[_0xa24c('0x2e')]);if(_0x28675f['name']){delete _0x28675f[_0xa24c('0x2f')];}_0x5b23f4[_0xa24c('0x1b')](_0xa0c48e)[_0xa24c('0x30')](_0x28675f);};}exports['index']=function(_0x15eaaf,_0x3dcb1b){var _0x253d83={},_0x4ae35c={},_0x245fb2={'count':0x0,'rows':[]};var _0x5e0226=_[_0xa24c('0x31')](db[_0xa24c('0x32')][_0xa24c('0x33')],function(_0x5d025a){return{'name':_0x5d025a[_0xa24c('0x34')],'type':_0x5d025a[_0xa24c('0x35')][_0xa24c('0x36')]};});_0x4ae35c['model']=_[_0xa24c('0x31')](_0x5e0226,'name');_0x4ae35c[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x15eaaf['query']);_0x4ae35c['filters']=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],_0x4ae35c[_0xa24c('0x37')]);_0x253d83[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x4ae35c[_0xa24c('0x3a')],qs[_0xa24c('0x3c')](_0x15eaaf['query'][_0xa24c('0x3c')]));_0x253d83[_0xa24c('0x3b')]=_0x253d83[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x253d83[_0xa24c('0x3b')]:_0x4ae35c[_0xa24c('0x3a')];if(!_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x3e')](_0xa24c('0x3f'))){_0x253d83[_0xa24c('0x1e')]=qs['limit'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x1e')]);_0x253d83[_0xa24c('0x21')]=qs[_0xa24c('0x21')](_0x15eaaf['query']['offset']);}_0x253d83[_0xa24c('0x40')]=qs['sort'](_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x41')]);_0x253d83[_0xa24c('0x42')]=qs[_0xa24c('0x43')](_[_0xa24c('0x44')](_0x15eaaf['query'],_0x4ae35c['filters']),_0x5e0226);if(_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]){_0x253d83[_0xa24c('0x42')]=_[_0xa24c('0x46')](_0x253d83[_0xa24c('0x42')],{'$or':_[_0xa24c('0x31')](_0x5e0226,function(_0x5080d0){if(_0x5080d0['type']!==_0xa24c('0x47')){var _0x1ce83e={};_0x1ce83e[_0x5080d0[_0xa24c('0x2f')]]={'$like':'%'+_0x15eaaf[_0xa24c('0x37')][_0xa24c('0x45')]+'%'};return _0x1ce83e;}})});}_0x253d83=_['merge']({},_0x253d83,_0x15eaaf[_0xa24c('0x48')]);var _0x7895e={'where':_0x253d83['where']};return db['AnalyticMetric'][_0xa24c('0x20')](_0x7895e)[_0xa24c('0x27')](function(_0x231eea){_0x245fb2['count']=_0x231eea;if(_0x15eaaf['query'][_0xa24c('0x49')]){_0x253d83[_0xa24c('0x4a')]=[{'all':!![]}];}return db[_0xa24c('0x32')][_0xa24c('0x4b')](_0x253d83);})[_0xa24c('0x27')](function(_0x1b7faf){_0x245fb2[_0xa24c('0x4c')]=_0x1b7faf;return _0x245fb2;})[_0xa24c('0x27')](respondWithFilteredResult(_0x3dcb1b,_0x253d83))['catch'](handleError(_0x3dcb1b,null));};exports['show']=function(_0x430ba3,_0x44f7d4){var _0x455256={'raw':!![],'where':{'id':_0x430ba3[_0xa24c('0x4d')]['id']}},_0x5972d7={};_0x5972d7[_0xa24c('0x3a')]=_[_0xa24c('0x38')](db[_0xa24c('0x32')][_0xa24c('0x33')]);_0x5972d7[_0xa24c('0x37')]=_[_0xa24c('0x38')](_0x430ba3[_0xa24c('0x37')]);_0x5972d7[_0xa24c('0x43')]=_[_0xa24c('0x39')](_0x5972d7['model'],_0x5972d7[_0xa24c('0x37')]);_0x455256[_0xa24c('0x3b')]=_[_0xa24c('0x39')](_0x5972d7['model'],qs[_0xa24c('0x3c')](_0x430ba3[_0xa24c('0x37')][_0xa24c('0x3c')]));_0x455256[_0xa24c('0x3b')]=_0x455256[_0xa24c('0x3b')][_0xa24c('0x3d')]?_0x455256[_0xa24c('0x3b')]:_0x5972d7[_0xa24c('0x3a')];if(_0x430ba3[_0xa24c('0x37')][_0xa24c('0x49')]){_0x455256[_0xa24c('0x4a')]=[{'all':!![]}];}_0x455256=_['merge']({},_0x455256,_0x430ba3[_0xa24c('0x48')]);return db[_0xa24c('0x32')][_0xa24c('0x4e')](_0x455256)[_0xa24c('0x27')](handleEntityNotFound(_0x44f7d4,null))[_0xa24c('0x27')](respondWithResult(_0x44f7d4,null))[_0xa24c('0x4f')](handleError(_0x44f7d4,null));};exports[_0xa24c('0x50')]=function(_0x2250b9,_0x184179){return db['AnalyticMetric']['create'](_0x2250b9[_0xa24c('0x51')],{})['then'](function(_0xc078ef){var _0x1f436c=_0x2250b9['user'][_0xa24c('0x29')]({'plain':!![]});if(!_0x1f436c)throw new Error(_0xa24c('0x52'));if(_0x1f436c[_0xa24c('0x53')]==='user'){var _0x55978e=_0xc078ef[_0xa24c('0x29')]({'plain':!![]});var _0x5ba726=_0xa24c('0x2a');return db[_0xa24c('0x54')][_0xa24c('0x4e')]({'where':{'name':_0x5ba726,'userProfileId':_0x1f436c[_0xa24c('0x55')]},'raw':!![]})[_0xa24c('0x27')](function(_0x1fa739){if(_0x1fa739&&_0x1fa739[_0xa24c('0x56')]===0x0){return db[_0xa24c('0x2b')][_0xa24c('0x50')]({'name':_0x55978e[_0xa24c('0x2f')],'resourceId':_0x55978e['id'],'type':_0x1fa739['name'],'sectionId':_0x1fa739['id']},{})[_0xa24c('0x27')](function(){return _0xc078ef;});}else{return _0xc078ef;}})[_0xa24c('0x4f')](function(_0x233f8e){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x233f8e);throw _0x233f8e;});}return _0xc078ef;})['then'](respondWithResult(_0x184179,0xc9))[_0xa24c('0x4f')](handleError(_0x184179,null));};exports['update']=function(_0x4757ff,_0x21d0fc){if(_0x4757ff['body']['id']){delete _0x4757ff[_0xa24c('0x51')]['id'];}return db[_0xa24c('0x32')][_0xa24c('0x4e')]({'where':{'id':_0x4757ff[_0xa24c('0x4d')]['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x21d0fc,null))[_0xa24c('0x27')](saveUpdates(_0x4757ff[_0xa24c('0x51')],null))[_0xa24c('0x27')](respondWithResult(_0x21d0fc,null))['catch'](handleError(_0x21d0fc,null));};exports[_0xa24c('0x28')]=function(_0x47af80,_0x5abd45){return db['AnalyticMetric']['find']({'where':{'id':_0x47af80['params']['id']}})[_0xa24c('0x27')](handleEntityNotFound(_0x5abd45,null))['then'](removeEntity(_0x5abd45,null))[_0xa24c('0x4f')](handleError(_0x5abd45,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 188e6f3..59b7354 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 _0xa49e=['AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./analyticMetric.attributes','exports','define'];(function(_0xb538c9,_0x491188){var _0x320ee0=function(_0x1586b8){while(--_0x1586b8){_0xb538c9['push'](_0xb538c9['shift']());}};_0x320ee0(++_0x491188);}(_0xa49e,0x1de));var _0xea49=function(_0xf3ae5e,_0x385757){_0xf3ae5e=_0xf3ae5e-0x0;var _0x353c92=_0xa49e[_0xf3ae5e];return _0x353c92;};'use strict';var _=require(_0xea49('0x0'));var util=require(_0xea49('0x1'));var logger=require(_0xea49('0x2'))(_0xea49('0x3'));var moment=require(_0xea49('0x4'));var BPromise=require(_0xea49('0x5'));var rp=require(_0xea49('0x6'));var fs=require('fs');var path=require(_0xea49('0x7'));var rimraf=require('rimraf');var config=require(_0xea49('0x8'));var attributes=require(_0xea49('0x9'));module[_0xea49('0xa')]=function(_0x56a45a,_0x1b831c){return _0x56a45a[_0xea49('0xb')](_0xea49('0xc'),attributes,{'tableName':_0xea49('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f44=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','lodash','util','api','moment'];(function(_0x4057a1,_0x228a4a){var _0x292356=function(_0xed9d12){while(--_0xed9d12){_0x4057a1['push'](_0x4057a1['shift']());}};_0x292356(++_0x228a4a);}(_0x6f44,0x1ea));var _0x46f4=function(_0xae9a70,_0x1e6543){_0xae9a70=_0xae9a70-0x0;var _0x545cd6=_0x6f44[_0xae9a70];return _0x545cd6;};'use strict';var _=require(_0x46f4('0x0'));var util=require(_0x46f4('0x1'));var logger=require('../../config/logger')(_0x46f4('0x2'));var moment=require(_0x46f4('0x3'));var BPromise=require(_0x46f4('0x4'));var rp=require(_0x46f4('0x5'));var fs=require('fs');var path=require(_0x46f4('0x6'));var rimraf=require(_0x46f4('0x7'));var config=require(_0x46f4('0x8'));var attributes=require(_0x46f4('0x9'));module[_0x46f4('0xa')]=function(_0x57f1a9,_0x169a5a){return _0x57f1a9[_0x46f4('0xb')](_0x46f4('0xc'),attributes,{'tableName':'analytics_metrics','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js
index 2efedd2..c6e7c1c 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 _0x220b=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment'];(function(_0x3aaf69,_0x318ff9){var _0x4542c6=function(_0x5d1369){while(--_0x5d1369){_0x3aaf69['push'](_0x3aaf69['shift']());}};_0x4542c6(++_0x318ff9);}(_0x220b,0x1cb));var _0xb220=function(_0x564821,_0x4d037e){_0x564821=_0x564821-0x0;var _0x2b604d=_0x220b[_0x564821];return _0x2b604d;};'use strict';var _=require(_0xb220('0x0'));var util=require(_0xb220('0x1'));var moment=require(_0xb220('0x2'));var BPromise=require('bluebird');var rs=require(_0xb220('0x3'));var fs=require('fs');var Redis=require(_0xb220('0x4'));var db=require(_0xb220('0x5'))['db'];var utils=require(_0xb220('0x6'));var logger=require(_0xb220('0x7'))(_0xb220('0x8'));var config=require(_0xb220('0x9'));var jayson=require(_0xb220('0xa'));var client=jayson['client'][_0xb220('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x339870,_0x548465,_0x284e29){return new BPromise(function(_0x4db7d8,_0x39559b){return client[_0xb220('0xc')](_0x339870,_0x284e29)[_0xb220('0xd')](function(_0x51e51c){logger[_0xb220('0xe')](_0xb220('0xf'),_0x548465,_0xb220('0x10'));logger[_0xb220('0x11')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x548465,'request\x20sent',JSON['stringify'](_0x51e51c));if(_0x51e51c[_0xb220('0x12')]){if(_0x51e51c[_0xb220('0x12')][_0xb220('0x13')]===0x1f4){logger['error'](_0xb220('0xf'),_0x548465,_0x51e51c[_0xb220('0x12')][_0xb220('0x14')]);return _0x39559b(_0x51e51c['error'][_0xb220('0x14')]);}logger[_0xb220('0x12')](_0xb220('0xf'),_0x548465,_0x51e51c['error'][_0xb220('0x14')]);return _0x4db7d8(_0x51e51c[_0xb220('0x12')]['message']);}else{logger[_0xb220('0xe')](_0xb220('0xf'),_0x548465,_0xb220('0x10'));_0x4db7d8(_0x51e51c[_0xb220('0x15')][_0xb220('0x14')]);}})['catch'](function(_0x33640e){logger['error'](_0xb220('0xf'),_0x548465,_0x33640e);_0x39559b(_0x33640e);});});}
\ No newline at end of file
+var _0x6933=['jayson/promise','client','http','request','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','randomstring','../../config/utils','../../config/logger','../../config/environment'];(function(_0x37cb20,_0x4eb76f){var _0x593727=function(_0x1bbe0c){while(--_0x1bbe0c){_0x37cb20['push'](_0x37cb20['shift']());}};_0x593727(++_0x4eb76f);}(_0x6933,0x6d));var _0x3693=function(_0x25ddfa,_0xbc4e37){_0x25ddfa=_0x25ddfa-0x0;var _0x10ce7b=_0x6933[_0x25ddfa];return _0x10ce7b;};'use strict';var _=require(_0x3693('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3693('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3693('0x2'));var logger=require(_0x3693('0x3'))('rpc');var config=require(_0x3693('0x4'));var jayson=require(_0x3693('0x5'));var client=jayson[_0x3693('0x6')][_0x3693('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x16da33,_0x12ef3f,_0x375392){return new BPromise(function(_0x523a47,_0x2b038e){return client[_0x3693('0x8')](_0x16da33,_0x375392)['then'](function(_0x42b214){logger[_0x3693('0x9')](_0x3693('0xa'),_0x12ef3f,'request\x20sent');logger[_0x3693('0xb')](_0x3693('0xc'),_0x12ef3f,_0x3693('0xd'),JSON[_0x3693('0xe')](_0x42b214));if(_0x42b214[_0x3693('0xf')]){if(_0x42b214[_0x3693('0xf')]['code']===0x1f4){logger[_0x3693('0xf')](_0x3693('0xa'),_0x12ef3f,_0x42b214[_0x3693('0xf')][_0x3693('0x10')]);return _0x2b038e(_0x42b214['error']['message']);}logger[_0x3693('0xf')]('AnalyticMetric,\x20%s,\x20%s',_0x12ef3f,_0x42b214[_0x3693('0xf')][_0x3693('0x10')]);return _0x523a47(_0x42b214[_0x3693('0xf')][_0x3693('0x10')]);}else{logger['info'](_0x3693('0xa'),_0x12ef3f,_0x3693('0xd'));_0x523a47(_0x42b214[_0x3693('0x11')][_0x3693('0x10')]);}})[_0x3693('0x12')](function(_0x105caa){logger[_0x3693('0xf')](_0x3693('0xa'),_0x12ef3f,_0x105caa);_0x2b038e(_0x105caa);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index da3b0aa..9cf139c 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 _0x7217=['Router','fs-extra','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x483c41,_0xcd46c9){var _0x38986d=function(_0x1b3f64){while(--_0x1b3f64){_0x483c41['push'](_0x483c41['shift']());}};_0x38986d(++_0xcd46c9);}(_0x7217,0x19e));var _0x7721=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x7217[_0x4b7b62];return _0x2280df;};'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('0xd')]('/',auth[_0x7721('0x9')](),controller[_0x7721('0xe')]);router[_0x7721('0xf')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller['update']);router[_0x7721('0x10')](_0x7721('0xb'),auth[_0x7721('0x9')](),controller[_0x7721('0x11')]);module[_0x7721('0x12')]=router;
\ No newline at end of file
+var _0x80c3=['isAuthenticated','post','put','update','delete','destroy','exports','multer','connect-timeout','Router','fs-extra','../../components/auth/service','get','/:id'];(function(_0x5b3f54,_0x228613){var _0x5c6bab=function(_0x2a7b4e){while(--_0x2a7b4e){_0x5b3f54['push'](_0x5b3f54['shift']());}};_0x5c6bab(++_0x228613);}(_0x80c3,0x18f));var _0x380c=function(_0x46a38b,_0x16ffb5){_0x46a38b=_0x46a38b-0x0;var _0x346e75=_0x80c3[_0x46a38b];return _0x346e75;};'use strict';var multer=require(_0x380c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x380c('0x1'));var express=require('express');var router=express[_0x380c('0x2')]();var fs_extra=require(_0x380c('0x3'));var auth=require(_0x380c('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./analyticMetric.controller');router[_0x380c('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x380c('0x5')](_0x380c('0x6'),auth[_0x380c('0x7')](),controller['show']);router[_0x380c('0x8')]('/',auth[_0x380c('0x7')](),controller['create']);router[_0x380c('0x9')](_0x380c('0x6'),auth['isAuthenticated'](),controller[_0x380c('0xa')]);router[_0x380c('0xb')](_0x380c('0x6'),auth['isAuthenticated'](),controller[_0x380c('0xc')]);module[_0x380c('0xd')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index d53fdcd..624fcd3 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 _0x2289=['sequelize','exports','TEXT'];(function(_0x533bc2,_0x2ec43a){var _0x56d98a=function(_0x10841b){while(--_0x10841b){_0x533bc2['push'](_0x533bc2['shift']());}};_0x56d98a(++_0x2ec43a);}(_0x2289,0xc6));var _0x9228=function(_0x41661c,_0x1b188b){_0x41661c=_0x41661c-0x0;var _0x42128d=_0x2289[_0x41661c];return _0x42128d;};'use strict';var Sequelize=require(_0x9228('0x0'));module[_0x9228('0x1')]={'tree':{'type':Sequelize[_0x9228('0x2')],'allowNull':![]}};
\ No newline at end of file
+var _0xa100=['sequelize','TEXT'];(function(_0x42daca,_0x275738){var _0x94bcf4=function(_0x17bbb2){while(--_0x17bbb2){_0x42daca['push'](_0x42daca['shift']());}};_0x94bcf4(++_0x275738);}(_0xa100,0xb6));var _0x0a10=function(_0x2e8660,_0x5ca0c2){_0x2e8660=_0x2e8660-0x0;var _0x3dc331=_0xa100[_0x2e8660];return _0x3dc331;};'use strict';var Sequelize=require(_0x0a10('0x0'));module['exports']={'tree':{'type':Sequelize[_0x0a10('0x1')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index 8152e90..959e112 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 _0xfbb8=['type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','filter','includeAll','findAll','catch','params','include','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','fs-extra','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','end','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','fieldName'];(function(_0x1409ea,_0x4544d0){var _0x53c013=function(_0x5c09fc){while(--_0x5c09fc){_0x1409ea['push'](_0x1409ea['shift']());}};_0x53c013(++_0x4544d0);}(_0xfbb8,0x13d));var _0x8fbb=function(_0xee37f1,_0x189f43){_0xee37f1=_0xee37f1-0x0;var _0x37fd54=_0xfbb8[_0xee37f1];return _0x37fd54;};'use strict';var emlformat=require(_0x8fbb('0x0'));var rimraf=require(_0x8fbb('0x1'));var zipdir=require(_0x8fbb('0x2'));var jsonpatch=require(_0x8fbb('0x3'));var rp=require(_0x8fbb('0x4'));var moment=require('moment');var BPromise=require(_0x8fbb('0x5'));var Mustache=require(_0x8fbb('0x6'));var util=require(_0x8fbb('0x7'));var path=require(_0x8fbb('0x8'));var sox=require('sox');var csv=require(_0x8fbb('0x9'));var ejs=require(_0x8fbb('0xa'));var fs=require('fs');var fs_extra=require(_0x8fbb('0xb'));var _=require(_0x8fbb('0xc'));var squel=require('squel');var crypto=require(_0x8fbb('0xd'));var jsforce=require(_0x8fbb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8fbb('0x9'));var querystring=require(_0x8fbb('0xf'));var Papa=require(_0x8fbb('0x10'));var Redis=require('ioredis');var authService=require(_0x8fbb('0x11'));var qs=require(_0x8fbb('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8fbb('0x13'));var logger=require(_0x8fbb('0x14'))(_0x8fbb('0x15'));var utils=require(_0x8fbb('0x16'));var config=require('../../config/environment');var licenseUtil=require(_0x8fbb('0x17'));var db=require(_0x8fbb('0x18'))['db'];function respondWithStatusCode(_0x330fff,_0x55b941){_0x55b941=_0x55b941||0xcc;return function(_0x41c021){if(_0x41c021){return _0x330fff[_0x8fbb('0x19')](_0x55b941);}return _0x330fff[_0x8fbb('0x1a')](_0x55b941)['end']();};}function respondWithResult(_0x4fe654,_0xe07a6d){_0xe07a6d=_0xe07a6d||0xc8;return function(_0xf19f60){if(_0xf19f60){return _0x4fe654[_0x8fbb('0x1a')](_0xe07a6d)[_0x8fbb('0x1b')](_0xf19f60);}};}function respondWithFilteredResult(_0x296dbc,_0x3d434e){return function(_0x50d558){if(_0x50d558){var _0x274359=typeof _0x3d434e[_0x8fbb('0x1c')]===_0x8fbb('0x1d')&&typeof _0x3d434e[_0x8fbb('0x1e')]==='undefined';var _0x327c3f=_0x50d558[_0x8fbb('0x1f')];var _0x1ae67=_0x274359?0x0:_0x3d434e[_0x8fbb('0x1c')];var _0x130148=_0x274359?_0x50d558[_0x8fbb('0x1f')]:_0x3d434e[_0x8fbb('0x1c')]+_0x3d434e['limit'];var _0x424b1d;if(_0x130148>=_0x327c3f){_0x130148=_0x327c3f;_0x424b1d=0xc8;}else{_0x424b1d=0xce;}_0x296dbc['status'](_0x424b1d);return _0x296dbc[_0x8fbb('0x20')](_0x8fbb('0x21'),_0x1ae67+'-'+_0x130148+'/'+_0x327c3f)[_0x8fbb('0x1b')](_0x50d558);}return null;};}function patchUpdates(_0x5c7f07){return function(_0x55bdf9){try{jsonpatch[_0x8fbb('0x22')](_0x55bdf9,_0x5c7f07,!![]);}catch(_0x1574b9){return BPromise[_0x8fbb('0x23')](_0x1574b9);}return _0x55bdf9[_0x8fbb('0x24')]();};}function saveUpdates(_0x11c5af,_0x1c69e6){return function(_0x3da977){if(_0x3da977){return _0x3da977[_0x8fbb('0x25')](_0x11c5af)['then'](function(_0x3d57c4){return _0x3d57c4;});}return null;};}function removeEntity(_0x37b3b2,_0x4db88f){return function(_0x4133fa){if(_0x4133fa){return _0x4133fa['destroy']()[_0x8fbb('0x26')](function(){_0x37b3b2[_0x8fbb('0x1a')](0xcc)[_0x8fbb('0x27')]();});}};}function handleEntityNotFound(_0x5c5d58,_0x455b74){return function(_0x5e6e39){if(!_0x5e6e39){_0x5c5d58[_0x8fbb('0x19')](0x194);}return _0x5e6e39;};}function handleError(_0x419ed7,_0x424b3d){_0x424b3d=_0x424b3d||0x1f4;return function(_0x8adb52){logger[_0x8fbb('0x28')](_0x8adb52[_0x8fbb('0x29')]);if(_0x8adb52[_0x8fbb('0x2a')]){delete _0x8adb52['name'];}_0x419ed7['status'](_0x424b3d)['send'](_0x8adb52);};}exports[_0x8fbb('0x2b')]=function(_0x4b926a,_0x3e4c2b){var _0x87cf77={},_0x19fd59={},_0x2624f8={'count':0x0,'rows':[]};var _0x5770ca=_[_0x8fbb('0x2c')](db[_0x8fbb('0x2d')][_0x8fbb('0x2e')],function(_0x19820e){return{'name':_0x19820e[_0x8fbb('0x2f')],'type':_0x19820e[_0x8fbb('0x30')][_0x8fbb('0x31')]};});_0x19fd59[_0x8fbb('0x32')]=_['map'](_0x5770ca,_0x8fbb('0x2a'));_0x19fd59[_0x8fbb('0x33')]=_[_0x8fbb('0x34')](_0x4b926a[_0x8fbb('0x33')]);_0x19fd59[_0x8fbb('0x35')]=_[_0x8fbb('0x36')](_0x19fd59[_0x8fbb('0x32')],_0x19fd59['query']);_0x87cf77[_0x8fbb('0x37')]=_[_0x8fbb('0x36')](_0x19fd59[_0x8fbb('0x32')],qs[_0x8fbb('0x38')](_0x4b926a[_0x8fbb('0x33')][_0x8fbb('0x38')]));_0x87cf77['attributes']=_0x87cf77[_0x8fbb('0x37')][_0x8fbb('0x39')]?_0x87cf77['attributes']:_0x19fd59[_0x8fbb('0x32')];if(!_0x4b926a[_0x8fbb('0x33')][_0x8fbb('0x3a')]('nolimit')){_0x87cf77['limit']=qs[_0x8fbb('0x1e')](_0x4b926a[_0x8fbb('0x33')][_0x8fbb('0x1e')]);_0x87cf77[_0x8fbb('0x1c')]=qs[_0x8fbb('0x1c')](_0x4b926a[_0x8fbb('0x33')][_0x8fbb('0x1c')]);}_0x87cf77['order']=qs[_0x8fbb('0x3b')](_0x4b926a['query'][_0x8fbb('0x3b')]);_0x87cf77[_0x8fbb('0x3c')]=qs['filters'](_[_0x8fbb('0x3d')](_0x4b926a[_0x8fbb('0x33')],_0x19fd59[_0x8fbb('0x35')]),_0x5770ca);if(_0x4b926a['query']['filter']){_0x87cf77[_0x8fbb('0x3c')]=_[_0x8fbb('0x3e')](_0x87cf77[_0x8fbb('0x3c')],{'$or':_[_0x8fbb('0x2c')](_0x5770ca,function(_0x1c66cb){if(_0x1c66cb[_0x8fbb('0x30')]!=='VIRTUAL'){var _0x3f60bf={};_0x3f60bf[_0x1c66cb[_0x8fbb('0x2a')]]={'$like':'%'+_0x4b926a[_0x8fbb('0x33')][_0x8fbb('0x3f')]+'%'};return _0x3f60bf;}})});}_0x87cf77=_[_0x8fbb('0x3e')]({},_0x87cf77,_0x4b926a['options']);var _0x261968={'where':_0x87cf77[_0x8fbb('0x3c')]};return db[_0x8fbb('0x2d')][_0x8fbb('0x1f')](_0x261968)[_0x8fbb('0x26')](function(_0x28017e){_0x2624f8[_0x8fbb('0x1f')]=_0x28017e;if(_0x4b926a[_0x8fbb('0x33')][_0x8fbb('0x40')]){_0x87cf77['include']=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x8fbb('0x41')](_0x87cf77);})[_0x8fbb('0x26')](function(_0x3a17cd){_0x2624f8['rows']=_0x3a17cd;return _0x2624f8;})[_0x8fbb('0x26')](respondWithFilteredResult(_0x3e4c2b,_0x87cf77))[_0x8fbb('0x42')](handleError(_0x3e4c2b,null));};exports['show']=function(_0x7e1290,_0x5c6e27){var _0x27d6d5={'raw':!![],'where':{'id':_0x7e1290[_0x8fbb('0x43')]['id']}},_0x1dbcfe={};_0x1dbcfe[_0x8fbb('0x32')]=_[_0x8fbb('0x34')](db['AnalyticTreeReport']['rawAttributes']);_0x1dbcfe[_0x8fbb('0x33')]=_['keys'](_0x7e1290['query']);_0x1dbcfe[_0x8fbb('0x35')]=_['intersection'](_0x1dbcfe[_0x8fbb('0x32')],_0x1dbcfe[_0x8fbb('0x33')]);_0x27d6d5[_0x8fbb('0x37')]=_[_0x8fbb('0x36')](_0x1dbcfe[_0x8fbb('0x32')],qs[_0x8fbb('0x38')](_0x7e1290[_0x8fbb('0x33')][_0x8fbb('0x38')]));_0x27d6d5['attributes']=_0x27d6d5['attributes'][_0x8fbb('0x39')]?_0x27d6d5['attributes']:_0x1dbcfe['model'];if(_0x7e1290[_0x8fbb('0x33')][_0x8fbb('0x40')]){_0x27d6d5[_0x8fbb('0x44')]=[{'all':!![]}];}_0x27d6d5=_[_0x8fbb('0x3e')]({},_0x27d6d5,_0x7e1290['options']);return db[_0x8fbb('0x2d')][_0x8fbb('0x45')](_0x27d6d5)['then'](handleEntityNotFound(_0x5c6e27,null))[_0x8fbb('0x26')](respondWithResult(_0x5c6e27,null))['catch'](handleError(_0x5c6e27,null));};exports[_0x8fbb('0x46')]=function(_0xc97e19,_0xc109df){return db[_0x8fbb('0x2d')][_0x8fbb('0x46')](_0xc97e19['body'],{})[_0x8fbb('0x26')](respondWithResult(_0xc109df,0xc9))[_0x8fbb('0x42')](handleError(_0xc109df,null));};exports[_0x8fbb('0x25')]=function(_0x55a92e,_0x262986){if(_0x55a92e[_0x8fbb('0x47')]['id']){delete _0x55a92e[_0x8fbb('0x47')]['id'];}return db[_0x8fbb('0x2d')][_0x8fbb('0x45')]({'where':{'id':_0x55a92e[_0x8fbb('0x43')]['id']}})['then'](handleEntityNotFound(_0x262986,null))[_0x8fbb('0x26')](saveUpdates(_0x55a92e['body'],null))[_0x8fbb('0x26')](respondWithResult(_0x262986,null))[_0x8fbb('0x42')](handleError(_0x262986,null));};exports[_0x8fbb('0x48')]=function(_0x27faf3,_0x4409cf){return db[_0x8fbb('0x2d')][_0x8fbb('0x45')]({'where':{'id':_0x27faf3['params']['id']}})['then'](handleEntityNotFound(_0x4409cf,null))[_0x8fbb('0x26')](removeEntity(_0x4409cf,null))[_0x8fbb('0x42')](handleError(_0x4409cf,null));};
\ No newline at end of file
+var _0x1c73=['map','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','AnalyticTreeReport','include','findAll','rows','show','params','intersection','includeAll','find','catch','create','body','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','limit','undefined','count','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x1c73,0x106));var _0x31c7=function(_0x369ff2,_0x466a61){_0x369ff2=_0x369ff2-0x0;var _0xb53a59=_0x1c73[_0x369ff2];return _0xb53a59;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x31c7('0x0'));var jsonpatch=require(_0x31c7('0x1'));var rp=require(_0x31c7('0x2'));var moment=require(_0x31c7('0x3'));var BPromise=require(_0x31c7('0x4'));var Mustache=require(_0x31c7('0x5'));var util=require('util');var path=require(_0x31c7('0x6'));var sox=require('sox');var csv=require(_0x31c7('0x7'));var ejs=require(_0x31c7('0x8'));var fs=require('fs');var fs_extra=require(_0x31c7('0x9'));var _=require(_0x31c7('0xa'));var squel=require(_0x31c7('0xb'));var crypto=require(_0x31c7('0xc'));var jsforce=require(_0x31c7('0xd'));var deskjs=require(_0x31c7('0xe'));var toCsv=require(_0x31c7('0x7'));var querystring=require(_0x31c7('0xf'));var Papa=require(_0x31c7('0x10'));var Redis=require(_0x31c7('0x11'));var authService=require(_0x31c7('0x12'));var qs=require(_0x31c7('0x13'));var as=require(_0x31c7('0x14'));var hardwareService=require(_0x31c7('0x15'));var logger=require(_0x31c7('0x16'))(_0x31c7('0x17'));var utils=require(_0x31c7('0x18'));var config=require(_0x31c7('0x19'));var licenseUtil=require(_0x31c7('0x1a'));var db=require(_0x31c7('0x1b'))['db'];function respondWithStatusCode(_0x24ceea,_0x58e89e){_0x58e89e=_0x58e89e||0xcc;return function(_0x22a0ef){if(_0x22a0ef){return _0x24ceea[_0x31c7('0x1c')](_0x58e89e);}return _0x24ceea[_0x31c7('0x1d')](_0x58e89e)[_0x31c7('0x1e')]();};}function respondWithResult(_0x4c4a23,_0x1383da){_0x1383da=_0x1383da||0xc8;return function(_0x254b71){if(_0x254b71){return _0x4c4a23[_0x31c7('0x1d')](_0x1383da)['json'](_0x254b71);}};}function respondWithFilteredResult(_0x2125dd,_0x1d4750){return function(_0x47a196){if(_0x47a196){var _0x4d09c7=typeof _0x1d4750[_0x31c7('0x1f')]==='undefined'&&typeof _0x1d4750[_0x31c7('0x20')]===_0x31c7('0x21');var _0x310df7=_0x47a196[_0x31c7('0x22')];var _0x3c7faf=_0x4d09c7?0x0:_0x1d4750['offset'];var _0x203f1e=_0x4d09c7?_0x47a196['count']:_0x1d4750[_0x31c7('0x1f')]+_0x1d4750[_0x31c7('0x20')];var _0x45362b;if(_0x203f1e>=_0x310df7){_0x203f1e=_0x310df7;_0x45362b=0xc8;}else{_0x45362b=0xce;}_0x2125dd[_0x31c7('0x1d')](_0x45362b);return _0x2125dd[_0x31c7('0x23')](_0x31c7('0x24'),_0x3c7faf+'-'+_0x203f1e+'/'+_0x310df7)['json'](_0x47a196);}return null;};}function patchUpdates(_0x57b9b2){return function(_0x190830){try{jsonpatch[_0x31c7('0x25')](_0x190830,_0x57b9b2,!![]);}catch(_0x31d128){return BPromise[_0x31c7('0x26')](_0x31d128);}return _0x190830['save']();};}function saveUpdates(_0x4e5186,_0x34e220){return function(_0x2c3a7b){if(_0x2c3a7b){return _0x2c3a7b[_0x31c7('0x27')](_0x4e5186)[_0x31c7('0x28')](function(_0x528b1f){return _0x528b1f;});}return null;};}function removeEntity(_0x50c758,_0x38d60b){return function(_0x4e3576){if(_0x4e3576){return _0x4e3576[_0x31c7('0x29')]()[_0x31c7('0x28')](function(){_0x50c758[_0x31c7('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x43dd4e,_0x387630){return function(_0x580797){if(!_0x580797){_0x43dd4e['sendStatus'](0x194);}return _0x580797;};}function handleError(_0x52a892,_0x40f1bf){_0x40f1bf=_0x40f1bf||0x1f4;return function(_0x53cd57){logger[_0x31c7('0x2a')](_0x53cd57[_0x31c7('0x2b')]);if(_0x53cd57[_0x31c7('0x2c')]){delete _0x53cd57[_0x31c7('0x2c')];}_0x52a892['status'](_0x40f1bf)['send'](_0x53cd57);};}exports[_0x31c7('0x2d')]=function(_0x44bfe2,_0x2f2bb8){var _0x503512={},_0x5bb7ba={},_0x2a45f3={'count':0x0,'rows':[]};var _0x4f678d=_[_0x31c7('0x2e')](db['AnalyticTreeReport'][_0x31c7('0x2f')],function(_0x44b6f1){return{'name':_0x44b6f1['fieldName'],'type':_0x44b6f1[_0x31c7('0x30')][_0x31c7('0x31')]};});_0x5bb7ba[_0x31c7('0x32')]=_[_0x31c7('0x2e')](_0x4f678d,_0x31c7('0x2c'));_0x5bb7ba[_0x31c7('0x33')]=_[_0x31c7('0x34')](_0x44bfe2[_0x31c7('0x33')]);_0x5bb7ba[_0x31c7('0x35')]=_['intersection'](_0x5bb7ba['model'],_0x5bb7ba[_0x31c7('0x33')]);_0x503512[_0x31c7('0x36')]=_['intersection'](_0x5bb7ba['model'],qs['fields'](_0x44bfe2[_0x31c7('0x33')][_0x31c7('0x37')]));_0x503512[_0x31c7('0x36')]=_0x503512[_0x31c7('0x36')][_0x31c7('0x38')]?_0x503512[_0x31c7('0x36')]:_0x5bb7ba['model'];if(!_0x44bfe2[_0x31c7('0x33')][_0x31c7('0x39')](_0x31c7('0x3a'))){_0x503512['limit']=qs[_0x31c7('0x20')](_0x44bfe2[_0x31c7('0x33')][_0x31c7('0x20')]);_0x503512[_0x31c7('0x1f')]=qs[_0x31c7('0x1f')](_0x44bfe2[_0x31c7('0x33')][_0x31c7('0x1f')]);}_0x503512['order']=qs[_0x31c7('0x3b')](_0x44bfe2['query'][_0x31c7('0x3b')]);_0x503512[_0x31c7('0x3c')]=qs[_0x31c7('0x35')](_[_0x31c7('0x3d')](_0x44bfe2[_0x31c7('0x33')],_0x5bb7ba[_0x31c7('0x35')]),_0x4f678d);if(_0x44bfe2[_0x31c7('0x33')][_0x31c7('0x3e')]){_0x503512['where']=_[_0x31c7('0x3f')](_0x503512[_0x31c7('0x3c')],{'$or':_[_0x31c7('0x2e')](_0x4f678d,function(_0x10ecc7){if(_0x10ecc7[_0x31c7('0x30')]!==_0x31c7('0x40')){var _0x2f13b0={};_0x2f13b0[_0x10ecc7[_0x31c7('0x2c')]]={'$like':'%'+_0x44bfe2['query'][_0x31c7('0x3e')]+'%'};return _0x2f13b0;}})});}_0x503512=_[_0x31c7('0x3f')]({},_0x503512,_0x44bfe2['options']);var _0x16e6b5={'where':_0x503512['where']};return db[_0x31c7('0x41')]['count'](_0x16e6b5)[_0x31c7('0x28')](function(_0x33caa2){_0x2a45f3['count']=_0x33caa2;if(_0x44bfe2['query']['includeAll']){_0x503512[_0x31c7('0x42')]=[{'all':!![]}];}return db[_0x31c7('0x41')][_0x31c7('0x43')](_0x503512);})[_0x31c7('0x28')](function(_0x5e1133){_0x2a45f3[_0x31c7('0x44')]=_0x5e1133;return _0x2a45f3;})['then'](respondWithFilteredResult(_0x2f2bb8,_0x503512))['catch'](handleError(_0x2f2bb8,null));};exports[_0x31c7('0x45')]=function(_0x4d36f0,_0x11e6b2){var _0x503740={'raw':!![],'where':{'id':_0x4d36f0[_0x31c7('0x46')]['id']}},_0x45a159={};_0x45a159[_0x31c7('0x32')]=_[_0x31c7('0x34')](db[_0x31c7('0x41')]['rawAttributes']);_0x45a159[_0x31c7('0x33')]=_['keys'](_0x4d36f0[_0x31c7('0x33')]);_0x45a159[_0x31c7('0x35')]=_[_0x31c7('0x47')](_0x45a159[_0x31c7('0x32')],_0x45a159[_0x31c7('0x33')]);_0x503740['attributes']=_[_0x31c7('0x47')](_0x45a159[_0x31c7('0x32')],qs['fields'](_0x4d36f0[_0x31c7('0x33')]['fields']));_0x503740[_0x31c7('0x36')]=_0x503740[_0x31c7('0x36')][_0x31c7('0x38')]?_0x503740[_0x31c7('0x36')]:_0x45a159[_0x31c7('0x32')];if(_0x4d36f0['query'][_0x31c7('0x48')]){_0x503740[_0x31c7('0x42')]=[{'all':!![]}];}_0x503740=_[_0x31c7('0x3f')]({},_0x503740,_0x4d36f0['options']);return db['AnalyticTreeReport'][_0x31c7('0x49')](_0x503740)[_0x31c7('0x28')](handleEntityNotFound(_0x11e6b2,null))[_0x31c7('0x28')](respondWithResult(_0x11e6b2,null))[_0x31c7('0x4a')](handleError(_0x11e6b2,null));};exports[_0x31c7('0x4b')]=function(_0x33b50c,_0x1da546){return db[_0x31c7('0x41')][_0x31c7('0x4b')](_0x33b50c[_0x31c7('0x4c')],{})['then'](respondWithResult(_0x1da546,0xc9))['catch'](handleError(_0x1da546,null));};exports['update']=function(_0x3e5671,_0x1016c1){if(_0x3e5671['body']['id']){delete _0x3e5671[_0x31c7('0x4c')]['id'];}return db[_0x31c7('0x41')]['find']({'where':{'id':_0x3e5671[_0x31c7('0x46')]['id']}})[_0x31c7('0x28')](handleEntityNotFound(_0x1016c1,null))[_0x31c7('0x28')](saveUpdates(_0x3e5671[_0x31c7('0x4c')],null))[_0x31c7('0x28')](respondWithResult(_0x1016c1,null))[_0x31c7('0x4a')](handleError(_0x1016c1,null));};exports[_0x31c7('0x29')]=function(_0x53e425,_0x17cd17){return db['AnalyticTreeReport']['find']({'where':{'id':_0x53e425[_0x31c7('0x46')]['id']}})['then'](handleEntityNotFound(_0x17cd17,null))[_0x31c7('0x28')](removeEntity(_0x17cd17,null))[_0x31c7('0x4a')](handleError(_0x17cd17,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 60a2b07..d897e62 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 _0x5759=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','analytics_report_trees','lodash','../../config/logger','moment'];(function(_0x5c1b69,_0x6868f6){var _0x191c50=function(_0x412a20){while(--_0x412a20){_0x5c1b69['push'](_0x5c1b69['shift']());}};_0x191c50(++_0x6868f6);}(_0x5759,0x1a4));var _0x9575=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0x5759[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0x9575('0x0'));var util=require('util');var logger=require(_0x9575('0x1'))('api');var moment=require(_0x9575('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9575('0x3'));var rimraf=require(_0x9575('0x4'));var config=require(_0x9575('0x5'));var attributes=require(_0x9575('0x6'));module[_0x9575('0x7')]=function(_0x588043,_0x2f4835){return _0x588043['define']('AnalyticTreeReport',attributes,{'tableName':_0x9575('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6cb8=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','util','../../config/logger','api'];(function(_0x34a8c8,_0x31e259){var _0x1fe6e5=function(_0x30f28d){while(--_0x30f28d){_0x34a8c8['push'](_0x34a8c8['shift']());}};_0x1fe6e5(++_0x31e259);}(_0x6cb8,0x141));var _0x86cb=function(_0x9d4f38,_0x1e0c77){_0x9d4f38=_0x9d4f38-0x0;var _0x1f211d=_0x6cb8[_0x9d4f38];return _0x1f211d;};'use strict';var _=require('lodash');var util=require(_0x86cb('0x0'));var logger=require(_0x86cb('0x1'))(_0x86cb('0x2'));var moment=require(_0x86cb('0x3'));var BPromise=require(_0x86cb('0x4'));var rp=require(_0x86cb('0x5'));var fs=require('fs');var path=require(_0x86cb('0x6'));var rimraf=require(_0x86cb('0x7'));var config=require(_0x86cb('0x8'));var attributes=require(_0x86cb('0x9'));module[_0x86cb('0xa')]=function(_0xcd813d,_0x540f2a){return _0xcd813d[_0x86cb('0xb')]('AnalyticTreeReport',attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js
index ec2aa6d..5d41d94 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 _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(_0x5a29c4,_0x30c0d2){var _0x2ae511=function(_0x241494){while(--_0x241494){_0x5a29c4['push'](_0x5a29c4['shift']());}};_0x2ae511(++_0x30c0d2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4bc042,_0x487f0e){_0x4bc042=_0x4bc042-0x0;var _0x162842=_0x5f2f[_0x4bc042];return _0x162842;};'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
+var _0xdb28=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','lodash','util'];(function(_0x437286,_0x4559e1){var _0x16aade=function(_0x2cd071){while(--_0x2cd071){_0x437286['push'](_0x437286['shift']());}};_0x16aade(++_0x4559e1);}(_0xdb28,0x106));var _0x8db2=function(_0x5c5ffc,_0x27dccd){_0x5c5ffc=_0x5c5ffc-0x0;var _0x4b698c=_0xdb28[_0x5c5ffc];return _0x4b698c;};'use strict';var _=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var moment=require(_0x8db2('0x2'));var BPromise=require(_0x8db2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8db2('0x4'));var db=require(_0x8db2('0x5'))['db'];var utils=require(_0x8db2('0x6'));var logger=require(_0x8db2('0x7'))(_0x8db2('0x8'));var config=require('../../config/environment');var jayson=require(_0x8db2('0x9'));var client=jayson[_0x8db2('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x494b40,_0x477f50,_0x46932f){return new BPromise(function(_0x131537,_0x29f698){return client[_0x8db2('0xb')](_0x494b40,_0x46932f)[_0x8db2('0xc')](function(_0x126c78){logger['info'](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));logger[_0x8db2('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x477f50,_0x8db2('0xe'),JSON[_0x8db2('0x10')](_0x126c78));if(_0x126c78['error']){if(_0x126c78[_0x8db2('0x11')][_0x8db2('0x12')]===0x1f4){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')]['message']);return _0x29f698(_0x126c78['error'][_0x8db2('0x13')]);}logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);return _0x131537(_0x126c78[_0x8db2('0x11')][_0x8db2('0x13')]);}else{logger[_0x8db2('0x14')](_0x8db2('0xd'),_0x477f50,_0x8db2('0xe'));_0x131537(_0x126c78['result'][_0x8db2('0x13')]);}})[_0x8db2('0x15')](function(_0x48101e){logger[_0x8db2('0x11')](_0x8db2('0xd'),_0x477f50,_0x48101e);_0x29f698(_0x48101e);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 3aeadb9..90f51b3 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 _0xfc44=['isAuthenticated','index','show','post','put','/:id','delete','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticTreeReport.controller','get'];(function(_0x1d8b10,_0x9603a6){var _0x123f31=function(_0x675fd8){while(--_0x675fd8){_0x1d8b10['push'](_0x1d8b10['shift']());}};_0x123f31(++_0x9603a6);}(_0xfc44,0x16c));var _0x4fc4=function(_0x3d62ac,_0x163846){_0x3d62ac=_0x3d62ac-0x0;var _0x4a83ba=_0xfc44[_0x3d62ac];return _0x4a83ba;};'use strict';var multer=require(_0x4fc4('0x0'));var util=require(_0x4fc4('0x1'));var path=require(_0x4fc4('0x2'));var timeout=require(_0x4fc4('0x3'));var express=require('express');var router=express[_0x4fc4('0x4')]();var fs_extra=require(_0x4fc4('0x5'));var auth=require(_0x4fc4('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x4fc4('0x7'));var controller=require(_0x4fc4('0x8'));router[_0x4fc4('0x9')]('/',auth[_0x4fc4('0xa')](),controller[_0x4fc4('0xb')]);router[_0x4fc4('0x9')]('/:id',auth[_0x4fc4('0xa')](),controller[_0x4fc4('0xc')]);router[_0x4fc4('0xd')]('/',auth[_0x4fc4('0xa')](),controller['create']);router[_0x4fc4('0xe')](_0x4fc4('0xf'),auth[_0x4fc4('0xa')](),controller['update']);router[_0x4fc4('0x10')](_0x4fc4('0xf'),auth[_0x4fc4('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0xedb5=['show','post','create','update','destroy','multer','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated'];(function(_0x5609ba,_0x1b7c6c){var _0x202f01=function(_0x239a8a){while(--_0x239a8a){_0x5609ba['push'](_0x5609ba['shift']());}};_0x202f01(++_0x1b7c6c);}(_0xedb5,0x1bf));var _0x5edb=function(_0x4ffb07,_0x31b18b){_0x4ffb07=_0x4ffb07-0x0;var _0x37a523=_0xedb5[_0x4ffb07];return _0x37a523;};'use strict';var multer=require(_0x5edb('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5edb('0x1'));var express=require(_0x5edb('0x2'));var router=express[_0x5edb('0x3')]();var fs_extra=require(_0x5edb('0x4'));var auth=require(_0x5edb('0x5'));var interaction=require(_0x5edb('0x6'));var config=require(_0x5edb('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x5edb('0x8')]('/',auth['isAuthenticated'](),controller[_0x5edb('0x9')]);router['get'](_0x5edb('0xa'),auth[_0x5edb('0xb')](),controller[_0x5edb('0xc')]);router[_0x5edb('0xd')]('/',auth['isAuthenticated'](),controller[_0x5edb('0xe')]);router['put'](_0x5edb('0xa'),auth[_0x5edb('0xb')](),controller[_0x5edb('0xf')]);router['delete'](_0x5edb('0xa'),auth[_0x5edb('0xb')](),controller[_0x5edb('0x10')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index e202ea8..b62fd8c 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 _0xf120=['STRING','exports'];(function(_0x22c775,_0x340176){var _0x34c6d2=function(_0x3830f1){while(--_0x3830f1){_0x22c775['push'](_0x22c775['shift']());}};_0x34c6d2(++_0x340176);}(_0xf120,0x179));var _0x0f12=function(_0x571440,_0x13b255){_0x571440=_0x571440-0x0;var _0x53bcf5=_0xf120[_0x571440];return _0x53bcf5;};'use strict';var Sequelize=require('sequelize');module[_0x0f12('0x0')]={'name':{'type':Sequelize[_0x0f12('0x1')]},'basename':{'type':Sequelize[_0x0f12('0x1')]},'type':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x4853=['STRING','exports'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_0x4853,0x11d));var _0x3485=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4853[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');module[_0x3485('0x0')]={'name':{'type':Sequelize['STRING']},'basename':{'type':Sequelize[_0x3485('0x1')]},'type':{'type':Sequelize[_0x3485('0x1')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index aae9765..5b4d855 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 _0xb53b=['basename','file','mimetype','download','findOne','ChatOfflineMessageId','join','server/files/attachments/','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','then','destroy','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','include','find','clone','includeAll','get','omit','createdAt','updatedAt','body','create','update','originalname'];(function(_0x227c53,_0x549882){var _0x3e6e99=function(_0x5b89fd){while(--_0x5b89fd){_0x227c53['push'](_0x227c53['shift']());}};_0x3e6e99(++_0x549882);}(_0xb53b,0xc0));var _0xbb53=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xb53b[_0x29b609];return _0x54c952;};'use strict';var emlformat=require(_0xbb53('0x0'));var rimraf=require(_0xbb53('0x1'));var zipdir=require(_0xbb53('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbb53('0x3'));var moment=require(_0xbb53('0x4'));var BPromise=require(_0xbb53('0x5'));var Mustache=require(_0xbb53('0x6'));var util=require(_0xbb53('0x7'));var path=require(_0xbb53('0x8'));var sox=require('sox');var csv=require(_0xbb53('0x9'));var ejs=require(_0xbb53('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbb53('0xb'));var squel=require(_0xbb53('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xbb53('0xd'));var toCsv=require(_0xbb53('0x9'));var querystring=require(_0xbb53('0xe'));var Papa=require(_0xbb53('0xf'));var Redis=require(_0xbb53('0x10'));var authService=require(_0xbb53('0x11'));var qs=require(_0xbb53('0x12'));var as=require(_0xbb53('0x13'));var hardwareService=require(_0xbb53('0x14'));var logger=require(_0xbb53('0x15'))(_0xbb53('0x16'));var utils=require(_0xbb53('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xbb53('0x18'));var db=require(_0xbb53('0x19'))['db'];function respondWithStatusCode(_0x480f81,_0x5a7085){_0x5a7085=_0x5a7085||0xcc;return function(_0x34e769){if(_0x34e769){return _0x480f81['sendStatus'](_0x5a7085);}return _0x480f81[_0xbb53('0x1a')](_0x5a7085)[_0xbb53('0x1b')]();};}function respondWithResult(_0x5d07f0,_0x334b07){_0x334b07=_0x334b07||0xc8;return function(_0x42eab2){if(_0x42eab2){return _0x5d07f0[_0xbb53('0x1a')](_0x334b07)[_0xbb53('0x1c')](_0x42eab2);}};}function respondWithFilteredResult(_0x272243,_0x36124a){return function(_0x3bfb95){if(_0x3bfb95){var _0x2b4cd0=typeof _0x36124a[_0xbb53('0x1d')]==='undefined'&&typeof _0x36124a[_0xbb53('0x1e')]===_0xbb53('0x1f');var _0x1c561=_0x3bfb95[_0xbb53('0x20')];var _0x117368=_0x2b4cd0?0x0:_0x36124a[_0xbb53('0x1d')];var _0x23ce96=_0x2b4cd0?_0x3bfb95['count']:_0x36124a[_0xbb53('0x1d')]+_0x36124a[_0xbb53('0x1e')];var _0x52ca4c;if(_0x23ce96>=_0x1c561){_0x23ce96=_0x1c561;_0x52ca4c=0xc8;}else{_0x52ca4c=0xce;}_0x272243[_0xbb53('0x1a')](_0x52ca4c);return _0x272243[_0xbb53('0x21')](_0xbb53('0x22'),_0x117368+'-'+_0x23ce96+'/'+_0x1c561)[_0xbb53('0x1c')](_0x3bfb95);}return null;};}function patchUpdates(_0x27b48b){return function(_0x372b03){try{jsonpatch[_0xbb53('0x23')](_0x372b03,_0x27b48b,!![]);}catch(_0x4ae033){return BPromise['reject'](_0x4ae033);}return _0x372b03['save']();};}function saveUpdates(_0x503f37,_0x4e8b5a){return function(_0x3d25af){if(_0x3d25af){return _0x3d25af['update'](_0x503f37)[_0xbb53('0x24')](function(_0x10f295){return _0x10f295;});}return null;};}function removeEntity(_0x5b74c3,_0x245c58){return function(_0x3b73ca){if(_0x3b73ca){return _0x3b73ca[_0xbb53('0x25')]()['then'](function(){_0x5b74c3[_0xbb53('0x1a')](0xcc)[_0xbb53('0x1b')]();});}};}function handleEntityNotFound(_0x1f6352,_0x2b7231){return function(_0x247891){if(!_0x247891){_0x1f6352[_0xbb53('0x26')](0x194);}return _0x247891;};}function handleError(_0x24384b,_0x5685ef){_0x5685ef=_0x5685ef||0x1f4;return function(_0x5ea3a5){logger[_0xbb53('0x27')](_0x5ea3a5[_0xbb53('0x28')]);if(_0x5ea3a5[_0xbb53('0x29')]){delete _0x5ea3a5[_0xbb53('0x29')];}_0x24384b[_0xbb53('0x1a')](_0x5685ef)[_0xbb53('0x2a')](_0x5ea3a5);};}exports[_0xbb53('0x2b')]=function(_0x1165d6,_0xb106d6){var _0xe636b3={},_0x2796b4={},_0x7206cc={'count':0x0,'rows':[]};var _0x1f076d=_[_0xbb53('0x2c')](db[_0xbb53('0x2d')][_0xbb53('0x2e')],function(_0x57f99e){return{'name':_0x57f99e['fieldName'],'type':_0x57f99e[_0xbb53('0x2f')][_0xbb53('0x30')]};});_0x2796b4['model']=_[_0xbb53('0x2c')](_0x1f076d,'name');_0x2796b4[_0xbb53('0x31')]=_[_0xbb53('0x32')](_0x1165d6[_0xbb53('0x31')]);_0x2796b4['filters']=_['intersection'](_0x2796b4[_0xbb53('0x33')],_0x2796b4[_0xbb53('0x31')]);_0xe636b3[_0xbb53('0x34')]=_[_0xbb53('0x35')](_0x2796b4[_0xbb53('0x33')],qs[_0xbb53('0x36')](_0x1165d6[_0xbb53('0x31')][_0xbb53('0x36')]));_0xe636b3[_0xbb53('0x34')]=_0xe636b3[_0xbb53('0x34')][_0xbb53('0x37')]?_0xe636b3[_0xbb53('0x34')]:_0x2796b4[_0xbb53('0x33')];if(!_0x1165d6[_0xbb53('0x31')][_0xbb53('0x38')](_0xbb53('0x39'))){_0xe636b3[_0xbb53('0x1e')]=qs[_0xbb53('0x1e')](_0x1165d6[_0xbb53('0x31')]['limit']);_0xe636b3['offset']=qs[_0xbb53('0x1d')](_0x1165d6[_0xbb53('0x31')][_0xbb53('0x1d')]);}_0xe636b3[_0xbb53('0x3a')]=qs[_0xbb53('0x3b')](_0x1165d6[_0xbb53('0x31')][_0xbb53('0x3b')]);_0xe636b3[_0xbb53('0x3c')]=qs['filters'](_[_0xbb53('0x3d')](_0x1165d6['query'],_0x2796b4[_0xbb53('0x3e')]),_0x1f076d);if(_0x1165d6['query'][_0xbb53('0x3f')]){_0xe636b3[_0xbb53('0x3c')]=_[_0xbb53('0x40')](_0xe636b3[_0xbb53('0x3c')],{'$or':_[_0xbb53('0x2c')](_0x1f076d,function(_0x1272c7){if(_0x1272c7[_0xbb53('0x2f')]!==_0xbb53('0x41')){var _0xd84f69={};_0xd84f69[_0x1272c7['name']]={'$like':'%'+_0x1165d6[_0xbb53('0x31')][_0xbb53('0x3f')]+'%'};return _0xd84f69;}})});}_0xe636b3=_[_0xbb53('0x40')]({},_0xe636b3,_0x1165d6[_0xbb53('0x42')]);var _0x39543a={'where':_0xe636b3['where']};return db[_0xbb53('0x2d')][_0xbb53('0x20')](_0x39543a)[_0xbb53('0x24')](function(_0x563962){_0x7206cc['count']=_0x563962;if(_0x1165d6['query']['includeAll']){_0xe636b3['include']=[{'all':!![]}];}return db[_0xbb53('0x2d')][_0xbb53('0x43')](_0xe636b3);})[_0xbb53('0x24')](function(_0x455c47){_0x7206cc[_0xbb53('0x44')]=_0x455c47;return _0x7206cc;})[_0xbb53('0x24')](respondWithFilteredResult(_0xb106d6,_0xe636b3))[_0xbb53('0x45')](handleError(_0xb106d6,null));};exports[_0xbb53('0x46')]=function(_0x205b7c,_0x481a18){var _0x52efb5={'raw':!![],'where':{'id':_0x205b7c[_0xbb53('0x47')]['id']}},_0xe9c68a={};_0xe9c68a[_0xbb53('0x33')]=_[_0xbb53('0x32')](db[_0xbb53('0x2d')][_0xbb53('0x2e')]);_0xe9c68a[_0xbb53('0x31')]=_['keys'](_0x205b7c[_0xbb53('0x31')]);_0xe9c68a[_0xbb53('0x3e')]=_[_0xbb53('0x35')](_0xe9c68a[_0xbb53('0x33')],_0xe9c68a['query']);_0x52efb5[_0xbb53('0x34')]=_[_0xbb53('0x35')](_0xe9c68a[_0xbb53('0x33')],qs[_0xbb53('0x36')](_0x205b7c[_0xbb53('0x31')][_0xbb53('0x36')]));_0x52efb5[_0xbb53('0x34')]=_0x52efb5['attributes'][_0xbb53('0x37')]?_0x52efb5['attributes']:_0xe9c68a[_0xbb53('0x33')];if(_0x205b7c[_0xbb53('0x31')]['includeAll']){_0x52efb5[_0xbb53('0x48')]=[{'all':!![]}];}_0x52efb5=_[_0xbb53('0x40')]({},_0x52efb5,_0x205b7c[_0xbb53('0x42')]);return db[_0xbb53('0x2d')][_0xbb53('0x49')](_0x52efb5)[_0xbb53('0x24')](handleEntityNotFound(_0x481a18,null))['then'](respondWithResult(_0x481a18,null))['catch'](handleError(_0x481a18,null));};exports[_0xbb53('0x4a')]=function(_0x322bb7,_0x1871ad){var _0xb950d0={'where':{'id':_0x322bb7['params']['id']}},_0x26d599={};_0x26d599[_0xbb53('0x33')]=_[_0xbb53('0x32')](db[_0xbb53('0x2d')][_0xbb53('0x2e')]);_0xb950d0[_0xbb53('0x34')]=_[_0xbb53('0x35')](_0x26d599[_0xbb53('0x33')],qs['fields'](_0x322bb7[_0xbb53('0x31')]['fields']));_0xb950d0[_0xbb53('0x34')]=_0xb950d0[_0xbb53('0x34')][_0xbb53('0x37')]?_0xb950d0['attributes']:_0x26d599['model'];if(_0x322bb7[_0xbb53('0x31')][_0xbb53('0x4b')]){_0xb950d0[_0xbb53('0x48')]=[{'all':!![]}];}_0xb950d0=_[_0xbb53('0x40')]({},_0xb950d0,_0x322bb7[_0xbb53('0x42')]);return db[_0xbb53('0x2d')]['find'](_0xb950d0)[_0xbb53('0x24')](handleEntityNotFound(_0x1871ad,null))['then'](function(_0x3db0be){if(_0x3db0be){var _0x4e3f27=_0x3db0be[_0xbb53('0x4c')]({'plain':!![]});_0x4e3f27=qs[_0xbb53('0x4d')](_0x4e3f27,['id',_0xbb53('0x4e'),_0xbb53('0x4f')]);_0x322bb7[_0xbb53('0x50')]=_[_0xbb53('0x4d')](_0x322bb7['body'],['id','createdAt','updatedAt']);return db['Attachment'][_0xbb53('0x51')](_['merge'](_0x4e3f27,_0x322bb7[_0xbb53('0x50')]),{'include':_0x322bb7[_0xbb53('0x31')][_0xbb53('0x4b')]?[{'all':!![]}]:undefined});}})[_0xbb53('0x24')](respondWithResult(_0x1871ad,0xc9))[_0xbb53('0x45')](handleError(_0x1871ad,null));};exports[_0xbb53('0x52')]=function(_0x48b7b3,_0x38cbd0){if(_0x48b7b3[_0xbb53('0x50')]['id']){delete _0x48b7b3[_0xbb53('0x50')]['id'];}return db[_0xbb53('0x2d')]['find']({'where':{'id':_0x48b7b3['params']['id']}})[_0xbb53('0x24')](handleEntityNotFound(_0x38cbd0,null))[_0xbb53('0x24')](saveUpdates(_0x48b7b3['body'],null))[_0xbb53('0x24')](respondWithResult(_0x38cbd0,null))['catch'](handleError(_0x38cbd0,null));};exports[_0xbb53('0x25')]=function(_0x38a661,_0x2405bc){return db['Attachment'][_0xbb53('0x49')]({'where':{'id':_0x38a661['params']['id']}})[_0xbb53('0x24')](handleEntityNotFound(_0x2405bc,null))[_0xbb53('0x24')](removeEntity(_0x2405bc,null))['catch'](handleError(_0x2405bc,null));};exports[_0xbb53('0x51')]=function(_0x588c63,_0x2cd161,_0x5783a7){_0x588c63[_0xbb53('0x50')]['name']=_0x588c63['file'][_0xbb53('0x53')];_0x588c63[_0xbb53('0x50')][_0xbb53('0x54')]=_0x588c63[_0xbb53('0x55')]['filename'];_0x588c63[_0xbb53('0x50')][_0xbb53('0x2f')]=_0x588c63['file'][_0xbb53('0x56')];return db[_0xbb53('0x2d')][_0xbb53('0x51')](_0x588c63[_0xbb53('0x50')])['then'](respondWithResult(_0x2cd161,0xc9))[_0xbb53('0x45')](handleError(_0x2cd161,null));};exports[_0xbb53('0x57')]=function(_0x23288b,_0x1d8c86,_0x3187c2){return db[_0xbb53('0x2d')][_0xbb53('0x58')]({'where':{'id':_0x23288b[_0xbb53('0x47')]['id']},'raw':!![]})[_0xbb53('0x24')](handleEntityNotFound(_0x1d8c86,null))['then'](function(_0x57a1b8){if(_0x57a1b8){var _0xb492f5=_0x57a1b8[_0xbb53('0x59')]!==null;var _0x277300=path[_0xbb53('0x5a')](config['root'],_0xbb53('0x5b'));if(_0xb492f5){_0x277300=path[_0xbb53('0x5a')](_0x277300,'offline-chat/');}var _0x438ba1=path[_0xbb53('0x5a')](_0x277300,_0x57a1b8[_0xbb53('0x54')]);return _0x1d8c86[_0xbb53('0x57')](_0x438ba1);}})[_0xbb53('0x45')](handleError(_0x1d8c86,null));};
\ No newline at end of file
+var _0x57e9=['jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','find','get','createdAt','updatedAt','omit','body','create','params','file','originalname','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','basename','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','fs-extra','lodash','squel','crypto'];(function(_0x19d54e,_0x54aec7){var _0x3b9d70=function(_0xfb970c){while(--_0xfb970c){_0x19d54e['push'](_0x19d54e['shift']());}};_0x3b9d70(++_0x54aec7);}(_0x57e9,0x1ab));var _0x957e=function(_0x17f2df,_0x29d0fd){_0x17f2df=_0x17f2df-0x0;var _0x59b3c1=_0x57e9[_0x17f2df];return _0x59b3c1;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x957e('0x0'));var zipdir=require(_0x957e('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x957e('0x2'));var moment=require(_0x957e('0x3'));var BPromise=require(_0x957e('0x4'));var Mustache=require(_0x957e('0x5'));var util=require(_0x957e('0x6'));var path=require(_0x957e('0x7'));var sox=require(_0x957e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x957e('0x9'));var _=require(_0x957e('0xa'));var squel=require(_0x957e('0xb'));var crypto=require(_0x957e('0xc'));var jsforce=require(_0x957e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x957e('0xe'));var querystring=require(_0x957e('0xf'));var Papa=require(_0x957e('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x957e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x957e('0x12'));var logger=require(_0x957e('0x13'))(_0x957e('0x14'));var utils=require(_0x957e('0x15'));var config=require(_0x957e('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0x957e('0x17'))['db'];function respondWithStatusCode(_0x3fe3d7,_0x2df447){_0x2df447=_0x2df447||0xcc;return function(_0x271a5a){if(_0x271a5a){return _0x3fe3d7['sendStatus'](_0x2df447);}return _0x3fe3d7[_0x957e('0x18')](_0x2df447)[_0x957e('0x19')]();};}function respondWithResult(_0x5e6235,_0x5bfb36){_0x5bfb36=_0x5bfb36||0xc8;return function(_0x2bf67e){if(_0x2bf67e){return _0x5e6235[_0x957e('0x18')](_0x5bfb36)['json'](_0x2bf67e);}};}function respondWithFilteredResult(_0x3cdd0a,_0x9867ef){return function(_0x57bded){if(_0x57bded){var _0x85b7fe=typeof _0x9867ef[_0x957e('0x1a')]===_0x957e('0x1b')&&typeof _0x9867ef[_0x957e('0x1c')]===_0x957e('0x1b');var _0x39ed19=_0x57bded['count'];var _0x46bf8a=_0x85b7fe?0x0:_0x9867ef[_0x957e('0x1a')];var _0x34a368=_0x85b7fe?_0x57bded[_0x957e('0x1d')]:_0x9867ef[_0x957e('0x1a')]+_0x9867ef[_0x957e('0x1c')];var _0x50d278;if(_0x34a368>=_0x39ed19){_0x34a368=_0x39ed19;_0x50d278=0xc8;}else{_0x50d278=0xce;}_0x3cdd0a[_0x957e('0x18')](_0x50d278);return _0x3cdd0a[_0x957e('0x1e')](_0x957e('0x1f'),_0x46bf8a+'-'+_0x34a368+'/'+_0x39ed19)['json'](_0x57bded);}return null;};}function patchUpdates(_0x2f8fcf){return function(_0x1c7cc8){try{jsonpatch[_0x957e('0x20')](_0x1c7cc8,_0x2f8fcf,!![]);}catch(_0x531390){return BPromise['reject'](_0x531390);}return _0x1c7cc8[_0x957e('0x21')]();};}function saveUpdates(_0x21b78f,_0x49fd52){return function(_0x489b5e){if(_0x489b5e){return _0x489b5e[_0x957e('0x22')](_0x21b78f)[_0x957e('0x23')](function(_0x3c1300){return _0x3c1300;});}return null;};}function removeEntity(_0x5a58c5,_0x5e34ae){return function(_0x15bac3){if(_0x15bac3){return _0x15bac3[_0x957e('0x24')]()['then'](function(){_0x5a58c5[_0x957e('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x257299,_0x3af39a){return function(_0x2516bd){if(!_0x2516bd){_0x257299[_0x957e('0x25')](0x194);}return _0x2516bd;};}function handleError(_0xa166eb,_0xe4a855){_0xe4a855=_0xe4a855||0x1f4;return function(_0x558c0f){logger['error'](_0x558c0f[_0x957e('0x26')]);if(_0x558c0f[_0x957e('0x27')]){delete _0x558c0f['name'];}_0xa166eb[_0x957e('0x18')](_0xe4a855)[_0x957e('0x28')](_0x558c0f);};}exports[_0x957e('0x29')]=function(_0x115bba,_0x3080cf){var _0x529e8e={},_0x2253a4={},_0x1491cd={'count':0x0,'rows':[]};var _0x2af578=_[_0x957e('0x2a')](db[_0x957e('0x2b')][_0x957e('0x2c')],function(_0x3e1ba4){return{'name':_0x3e1ba4[_0x957e('0x2d')],'type':_0x3e1ba4[_0x957e('0x2e')][_0x957e('0x2f')]};});_0x2253a4['model']=_['map'](_0x2af578,_0x957e('0x27'));_0x2253a4['query']=_[_0x957e('0x30')](_0x115bba[_0x957e('0x31')]);_0x2253a4[_0x957e('0x32')]=_[_0x957e('0x33')](_0x2253a4[_0x957e('0x34')],_0x2253a4[_0x957e('0x31')]);_0x529e8e[_0x957e('0x35')]=_[_0x957e('0x33')](_0x2253a4[_0x957e('0x34')],qs['fields'](_0x115bba['query'][_0x957e('0x36')]));_0x529e8e[_0x957e('0x35')]=_0x529e8e[_0x957e('0x35')][_0x957e('0x37')]?_0x529e8e[_0x957e('0x35')]:_0x2253a4[_0x957e('0x34')];if(!_0x115bba['query'][_0x957e('0x38')](_0x957e('0x39'))){_0x529e8e[_0x957e('0x1c')]=qs['limit'](_0x115bba[_0x957e('0x31')][_0x957e('0x1c')]);_0x529e8e[_0x957e('0x1a')]=qs[_0x957e('0x1a')](_0x115bba[_0x957e('0x31')]['offset']);}_0x529e8e[_0x957e('0x3a')]=qs['sort'](_0x115bba['query']['sort']);_0x529e8e[_0x957e('0x3b')]=qs[_0x957e('0x32')](_[_0x957e('0x3c')](_0x115bba[_0x957e('0x31')],_0x2253a4[_0x957e('0x32')]),_0x2af578);if(_0x115bba[_0x957e('0x31')][_0x957e('0x3d')]){_0x529e8e[_0x957e('0x3b')]=_[_0x957e('0x3e')](_0x529e8e['where'],{'$or':_['map'](_0x2af578,function(_0x228053){if(_0x228053[_0x957e('0x2e')]!==_0x957e('0x3f')){var _0x1d141a={};_0x1d141a[_0x228053['name']]={'$like':'%'+_0x115bba['query'][_0x957e('0x3d')]+'%'};return _0x1d141a;}})});}_0x529e8e=_[_0x957e('0x3e')]({},_0x529e8e,_0x115bba[_0x957e('0x40')]);var _0x19f738={'where':_0x529e8e[_0x957e('0x3b')]};return db[_0x957e('0x2b')]['count'](_0x19f738)[_0x957e('0x23')](function(_0x31732b){_0x1491cd[_0x957e('0x1d')]=_0x31732b;if(_0x115bba[_0x957e('0x31')][_0x957e('0x41')]){_0x529e8e['include']=[{'all':!![]}];}return db[_0x957e('0x2b')]['findAll'](_0x529e8e);})[_0x957e('0x23')](function(_0x35da21){_0x1491cd['rows']=_0x35da21;return _0x1491cd;})[_0x957e('0x23')](respondWithFilteredResult(_0x3080cf,_0x529e8e))['catch'](handleError(_0x3080cf,null));};exports['show']=function(_0x4d4940,_0x37b073){var _0x4d5a4e={'raw':!![],'where':{'id':_0x4d4940['params']['id']}},_0x496125={};_0x496125[_0x957e('0x34')]=_['keys'](db[_0x957e('0x2b')][_0x957e('0x2c')]);_0x496125['query']=_[_0x957e('0x30')](_0x4d4940[_0x957e('0x31')]);_0x496125[_0x957e('0x32')]=_[_0x957e('0x33')](_0x496125[_0x957e('0x34')],_0x496125['query']);_0x4d5a4e[_0x957e('0x35')]=_[_0x957e('0x33')](_0x496125['model'],qs[_0x957e('0x36')](_0x4d4940[_0x957e('0x31')]['fields']));_0x4d5a4e['attributes']=_0x4d5a4e[_0x957e('0x35')][_0x957e('0x37')]?_0x4d5a4e[_0x957e('0x35')]:_0x496125[_0x957e('0x34')];if(_0x4d4940[_0x957e('0x31')][_0x957e('0x41')]){_0x4d5a4e[_0x957e('0x42')]=[{'all':!![]}];}_0x4d5a4e=_[_0x957e('0x3e')]({},_0x4d5a4e,_0x4d4940[_0x957e('0x40')]);return db[_0x957e('0x2b')]['find'](_0x4d5a4e)['then'](handleEntityNotFound(_0x37b073,null))[_0x957e('0x23')](respondWithResult(_0x37b073,null))[_0x957e('0x43')](handleError(_0x37b073,null));};exports['clone']=function(_0x38b8c6,_0x193d8c){var _0x1487c3={'where':{'id':_0x38b8c6['params']['id']}},_0x5080a6={};_0x5080a6[_0x957e('0x34')]=_[_0x957e('0x30')](db['Attachment'][_0x957e('0x2c')]);_0x1487c3[_0x957e('0x35')]=_[_0x957e('0x33')](_0x5080a6[_0x957e('0x34')],qs['fields'](_0x38b8c6[_0x957e('0x31')][_0x957e('0x36')]));_0x1487c3[_0x957e('0x35')]=_0x1487c3[_0x957e('0x35')][_0x957e('0x37')]?_0x1487c3['attributes']:_0x5080a6[_0x957e('0x34')];if(_0x38b8c6[_0x957e('0x31')]['includeAll']){_0x1487c3['include']=[{'all':!![]}];}_0x1487c3=_['merge']({},_0x1487c3,_0x38b8c6[_0x957e('0x40')]);return db['Attachment'][_0x957e('0x44')](_0x1487c3)['then'](handleEntityNotFound(_0x193d8c,null))[_0x957e('0x23')](function(_0x58a3fa){if(_0x58a3fa){var _0x54123b=_0x58a3fa[_0x957e('0x45')]({'plain':!![]});_0x54123b=qs['omit'](_0x54123b,['id',_0x957e('0x46'),_0x957e('0x47')]);_0x38b8c6['body']=_[_0x957e('0x48')](_0x38b8c6[_0x957e('0x49')],['id',_0x957e('0x46'),_0x957e('0x47')]);return db[_0x957e('0x2b')][_0x957e('0x4a')](_[_0x957e('0x3e')](_0x54123b,_0x38b8c6[_0x957e('0x49')]),{'include':_0x38b8c6[_0x957e('0x31')][_0x957e('0x41')]?[{'all':!![]}]:undefined});}})[_0x957e('0x23')](respondWithResult(_0x193d8c,0xc9))[_0x957e('0x43')](handleError(_0x193d8c,null));};exports[_0x957e('0x22')]=function(_0x2bd401,_0x564618){if(_0x2bd401[_0x957e('0x49')]['id']){delete _0x2bd401[_0x957e('0x49')]['id'];}return db[_0x957e('0x2b')][_0x957e('0x44')]({'where':{'id':_0x2bd401[_0x957e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x564618,null))[_0x957e('0x23')](saveUpdates(_0x2bd401['body'],null))[_0x957e('0x23')](respondWithResult(_0x564618,null))[_0x957e('0x43')](handleError(_0x564618,null));};exports[_0x957e('0x24')]=function(_0x5b3e44,_0x522b78){return db[_0x957e('0x2b')][_0x957e('0x44')]({'where':{'id':_0x5b3e44[_0x957e('0x4b')]['id']}})[_0x957e('0x23')](handleEntityNotFound(_0x522b78,null))[_0x957e('0x23')](removeEntity(_0x522b78,null))[_0x957e('0x43')](handleError(_0x522b78,null));};exports['create']=function(_0x52f674,_0x173dc6,_0x1297b0){_0x52f674[_0x957e('0x49')]['name']=_0x52f674[_0x957e('0x4c')][_0x957e('0x4d')];_0x52f674[_0x957e('0x49')]['basename']=_0x52f674[_0x957e('0x4c')][_0x957e('0x4e')];_0x52f674['body'][_0x957e('0x2e')]=_0x52f674[_0x957e('0x4c')][_0x957e('0x4f')];return db['Attachment'][_0x957e('0x4a')](_0x52f674[_0x957e('0x49')])[_0x957e('0x23')](respondWithResult(_0x173dc6,0xc9))[_0x957e('0x43')](handleError(_0x173dc6,null));};exports[_0x957e('0x50')]=function(_0x43b983,_0x17acd9,_0xab00ce){return db[_0x957e('0x2b')][_0x957e('0x51')]({'where':{'id':_0x43b983[_0x957e('0x4b')]['id']},'raw':!![]})[_0x957e('0x23')](handleEntityNotFound(_0x17acd9,null))[_0x957e('0x23')](function(_0x218a9a){if(_0x218a9a){var _0x3ff58f=_0x218a9a[_0x957e('0x52')]!==null;var _0x271cf4=path[_0x957e('0x53')](config[_0x957e('0x54')],_0x957e('0x55'));if(_0x3ff58f){_0x271cf4=path['join'](_0x271cf4,_0x957e('0x56'));}var _0x386740=path[_0x957e('0x53')](_0x271cf4,_0x218a9a[_0x957e('0x57')]);return _0x17acd9[_0x957e('0x50')](_0x386740);}})['catch'](handleError(_0x17acd9,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index 8808159..8970132 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 _0x4d5a=['request-promise','rimraf','./attachment.attributes','exports','define','Attachment','lodash','util','../../config/logger','api','bluebird'];(function(_0x3a1b35,_0x43f746){var _0x27fd53=function(_0x398150){while(--_0x398150){_0x3a1b35['push'](_0x3a1b35['shift']());}};_0x27fd53(++_0x43f746);}(_0x4d5a,0x8a));var _0xa4d5=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x4d5a[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xa4d5('0x0'));var util=require(_0xa4d5('0x1'));var logger=require(_0xa4d5('0x2'))(_0xa4d5('0x3'));var moment=require('moment');var BPromise=require(_0xa4d5('0x4'));var rp=require(_0xa4d5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa4d5('0x6'));var config=require('../../config/environment');var attributes=require(_0xa4d5('0x7'));module[_0xa4d5('0x8')]=function(_0x17d1c4,_0x1e65c6){return _0x17d1c4[_0xa4d5('0x9')](_0xa4d5('0xa'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xe54d=['bluebird','request-promise','rimraf','./attachment.attributes','exports','define','lodash','util','../../config/logger','api','moment'];(function(_0x4718bc,_0x295b9c){var _0x5c2b6f=function(_0x5c76f4){while(--_0x5c76f4){_0x4718bc['push'](_0x4718bc['shift']());}};_0x5c2b6f(++_0x295b9c);}(_0xe54d,0x12f));var _0xde54=function(_0x13f286,_0x426f1e){_0x13f286=_0x13f286-0x0;var _0x5648e2=_0xe54d[_0x13f286];return _0x5648e2;};'use strict';var _=require(_0xde54('0x0'));var util=require(_0xde54('0x1'));var logger=require(_0xde54('0x2'))(_0xde54('0x3'));var moment=require(_0xde54('0x4'));var BPromise=require(_0xde54('0x5'));var rp=require(_0xde54('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde54('0x7'));var config=require('../../config/environment');var attributes=require(_0xde54('0x8'));module[_0xde54('0x9')]=function(_0x38c131,_0x3bcd74){return _0x38c131[_0xde54('0xa')]('Attachment',attributes,{'tableName':'attachments','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 16411b5..caf9f8b 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 _0xa7b4=['ioredis','rpc','../../config/environment','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateAttachment','body','options','debug','util','moment','randomstring'];(function(_0x5c6b0a,_0x17f91c){var _0x50976b=function(_0x398629){while(--_0x398629){_0x5c6b0a['push'](_0x5c6b0a['shift']());}};_0x50976b(++_0x17f91c);}(_0xa7b4,0x8d));var _0x4a7b=function(_0x4d09d3,_0x57b3fb){_0x4d09d3=_0x4d09d3-0x0;var _0x3452f9=_0xa7b4[_0x4d09d3];return _0x3452f9;};'use strict';var _=require('lodash');var util=require(_0x4a7b('0x0'));var moment=require(_0x4a7b('0x1'));var BPromise=require('bluebird');var rs=require(_0x4a7b('0x2'));var fs=require('fs');var Redis=require(_0x4a7b('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4a7b('0x4'));var config=require(_0x4a7b('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x4a7b('0x6')][_0x4a7b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x14e777,_0x683a48,_0x2f9fe5){return new BPromise(function(_0x3fc66a,_0x2d5ffa){return client[_0x4a7b('0x8')](_0x14e777,_0x2f9fe5)[_0x4a7b('0x9')](function(_0x2fdd73){logger[_0x4a7b('0xa')](_0x4a7b('0xb'),_0x683a48,_0x4a7b('0xc'));logger['debug'](_0x4a7b('0xd'),_0x683a48,'request\x20sent',JSON[_0x4a7b('0xe')](_0x2fdd73));if(_0x2fdd73[_0x4a7b('0xf')]){if(_0x2fdd73[_0x4a7b('0xf')][_0x4a7b('0x10')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x683a48,_0x2fdd73[_0x4a7b('0xf')][_0x4a7b('0x11')]);return _0x2d5ffa(_0x2fdd73['error']['message']);}logger[_0x4a7b('0xf')](_0x4a7b('0xb'),_0x683a48,_0x2fdd73[_0x4a7b('0xf')][_0x4a7b('0x11')]);return _0x3fc66a(_0x2fdd73[_0x4a7b('0xf')][_0x4a7b('0x11')]);}else{logger[_0x4a7b('0xa')](_0x4a7b('0xb'),_0x683a48,_0x4a7b('0xc'));_0x3fc66a(_0x2fdd73[_0x4a7b('0x12')]['message']);}})[_0x4a7b('0x13')](function(_0x7458f1){logger[_0x4a7b('0xf')](_0x4a7b('0xb'),_0x683a48,_0x7458f1);_0x2d5ffa(_0x7458f1);});});}exports[_0x4a7b('0x14')]=function(_0x51fdfd){var _0x556151=this;return new Promise(function(_0x211d49,_0x5c35b1){return db['Attachment']['create'](_0x51fdfd[_0x4a7b('0x15')],{'raw':_0x51fdfd[_0x4a7b('0x16')]?_0x51fdfd['options']['raw']===undefined?!![]:![]:!![]})[_0x4a7b('0x9')](function(_0x2eae86){logger['info'](_0x4a7b('0x14'),_0x51fdfd);logger[_0x4a7b('0x17')](_0x4a7b('0x14'),_0x51fdfd,JSON['stringify'](_0x2eae86));_0x211d49(_0x2eae86);})[_0x4a7b('0x13')](function(_0x42c75d){logger['error']('CreateAttachment',_0x42c75d[_0x4a7b('0x11')],_0x51fdfd);_0x5c35b1(_0x556151[_0x4a7b('0xf')](0x1f4,_0x42c75d[_0x4a7b('0x11')]));});});};
\ No newline at end of file
+var _0x98e5=['error','code','message','result','CreateAttachment','Attachment','create','body','options','raw','debug','stringify','catch','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','Attachment,\x20%s,\x20%s,\x20%s'];(function(_0x268111,_0x31c1f9){var _0x54e72a=function(_0x16e79c){while(--_0x16e79c){_0x268111['push'](_0x268111['shift']());}};_0x54e72a(++_0x31c1f9);}(_0x98e5,0x8a));var _0x598e=function(_0xd1f854,_0x532346){_0xd1f854=_0xd1f854-0x0;var _0x548294=_0x98e5[_0xd1f854];return _0x548294;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x598e('0x0'));var rs=require(_0x598e('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x598e('0x2'))['db'];var utils=require(_0x598e('0x3'));var logger=require('../../config/logger')(_0x598e('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x598e('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4292c3,_0x1fc8b5,_0x10bf8e){return new BPromise(function(_0x3e0212,_0x9dc046){return client[_0x598e('0x6')](_0x4292c3,_0x10bf8e)[_0x598e('0x7')](function(_0x2550b9){logger[_0x598e('0x8')](_0x598e('0x9'),_0x1fc8b5,_0x598e('0xa'));logger['debug'](_0x598e('0xb'),_0x1fc8b5,_0x598e('0xa'),JSON['stringify'](_0x2550b9));if(_0x2550b9[_0x598e('0xc')]){if(_0x2550b9['error'][_0x598e('0xd')]===0x1f4){logger[_0x598e('0xc')](_0x598e('0x9'),_0x1fc8b5,_0x2550b9[_0x598e('0xc')][_0x598e('0xe')]);return _0x9dc046(_0x2550b9['error'][_0x598e('0xe')]);}logger['error'](_0x598e('0x9'),_0x1fc8b5,_0x2550b9[_0x598e('0xc')]['message']);return _0x3e0212(_0x2550b9[_0x598e('0xc')][_0x598e('0xe')]);}else{logger[_0x598e('0x8')](_0x598e('0x9'),_0x1fc8b5,_0x598e('0xa'));_0x3e0212(_0x2550b9[_0x598e('0xf')][_0x598e('0xe')]);}})['catch'](function(_0x9ba324){logger[_0x598e('0xc')](_0x598e('0x9'),_0x1fc8b5,_0x9ba324);_0x9dc046(_0x9ba324);});});}exports[_0x598e('0x10')]=function(_0x50ffbb){var _0x1efdfc=this;return new Promise(function(_0x2ecb1e,_0x1727dd){return db[_0x598e('0x11')][_0x598e('0x12')](_0x50ffbb[_0x598e('0x13')],{'raw':_0x50ffbb[_0x598e('0x14')]?_0x50ffbb[_0x598e('0x14')][_0x598e('0x15')]===undefined?!![]:![]:!![]})[_0x598e('0x7')](function(_0x17e5f1){logger[_0x598e('0x8')](_0x598e('0x10'),_0x50ffbb);logger[_0x598e('0x16')](_0x598e('0x10'),_0x50ffbb,JSON[_0x598e('0x17')](_0x17e5f1));_0x2ecb1e(_0x17e5f1);})[_0x598e('0x18')](function(_0x5b9c3){logger['error'](_0x598e('0x10'),_0x5b9c3['message'],_0x50ffbb);_0x1727dd(_0x1efdfc[_0x598e('0xc')](0x1f4,_0x5b9c3[_0x598e('0xe')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 4409b4b..3d88a1e 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 _0xb10b=['originalname','replace','single','file','create','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','download','post','/:id/clone','diskStorage','join','server/files/attachments/','format','%s-%s'];(function(_0x5b7fc5,_0x413040){var _0x259d55=function(_0x181eff){while(--_0x181eff){_0x5b7fc5['push'](_0x5b7fc5['shift']());}};_0x259d55(++_0x413040);}(_0xb10b,0x12a));var _0xbb10=function(_0x111c17,_0x275184){_0x111c17=_0x111c17-0x0;var _0x5ff50a=_0xb10b[_0x111c17];return _0x5ff50a;};'use strict';var multer=require(_0xbb10('0x0'));var util=require('util');var path=require(_0xbb10('0x1'));var timeout=require(_0xbb10('0x2'));var express=require(_0xbb10('0x3'));var router=express['Router']();var fs_extra=require(_0xbb10('0x4'));var auth=require(_0xbb10('0x5'));var interaction=require(_0xbb10('0x6'));var config=require(_0xbb10('0x7'));var controller=require(_0xbb10('0x8'));router[_0xbb10('0x9')]('/',auth['isAuthenticated'](),controller[_0xbb10('0xa')]);router[_0xbb10('0x9')]('/:id',auth[_0xbb10('0xb')](),controller[_0xbb10('0xc')]);router[_0xbb10('0x9')](_0xbb10('0xd'),auth[_0xbb10('0xb')](),controller[_0xbb10('0xe')]);router[_0xbb10('0xf')](_0xbb10('0x10'),auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer[_0xbb10('0x11')]({'destination':function(_0x118a74,_0xce64f3,_0x5e136d){_0x5e136d(null,path[_0xbb10('0x12')](config['root'],_0xbb10('0x13')));},'filename':function(_0x916a32,_0x285009,_0x193a27){_0x193a27(null,util[_0xbb10('0x14')](_0xbb10('0x15'),Date['now'](),_0x285009[_0xbb10('0x16')][_0xbb10('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xbb10('0xf')]('/',upload[_0xbb10('0x18')](_0xbb10('0x19')),controller[_0xbb10('0x1a')]);router[_0xbb10('0x1b')](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1d')]);router['delete'](_0xbb10('0x1c'),auth[_0xbb10('0xb')](),controller[_0xbb10('0x1e')]);module[_0xbb10('0x1f')]=router;
\ No newline at end of file
+var _0xdb28=['path','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/download','download','/:id/clone','clone','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','single','file','create','put','update','delete','destroy','exports','multer','util'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xdb28,0x106));var _0x8db2=function(_0x244201,_0x107d14){_0x244201=_0x244201-0x0;var _0x227f44=_0xdb28[_0x244201];return _0x227f44;};'use strict';var multer=require(_0x8db2('0x0'));var util=require(_0x8db2('0x1'));var path=require(_0x8db2('0x2'));var timeout=require(_0x8db2('0x3'));var express=require('express');var router=express[_0x8db2('0x4')]();var fs_extra=require(_0x8db2('0x5'));var auth=require(_0x8db2('0x6'));var interaction=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var controller=require('./attachment.controller');router[_0x8db2('0x9')]('/',auth[_0x8db2('0xa')](),controller['index']);router['get'](_0x8db2('0xb'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xc')]);router[_0x8db2('0x9')](_0x8db2('0xd'),auth[_0x8db2('0xa')](),controller[_0x8db2('0xe')]);router['post'](_0x8db2('0xf'),auth[_0x8db2('0xa')](),controller[_0x8db2('0x10')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1d9371,_0x150942,_0x576475){_0x576475(null,path[_0x8db2('0x11')](config[_0x8db2('0x12')],_0x8db2('0x13')));},'filename':function(_0x204f49,_0x37d017,_0x559fb1){_0x559fb1(null,util['format'](_0x8db2('0x14'),Date[_0x8db2('0x15')](),_0x37d017[_0x8db2('0x16')][_0x8db2('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x8db2('0x18')]('/',upload[_0x8db2('0x19')](_0x8db2('0x1a')),controller[_0x8db2('0x1b')]);router[_0x8db2('0x1c')](_0x8db2('0xb'),auth['isAuthenticated'](),controller[_0x8db2('0x1d')]);router[_0x8db2('0x1e')]('/:id',auth[_0x8db2('0xa')](),controller[_0x8db2('0x1f')]);module[_0x8db2('0x20')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 260ebd0..b329f18 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 _0xbf07=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','blocked','blockedAt','online','admin','user','agent','then','disabled','add','clearBlockUser','getLicense','catch','send','message','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','User','passport','passport-local','Strategy','moment','bluebird','util','../../config/environment','undefined','baseDN','activedirectory','url','domain','authenticate','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','Setting','findOne','adSsoEnabled','blockDuration'];(function(_0x34e943,_0x4eb0f0){var _0x8a251c=function(_0x5cab8c){while(--_0x5cab8c){_0x34e943['push'](_0x34e943['shift']());}};_0x8a251c(++_0x4eb0f0);}(_0xbf07,0x77));var _0x7bf0=function(_0x5f1cf8,_0x5e0923){_0x5f1cf8=_0x5f1cf8-0x0;var _0x27d0fa=_0xbf07[_0x5f1cf8];return _0x27d0fa;};'use strict';var passport=require(_0x7bf0('0x0'));var LocalStrategy=require(_0x7bf0('0x1'))[_0x7bf0('0x2')];var moment=require(_0x7bf0('0x3'));var ActiveDirectory=require('activedirectory2');var BPromise=require(_0x7bf0('0x4'));var util=require(_0x7bf0('0x5'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0x7bf0('0x6'));var logger=require('../../config/logger')('api');function isActiveDirectoryConfigured(_0x4a925d){var _0x44f656=![];if(typeof _0x4a925d['activedirectory']!==_0x7bf0('0x7')){_0x44f656=_0x4a925d['activedirectory'][_0x7bf0('0x8')]&&_0x4a925d[_0x7bf0('0x9')][_0x7bf0('0xa')]&&_0x4a925d[_0x7bf0('0x9')][_0x7bf0('0xb')];}return _0x44f656;}function adAuthenticate(_0x38fb34,_0x59cad0,_0x13d13f){return new BPromise(function(_0x4d0a69,_0x96d3c7){try{var _0x1e2f8f=new ActiveDirectory(_0x38fb34);_0x1e2f8f[_0x7bf0('0xc')](_0x59cad0,_0x13d13f,function(_0x4507e6,_0x13fe51){if(_0x4507e6){logger[_0x7bf0('0xd')](_0x7bf0('0xe'),_0x59cad0,util[_0x7bf0('0xf')](_0x4507e6,{'showHidden':![],'depth':null}));_0x96d3c7(_0x7bf0('0x10'));}else if(!_0x13fe51){logger[_0x7bf0('0xd')](_0x7bf0('0x11'),_0x59cad0);_0x96d3c7(_0x7bf0('0x10'));}else{_0x4d0a69(_0x13fe51);}});}catch(_0xf15732){_0x96d3c7(_0xf15732);}});}function ActiveDirectoryAuthenticate(_0x88142d,_0x13c6e9,_0x16a7a4,_0x4424a5){var _0x383be0,_0x20fc70;if(!isActiveDirectoryConfigured(config)){logger[_0x7bf0('0xd')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured',_0x13c6e9);return _0x4424a5(null,![],{'message':_0x7bf0('0x10')});}return db[_0x7bf0('0x12')][_0x7bf0('0x13')]({'where':{'id':0x1},'attributes':[_0x7bf0('0x14'),_0x7bf0('0x15')],'raw':!![]})['then'](function(_0x254dc8){_0x383be0=_0x254dc8;if(!_0x383be0[_0x7bf0('0x14')]){logger[_0x7bf0('0xd')](_0x7bf0('0x16'),_0x13c6e9);throw new Error(_0x7bf0('0x10'));}return _0x88142d[_0x7bf0('0x13')]({'attributes':['id',_0x7bf0('0x17'),_0x7bf0('0x18'),_0x7bf0('0x19'),_0x7bf0('0x1a'),'disabled',_0x7bf0('0x1b'),_0x7bf0('0x1c'),_0x7bf0('0x1d')],'where':{'name':_0x13c6e9,'role':{'$or':[_0x7bf0('0x1e'),_0x7bf0('0x1f'),_0x7bf0('0x20')]},'adSsoEnabled':!![]}});})['then'](function(_0x4924d8){if(!_0x4924d8||_0x4924d8&&_0x4924d8[_0x7bf0('0x17')]!==_0x13c6e9){throw new Error(_0x7bf0('0x10'));}_0x20fc70=_0x4924d8;var _0x4fc2a4=_0x20fc70[_0x7bf0('0x17')]+'@'+config['activedirectory'][_0x7bf0('0xb')];return adAuthenticate(config[_0x7bf0('0x9')],_0x4fc2a4,_0x16a7a4);})[_0x7bf0('0x21')](function(_0x2b8c6f){if(_0x20fc70[_0x7bf0('0x22')]){throw new Error(_0x7bf0('0x10'));}if(_0x383be0[_0x7bf0('0x15')]>0x0){if(_0x20fc70[_0x7bf0('0x1b')]){if(moment(_0x20fc70[_0x7bf0('0x1c')])[_0x7bf0('0x23')](_0x383be0[_0x7bf0('0x15')],'minutes')>moment()){throw new Error(_0x7bf0('0x10'));}return utils[_0x7bf0('0x24')](_0x20fc70,0x0,![],null)[_0x7bf0('0x21')](function(){return utils[_0x7bf0('0x25')](_0x20fc70);})[_0x7bf0('0x21')](function(){return _0x4424a5(null,_0x20fc70);});}else{return utils['getLicense'](_0x20fc70)[_0x7bf0('0x21')](function(){return _0x4424a5(null,_0x20fc70);});}}else{return utils[_0x7bf0('0x25')](_0x20fc70)['then'](function(){return _0x4424a5(null,_0x20fc70);});}})[_0x7bf0('0x26')](function(_0x540e84){return _0x4424a5(null,![],_0x540e84);});}function handleError(_0x1393f7,_0x40395b,_0x196b6a){return _0x1393f7['status'](_0x40395b||0x1f4)[_0x7bf0('0x27')]({'message':_0x196b6a?_0x196b6a[_0x7bf0('0x28')]||_0x196b6a:''});}exports[_0x7bf0('0x29')]=function(_0x5ad9c9,_0x371611,_0x318c1f){passport[_0x7bf0('0xc')](_0x7bf0('0x2a'),function(_0x4d50e1,_0x37942,_0x13130b){var _0x2e88e7=_0x4d50e1||_0x13130b;if(_0x2e88e7){return handleError(_0x371611,0x191,_0x2e88e7);}if(!_0x37942){return handleError(_0x371611,0x194,{'message':_0x7bf0('0x2b')});}else{var _0x2229bb={'payload':{'id':_0x37942['id'],'role':_0x37942['role']},'options':{'expiresIn':0x15180}};return authService[_0x7bf0('0x2c')](_0x2229bb)[_0x7bf0('0x21')](function(_0x5f39dc){_0x371611[_0x7bf0('0x2d')]({'id':_0x37942['id'],'token':_0x5f39dc,'statusCall':'','isAlreadyLogged':_0x37942[_0x7bf0('0x1d')]});});}})(_0x5ad9c9,_0x371611,_0x318c1f);};passport['use'](_0x7bf0('0x2a'),new LocalStrategy({'usernameField':_0x7bf0('0x17'),'passwordField':_0x7bf0('0x18')},function(_0x4292f6,_0x1ee014,_0x206312){return ActiveDirectoryAuthenticate(db[_0x7bf0('0x2e')],_0x4292f6,_0x1ee014,_0x206312);}));
\ No newline at end of file
+var _0x26aa=['Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','password','salt','blocked','blockedAt','user','agent','then','name','disabled','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','User','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../components/auth/service','api','activedirectory','undefined','baseDN','url','domain','authenticate','error','Error\x20authenticate\x20%s:\x20%s','inspect','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0x26aa,0xa2));var _0xa26a=function(_0x4fd4f0,_0x4caa4b){_0x4fd4f0=_0x4fd4f0-0x0;var _0x4a1ac2=_0x26aa[_0x4fd4f0];return _0x4a1ac2;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xa26a('0x0'))[_0xa26a('0x1')];var moment=require(_0xa26a('0x2'));var ActiveDirectory=require(_0xa26a('0x3'));var BPromise=require('bluebird');var util=require(_0xa26a('0x4'));var db=require(_0xa26a('0x5'))['db'];var authService=require(_0xa26a('0x6'));var utils=require('../../config/utils');var config=require('../../config/environment');var logger=require('../../config/logger')(_0xa26a('0x7'));function isActiveDirectoryConfigured(_0x2ea383){var _0x1eb8bc=![];if(typeof _0x2ea383[_0xa26a('0x8')]!==_0xa26a('0x9')){_0x1eb8bc=_0x2ea383[_0xa26a('0x8')][_0xa26a('0xa')]&&_0x2ea383[_0xa26a('0x8')][_0xa26a('0xb')]&&_0x2ea383[_0xa26a('0x8')][_0xa26a('0xc')];}return _0x1eb8bc;}function adAuthenticate(_0x2d9002,_0x560a0a,_0x373d1c){return new BPromise(function(_0x5f5d52,_0x1f987f){try{var _0x41b14e=new ActiveDirectory(_0x2d9002);_0x41b14e[_0xa26a('0xd')](_0x560a0a,_0x373d1c,function(_0x94c873,_0x3e962b){if(_0x94c873){logger[_0xa26a('0xe')](_0xa26a('0xf'),_0x560a0a,util[_0xa26a('0x10')](_0x94c873,{'showHidden':![],'depth':null}));_0x1f987f(_0xa26a('0x11'));}else if(!_0x3e962b){logger['error']('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x560a0a);_0x1f987f(_0xa26a('0x11'));}else{_0x5f5d52(_0x3e962b);}});}catch(_0x264184){_0x1f987f(_0x264184);}});}function ActiveDirectoryAuthenticate(_0x49b169,_0x3f0aec,_0x4cfdc7,_0xf47df7){var _0x21dd54,_0x2351ea;if(!isActiveDirectoryConfigured(config)){logger[_0xa26a('0xe')](_0xa26a('0x12'),_0x3f0aec);return _0xf47df7(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xa26a('0x13'),_0xa26a('0x14')],'raw':!![]})['then'](function(_0x581f8e){_0x21dd54=_0x581f8e;if(!_0x21dd54[_0xa26a('0x13')]){logger[_0xa26a('0xe')](_0xa26a('0x15'),_0x3f0aec);throw new Error(_0xa26a('0x11'));}return _0x49b169['findOne']({'attributes':['id','name',_0xa26a('0x16'),_0xa26a('0x17'),'role','disabled',_0xa26a('0x18'),_0xa26a('0x19'),'online'],'where':{'name':_0x3f0aec,'role':{'$or':['admin',_0xa26a('0x1a'),_0xa26a('0x1b')]},'adSsoEnabled':!![]}});})[_0xa26a('0x1c')](function(_0xb5c60c){if(!_0xb5c60c||_0xb5c60c&&_0xb5c60c[_0xa26a('0x1d')]!==_0x3f0aec){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x2351ea=_0xb5c60c;var _0x191aba=_0x2351ea[_0xa26a('0x1d')]+'@'+config['activedirectory'][_0xa26a('0xc')];return adAuthenticate(config['activedirectory'],_0x191aba,_0x4cfdc7);})[_0xa26a('0x1c')](function(_0x58a1bf){if(_0x2351ea[_0xa26a('0x1e')]){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}if(_0x21dd54[_0xa26a('0x14')]>0x0){if(_0x2351ea[_0xa26a('0x18')]){if(moment(_0x2351ea['blockedAt'])['add'](_0x21dd54['blockDuration'],_0xa26a('0x1f'))>moment()){throw new Error(_0xa26a('0x11'));}return utils[_0xa26a('0x20')](_0x2351ea,0x0,![],null)[_0xa26a('0x1c')](function(){return utils['getLicense'](_0x2351ea);})[_0xa26a('0x1c')](function(){return _0xf47df7(null,_0x2351ea);});}else{return utils['getLicense'](_0x2351ea)['then'](function(){return _0xf47df7(null,_0x2351ea);});}}else{return utils[_0xa26a('0x21')](_0x2351ea)[_0xa26a('0x1c')](function(){return _0xf47df7(null,_0x2351ea);});}})[_0xa26a('0x22')](function(_0x309392){return _0xf47df7(null,![],_0x309392);});}function handleError(_0x508d3d,_0x346a14,_0x55edf7){return _0x508d3d[_0xa26a('0x23')](_0x346a14||0x1f4)[_0xa26a('0x24')]({'message':_0x55edf7?_0x55edf7['message']||_0x55edf7:''});}exports[_0xa26a('0x25')]=function(_0x450121,_0x3ffc48,_0x25519b){passport[_0xa26a('0xd')](_0xa26a('0x26'),function(_0x5aa567,_0x2c864d,_0x5e5b7d){var _0x49ff9a=_0x5aa567||_0x5e5b7d;if(_0x49ff9a){return handleError(_0x3ffc48,0x191,_0x49ff9a);}if(!_0x2c864d){return handleError(_0x3ffc48,0x194,{'message':_0xa26a('0x27')});}else{var _0x3961f4={'payload':{'id':_0x2c864d['id'],'role':_0x2c864d[_0xa26a('0x28')]},'options':{'expiresIn':0x15180}};return authService[_0xa26a('0x29')](_0x3961f4)['then'](function(_0xa0168b){_0x3ffc48[_0xa26a('0x2a')]({'id':_0x2c864d['id'],'token':_0xa0168b,'statusCall':'','isAlreadyLogged':_0x2c864d[_0xa26a('0x2b')]});});}})(_0x450121,_0x3ffc48,_0x25519b);};passport['use'](_0xa26a('0x26'),new LocalStrategy({'usernameField':_0xa26a('0x1d'),'passwordField':_0xa26a('0x16')},function(_0x3dc07c,_0x79974a,_0x152410){return ActiveDirectoryAuthenticate(db[_0xa26a('0x2c')],_0x3dc07c,_0x79974a,_0x152410);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 32a056a..4573cbb 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 _0x13ef=['Router','post','login','exports','express'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0x13ef,0x1d0));var _0xf13e=function(_0x2e4e19,_0x493b50){_0x2e4e19=_0x2e4e19-0x0;var _0x9ba20b=_0x13ef[_0x2e4e19];return _0x9ba20b;};'use strict';var express=require(_0xf13e('0x0'));var router=express[_0xf13e('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xf13e('0x2')]('/',controller[_0xf13e('0x3')]);module[_0xf13e('0x4')]=router;
\ No newline at end of file
+var _0xee7d=['post','login','exports','express','Router'];(function(_0x41852b,_0x305aad){var _0x506908=function(_0x203e0c){while(--_0x203e0c){_0x41852b['push'](_0x41852b['shift']());}};_0x506908(++_0x305aad);}(_0xee7d,0x120));var _0xdee7=function(_0x185ce6,_0x3495e3){_0x185ce6=_0x185ce6-0x0;var _0x252f03=_0xee7d[_0x185ce6];return _0x252f03;};'use strict';var express=require(_0xdee7('0x0'));var router=express[_0xdee7('0x1')]();var controller=require('./authActiveDirectory.controller');router[_0xdee7('0x2')]('/',controller[_0xdee7('0x3')]);module[_0xdee7('0x4')]=router;
\ No newline at end of file
diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js
index 95bec34..2eb01aa 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 _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(_0x24dbe2,_0xd9a4b0){var _0x42712e=function(_0xd29dfe){while(--_0xd29dfe){_0x24dbe2['push'](_0x24dbe2['shift']());}};_0x42712e(++_0xd9a4b0);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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
+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(_0x51a9c8,_0x1e0917){var _0x5d8b7f=function(_0x183af6){while(--_0x183af6){_0x51a9c8['push'](_0x51a9c8['shift']());}};_0x5d8b7f(++_0x1e0917);}(_0x9957,0x93));var _0x7995=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x9957[_0xbca1b1];return _0x4e1686;};'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 748862c..d279977 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 _0x3bdb=['../../components/auth/service','get','login','callback','isMiddleware','exports','express','passport','./authGoogle.controller'];(function(_0x297fd3,_0x115406){var _0x2af381=function(_0x1dd31b){while(--_0x1dd31b){_0x297fd3['push'](_0x297fd3['shift']());}};_0x2af381(++_0x115406);}(_0x3bdb,0xf9));var _0xb3bd=function(_0x3734cb,_0x50ac81){_0x3734cb=_0x3734cb-0x0;var _0x459f08=_0x3bdb[_0x3734cb];return _0x459f08;};'use strict';var express=require(_0xb3bd('0x0'));var passport=require(_0xb3bd('0x1'));var router=express['Router']();var controller=require(_0xb3bd('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0xb3bd('0x3'));router[_0xb3bd('0x4')]('/',controller[_0xb3bd('0x5')]);router[_0xb3bd('0x4')]('/callback',controller[_0xb3bd('0x6')],authService[_0xb3bd('0x7')],userController['login'],authService['setTokenCookie']);module[_0xb3bd('0x8')]=router;
\ No newline at end of file
+var _0x76d5=['Router','./authGoogle.controller','login','get','/callback','isMiddleware','setTokenCookie','exports'];(function(_0x953701,_0x5d2bf2){var _0x5a2c8f=function(_0xe8a01){while(--_0xe8a01){_0x953701['push'](_0x953701['shift']());}};_0x5a2c8f(++_0x5d2bf2);}(_0x76d5,0x108));var _0x576d=function(_0x126f39,_0x18289b){_0x126f39=_0x126f39-0x0;var _0x3bd5da=_0x76d5[_0x126f39];return _0x3bd5da;};'use strict';var express=require('express');var passport=require('passport');var router=express[_0x576d('0x0')]();var controller=require(_0x576d('0x1'));var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router['get']('/',controller[_0x576d('0x2')]);router[_0x576d('0x3')](_0x576d('0x4'),controller['callback'],authService[_0x576d('0x5')],userController[_0x576d('0x2')],authService[_0x576d('0x6')]);module[_0x576d('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 ff8fd70..eae8dc4 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 _0xa31d=['find','MailServerOut','CloudProvider','getSmtpOptions','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','role','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','email','trim','toLowerCase','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','User','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','password','validatePasswordHistory','resetPasswordExpires','Password\x20reset!','use','util','passport','passport-local','jayson/promise','lodash','moment','../../mysqldb','../../config/utils','client','http','Setting','blockDuration','findOne','name','salt','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','allowedLoginAttempts','clearBlockUser','disabled','add','getLicense','catch'];(function(_0x405778,_0xa4dd3b){var _0x341735=function(_0x4fc3b8){while(--_0x4fc3b8){_0x405778['push'](_0x405778['shift']());}};_0x341735(++_0xa4dd3b);}(_0xa31d,0x132));var _0xda31=function(_0x574ce3,_0x59eef4){_0x574ce3=_0x574ce3-0x0;var _0x3447a0=_0xa31d[_0x574ce3];return _0x3447a0;};'use strict';var util=require(_0xda31('0x0'));var passport=require(_0xda31('0x1'));var LocalStrategy=require(_0xda31('0x2'))['Strategy'];var jayson=require(_0xda31('0x3'));var _=require(_0xda31('0x4'));var rs=require('randomstring');var moment=require(_0xda31('0x5'));var db=require(_0xda31('0x6'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xda31('0x7'));var client=jayson[_0xda31('0x8')][_0xda31('0x9')]({'port':0x232b});function localAuthenticate(_0x3fbdeb,_0x5e20a6,_0x3c9812,_0x91b7f4){var _0x38b7c6,_0x472e84;return db[_0xda31('0xa')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xda31('0xb')],'raw':!![]})['then'](function(_0x55c3a6){_0x38b7c6=_0x55c3a6;return _0x3fbdeb[_0xda31('0xc')]({'attributes':['id',_0xda31('0xd'),'password',_0xda31('0xe'),'role','disabled',_0xda31('0xf'),_0xda31('0x10'),_0xda31('0x11')],'where':{'name':_0x5e20a6,'role':{'$or':[_0xda31('0x12'),_0xda31('0x13'),_0xda31('0x14')]}}});})[_0xda31('0x15')](function(_0x29f569){if(!_0x29f569||_0x29f569&&_0x29f569[_0xda31('0xd')]!==_0x5e20a6){throw new Error(_0xda31('0x16'));}else{_0x472e84=_0x29f569;return _0x472e84;}})['then'](function(){_0x472e84[_0xda31('0x17')](_0x3c9812,function(_0x3610ca,_0x3ef8ec){var _0x3f9445=_0x472e84[_0xda31('0x11')]+0x1;if(_0x3610ca){return _0x91b7f4(_0x3610ca);}else if(!_0x3ef8ec){if(_0x472e84['disabled']){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});}else if(_0x38b7c6[_0xda31('0x18')]>0x0){if(_0x472e84[_0xda31('0xf')]){if(_0x38b7c6[_0xda31('0xb')]>0x0){if(moment(_0x472e84[_0xda31('0x10')])['add'](_0x38b7c6[_0xda31('0xb')],'minutes')>moment()){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});}else{return utils[_0xda31('0x19')](_0x472e84,_0x3f9445,![],null)[_0xda31('0x15')](function(){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});});}}else{return _0x91b7f4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x3f9445>=_0x38b7c6[_0xda31('0x18')]){return utils['clearBlockUser'](_0x472e84,0x0,!![],moment())[_0xda31('0x15')](function(){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});});}else{return utils[_0xda31('0x19')](_0x472e84,_0x3f9445,![],null)[_0xda31('0x15')](function(){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});});}}}else{return _0x91b7f4(null,![],{'message':_0xda31('0x16')});}}else{if(_0x472e84[_0xda31('0x1a')]){return _0x91b7f4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x38b7c6[_0xda31('0x18')]>0x0){if(_0x472e84[_0xda31('0xf')]){if(_0x38b7c6['blockDuration']>0x0){if(moment(_0x472e84[_0xda31('0x10')])[_0xda31('0x1b')](_0x38b7c6[_0xda31('0xb')],'minutes')>moment()){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});}else{return utils[_0xda31('0x19')](_0x472e84,0x0,![],null)[_0xda31('0x15')](function(){return utils[_0xda31('0x1c')](_0x472e84);})[_0xda31('0x15')](function(){return _0x91b7f4(null,_0x472e84);});}}else{return _0x91b7f4(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x472e84,0x0,![],null)[_0xda31('0x15')](function(){return utils['getLicense'](_0x472e84);})[_0xda31('0x15')](function(){return _0x91b7f4(null,_0x472e84);})[_0xda31('0x1d')](function(_0x23f12e){return _0x91b7f4(null,![],_0x23f12e);});}}else{if(_0x472e84[_0xda31('0xf')]){return _0x91b7f4(null,![],{'message':_0xda31('0x16')});}else{return utils['getLicense'](_0x472e84)[_0xda31('0x15')](function(){return _0x91b7f4(null,_0x472e84);});}}}});})[_0xda31('0x1d')](function(_0x9c9cea){return _0x91b7f4(null,![],_0x9c9cea);});}function sendServiceMail(_0xd5b4de){return db['MailAccount'][_0xda31('0x1e')]({'where':{'service':!![]},'attributes':['id',_0xda31('0xd'),'email'],'include':[{'model':db[_0xda31('0x1f')],'as':'Smtp','include':[{'model':db[_0xda31('0x20')],'as':_0xda31('0x20')}]}]})[_0xda31('0x15')](function(_0x2df080){if(!_0x2df080){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x433bec=_0x2df080[_0xda31('0x21')]();var _0x152cc6={'account':_0x433bec,'message':_[_0xda31('0x22')]({'from':util[_0xda31('0x23')](_0xda31('0x24'),_0x2df080[_0xda31('0xd')],_0x2df080['email']||_0x2df080['Smtp'][_0xda31('0x13')])},_0xd5b4de)};return client[_0xda31('0x25')](_0xda31('0x26'),_0x152cc6);})['then'](function(_0x2124b1){if(_0x2124b1[_0xda31('0x27')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2124b1[_0xda31('0x27')]['message']||JSON[_0xda31('0x28')](_0x2124b1[_0xda31('0x27')])));}return!![];});}function handleError(_0x28a32f,_0x2391bb,_0x33a2cb){return _0x28a32f['status'](_0x2391bb||0x1f4)[_0xda31('0x29')]({'message':_0x33a2cb?_0x33a2cb['message']||_0x33a2cb:''});}exports[_0xda31('0x2a')]=function(_0x2be2a8,_0x23c467,_0x1df2f0){passport['authenticate'](_0xda31('0x2b'),function(_0x145279,_0x3c3f56,_0x3452cd){var _0x50f6e0=_0x145279||_0x3452cd;if(_0x50f6e0){return handleError(_0x23c467,0x191,_0x50f6e0);}if(!_0x3c3f56){return handleError(_0x23c467,0x194,{'message':_0xda31('0x2c')});}else{var _0x53b174={'payload':{'id':_0x3c3f56['id'],'role':_0x3c3f56[_0xda31('0x2d')]},'options':{'expiresIn':0x15180}};return authService[_0xda31('0x2e')](_0x53b174)[_0xda31('0x15')](function(_0xd906a8){_0x23c467[_0xda31('0x2f')]({'id':_0x3c3f56['id'],'token':_0xd906a8,'statusCall':'','isAlreadyLogged':_0x3c3f56[_0xda31('0x30')]});});}})(_0x2be2a8,_0x23c467,_0x1df2f0);};exports[_0xda31('0x31')]=function(_0x34d7e4,_0x29bd53){if(!_0x34d7e4[_0xda31('0x32')]['email']){return handleError(_0x29bd53,0x1f4,{'message':_0xda31('0x33')});}var _0x17f455=rs[_0xda31('0x34')]();_0x34d7e4[_0xda31('0x32')][_0xda31('0x35')]=_0x34d7e4[_0xda31('0x32')]['email'][_0xda31('0x36')]()[_0xda31('0x37')]();var _0x49d09b;return db[_0xda31('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xda31('0x18'),_0xda31('0xb')],'raw':!![]})['then'](function(_0x144fec){_0x49d09b=_0x144fec;return db['User'][_0xda31('0x1e')]({'where':{'email':_0x34d7e4[_0xda31('0x32')][_0xda31('0x35')]}});})['then'](function(_0x32b7e6){if(!_0x32b7e6){throw new Error(_0xda31('0x38'));}if(_0x32b7e6[_0xda31('0x1a')]){throw new Error(_0xda31('0x39'));}if(_0x32b7e6[_0xda31('0xf')]){if(moment(_0x32b7e6[_0xda31('0x10')])[_0xda31('0x1b')](_0x49d09b['blockDuration'],_0xda31('0x3a'))>moment()){throw new Error(_0xda31('0x3b'));}else{_0x32b7e6[_0xda31('0xf')]=![];_0x32b7e6['blockedAt']=null;}}_0x32b7e6[_0xda31('0x3c')]=_0x17f455;_0x32b7e6['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x32b7e6[_0xda31('0x3d')]();})['then'](function(){return sendServiceMail({'to':_0x34d7e4[_0xda31('0x32')][_0xda31('0x35')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xda31('0x3e')+_0xda31('0x3f')+'https://'+_0x34d7e4[_0xda31('0x40')][_0xda31('0x41')]+_0xda31('0x42')+_0x17f455+'\x0a\x0a'+_0xda31('0x43')});})[_0xda31('0x15')](function(){_0x29bd53[_0xda31('0x44')](0xc8)[_0xda31('0x29')]({'message':_0xda31('0x45')});})[_0xda31('0x1d')](function(_0x5b358f){return handleError(_0x29bd53,0x1f4,_0x5b358f);});};exports[_0xda31('0x46')]=function(_0x466f2e,_0x4b6df6){return db[_0xda31('0x47')][_0xda31('0x1e')]({'where':{'resetPasswordToken':_0x466f2e['params'][_0xda31('0x48')],'resetPasswordExpires':{'$gt':Date[_0xda31('0x49')]()}}})[_0xda31('0x15')](function(_0x52e7e5){if(!_0x52e7e5){throw new Error(_0xda31('0x4a'));}return db[_0xda31('0xa')][_0xda31('0xc')]({'attributes':['id',_0xda31('0x4b'),_0xda31('0x4c'),_0xda31('0x4d')]})[_0xda31('0x15')](function(_0x5e0188){if(_0x5e0188['securePassword'])authService[_0xda31('0x4e')](_0x466f2e[_0xda31('0x32')][_0xda31('0x4f')]);if(!_0x5e0188[_0xda31('0x4c')]||!_0x52e7e5['previousPasswords'])return _0x52e7e5;authService[_0xda31('0x50')](_0x466f2e[_0xda31('0x32')][_0xda31('0x4f')],_0x52e7e5['previousPasswords'],_0x5e0188[_0xda31('0x4d')]);return _0x52e7e5;})[_0xda31('0x15')](function(){_0x52e7e5[_0xda31('0x4f')]=_0x466f2e['body'][_0xda31('0x4f')];_0x52e7e5[_0xda31('0x3c')]=null;_0x52e7e5[_0xda31('0x51')]=null;return _0x52e7e5['save']();});})[_0xda31('0x15')](function(){_0x4b6df6['status'](0xc8)[_0xda31('0x29')]({'message':_0xda31('0x52')});})[_0xda31('0x1d')](function(_0x4ea011){return handleError(_0x4b6df6,0x1f4,_0x4ea011);});};passport[_0xda31('0x53')](_0xda31('0x2b'),new LocalStrategy({'usernameField':_0xda31('0xd'),'passwordField':_0xda31('0x4f')},function(_0x2f890a,_0x46e0d3,_0xe38e5c){return localAuthenticate(db[_0xda31('0x47')],_0x2f890a,_0x46e0d3,_0xe38e5c);}));
\ No newline at end of file
+var _0x26ec=['The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','now','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','headers','host','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','send','Reset\x20Email\x20sent!','User','token','securePassword','enforcePasswordHistory','passwordHistoryLimit','previousPasswords','validatePasswordHistory','save','Password\x20reset!','use','util','passport','passport-local','Strategy','jayson/promise','lodash','randomstring','moment','../../mysqldb','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','role','blocked','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','disabled','clearBlockUser','blockedAt','add','minutes','catch','getLicense','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','This\x20email\x20is\x20not\x20registered.'];(function(_0x2e682e,_0xf91ba0){var _0x33c2da=function(_0x3fb6d4){while(--_0x3fb6d4){_0x2e682e['push'](_0x2e682e['shift']());}};_0x33c2da(++_0xf91ba0);}(_0x26ec,0x163));var _0xc26e=function(_0x18acbc,_0x5d33f5){_0x18acbc=_0x18acbc-0x0;var _0x201223=_0x26ec[_0x18acbc];return _0x201223;};'use strict';var util=require(_0xc26e('0x0'));var passport=require(_0xc26e('0x1'));var LocalStrategy=require(_0xc26e('0x2'))[_0xc26e('0x3')];var jayson=require(_0xc26e('0x4'));var _=require(_0xc26e('0x5'));var rs=require(_0xc26e('0x6'));var moment=require(_0xc26e('0x7'));var db=require(_0xc26e('0x8'))['db'];var authService=require('../../components/auth/service');var utils=require(_0xc26e('0x9'));var client=jayson[_0xc26e('0xa')][_0xc26e('0xb')]({'port':0x232b});function localAuthenticate(_0x421d50,_0xf769f8,_0xbb0211,_0x21fe6f){var _0x52a975,_0x24b11;return db[_0xc26e('0xc')][_0xc26e('0xd')]({'where':{'id':0x1},'attributes':[_0xc26e('0xe'),_0xc26e('0xf')],'raw':!![]})[_0xc26e('0x10')](function(_0x3ccf9c){_0x52a975=_0x3ccf9c;return _0x421d50['findOne']({'attributes':['id',_0xc26e('0x11'),_0xc26e('0x12'),'salt',_0xc26e('0x13'),'disabled',_0xc26e('0x14'),'blockedAt',_0xc26e('0x15')],'where':{'name':_0xf769f8,'role':{'$or':[_0xc26e('0x16'),_0xc26e('0x17'),_0xc26e('0x18')]}}});})['then'](function(_0x2560bd){if(!_0x2560bd||_0x2560bd&&_0x2560bd[_0xc26e('0x11')]!==_0xf769f8){throw new Error(_0xc26e('0x19'));}else{_0x24b11=_0x2560bd;return _0x24b11;}})[_0xc26e('0x10')](function(){_0x24b11[_0xc26e('0x1a')](_0xbb0211,function(_0xe71ea0,_0x1bc15a){var _0x58c7b9=_0x24b11[_0xc26e('0x15')]+0x1;if(_0xe71ea0){return _0x21fe6f(_0xe71ea0);}else if(!_0x1bc15a){if(_0x24b11[_0xc26e('0x1b')]){return _0x21fe6f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x52a975[_0xc26e('0xe')]>0x0){if(_0x24b11[_0xc26e('0x14')]){if(_0x52a975['blockDuration']>0x0){if(moment(_0x24b11['blockedAt'])['add'](_0x52a975[_0xc26e('0xf')],'minutes')>moment()){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});}else{return utils[_0xc26e('0x1c')](_0x24b11,_0x58c7b9,![],null)[_0xc26e('0x10')](function(){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});});}}else{return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});}}else{if(_0x58c7b9>=_0x52a975[_0xc26e('0xe')]){return utils[_0xc26e('0x1c')](_0x24b11,0x0,!![],moment())[_0xc26e('0x10')](function(){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});});}else{return utils['clearBlockUser'](_0x24b11,_0x58c7b9,![],null)['then'](function(){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});});}}}else{return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});}}else{if(_0x24b11[_0xc26e('0x1b')]){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});}else if(_0x52a975[_0xc26e('0xe')]>0x0){if(_0x24b11['blocked']){if(_0x52a975['blockDuration']>0x0){if(moment(_0x24b11[_0xc26e('0x1d')])[_0xc26e('0x1e')](_0x52a975[_0xc26e('0xf')],_0xc26e('0x1f'))>moment()){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});}else{return utils[_0xc26e('0x1c')](_0x24b11,0x0,![],null)[_0xc26e('0x10')](function(){return utils['getLicense'](_0x24b11);})[_0xc26e('0x10')](function(){return _0x21fe6f(null,_0x24b11);});}}else{return _0x21fe6f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xc26e('0x1c')](_0x24b11,0x0,![],null)[_0xc26e('0x10')](function(){return utils['getLicense'](_0x24b11);})[_0xc26e('0x10')](function(){return _0x21fe6f(null,_0x24b11);})[_0xc26e('0x20')](function(_0x15d7bf){return _0x21fe6f(null,![],_0x15d7bf);});}}else{if(_0x24b11[_0xc26e('0x14')]){return _0x21fe6f(null,![],{'message':_0xc26e('0x19')});}else{return utils[_0xc26e('0x21')](_0x24b11)[_0xc26e('0x10')](function(){return _0x21fe6f(null,_0x24b11);});}}}});})['catch'](function(_0x4f4e7a){return _0x21fe6f(null,![],_0x4f4e7a);});}function sendServiceMail(_0x2d99e1){return db[_0xc26e('0x22')][_0xc26e('0x23')]({'where':{'service':!![]},'attributes':['id',_0xc26e('0x11'),_0xc26e('0x24')],'include':[{'model':db[_0xc26e('0x25')],'as':_0xc26e('0x26'),'include':[{'model':db['CloudProvider'],'as':_0xc26e('0x27')}]}]})[_0xc26e('0x10')](function(_0x1c07b1){if(!_0x1c07b1){throw new Error(_0xc26e('0x28'));}var _0x49d1d3=_0x1c07b1[_0xc26e('0x29')]();var _0x2458ec={'account':_0x49d1d3,'message':_['merge']({'from':util[_0xc26e('0x2a')](_0xc26e('0x2b'),_0x1c07b1[_0xc26e('0x11')],_0x1c07b1['email']||_0x1c07b1[_0xc26e('0x26')][_0xc26e('0x17')])},_0x2d99e1)};return client[_0xc26e('0x2c')](_0xc26e('0x2d'),_0x2458ec);})[_0xc26e('0x10')](function(_0x245e0c){if(_0x245e0c[_0xc26e('0x2e')]){throw new Error(util[_0xc26e('0x2a')](_0xc26e('0x2f'),_0x245e0c['error']['message']||JSON['stringify'](_0x245e0c[_0xc26e('0x2e')])));}return!![];});}function handleError(_0x52a547,_0x53208d,_0x340e40){return _0x52a547['status'](_0x53208d||0x1f4)['send']({'message':_0x340e40?_0x340e40[_0xc26e('0x30')]||_0x340e40:''});}exports[_0xc26e('0x31')]=function(_0x5309e4,_0x146aab,_0x83f90b){passport['authenticate'](_0xc26e('0x32'),function(_0x3b78ca,_0x3e5502,_0x6faf6c){var _0x5af567=_0x3b78ca||_0x6faf6c;if(_0x5af567){return handleError(_0x146aab,0x191,_0x5af567);}if(!_0x3e5502){return handleError(_0x146aab,0x194,{'message':_0xc26e('0x33')});}else{var _0x2a2401={'payload':{'id':_0x3e5502['id'],'role':_0x3e5502[_0xc26e('0x13')]},'options':{'expiresIn':0x15180}};return authService[_0xc26e('0x34')](_0x2a2401)[_0xc26e('0x10')](function(_0x24f6a2){_0x146aab[_0xc26e('0x35')]({'id':_0x3e5502['id'],'token':_0x24f6a2,'statusCall':'','isAlreadyLogged':_0x3e5502['online']});});}})(_0x5309e4,_0x146aab,_0x83f90b);};exports[_0xc26e('0x36')]=function(_0x379219,_0x4a5b45){if(!_0x379219['body'][_0xc26e('0x24')]){return handleError(_0x4a5b45,0x1f4,{'message':_0xc26e('0x37')});}var _0x176396=rs[_0xc26e('0x38')]();_0x379219['body']['email']=_0x379219[_0xc26e('0x39')][_0xc26e('0x24')]['trim']()[_0xc26e('0x3a')]();var _0x580215;return db[_0xc26e('0xc')][_0xc26e('0xd')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xc26e('0xf')],'raw':!![]})[_0xc26e('0x10')](function(_0x19c4dc){_0x580215=_0x19c4dc;return db['User'][_0xc26e('0x23')]({'where':{'email':_0x379219[_0xc26e('0x39')]['email']}});})[_0xc26e('0x10')](function(_0x1726d4){if(!_0x1726d4){throw new Error(_0xc26e('0x3b'));}if(_0x1726d4[_0xc26e('0x1b')]){throw new Error(_0xc26e('0x3c'));}if(_0x1726d4[_0xc26e('0x14')]){if(moment(_0x1726d4[_0xc26e('0x1d')])[_0xc26e('0x1e')](_0x580215[_0xc26e('0xf')],_0xc26e('0x1f'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x1726d4[_0xc26e('0x14')]=![];_0x1726d4[_0xc26e('0x1d')]=null;}}_0x1726d4['resetPasswordToken']=_0x176396;_0x1726d4[_0xc26e('0x3d')]=Date[_0xc26e('0x3e')]()+0x36ee80;return _0x1726d4['save']();})[_0xc26e('0x10')](function(){return sendServiceMail({'to':_0x379219[_0xc26e('0x39')][_0xc26e('0x24')],'subject':_0xc26e('0x3f'),'text':_0xc26e('0x40')+_0xc26e('0x41')+'https://'+_0x379219[_0xc26e('0x42')][_0xc26e('0x43')]+_0xc26e('0x44')+_0x176396+'\x0a\x0a'+_0xc26e('0x45')});})['then'](function(){_0x4a5b45[_0xc26e('0x46')](0xc8)[_0xc26e('0x47')]({'message':_0xc26e('0x48')});})['catch'](function(_0x2af0db){return handleError(_0x4a5b45,0x1f4,_0x2af0db);});};exports['reset']=function(_0x304ddd,_0xda5333){return db[_0xc26e('0x49')][_0xc26e('0x23')]({'where':{'resetPasswordToken':_0x304ddd['params'][_0xc26e('0x4a')],'resetPasswordExpires':{'$gt':Date[_0xc26e('0x3e')]()}}})[_0xc26e('0x10')](function(_0x24a050){if(!_0x24a050){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0xc26e('0xc')][_0xc26e('0xd')]({'attributes':['id',_0xc26e('0x4b'),_0xc26e('0x4c'),_0xc26e('0x4d')]})[_0xc26e('0x10')](function(_0xe2af2b){if(_0xe2af2b[_0xc26e('0x4b')])authService['validatePasswordPattern'](_0x304ddd['body'][_0xc26e('0x12')]);if(!_0xe2af2b['enforcePasswordHistory']||!_0x24a050[_0xc26e('0x4e')])return _0x24a050;authService[_0xc26e('0x4f')](_0x304ddd[_0xc26e('0x39')][_0xc26e('0x12')],_0x24a050[_0xc26e('0x4e')],_0xe2af2b[_0xc26e('0x4d')]);return _0x24a050;})['then'](function(){_0x24a050[_0xc26e('0x12')]=_0x304ddd[_0xc26e('0x39')]['password'];_0x24a050['resetPasswordToken']=null;_0x24a050['resetPasswordExpires']=null;return _0x24a050[_0xc26e('0x50')]();});})[_0xc26e('0x10')](function(){_0xda5333[_0xc26e('0x46')](0xc8)[_0xc26e('0x47')]({'message':_0xc26e('0x51')});})[_0xc26e('0x20')](function(_0x595bca){return handleError(_0xda5333,0x1f4,_0x595bca);});};passport[_0xc26e('0x52')](_0xc26e('0x32'),new LocalStrategy({'usernameField':_0xc26e('0x11'),'passwordField':'password'},function(_0x1fe757,_0x14a5a6,_0x301fdf){return localAuthenticate(db[_0xc26e('0x49')],_0x1fe757,_0x14a5a6,_0x301fdf);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index c11c012..a4aa0de 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 _0x919f=['login','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x1752e5,_0x11b9b2){var _0x26da3f=function(_0x17c1f2){while(--_0x17c1f2){_0x1752e5['push'](_0x1752e5['shift']());}};_0x26da3f(++_0x11b9b2);}(_0x919f,0x114));var _0xf919=function(_0x2bc557,_0x20bdbb){_0x2bc557=_0x2bc557-0x0;var _0x423830=_0x919f[_0x2bc557];return _0x423830;};'use strict';var express=require(_0xf919('0x0'));var router=express[_0xf919('0x1')]();var controller=require(_0xf919('0x2'));router[_0xf919('0x3')]('/',controller[_0xf919('0x4')]);router['post']('/forgot',controller['forgot']);router['post'](_0xf919('0x5'),controller[_0xf919('0x6')]);module[_0xf919('0x7')]=router;
\ No newline at end of file
+var _0xcf51=['/reset/:token','Router','./authLocal.controller','/forgot','post'];(function(_0x156dd8,_0x284471){var _0x4edf66=function(_0x50a94f){while(--_0x50a94f){_0x156dd8['push'](_0x156dd8['shift']());}};_0x4edf66(++_0x284471);}(_0xcf51,0x1e1));var _0x1cf5=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xcf51[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0x1cf5('0x0')]();var controller=require(_0x1cf5('0x1'));router['post']('/',controller['login']);router['post'](_0x1cf5('0x2'),controller['forgot']);router[_0x1cf5('0x3')](_0x1cf5('0x4'),controller['reset']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index e6f5cd9..0c683b0 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 _0x9a5d=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x37e6ed,_0x2421bf){var _0x3ec98c=function(_0x50aa59){while(--_0x50aa59){_0x37e6ed['push'](_0x37e6ed['shift']());}};_0x3ec98c(++_0x2421bf);}(_0x9a5d,0x70));var _0xd9a5=function(_0x2562fc,_0x475b75){_0x2562fc=_0x2562fc-0x0;var _0x3708bd=_0x9a5d[_0x2562fc];return _0x3708bd;};'use strict';var Sequelize=require(_0xd9a5('0x0'));module[_0xd9a5('0x1')]={'name':{'type':Sequelize[_0xd9a5('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd9a5('0x2')]},'status':{'type':Sequelize[_0xd9a5('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xd9a5('0x4')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x5784=['sequelize','exports','STRING','BOOLEAN'];(function(_0x187c2d,_0x465bfa){var _0x149f8b=function(_0x473b01){while(--_0x473b01){_0x187c2d['push'](_0x187c2d['shift']());}};_0x149f8b(++_0x465bfa);}(_0x5784,0x1d4));var _0x4578=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5784[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require(_0x4578('0x0'));module[_0x4578('0x1')]={'name':{'type':Sequelize[_0x4578('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x4578('0x2')]},'description':{'type':Sequelize[_0x4578('0x2')]},'status':{'type':Sequelize[_0x4578('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 7234522..51bbfa5 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 _0xfdf8=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','reject','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','keys','filters','intersection','attributes','query','fields','length','hasOwnProperty','nolimit','order','sort','filter','merge','type','where','Automation','includeAll','rows','show','include','find','create','body','catch','params','addConditions','Condition','ids','omit','findOne','options','getConditions','addActions','Action','getActions','pick','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','lodash','squel'];(function(_0x20739b,_0x289073){var _0x28687b=function(_0x3ebbc7){while(--_0x3ebbc7){_0x20739b['push'](_0x20739b['shift']());}};_0x28687b(++_0x289073);}(_0xfdf8,0x13f));var _0x8fdf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xfdf8[_0xa464c9];return _0x3d73c4;};'use strict';var emlformat=require(_0x8fdf('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x8fdf('0x1'));var jsonpatch=require(_0x8fdf('0x2'));var rp=require(_0x8fdf('0x3'));var moment=require(_0x8fdf('0x4'));var BPromise=require(_0x8fdf('0x5'));var Mustache=require(_0x8fdf('0x6'));var util=require('util');var path=require('path');var sox=require(_0x8fdf('0x7'));var csv=require(_0x8fdf('0x8'));var ejs=require(_0x8fdf('0x9'));var fs=require('fs');var fs_extra=require(_0x8fdf('0xa'));var _=require(_0x8fdf('0xb'));var squel=require(_0x8fdf('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8fdf('0xd'));var toCsv=require('to-csv');var querystring=require(_0x8fdf('0xe'));var Papa=require(_0x8fdf('0xf'));var Redis=require(_0x8fdf('0x10'));var authService=require(_0x8fdf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x8fdf('0x12'));var hardwareService=require(_0x8fdf('0x13'));var logger=require(_0x8fdf('0x14'))(_0x8fdf('0x15'));var utils=require(_0x8fdf('0x16'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0x8fdf('0x17'))['db'];function respondWithStatusCode(_0x408866,_0x53c5fc){_0x53c5fc=_0x53c5fc||0xcc;return function(_0x51cbf2){if(_0x51cbf2){return _0x408866['sendStatus'](_0x53c5fc);}return _0x408866[_0x8fdf('0x18')](_0x53c5fc)[_0x8fdf('0x19')]();};}function respondWithResult(_0x2e2d79,_0xd996f5){_0xd996f5=_0xd996f5||0xc8;return function(_0x11f661){if(_0x11f661){return _0x2e2d79[_0x8fdf('0x18')](_0xd996f5)[_0x8fdf('0x1a')](_0x11f661);}};}function respondWithFilteredResult(_0x3df8a4,_0x4914c7){return function(_0x2fbec6){if(_0x2fbec6){var _0x55e2a0=typeof _0x4914c7[_0x8fdf('0x1b')]==='undefined'&&typeof _0x4914c7[_0x8fdf('0x1c')]===_0x8fdf('0x1d');var _0xaad56c=_0x2fbec6[_0x8fdf('0x1e')];var _0x4ba994=_0x55e2a0?0x0:_0x4914c7[_0x8fdf('0x1b')];var _0x5a5c69=_0x55e2a0?_0x2fbec6[_0x8fdf('0x1e')]:_0x4914c7[_0x8fdf('0x1b')]+_0x4914c7['limit'];var _0x48aaf2;if(_0x5a5c69>=_0xaad56c){_0x5a5c69=_0xaad56c;_0x48aaf2=0xc8;}else{_0x48aaf2=0xce;}_0x3df8a4[_0x8fdf('0x18')](_0x48aaf2);return _0x3df8a4[_0x8fdf('0x1f')](_0x8fdf('0x20'),_0x4ba994+'-'+_0x5a5c69+'/'+_0xaad56c)[_0x8fdf('0x1a')](_0x2fbec6);}return null;};}function patchUpdates(_0x2f0bb2){return function(_0x3f1c79){try{jsonpatch[_0x8fdf('0x21')](_0x3f1c79,_0x2f0bb2,!![]);}catch(_0x255ddd){return BPromise[_0x8fdf('0x22')](_0x255ddd);}return _0x3f1c79['save']();};}function saveUpdates(_0x3b4fc1,_0xf8a0d8){return function(_0x179ad3){if(_0x179ad3){return _0x179ad3['update'](_0x3b4fc1)[_0x8fdf('0x23')](function(_0x19e25a){return _0x19e25a;});}return null;};}function removeEntity(_0xafae78,_0x5e5b43){return function(_0x138587){if(_0x138587){return _0x138587[_0x8fdf('0x24')]()['then'](function(){_0xafae78[_0x8fdf('0x18')](0xcc)[_0x8fdf('0x19')]();});}};}function handleEntityNotFound(_0x24bf53,_0xa93a1f){return function(_0x14900f){if(!_0x14900f){_0x24bf53['sendStatus'](0x194);}return _0x14900f;};}function handleError(_0x1a6248,_0x49d7dc){_0x49d7dc=_0x49d7dc||0x1f4;return function(_0x4dea61){logger[_0x8fdf('0x25')](_0x4dea61[_0x8fdf('0x26')]);if(_0x4dea61[_0x8fdf('0x27')]){delete _0x4dea61[_0x8fdf('0x27')];}_0x1a6248['status'](_0x49d7dc)[_0x8fdf('0x28')](_0x4dea61);};}exports[_0x8fdf('0x29')]=function(_0x1b2dc8,_0x188a05){var _0x3fea73={},_0x132d03={},_0x3b9932={'count':0x0,'rows':[]};var _0x3fad42=_[_0x8fdf('0x2a')](db['Automation'][_0x8fdf('0x2b')],function(_0x1eaa50){return{'name':_0x1eaa50[_0x8fdf('0x2c')],'type':_0x1eaa50['type'][_0x8fdf('0x2d')]};});_0x132d03[_0x8fdf('0x2e')]=_['map'](_0x3fad42,_0x8fdf('0x27'));_0x132d03['query']=_[_0x8fdf('0x2f')](_0x1b2dc8['query']);_0x132d03[_0x8fdf('0x30')]=_[_0x8fdf('0x31')](_0x132d03['model'],_0x132d03['query']);_0x3fea73[_0x8fdf('0x32')]=_['intersection'](_0x132d03[_0x8fdf('0x2e')],qs['fields'](_0x1b2dc8[_0x8fdf('0x33')][_0x8fdf('0x34')]));_0x3fea73[_0x8fdf('0x32')]=_0x3fea73['attributes'][_0x8fdf('0x35')]?_0x3fea73[_0x8fdf('0x32')]:_0x132d03[_0x8fdf('0x2e')];if(!_0x1b2dc8['query'][_0x8fdf('0x36')](_0x8fdf('0x37'))){_0x3fea73['limit']=qs[_0x8fdf('0x1c')](_0x1b2dc8[_0x8fdf('0x33')]['limit']);_0x3fea73['offset']=qs['offset'](_0x1b2dc8[_0x8fdf('0x33')][_0x8fdf('0x1b')]);}_0x3fea73[_0x8fdf('0x38')]=qs['sort'](_0x1b2dc8['query'][_0x8fdf('0x39')]);_0x3fea73['where']=qs[_0x8fdf('0x30')](_['pick'](_0x1b2dc8['query'],_0x132d03[_0x8fdf('0x30')]),_0x3fad42);if(_0x1b2dc8[_0x8fdf('0x33')][_0x8fdf('0x3a')]){_0x3fea73['where']=_[_0x8fdf('0x3b')](_0x3fea73['where'],{'$or':_[_0x8fdf('0x2a')](_0x3fad42,function(_0x50e44c){if(_0x50e44c[_0x8fdf('0x3c')]!=='VIRTUAL'){var _0x3a04fd={};_0x3a04fd[_0x50e44c[_0x8fdf('0x27')]]={'$like':'%'+_0x1b2dc8['query'][_0x8fdf('0x3a')]+'%'};return _0x3a04fd;}})});}_0x3fea73=_[_0x8fdf('0x3b')]({},_0x3fea73,_0x1b2dc8['options']);var _0x96be2d={'where':_0x3fea73[_0x8fdf('0x3d')]};return db[_0x8fdf('0x3e')][_0x8fdf('0x1e')](_0x96be2d)[_0x8fdf('0x23')](function(_0x3dbbee){_0x3b9932[_0x8fdf('0x1e')]=_0x3dbbee;if(_0x1b2dc8['query'][_0x8fdf('0x3f')]){_0x3fea73['include']=[{'all':!![]}];}return db[_0x8fdf('0x3e')]['findAll'](_0x3fea73);})[_0x8fdf('0x23')](function(_0x26da4a){_0x3b9932[_0x8fdf('0x40')]=_0x26da4a;return _0x3b9932;})['then'](respondWithFilteredResult(_0x188a05,_0x3fea73))['catch'](handleError(_0x188a05,null));};exports[_0x8fdf('0x41')]=function(_0x4ac53e,_0x31592f){var _0x48584c={'raw':![],'where':{'id':_0x4ac53e['params']['id']}},_0x50e68d={};_0x50e68d['model']=_[_0x8fdf('0x2f')](db['Automation'][_0x8fdf('0x2b')]);_0x50e68d[_0x8fdf('0x33')]=_[_0x8fdf('0x2f')](_0x4ac53e['query']);_0x50e68d['filters']=_[_0x8fdf('0x31')](_0x50e68d['model'],_0x50e68d[_0x8fdf('0x33')]);_0x48584c[_0x8fdf('0x32')]=_[_0x8fdf('0x31')](_0x50e68d['model'],qs[_0x8fdf('0x34')](_0x4ac53e['query']['fields']));_0x48584c['attributes']=_0x48584c['attributes'][_0x8fdf('0x35')]?_0x48584c[_0x8fdf('0x32')]:_0x50e68d[_0x8fdf('0x2e')];if(_0x4ac53e[_0x8fdf('0x33')][_0x8fdf('0x3f')]){_0x48584c[_0x8fdf('0x42')]=[{'all':!![]}];}_0x48584c=_['merge']({},_0x48584c,_0x4ac53e['options']);return db[_0x8fdf('0x3e')][_0x8fdf('0x43')](_0x48584c)[_0x8fdf('0x23')](handleEntityNotFound(_0x31592f,null))[_0x8fdf('0x23')](respondWithResult(_0x31592f,null))['catch'](handleError(_0x31592f,null));};exports[_0x8fdf('0x44')]=function(_0x48b123,_0x373c6a){return db[_0x8fdf('0x3e')][_0x8fdf('0x44')](_0x48b123[_0x8fdf('0x45')],{})[_0x8fdf('0x23')](respondWithResult(_0x373c6a,0xc9))[_0x8fdf('0x46')](handleError(_0x373c6a,null));};exports['update']=function(_0x3aabc1,_0x526ba3){if(_0x3aabc1[_0x8fdf('0x45')]['id']){delete _0x3aabc1[_0x8fdf('0x45')]['id'];}return db['Automation'][_0x8fdf('0x43')]({'where':{'id':_0x3aabc1[_0x8fdf('0x47')]['id']}})[_0x8fdf('0x23')](handleEntityNotFound(_0x526ba3,null))[_0x8fdf('0x23')](saveUpdates(_0x3aabc1['body'],null))[_0x8fdf('0x23')](respondWithResult(_0x526ba3,null))[_0x8fdf('0x46')](handleError(_0x526ba3,null));};exports[_0x8fdf('0x24')]=function(_0x28d836,_0x11d186){return db['Automation'][_0x8fdf('0x43')]({'where':{'id':_0x28d836['params']['id']}})[_0x8fdf('0x23')](handleEntityNotFound(_0x11d186,null))[_0x8fdf('0x23')](removeEntity(_0x11d186,null))['catch'](handleError(_0x11d186,null));};exports[_0x8fdf('0x48')]=function(_0x305585,_0x56ec41,_0x53e32e){return db[_0x8fdf('0x49')]['find']({'where':{'id':_0x305585[_0x8fdf('0x47')]['id']}})[_0x8fdf('0x23')](handleEntityNotFound(_0x56ec41,null))[_0x8fdf('0x23')](function(_0x5a0d73){if(_0x5a0d73){return _0x5a0d73['addConditions'](_0x305585['body'][_0x8fdf('0x4a')],_[_0x8fdf('0x4b')](_0x305585[_0x8fdf('0x45')],[_0x8fdf('0x4a'),'id'])||{});}})['then'](respondWithResult(_0x56ec41,null))[_0x8fdf('0x46')](handleError(_0x56ec41,null));};exports['getConditions']=function(_0x132e6d,_0x22548c,_0xb1576d){var _0x10f129={};var _0x33bc96={};var _0x205c97;var _0x587c3c;return db[_0x8fdf('0x3e')][_0x8fdf('0x4c')]({'where':{'id':_0x132e6d[_0x8fdf('0x47')]['id']}})[_0x8fdf('0x23')](handleEntityNotFound(_0x22548c,null))[_0x8fdf('0x23')](function(_0x445de4){if(_0x445de4){_0x205c97=_0x445de4;_0x33bc96[_0x8fdf('0x2e')]=_['keys'](db['Condition'][_0x8fdf('0x2b')]);_0x33bc96[_0x8fdf('0x33')]=_[_0x8fdf('0x2f')](_0x132e6d[_0x8fdf('0x33')]);_0x33bc96[_0x8fdf('0x30')]=_[_0x8fdf('0x31')](_0x33bc96[_0x8fdf('0x2e')],_0x33bc96[_0x8fdf('0x33')]);_0x10f129[_0x8fdf('0x32')]=_[_0x8fdf('0x31')](_0x33bc96['model'],qs[_0x8fdf('0x34')](_0x132e6d[_0x8fdf('0x33')][_0x8fdf('0x34')]));_0x10f129[_0x8fdf('0x32')]=_0x10f129[_0x8fdf('0x32')][_0x8fdf('0x35')]?_0x10f129['attributes']:_0x33bc96[_0x8fdf('0x2e')];_0x10f129[_0x8fdf('0x38')]=qs[_0x8fdf('0x39')](_0x132e6d['query'][_0x8fdf('0x39')]);_0x10f129[_0x8fdf('0x3d')]=qs['filters'](_['pick'](_0x132e6d[_0x8fdf('0x33')],_0x33bc96['filters']));if(_0x132e6d[_0x8fdf('0x33')][_0x8fdf('0x3a')]){_0x10f129[_0x8fdf('0x3d')]=_[_0x8fdf('0x3b')](_0x10f129['where'],{'$or':_['map'](_0x10f129[_0x8fdf('0x32')],function(_0x4cc9bf){var _0x22029d={};_0x22029d[_0x4cc9bf]={'$like':'%'+_0x132e6d[_0x8fdf('0x33')][_0x8fdf('0x3a')]+'%'};return _0x22029d;})});}_0x10f129=_[_0x8fdf('0x3b')]({},_0x10f129,_0x132e6d[_0x8fdf('0x4d')]);return _0x205c97[_0x8fdf('0x4e')](_0x10f129);}})[_0x8fdf('0x23')](function(_0x1871e6){if(_0x1871e6){_0x587c3c=_0x1871e6['length'];if(!_0x132e6d[_0x8fdf('0x33')][_0x8fdf('0x36')](_0x8fdf('0x37'))){_0x10f129['limit']=qs[_0x8fdf('0x1c')](_0x132e6d[_0x8fdf('0x33')]['limit']);_0x10f129['offset']=qs[_0x8fdf('0x1b')](_0x132e6d['query'][_0x8fdf('0x1b')]);}return _0x205c97[_0x8fdf('0x4e')](_0x10f129);}})[_0x8fdf('0x23')](function(_0x23b122){if(_0x23b122){return _0x23b122?{'count':_0x587c3c,'rows':_0x23b122}:null;}})[_0x8fdf('0x23')](respondWithResult(_0x22548c,null))[_0x8fdf('0x46')](handleError(_0x22548c,null));};exports[_0x8fdf('0x4f')]=function(_0x418e1f,_0x281b62,_0x28c6d9){return db[_0x8fdf('0x50')]['find']({'where':{'id':_0x418e1f[_0x8fdf('0x47')]['id']}})[_0x8fdf('0x23')](handleEntityNotFound(_0x281b62,null))[_0x8fdf('0x23')](function(_0x2b8fc8){if(_0x2b8fc8){return _0x2b8fc8[_0x8fdf('0x4f')](_0x418e1f[_0x8fdf('0x45')]['ids'],_[_0x8fdf('0x4b')](_0x418e1f['body'],[_0x8fdf('0x4a'),'id'])||{});}})[_0x8fdf('0x23')](respondWithResult(_0x281b62,null))[_0x8fdf('0x46')](handleError(_0x281b62,null));};exports[_0x8fdf('0x51')]=function(_0x1051ac,_0x1e0fde,_0x1e2110){var _0x48f6fe={};var _0x15321d={};var _0x2ad8ee;var _0x1c0379;return db[_0x8fdf('0x3e')][_0x8fdf('0x4c')]({'where':{'id':_0x1051ac[_0x8fdf('0x47')]['id']}})[_0x8fdf('0x23')](handleEntityNotFound(_0x1e0fde,null))[_0x8fdf('0x23')](function(_0x21cfb9){if(_0x21cfb9){_0x2ad8ee=_0x21cfb9;_0x15321d['model']=_[_0x8fdf('0x2f')](db[_0x8fdf('0x50')][_0x8fdf('0x2b')]);_0x15321d[_0x8fdf('0x33')]=_[_0x8fdf('0x2f')](_0x1051ac[_0x8fdf('0x33')]);_0x15321d['filters']=_['intersection'](_0x15321d[_0x8fdf('0x2e')],_0x15321d[_0x8fdf('0x33')]);_0x48f6fe[_0x8fdf('0x32')]=_[_0x8fdf('0x31')](_0x15321d[_0x8fdf('0x2e')],qs[_0x8fdf('0x34')](_0x1051ac[_0x8fdf('0x33')][_0x8fdf('0x34')]));_0x48f6fe[_0x8fdf('0x32')]=_0x48f6fe[_0x8fdf('0x32')][_0x8fdf('0x35')]?_0x48f6fe[_0x8fdf('0x32')]:_0x15321d[_0x8fdf('0x2e')];_0x48f6fe[_0x8fdf('0x38')]=qs['sort'](_0x1051ac[_0x8fdf('0x33')][_0x8fdf('0x39')]);_0x48f6fe[_0x8fdf('0x3d')]=qs[_0x8fdf('0x30')](_[_0x8fdf('0x52')](_0x1051ac[_0x8fdf('0x33')],_0x15321d[_0x8fdf('0x30')]));if(_0x1051ac[_0x8fdf('0x33')]['filter']){_0x48f6fe['where']=_[_0x8fdf('0x3b')](_0x48f6fe['where'],{'$or':_[_0x8fdf('0x2a')](_0x48f6fe[_0x8fdf('0x32')],function(_0x10de10){var _0x456b7e={};_0x456b7e[_0x10de10]={'$like':'%'+_0x1051ac['query']['filter']+'%'};return _0x456b7e;})});}_0x48f6fe=_[_0x8fdf('0x3b')]({},_0x48f6fe,_0x1051ac[_0x8fdf('0x4d')]);return _0x2ad8ee[_0x8fdf('0x51')](_0x48f6fe);}})[_0x8fdf('0x23')](function(_0x4cc59d){if(_0x4cc59d){_0x1c0379=_0x4cc59d[_0x8fdf('0x35')];if(!_0x1051ac[_0x8fdf('0x33')][_0x8fdf('0x36')](_0x8fdf('0x37'))){_0x48f6fe[_0x8fdf('0x1c')]=qs[_0x8fdf('0x1c')](_0x1051ac[_0x8fdf('0x33')][_0x8fdf('0x1c')]);_0x48f6fe[_0x8fdf('0x1b')]=qs[_0x8fdf('0x1b')](_0x1051ac[_0x8fdf('0x33')]['offset']);}return _0x2ad8ee[_0x8fdf('0x51')](_0x48f6fe);}})['then'](function(_0x46df0c){if(_0x46df0c){return _0x46df0c?{'count':_0x1c0379,'rows':_0x46df0c}:null;}})[_0x8fdf('0x23')](respondWithResult(_0x1e0fde,null))['catch'](handleError(_0x1e0fde,null));};
\ No newline at end of file
+var _0xc8e2=['status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','then','error','stack','name','send','index','map','Automation','rawAttributes','type','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','filters','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','keys','body','find','addConditions','Condition','ids','omit','getConditions','findOne','sort','addActions','Action','getActions','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','sendStatus'];(function(_0x4549f2,_0x3ae7cb){var _0x4957d7=function(_0x1201b2){while(--_0x1201b2){_0x4549f2['push'](_0x4549f2['shift']());}};_0x4957d7(++_0x3ae7cb);}(_0xc8e2,0x1d4));var _0x2c8e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc8e2[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0x2c8e('0x0'));var rimraf=require(_0x2c8e('0x1'));var zipdir=require(_0x2c8e('0x2'));var jsonpatch=require(_0x2c8e('0x3'));var rp=require(_0x2c8e('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c8e('0x5'));var util=require('util');var path=require(_0x2c8e('0x6'));var sox=require(_0x2c8e('0x7'));var csv=require('to-csv');var ejs=require(_0x2c8e('0x8'));var fs=require('fs');var fs_extra=require(_0x2c8e('0x9'));var _=require(_0x2c8e('0xa'));var squel=require(_0x2c8e('0xb'));var crypto=require(_0x2c8e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x2c8e('0xd'));var toCsv=require(_0x2c8e('0xe'));var querystring=require(_0x2c8e('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x2c8e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x2c8e('0x11'));var hardwareService=require(_0x2c8e('0x12'));var logger=require(_0x2c8e('0x13'))('api');var utils=require(_0x2c8e('0x14'));var config=require(_0x2c8e('0x15'));var licenseUtil=require(_0x2c8e('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3adeb1,_0x1b0060){_0x1b0060=_0x1b0060||0xcc;return function(_0x5ea2ca){if(_0x5ea2ca){return _0x3adeb1[_0x2c8e('0x17')](_0x1b0060);}return _0x3adeb1[_0x2c8e('0x18')](_0x1b0060)[_0x2c8e('0x19')]();};}function respondWithResult(_0x9e83df,_0x506ff7){_0x506ff7=_0x506ff7||0xc8;return function(_0x365849){if(_0x365849){return _0x9e83df[_0x2c8e('0x18')](_0x506ff7)[_0x2c8e('0x1a')](_0x365849);}};}function respondWithFilteredResult(_0x15ce9c,_0xeb87b9){return function(_0x431a40){if(_0x431a40){var _0x29ac74=typeof _0xeb87b9[_0x2c8e('0x1b')]===_0x2c8e('0x1c')&&typeof _0xeb87b9[_0x2c8e('0x1d')]===_0x2c8e('0x1c');var _0x415fb2=_0x431a40[_0x2c8e('0x1e')];var _0x59f8dc=_0x29ac74?0x0:_0xeb87b9[_0x2c8e('0x1b')];var _0x4a6612=_0x29ac74?_0x431a40['count']:_0xeb87b9['offset']+_0xeb87b9['limit'];var _0x27aca9;if(_0x4a6612>=_0x415fb2){_0x4a6612=_0x415fb2;_0x27aca9=0xc8;}else{_0x27aca9=0xce;}_0x15ce9c[_0x2c8e('0x18')](_0x27aca9);return _0x15ce9c[_0x2c8e('0x1f')](_0x2c8e('0x20'),_0x59f8dc+'-'+_0x4a6612+'/'+_0x415fb2)[_0x2c8e('0x1a')](_0x431a40);}return null;};}function patchUpdates(_0x4624ff){return function(_0x38724){try{jsonpatch['apply'](_0x38724,_0x4624ff,!![]);}catch(_0x508f99){return BPromise[_0x2c8e('0x21')](_0x508f99);}return _0x38724[_0x2c8e('0x22')]();};}function saveUpdates(_0x2f9719,_0x5c8df6){return function(_0x37d942){if(_0x37d942){return _0x37d942[_0x2c8e('0x23')](_0x2f9719)['then'](function(_0x3f9724){return _0x3f9724;});}return null;};}function removeEntity(_0x323f5c,_0x1d0ec4){return function(_0x1fdd1a){if(_0x1fdd1a){return _0x1fdd1a[_0x2c8e('0x24')]()[_0x2c8e('0x25')](function(){_0x323f5c[_0x2c8e('0x18')](0xcc)[_0x2c8e('0x19')]();});}};}function handleEntityNotFound(_0x5dd9dc,_0x11a2b6){return function(_0x37dc11){if(!_0x37dc11){_0x5dd9dc['sendStatus'](0x194);}return _0x37dc11;};}function handleError(_0x1466ed,_0x21a3c5){_0x21a3c5=_0x21a3c5||0x1f4;return function(_0x7020){logger[_0x2c8e('0x26')](_0x7020[_0x2c8e('0x27')]);if(_0x7020[_0x2c8e('0x28')]){delete _0x7020[_0x2c8e('0x28')];}_0x1466ed['status'](_0x21a3c5)[_0x2c8e('0x29')](_0x7020);};}exports[_0x2c8e('0x2a')]=function(_0x5e2747,_0x17e02b){var _0x24fc9f={},_0x5139cd={},_0x31c7ec={'count':0x0,'rows':[]};var _0x6c1c35=_[_0x2c8e('0x2b')](db[_0x2c8e('0x2c')][_0x2c8e('0x2d')],function(_0x46a019){return{'name':_0x46a019['fieldName'],'type':_0x46a019[_0x2c8e('0x2e')]['key']};});_0x5139cd[_0x2c8e('0x2f')]=_['map'](_0x6c1c35,_0x2c8e('0x28'));_0x5139cd[_0x2c8e('0x30')]=_['keys'](_0x5e2747['query']);_0x5139cd['filters']=_[_0x2c8e('0x31')](_0x5139cd[_0x2c8e('0x2f')],_0x5139cd[_0x2c8e('0x30')]);_0x24fc9f['attributes']=_[_0x2c8e('0x31')](_0x5139cd[_0x2c8e('0x2f')],qs[_0x2c8e('0x32')](_0x5e2747[_0x2c8e('0x30')]['fields']));_0x24fc9f[_0x2c8e('0x33')]=_0x24fc9f['attributes'][_0x2c8e('0x34')]?_0x24fc9f[_0x2c8e('0x33')]:_0x5139cd['model'];if(!_0x5e2747['query'][_0x2c8e('0x35')](_0x2c8e('0x36'))){_0x24fc9f[_0x2c8e('0x1d')]=qs['limit'](_0x5e2747['query'][_0x2c8e('0x1d')]);_0x24fc9f[_0x2c8e('0x1b')]=qs[_0x2c8e('0x1b')](_0x5e2747['query'][_0x2c8e('0x1b')]);}_0x24fc9f[_0x2c8e('0x37')]=qs['sort'](_0x5e2747[_0x2c8e('0x30')]['sort']);_0x24fc9f['where']=qs[_0x2c8e('0x38')](_['pick'](_0x5e2747[_0x2c8e('0x30')],_0x5139cd[_0x2c8e('0x38')]),_0x6c1c35);if(_0x5e2747[_0x2c8e('0x30')][_0x2c8e('0x39')]){_0x24fc9f[_0x2c8e('0x3a')]=_[_0x2c8e('0x3b')](_0x24fc9f['where'],{'$or':_['map'](_0x6c1c35,function(_0x2a8672){if(_0x2a8672['type']!=='VIRTUAL'){var _0x3f89be={};_0x3f89be[_0x2a8672[_0x2c8e('0x28')]]={'$like':'%'+_0x5e2747[_0x2c8e('0x30')][_0x2c8e('0x39')]+'%'};return _0x3f89be;}})});}_0x24fc9f=_[_0x2c8e('0x3b')]({},_0x24fc9f,_0x5e2747[_0x2c8e('0x3c')]);var _0x59b843={'where':_0x24fc9f[_0x2c8e('0x3a')]};return db[_0x2c8e('0x2c')][_0x2c8e('0x1e')](_0x59b843)['then'](function(_0x13f483){_0x31c7ec[_0x2c8e('0x1e')]=_0x13f483;if(_0x5e2747['query'][_0x2c8e('0x3d')]){_0x24fc9f[_0x2c8e('0x3e')]=[{'all':!![]}];}return db['Automation'][_0x2c8e('0x3f')](_0x24fc9f);})['then'](function(_0x582686){_0x31c7ec[_0x2c8e('0x40')]=_0x582686;return _0x31c7ec;})[_0x2c8e('0x25')](respondWithFilteredResult(_0x17e02b,_0x24fc9f))[_0x2c8e('0x41')](handleError(_0x17e02b,null));};exports[_0x2c8e('0x42')]=function(_0x5b2f61,_0x275b40){var _0x93d206={'raw':![],'where':{'id':_0x5b2f61[_0x2c8e('0x43')]['id']}},_0x13b2a9={};_0x13b2a9['model']=_['keys'](db['Automation']['rawAttributes']);_0x13b2a9[_0x2c8e('0x30')]=_[_0x2c8e('0x44')](_0x5b2f61[_0x2c8e('0x30')]);_0x13b2a9[_0x2c8e('0x38')]=_[_0x2c8e('0x31')](_0x13b2a9[_0x2c8e('0x2f')],_0x13b2a9[_0x2c8e('0x30')]);_0x93d206[_0x2c8e('0x33')]=_[_0x2c8e('0x31')](_0x13b2a9[_0x2c8e('0x2f')],qs[_0x2c8e('0x32')](_0x5b2f61['query'][_0x2c8e('0x32')]));_0x93d206[_0x2c8e('0x33')]=_0x93d206[_0x2c8e('0x33')]['length']?_0x93d206[_0x2c8e('0x33')]:_0x13b2a9[_0x2c8e('0x2f')];if(_0x5b2f61[_0x2c8e('0x30')][_0x2c8e('0x3d')]){_0x93d206[_0x2c8e('0x3e')]=[{'all':!![]}];}_0x93d206=_[_0x2c8e('0x3b')]({},_0x93d206,_0x5b2f61[_0x2c8e('0x3c')]);return db[_0x2c8e('0x2c')]['find'](_0x93d206)[_0x2c8e('0x25')](handleEntityNotFound(_0x275b40,null))[_0x2c8e('0x25')](respondWithResult(_0x275b40,null))[_0x2c8e('0x41')](handleError(_0x275b40,null));};exports['create']=function(_0x37e070,_0x120632){return db[_0x2c8e('0x2c')]['create'](_0x37e070[_0x2c8e('0x45')],{})[_0x2c8e('0x25')](respondWithResult(_0x120632,0xc9))[_0x2c8e('0x41')](handleError(_0x120632,null));};exports[_0x2c8e('0x23')]=function(_0x5bbaea,_0x194b3c){if(_0x5bbaea[_0x2c8e('0x45')]['id']){delete _0x5bbaea[_0x2c8e('0x45')]['id'];}return db['Automation'][_0x2c8e('0x46')]({'where':{'id':_0x5bbaea[_0x2c8e('0x43')]['id']}})[_0x2c8e('0x25')](handleEntityNotFound(_0x194b3c,null))[_0x2c8e('0x25')](saveUpdates(_0x5bbaea[_0x2c8e('0x45')],null))['then'](respondWithResult(_0x194b3c,null))[_0x2c8e('0x41')](handleError(_0x194b3c,null));};exports[_0x2c8e('0x24')]=function(_0x2de496,_0x4ef6b6){return db['Automation'][_0x2c8e('0x46')]({'where':{'id':_0x2de496[_0x2c8e('0x43')]['id']}})[_0x2c8e('0x25')](handleEntityNotFound(_0x4ef6b6,null))[_0x2c8e('0x25')](removeEntity(_0x4ef6b6,null))['catch'](handleError(_0x4ef6b6,null));};exports[_0x2c8e('0x47')]=function(_0x1d3d24,_0xdfc74b,_0x3fd421){return db[_0x2c8e('0x48')][_0x2c8e('0x46')]({'where':{'id':_0x1d3d24[_0x2c8e('0x43')]['id']}})[_0x2c8e('0x25')](handleEntityNotFound(_0xdfc74b,null))[_0x2c8e('0x25')](function(_0xb23c0a){if(_0xb23c0a){return _0xb23c0a[_0x2c8e('0x47')](_0x1d3d24[_0x2c8e('0x45')][_0x2c8e('0x49')],_[_0x2c8e('0x4a')](_0x1d3d24[_0x2c8e('0x45')],[_0x2c8e('0x49'),'id'])||{});}})['then'](respondWithResult(_0xdfc74b,null))[_0x2c8e('0x41')](handleError(_0xdfc74b,null));};exports[_0x2c8e('0x4b')]=function(_0x294943,_0x4f5075,_0x207ca9){var _0x32cb18={};var _0x144729={};var _0x265dc9;var _0x22c6c5;return db[_0x2c8e('0x2c')][_0x2c8e('0x4c')]({'where':{'id':_0x294943[_0x2c8e('0x43')]['id']}})[_0x2c8e('0x25')](handleEntityNotFound(_0x4f5075,null))[_0x2c8e('0x25')](function(_0x4cb2af){if(_0x4cb2af){_0x265dc9=_0x4cb2af;_0x144729[_0x2c8e('0x2f')]=_['keys'](db[_0x2c8e('0x48')]['rawAttributes']);_0x144729[_0x2c8e('0x30')]=_['keys'](_0x294943['query']);_0x144729[_0x2c8e('0x38')]=_[_0x2c8e('0x31')](_0x144729['model'],_0x144729[_0x2c8e('0x30')]);_0x32cb18[_0x2c8e('0x33')]=_[_0x2c8e('0x31')](_0x144729['model'],qs['fields'](_0x294943[_0x2c8e('0x30')][_0x2c8e('0x32')]));_0x32cb18[_0x2c8e('0x33')]=_0x32cb18['attributes'][_0x2c8e('0x34')]?_0x32cb18[_0x2c8e('0x33')]:_0x144729['model'];_0x32cb18[_0x2c8e('0x37')]=qs[_0x2c8e('0x4d')](_0x294943['query'][_0x2c8e('0x4d')]);_0x32cb18[_0x2c8e('0x3a')]=qs[_0x2c8e('0x38')](_['pick'](_0x294943[_0x2c8e('0x30')],_0x144729[_0x2c8e('0x38')]));if(_0x294943[_0x2c8e('0x30')][_0x2c8e('0x39')]){_0x32cb18[_0x2c8e('0x3a')]=_[_0x2c8e('0x3b')](_0x32cb18[_0x2c8e('0x3a')],{'$or':_[_0x2c8e('0x2b')](_0x32cb18[_0x2c8e('0x33')],function(_0x960a36){var _0x3492ad={};_0x3492ad[_0x960a36]={'$like':'%'+_0x294943['query'][_0x2c8e('0x39')]+'%'};return _0x3492ad;})});}_0x32cb18=_['merge']({},_0x32cb18,_0x294943[_0x2c8e('0x3c')]);return _0x265dc9[_0x2c8e('0x4b')](_0x32cb18);}})['then'](function(_0x51a202){if(_0x51a202){_0x22c6c5=_0x51a202['length'];if(!_0x294943['query'][_0x2c8e('0x35')](_0x2c8e('0x36'))){_0x32cb18[_0x2c8e('0x1d')]=qs['limit'](_0x294943[_0x2c8e('0x30')][_0x2c8e('0x1d')]);_0x32cb18[_0x2c8e('0x1b')]=qs[_0x2c8e('0x1b')](_0x294943[_0x2c8e('0x30')][_0x2c8e('0x1b')]);}return _0x265dc9['getConditions'](_0x32cb18);}})[_0x2c8e('0x25')](function(_0x506d81){if(_0x506d81){return _0x506d81?{'count':_0x22c6c5,'rows':_0x506d81}:null;}})[_0x2c8e('0x25')](respondWithResult(_0x4f5075,null))[_0x2c8e('0x41')](handleError(_0x4f5075,null));};exports[_0x2c8e('0x4e')]=function(_0x41f433,_0x59b1f1,_0x185077){return db[_0x2c8e('0x4f')]['find']({'where':{'id':_0x41f433[_0x2c8e('0x43')]['id']}})[_0x2c8e('0x25')](handleEntityNotFound(_0x59b1f1,null))['then'](function(_0xe8a344){if(_0xe8a344){return _0xe8a344[_0x2c8e('0x4e')](_0x41f433[_0x2c8e('0x45')][_0x2c8e('0x49')],_[_0x2c8e('0x4a')](_0x41f433['body'],['ids','id'])||{});}})[_0x2c8e('0x25')](respondWithResult(_0x59b1f1,null))[_0x2c8e('0x41')](handleError(_0x59b1f1,null));};exports[_0x2c8e('0x50')]=function(_0x5d2e6e,_0x1e1c34,_0x23e5d0){var _0x55b84c={};var _0x376ad1={};var _0x2e0275;var _0x58fe6f;return db[_0x2c8e('0x2c')][_0x2c8e('0x4c')]({'where':{'id':_0x5d2e6e[_0x2c8e('0x43')]['id']}})[_0x2c8e('0x25')](handleEntityNotFound(_0x1e1c34,null))[_0x2c8e('0x25')](function(_0x5971a3){if(_0x5971a3){_0x2e0275=_0x5971a3;_0x376ad1[_0x2c8e('0x2f')]=_[_0x2c8e('0x44')](db[_0x2c8e('0x4f')][_0x2c8e('0x2d')]);_0x376ad1[_0x2c8e('0x30')]=_[_0x2c8e('0x44')](_0x5d2e6e['query']);_0x376ad1[_0x2c8e('0x38')]=_[_0x2c8e('0x31')](_0x376ad1['model'],_0x376ad1[_0x2c8e('0x30')]);_0x55b84c[_0x2c8e('0x33')]=_[_0x2c8e('0x31')](_0x376ad1[_0x2c8e('0x2f')],qs['fields'](_0x5d2e6e[_0x2c8e('0x30')][_0x2c8e('0x32')]));_0x55b84c['attributes']=_0x55b84c[_0x2c8e('0x33')]['length']?_0x55b84c['attributes']:_0x376ad1[_0x2c8e('0x2f')];_0x55b84c[_0x2c8e('0x37')]=qs[_0x2c8e('0x4d')](_0x5d2e6e[_0x2c8e('0x30')]['sort']);_0x55b84c[_0x2c8e('0x3a')]=qs['filters'](_[_0x2c8e('0x51')](_0x5d2e6e[_0x2c8e('0x30')],_0x376ad1[_0x2c8e('0x38')]));if(_0x5d2e6e['query']['filter']){_0x55b84c[_0x2c8e('0x3a')]=_[_0x2c8e('0x3b')](_0x55b84c['where'],{'$or':_[_0x2c8e('0x2b')](_0x55b84c[_0x2c8e('0x33')],function(_0x2c95b4){var _0x1530dd={};_0x1530dd[_0x2c95b4]={'$like':'%'+_0x5d2e6e[_0x2c8e('0x30')]['filter']+'%'};return _0x1530dd;})});}_0x55b84c=_[_0x2c8e('0x3b')]({},_0x55b84c,_0x5d2e6e['options']);return _0x2e0275[_0x2c8e('0x50')](_0x55b84c);}})[_0x2c8e('0x25')](function(_0x31bcf0){if(_0x31bcf0){_0x58fe6f=_0x31bcf0[_0x2c8e('0x34')];if(!_0x5d2e6e['query'][_0x2c8e('0x35')]('nolimit')){_0x55b84c[_0x2c8e('0x1d')]=qs[_0x2c8e('0x1d')](_0x5d2e6e[_0x2c8e('0x30')][_0x2c8e('0x1d')]);_0x55b84c['offset']=qs[_0x2c8e('0x1b')](_0x5d2e6e['query'][_0x2c8e('0x1b')]);}return _0x2e0275[_0x2c8e('0x50')](_0x55b84c);}})[_0x2c8e('0x25')](function(_0x5862f5){if(_0x5862f5){return _0x5862f5?{'count':_0x58fe6f,'rows':_0x5862f5}:null;}})[_0x2c8e('0x25')](respondWithResult(_0x1e1c34,null))['catch'](handleError(_0x1e1c34,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 52172da..422f01c 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 _0xe704=['util','../../config/logger','api','moment','bluebird','request-promise','path','./automation.attributes','exports','define','Automation','tools_automations'];(function(_0x2e71ba,_0x4e04f4){var _0x4715d4=function(_0x33c8be){while(--_0x33c8be){_0x2e71ba['push'](_0x2e71ba['shift']());}};_0x4715d4(++_0x4e04f4);}(_0xe704,0xd8));var _0x4e70=function(_0x53b07f,_0xe70c95){_0x53b07f=_0x53b07f-0x0;var _0x28730e=_0xe704[_0x53b07f];return _0x28730e;};'use strict';var _=require('lodash');var util=require(_0x4e70('0x0'));var logger=require(_0x4e70('0x1'))(_0x4e70('0x2'));var moment=require(_0x4e70('0x3'));var BPromise=require(_0x4e70('0x4'));var rp=require(_0x4e70('0x5'));var fs=require('fs');var path=require(_0x4e70('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4e70('0x7'));module[_0x4e70('0x8')]=function(_0x1ef113,_0x37842f){return _0x1ef113[_0x4e70('0x9')](_0x4e70('0xa'),attributes,{'tableName':_0x4e70('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x8f3d=['request-promise','path','rimraf','./automation.attributes','exports','Automation','tools_automations','lodash','util','../../config/logger','api','bluebird'];(function(_0x648818,_0x2169db){var _0x353087=function(_0x142b08){while(--_0x142b08){_0x648818['push'](_0x648818['shift']());}};_0x353087(++_0x2169db);}(_0x8f3d,0x157));var _0xd8f3=function(_0x396b6d,_0x382476){_0x396b6d=_0x396b6d-0x0;var _0x5ee4a3=_0x8f3d[_0x396b6d];return _0x5ee4a3;};'use strict';var _=require(_0xd8f3('0x0'));var util=require(_0xd8f3('0x1'));var logger=require(_0xd8f3('0x2'))(_0xd8f3('0x3'));var moment=require('moment');var BPromise=require(_0xd8f3('0x4'));var rp=require(_0xd8f3('0x5'));var fs=require('fs');var path=require(_0xd8f3('0x6'));var rimraf=require(_0xd8f3('0x7'));var config=require('../../config/environment');var attributes=require(_0xd8f3('0x8'));module[_0xd8f3('0x9')]=function(_0x4914ee,_0x1bd360){return _0x4914ee['define'](_0xd8f3('0xa'),attributes,{'tableName':_0xd8f3('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 dd93bf1..5ebf642 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 _0x2c16=['moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','Automation,\x20%s,\x20%s','message','catch','lodash','util'];(function(_0x5a4a76,_0x142d2f){var _0xd2bfba=function(_0xbeb5c4){while(--_0xbeb5c4){_0x5a4a76['push'](_0x5a4a76['shift']());}};_0xd2bfba(++_0x142d2f);}(_0x2c16,0xf0));var _0x62c1=function(_0x26b5e6,_0x3e7cff){_0x26b5e6=_0x26b5e6-0x0;var _0x2b4c4f=_0x2c16[_0x26b5e6];return _0x2b4c4f;};'use strict';var _=require(_0x62c1('0x0'));var util=require(_0x62c1('0x1'));var moment=require(_0x62c1('0x2'));var BPromise=require('bluebird');var rs=require(_0x62c1('0x3'));var fs=require('fs');var Redis=require(_0x62c1('0x4'));var db=require(_0x62c1('0x5'))['db'];var utils=require(_0x62c1('0x6'));var logger=require(_0x62c1('0x7'))(_0x62c1('0x8'));var config=require(_0x62c1('0x9'));var jayson=require(_0x62c1('0xa'));var client=jayson[_0x62c1('0xb')][_0x62c1('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x527671,_0x113a32,_0x4bcc7b){return new BPromise(function(_0x236518,_0x4af828){return client[_0x62c1('0xd')](_0x527671,_0x4bcc7b)['then'](function(_0x153420){logger[_0x62c1('0xe')]('Automation,\x20%s,\x20%s',_0x113a32,_0x62c1('0xf'));logger['debug'](_0x62c1('0x10'),_0x113a32,_0x62c1('0xf'),JSON[_0x62c1('0x11')](_0x153420));if(_0x153420[_0x62c1('0x12')]){if(_0x153420[_0x62c1('0x12')]['code']===0x1f4){logger['error'](_0x62c1('0x13'),_0x113a32,_0x153420[_0x62c1('0x12')]['message']);return _0x4af828(_0x153420['error'][_0x62c1('0x14')]);}logger[_0x62c1('0x12')]('Automation,\x20%s,\x20%s',_0x113a32,_0x153420[_0x62c1('0x12')][_0x62c1('0x14')]);return _0x236518(_0x153420[_0x62c1('0x12')][_0x62c1('0x14')]);}else{logger[_0x62c1('0xe')]('Automation,\x20%s,\x20%s',_0x113a32,_0x62c1('0xf'));_0x236518(_0x153420['result'][_0x62c1('0x14')]);}})[_0x62c1('0x15')](function(_0x969e09){logger[_0x62c1('0x12')](_0x62c1('0x13'),_0x113a32,_0x969e09);_0x4af828(_0x969e09);});});}
\ No newline at end of file
+var _0x3da6=['error','code','message','info','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','then','Automation,\x20%s,\x20%s','debug','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0x3da6,0xc1));var _0x63da=function(_0x617084,_0x27a65f){_0x617084=_0x617084-0x0;var _0x384ac0=_0x3da6[_0x617084];return _0x384ac0;};'use strict';var _=require(_0x63da('0x0'));var util=require(_0x63da('0x1'));var moment=require(_0x63da('0x2'));var BPromise=require(_0x63da('0x3'));var rs=require(_0x63da('0x4'));var fs=require('fs');var Redis=require(_0x63da('0x5'));var db=require(_0x63da('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x63da('0x7'))(_0x63da('0x8'));var config=require('../../config/environment');var jayson=require(_0x63da('0x9'));var client=jayson['client'][_0x63da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x519714,_0x1e6160,_0x7a48ee){return new BPromise(function(_0xbf0f63,_0x39a442){return client['request'](_0x519714,_0x7a48ee)[_0x63da('0xb')](function(_0xdc10c4){logger['info'](_0x63da('0xc'),_0x1e6160,'request\x20sent');logger[_0x63da('0xd')](_0x63da('0xe'),_0x1e6160,_0x63da('0xf'),JSON[_0x63da('0x10')](_0xdc10c4));if(_0xdc10c4[_0x63da('0x11')]){if(_0xdc10c4['error'][_0x63da('0x12')]===0x1f4){logger['error'](_0x63da('0xc'),_0x1e6160,_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);return _0x39a442(_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);}logger[_0x63da('0x11')](_0x63da('0xc'),_0x1e6160,_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);return _0xbf0f63(_0xdc10c4[_0x63da('0x11')][_0x63da('0x13')]);}else{logger[_0x63da('0x14')](_0x63da('0xc'),_0x1e6160,'request\x20sent');_0xbf0f63(_0xdc10c4['result'][_0x63da('0x13')]);}})['catch'](function(_0x1f2f88){logger[_0x63da('0x11')](_0x63da('0xc'),_0x1e6160,_0x1f2f88);_0x39a442(_0x1f2f88);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index 00948ac..306debf 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 _0x946e=['destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','index','/:id','show','/:id/conditions','isAuthenticated','create','addConditions','/:id/actions','addActions','put','update'];(function(_0x3bcf9e,_0x148a5d){var _0x1bb37c=function(_0xcaf5da){while(--_0xcaf5da){_0x3bcf9e['push'](_0x3bcf9e['shift']());}};_0x1bb37c(++_0x148a5d);}(_0x946e,0x1d0));var _0xe946=function(_0x3af10e,_0x273881){_0x3af10e=_0x3af10e-0x0;var _0x40070e=_0x946e[_0x3af10e];return _0x40070e;};'use strict';var multer=require(_0xe946('0x0'));var util=require('util');var path=require(_0xe946('0x1'));var timeout=require('connect-timeout');var express=require(_0xe946('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xe946('0x3'));var interaction=require(_0xe946('0x4'));var config=require(_0xe946('0x5'));var controller=require(_0xe946('0x6'));router[_0xe946('0x7')]('/',auth['isAuthenticated'](),controller[_0xe946('0x8')]);router[_0xe946('0x7')](_0xe946('0x9'),auth['isAuthenticated'](),controller[_0xe946('0xa')]);router['get'](_0xe946('0xb'),auth[_0xe946('0xc')](),controller['getConditions']);router['get']('/:id/actions',auth[_0xe946('0xc')](),controller['getActions']);router['post']('/',auth[_0xe946('0xc')](),controller[_0xe946('0xd')]);router['post']('/:id/conditions',auth[_0xe946('0xc')](),controller[_0xe946('0xe')]);router['post'](_0xe946('0xf'),auth[_0xe946('0xc')](),controller[_0xe946('0x10')]);router[_0xe946('0x11')](_0xe946('0x9'),auth[_0xe946('0xc')](),controller[_0xe946('0x12')]);router['delete']('/:id',auth[_0xe946('0xc')](),controller[_0xe946('0x13')]);module[_0xe946('0x14')]=router;
\ No newline at end of file
+var _0xafe6=['destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addActions','put','update','delete'];(function(_0x45fa83,_0x1bf036){var _0x3ddf5d=function(_0x24b9a8){while(--_0x24b9a8){_0x45fa83['push'](_0x45fa83['shift']());}};_0x3ddf5d(++_0x1bf036);}(_0xafe6,0x66));var _0x6afe=function(_0x25ec2d,_0x3220f2){_0x25ec2d=_0x25ec2d-0x0;var _0x4b625b=_0xafe6[_0x25ec2d];return _0x4b625b;};'use strict';var multer=require(_0x6afe('0x0'));var util=require(_0x6afe('0x1'));var path=require(_0x6afe('0x2'));var timeout=require(_0x6afe('0x3'));var express=require(_0x6afe('0x4'));var router=express['Router']();var fs_extra=require(_0x6afe('0x5'));var auth=require(_0x6afe('0x6'));var interaction=require(_0x6afe('0x7'));var config=require('../../config/environment');var controller=require('./automation.controller');router[_0x6afe('0x8')]('/',auth['isAuthenticated'](),controller[_0x6afe('0x9')]);router[_0x6afe('0x8')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0xc')]);router['get'](_0x6afe('0xd'),auth['isAuthenticated'](),controller[_0x6afe('0xe')]);router['get'](_0x6afe('0xf'),auth[_0x6afe('0xb')](),controller[_0x6afe('0x10')]);router[_0x6afe('0x11')]('/',auth[_0x6afe('0xb')](),controller[_0x6afe('0x12')]);router[_0x6afe('0x11')](_0x6afe('0xd'),auth[_0x6afe('0xb')](),controller['addConditions']);router[_0x6afe('0x11')]('/:id/actions',auth[_0x6afe('0xb')](),controller[_0x6afe('0x13')]);router[_0x6afe('0x14')](_0x6afe('0xa'),auth[_0x6afe('0xb')](),controller[_0x6afe('0x15')]);router[_0x6afe('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x6afe('0x17')]);module[_0x6afe('0x18')]=router;
\ No newline at end of file
diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js
index 4b0f741..957d9c2 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 _0x62a8=['Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','onlyIfOpen','BOOLEAN','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\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','DESC','Cut\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','STRING','name','ENUM','ivr','Active/Disactive\x20Campaign','UNSIGNED','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x62a8,0x16b));var _0x862a=function(_0x103f47,_0x3a4c98){_0x103f47=_0x103f47-0x0;var _0x4ad438=_0x62a8[_0x103f47];return _0x4ad438;};'use strict';var Sequelize=require(_0x862a('0x0'));module[_0x862a('0x1')]={'name':{'type':Sequelize[_0x862a('0x2')],'unique':_0x862a('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x862a('0x4')]('ivr'),'allowNull':![],'defaultValue':_0x862a('0x5')},'description':{'type':Sequelize[_0x862a('0x2')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x862a('0x6')},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x862a('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0x862a('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0xe')},'dialGlobalMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x862a('0xf')},'dialTimezone':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x862a('0x2')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x862a('0x4')](_0x862a('0x10'),'never',_0x862a('0x11')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x862a('0x12')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x862a('0x13')},'dialAMDGreeting':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x862a('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x15')},'dialAMDMinWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x862a('0x16')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x862a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x862a('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x862a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x862a('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x862a('0x8')](0x9)[_0x862a('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x862a('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x862a('0x1a'),'ASC'),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize[_0x862a('0x2')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x862a('0x1b')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1c')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1e')},'dialMachineMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x862a('0x8')](0x3)[_0x862a('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x862a('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x862a('0x8')](0x5)[_0x862a('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x862a('0x21')}};
\ No newline at end of file
+var _0x65ac=['Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\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)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC'];(function(_0x4f1026,_0x5aad6e){var _0x18fd21=function(_0x491f97){while(--_0x491f97){_0x4f1026['push'](_0x4f1026['shift']());}};_0x18fd21(++_0x5aad6e);}(_0x65ac,0xf8));var _0xc65a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x65ac[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xc65a('0x0'));module[_0xc65a('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc65a('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xc65a('0x3')](_0xc65a('0x4')),'allowNull':![],'defaultValue':_0xc65a('0x4')},'description':{'type':Sequelize[_0xc65a('0x5')]},'active':{'type':Sequelize[_0xc65a('0x6')],'defaultValue':0x0,'comment':_0xc65a('0x7')},'limitCalls':{'type':Sequelize[_0xc65a('0x8')](0x4)[_0xc65a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xc65a('0xa')},'dialOriginateCallerIdName':{'type':Sequelize[_0xc65a('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xc65a('0x5')]},'dialOriginateTimeout':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc65a('0xb')},'dialCongestionMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc65a('0xc')},'dialCongestionRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc65a('0xd')},'dialBusyMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc65a('0xe')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'comment':_0xc65a('0xf')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc65a('0x10')},'dialGlobalMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xc65a('0x11')},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xc65a('0x12')},'dialCheckDuplicateType':{'type':Sequelize[_0xc65a('0x3')](_0xc65a('0x13'),_0xc65a('0x14'),_0xc65a('0x15')),'defaultValue':_0xc65a('0x13')},'dialAMDActive':{'type':Sequelize[_0xc65a('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xc65a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xc65a('0x16')},'dialAMDGreeting':{'type':Sequelize[_0xc65a('0x8')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xc65a('0x8')](0x9)[_0xc65a('0x9')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xc65a('0x17')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0xc65a('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc65a('0x18')},'dialAMDMinWordLength':{'type':Sequelize[_0xc65a('0x8')](0x9)[_0xc65a('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xc65a('0x19')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xc65a('0x8')](0x9)[_0xc65a('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xc65a('0x1a')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xc65a('0x8')](0x9)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xc65a('0x1b')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xc65a('0x1c')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xc65a('0x8')](0x9)[_0xc65a('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xc65a('0x1d')},'dialOrderByScheduledAt':{'type':Sequelize[_0xc65a('0x3')](_0xc65a('0x1e'),_0xc65a('0x1f')),'defaultValue':_0xc65a('0x1e')},'dialPrefix':{'type':Sequelize[_0xc65a('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xc65a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xc65a('0x20')},'dialCutDigit':{'type':Sequelize[_0xc65a('0x8')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc65a('0x21')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc65a('0x22')},'dialDropRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc65a('0x23')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc65a('0x24')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc65a('0x25')},'dialMachineMaxRetry':{'type':Sequelize[_0xc65a('0x8')](0x3)[_0xc65a('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xc65a('0x26')},'dialMachineRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xc65a('0x27')},'dialAgentRejectMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xc65a('0x8')](0x5)[_0xc65a('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 7ba2261..616e769 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 _0xe330=['addBlackLists','omit','cm_hopper_black','removeBlackLists','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','limit','undefined','count','offset','set','Content-Range','reject','then','get','IvrCampaigns','UserProfileResource','destroy','name','send','index','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','includeAll','include','Campaign','findAll','catch','show','params','options','find','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','error','clone','rawAttributes','updatedAt','body','createdAt','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','order','CampaignId','rows','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','from','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','cm_contacts','deletedAt\x20IS\x20NULL','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','join','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','removeLists','getBlackLists'];(function(_0x480cee,_0x3d4b07){var _0x25f2c5=function(_0x4fc976){while(--_0x4fc976){_0x480cee['push'](_0x480cee['shift']());}};_0x25f2c5(++_0x3d4b07);}(_0xe330,0x96));var _0x0e33=function(_0x332431,_0x56e16e){_0x332431=_0x332431-0x0;var _0x88af2c=_0xe330[_0x332431];return _0x88af2c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x0e33('0x0'));var zipdir=require(_0x0e33('0x1'));var jsonpatch=require(_0x0e33('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0e33('0x3'));var Mustache=require(_0x0e33('0x4'));var util=require('util');var path=require(_0x0e33('0x5'));var sox=require(_0x0e33('0x6'));var csv=require('to-csv');var ejs=require(_0x0e33('0x7'));var fs=require('fs');var fs_extra=require(_0x0e33('0x8'));var _=require(_0x0e33('0x9'));var squel=require(_0x0e33('0xa'));var crypto=require(_0x0e33('0xb'));var jsforce=require(_0x0e33('0xc'));var deskjs=require(_0x0e33('0xd'));var toCsv=require(_0x0e33('0xe'));var querystring=require(_0x0e33('0xf'));var Papa=require(_0x0e33('0x10'));var Redis=require(_0x0e33('0x11'));var authService=require(_0x0e33('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x0e33('0x13'));var hardwareService=require(_0x0e33('0x14'));var logger=require(_0x0e33('0x15'))(_0x0e33('0x16'));var utils=require('../../config/utils');var config=require(_0x0e33('0x17'));var licenseUtil=require(_0x0e33('0x18'));var db=require(_0x0e33('0x19'))['db'];function respondWithStatusCode(_0x2c048c,_0x512994){_0x512994=_0x512994||0xcc;return function(_0x4f379c){if(_0x4f379c){return _0x2c048c[_0x0e33('0x1a')](_0x512994);}return _0x2c048c['status'](_0x512994)[_0x0e33('0x1b')]();};}function respondWithResult(_0x4725d8,_0x4267a3){_0x4267a3=_0x4267a3||0xc8;return function(_0x28751c){if(_0x28751c){return _0x4725d8[_0x0e33('0x1c')](_0x4267a3)[_0x0e33('0x1d')](_0x28751c);}};}function respondWithFilteredResult(_0x16d45c,_0x4148d4){return function(_0x25fbaf){if(_0x25fbaf){var _0x3c5399=typeof _0x4148d4['offset']==='undefined'&&typeof _0x4148d4[_0x0e33('0x1e')]===_0x0e33('0x1f');var _0xa73fa5=_0x25fbaf[_0x0e33('0x20')];var _0x515efc=_0x3c5399?0x0:_0x4148d4[_0x0e33('0x21')];var _0x35ab15=_0x3c5399?_0x25fbaf[_0x0e33('0x20')]:_0x4148d4[_0x0e33('0x21')]+_0x4148d4[_0x0e33('0x1e')];var _0x296c50;if(_0x35ab15>=_0xa73fa5){_0x35ab15=_0xa73fa5;_0x296c50=0xc8;}else{_0x296c50=0xce;}_0x16d45c[_0x0e33('0x1c')](_0x296c50);return _0x16d45c[_0x0e33('0x22')](_0x0e33('0x23'),_0x515efc+'-'+_0x35ab15+'/'+_0xa73fa5)[_0x0e33('0x1d')](_0x25fbaf);}return null;};}function patchUpdates(_0x651a94){return function(_0x58c4f9){try{jsonpatch['apply'](_0x58c4f9,_0x651a94,!![]);}catch(_0x29cd1b){return BPromise[_0x0e33('0x24')](_0x29cd1b);}return _0x58c4f9['save']();};}function saveUpdates(_0x510039,_0x17c388){return function(_0x4a1db6){if(_0x4a1db6){return _0x4a1db6['update'](_0x510039)['then'](function(_0x113707){return _0x113707;});}return null;};}function removeEntity(_0x3d0853,_0x5497bb){return function(_0x48232e){if(_0x48232e){return _0x48232e['destroy']()[_0x0e33('0x25')](function(){var _0x1eaceb=_0x48232e[_0x0e33('0x26')]({'plain':!![]});var _0x1ca468=_0x0e33('0x27');return db[_0x0e33('0x28')][_0x0e33('0x29')]({'where':{'type':_0x1ca468,'resourceId':_0x1eaceb['id']}})[_0x0e33('0x25')](function(){return _0x48232e;});})['then'](function(){_0x3d0853[_0x0e33('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33f8e1,_0x38a78a){return function(_0x2d86d8){if(!_0x2d86d8){_0x33f8e1[_0x0e33('0x1a')](0x194);}return _0x2d86d8;};}function handleError(_0x1f3bfa,_0x103ddb){_0x103ddb=_0x103ddb||0x1f4;return function(_0x603e2e){logger['error'](_0x603e2e['stack']);if(_0x603e2e[_0x0e33('0x2a')]){delete _0x603e2e[_0x0e33('0x2a')];}_0x1f3bfa['status'](_0x103ddb)[_0x0e33('0x2b')](_0x603e2e);};}exports[_0x0e33('0x2c')]=function(_0x585269,_0x4458ad){var _0x379fa7={},_0x220107={},_0x11f181={'count':0x0,'rows':[]};var _0x143241=_['map'](db['Campaign']['rawAttributes'],function(_0x39fdf2){return{'name':_0x39fdf2[_0x0e33('0x2d')],'type':_0x39fdf2[_0x0e33('0x2e')]['key']};});_0x220107[_0x0e33('0x2f')]=_[_0x0e33('0x30')](_0x143241,_0x0e33('0x2a'));_0x220107['query']=_[_0x0e33('0x31')](_0x585269[_0x0e33('0x32')]);_0x220107[_0x0e33('0x33')]=_[_0x0e33('0x34')](_0x220107[_0x0e33('0x2f')],_0x220107[_0x0e33('0x32')]);_0x379fa7[_0x0e33('0x35')]=_[_0x0e33('0x34')](_0x220107[_0x0e33('0x2f')],qs[_0x0e33('0x36')](_0x585269['query']['fields']));_0x379fa7['attributes']=_0x379fa7[_0x0e33('0x35')][_0x0e33('0x37')]?_0x379fa7[_0x0e33('0x35')]:_0x220107[_0x0e33('0x2f')];if(!_0x585269['query'][_0x0e33('0x38')](_0x0e33('0x39'))){_0x379fa7['limit']=qs[_0x0e33('0x1e')](_0x585269[_0x0e33('0x32')][_0x0e33('0x1e')]);_0x379fa7[_0x0e33('0x21')]=qs[_0x0e33('0x21')](_0x585269['query'][_0x0e33('0x21')]);}_0x379fa7['order']=qs[_0x0e33('0x3a')](_0x585269[_0x0e33('0x32')][_0x0e33('0x3a')]);_0x379fa7['where']=qs[_0x0e33('0x33')](_[_0x0e33('0x3b')](_0x585269[_0x0e33('0x32')],_0x220107['filters']),_0x143241);if(_0x585269[_0x0e33('0x32')][_0x0e33('0x3c')]){_0x379fa7[_0x0e33('0x3d')]=_[_0x0e33('0x3e')](_0x379fa7[_0x0e33('0x3d')],{'$or':_[_0x0e33('0x30')](_0x143241,function(_0x52d6ab){if(_0x52d6ab[_0x0e33('0x2e')]!=='VIRTUAL'){var _0x502a46={};_0x502a46[_0x52d6ab[_0x0e33('0x2a')]]={'$like':'%'+_0x585269['query']['filter']+'%'};return _0x502a46;}})});}_0x379fa7=_[_0x0e33('0x3e')]({},_0x379fa7,_0x585269['options']);var _0x5054d8={'where':_0x379fa7[_0x0e33('0x3d')]};return db['Campaign'][_0x0e33('0x20')](_0x5054d8)['then'](function(_0x4f513a){_0x11f181[_0x0e33('0x20')]=_0x4f513a;if(_0x585269['query'][_0x0e33('0x3f')]){_0x379fa7[_0x0e33('0x40')]=[{'all':!![]}];}return db[_0x0e33('0x41')][_0x0e33('0x42')](_0x379fa7);})['then'](function(_0x1b1d2f){_0x11f181['rows']=_0x1b1d2f;return _0x11f181;})[_0x0e33('0x25')](respondWithFilteredResult(_0x4458ad,_0x379fa7))[_0x0e33('0x43')](handleError(_0x4458ad,null));};exports[_0x0e33('0x44')]=function(_0x37b82b,_0x1b3c6b){var _0xc74e96={'raw':![],'where':{'id':_0x37b82b[_0x0e33('0x45')]['id']}},_0x19a484={};_0x19a484[_0x0e33('0x2f')]=_[_0x0e33('0x31')](db[_0x0e33('0x41')]['rawAttributes']);_0x19a484[_0x0e33('0x32')]=_['keys'](_0x37b82b[_0x0e33('0x32')]);_0x19a484[_0x0e33('0x33')]=_[_0x0e33('0x34')](_0x19a484[_0x0e33('0x2f')],_0x19a484['query']);_0xc74e96[_0x0e33('0x35')]=_[_0x0e33('0x34')](_0x19a484[_0x0e33('0x2f')],qs[_0x0e33('0x36')](_0x37b82b[_0x0e33('0x32')][_0x0e33('0x36')]));_0xc74e96[_0x0e33('0x35')]=_0xc74e96['attributes'][_0x0e33('0x37')]?_0xc74e96[_0x0e33('0x35')]:_0x19a484[_0x0e33('0x2f')];if(_0x37b82b['query']['includeAll']){_0xc74e96[_0x0e33('0x40')]=[{'all':!![]}];}_0xc74e96=_[_0x0e33('0x3e')]({},_0xc74e96,_0x37b82b[_0x0e33('0x46')]);return db['Campaign'][_0x0e33('0x47')](_0xc74e96)[_0x0e33('0x25')](handleEntityNotFound(_0x1b3c6b,null))[_0x0e33('0x25')](respondWithResult(_0x1b3c6b,null))[_0x0e33('0x43')](handleError(_0x1b3c6b,null));};exports['create']=function(_0x3956b7,_0x48cf4a){return db[_0x0e33('0x41')]['create'](_0x3956b7['body'],{})['then'](function(_0x4fd5bc){var _0x3c26b9=_0x3956b7[_0x0e33('0x48')][_0x0e33('0x26')]({'plain':!![]});if(!_0x3c26b9)throw new Error(_0x0e33('0x49'));if(_0x3c26b9[_0x0e33('0x4a')]===_0x0e33('0x48')){var _0x27869e=_0x4fd5bc[_0x0e33('0x26')]({'plain':!![]});var _0x59dc5a=_0x0e33('0x27');return db[_0x0e33('0x4b')]['find']({'where':{'name':_0x59dc5a,'userProfileId':_0x3c26b9['userProfileId']},'raw':!![]})['then'](function(_0x276be2){if(_0x276be2&&_0x276be2[_0x0e33('0x4c')]===0x0){return db[_0x0e33('0x28')][_0x0e33('0x4d')]({'name':_0x27869e['name'],'resourceId':_0x27869e['id'],'type':_0x276be2[_0x0e33('0x2a')],'sectionId':_0x276be2['id']},{})[_0x0e33('0x25')](function(){return _0x4fd5bc;});}else{return _0x4fd5bc;}})[_0x0e33('0x43')](function(_0x47281e){logger[_0x0e33('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x47281e);throw _0x47281e;});}return _0x4fd5bc;})['then'](respondWithResult(_0x48cf4a,0xc9))[_0x0e33('0x43')](handleError(_0x48cf4a,null));};exports[_0x0e33('0x4f')]=function(_0x10a567,_0x344b23){var _0x4be2fe={'where':{'id':_0x10a567[_0x0e33('0x45')]['id']}},_0x213d22={};_0x213d22['model']=_[_0x0e33('0x31')](db[_0x0e33('0x41')][_0x0e33('0x50')]);_0x4be2fe[_0x0e33('0x35')]=_['intersection'](_0x213d22['model'],qs[_0x0e33('0x36')](_0x10a567[_0x0e33('0x32')][_0x0e33('0x36')]));_0x4be2fe[_0x0e33('0x35')]=_0x4be2fe[_0x0e33('0x35')][_0x0e33('0x37')]?_0x4be2fe[_0x0e33('0x35')]:_0x213d22[_0x0e33('0x2f')];if(_0x10a567[_0x0e33('0x32')][_0x0e33('0x3f')]){_0x4be2fe[_0x0e33('0x40')]=[{'all':!![]}];}_0x4be2fe=_[_0x0e33('0x3e')]({},_0x4be2fe,_0x10a567[_0x0e33('0x46')]);return db[_0x0e33('0x41')][_0x0e33('0x47')](_0x4be2fe)[_0x0e33('0x25')](handleEntityNotFound(_0x344b23,null))[_0x0e33('0x25')](function(_0x234ed4){if(_0x234ed4){var _0x4613fa=_0x234ed4['get']({'plain':!![]});_0x4613fa=qs['omit'](_0x4613fa,['id','createdAt',_0x0e33('0x51')]);_0x10a567[_0x0e33('0x52')]=_['omit'](_0x10a567[_0x0e33('0x52')],['id',_0x0e33('0x53'),_0x0e33('0x51')]);return db['Campaign'][_0x0e33('0x4d')](_[_0x0e33('0x3e')](_0x4613fa,_0x10a567[_0x0e33('0x52')]),{'include':_0x10a567[_0x0e33('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x0e33('0x25')](function(_0x1c343f){var _0x4d638b=_0x10a567[_0x0e33('0x48')]['get']({'plain':!![]});if(!_0x4d638b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d638b[_0x0e33('0x4a')]===_0x0e33('0x48')){var _0x392c7=_0x1c343f[_0x0e33('0x26')]({'plain':!![]});var _0x57c77c=_0x0e33('0x27');return db[_0x0e33('0x4b')][_0x0e33('0x47')]({'where':{'name':_0x57c77c,'userProfileId':_0x4d638b[_0x0e33('0x54')]},'raw':!![]})[_0x0e33('0x25')](function(_0x15dd07){if(_0x15dd07&&_0x15dd07[_0x0e33('0x4c')]===0x0){return db[_0x0e33('0x28')]['create']({'name':_0x392c7[_0x0e33('0x2a')],'resourceId':_0x392c7['id'],'type':_0x15dd07[_0x0e33('0x2a')],'sectionId':_0x15dd07['id']},{})['then'](function(){return _0x1c343f;});}else{return _0x1c343f;}})[_0x0e33('0x43')](function(_0x16b8f5){logger[_0x0e33('0x4e')](_0x0e33('0x55'),_0x16b8f5);throw _0x16b8f5;});}return _0x1c343f;});}})['then'](respondWithResult(_0x344b23,0xc9))[_0x0e33('0x43')](handleError(_0x344b23,null));};exports['update']=function(_0x5379c8,_0x33ed90){if(_0x5379c8[_0x0e33('0x52')]['id']){delete _0x5379c8[_0x0e33('0x52')]['id'];}return db['Campaign']['find']({'where':{'id':_0x5379c8[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x33ed90,null))[_0x0e33('0x25')](saveUpdates(_0x5379c8['body'],null))[_0x0e33('0x25')](respondWithResult(_0x33ed90,null))['catch'](handleError(_0x33ed90,null));};exports[_0x0e33('0x29')]=function(_0x523a4a,_0x2dca33){return db[_0x0e33('0x41')][_0x0e33('0x47')]({'where':{'id':_0x523a4a[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x2dca33,null))[_0x0e33('0x25')](removeEntity(_0x2dca33,null))[_0x0e33('0x43')](handleError(_0x2dca33,null));};exports[_0x0e33('0x56')]=function(_0x2d12be,_0x4eb796,_0x3ede45){var _0x32020e={'raw':!![],'where':{}};var _0x4a908b={};var _0x3d9086={'count':0x0,'rows':[]};return db[_0x0e33('0x41')][_0x0e33('0x57')]({'where':{'id':_0x2d12be[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x4eb796,null))['then'](function(_0x19d329){if(_0x19d329){_0x4a908b[_0x0e33('0x2f')]=_[_0x0e33('0x31')](db[_0x0e33('0x58')][_0x0e33('0x50')]);_0x4a908b['query']=_[_0x0e33('0x31')](_0x2d12be[_0x0e33('0x32')]);_0x4a908b['filters']=_[_0x0e33('0x34')](_0x4a908b[_0x0e33('0x2f')],_0x4a908b[_0x0e33('0x32')]);_0x32020e[_0x0e33('0x35')]=_[_0x0e33('0x34')](_0x4a908b['model'],qs[_0x0e33('0x36')](_0x2d12be[_0x0e33('0x32')][_0x0e33('0x36')]));_0x32020e[_0x0e33('0x35')]=_0x32020e[_0x0e33('0x35')][_0x0e33('0x37')]?_0x32020e[_0x0e33('0x35')]:_0x4a908b[_0x0e33('0x2f')];if(!_0x2d12be[_0x0e33('0x32')][_0x0e33('0x38')](_0x0e33('0x39'))){_0x32020e[_0x0e33('0x1e')]=qs[_0x0e33('0x1e')](_0x2d12be[_0x0e33('0x32')]['limit']);_0x32020e['offset']=qs[_0x0e33('0x21')](_0x2d12be[_0x0e33('0x32')][_0x0e33('0x21')]);}_0x32020e[_0x0e33('0x59')]=qs[_0x0e33('0x3a')](_0x2d12be[_0x0e33('0x32')]['sort']);_0x32020e['where']=qs[_0x0e33('0x33')](_[_0x0e33('0x3b')](_0x2d12be[_0x0e33('0x32')],_0x4a908b['filters']));_0x32020e['where'][_0x0e33('0x5a')]=_0x19d329['id'];if(_0x2d12be[_0x0e33('0x32')][_0x0e33('0x3c')]){_0x32020e[_0x0e33('0x3d')]=_[_0x0e33('0x3e')](_0x32020e['where'],{'$or':_[_0x0e33('0x30')](_0x32020e[_0x0e33('0x35')],function(_0x4d6196){var _0x45d8fa={};_0x45d8fa[_0x4d6196]={'$like':'%'+_0x2d12be[_0x0e33('0x32')][_0x0e33('0x3c')]+'%'};return _0x45d8fa;})});}_0x32020e=_['merge']({},_0x32020e,_0x2d12be[_0x0e33('0x46')]);return db[_0x0e33('0x58')]['count']({'where':_0x32020e[_0x0e33('0x3d')]})[_0x0e33('0x25')](function(_0x2f0fcd){_0x3d9086[_0x0e33('0x20')]=_0x2f0fcd;if(_0x2d12be[_0x0e33('0x32')]['includeAll']){_0x32020e['include']=[{'all':!![]}];}return db[_0x0e33('0x58')]['findAll'](_0x32020e);})['then'](function(_0x23c297){_0x3d9086[_0x0e33('0x5b')]=_0x23c297;return _0x3d9086;});}})[_0x0e33('0x25')](respondWithFilteredResult(_0x4eb796,_0x32020e))[_0x0e33('0x43')](handleError(_0x4eb796,null));};exports[_0x0e33('0x5c')]=function(_0x45893e,_0x49e53b,_0x3f045e){var _0x5ca4c8={'raw':!![],'where':{}};var _0x368a3e={};var _0x157f00={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0x45893e[_0x0e33('0x45')]['id']}})['then'](handleEntityNotFound(_0x49e53b,null))[_0x0e33('0x25')](function(_0x5048fb){if(_0x5048fb){_0x368a3e[_0x0e33('0x2f')]=_[_0x0e33('0x31')](db[_0x0e33('0x5d')][_0x0e33('0x50')]);_0x368a3e[_0x0e33('0x32')]=_[_0x0e33('0x31')](_0x45893e[_0x0e33('0x32')]);_0x368a3e[_0x0e33('0x33')]=_['intersection'](_0x368a3e[_0x0e33('0x2f')],_0x368a3e[_0x0e33('0x32')]);_0x5ca4c8[_0x0e33('0x35')]=_['intersection'](_0x368a3e[_0x0e33('0x2f')],qs[_0x0e33('0x36')](_0x45893e[_0x0e33('0x32')][_0x0e33('0x36')]));_0x5ca4c8[_0x0e33('0x35')]=_0x5ca4c8['attributes'][_0x0e33('0x37')]?_0x5ca4c8[_0x0e33('0x35')]:_0x368a3e[_0x0e33('0x2f')];if(!_0x45893e[_0x0e33('0x32')][_0x0e33('0x38')]('nolimit')){_0x5ca4c8[_0x0e33('0x1e')]=qs[_0x0e33('0x1e')](_0x45893e[_0x0e33('0x32')][_0x0e33('0x1e')]);_0x5ca4c8[_0x0e33('0x21')]=qs['offset'](_0x45893e['query']['offset']);}_0x5ca4c8[_0x0e33('0x59')]=qs[_0x0e33('0x3a')](_0x45893e['query'][_0x0e33('0x3a')]);_0x5ca4c8[_0x0e33('0x3d')]=qs[_0x0e33('0x33')](_['pick'](_0x45893e[_0x0e33('0x32')],_0x368a3e['filters']));_0x5ca4c8[_0x0e33('0x3d')][_0x0e33('0x5a')]=_0x5048fb['id'];if(_0x45893e[_0x0e33('0x32')]['filter']){_0x5ca4c8[_0x0e33('0x3d')]=_[_0x0e33('0x3e')](_0x5ca4c8['where'],{'$or':_['map'](_0x5ca4c8[_0x0e33('0x35')],function(_0x108508){var _0x2c6c6f={};_0x2c6c6f[_0x108508]={'$like':'%'+_0x45893e[_0x0e33('0x32')][_0x0e33('0x3c')]+'%'};return _0x2c6c6f;})});}_0x5ca4c8=_['merge']({},_0x5ca4c8,_0x45893e[_0x0e33('0x46')]);return db['CmHopperHistory'][_0x0e33('0x20')]({'where':_0x5ca4c8[_0x0e33('0x3d')]})['then'](function(_0x456a14){_0x157f00[_0x0e33('0x20')]=_0x456a14;if(_0x45893e[_0x0e33('0x32')][_0x0e33('0x3f')]){_0x5ca4c8[_0x0e33('0x40')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x5ca4c8);})[_0x0e33('0x25')](function(_0x4c4e3f){_0x157f00[_0x0e33('0x5b')]=_0x4c4e3f;return _0x157f00;});}})[_0x0e33('0x25')](respondWithFilteredResult(_0x49e53b,_0x5ca4c8))[_0x0e33('0x43')](handleError(_0x49e53b,null));};exports[_0x0e33('0x5e')]=function(_0x1ffc79,_0x4c86d8,_0x10e259){var _0x3a3e29={'raw':!![],'where':{}};var _0x4cd154={};var _0xb9cd01={'count':0x0,'rows':[]};return db[_0x0e33('0x41')][_0x0e33('0x57')]({'where':{'id':_0x1ffc79[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x4c86d8,null))[_0x0e33('0x25')](function(_0x3afc94){if(_0x3afc94){_0x4cd154[_0x0e33('0x2f')]=_[_0x0e33('0x31')](db['CmHopperFinal'][_0x0e33('0x50')]);_0x4cd154['query']=_[_0x0e33('0x31')](_0x1ffc79[_0x0e33('0x32')]);_0x4cd154[_0x0e33('0x33')]=_[_0x0e33('0x34')](_0x4cd154[_0x0e33('0x2f')],_0x4cd154[_0x0e33('0x32')]);_0x3a3e29[_0x0e33('0x35')]=_[_0x0e33('0x34')](_0x4cd154[_0x0e33('0x2f')],qs['fields'](_0x1ffc79[_0x0e33('0x32')][_0x0e33('0x36')]));_0x3a3e29['attributes']=_0x3a3e29[_0x0e33('0x35')]['length']?_0x3a3e29[_0x0e33('0x35')]:_0x4cd154[_0x0e33('0x2f')];if(!_0x1ffc79[_0x0e33('0x32')][_0x0e33('0x38')](_0x0e33('0x39'))){_0x3a3e29[_0x0e33('0x1e')]=qs[_0x0e33('0x1e')](_0x1ffc79[_0x0e33('0x32')]['limit']);_0x3a3e29[_0x0e33('0x21')]=qs[_0x0e33('0x21')](_0x1ffc79[_0x0e33('0x32')]['offset']);}_0x3a3e29[_0x0e33('0x59')]=qs[_0x0e33('0x3a')](_0x1ffc79[_0x0e33('0x32')][_0x0e33('0x3a')]);_0x3a3e29[_0x0e33('0x3d')]=qs[_0x0e33('0x33')](_[_0x0e33('0x3b')](_0x1ffc79[_0x0e33('0x32')],_0x4cd154[_0x0e33('0x33')]));_0x3a3e29[_0x0e33('0x3d')]['CampaignId']=_0x3afc94['id'];if(_0x1ffc79[_0x0e33('0x32')][_0x0e33('0x3c')]){_0x3a3e29[_0x0e33('0x3d')]=_[_0x0e33('0x3e')](_0x3a3e29['where'],{'$or':_[_0x0e33('0x30')](_0x3a3e29[_0x0e33('0x35')],function(_0x1aa77f){var _0x3c5050={};_0x3c5050[_0x1aa77f]={'$like':'%'+_0x1ffc79[_0x0e33('0x32')][_0x0e33('0x3c')]+'%'};return _0x3c5050;})});}_0x3a3e29=_['merge']({},_0x3a3e29,_0x1ffc79[_0x0e33('0x46')]);return db[_0x0e33('0x5f')][_0x0e33('0x20')]({'where':_0x3a3e29[_0x0e33('0x3d')]})[_0x0e33('0x25')](function(_0x30834a){_0xb9cd01[_0x0e33('0x20')]=_0x30834a;if(_0x1ffc79[_0x0e33('0x32')]['includeAll']){_0x3a3e29[_0x0e33('0x40')]=[{'all':!![]}];}return db[_0x0e33('0x5f')][_0x0e33('0x42')](_0x3a3e29);})['then'](function(_0x47dbda){_0xb9cd01['rows']=_0x47dbda;return _0xb9cd01;});}})[_0x0e33('0x25')](respondWithFilteredResult(_0x4c86d8,_0x3a3e29))[_0x0e33('0x43')](handleError(_0x4c86d8,null));};exports[_0x0e33('0x60')]=function(_0x51801d,_0x442624,_0x1e562f){var _0x168837={'raw':!![],'where':{}};var _0x30b925={};var _0x191eb7={'count':0x0,'rows':[]};return db[_0x0e33('0x41')]['findOne']({'where':{'id':_0x51801d[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x442624,null))[_0x0e33('0x25')](function(_0x3d1d4f){if(_0x3d1d4f){_0x30b925['model']=_[_0x0e33('0x31')](db[_0x0e33('0x61')][_0x0e33('0x50')]);_0x30b925[_0x0e33('0x32')]=_['keys'](_0x51801d['query']);_0x30b925[_0x0e33('0x33')]=_['intersection'](_0x30b925['model'],_0x30b925[_0x0e33('0x32')]);_0x168837[_0x0e33('0x35')]=_['intersection'](_0x30b925[_0x0e33('0x2f')],qs['fields'](_0x51801d[_0x0e33('0x32')][_0x0e33('0x36')]));_0x168837[_0x0e33('0x35')]=_0x168837['attributes']['length']?_0x168837['attributes']:_0x30b925[_0x0e33('0x2f')];if(!_0x51801d[_0x0e33('0x32')]['hasOwnProperty']('nolimit')){_0x168837[_0x0e33('0x1e')]=qs[_0x0e33('0x1e')](_0x51801d[_0x0e33('0x32')]['limit']);_0x168837[_0x0e33('0x21')]=qs[_0x0e33('0x21')](_0x51801d[_0x0e33('0x32')]['offset']);}_0x168837[_0x0e33('0x59')]=qs[_0x0e33('0x3a')](_0x51801d[_0x0e33('0x32')][_0x0e33('0x3a')]);_0x168837[_0x0e33('0x3d')]=qs[_0x0e33('0x33')](_[_0x0e33('0x3b')](_0x51801d['query'],_0x30b925[_0x0e33('0x33')]));_0x168837[_0x0e33('0x3d')][_0x0e33('0x5a')]=_0x3d1d4f['id'];if(_0x51801d[_0x0e33('0x32')]['filter']){_0x168837[_0x0e33('0x3d')]=_['merge'](_0x168837[_0x0e33('0x3d')],{'$or':_[_0x0e33('0x30')](_0x168837[_0x0e33('0x35')],function(_0x4efcc1){var _0x58ac0c={};_0x58ac0c[_0x4efcc1]={'$like':'%'+_0x51801d[_0x0e33('0x32')][_0x0e33('0x3c')]+'%'};return _0x58ac0c;})});}_0x168837=_[_0x0e33('0x3e')]({},_0x168837,_0x51801d['options']);return db['CmHopperBlack'][_0x0e33('0x20')]({'where':_0x168837['where']})[_0x0e33('0x25')](function(_0x67ae84){_0x191eb7[_0x0e33('0x20')]=_0x67ae84;if(_0x51801d['query'][_0x0e33('0x3f')]){_0x168837[_0x0e33('0x40')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x168837);})[_0x0e33('0x25')](function(_0x542e83){_0x191eb7[_0x0e33('0x5b')]=_0x542e83;return _0x191eb7;});}})[_0x0e33('0x25')](respondWithFilteredResult(_0x442624,_0x168837))[_0x0e33('0x43')](handleError(_0x442624,null));};exports[_0x0e33('0x62')]=function(_0x14a3be,_0x537ea0,_0x2ffe47){var _0x41f7f0={};var _0x334602={};var _0x35e3cf;var _0x311b83;return db[_0x0e33('0x41')][_0x0e33('0x57')]({'where':{'id':_0x14a3be[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x537ea0,null))['then'](function(_0x1700dd){if(_0x1700dd){_0x35e3cf=_0x1700dd;_0x334602[_0x0e33('0x2f')]=_[_0x0e33('0x31')](db[_0x0e33('0x63')][_0x0e33('0x50')]);_0x334602[_0x0e33('0x32')]=_[_0x0e33('0x31')](_0x14a3be['query']);_0x334602[_0x0e33('0x33')]=_[_0x0e33('0x34')](_0x334602['model'],_0x334602[_0x0e33('0x32')]);_0x41f7f0[_0x0e33('0x35')]=_[_0x0e33('0x34')](_0x334602[_0x0e33('0x2f')],qs['fields'](_0x14a3be[_0x0e33('0x32')][_0x0e33('0x36')]));_0x41f7f0[_0x0e33('0x35')]=_0x41f7f0['attributes'][_0x0e33('0x37')]?_0x41f7f0[_0x0e33('0x35')]:_0x334602['model'];_0x41f7f0['order']=qs[_0x0e33('0x3a')](_0x14a3be['query'][_0x0e33('0x3a')]);_0x41f7f0[_0x0e33('0x3d')]=qs[_0x0e33('0x33')](_[_0x0e33('0x3b')](_0x14a3be[_0x0e33('0x32')],_0x334602[_0x0e33('0x33')]));if(_0x14a3be[_0x0e33('0x32')][_0x0e33('0x3c')]){_0x41f7f0[_0x0e33('0x3d')]=_['merge'](_0x41f7f0[_0x0e33('0x3d')],{'$or':_['map'](_0x41f7f0['attributes'],function(_0x1c2ede){var _0x576be4={};_0x576be4[_0x1c2ede]={'$like':'%'+_0x14a3be['query'][_0x0e33('0x3c')]+'%'};return _0x576be4;})});}_0x41f7f0=_[_0x0e33('0x3e')]({},_0x41f7f0,_0x14a3be[_0x0e33('0x46')]);return _0x35e3cf[_0x0e33('0x62')](_0x41f7f0);}})[_0x0e33('0x25')](function(_0x43b8e5){if(_0x43b8e5){_0x311b83=_0x43b8e5['length'];if(!_0x14a3be[_0x0e33('0x32')][_0x0e33('0x38')](_0x0e33('0x39'))){_0x41f7f0[_0x0e33('0x1e')]=qs['limit'](_0x14a3be['query'][_0x0e33('0x1e')]);_0x41f7f0[_0x0e33('0x21')]=qs['offset'](_0x14a3be[_0x0e33('0x32')][_0x0e33('0x21')]);}return _0x35e3cf[_0x0e33('0x62')](_0x41f7f0);}})[_0x0e33('0x25')](function(_0x5b1834){if(_0x5b1834){return _0x5b1834?{'count':_0x311b83,'rows':_0x5b1834}:null;}})[_0x0e33('0x25')](respondWithResult(_0x537ea0,null))[_0x0e33('0x43')](handleError(_0x537ea0,null));};exports[_0x0e33('0x64')]=function(_0x2f6b61,_0x337014,_0x8ea76c){var _0x25a1f9,_0x3e52bc;var _0x58762d=[];var _0x226fcc=moment()[_0x0e33('0x65')](_0x0e33('0x66'));return db[_0x0e33('0x41')][_0x0e33('0x47')]({'where':{'id':_0x2f6b61[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x337014,null))[_0x0e33('0x25')](function(_0x317aad){if(_0x317aad){_0x3e52bc=_0x317aad;return _0x317aad[_0x0e33('0x64')](_0x2f6b61[_0x0e33('0x52')]['ids'],_['omit'](_0x2f6b61[_0x0e33('0x52')],[_0x0e33('0x67'),'id'])||{});}return null;})[_0x0e33('0x68')](function(_0x48f026){var _0x4c374b;var _0x41dc23;_0x25a1f9=_0x48f026||[];var _0x40ebe5=[];if(_0x48f026){for(var _0x136d19=0x0;_0x136d19<_0x48f026[_0x0e33('0x37')];_0x136d19+=0x1){var _0x19bb43=_0x48f026[_0x136d19][_0x0e33('0x26')]({'plain':!![]});_0x3e52bc[_0x0e33('0x69')]=_0x2f6b61[_0x0e33('0x52')][_0x0e33('0x69')]?_0x2f6b61['body'][_0x0e33('0x69')]:_0x3e52bc[_0x0e33('0x69')];switch(_0x3e52bc[_0x0e33('0x69')]){case _0x0e33('0x6a'):_0x4c374b=squel[_0x0e33('0x6b')]()[_0x0e33('0x6c')]('cm_hopper')[_0x0e33('0x6d')]([_0x0e33('0x6e'),_0x0e33('0x6f'),_0x0e33('0x70'),_0x0e33('0x71'),'CampaignId','createdAt',_0x0e33('0x51')],squel[_0x0e33('0x72')]()['field']('phone',_0x0e33('0x6e'))['field'](_0x0e33('0x73'),'scheduledAt')[_0x0e33('0x74')]('id','ContactId')['field'](_0x19bb43[_0x0e33('0x75')]['toString'](),_0x0e33('0x71'))['field'](_0x2f6b61['params']['id'][_0x0e33('0x76')](),_0x0e33('0x5a'))[_0x0e33('0x74')]('\x27'+_0x226fcc+'\x27',_0x0e33('0x53'))['field']('\x27'+_0x226fcc+'\x27',_0x0e33('0x51'))[_0x0e33('0x77')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x0e33('0x78'),_0x19bb43[_0x0e33('0x75')][_0x0e33('0x76')]())[_0x0e33('0x3d')](_0x0e33('0x79'))[_0x0e33('0x3d')](_0x0e33('0x7a'),squel[_0x0e33('0x72')]()[_0x0e33('0x74')](_0x0e33('0x7b'))['from']('cm_hopper_final')['where']('CampaignId\x20=\x20?',_0x2f6b61['params']['id'][_0x0e33('0x76')]()))[_0x0e33('0x3d')](_0x0e33('0x7a'),squel[_0x0e33('0x72')]()['field'](_0x0e33('0x7c'))['from']('cm_hopper')['where'](_0x0e33('0x7d'),_0x2f6b61['params']['id']['toString']())))[_0x0e33('0x76')]();break;case _0x0e33('0x7e'):_0x4c374b=squel[_0x0e33('0x6b')]()[_0x0e33('0x6c')](_0x0e33('0x7f'))[_0x0e33('0x6d')]([_0x0e33('0x6e'),_0x0e33('0x6f'),_0x0e33('0x70'),'ListId',_0x0e33('0x5a'),_0x0e33('0x53'),_0x0e33('0x51')],squel['select']()[_0x0e33('0x74')]('phone',_0x0e33('0x6e'))[_0x0e33('0x74')](_0x0e33('0x73'),_0x0e33('0x6f'))['field']('id',_0x0e33('0x70'))['field'](_0x19bb43[_0x0e33('0x75')][_0x0e33('0x76')](),_0x0e33('0x71'))['field'](_0x2f6b61[_0x0e33('0x45')]['id'][_0x0e33('0x76')](),_0x0e33('0x5a'))[_0x0e33('0x74')]('\x27'+_0x226fcc+'\x27','createdAt')[_0x0e33('0x74')]('\x27'+_0x226fcc+'\x27',_0x0e33('0x51'))[_0x0e33('0x77')](_0x0e33('0x80'))['where'](_0x0e33('0x81'))[_0x0e33('0x3d')](_0x0e33('0x78'),_0x19bb43[_0x0e33('0x75')][_0x0e33('0x76')]())[_0x0e33('0x3d')](_0x0e33('0x79'))[_0x0e33('0x3d')]('phone\x20NOT\x20IN\x20(?)',squel[_0x0e33('0x72')]()[_0x0e33('0x74')](_0x0e33('0x7c'))['from'](_0x0e33('0x7f'))[_0x0e33('0x3d')](_0x0e33('0x7d'),_0x2f6b61[_0x0e33('0x45')]['id']['toString']())))[_0x0e33('0x76')]();break;default:_0x4c374b=squel[_0x0e33('0x6b')]()[_0x0e33('0x6c')](_0x0e33('0x7f'))[_0x0e33('0x6d')](['phone',_0x0e33('0x6f'),_0x0e33('0x70'),_0x0e33('0x71'),_0x0e33('0x5a'),_0x0e33('0x53'),_0x0e33('0x51')],squel[_0x0e33('0x72')]()[_0x0e33('0x74')](_0x0e33('0x6e'),_0x0e33('0x6e'))['field'](_0x0e33('0x73'),_0x0e33('0x6f'))[_0x0e33('0x74')]('id',_0x0e33('0x70'))[_0x0e33('0x74')](_0x19bb43[_0x0e33('0x75')][_0x0e33('0x76')](),_0x0e33('0x71'))[_0x0e33('0x74')](_0x2f6b61[_0x0e33('0x45')]['id'][_0x0e33('0x76')](),_0x0e33('0x5a'))['field']('\x27'+_0x226fcc+'\x27',_0x0e33('0x53'))[_0x0e33('0x74')]('\x27'+_0x226fcc+'\x27',_0x0e33('0x51'))['from']('cm_contacts')[_0x0e33('0x3d')]('deletedAt\x20IS\x20NULL')['where'](_0x0e33('0x78'),_0x19bb43[_0x0e33('0x75')][_0x0e33('0x76')]())[_0x0e33('0x3d')](_0x0e33('0x79')))[_0x0e33('0x76')]();}_0x41dc23=squel['insert']()[_0x0e33('0x6c')]('cm_hopper_additional_phones')[_0x0e33('0x6d')](['cmHopperId',_0x0e33('0x6f'),'phone',_0x0e33('0x82'),_0x0e33('0x53'),'updatedAt'],squel['select']()[_0x0e33('0x74')](_0x0e33('0x83'),'id')[_0x0e33('0x74')](_0x0e33('0x73'),'scheduledAt')[_0x0e33('0x74')](_0x0e33('0x84'),_0x0e33('0x6e'))[_0x0e33('0x74')](_0x0e33('0x85'),_0x0e33('0x82'))[_0x0e33('0x74')]('\x27'+_0x226fcc+'\x27',_0x0e33('0x53'))[_0x0e33('0x74')]('\x27'+_0x226fcc+'\x27',_0x0e33('0x51'))[_0x0e33('0x77')](_0x0e33('0x86'),'ci')[_0x0e33('0x87')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')[_0x0e33('0x3d')]('h.ListId\x20=\x20?',_0x19bb43[_0x0e33('0x75')][_0x0e33('0x76')]())[_0x0e33('0x3d')](_0x0e33('0x88'),_0x2f6b61[_0x0e33('0x45')]['id']['toString']())['where'](_0x0e33('0x89'),_0x226fcc))[_0x0e33('0x76')]();_0x40ebe5[_0x0e33('0x8a')](db[_0x0e33('0x8b')]['query'](_0x4c374b));_0x58762d[_0x0e33('0x8a')](db[_0x0e33('0x8b')][_0x0e33('0x32')](_0x41dc23));}return BPromise['all'](_0x40ebe5);}})['then'](function(){return BPromise['all'](_0x58762d);})[_0x0e33('0x25')](function(){return _0x25a1f9;})['then'](respondWithResult(_0x337014,null))[_0x0e33('0x43')](handleError(_0x337014,null));};exports[_0x0e33('0x8c')]=function(_0xc59439,_0x10bc1d,_0x219e53){return db[_0x0e33('0x41')][_0x0e33('0x47')]({'where':{'id':_0xc59439[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x10bc1d,null))[_0x0e33('0x25')](function(_0x12f4f6){if(_0x12f4f6){return _0x12f4f6['removeLists'](_0xc59439[_0x0e33('0x32')][_0x0e33('0x67')]);}})[_0x0e33('0x25')](function(_0x2b4941){if(_0x2b4941){return db[_0x0e33('0x58')][_0x0e33('0x29')]({'where':{'ListId':_0xc59439['query'][_0x0e33('0x67')],'CampaignId':_0xc59439[_0x0e33('0x45')]['id']}})['then'](function(){return _0x2b4941;});}})[_0x0e33('0x25')](respondWithStatusCode(_0x10bc1d,null))[_0x0e33('0x43')](handleError(_0x10bc1d,null));};exports[_0x0e33('0x8d')]=function(_0x22a453,_0x513fe8,_0x35a5a){var _0x462ef2={};var _0xaf1336={};var _0x11155a;var _0xbc4cb0;return db['Campaign'][_0x0e33('0x57')]({'where':{'id':_0x22a453['params']['id']}})['then'](handleEntityNotFound(_0x513fe8,null))[_0x0e33('0x25')](function(_0x19fef3){if(_0x19fef3){_0x11155a=_0x19fef3;_0xaf1336[_0x0e33('0x2f')]=_[_0x0e33('0x31')](db[_0x0e33('0x63')]['rawAttributes']);_0xaf1336[_0x0e33('0x32')]=_[_0x0e33('0x31')](_0x22a453[_0x0e33('0x32')]);_0xaf1336['filters']=_[_0x0e33('0x34')](_0xaf1336[_0x0e33('0x2f')],_0xaf1336[_0x0e33('0x32')]);_0x462ef2[_0x0e33('0x35')]=_[_0x0e33('0x34')](_0xaf1336[_0x0e33('0x2f')],qs[_0x0e33('0x36')](_0x22a453[_0x0e33('0x32')][_0x0e33('0x36')]));_0x462ef2['attributes']=_0x462ef2[_0x0e33('0x35')][_0x0e33('0x37')]?_0x462ef2[_0x0e33('0x35')]:_0xaf1336[_0x0e33('0x2f')];_0x462ef2[_0x0e33('0x59')]=qs[_0x0e33('0x3a')](_0x22a453[_0x0e33('0x32')][_0x0e33('0x3a')]);_0x462ef2['where']=qs[_0x0e33('0x33')](_[_0x0e33('0x3b')](_0x22a453[_0x0e33('0x32')],_0xaf1336['filters']));if(_0x22a453[_0x0e33('0x32')][_0x0e33('0x3c')]){_0x462ef2[_0x0e33('0x3d')]=_[_0x0e33('0x3e')](_0x462ef2[_0x0e33('0x3d')],{'$or':_[_0x0e33('0x30')](_0x462ef2[_0x0e33('0x35')],function(_0x1eba76){var _0x8281d5={};_0x8281d5[_0x1eba76]={'$like':'%'+_0x22a453[_0x0e33('0x32')][_0x0e33('0x3c')]+'%'};return _0x8281d5;})});}_0x462ef2=_['merge']({},_0x462ef2,_0x22a453['options']);return _0x11155a['getBlackLists'](_0x462ef2);}})[_0x0e33('0x25')](function(_0x4b72ae){if(_0x4b72ae){_0xbc4cb0=_0x4b72ae['length'];if(!_0x22a453['query'][_0x0e33('0x38')](_0x0e33('0x39'))){_0x462ef2['limit']=qs[_0x0e33('0x1e')](_0x22a453[_0x0e33('0x32')][_0x0e33('0x1e')]);_0x462ef2['offset']=qs['offset'](_0x22a453[_0x0e33('0x32')]['offset']);}return _0x11155a[_0x0e33('0x8d')](_0x462ef2);}})['then'](function(_0x3d5048){if(_0x3d5048){return _0x3d5048?{'count':_0xbc4cb0,'rows':_0x3d5048}:null;}})[_0x0e33('0x25')](respondWithResult(_0x513fe8,null))[_0x0e33('0x43')](handleError(_0x513fe8,null));};exports['addBlackLists']=function(_0x41d36d,_0x166245,_0x12b871){var _0x4b8dcf,_0x250d16;var _0x3c32bb=[];var _0x1345e7=moment()[_0x0e33('0x65')]('YYYY-MM-DD\x20HH:mm:ss');return db[_0x0e33('0x41')][_0x0e33('0x47')]({'where':{'id':_0x41d36d['params']['id']}})['then'](handleEntityNotFound(_0x166245,null))[_0x0e33('0x25')](function(_0x1c698a){if(_0x1c698a){_0x250d16=_0x1c698a;return _0x1c698a[_0x0e33('0x8e')](_0x41d36d[_0x0e33('0x52')][_0x0e33('0x67')],_[_0x0e33('0x8f')](_0x41d36d[_0x0e33('0x52')],[_0x0e33('0x67'),'id'])||{});}return null;})['spread'](function(_0x4cee1e){var _0x5c9003;var _0xb94fe5;_0x4b8dcf=_0x4cee1e||[];var _0x547933=[];if(_0x4cee1e){for(var _0x1bad02=0x0;_0x1bad02<_0x4cee1e['length'];_0x1bad02+=0x1){var _0x1f992e=_0x4cee1e[_0x1bad02]['get']({'plain':!![]});_0x5c9003=squel[_0x0e33('0x6b')]()[_0x0e33('0x6c')](_0x0e33('0x90'))['fromQuery']([_0x0e33('0x6e'),'ContactId',_0x0e33('0x71'),'CampaignId',_0x0e33('0x53'),_0x0e33('0x51')],squel[_0x0e33('0x72')]()[_0x0e33('0x74')](_0x0e33('0x6e'),'phone')['field']('id',_0x0e33('0x70'))[_0x0e33('0x74')](_0x1f992e['CmListId']['toString'](),'ListId')[_0x0e33('0x74')](_0x41d36d['params']['id']['toString'](),_0x0e33('0x5a'))[_0x0e33('0x74')](_0x0e33('0x73'),_0x0e33('0x53'))[_0x0e33('0x74')](_0x0e33('0x73'),_0x0e33('0x51'))['from'](_0x0e33('0x80'))[_0x0e33('0x3d')](_0x0e33('0x81'))[_0x0e33('0x3d')](_0x0e33('0x78'),_0x1f992e['CmListId'][_0x0e33('0x76')]())[_0x0e33('0x3d')](_0x0e33('0x79')))[_0x0e33('0x76')]();_0x547933[_0x0e33('0x8a')](db['sequelize'][_0x0e33('0x32')](_0x5c9003));}return BPromise['all'](_0x547933);}})[_0x0e33('0x25')](function(){return _0x4b8dcf;})[_0x0e33('0x25')](respondWithResult(_0x166245,null))[_0x0e33('0x43')](handleError(_0x166245,null));};exports[_0x0e33('0x91')]=function(_0x1c4901,_0x4a9056,_0x552758){return db[_0x0e33('0x41')][_0x0e33('0x47')]({'where':{'id':_0x1c4901[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](handleEntityNotFound(_0x4a9056,null))['then'](function(_0x2a6433){if(_0x2a6433){return _0x2a6433[_0x0e33('0x91')](_0x1c4901[_0x0e33('0x32')][_0x0e33('0x67')]);}})[_0x0e33('0x25')](function(_0x1187f8){if(_0x1187f8){return db[_0x0e33('0x61')][_0x0e33('0x29')]({'where':{'ListId':_0x1c4901[_0x0e33('0x32')][_0x0e33('0x67')],'CampaignId':_0x1c4901[_0x0e33('0x45')]['id']}})[_0x0e33('0x25')](function(){return _0x1187f8;});}})['then'](respondWithStatusCode(_0x4a9056,null))['catch'](handleError(_0x4a9056,null));};
\ No newline at end of file
+var _0xaa1b=['ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','end','sendStatus','error','stack','name','index','map','Campaign','rawAttributes','fieldName','type','model','query','intersection','attributes','fields','nolimit','order','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','params','keys','length','find','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','userProfileId','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','spread','dialCheckDuplicateType','always','insert','into','fromQuery','phone','scheduledAt','ContactId','ListId','field','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','select','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','createdAt','NOW()','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.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','ids','getBlackLists','addBlackLists','format','YYYY-MM-DD\x20HH:mm:ss','cm_hopper_black','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','to-csv'];(function(_0x3cd5b5,_0x2191f1){var _0x2010fb=function(_0x202fae){while(--_0x202fae){_0x3cd5b5['push'](_0x3cd5b5['shift']());}};_0x2010fb(++_0x2191f1);}(_0xaa1b,0x123));var _0xbaa1=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xaa1b[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require(_0xbaa1('0x0'));var rimraf=require(_0xbaa1('0x1'));var zipdir=require(_0xbaa1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbaa1('0x3'));var moment=require('moment');var BPromise=require(_0xbaa1('0x4'));var Mustache=require(_0xbaa1('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xbaa1('0x6'));var ejs=require(_0xbaa1('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xbaa1('0x8'));var squel=require('squel');var crypto=require(_0xbaa1('0x9'));var jsforce=require(_0xbaa1('0xa'));var deskjs=require(_0xbaa1('0xb'));var toCsv=require(_0xbaa1('0x6'));var querystring=require(_0xbaa1('0xc'));var Papa=require(_0xbaa1('0xd'));var Redis=require('ioredis');var authService=require(_0xbaa1('0xe'));var qs=require(_0xbaa1('0xf'));var as=require(_0xbaa1('0x10'));var hardwareService=require(_0xbaa1('0x11'));var logger=require(_0xbaa1('0x12'))(_0xbaa1('0x13'));var utils=require(_0xbaa1('0x14'));var config=require(_0xbaa1('0x15'));var licenseUtil=require(_0xbaa1('0x16'));var db=require(_0xbaa1('0x17'))['db'];function respondWithStatusCode(_0x8ce72d,_0x1376c6){_0x1376c6=_0x1376c6||0xcc;return function(_0x5064a4){if(_0x5064a4){return _0x8ce72d['sendStatus'](_0x1376c6);}return _0x8ce72d['status'](_0x1376c6)['end']();};}function respondWithResult(_0x2184ab,_0x388cfd){_0x388cfd=_0x388cfd||0xc8;return function(_0x3bfbcc){if(_0x3bfbcc){return _0x2184ab[_0xbaa1('0x18')](_0x388cfd)[_0xbaa1('0x19')](_0x3bfbcc);}};}function respondWithFilteredResult(_0x2e7db5,_0x30f191){return function(_0xdbaa8b){if(_0xdbaa8b){var _0x35a3fd=typeof _0x30f191[_0xbaa1('0x1a')]===_0xbaa1('0x1b')&&typeof _0x30f191[_0xbaa1('0x1c')]===_0xbaa1('0x1b');var _0x16725c=_0xdbaa8b[_0xbaa1('0x1d')];var _0x155a16=_0x35a3fd?0x0:_0x30f191[_0xbaa1('0x1a')];var _0x200f01=_0x35a3fd?_0xdbaa8b[_0xbaa1('0x1d')]:_0x30f191['offset']+_0x30f191[_0xbaa1('0x1c')];var _0x3e3f4a;if(_0x200f01>=_0x16725c){_0x200f01=_0x16725c;_0x3e3f4a=0xc8;}else{_0x3e3f4a=0xce;}_0x2e7db5[_0xbaa1('0x18')](_0x3e3f4a);return _0x2e7db5[_0xbaa1('0x1e')](_0xbaa1('0x1f'),_0x155a16+'-'+_0x200f01+'/'+_0x16725c)[_0xbaa1('0x19')](_0xdbaa8b);}return null;};}function patchUpdates(_0x5c2115){return function(_0x1c587c){try{jsonpatch[_0xbaa1('0x20')](_0x1c587c,_0x5c2115,!![]);}catch(_0x1c38f3){return BPromise[_0xbaa1('0x21')](_0x1c38f3);}return _0x1c587c[_0xbaa1('0x22')]();};}function saveUpdates(_0x5a7d21,_0x4e4a0c){return function(_0x2b01ec){if(_0x2b01ec){return _0x2b01ec[_0xbaa1('0x23')](_0x5a7d21)[_0xbaa1('0x24')](function(_0x34946c){return _0x34946c;});}return null;};}function removeEntity(_0x117079,_0x113bbd){return function(_0x4806e7){if(_0x4806e7){return _0x4806e7[_0xbaa1('0x25')]()[_0xbaa1('0x24')](function(){var _0x28e508=_0x4806e7[_0xbaa1('0x26')]({'plain':!![]});var _0x1204f4=_0xbaa1('0x27');return db[_0xbaa1('0x28')][_0xbaa1('0x25')]({'where':{'type':_0x1204f4,'resourceId':_0x28e508['id']}})[_0xbaa1('0x24')](function(){return _0x4806e7;});})['then'](function(){_0x117079[_0xbaa1('0x18')](0xcc)[_0xbaa1('0x29')]();});}};}function handleEntityNotFound(_0xd2cae3,_0x2913ae){return function(_0x109187){if(!_0x109187){_0xd2cae3[_0xbaa1('0x2a')](0x194);}return _0x109187;};}function handleError(_0x594578,_0x49803c){_0x49803c=_0x49803c||0x1f4;return function(_0x18b6d6){logger[_0xbaa1('0x2b')](_0x18b6d6[_0xbaa1('0x2c')]);if(_0x18b6d6['name']){delete _0x18b6d6[_0xbaa1('0x2d')];}_0x594578[_0xbaa1('0x18')](_0x49803c)['send'](_0x18b6d6);};}exports[_0xbaa1('0x2e')]=function(_0x57a4b4,_0x158437){var _0x3670bd={},_0x344ace={},_0x53fead={'count':0x0,'rows':[]};var _0x594250=_[_0xbaa1('0x2f')](db[_0xbaa1('0x30')][_0xbaa1('0x31')],function(_0x1a98f9){return{'name':_0x1a98f9[_0xbaa1('0x32')],'type':_0x1a98f9[_0xbaa1('0x33')]['key']};});_0x344ace[_0xbaa1('0x34')]=_[_0xbaa1('0x2f')](_0x594250,_0xbaa1('0x2d'));_0x344ace[_0xbaa1('0x35')]=_['keys'](_0x57a4b4[_0xbaa1('0x35')]);_0x344ace['filters']=_[_0xbaa1('0x36')](_0x344ace[_0xbaa1('0x34')],_0x344ace[_0xbaa1('0x35')]);_0x3670bd[_0xbaa1('0x37')]=_['intersection'](_0x344ace[_0xbaa1('0x34')],qs[_0xbaa1('0x38')](_0x57a4b4[_0xbaa1('0x35')]['fields']));_0x3670bd[_0xbaa1('0x37')]=_0x3670bd[_0xbaa1('0x37')]['length']?_0x3670bd[_0xbaa1('0x37')]:_0x344ace[_0xbaa1('0x34')];if(!_0x57a4b4[_0xbaa1('0x35')]['hasOwnProperty'](_0xbaa1('0x39'))){_0x3670bd['limit']=qs['limit'](_0x57a4b4[_0xbaa1('0x35')]['limit']);_0x3670bd[_0xbaa1('0x1a')]=qs[_0xbaa1('0x1a')](_0x57a4b4[_0xbaa1('0x35')]['offset']);}_0x3670bd[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0x57a4b4['query'][_0xbaa1('0x3b')]);_0x3670bd[_0xbaa1('0x3c')]=qs[_0xbaa1('0x3d')](_[_0xbaa1('0x3e')](_0x57a4b4[_0xbaa1('0x35')],_0x344ace[_0xbaa1('0x3d')]),_0x594250);if(_0x57a4b4[_0xbaa1('0x35')][_0xbaa1('0x3f')]){_0x3670bd['where']=_[_0xbaa1('0x40')](_0x3670bd['where'],{'$or':_[_0xbaa1('0x2f')](_0x594250,function(_0x3ba6bf){if(_0x3ba6bf[_0xbaa1('0x33')]!=='VIRTUAL'){var _0x1b2333={};_0x1b2333[_0x3ba6bf['name']]={'$like':'%'+_0x57a4b4['query'][_0xbaa1('0x3f')]+'%'};return _0x1b2333;}})});}_0x3670bd=_[_0xbaa1('0x40')]({},_0x3670bd,_0x57a4b4[_0xbaa1('0x41')]);var _0x5efda0={'where':_0x3670bd['where']};return db[_0xbaa1('0x30')][_0xbaa1('0x1d')](_0x5efda0)[_0xbaa1('0x24')](function(_0x2443e3){_0x53fead[_0xbaa1('0x1d')]=_0x2443e3;if(_0x57a4b4[_0xbaa1('0x35')][_0xbaa1('0x42')]){_0x3670bd[_0xbaa1('0x43')]=[{'all':!![]}];}return db[_0xbaa1('0x30')][_0xbaa1('0x44')](_0x3670bd);})[_0xbaa1('0x24')](function(_0xc59188){_0x53fead[_0xbaa1('0x45')]=_0xc59188;return _0x53fead;})[_0xbaa1('0x24')](respondWithFilteredResult(_0x158437,_0x3670bd))['catch'](handleError(_0x158437,null));};exports['show']=function(_0x18c4e1,_0x6cc5ad){var _0x153cab={'raw':![],'where':{'id':_0x18c4e1[_0xbaa1('0x46')]['id']}},_0xfe2c06={};_0xfe2c06[_0xbaa1('0x34')]=_[_0xbaa1('0x47')](db[_0xbaa1('0x30')]['rawAttributes']);_0xfe2c06[_0xbaa1('0x35')]=_[_0xbaa1('0x47')](_0x18c4e1[_0xbaa1('0x35')]);_0xfe2c06[_0xbaa1('0x3d')]=_[_0xbaa1('0x36')](_0xfe2c06[_0xbaa1('0x34')],_0xfe2c06['query']);_0x153cab['attributes']=_[_0xbaa1('0x36')](_0xfe2c06['model'],qs[_0xbaa1('0x38')](_0x18c4e1[_0xbaa1('0x35')][_0xbaa1('0x38')]));_0x153cab['attributes']=_0x153cab[_0xbaa1('0x37')][_0xbaa1('0x48')]?_0x153cab[_0xbaa1('0x37')]:_0xfe2c06[_0xbaa1('0x34')];if(_0x18c4e1[_0xbaa1('0x35')]['includeAll']){_0x153cab['include']=[{'all':!![]}];}_0x153cab=_[_0xbaa1('0x40')]({},_0x153cab,_0x18c4e1[_0xbaa1('0x41')]);return db[_0xbaa1('0x30')][_0xbaa1('0x49')](_0x153cab)[_0xbaa1('0x24')](handleEntityNotFound(_0x6cc5ad,null))[_0xbaa1('0x24')](respondWithResult(_0x6cc5ad,null))[_0xbaa1('0x4a')](handleError(_0x6cc5ad,null));};exports[_0xbaa1('0x4b')]=function(_0xa4dd12,_0x19c7f5){return db[_0xbaa1('0x30')]['create'](_0xa4dd12[_0xbaa1('0x4c')],{})[_0xbaa1('0x24')](function(_0x2e2f16){var _0x216336=_0xa4dd12[_0xbaa1('0x4d')][_0xbaa1('0x26')]({'plain':!![]});if(!_0x216336)throw new Error(_0xbaa1('0x4e'));if(_0x216336['role']===_0xbaa1('0x4d')){var _0x378bfa=_0x2e2f16['get']({'plain':!![]});var _0x18e207=_0xbaa1('0x27');return db[_0xbaa1('0x4f')][_0xbaa1('0x49')]({'where':{'name':_0x18e207,'userProfileId':_0x216336['userProfileId']},'raw':!![]})[_0xbaa1('0x24')](function(_0x4d70f1){if(_0x4d70f1&&_0x4d70f1[_0xbaa1('0x50')]===0x0){return db[_0xbaa1('0x28')][_0xbaa1('0x4b')]({'name':_0x378bfa[_0xbaa1('0x2d')],'resourceId':_0x378bfa['id'],'type':_0x4d70f1['name'],'sectionId':_0x4d70f1['id']},{})[_0xbaa1('0x24')](function(){return _0x2e2f16;});}else{return _0x2e2f16;}})[_0xbaa1('0x4a')](function(_0x176ce2){logger[_0xbaa1('0x2b')](_0xbaa1('0x51'),_0x176ce2);throw _0x176ce2;});}return _0x2e2f16;})[_0xbaa1('0x24')](respondWithResult(_0x19c7f5,0xc9))[_0xbaa1('0x4a')](handleError(_0x19c7f5,null));};exports[_0xbaa1('0x52')]=function(_0x5018e2,_0x39fb53){var _0x39e35c={'where':{'id':_0x5018e2[_0xbaa1('0x46')]['id']}},_0x348eb6={};_0x348eb6[_0xbaa1('0x34')]=_[_0xbaa1('0x47')](db[_0xbaa1('0x30')]['rawAttributes']);_0x39e35c['attributes']=_[_0xbaa1('0x36')](_0x348eb6[_0xbaa1('0x34')],qs['fields'](_0x5018e2[_0xbaa1('0x35')][_0xbaa1('0x38')]));_0x39e35c[_0xbaa1('0x37')]=_0x39e35c['attributes'][_0xbaa1('0x48')]?_0x39e35c[_0xbaa1('0x37')]:_0x348eb6[_0xbaa1('0x34')];if(_0x5018e2[_0xbaa1('0x35')][_0xbaa1('0x42')]){_0x39e35c[_0xbaa1('0x43')]=[{'all':!![]}];}_0x39e35c=_['merge']({},_0x39e35c,_0x5018e2[_0xbaa1('0x41')]);return db[_0xbaa1('0x30')]['find'](_0x39e35c)['then'](handleEntityNotFound(_0x39fb53,null))[_0xbaa1('0x24')](function(_0x4973d4){if(_0x4973d4){var _0x2bb374=_0x4973d4[_0xbaa1('0x26')]({'plain':!![]});_0x2bb374=qs[_0xbaa1('0x53')](_0x2bb374,['id','createdAt',_0xbaa1('0x54')]);_0x5018e2[_0xbaa1('0x4c')]=_[_0xbaa1('0x53')](_0x5018e2[_0xbaa1('0x4c')],['id','createdAt',_0xbaa1('0x54')]);return db[_0xbaa1('0x30')][_0xbaa1('0x4b')](_[_0xbaa1('0x40')](_0x2bb374,_0x5018e2[_0xbaa1('0x4c')]),{'include':_0x5018e2[_0xbaa1('0x35')][_0xbaa1('0x42')]?[{'all':!![]}]:undefined})[_0xbaa1('0x24')](function(_0x2200e0){var _0xf33b78=_0x5018e2[_0xbaa1('0x4d')][_0xbaa1('0x26')]({'plain':!![]});if(!_0xf33b78)throw new Error(_0xbaa1('0x4e'));if(_0xf33b78['role']===_0xbaa1('0x4d')){var _0x1aa65a=_0x2200e0[_0xbaa1('0x26')]({'plain':!![]});var _0x5a1cb4=_0xbaa1('0x27');return db[_0xbaa1('0x4f')][_0xbaa1('0x49')]({'where':{'name':_0x5a1cb4,'userProfileId':_0xf33b78[_0xbaa1('0x55')]},'raw':!![]})[_0xbaa1('0x24')](function(_0x3fb861){if(_0x3fb861&&_0x3fb861[_0xbaa1('0x50')]===0x0){return db[_0xbaa1('0x28')][_0xbaa1('0x4b')]({'name':_0x1aa65a[_0xbaa1('0x2d')],'resourceId':_0x1aa65a['id'],'type':_0x3fb861[_0xbaa1('0x2d')],'sectionId':_0x3fb861['id']},{})[_0xbaa1('0x24')](function(){return _0x2200e0;});}else{return _0x2200e0;}})[_0xbaa1('0x4a')](function(_0x5c369a){logger['error'](_0xbaa1('0x51'),_0x5c369a);throw _0x5c369a;});}return _0x2200e0;});}})[_0xbaa1('0x24')](respondWithResult(_0x39fb53,0xc9))[_0xbaa1('0x4a')](handleError(_0x39fb53,null));};exports[_0xbaa1('0x23')]=function(_0x296d32,_0x15fd0c){if(_0x296d32['body']['id']){delete _0x296d32[_0xbaa1('0x4c')]['id'];}return db[_0xbaa1('0x30')]['find']({'where':{'id':_0x296d32['params']['id']}})['then'](handleEntityNotFound(_0x15fd0c,null))[_0xbaa1('0x24')](saveUpdates(_0x296d32['body'],null))[_0xbaa1('0x24')](respondWithResult(_0x15fd0c,null))['catch'](handleError(_0x15fd0c,null));};exports[_0xbaa1('0x25')]=function(_0x15c1df,_0x2ac192){return db[_0xbaa1('0x30')]['find']({'where':{'id':_0x15c1df[_0xbaa1('0x46')]['id']}})['then'](handleEntityNotFound(_0x2ac192,null))[_0xbaa1('0x24')](removeEntity(_0x2ac192,null))[_0xbaa1('0x4a')](handleError(_0x2ac192,null));};exports[_0xbaa1('0x56')]=function(_0x3ec6a5,_0xd6b380,_0x134906){var _0x4a7f3a={'raw':!![],'where':{}};var _0x43eb9c={};var _0x5c1e78={'count':0x0,'rows':[]};return db[_0xbaa1('0x30')][_0xbaa1('0x57')]({'where':{'id':_0x3ec6a5['params']['id']}})['then'](handleEntityNotFound(_0xd6b380,null))[_0xbaa1('0x24')](function(_0x21ac88){if(_0x21ac88){_0x43eb9c['model']=_[_0xbaa1('0x47')](db['CmHopper']['rawAttributes']);_0x43eb9c[_0xbaa1('0x35')]=_[_0xbaa1('0x47')](_0x3ec6a5[_0xbaa1('0x35')]);_0x43eb9c[_0xbaa1('0x3d')]=_['intersection'](_0x43eb9c['model'],_0x43eb9c[_0xbaa1('0x35')]);_0x4a7f3a['attributes']=_[_0xbaa1('0x36')](_0x43eb9c[_0xbaa1('0x34')],qs['fields'](_0x3ec6a5[_0xbaa1('0x35')][_0xbaa1('0x38')]));_0x4a7f3a[_0xbaa1('0x37')]=_0x4a7f3a[_0xbaa1('0x37')][_0xbaa1('0x48')]?_0x4a7f3a['attributes']:_0x43eb9c[_0xbaa1('0x34')];if(!_0x3ec6a5['query'][_0xbaa1('0x58')](_0xbaa1('0x39'))){_0x4a7f3a[_0xbaa1('0x1c')]=qs[_0xbaa1('0x1c')](_0x3ec6a5['query'][_0xbaa1('0x1c')]);_0x4a7f3a[_0xbaa1('0x1a')]=qs[_0xbaa1('0x1a')](_0x3ec6a5['query'][_0xbaa1('0x1a')]);}_0x4a7f3a[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0x3ec6a5[_0xbaa1('0x35')][_0xbaa1('0x3b')]);_0x4a7f3a['where']=qs['filters'](_[_0xbaa1('0x3e')](_0x3ec6a5[_0xbaa1('0x35')],_0x43eb9c['filters']));_0x4a7f3a[_0xbaa1('0x3c')][_0xbaa1('0x59')]=_0x21ac88['id'];if(_0x3ec6a5['query']['filter']){_0x4a7f3a[_0xbaa1('0x3c')]=_[_0xbaa1('0x40')](_0x4a7f3a['where'],{'$or':_[_0xbaa1('0x2f')](_0x4a7f3a[_0xbaa1('0x37')],function(_0x49cceb){var _0x485a07={};_0x485a07[_0x49cceb]={'$like':'%'+_0x3ec6a5[_0xbaa1('0x35')][_0xbaa1('0x3f')]+'%'};return _0x485a07;})});}_0x4a7f3a=_[_0xbaa1('0x40')]({},_0x4a7f3a,_0x3ec6a5[_0xbaa1('0x41')]);return db[_0xbaa1('0x5a')][_0xbaa1('0x1d')]({'where':_0x4a7f3a['where']})['then'](function(_0x5f3161){_0x5c1e78[_0xbaa1('0x1d')]=_0x5f3161;if(_0x3ec6a5[_0xbaa1('0x35')][_0xbaa1('0x42')]){_0x4a7f3a[_0xbaa1('0x43')]=[{'all':!![]}];}return db[_0xbaa1('0x5a')]['findAll'](_0x4a7f3a);})[_0xbaa1('0x24')](function(_0x292087){_0x5c1e78[_0xbaa1('0x45')]=_0x292087;return _0x5c1e78;});}})[_0xbaa1('0x24')](respondWithFilteredResult(_0xd6b380,_0x4a7f3a))[_0xbaa1('0x4a')](handleError(_0xd6b380,null));};exports[_0xbaa1('0x5b')]=function(_0x18ffe9,_0x11606e,_0x55e7a4){var _0x2305ee={'raw':!![],'where':{}};var _0x20cca4={};var _0x4ec9bd={'count':0x0,'rows':[]};return db[_0xbaa1('0x30')][_0xbaa1('0x57')]({'where':{'id':_0x18ffe9[_0xbaa1('0x46')]['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x11606e,null))[_0xbaa1('0x24')](function(_0x17f088){if(_0x17f088){_0x20cca4[_0xbaa1('0x34')]=_['keys'](db[_0xbaa1('0x5c')][_0xbaa1('0x31')]);_0x20cca4[_0xbaa1('0x35')]=_[_0xbaa1('0x47')](_0x18ffe9[_0xbaa1('0x35')]);_0x20cca4['filters']=_[_0xbaa1('0x36')](_0x20cca4[_0xbaa1('0x34')],_0x20cca4[_0xbaa1('0x35')]);_0x2305ee['attributes']=_['intersection'](_0x20cca4['model'],qs['fields'](_0x18ffe9[_0xbaa1('0x35')]['fields']));_0x2305ee[_0xbaa1('0x37')]=_0x2305ee[_0xbaa1('0x37')][_0xbaa1('0x48')]?_0x2305ee[_0xbaa1('0x37')]:_0x20cca4[_0xbaa1('0x34')];if(!_0x18ffe9[_0xbaa1('0x35')][_0xbaa1('0x58')](_0xbaa1('0x39'))){_0x2305ee[_0xbaa1('0x1c')]=qs[_0xbaa1('0x1c')](_0x18ffe9[_0xbaa1('0x35')]['limit']);_0x2305ee[_0xbaa1('0x1a')]=qs[_0xbaa1('0x1a')](_0x18ffe9[_0xbaa1('0x35')]['offset']);}_0x2305ee[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0x18ffe9['query'][_0xbaa1('0x3b')]);_0x2305ee[_0xbaa1('0x3c')]=qs['filters'](_[_0xbaa1('0x3e')](_0x18ffe9[_0xbaa1('0x35')],_0x20cca4[_0xbaa1('0x3d')]));_0x2305ee[_0xbaa1('0x3c')]['CampaignId']=_0x17f088['id'];if(_0x18ffe9[_0xbaa1('0x35')][_0xbaa1('0x3f')]){_0x2305ee['where']=_['merge'](_0x2305ee[_0xbaa1('0x3c')],{'$or':_[_0xbaa1('0x2f')](_0x2305ee['attributes'],function(_0x49b4a2){var _0x4b07cc={};_0x4b07cc[_0x49b4a2]={'$like':'%'+_0x18ffe9[_0xbaa1('0x35')][_0xbaa1('0x3f')]+'%'};return _0x4b07cc;})});}_0x2305ee=_[_0xbaa1('0x40')]({},_0x2305ee,_0x18ffe9['options']);return db['CmHopperHistory']['count']({'where':_0x2305ee[_0xbaa1('0x3c')]})[_0xbaa1('0x24')](function(_0x4a6ee2){_0x4ec9bd['count']=_0x4a6ee2;if(_0x18ffe9[_0xbaa1('0x35')][_0xbaa1('0x42')]){_0x2305ee[_0xbaa1('0x43')]=[{'all':!![]}];}return db[_0xbaa1('0x5c')][_0xbaa1('0x44')](_0x2305ee);})['then'](function(_0x2619cd){_0x4ec9bd[_0xbaa1('0x45')]=_0x2619cd;return _0x4ec9bd;});}})['then'](respondWithFilteredResult(_0x11606e,_0x2305ee))[_0xbaa1('0x4a')](handleError(_0x11606e,null));};exports[_0xbaa1('0x5d')]=function(_0xa014c9,_0xaf96f3,_0x41f58a){var _0x50b7a8={'raw':!![],'where':{}};var _0x156a8c={};var _0x3cc3a9={'count':0x0,'rows':[]};return db[_0xbaa1('0x30')][_0xbaa1('0x57')]({'where':{'id':_0xa014c9['params']['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0xaf96f3,null))[_0xbaa1('0x24')](function(_0x357bdf){if(_0x357bdf){_0x156a8c[_0xbaa1('0x34')]=_[_0xbaa1('0x47')](db[_0xbaa1('0x5e')][_0xbaa1('0x31')]);_0x156a8c[_0xbaa1('0x35')]=_[_0xbaa1('0x47')](_0xa014c9[_0xbaa1('0x35')]);_0x156a8c[_0xbaa1('0x3d')]=_[_0xbaa1('0x36')](_0x156a8c['model'],_0x156a8c[_0xbaa1('0x35')]);_0x50b7a8[_0xbaa1('0x37')]=_[_0xbaa1('0x36')](_0x156a8c[_0xbaa1('0x34')],qs[_0xbaa1('0x38')](_0xa014c9['query'][_0xbaa1('0x38')]));_0x50b7a8[_0xbaa1('0x37')]=_0x50b7a8[_0xbaa1('0x37')]['length']?_0x50b7a8[_0xbaa1('0x37')]:_0x156a8c[_0xbaa1('0x34')];if(!_0xa014c9[_0xbaa1('0x35')][_0xbaa1('0x58')](_0xbaa1('0x39'))){_0x50b7a8['limit']=qs[_0xbaa1('0x1c')](_0xa014c9[_0xbaa1('0x35')][_0xbaa1('0x1c')]);_0x50b7a8['offset']=qs['offset'](_0xa014c9[_0xbaa1('0x35')][_0xbaa1('0x1a')]);}_0x50b7a8[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0xa014c9['query']['sort']);_0x50b7a8[_0xbaa1('0x3c')]=qs[_0xbaa1('0x3d')](_[_0xbaa1('0x3e')](_0xa014c9['query'],_0x156a8c[_0xbaa1('0x3d')]));_0x50b7a8['where'][_0xbaa1('0x59')]=_0x357bdf['id'];if(_0xa014c9[_0xbaa1('0x35')][_0xbaa1('0x3f')]){_0x50b7a8['where']=_[_0xbaa1('0x40')](_0x50b7a8[_0xbaa1('0x3c')],{'$or':_[_0xbaa1('0x2f')](_0x50b7a8['attributes'],function(_0x3abcd0){var _0x48aaae={};_0x48aaae[_0x3abcd0]={'$like':'%'+_0xa014c9[_0xbaa1('0x35')][_0xbaa1('0x3f')]+'%'};return _0x48aaae;})});}_0x50b7a8=_[_0xbaa1('0x40')]({},_0x50b7a8,_0xa014c9['options']);return db[_0xbaa1('0x5e')]['count']({'where':_0x50b7a8[_0xbaa1('0x3c')]})[_0xbaa1('0x24')](function(_0x57e18b){_0x3cc3a9[_0xbaa1('0x1d')]=_0x57e18b;if(_0xa014c9['query'][_0xbaa1('0x42')]){_0x50b7a8[_0xbaa1('0x43')]=[{'all':!![]}];}return db[_0xbaa1('0x5e')][_0xbaa1('0x44')](_0x50b7a8);})[_0xbaa1('0x24')](function(_0x18e56f){_0x3cc3a9[_0xbaa1('0x45')]=_0x18e56f;return _0x3cc3a9;});}})['then'](respondWithFilteredResult(_0xaf96f3,_0x50b7a8))[_0xbaa1('0x4a')](handleError(_0xaf96f3,null));};exports['getHopperBlacks']=function(_0xe6445a,_0x5c65bb,_0x339ff5){var _0x203ab6={'raw':!![],'where':{}};var _0x3666c5={};var _0x24ccf5={'count':0x0,'rows':[]};return db['Campaign'][_0xbaa1('0x57')]({'where':{'id':_0xe6445a['params']['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x5c65bb,null))[_0xbaa1('0x24')](function(_0x4860d8){if(_0x4860d8){_0x3666c5[_0xbaa1('0x34')]=_[_0xbaa1('0x47')](db[_0xbaa1('0x5f')]['rawAttributes']);_0x3666c5[_0xbaa1('0x35')]=_[_0xbaa1('0x47')](_0xe6445a[_0xbaa1('0x35')]);_0x3666c5[_0xbaa1('0x3d')]=_[_0xbaa1('0x36')](_0x3666c5[_0xbaa1('0x34')],_0x3666c5[_0xbaa1('0x35')]);_0x203ab6[_0xbaa1('0x37')]=_['intersection'](_0x3666c5[_0xbaa1('0x34')],qs['fields'](_0xe6445a[_0xbaa1('0x35')]['fields']));_0x203ab6[_0xbaa1('0x37')]=_0x203ab6[_0xbaa1('0x37')]['length']?_0x203ab6['attributes']:_0x3666c5[_0xbaa1('0x34')];if(!_0xe6445a[_0xbaa1('0x35')][_0xbaa1('0x58')]('nolimit')){_0x203ab6[_0xbaa1('0x1c')]=qs[_0xbaa1('0x1c')](_0xe6445a[_0xbaa1('0x35')][_0xbaa1('0x1c')]);_0x203ab6['offset']=qs[_0xbaa1('0x1a')](_0xe6445a['query'][_0xbaa1('0x1a')]);}_0x203ab6[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0xe6445a[_0xbaa1('0x35')][_0xbaa1('0x3b')]);_0x203ab6['where']=qs[_0xbaa1('0x3d')](_[_0xbaa1('0x3e')](_0xe6445a[_0xbaa1('0x35')],_0x3666c5[_0xbaa1('0x3d')]));_0x203ab6[_0xbaa1('0x3c')][_0xbaa1('0x59')]=_0x4860d8['id'];if(_0xe6445a[_0xbaa1('0x35')][_0xbaa1('0x3f')]){_0x203ab6[_0xbaa1('0x3c')]=_['merge'](_0x203ab6['where'],{'$or':_['map'](_0x203ab6['attributes'],function(_0x56936c){var _0x33f339={};_0x33f339[_0x56936c]={'$like':'%'+_0xe6445a['query'][_0xbaa1('0x3f')]+'%'};return _0x33f339;})});}_0x203ab6=_['merge']({},_0x203ab6,_0xe6445a['options']);return db[_0xbaa1('0x5f')][_0xbaa1('0x1d')]({'where':_0x203ab6['where']})[_0xbaa1('0x24')](function(_0x1ba530){_0x24ccf5['count']=_0x1ba530;if(_0xe6445a['query'][_0xbaa1('0x42')]){_0x203ab6[_0xbaa1('0x43')]=[{'all':!![]}];}return db[_0xbaa1('0x5f')][_0xbaa1('0x44')](_0x203ab6);})['then'](function(_0x206778){_0x24ccf5['rows']=_0x206778;return _0x24ccf5;});}})[_0xbaa1('0x24')](respondWithFilteredResult(_0x5c65bb,_0x203ab6))[_0xbaa1('0x4a')](handleError(_0x5c65bb,null));};exports[_0xbaa1('0x60')]=function(_0x428e16,_0x16f671,_0x5022ce){var _0x35b84a={};var _0x5a9926={};var _0x4bd005;var _0x4e6ae2;return db[_0xbaa1('0x30')][_0xbaa1('0x57')]({'where':{'id':_0x428e16[_0xbaa1('0x46')]['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x16f671,null))['then'](function(_0x36b752){if(_0x36b752){_0x4bd005=_0x36b752;_0x5a9926[_0xbaa1('0x34')]=_[_0xbaa1('0x47')](db[_0xbaa1('0x61')][_0xbaa1('0x31')]);_0x5a9926[_0xbaa1('0x35')]=_[_0xbaa1('0x47')](_0x428e16[_0xbaa1('0x35')]);_0x5a9926[_0xbaa1('0x3d')]=_['intersection'](_0x5a9926[_0xbaa1('0x34')],_0x5a9926['query']);_0x35b84a['attributes']=_['intersection'](_0x5a9926[_0xbaa1('0x34')],qs[_0xbaa1('0x38')](_0x428e16[_0xbaa1('0x35')]['fields']));_0x35b84a[_0xbaa1('0x37')]=_0x35b84a[_0xbaa1('0x37')][_0xbaa1('0x48')]?_0x35b84a[_0xbaa1('0x37')]:_0x5a9926['model'];_0x35b84a[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0x428e16[_0xbaa1('0x35')][_0xbaa1('0x3b')]);_0x35b84a['where']=qs['filters'](_[_0xbaa1('0x3e')](_0x428e16['query'],_0x5a9926[_0xbaa1('0x3d')]));if(_0x428e16[_0xbaa1('0x35')][_0xbaa1('0x3f')]){_0x35b84a[_0xbaa1('0x3c')]=_[_0xbaa1('0x40')](_0x35b84a[_0xbaa1('0x3c')],{'$or':_['map'](_0x35b84a[_0xbaa1('0x37')],function(_0x66e731){var _0x59cfb5={};_0x59cfb5[_0x66e731]={'$like':'%'+_0x428e16[_0xbaa1('0x35')][_0xbaa1('0x3f')]+'%'};return _0x59cfb5;})});}_0x35b84a=_[_0xbaa1('0x40')]({},_0x35b84a,_0x428e16[_0xbaa1('0x41')]);return _0x4bd005[_0xbaa1('0x60')](_0x35b84a);}})[_0xbaa1('0x24')](function(_0x24bf78){if(_0x24bf78){_0x4e6ae2=_0x24bf78[_0xbaa1('0x48')];if(!_0x428e16[_0xbaa1('0x35')]['hasOwnProperty']('nolimit')){_0x35b84a['limit']=qs[_0xbaa1('0x1c')](_0x428e16[_0xbaa1('0x35')]['limit']);_0x35b84a[_0xbaa1('0x1a')]=qs[_0xbaa1('0x1a')](_0x428e16[_0xbaa1('0x35')]['offset']);}return _0x4bd005['getLists'](_0x35b84a);}})[_0xbaa1('0x24')](function(_0x35841d){if(_0x35841d){return _0x35841d?{'count':_0x4e6ae2,'rows':_0x35841d}:null;}})[_0xbaa1('0x24')](respondWithResult(_0x16f671,null))['catch'](handleError(_0x16f671,null));};exports[_0xbaa1('0x62')]=function(_0x5de9e0,_0x14a1c5,_0x3a8c41){var _0x3d0925,_0xd5599d;var _0x4b97a6=[];var _0xed03fd=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');return db['Campaign'][_0xbaa1('0x49')]({'where':{'id':_0x5de9e0[_0xbaa1('0x46')]['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x14a1c5,null))[_0xbaa1('0x24')](function(_0x371c8d){if(_0x371c8d){_0xd5599d=_0x371c8d;return _0x371c8d[_0xbaa1('0x62')](_0x5de9e0[_0xbaa1('0x4c')]['ids'],_[_0xbaa1('0x53')](_0x5de9e0[_0xbaa1('0x4c')],['ids','id'])||{});}return null;})[_0xbaa1('0x63')](function(_0x130bc9){var _0x5ef444;var _0x3dc1a1;_0x3d0925=_0x130bc9||[];var _0x1d09fc=[];if(_0x130bc9){for(var _0x11d510=0x0;_0x11d510<_0x130bc9[_0xbaa1('0x48')];_0x11d510+=0x1){var _0x4ab5ed=_0x130bc9[_0x11d510][_0xbaa1('0x26')]({'plain':!![]});_0xd5599d[_0xbaa1('0x64')]=_0x5de9e0[_0xbaa1('0x4c')]['dialCheckDuplicateType']?_0x5de9e0[_0xbaa1('0x4c')]['dialCheckDuplicateType']:_0xd5599d[_0xbaa1('0x64')];switch(_0xd5599d[_0xbaa1('0x64')]){case _0xbaa1('0x65'):_0x5ef444=squel[_0xbaa1('0x66')]()[_0xbaa1('0x67')]('cm_hopper')[_0xbaa1('0x68')]([_0xbaa1('0x69'),_0xbaa1('0x6a'),_0xbaa1('0x6b'),_0xbaa1('0x6c'),_0xbaa1('0x59'),'createdAt',_0xbaa1('0x54')],squel['select']()[_0xbaa1('0x6d')](_0xbaa1('0x69'),'phone')[_0xbaa1('0x6d')]('NOW()',_0xbaa1('0x6a'))[_0xbaa1('0x6d')]('id',_0xbaa1('0x6b'))[_0xbaa1('0x6d')](_0x4ab5ed[_0xbaa1('0x6e')][_0xbaa1('0x6f')](),_0xbaa1('0x6c'))[_0xbaa1('0x6d')](_0x5de9e0[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')](),'CampaignId')[_0xbaa1('0x6d')]('\x27'+_0xed03fd+'\x27','createdAt')['field']('\x27'+_0xed03fd+'\x27',_0xbaa1('0x54'))[_0xbaa1('0x70')](_0xbaa1('0x71'))[_0xbaa1('0x3c')](_0xbaa1('0x72'))['where'](_0xbaa1('0x73'),_0x4ab5ed[_0xbaa1('0x6e')][_0xbaa1('0x6f')]())['where'](_0xbaa1('0x74'))[_0xbaa1('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xbaa1('0x6d')](_0xbaa1('0x75'))['from']('cm_hopper_final')[_0xbaa1('0x3c')](_0xbaa1('0x76'),_0x5de9e0[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')]()))[_0xbaa1('0x3c')](_0xbaa1('0x77'),squel[_0xbaa1('0x78')]()[_0xbaa1('0x6d')](_0xbaa1('0x79'))[_0xbaa1('0x70')](_0xbaa1('0x7a'))[_0xbaa1('0x3c')]('CampaignId\x20=\x20?',_0x5de9e0['params']['id'][_0xbaa1('0x6f')]())))[_0xbaa1('0x6f')]();break;case _0xbaa1('0x7b'):_0x5ef444=squel[_0xbaa1('0x66')]()[_0xbaa1('0x67')](_0xbaa1('0x7a'))['fromQuery']([_0xbaa1('0x69'),_0xbaa1('0x6a'),_0xbaa1('0x6b'),'ListId',_0xbaa1('0x59'),_0xbaa1('0x7c'),_0xbaa1('0x54')],squel[_0xbaa1('0x78')]()['field']('phone',_0xbaa1('0x69'))[_0xbaa1('0x6d')](_0xbaa1('0x7d'),_0xbaa1('0x6a'))[_0xbaa1('0x6d')]('id',_0xbaa1('0x6b'))[_0xbaa1('0x6d')](_0x4ab5ed[_0xbaa1('0x6e')][_0xbaa1('0x6f')](),_0xbaa1('0x6c'))[_0xbaa1('0x6d')](_0x5de9e0[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')](),_0xbaa1('0x59'))[_0xbaa1('0x6d')]('\x27'+_0xed03fd+'\x27',_0xbaa1('0x7c'))[_0xbaa1('0x6d')]('\x27'+_0xed03fd+'\x27','updatedAt')['from'](_0xbaa1('0x71'))[_0xbaa1('0x3c')](_0xbaa1('0x72'))['where'](_0xbaa1('0x73'),_0x4ab5ed[_0xbaa1('0x6e')][_0xbaa1('0x6f')]())['where'](_0xbaa1('0x74'))[_0xbaa1('0x3c')](_0xbaa1('0x77'),squel[_0xbaa1('0x78')]()[_0xbaa1('0x6d')](_0xbaa1('0x79'))[_0xbaa1('0x70')]('cm_hopper')['where']('CampaignId\x20=\x20?',_0x5de9e0[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')]())))['toString']();break;default:_0x5ef444=squel[_0xbaa1('0x66')]()[_0xbaa1('0x67')](_0xbaa1('0x7a'))['fromQuery']([_0xbaa1('0x69'),_0xbaa1('0x6a'),'ContactId',_0xbaa1('0x6c'),_0xbaa1('0x59'),_0xbaa1('0x7c'),_0xbaa1('0x54')],squel[_0xbaa1('0x78')]()['field'](_0xbaa1('0x69'),_0xbaa1('0x69'))['field'](_0xbaa1('0x7d'),_0xbaa1('0x6a'))[_0xbaa1('0x6d')]('id',_0xbaa1('0x6b'))['field'](_0x4ab5ed['CmListId']['toString'](),_0xbaa1('0x6c'))['field'](_0x5de9e0[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')](),'CampaignId')[_0xbaa1('0x6d')]('\x27'+_0xed03fd+'\x27',_0xbaa1('0x7c'))[_0xbaa1('0x6d')]('\x27'+_0xed03fd+'\x27','updatedAt')[_0xbaa1('0x70')](_0xbaa1('0x71'))['where'](_0xbaa1('0x72'))[_0xbaa1('0x3c')](_0xbaa1('0x73'),_0x4ab5ed[_0xbaa1('0x6e')][_0xbaa1('0x6f')]())[_0xbaa1('0x3c')](_0xbaa1('0x74')))['toString']();}_0x3dc1a1=squel[_0xbaa1('0x66')]()[_0xbaa1('0x67')](_0xbaa1('0x7e'))[_0xbaa1('0x68')]([_0xbaa1('0x7f'),_0xbaa1('0x6a'),_0xbaa1('0x69'),_0xbaa1('0x80'),_0xbaa1('0x7c'),_0xbaa1('0x54')],squel[_0xbaa1('0x78')]()[_0xbaa1('0x6d')](_0xbaa1('0x81'),'id')['field'](_0xbaa1('0x7d'),_0xbaa1('0x6a'))[_0xbaa1('0x6d')](_0xbaa1('0x82'),_0xbaa1('0x69'))[_0xbaa1('0x6d')](_0xbaa1('0x83'),_0xbaa1('0x80'))['field']('\x27'+_0xed03fd+'\x27',_0xbaa1('0x7c'))[_0xbaa1('0x6d')]('\x27'+_0xed03fd+'\x27',_0xbaa1('0x54'))[_0xbaa1('0x70')](_0xbaa1('0x84'),'ci')[_0xbaa1('0x85')]('cm_hopper','h',_0xbaa1('0x86'))[_0xbaa1('0x3c')](_0xbaa1('0x87'),_0x4ab5ed[_0xbaa1('0x6e')]['toString']())['where'](_0xbaa1('0x88'),_0x5de9e0[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')]())[_0xbaa1('0x3c')](_0xbaa1('0x89'),_0xed03fd))[_0xbaa1('0x6f')]();_0x1d09fc[_0xbaa1('0x8a')](db[_0xbaa1('0x8b')][_0xbaa1('0x35')](_0x5ef444));_0x4b97a6['push'](db['sequelize'][_0xbaa1('0x35')](_0x3dc1a1));}return BPromise[_0xbaa1('0x8c')](_0x1d09fc);}})[_0xbaa1('0x24')](function(){return BPromise[_0xbaa1('0x8c')](_0x4b97a6);})[_0xbaa1('0x24')](function(){return _0x3d0925;})[_0xbaa1('0x24')](respondWithResult(_0x14a1c5,null))[_0xbaa1('0x4a')](handleError(_0x14a1c5,null));};exports[_0xbaa1('0x8d')]=function(_0x2f2f07,_0x809f12,_0x883f59){return db[_0xbaa1('0x30')][_0xbaa1('0x49')]({'where':{'id':_0x2f2f07[_0xbaa1('0x46')]['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x809f12,null))[_0xbaa1('0x24')](function(_0x54b13d){if(_0x54b13d){return _0x54b13d[_0xbaa1('0x8d')](_0x2f2f07[_0xbaa1('0x35')][_0xbaa1('0x8e')]);}})[_0xbaa1('0x24')](function(_0x418250){if(_0x418250){return db[_0xbaa1('0x5a')][_0xbaa1('0x25')]({'where':{'ListId':_0x2f2f07[_0xbaa1('0x35')][_0xbaa1('0x8e')],'CampaignId':_0x2f2f07[_0xbaa1('0x46')]['id']}})['then'](function(){return _0x418250;});}})['then'](respondWithStatusCode(_0x809f12,null))[_0xbaa1('0x4a')](handleError(_0x809f12,null));};exports[_0xbaa1('0x8f')]=function(_0x3a0738,_0x1538e6,_0x264c17){var _0x585993={};var _0x5ac12d={};var _0x177431;var _0x45b208;return db[_0xbaa1('0x30')]['findOne']({'where':{'id':_0x3a0738[_0xbaa1('0x46')]['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x1538e6,null))[_0xbaa1('0x24')](function(_0x46f9e5){if(_0x46f9e5){_0x177431=_0x46f9e5;_0x5ac12d['model']=_[_0xbaa1('0x47')](db[_0xbaa1('0x61')][_0xbaa1('0x31')]);_0x5ac12d['query']=_[_0xbaa1('0x47')](_0x3a0738[_0xbaa1('0x35')]);_0x5ac12d[_0xbaa1('0x3d')]=_[_0xbaa1('0x36')](_0x5ac12d[_0xbaa1('0x34')],_0x5ac12d['query']);_0x585993[_0xbaa1('0x37')]=_['intersection'](_0x5ac12d[_0xbaa1('0x34')],qs[_0xbaa1('0x38')](_0x3a0738[_0xbaa1('0x35')]['fields']));_0x585993[_0xbaa1('0x37')]=_0x585993[_0xbaa1('0x37')][_0xbaa1('0x48')]?_0x585993[_0xbaa1('0x37')]:_0x5ac12d[_0xbaa1('0x34')];_0x585993[_0xbaa1('0x3a')]=qs[_0xbaa1('0x3b')](_0x3a0738['query'][_0xbaa1('0x3b')]);_0x585993[_0xbaa1('0x3c')]=qs[_0xbaa1('0x3d')](_[_0xbaa1('0x3e')](_0x3a0738[_0xbaa1('0x35')],_0x5ac12d[_0xbaa1('0x3d')]));if(_0x3a0738['query'][_0xbaa1('0x3f')]){_0x585993['where']=_[_0xbaa1('0x40')](_0x585993['where'],{'$or':_[_0xbaa1('0x2f')](_0x585993['attributes'],function(_0x3cd2e5){var _0x54eecc={};_0x54eecc[_0x3cd2e5]={'$like':'%'+_0x3a0738[_0xbaa1('0x35')]['filter']+'%'};return _0x54eecc;})});}_0x585993=_[_0xbaa1('0x40')]({},_0x585993,_0x3a0738[_0xbaa1('0x41')]);return _0x177431[_0xbaa1('0x8f')](_0x585993);}})['then'](function(_0x3b114e){if(_0x3b114e){_0x45b208=_0x3b114e[_0xbaa1('0x48')];if(!_0x3a0738[_0xbaa1('0x35')]['hasOwnProperty'](_0xbaa1('0x39'))){_0x585993[_0xbaa1('0x1c')]=qs['limit'](_0x3a0738['query'][_0xbaa1('0x1c')]);_0x585993[_0xbaa1('0x1a')]=qs[_0xbaa1('0x1a')](_0x3a0738[_0xbaa1('0x35')]['offset']);}return _0x177431[_0xbaa1('0x8f')](_0x585993);}})[_0xbaa1('0x24')](function(_0x289258){if(_0x289258){return _0x289258?{'count':_0x45b208,'rows':_0x289258}:null;}})[_0xbaa1('0x24')](respondWithResult(_0x1538e6,null))[_0xbaa1('0x4a')](handleError(_0x1538e6,null));};exports[_0xbaa1('0x90')]=function(_0x289421,_0x558f36,_0x5a68c1){var _0x292887,_0x22b8f3;var _0x5d4da6=[];var _0x3d6ce9=moment()[_0xbaa1('0x91')](_0xbaa1('0x92'));return db[_0xbaa1('0x30')]['find']({'where':{'id':_0x289421['params']['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x558f36,null))['then'](function(_0x43d9c2){if(_0x43d9c2){_0x22b8f3=_0x43d9c2;return _0x43d9c2['addBlackLists'](_0x289421[_0xbaa1('0x4c')]['ids'],_['omit'](_0x289421[_0xbaa1('0x4c')],[_0xbaa1('0x8e'),'id'])||{});}return null;})[_0xbaa1('0x63')](function(_0x1dbe68){var _0x58e18a;var _0xbf751d;_0x292887=_0x1dbe68||[];var _0x3c2749=[];if(_0x1dbe68){for(var _0x1b966f=0x0;_0x1b966f<_0x1dbe68[_0xbaa1('0x48')];_0x1b966f+=0x1){var _0x4d00c4=_0x1dbe68[_0x1b966f]['get']({'plain':!![]});_0x58e18a=squel[_0xbaa1('0x66')]()[_0xbaa1('0x67')](_0xbaa1('0x93'))[_0xbaa1('0x68')](['phone',_0xbaa1('0x6b'),'ListId','CampaignId','createdAt',_0xbaa1('0x54')],squel[_0xbaa1('0x78')]()[_0xbaa1('0x6d')]('phone',_0xbaa1('0x69'))[_0xbaa1('0x6d')]('id',_0xbaa1('0x6b'))[_0xbaa1('0x6d')](_0x4d00c4['CmListId'][_0xbaa1('0x6f')](),_0xbaa1('0x6c'))['field'](_0x289421[_0xbaa1('0x46')]['id'][_0xbaa1('0x6f')](),'CampaignId')[_0xbaa1('0x6d')](_0xbaa1('0x7d'),_0xbaa1('0x7c'))['field']('NOW()',_0xbaa1('0x54'))[_0xbaa1('0x70')]('cm_contacts')['where'](_0xbaa1('0x72'))[_0xbaa1('0x3c')]('ListId\x20=\x20?',_0x4d00c4[_0xbaa1('0x6e')][_0xbaa1('0x6f')]())[_0xbaa1('0x3c')](_0xbaa1('0x74')))[_0xbaa1('0x6f')]();_0x3c2749[_0xbaa1('0x8a')](db[_0xbaa1('0x8b')][_0xbaa1('0x35')](_0x58e18a));}return BPromise['all'](_0x3c2749);}})[_0xbaa1('0x24')](function(){return _0x292887;})['then'](respondWithResult(_0x558f36,null))[_0xbaa1('0x4a')](handleError(_0x558f36,null));};exports[_0xbaa1('0x94')]=function(_0x2aa343,_0x33c182,_0x2166e9){return db[_0xbaa1('0x30')][_0xbaa1('0x49')]({'where':{'id':_0x2aa343[_0xbaa1('0x46')]['id']}})[_0xbaa1('0x24')](handleEntityNotFound(_0x33c182,null))[_0xbaa1('0x24')](function(_0xbf957f){if(_0xbf957f){return _0xbf957f[_0xbaa1('0x94')](_0x2aa343['query'][_0xbaa1('0x8e')]);}})[_0xbaa1('0x24')](function(_0x278628){if(_0x278628){return db[_0xbaa1('0x5f')][_0xbaa1('0x25')]({'where':{'ListId':_0x2aa343[_0xbaa1('0x35')][_0xbaa1('0x8e')],'CampaignId':_0x2aa343[_0xbaa1('0x46')]['id']}})['then'](function(){return _0x278628;});}})[_0xbaa1('0x24')](respondWithStatusCode(_0x33c182,null))[_0xbaa1('0x4a')](handleError(_0x33c182,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index 2ec7b8e..42dcfe7 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(_0x4be3f3,_0x20efd7){var _0x5278b3=function(_0x147367){while(--_0x147367){_0x4be3f3['push'](_0x4be3f3['shift']());}};_0x5278b3(++_0x20efd7);}(_0x7a54,0x106));var _0x47a5=function(_0x417127,_0xc3ae){_0x417127=_0x417127-0x0;var _0x3086eb=_0x7a54[_0x417127];return _0x3086eb;};'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(_0x26f702,_0x3919bf){var _0x11417d=function(_0x1aa3e8){while(--_0x1aa3e8){_0x26f702['push'](_0x26f702['shift']());}};_0x11417d(++_0x3919bf);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 8dea0ce..287c35a 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 _0x5640=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Campaign,\x20%s,\x20%s','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x5640,0x111));var _0x0564=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x5640[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0x0564('0x0'));var util=require('util');var moment=require(_0x0564('0x1'));var BPromise=require(_0x0564('0x2'));var rs=require(_0x0564('0x3'));var fs=require('fs');var Redis=require(_0x0564('0x4'));var db=require(_0x0564('0x5'))['db'];var utils=require(_0x0564('0x6'));var logger=require(_0x0564('0x7'))(_0x0564('0x8'));var config=require(_0x0564('0x9'));var jayson=require(_0x0564('0xa'));var client=jayson[_0x0564('0xb')][_0x0564('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3deac1,_0x545a39,_0x52b032){return new BPromise(function(_0x9e3a60,_0x37a190){return client[_0x0564('0xd')](_0x3deac1,_0x52b032)[_0x0564('0xe')](function(_0x4f5a64){logger[_0x0564('0xf')](_0x0564('0x10'),_0x545a39,'request\x20sent');logger[_0x0564('0x11')](_0x0564('0x12'),_0x545a39,'request\x20sent',JSON[_0x0564('0x13')](_0x4f5a64));if(_0x4f5a64[_0x0564('0x14')]){if(_0x4f5a64[_0x0564('0x14')]['code']===0x1f4){logger['error'](_0x0564('0x10'),_0x545a39,_0x4f5a64['error'][_0x0564('0x15')]);return _0x37a190(_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);}logger[_0x0564('0x14')](_0x0564('0x10'),_0x545a39,_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);return _0x9e3a60(_0x4f5a64[_0x0564('0x14')][_0x0564('0x15')]);}else{logger['info'](_0x0564('0x10'),_0x545a39,_0x0564('0x16'));_0x9e3a60(_0x4f5a64[_0x0564('0x17')][_0x0564('0x15')]);}})[_0x0564('0x18')](function(_0x49173f){logger['error'](_0x0564('0x10'),_0x545a39,_0x49173f);_0x37a190(_0x49173f);});});}exports[_0x0564('0x19')]=function(_0x28c807){var _0x35ebe3=this;return new Promise(function(_0x31b612,_0x471645){return db[_0x0564('0x1a')]['findAll']({'raw':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1c')]===undefined?!![]:![]:!![],'where':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1d')]||null:null,'attributes':_0x28c807[_0x0564('0x1b')]?_0x28c807[_0x0564('0x1b')][_0x0564('0x1e')]||null:null,'limit':_0x28c807['options']?_0x28c807[_0x0564('0x1b')][_0x0564('0x1f')]||null:null,'include':_0x28c807['options']?_0x28c807[_0x0564('0x1b')][_0x0564('0x20')]?_[_0x0564('0x21')](_0x28c807[_0x0564('0x1b')]['include'],function(_0x542b1d){return{'model':db[_0x542b1d[_0x0564('0x22')]],'as':_0x542b1d['as'],'attributes':_0x542b1d[_0x0564('0x1e')],'include':_0x542b1d['include']?_[_0x0564('0x21')](_0x542b1d['include'],function(_0x4ed225){return{'model':db[_0x4ed225[_0x0564('0x22')]],'as':_0x4ed225['as'],'attributes':_0x4ed225['attributes'],'include':_0x4ed225['include']?_[_0x0564('0x21')](_0x4ed225[_0x0564('0x20')],function(_0x23d59d){return{'model':db[_0x23d59d[_0x0564('0x22')]],'as':_0x23d59d['as'],'attributes':_0x23d59d[_0x0564('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0564('0xe')](function(_0x2da082){logger[_0x0564('0xf')](_0x0564('0x19'),_0x28c807);logger[_0x0564('0x11')](_0x0564('0x19'),_0x28c807,JSON['stringify'](_0x2da082));_0x31b612(_0x2da082);})[_0x0564('0x18')](function(_0x2bd9c7){logger['error']('GetCampaign',_0x2bd9c7[_0x0564('0x15')],_0x28c807);_0x471645(_0x35ebe3['error'](0x1f4,_0x2bd9c7[_0x0564('0x15')]));});});};
\ No newline at end of file
+var _0xf194=['GetCampaign','Campaign','findAll','options','raw','where','limit','include','map','model','attributes','stringify','catch','lodash','util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x5dda34,_0x4547c3){var _0x40ba81=function(_0x56820a){while(--_0x56820a){_0x5dda34['push'](_0x5dda34['shift']());}};_0x40ba81(++_0x4547c3);}(_0xf194,0x91));var _0x4f19=function(_0x4bb90c,_0x243ad5){_0x4bb90c=_0x4bb90c-0x0;var _0x14f765=_0xf194[_0x4bb90c];return _0x14f765;};'use strict';var _=require(_0x4f19('0x0'));var util=require(_0x4f19('0x1'));var moment=require(_0x4f19('0x2'));var BPromise=require(_0x4f19('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4f19('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4f19('0x5'));var config=require(_0x4f19('0x6'));var jayson=require(_0x4f19('0x7'));var client=jayson['client'][_0x4f19('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x45c88a,_0x514d93,_0x4b023f){return new BPromise(function(_0x265d15,_0x116780){return client[_0x4f19('0x9')](_0x45c88a,_0x4b023f)[_0x4f19('0xa')](function(_0x4aaf89){logger[_0x4f19('0xb')](_0x4f19('0xc'),_0x514d93,_0x4f19('0xd'));logger[_0x4f19('0xe')](_0x4f19('0xf'),_0x514d93,_0x4f19('0xd'),JSON['stringify'](_0x4aaf89));if(_0x4aaf89['error']){if(_0x4aaf89['error'][_0x4f19('0x10')]===0x1f4){logger[_0x4f19('0x11')]('Campaign,\x20%s,\x20%s',_0x514d93,_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);return _0x116780(_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);}logger['error'](_0x4f19('0xc'),_0x514d93,_0x4aaf89[_0x4f19('0x11')]['message']);return _0x265d15(_0x4aaf89[_0x4f19('0x11')][_0x4f19('0x12')]);}else{logger['info'](_0x4f19('0xc'),_0x514d93,'request\x20sent');_0x265d15(_0x4aaf89[_0x4f19('0x13')][_0x4f19('0x12')]);}})['catch'](function(_0x4d8021){logger[_0x4f19('0x11')](_0x4f19('0xc'),_0x514d93,_0x4d8021);_0x116780(_0x4d8021);});});}exports[_0x4f19('0x14')]=function(_0x576eef){var _0x1d9bf3=this;return new Promise(function(_0x205fee,_0x1b4d79){return db[_0x4f19('0x15')][_0x4f19('0x16')]({'raw':_0x576eef['options']?_0x576eef[_0x4f19('0x17')][_0x4f19('0x18')]===undefined?!![]:![]:!![],'where':_0x576eef['options']?_0x576eef[_0x4f19('0x17')][_0x4f19('0x19')]||null:null,'attributes':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')]['attributes']||null:null,'limit':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')][_0x4f19('0x1a')]||null:null,'include':_0x576eef[_0x4f19('0x17')]?_0x576eef[_0x4f19('0x17')][_0x4f19('0x1b')]?_[_0x4f19('0x1c')](_0x576eef[_0x4f19('0x17')][_0x4f19('0x1b')],function(_0x10e164){return{'model':db[_0x10e164[_0x4f19('0x1d')]],'as':_0x10e164['as'],'attributes':_0x10e164[_0x4f19('0x1e')],'include':_0x10e164[_0x4f19('0x1b')]?_[_0x4f19('0x1c')](_0x10e164[_0x4f19('0x1b')],function(_0x39cb12){return{'model':db[_0x39cb12[_0x4f19('0x1d')]],'as':_0x39cb12['as'],'attributes':_0x39cb12[_0x4f19('0x1e')],'include':_0x39cb12[_0x4f19('0x1b')]?_['map'](_0x39cb12[_0x4f19('0x1b')],function(_0x5218c6){return{'model':db[_0x5218c6[_0x4f19('0x1d')]],'as':_0x5218c6['as'],'attributes':_0x5218c6['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f19('0xa')](function(_0x5321a8){logger[_0x4f19('0xb')](_0x4f19('0x14'),_0x576eef);logger[_0x4f19('0xe')]('GetCampaign',_0x576eef,JSON[_0x4f19('0x1f')](_0x5321a8));_0x205fee(_0x5321a8);})[_0x4f19('0x20')](function(_0x2175ff){logger[_0x4f19('0x11')](_0x4f19('0x14'),_0x2175ff['message'],_0x576eef);_0x1b4d79(_0x1d9bf3[_0x4f19('0x11')](0x1f4,_0x2175ff[_0x4f19('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 140085d..f801863 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 _0xd69c=['getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','clone','addLists','addBlackLists','update','delete','removeLists','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./campaign.controller','get','/:id','isAuthenticated','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x5b37f9,_0x311ec1){var _0x5945e2=function(_0x5af157){while(--_0x5af157){_0x5b37f9['push'](_0x5b37f9['shift']());}};_0x5945e2(++_0x311ec1);}(_0xd69c,0x15c));var _0xcd69=function(_0x36731d,_0x2b675c){_0x36731d=_0x36731d-0x0;var _0x53d18c=_0xd69c[_0x36731d];return _0x53d18c;};'use strict';var multer=require(_0xcd69('0x0'));var util=require(_0xcd69('0x1'));var path=require(_0xcd69('0x2'));var timeout=require(_0xcd69('0x3'));var express=require(_0xcd69('0x4'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xcd69('0x5'));var interaction=require(_0xcd69('0x6'));var config=require('../../config/environment');var controller=require(_0xcd69('0x7'));router[_0xcd69('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xcd69('0x8')](_0xcd69('0x9'),auth[_0xcd69('0xa')](),controller[_0xcd69('0xb')]);router[_0xcd69('0x8')](_0xcd69('0xc'),auth[_0xcd69('0xa')](),controller[_0xcd69('0xd')]);router['get'](_0xcd69('0xe'),auth[_0xcd69('0xa')](),controller[_0xcd69('0xf')]);router[_0xcd69('0x8')](_0xcd69('0x10'),auth[_0xcd69('0xa')](),controller[_0xcd69('0x11')]);router[_0xcd69('0x8')](_0xcd69('0x12'),auth[_0xcd69('0xa')](),controller[_0xcd69('0x13')]);router['get'](_0xcd69('0x14'),auth[_0xcd69('0xa')](),controller[_0xcd69('0x15')]);router['get'](_0xcd69('0x16'),auth['isAuthenticated'](),controller[_0xcd69('0x17')]);router[_0xcd69('0x18')]('/',auth[_0xcd69('0xa')](),controller[_0xcd69('0x19')]);router[_0xcd69('0x18')]('/:id/clone',auth['isAuthenticated'](),controller[_0xcd69('0x1a')]);router[_0xcd69('0x18')](_0xcd69('0x14'),auth['isAuthenticated'](),controller[_0xcd69('0x1b')]);router[_0xcd69('0x18')](_0xcd69('0x16'),auth[_0xcd69('0xa')](),controller[_0xcd69('0x1c')]);router['put'](_0xcd69('0x9'),auth[_0xcd69('0xa')](),controller[_0xcd69('0x1d')]);router[_0xcd69('0x1e')](_0xcd69('0x9'),auth[_0xcd69('0xa')](),controller['destroy']);router[_0xcd69('0x1e')](_0xcd69('0x14'),auth['isAuthenticated'](),controller[_0xcd69('0x1f')]);router[_0xcd69('0x1e')](_0xcd69('0x16'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0xcd69('0x20')]=router;
\ No newline at end of file
+var _0x2054=['post','/:id/clone','clone','addBlackLists','put','update','delete','/:id/lists','removeLists','removeBlackLists','multer','express','Router','fs-extra','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getLists','/:id/blacklists'];(function(_0x5d8048,_0x445203){var _0x3affba=function(_0x5e65c4){while(--_0x5e65c4){_0x5d8048['push'](_0x5d8048['shift']());}};_0x3affba(++_0x445203);}(_0x2054,0x176));var _0x4205=function(_0x5054da,_0x217daf){_0x5054da=_0x5054da-0x0;var _0x76c47b=_0x2054[_0x5054da];return _0x76c47b;};'use strict';var multer=require(_0x4205('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4205('0x1'));var router=express[_0x4205('0x2')]();var fs_extra=require(_0x4205('0x3'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x4205('0x4'));router[_0x4205('0x5')]('/',auth[_0x4205('0x6')](),controller[_0x4205('0x7')]);router['get'](_0x4205('0x8'),auth['isAuthenticated'](),controller[_0x4205('0x9')]);router[_0x4205('0x5')](_0x4205('0xa'),auth[_0x4205('0x6')](),controller[_0x4205('0xb')]);router[_0x4205('0x5')](_0x4205('0xc'),auth[_0x4205('0x6')](),controller[_0x4205('0xd')]);router[_0x4205('0x5')](_0x4205('0xe'),auth[_0x4205('0x6')](),controller['getHopperFinals']);router['get'](_0x4205('0xf'),auth[_0x4205('0x6')](),controller['getHopperBlacks']);router[_0x4205('0x5')]('/:id/lists',auth[_0x4205('0x6')](),controller[_0x4205('0x10')]);router['get'](_0x4205('0x11'),auth[_0x4205('0x6')](),controller['getBlackLists']);router['post']('/',auth[_0x4205('0x6')](),controller['create']);router[_0x4205('0x12')](_0x4205('0x13'),auth[_0x4205('0x6')](),controller[_0x4205('0x14')]);router[_0x4205('0x12')]('/:id/lists',auth[_0x4205('0x6')](),controller['addLists']);router[_0x4205('0x12')](_0x4205('0x11'),auth['isAuthenticated'](),controller[_0x4205('0x15')]);router[_0x4205('0x16')]('/:id',auth[_0x4205('0x6')](),controller[_0x4205('0x17')]);router[_0x4205('0x18')](_0x4205('0x8'),auth[_0x4205('0x6')](),controller['destroy']);router[_0x4205('0x18')](_0x4205('0x19'),auth[_0x4205('0x6')](),controller[_0x4205('0x1a')]);router[_0x4205('0x18')](_0x4205('0x11'),auth['isAuthenticated'](),controller[_0x4205('0x1b')]);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 940f71d..535297b 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 _0xd699=['VIRTUAL','getDataValue','STRING','TEXT'];(function(_0x4f9368,_0x545aad){var _0x1ae968=function(_0x1cca05){while(--_0x1cca05){_0x4f9368['push'](_0x4f9368['shift']());}};_0x1ae968(++_0x545aad);}(_0xd699,0x1d2));var _0x9d69=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xd699[_0x19950b];return _0x3c6b41;};'use strict';var Sequelize=require('sequelize');module['exports']={'key':{'type':Sequelize[_0x9d69('0x0')],'allowNull':![]},'value':{'type':Sequelize[_0x9d69('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x9d69('0x0')]},'name':{'type':Sequelize[_0x9d69('0x2')],'get':function(){return this[_0x9d69('0x3')]('key');}}};
\ No newline at end of file
+var _0x3a5b=['exports','STRING','TEXT','getDataValue','sequelize'];(function(_0x38674e,_0x170f1e){var _0x282a8a=function(_0x308ade){while(--_0x308ade){_0x38674e['push'](_0x38674e['shift']());}};_0x282a8a(++_0x170f1e);}(_0x3a5b,0xb3));var _0xb3a5=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x3a5b[_0x25d2fb];return _0x1ded53;};'use strict';var Sequelize=require(_0xb3a5('0x0'));module[_0xb3a5('0x1')]={'key':{'type':Sequelize[_0xb3a5('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xb3a5('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xb3a5('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb3a5('0x4')]('key');}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index 944406e..61079f2 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 _0x7f3f=['rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','filters','length','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','role','user','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','then','destroy','get','error','stack','name','send','index','map','CannedAnswer'];(function(_0x8c0c1a,_0xc7b715){var _0x1e08a5=function(_0x18e918){while(--_0x18e918){_0x8c0c1a['push'](_0x8c0c1a['shift']());}};_0x1e08a5(++_0xc7b715);}(_0x7f3f,0x18d));var _0xf7f3=function(_0x38622b,_0x3cfdf7){_0x38622b=_0x38622b-0x0;var _0x2c1a7a=_0x7f3f[_0x38622b];return _0x2c1a7a;};'use strict';var emlformat=require(_0xf7f3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xf7f3('0x1'));var rp=require(_0xf7f3('0x2'));var moment=require(_0xf7f3('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf7f3('0x4'));var util=require(_0xf7f3('0x5'));var path=require('path');var sox=require(_0xf7f3('0x6'));var csv=require(_0xf7f3('0x7'));var ejs=require(_0xf7f3('0x8'));var fs=require('fs');var fs_extra=require(_0xf7f3('0x9'));var _=require('lodash');var squel=require(_0xf7f3('0xa'));var crypto=require(_0xf7f3('0xb'));var jsforce=require(_0xf7f3('0xc'));var deskjs=require(_0xf7f3('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf7f3('0xe'));var Redis=require(_0xf7f3('0xf'));var authService=require(_0xf7f3('0x10'));var qs=require(_0xf7f3('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf7f3('0x12'));var logger=require(_0xf7f3('0x13'))(_0xf7f3('0x14'));var utils=require(_0xf7f3('0x15'));var config=require(_0xf7f3('0x16'));var licenseUtil=require(_0xf7f3('0x17'));var db=require(_0xf7f3('0x18'))['db'];function respondWithStatusCode(_0x26afcb,_0x502302){_0x502302=_0x502302||0xcc;return function(_0x11717c){if(_0x11717c){return _0x26afcb[_0xf7f3('0x19')](_0x502302);}return _0x26afcb[_0xf7f3('0x1a')](_0x502302)[_0xf7f3('0x1b')]();};}function respondWithResult(_0x321ed4,_0x6e4c52){_0x6e4c52=_0x6e4c52||0xc8;return function(_0x2e7547){if(_0x2e7547){return _0x321ed4[_0xf7f3('0x1a')](_0x6e4c52)[_0xf7f3('0x1c')](_0x2e7547);}};}function respondWithFilteredResult(_0x108ec2,_0x116a8c){return function(_0x23a70c){if(_0x23a70c){var _0x4faba8=typeof _0x116a8c[_0xf7f3('0x1d')]===_0xf7f3('0x1e')&&typeof _0x116a8c[_0xf7f3('0x1f')]===_0xf7f3('0x1e');var _0x1673bc=_0x23a70c[_0xf7f3('0x20')];var _0x38fc0c=_0x4faba8?0x0:_0x116a8c['offset'];var _0x37ae54=_0x4faba8?_0x23a70c[_0xf7f3('0x20')]:_0x116a8c[_0xf7f3('0x1d')]+_0x116a8c['limit'];var _0x15d961;if(_0x37ae54>=_0x1673bc){_0x37ae54=_0x1673bc;_0x15d961=0xc8;}else{_0x15d961=0xce;}_0x108ec2['status'](_0x15d961);return _0x108ec2['set'](_0xf7f3('0x21'),_0x38fc0c+'-'+_0x37ae54+'/'+_0x1673bc)[_0xf7f3('0x1c')](_0x23a70c);}return null;};}function patchUpdates(_0x3a4541){return function(_0x240aa4){try{jsonpatch[_0xf7f3('0x22')](_0x240aa4,_0x3a4541,!![]);}catch(_0x196233){return BPromise[_0xf7f3('0x23')](_0x196233);}return _0x240aa4[_0xf7f3('0x24')]();};}function saveUpdates(_0x811c3,_0x36ecad){return function(_0x2a36c2){if(_0x2a36c2){return _0x2a36c2[_0xf7f3('0x25')](_0x811c3)[_0xf7f3('0x26')](function(_0x4c06f6){return _0x4c06f6;});}return null;};}function removeEntity(_0x5492dd,_0x25902d){return function(_0x1f18f7){if(_0x1f18f7){return _0x1f18f7[_0xf7f3('0x27')]()[_0xf7f3('0x26')](function(){var _0x1e74ce=_0x1f18f7[_0xf7f3('0x28')]({'plain':!![]});var _0x5e0ce0='CannedAnswers';return db['UserProfileResource']['destroy']({'where':{'type':_0x5e0ce0,'resourceId':_0x1e74ce['id']}})[_0xf7f3('0x26')](function(){return _0x1f18f7;});})[_0xf7f3('0x26')](function(){_0x5492dd[_0xf7f3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35dc6d,_0x4bffdd){return function(_0x26e1a4){if(!_0x26e1a4){_0x35dc6d[_0xf7f3('0x19')](0x194);}return _0x26e1a4;};}function handleError(_0x96a3ba,_0x290519){_0x290519=_0x290519||0x1f4;return function(_0x3f889c){logger[_0xf7f3('0x29')](_0x3f889c[_0xf7f3('0x2a')]);if(_0x3f889c[_0xf7f3('0x2b')]){delete _0x3f889c['name'];}_0x96a3ba[_0xf7f3('0x1a')](_0x290519)[_0xf7f3('0x2c')](_0x3f889c);};}exports[_0xf7f3('0x2d')]=function(_0x29879d,_0x497fad){var _0x1f7502={},_0x2e78b5={},_0x516251={'count':0x0,'rows':[]};var _0x3707fc=_[_0xf7f3('0x2e')](db[_0xf7f3('0x2f')][_0xf7f3('0x30')],function(_0x1fea3a){return{'name':_0x1fea3a[_0xf7f3('0x31')],'type':_0x1fea3a['type'][_0xf7f3('0x32')]};});_0x2e78b5[_0xf7f3('0x33')]=_[_0xf7f3('0x2e')](_0x3707fc,_0xf7f3('0x2b'));_0x2e78b5[_0xf7f3('0x34')]=_[_0xf7f3('0x35')](_0x29879d[_0xf7f3('0x34')]);_0x2e78b5['filters']=_[_0xf7f3('0x36')](_0x2e78b5[_0xf7f3('0x33')],_0x2e78b5[_0xf7f3('0x34')]);_0x1f7502[_0xf7f3('0x37')]=_[_0xf7f3('0x36')](_0x2e78b5[_0xf7f3('0x33')],qs[_0xf7f3('0x38')](_0x29879d[_0xf7f3('0x34')][_0xf7f3('0x38')]));_0x1f7502[_0xf7f3('0x37')]=_0x1f7502['attributes']['length']?_0x1f7502['attributes']:_0x2e78b5[_0xf7f3('0x33')];if(!_0x29879d['query'][_0xf7f3('0x39')]('nolimit')){_0x1f7502['limit']=qs['limit'](_0x29879d[_0xf7f3('0x34')]['limit']);_0x1f7502['offset']=qs['offset'](_0x29879d[_0xf7f3('0x34')]['offset']);}_0x1f7502[_0xf7f3('0x3a')]=qs[_0xf7f3('0x3b')](_0x29879d['query'][_0xf7f3('0x3b')]);_0x1f7502['where']=qs['filters'](_['pick'](_0x29879d[_0xf7f3('0x34')],_0x2e78b5['filters']),_0x3707fc);if(_0x29879d[_0xf7f3('0x34')][_0xf7f3('0x3c')]){_0x1f7502['where']=_['merge'](_0x1f7502[_0xf7f3('0x3d')],{'$or':[{'key':{'$like':'%'+_0x29879d[_0xf7f3('0x34')][_0xf7f3('0x3c')]+'%'}},{'value':{'$like':'%'+_0x29879d[_0xf7f3('0x34')][_0xf7f3('0x3c')]+'%'}}]});}_0x1f7502=_[_0xf7f3('0x3e')]({},_0x1f7502,_0x29879d[_0xf7f3('0x3f')]);var _0x3719cd={'where':_0x1f7502[_0xf7f3('0x3d')]};return db[_0xf7f3('0x2f')][_0xf7f3('0x20')](_0x3719cd)['then'](function(_0x343850){_0x516251['count']=_0x343850;if(_0x29879d[_0xf7f3('0x34')][_0xf7f3('0x40')]){_0x1f7502[_0xf7f3('0x41')]=[{'all':!![]}];}return db[_0xf7f3('0x2f')][_0xf7f3('0x42')](_0x1f7502);})['then'](function(_0x43f1cf){_0x516251[_0xf7f3('0x43')]=_0x43f1cf;return _0x516251;})['then'](respondWithFilteredResult(_0x497fad,_0x1f7502))[_0xf7f3('0x44')](handleError(_0x497fad,null));};exports[_0xf7f3('0x45')]=function(_0x5aec30,_0x17b6ea){var _0x539296={'raw':!![],'where':{'id':_0x5aec30[_0xf7f3('0x46')]['id']}},_0xe71b71={};_0xe71b71[_0xf7f3('0x33')]=_['keys'](db['CannedAnswer'][_0xf7f3('0x30')]);_0xe71b71['query']=_[_0xf7f3('0x35')](_0x5aec30['query']);_0xe71b71[_0xf7f3('0x47')]=_[_0xf7f3('0x36')](_0xe71b71['model'],_0xe71b71['query']);_0x539296[_0xf7f3('0x37')]=_['intersection'](_0xe71b71[_0xf7f3('0x33')],qs[_0xf7f3('0x38')](_0x5aec30[_0xf7f3('0x34')][_0xf7f3('0x38')]));_0x539296[_0xf7f3('0x37')]=_0x539296[_0xf7f3('0x37')][_0xf7f3('0x48')]?_0x539296[_0xf7f3('0x37')]:_0xe71b71[_0xf7f3('0x33')];if(_0x5aec30[_0xf7f3('0x34')][_0xf7f3('0x40')]){_0x539296[_0xf7f3('0x41')]=[{'all':!![]}];}_0x539296=_['merge']({},_0x539296,_0x5aec30['options']);return db[_0xf7f3('0x2f')][_0xf7f3('0x49')](_0x539296)[_0xf7f3('0x26')](handleEntityNotFound(_0x17b6ea,null))[_0xf7f3('0x26')](respondWithResult(_0x17b6ea,null))[_0xf7f3('0x44')](handleError(_0x17b6ea,null));};exports['update']=function(_0x259c05,_0x236894){if(_0x259c05[_0xf7f3('0x4a')]['id']){delete _0x259c05[_0xf7f3('0x4a')]['id'];}return db[_0xf7f3('0x2f')][_0xf7f3('0x49')]({'where':{'id':_0x259c05[_0xf7f3('0x46')]['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x236894,null))['then'](saveUpdates(_0x259c05['body'],null))['then'](respondWithResult(_0x236894,null))['catch'](handleError(_0x236894,null));};exports['destroy']=function(_0x4ada95,_0x349369){return db['CannedAnswer']['find']({'where':{'id':_0x4ada95[_0xf7f3('0x46')]['id']}})[_0xf7f3('0x26')](handleEntityNotFound(_0x349369,null))['then'](removeEntity(_0x349369,null))[_0xf7f3('0x44')](handleError(_0x349369,null));};exports[_0xf7f3('0x4b')]=function(_0x558c3e,_0x372644){var _0x1a1cc4={'key':_0x558c3e[_0xf7f3('0x4a')]['key']};if(_0x558c3e[_0xf7f3('0x4a')][_0xf7f3('0x4c')]){_0x1a1cc4[_0xf7f3('0x4c')]=_0x558c3e[_0xf7f3('0x4a')][_0xf7f3('0x4c')];}else if(_0x558c3e['body'][_0xf7f3('0x4d')]){_0x1a1cc4[_0xf7f3('0x4d')]=_0x558c3e[_0xf7f3('0x4a')]['SmsAccountId'];}else if(_0x558c3e[_0xf7f3('0x4a')][_0xf7f3('0x4e')]){_0x1a1cc4[_0xf7f3('0x4e')]=_0x558c3e[_0xf7f3('0x4a')]['OpenchannelAccountId'];}else if(_0x558c3e[_0xf7f3('0x4a')]['ChatWebsiteId']){_0x1a1cc4[_0xf7f3('0x4f')]=_0x558c3e[_0xf7f3('0x4a')][_0xf7f3('0x4f')];}return db[_0xf7f3('0x2f')][_0xf7f3('0x49')]({'where':_0x1a1cc4})[_0xf7f3('0x26')](function(_0x26b68d){if(_0x26b68d){throw new db[(_0xf7f3('0x50'))][(_0xf7f3('0x51'))](_0xf7f3('0x52'));}return db[_0xf7f3('0x2f')][_0xf7f3('0x4b')](_0x558c3e[_0xf7f3('0x4a')]);})['then'](function(_0x2387d1){var _0x425a21=_0x558c3e['user']['get']({'plain':!![]});if(!_0x425a21)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x425a21[_0xf7f3('0x53')]===_0xf7f3('0x54')){var _0x2b5a96=_0x2387d1['get']({'plain':!![]});return db[_0xf7f3('0x55')][_0xf7f3('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x425a21[_0xf7f3('0x56')]},'raw':!![]})[_0xf7f3('0x26')](function(_0xe0fa68){if(_0xe0fa68&&_0xe0fa68['autoAssociation']===0x0){return db[_0xf7f3('0x57')]['create']({'name':_0x2b5a96[_0xf7f3('0x2b')],'resourceId':_0x2b5a96['id'],'type':_0xe0fa68[_0xf7f3('0x2b')],'sectionId':_0xe0fa68['id']},{})[_0xf7f3('0x26')](function(){return _0x2387d1;});}else{return _0x2387d1;}})[_0xf7f3('0x44')](function(_0x393085){logger[_0xf7f3('0x29')](_0xf7f3('0x58'),_0x393085);throw _0x393085;});}return _0x2387d1;})[_0xf7f3('0x26')](respondWithResult(_0x372644,0xc9))['catch'](handleError(_0x372644,null));};
\ No newline at end of file
+var _0x4984=['includeAll','include','findAll','rows','catch','show','params','keys','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','index','CannedAnswer','fieldName','type','key','query','intersection','attributes','model','fields','length','hasOwnProperty','sort','where','filters','pick','filter','merge','options'];(function(_0x43fa17,_0x498bc8){var _0x24aafe=function(_0x3cf9e8){while(--_0x3cf9e8){_0x43fa17['push'](_0x43fa17['shift']());}};_0x24aafe(++_0x498bc8);}(_0x4984,0x174));var _0x4498=function(_0x3f8162,_0x5b8808){_0x3f8162=_0x3f8162-0x0;var _0xe80afb=_0x4984[_0x3f8162];return _0xe80afb;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x4498('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4498('0x1'));var rp=require('request-promise');var moment=require(_0x4498('0x2'));var BPromise=require(_0x4498('0x3'));var Mustache=require('mustache');var util=require(_0x4498('0x4'));var path=require('path');var sox=require(_0x4498('0x5'));var csv=require(_0x4498('0x6'));var ejs=require(_0x4498('0x7'));var fs=require('fs');var fs_extra=require(_0x4498('0x8'));var _=require(_0x4498('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4498('0xa'));var deskjs=require(_0x4498('0xb'));var toCsv=require(_0x4498('0x6'));var querystring=require(_0x4498('0xc'));var Papa=require(_0x4498('0xd'));var Redis=require(_0x4498('0xe'));var authService=require(_0x4498('0xf'));var qs=require(_0x4498('0x10'));var as=require(_0x4498('0x11'));var hardwareService=require(_0x4498('0x12'));var logger=require(_0x4498('0x13'))('api');var utils=require(_0x4498('0x14'));var config=require(_0x4498('0x15'));var licenseUtil=require(_0x4498('0x16'));var db=require(_0x4498('0x17'))['db'];function respondWithStatusCode(_0x407c52,_0x538ee9){_0x538ee9=_0x538ee9||0xcc;return function(_0x225fbd){if(_0x225fbd){return _0x407c52[_0x4498('0x18')](_0x538ee9);}return _0x407c52[_0x4498('0x19')](_0x538ee9)[_0x4498('0x1a')]();};}function respondWithResult(_0x5d4dcf,_0xa46acc){_0xa46acc=_0xa46acc||0xc8;return function(_0x37e341){if(_0x37e341){return _0x5d4dcf['status'](_0xa46acc)[_0x4498('0x1b')](_0x37e341);}};}function respondWithFilteredResult(_0x6cafb2,_0x3cb446){return function(_0x48e98f){if(_0x48e98f){var _0x34a6ef=typeof _0x3cb446[_0x4498('0x1c')]===_0x4498('0x1d')&&typeof _0x3cb446[_0x4498('0x1e')]===_0x4498('0x1d');var _0x29a5be=_0x48e98f['count'];var _0x240cfe=_0x34a6ef?0x0:_0x3cb446[_0x4498('0x1c')];var _0xff2aed=_0x34a6ef?_0x48e98f[_0x4498('0x1f')]:_0x3cb446[_0x4498('0x1c')]+_0x3cb446[_0x4498('0x1e')];var _0x492552;if(_0xff2aed>=_0x29a5be){_0xff2aed=_0x29a5be;_0x492552=0xc8;}else{_0x492552=0xce;}_0x6cafb2[_0x4498('0x19')](_0x492552);return _0x6cafb2['set'](_0x4498('0x20'),_0x240cfe+'-'+_0xff2aed+'/'+_0x29a5be)[_0x4498('0x1b')](_0x48e98f);}return null;};}function patchUpdates(_0x2d29cd){return function(_0x209ecb){try{jsonpatch[_0x4498('0x21')](_0x209ecb,_0x2d29cd,!![]);}catch(_0x354c5c){return BPromise['reject'](_0x354c5c);}return _0x209ecb[_0x4498('0x22')]();};}function saveUpdates(_0x501ac7,_0x383997){return function(_0x13c9be){if(_0x13c9be){return _0x13c9be[_0x4498('0x23')](_0x501ac7)[_0x4498('0x24')](function(_0x4d36a9){return _0x4d36a9;});}return null;};}function removeEntity(_0x485e1a,_0x2aa359){return function(_0x357953){if(_0x357953){return _0x357953[_0x4498('0x25')]()[_0x4498('0x24')](function(){var _0x106f8c=_0x357953[_0x4498('0x26')]({'plain':!![]});var _0x4807a9=_0x4498('0x27');return db[_0x4498('0x28')][_0x4498('0x25')]({'where':{'type':_0x4807a9,'resourceId':_0x106f8c['id']}})[_0x4498('0x24')](function(){return _0x357953;});})[_0x4498('0x24')](function(){_0x485e1a[_0x4498('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x62d6d1,_0x43ed90){return function(_0x5e7e86){if(!_0x5e7e86){_0x62d6d1[_0x4498('0x18')](0x194);}return _0x5e7e86;};}function handleError(_0x13b0d5,_0x255ea5){_0x255ea5=_0x255ea5||0x1f4;return function(_0x1982be){logger['error'](_0x1982be[_0x4498('0x29')]);if(_0x1982be[_0x4498('0x2a')]){delete _0x1982be[_0x4498('0x2a')];}_0x13b0d5[_0x4498('0x19')](_0x255ea5)[_0x4498('0x2b')](_0x1982be);};}exports[_0x4498('0x2c')]=function(_0x37c588,_0x98823e){var _0x8e18a5={},_0x15e9ab={},_0x5047cd={'count':0x0,'rows':[]};var _0x2b9f19=_['map'](db[_0x4498('0x2d')]['rawAttributes'],function(_0x21ed2f){return{'name':_0x21ed2f[_0x4498('0x2e')],'type':_0x21ed2f[_0x4498('0x2f')][_0x4498('0x30')]};});_0x15e9ab['model']=_['map'](_0x2b9f19,_0x4498('0x2a'));_0x15e9ab[_0x4498('0x31')]=_['keys'](_0x37c588['query']);_0x15e9ab['filters']=_[_0x4498('0x32')](_0x15e9ab['model'],_0x15e9ab[_0x4498('0x31')]);_0x8e18a5[_0x4498('0x33')]=_[_0x4498('0x32')](_0x15e9ab[_0x4498('0x34')],qs[_0x4498('0x35')](_0x37c588[_0x4498('0x31')][_0x4498('0x35')]));_0x8e18a5['attributes']=_0x8e18a5[_0x4498('0x33')][_0x4498('0x36')]?_0x8e18a5[_0x4498('0x33')]:_0x15e9ab['model'];if(!_0x37c588[_0x4498('0x31')][_0x4498('0x37')]('nolimit')){_0x8e18a5[_0x4498('0x1e')]=qs[_0x4498('0x1e')](_0x37c588['query'][_0x4498('0x1e')]);_0x8e18a5[_0x4498('0x1c')]=qs[_0x4498('0x1c')](_0x37c588[_0x4498('0x31')][_0x4498('0x1c')]);}_0x8e18a5['order']=qs['sort'](_0x37c588[_0x4498('0x31')][_0x4498('0x38')]);_0x8e18a5[_0x4498('0x39')]=qs[_0x4498('0x3a')](_[_0x4498('0x3b')](_0x37c588[_0x4498('0x31')],_0x15e9ab[_0x4498('0x3a')]),_0x2b9f19);if(_0x37c588[_0x4498('0x31')][_0x4498('0x3c')]){_0x8e18a5['where']=_[_0x4498('0x3d')](_0x8e18a5[_0x4498('0x39')],{'$or':[{'key':{'$like':'%'+_0x37c588[_0x4498('0x31')][_0x4498('0x3c')]+'%'}},{'value':{'$like':'%'+_0x37c588[_0x4498('0x31')][_0x4498('0x3c')]+'%'}}]});}_0x8e18a5=_['merge']({},_0x8e18a5,_0x37c588[_0x4498('0x3e')]);var _0x4bdbb3={'where':_0x8e18a5[_0x4498('0x39')]};return db['CannedAnswer']['count'](_0x4bdbb3)[_0x4498('0x24')](function(_0x1825aa){_0x5047cd[_0x4498('0x1f')]=_0x1825aa;if(_0x37c588[_0x4498('0x31')][_0x4498('0x3f')]){_0x8e18a5[_0x4498('0x40')]=[{'all':!![]}];}return db[_0x4498('0x2d')][_0x4498('0x41')](_0x8e18a5);})[_0x4498('0x24')](function(_0x31d07c){_0x5047cd[_0x4498('0x42')]=_0x31d07c;return _0x5047cd;})[_0x4498('0x24')](respondWithFilteredResult(_0x98823e,_0x8e18a5))[_0x4498('0x43')](handleError(_0x98823e,null));};exports[_0x4498('0x44')]=function(_0x486aaa,_0x5ef1df){var _0x5a095d={'raw':!![],'where':{'id':_0x486aaa[_0x4498('0x45')]['id']}},_0x339ab5={};_0x339ab5[_0x4498('0x34')]=_[_0x4498('0x46')](db[_0x4498('0x2d')]['rawAttributes']);_0x339ab5[_0x4498('0x31')]=_[_0x4498('0x46')](_0x486aaa[_0x4498('0x31')]);_0x339ab5['filters']=_['intersection'](_0x339ab5[_0x4498('0x34')],_0x339ab5[_0x4498('0x31')]);_0x5a095d['attributes']=_[_0x4498('0x32')](_0x339ab5[_0x4498('0x34')],qs['fields'](_0x486aaa[_0x4498('0x31')][_0x4498('0x35')]));_0x5a095d[_0x4498('0x33')]=_0x5a095d[_0x4498('0x33')][_0x4498('0x36')]?_0x5a095d[_0x4498('0x33')]:_0x339ab5[_0x4498('0x34')];if(_0x486aaa['query'][_0x4498('0x3f')]){_0x5a095d[_0x4498('0x40')]=[{'all':!![]}];}_0x5a095d=_['merge']({},_0x5a095d,_0x486aaa[_0x4498('0x3e')]);return db[_0x4498('0x2d')][_0x4498('0x47')](_0x5a095d)[_0x4498('0x24')](handleEntityNotFound(_0x5ef1df,null))[_0x4498('0x24')](respondWithResult(_0x5ef1df,null))['catch'](handleError(_0x5ef1df,null));};exports['update']=function(_0x44227e,_0x121b8b){if(_0x44227e[_0x4498('0x48')]['id']){delete _0x44227e[_0x4498('0x48')]['id'];}return db[_0x4498('0x2d')]['find']({'where':{'id':_0x44227e['params']['id']}})[_0x4498('0x24')](handleEntityNotFound(_0x121b8b,null))[_0x4498('0x24')](saveUpdates(_0x44227e[_0x4498('0x48')],null))['then'](respondWithResult(_0x121b8b,null))['catch'](handleError(_0x121b8b,null));};exports[_0x4498('0x25')]=function(_0x309b25,_0x3383ec){return db[_0x4498('0x2d')][_0x4498('0x47')]({'where':{'id':_0x309b25[_0x4498('0x45')]['id']}})[_0x4498('0x24')](handleEntityNotFound(_0x3383ec,null))['then'](removeEntity(_0x3383ec,null))[_0x4498('0x43')](handleError(_0x3383ec,null));};exports[_0x4498('0x49')]=function(_0x460100,_0x279d7e){var _0x5eb882={'key':_0x460100['body']['key']};if(_0x460100[_0x4498('0x48')][_0x4498('0x4a')]){_0x5eb882[_0x4498('0x4a')]=_0x460100[_0x4498('0x48')]['MailAccountId'];}else if(_0x460100['body'][_0x4498('0x4b')]){_0x5eb882[_0x4498('0x4b')]=_0x460100['body'][_0x4498('0x4b')];}else if(_0x460100[_0x4498('0x48')][_0x4498('0x4c')]){_0x5eb882['OpenchannelAccountId']=_0x460100[_0x4498('0x48')]['OpenchannelAccountId'];}else if(_0x460100[_0x4498('0x48')][_0x4498('0x4d')]){_0x5eb882[_0x4498('0x4d')]=_0x460100[_0x4498('0x48')]['ChatWebsiteId'];}return db[_0x4498('0x2d')]['find']({'where':_0x5eb882})[_0x4498('0x24')](function(_0x196fb0){if(_0x196fb0){throw new db[(_0x4498('0x4e'))][(_0x4498('0x4f'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x4498('0x2d')][_0x4498('0x49')](_0x460100['body']);})['then'](function(_0x11e176){var _0x58a6fb=_0x460100[_0x4498('0x50')][_0x4498('0x26')]({'plain':!![]});if(!_0x58a6fb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x58a6fb[_0x4498('0x51')]===_0x4498('0x50')){var _0x4271b7=_0x11e176[_0x4498('0x26')]({'plain':!![]});return db[_0x4498('0x52')][_0x4498('0x47')]({'where':{'name':_0x4498('0x27'),'userProfileId':_0x58a6fb[_0x4498('0x53')]},'raw':!![]})[_0x4498('0x24')](function(_0x52f8f9){if(_0x52f8f9&&_0x52f8f9[_0x4498('0x54')]===0x0){return db[_0x4498('0x28')]['create']({'name':_0x4271b7[_0x4498('0x2a')],'resourceId':_0x4271b7['id'],'type':_0x52f8f9['name'],'sectionId':_0x52f8f9['id']},{})['then'](function(){return _0x11e176;});}else{return _0x11e176;}})[_0x4498('0x43')](function(_0x5e01d9){logger[_0x4498('0x55')](_0x4498('0x56'),_0x5e01d9);throw _0x5e01d9;});}return _0x11e176;})['then'](respondWithResult(_0x279d7e,0xc9))[_0x4498('0x43')](handleError(_0x279d7e,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index 31e278e..430d24b 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 _0xabf1=['bluebird','request-promise','../../config/environment','define','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','util','api','moment'];(function(_0x38a5df,_0x88728f){var _0x3c4ce2=function(_0x12a47d){while(--_0x12a47d){_0x38a5df['push'](_0x38a5df['shift']());}};_0x3c4ce2(++_0x88728f);}(_0xabf1,0xed));var _0x1abf=function(_0xceda64,_0x57969b){_0xceda64=_0xceda64-0x0;var _0x345f2f=_0xabf1[_0xceda64];return _0x345f2f;};'use strict';var _=require('lodash');var util=require(_0x1abf('0x0'));var logger=require('../../config/logger')(_0x1abf('0x1'));var moment=require(_0x1abf('0x2'));var BPromise=require(_0x1abf('0x3'));var rp=require(_0x1abf('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1abf('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0xdea3dc,_0x522042){return _0xdea3dc[_0x1abf('0x6')]('CannedAnswer',attributes,{'tableName':_0x1abf('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1abf('0x8'),'collate':_0x1abf('0x9')});};
\ No newline at end of file
+var _0x95c0=['../../config/logger','api','bluebird','request-promise','path','rimraf','./cannedAnswer.attributes','exports','define','CannedAnswer','utf8mb4','utf8mb4_unicode_ci','lodash'];(function(_0x5dff12,_0x13c07f){var _0x292e58=function(_0x513642){while(--_0x513642){_0x5dff12['push'](_0x5dff12['shift']());}};_0x292e58(++_0x13c07f);}(_0x95c0,0x74));var _0x095c=function(_0x10d73c,_0x556760){_0x10d73c=_0x10d73c-0x0;var _0x3dc92b=_0x95c0[_0x10d73c];return _0x3dc92b;};'use strict';var _=require(_0x095c('0x0'));var util=require('util');var logger=require(_0x095c('0x1'))(_0x095c('0x2'));var moment=require('moment');var BPromise=require(_0x095c('0x3'));var rp=require(_0x095c('0x4'));var fs=require('fs');var path=require(_0x095c('0x5'));var rimraf=require(_0x095c('0x6'));var config=require('../../config/environment');var attributes=require(_0x095c('0x7'));module[_0x095c('0x8')]=function(_0x2b7b3e,_0x92c19b){return _0x2b7b3e[_0x095c('0x9')](_0x095c('0xa'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x095c('0xb'),'collate':_0x095c('0xc')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index 1ab10ef..9407d23 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(_0x476c67,_0x5904d2){var _0x5d1860=function(_0x1d3f2e){while(--_0x1d3f2e){_0x476c67['push'](_0x476c67['shift']());}};_0x5d1860(++_0x5904d2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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(_0x425871,_0x46c821){var _0x3de4ed=function(_0x4dbda1){while(--_0x4dbda1){_0x425871['push'](_0x425871['shift']());}};_0x3de4ed(++_0x46c821);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'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 1ab66d3..4b172af 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 _0xa986=['express','Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put','update','destroy','util'];(function(_0x1c7f5c,_0xf442a2){var _0x36d7e7=function(_0x479c0b){while(--_0x479c0b){_0x1c7f5c['push'](_0x1c7f5c['shift']());}};_0x36d7e7(++_0xf442a2);}(_0xa986,0xe0));var _0x6a98=function(_0x30feb4,_0x4d3a77){_0x30feb4=_0x30feb4-0x0;var _0x1adf4c=_0xa986[_0x30feb4];return _0x1adf4c;};'use strict';var multer=require('multer');var util=require(_0x6a98('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6a98('0x1'));var router=express[_0x6a98('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x6a98('0x3'));var interaction=require(_0x6a98('0x4'));var config=require('../../config/environment');var controller=require(_0x6a98('0x5'));router[_0x6a98('0x6')]('/',auth[_0x6a98('0x7')](),controller[_0x6a98('0x8')]);router[_0x6a98('0x6')](_0x6a98('0x9'),auth[_0x6a98('0x7')](),controller[_0x6a98('0xa')]);router[_0x6a98('0xb')]('/',auth[_0x6a98('0x7')](),controller['create']);router[_0x6a98('0xc')](_0x6a98('0x9'),auth['isAuthenticated'](),controller[_0x6a98('0xd')]);router['delete']('/:id',auth[_0x6a98('0x7')](),controller[_0x6a98('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x74e0=['util','path','express','Router','fs-extra','../../components/auth/service','./cannedAnswer.controller','get','index','isAuthenticated','post','create','put','delete','/:id','destroy','exports','multer'];(function(_0x5c4ed9,_0x2475ea){var _0x3aded2=function(_0x465ba7){while(--_0x465ba7){_0x5c4ed9['push'](_0x5c4ed9['shift']());}};_0x3aded2(++_0x2475ea);}(_0x74e0,0xfb));var _0x074e=function(_0x4ade33,_0x103537){_0x4ade33=_0x4ade33-0x0;var _0x162cc1=_0x74e0[_0x4ade33];return _0x162cc1;};'use strict';var multer=require(_0x074e('0x0'));var util=require(_0x074e('0x1'));var path=require(_0x074e('0x2'));var timeout=require('connect-timeout');var express=require(_0x074e('0x3'));var router=express[_0x074e('0x4')]();var fs_extra=require(_0x074e('0x5'));var auth=require(_0x074e('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x074e('0x7'));router[_0x074e('0x8')]('/',auth['isAuthenticated'](),controller[_0x074e('0x9')]);router[_0x074e('0x8')]('/:id',auth[_0x074e('0xa')](),controller['show']);router[_0x074e('0xb')]('/',auth[_0x074e('0xa')](),controller[_0x074e('0xc')]);router[_0x074e('0xd')]('/:id',auth[_0x074e('0xa')](),controller['update']);router[_0x074e('0xe')](_0x074e('0xf'),auth[_0x074e('0xa')](),controller[_0x074e('0x10')]);module[_0x074e('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index aae405b..a14401a 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 _0xca2b=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x1d9992,_0x48ddc3){var _0x497c91=function(_0x1fbc80){while(--_0x1fbc80){_0x1d9992['push'](_0x1d9992['shift']());}};_0x497c91(++_0x48ddc3);}(_0xca2b,0x156));var _0xbca2=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xca2b[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0xbca2('0x0'));module[_0xbca2('0x1')]={'calldate':{'type':Sequelize[_0xbca2('0x2')],'allowNull':![],'defaultValue':_0xbca2('0x3')},'clid':{'type':Sequelize[_0xbca2('0x4')]},'src':{'type':Sequelize[_0xbca2('0x4')]},'dst':{'type':Sequelize[_0xbca2('0x4')]},'dcontext':{'type':Sequelize[_0xbca2('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xbca2('0x4')]},'lastapp':{'type':Sequelize[_0xbca2('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0xbca2('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xbca2('0x4')]},'amaflags':{'type':Sequelize[_0xbca2('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xbca2('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xbca2('0x4')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xbca2('0x4')]},'tag':{'type':Sequelize[_0xbca2('0x4')]}};
\ No newline at end of file
+var _0x1e88=['exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER','sequelize'];(function(_0x17d389,_0x2f85bf){var _0x28a0c4=function(_0x16d20d){while(--_0x16d20d){_0x17d389['push'](_0x17d389['shift']());}};_0x28a0c4(++_0x2f85bf);}(_0x1e88,0x1d3));var _0x81e8=function(_0x5edd12,_0x487384){_0x5edd12=_0x5edd12-0x0;var _0xda9649=_0x1e88[_0x5edd12];return _0xda9649;};'use strict';var Sequelize=require(_0x81e8('0x0'));module[_0x81e8('0x1')]={'calldate':{'type':Sequelize[_0x81e8('0x2')],'allowNull':![],'defaultValue':_0x81e8('0x3')},'clid':{'type':Sequelize[_0x81e8('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x81e8('0x4')]},'channel':{'type':Sequelize[_0x81e8('0x4')]},'dstchannel':{'type':Sequelize[_0x81e8('0x4')]},'lastapp':{'type':Sequelize[_0x81e8('0x4')]},'lastdata':{'type':Sequelize[_0x81e8('0x4')]},'duration':{'type':Sequelize[_0x81e8('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x81e8('0x4')]},'amaflags':{'type':Sequelize[_0x81e8('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x81e8('0x4')]},'userfield':{'type':Sequelize[_0x81e8('0x4')]},'uniqueid':{'type':Sequelize[_0x81e8('0x4')]},'linkedid':{'type':Sequelize[_0x81e8('0x4')]},'sequence':{'type':Sequelize[_0x81e8('0x4')]},'peeraccount':{'type':Sequelize[_0x81e8('0x4')]},'type':{'type':Sequelize[_0x81e8('0x4')]},'tag':{'type':Sequelize[_0x81e8('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index adbbd68..d81d363 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 _0xa7e6=['json','limit','count','offset','set','Content-Range','apply','reject','save','update','then','error','stack','name','map','type','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','Cdr','include','rows','catch','show','params','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x585e5f,_0x3fc02b){var _0x5264b3=function(_0x8ac830){while(--_0x8ac830){_0x585e5f['push'](_0x585e5f['shift']());}};_0x5264b3(++_0x3fc02b);}(_0xa7e6,0x74));var _0x6a7e=function(_0x3080e1,_0x1be003){_0x3080e1=_0x3080e1-0x0;var _0x386973=_0xa7e6[_0x3080e1];return _0x386973;};'use strict';var emlformat=require(_0x6a7e('0x0'));var rimraf=require(_0x6a7e('0x1'));var zipdir=require(_0x6a7e('0x2'));var jsonpatch=require(_0x6a7e('0x3'));var rp=require(_0x6a7e('0x4'));var moment=require(_0x6a7e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x6a7e('0x6'));var util=require(_0x6a7e('0x7'));var path=require(_0x6a7e('0x8'));var sox=require(_0x6a7e('0x9'));var csv=require(_0x6a7e('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x6a7e('0xb'));var _=require(_0x6a7e('0xc'));var squel=require(_0x6a7e('0xd'));var crypto=require(_0x6a7e('0xe'));var jsforce=require(_0x6a7e('0xf'));var deskjs=require(_0x6a7e('0x10'));var toCsv=require(_0x6a7e('0xa'));var querystring=require(_0x6a7e('0x11'));var Papa=require(_0x6a7e('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6a7e('0x13'));var logger=require(_0x6a7e('0x14'))(_0x6a7e('0x15'));var utils=require(_0x6a7e('0x16'));var config=require(_0x6a7e('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x6a7e('0x18'))['db'];function respondWithStatusCode(_0x4754ef,_0x5c0c74){_0x5c0c74=_0x5c0c74||0xcc;return function(_0x50dcc1){if(_0x50dcc1){return _0x4754ef[_0x6a7e('0x19')](_0x5c0c74);}return _0x4754ef[_0x6a7e('0x1a')](_0x5c0c74)[_0x6a7e('0x1b')]();};}function respondWithResult(_0x374763,_0x4faca9){_0x4faca9=_0x4faca9||0xc8;return function(_0x3137bc){if(_0x3137bc){return _0x374763[_0x6a7e('0x1a')](_0x4faca9)[_0x6a7e('0x1c')](_0x3137bc);}};}function respondWithFilteredResult(_0x4576fe,_0x465566){return function(_0x4b0893){if(_0x4b0893){var _0x16c9a5=typeof _0x465566['offset']==='undefined'&&typeof _0x465566[_0x6a7e('0x1d')]==='undefined';var _0x1d2abb=_0x4b0893[_0x6a7e('0x1e')];var _0x470197=_0x16c9a5?0x0:_0x465566[_0x6a7e('0x1f')];var _0x20e90a=_0x16c9a5?_0x4b0893['count']:_0x465566['offset']+_0x465566['limit'];var _0x102e83;if(_0x20e90a>=_0x1d2abb){_0x20e90a=_0x1d2abb;_0x102e83=0xc8;}else{_0x102e83=0xce;}_0x4576fe[_0x6a7e('0x1a')](_0x102e83);return _0x4576fe[_0x6a7e('0x20')](_0x6a7e('0x21'),_0x470197+'-'+_0x20e90a+'/'+_0x1d2abb)[_0x6a7e('0x1c')](_0x4b0893);}return null;};}function patchUpdates(_0x35b0ff){return function(_0x42eccc){try{jsonpatch[_0x6a7e('0x22')](_0x42eccc,_0x35b0ff,!![]);}catch(_0x5d5cbf){return BPromise[_0x6a7e('0x23')](_0x5d5cbf);}return _0x42eccc[_0x6a7e('0x24')]();};}function saveUpdates(_0x4f53c5,_0x3e1e64){return function(_0x3d0971){if(_0x3d0971){return _0x3d0971[_0x6a7e('0x25')](_0x4f53c5)['then'](function(_0x40c7f6){return _0x40c7f6;});}return null;};}function removeEntity(_0xd045ca,_0x4ee914){return function(_0x18f5e2){if(_0x18f5e2){return _0x18f5e2['destroy']()[_0x6a7e('0x26')](function(){_0xd045ca[_0x6a7e('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x29db13,_0x956eb6){return function(_0x46a15f){if(!_0x46a15f){_0x29db13[_0x6a7e('0x19')](0x194);}return _0x46a15f;};}function handleError(_0x3498c5,_0x380f2f){_0x380f2f=_0x380f2f||0x1f4;return function(_0x573bdc){logger[_0x6a7e('0x27')](_0x573bdc[_0x6a7e('0x28')]);if(_0x573bdc[_0x6a7e('0x29')]){delete _0x573bdc[_0x6a7e('0x29')];}_0x3498c5[_0x6a7e('0x1a')](_0x380f2f)['send'](_0x573bdc);};}exports['index']=function(_0x8b0439,_0x2e86f8){var _0x2723d0={},_0x525376={},_0xa324d0={'count':0x0,'rows':[]};var _0x57e642=_[_0x6a7e('0x2a')](db['Cdr']['rawAttributes'],function(_0x15c2b8){return{'name':_0x15c2b8['fieldName'],'type':_0x15c2b8[_0x6a7e('0x2b')]['key']};});_0x525376['model']=_[_0x6a7e('0x2a')](_0x57e642,_0x6a7e('0x29'));_0x525376[_0x6a7e('0x2c')]=_[_0x6a7e('0x2d')](_0x8b0439[_0x6a7e('0x2c')]);_0x525376[_0x6a7e('0x2e')]=_[_0x6a7e('0x2f')](_0x525376[_0x6a7e('0x30')],_0x525376[_0x6a7e('0x2c')]);_0x2723d0[_0x6a7e('0x31')]=_[_0x6a7e('0x2f')](_0x525376[_0x6a7e('0x30')],qs['fields'](_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x32')]));_0x2723d0[_0x6a7e('0x31')]=_0x2723d0['attributes'][_0x6a7e('0x33')]?_0x2723d0[_0x6a7e('0x31')]:_0x525376[_0x6a7e('0x30')];if(!_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x34')](_0x6a7e('0x35'))){_0x2723d0['limit']=qs['limit'](_0x8b0439[_0x6a7e('0x2c')]['limit']);_0x2723d0[_0x6a7e('0x1f')]=qs[_0x6a7e('0x1f')](_0x8b0439['query']['offset']);}_0x2723d0['order']=qs[_0x6a7e('0x36')](_0x8b0439['query']['sort']);_0x2723d0['where']=qs['filters'](_[_0x6a7e('0x37')](_0x8b0439['query'],_0x525376[_0x6a7e('0x2e')]),_0x57e642);if(_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x38')]){_0x2723d0[_0x6a7e('0x39')]=_[_0x6a7e('0x3a')](_0x2723d0['where'],{'$or':_[_0x6a7e('0x2a')](_0x57e642,function(_0x1db4e3){if(_0x1db4e3['type']!==_0x6a7e('0x3b')){var _0x2f58ac={};_0x2f58ac[_0x1db4e3['name']]={'$like':'%'+_0x8b0439[_0x6a7e('0x2c')][_0x6a7e('0x38')]+'%'};return _0x2f58ac;}})});}_0x2723d0=_[_0x6a7e('0x3a')]({},_0x2723d0,_0x8b0439[_0x6a7e('0x3c')]);var _0x2827f7={'where':_0x2723d0[_0x6a7e('0x39')]};return db[_0x6a7e('0x3d')][_0x6a7e('0x1e')](_0x2827f7)[_0x6a7e('0x26')](function(_0x27434a){_0xa324d0[_0x6a7e('0x1e')]=_0x27434a;if(_0x8b0439['query']['includeAll']){_0x2723d0[_0x6a7e('0x3e')]=[{'all':!![]}];}return db[_0x6a7e('0x3d')]['findAll'](_0x2723d0);})[_0x6a7e('0x26')](function(_0x46799d){_0xa324d0[_0x6a7e('0x3f')]=_0x46799d;return _0xa324d0;})[_0x6a7e('0x26')](respondWithFilteredResult(_0x2e86f8,_0x2723d0))[_0x6a7e('0x40')](handleError(_0x2e86f8,null));};exports[_0x6a7e('0x41')]=function(_0x3d7266,_0x14cae5){var _0x2a3d31={'raw':!![],'where':{'id':_0x3d7266[_0x6a7e('0x42')]['id']}},_0x247efb={};_0x247efb[_0x6a7e('0x30')]=_[_0x6a7e('0x2d')](db[_0x6a7e('0x3d')]['rawAttributes']);_0x247efb['query']=_[_0x6a7e('0x2d')](_0x3d7266[_0x6a7e('0x2c')]);_0x247efb[_0x6a7e('0x2e')]=_[_0x6a7e('0x2f')](_0x247efb[_0x6a7e('0x30')],_0x247efb[_0x6a7e('0x2c')]);_0x2a3d31[_0x6a7e('0x31')]=_[_0x6a7e('0x2f')](_0x247efb['model'],qs[_0x6a7e('0x32')](_0x3d7266['query'][_0x6a7e('0x32')]));_0x2a3d31[_0x6a7e('0x31')]=_0x2a3d31[_0x6a7e('0x31')][_0x6a7e('0x33')]?_0x2a3d31['attributes']:_0x247efb[_0x6a7e('0x30')];if(_0x3d7266[_0x6a7e('0x2c')][_0x6a7e('0x43')]){_0x2a3d31['include']=[{'all':!![]}];}_0x2a3d31=_[_0x6a7e('0x3a')]({},_0x2a3d31,_0x3d7266['options']);return db[_0x6a7e('0x3d')][_0x6a7e('0x44')](_0x2a3d31)[_0x6a7e('0x26')](handleEntityNotFound(_0x14cae5,null))[_0x6a7e('0x26')](respondWithResult(_0x14cae5,null))['catch'](handleError(_0x14cae5,null));};exports[_0x6a7e('0x45')]=function(_0x47369f,_0x188ab5){return db[_0x6a7e('0x3d')]['create'](_0x47369f[_0x6a7e('0x46')],{})['then'](respondWithResult(_0x188ab5,0xc9))[_0x6a7e('0x40')](handleError(_0x188ab5,null));};exports[_0x6a7e('0x25')]=function(_0x25c2bb,_0x4a7465){if(_0x25c2bb[_0x6a7e('0x46')]['id']){delete _0x25c2bb['body']['id'];}return db[_0x6a7e('0x3d')]['find']({'where':{'id':_0x25c2bb[_0x6a7e('0x42')]['id']}})[_0x6a7e('0x26')](handleEntityNotFound(_0x4a7465,null))[_0x6a7e('0x26')](saveUpdates(_0x25c2bb[_0x6a7e('0x46')],null))[_0x6a7e('0x26')](respondWithResult(_0x4a7465,null))[_0x6a7e('0x40')](handleError(_0x4a7465,null));};exports['destroy']=function(_0x3d4395,_0x54f72b){return db[_0x6a7e('0x3d')][_0x6a7e('0x44')]({'where':{'id':_0x3d4395['params']['id']}})['then'](handleEntityNotFound(_0x54f72b,null))[_0x6a7e('0x26')](removeEntity(_0x54f72b,null))[_0x6a7e('0x40')](handleError(_0x54f72b,null));};exports[_0x6a7e('0x47')]=function(_0x251076,_0x43f5ac){return db['Cdr'][_0x6a7e('0x47')]()[_0x6a7e('0x26')](respondWithResult(_0x43f5ac,null))[_0x6a7e('0x40')](handleError(_0x43f5ac,null));};
\ No newline at end of file
+var _0x6b8f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','rows','catch','show','params','keys','find','create','body','describe','rimraf','fast-json-patch','bluebird','mustache','path','sox','to-csv','fs-extra','lodash','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','apply','reject','save','update','destroy','then','end','name','send','index','map','Cdr','rawAttributes','fieldName','type','key','query','filters','intersection','model'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0x6b8f,0x1bc));var _0xf6b8=function(_0x4f0a48,_0x1e47d3){_0x4f0a48=_0x4f0a48-0x0;var _0x52384c=_0x6b8f[_0x4f0a48];return _0x52384c;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xf6b8('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf6b8('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf6b8('0x2'));var Mustache=require(_0xf6b8('0x3'));var util=require('util');var path=require(_0xf6b8('0x4'));var sox=require(_0xf6b8('0x5'));var csv=require(_0xf6b8('0x6'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xf6b8('0x7'));var _=require(_0xf6b8('0x8'));var squel=require(_0xf6b8('0x9'));var crypto=require(_0xf6b8('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf6b8('0x6'));var querystring=require('querystring');var Papa=require(_0xf6b8('0xb'));var Redis=require(_0xf6b8('0xc'));var authService=require(_0xf6b8('0xd'));var qs=require(_0xf6b8('0xe'));var as=require(_0xf6b8('0xf'));var hardwareService=require(_0xf6b8('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xf6b8('0x11'));var licenseUtil=require(_0xf6b8('0x12'));var db=require(_0xf6b8('0x13'))['db'];function respondWithStatusCode(_0x1d96b9,_0x5a6118){_0x5a6118=_0x5a6118||0xcc;return function(_0x4e5235){if(_0x4e5235){return _0x1d96b9[_0xf6b8('0x14')](_0x5a6118);}return _0x1d96b9[_0xf6b8('0x15')](_0x5a6118)['end']();};}function respondWithResult(_0xfcecc9,_0x2db10c){_0x2db10c=_0x2db10c||0xc8;return function(_0x454d8a){if(_0x454d8a){return _0xfcecc9['status'](_0x2db10c)[_0xf6b8('0x16')](_0x454d8a);}};}function respondWithFilteredResult(_0x53d744,_0x410345){return function(_0x1ee041){if(_0x1ee041){var _0x2e1748=typeof _0x410345[_0xf6b8('0x17')]===_0xf6b8('0x18')&&typeof _0x410345['limit']==='undefined';var _0x3bb9ae=_0x1ee041['count'];var _0x3cf63c=_0x2e1748?0x0:_0x410345[_0xf6b8('0x17')];var _0x4a93a8=_0x2e1748?_0x1ee041['count']:_0x410345[_0xf6b8('0x17')]+_0x410345[_0xf6b8('0x19')];var _0x3081db;if(_0x4a93a8>=_0x3bb9ae){_0x4a93a8=_0x3bb9ae;_0x3081db=0xc8;}else{_0x3081db=0xce;}_0x53d744[_0xf6b8('0x15')](_0x3081db);return _0x53d744['set']('Content-Range',_0x3cf63c+'-'+_0x4a93a8+'/'+_0x3bb9ae)['json'](_0x1ee041);}return null;};}function patchUpdates(_0x3298a4){return function(_0x2a8195){try{jsonpatch[_0xf6b8('0x1a')](_0x2a8195,_0x3298a4,!![]);}catch(_0x56b48a){return BPromise[_0xf6b8('0x1b')](_0x56b48a);}return _0x2a8195[_0xf6b8('0x1c')]();};}function saveUpdates(_0x3d2c57,_0x9c660c){return function(_0x5dd616){if(_0x5dd616){return _0x5dd616[_0xf6b8('0x1d')](_0x3d2c57)['then'](function(_0x22c52d){return _0x22c52d;});}return null;};}function removeEntity(_0x2b5bd3,_0x13a451){return function(_0x4127c9){if(_0x4127c9){return _0x4127c9[_0xf6b8('0x1e')]()[_0xf6b8('0x1f')](function(){_0x2b5bd3['status'](0xcc)[_0xf6b8('0x20')]();});}};}function handleEntityNotFound(_0x1ebfea,_0x4815f7){return function(_0x205d6c){if(!_0x205d6c){_0x1ebfea[_0xf6b8('0x14')](0x194);}return _0x205d6c;};}function handleError(_0x324057,_0xd5ebb5){_0xd5ebb5=_0xd5ebb5||0x1f4;return function(_0x3365b8){logger['error'](_0x3365b8['stack']);if(_0x3365b8[_0xf6b8('0x21')]){delete _0x3365b8[_0xf6b8('0x21')];}_0x324057['status'](_0xd5ebb5)[_0xf6b8('0x22')](_0x3365b8);};}exports[_0xf6b8('0x23')]=function(_0x888319,_0x5a7f55){var _0x458935={},_0xc958f4={},_0x511896={'count':0x0,'rows':[]};var _0x309f04=_[_0xf6b8('0x24')](db[_0xf6b8('0x25')][_0xf6b8('0x26')],function(_0x51ffcf){return{'name':_0x51ffcf[_0xf6b8('0x27')],'type':_0x51ffcf[_0xf6b8('0x28')][_0xf6b8('0x29')]};});_0xc958f4['model']=_[_0xf6b8('0x24')](_0x309f04,_0xf6b8('0x21'));_0xc958f4[_0xf6b8('0x2a')]=_['keys'](_0x888319[_0xf6b8('0x2a')]);_0xc958f4[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],_0xc958f4['query']);_0x458935[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0xc958f4[_0xf6b8('0x2d')],qs['fields'](_0x888319['query'][_0xf6b8('0x2f')]));_0x458935[_0xf6b8('0x2e')]=_0x458935[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x458935[_0xf6b8('0x2e')]:_0xc958f4[_0xf6b8('0x2d')];if(!_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x31')](_0xf6b8('0x32'))){_0x458935[_0xf6b8('0x19')]=qs[_0xf6b8('0x19')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x19')]);_0x458935[_0xf6b8('0x17')]=qs[_0xf6b8('0x17')](_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x17')]);}_0x458935[_0xf6b8('0x33')]=qs['sort'](_0x888319['query'][_0xf6b8('0x34')]);_0x458935[_0xf6b8('0x35')]=qs[_0xf6b8('0x2b')](_[_0xf6b8('0x36')](_0x888319[_0xf6b8('0x2a')],_0xc958f4[_0xf6b8('0x2b')]),_0x309f04);if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]){_0x458935[_0xf6b8('0x35')]=_[_0xf6b8('0x38')](_0x458935[_0xf6b8('0x35')],{'$or':_[_0xf6b8('0x24')](_0x309f04,function(_0x4a8c49){if(_0x4a8c49[_0xf6b8('0x28')]!==_0xf6b8('0x39')){var _0x5d26ad={};_0x5d26ad[_0x4a8c49[_0xf6b8('0x21')]]={'$like':'%'+_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x37')]+'%'};return _0x5d26ad;}})});}_0x458935=_[_0xf6b8('0x38')]({},_0x458935,_0x888319[_0xf6b8('0x3a')]);var _0x87a4ee={'where':_0x458935[_0xf6b8('0x35')]};return db[_0xf6b8('0x25')][_0xf6b8('0x3b')](_0x87a4ee)[_0xf6b8('0x1f')](function(_0x15a63b){_0x511896[_0xf6b8('0x3b')]=_0x15a63b;if(_0x888319[_0xf6b8('0x2a')][_0xf6b8('0x3c')]){_0x458935['include']=[{'all':!![]}];}return db['Cdr']['findAll'](_0x458935);})[_0xf6b8('0x1f')](function(_0x2c68f5){_0x511896[_0xf6b8('0x3d')]=_0x2c68f5;return _0x511896;})[_0xf6b8('0x1f')](respondWithFilteredResult(_0x5a7f55,_0x458935))[_0xf6b8('0x3e')](handleError(_0x5a7f55,null));};exports[_0xf6b8('0x3f')]=function(_0x1390dc,_0x48f4cb){var _0x1f5e72={'raw':!![],'where':{'id':_0x1390dc[_0xf6b8('0x40')]['id']}},_0x5086d9={};_0x5086d9[_0xf6b8('0x2d')]=_[_0xf6b8('0x41')](db[_0xf6b8('0x25')][_0xf6b8('0x26')]);_0x5086d9['query']=_[_0xf6b8('0x41')](_0x1390dc[_0xf6b8('0x2a')]);_0x5086d9[_0xf6b8('0x2b')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],_0x5086d9['query']);_0x1f5e72[_0xf6b8('0x2e')]=_[_0xf6b8('0x2c')](_0x5086d9[_0xf6b8('0x2d')],qs['fields'](_0x1390dc['query'][_0xf6b8('0x2f')]));_0x1f5e72[_0xf6b8('0x2e')]=_0x1f5e72[_0xf6b8('0x2e')][_0xf6b8('0x30')]?_0x1f5e72['attributes']:_0x5086d9['model'];if(_0x1390dc['query'][_0xf6b8('0x3c')]){_0x1f5e72['include']=[{'all':!![]}];}_0x1f5e72=_[_0xf6b8('0x38')]({},_0x1f5e72,_0x1390dc[_0xf6b8('0x3a')]);return db[_0xf6b8('0x25')][_0xf6b8('0x42')](_0x1f5e72)[_0xf6b8('0x1f')](handleEntityNotFound(_0x48f4cb,null))[_0xf6b8('0x1f')](respondWithResult(_0x48f4cb,null))[_0xf6b8('0x3e')](handleError(_0x48f4cb,null));};exports[_0xf6b8('0x43')]=function(_0x394a34,_0x597511){return db[_0xf6b8('0x25')]['create'](_0x394a34[_0xf6b8('0x44')],{})[_0xf6b8('0x1f')](respondWithResult(_0x597511,0xc9))[_0xf6b8('0x3e')](handleError(_0x597511,null));};exports[_0xf6b8('0x1d')]=function(_0x1abf17,_0x291845){if(_0x1abf17[_0xf6b8('0x44')]['id']){delete _0x1abf17['body']['id'];}return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x1abf17[_0xf6b8('0x40')]['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x291845,null))['then'](saveUpdates(_0x1abf17[_0xf6b8('0x44')],null))[_0xf6b8('0x1f')](respondWithResult(_0x291845,null))['catch'](handleError(_0x291845,null));};exports[_0xf6b8('0x1e')]=function(_0x143164,_0x392582){return db[_0xf6b8('0x25')][_0xf6b8('0x42')]({'where':{'id':_0x143164['params']['id']}})[_0xf6b8('0x1f')](handleEntityNotFound(_0x392582,null))[_0xf6b8('0x1f')](removeEntity(_0x392582,null))['catch'](handleError(_0x392582,null));};exports['describe']=function(_0x55c392,_0x22c1eb){return db[_0xf6b8('0x25')][_0xf6b8('0x45')]()[_0xf6b8('0x1f')](respondWithResult(_0x22c1eb,null))['catch'](handleError(_0x22c1eb,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index e67e822..736fdac 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 _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x24b716,_0x62a194){var _0x3ce4ac=function(_0x522a84){while(--_0x522a84){_0x24b716['push'](_0x24b716['shift']());}};_0x3ce4ac(++_0x62a194);}(_0x7a54,0x106));var _0x47a5=function(_0xfe5c43,_0x1708b4){_0xfe5c43=_0xfe5c43-0x0;var _0x57cfeb=_0x7a54[_0xfe5c43];return _0x57cfeb;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x7a54=['Cdr','cdr','accountcode','disposition','dst','src','uniqueid','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./cdr.attributes','exports'];(function(_0x412985,_0x1e3b48){var _0x1d10f2=function(_0x2215f3){while(--_0x2215f3){_0x412985['push'](_0x412985['shift']());}};_0x1d10f2(++_0x1e3b48);}(_0x7a54,0x106));var _0x47a5=function(_0xd26d28,_0x1d2e2){_0xd26d28=_0xd26d28-0x0;var _0x412edf=_0x7a54[_0xd26d28];return _0x412edf;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x47a5('0xc')]},{'name':'calldate','fields':['calldate']},{'name':'disposition','fields':[_0x47a5('0xd')]},{'name':_0x47a5('0xe'),'fields':['dst']},{'name':_0x47a5('0xf'),'fields':['src']},{'name':'uniqueid','fields':[_0x47a5('0x10')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 27f3579..66412bd 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 _0xe754=['debug','Cdr,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','Cdr,\x20%s,\x20%s','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','http','request'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0xe754,0x13a));var _0x4e75=function(_0x53a200,_0x2bde43){_0x53a200=_0x53a200-0x0;var _0x4d1124=_0xe754[_0x53a200];return _0x4d1124;};'use strict';var _=require(_0x4e75('0x0'));var util=require(_0x4e75('0x1'));var moment=require('moment');var BPromise=require(_0x4e75('0x2'));var rs=require(_0x4e75('0x3'));var fs=require('fs');var Redis=require(_0x4e75('0x4'));var db=require(_0x4e75('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x4e75('0x6'));var client=jayson[_0x4e75('0x7')][_0x4e75('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bc51d,_0x29f3ab,_0x5736d9){return new BPromise(function(_0x4dea18,_0x5166b3){return client[_0x4e75('0x9')](_0x4bc51d,_0x5736d9)['then'](function(_0x2677b3){logger['info']('Cdr,\x20%s,\x20%s',_0x29f3ab,'request\x20sent');logger[_0x4e75('0xa')](_0x4e75('0xb'),_0x29f3ab,_0x4e75('0xc'),JSON[_0x4e75('0xd')](_0x2677b3));if(_0x2677b3[_0x4e75('0xe')]){if(_0x2677b3[_0x4e75('0xe')]['code']===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x29f3ab,_0x2677b3[_0x4e75('0xe')]['message']);return _0x5166b3(_0x2677b3[_0x4e75('0xe')][_0x4e75('0xf')]);}logger['error'](_0x4e75('0x10'),_0x29f3ab,_0x2677b3[_0x4e75('0xe')][_0x4e75('0xf')]);return _0x4dea18(_0x2677b3['error']['message']);}else{logger[_0x4e75('0x11')](_0x4e75('0x10'),_0x29f3ab,_0x4e75('0xc'));_0x4dea18(_0x2677b3['result'][_0x4e75('0xf')]);}})['catch'](function(_0x32c41a){logger[_0x4e75('0xe')](_0x4e75('0x10'),_0x29f3ab,_0x32c41a);_0x5166b3(_0x32c41a);});});}
\ No newline at end of file
+var _0x8c98=['../../config/utils','rpc','../../config/environment','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x12d773,_0x253abd){var _0x152e37=function(_0x51b1f2){while(--_0x51b1f2){_0x12d773['push'](_0x12d773['shift']());}};_0x152e37(++_0x253abd);}(_0x8c98,0x12e));var _0x88c9=function(_0x3b7ecb,_0x289d8c){_0x3b7ecb=_0x3b7ecb-0x0;var _0x45c8bc=_0x8c98[_0x3b7ecb];return _0x45c8bc;};'use strict';var _=require(_0x88c9('0x0'));var util=require(_0x88c9('0x1'));var moment=require(_0x88c9('0x2'));var BPromise=require('bluebird');var rs=require(_0x88c9('0x3'));var fs=require('fs');var Redis=require(_0x88c9('0x4'));var db=require(_0x88c9('0x5'))['db'];var utils=require(_0x88c9('0x6'));var logger=require('../../config/logger')(_0x88c9('0x7'));var config=require(_0x88c9('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x88c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x22f026,_0x57f9ba,_0x1614fb){return new BPromise(function(_0x646216,_0x3b9959){return client[_0x88c9('0xa')](_0x22f026,_0x1614fb)[_0x88c9('0xb')](function(_0x3c26a5){logger[_0x88c9('0xc')](_0x88c9('0xd'),_0x57f9ba,_0x88c9('0xe'));logger[_0x88c9('0xf')](_0x88c9('0x10'),_0x57f9ba,_0x88c9('0xe'),JSON['stringify'](_0x3c26a5));if(_0x3c26a5[_0x88c9('0x11')]){if(_0x3c26a5[_0x88c9('0x11')][_0x88c9('0x12')]===0x1f4){logger[_0x88c9('0x11')]('Cdr,\x20%s,\x20%s',_0x57f9ba,_0x3c26a5['error']['message']);return _0x3b9959(_0x3c26a5[_0x88c9('0x11')][_0x88c9('0x13')]);}logger['error'](_0x88c9('0xd'),_0x57f9ba,_0x3c26a5[_0x88c9('0x11')][_0x88c9('0x13')]);return _0x646216(_0x3c26a5[_0x88c9('0x11')][_0x88c9('0x13')]);}else{logger[_0x88c9('0xc')](_0x88c9('0xd'),_0x57f9ba,_0x88c9('0xe'));_0x646216(_0x3c26a5[_0x88c9('0x14')]['message']);}})[_0x88c9('0x15')](function(_0x5ef0fe){logger['error']('Cdr,\x20%s,\x20%s',_0x57f9ba,_0x5ef0fe);_0x3b9959(_0x5ef0fe);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index ddf6888..0682690 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 _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x207a02,_0x278c56){var _0xd995c3=function(_0x24e415){while(--_0x24e415){_0x207a02['push'](_0x207a02['shift']());}};_0xd995c3(++_0x278c56);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xa9e0[_0x5c351c];return _0x26f3b3;};'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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('0x12')]=router;
\ No newline at end of file
+var _0xa9e0=['isAuthenticated','create','put','/:id','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get','index','/describe','show','post'];(function(_0x4cce65,_0x40021e){var _0x4d1b45=function(_0x54d290){while(--_0x54d290){_0x4cce65['push'](_0x4cce65['shift']());}};_0x4d1b45(++_0x40021e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'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['describe']);router[_0x0a9e('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xb')]);router[_0x0a9e('0xc')]('/',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0xe')]);router[_0x0a9e('0xf')](_0x0a9e('0x10'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x0a9e('0xd')](),controller[_0x0a9e('0x11')]);module[_0x0a9e('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 48a55f1..c8dd502 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 _0xd9f1=['INTEGER','noop','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x5108ba,_0x54bf77){var _0x3cfa10=function(_0xe68083){while(--_0xe68083){_0x5108ba['push'](_0x5108ba['shift']());}};_0x3cfa10(++_0x54bf77);}(_0xd9f1,0x178));var _0x1d9f=function(_0x27fce9,_0x55a249){_0x27fce9=_0x27fce9-0x0;var _0x28ce11=_0xd9f1[_0x27fce9];return _0x28ce11;};'use strict';var Sequelize=require(_0x1d9f('0x0'));module[_0x1d9f('0x1')]={'priority':{'type':Sequelize[_0x1d9f('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1d9f('0x3')},'appdata':{'type':Sequelize[_0x1d9f('0x4')]()},'description':{'type':Sequelize[_0x1d9f('0x5')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x1d9f('0x6')}};
\ No newline at end of file
+var _0x6ecb=['TEXT','*,*,*,*','sequelize','INTEGER','STRING','noop'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0x6ecb,0x12e));var _0xb6ec=function(_0x484a09,_0x31b700){_0x484a09=_0x484a09-0x0;var _0x16ea35=_0x6ecb[_0x484a09];return _0x16ea35;};'use strict';var Sequelize=require(_0xb6ec('0x0'));module['exports']={'priority':{'type':Sequelize[_0xb6ec('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xb6ec('0x2')],'allowNull':![],'defaultValue':_0xb6ec('0x3')},'appdata':{'type':Sequelize[_0xb6ec('0x4')]()},'description':{'type':Sequelize[_0xb6ec('0x2')]},'interval':{'type':Sequelize[_0xb6ec('0x2')],'defaultValue':_0xb6ec('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index afb0b7c..6e9d8b0 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 _0x4e5c=['merge','options','then','catch','body','eml-format','zip-dir','request-promise','moment','bluebird','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','offset','undefined','limit','count','set','save','update','destroy','error','stack','name','send','params','keys','ChatApplication','query','intersection','model','fields','attributes','length','includeAll','include'];(function(_0x43cc50,_0x1b7bd1){var _0x2fb4b5=function(_0x1f11a0){while(--_0x1f11a0){_0x43cc50['push'](_0x43cc50['shift']());}};_0x2fb4b5(++_0x1b7bd1);}(_0x4e5c,0x149));var _0xc4e5=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x4e5c[_0xc8a931];return _0x28bd27;};'use strict';var emlformat=require(_0xc4e5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc4e5('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc4e5('0x2'));var moment=require(_0xc4e5('0x3'));var BPromise=require(_0xc4e5('0x4'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc4e5('0x5'));var csv=require(_0xc4e5('0x6'));var ejs=require(_0xc4e5('0x7'));var fs=require('fs');var fs_extra=require(_0xc4e5('0x8'));var _=require(_0xc4e5('0x9'));var squel=require(_0xc4e5('0xa'));var crypto=require(_0xc4e5('0xb'));var jsforce=require(_0xc4e5('0xc'));var deskjs=require(_0xc4e5('0xd'));var toCsv=require(_0xc4e5('0x6'));var querystring=require(_0xc4e5('0xe'));var Papa=require(_0xc4e5('0xf'));var Redis=require('ioredis');var authService=require(_0xc4e5('0x10'));var qs=require(_0xc4e5('0x11'));var as=require(_0xc4e5('0x12'));var hardwareService=require(_0xc4e5('0x13'));var logger=require('../../config/logger')(_0xc4e5('0x14'));var utils=require(_0xc4e5('0x15'));var config=require(_0xc4e5('0x16'));var licenseUtil=require(_0xc4e5('0x17'));var db=require(_0xc4e5('0x18'))['db'];function respondWithStatusCode(_0x418b8b,_0x3fa318){_0x3fa318=_0x3fa318||0xcc;return function(_0x54c5a7){if(_0x54c5a7){return _0x418b8b['sendStatus'](_0x3fa318);}return _0x418b8b[_0xc4e5('0x19')](_0x3fa318)['end']();};}function respondWithResult(_0x3f8150,_0x7cd002){_0x7cd002=_0x7cd002||0xc8;return function(_0x303037){if(_0x303037){return _0x3f8150[_0xc4e5('0x19')](_0x7cd002)['json'](_0x303037);}};}function respondWithFilteredResult(_0x1b7d62,_0x528de4){return function(_0x338c37){if(_0x338c37){var _0x3beb59=typeof _0x528de4[_0xc4e5('0x1a')]===_0xc4e5('0x1b')&&typeof _0x528de4[_0xc4e5('0x1c')]===_0xc4e5('0x1b');var _0x228232=_0x338c37[_0xc4e5('0x1d')];var _0x170c0c=_0x3beb59?0x0:_0x528de4['offset'];var _0x252b5a=_0x3beb59?_0x338c37[_0xc4e5('0x1d')]:_0x528de4['offset']+_0x528de4[_0xc4e5('0x1c')];var _0x33eef8;if(_0x252b5a>=_0x228232){_0x252b5a=_0x228232;_0x33eef8=0xc8;}else{_0x33eef8=0xce;}_0x1b7d62['status'](_0x33eef8);return _0x1b7d62[_0xc4e5('0x1e')]('Content-Range',_0x170c0c+'-'+_0x252b5a+'/'+_0x228232)['json'](_0x338c37);}return null;};}function patchUpdates(_0x2f2970){return function(_0x7dbe6d){try{jsonpatch['apply'](_0x7dbe6d,_0x2f2970,!![]);}catch(_0x34f4e8){return BPromise['reject'](_0x34f4e8);}return _0x7dbe6d[_0xc4e5('0x1f')]();};}function saveUpdates(_0x37e869,_0x505078){return function(_0x546949){if(_0x546949){return _0x546949[_0xc4e5('0x20')](_0x37e869)['then'](function(_0x69cb24){return _0x69cb24;});}return null;};}function removeEntity(_0x41467f,_0x4bb973){return function(_0x4ed1ff){if(_0x4ed1ff){return _0x4ed1ff[_0xc4e5('0x21')]()['then'](function(){_0x41467f[_0xc4e5('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x460fd8,_0x234b31){return function(_0x53f7cd){if(!_0x53f7cd){_0x460fd8['sendStatus'](0x194);}return _0x53f7cd;};}function handleError(_0x4b379b,_0x23889c){_0x23889c=_0x23889c||0x1f4;return function(_0x183ec7){logger[_0xc4e5('0x22')](_0x183ec7[_0xc4e5('0x23')]);if(_0x183ec7[_0xc4e5('0x24')]){delete _0x183ec7[_0xc4e5('0x24')];}_0x4b379b[_0xc4e5('0x19')](_0x23889c)[_0xc4e5('0x25')](_0x183ec7);};}exports['show']=function(_0x1cd4d9,_0x2ad4be){var _0x261b88={'raw':!![],'where':{'id':_0x1cd4d9[_0xc4e5('0x26')]['id']}},_0x23383b={};_0x23383b['model']=_[_0xc4e5('0x27')](db[_0xc4e5('0x28')]['rawAttributes']);_0x23383b[_0xc4e5('0x29')]=_['keys'](_0x1cd4d9[_0xc4e5('0x29')]);_0x23383b['filters']=_[_0xc4e5('0x2a')](_0x23383b['model'],_0x23383b[_0xc4e5('0x29')]);_0x261b88['attributes']=_['intersection'](_0x23383b[_0xc4e5('0x2b')],qs[_0xc4e5('0x2c')](_0x1cd4d9[_0xc4e5('0x29')][_0xc4e5('0x2c')]));_0x261b88['attributes']=_0x261b88[_0xc4e5('0x2d')][_0xc4e5('0x2e')]?_0x261b88[_0xc4e5('0x2d')]:_0x23383b[_0xc4e5('0x2b')];if(_0x1cd4d9['query'][_0xc4e5('0x2f')]){_0x261b88[_0xc4e5('0x30')]=[{'all':!![]}];}_0x261b88=_[_0xc4e5('0x31')]({},_0x261b88,_0x1cd4d9[_0xc4e5('0x32')]);return db[_0xc4e5('0x28')]['find'](_0x261b88)[_0xc4e5('0x33')](handleEntityNotFound(_0x2ad4be,null))[_0xc4e5('0x33')](respondWithResult(_0x2ad4be,null))[_0xc4e5('0x34')](handleError(_0x2ad4be,null));};exports['update']=function(_0x44551b,_0x1c78ec){if(_0x44551b[_0xc4e5('0x35')]['id']){delete _0x44551b[_0xc4e5('0x35')]['id'];}return db['ChatApplication']['find']({'where':{'id':_0x44551b[_0xc4e5('0x26')]['id']}})[_0xc4e5('0x33')](handleEntityNotFound(_0x1c78ec,null))[_0xc4e5('0x33')](saveUpdates(_0x44551b[_0xc4e5('0x35')],null))[_0xc4e5('0x33')](respondWithResult(_0x1c78ec,null))[_0xc4e5('0x34')](handleError(_0x1c78ec,null));};exports[_0xc4e5('0x21')]=function(_0x2439ee,_0x20bbce){return db['ChatApplication']['find']({'where':{'id':_0x2439ee[_0xc4e5('0x26')]['id']}})[_0xc4e5('0x33')](handleEntityNotFound(_0x20bbce,null))[_0xc4e5('0x33')](removeEntity(_0x20bbce,null))[_0xc4e5('0x34')](handleError(_0x20bbce,null));};
\ No newline at end of file
+var _0x8ce8=['send','show','params','keys','ChatApplication','rawAttributes','query','filters','intersection','model','attributes','fields','length','includeAll','include','merge','find','catch','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','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','status','end','json','undefined','limit','offset','count','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x8ce8,0xd3));var _0x88ce=function(_0x516ab4,_0x3a8d82){_0x516ab4=_0x516ab4-0x0;var _0x23fff3=_0x8ce8[_0x516ab4];return _0x23fff3;};'use strict';var emlformat=require(_0x88ce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x88ce('0x1'));var jsonpatch=require(_0x88ce('0x2'));var rp=require(_0x88ce('0x3'));var moment=require(_0x88ce('0x4'));var BPromise=require(_0x88ce('0x5'));var Mustache=require(_0x88ce('0x6'));var util=require(_0x88ce('0x7'));var path=require(_0x88ce('0x8'));var sox=require(_0x88ce('0x9'));var csv=require(_0x88ce('0xa'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x88ce('0xb'));var squel=require(_0x88ce('0xc'));var crypto=require(_0x88ce('0xd'));var jsforce=require(_0x88ce('0xe'));var deskjs=require(_0x88ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x88ce('0x10'));var Papa=require('papaparse');var Redis=require(_0x88ce('0x11'));var authService=require(_0x88ce('0x12'));var qs=require(_0x88ce('0x13'));var as=require(_0x88ce('0x14'));var hardwareService=require(_0x88ce('0x15'));var logger=require(_0x88ce('0x16'))(_0x88ce('0x17'));var utils=require(_0x88ce('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x88ce('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3e336a,_0x3b67c8){_0x3b67c8=_0x3b67c8||0xcc;return function(_0x50b088){if(_0x50b088){return _0x3e336a['sendStatus'](_0x3b67c8);}return _0x3e336a[_0x88ce('0x1a')](_0x3b67c8)[_0x88ce('0x1b')]();};}function respondWithResult(_0x12e8af,_0xad722b){_0xad722b=_0xad722b||0xc8;return function(_0x417896){if(_0x417896){return _0x12e8af[_0x88ce('0x1a')](_0xad722b)[_0x88ce('0x1c')](_0x417896);}};}function respondWithFilteredResult(_0x48ebd3,_0x3460e5){return function(_0x5bcd5a){if(_0x5bcd5a){var _0x3da93e=typeof _0x3460e5['offset']===_0x88ce('0x1d')&&typeof _0x3460e5[_0x88ce('0x1e')]===_0x88ce('0x1d');var _0x34b0e4=_0x5bcd5a['count'];var _0x50c9df=_0x3da93e?0x0:_0x3460e5[_0x88ce('0x1f')];var _0x65fa81=_0x3da93e?_0x5bcd5a[_0x88ce('0x20')]:_0x3460e5[_0x88ce('0x1f')]+_0x3460e5[_0x88ce('0x1e')];var _0x37f31;if(_0x65fa81>=_0x34b0e4){_0x65fa81=_0x34b0e4;_0x37f31=0xc8;}else{_0x37f31=0xce;}_0x48ebd3[_0x88ce('0x1a')](_0x37f31);return _0x48ebd3[_0x88ce('0x21')](_0x88ce('0x22'),_0x50c9df+'-'+_0x65fa81+'/'+_0x34b0e4)[_0x88ce('0x1c')](_0x5bcd5a);}return null;};}function patchUpdates(_0x106e59){return function(_0x7de0ac){try{jsonpatch[_0x88ce('0x23')](_0x7de0ac,_0x106e59,!![]);}catch(_0x397ee5){return BPromise[_0x88ce('0x24')](_0x397ee5);}return _0x7de0ac[_0x88ce('0x25')]();};}function saveUpdates(_0x4daac4,_0x356d7d){return function(_0x34fbcc){if(_0x34fbcc){return _0x34fbcc[_0x88ce('0x26')](_0x4daac4)[_0x88ce('0x27')](function(_0x33711e){return _0x33711e;});}return null;};}function removeEntity(_0x4e45eb,_0x4c9133){return function(_0x4dcdc4){if(_0x4dcdc4){return _0x4dcdc4[_0x88ce('0x28')]()[_0x88ce('0x27')](function(){_0x4e45eb[_0x88ce('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e35db,_0x1f0adc){return function(_0x3383fa){if(!_0x3383fa){_0x4e35db[_0x88ce('0x29')](0x194);}return _0x3383fa;};}function handleError(_0x357247,_0x4b30db){_0x4b30db=_0x4b30db||0x1f4;return function(_0x1efcea){logger[_0x88ce('0x2a')](_0x1efcea[_0x88ce('0x2b')]);if(_0x1efcea[_0x88ce('0x2c')]){delete _0x1efcea[_0x88ce('0x2c')];}_0x357247[_0x88ce('0x1a')](_0x4b30db)[_0x88ce('0x2d')](_0x1efcea);};}exports[_0x88ce('0x2e')]=function(_0x29698a,_0x12b9a1){var _0x1814d1={'raw':!![],'where':{'id':_0x29698a[_0x88ce('0x2f')]['id']}},_0x47bbff={};_0x47bbff['model']=_[_0x88ce('0x30')](db[_0x88ce('0x31')][_0x88ce('0x32')]);_0x47bbff[_0x88ce('0x33')]=_['keys'](_0x29698a[_0x88ce('0x33')]);_0x47bbff[_0x88ce('0x34')]=_[_0x88ce('0x35')](_0x47bbff[_0x88ce('0x36')],_0x47bbff[_0x88ce('0x33')]);_0x1814d1[_0x88ce('0x37')]=_[_0x88ce('0x35')](_0x47bbff['model'],qs[_0x88ce('0x38')](_0x29698a[_0x88ce('0x33')]['fields']));_0x1814d1[_0x88ce('0x37')]=_0x1814d1[_0x88ce('0x37')][_0x88ce('0x39')]?_0x1814d1[_0x88ce('0x37')]:_0x47bbff[_0x88ce('0x36')];if(_0x29698a[_0x88ce('0x33')][_0x88ce('0x3a')]){_0x1814d1[_0x88ce('0x3b')]=[{'all':!![]}];}_0x1814d1=_[_0x88ce('0x3c')]({},_0x1814d1,_0x29698a['options']);return db[_0x88ce('0x31')][_0x88ce('0x3d')](_0x1814d1)[_0x88ce('0x27')](handleEntityNotFound(_0x12b9a1,null))['then'](respondWithResult(_0x12b9a1,null))[_0x88ce('0x3e')](handleError(_0x12b9a1,null));};exports[_0x88ce('0x26')]=function(_0x545a50,_0x4910f0){if(_0x545a50[_0x88ce('0x3f')]['id']){delete _0x545a50[_0x88ce('0x3f')]['id'];}return db[_0x88ce('0x31')][_0x88ce('0x3d')]({'where':{'id':_0x545a50[_0x88ce('0x2f')]['id']}})[_0x88ce('0x27')](handleEntityNotFound(_0x4910f0,null))['then'](saveUpdates(_0x545a50[_0x88ce('0x3f')],null))[_0x88ce('0x27')](respondWithResult(_0x4910f0,null))['catch'](handleError(_0x4910f0,null));};exports[_0x88ce('0x28')]=function(_0xe0ddfa,_0x55e1c4){return db[_0x88ce('0x31')]['find']({'where':{'id':_0xe0ddfa[_0x88ce('0x2f')]['id']}})[_0x88ce('0x27')](handleEntityNotFound(_0x55e1c4,null))[_0x88ce('0x27')](removeEntity(_0x55e1c4,null))[_0x88ce('0x3e')](handleError(_0x55e1c4,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 7cc4b66..7f64f9c 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 _0x0587=['api','moment','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports','define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x306f3e,_0x5e3f27){var _0x37f45a=function(_0x961c58){while(--_0x961c58){_0x306f3e['push'](_0x306f3e['shift']());}};_0x37f45a(++_0x5e3f27);}(_0x0587,0x11d));var _0x7058=function(_0x30c649,_0x2ebbac){_0x30c649=_0x30c649-0x0;var _0x3edfb9=_0x0587[_0x30c649];return _0x3edfb9;};'use strict';var _=require(_0x7058('0x0'));var util=require(_0x7058('0x1'));var logger=require(_0x7058('0x2'))(_0x7058('0x3'));var moment=require(_0x7058('0x4'));var BPromise=require(_0x7058('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7058('0x6'));var rimraf=require(_0x7058('0x7'));var config=require(_0x7058('0x8'));var attributes=require(_0x7058('0x9'));module[_0x7058('0xa')]=function(_0x1acc16,_0x2c0060){return _0x1acc16[_0x7058('0xb')](_0x7058('0xc'),attributes,{'tableName':_0x7058('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7058('0xe'),'collate':_0x7058('0xf')});};
\ No newline at end of file
+var _0x5bfe=['exports','chat_applications','utf8mb4','util','../../config/logger','bluebird','path','rimraf','./chatApplication.attributes'];(function(_0x32703c,_0x17c57c){var _0x50489d=function(_0x4a8b2a){while(--_0x4a8b2a){_0x32703c['push'](_0x32703c['shift']());}};_0x50489d(++_0x17c57c);}(_0x5bfe,0x9c));var _0xe5bf=function(_0x18a5ba,_0x532863){_0x18a5ba=_0x18a5ba-0x0;var _0x287a75=_0x5bfe[_0x18a5ba];return _0x287a75;};'use strict';var _=require('lodash');var util=require(_0xe5bf('0x0'));var logger=require(_0xe5bf('0x1'))('api');var moment=require('moment');var BPromise=require(_0xe5bf('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5bf('0x3'));var rimraf=require(_0xe5bf('0x4'));var config=require('../../config/environment');var attributes=require(_0xe5bf('0x5'));module[_0xe5bf('0x6')]=function(_0x2b48c4,_0x3d4aa9){return _0x2b48c4['define']('ChatApplication',attributes,{'tableName':_0xe5bf('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe5bf('0x8'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 1fac610..7618cc1 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 _0x19bd=['error','code','ChatApplication,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','http','request','then','info','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2a5a1a,_0x1063d0){var _0x1a76f4=function(_0x49dfdc){while(--_0x49dfdc){_0x2a5a1a['push'](_0x2a5a1a['shift']());}};_0x1a76f4(++_0x1063d0);}(_0x19bd,0xd5));var _0xd19b=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x19bd[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xd19b('0x0'));var util=require(_0xd19b('0x1'));var moment=require(_0xd19b('0x2'));var BPromise=require(_0xd19b('0x3'));var rs=require(_0xd19b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd19b('0x5'))['db'];var utils=require(_0xd19b('0x6'));var logger=require('../../config/logger')(_0xd19b('0x7'));var config=require(_0xd19b('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xd19b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6604d4,_0x597c7d,_0x330399){return new BPromise(function(_0x1541e0,_0x296286){return client[_0xd19b('0xa')](_0x6604d4,_0x330399)[_0xd19b('0xb')](function(_0x294e3b){logger[_0xd19b('0xc')]('ChatApplication,\x20%s,\x20%s',_0x597c7d,_0xd19b('0xd'));logger[_0xd19b('0xe')](_0xd19b('0xf'),_0x597c7d,'request\x20sent',JSON[_0xd19b('0x10')](_0x294e3b));if(_0x294e3b[_0xd19b('0x11')]){if(_0x294e3b[_0xd19b('0x11')][_0xd19b('0x12')]===0x1f4){logger[_0xd19b('0x11')](_0xd19b('0x13'),_0x597c7d,_0x294e3b['error']['message']);return _0x296286(_0x294e3b['error'][_0xd19b('0x14')]);}logger[_0xd19b('0x11')](_0xd19b('0x13'),_0x597c7d,_0x294e3b['error'][_0xd19b('0x14')]);return _0x1541e0(_0x294e3b[_0xd19b('0x11')][_0xd19b('0x14')]);}else{logger[_0xd19b('0xc')]('ChatApplication,\x20%s,\x20%s',_0x597c7d,_0xd19b('0xd'));_0x1541e0(_0x294e3b[_0xd19b('0x15')]['message']);}})[_0xd19b('0x16')](function(_0xc33bf9){logger[_0xd19b('0x11')](_0xd19b('0x13'),_0x597c7d,_0xc33bf9);_0x296286(_0xc33bf9);});});}
\ No newline at end of file
+var _0xb56d=['message','request\x20sent','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','ChatApplication,\x20%s,\x20%s','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x299d09,_0x1fdf9d){var _0x3754cb=function(_0x2b211b){while(--_0x2b211b){_0x299d09['push'](_0x299d09['shift']());}};_0x3754cb(++_0x1fdf9d);}(_0xb56d,0x1e7));var _0xdb56=function(_0x26dea1,_0x1d68ba){_0x26dea1=_0x26dea1-0x0;var _0x3da162=_0xb56d[_0x26dea1];return _0x3da162;};'use strict';var _=require('lodash');var util=require(_0xdb56('0x0'));var moment=require(_0xdb56('0x1'));var BPromise=require(_0xdb56('0x2'));var rs=require(_0xdb56('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb56('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xdb56('0x5'))('rpc');var config=require(_0xdb56('0x6'));var jayson=require(_0xdb56('0x7'));var client=jayson['client'][_0xdb56('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d9e88,_0xe913de,_0x2c9987){return new BPromise(function(_0x1b2bec,_0x12f1a6){return client['request'](_0x5d9e88,_0x2c9987)[_0xdb56('0x9')](function(_0x3e6c19){logger[_0xdb56('0xa')](_0xdb56('0xb'),_0xe913de,'request\x20sent');logger[_0xdb56('0xc')](_0xdb56('0xd'),_0xe913de,'request\x20sent',JSON[_0xdb56('0xe')](_0x3e6c19));if(_0x3e6c19[_0xdb56('0xf')]){if(_0x3e6c19['error'][_0xdb56('0x10')]===0x1f4){logger['error'](_0xdb56('0xb'),_0xe913de,_0x3e6c19[_0xdb56('0xf')][_0xdb56('0x11')]);return _0x12f1a6(_0x3e6c19[_0xdb56('0xf')][_0xdb56('0x11')]);}logger['error']('ChatApplication,\x20%s,\x20%s',_0xe913de,_0x3e6c19[_0xdb56('0xf')][_0xdb56('0x11')]);return _0x1b2bec(_0x3e6c19['error'][_0xdb56('0x11')]);}else{logger[_0xdb56('0xa')](_0xdb56('0xb'),_0xe913de,_0xdb56('0x12'));_0x1b2bec(_0x3e6c19[_0xdb56('0x13')]['message']);}})[_0xdb56('0x14')](function(_0x10e2b3){logger[_0xdb56('0xf')](_0xdb56('0xb'),_0xe913de,_0x10e2b3);_0x12f1a6(_0x10e2b3);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index ae07cfe..d93b4fd 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 _0x710a=['util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','/:id','update','delete','destroy','exports'];(function(_0x159890,_0x5ac7b0){var _0x214c47=function(_0xa3e181){while(--_0xa3e181){_0x159890['push'](_0x159890['shift']());}};_0x214c47(++_0x5ac7b0);}(_0x710a,0xd2));var _0xa710=function(_0x50b09c,_0xe560e6){_0x50b09c=_0x50b09c-0x0;var _0xb3b724=_0x710a[_0x50b09c];return _0xb3b724;};'use strict';var multer=require('multer');var util=require(_0xa710('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa710('0x1'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xa710('0x2'));var interaction=require(_0xa710('0x3'));var config=require(_0xa710('0x4'));var controller=require(_0xa710('0x5'));router[_0xa710('0x6')]('/:id',auth[_0xa710('0x7')](),controller[_0xa710('0x8')]);router[_0xa710('0x9')](_0xa710('0xa'),auth[_0xa710('0x7')](),controller[_0xa710('0xb')]);router[_0xa710('0xc')](_0xa710('0xa'),auth['isAuthenticated'](),controller[_0xa710('0xd')]);module[_0xa710('0xe')]=router;
\ No newline at end of file
+var _0x8b6b=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','util'];(function(_0x5bf06e,_0x24abf1){var _0x374a73=function(_0x256e8f){while(--_0x256e8f){_0x5bf06e['push'](_0x5bf06e['shift']());}};_0x374a73(++_0x24abf1);}(_0x8b6b,0x149));var _0xb8b6=function(_0x42323a,_0x432571){_0x42323a=_0x42323a-0x0;var _0x1d253c=_0x8b6b[_0x42323a];return _0x1d253c;};'use strict';var multer=require('multer');var util=require(_0xb8b6('0x0'));var path=require(_0xb8b6('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb8b6('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0xb8b6('0x3'));var interaction=require(_0xb8b6('0x4'));var config=require(_0xb8b6('0x5'));var controller=require(_0xb8b6('0x6'));router[_0xb8b6('0x7')](_0xb8b6('0x8'),auth[_0xb8b6('0x9')](),controller[_0xb8b6('0xa')]);router[_0xb8b6('0xb')](_0xb8b6('0x8'),auth[_0xb8b6('0x9')](),controller[_0xb8b6('0xc')]);router[_0xb8b6('0xd')](_0xb8b6('0x8'),auth['isAuthenticated'](),controller[_0xb8b6('0xe')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 7126a1c..7538c05 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 _0xe2fe=['sequelize','STRING'];(function(_0x143a91,_0x235332){var _0x1906f5=function(_0xd27eeb){while(--_0xd27eeb){_0x143a91['push'](_0x143a91['shift']());}};_0x1906f5(++_0x235332);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0xee2f('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xee2f('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xe706=['STRING','sequelize','exports'];(function(_0xd15876,_0x4690d9){var _0x267815=function(_0x3ee56a){while(--_0x3ee56a){_0xd15876['push'](_0xd15876['shift']());}};_0x267815(++_0x4690d9);}(_0xe706,0x1ab));var _0x6e70=function(_0x3eb450,_0x592b0a){_0x3eb450=_0x3eb450-0x0;var _0x2c4cfd=_0xe706[_0x3eb450];return _0x2c4cfd;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x6e70('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js
index a92d7db..8c589d1 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 _0xdad8=['../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','redis','socket.io-emitter','./chatGroup.socket','register','status','end','offset','undefined','limit','count','set','Content-Range','reject','save','update','destroy','sendStatus','error','name','map','ChatGroup','type','key','query','intersection','fields','attributes','length','model','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','then','includeAll','findAll','rows','catch','show','params','rawAttributes','keys','include','find','create','body','describe','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','pick','removeMembers','addMessage','ChatInternalMessage','$gte','format','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','ejs','fs-extra','lodash','desk.js','to-csv','papaparse','ioredis','../../components/auth/service'];(function(_0x565a23,_0x1f7b1c){var _0x3e5d70=function(_0x1b3f97){while(--_0x1b3f97){_0x565a23['push'](_0x565a23['shift']());}};_0x3e5d70(++_0x1f7b1c);}(_0xdad8,0xfb));var _0x8dad=function(_0x849edd,_0x19b879){_0x849edd=_0x849edd-0x0;var _0x4f68b7=_0xdad8[_0x849edd];return _0x4f68b7;};'use strict';var emlformat=require(_0x8dad('0x0'));var rimraf=require(_0x8dad('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8dad('0x2'));var rp=require(_0x8dad('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8dad('0x4'));var util=require(_0x8dad('0x5'));var path=require(_0x8dad('0x6'));var sox=require(_0x8dad('0x7'));var csv=require('to-csv');var ejs=require(_0x8dad('0x8'));var fs=require('fs');var fs_extra=require(_0x8dad('0x9'));var _=require(_0x8dad('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8dad('0xb'));var toCsv=require(_0x8dad('0xc'));var querystring=require('querystring');var Papa=require(_0x8dad('0xd'));var Redis=require(_0x8dad('0xe'));var authService=require(_0x8dad('0xf'));var qs=require(_0x8dad('0x10'));var as=require(_0x8dad('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8dad('0x12'));var utils=require(_0x8dad('0x13'));var config=require(_0x8dad('0x14'));var licenseUtil=require(_0x8dad('0x15'));var db=require('../../mysqldb')['db'];config[_0x8dad('0x16')]=_['defaults'](config[_0x8dad('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x8dad('0x17'))(new Redis(config[_0x8dad('0x16')]));require(_0x8dad('0x18'))[_0x8dad('0x19')](socket);function respondWithStatusCode(_0x2d0024,_0x2366c1){_0x2366c1=_0x2366c1||0xcc;return function(_0xa570e9){if(_0xa570e9){return _0x2d0024['sendStatus'](_0x2366c1);}return _0x2d0024[_0x8dad('0x1a')](_0x2366c1)[_0x8dad('0x1b')]();};}function respondWithResult(_0x463843,_0x5c579a){_0x5c579a=_0x5c579a||0xc8;return function(_0x317904){if(_0x317904){return _0x463843[_0x8dad('0x1a')](_0x5c579a)['json'](_0x317904);}};}function respondWithFilteredResult(_0x176295,_0x2d8513){return function(_0x347361){if(_0x347361){var _0x7e487c=typeof _0x2d8513[_0x8dad('0x1c')]===_0x8dad('0x1d')&&typeof _0x2d8513[_0x8dad('0x1e')]===_0x8dad('0x1d');var _0x258cc1=_0x347361[_0x8dad('0x1f')];var _0xecf2ea=_0x7e487c?0x0:_0x2d8513['offset'];var _0x454b76=_0x7e487c?_0x347361['count']:_0x2d8513[_0x8dad('0x1c')]+_0x2d8513[_0x8dad('0x1e')];var _0x4bce8c;if(_0x454b76>=_0x258cc1){_0x454b76=_0x258cc1;_0x4bce8c=0xc8;}else{_0x4bce8c=0xce;}_0x176295[_0x8dad('0x1a')](_0x4bce8c);return _0x176295[_0x8dad('0x20')](_0x8dad('0x21'),_0xecf2ea+'-'+_0x454b76+'/'+_0x258cc1)['json'](_0x347361);}return null;};}function patchUpdates(_0x4ad232){return function(_0x1e8fbf){try{jsonpatch['apply'](_0x1e8fbf,_0x4ad232,!![]);}catch(_0x3171be){return BPromise[_0x8dad('0x22')](_0x3171be);}return _0x1e8fbf[_0x8dad('0x23')]();};}function saveUpdates(_0x141aef,_0x363ee9){return function(_0x15d3e8){if(_0x15d3e8){return _0x15d3e8[_0x8dad('0x24')](_0x141aef)['then'](function(_0x5baf3d){return _0x5baf3d;});}return null;};}function removeEntity(_0x5104c2,_0x4c6709){return function(_0xb3c015){if(_0xb3c015){return _0xb3c015[_0x8dad('0x25')]()['then'](function(){_0x5104c2['status'](0xcc)[_0x8dad('0x1b')]();});}};}function handleEntityNotFound(_0x163eaa,_0x3bfef2){return function(_0x5f03e1){if(!_0x5f03e1){_0x163eaa[_0x8dad('0x26')](0x194);}return _0x5f03e1;};}function handleError(_0x54b0b9,_0x23982e){_0x23982e=_0x23982e||0x1f4;return function(_0x5759d8){logger[_0x8dad('0x27')](_0x5759d8['stack']);if(_0x5759d8[_0x8dad('0x28')]){delete _0x5759d8['name'];}_0x54b0b9[_0x8dad('0x1a')](_0x23982e)['send'](_0x5759d8);};}exports['index']=function(_0x497842,_0x42bc45){var _0x321dee={},_0x211ed1={},_0x54f8e1={'count':0x0,'rows':[]};var _0x2b2a65=_[_0x8dad('0x29')](db[_0x8dad('0x2a')]['rawAttributes'],function(_0x1f98ca){return{'name':_0x1f98ca['fieldName'],'type':_0x1f98ca[_0x8dad('0x2b')][_0x8dad('0x2c')]};});_0x211ed1['model']=_['map'](_0x2b2a65,_0x8dad('0x28'));_0x211ed1[_0x8dad('0x2d')]=_['keys'](_0x497842[_0x8dad('0x2d')]);_0x211ed1['filters']=_[_0x8dad('0x2e')](_0x211ed1['model'],_0x211ed1[_0x8dad('0x2d')]);_0x321dee['attributes']=_['intersection'](_0x211ed1['model'],qs[_0x8dad('0x2f')](_0x497842['query'][_0x8dad('0x2f')]));_0x321dee['attributes']=_0x321dee[_0x8dad('0x30')][_0x8dad('0x31')]?_0x321dee['attributes']:_0x211ed1[_0x8dad('0x32')];if(!_0x497842[_0x8dad('0x2d')][_0x8dad('0x33')](_0x8dad('0x34'))){_0x321dee[_0x8dad('0x1e')]=qs[_0x8dad('0x1e')](_0x497842['query'][_0x8dad('0x1e')]);_0x321dee[_0x8dad('0x1c')]=qs['offset'](_0x497842[_0x8dad('0x2d')]['offset']);}_0x321dee[_0x8dad('0x35')]=qs[_0x8dad('0x36')](_0x497842[_0x8dad('0x2d')][_0x8dad('0x36')]);_0x321dee[_0x8dad('0x37')]=qs[_0x8dad('0x38')](_['pick'](_0x497842[_0x8dad('0x2d')],_0x211ed1[_0x8dad('0x38')]),_0x2b2a65);if(_0x497842['query'][_0x8dad('0x39')]){_0x321dee[_0x8dad('0x37')]=_[_0x8dad('0x3a')](_0x321dee[_0x8dad('0x37')],{'$or':_[_0x8dad('0x29')](_0x2b2a65,function(_0x376fcc){if(_0x376fcc[_0x8dad('0x2b')]!==_0x8dad('0x3b')){var _0x48734c={};_0x48734c[_0x376fcc[_0x8dad('0x28')]]={'$like':'%'+_0x497842[_0x8dad('0x2d')][_0x8dad('0x39')]+'%'};return _0x48734c;}})});}_0x321dee=_[_0x8dad('0x3a')]({},_0x321dee,_0x497842[_0x8dad('0x3c')]);var _0x4671e1={'where':_0x321dee[_0x8dad('0x37')]};return db[_0x8dad('0x2a')][_0x8dad('0x1f')](_0x4671e1)[_0x8dad('0x3d')](function(_0xc9311e){_0x54f8e1[_0x8dad('0x1f')]=_0xc9311e;if(_0x497842[_0x8dad('0x2d')][_0x8dad('0x3e')]){_0x321dee['include']=[{'all':!![]}];}return db[_0x8dad('0x2a')][_0x8dad('0x3f')](_0x321dee);})[_0x8dad('0x3d')](function(_0x171ff6){_0x54f8e1[_0x8dad('0x40')]=_0x171ff6;return _0x54f8e1;})['then'](respondWithFilteredResult(_0x42bc45,_0x321dee))[_0x8dad('0x41')](handleError(_0x42bc45,null));};exports[_0x8dad('0x42')]=function(_0x8ce3a3,_0x147b06){var _0x1e6b18={'raw':!![],'where':{'id':_0x8ce3a3[_0x8dad('0x43')]['id']}},_0x9e763={};_0x9e763[_0x8dad('0x32')]=_['keys'](db[_0x8dad('0x2a')][_0x8dad('0x44')]);_0x9e763[_0x8dad('0x2d')]=_[_0x8dad('0x45')](_0x8ce3a3[_0x8dad('0x2d')]);_0x9e763['filters']=_[_0x8dad('0x2e')](_0x9e763['model'],_0x9e763[_0x8dad('0x2d')]);_0x1e6b18[_0x8dad('0x30')]=_[_0x8dad('0x2e')](_0x9e763[_0x8dad('0x32')],qs[_0x8dad('0x2f')](_0x8ce3a3[_0x8dad('0x2d')][_0x8dad('0x2f')]));_0x1e6b18[_0x8dad('0x30')]=_0x1e6b18[_0x8dad('0x30')][_0x8dad('0x31')]?_0x1e6b18['attributes']:_0x9e763['model'];if(_0x8ce3a3[_0x8dad('0x2d')][_0x8dad('0x3e')]){_0x1e6b18[_0x8dad('0x46')]=[{'all':!![]}];}_0x1e6b18=_['merge']({},_0x1e6b18,_0x8ce3a3[_0x8dad('0x3c')]);return db[_0x8dad('0x2a')][_0x8dad('0x47')](_0x1e6b18)[_0x8dad('0x3d')](handleEntityNotFound(_0x147b06,null))['then'](respondWithResult(_0x147b06,null))[_0x8dad('0x41')](handleError(_0x147b06,null));};exports[_0x8dad('0x48')]=function(_0x2d8859,_0x441bc8){return db[_0x8dad('0x2a')][_0x8dad('0x48')](_0x2d8859[_0x8dad('0x49')],{})[_0x8dad('0x3d')](respondWithResult(_0x441bc8,0xc9))['catch'](handleError(_0x441bc8,null));};exports[_0x8dad('0x24')]=function(_0x3e99a2,_0x44346a){if(_0x3e99a2[_0x8dad('0x49')]['id']){delete _0x3e99a2[_0x8dad('0x49')]['id'];}return db[_0x8dad('0x2a')]['find']({'where':{'id':_0x3e99a2[_0x8dad('0x43')]['id']}})[_0x8dad('0x3d')](handleEntityNotFound(_0x44346a,null))['then'](saveUpdates(_0x3e99a2['body'],null))['then'](respondWithResult(_0x44346a,null))[_0x8dad('0x41')](handleError(_0x44346a,null));};exports[_0x8dad('0x25')]=function(_0x49a594,_0x40c32e){return db[_0x8dad('0x2a')]['find']({'where':{'id':_0x49a594[_0x8dad('0x43')]['id']}})['then'](handleEntityNotFound(_0x40c32e,null))[_0x8dad('0x3d')](removeEntity(_0x40c32e,null))[_0x8dad('0x41')](handleError(_0x40c32e,null));};exports[_0x8dad('0x4a')]=function(_0x1fe81e,_0x10d765){return db[_0x8dad('0x2a')][_0x8dad('0x4a')]()['then'](respondWithResult(_0x10d765,null))[_0x8dad('0x41')](handleError(_0x10d765,null));};exports['getUnread']=function(_0xd77bef,_0x58839a,_0x8ac6bf){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0xd77bef['params']['id'],'ToId':_0xd77bef[_0x8dad('0x4b')]['id'],'read':![]}})['then'](function(_0xe38d10){return{'id':_[_0x8dad('0x4c')](_0xd77bef['params']['id']),'count':_0xe38d10};})['then'](respondWithResult(_0x58839a,null))['catch'](handleError(_0x58839a,null));};exports['addMembers']=function(_0x2ec9b6,_0x912789,_0x39f520){return db['ChatGroup'][_0x8dad('0x47')]({'where':{'id':_0x2ec9b6[_0x8dad('0x43')]['id']}})[_0x8dad('0x3d')](handleEntityNotFound(_0x912789,null))[_0x8dad('0x3d')](function(_0x23e901){if(_0x23e901){return _0x23e901[_0x8dad('0x4d')](_0x2ec9b6['body'][_0x8dad('0x4e')],_[_0x8dad('0x4f')](_0x2ec9b6['body'],['ids','id'])||{});}})[_0x8dad('0x3d')](respondWithResult(_0x912789,null))[_0x8dad('0x41')](handleError(_0x912789,null));};exports[_0x8dad('0x50')]=function(_0x29cfd2,_0x3e2b78,_0x1c0288){var _0xb197e={};var _0x100a40={};var _0x94f6f9;var _0x3c6821;return db['ChatGroup'][_0x8dad('0x51')]({'where':{'id':_0x29cfd2[_0x8dad('0x43')]['id']}})[_0x8dad('0x3d')](handleEntityNotFound(_0x3e2b78,null))[_0x8dad('0x3d')](function(_0x2b7753){if(_0x2b7753){_0x94f6f9=_0x2b7753;_0x100a40[_0x8dad('0x32')]=_['keys'](db[_0x8dad('0x52')][_0x8dad('0x44')]);_0x100a40[_0x8dad('0x2d')]=_['keys'](_0x29cfd2[_0x8dad('0x2d')]);_0x100a40[_0x8dad('0x38')]=_[_0x8dad('0x2e')](_0x100a40[_0x8dad('0x32')],_0x100a40[_0x8dad('0x2d')]);_0xb197e[_0x8dad('0x30')]=_['intersection'](_0x100a40[_0x8dad('0x32')],qs[_0x8dad('0x2f')](_0x29cfd2[_0x8dad('0x2d')][_0x8dad('0x2f')]));_0xb197e[_0x8dad('0x30')]=_0xb197e[_0x8dad('0x30')][_0x8dad('0x31')]?_0xb197e['attributes']:_0x100a40[_0x8dad('0x32')];_0xb197e[_0x8dad('0x35')]=qs[_0x8dad('0x36')](_0x29cfd2[_0x8dad('0x2d')][_0x8dad('0x36')]);_0xb197e[_0x8dad('0x37')]=qs[_0x8dad('0x38')](_[_0x8dad('0x53')](_0x29cfd2['query'],_0x100a40[_0x8dad('0x38')]));if(_0x29cfd2[_0x8dad('0x2d')][_0x8dad('0x39')]){_0xb197e[_0x8dad('0x37')]=_[_0x8dad('0x3a')](_0xb197e['where'],{'$or':_[_0x8dad('0x29')](_0xb197e['attributes'],function(_0x1d97a9){var _0x309771={};_0x309771[_0x1d97a9]={'$like':'%'+_0x29cfd2[_0x8dad('0x2d')][_0x8dad('0x39')]+'%'};return _0x309771;})});}_0xb197e=_['merge']({},_0xb197e,_0x29cfd2[_0x8dad('0x3c')]);return _0x94f6f9[_0x8dad('0x50')](_0xb197e);}})[_0x8dad('0x3d')](function(_0x181e5e){if(_0x181e5e){_0x3c6821=_0x181e5e[_0x8dad('0x31')];if(!_0x29cfd2[_0x8dad('0x2d')]['hasOwnProperty'](_0x8dad('0x34'))){_0xb197e[_0x8dad('0x1e')]=qs[_0x8dad('0x1e')](_0x29cfd2['query'][_0x8dad('0x1e')]);_0xb197e[_0x8dad('0x1c')]=qs[_0x8dad('0x1c')](_0x29cfd2[_0x8dad('0x2d')]['offset']);}return _0x94f6f9[_0x8dad('0x50')](_0xb197e);}})['then'](function(_0x2ce1cd){if(_0x2ce1cd){return _0x2ce1cd?{'count':_0x3c6821,'rows':_0x2ce1cd}:null;}})['then'](respondWithResult(_0x3e2b78,null))[_0x8dad('0x41')](handleError(_0x3e2b78,null));};exports[_0x8dad('0x54')]=function(_0x369f92,_0x127531,_0x2e6662){return db['ChatGroup'][_0x8dad('0x47')]({'where':{'id':_0x369f92[_0x8dad('0x43')]['id']}})['then'](handleEntityNotFound(_0x127531,null))['then'](function(_0x550eea){if(_0x550eea){return _0x550eea['removeMembers'](_0x369f92['query']['ids']);}})[_0x8dad('0x3d')](respondWithStatusCode(_0x127531,null))[_0x8dad('0x41')](handleError(_0x127531,null));};exports[_0x8dad('0x55')]=function(_0x556982,_0x59278c,_0x215f38){if(_0x556982['body']['id']){delete _0x556982[_0x8dad('0x49')]['id'];}return db['ChatGroup'][_0x8dad('0x47')]({'where':{'id':_0x556982[_0x8dad('0x43')]['id']}})[_0x8dad('0x3d')](handleEntityNotFound(_0x59278c,null))[_0x8dad('0x3d')](function(_0x742877){if(_0x742877){_0x556982[_0x8dad('0x49')]['ChatGroupId']=_0x742877['id'];return db[_0x8dad('0x56')][_0x8dad('0x48')](_0x556982['body']);}})[_0x8dad('0x3d')](respondWithResult(_0x59278c,null))[_0x8dad('0x41')](handleError(_0x59278c,null));};exports['getMessages']=function(_0x10e9ba,_0x43685c,_0x1fdf3e){var _0x108b9f={};var _0x5932ec={};var _0x4f8520;var _0x2da4f3;return db[_0x8dad('0x2a')][_0x8dad('0x51')]({'where':{'id':_0x10e9ba['params']['id']}})[_0x8dad('0x3d')](handleEntityNotFound(_0x43685c,null))['then'](function(_0x3f4e02){if(_0x3f4e02){_0x4f8520=_0x3f4e02;_0x5932ec[_0x8dad('0x32')]=_[_0x8dad('0x45')](db[_0x8dad('0x56')]['rawAttributes']);_0x5932ec[_0x8dad('0x2d')]=_['keys'](_0x10e9ba[_0x8dad('0x2d')]);_0x5932ec['filters']=_[_0x8dad('0x2e')](_0x5932ec['model'],_0x5932ec[_0x8dad('0x2d')]);_0x108b9f[_0x8dad('0x30')]=_['intersection'](_0x5932ec[_0x8dad('0x32')],qs[_0x8dad('0x2f')](_0x10e9ba['query'][_0x8dad('0x2f')]));_0x108b9f[_0x8dad('0x30')]=_0x108b9f['attributes'][_0x8dad('0x31')]?_0x108b9f[_0x8dad('0x30')]:_0x5932ec[_0x8dad('0x32')];_0x108b9f[_0x8dad('0x35')]=qs['sort'](_0x10e9ba[_0x8dad('0x2d')]['sort']);_0x108b9f[_0x8dad('0x37')]=qs[_0x8dad('0x38')](_[_0x8dad('0x53')](_0x10e9ba[_0x8dad('0x2d')],_0x5932ec[_0x8dad('0x38')]));if(_0x10e9ba[_0x8dad('0x2d')]['filter']){_0x108b9f[_0x8dad('0x37')]=_['merge'](_0x108b9f['where'],{'$or':_[_0x8dad('0x29')](_0x108b9f['attributes'],function(_0x1ff6fe){var _0x580a37={};_0x580a37[_0x1ff6fe]={'$like':'%'+_0x10e9ba['query']['filter']+'%'};return _0x580a37;})});}if(_0x10e9ba[_0x8dad('0x2d')]['$gte']){var _0x265e72=_0x10e9ba[_0x8dad('0x2d')][_0x8dad('0x57')]['split'](',');var _0x3a3430={};_0x3a3430[_0x265e72[0x0]]={'$gte':moment(_0x265e72[0x1])[_0x8dad('0x58')]('YYYY-MM-DD\x20HH:mm:ss')};_0x108b9f[_0x8dad('0x37')]=_[_0x8dad('0x3a')](_0x108b9f['where'],_0x3a3430);}_0x108b9f=_[_0x8dad('0x3a')]({},_0x108b9f,_0x10e9ba[_0x8dad('0x3c')]);return _0x4f8520['getMessages'](_0x108b9f);}})[_0x8dad('0x3d')](function(_0x4ec303){if(_0x4ec303){_0x2da4f3=_0x4ec303[_0x8dad('0x31')];if(!_0x10e9ba[_0x8dad('0x2d')][_0x8dad('0x33')](_0x8dad('0x34'))){_0x108b9f[_0x8dad('0x1e')]=qs['limit'](_0x10e9ba['query']['limit']);_0x108b9f[_0x8dad('0x1c')]=qs[_0x8dad('0x1c')](_0x10e9ba[_0x8dad('0x2d')][_0x8dad('0x1c')]);}return _0x4f8520['getMessages'](_0x108b9f);}})['then'](function(_0x462768){if(_0x462768){return _0x462768?{'count':_0x2da4f3,'rows':_0x462768}:null;}})[_0x8dad('0x3d')](respondWithResult(_0x43685c,null))[_0x8dad('0x41')](handleError(_0x43685c,null));};
\ No newline at end of file
+var _0x055d=['register','sendStatus','status','end','offset','undefined','limit','count','set','json','reject','update','then','destroy','error','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','merge','options','include','rows','catch','show','find','create','body','describe','getUnread','ChatInternalMessage','user','addMembers','params','omit','ids','getMembers','findOne','User','filter','hasOwnProperty','removeMembers','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./chatGroup.socket'];(function(_0x52456c,_0x2bea26){var _0x3040d9=function(_0x1f31ab){while(--_0x1f31ab){_0x52456c['push'](_0x52456c['shift']());}};_0x3040d9(++_0x2bea26);}(_0x055d,0x103));var _0xd055=function(_0x2d99ca,_0x36a2e0){_0x2d99ca=_0x2d99ca-0x0;var _0x5574e3=_0x055d[_0x2d99ca];return _0x5574e3;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xd055('0x0'));var zipdir=require(_0xd055('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd055('0x2'));var moment=require(_0xd055('0x3'));var BPromise=require(_0xd055('0x4'));var Mustache=require(_0xd055('0x5'));var util=require('util');var path=require('path');var sox=require(_0xd055('0x6'));var csv=require(_0xd055('0x7'));var ejs=require(_0xd055('0x8'));var fs=require('fs');var fs_extra=require(_0xd055('0x9'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xd055('0xa'));var jsforce=require(_0xd055('0xb'));var deskjs=require(_0xd055('0xc'));var toCsv=require('to-csv');var querystring=require(_0xd055('0xd'));var Papa=require(_0xd055('0xe'));var Redis=require(_0xd055('0xf'));var authService=require(_0xd055('0x10'));var qs=require(_0xd055('0x11'));var as=require(_0xd055('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd055('0x13'))(_0xd055('0x14'));var utils=require(_0xd055('0x15'));var config=require(_0xd055('0x16'));var licenseUtil=require('../../config/license/util');var db=require(_0xd055('0x17'))['db'];config['redis']=_[_0xd055('0x18')](config['redis'],{'host':_0xd055('0x19'),'port':0x18eb});var socket=require(_0xd055('0x1a'))(new Redis(config[_0xd055('0x1b')]));require(_0xd055('0x1c'))[_0xd055('0x1d')](socket);function respondWithStatusCode(_0x18b95a,_0x5e522b){_0x5e522b=_0x5e522b||0xcc;return function(_0x1bb3ca){if(_0x1bb3ca){return _0x18b95a[_0xd055('0x1e')](_0x5e522b);}return _0x18b95a[_0xd055('0x1f')](_0x5e522b)[_0xd055('0x20')]();};}function respondWithResult(_0x4a485f,_0x302071){_0x302071=_0x302071||0xc8;return function(_0x1a1dd9){if(_0x1a1dd9){return _0x4a485f[_0xd055('0x1f')](_0x302071)['json'](_0x1a1dd9);}};}function respondWithFilteredResult(_0x17121f,_0x24c9ea){return function(_0x4a24a9){if(_0x4a24a9){var _0x312f56=typeof _0x24c9ea[_0xd055('0x21')]===_0xd055('0x22')&&typeof _0x24c9ea[_0xd055('0x23')]==='undefined';var _0x5df396=_0x4a24a9[_0xd055('0x24')];var _0x19cf72=_0x312f56?0x0:_0x24c9ea[_0xd055('0x21')];var _0x275436=_0x312f56?_0x4a24a9[_0xd055('0x24')]:_0x24c9ea['offset']+_0x24c9ea[_0xd055('0x23')];var _0x458fef;if(_0x275436>=_0x5df396){_0x275436=_0x5df396;_0x458fef=0xc8;}else{_0x458fef=0xce;}_0x17121f['status'](_0x458fef);return _0x17121f[_0xd055('0x25')]('Content-Range',_0x19cf72+'-'+_0x275436+'/'+_0x5df396)[_0xd055('0x26')](_0x4a24a9);}return null;};}function patchUpdates(_0x4c12f2){return function(_0x38d9da){try{jsonpatch['apply'](_0x38d9da,_0x4c12f2,!![]);}catch(_0x457c61){return BPromise[_0xd055('0x27')](_0x457c61);}return _0x38d9da['save']();};}function saveUpdates(_0x29b66d,_0x461582){return function(_0x447c18){if(_0x447c18){return _0x447c18[_0xd055('0x28')](_0x29b66d)[_0xd055('0x29')](function(_0x14e63d){return _0x14e63d;});}return null;};}function removeEntity(_0x1732e3,_0x29a81a){return function(_0x5bb1c2){if(_0x5bb1c2){return _0x5bb1c2[_0xd055('0x2a')]()[_0xd055('0x29')](function(){_0x1732e3[_0xd055('0x1f')](0xcc)[_0xd055('0x20')]();});}};}function handleEntityNotFound(_0x36fc30,_0x4e85fb){return function(_0x5a5dd9){if(!_0x5a5dd9){_0x36fc30[_0xd055('0x1e')](0x194);}return _0x5a5dd9;};}function handleError(_0x1d9f6a,_0x41b2c6){_0x41b2c6=_0x41b2c6||0x1f4;return function(_0x5aa97f){logger[_0xd055('0x2b')](_0x5aa97f[_0xd055('0x2c')]);if(_0x5aa97f['name']){delete _0x5aa97f[_0xd055('0x2d')];}_0x1d9f6a[_0xd055('0x1f')](_0x41b2c6)[_0xd055('0x2e')](_0x5aa97f);};}exports[_0xd055('0x2f')]=function(_0x2dbf63,_0x2bd7f6){var _0x5a4d77={},_0x54c500={},_0xbe157c={'count':0x0,'rows':[]};var _0xbb0c2=_[_0xd055('0x30')](db[_0xd055('0x31')][_0xd055('0x32')],function(_0xb3f02a){return{'name':_0xb3f02a[_0xd055('0x33')],'type':_0xb3f02a[_0xd055('0x34')][_0xd055('0x35')]};});_0x54c500[_0xd055('0x36')]=_[_0xd055('0x30')](_0xbb0c2,_0xd055('0x2d'));_0x54c500[_0xd055('0x37')]=_[_0xd055('0x38')](_0x2dbf63[_0xd055('0x37')]);_0x54c500[_0xd055('0x39')]=_[_0xd055('0x3a')](_0x54c500[_0xd055('0x36')],_0x54c500[_0xd055('0x37')]);_0x5a4d77['attributes']=_[_0xd055('0x3a')](_0x54c500['model'],qs[_0xd055('0x3b')](_0x2dbf63['query'][_0xd055('0x3b')]));_0x5a4d77['attributes']=_0x5a4d77[_0xd055('0x3c')][_0xd055('0x3d')]?_0x5a4d77[_0xd055('0x3c')]:_0x54c500[_0xd055('0x36')];if(!_0x2dbf63[_0xd055('0x37')]['hasOwnProperty'](_0xd055('0x3e'))){_0x5a4d77[_0xd055('0x23')]=qs['limit'](_0x2dbf63[_0xd055('0x37')][_0xd055('0x23')]);_0x5a4d77[_0xd055('0x21')]=qs['offset'](_0x2dbf63[_0xd055('0x37')]['offset']);}_0x5a4d77[_0xd055('0x3f')]=qs[_0xd055('0x40')](_0x2dbf63[_0xd055('0x37')][_0xd055('0x40')]);_0x5a4d77[_0xd055('0x41')]=qs[_0xd055('0x39')](_[_0xd055('0x42')](_0x2dbf63[_0xd055('0x37')],_0x54c500[_0xd055('0x39')]),_0xbb0c2);if(_0x2dbf63[_0xd055('0x37')]['filter']){_0x5a4d77[_0xd055('0x41')]=_[_0xd055('0x43')](_0x5a4d77[_0xd055('0x41')],{'$or':_['map'](_0xbb0c2,function(_0x56adcf){if(_0x56adcf['type']!=='VIRTUAL'){var _0x158635={};_0x158635[_0x56adcf['name']]={'$like':'%'+_0x2dbf63[_0xd055('0x37')]['filter']+'%'};return _0x158635;}})});}_0x5a4d77=_[_0xd055('0x43')]({},_0x5a4d77,_0x2dbf63[_0xd055('0x44')]);var _0x58221d={'where':_0x5a4d77[_0xd055('0x41')]};return db['ChatGroup'][_0xd055('0x24')](_0x58221d)[_0xd055('0x29')](function(_0x175f63){_0xbe157c[_0xd055('0x24')]=_0x175f63;if(_0x2dbf63[_0xd055('0x37')]['includeAll']){_0x5a4d77[_0xd055('0x45')]=[{'all':!![]}];}return db[_0xd055('0x31')]['findAll'](_0x5a4d77);})[_0xd055('0x29')](function(_0x43c6c5){_0xbe157c[_0xd055('0x46')]=_0x43c6c5;return _0xbe157c;})['then'](respondWithFilteredResult(_0x2bd7f6,_0x5a4d77))[_0xd055('0x47')](handleError(_0x2bd7f6,null));};exports[_0xd055('0x48')]=function(_0x2804e6,_0x1ba175){var _0x9d4b63={'raw':!![],'where':{'id':_0x2804e6['params']['id']}},_0xefed18={};_0xefed18[_0xd055('0x36')]=_[_0xd055('0x38')](db[_0xd055('0x31')][_0xd055('0x32')]);_0xefed18[_0xd055('0x37')]=_[_0xd055('0x38')](_0x2804e6['query']);_0xefed18['filters']=_[_0xd055('0x3a')](_0xefed18['model'],_0xefed18[_0xd055('0x37')]);_0x9d4b63[_0xd055('0x3c')]=_[_0xd055('0x3a')](_0xefed18[_0xd055('0x36')],qs['fields'](_0x2804e6[_0xd055('0x37')]['fields']));_0x9d4b63[_0xd055('0x3c')]=_0x9d4b63['attributes'][_0xd055('0x3d')]?_0x9d4b63['attributes']:_0xefed18['model'];if(_0x2804e6[_0xd055('0x37')]['includeAll']){_0x9d4b63['include']=[{'all':!![]}];}_0x9d4b63=_[_0xd055('0x43')]({},_0x9d4b63,_0x2804e6[_0xd055('0x44')]);return db[_0xd055('0x31')][_0xd055('0x49')](_0x9d4b63)[_0xd055('0x29')](handleEntityNotFound(_0x1ba175,null))['then'](respondWithResult(_0x1ba175,null))[_0xd055('0x47')](handleError(_0x1ba175,null));};exports[_0xd055('0x4a')]=function(_0xe89ec5,_0x5605d8){return db[_0xd055('0x31')][_0xd055('0x4a')](_0xe89ec5[_0xd055('0x4b')],{})[_0xd055('0x29')](respondWithResult(_0x5605d8,0xc9))['catch'](handleError(_0x5605d8,null));};exports['update']=function(_0x4e0f53,_0x406234){if(_0x4e0f53[_0xd055('0x4b')]['id']){delete _0x4e0f53[_0xd055('0x4b')]['id'];}return db['ChatGroup'][_0xd055('0x49')]({'where':{'id':_0x4e0f53['params']['id']}})[_0xd055('0x29')](handleEntityNotFound(_0x406234,null))[_0xd055('0x29')](saveUpdates(_0x4e0f53[_0xd055('0x4b')],null))[_0xd055('0x29')](respondWithResult(_0x406234,null))['catch'](handleError(_0x406234,null));};exports['destroy']=function(_0x13e747,_0x22ef69){return db[_0xd055('0x31')]['find']({'where':{'id':_0x13e747['params']['id']}})[_0xd055('0x29')](handleEntityNotFound(_0x22ef69,null))[_0xd055('0x29')](removeEntity(_0x22ef69,null))[_0xd055('0x47')](handleError(_0x22ef69,null));};exports['describe']=function(_0x1e8b50,_0x5ea1bd){return db['ChatGroup'][_0xd055('0x4c')]()[_0xd055('0x29')](respondWithResult(_0x5ea1bd,null))[_0xd055('0x47')](handleError(_0x5ea1bd,null));};exports[_0xd055('0x4d')]=function(_0x30cf1d,_0x2990e4,_0x5e15a7){return db[_0xd055('0x4e')][_0xd055('0x24')]({'where':{'ChatGroupId':_0x30cf1d['params']['id'],'ToId':_0x30cf1d[_0xd055('0x4f')]['id'],'read':![]}})[_0xd055('0x29')](function(_0x1205ed){return{'id':_['toInteger'](_0x30cf1d['params']['id']),'count':_0x1205ed};})[_0xd055('0x29')](respondWithResult(_0x2990e4,null))['catch'](handleError(_0x2990e4,null));};exports[_0xd055('0x50')]=function(_0xa1f45f,_0x4fcfc0,_0x27d52a){return db[_0xd055('0x31')]['find']({'where':{'id':_0xa1f45f[_0xd055('0x51')]['id']}})[_0xd055('0x29')](handleEntityNotFound(_0x4fcfc0,null))[_0xd055('0x29')](function(_0xdca925){if(_0xdca925){return _0xdca925['addMembers'](_0xa1f45f['body']['ids'],_[_0xd055('0x52')](_0xa1f45f[_0xd055('0x4b')],[_0xd055('0x53'),'id'])||{});}})[_0xd055('0x29')](respondWithResult(_0x4fcfc0,null))[_0xd055('0x47')](handleError(_0x4fcfc0,null));};exports[_0xd055('0x54')]=function(_0x1c750b,_0x655a5,_0x3e29b1){var _0xf0b0c1={};var _0x6da66b={};var _0x4b96af;var _0x5d87fc;return db[_0xd055('0x31')][_0xd055('0x55')]({'where':{'id':_0x1c750b[_0xd055('0x51')]['id']}})['then'](handleEntityNotFound(_0x655a5,null))[_0xd055('0x29')](function(_0x249edc){if(_0x249edc){_0x4b96af=_0x249edc;_0x6da66b[_0xd055('0x36')]=_[_0xd055('0x38')](db[_0xd055('0x56')][_0xd055('0x32')]);_0x6da66b[_0xd055('0x37')]=_[_0xd055('0x38')](_0x1c750b[_0xd055('0x37')]);_0x6da66b[_0xd055('0x39')]=_[_0xd055('0x3a')](_0x6da66b[_0xd055('0x36')],_0x6da66b[_0xd055('0x37')]);_0xf0b0c1[_0xd055('0x3c')]=_[_0xd055('0x3a')](_0x6da66b[_0xd055('0x36')],qs['fields'](_0x1c750b[_0xd055('0x37')][_0xd055('0x3b')]));_0xf0b0c1[_0xd055('0x3c')]=_0xf0b0c1[_0xd055('0x3c')][_0xd055('0x3d')]?_0xf0b0c1['attributes']:_0x6da66b['model'];_0xf0b0c1[_0xd055('0x3f')]=qs['sort'](_0x1c750b[_0xd055('0x37')]['sort']);_0xf0b0c1[_0xd055('0x41')]=qs[_0xd055('0x39')](_[_0xd055('0x42')](_0x1c750b[_0xd055('0x37')],_0x6da66b[_0xd055('0x39')]));if(_0x1c750b[_0xd055('0x37')][_0xd055('0x57')]){_0xf0b0c1[_0xd055('0x41')]=_[_0xd055('0x43')](_0xf0b0c1[_0xd055('0x41')],{'$or':_[_0xd055('0x30')](_0xf0b0c1['attributes'],function(_0x55dcd0){var _0xe3dae={};_0xe3dae[_0x55dcd0]={'$like':'%'+_0x1c750b[_0xd055('0x37')][_0xd055('0x57')]+'%'};return _0xe3dae;})});}_0xf0b0c1=_[_0xd055('0x43')]({},_0xf0b0c1,_0x1c750b['options']);return _0x4b96af[_0xd055('0x54')](_0xf0b0c1);}})[_0xd055('0x29')](function(_0x4e8d36){if(_0x4e8d36){_0x5d87fc=_0x4e8d36[_0xd055('0x3d')];if(!_0x1c750b[_0xd055('0x37')][_0xd055('0x58')]('nolimit')){_0xf0b0c1[_0xd055('0x23')]=qs['limit'](_0x1c750b[_0xd055('0x37')][_0xd055('0x23')]);_0xf0b0c1[_0xd055('0x21')]=qs[_0xd055('0x21')](_0x1c750b[_0xd055('0x37')][_0xd055('0x21')]);}return _0x4b96af[_0xd055('0x54')](_0xf0b0c1);}})[_0xd055('0x29')](function(_0x51a7ce){if(_0x51a7ce){return _0x51a7ce?{'count':_0x5d87fc,'rows':_0x51a7ce}:null;}})[_0xd055('0x29')](respondWithResult(_0x655a5,null))[_0xd055('0x47')](handleError(_0x655a5,null));};exports[_0xd055('0x59')]=function(_0x47550e,_0x2cc944,_0x1cfe6d){return db['ChatGroup'][_0xd055('0x49')]({'where':{'id':_0x47550e[_0xd055('0x51')]['id']}})[_0xd055('0x29')](handleEntityNotFound(_0x2cc944,null))[_0xd055('0x29')](function(_0x32d877){if(_0x32d877){return _0x32d877[_0xd055('0x59')](_0x47550e[_0xd055('0x37')][_0xd055('0x53')]);}})[_0xd055('0x29')](respondWithStatusCode(_0x2cc944,null))[_0xd055('0x47')](handleError(_0x2cc944,null));};exports[_0xd055('0x5a')]=function(_0x739a8c,_0x47369d,_0x3eda5d){if(_0x739a8c[_0xd055('0x4b')]['id']){delete _0x739a8c[_0xd055('0x4b')]['id'];}return db['ChatGroup'][_0xd055('0x49')]({'where':{'id':_0x739a8c[_0xd055('0x51')]['id']}})['then'](handleEntityNotFound(_0x47369d,null))['then'](function(_0x33d1b2){if(_0x33d1b2){_0x739a8c[_0xd055('0x4b')][_0xd055('0x5b')]=_0x33d1b2['id'];return db[_0xd055('0x4e')]['create'](_0x739a8c[_0xd055('0x4b')]);}})[_0xd055('0x29')](respondWithResult(_0x47369d,null))[_0xd055('0x47')](handleError(_0x47369d,null));};exports[_0xd055('0x5c')]=function(_0x97636a,_0x674a6d,_0x4a747d){var _0x23db21={};var _0x1e4fe6={};var _0xa818b0;var _0x4346ef;return db[_0xd055('0x31')][_0xd055('0x55')]({'where':{'id':_0x97636a['params']['id']}})[_0xd055('0x29')](handleEntityNotFound(_0x674a6d,null))[_0xd055('0x29')](function(_0xb0dcf3){if(_0xb0dcf3){_0xa818b0=_0xb0dcf3;_0x1e4fe6[_0xd055('0x36')]=_['keys'](db[_0xd055('0x4e')][_0xd055('0x32')]);_0x1e4fe6[_0xd055('0x37')]=_[_0xd055('0x38')](_0x97636a[_0xd055('0x37')]);_0x1e4fe6['filters']=_[_0xd055('0x3a')](_0x1e4fe6[_0xd055('0x36')],_0x1e4fe6[_0xd055('0x37')]);_0x23db21[_0xd055('0x3c')]=_[_0xd055('0x3a')](_0x1e4fe6[_0xd055('0x36')],qs[_0xd055('0x3b')](_0x97636a[_0xd055('0x37')]['fields']));_0x23db21[_0xd055('0x3c')]=_0x23db21[_0xd055('0x3c')][_0xd055('0x3d')]?_0x23db21['attributes']:_0x1e4fe6[_0xd055('0x36')];_0x23db21[_0xd055('0x3f')]=qs[_0xd055('0x40')](_0x97636a[_0xd055('0x37')][_0xd055('0x40')]);_0x23db21[_0xd055('0x41')]=qs[_0xd055('0x39')](_['pick'](_0x97636a[_0xd055('0x37')],_0x1e4fe6[_0xd055('0x39')]));if(_0x97636a[_0xd055('0x37')][_0xd055('0x57')]){_0x23db21[_0xd055('0x41')]=_[_0xd055('0x43')](_0x23db21[_0xd055('0x41')],{'$or':_[_0xd055('0x30')](_0x23db21[_0xd055('0x3c')],function(_0x2ff0e8){var _0x53bfeb={};_0x53bfeb[_0x2ff0e8]={'$like':'%'+_0x97636a[_0xd055('0x37')][_0xd055('0x57')]+'%'};return _0x53bfeb;})});}if(_0x97636a[_0xd055('0x37')][_0xd055('0x5d')]){var _0x1300c3=_0x97636a[_0xd055('0x37')]['$gte'][_0xd055('0x5e')](',');var _0x4da58a={};_0x4da58a[_0x1300c3[0x0]]={'$gte':moment(_0x1300c3[0x1])['format'](_0xd055('0x5f'))};_0x23db21[_0xd055('0x41')]=_[_0xd055('0x43')](_0x23db21['where'],_0x4da58a);}_0x23db21=_[_0xd055('0x43')]({},_0x23db21,_0x97636a[_0xd055('0x44')]);return _0xa818b0['getMessages'](_0x23db21);}})[_0xd055('0x29')](function(_0x5c6db6){if(_0x5c6db6){_0x4346ef=_0x5c6db6['length'];if(!_0x97636a[_0xd055('0x37')][_0xd055('0x58')](_0xd055('0x3e'))){_0x23db21[_0xd055('0x23')]=qs[_0xd055('0x23')](_0x97636a['query']['limit']);_0x23db21[_0xd055('0x21')]=qs[_0xd055('0x21')](_0x97636a['query'][_0xd055('0x21')]);}return _0xa818b0[_0xd055('0x5c')](_0x23db21);}})[_0xd055('0x29')](function(_0x1db659){if(_0x1db659){return _0x1db659?{'count':_0x4346ef,'rows':_0x1db659}:null;}})['then'](respondWithResult(_0x674a6d,null))['catch'](handleError(_0x674a6d,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index b601402..5a62664 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 _0x1f26=['emit','hook','events','../../mysqldb','ChatGroup','setMaxListeners','save','update','remove'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x1f26,0x197));var _0x61f2=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x1f26[_0x321bb2];return _0x9c12ed;};'use strict';var EventEmitter=require(_0x61f2('0x0'));var ChatGroup=require(_0x61f2('0x1'))['db'][_0x61f2('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x61f2('0x3')](0x0);var events={'afterCreate':_0x61f2('0x4'),'afterUpdate':_0x61f2('0x5'),'afterDestroy':_0x61f2('0x6')};function emitEvent(_0x5c0541){return function(_0xa8899a,_0x4357bb,_0xeb6ad6){ChatGroupEvents['emit'](_0x5c0541+':'+_0xa8899a['id'],_0xa8899a);ChatGroupEvents[_0x61f2('0x7')](_0x5c0541,_0xa8899a);_0xeb6ad6(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x61f2('0x8')](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
+var _0xe9ef=['events','ChatGroup','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x2020b6,_0x2ff986){var _0x2e0f62=function(_0x3dbe24){while(--_0x3dbe24){_0x2020b6['push'](_0x2020b6['shift']());}};_0x2e0f62(++_0x2ff986);}(_0xe9ef,0x16e));var _0xfe9e=function(_0x2431d6,_0x25189a){_0x2431d6=_0x2431d6-0x0;var _0x4d0f9b=_0xe9ef[_0x2431d6];return _0x4d0f9b;};'use strict';var EventEmitter=require(_0xfe9e('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xfe9e('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xfe9e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfe9e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x23904d){return function(_0x45bf15,_0x199f65,_0x20d75f){ChatGroupEvents['emit'](_0x23904d+':'+_0x45bf15['id'],_0x45bf15);ChatGroupEvents[_0xfe9e('0x4')](_0x23904d,_0x45bf15);_0x20d75f(null);};}for(var e in events){if(events[_0xfe9e('0x5')](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module['exports']=ChatGroupEvents;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js
index 3e71534..4c4fd1c 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 _0xd7cb=['api','bluebird','request-promise','rimraf','../../config/environment','./chatGroup.attributes','exports','ChatGroup','lodash','../../config/logger'];(function(_0xf307eb,_0x19ac0c){var _0x1606b8=function(_0x18bb44){while(--_0x18bb44){_0xf307eb['push'](_0xf307eb['shift']());}};_0x1606b8(++_0x19ac0c);}(_0xd7cb,0x1de));var _0xbd7c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xd7cb[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xbd7c('0x0'));var util=require('util');var logger=require(_0xbd7c('0x1'))(_0xbd7c('0x2'));var moment=require('moment');var BPromise=require(_0xbd7c('0x3'));var rp=require(_0xbd7c('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbd7c('0x5'));var config=require(_0xbd7c('0x6'));var attributes=require(_0xbd7c('0x7'));module[_0xbd7c('0x8')]=function(_0x1d3eb9,_0x52a3b7){return _0x1d3eb9['define'](_0xbd7c('0x9'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1271=['../../config/environment','chat_groups','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf'];(function(_0x5beeb7,_0xeeac1b){var _0x5126bf=function(_0x2d115d){while(--_0x2d115d){_0x5beeb7['push'](_0x5beeb7['shift']());}};_0x5126bf(++_0xeeac1b);}(_0x1271,0x1e8));var _0x1127=function(_0xe9f4a2,_0x50f0c4){_0xe9f4a2=_0xe9f4a2-0x0;var _0x25e066=_0x1271[_0xe9f4a2];return _0x25e066;};'use strict';var _=require(_0x1127('0x0'));var util=require('util');var logger=require(_0x1127('0x1'))(_0x1127('0x2'));var moment=require(_0x1127('0x3'));var BPromise=require(_0x1127('0x4'));var rp=require(_0x1127('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1127('0x6'));var config=require(_0x1127('0x7'));var attributes=require('./chatGroup.attributes');module['exports']=function(_0x37a09e,_0x35bd89){return _0x37a09e['define']('ChatGroup',attributes,{'tableName':_0x1127('0x8'),'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 b59eb7d..5ff7fed 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 _0x55a5=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x17c1a4,_0x195273){var _0x2ecdee=function(_0x3d6b93){while(--_0x3d6b93){_0x17c1a4['push'](_0x17c1a4['shift']());}};_0x2ecdee(++_0x195273);}(_0x55a5,0xf7));var _0x555a=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0x55a5[_0x2ce6d5];return _0x32d272;};'use strict';var _=require(_0x555a('0x0'));var util=require('util');var moment=require(_0x555a('0x1'));var BPromise=require(_0x555a('0x2'));var rs=require(_0x555a('0x3'));var fs=require('fs');var Redis=require(_0x555a('0x4'));var db=require(_0x555a('0x5'))['db'];var utils=require(_0x555a('0x6'));var logger=require(_0x555a('0x7'))(_0x555a('0x8'));var config=require(_0x555a('0x9'));var jayson=require(_0x555a('0xa'));var client=jayson[_0x555a('0xb')][_0x555a('0xc')]({'port':0x232a});config[_0x555a('0xd')]=_[_0x555a('0xe')](config[_0x555a('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x555a('0xf'))(new Redis(config[_0x555a('0xd')]));require(_0x555a('0x10'))[_0x555a('0x11')](socket);function respondWithRpcPromise(_0xb56cd2,_0xd6ec1b,_0x273c20){return new BPromise(function(_0x3e4af3,_0x5b83f8){return client[_0x555a('0x12')](_0xb56cd2,_0x273c20)[_0x555a('0x13')](function(_0x411ff1){logger[_0x555a('0x14')](_0x555a('0x15'),_0xd6ec1b,'request\x20sent');logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0xd6ec1b,'request\x20sent',JSON[_0x555a('0x16')](_0x411ff1));if(_0x411ff1[_0x555a('0x17')]){if(_0x411ff1[_0x555a('0x17')][_0x555a('0x18')]===0x1f4){logger[_0x555a('0x17')](_0x555a('0x15'),_0xd6ec1b,_0x411ff1[_0x555a('0x17')][_0x555a('0x19')]);return _0x5b83f8(_0x411ff1['error']['message']);}logger['error'](_0x555a('0x15'),_0xd6ec1b,_0x411ff1[_0x555a('0x17')][_0x555a('0x19')]);return _0x3e4af3(_0x411ff1['error'][_0x555a('0x19')]);}else{logger[_0x555a('0x14')](_0x555a('0x15'),_0xd6ec1b,'request\x20sent');_0x3e4af3(_0x411ff1[_0x555a('0x1a')]['message']);}})[_0x555a('0x1b')](function(_0x330e85){logger[_0x555a('0x17')](_0x555a('0x15'),_0xd6ec1b,_0x330e85);_0x5b83f8(_0x330e85);});});}
\ No newline at end of file
+var _0xfd7b=['error','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','redis','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','code'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xfd7b,0x1df));var _0xbfd7=function(_0x3b96cf,_0x1592f2){_0x3b96cf=_0x3b96cf-0x0;var _0x2e315a=_0xfd7b[_0x3b96cf];return _0x2e315a;};'use strict';var _=require('lodash');var util=require(_0xbfd7('0x0'));var moment=require(_0xbfd7('0x1'));var BPromise=require(_0xbfd7('0x2'));var rs=require(_0xbfd7('0x3'));var fs=require('fs');var Redis=require(_0xbfd7('0x4'));var db=require(_0xbfd7('0x5'))['db'];var utils=require(_0xbfd7('0x6'));var logger=require(_0xbfd7('0x7'))(_0xbfd7('0x8'));var config=require(_0xbfd7('0x9'));var jayson=require(_0xbfd7('0xa'));var client=jayson[_0xbfd7('0xb')][_0xbfd7('0xc')]({'port':0x232a});config['redis']=_[_0xbfd7('0xd')](config['redis'],{'host':_0xbfd7('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbfd7('0xf')]));require(_0xbfd7('0x10'))[_0xbfd7('0x11')](socket);function respondWithRpcPromise(_0x3b7670,_0x47e7c2,_0x19e7bc){return new BPromise(function(_0x14c84b,_0x5d5b48){return client['request'](_0x3b7670,_0x19e7bc)[_0xbfd7('0x12')](function(_0x45606b){logger[_0xbfd7('0x13')](_0xbfd7('0x14'),_0x47e7c2,_0xbfd7('0x15'));logger['debug'](_0xbfd7('0x16'),_0x47e7c2,'request\x20sent',JSON[_0xbfd7('0x17')](_0x45606b));if(_0x45606b['error']){if(_0x45606b['error'][_0xbfd7('0x18')]===0x1f4){logger[_0xbfd7('0x19')](_0xbfd7('0x14'),_0x47e7c2,_0x45606b[_0xbfd7('0x19')]['message']);return _0x5d5b48(_0x45606b['error']['message']);}logger[_0xbfd7('0x19')](_0xbfd7('0x14'),_0x47e7c2,_0x45606b[_0xbfd7('0x19')][_0xbfd7('0x1a')]);return _0x14c84b(_0x45606b[_0xbfd7('0x19')][_0xbfd7('0x1a')]);}else{logger[_0xbfd7('0x13')](_0xbfd7('0x14'),_0x47e7c2,_0xbfd7('0x15'));_0x14c84b(_0x45606b['result']['message']);}})[_0xbfd7('0x1b')](function(_0x1ca43c){logger['error']('ChatGroup,\x20%s,\x20%s',_0x47e7c2,_0x1ca43c);_0x5d5b48(_0x1ca43c);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index dea5248..9f139d4 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 _0x2cea=['emit','removeListener','length','save','remove','update'];(function(_0x1df210,_0x3abe68){var _0x4a5027=function(_0x40efc3){while(--_0x40efc3){_0x1df210['push'](_0x1df210['shift']());}};_0x4a5027(++_0x3abe68);}(_0x2cea,0x153));var _0xa2ce=function(_0x382d8e,_0x2a5761){_0x382d8e=_0x382d8e-0x0;var _0x23993d=_0x2cea[_0x382d8e];return _0x23993d;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xa2ce('0x0'),_0xa2ce('0x1'),_0xa2ce('0x2')];function createListener(_0x20fce4,_0x5d6127){return function(_0x4729cf){_0x5d6127[_0xa2ce('0x3')](_0x20fce4,_0x4729cf);};}function removeListener(_0x3faea7,_0x13858a){return function(){ChatGroupEvents[_0xa2ce('0x4')](_0x3faea7,_0x13858a);};}exports['register']=function(_0x2331d9){for(var _0x2750ac=0x0,_0x4630bc=events[_0xa2ce('0x5')];_0x2750ac<_0x4630bc;_0x2750ac++){var _0x7ac717=events[_0x2750ac];var _0x322bb2=createListener('chatGroup:'+_0x7ac717,_0x2331d9);ChatGroupEvents['on'](_0x7ac717,_0x322bb2);}};
\ No newline at end of file
+var _0xa932=['update','removeListener','register','length','chatGroup:','./chatGroup.events','save','remove'];(function(_0x6f362f,_0x1853be){var _0x33d274=function(_0x5e3ae2){while(--_0x5e3ae2){_0x6f362f['push'](_0x6f362f['shift']());}};_0x33d274(++_0x1853be);}(_0xa932,0x1bd));var _0x2a93=function(_0x47bf8b,_0x5c377e){_0x47bf8b=_0x47bf8b-0x0;var _0x2d71ff=_0xa932[_0x47bf8b];return _0x2d71ff;};'use strict';var ChatGroupEvents=require(_0x2a93('0x0'));var events=[_0x2a93('0x1'),_0x2a93('0x2'),_0x2a93('0x3')];function createListener(_0x7513fe,_0x336154){return function(_0x4fe938){_0x336154['emit'](_0x7513fe,_0x4fe938);};}function removeListener(_0x2fc962,_0x490f2e){return function(){ChatGroupEvents[_0x2a93('0x4')](_0x2fc962,_0x490f2e);};}exports[_0x2a93('0x5')]=function(_0x130112){for(var _0x198b17=0x0,_0x5d4ede=events[_0x2a93('0x6')];_0x198b17<_0x5d4ede;_0x198b17++){var _0x44729e=events[_0x198b17];var _0x203fc1=createListener(_0x2a93('0x7')+_0x44729e,_0x130112);ChatGroupEvents['on'](_0x44729e,_0x203fc1);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index e519277..c0e77eb 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 _0xf8fc=['addMessage','put','update','delete','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','get','describe','/:id','isAuthenticated','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xf8fc,0x180));var _0xcf8f=function(_0x3511d3,_0x4107ae){_0x3511d3=_0x3511d3-0x0;var _0x5d6321=_0xf8fc[_0x3511d3];return _0x5d6321;};'use strict';var multer=require(_0xcf8f('0x0'));var util=require(_0xcf8f('0x1'));var path=require('path');var timeout=require(_0xcf8f('0x2'));var express=require(_0xcf8f('0x3'));var router=express['Router']();var fs_extra=require(_0xcf8f('0x4'));var auth=require(_0xcf8f('0x5'));var interaction=require(_0xcf8f('0x6'));var config=require('../../config/environment');var controller=require('./chatGroup.controller');router[_0xcf8f('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xcf8f('0x8')]);router['get'](_0xcf8f('0x9'),auth[_0xcf8f('0xa')](),controller[_0xcf8f('0xb')]);router[_0xcf8f('0x7')](_0xcf8f('0xc'),auth['isAuthenticated'](),controller[_0xcf8f('0xd')]);router['get'](_0xcf8f('0xe'),auth[_0xcf8f('0xa')](),controller[_0xcf8f('0xf')]);router['get'](_0xcf8f('0x10'),auth[_0xcf8f('0xa')](),controller[_0xcf8f('0x11')]);router[_0xcf8f('0x12')]('/',auth[_0xcf8f('0xa')](),controller[_0xcf8f('0x13')]);router[_0xcf8f('0x12')](_0xcf8f('0xe'),auth[_0xcf8f('0xa')](),controller[_0xcf8f('0x14')]);router['post']('/:id/messages',auth[_0xcf8f('0xa')](),controller[_0xcf8f('0x15')]);router[_0xcf8f('0x16')](_0xcf8f('0x9'),auth['isAuthenticated'](),controller[_0xcf8f('0x17')]);router[_0xcf8f('0x18')](_0xcf8f('0x9'),auth['isAuthenticated'](),controller[_0xcf8f('0x19')]);router[_0xcf8f('0x18')](_0xcf8f('0xe'),auth[_0xcf8f('0xa')](),controller['removeMembers']);module[_0xcf8f('0x1a')]=router;
\ No newline at end of file
+var _0xcb3b=['connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','/:id/members','getMembers','getMessages','create','post','addMembers','put','update','delete','destroy','removeMembers','exports','multer','path'];(function(_0x47825a,_0x2afee6){var _0x36a42f=function(_0x2aa672){while(--_0x2aa672){_0x47825a['push'](_0x47825a['shift']());}};_0x36a42f(++_0x2afee6);}(_0xcb3b,0x16a));var _0xbcb3=function(_0x603d70,_0x55420f){_0x603d70=_0x603d70-0x0;var _0xac2a32=_0xcb3b[_0x603d70];return _0xac2a32;};'use strict';var multer=require(_0xbcb3('0x0'));var util=require('util');var path=require(_0xbcb3('0x1'));var timeout=require(_0xbcb3('0x2'));var express=require(_0xbcb3('0x3'));var router=express[_0xbcb3('0x4')]();var fs_extra=require(_0xbcb3('0x5'));var auth=require(_0xbcb3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xbcb3('0x7'));var controller=require(_0xbcb3('0x8'));router[_0xbcb3('0x9')]('/',auth[_0xbcb3('0xa')](),controller[_0xbcb3('0xb')]);router[_0xbcb3('0x9')](_0xbcb3('0xc'),auth[_0xbcb3('0xa')](),controller['describe']);router[_0xbcb3('0x9')](_0xbcb3('0xd'),auth[_0xbcb3('0xa')](),controller['show']);router[_0xbcb3('0x9')]('/:id/unread',auth[_0xbcb3('0xa')](),controller['getUnread']);router['get'](_0xbcb3('0xe'),auth[_0xbcb3('0xa')](),controller[_0xbcb3('0xf')]);router['get']('/:id/messages',auth[_0xbcb3('0xa')](),controller[_0xbcb3('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0xbcb3('0x11')]);router[_0xbcb3('0x12')](_0xbcb3('0xe'),auth[_0xbcb3('0xa')](),controller[_0xbcb3('0x13')]);router[_0xbcb3('0x12')]('/:id/messages',auth['isAuthenticated'](),controller['addMessage']);router[_0xbcb3('0x14')](_0xbcb3('0xd'),auth[_0xbcb3('0xa')](),controller[_0xbcb3('0x15')]);router[_0xbcb3('0x16')](_0xbcb3('0xd'),auth[_0xbcb3('0xa')](),controller[_0xbcb3('0x17')]);router[_0xbcb3('0x16')](_0xbcb3('0xe'),auth[_0xbcb3('0xa')](),controller[_0xbcb3('0x18')]);module[_0xbcb3('0x19')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index f035e71..a53c4d4 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 _0xe6e4=['star','thumb','TEXT','STRING','long','DATE','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x1e7ee5,_0x3c3cce){var _0x19fc89=function(_0x1346f7){while(--_0x1346f7){_0x1e7ee5['push'](_0x1e7ee5['shift']());}};_0x19fc89(++_0x3c3cce);}(_0xe6e4,0xc1));var _0x4e6e=function(_0xbc2d9e,_0x40ef4f){_0xbc2d9e=_0xbc2d9e-0x0;var _0x2e315c=_0xe6e4[_0xbc2d9e];return _0x2e315c;};'use strict';var Sequelize=require(_0x4e6e('0x0'));module[_0x4e6e('0x1')]={'closed':{'type':Sequelize[_0x4e6e('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x4e6e('0x3')]},'ratingType':{'type':Sequelize[_0x4e6e('0x4')](_0x4e6e('0x5'),_0x4e6e('0x6')),'defaultValue':_0x4e6e('0x5')},'ratingMessage':{'type':Sequelize[_0x4e6e('0x7')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize[_0x4e6e('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'secondDisposition':{'type':Sequelize[_0x4e6e('0x8')]},'thirdDisposition':{'type':Sequelize[_0x4e6e('0x8')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x4e6e('0x8')]},'browserVersion':{'type':Sequelize[_0x4e6e('0x8')]},'osName':{'type':Sequelize[_0x4e6e('0x8')]},'osVersion':{'type':Sequelize[_0x4e6e('0x8')]},'deviceModel':{'type':Sequelize[_0x4e6e('0x8')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x4e6e('0x8')]},'referer':{'type':Sequelize[_0x4e6e('0x7')]},'customerIp':{'type':Sequelize[_0x4e6e('0x8')]},'formData':{'type':Sequelize[_0x4e6e('0x7')](_0x4e6e('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x4e6e('0xa')]},'lastMsgDirection':{'type':Sequelize[_0x4e6e('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x4e6e('0x8')]},'customerPort':{'type':Sequelize[_0x4e6e('0x8')]},'vidaooSessionId':{'type':Sequelize[_0x4e6e('0x7')]},'autoreplyExecuted':{'type':Sequelize[_0x4e6e('0x2')],'defaultValue':![]}};
\ No newline at end of file
+var _0x705f=['BOOLEAN','ENUM','star','thumb','TEXT','STRING','DATE','long','out'];(function(_0x287473,_0x20c8dc){var _0xe6693e=function(_0x2c7747){while(--_0x2c7747){_0x287473['push'](_0x287473['shift']());}};_0xe6693e(++_0x20c8dc);}(_0x705f,0x75));var _0xf705=function(_0x3a902a,_0xca8442){_0x3a902a=_0x3a902a-0x0;var _0x24f2d5=_0x705f[_0x3a902a];return _0x24f2d5;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xf705('0x0')],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0xf705('0x1')](_0xf705('0x2'),_0xf705('0x3')),'defaultValue':_0xf705('0x2')},'ratingMessage':{'type':Sequelize[_0xf705('0x4')]},'pathTranscript':{'type':Sequelize[_0xf705('0x4')]},'mailTranscript':{'type':Sequelize[_0xf705('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xf705('0x6')]},'disposition':{'type':Sequelize[_0xf705('0x5')]},'secondDisposition':{'type':Sequelize[_0xf705('0x5')]},'thirdDisposition':{'type':Sequelize[_0xf705('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0xf705('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0xf705('0x5')]},'deviceModel':{'type':Sequelize[_0xf705('0x5')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0xf705('0x4')]},'customerIp':{'type':Sequelize[_0xf705('0x5')]},'formData':{'type':Sequelize[_0xf705('0x4')](_0xf705('0x7'))},'read1stAt':{'type':Sequelize[_0xf705('0x6')]},'lastMsgAt':{'type':Sequelize[_0xf705('0x6')]},'lastMsgDirection':{'type':Sequelize[_0xf705('0x1')]('in',_0xf705('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xf705('0x5')]},'vidaooSessionId':{'type':Sequelize[_0xf705('0x4')]},'autoreplyExecuted':{'type':Sequelize[_0xf705('0x0')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index f315cc7..e257921 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 _0x4522=['c.email','Contact.email','Contact.phone','c.mobile','c.fax','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','length','ChatInteractionId','push','all','rows','catch','show','params','includeAll','include','options','create','destroy','describe','ChatWebsite','findOne','vidaooApiKey','vidaooMetadata','vidaooEscalation','POST','https://api-vidaoo.xcally.com/api/v1/meetings','vidaooNote','metadata','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','ChatMessage','updateAttributes','customUpdate','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','Interaction\x20already\x20assigned','disposition','AbandonInteraction','file','basename','filename','Unauthorized','Attachment','ChatOfflineMessageId','join','root','offline-chat/','download','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','appendFileSync','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','omit','ids','nolimit','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','getMyMessages','secret','spread','Tag','chatInteractionTags:save','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','lastName','read','Account','Chat','Owner','closedAt','browserName','osName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','out','firstName','renderFile','views','downloadInteraction.ejs','.pdf','createPdfFromHTML','err','unlinkSync','request-promise','moment','bluebird','util','path','ejs','lodash','squel','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../components/export/pdf','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','jayson/promise','client','http','then','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','update','stack','name','send','render','body','contact','agent','interaction','account','Users','map','fullname','TagIds','Tags','split','waiting','answered','unmanaged','abandoned','total','closed','talking','UserId','rawAttributes','fieldName','type','query','keys','intersection','model','attributes','hasOwnProperty','order','sort','where','filters','pick','field','from','tools_tags','select','u.id','u.fullname','ui.ChatInteractionId','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','having','`\x20=\x200','`\x20>\x200','value','ContactId','buildExpression','start','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','null','\x20IS\x20NULL','tag','isArray','filter','replace','i.id\x20LIKE\x20?','Sequelize','QueryTypes','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','count','toString','keyBy','merge','ChatInteraction','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','contactName','c.firstName','Contact.firstName','Contact.lastName'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4522,0x1a0));var _0x2452=function(_0x164f64,_0x3e577b){_0x164f64=_0x164f64-0x0;var _0x240869=_0x4522[_0x164f64];return _0x240869;};'use strict';var rimraf=require('rimraf');var zipdir=require('zip-dir');var rp=require(_0x2452('0x0'));var moment=require(_0x2452('0x1'));var BPromise=require(_0x2452('0x2'));var Mustache=require('mustache');var util=require(_0x2452('0x3'));var path=require(_0x2452('0x4'));var ejs=require(_0x2452('0x5'));var fs=require('fs');var _=require(_0x2452('0x6'));var squel=require(_0x2452('0x7'));var Redis=require(_0x2452('0x8'));var qs=require(_0x2452('0x9'));var as=require(_0x2452('0xa'));var pdf=require(_0x2452('0xb'));var logger=require(_0x2452('0xc'))(_0x2452('0xd'));var config=require(_0x2452('0xe'));var db=require(_0x2452('0xf'))['db'];config[_0x2452('0x10')]=_[_0x2452('0x11')](config[_0x2452('0x10')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2452('0x10')]));require('./chatInteraction.socket')['register'](socket);var jayson=require(_0x2452('0x12'));var client=jayson[_0x2452('0x13')][_0x2452('0x14')]({'port':0x232b});var client9004=jayson[_0x2452('0x13')][_0x2452('0x14')]({'port':0x232c});function respondWithRpcPromise(_0x14f338,_0x2c1e0f,_0x2377b9,_0x4968e8){return new BPromise(function(_0x529fb2,_0x5315ed){var _0x463960=_0x4968e8||client;return _0x463960['request'](_0x14f338,_0x2377b9)[_0x2452('0x15')](function(_0x506cd4){logger[_0x2452('0x16')](_0x2452('0x17'),_0x2c1e0f,'request\x20sent');logger[_0x2452('0x18')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x2c1e0f,_0x2452('0x19'),JSON[_0x2452('0x1a')](_0x506cd4));if(_0x506cd4[_0x2452('0x1b')]){if(_0x506cd4[_0x2452('0x1b')]['code']===0x1f4){logger[_0x2452('0x1b')](_0x2452('0x17'),_0x2c1e0f,_0x506cd4['error']['message']);return _0x5315ed(_0x506cd4[_0x2452('0x1b')][_0x2452('0x1c')]);}logger[_0x2452('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x2c1e0f,_0x506cd4[_0x2452('0x1b')][_0x2452('0x1c')]);return _0x529fb2(_0x506cd4[_0x2452('0x1b')][_0x2452('0x1c')]);}else{logger[_0x2452('0x16')](_0x2452('0x17'),_0x2c1e0f,_0x2452('0x19'));_0x529fb2(_0x506cd4[_0x2452('0x1d')]['message']);}})['catch'](function(_0x1f060d){logger[_0x2452('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x2c1e0f,_0x1f060d);_0x5315ed(_0x1f060d);});});}function respondWithStatusCode(_0x17d0a0,_0x395cf1){_0x395cf1=_0x395cf1||0xcc;return function(_0x1d5720){if(_0x1d5720){return _0x17d0a0[_0x2452('0x1e')](_0x395cf1);}return _0x17d0a0[_0x2452('0x1f')](_0x395cf1)[_0x2452('0x20')]();};}function respondWithResult(_0x155caa,_0x543b06){_0x543b06=_0x543b06||0xc8;return function(_0x119bf6){if(_0x119bf6){return _0x155caa[_0x2452('0x1f')](_0x543b06)[_0x2452('0x21')](_0x119bf6);}};}function respondWithFilteredResult(_0x231410,_0x3a4326){return function(_0x516fcf){if(_0x516fcf){var _0x48783a=typeof _0x3a4326[_0x2452('0x22')]===_0x2452('0x23')&&typeof _0x3a4326[_0x2452('0x24')]===_0x2452('0x23');var _0x1aac19=_0x516fcf['count'];var _0x3fba00=_0x48783a?0x0:_0x3a4326[_0x2452('0x22')];var _0x5e9184=_0x48783a?_0x516fcf['count']:_0x3a4326[_0x2452('0x22')]+_0x3a4326[_0x2452('0x24')];var _0x36cb6c;if(_0x5e9184>=_0x1aac19){_0x5e9184=_0x1aac19;_0x36cb6c=0xc8;}else{_0x36cb6c=0xce;}_0x231410[_0x2452('0x1f')](_0x36cb6c);return _0x231410[_0x2452('0x25')](_0x2452('0x26'),_0x3fba00+'-'+_0x5e9184+'/'+_0x1aac19)['json'](_0x516fcf);}return null;};}function saveUpdates(_0x5da9aa){return function(_0x46b611){if(_0x46b611){return _0x46b611[_0x2452('0x27')](_0x5da9aa)[_0x2452('0x15')](function(_0x5c36aa){return _0x5c36aa;});}return null;};}function removeEntity(_0x2fb2ae){return function(_0x586a20){if(_0x586a20){return _0x586a20['destroy']()[_0x2452('0x15')](function(){_0x2fb2ae[_0x2452('0x1f')](0xcc)[_0x2452('0x20')]();});}};}function handleEntityNotFound(_0xe97b1c){return function(_0x334aba){if(!_0x334aba){_0xe97b1c[_0x2452('0x1e')](0x194);}return _0x334aba;};}function handleError(_0x312f1b,_0x115e09){_0x115e09=_0x115e09||0x1f4;return function(_0x3b96aa){logger[_0x2452('0x1b')](_0x3b96aa[_0x2452('0x28')]);if(_0x3b96aa[_0x2452('0x29')]){delete _0x3b96aa[_0x2452('0x29')];}_0x312f1b['status'](_0x115e09)[_0x2452('0x2a')](_0x3b96aa);};}function getMustacheRender(_0x1689cd,_0x4cd7e2){return Mustache[_0x2452('0x2b')](_0x1689cd,_['merge'](_0x4cd7e2[_0x2452('0x2c')],{'contact':_0x4cd7e2[_0x2452('0x2d')],'message':_0x4cd7e2['message'],'agent':_0x4cd7e2[_0x2452('0x2e')],'interaction':_0x4cd7e2[_0x2452('0x2f')],'account':_0x4cd7e2[_0x2452('0x30')]}))||'';}function getInteractionUsers(_0x5ce5fb,_0x20a4b4){return new BPromise(function(_0x4565c7,_0x4ba2ae){try{if(_0x20a4b4[_0x5ce5fb['id']]){_0x5ce5fb[_0x2452('0x31')]=_[_0x2452('0x32')](_0x20a4b4[_0x5ce5fb['id']],function(_0x11dba4){return{'id':_0x11dba4['id'],'fullname':_0x11dba4[_0x2452('0x33')]};});}}catch(_0x261bd8){_0x4ba2ae(_0x261bd8);}_0x4565c7(_0x5ce5fb);});}function getInteractionTags(_0x54c36a,_0x58b6c2){return new BPromise(function(_0x510b79,_0x1df280){try{if(_0x54c36a[_0x2452('0x34')]){_0x54c36a[_0x2452('0x35')]=[];_0x54c36a[_0x2452('0x34')][_0x2452('0x36')](',')['forEach'](function(_0x22120a){_0x54c36a['Tags']['push'](_0x58b6c2[_0x22120a]);});}delete _0x54c36a[_0x2452('0x34')];}catch(_0x515e7b){_0x1df280(_0x515e7b);}_0x510b79(_0x54c36a);});}function updateChatInteraction(_0x44ef50,_0xac3b74,_0x514037){return new BPromise(function(_0x30b49f,_0x2cc8a4){return getInteractionUsers(_0x44ef50,_0x514037)[_0x2452('0x15')](function(_0x34d7f9){return getInteractionTags(_0x34d7f9,_0xac3b74);})[_0x2452('0x15')](function(_0x112849){return getStateInteraction(_0x112849);})[_0x2452('0x15')](function(_0x46a561){_0x30b49f(_0x46a561);})['catch'](function(_0x262467){_0x2cc8a4(_0x262467);});});}function getStateInteraction(_0x52c6b6){return new BPromise(function(_0xaea800){_0x52c6b6[_0x2452('0x37')]=0x0;_0x52c6b6['talking']=0x0;_0x52c6b6[_0x2452('0x38')]=0x0;_0x52c6b6[_0x2452('0x39')]=0x0;_0x52c6b6[_0x2452('0x3a')]=0x0;_0x52c6b6[_0x2452('0x3b')]=0x0;if(!_0x52c6b6[_0x2452('0x3c')]&&!_0x52c6b6['UserId']){_0x52c6b6[_0x2452('0x37')]+=0x1;}if(!_0x52c6b6[_0x2452('0x3c')]&&_0x52c6b6['UserId']){_0x52c6b6[_0x2452('0x3d')]+=0x1;if(_0x52c6b6[_0x2452('0x37')]){_0x52c6b6[_0x2452('0x37')]-=0x1;}}if(_0x52c6b6[_0x2452('0x3c')]&&_0x52c6b6['disposition']===_0x2452('0x3a')){_0x52c6b6[_0x2452('0x3a')]+=0x1;if(_0x52c6b6[_0x2452('0x37')]){_0x52c6b6[_0x2452('0x37')]-=0x1;}}else if(_0x52c6b6[_0x2452('0x3c')]&&!_0x52c6b6[_0x2452('0x3e')]&&_0x52c6b6['disposition']){_0x52c6b6[_0x2452('0x39')]+=0x1;if(_0x52c6b6['waiting']){_0x52c6b6[_0x2452('0x37')]-=0x1;}}else if(_0x52c6b6[_0x2452('0x3c')]&&_0x52c6b6['UserId']){_0x52c6b6['answered']+=0x1;if(_0x52c6b6['talking']){_0x52c6b6['talking']-=0x1;}}_0x52c6b6[_0x2452('0x3b')]+=0x1;_0xaea800(_0x52c6b6);});}exports['index']=function(_0x15f0e7,_0x5e400a){var _0x1ef02b={},_0x16d938={},_0x55de3d={'count':0x0,'rows':[]};var _0x4c6b8a=_[_0x2452('0x32')](db['ChatInteraction'][_0x2452('0x3f')],function(_0x1cb30a){return{'name':_0x1cb30a[_0x2452('0x40')],'type':_0x1cb30a[_0x2452('0x41')]['key']};});_0x16d938['model']=_[_0x2452('0x32')](_0x4c6b8a,_0x2452('0x29'));_0x16d938[_0x2452('0x42')]=_[_0x2452('0x43')](_0x15f0e7[_0x2452('0x42')]);_0x16d938['filters']=_[_0x2452('0x44')](_0x16d938['model'],_0x16d938[_0x2452('0x42')]);_0x1ef02b['attributes']=_[_0x2452('0x44')](_0x16d938[_0x2452('0x45')],qs['fields'](_0x15f0e7[_0x2452('0x42')]['fields']));_0x1ef02b[_0x2452('0x46')]=_0x1ef02b['attributes']['length']?_0x1ef02b['attributes']:_0x16d938[_0x2452('0x45')];if(!_0x15f0e7[_0x2452('0x42')][_0x2452('0x47')]('nolimit')){_0x1ef02b[_0x2452('0x24')]=qs[_0x2452('0x24')](_0x15f0e7[_0x2452('0x42')][_0x2452('0x24')]);_0x1ef02b[_0x2452('0x22')]=qs['offset'](_0x15f0e7[_0x2452('0x42')]['offset']);}_0x1ef02b[_0x2452('0x48')]=qs[_0x2452('0x49')](_0x15f0e7[_0x2452('0x42')][_0x2452('0x49')]);_0x1ef02b[_0x2452('0x4a')]=qs[_0x2452('0x4b')](_[_0x2452('0x4c')](_0x15f0e7[_0x2452('0x42')],_0x16d938[_0x2452('0x4b')]),_0x4c6b8a);var _0x4ec01a=[];var _0x443cf9=squel['select']()[_0x2452('0x4d')]('id')['field'](_0x2452('0x29'))[_0x2452('0x4d')]('color')[_0x2452('0x4e')](_0x2452('0x4f'));var _0x18ec2d=squel[_0x2452('0x50')]()[_0x2452('0x4d')](_0x2452('0x51'))[_0x2452('0x4d')](_0x2452('0x52'))[_0x2452('0x4d')](_0x2452('0x53'))[_0x2452('0x4e')]('user_has_chat_interactions','ui')[_0x2452('0x54')]('users','u',_0x2452('0x55'));var _0x4959a7=squel[_0x2452('0x50')]()[_0x2452('0x4e')](_0x2452('0x56'),'i')[_0x2452('0x54')](_0x2452('0x57'),'c',_0x2452('0x58'))[_0x2452('0x54')](_0x2452('0x59'),'o',_0x2452('0x5a'))[_0x2452('0x54')](_0x2452('0x5b'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x2452('0x54')](_0x2452('0x5c'),'me',_0x2452('0x5d'))[_0x2452('0x54')](_0x2452('0x5e'),'it',_0x2452('0x5f'))['left_join'](_0x2452('0x4f'),'t',_0x2452('0x60'));var _0x4bce9e=squel[_0x2452('0x61')]();var _0x3a64fc=[];var _0x1b8e8b=squel[_0x2452('0x61')]();var _0x2f1b16;if(_0x15f0e7[_0x2452('0x42')][_0x2452('0x62')]){_0x2f1b16=as[_0x2452('0x63')](_0x15f0e7[_0x2452('0x42')][_0x2452('0x62')]);var _0x243b85=_0x2f1b16['sqlOperator'];for(var _0x5cf96b=0x0;_0x5cf96b<_0x2f1b16[_0x2452('0x64')]['length'];_0x5cf96b++){var _0x20875f=_0x2f1b16[_0x2452('0x64')][_0x5cf96b];var _0x192788='i';var _0x17b1ec=_[_0x2452('0x65')](_0x4c6b8a,[_0x2452('0x29'),_0x20875f['field']]);if(!_0x17b1ec){switch(_0x20875f['field']){case _0x2452('0x66'):if(_0x20875f['value']==0x1){_0x4959a7[_0x2452('0x67')]('`'+_0x20875f['field']+_0x2452('0x68'));}else{_0x4959a7[_0x2452('0x67')]('`'+_0x20875f[_0x2452('0x4d')]+_0x2452('0x69'));}break;case'Contact':if(_0x20875f['operator']==='$substring'){if(_0x20875f[_0x2452('0x6a')][_0x2452('0x36')]('\x20')['length']>0x1){_0x4bce9e[_0x243b85]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x20875f['value']),null);}else{var _0x4b563d='%'+_0x20875f[_0x2452('0x6a')]+'%';_0x4bce9e[_0x243b85]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4b563d,_0x4b563d,_0x4b563d);}}else{_0x17b1ec=_['find'](_0x4c6b8a,[_0x2452('0x29'),_0x2452('0x6b')]);_0x20875f[_0x2452('0x4d')]=_0x2452('0x6b');_0x1ce631=as[_0x2452('0x6c')](_0x192788,_0x17b1ec[_0x2452('0x41')],_0x20875f);_0x4bce9e[_0x243b85](_0x1ce631['text'],_0x1ce631[_0x2452('0x6a')][_0x2452('0x6d')],_0x1ce631[_0x2452('0x6a')]['end']);}break;case'Tag':var _0xa692d5=_0x20875f[_0x2452('0x6a')][_0x2452('0x36')](',')[_0x2452('0x32')](function(_0x401628){return Number(_0x401628);});_0xa692d5[_0x2452('0x6e')](function(_0x4dd13d){_0x1b8e8b['or'](_0x2452('0x6f'),'%,'+_0x4dd13d+',%');});_0x3a64fc=_['union'](_0x3a64fc,_0xa692d5);break;case _0x2452('0x70'):if(_0x20875f[_0x2452('0x71')]===_0x2452('0x72')){_0x4bce9e[_0x243b85](_0x2452('0x73'),'%'+_0x20875f['value']+'%',null);}else{_0x17b1ec=_[_0x2452('0x65')](_0x4c6b8a,[_0x2452('0x29'),'UserId']);_0x20875f[_0x2452('0x4d')]=_0x2452('0x3e');_0x1ce631=as[_0x2452('0x6c')](_0x192788,_0x17b1ec[_0x2452('0x41')],_0x20875f);_0x4bce9e[_0x243b85](_0x1ce631[_0x2452('0x74')],_0x1ce631[_0x2452('0x6a')][_0x2452('0x6d')],_0x1ce631[_0x2452('0x6a')]['end']);}break;case'body':_0x1ce631=as[_0x2452('0x6c')]('me',null,_0x20875f);_0x4bce9e[_0x243b85](_0x1ce631[_0x2452('0x74')],_0x1ce631[_0x2452('0x6a')][_0x2452('0x6d')],_0x1ce631['value'][_0x2452('0x20')]);break;}}else{var _0x1ce631=as[_0x2452('0x6c')](_0x192788,_0x17b1ec[_0x2452('0x41')],_0x20875f);_0x4bce9e[_0x243b85](_0x1ce631['text'],_0x1ce631[_0x2452('0x6a')][_0x2452('0x6d')],_0x1ce631[_0x2452('0x6a')][_0x2452('0x20')]);}}}else{var _0x552633=_(_0x15f0e7['query'])[_0x2452('0x43')]()[_0x2452('0x32')](function(_0x4c5192){return _[_0x2452('0x75')](_0x4c6b8a,[_0x2452('0x29'),_0x4c5192])?_0x4c5192:undefined;})[_0x2452('0x76')]()[_0x2452('0x6a')]();if(!_[_0x2452('0x77')](_0x552633)){_0x552633[_0x2452('0x6e')](function(_0x1e9f1a){if(_0x1e9f1a===_0x2452('0x78')){_0x4959a7[_0x2452('0x4a')](_0x2452('0x79'),[][_0x2452('0x7a')](_0x15f0e7[_0x2452('0x42')][_0x1e9f1a]));}else if(_0x1e9f1a===_0x2452('0x7b')){var _0x326570=JSON[_0x2452('0x7c')](_0x15f0e7[_0x2452('0x42')][_0x1e9f1a])['$gte'];var _0x16ca73=JSON[_0x2452('0x7c')](_0x15f0e7[_0x2452('0x42')][_0x1e9f1a])['$lte'];_0x4959a7['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x326570,_0x16ca73);}else{if(_0x15f0e7[_0x2452('0x42')][_0x1e9f1a]===_0x2452('0x7d')){_0x4959a7[_0x2452('0x4a')]('i.'+_0x1e9f1a+_0x2452('0x7e'));}else{_0x4959a7['where']('i.'+_0x1e9f1a+'\x20=\x20?',_0x15f0e7['query'][_0x1e9f1a]);}}});}if(_0x15f0e7[_0x2452('0x42')]['read']){if(_0x15f0e7[_0x2452('0x42')]['read']==0x1){_0x4959a7[_0x2452('0x67')]('`unreadMessages`\x20=\x200');}else{_0x4959a7[_0x2452('0x67')]('`unreadMessages`\x20>\x200');}}if(_0x15f0e7[_0x2452('0x42')][_0x2452('0x7f')]){_0x3a64fc=_[_0x2452('0x80')](_0x15f0e7[_0x2452('0x42')][_0x2452('0x7f')])?_0x15f0e7['query'][_0x2452('0x7f')]:new Array(_0x15f0e7[_0x2452('0x42')][_0x2452('0x7f')]);_0x3a64fc[_0x2452('0x6e')](function(_0x285407){_0x1b8e8b['or'](_0x2452('0x6f'),'%,'+_0x285407+',%');});}if(_0x15f0e7[_0x2452('0x42')][_0x2452('0x81')]){var _0x18f94f=_0x15f0e7[_0x2452('0x42')][_0x2452('0x81')]['replace']('\x5c','\x5c\x5c')[_0x2452('0x82')](/'/g,'\x27\x27');if(qs['isNumeric'](_0x18f94f)){_0x4bce9e['or'](_0x2452('0x83'),_0x18f94f+'%');}else{_0x4bce9e['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs['getFullTextValue'](_0x18f94f))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x18f94f+'%');}}}_0x4959a7['where'](_0x4bce9e);_0x4959a7['group']('i.id');var _0x3e372d={'type':db[_0x2452('0x84')][_0x2452('0x85')]['SELECT'],'raw':!![]};var _0x4ef9ed=_0x4959a7['clone']();_0x4ef9ed[_0x2452('0x4d')](_0x2452('0x86'));_0x4ef9ed[_0x2452('0x4d')](_0x2452('0x87'),_0x2452('0x66'));if(_0x1ef02b[_0x2452('0x48')]){_0x1ef02b[_0x2452('0x48')]['forEach'](function(_0x4046d9){var _0x218103=_0x4046d9[0x0]==='contactName'?_0x4046d9[0x0]:'i.'+_0x4046d9[0x0];_0x4959a7[_0x2452('0x48')](_0x218103,_0x4046d9[0x1]===_0x2452('0x88')?![]:!![]);});}if(!_[_0x2452('0x77')](_0x3a64fc)){_0x4959a7[_0x2452('0x67')](_0x1b8e8b);_0x4ef9ed['where'](_0x2452('0x89'),_0x3a64fc);}BPromise['resolve']()[_0x2452('0x15')](function(){if(!_0x2f1b16){if(_0x15f0e7[_0x2452('0x42')][_0x2452('0x78')])return;_0x4ef9ed[_0x2452('0x4a')](_0x2452('0x8a'));_0x4959a7['where'](_0x2452('0x8a'));return;}if(_0x15f0e7[_0x2452('0x8b')][_0x2452('0x8c')]!==_0x2452('0x2e'))return;return _0x15f0e7['user'][_0x2452('0x8d')]({'attributes':['id'],'raw':!![]})[_0x2452('0x15')](function(_0xdeeeff){if(_[_0x2452('0x77')](_0xdeeeff)){_0x4ef9ed[_0x2452('0x4a')](_0x2452('0x8e'));_0x4959a7[_0x2452('0x4a')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x4ef9ed[_0x2452('0x4a')]('i.ChatWebsiteId\x20IN\x20?',_['map'](_0xdeeeff,'id'));_0x4959a7['where'](_0x2452('0x79'),_[_0x2452('0x32')](_0xdeeeff,'id'));}});})[_0x2452('0x15')](function(){if(_0x15f0e7[_0x2452('0x8b')][_0x2452('0x8c')]===_0x2452('0x2e')&&!_0x2f1b16&&!_0x15f0e7[_0x2452('0x42')][_0x2452('0x78')])return[];return db[_0x2452('0x8f')]['query'](_0x4ef9ed['toString'](),_0x3e372d);})['then'](function(_0x28c8a8){_0x55de3d['count']=_0x28c8a8['length'];if(_0x55de3d[_0x2452('0x90')]===0x0)return[];return db[_0x2452('0x8f')][_0x2452('0x42')](_0x443cf9[_0x2452('0x91')](),_0x3e372d)[_0x2452('0x15')](function(_0x4f51bb){_0x4ec01a=_[_0x2452('0x92')](_0x4f51bb,'id');_0x3e372d=_[_0x2452('0x93')](_0x3e372d,{'model':db[_0x2452('0x94')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15f0e7[_0x2452('0x42')][_0x2452('0x95')]){_0x1ef02b['attributes'][_0x2452('0x6e')](function(_0x5bc8e4){_0x4959a7[_0x2452('0x4d')]('i.'+_0x5bc8e4);});}else{_0x4959a7[_0x2452('0x4d')](_0x2452('0x87'),_0x2452('0x66'));_0x4959a7[_0x2452('0x4d')](_0x2452('0x96'),'Account.key');_0x4959a7['field'](_0x2452('0x97'),_0x2452('0x98'));_0x4959a7[_0x2452('0x4d')](_0x2452('0x99'),_0x2452('0x9a'));_0x4959a7[_0x2452('0x4d')]('i.*');_0x4959a7[_0x2452('0x4d')](_0x2452('0x9b'),_0x2452('0x9c'));_0x4959a7[_0x2452('0x4d')]('c.lastName',_0x2452('0x9d'));_0x4959a7[_0x2452('0x4d')](_0x2452('0x9e'),_0x2452('0x9f'));_0x4959a7['field']('c.phone',_0x2452('0xa0'));_0x4959a7[_0x2452('0x4d')](_0x2452('0xa1'),'Contact.mobile');_0x4959a7[_0x2452('0x4d')](_0x2452('0xa2'),'Contact.fax');_0x4959a7['field']('o.fullname',_0x2452('0xa3'));_0x4959a7[_0x2452('0x4d')](_0x2452('0xa4'),'Owner.internal');_0x4959a7[_0x2452('0x4d')](_0x2452('0xa5'),_0x2452('0x34'));}if(_0x1ef02b['limit'])_0x4959a7['limit'](_0x1ef02b[_0x2452('0x24')]);if(_0x1ef02b['offset'])_0x4959a7[_0x2452('0x22')](_0x1ef02b[_0x2452('0x22')]);return db['sequelize'][_0x2452('0x42')](_0x4959a7[_0x2452('0x91')](),_0x3e372d);})[_0x2452('0x15')](function(_0x485f2a){if(_0x485f2a[_0x2452('0xa6')]>0x0)_0x18ec2d[_0x2452('0x4a')]('ui.ChatInteractionId\x20IN\x20?',_[_0x2452('0x32')](_0x485f2a,'id'));return db[_0x2452('0x8f')][_0x2452('0x42')](_0x18ec2d[_0x2452('0x91')](),_0x3e372d)[_0x2452('0x15')](function(_0x229c79){var _0x3454e4=_['groupBy'](_0x229c79,_0x2452('0xa7'));var _0x114ffd=[];_0x485f2a[_0x2452('0x6e')](function(_0x1e3399){_0x114ffd[_0x2452('0xa8')](updateChatInteraction(_0x1e3399,_0x4ec01a,_0x3454e4));});return BPromise[_0x2452('0xa9')](_0x114ffd);});});})[_0x2452('0x15')](function(_0x28bf18){_0x55de3d[_0x2452('0xaa')]=_0x28bf18;return _0x55de3d;})['then'](respondWithFilteredResult(_0x5e400a,_0x1ef02b))[_0x2452('0xab')](handleError(_0x5e400a,null));};exports[_0x2452('0xac')]=function(_0x37957b,_0x37cf09){var _0x360076={'raw':![],'where':{'id':_0x37957b[_0x2452('0xad')]['id']}},_0x28f93c={};_0x28f93c[_0x2452('0x45')]=_[_0x2452('0x43')](db[_0x2452('0x94')][_0x2452('0x3f')]);_0x28f93c['query']=_[_0x2452('0x43')](_0x37957b[_0x2452('0x42')]);_0x28f93c[_0x2452('0x4b')]=_['intersection'](_0x28f93c['model'],_0x28f93c[_0x2452('0x42')]);_0x360076['attributes']=_[_0x2452('0x44')](_0x28f93c[_0x2452('0x45')],qs[_0x2452('0x95')](_0x37957b[_0x2452('0x42')]['fields']));_0x360076[_0x2452('0x46')]=_0x360076[_0x2452('0x46')][_0x2452('0xa6')]?_0x360076[_0x2452('0x46')]:_0x28f93c[_0x2452('0x45')];if(_0x37957b[_0x2452('0x42')][_0x2452('0xae')]){_0x360076[_0x2452('0xaf')]=[{'all':!![]}];}_0x360076=_[_0x2452('0x93')]({},_0x360076,_0x37957b[_0x2452('0xb0')]);return db[_0x2452('0x94')]['find'](_0x360076)['then'](handleEntityNotFound(_0x37cf09,null))['then'](respondWithResult(_0x37cf09,null))[_0x2452('0xab')](handleError(_0x37cf09,null));};exports[_0x2452('0xb1')]=function(_0x430133,_0x2d12f1){return db[_0x2452('0x94')][_0x2452('0xb1')](_0x430133['body'],{})['then'](respondWithResult(_0x2d12f1,0xc9))[_0x2452('0xab')](handleError(_0x2d12f1,null));};exports[_0x2452('0x27')]=function(_0x3ccc5c,_0x39236b){if(_0x3ccc5c[_0x2452('0x2c')]['id']){delete _0x3ccc5c[_0x2452('0x2c')]['id'];}return db[_0x2452('0x94')][_0x2452('0x65')]({'where':{'id':_0x3ccc5c[_0x2452('0xad')]['id']}})[_0x2452('0x15')](handleEntityNotFound(_0x39236b,null))['then'](saveUpdates(_0x3ccc5c[_0x2452('0x2c')],null))[_0x2452('0x15')](respondWithResult(_0x39236b,null))[_0x2452('0xab')](handleError(_0x39236b,null));};exports[_0x2452('0xb2')]=function(_0x1ae483,_0x444447){return db[_0x2452('0x94')][_0x2452('0x65')]({'where':{'id':_0x1ae483[_0x2452('0xad')]['id']}})[_0x2452('0x15')](handleEntityNotFound(_0x444447,null))[_0x2452('0x15')](removeEntity(_0x444447,null))[_0x2452('0xab')](handleError(_0x444447,null));};exports[_0x2452('0xb3')]=function(_0x132ae5,_0x1b9e68){return db[_0x2452('0x94')][_0x2452('0xb3')]()[_0x2452('0x15')](respondWithResult(_0x1b9e68,null))[_0x2452('0xab')](handleError(_0x1b9e68,null));};exports['createVidaooSession']=function(_0x39728d,_0x35365c){var _0x27cc0c=_0x39728d[_0x2452('0xad')]['id'];var _0x2e6ca3;var _0x44677c;var _0x3eeda5;return db[_0x2452('0x94')]['findOne']({'where':{'id':_0x27cc0c}})[_0x2452('0x15')](function(_0x327495){_0x2e6ca3=_0x327495;return db[_0x2452('0xb4')][_0x2452('0xb5')]({'where':{'id':_0x327495[_0x2452('0x78')]},'attributes':['id',_0x2452('0xb6'),'vidaooEscalation','vidaooTopic','vidaooNote',_0x2452('0xb7')],'raw':!![]});})[_0x2452('0x15')](function(_0xe486f7){if(_0xe486f7&&_0xe486f7[_0x2452('0xb6')]&&_0xe486f7[_0x2452('0xb8')]){_0x44677c=_0xe486f7;var _0x593025={'interaction':{'id':_0x27cc0c},'agent':{'id':_0x39728d[_0x2452('0x8b')]['id'],'name':_0x39728d['user'][_0x2452('0x29')],'fullname':_0x39728d[_0x2452('0x8b')][_0x2452('0x33')],'email':_0x39728d['user']['email']},'contact':_0x39728d[_0x2452('0x2c')]['contact'],'account':_0x39728d[_0x2452('0x2c')][_0x2452('0x30')]};var _0xb4400a={'rejectUnauthorized':![],'method':_0x2452('0xb9'),'url':_0x2452('0xba'),'headers':{'X-APIKEY':_0xe486f7[_0x2452('0xb6')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x39728d['user']['email']],'buttons':null,'topic':_0x44677c['vidaooTopic'],'note':_['isNull'](_0x44677c[_0x2452('0xbb')])?null:getMustacheRender(_0x44677c[_0x2452('0xbb')],_0x593025),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x44677c[_0x2452('0xb7')])){var _0x3afe7f=getMustacheRender(_0x44677c['vidaooMetadata'],_0x593025);var _0x3a8e0b=JSON[_0x2452('0x7c')](_0x3afe7f);_0xb4400a[_0x2452('0x2c')][_0x2452('0xbc')]=_0x3a8e0b;}}catch(_0x3a8057){throw new db[(_0x2452('0x84'))]['ValidationError'](_0x2452('0xbd'));}return rp(_0xb4400a);}else{throw new db[(_0x2452('0x84'))][(_0x2452('0xbe'))](_0x2452('0xbf'));}})[_0x2452('0x15')](function(_0x572caa){_0x3eeda5=_0x572caa;if(_0x3eeda5['id']){var _0x257dfd={'body':_0x3eeda5[_0x2452('0xc0')],'ChatWebsiteId':_0x44677c['id'],'ChatInteractionId':_0x2e6ca3['id'],'direction':'out','UserId':_0x39728d['user']['id']};return db[_0x2452('0xc1')][_0x2452('0xb1')](_0x257dfd,{});}else{throw new db[(_0x2452('0x84'))][(_0x2452('0xbe'))]('Unable\x20to\x20create\x20Vidaoo\x20session');}})[_0x2452('0x15')](function(){return _0x2e6ca3[_0x2452('0xc2')]({'vidaooSessionId':_0x3eeda5['id']});})[_0x2452('0x15')](respondWithResult(_0x35365c,null))[_0x2452('0xab')](handleError(_0x35365c,null));};exports[_0x2452('0xc3')]=function(_0x27ac75,_0x73af1a){if(_0x27ac75[_0x2452('0x2c')]['id']){delete _0x27ac75[_0x2452('0x2c')]['id'];}return db['ChatInteraction'][_0x2452('0x65')]({'where':{'id':_0x27ac75['params']['id']},'include':[{'model':db['CmContact'],'as':_0x2452('0xc4')}]})[_0x2452('0x15')](handleEntityNotFound(_0x73af1a,null))[_0x2452('0x15')](saveUpdates(_0x27ac75[_0x2452('0x2c')],null))[_0x2452('0x15')](respondWithResult(_0x73af1a,null))['catch'](handleError(_0x73af1a,null));};exports[_0x2452('0xc5')]=function(_0x5c1308,_0x4b02e6){if(_0x5c1308['body']['id']){delete _0x5c1308[_0x2452('0x2c')]['id'];}return db[_0x2452('0x94')][_0x2452('0x65')]({'where':{'id':_0x5c1308[_0x2452('0xad')]['id']}})[_0x2452('0x15')](function(_0x1e45ff){if(!_0x1e45ff){logger[_0x2452('0x1b')](_0x2452('0xc6'),_0x2452('0xc5'),0x194,_0x2452('0xc7'));_0x4b02e6['sendStatus'](0x194);}else{if(_0x1e45ff[_0x2452('0x3e')]){throw new db['Sequelize']['ValidationError'](_0x2452('0xc8'));}}return _0x1e45ff;})['then'](function(_0x703ee5){if(_0x703ee5){return _0x703ee5[_0x2452('0x27')]({'closed':_0x5c1308[_0x2452('0x2c')][_0x2452('0x3c')],'disposition':_0x5c1308['body'][_0x2452('0xc9')]})[_0x2452('0x15')](function(_0x419529){return _0x419529;});}})[_0x2452('0x15')](function(){return respondWithRpcPromise(_0x2452('0xca'),_0x2452('0xc5'),_0x5c1308[_0x2452('0x2c')],client9004);})[_0x2452('0x15')](respondWithResult(_0x4b02e6,null))[_0x2452('0xab')](handleError(_0x4b02e6,null));};exports['attachmentUpload']=function(_0x26dbe2,_0x3be01e){_0x26dbe2[_0x2452('0x2c')]['name']=_0x26dbe2[_0x2452('0xcb')]['originalname'];_0x26dbe2[_0x2452('0x2c')][_0x2452('0xcc')]=_0x26dbe2[_0x2452('0xcb')][_0x2452('0xcd')];_0x26dbe2[_0x2452('0x2c')]['type']=_0x26dbe2[_0x2452('0xcb')]['mimetype'];return db['Attachment']['create'](_0x26dbe2[_0x2452('0x2c')])['then'](respondWithResult(_0x3be01e,0xc9))[_0x2452('0xab')](handleError(_0x3be01e,null));};exports['attachmentDownload']=function(_0x12b4c6,_0x59fb94){return db[_0x2452('0x94')][_0x2452('0xb5')]({'where':{'id':_0x12b4c6[_0x2452('0xad')]['id']},'raw':!![]})[_0x2452('0x15')](handleEntityNotFound(_0x59fb94,null))[_0x2452('0x15')](function(_0x17f759){if(_0x17f759){if(_0x17f759['closed']){return _0x59fb94[_0x2452('0x1f')](0x193)['json']({'status':0x193,'message':_0x2452('0xce')});}return db[_0x2452('0xcf')][_0x2452('0xb5')]({'where':{'id':_0x12b4c6[_0x2452('0x42')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x59fb94,null));}})[_0x2452('0x15')](function(_0xc91e25){if(_0xc91e25){var _0xf07c57=_0xc91e25[_0x2452('0xd0')]!==null;var _0x5edb11=path[_0x2452('0xd1')](config[_0x2452('0xd2')],'server/files/attachments/');if(_0xf07c57){_0x5edb11=path[_0x2452('0xd1')](_0x5edb11,_0x2452('0xd3'));}var _0x19722b=path[_0x2452('0xd1')](_0x5edb11,_0xc91e25['basename']);return _0x59fb94[_0x2452('0xd4')](_0x19722b);}})[_0x2452('0xab')](handleError(_0x59fb94,null));};exports['close']=function(_0x4e342c,_0x4e8fd9){var _0x173d77=null;var _0x3c454d=null;var _0x47ba11=null;if(_0x4e342c['body']['id']){delete _0x4e342c[_0x2452('0x2c')]['id'];}if(_0x4e342c[_0x2452('0x2c')][_0x2452('0xd5')]){_0x47ba11=path[_0x2452('0xd1')](config[_0x2452('0xd2')],_0x2452('0xd6'),util[_0x2452('0xd7')](_0x2452('0xd8'),Date[_0x2452('0xd9')]()));_0x4e342c[_0x2452('0x2c')][_0x2452('0xda')]=_0x47ba11;}return db['ChatInteraction'][_0x2452('0x65')]({'where':{'id':_0x4e342c['params']['id']},'include':[{'model':db[_0x2452('0xc1')],'as':_0x2452('0xdb'),'include':[{'model':db[_0x2452('0x70')],'as':_0x2452('0x70')}]}]})['then'](handleEntityNotFound(_0x4e8fd9,null))[_0x2452('0x15')](saveUpdates(_0x4e342c[_0x2452('0x2c')],null))[_0x2452('0x15')](function(_0x3682ee){if(_0x3682ee){_0x173d77=_0x3682ee;return db[_0x2452('0xb4')][_0x2452('0x65')]({'where':{'id':_0x173d77[_0x2452('0x78')]}});}})[_0x2452('0x15')](function(_0x283cb3){if(_0x283cb3){_0x3c454d=_0x283cb3;return db[_0x2452('0xdc')]['find']({'where':{'id':_0x173d77['ContactId']}});}})[_0x2452('0x15')](function(_0x48ce24){if(_0x48ce24){if(_0x47ba11){var _0x38c7a0=null;for(var _0x48eff7=0x1;_0x48eff7<_0x173d77[_0x2452('0xdb')][_0x2452('0xa6')];++_0x48eff7){_0x38c7a0=_0x173d77[_0x2452('0xdb')][_0x48eff7];var _0x1f0117=_0x38c7a0[_0x2452('0x3e')]?util[_0x2452('0xd7')](_0x2452('0xdd'),_0x3c454d[_0x2452('0xde')],_0x38c7a0[_0x2452('0x3e')]):_0x2452('0xdf');var _0x53ac7a=_0x4e342c['body'][_0x2452('0xe0')]||util[_0x2452('0xd7')](_0x2452('0xdd'),_0x2452('0xe1'),_0x38c7a0[_0x2452('0x6b')]);switch(_0x3c454d[_0x2452('0xe2')]){case _0x2452('0xe3'):_0x1f0117=_0x38c7a0['UserId']?util[_0x2452('0xd7')]('%s%d',_0x3c454d['agentAlias'],_0x38c7a0[_0x2452('0x3e')]):'System';break;case _0x2452('0xe4'):_0x1f0117=_0x38c7a0['UserId']?_0x38c7a0[_0x2452('0x70')][_0x2452('0xe5')]||_0x38c7a0[_0x2452('0x70')][_0x2452('0x33')]:_0x2452('0xdf');break;case _0x2452('0xe6'):_0x1f0117=_0x38c7a0[_0x2452('0x3e')]?_0x38c7a0[_0x2452('0x70')][_0x2452('0x33')]:_0x2452('0xdf');break;default:_0x1f0117=_0x38c7a0['UserId']?util[_0x2452('0xd7')](_0x2452('0xdd'),_0x3c454d[_0x2452('0xde')],_0x38c7a0[_0x2452('0x3e')]):_0x2452('0xdf');}var _0x3d223d=util['format'](_0x2452('0xe7'),moment(_0x38c7a0[_0x2452('0x7b')])[_0x2452('0xd7')](_0x2452('0xe8')),_0x38c7a0[_0x2452('0xe9')]==='in'?_0x53ac7a:_0x1f0117,_0x38c7a0[_0x2452('0x2c')]);if(!_0x38c7a0['secret']){fs[_0x2452('0xea')](_0x47ba11,_0x3d223d);}}return db[_0x2452('0xeb')][_0x2452('0xb5')]({'where':{'service':!![]},'include':[{'model':db[_0x2452('0xec')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x2452('0xed')],'as':_0x2452('0xed'),'raw':!![]}]}]});}}})['then'](function(_0x8392be){if(!_0x8392be||!_0x8392be[_0x2452('0xee')]||!_0x4e342c[_0x2452('0x2c')])return _0x173d77;var _0x1c5ccc=_0x8392be[_0x2452('0xef')]();return respondWithRpcPromise(_0x2452('0xf0'),'sendMail',{'account':_0x1c5ccc,'message':{'from':util[_0x2452('0xd7')]('\x22%s\x22\x20<%s>',_0x8392be['name'],_0x8392be[_0x2452('0xf1')]||_0x8392be[_0x2452('0xee')][_0x2452('0x8b')]),'to':_0x4e342c['body']['mailTranscript'],'subject':_0x2452('0xf2'),'text':util[_0x2452('0xd7')](_0x2452('0xf3'),_0x4e342c[_0x2452('0x2c')][_0x2452('0xd5')]),'attachments':[{'path':_0x47ba11}]}})[_0x2452('0x15')](function(){return _0x173d77;})[_0x2452('0xab')](function(_0x2cd73c){logger[_0x2452('0x1b')](_0x2cd73c);});})['then'](respondWithStatusCode(_0x4e8fd9,0xc8))['catch'](handleError(_0x4e8fd9,null));};exports[_0x2452('0xf4')]=function(_0x3a79d9,_0xd86a41){return db[_0x2452('0xc1')][_0x2452('0x65')]({'where':{'id':_0x3a79d9['params']['id']}})[_0x2452('0x15')](handleEntityNotFound(_0xd86a41,null))[_0x2452('0x15')](function(_0x56d8b6){if(_0x56d8b6){return _0x56d8b6[_0x2452('0xf4')](_0x3a79d9['body']['ids'],_[_0x2452('0xf5')](_0x3a79d9[_0x2452('0x2c')],[_0x2452('0xf6'),'id'])||{});}})[_0x2452('0x15')](respondWithResult(_0xd86a41,null))[_0x2452('0xab')](handleError(_0xd86a41,null));};exports['getMessages']=function(_0x2ec7b4,_0x2395e0){var _0x5d2e57={'raw':![],'where':{}};var _0x39936f={};var _0x5481d5={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2452('0xb5')]({'where':{'id':_0x2ec7b4[_0x2452('0xad')]['id']}})[_0x2452('0x15')](handleEntityNotFound(_0x2395e0,null))[_0x2452('0x15')](function(_0x56a09d){if(_0x56a09d){_0x39936f[_0x2452('0x45')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x39936f[_0x2452('0x42')]=_['keys'](_0x2ec7b4[_0x2452('0x42')]);_0x39936f[_0x2452('0x4b')]=_[_0x2452('0x44')](_0x39936f[_0x2452('0x45')],_0x39936f[_0x2452('0x42')]);_0x5d2e57[_0x2452('0x46')]=_[_0x2452('0x44')](_0x39936f[_0x2452('0x45')],qs[_0x2452('0x95')](_0x2ec7b4['query'][_0x2452('0x95')]));_0x5d2e57[_0x2452('0x46')]=_0x5d2e57[_0x2452('0x46')][_0x2452('0xa6')]?_0x5d2e57[_0x2452('0x46')]:_0x39936f[_0x2452('0x45')];if(!_0x2ec7b4['query'][_0x2452('0x47')](_0x2452('0xf7'))){_0x5d2e57[_0x2452('0x24')]=qs['limit'](_0x2ec7b4['query'][_0x2452('0x24')]);_0x5d2e57['offset']=qs[_0x2452('0x22')](_0x2ec7b4[_0x2452('0x42')][_0x2452('0x22')]);}_0x5d2e57[_0x2452('0x48')]=qs[_0x2452('0x49')](_0x2ec7b4[_0x2452('0x42')][_0x2452('0x49')]);_0x5d2e57['where']=qs['filters'](_[_0x2452('0x4c')](_0x2ec7b4[_0x2452('0x42')],_0x39936f['filters']));_0x5d2e57[_0x2452('0x4a')][_0x2452('0xa7')]=_0x56a09d['id'];if(_0x2ec7b4['query'][_0x2452('0x81')]){_0x5d2e57[_0x2452('0x4a')]=_[_0x2452('0x93')](_0x5d2e57[_0x2452('0x4a')],{'$or':_['map'](_0x5d2e57[_0x2452('0x46')],function(_0x1e6e2c){var _0x45d809={};_0x45d809[_0x1e6e2c]={'$like':'%'+_0x2ec7b4[_0x2452('0x42')][_0x2452('0x81')]+'%'};return _0x45d809;})});}if(_0x2ec7b4['query'][_0x2452('0xf8')]){var _0x4806e4=_0x2ec7b4[_0x2452('0x42')]['$gte']['split'](',');var _0x519968={};_0x519968[_0x4806e4[0x0]]={'$gte':moment(_0x4806e4[0x1])[_0x2452('0xd7')](_0x2452('0xf9'))};_0x5d2e57[_0x2452('0x4a')]=_[_0x2452('0x93')](_0x5d2e57[_0x2452('0x4a')],_0x519968);}_0x5d2e57=_[_0x2452('0x93')]({},_0x5d2e57,_0x2ec7b4[_0x2452('0xb0')]);return db['ChatMessage']['count']({'where':_0x5d2e57['where']})['then'](function(_0x582812){_0x5481d5['count']=_0x582812;if(_0x2ec7b4[_0x2452('0x42')]['includeAll']){_0x5d2e57[_0x2452('0xaf')]=[{'all':!![]}];}return db['ChatMessage'][_0x2452('0xfa')](_0x5d2e57);})[_0x2452('0x15')](function(_0x42d5af){_0x5481d5['rows']=_0x42d5af;return _0x5481d5;});}})[_0x2452('0x15')](respondWithFilteredResult(_0x2395e0,_0x5d2e57))[_0x2452('0xab')](handleError(_0x2395e0,null));};exports[_0x2452('0xfb')]=function(_0x23c05e,_0x447013){var _0xaa3e42={'where':{}},_0x10a04f={},_0x4eaad6={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x2452('0xb5')]({'where':{'id':_0x23c05e[_0x2452('0xad')]['id']}})[_0x2452('0x15')](handleEntityNotFound(_0x447013,null))[_0x2452('0x15')](function(_0x59c8d3){if(_0x59c8d3){_0x10a04f[_0x2452('0x45')]=_[_0x2452('0x43')](db[_0x2452('0xc1')]['rawAttributes']);_0x10a04f[_0x2452('0x42')]=_[_0x2452('0x43')](_0x23c05e[_0x2452('0x42')]);_0x10a04f['filters']=_[_0x2452('0x44')](_0x10a04f[_0x2452('0x45')],_0x10a04f['query']);_0xaa3e42['attributes']=_['intersection'](_0x10a04f[_0x2452('0x45')],qs[_0x2452('0x95')](_0x23c05e[_0x2452('0x42')]['fields']));_0xaa3e42[_0x2452('0x46')]=_0xaa3e42['attributes']['length']?_0xaa3e42[_0x2452('0x46')]:_0x10a04f[_0x2452('0x45')];if(!_0x23c05e[_0x2452('0x42')]['hasOwnProperty'](_0x2452('0xf7'))){_0xaa3e42[_0x2452('0x24')]=qs[_0x2452('0x24')](_0x23c05e[_0x2452('0x42')][_0x2452('0x24')]);_0xaa3e42[_0x2452('0x22')]=qs[_0x2452('0x22')](_0x23c05e[_0x2452('0x42')][_0x2452('0x22')]);}_0xaa3e42[_0x2452('0x48')]=qs[_0x2452('0x49')](_0x23c05e[_0x2452('0x42')]['sort']);_0xaa3e42[_0x2452('0x4a')]=qs[_0x2452('0x4b')](_[_0x2452('0x4c')](_0x23c05e['query'],_0x10a04f[_0x2452('0x4b')]));_0xaa3e42['where']['ChatInteractionId']=_0x59c8d3['id'];if(_0x23c05e[_0x2452('0x42')][_0x2452('0x81')]){_0xaa3e42['where']=_[_0x2452('0x93')](_0xaa3e42['where'],{'$or':_['map'](_0xaa3e42[_0x2452('0x46')],function(_0x59a23a){var _0x1d4f38={};_0x1d4f38[_0x59a23a]={'$like':'%'+_0x23c05e[_0x2452('0x42')][_0x2452('0x81')]+'%'};return _0x1d4f38;})});}_0xaa3e42[_0x2452('0x4a')][_0x2452('0xfc')]=![];if(_0x23c05e[_0x2452('0x42')]['id']){_0xaa3e42[_0x2452('0x4a')]['id']={'$gt':_0x23c05e[_0x2452('0x42')]['id']};}_0xaa3e42=_[_0x2452('0x93')]({},_0xaa3e42,_0x23c05e[_0x2452('0xb0')]);return db[_0x2452('0xc1')][_0x2452('0x90')]({'where':_0xaa3e42[_0x2452('0x4a')]})[_0x2452('0x15')](function(_0x1a04a9){_0x4eaad6['count']=_0x1a04a9;_0xaa3e42[_0x2452('0xaf')]=[];if(_0x23c05e[_0x2452('0x42')]['includeAgent']){_0xaa3e42[_0x2452('0xaf')][_0x2452('0xa8')]({'model':db[_0x2452('0x70')],'as':_0x2452('0x70'),'attributes':['id',_0x2452('0x33'),_0x2452('0xe5')]});}if(_0x23c05e['query'][_0x2452('0xae')]){_0xaa3e42[_0x2452('0xaf')]=[{'all':!![]}];}return db[_0x2452('0xc1')][_0x2452('0xfa')](_0xaa3e42);})[_0x2452('0x15')](function(_0x198a21){_0x4eaad6[_0x2452('0xaa')]=_0x198a21;return _0x4eaad6;});}})[_0x2452('0x15')](respondWithFilteredResult(_0x447013,_0xaa3e42))[_0x2452('0xab')](handleError(_0x447013,null));};exports['addTags']=function(_0x35a94a,_0x40d4ed){return db['ChatInteraction']['find']({'where':{'id':_0x35a94a[_0x2452('0xad')]['id']}})['then'](handleEntityNotFound(_0x40d4ed,null))[_0x2452('0x15')](function(_0x5edce1){if(_0x5edce1){return _0x5edce1['setTags'](_0x35a94a[_0x2452('0x2c')][_0x2452('0xf6')],_[_0x2452('0xf5')](_0x35a94a[_0x2452('0x2c')],['ids','id'])||{})[_0x2452('0xfd')](function(){return db[_0x2452('0xfe')][_0x2452('0xfa')]({'attributes':['id','name','color'],'where':{'id':_0x35a94a[_0x2452('0x2c')][_0x2452('0xf6')]}});})[_0x2452('0x15')](function(_0x578cb2){socket['emit'](_0x2452('0xff'),{'id':Number(_0x35a94a[_0x2452('0xad')]['id']),'tags':_0x578cb2||[]});return{'id':Number(_0x35a94a['params']['id']),'tags':_0x578cb2||[]};});}})[_0x2452('0x15')](respondWithResult(_0x40d4ed,null))[_0x2452('0xab')](handleError(_0x40d4ed,null));};exports['removeTags']=function(_0x29aa63,_0x12cf38){return db[_0x2452('0x94')]['find']({'where':{'id':_0x29aa63[_0x2452('0xad')]['id']}})['then'](handleEntityNotFound(_0x12cf38,null))[_0x2452('0x15')](function(_0x3ce9bf){if(_0x3ce9bf){return _0x3ce9bf[_0x2452('0x100')](_0x29aa63[_0x2452('0x42')][_0x2452('0xf6')]);}})[_0x2452('0x15')](respondWithStatusCode(_0x12cf38,null))[_0x2452('0xab')](handleError(_0x12cf38,null));};exports[_0x2452('0xd4')]=function(_0xa57faf,_0x238d8e){var _0x25968d=moment()[_0x2452('0x101')]()['toString']();var _0x16d2fc=path[_0x2452('0xd1')](config['root'],_0x2452('0x102'),_0x2452('0x103'),_0x2452('0x104'));var _0xfdca38=path[_0x2452('0xd1')](config[_0x2452('0xd2')],_0x2452('0x102'),_0x2452('0x103'),_0x2452('0x105'));var _0x56575a=path[_0x2452('0xd1')](_0x16d2fc,_0x25968d);var _0x4724d2=util['format'](_0x2452('0x106'),_0xa57faf[_0x2452('0xad')]['id'],_0x25968d);var _0x98ad63=path['join'](_0x16d2fc,_0x4724d2);var _0x4d2a07=[];_0x4d2a07[_0x2452('0xa8')]({'model':db[_0x2452('0x70')],'as':_0x2452('0x70'),'attributes':['id',_0x2452('0x33')],'raw':!![]});_0x4d2a07['push']({'model':db[_0x2452('0xdc')],'as':'Contact','attributes':['id','firstName',_0x2452('0x107')],'raw':!![]});if(_0xa57faf[_0x2452('0x42')][_0x2452('0x105')]){_0x4d2a07[_0x2452('0xa8')]({'model':db[_0x2452('0xcf')],'as':'Attachment','raw':!![]});}var _0x4faf49=[{'model':db[_0x2452('0xc1')],'as':_0x2452('0xdb'),'attributes':['id',_0x2452('0x2c'),'createdAt',_0x2452('0xe9'),_0x2452('0xfc'),_0x2452('0x108')],'include':_0x4d2a07}];_0x4faf49[_0x2452('0xa8')]({'model':db[_0x2452('0xb4')],'as':_0x2452('0x109'),'attributes':['id',_0x2452('0x29')]});_0x4faf49[_0x2452('0xa8')]({'model':db['User'],'as':'Owner','attributes':['id',_0x2452('0x33')]});return db[_0x2452('0x94')]['find']({'where':{'id':_0xa57faf[_0x2452('0xad')]['id']},'include':_0x4faf49})[_0x2452('0x15')](handleEntityNotFound(_0x238d8e,null))[_0x2452('0x15')](function(_0x160781){if(_0x160781){var _0x16aa9b=_0x160781['get']({'plain':!![]});fs['mkdirSync'](_0x56575a);var _0x19660b={'channel':_0x2452('0x10a'),'account':_0x16aa9b['Account'][_0x2452('0x29')],'agent':_0x16aa9b['Owner']?_0x16aa9b[_0x2452('0x10b')][_0x2452('0x33')]:'N.A.','createdAt':moment(_0x16aa9b['createdAt'])[_0x2452('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2452('0x91')](),'closedAt':_0x16aa9b[_0x2452('0x3c')]?moment(_0x16aa9b[_0x2452('0x10c')])[_0x2452('0xd7')](_0x2452('0xf9'))['toString']():'','disposition':_0x16aa9b[_0x2452('0xc9')],'chatInfo':{'browser':_0x16aa9b[_0x2452('0x10d')],'os':_0x16aa9b[_0x2452('0x10e')],'referer':_0x16aa9b[_0x2452('0x10f')],'customerIp':_0x16aa9b[_0x2452('0x110')],'customerPort':_0x16aa9b[_0x2452('0x111')]?_0x16aa9b['customerPort']:'N.A.'},'messages':_(_0x16aa9b[_0x2452('0xdb')])[_0x2452('0x112')]()[_0x2452('0x81')]({'secret':![]})[_0x2452('0x32')](function(_0x362b56){if(_0x362b56[_0x2452('0xcf')]){var _0x27b007=path[_0x2452('0xd1')](_0xfdca38,_0x362b56[_0x2452('0xcf')]['basename']);if(fs[_0x2452('0x113')](_0x27b007)){fs[_0x2452('0x114')](_0x27b007)[_0x2452('0x115')](fs['createWriteStream'](path[_0x2452('0xd1')](_0x56575a,_0x362b56['Attachment'][_0x2452('0xcc')])));}}return{'date':moment(_0x362b56['createdAt'])[_0x2452('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x362b56[_0x2452('0xe9')]===_0x2452('0x116')?_0x362b56['User']?_0x362b56[_0x2452('0x70')][_0x2452('0x33')]:_0x2452('0xdf'):_0x362b56[_0x2452('0xc4')][_0x2452('0x117')]+(_0x362b56[_0x2452('0xc4')][_0x2452('0x107')]?'\x20'+_0x362b56[_0x2452('0xc4')][_0x2452('0x107')]:''),'body':_0x362b56['Attachment']?_0x362b56[_0x2452('0xcf')][_0x2452('0xcc')]:_0x362b56[_0x2452('0x2c')],'direction':_0x362b56[_0x2452('0xe9')]===_0x2452('0x116')?'A':'C','secret':_0x362b56[_0x2452('0xfc')],'read':_0x362b56[_0x2452('0x108')],'attachment':_0x362b56[_0x2452('0xcf')]};})[_0x2452('0x6a')]()};return ejs[_0x2452('0x118')](path[_0x2452('0xd1')](config[_0x2452('0xd2')],_0x2452('0x102'),_0x2452('0x119'),_0x2452('0x11a')),{'interaction':_0x19660b})['then'](function(_0x388ee5){var _0xe6661a=path[_0x2452('0xd1')](_0x56575a,'transcript-'+_0x16aa9b['id']+'-'+_0x25968d+_0x2452('0x11b'));var _0x4d298d={'path':_0xe6661a,'channel':'Chat','interactionId':_0x16aa9b['id']};return pdf[_0x2452('0x11c')](_0x388ee5,_0x4d298d);})[_0x2452('0x15')](function(){return new Promise(function(_0x4685a1,_0x569219){zipdir(_0x56575a,{'saveTo':_0x98ad63},function(_0x4aa0c4,_0x18d287){if(_0x4aa0c4)return _0x569219(_0x4aa0c4);return _0x4685a1(_0x18d287);});})[_0x2452('0x15')](function(){return new BPromise(function(_0x4f58bc,_0x910348){rimraf(_0x56575a,function(_0x20d1c5){if(_0x20d1c5)_0x910348(_0x20d1c5);return _0x4f58bc();});});})['then'](function(){return _0x238d8e[_0x2452('0xd4')](_0x98ad63,_0x4724d2,function(_0x1b3952){if(_0x1b3952){logger[_0x2452('0x1b')](_0x2452('0x11d'),_0x1b3952);}else{fs[_0x2452('0x11e')](_0x98ad63);}});});});}else{return _0x238d8e[_0x2452('0x1e')](0xc8);}})['catch'](handleError(_0x238d8e,null));};
\ No newline at end of file
+var _0x6f0d=['CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','Mail\x20Transcript','addMessage','ids','omit','getMessages','nolimit','YYYY-MM-DD\x20HH:mm:ss','includeAll','findAll','getMyMessages','includeAgent','alias','setTags','spread','color','emit','chatInteractionTags:save','removeTags','unix','server','tmp','attachments','transcript-%d-%s.zip','firstName','createdAt','direction','Account','mkdirSync','Chat','Owner','N.A.','closedAt','browserName','osName','referer','customerPort','tail','existsSync','createWriteStream','lastName','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','unlinkSync','zip-dir','request-promise','moment','bluebird','util','path','ejs','lodash','squel','../../components/parsers/qs','../../components/export/pdf','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','end','stack','send','render','body','agent','interaction','account','Users','TagIds','Tags','forEach','waiting','talking','answered','abandoned','total','closed','UserId','disposition','map','rawAttributes','key','name','query','filters','intersection','model','fields','attributes','hasOwnProperty','order','sort','where','select','field','from','u.fullname','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','expr','parseSearch','search','sqlOperator','conditions','length','unreadMessages','having','`\x20=\x200','$substring','value','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','keys','compact','isEmpty','i.ChatWebsiteId\x20IN\x20?','parse','$gte','$lte','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','contactName','DESC','resolve','ChatWebsiteId','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','role','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','ChatInteraction','Account.key','Account.mandatoryDisposition','CASE\x20WHEN\x20(c.firstName\x20IS\x20NOT\x20NULL\x20AND\x20c.firstName\x20<>\x20\x27\x27)\x20OR\x20(c.lastName\x20IS\x20NOT\x20NULL\x20AND\x20c.lastName\x20<>\x20\x27\x27)\x20THEN\x20CONCAT(IFNULL(c.firstName,\x20\x27\x27),\x20\x27\x20\x27,\x20IFNULL(c.lastName,\x20\x27\x27))\x20ELSE\x20\x27Unknown\x27\x20END','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','ChatInteractionId','push','all','rows','include','merge','options','find','create','params','describe','findOne','ChatWebsite','vidaooApiKey','vidaooTopic','fullname','email','contact','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','vidaooMetadata','metadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','ChatOfflineMessageId','join','root','server/files/attachments/','download','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages'];(function(_0x34bf42,_0x4fbc9c){var _0x46de16=function(_0x5f4d1c){while(--_0x5f4d1c){_0x34bf42['push'](_0x34bf42['shift']());}};_0x46de16(++_0x4fbc9c);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x557439,_0x522fac){_0x557439=_0x557439-0x0;var _0x5bbcc7=_0x6f0d[_0x557439];return _0x5bbcc7;};'use strict';var rimraf=require('rimraf');var zipdir=require(_0xd6f0('0x0'));var rp=require(_0xd6f0('0x1'));var moment=require(_0xd6f0('0x2'));var BPromise=require(_0xd6f0('0x3'));var Mustache=require('mustache');var util=require(_0xd6f0('0x4'));var path=require(_0xd6f0('0x5'));var ejs=require(_0xd6f0('0x6'));var fs=require('fs');var _=require(_0xd6f0('0x7'));var squel=require(_0xd6f0('0x8'));var Redis=require('ioredis');var qs=require(_0xd6f0('0x9'));var as=require('../../components/parsers/advancedSearch');var pdf=require(_0xd6f0('0xa'));var logger=require(_0xd6f0('0xb'))(_0xd6f0('0xc'));var config=require(_0xd6f0('0xd'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd6f0('0xe')](config[_0xd6f0('0xf')],{'host':_0xd6f0('0x10'),'port':0x18eb});var socket=require(_0xd6f0('0x11'))(new Redis(config[_0xd6f0('0xf')]));require('./chatInteraction.socket')[_0xd6f0('0x12')](socket);var jayson=require(_0xd6f0('0x13'));var client=jayson[_0xd6f0('0x14')][_0xd6f0('0x15')]({'port':0x232b});var client9004=jayson['client'][_0xd6f0('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x2f0459,_0x306aad,_0x45973d,_0x109655){return new BPromise(function(_0x409549,_0x2bf5b8){var _0x250999=_0x109655||client;return _0x250999[_0xd6f0('0x16')](_0x2f0459,_0x45973d)['then'](function(_0x2b3f32){logger[_0xd6f0('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x306aad,_0xd6f0('0x18'));logger['debug'](_0xd6f0('0x19'),_0x306aad,_0xd6f0('0x18'),JSON[_0xd6f0('0x1a')](_0x2b3f32));if(_0x2b3f32[_0xd6f0('0x1b')]){if(_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1c')]===0x1f4){logger[_0xd6f0('0x1b')](_0xd6f0('0x1d'),_0x306aad,_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1e')]);return _0x2bf5b8(_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1e')]);}logger[_0xd6f0('0x1b')](_0xd6f0('0x1d'),_0x306aad,_0x2b3f32[_0xd6f0('0x1b')][_0xd6f0('0x1e')]);return _0x409549(_0x2b3f32['error']['message']);}else{logger[_0xd6f0('0x17')](_0xd6f0('0x1d'),_0x306aad,_0xd6f0('0x18'));_0x409549(_0x2b3f32['result'][_0xd6f0('0x1e')]);}})[_0xd6f0('0x1f')](function(_0x557c9b){logger[_0xd6f0('0x1b')]('ChatInteraction,\x20%s,\x20%s',_0x306aad,_0x557c9b);_0x2bf5b8(_0x557c9b);});});}function respondWithStatusCode(_0x1ee584,_0x1c9d90){_0x1c9d90=_0x1c9d90||0xcc;return function(_0x5dbe1c){if(_0x5dbe1c){return _0x1ee584[_0xd6f0('0x20')](_0x1c9d90);}return _0x1ee584[_0xd6f0('0x21')](_0x1c9d90)['end']();};}function respondWithResult(_0x3dbdc3,_0x402070){_0x402070=_0x402070||0xc8;return function(_0x283a07){if(_0x283a07){return _0x3dbdc3['status'](_0x402070)[_0xd6f0('0x22')](_0x283a07);}};}function respondWithFilteredResult(_0x3dc166,_0x5ecb16){return function(_0xcea0ae){if(_0xcea0ae){var _0x551be8=typeof _0x5ecb16[_0xd6f0('0x23')]===_0xd6f0('0x24')&&typeof _0x5ecb16[_0xd6f0('0x25')]===_0xd6f0('0x24');var _0x4101bd=_0xcea0ae[_0xd6f0('0x26')];var _0x12d6ec=_0x551be8?0x0:_0x5ecb16[_0xd6f0('0x23')];var _0x48975d=_0x551be8?_0xcea0ae[_0xd6f0('0x26')]:_0x5ecb16[_0xd6f0('0x23')]+_0x5ecb16['limit'];var _0x38a3e9;if(_0x48975d>=_0x4101bd){_0x48975d=_0x4101bd;_0x38a3e9=0xc8;}else{_0x38a3e9=0xce;}_0x3dc166[_0xd6f0('0x21')](_0x38a3e9);return _0x3dc166[_0xd6f0('0x27')](_0xd6f0('0x28'),_0x12d6ec+'-'+_0x48975d+'/'+_0x4101bd)[_0xd6f0('0x22')](_0xcea0ae);}return null;};}function saveUpdates(_0x39e96a){return function(_0x351fda){if(_0x351fda){return _0x351fda[_0xd6f0('0x29')](_0x39e96a)[_0xd6f0('0x2a')](function(_0x43f72f){return _0x43f72f;});}return null;};}function removeEntity(_0x1dff9b){return function(_0x3e913a){if(_0x3e913a){return _0x3e913a[_0xd6f0('0x2b')]()[_0xd6f0('0x2a')](function(){_0x1dff9b[_0xd6f0('0x21')](0xcc)[_0xd6f0('0x2c')]();});}};}function handleEntityNotFound(_0x31c493){return function(_0x376890){if(!_0x376890){_0x31c493[_0xd6f0('0x20')](0x194);}return _0x376890;};}function handleError(_0x180e5f,_0x3906ca){_0x3906ca=_0x3906ca||0x1f4;return function(_0x26ab29){logger['error'](_0x26ab29[_0xd6f0('0x2d')]);if(_0x26ab29['name']){delete _0x26ab29['name'];}_0x180e5f[_0xd6f0('0x21')](_0x3906ca)[_0xd6f0('0x2e')](_0x26ab29);};}function getMustacheRender(_0x12a6fa,_0x27ad7e){return Mustache[_0xd6f0('0x2f')](_0x12a6fa,_['merge'](_0x27ad7e[_0xd6f0('0x30')],{'contact':_0x27ad7e['contact'],'message':_0x27ad7e[_0xd6f0('0x1e')],'agent':_0x27ad7e[_0xd6f0('0x31')],'interaction':_0x27ad7e[_0xd6f0('0x32')],'account':_0x27ad7e[_0xd6f0('0x33')]}))||'';}function getInteractionUsers(_0x518751,_0x5c3132){return new BPromise(function(_0x47b33d,_0x3b6463){try{if(_0x5c3132[_0x518751['id']]){_0x518751[_0xd6f0('0x34')]=_['map'](_0x5c3132[_0x518751['id']],function(_0x1d200a){return{'id':_0x1d200a['id'],'fullname':_0x1d200a['fullname']};});}}catch(_0x507f66){_0x3b6463(_0x507f66);}_0x47b33d(_0x518751);});}function getInteractionTags(_0x2fd7b8,_0x28659e){return new BPromise(function(_0x1852dd,_0x451834){try{if(_0x2fd7b8[_0xd6f0('0x35')]){_0x2fd7b8[_0xd6f0('0x36')]=[];_0x2fd7b8['TagIds']['split'](',')[_0xd6f0('0x37')](function(_0xf879a6){_0x2fd7b8[_0xd6f0('0x36')]['push'](_0x28659e[_0xf879a6]);});}delete _0x2fd7b8['TagIds'];}catch(_0x13b41d){_0x451834(_0x13b41d);}_0x1852dd(_0x2fd7b8);});}function updateChatInteraction(_0x2def01,_0x39fd07,_0x38d06f){return new BPromise(function(_0x2e3225,_0x2b5df5){return getInteractionUsers(_0x2def01,_0x38d06f)[_0xd6f0('0x2a')](function(_0x64359c){return getInteractionTags(_0x64359c,_0x39fd07);})['then'](function(_0x1af620){return getStateInteraction(_0x1af620);})[_0xd6f0('0x2a')](function(_0x1e3c8a){_0x2e3225(_0x1e3c8a);})[_0xd6f0('0x1f')](function(_0x57b83e){_0x2b5df5(_0x57b83e);});});}function getStateInteraction(_0x1981bd){return new BPromise(function(_0x94ec6d){_0x1981bd[_0xd6f0('0x38')]=0x0;_0x1981bd[_0xd6f0('0x39')]=0x0;_0x1981bd[_0xd6f0('0x3a')]=0x0;_0x1981bd['unmanaged']=0x0;_0x1981bd[_0xd6f0('0x3b')]=0x0;_0x1981bd[_0xd6f0('0x3c')]=0x0;if(!_0x1981bd[_0xd6f0('0x3d')]&&!_0x1981bd['UserId']){_0x1981bd[_0xd6f0('0x38')]+=0x1;}if(!_0x1981bd[_0xd6f0('0x3d')]&&_0x1981bd['UserId']){_0x1981bd['talking']+=0x1;if(_0x1981bd[_0xd6f0('0x38')]){_0x1981bd[_0xd6f0('0x38')]-=0x1;}}if(_0x1981bd[_0xd6f0('0x3d')]&&_0x1981bd['disposition']===_0xd6f0('0x3b')){_0x1981bd[_0xd6f0('0x3b')]+=0x1;if(_0x1981bd['waiting']){_0x1981bd[_0xd6f0('0x38')]-=0x1;}}else if(_0x1981bd[_0xd6f0('0x3d')]&&!_0x1981bd[_0xd6f0('0x3e')]&&_0x1981bd[_0xd6f0('0x3f')]){_0x1981bd['unmanaged']+=0x1;if(_0x1981bd[_0xd6f0('0x38')]){_0x1981bd[_0xd6f0('0x38')]-=0x1;}}else if(_0x1981bd[_0xd6f0('0x3d')]&&_0x1981bd[_0xd6f0('0x3e')]){_0x1981bd[_0xd6f0('0x3a')]+=0x1;if(_0x1981bd[_0xd6f0('0x39')]){_0x1981bd[_0xd6f0('0x39')]-=0x1;}}_0x1981bd[_0xd6f0('0x3c')]+=0x1;_0x94ec6d(_0x1981bd);});}exports['index']=function(_0x909f20,_0x3d42ca){var _0x55e93b={},_0x268772={},_0x39ca69={'count':0x0,'rows':[]};var _0x1bcb36=_[_0xd6f0('0x40')](db['ChatInteraction'][_0xd6f0('0x41')],function(_0xe5fd11){return{'name':_0xe5fd11['fieldName'],'type':_0xe5fd11['type'][_0xd6f0('0x42')]};});_0x268772['model']=_[_0xd6f0('0x40')](_0x1bcb36,_0xd6f0('0x43'));_0x268772[_0xd6f0('0x44')]=_['keys'](_0x909f20[_0xd6f0('0x44')]);_0x268772[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x268772[_0xd6f0('0x47')],_0x268772[_0xd6f0('0x44')]);_0x55e93b['attributes']=_[_0xd6f0('0x46')](_0x268772['model'],qs[_0xd6f0('0x48')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x48')]));_0x55e93b[_0xd6f0('0x49')]=_0x55e93b['attributes']['length']?_0x55e93b[_0xd6f0('0x49')]:_0x268772[_0xd6f0('0x47')];if(!_0x909f20['query'][_0xd6f0('0x4a')]('nolimit')){_0x55e93b[_0xd6f0('0x25')]=qs[_0xd6f0('0x25')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x25')]);_0x55e93b[_0xd6f0('0x23')]=qs['offset'](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x23')]);}_0x55e93b[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x4c')]);_0x55e93b[_0xd6f0('0x4d')]=qs[_0xd6f0('0x45')](_['pick'](_0x909f20[_0xd6f0('0x44')],_0x268772[_0xd6f0('0x45')]),_0x1bcb36);var _0x469e92=[];var _0x29509e=squel[_0xd6f0('0x4e')]()[_0xd6f0('0x4f')]('id')[_0xd6f0('0x4f')](_0xd6f0('0x43'))[_0xd6f0('0x4f')]('color')[_0xd6f0('0x50')]('tools_tags');var _0x5505fd=squel[_0xd6f0('0x4e')]()['field']('u.id')[_0xd6f0('0x4f')](_0xd6f0('0x51'))[_0xd6f0('0x4f')]('ui.ChatInteractionId')[_0xd6f0('0x50')](_0xd6f0('0x52'),'ui')[_0xd6f0('0x53')]('users','u',_0xd6f0('0x54'));var _0x357193=squel['select']()[_0xd6f0('0x50')](_0xd6f0('0x55'),'i')['left_join'](_0xd6f0('0x56'),'c',_0xd6f0('0x57'))[_0xd6f0('0x53')](_0xd6f0('0x58'),'o',_0xd6f0('0x59'))['left_join'](_0xd6f0('0x5a'),'a',_0xd6f0('0x5b'))['left_join'](_0xd6f0('0x5c'),'me',_0xd6f0('0x5d'))[_0xd6f0('0x53')]('chat_interaction_has_tags','it',_0xd6f0('0x5e'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x5c5aa4=squel[_0xd6f0('0x5f')]();var _0x2876a6=[];var _0x1a8984=squel[_0xd6f0('0x5f')]();var _0x530bcc;if(_0x909f20[_0xd6f0('0x44')]['search']){_0x530bcc=as[_0xd6f0('0x60')](_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x61')]);var _0x50d93a=_0x530bcc[_0xd6f0('0x62')];for(var _0x31b055=0x0;_0x31b055<_0x530bcc[_0xd6f0('0x63')][_0xd6f0('0x64')];_0x31b055++){var _0x5ce01c=_0x530bcc[_0xd6f0('0x63')][_0x31b055];var _0xf673bb='i';var _0x30ae43=_['find'](_0x1bcb36,[_0xd6f0('0x43'),_0x5ce01c[_0xd6f0('0x4f')]]);if(!_0x30ae43){switch(_0x5ce01c[_0xd6f0('0x4f')]){case _0xd6f0('0x65'):if(_0x5ce01c['value']==0x1){_0x357193[_0xd6f0('0x66')]('`'+_0x5ce01c[_0xd6f0('0x4f')]+_0xd6f0('0x67'));}else{_0x357193[_0xd6f0('0x66')]('`'+_0x5ce01c['field']+'`\x20>\x200');}break;case'Contact':if(_0x5ce01c['operator']===_0xd6f0('0x68')){if(_0x5ce01c[_0xd6f0('0x69')][_0xd6f0('0x6a')]('\x20')[_0xd6f0('0x64')]>0x1){_0x5c5aa4[_0x50d93a](_0xd6f0('0x6b'),qs[_0xd6f0('0x6c')](_0x5ce01c[_0xd6f0('0x69')]),null);}else{var _0x1b298a='%'+_0x5ce01c[_0xd6f0('0x69')]+'%';_0x5c5aa4[_0x50d93a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1b298a,_0x1b298a,_0x1b298a);}}else{_0x30ae43=_['find'](_0x1bcb36,[_0xd6f0('0x43'),'ContactId']);_0x5ce01c[_0xd6f0('0x4f')]=_0xd6f0('0x6d');_0x1dc77c=as[_0xd6f0('0x6e')](_0xf673bb,_0x30ae43[_0xd6f0('0x6f')],_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x71')],_0x1dc77c['value'][_0xd6f0('0x2c')]);}break;case _0xd6f0('0x72'):var _0x40cdae=_0x5ce01c['value'][_0xd6f0('0x6a')](',')[_0xd6f0('0x40')](function(_0x4f3dd9){return Number(_0x4f3dd9);});_0x40cdae[_0xd6f0('0x37')](function(_0x80f21c){_0x1a8984['or'](_0xd6f0('0x73'),'%,'+_0x80f21c+',%');});_0x2876a6=_[_0xd6f0('0x74')](_0x2876a6,_0x40cdae);break;case _0xd6f0('0x75'):if(_0x5ce01c[_0xd6f0('0x76')]===_0xd6f0('0x68')){_0x5c5aa4[_0x50d93a](_0xd6f0('0x77'),'%'+_0x5ce01c[_0xd6f0('0x69')]+'%',null);}else{_0x30ae43=_['find'](_0x1bcb36,[_0xd6f0('0x43'),_0xd6f0('0x3e')]);_0x5ce01c[_0xd6f0('0x4f')]=_0xd6f0('0x3e');_0x1dc77c=as['buildExpression'](_0xf673bb,_0x30ae43[_0xd6f0('0x6f')],_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x71')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x2c')]);}break;case _0xd6f0('0x30'):_0x1dc77c=as[_0xd6f0('0x6e')]('me',null,_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')]['start'],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x2c')]);break;}}else{var _0x1dc77c=as['buildExpression'](_0xf673bb,_0x30ae43[_0xd6f0('0x6f')],_0x5ce01c);_0x5c5aa4[_0x50d93a](_0x1dc77c[_0xd6f0('0x70')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x71')],_0x1dc77c[_0xd6f0('0x69')][_0xd6f0('0x2c')]);}}}else{var _0x1c7f08=_(_0x909f20[_0xd6f0('0x44')])[_0xd6f0('0x78')]()[_0xd6f0('0x40')](function(_0x27ad68){return _['some'](_0x1bcb36,['name',_0x27ad68])?_0x27ad68:undefined;})[_0xd6f0('0x79')]()[_0xd6f0('0x69')]();if(!_[_0xd6f0('0x7a')](_0x1c7f08)){_0x1c7f08[_0xd6f0('0x37')](function(_0x1da442){if(_0x1da442==='ChatWebsiteId'){_0x357193[_0xd6f0('0x4d')](_0xd6f0('0x7b'),[]['concat'](_0x909f20[_0xd6f0('0x44')][_0x1da442]));}else if(_0x1da442==='createdAt'){var _0x458f66=JSON[_0xd6f0('0x7c')](_0x909f20[_0xd6f0('0x44')][_0x1da442])[_0xd6f0('0x7d')];var _0x391c2a=JSON['parse'](_0x909f20['query'][_0x1da442])[_0xd6f0('0x7e')];_0x357193[_0xd6f0('0x4d')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x458f66,_0x391c2a);}else{if(_0x909f20[_0xd6f0('0x44')][_0x1da442]==='null'){_0x357193['where']('i.'+_0x1da442+_0xd6f0('0x7f'));}else{_0x357193['where']('i.'+_0x1da442+'\x20=\x20?',_0x909f20['query'][_0x1da442]);}}});}if(_0x909f20['query'][_0xd6f0('0x80')]){if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x80')]==0x1){_0x357193[_0xd6f0('0x66')](_0xd6f0('0x81'));}else{_0x357193[_0xd6f0('0x66')](_0xd6f0('0x82'));}}if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x83')]){_0x2876a6=_['isArray'](_0x909f20[_0xd6f0('0x44')]['tag'])?_0x909f20['query'][_0xd6f0('0x83')]:new Array(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x83')]);_0x2876a6['forEach'](function(_0x12e166){_0x1a8984['or'](_0xd6f0('0x73'),'%,'+_0x12e166+',%');});}if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x84')]){var _0x41e738=_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x84')][_0xd6f0('0x85')]('\x5c','\x5c\x5c')['replace'](/'/g,'\x27\x27');if(qs[_0xd6f0('0x86')](_0x41e738)){_0x5c5aa4['or'](_0xd6f0('0x87'),_0x41e738+'%');}else{_0x5c5aa4['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd6f0('0x6c')](_0x41e738))['or'](_0xd6f0('0x88'),_0x41e738+'%');}}}_0x357193[_0xd6f0('0x4d')](_0x5c5aa4);_0x357193[_0xd6f0('0x89')](_0xd6f0('0x8a'));var _0x96fc03={'type':db[_0xd6f0('0x8b')]['QueryTypes'][_0xd6f0('0x8c')],'raw':!![]};var _0x24c31d=_0x357193[_0xd6f0('0x8d')]();_0x24c31d['field']('i.id');_0x24c31d['field'](_0xd6f0('0x8e'),_0xd6f0('0x65'));if(_0x55e93b[_0xd6f0('0x4b')]){_0x55e93b[_0xd6f0('0x4b')][_0xd6f0('0x37')](function(_0x48d87d){var _0x4b5139=_0x48d87d[0x0]===_0xd6f0('0x8f')?_0x48d87d[0x0]:'i.'+_0x48d87d[0x0];_0x357193[_0xd6f0('0x4b')](_0x4b5139,_0x48d87d[0x1]===_0xd6f0('0x90')?![]:!![]);});}if(!_[_0xd6f0('0x7a')](_0x2876a6)){_0x357193['having'](_0x1a8984);_0x24c31d[_0xd6f0('0x4d')]('t.id\x20IN\x20?',_0x2876a6);}BPromise[_0xd6f0('0x91')]()['then'](function(){if(!_0x530bcc){if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x92')])return;_0x24c31d['where'](_0xd6f0('0x93'));_0x357193[_0xd6f0('0x4d')](_0xd6f0('0x93'));return;}if(_0x909f20[_0xd6f0('0x94')][_0xd6f0('0x95')]!==_0xd6f0('0x31'))return;return _0x909f20[_0xd6f0('0x94')][_0xd6f0('0x96')]({'attributes':['id'],'raw':!![]})[_0xd6f0('0x2a')](function(_0x2c277f){if(_[_0xd6f0('0x7a')](_0x2c277f)){_0x24c31d[_0xd6f0('0x4d')](_0xd6f0('0x97'));_0x357193[_0xd6f0('0x4d')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x24c31d[_0xd6f0('0x4d')](_0xd6f0('0x7b'),_[_0xd6f0('0x40')](_0x2c277f,'id'));_0x357193[_0xd6f0('0x4d')](_0xd6f0('0x7b'),_[_0xd6f0('0x40')](_0x2c277f,'id'));}});})[_0xd6f0('0x2a')](function(){if(_0x909f20[_0xd6f0('0x94')][_0xd6f0('0x95')]===_0xd6f0('0x31')&&!_0x530bcc&&!_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x92')])return[];return db[_0xd6f0('0x98')][_0xd6f0('0x44')](_0x24c31d['toString'](),_0x96fc03);})['then'](function(_0x2638c3){_0x39ca69[_0xd6f0('0x26')]=_0x2638c3[_0xd6f0('0x64')];if(_0x39ca69[_0xd6f0('0x26')]===0x0)return[];return db[_0xd6f0('0x98')]['query'](_0x29509e[_0xd6f0('0x99')](),_0x96fc03)[_0xd6f0('0x2a')](function(_0x2d0d8a){_0x469e92=_[_0xd6f0('0x9a')](_0x2d0d8a,'id');_0x96fc03=_['merge'](_0x96fc03,{'model':db[_0xd6f0('0x9b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x909f20[_0xd6f0('0x44')][_0xd6f0('0x48')]){_0x55e93b[_0xd6f0('0x49')][_0xd6f0('0x37')](function(_0x229631){_0x357193['field']('i.'+_0x229631);});}else{_0x357193['field'](_0xd6f0('0x8e'),'unreadMessages');_0x357193[_0xd6f0('0x4f')]('a.key',_0xd6f0('0x9c'));_0x357193[_0xd6f0('0x4f')]('a.mandatoryDisposition',_0xd6f0('0x9d'));_0x357193['field'](_0xd6f0('0x9e'),_0xd6f0('0x8f'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0x9f'));_0x357193['field'](_0xd6f0('0xa0'),_0xd6f0('0xa1'));_0x357193[_0xd6f0('0x4f')]('c.lastName',_0xd6f0('0xa2'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xa3'),'Contact.email');_0x357193['field'](_0xd6f0('0xa4'),_0xd6f0('0xa5'));_0x357193[_0xd6f0('0x4f')]('c.mobile',_0xd6f0('0xa6'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xa7'),_0xd6f0('0xa8'));_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xa9'),_0xd6f0('0xaa'));_0x357193['field'](_0xd6f0('0xab'),'Owner.internal');_0x357193[_0xd6f0('0x4f')](_0xd6f0('0xac'),_0xd6f0('0x35'));}if(_0x55e93b['limit'])_0x357193[_0xd6f0('0x25')](_0x55e93b['limit']);if(_0x55e93b['offset'])_0x357193[_0xd6f0('0x23')](_0x55e93b[_0xd6f0('0x23')]);return db[_0xd6f0('0x98')]['query'](_0x357193[_0xd6f0('0x99')](),_0x96fc03);})['then'](function(_0x51e28a){if(_0x51e28a[_0xd6f0('0x64')]>0x0)_0x5505fd[_0xd6f0('0x4d')](_0xd6f0('0xad'),_[_0xd6f0('0x40')](_0x51e28a,'id'));return db[_0xd6f0('0x98')][_0xd6f0('0x44')](_0x5505fd['toString'](),_0x96fc03)[_0xd6f0('0x2a')](function(_0x5b8770){var _0x1c07b8=_['groupBy'](_0x5b8770,_0xd6f0('0xae'));var _0x1dce9c=[];_0x51e28a['forEach'](function(_0x212920){_0x1dce9c[_0xd6f0('0xaf')](updateChatInteraction(_0x212920,_0x469e92,_0x1c07b8));});return BPromise[_0xd6f0('0xb0')](_0x1dce9c);});});})[_0xd6f0('0x2a')](function(_0x1fff48){_0x39ca69[_0xd6f0('0xb1')]=_0x1fff48;return _0x39ca69;})[_0xd6f0('0x2a')](respondWithFilteredResult(_0x3d42ca,_0x55e93b))[_0xd6f0('0x1f')](handleError(_0x3d42ca,null));};exports['show']=function(_0x25c9a8,_0x1a2390){var _0x529c3d={'raw':![],'where':{'id':_0x25c9a8['params']['id']}},_0x282736={};_0x282736[_0xd6f0('0x47')]=_[_0xd6f0('0x78')](db[_0xd6f0('0x9b')][_0xd6f0('0x41')]);_0x282736['query']=_['keys'](_0x25c9a8[_0xd6f0('0x44')]);_0x282736[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x282736[_0xd6f0('0x47')],_0x282736[_0xd6f0('0x44')]);_0x529c3d[_0xd6f0('0x49')]=_[_0xd6f0('0x46')](_0x282736['model'],qs[_0xd6f0('0x48')](_0x25c9a8[_0xd6f0('0x44')][_0xd6f0('0x48')]));_0x529c3d[_0xd6f0('0x49')]=_0x529c3d['attributes'][_0xd6f0('0x64')]?_0x529c3d['attributes']:_0x282736['model'];if(_0x25c9a8[_0xd6f0('0x44')]['includeAll']){_0x529c3d[_0xd6f0('0xb2')]=[{'all':!![]}];}_0x529c3d=_[_0xd6f0('0xb3')]({},_0x529c3d,_0x25c9a8[_0xd6f0('0xb4')]);return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')](_0x529c3d)[_0xd6f0('0x2a')](handleEntityNotFound(_0x1a2390,null))[_0xd6f0('0x2a')](respondWithResult(_0x1a2390,null))['catch'](handleError(_0x1a2390,null));};exports[_0xd6f0('0xb6')]=function(_0x11437d,_0x410185){return db['ChatInteraction'][_0xd6f0('0xb6')](_0x11437d[_0xd6f0('0x30')],{})[_0xd6f0('0x2a')](respondWithResult(_0x410185,0xc9))[_0xd6f0('0x1f')](handleError(_0x410185,null));};exports['update']=function(_0x308306,_0x4e5bb8){if(_0x308306[_0xd6f0('0x30')]['id']){delete _0x308306['body']['id'];}return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x308306[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x4e5bb8,null))[_0xd6f0('0x2a')](saveUpdates(_0x308306[_0xd6f0('0x30')],null))[_0xd6f0('0x2a')](respondWithResult(_0x4e5bb8,null))['catch'](handleError(_0x4e5bb8,null));};exports['destroy']=function(_0x12d982,_0x574ca9){return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x12d982[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x574ca9,null))[_0xd6f0('0x2a')](removeEntity(_0x574ca9,null))[_0xd6f0('0x1f')](handleError(_0x574ca9,null));};exports[_0xd6f0('0xb8')]=function(_0x83b80a,_0xb726d0){return db[_0xd6f0('0x9b')][_0xd6f0('0xb8')]()['then'](respondWithResult(_0xb726d0,null))[_0xd6f0('0x1f')](handleError(_0xb726d0,null));};exports['createVidaooSession']=function(_0x28d7e9,_0x210946){var _0x4ed3f0=_0x28d7e9[_0xd6f0('0xb7')]['id'];var _0x5b85c3;var _0x3704e6;var _0xcc9d50;return db[_0xd6f0('0x9b')][_0xd6f0('0xb9')]({'where':{'id':_0x4ed3f0}})[_0xd6f0('0x2a')](function(_0x3b4c53){_0x5b85c3=_0x3b4c53;return db[_0xd6f0('0xba')]['findOne']({'where':{'id':_0x3b4c53[_0xd6f0('0x92')]},'attributes':['id',_0xd6f0('0xbb'),'vidaooEscalation',_0xd6f0('0xbc'),'vidaooNote','vidaooMetadata'],'raw':!![]});})['then'](function(_0x461f29){if(_0x461f29&&_0x461f29[_0xd6f0('0xbb')]&&_0x461f29['vidaooEscalation']){_0x3704e6=_0x461f29;var _0x18e364={'interaction':{'id':_0x4ed3f0},'agent':{'id':_0x28d7e9[_0xd6f0('0x94')]['id'],'name':_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0x43')],'fullname':_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0xbd')],'email':_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0xbe')]},'contact':_0x28d7e9['body'][_0xd6f0('0xbf')],'account':_0x28d7e9[_0xd6f0('0x30')]['account']};var _0x360ec0={'rejectUnauthorized':![],'method':'POST','url':_0xd6f0('0xc0'),'headers':{'X-APIKEY':_0x461f29[_0xd6f0('0xbb')]},'body':{'duration':null,'scheduledAt':null,'participants':[_0x28d7e9[_0xd6f0('0x94')][_0xd6f0('0xbe')]],'buttons':null,'topic':_0x3704e6['vidaooTopic'],'note':_[_0xd6f0('0xc1')](_0x3704e6['vidaooNote'])?null:getMustacheRender(_0x3704e6['vidaooNote'],_0x18e364),'metadata':null},'redirect':_0xd6f0('0xc2'),'json':!![]};try{if(!_[_0xd6f0('0xc1')](_0x3704e6[_0xd6f0('0xc3')])){var _0x5ede6b=getMustacheRender(_0x3704e6[_0xd6f0('0xc3')],_0x18e364);var _0x45283d=JSON[_0xd6f0('0x7c')](_0x5ede6b);_0x360ec0[_0xd6f0('0x30')][_0xd6f0('0xc4')]=_0x45283d;}}catch(_0x5cbab7){throw new db[(_0xd6f0('0x8b'))][(_0xd6f0('0xc5'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0x360ec0);}else{throw new db[(_0xd6f0('0x8b'))]['ValidationError'](_0xd6f0('0xc6'));}})[_0xd6f0('0x2a')](function(_0x46f385){_0xcc9d50=_0x46f385;if(_0xcc9d50['id']){var _0x30f693={'body':_0xcc9d50[_0xd6f0('0xc7')],'ChatWebsiteId':_0x3704e6['id'],'ChatInteractionId':_0x5b85c3['id'],'direction':_0xd6f0('0xc8'),'UserId':_0x28d7e9[_0xd6f0('0x94')]['id']};return db['ChatMessage']['create'](_0x30f693,{});}else{throw new db[(_0xd6f0('0x8b'))]['ValidationError'](_0xd6f0('0xc9'));}})[_0xd6f0('0x2a')](function(){return _0x5b85c3[_0xd6f0('0xca')]({'vidaooSessionId':_0xcc9d50['id']});})['then'](respondWithResult(_0x210946,null))[_0xd6f0('0x1f')](handleError(_0x210946,null));};exports['customUpdate']=function(_0x39f781,_0x2e2fc5){if(_0x39f781['body']['id']){delete _0x39f781[_0xd6f0('0x30')]['id'];}return db[_0xd6f0('0x9b')]['find']({'where':{'id':_0x39f781['params']['id']},'include':[{'model':db['CmContact'],'as':_0xd6f0('0xcb')}]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x2e2fc5,null))[_0xd6f0('0x2a')](saveUpdates(_0x39f781[_0xd6f0('0x30')],null))[_0xd6f0('0x2a')](respondWithResult(_0x2e2fc5,null))['catch'](handleError(_0x2e2fc5,null));};exports[_0xd6f0('0xcc')]=function(_0xf4ecc,_0x1e908d){if(_0xf4ecc[_0xd6f0('0x30')]['id']){delete _0xf4ecc[_0xd6f0('0x30')]['id'];}return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0xf4ecc[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](function(_0x62d0ef){if(!_0x62d0ef){logger[_0xd6f0('0x1b')](_0xd6f0('0xcd'),_0xd6f0('0xcc'),0x194,_0xd6f0('0xce'));_0x1e908d['sendStatus'](0x194);}else{if(_0x62d0ef['UserId']){throw new db[(_0xd6f0('0x8b'))][(_0xd6f0('0xc5'))]('Interaction\x20already\x20assigned');}}return _0x62d0ef;})[_0xd6f0('0x2a')](function(_0x2f7e8f){if(_0x2f7e8f){return _0x2f7e8f[_0xd6f0('0x29')]({'closed':_0xf4ecc[_0xd6f0('0x30')][_0xd6f0('0x3d')],'disposition':_0xf4ecc[_0xd6f0('0x30')][_0xd6f0('0x3f')]})['then'](function(_0x2879b5){return _0x2879b5;});}})[_0xd6f0('0x2a')](function(){return respondWithRpcPromise(_0xd6f0('0xcf'),_0xd6f0('0xcc'),_0xf4ecc['body'],client9004);})[_0xd6f0('0x2a')](respondWithResult(_0x1e908d,null))[_0xd6f0('0x1f')](handleError(_0x1e908d,null));};exports[_0xd6f0('0xd0')]=function(_0x516f59,_0x178d6b){_0x516f59['body'][_0xd6f0('0x43')]=_0x516f59[_0xd6f0('0xd1')][_0xd6f0('0xd2')];_0x516f59[_0xd6f0('0x30')][_0xd6f0('0xd3')]=_0x516f59[_0xd6f0('0xd1')][_0xd6f0('0xd4')];_0x516f59[_0xd6f0('0x30')][_0xd6f0('0x6f')]=_0x516f59[_0xd6f0('0xd1')][_0xd6f0('0xd5')];return db[_0xd6f0('0xd6')][_0xd6f0('0xb6')](_0x516f59[_0xd6f0('0x30')])[_0xd6f0('0x2a')](respondWithResult(_0x178d6b,0xc9))[_0xd6f0('0x1f')](handleError(_0x178d6b,null));};exports['attachmentDownload']=function(_0x198eec,_0x3d1d95){return db[_0xd6f0('0x9b')][_0xd6f0('0xb9')]({'where':{'id':_0x198eec['params']['id']},'raw':!![]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x3d1d95,null))['then'](function(_0x5a8d88){if(_0x5a8d88){if(_0x5a8d88[_0xd6f0('0x3d')]){return _0x3d1d95['status'](0x193)[_0xd6f0('0x22')]({'status':0x193,'message':_0xd6f0('0xd7')});}return db[_0xd6f0('0xd6')]['findOne']({'where':{'id':_0x198eec[_0xd6f0('0x44')]['attachId']},'raw':!![]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x3d1d95,null));}})[_0xd6f0('0x2a')](function(_0xe4e7f9){if(_0xe4e7f9){var _0x51bf52=_0xe4e7f9[_0xd6f0('0xd8')]!==null;var _0x33f54e=path[_0xd6f0('0xd9')](config[_0xd6f0('0xda')],_0xd6f0('0xdb'));if(_0x51bf52){_0x33f54e=path[_0xd6f0('0xd9')](_0x33f54e,'offline-chat/');}var _0x17c5b6=path[_0xd6f0('0xd9')](_0x33f54e,_0xe4e7f9[_0xd6f0('0xd3')]);return _0x3d1d95[_0xd6f0('0xdc')](_0x17c5b6);}})['catch'](handleError(_0x3d1d95,null));};exports[_0xd6f0('0xdd')]=function(_0x55fb13,_0x2e5f31){var _0x59d38a=null;var _0x5db326=null;var _0x2df291=null;if(_0x55fb13[_0xd6f0('0x30')]['id']){delete _0x55fb13[_0xd6f0('0x30')]['id'];}if(_0x55fb13['body'][_0xd6f0('0xde')]){_0x2df291=path['join'](config[_0xd6f0('0xda')],_0xd6f0('0xdf'),util[_0xd6f0('0xe0')](_0xd6f0('0xe1'),Date[_0xd6f0('0xe2')]()));_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xe3')]=_0x2df291;}return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x55fb13[_0xd6f0('0xb7')]['id']},'include':[{'model':db[_0xd6f0('0xe4')],'as':_0xd6f0('0xe5'),'include':[{'model':db['User'],'as':'User'}]}]})[_0xd6f0('0x2a')](handleEntityNotFound(_0x2e5f31,null))[_0xd6f0('0x2a')](saveUpdates(_0x55fb13[_0xd6f0('0x30')],null))[_0xd6f0('0x2a')](function(_0x5ae946){if(_0x5ae946){_0x59d38a=_0x5ae946;return db[_0xd6f0('0xba')]['find']({'where':{'id':_0x59d38a[_0xd6f0('0x92')]}});}})[_0xd6f0('0x2a')](function(_0x3f32e6){if(_0x3f32e6){_0x5db326=_0x3f32e6;return db[_0xd6f0('0xe6')][_0xd6f0('0xb5')]({'where':{'id':_0x59d38a['ContactId']}});}})[_0xd6f0('0x2a')](function(_0x174f35){if(_0x174f35){if(_0x2df291){var _0x4c3b1d=null;for(var _0x88b850=0x1;_0x88b850<_0x59d38a[_0xd6f0('0xe5')][_0xd6f0('0x64')];++_0x88b850){_0x4c3b1d=_0x59d38a[_0xd6f0('0xe5')][_0x88b850];var _0x55bb74=_0x4c3b1d['UserId']?util[_0xd6f0('0xe0')](_0xd6f0('0xe7'),_0x5db326[_0xd6f0('0xe8')],_0x4c3b1d[_0xd6f0('0x3e')]):_0xd6f0('0xe9');var _0x3eb403=_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xea')]||util['format'](_0xd6f0('0xe7'),_0xd6f0('0xeb'),_0x4c3b1d[_0xd6f0('0x6d')]);switch(_0x5db326[_0xd6f0('0xec')]){case _0xd6f0('0xed'):_0x55bb74=_0x4c3b1d[_0xd6f0('0x3e')]?util[_0xd6f0('0xe0')](_0xd6f0('0xe7'),_0x5db326[_0xd6f0('0xe8')],_0x4c3b1d[_0xd6f0('0x3e')]):_0xd6f0('0xe9');break;case'agent_alias':_0x55bb74=_0x4c3b1d['UserId']?_0x4c3b1d[_0xd6f0('0x75')]['alias']||_0x4c3b1d[_0xd6f0('0x75')][_0xd6f0('0xbd')]:_0xd6f0('0xe9');break;case _0xd6f0('0xee'):_0x55bb74=_0x4c3b1d[_0xd6f0('0x3e')]?_0x4c3b1d[_0xd6f0('0x75')][_0xd6f0('0xbd')]:'System';break;default:_0x55bb74=_0x4c3b1d[_0xd6f0('0x3e')]?util[_0xd6f0('0xe0')](_0xd6f0('0xe7'),_0x5db326['agentAlias'],_0x4c3b1d['UserId']):_0xd6f0('0xe9');}var _0x156d8c=util[_0xd6f0('0xe0')](_0xd6f0('0xef'),moment(_0x4c3b1d['createdAt'])[_0xd6f0('0xe0')](_0xd6f0('0xf0')),_0x4c3b1d['direction']==='in'?_0x3eb403:_0x55bb74,_0x4c3b1d[_0xd6f0('0x30')]);if(!_0x4c3b1d[_0xd6f0('0xf1')]){fs[_0xd6f0('0xf2')](_0x2df291,_0x156d8c);}}return db[_0xd6f0('0xf3')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xd6f0('0xf4')],'as':_0xd6f0('0xf5'),'raw':!![],'include':[{'model':db['CloudProvider'],'as':'CloudProvider','raw':!![]}]}]});}}})[_0xd6f0('0x2a')](function(_0x24800d){if(!_0x24800d||!_0x24800d[_0xd6f0('0xf5')]||!_0x55fb13[_0xd6f0('0x30')])return _0x59d38a;var _0x1acefc=_0x24800d[_0xd6f0('0xf6')]();return respondWithRpcPromise(_0xd6f0('0xf7'),_0xd6f0('0xf8'),{'account':_0x1acefc,'message':{'from':util[_0xd6f0('0xe0')](_0xd6f0('0xf9'),_0x24800d['name'],_0x24800d[_0xd6f0('0xbe')]||_0x24800d[_0xd6f0('0xf5')][_0xd6f0('0x94')]),'to':_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xde')],'subject':_0xd6f0('0xfa'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x55fb13[_0xd6f0('0x30')][_0xd6f0('0xde')]),'attachments':[{'path':_0x2df291}]}})[_0xd6f0('0x2a')](function(){return _0x59d38a;})[_0xd6f0('0x1f')](function(_0x53d6fd){logger[_0xd6f0('0x1b')](_0x53d6fd);});})[_0xd6f0('0x2a')](respondWithStatusCode(_0x2e5f31,0xc8))[_0xd6f0('0x1f')](handleError(_0x2e5f31,null));};exports[_0xd6f0('0xfb')]=function(_0x3ce855,_0x56fbcb){return db[_0xd6f0('0xe4')][_0xd6f0('0xb5')]({'where':{'id':_0x3ce855['params']['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x56fbcb,null))[_0xd6f0('0x2a')](function(_0x4ae09a){if(_0x4ae09a){return _0x4ae09a[_0xd6f0('0xfb')](_0x3ce855[_0xd6f0('0x30')][_0xd6f0('0xfc')],_[_0xd6f0('0xfd')](_0x3ce855[_0xd6f0('0x30')],[_0xd6f0('0xfc'),'id'])||{});}})[_0xd6f0('0x2a')](respondWithResult(_0x56fbcb,null))[_0xd6f0('0x1f')](handleError(_0x56fbcb,null));};exports[_0xd6f0('0xfe')]=function(_0x430b18,_0x22ec51){var _0x578789={'raw':![],'where':{}};var _0xdd080f={};var _0x4a1165={'count':0x0,'rows':[]};return db[_0xd6f0('0x9b')][_0xd6f0('0xb9')]({'where':{'id':_0x430b18[_0xd6f0('0xb7')]['id']}})['then'](handleEntityNotFound(_0x22ec51,null))[_0xd6f0('0x2a')](function(_0x2e64be){if(_0x2e64be){_0xdd080f[_0xd6f0('0x47')]=_[_0xd6f0('0x78')](db[_0xd6f0('0xe4')]['rawAttributes']);_0xdd080f['query']=_[_0xd6f0('0x78')](_0x430b18[_0xd6f0('0x44')]);_0xdd080f[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0xdd080f[_0xd6f0('0x47')],_0xdd080f[_0xd6f0('0x44')]);_0x578789[_0xd6f0('0x49')]=_[_0xd6f0('0x46')](_0xdd080f['model'],qs['fields'](_0x430b18['query'][_0xd6f0('0x48')]));_0x578789['attributes']=_0x578789[_0xd6f0('0x49')][_0xd6f0('0x64')]?_0x578789[_0xd6f0('0x49')]:_0xdd080f[_0xd6f0('0x47')];if(!_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x4a')](_0xd6f0('0xff'))){_0x578789[_0xd6f0('0x25')]=qs[_0xd6f0('0x25')](_0x430b18[_0xd6f0('0x44')]['limit']);_0x578789[_0xd6f0('0x23')]=qs['offset'](_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x23')]);}_0x578789['order']=qs[_0xd6f0('0x4c')](_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x4c')]);_0x578789[_0xd6f0('0x4d')]=qs[_0xd6f0('0x45')](_['pick'](_0x430b18['query'],_0xdd080f['filters']));_0x578789['where'][_0xd6f0('0xae')]=_0x2e64be['id'];if(_0x430b18['query'][_0xd6f0('0x84')]){_0x578789[_0xd6f0('0x4d')]=_[_0xd6f0('0xb3')](_0x578789[_0xd6f0('0x4d')],{'$or':_[_0xd6f0('0x40')](_0x578789[_0xd6f0('0x49')],function(_0x55f274){var _0x1d461f={};_0x1d461f[_0x55f274]={'$like':'%'+_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x84')]+'%'};return _0x1d461f;})});}if(_0x430b18[_0xd6f0('0x44')][_0xd6f0('0x7d')]){var _0x32af02=_0x430b18['query']['$gte'][_0xd6f0('0x6a')](',');var _0x69694c={};_0x69694c[_0x32af02[0x0]]={'$gte':moment(_0x32af02[0x1])['format'](_0xd6f0('0x100'))};_0x578789[_0xd6f0('0x4d')]=_['merge'](_0x578789[_0xd6f0('0x4d')],_0x69694c);}_0x578789=_[_0xd6f0('0xb3')]({},_0x578789,_0x430b18[_0xd6f0('0xb4')]);return db['ChatMessage'][_0xd6f0('0x26')]({'where':_0x578789[_0xd6f0('0x4d')]})[_0xd6f0('0x2a')](function(_0x2d6902){_0x4a1165[_0xd6f0('0x26')]=_0x2d6902;if(_0x430b18['query'][_0xd6f0('0x101')]){_0x578789[_0xd6f0('0xb2')]=[{'all':!![]}];}return db[_0xd6f0('0xe4')][_0xd6f0('0x102')](_0x578789);})[_0xd6f0('0x2a')](function(_0x2ace80){_0x4a1165[_0xd6f0('0xb1')]=_0x2ace80;return _0x4a1165;});}})[_0xd6f0('0x2a')](respondWithFilteredResult(_0x22ec51,_0x578789))[_0xd6f0('0x1f')](handleError(_0x22ec51,null));};exports[_0xd6f0('0x103')]=function(_0x46dedb,_0x5887ab){var _0x240207={'where':{}},_0x3a32b3={},_0x55c3da={'count':0x0,'rows':[]};return db[_0xd6f0('0x9b')]['findOne']({'where':{'id':_0x46dedb[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x5887ab,null))['then'](function(_0x2c9e1a){if(_0x2c9e1a){_0x3a32b3['model']=_[_0xd6f0('0x78')](db['ChatMessage'][_0xd6f0('0x41')]);_0x3a32b3[_0xd6f0('0x44')]=_['keys'](_0x46dedb['query']);_0x3a32b3[_0xd6f0('0x45')]=_[_0xd6f0('0x46')](_0x3a32b3[_0xd6f0('0x47')],_0x3a32b3['query']);_0x240207[_0xd6f0('0x49')]=_[_0xd6f0('0x46')](_0x3a32b3[_0xd6f0('0x47')],qs[_0xd6f0('0x48')](_0x46dedb[_0xd6f0('0x44')]['fields']));_0x240207[_0xd6f0('0x49')]=_0x240207[_0xd6f0('0x49')][_0xd6f0('0x64')]?_0x240207[_0xd6f0('0x49')]:_0x3a32b3[_0xd6f0('0x47')];if(!_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x4a')]('nolimit')){_0x240207[_0xd6f0('0x25')]=qs[_0xd6f0('0x25')](_0x46dedb['query'][_0xd6f0('0x25')]);_0x240207[_0xd6f0('0x23')]=qs['offset'](_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x23')]);}_0x240207[_0xd6f0('0x4b')]=qs[_0xd6f0('0x4c')](_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x4c')]);_0x240207[_0xd6f0('0x4d')]=qs[_0xd6f0('0x45')](_['pick'](_0x46dedb[_0xd6f0('0x44')],_0x3a32b3[_0xd6f0('0x45')]));_0x240207['where'][_0xd6f0('0xae')]=_0x2c9e1a['id'];if(_0x46dedb['query'][_0xd6f0('0x84')]){_0x240207[_0xd6f0('0x4d')]=_[_0xd6f0('0xb3')](_0x240207[_0xd6f0('0x4d')],{'$or':_[_0xd6f0('0x40')](_0x240207[_0xd6f0('0x49')],function(_0x44cead){var _0x5e1062={};_0x5e1062[_0x44cead]={'$like':'%'+_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x84')]+'%'};return _0x5e1062;})});}_0x240207[_0xd6f0('0x4d')][_0xd6f0('0xf1')]=![];if(_0x46dedb[_0xd6f0('0x44')]['id']){_0x240207['where']['id']={'$gt':_0x46dedb[_0xd6f0('0x44')]['id']};}_0x240207=_['merge']({},_0x240207,_0x46dedb[_0xd6f0('0xb4')]);return db['ChatMessage'][_0xd6f0('0x26')]({'where':_0x240207[_0xd6f0('0x4d')]})['then'](function(_0x27887e){_0x55c3da['count']=_0x27887e;_0x240207['include']=[];if(_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x104')]){_0x240207[_0xd6f0('0xb2')][_0xd6f0('0xaf')]({'model':db[_0xd6f0('0x75')],'as':_0xd6f0('0x75'),'attributes':['id',_0xd6f0('0xbd'),_0xd6f0('0x105')]});}if(_0x46dedb[_0xd6f0('0x44')][_0xd6f0('0x101')]){_0x240207[_0xd6f0('0xb2')]=[{'all':!![]}];}return db[_0xd6f0('0xe4')][_0xd6f0('0x102')](_0x240207);})[_0xd6f0('0x2a')](function(_0x2ea0c4){_0x55c3da['rows']=_0x2ea0c4;return _0x55c3da;});}})[_0xd6f0('0x2a')](respondWithFilteredResult(_0x5887ab,_0x240207))[_0xd6f0('0x1f')](handleError(_0x5887ab,null));};exports['addTags']=function(_0x2e9eca,_0x1814a9){return db[_0xd6f0('0x9b')][_0xd6f0('0xb5')]({'where':{'id':_0x2e9eca[_0xd6f0('0xb7')]['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x1814a9,null))[_0xd6f0('0x2a')](function(_0x54f0f0){if(_0x54f0f0){return _0x54f0f0[_0xd6f0('0x106')](_0x2e9eca[_0xd6f0('0x30')][_0xd6f0('0xfc')],_[_0xd6f0('0xfd')](_0x2e9eca[_0xd6f0('0x30')],['ids','id'])||{})[_0xd6f0('0x107')](function(){return db[_0xd6f0('0x72')][_0xd6f0('0x102')]({'attributes':['id','name',_0xd6f0('0x108')],'where':{'id':_0x2e9eca[_0xd6f0('0x30')][_0xd6f0('0xfc')]}});})[_0xd6f0('0x2a')](function(_0x486a3e){socket[_0xd6f0('0x109')](_0xd6f0('0x10a'),{'id':Number(_0x2e9eca[_0xd6f0('0xb7')]['id']),'tags':_0x486a3e||[]});return{'id':Number(_0x2e9eca[_0xd6f0('0xb7')]['id']),'tags':_0x486a3e||[]};});}})[_0xd6f0('0x2a')](respondWithResult(_0x1814a9,null))[_0xd6f0('0x1f')](handleError(_0x1814a9,null));};exports[_0xd6f0('0x10b')]=function(_0x1033e1,_0x3d1c1e){return db[_0xd6f0('0x9b')]['find']({'where':{'id':_0x1033e1['params']['id']}})[_0xd6f0('0x2a')](handleEntityNotFound(_0x3d1c1e,null))[_0xd6f0('0x2a')](function(_0x547615){if(_0x547615){return _0x547615[_0xd6f0('0x10b')](_0x1033e1[_0xd6f0('0x44')][_0xd6f0('0xfc')]);}})[_0xd6f0('0x2a')](respondWithStatusCode(_0x3d1c1e,null))[_0xd6f0('0x1f')](handleError(_0x3d1c1e,null));};exports[_0xd6f0('0xdc')]=function(_0x920605,_0x280343){var _0xdeebce=moment()[_0xd6f0('0x10c')]()[_0xd6f0('0x99')]();var _0x2ac49c=path['join'](config[_0xd6f0('0xda')],_0xd6f0('0x10d'),'files',_0xd6f0('0x10e'));var _0x5327b3=path[_0xd6f0('0xd9')](config[_0xd6f0('0xda')],_0xd6f0('0x10d'),'files',_0xd6f0('0x10f'));var _0x245c62=path[_0xd6f0('0xd9')](_0x2ac49c,_0xdeebce);var _0x1a4ad0=util['format'](_0xd6f0('0x110'),_0x920605[_0xd6f0('0xb7')]['id'],_0xdeebce);var _0x4e7e89=path[_0xd6f0('0xd9')](_0x2ac49c,_0x1a4ad0);var _0x1151d0=[];_0x1151d0[_0xd6f0('0xaf')]({'model':db[_0xd6f0('0x75')],'as':'User','attributes':['id',_0xd6f0('0xbd')],'raw':!![]});_0x1151d0[_0xd6f0('0xaf')]({'model':db['CmContact'],'as':_0xd6f0('0xcb'),'attributes':['id',_0xd6f0('0x111'),'lastName'],'raw':!![]});if(_0x920605[_0xd6f0('0x44')][_0xd6f0('0x10f')]){_0x1151d0[_0xd6f0('0xaf')]({'model':db[_0xd6f0('0xd6')],'as':_0xd6f0('0xd6'),'raw':!![]});}var _0x46ee50=[{'model':db[_0xd6f0('0xe4')],'as':_0xd6f0('0xe5'),'attributes':['id',_0xd6f0('0x30'),_0xd6f0('0x112'),_0xd6f0('0x113'),'secret',_0xd6f0('0x80')],'include':_0x1151d0}];_0x46ee50['push']({'model':db[_0xd6f0('0xba')],'as':_0xd6f0('0x114'),'attributes':['id',_0xd6f0('0x43')]});_0x46ee50[_0xd6f0('0xaf')]({'model':db['User'],'as':'Owner','attributes':['id',_0xd6f0('0xbd')]});return db['ChatInteraction'][_0xd6f0('0xb5')]({'where':{'id':_0x920605[_0xd6f0('0xb7')]['id']},'include':_0x46ee50})[_0xd6f0('0x2a')](handleEntityNotFound(_0x280343,null))['then'](function(_0x519500){if(_0x519500){var _0x1fce58=_0x519500['get']({'plain':!![]});fs[_0xd6f0('0x115')](_0x245c62);var _0x3e89c2={'channel':_0xd6f0('0x116'),'account':_0x1fce58[_0xd6f0('0x114')][_0xd6f0('0x43')],'agent':_0x1fce58[_0xd6f0('0x117')]?_0x1fce58['Owner'][_0xd6f0('0xbd')]:_0xd6f0('0x118'),'createdAt':moment(_0x1fce58['createdAt'])[_0xd6f0('0xe0')](_0xd6f0('0x100'))[_0xd6f0('0x99')](),'closedAt':_0x1fce58[_0xd6f0('0x3d')]?moment(_0x1fce58[_0xd6f0('0x119')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd6f0('0x99')]():'','disposition':_0x1fce58['disposition'],'chatInfo':{'browser':_0x1fce58[_0xd6f0('0x11a')],'os':_0x1fce58[_0xd6f0('0x11b')],'referer':_0x1fce58[_0xd6f0('0x11c')],'customerIp':_0x1fce58['customerIp'],'customerPort':_0x1fce58['customerPort']?_0x1fce58[_0xd6f0('0x11d')]:_0xd6f0('0x118')},'messages':_(_0x1fce58[_0xd6f0('0xe5')])[_0xd6f0('0x11e')]()['filter']({'secret':![]})[_0xd6f0('0x40')](function(_0x37107f){if(_0x37107f['Attachment']){var _0x318972=path[_0xd6f0('0xd9')](_0x5327b3,_0x37107f[_0xd6f0('0xd6')][_0xd6f0('0xd3')]);if(fs[_0xd6f0('0x11f')](_0x318972)){fs['createReadStream'](_0x318972)['pipe'](fs[_0xd6f0('0x120')](path[_0xd6f0('0xd9')](_0x245c62,_0x37107f['Attachment'][_0xd6f0('0xd3')])));}}return{'date':moment(_0x37107f[_0xd6f0('0x112')])[_0xd6f0('0xe0')](_0xd6f0('0x100'))[_0xd6f0('0x99')](),'sender':_0x37107f[_0xd6f0('0x113')]===_0xd6f0('0xc8')?_0x37107f[_0xd6f0('0x75')]?_0x37107f[_0xd6f0('0x75')][_0xd6f0('0xbd')]:_0xd6f0('0xe9'):_0x37107f['Contact']['firstName']+(_0x37107f[_0xd6f0('0xcb')]['lastName']?'\x20'+_0x37107f[_0xd6f0('0xcb')][_0xd6f0('0x121')]:''),'body':_0x37107f[_0xd6f0('0xd6')]?_0x37107f['Attachment']['basename']:_0x37107f['body'],'direction':_0x37107f[_0xd6f0('0x113')]===_0xd6f0('0xc8')?'A':'C','secret':_0x37107f['secret'],'read':_0x37107f['read'],'attachment':_0x37107f[_0xd6f0('0xd6')]};})[_0xd6f0('0x69')]()};return ejs[_0xd6f0('0x122')](path['join'](config['root'],_0xd6f0('0x10d'),_0xd6f0('0x123'),_0xd6f0('0x124')),{'interaction':_0x3e89c2})['then'](function(_0xa4ae76){var _0x1478ce=path['join'](_0x245c62,_0xd6f0('0x125')+_0x1fce58['id']+'-'+_0xdeebce+_0xd6f0('0x126'));var _0x264d69={'path':_0x1478ce,'channel':_0xd6f0('0x116'),'interactionId':_0x1fce58['id']};return pdf[_0xd6f0('0x127')](_0xa4ae76,_0x264d69);})[_0xd6f0('0x2a')](function(){return new Promise(function(_0x300b64,_0x16ef7b){zipdir(_0x245c62,{'saveTo':_0x4e7e89},function(_0x526978,_0x552cd5){if(_0x526978)return _0x16ef7b(_0x526978);return _0x300b64(_0x552cd5);});})[_0xd6f0('0x2a')](function(){return new BPromise(function(_0x5e505d,_0x5d0e6e){rimraf(_0x245c62,function(_0x44e0ca){if(_0x44e0ca)_0x5d0e6e(_0x44e0ca);return _0x5e505d();});});})[_0xd6f0('0x2a')](function(){return _0x280343[_0xd6f0('0xdc')](_0x4e7e89,_0x1a4ad0,function(_0x4fc550){if(_0x4fc550){logger['error']('err',_0x4fc550);}else{fs[_0xd6f0('0x128')](_0x4e7e89);}});});});}else{return _0x280343[_0xd6f0('0x20')](0xc8);}})[_0xd6f0('0x1f')](handleError(_0x280343,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 014b475..fcd9a27 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 _0x391d=['update','remove','getUsers','then','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save'];(function(_0xecbbdf,_0x3c220f){var _0x3dc33b=function(_0x2e86a5){while(--_0x2e86a5){_0xecbbdf['push'](_0xecbbdf['shift']());}};_0x3dc33b(++_0x3c220f);}(_0x391d,0xbb));var _0xd391=function(_0x6b8e6,_0x5b5b8d){_0x6b8e6=_0x6b8e6-0x0;var _0x11e8d9=_0x391d[_0x6b8e6];return _0x11e8d9;};'use strict';var EventEmitter=require(_0xd391('0x0'));var ChatInteraction=require(_0xd391('0x1'))['db']['ChatInteraction'];var ChatMessage=require('../../mysqldb')['db'][_0xd391('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xd391('0x3')](0x0);var events={'afterCreate':_0xd391('0x4'),'afterUpdate':_0xd391('0x5'),'afterDestroy':_0xd391('0x6')};function emitEvent(_0x23269c){return function(_0x187d06,_0xa73638,_0x5641c8){_0x187d06[_0xd391('0x7')]({'attributes':['id'],'raw':!![]})[_0xd391('0x8')](function(_0xfbf275){_0x187d06[_0xd391('0x9')]('Users',_0xfbf275['map'](function(_0x4276c3){return{'id':_0x4276c3['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x187d06['id'],'direction':'in','read':![]},'raw':!![]});})[_0xd391('0x8')](function(_0x1104a2){_0x187d06[_0xd391('0x9')](_0xd391('0xa'),_0x1104a2[_0xd391('0xb')]);ChatInteractionEvents[_0xd391('0xc')](_0x23269c+':'+_0x187d06['id'],_0x187d06);ChatInteractionEvents[_0xd391('0xc')](_0x23269c,_0x187d06);_0x5641c8(null);})[_0xd391('0xd')](_0x5641c8(null));};}for(var e in events){if(events[_0xd391('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xd391('0xf')]=ChatInteractionEvents;
\ No newline at end of file
+var _0x354b=['Users','findAll','unreadMessages','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','setDataValue'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x354b,0x148));var _0xb354=function(_0x21ea1f,_0x3548a9){_0x21ea1f=_0x21ea1f-0x0;var _0x1801e2=_0x354b[_0x21ea1f];return _0x1801e2;};'use strict';var EventEmitter=require(_0xb354('0x0'));var ChatInteraction=require(_0xb354('0x1'))['db'][_0xb354('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xb354('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xb354('0x4')](0x0);var events={'afterCreate':_0xb354('0x5'),'afterUpdate':'update','afterDestroy':_0xb354('0x6')};function emitEvent(_0x34e743){return function(_0x132ae8,_0x31e9b9,_0x597c96){_0x132ae8['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x5f3e7f){_0x132ae8[_0xb354('0x7')](_0xb354('0x8'),_0x5f3e7f['map'](function(_0x5c6cc9){return{'id':_0x5c6cc9['id']};}));return ChatMessage[_0xb354('0x9')]({'where':{'ChatInteractionId':_0x132ae8['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x41c5df){_0x132ae8['setDataValue'](_0xb354('0xa'),_0x41c5df['length']);ChatInteractionEvents['emit'](_0x34e743+':'+_0x132ae8['id'],_0x132ae8);ChatInteractionEvents[_0xb354('0xb')](_0x34e743,_0x132ae8);_0x597c96(null);})[_0xb354('0xc')](_0x597c96(null));};}for(var e in events){if(events[_0xb354('0xd')](e)){var event=events[e];ChatInteraction[_0xb354('0xe')](e,emitEvent(event));}}module[_0xb354('0xf')]=ChatInteractionEvents;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js
index 921d74b..af376f2 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 _0x269c=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatInteraction.attributes','exports','define','chat_interactions','changed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util'];(function(_0x572ab2,_0x296d2e){var _0x94cf99=function(_0x41e76b){while(--_0x41e76b){_0x572ab2['push'](_0x572ab2['shift']());}};_0x94cf99(++_0x296d2e);}(_0x269c,0x1ec));var _0xc269=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x269c[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc269('0x0'));var util=require(_0xc269('0x1'));var logger=require(_0xc269('0x2'))(_0xc269('0x3'));var moment=require(_0xc269('0x4'));var BPromise=require(_0xc269('0x5'));var rp=require(_0xc269('0x6'));var fs=require('fs');var path=require(_0xc269('0x7'));var rimraf=require(_0xc269('0x8'));var config=require('../../config/environment');var attributes=require(_0xc269('0x9'));module[_0xc269('0xa')]=function(_0x12c1cd,_0x3a7537){return _0x12c1cd[_0xc269('0xb')]('ChatInteraction',attributes,{'tableName':_0xc269('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x450da6,_0x44f4eb,_0x2d97eb){if(_0x450da6[_0xc269('0xd')]('closed')){_0x450da6[_0xc269('0xe')]=moment()[_0xc269('0xf')](_0xc269('0x10'));}_0x2d97eb(null,_0x450da6);}},'charset':_0xc269('0x11'),'collate':_0xc269('0x12')});};
\ No newline at end of file
+var _0x9084=['rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x4b1665,_0xb0c095){var _0x5850c0=function(_0x44b7a4){while(--_0x44b7a4){_0x4b1665['push'](_0x4b1665['shift']());}};_0x5850c0(++_0xb0c095);}(_0x9084,0x1ed));var _0x4908=function(_0x5ae619,_0x365b3d){_0x5ae619=_0x5ae619-0x0;var _0x40c0c9=_0x9084[_0x5ae619];return _0x40c0c9;};'use strict';var _=require(_0x4908('0x0'));var util=require(_0x4908('0x1'));var logger=require(_0x4908('0x2'))(_0x4908('0x3'));var moment=require(_0x4908('0x4'));var BPromise=require(_0x4908('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4908('0x6'));var rimraf=require(_0x4908('0x7'));var config=require(_0x4908('0x8'));var attributes=require(_0x4908('0x9'));module[_0x4908('0xa')]=function(_0x1789aa,_0x4807ee){return _0x1789aa[_0x4908('0xb')](_0x4908('0xc'),attributes,{'tableName':_0x4908('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3bb508,_0x59819f,_0x2809db){if(_0x3bb508[_0x4908('0xe')](_0x4908('0xf'))){_0x3bb508[_0x4908('0x10')]=moment()[_0x4908('0x11')](_0x4908('0x12'));}_0x2809db(null,_0x3bb508);}},'charset':'utf8mb4','collate':_0x4908('0x13')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index d30147b..17796dc 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 _0x029f=['error','code','ChatInteraction,\x20%s,\x20%s','message','info','catch','UpdateChatInteraction','ChatInteraction','body','options','raw','where','attributes','find','then','ids','omit','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./chatInteraction.socket','register','request','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s'];(function(_0xa329ca,_0x3613a6){var _0x24eb20=function(_0x22cf86){while(--_0x22cf86){_0xa329ca['push'](_0xa329ca['shift']());}};_0x24eb20(++_0x3613a6);}(_0x029f,0x7e));var _0xf029=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x029f[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xf029('0x0'));var util=require('util');var moment=require(_0xf029('0x1'));var BPromise=require(_0xf029('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf029('0x3'));var db=require(_0xf029('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf029('0x5'));var config=require(_0xf029('0x6'));var jayson=require(_0xf029('0x7'));var client=jayson[_0xf029('0x8')][_0xf029('0x9')]({'port':0x232a});config[_0xf029('0xa')]=_[_0xf029('0xb')](config[_0xf029('0xa')],{'host':_0xf029('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf029('0xd'))[_0xf029('0xe')](socket);function respondWithRpcPromise(_0x1d722e,_0x5ad2cb,_0x2fb120){return new BPromise(function(_0x125677,_0x1a28f4){return client[_0xf029('0xf')](_0x1d722e,_0x2fb120)['then'](function(_0x1bfd19){logger['info']('ChatInteraction,\x20%s,\x20%s',_0x5ad2cb,_0xf029('0x10'));logger['debug'](_0xf029('0x11'),_0x5ad2cb,'request\x20sent',JSON['stringify'](_0x1bfd19));if(_0x1bfd19[_0xf029('0x12')]){if(_0x1bfd19[_0xf029('0x12')][_0xf029('0x13')]===0x1f4){logger[_0xf029('0x12')](_0xf029('0x14'),_0x5ad2cb,_0x1bfd19[_0xf029('0x12')][_0xf029('0x15')]);return _0x1a28f4(_0x1bfd19['error'][_0xf029('0x15')]);}logger[_0xf029('0x12')](_0xf029('0x14'),_0x5ad2cb,_0x1bfd19[_0xf029('0x12')][_0xf029('0x15')]);return _0x125677(_0x1bfd19[_0xf029('0x12')]['message']);}else{logger[_0xf029('0x16')]('ChatInteraction,\x20%s,\x20%s',_0x5ad2cb,_0xf029('0x10'));_0x125677(_0x1bfd19['result']['message']);}})[_0xf029('0x17')](function(_0x4a5d23){logger[_0xf029('0x12')](_0xf029('0x14'),_0x5ad2cb,_0x4a5d23);_0x1a28f4(_0x4a5d23);});});}exports[_0xf029('0x18')]=function(_0x5c109a){var _0x345943=this;return new Promise(function(_0x347707,_0x1e64f5){return db[_0xf029('0x19')]['update'](_0x5c109a[_0xf029('0x1a')],{'raw':_0x5c109a[_0xf029('0x1b')]?_0x5c109a[_0xf029('0x1b')][_0xf029('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c109a[_0xf029('0x1b')]?_0x5c109a[_0xf029('0x1b')][_0xf029('0x1d')]||null:null,'attributes':_0x5c109a[_0xf029('0x1b')]?_0x5c109a['options'][_0xf029('0x1e')]||null:null,'limit':_0x5c109a[_0xf029('0x1b')]?_0x5c109a[_0xf029('0x1b')]['limit']||null:null})['then'](function(_0x372872){logger[_0xf029('0x16')]('UpdateChatInteraction',_0x5c109a);logger['debug'](_0xf029('0x18'),_0x5c109a,JSON['stringify'](_0x372872));_0x347707(_0x372872);})[_0xf029('0x17')](function(_0x10e9c8){logger[_0xf029('0x12')](_0xf029('0x18'),_0x10e9c8['message'],_0x5c109a);_0x1e64f5(_0x345943[_0xf029('0x12')](0x1f4,_0x10e9c8[_0xf029('0x15')]));});});};exports['AddTagsToChatInteraction']=function(_0x42538b){return new Promise(function(_0x3f0c45,_0x506fa4){return db[_0xf029('0x19')][_0xf029('0x1f')]({'where':_0x42538b[_0xf029('0x1b')]?_0x42538b[_0xf029('0x1b')][_0xf029('0x1d')]||null:null})[_0xf029('0x20')](function(_0x28dfc1){if(_0x28dfc1){return _0x28dfc1['addTags'](_0x42538b[_0xf029('0x1a')][_0xf029('0x21')],_[_0xf029('0x22')](_0x42538b['body'],[_0xf029('0x21'),'id'])||{});}})['spread'](function(_0x3b614a){logger[_0xf029('0x16')]('AddTags',_0x42538b);logger['debug'](_0xf029('0x23'),_0x42538b,JSON['stringify'](_0x3b614a));_0x3f0c45(_0x3b614a);})['catch'](function(_0x10d257){logger[_0xf029('0x12')](_0xf029('0x23'),_0x10d257[_0xf029('0x15')],_0x42538b);_0x506fa4(_this[_0xf029('0x12')](0x1f4,_0x10d257[_0xf029('0x15')]));});});};
\ No newline at end of file
+var _0x111e=['then','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','ChatInteraction','update','body','options','raw','where','UpdateChatInteraction','stringify','AddTagsToChatInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x111e,0x1d1));var _0xe111=function(_0x31fdd7,_0x10f202){_0x31fdd7=_0x31fdd7-0x0;var _0x268731=_0x111e[_0x31fdd7];return _0x268731;};'use strict';var _=require(_0xe111('0x0'));var util=require('util');var moment=require(_0xe111('0x1'));var BPromise=require(_0xe111('0x2'));var rs=require(_0xe111('0x3'));var fs=require('fs');var Redis=require(_0xe111('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe111('0x5'));var logger=require(_0xe111('0x6'))(_0xe111('0x7'));var config=require(_0xe111('0x8'));var jayson=require(_0xe111('0x9'));var client=jayson[_0xe111('0xa')][_0xe111('0xb')]({'port':0x232a});config[_0xe111('0xc')]=_[_0xe111('0xd')](config[_0xe111('0xc')],{'host':_0xe111('0xe'),'port':0x18eb});var socket=require(_0xe111('0xf'))(new Redis(config[_0xe111('0xc')]));require(_0xe111('0x10'))[_0xe111('0x11')](socket);function respondWithRpcPromise(_0x11089b,_0x56fdd2,_0x5a9821){return new BPromise(function(_0x327d84,_0x120b18){return client[_0xe111('0x12')](_0x11089b,_0x5a9821)[_0xe111('0x13')](function(_0x530ee2){logger['info'](_0xe111('0x14'),_0x56fdd2,_0xe111('0x15'));logger[_0xe111('0x16')](_0xe111('0x17'),_0x56fdd2,_0xe111('0x15'),JSON['stringify'](_0x530ee2));if(_0x530ee2[_0xe111('0x18')]){if(_0x530ee2[_0xe111('0x18')]['code']===0x1f4){logger[_0xe111('0x18')]('ChatInteraction,\x20%s,\x20%s',_0x56fdd2,_0x530ee2[_0xe111('0x18')][_0xe111('0x19')]);return _0x120b18(_0x530ee2[_0xe111('0x18')]['message']);}logger[_0xe111('0x18')](_0xe111('0x14'),_0x56fdd2,_0x530ee2['error']['message']);return _0x327d84(_0x530ee2[_0xe111('0x18')]['message']);}else{logger[_0xe111('0x1a')](_0xe111('0x14'),_0x56fdd2,_0xe111('0x15'));_0x327d84(_0x530ee2[_0xe111('0x1b')][_0xe111('0x19')]);}})[_0xe111('0x1c')](function(_0x2fd7b9){logger[_0xe111('0x18')](_0xe111('0x14'),_0x56fdd2,_0x2fd7b9);_0x120b18(_0x2fd7b9);});});}exports['UpdateChatInteraction']=function(_0x353363){var _0x29fbe5=this;return new Promise(function(_0xbb882f,_0x582365){return db[_0xe111('0x1d')][_0xe111('0x1e')](_0x353363[_0xe111('0x1f')],{'raw':_0x353363[_0xe111('0x20')]?_0x353363[_0xe111('0x20')][_0xe111('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x353363[_0xe111('0x20')]?_0x353363[_0xe111('0x20')][_0xe111('0x22')]||null:null,'attributes':_0x353363[_0xe111('0x20')]?_0x353363[_0xe111('0x20')]['attributes']||null:null,'limit':_0x353363['options']?_0x353363[_0xe111('0x20')]['limit']||null:null})[_0xe111('0x13')](function(_0x2e6b16){logger[_0xe111('0x1a')](_0xe111('0x23'),_0x353363);logger[_0xe111('0x16')]('UpdateChatInteraction',_0x353363,JSON[_0xe111('0x24')](_0x2e6b16));_0xbb882f(_0x2e6b16);})[_0xe111('0x1c')](function(_0x1a4b72){logger[_0xe111('0x18')](_0xe111('0x23'),_0x1a4b72['message'],_0x353363);_0x582365(_0x29fbe5[_0xe111('0x18')](0x1f4,_0x1a4b72[_0xe111('0x19')]));});});};exports[_0xe111('0x25')]=function(_0x54002f){return new Promise(function(_0x2b4de5,_0x40c6dc){return db[_0xe111('0x1d')][_0xe111('0x26')]({'where':_0x54002f['options']?_0x54002f[_0xe111('0x20')][_0xe111('0x22')]||null:null})[_0xe111('0x13')](function(_0x524320){if(_0x524320){return _0x524320[_0xe111('0x27')](_0x54002f[_0xe111('0x1f')][_0xe111('0x28')],_[_0xe111('0x29')](_0x54002f['body'],['ids','id'])||{});}})[_0xe111('0x2a')](function(_0x40f34d){logger[_0xe111('0x1a')](_0xe111('0x2b'),_0x54002f);logger[_0xe111('0x16')](_0xe111('0x2b'),_0x54002f,JSON['stringify'](_0x40f34d));_0x2b4de5(_0x40f34d);})[_0xe111('0x1c')](function(_0x684a67){logger[_0xe111('0x18')]('AddTags',_0x684a67[_0xe111('0x19')],_0x54002f);_0x40c6dc(_this[_0xe111('0x18')](0x1f4,_0x684a67[_0xe111('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index a164ec9..c8cb0fd 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 _0x5a86=['update','emit','removeListener','register','chatInteraction:'];(function(_0x410cad,_0x3b12c5){var _0x3a0afd=function(_0x137c68){while(--_0x137c68){_0x410cad['push'](_0x410cad['shift']());}};_0x3a0afd(++_0x3b12c5);}(_0x5a86,0x1a4));var _0x65a8=function(_0xad3b93,_0x4c929b){_0xad3b93=_0xad3b93-0x0;var _0x5a2416=_0x5a86[_0xad3b93];return _0x5a2416;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=['save','remove',_0x65a8('0x0')];function createListener(_0x41847e,_0x2eebbc){return function(_0x1b2b3f){_0x2eebbc[_0x65a8('0x1')](_0x41847e,_0x1b2b3f);};}function removeListener(_0x300d7d,_0x366db0){return function(){ChatInteractionEvents[_0x65a8('0x2')](_0x300d7d,_0x366db0);};}exports[_0x65a8('0x3')]=function(_0x4731d2){for(var _0x4da991=0x0,_0x32ee2d=events['length'];_0x4da991<_0x32ee2d;_0x4da991++){var _0x3c25c2=events[_0x4da991];var _0xd6209b=createListener(_0x65a8('0x4')+_0x3c25c2,_0x4731d2);ChatInteractionEvents['on'](_0x3c25c2,_0xd6209b);}};
\ No newline at end of file
+var _0xd734=['./chatInteraction.events','save','remove','update','removeListener','chatInteraction:'];(function(_0x3d8b15,_0x3f4a7e){var _0x2f9090=function(_0x51809c){while(--_0x51809c){_0x3d8b15['push'](_0x3d8b15['shift']());}};_0x2f9090(++_0x3f4a7e);}(_0xd734,0x18c));var _0x4d73=function(_0xc237ff,_0x4673ff){_0xc237ff=_0xc237ff-0x0;var _0x4b7b9b=_0xd734[_0xc237ff];return _0x4b7b9b;};'use strict';var ChatInteractionEvents=require(_0x4d73('0x0'));var events=[_0x4d73('0x1'),_0x4d73('0x2'),_0x4d73('0x3')];function createListener(_0x36961b,_0x4fddaa){return function(_0x3866f3){_0x4fddaa['emit'](_0x36961b,_0x3866f3);};}function removeListener(_0x34296c,_0x560518){return function(){ChatInteractionEvents[_0x4d73('0x4')](_0x34296c,_0x560518);};}exports['register']=function(_0x361d70){for(var _0x209d65=0x0,_0x2f05c7=events['length'];_0x209d65<_0x2f05c7;_0x209d65++){var _0x27a0c4=events[_0x209d65];var _0x596663=createListener(_0x4d73('0x5')+_0x27a0c4,_0x361d70);ChatInteractionEvents['on'](_0x27a0c4,_0x596663);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 19e6f86..0df1b94 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 _0x908a=['describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/download','download','create','post','/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','now','originalname','replace','/:id/attachment_upload','single','file','/:id/tags','chat','chatinteraction:addtags','addTags','put','tracked','chatinteraction:update','update','/:id/custom_update','customUpdate','/:id/abandon','abandon','delete','/:id','chatinteraction:destroy','destroy','exports','multer','util','path','express','fs-extra','../../components/auth/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index'];(function(_0x305bca,_0xa66795){var _0x2e06f0=function(_0x37b672){while(--_0x37b672){_0x305bca['push'](_0x305bca['shift']());}};_0x2e06f0(++_0xa66795);}(_0x908a,0x18d));var _0xa908=function(_0x3c2eb8,_0x5dff1d){_0x3c2eb8=_0x3c2eb8-0x0;var _0x41b769=_0x908a[_0x3c2eb8];return _0x41b769;};'use strict';var multer=require(_0xa908('0x0'));var util=require(_0xa908('0x1'));var path=require(_0xa908('0x2'));var timeout=require('connect-timeout');var express=require(_0xa908('0x3'));var router=express['Router']();var fs_extra=require(_0xa908('0x4'));var auth=require(_0xa908('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa908('0x6'));var controller=require(_0xa908('0x7'));router[_0xa908('0x8')]('/',auth[_0xa908('0x9')](),controller[_0xa908('0xa')]);router[_0xa908('0x8')]('/describe',auth[_0xa908('0x9')](),controller[_0xa908('0xb')]);router['get']('/:id',auth[_0xa908('0xc')](),controller[_0xa908('0xd')]);router[_0xa908('0x8')](_0xa908('0xe'),auth[_0xa908('0xc')](),controller[_0xa908('0xf')]);router[_0xa908('0x8')](_0xa908('0x10'),auth['isAuthenticated'](),controller[_0xa908('0x11')]);router[_0xa908('0x8')]('/:id/my_messages',auth[_0xa908('0xc')](),controller['getMyMessages']);router['get'](_0xa908('0x12'),auth[_0xa908('0x9')](),controller[_0xa908('0x13')]);router['post']('/',auth[_0xa908('0x9')](),controller[_0xa908('0x14')]);router[_0xa908('0x15')](_0xa908('0x16'),auth[_0xa908('0x9')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xa908('0x17')]({'destination':function(_0x5ab239,_0x406ec0,_0x45996d){_0x45996d(null,path[_0xa908('0x18')](config[_0xa908('0x19')],_0xa908('0x1a')));},'filename':function(_0x32fefa,_0x1f9874,_0x4a75fe){_0x4a75fe(null,util[_0xa908('0x1b')]('%s-%s',Date[_0xa908('0x1c')](),_0x1f9874[_0xa908('0x1d')][_0xa908('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa908('0x15')](_0xa908('0x1f'),upload[_0xa908('0x20')](_0xa908('0x21')),controller['attachmentUpload']);router['post'](_0xa908('0x10'),auth[_0xa908('0xc')](),controller['addMessage']);router[_0xa908('0x15')](_0xa908('0x22'),auth[_0xa908('0x9')](),interaction['tracked'](_0xa908('0x23'),_0xa908('0x24')),controller[_0xa908('0x25')]);router[_0xa908('0x26')]('/:id',auth[_0xa908('0x9')](),interaction[_0xa908('0x27')](_0xa908('0x23'),_0xa908('0x28')),controller[_0xa908('0x29')]);router[_0xa908('0x26')](_0xa908('0x2a'),controller[_0xa908('0x2b')]);router[_0xa908('0x26')](_0xa908('0x2c'),auth[_0xa908('0xc')](),controller[_0xa908('0x2d')]);router['put']('/:id/close',controller['close']);router[_0xa908('0x2e')](_0xa908('0x2f'),auth[_0xa908('0x9')](),interaction[_0xa908('0x27')](_0xa908('0x23'),_0xa908('0x30')),controller[_0xa908('0x31')]);router['delete'](_0xa908('0x22'),auth['isAuthenticated'](),controller['removeTags']);module[_0xa908('0x32')]=router;
\ No newline at end of file
+var _0x12ab=['update','/:id/custom_update','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','diskStorage','join','server/files/attachments/','format','%s-%s','now','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','put','/:id','chatinteraction:update'];(function(_0x45b964,_0x3505d2){var _0xf78a55=function(_0x3c46cd){while(--_0x3c46cd){_0x45b964['push'](_0x45b964['shift']());}};_0xf78a55(++_0x3505d2);}(_0x12ab,0x103));var _0xb12a=function(_0x1f0157,_0x4d6f65){_0x1f0157=_0x1f0157-0x0;var _0x4a9d01=_0x12ab[_0x1f0157];return _0x4a9d01;};'use strict';var multer=require(_0xb12a('0x0'));var util=require(_0xb12a('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb12a('0x2'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xb12a('0x3'));var interaction=require(_0xb12a('0x4'));var config=require('../../config/environment');var controller=require(_0xb12a('0x5'));router[_0xb12a('0x6')]('/',auth[_0xb12a('0x7')](),controller['index']);router[_0xb12a('0x6')](_0xb12a('0x8'),auth['isAuthenticated'](),controller[_0xb12a('0x9')]);router[_0xb12a('0x6')]('/:id',auth[_0xb12a('0xa')](),controller[_0xb12a('0xb')]);router[_0xb12a('0x6')](_0xb12a('0xc'),auth[_0xb12a('0xa')](),controller[_0xb12a('0xd')]);router[_0xb12a('0x6')]('/:id/messages',auth[_0xb12a('0x7')](),controller[_0xb12a('0xe')]);router[_0xb12a('0x6')](_0xb12a('0xf'),auth[_0xb12a('0xa')](),controller[_0xb12a('0x10')]);router[_0xb12a('0x6')](_0xb12a('0x11'),auth[_0xb12a('0x7')](),controller['download']);router[_0xb12a('0x12')]('/',auth[_0xb12a('0x7')](),controller[_0xb12a('0x13')]);router['post'](_0xb12a('0x14'),auth['isAuthenticated'](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0xb12a('0x15')]({'destination':function(_0x1f46ae,_0x2399d2,_0x5a47e9){_0x5a47e9(null,path[_0xb12a('0x16')](config['root'],_0xb12a('0x17')));},'filename':function(_0x3829f7,_0x5bf865,_0x20eba3){_0x20eba3(null,util[_0xb12a('0x18')](_0xb12a('0x19'),Date[_0xb12a('0x1a')](),_0x5bf865[_0xb12a('0x1b')][_0xb12a('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xb12a('0x12')](_0xb12a('0x1d'),upload[_0xb12a('0x1e')](_0xb12a('0x1f')),controller[_0xb12a('0x20')]);router[_0xb12a('0x12')](_0xb12a('0x21'),auth[_0xb12a('0xa')](),controller[_0xb12a('0x22')]);router[_0xb12a('0x12')](_0xb12a('0x23'),auth['isAuthenticated'](),interaction[_0xb12a('0x24')](_0xb12a('0x25'),'chatinteraction:addtags'),controller['addTags']);router[_0xb12a('0x26')](_0xb12a('0x27'),auth[_0xb12a('0x7')](),interaction[_0xb12a('0x24')](_0xb12a('0x25'),_0xb12a('0x28')),controller[_0xb12a('0x29')]);router[_0xb12a('0x26')](_0xb12a('0x2a'),controller['customUpdate']);router[_0xb12a('0x26')]('/:id/abandon',auth[_0xb12a('0xa')](),controller['abandon']);router[_0xb12a('0x26')](_0xb12a('0x2b'),controller[_0xb12a('0x2c')]);router[_0xb12a('0x2d')](_0xb12a('0x27'),auth['isAuthenticated'](),interaction['tracked'](_0xb12a('0x25'),_0xb12a('0x2e')),controller[_0xb12a('0x2f')]);router[_0xb12a('0x2d')](_0xb12a('0x23'),auth['isAuthenticated'](),controller[_0xb12a('0x30')]);module[_0xb12a('0x31')]=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 4ab6e7c..4fa7825 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 _0xc00f=['TEXT','medium','BOOLEAN','sequelize'];(function(_0x5b2e6e,_0x2db042){var _0x32957e=function(_0x3f6ca3){while(--_0x3f6ca3){_0x5b2e6e['push'](_0x5b2e6e['shift']());}};_0x32957e(++_0x2db042);}(_0xc00f,0x83));var _0xfc00=function(_0x531e48,_0x4bb96b){_0x531e48=_0x531e48-0x0;var _0x202971=_0xc00f[_0x531e48];return _0x202971;};'use strict';var Sequelize=require(_0xfc00('0x0'));module['exports']={'body':{'type':Sequelize[_0xfc00('0x1')](_0xfc00('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xfc00('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0x6034=['BOOLEAN','INTEGER'];(function(_0x129d57,_0x2c2a70){var _0xb55bc1=function(_0x1aa191){while(--_0x1aa191){_0x129d57['push'](_0x129d57['shift']());}};_0xb55bc1(++_0x2c2a70);}(_0x6034,0x94));var _0x4603=function(_0xae3dc5,_0x501872){_0xae3dc5=_0xae3dc5-0x0;var _0x1a883a=_0x6034[_0xae3dc5];return _0x1a883a;};'use strict';var Sequelize=require('sequelize');module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x4603('0x0')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x4603('0x1')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index 99d2492..87ce695 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 _0xdfe3=['key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','agent','admin','user','fullname','role','internal','lastLoginAt','allowmessenger','showWebBar','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','userProfileId','isEmpty','resourceId','push','FromId','ToId','read','all','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','undefined','count','Content-Range','apply','reject','update','then','stack','name','send','index','map','ChatInternalMessage','rawAttributes','fieldName','type'];(function(_0x48222e,_0x336aa5){var _0x23031d=function(_0x43be1d){while(--_0x43be1d){_0x48222e['push'](_0x48222e['shift']());}};_0x23031d(++_0x336aa5);}(_0xdfe3,0x9e));var _0x3dfe=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xdfe3[_0x2070da];return _0x4f9fe1;};'use strict';var emlformat=require(_0x3dfe('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3dfe('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3dfe('0x2'));var Mustache=require(_0x3dfe('0x3'));var util=require(_0x3dfe('0x4'));var path=require(_0x3dfe('0x5'));var sox=require(_0x3dfe('0x6'));var csv=require(_0x3dfe('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x3dfe('0x8'));var _=require(_0x3dfe('0x9'));var squel=require(_0x3dfe('0xa'));var crypto=require(_0x3dfe('0xb'));var jsforce=require(_0x3dfe('0xc'));var deskjs=require(_0x3dfe('0xd'));var toCsv=require(_0x3dfe('0x7'));var querystring=require(_0x3dfe('0xe'));var Papa=require('papaparse');var Redis=require(_0x3dfe('0xf'));var authService=require(_0x3dfe('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3dfe('0x11'));var hardwareService=require(_0x3dfe('0x12'));var logger=require(_0x3dfe('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x3dfe('0x14'));var licenseUtil=require(_0x3dfe('0x15'));var db=require(_0x3dfe('0x16'))['db'];config[_0x3dfe('0x17')]=_[_0x3dfe('0x18')](config[_0x3dfe('0x17')],{'host':_0x3dfe('0x19'),'port':0x18eb});var socket=require(_0x3dfe('0x1a'))(new Redis(config[_0x3dfe('0x17')]));require('./chatInternalMessage.socket')[_0x3dfe('0x1b')](socket);function respondWithStatusCode(_0x4b92af,_0x2fc715){_0x2fc715=_0x2fc715||0xcc;return function(_0x36085b){if(_0x36085b){return _0x4b92af[_0x3dfe('0x1c')](_0x2fc715);}return _0x4b92af[_0x3dfe('0x1d')](_0x2fc715)[_0x3dfe('0x1e')]();};}function respondWithResult(_0x3b66db,_0x4f7051){_0x4f7051=_0x4f7051||0xc8;return function(_0x2ebbd4){if(_0x2ebbd4){return _0x3b66db[_0x3dfe('0x1d')](_0x4f7051)[_0x3dfe('0x1f')](_0x2ebbd4);}};}function respondWithFilteredResult(_0x3b4a4a,_0x35a1d0){return function(_0x4c7dfc){if(_0x4c7dfc){var _0x18ff9e=typeof _0x35a1d0[_0x3dfe('0x20')]==='undefined'&&typeof _0x35a1d0[_0x3dfe('0x21')]===_0x3dfe('0x22');var _0x15bcab=_0x4c7dfc[_0x3dfe('0x23')];var _0x14df9c=_0x18ff9e?0x0:_0x35a1d0[_0x3dfe('0x20')];var _0x15c61f=_0x18ff9e?_0x4c7dfc[_0x3dfe('0x23')]:_0x35a1d0['offset']+_0x35a1d0[_0x3dfe('0x21')];var _0x39d7b8;if(_0x15c61f>=_0x15bcab){_0x15c61f=_0x15bcab;_0x39d7b8=0xc8;}else{_0x39d7b8=0xce;}_0x3b4a4a[_0x3dfe('0x1d')](_0x39d7b8);return _0x3b4a4a['set'](_0x3dfe('0x24'),_0x14df9c+'-'+_0x15c61f+'/'+_0x15bcab)[_0x3dfe('0x1f')](_0x4c7dfc);}return null;};}function patchUpdates(_0x47ae9e){return function(_0xfa4776){try{jsonpatch[_0x3dfe('0x25')](_0xfa4776,_0x47ae9e,!![]);}catch(_0x43c11e){return BPromise[_0x3dfe('0x26')](_0x43c11e);}return _0xfa4776['save']();};}function saveUpdates(_0x37a6a5,_0x32812e){return function(_0x15ddde){if(_0x15ddde){return _0x15ddde[_0x3dfe('0x27')](_0x37a6a5)[_0x3dfe('0x28')](function(_0x4009ce){return _0x4009ce;});}return null;};}function removeEntity(_0x220765,_0x33f2cb){return function(_0x41f664){if(_0x41f664){return _0x41f664['destroy']()[_0x3dfe('0x28')](function(){_0x220765['status'](0xcc)[_0x3dfe('0x1e')]();});}};}function handleEntityNotFound(_0x438123,_0x18d8f2){return function(_0x240b54){if(!_0x240b54){_0x438123[_0x3dfe('0x1c')](0x194);}return _0x240b54;};}function handleError(_0x5d8f4a,_0x3435c0){_0x3435c0=_0x3435c0||0x1f4;return function(_0x4a18e0){logger['error'](_0x4a18e0[_0x3dfe('0x29')]);if(_0x4a18e0[_0x3dfe('0x2a')]){delete _0x4a18e0[_0x3dfe('0x2a')];}_0x5d8f4a[_0x3dfe('0x1d')](_0x3435c0)[_0x3dfe('0x2b')](_0x4a18e0);};}exports[_0x3dfe('0x2c')]=function(_0xeb018,_0x529e4e){var _0x190135={},_0x3820a9={},_0x112330={'count':0x0,'rows':[]};var _0x485754=_[_0x3dfe('0x2d')](db[_0x3dfe('0x2e')][_0x3dfe('0x2f')],function(_0x1c92e4){return{'name':_0x1c92e4[_0x3dfe('0x30')],'type':_0x1c92e4[_0x3dfe('0x31')][_0x3dfe('0x32')]};});_0x3820a9[_0x3dfe('0x33')]=_[_0x3dfe('0x2d')](_0x485754,_0x3dfe('0x2a'));_0x3820a9[_0x3dfe('0x34')]=_[_0x3dfe('0x35')](_0xeb018[_0x3dfe('0x34')]);_0x3820a9['filters']=_[_0x3dfe('0x36')](_0x3820a9['model'],_0x3820a9['query']);_0x190135['attributes']=_['intersection'](_0x3820a9[_0x3dfe('0x33')],qs[_0x3dfe('0x37')](_0xeb018[_0x3dfe('0x34')][_0x3dfe('0x37')]));_0x190135['attributes']=_0x190135[_0x3dfe('0x38')][_0x3dfe('0x39')]?_0x190135[_0x3dfe('0x38')]:_0x3820a9['model'];if(!_0xeb018[_0x3dfe('0x34')][_0x3dfe('0x3a')]('nolimit')){_0x190135['limit']=qs['limit'](_0xeb018['query'][_0x3dfe('0x21')]);_0x190135[_0x3dfe('0x20')]=qs['offset'](_0xeb018['query'][_0x3dfe('0x20')]);}_0x190135['order']=qs[_0x3dfe('0x3b')](_0xeb018['query'][_0x3dfe('0x3b')]);_0x190135[_0x3dfe('0x3c')]=qs[_0x3dfe('0x3d')](_['pick'](_0xeb018['query'],_0x3820a9[_0x3dfe('0x3d')]),_0x485754);if(_0xeb018[_0x3dfe('0x34')][_0x3dfe('0x3e')]){_0x190135[_0x3dfe('0x3c')]=_[_0x3dfe('0x3f')](_0x190135[_0x3dfe('0x3c')],{'$or':_['map'](_0x485754,function(_0x3bce2e){if(_0x3bce2e[_0x3dfe('0x31')]!==_0x3dfe('0x40')){var _0x1520da={};_0x1520da[_0x3bce2e['name']]={'$like':'%'+_0xeb018[_0x3dfe('0x34')]['filter']+'%'};return _0x1520da;}})});}_0x190135=_[_0x3dfe('0x3f')]({},_0x190135,_0xeb018[_0x3dfe('0x41')]);var _0x2e08d3={'where':_0x190135[_0x3dfe('0x3c')]};return db[_0x3dfe('0x2e')][_0x3dfe('0x23')](_0x2e08d3)[_0x3dfe('0x28')](function(_0xe3280f){_0x112330[_0x3dfe('0x23')]=_0xe3280f;if(_0xeb018['query']['includeAll']){_0x190135[_0x3dfe('0x42')]=[{'all':!![]}];}return db[_0x3dfe('0x2e')][_0x3dfe('0x43')](_0x190135);})[_0x3dfe('0x28')](function(_0x5e6059){_0x112330[_0x3dfe('0x44')]=_0x5e6059;return _0x112330;})[_0x3dfe('0x28')](respondWithFilteredResult(_0x529e4e,_0x190135))['catch'](handleError(_0x529e4e,null));};exports[_0x3dfe('0x45')]=function(_0x49852d,_0x598537){var _0x4af5fe={'raw':!![],'where':{'id':_0x49852d[_0x3dfe('0x46')]['id']}},_0x5d3783={};_0x5d3783[_0x3dfe('0x33')]=_[_0x3dfe('0x35')](db[_0x3dfe('0x2e')]['rawAttributes']);_0x5d3783[_0x3dfe('0x34')]=_[_0x3dfe('0x35')](_0x49852d[_0x3dfe('0x34')]);_0x5d3783[_0x3dfe('0x3d')]=_['intersection'](_0x5d3783[_0x3dfe('0x33')],_0x5d3783[_0x3dfe('0x34')]);_0x4af5fe['attributes']=_[_0x3dfe('0x36')](_0x5d3783[_0x3dfe('0x33')],qs[_0x3dfe('0x37')](_0x49852d['query'][_0x3dfe('0x37')]));_0x4af5fe[_0x3dfe('0x38')]=_0x4af5fe[_0x3dfe('0x38')]['length']?_0x4af5fe['attributes']:_0x5d3783[_0x3dfe('0x33')];if(_0x49852d[_0x3dfe('0x34')]['includeAll']){_0x4af5fe[_0x3dfe('0x42')]=[{'all':!![]}];}_0x4af5fe=_[_0x3dfe('0x3f')]({},_0x4af5fe,_0x49852d[_0x3dfe('0x41')]);return db[_0x3dfe('0x2e')][_0x3dfe('0x47')](_0x4af5fe)[_0x3dfe('0x28')](handleEntityNotFound(_0x598537,null))[_0x3dfe('0x28')](respondWithResult(_0x598537,null))[_0x3dfe('0x48')](handleError(_0x598537,null));};exports[_0x3dfe('0x49')]=function(_0x57030b,_0x1d88a2){return db['ChatInternalMessage']['create'](_0x57030b[_0x3dfe('0x4a')],{})[_0x3dfe('0x28')](respondWithResult(_0x1d88a2,0xc9))['catch'](handleError(_0x1d88a2,null));};exports[_0x3dfe('0x27')]=function(_0xef027c,_0x4dfb14){if(_0xef027c[_0x3dfe('0x4a')]['id']){delete _0xef027c[_0x3dfe('0x4a')]['id'];}return db[_0x3dfe('0x2e')][_0x3dfe('0x47')]({'where':{'id':_0xef027c[_0x3dfe('0x46')]['id']}})[_0x3dfe('0x28')](handleEntityNotFound(_0x4dfb14,null))[_0x3dfe('0x28')](saveUpdates(_0xef027c['body'],null))[_0x3dfe('0x28')](respondWithResult(_0x4dfb14,null))[_0x3dfe('0x48')](handleError(_0x4dfb14,null));};exports[_0x3dfe('0x4b')]=function(_0x2f3fce,_0x51cd41){return db['ChatInternalMessage']['find']({'where':{'id':_0x2f3fce[_0x3dfe('0x46')]['id']}})[_0x3dfe('0x28')](handleEntityNotFound(_0x51cd41,null))['then'](removeEntity(_0x51cd41,null))[_0x3dfe('0x48')](handleError(_0x51cd41,null));};exports[_0x3dfe('0x4c')]=function(_0x277a83,_0x2be5c4){return db[_0x3dfe('0x2e')]['describe']()[_0x3dfe('0x28')](respondWithResult(_0x2be5c4,null))['catch'](handleError(_0x2be5c4,null));};function wrapUser(_0x2b15f8){return function(_0x2a3b5a){var _0x4ff940=_0x2b15f8[_0x3dfe('0x4d')]({'plain':!![]});_0x4ff940[_0x3dfe('0x4e')]=[];if(_0x2a3b5a){_0x4ff940[_0x3dfe('0x4f')]=_0x2a3b5a[_0x3dfe('0x50')];_0x4ff940[_0x3dfe('0x51')]=_0x2a3b5a;}else{_0x4ff940[_0x3dfe('0x4f')]=moment(0x0)[_0x3dfe('0x52')](_0x3dfe('0x53'));_0x4ff940[_0x3dfe('0x51')]={};}return _0x4ff940;};}exports[_0x3dfe('0x54')]=function(_0x39e078,_0x46bfee,_0x2b06dc){var _0x26945d=[];return db['User']['findAll']({'where':{'role':[_0x3dfe('0x55'),_0x3dfe('0x56'),_0x3dfe('0x57')]},'attributes':['id',_0x3dfe('0x58'),_0x3dfe('0x2a'),_0x3dfe('0x59'),'userpic',_0x3dfe('0x5a'),'online',_0x3dfe('0x5b'),_0x3dfe('0x5c'),_0x3dfe('0x5d')],'order':qs[_0x3dfe('0x3b')]('-online'),'include':[{'model':db['VoiceQueue'],'as':'VoiceQueues','attributes':['id',_0x3dfe('0x2a'),_0x3dfe('0x31')],'through':{'attributes':[]}}]})[_0x3dfe('0x28')](function(_0x22ae3a){if(_0x22ae3a){var _0x59617c=_0x39e078[_0x3dfe('0x57')][_0x3dfe('0x4d')]({'plain':!![]});if(!_0x59617c)throw new Error(_0x3dfe('0x5e'));if(_0x59617c[_0x3dfe('0x59')]===_0x3dfe('0x57')){return db['UserProfileSection']['find']({'where':{'name':_0x3dfe('0x5f'),'userProfileId':_0x59617c[_0x3dfe('0x60')]},'raw':!![]})['then'](function(_0x28802b){if(_0x28802b){if(_0x28802b['autoAssociation']===0x0){return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x28802b['id']},'raw':!![]})[_0x3dfe('0x28')](function(_0x53da11){var _0x561f7b=[];if(_[_0x3dfe('0x61')](_0x53da11)){_0x561f7b=_[_0x3dfe('0x3e')](_0x22ae3a,function(_0x254158){if(_0x254158['role']!==_0x3dfe('0x55')){return _0x254158;}});return _0x561f7b;}else{for(var _0x3af851=0x0;_0x3af851<_0x22ae3a[_0x3dfe('0x39')];_0x3af851++){var _0x4bdf67=_0x22ae3a[_0x3af851];if(_0x4bdf67[_0x3dfe('0x59')]===_0x3dfe('0x55')){var _0x50871e=_['find'](_0x53da11,function(_0x3ae6fa){return _0x3ae6fa[_0x3dfe('0x62')]===_0x4bdf67['id'];});if(_0x50871e)_0x561f7b[_0x3dfe('0x63')](_0x4bdf67);}else{_0x561f7b[_0x3dfe('0x63')](_0x4bdf67);}}return _0x561f7b;}});}else{return _0x22ae3a;}}else{var _0x4b1bde=_[_0x3dfe('0x3e')](_0x22ae3a,function(_0x2a11dd){if(_0x2a11dd['role']!==_0x3dfe('0x55')){return _0x2a11dd;}});return _0x4b1bde;}});}else{return _0x22ae3a;}}})[_0x3dfe('0x28')](function(_0x354634){var _0x334f39=[];if(_0x354634){_0x26945d=_0x354634;for(var _0x1dc2ac=0x0;_0x1dc2ac<_0x354634[_0x3dfe('0x39')];_0x1dc2ac+=0x1){_0x26945d[_0x1dc2ac][_0x3dfe('0x4e')]=[];_0x334f39['push'](db['ChatInternalMessage'][_0x3dfe('0x47')]({'where':{'FromId':[_0x39e078['user']['id'],_0x354634[_0x1dc2ac]['id']],'ToId':[_0x39e078['user']['id'],_0x354634[_0x1dc2ac]['id']],'ChatGroupId':null},'attributes':['id',_0x3dfe('0x50'),_0x3dfe('0x64'),_0x3dfe('0x65'),_0x3dfe('0x66'),_0x3dfe('0x4a')],'order':qs[_0x3dfe('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3dfe('0x28')](wrapUser(_0x354634[_0x1dc2ac])));}return BPromise[_0x3dfe('0x67')](_0x334f39);}return[];})['then'](function(_0x26fbd1){return{'rows':_0x26fbd1,'count':_0x26fbd1['length']};})[_0x3dfe('0x28')](respondWithResult(_0x46bfee,null))['catch'](handleError(_0x46bfee,null));};
\ No newline at end of file
+var _0x41b0=['sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','reject','save','then','destroy','error','stack','name','index','map','ChatInternalMessage','type','key','query','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','filters','find','create','body','update','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','getUsers','User','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','agent','resourceId','push','FromId','ToId','-createdAt','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x2a2529,_0x3b1281){var _0x341e23=function(_0x2ccccc){while(--_0x2ccccc){_0x2a2529['push'](_0x2a2529['shift']());}};_0x341e23(++_0x3b1281);}(_0x41b0,0xc4));var _0x041b=function(_0x47b15f,_0x103e93){_0x47b15f=_0x47b15f-0x0;var _0x55bf25=_0x41b0[_0x47b15f];return _0x55bf25;};'use strict';var emlformat=require(_0x041b('0x0'));var rimraf=require(_0x041b('0x1'));var zipdir=require(_0x041b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x041b('0x3'));var moment=require(_0x041b('0x4'));var BPromise=require(_0x041b('0x5'));var Mustache=require(_0x041b('0x6'));var util=require('util');var path=require(_0x041b('0x7'));var sox=require('sox');var csv=require(_0x041b('0x8'));var ejs=require(_0x041b('0x9'));var fs=require('fs');var fs_extra=require(_0x041b('0xa'));var _=require(_0x041b('0xb'));var squel=require(_0x041b('0xc'));var crypto=require(_0x041b('0xd'));var jsforce=require(_0x041b('0xe'));var deskjs=require(_0x041b('0xf'));var toCsv=require(_0x041b('0x8'));var querystring=require(_0x041b('0x10'));var Papa=require(_0x041b('0x11'));var Redis=require(_0x041b('0x12'));var authService=require(_0x041b('0x13'));var qs=require(_0x041b('0x14'));var as=require(_0x041b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x041b('0x16'))(_0x041b('0x17'));var utils=require(_0x041b('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x041b('0x19'));var db=require(_0x041b('0x1a'))['db'];config['redis']=_[_0x041b('0x1b')](config[_0x041b('0x1c')],{'host':'localhost','port':0x18eb});var socket=require(_0x041b('0x1d'))(new Redis(config[_0x041b('0x1c')]));require(_0x041b('0x1e'))[_0x041b('0x1f')](socket);function respondWithStatusCode(_0x411465,_0x45fe5e){_0x45fe5e=_0x45fe5e||0xcc;return function(_0x53674f){if(_0x53674f){return _0x411465[_0x041b('0x20')](_0x45fe5e);}return _0x411465[_0x041b('0x21')](_0x45fe5e)[_0x041b('0x22')]();};}function respondWithResult(_0x22164d,_0x395e35){_0x395e35=_0x395e35||0xc8;return function(_0x1b83b1){if(_0x1b83b1){return _0x22164d[_0x041b('0x21')](_0x395e35)['json'](_0x1b83b1);}};}function respondWithFilteredResult(_0x70d1dc,_0x263a59){return function(_0x168aa1){if(_0x168aa1){var _0x58e1d1=typeof _0x263a59[_0x041b('0x23')]===_0x041b('0x24')&&typeof _0x263a59[_0x041b('0x25')]===_0x041b('0x24');var _0x343813=_0x168aa1['count'];var _0x58d0bb=_0x58e1d1?0x0:_0x263a59[_0x041b('0x23')];var _0x255688=_0x58e1d1?_0x168aa1[_0x041b('0x26')]:_0x263a59['offset']+_0x263a59['limit'];var _0x166770;if(_0x255688>=_0x343813){_0x255688=_0x343813;_0x166770=0xc8;}else{_0x166770=0xce;}_0x70d1dc['status'](_0x166770);return _0x70d1dc[_0x041b('0x27')](_0x041b('0x28'),_0x58d0bb+'-'+_0x255688+'/'+_0x343813)[_0x041b('0x29')](_0x168aa1);}return null;};}function patchUpdates(_0x12bdf2){return function(_0x15d0bf){try{jsonpatch['apply'](_0x15d0bf,_0x12bdf2,!![]);}catch(_0x423a93){return BPromise[_0x041b('0x2a')](_0x423a93);}return _0x15d0bf[_0x041b('0x2b')]();};}function saveUpdates(_0x5a0cfc,_0x18cc2a){return function(_0x4e7c7e){if(_0x4e7c7e){return _0x4e7c7e['update'](_0x5a0cfc)[_0x041b('0x2c')](function(_0x2dfb61){return _0x2dfb61;});}return null;};}function removeEntity(_0xe18570,_0x13a455){return function(_0xa99909){if(_0xa99909){return _0xa99909[_0x041b('0x2d')]()[_0x041b('0x2c')](function(){_0xe18570[_0x041b('0x21')](0xcc)[_0x041b('0x22')]();});}};}function handleEntityNotFound(_0x4e0adf,_0x27bd54){return function(_0x575369){if(!_0x575369){_0x4e0adf[_0x041b('0x20')](0x194);}return _0x575369;};}function handleError(_0x599995,_0x22c9b4){_0x22c9b4=_0x22c9b4||0x1f4;return function(_0x1bd3a8){logger[_0x041b('0x2e')](_0x1bd3a8[_0x041b('0x2f')]);if(_0x1bd3a8[_0x041b('0x30')]){delete _0x1bd3a8[_0x041b('0x30')];}_0x599995[_0x041b('0x21')](_0x22c9b4)['send'](_0x1bd3a8);};}exports[_0x041b('0x31')]=function(_0x53b9a0,_0x27b4ec){var _0x5c08c1={},_0x71d08={},_0x5802db={'count':0x0,'rows':[]};var _0x3eb730=_[_0x041b('0x32')](db[_0x041b('0x33')]['rawAttributes'],function(_0x8d07ce){return{'name':_0x8d07ce['fieldName'],'type':_0x8d07ce[_0x041b('0x34')][_0x041b('0x35')]};});_0x71d08['model']=_[_0x041b('0x32')](_0x3eb730,_0x041b('0x30'));_0x71d08[_0x041b('0x36')]=_['keys'](_0x53b9a0['query']);_0x71d08['filters']=_[_0x041b('0x37')](_0x71d08[_0x041b('0x38')],_0x71d08['query']);_0x5c08c1['attributes']=_['intersection'](_0x71d08['model'],qs['fields'](_0x53b9a0[_0x041b('0x36')][_0x041b('0x39')]));_0x5c08c1[_0x041b('0x3a')]=_0x5c08c1[_0x041b('0x3a')][_0x041b('0x3b')]?_0x5c08c1['attributes']:_0x71d08[_0x041b('0x38')];if(!_0x53b9a0['query'][_0x041b('0x3c')](_0x041b('0x3d'))){_0x5c08c1[_0x041b('0x25')]=qs[_0x041b('0x25')](_0x53b9a0[_0x041b('0x36')][_0x041b('0x25')]);_0x5c08c1['offset']=qs[_0x041b('0x23')](_0x53b9a0['query'][_0x041b('0x23')]);}_0x5c08c1['order']=qs[_0x041b('0x3e')](_0x53b9a0['query'][_0x041b('0x3e')]);_0x5c08c1[_0x041b('0x3f')]=qs['filters'](_[_0x041b('0x40')](_0x53b9a0[_0x041b('0x36')],_0x71d08['filters']),_0x3eb730);if(_0x53b9a0[_0x041b('0x36')][_0x041b('0x41')]){_0x5c08c1[_0x041b('0x3f')]=_['merge'](_0x5c08c1['where'],{'$or':_['map'](_0x3eb730,function(_0x306c7d){if(_0x306c7d[_0x041b('0x34')]!==_0x041b('0x42')){var _0x534dac={};_0x534dac[_0x306c7d[_0x041b('0x30')]]={'$like':'%'+_0x53b9a0[_0x041b('0x36')][_0x041b('0x41')]+'%'};return _0x534dac;}})});}_0x5c08c1=_[_0x041b('0x43')]({},_0x5c08c1,_0x53b9a0['options']);var _0x21baa0={'where':_0x5c08c1[_0x041b('0x3f')]};return db[_0x041b('0x33')][_0x041b('0x26')](_0x21baa0)['then'](function(_0x4dd8bb){_0x5802db[_0x041b('0x26')]=_0x4dd8bb;if(_0x53b9a0[_0x041b('0x36')][_0x041b('0x44')]){_0x5c08c1[_0x041b('0x45')]=[{'all':!![]}];}return db[_0x041b('0x33')][_0x041b('0x46')](_0x5c08c1);})[_0x041b('0x2c')](function(_0x421408){_0x5802db[_0x041b('0x47')]=_0x421408;return _0x5802db;})[_0x041b('0x2c')](respondWithFilteredResult(_0x27b4ec,_0x5c08c1))[_0x041b('0x48')](handleError(_0x27b4ec,null));};exports[_0x041b('0x49')]=function(_0x10fa82,_0x385ac8){var _0x415dcf={'raw':!![],'where':{'id':_0x10fa82[_0x041b('0x4a')]['id']}},_0x2574ed={};_0x2574ed['model']=_[_0x041b('0x4b')](db[_0x041b('0x33')][_0x041b('0x4c')]);_0x2574ed[_0x041b('0x36')]=_[_0x041b('0x4b')](_0x10fa82[_0x041b('0x36')]);_0x2574ed[_0x041b('0x4d')]=_[_0x041b('0x37')](_0x2574ed[_0x041b('0x38')],_0x2574ed['query']);_0x415dcf['attributes']=_[_0x041b('0x37')](_0x2574ed[_0x041b('0x38')],qs[_0x041b('0x39')](_0x10fa82[_0x041b('0x36')][_0x041b('0x39')]));_0x415dcf['attributes']=_0x415dcf[_0x041b('0x3a')][_0x041b('0x3b')]?_0x415dcf[_0x041b('0x3a')]:_0x2574ed[_0x041b('0x38')];if(_0x10fa82[_0x041b('0x36')][_0x041b('0x44')]){_0x415dcf[_0x041b('0x45')]=[{'all':!![]}];}_0x415dcf=_['merge']({},_0x415dcf,_0x10fa82['options']);return db[_0x041b('0x33')][_0x041b('0x4e')](_0x415dcf)['then'](handleEntityNotFound(_0x385ac8,null))[_0x041b('0x2c')](respondWithResult(_0x385ac8,null))[_0x041b('0x48')](handleError(_0x385ac8,null));};exports[_0x041b('0x4f')]=function(_0x3e0475,_0x27a19e){return db[_0x041b('0x33')][_0x041b('0x4f')](_0x3e0475[_0x041b('0x50')],{})[_0x041b('0x2c')](respondWithResult(_0x27a19e,0xc9))['catch'](handleError(_0x27a19e,null));};exports[_0x041b('0x51')]=function(_0x1b529c,_0x16d473){if(_0x1b529c[_0x041b('0x50')]['id']){delete _0x1b529c['body']['id'];}return db[_0x041b('0x33')]['find']({'where':{'id':_0x1b529c[_0x041b('0x4a')]['id']}})[_0x041b('0x2c')](handleEntityNotFound(_0x16d473,null))[_0x041b('0x2c')](saveUpdates(_0x1b529c[_0x041b('0x50')],null))[_0x041b('0x2c')](respondWithResult(_0x16d473,null))['catch'](handleError(_0x16d473,null));};exports[_0x041b('0x2d')]=function(_0x47fba4,_0x22d060){return db[_0x041b('0x33')][_0x041b('0x4e')]({'where':{'id':_0x47fba4['params']['id']}})[_0x041b('0x2c')](handleEntityNotFound(_0x22d060,null))['then'](removeEntity(_0x22d060,null))[_0x041b('0x48')](handleError(_0x22d060,null));};exports[_0x041b('0x52')]=function(_0x46e3ef,_0x337b52){return db['ChatInternalMessage'][_0x041b('0x52')]()[_0x041b('0x2c')](respondWithResult(_0x337b52,null))[_0x041b('0x48')](handleError(_0x337b52,null));};function wrapUser(_0xd1a626){return function(_0x587266){var _0x36c73b=_0xd1a626[_0x041b('0x53')]({'plain':!![]});_0x36c73b[_0x041b('0x54')]=[];if(_0x587266){_0x36c73b[_0x041b('0x55')]=_0x587266[_0x041b('0x56')];_0x36c73b[_0x041b('0x57')]=_0x587266;}else{_0x36c73b[_0x041b('0x55')]=moment(0x0)[_0x041b('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x36c73b['lastMessage']={};}return _0x36c73b;};}exports[_0x041b('0x59')]=function(_0x1b9ac7,_0x4cc5b7,_0x531454){var _0x272d33=[];return db[_0x041b('0x5a')][_0x041b('0x46')]({'where':{'role':['agent','admin',_0x041b('0x5b')]},'attributes':['id',_0x041b('0x5c'),_0x041b('0x30'),_0x041b('0x5d'),_0x041b('0x5e'),_0x041b('0x5f'),_0x041b('0x60'),_0x041b('0x61'),_0x041b('0x62'),_0x041b('0x63')],'order':qs[_0x041b('0x3e')](_0x041b('0x64')),'include':[{'model':db[_0x041b('0x65')],'as':_0x041b('0x66'),'attributes':['id',_0x041b('0x30'),_0x041b('0x34')],'through':{'attributes':[]}}]})[_0x041b('0x2c')](function(_0x4ada59){if(_0x4ada59){var _0x51cc79=_0x1b9ac7[_0x041b('0x5b')][_0x041b('0x53')]({'plain':!![]});if(!_0x51cc79)throw new Error(_0x041b('0x67'));if(_0x51cc79[_0x041b('0x5d')]==='user'){return db[_0x041b('0x68')]['find']({'where':{'name':_0x041b('0x69'),'userProfileId':_0x51cc79[_0x041b('0x6a')]},'raw':!![]})[_0x041b('0x2c')](function(_0x3d0f29){if(_0x3d0f29){if(_0x3d0f29[_0x041b('0x6b')]===0x0){return db['UserProfileResource'][_0x041b('0x46')]({'where':{'sectionId':_0x3d0f29['id']},'raw':!![]})[_0x041b('0x2c')](function(_0x48f01a){var _0x5bf936=[];if(_['isEmpty'](_0x48f01a)){_0x5bf936=_[_0x041b('0x41')](_0x4ada59,function(_0x426603){if(_0x426603[_0x041b('0x5d')]!==_0x041b('0x6c')){return _0x426603;}});return _0x5bf936;}else{for(var _0x2be507=0x0;_0x2be507<_0x4ada59[_0x041b('0x3b')];_0x2be507++){var _0xb3f04=_0x4ada59[_0x2be507];if(_0xb3f04[_0x041b('0x5d')]===_0x041b('0x6c')){var _0x34c4fe=_['find'](_0x48f01a,function(_0x34ef05){return _0x34ef05[_0x041b('0x6d')]===_0xb3f04['id'];});if(_0x34c4fe)_0x5bf936[_0x041b('0x6e')](_0xb3f04);}else{_0x5bf936[_0x041b('0x6e')](_0xb3f04);}}return _0x5bf936;}});}else{return _0x4ada59;}}else{var _0x2713b6=_[_0x041b('0x41')](_0x4ada59,function(_0x587a4c){if(_0x587a4c[_0x041b('0x5d')]!=='agent'){return _0x587a4c;}});return _0x2713b6;}});}else{return _0x4ada59;}}})[_0x041b('0x2c')](function(_0x235b9e){var _0x25b356=[];if(_0x235b9e){_0x272d33=_0x235b9e;for(var _0x526355=0x0;_0x526355<_0x235b9e[_0x041b('0x3b')];_0x526355+=0x1){_0x272d33[_0x526355][_0x041b('0x54')]=[];_0x25b356[_0x041b('0x6e')](db[_0x041b('0x33')][_0x041b('0x4e')]({'where':{'FromId':[_0x1b9ac7[_0x041b('0x5b')]['id'],_0x235b9e[_0x526355]['id']],'ToId':[_0x1b9ac7[_0x041b('0x5b')]['id'],_0x235b9e[_0x526355]['id']],'ChatGroupId':null},'attributes':['id',_0x041b('0x56'),_0x041b('0x6f'),_0x041b('0x70'),'read',_0x041b('0x50')],'order':qs[_0x041b('0x3e')](_0x041b('0x71')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x041b('0x2c')](wrapUser(_0x235b9e[_0x526355])));}return BPromise['all'](_0x25b356);}return[];})[_0x041b('0x2c')](function(_0x21ebb5){return{'rows':_0x21ebb5,'count':_0x21ebb5['length']};})[_0x041b('0x2c')](respondWithResult(_0x4cc5b7,null))[_0x041b('0x48')](handleError(_0x4cc5b7,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 8e5423f..1cbd4c0 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 _0xc102=['../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hook','exports','events'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc102,0x77));var _0x2c10=function(_0x4fe5bf,_0x35c89a){_0x4fe5bf=_0x4fe5bf-0x0;var _0x219fa2=_0xc102[_0x4fe5bf];return _0x219fa2;};'use strict';var EventEmitter=require(_0x2c10('0x0'));var ChatInternalMessage=require(_0x2c10('0x1'))['db'][_0x2c10('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x2c10('0x3')](0x0);var events={'afterCreate':_0x2c10('0x4'),'afterUpdate':_0x2c10('0x5'),'afterDestroy':_0x2c10('0x6')};function emitEvent(_0x55f5f8){return function(_0x3309a8,_0x5018a7,_0x1db65e){ChatInternalMessageEvents[_0x2c10('0x7')](_0x55f5f8+':'+_0x3309a8['id'],_0x3309a8);ChatInternalMessageEvents[_0x2c10('0x7')](_0x55f5f8,_0x3309a8);_0x1db65e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0x2c10('0x8')](e,emitEvent(event));}}module[_0x2c10('0x9')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x58a4=['emit','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x2ec644,_0x4018c9){var _0x3de80c=function(_0x7cd0ca){while(--_0x7cd0ca){_0x2ec644['push'](_0x2ec644['shift']());}};_0x3de80c(++_0x4018c9);}(_0x58a4,0xbf));var _0x458a=function(_0x137ef8,_0x3384dc){_0x137ef8=_0x137ef8-0x0;var _0x3b7d28=_0x58a4[_0x137ef8];return _0x3b7d28;};'use strict';var EventEmitter=require(_0x458a('0x0'));var ChatInternalMessage=require(_0x458a('0x1'))['db'][_0x458a('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x458a('0x3')](0x0);var events={'afterCreate':_0x458a('0x4'),'afterUpdate':_0x458a('0x5'),'afterDestroy':_0x458a('0x6')};function emitEvent(_0xacd5b3){return function(_0x362079,_0x1b4d2e,_0x2fde72){ChatInternalMessageEvents[_0x458a('0x7')](_0xacd5b3+':'+_0x362079['id'],_0x362079);ChatInternalMessageEvents[_0x458a('0x7')](_0xacd5b3,_0x362079);_0x2fde72(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x458a('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 732db80..e23d48e 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 _0xcb75=['bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment'];(function(_0x4b0b3b,_0x2cabb4){var _0x243eec=function(_0x51af60){while(--_0x51af60){_0x4b0b3b['push'](_0x4b0b3b['shift']());}};_0x243eec(++_0x2cabb4);}(_0xcb75,0x176));var _0x5cb7=function(_0x280b36,_0x586e88){_0x280b36=_0x280b36-0x0;var _0x2c1c82=_0xcb75[_0x280b36];return _0x2c1c82;};'use strict';var _=require('lodash');var util=require(_0x5cb7('0x0'));var logger=require(_0x5cb7('0x1'))(_0x5cb7('0x2'));var moment=require(_0x5cb7('0x3'));var BPromise=require(_0x5cb7('0x4'));var rp=require(_0x5cb7('0x5'));var fs=require('fs');var path=require(_0x5cb7('0x6'));var rimraf=require('rimraf');var config=require(_0x5cb7('0x7'));var attributes=require(_0x5cb7('0x8'));module[_0x5cb7('0x9')]=function(_0x34f82b,_0xe92ec5){return _0x34f82b[_0x5cb7('0xa')](_0x5cb7('0xb'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x5cb7('0xc'),'collate':_0x5cb7('0xd')});};
\ No newline at end of file
+var _0xfe84=['exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x491a48,_0x138540){var _0x4f48de=function(_0x21e3ec){while(--_0x21e3ec){_0x491a48['push'](_0x491a48['shift']());}};_0x4f48de(++_0x138540);}(_0xfe84,0xef));var _0x4fe8=function(_0x5c96eb,_0x5404da){_0x5c96eb=_0x5c96eb-0x0;var _0x4ddbad=_0xfe84[_0x5c96eb];return _0x4ddbad;};'use strict';var _=require(_0x4fe8('0x0'));var util=require(_0x4fe8('0x1'));var logger=require(_0x4fe8('0x2'))('api');var moment=require(_0x4fe8('0x3'));var BPromise=require(_0x4fe8('0x4'));var rp=require(_0x4fe8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4fe8('0x6'));var config=require(_0x4fe8('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0x4fe8('0x8')]=function(_0x4bde20,_0x5d0867){return _0x4bde20[_0x4fe8('0x9')](_0x4fe8('0xa'),attributes,{'tableName':_0x4fe8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4fe8('0xc'),'collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 2bf445e..129524e 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 _0x54a9=['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','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x24481a,_0x1ee10a){var _0x1ad40b=function(_0x3edd4a){while(--_0x3edd4a){_0x24481a['push'](_0x24481a['shift']());}};_0x1ad40b(++_0x1ee10a);}(_0x54a9,0x186));var _0x954a=function(_0x3827e4,_0x435f88){_0x3827e4=_0x3827e4-0x0;var _0x55a664=_0x54a9[_0x3827e4];return _0x55a664;};'use strict';var _=require(_0x954a('0x0'));var util=require('util');var moment=require(_0x954a('0x1'));var BPromise=require('bluebird');var rs=require(_0x954a('0x2'));var fs=require('fs');var Redis=require(_0x954a('0x3'));var db=require(_0x954a('0x4'))['db'];var utils=require(_0x954a('0x5'));var logger=require(_0x954a('0x6'))(_0x954a('0x7'));var config=require(_0x954a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x954a('0x9')]['http']({'port':0x232a});config[_0x954a('0xa')]=_[_0x954a('0xb')](config[_0x954a('0xa')],{'host':_0x954a('0xc'),'port':0x18eb});var socket=require(_0x954a('0xd'))(new Redis(config[_0x954a('0xa')]));require(_0x954a('0xe'))[_0x954a('0xf')](socket);function respondWithRpcPromise(_0x1359f8,_0x519a2b,_0x27d204){return new BPromise(function(_0xacaf71,_0x31f4c3){return client[_0x954a('0x10')](_0x1359f8,_0x27d204)[_0x954a('0x11')](function(_0x4b2522){logger[_0x954a('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x519a2b,_0x954a('0x13'));logger[_0x954a('0x14')](_0x954a('0x15'),_0x519a2b,_0x954a('0x13'),JSON[_0x954a('0x16')](_0x4b2522));if(_0x4b2522[_0x954a('0x17')]){if(_0x4b2522[_0x954a('0x17')][_0x954a('0x18')]===0x1f4){logger[_0x954a('0x17')](_0x954a('0x19'),_0x519a2b,_0x4b2522[_0x954a('0x17')][_0x954a('0x1a')]);return _0x31f4c3(_0x4b2522[_0x954a('0x17')]['message']);}logger[_0x954a('0x17')](_0x954a('0x19'),_0x519a2b,_0x4b2522[_0x954a('0x17')][_0x954a('0x1a')]);return _0xacaf71(_0x4b2522['error'][_0x954a('0x1a')]);}else{logger['info'](_0x954a('0x19'),_0x519a2b,_0x954a('0x13'));_0xacaf71(_0x4b2522[_0x954a('0x1b')]['message']);}})[_0x954a('0x1c')](function(_0x51a796){logger[_0x954a('0x17')](_0x954a('0x19'),_0x519a2b,_0x51a796);_0x31f4c3(_0x51a796);});});}
\ No newline at end of file
+var _0x17d7=['register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./chatInternalMessage.socket'];(function(_0xb8d180,_0x893775){var _0x49f864=function(_0x20ae83){while(--_0x20ae83){_0xb8d180['push'](_0xb8d180['shift']());}};_0x49f864(++_0x893775);}(_0x17d7,0x15b));var _0x717d=function(_0x5d506a,_0x34fa5c){_0x5d506a=_0x5d506a-0x0;var _0x95ec8c=_0x17d7[_0x5d506a];return _0x95ec8c;};'use strict';var _=require(_0x717d('0x0'));var util=require(_0x717d('0x1'));var moment=require('moment');var BPromise=require(_0x717d('0x2'));var rs=require(_0x717d('0x3'));var fs=require('fs');var Redis=require(_0x717d('0x4'));var db=require(_0x717d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x717d('0x6'))(_0x717d('0x7'));var config=require(_0x717d('0x8'));var jayson=require(_0x717d('0x9'));var client=jayson[_0x717d('0xa')][_0x717d('0xb')]({'port':0x232a});config['redis']=_[_0x717d('0xc')](config[_0x717d('0xd')],{'host':_0x717d('0xe'),'port':0x18eb});var socket=require(_0x717d('0xf'))(new Redis(config[_0x717d('0xd')]));require(_0x717d('0x10'))[_0x717d('0x11')](socket);function respondWithRpcPromise(_0x5cfbad,_0x69a26e,_0x1478c1){return new BPromise(function(_0x2fac9e,_0x42a431){return client[_0x717d('0x12')](_0x5cfbad,_0x1478c1)[_0x717d('0x13')](function(_0x3b1b76){logger[_0x717d('0x14')](_0x717d('0x15'),_0x69a26e,_0x717d('0x16'));logger[_0x717d('0x17')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x69a26e,_0x717d('0x16'),JSON['stringify'](_0x3b1b76));if(_0x3b1b76[_0x717d('0x18')]){if(_0x3b1b76[_0x717d('0x18')][_0x717d('0x19')]===0x1f4){logger[_0x717d('0x18')](_0x717d('0x15'),_0x69a26e,_0x3b1b76[_0x717d('0x18')][_0x717d('0x1a')]);return _0x42a431(_0x3b1b76[_0x717d('0x18')][_0x717d('0x1a')]);}logger[_0x717d('0x18')](_0x717d('0x15'),_0x69a26e,_0x3b1b76[_0x717d('0x18')]['message']);return _0x2fac9e(_0x3b1b76[_0x717d('0x18')][_0x717d('0x1a')]);}else{logger[_0x717d('0x14')]('ChatInternalMessage,\x20%s,\x20%s',_0x69a26e,_0x717d('0x16'));_0x2fac9e(_0x3b1b76['result'][_0x717d('0x1a')]);}})[_0x717d('0x1b')](function(_0x435759){logger['error'](_0x717d('0x15'),_0x69a26e,_0x435759);_0x42a431(_0x435759);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index ae4aff8..b4773db 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 _0x6852=['register','length','./chatInternalMessage.events','save','remove','update','emit'];(function(_0x2bf05c,_0x132f75){var _0x3164a8=function(_0x607992){while(--_0x607992){_0x2bf05c['push'](_0x2bf05c['shift']());}};_0x3164a8(++_0x132f75);}(_0x6852,0x17c));var _0x2685=function(_0x239fe9,_0x1bf062){_0x239fe9=_0x239fe9-0x0;var _0x36c215=_0x6852[_0x239fe9];return _0x36c215;};'use strict';var ChatInternalMessageEvents=require(_0x2685('0x0'));var events=[_0x2685('0x1'),_0x2685('0x2'),_0x2685('0x3')];function createListener(_0x398619,_0x52d472){return function(_0x46e3f9){_0x52d472[_0x2685('0x4')](_0x398619,_0x46e3f9);};}function removeListener(_0x5ea8d5,_0x199ed6){return function(){ChatInternalMessageEvents['removeListener'](_0x5ea8d5,_0x199ed6);};}exports[_0x2685('0x5')]=function(_0x583cb7){for(var _0x496d72=0x0,_0x118ad8=events[_0x2685('0x6')];_0x496d72<_0x118ad8;_0x496d72++){var _0x25ea46=events[_0x496d72];var _0x175a2f=createListener('chatInternalMessage:'+_0x25ea46,_0x583cb7);ChatInternalMessageEvents['on'](_0x25ea46,_0x175a2f);}};
\ No newline at end of file
+var _0x0401=['update','removeListener','register','length','remove'];(function(_0x1f5d94,_0x3d59c5){var _0x6565ab=function(_0x39dfb1){while(--_0x39dfb1){_0x1f5d94['push'](_0x1f5d94['shift']());}};_0x6565ab(++_0x3d59c5);}(_0x0401,0xf9));var _0x1040=function(_0x576170,_0x1712ae){_0x576170=_0x576170-0x0;var _0x397c70=_0x0401[_0x576170];return _0x397c70;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x1040('0x0'),_0x1040('0x1')];function createListener(_0x4d61c1,_0x4f5c16){return function(_0x2662e5){_0x4f5c16['emit'](_0x4d61c1,_0x2662e5);};}function removeListener(_0x3088e0,_0x55ddee){return function(){ChatInternalMessageEvents[_0x1040('0x2')](_0x3088e0,_0x55ddee);};}exports[_0x1040('0x3')]=function(_0x29debb){for(var _0x10ba48=0x0,_0x2d1d85=events[_0x1040('0x4')];_0x10ba48<_0x2d1d85;_0x10ba48++){var _0x4ee957=events[_0x10ba48];var _0x2cd702=createListener('chatInternalMessage:'+_0x4ee957,_0x29debb);ChatInternalMessageEvents['on'](_0x4ee957,_0x2cd702);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 4aa6862..1d8b09b 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 _0x4d04=['isAuthenticated','index','/describe','/users','getUsers','/:id','post','create','put','update','delete','exports','util','path','connect-timeout','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get'];(function(_0x47a309,_0x89a700){var _0x180c4d=function(_0x56be77){while(--_0x56be77){_0x47a309['push'](_0x47a309['shift']());}};_0x180c4d(++_0x89a700);}(_0x4d04,0xf3));var _0x44d0=function(_0x44434e,_0x51ba95){_0x44434e=_0x44434e-0x0;var _0x326e53=_0x4d04[_0x44434e];return _0x326e53;};'use strict';var multer=require('multer');var util=require(_0x44d0('0x0'));var path=require(_0x44d0('0x1'));var timeout=require(_0x44d0('0x2'));var express=require('express');var router=express[_0x44d0('0x3')]();var fs_extra=require(_0x44d0('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x44d0('0x5'));var config=require(_0x44d0('0x6'));var controller=require(_0x44d0('0x7'));router[_0x44d0('0x8')]('/',auth[_0x44d0('0x9')](),controller[_0x44d0('0xa')]);router[_0x44d0('0x8')](_0x44d0('0xb'),auth[_0x44d0('0x9')](),controller['describe']);router['get'](_0x44d0('0xc'),auth[_0x44d0('0x9')](),controller[_0x44d0('0xd')]);router['get'](_0x44d0('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x44d0('0xf')]('/',auth['isAuthenticated'](),controller[_0x44d0('0x10')]);router[_0x44d0('0x11')](_0x44d0('0xe'),controller[_0x44d0('0x12')]);router[_0x44d0('0x13')](_0x44d0('0xe'),auth[_0x44d0('0x9')](),controller['destroy']);module[_0x44d0('0x14')]=router;
\ No newline at end of file
+var _0xcfa2=['post','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','isAuthenticated','index','get','/describe','describe','/users','getUsers','show'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xcfa2,0x97));var _0x2cfa=function(_0x42792e,_0x34e1e3){_0x42792e=_0x42792e-0x0;var _0x2897ed=_0xcfa2[_0x42792e];return _0x2897ed;};'use strict';var multer=require(_0x2cfa('0x0'));var util=require('util');var path=require(_0x2cfa('0x1'));var timeout=require(_0x2cfa('0x2'));var express=require(_0x2cfa('0x3'));var router=express[_0x2cfa('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x2cfa('0x5'));var interaction=require(_0x2cfa('0x6'));var config=require(_0x2cfa('0x7'));var controller=require(_0x2cfa('0x8'));router['get']('/',auth[_0x2cfa('0x9')](),controller[_0x2cfa('0xa')]);router[_0x2cfa('0xb')](_0x2cfa('0xc'),auth[_0x2cfa('0x9')](),controller[_0x2cfa('0xd')]);router[_0x2cfa('0xb')](_0x2cfa('0xe'),auth[_0x2cfa('0x9')](),controller[_0x2cfa('0xf')]);router[_0x2cfa('0xb')]('/:id',auth[_0x2cfa('0x9')](),controller[_0x2cfa('0x10')]);router[_0x2cfa('0x11')]('/',auth[_0x2cfa('0x9')](),controller['create']);router[_0x2cfa('0x12')](_0x2cfa('0x13'),controller[_0x2cfa('0x14')]);router[_0x2cfa('0x15')](_0x2cfa('0x13'),auth['isAuthenticated'](),controller[_0x2cfa('0x16')]);module[_0x2cfa('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 9f4bc70..f311165 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 _0x152f=['BOOLEAN','ENUM','out','DATE','sequelize','exports','TEXT','medium'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x152f,0x144));var _0xf152=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0x152f[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0xf152('0x0'));module[_0xf152('0x1')]={'body':{'type':Sequelize[_0xf152('0x2')](_0xf152('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xf152('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf152('0x5')]('in',_0xf152('0x6')),'defaultValue':_0xf152('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xf152('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xf152('0x2')]}};
\ No newline at end of file
+var _0x4213=['exports','TEXT','medium','BOOLEAN','ENUM','out','STRING','sequelize'];(function(_0xbf5f17,_0x17b121){var _0x469583=function(_0x1aa9f3){while(--_0x1aa9f3){_0xbf5f17['push'](_0xbf5f17['shift']());}};_0x469583(++_0x17b121);}(_0x4213,0x77));var _0x3421=function(_0x189564,_0x419229){_0x189564=_0x189564-0x0;var _0x531d23=_0x4213[_0x189564];return _0x531d23;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'body':{'type':Sequelize[_0x3421('0x2')](_0x3421('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x3421('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x3421('0x5')]('in','out'),'defaultValue':_0x3421('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']},'providerName':{'type':Sequelize[_0x3421('0x7')]},'providerResponse':{'type':Sequelize[_0x3421('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6a3b082..c4daf45 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 _0x254b=['rawAttributes','length','merge','find','create','body','params','chat-interactions','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','sequelize','QueryTypes','contact','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','Sequelize','User','rejectmessage','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','register','jayson/promise','client','http','then','info','ChatMessage,\x20%s,\x20%s','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','stack','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','options','includeAll','include','findAll','rows','show'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x254b,0xb8));var _0xb254=function(_0x35af23,_0x9190f6){_0x35af23=_0x35af23-0x0;var _0x340506=_0x254b[_0x35af23];return _0x340506;};'use strict';var emlformat=require(_0xb254('0x0'));var rimraf=require(_0xb254('0x1'));var zipdir=require(_0xb254('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb254('0x3'));var moment=require(_0xb254('0x4'));var BPromise=require(_0xb254('0x5'));var Mustache=require('mustache');var util=require(_0xb254('0x6'));var path=require(_0xb254('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb254('0x8'));var fs=require('fs');var fs_extra=require(_0xb254('0x9'));var _=require(_0xb254('0xa'));var squel=require(_0xb254('0xb'));var crypto=require(_0xb254('0xc'));var jsforce=require(_0xb254('0xd'));var deskjs=require(_0xb254('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xb254('0xf'));var authService=require(_0xb254('0x10'));var qs=require(_0xb254('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb254('0x12'))(_0xb254('0x13'));var utils=require(_0xb254('0x14'));var config=require(_0xb254('0x15'));var licenseUtil=require(_0xb254('0x16'));var db=require(_0xb254('0x17'))['db'];config[_0xb254('0x18')]=_[_0xb254('0x19')](config['redis'],{'host':_0xb254('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb254('0x18')]));require('./chatMessage.socket')[_0xb254('0x1b')](socket);var jayson=require(_0xb254('0x1c'));var client=jayson[_0xb254('0x1d')][_0xb254('0x1e')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x27c50b,_0x24ac7e,_0x227872,_0x5cab41){return new BPromise(function(_0xde16ad,_0x29b956){var _0x9bff37=_0x5cab41||client;return _0x9bff37['request'](_0x27c50b,_0x227872)[_0xb254('0x1f')](function(_0x273eae){logger[_0xb254('0x20')](_0xb254('0x21'),_0x24ac7e,'request\x20sent');logger['debug'](_0xb254('0x22'),_0x24ac7e,_0xb254('0x23'),JSON[_0xb254('0x24')](_0x273eae));if(_0x273eae[_0xb254('0x25')]){if(_0x273eae['error'][_0xb254('0x26')]===0x1f4){logger[_0xb254('0x25')]('ChatMessage,\x20%s,\x20%s',_0x24ac7e,_0x273eae['error']['message']);return _0x29b956(_0x273eae[_0xb254('0x25')][_0xb254('0x27')]);}logger[_0xb254('0x25')](_0xb254('0x21'),_0x24ac7e,_0x273eae[_0xb254('0x25')]['message']);return _0xde16ad(_0x273eae[_0xb254('0x25')][_0xb254('0x27')]);}else{logger[_0xb254('0x20')](_0xb254('0x21'),_0x24ac7e,'request\x20sent');_0xde16ad(_0x273eae[_0xb254('0x28')][_0xb254('0x27')]);}})[_0xb254('0x29')](function(_0x139343){logger[_0xb254('0x25')](_0xb254('0x21'),_0x24ac7e,_0x139343);_0x29b956(_0x139343);});});}function respondWithStatusCode(_0x12135b,_0x553503){_0x553503=_0x553503||0xcc;return function(_0x4e3436){if(_0x4e3436){return _0x12135b[_0xb254('0x2a')](_0x553503);}return _0x12135b['status'](_0x553503)[_0xb254('0x2b')]();};}function respondWithResult(_0x114923,_0x3ea59f){_0x3ea59f=_0x3ea59f||0xc8;return function(_0x2fb3b5){if(_0x2fb3b5){return _0x114923[_0xb254('0x2c')](_0x3ea59f)[_0xb254('0x2d')](_0x2fb3b5);}};}function respondWithFilteredResult(_0x5807cd,_0x563597){return function(_0x40b1ac){if(_0x40b1ac){var _0x3c08e8=typeof _0x563597[_0xb254('0x2e')]===_0xb254('0x2f')&&typeof _0x563597[_0xb254('0x30')]===_0xb254('0x2f');var _0x295c04=_0x40b1ac[_0xb254('0x31')];var _0x357c54=_0x3c08e8?0x0:_0x563597['offset'];var _0xe8a2a9=_0x3c08e8?_0x40b1ac[_0xb254('0x31')]:_0x563597[_0xb254('0x2e')]+_0x563597['limit'];var _0x37c209;if(_0xe8a2a9>=_0x295c04){_0xe8a2a9=_0x295c04;_0x37c209=0xc8;}else{_0x37c209=0xce;}_0x5807cd[_0xb254('0x2c')](_0x37c209);return _0x5807cd[_0xb254('0x32')](_0xb254('0x33'),_0x357c54+'-'+_0xe8a2a9+'/'+_0x295c04)['json'](_0x40b1ac);}return null;};}function patchUpdates(_0x2c32d6){return function(_0x408c47){try{jsonpatch[_0xb254('0x34')](_0x408c47,_0x2c32d6,!![]);}catch(_0x2ccdc2){return BPromise[_0xb254('0x35')](_0x2ccdc2);}return _0x408c47['save']();};}function saveUpdates(_0x27fb46,_0x44f9e3){return function(_0x7a42ce){if(_0x7a42ce){return _0x7a42ce[_0xb254('0x36')](_0x27fb46)[_0xb254('0x1f')](function(_0xf4d3f4){return _0xf4d3f4;});}return null;};}function removeEntity(_0x3825fe,_0x32f8fe){return function(_0x415391){if(_0x415391){return _0x415391[_0xb254('0x37')]()[_0xb254('0x1f')](function(){_0x3825fe[_0xb254('0x2c')](0xcc)[_0xb254('0x2b')]();});}};}function handleEntityNotFound(_0x14cb0c,_0x1e542d){return function(_0x11b197){if(!_0x11b197){_0x14cb0c[_0xb254('0x2a')](0x194);}return _0x11b197;};}function handleError(_0x29b601,_0x56b778){_0x56b778=_0x56b778||0x1f4;return function(_0x57907c){logger[_0xb254('0x25')](_0x57907c[_0xb254('0x38')]);if(_0x57907c['name']){delete _0x57907c[_0xb254('0x39')];}_0x29b601['status'](_0x56b778)[_0xb254('0x3a')](_0x57907c);};}exports[_0xb254('0x3b')]=function(_0x10211e,_0xfb4cd5){var _0x30485e={},_0x9ccd39={},_0x11b390={'count':0x0,'rows':[]};var _0x5004b1=_[_0xb254('0x3c')](db[_0xb254('0x3d')]['rawAttributes'],function(_0x477df6){return{'name':_0x477df6[_0xb254('0x3e')],'type':_0x477df6[_0xb254('0x3f')][_0xb254('0x40')]};});_0x9ccd39[_0xb254('0x41')]=_['map'](_0x5004b1,_0xb254('0x39'));_0x9ccd39[_0xb254('0x42')]=_[_0xb254('0x43')](_0x10211e[_0xb254('0x42')]);_0x9ccd39[_0xb254('0x44')]=_[_0xb254('0x45')](_0x9ccd39[_0xb254('0x41')],_0x9ccd39[_0xb254('0x42')]);_0x30485e[_0xb254('0x46')]=_[_0xb254('0x45')](_0x9ccd39[_0xb254('0x41')],qs['fields'](_0x10211e['query'][_0xb254('0x47')]));_0x30485e[_0xb254('0x46')]=_0x30485e[_0xb254('0x46')]['length']?_0x30485e[_0xb254('0x46')]:_0x9ccd39[_0xb254('0x41')];if(!_0x10211e['query'][_0xb254('0x48')](_0xb254('0x49'))){_0x30485e[_0xb254('0x30')]=qs[_0xb254('0x30')](_0x10211e[_0xb254('0x42')][_0xb254('0x30')]);_0x30485e[_0xb254('0x2e')]=qs['offset'](_0x10211e['query'][_0xb254('0x2e')]);}_0x30485e[_0xb254('0x4a')]=qs[_0xb254('0x4b')](_0x10211e[_0xb254('0x42')][_0xb254('0x4b')]);_0x30485e[_0xb254('0x4c')]=qs['filters'](_[_0xb254('0x4d')](_0x10211e[_0xb254('0x42')],_0x9ccd39['filters']),_0x5004b1);if(_0x10211e[_0xb254('0x42')][_0xb254('0x4e')]){_0x30485e[_0xb254('0x4c')]=_['merge'](_0x30485e['where'],{'$or':_[_0xb254('0x3c')](_0x5004b1,function(_0x4ee572){if(_0x4ee572[_0xb254('0x3f')]!==_0xb254('0x4f')){var _0x24572a={};_0x24572a[_0x4ee572[_0xb254('0x39')]]={'$like':'%'+_0x10211e[_0xb254('0x42')][_0xb254('0x4e')]+'%'};return _0x24572a;}})});}_0x30485e=_['merge']({},_0x30485e,_0x10211e[_0xb254('0x50')]);var _0x530ef3={'where':_0x30485e['where']};return db['ChatMessage'][_0xb254('0x31')](_0x530ef3)[_0xb254('0x1f')](function(_0x17ecfe){_0x11b390[_0xb254('0x31')]=_0x17ecfe;if(_0x10211e['query'][_0xb254('0x51')]){_0x30485e[_0xb254('0x52')]=[{'all':!![]}];}return db[_0xb254('0x3d')][_0xb254('0x53')](_0x30485e);})[_0xb254('0x1f')](function(_0x59743d){_0x11b390[_0xb254('0x54')]=_0x59743d;return _0x11b390;})['then'](respondWithFilteredResult(_0xfb4cd5,_0x30485e))[_0xb254('0x29')](handleError(_0xfb4cd5,null));};exports[_0xb254('0x55')]=function(_0x33fca9,_0x4b3eec){var _0x4f11ba={'raw':!![],'where':{'id':_0x33fca9['params']['id']}},_0x33518d={};_0x33518d[_0xb254('0x41')]=_['keys'](db[_0xb254('0x3d')][_0xb254('0x56')]);_0x33518d[_0xb254('0x42')]=_[_0xb254('0x43')](_0x33fca9[_0xb254('0x42')]);_0x33518d[_0xb254('0x44')]=_[_0xb254('0x45')](_0x33518d[_0xb254('0x41')],_0x33518d[_0xb254('0x42')]);_0x4f11ba[_0xb254('0x46')]=_[_0xb254('0x45')](_0x33518d['model'],qs[_0xb254('0x47')](_0x33fca9[_0xb254('0x42')]['fields']));_0x4f11ba[_0xb254('0x46')]=_0x4f11ba[_0xb254('0x46')][_0xb254('0x57')]?_0x4f11ba[_0xb254('0x46')]:_0x33518d[_0xb254('0x41')];if(_0x33fca9['query'][_0xb254('0x51')]){_0x4f11ba['include']=[{'all':!![]}];}_0x4f11ba=_[_0xb254('0x58')]({},_0x4f11ba,_0x33fca9['options']);return db[_0xb254('0x3d')][_0xb254('0x59')](_0x4f11ba)['then'](handleEntityNotFound(_0x4b3eec,null))[_0xb254('0x1f')](respondWithResult(_0x4b3eec,null))[_0xb254('0x29')](handleError(_0x4b3eec,null));};exports['create']=function(_0x59cfcb,_0x571e31){return db[_0xb254('0x3d')][_0xb254('0x5a')](_0x59cfcb['body'],{})[_0xb254('0x1f')](respondWithResult(_0x571e31,0xc9))[_0xb254('0x29')](handleError(_0x571e31,null));};exports[_0xb254('0x36')]=function(_0x20158e,_0x3c3438){if(_0x20158e[_0xb254('0x5b')]['id']){delete _0x20158e['body']['id'];}return db['ChatMessage'][_0xb254('0x59')]({'where':{'id':_0x20158e[_0xb254('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3c3438,null))['then'](saveUpdates(_0x20158e[_0xb254('0x5b')],null))[_0xb254('0x1f')](respondWithResult(_0x3c3438,null))[_0xb254('0x29')](handleError(_0x3c3438,null));};exports['destroy']=function(_0x1238dc,_0x412a28){return db[_0xb254('0x3d')][_0xb254('0x59')]({'where':{'id':_0x1238dc['params']['id']}})[_0xb254('0x1f')](handleEntityNotFound(_0x412a28,null))[_0xb254('0x1f')](removeEntity(_0x412a28,null))['catch'](handleError(_0x412a28,null));};exports['describe']=function(_0xf397e6,_0x7f792c){return db[_0xb254('0x3d')]['describe']()[_0xb254('0x1f')](respondWithResult(_0x7f792c,null))[_0xb254('0x29')](handleError(_0x7f792c,null));};var interaction_log=require(_0xb254('0x12'))(_0xb254('0x5d'));exports['accept']=function(_0x414ff4,_0x410873,_0x709de4){var _0x3fc90a={'agent':{},'channel':_0xb254('0x5e')};if(_0x414ff4[_0xb254('0x5b')]['id']){delete _0x414ff4[_0xb254('0x5b')]['id'];}_0x414ff4[_0xb254('0x5b')][_0xb254('0x5f')]=!![];_0x414ff4[_0xb254('0x5b')][_0xb254('0x60')]=moment()[_0xb254('0x61')](_0xb254('0x62'));_0x414ff4[_0xb254('0x5b')][_0xb254('0x63')]=_0x414ff4[_0xb254('0x5b')]['UserId']||_0x414ff4[_0xb254('0x64')]['id'];_0x3fc90a[_0xb254('0x65')]['id']=_0x414ff4['body'][_0xb254('0x63')];return db[_0xb254('0x3d')]['find']({'where':{'id':_0x414ff4[_0xb254('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x410873,null))[_0xb254('0x1f')](saveUpdates(_0x414ff4[_0xb254('0x5b')],null))[_0xb254('0x1f')](function(_0x3393f2){if(_0x3393f2){_0x3fc90a['message']=_0x3393f2[_0xb254('0x66')]({'plain':!![]});return db[_0xb254('0x67')][_0xb254('0x59')]({'where':{'id':_0x3393f2[_0xb254('0x68')]}});}return null;})[_0xb254('0x1f')](handleEntityNotFound(_0x410873,null))[_0xb254('0x1f')](function(_0x5b4f64){if(_0x5b4f64){return _0x5b4f64['update']({'UserId':_0x414ff4[_0xb254('0x5b')]['UserId'],'read1stAt':_[_0xb254('0x69')](_0x5b4f64['read1stAt'])?moment()[_0xb254('0x61')](_0xb254('0x62')):undefined});}return null;})[_0xb254('0x1f')](function(_0x1b2d67){if(_0x1b2d67){_0x3fc90a[_0xb254('0x6a')]=_0x1b2d67[_0xb254('0x66')]({'plain':!![]});interaction_log[_0xb254('0x20')](_0xb254('0x6b'),_0x414ff4[_0xb254('0x64')]['id'],_0x414ff4['user'][_0xb254('0x39')],_0x414ff4['user']['role'],_0x3fc90a[_0xb254('0x6a')]['id'],_0x414ff4['body']?JSON[_0xb254('0x24')](_0x414ff4[_0xb254('0x5b')]):_0xb254('0x6c'));return respondWithRpcPromise(_0xb254('0x6d'),_0xb254('0x6e'),_0x3fc90a);}return null;})[_0xb254('0x1f')](function(_0x28dfa1){var _0x10072=_0xb254('0x6f')+_0x28dfa1['message'][_0xb254('0x70')];return db[_0xb254('0x71')][_0xb254('0x42')](_0x10072,{'type':db['Sequelize'][_0xb254('0x72')]['SELECT'],'raw':!![]})[_0xb254('0x1f')](function(_0x3e204f){return _0x3e204f;});})[_0xb254('0x1f')](function(_0x30afed){if(_0x30afed){_0x3fc90a['message'][_0xb254('0x73')]=_0x30afed[0x0];if(!_0x414ff4[_0xb254('0x5b')][_0xb254('0x63')])return;return db['User'][_0xb254('0x59')]({'where':{'id':_0x414ff4[_0xb254('0x5b')][_0xb254('0x63')],'role':_0xb254('0x65')},'attributes':['id',_0xb254('0x39'),'fullname',_0xb254('0x74'),_0xb254('0x75')],'raw':!![]});}return null;})[_0xb254('0x1f')](function(_0x2df862){if(!_0x2df862)return null;_0x3fc90a[_0xb254('0x27')][_0xb254('0x65')]=_0x2df862;return _0x3fc90a;})[_0xb254('0x1f')](function(_0x603679){if(_0x603679){if(_0x414ff4[_0xb254('0x5b')][_0xb254('0x76')]){_0x3fc90a['message'][_0xb254('0x77')]=util[_0xb254('0x61')](_0xb254('0x78'),_0x414ff4[_0xb254('0x64')][_0xb254('0x39')]);_0x3fc90a[_0xb254('0x27')][_0xb254('0x79')]=_0x3fc90a[_0xb254('0x79')];_0x3fc90a[_0xb254('0x27')][_0xb254('0x7a')]=_0x3fc90a[_0xb254('0x79')];_0x3fc90a['message'][_0xb254('0x7b')]='accept';return respondWithRpcPromise(_0xb254('0x7c'),_0xb254('0x7c'),{'event':_0xb254('0x7d'),'message':_[_0xb254('0x58')](_0x3fc90a[_0xb254('0x27')],JSON[_0xb254('0x7e')](_0x3fc90a[_0xb254('0x6a')][_0xb254('0x7f')]))},client9002)[_0xb254('0x1f')](function(){return _0x3fc90a;});}return _0x3fc90a;}return null;})['then'](respondWithResult(_0x410873,null))[_0xb254('0x29')](handleError(_0x410873,null));};var interaction_log=require('../../config/logger')(_0xb254('0x5d'));exports[_0xb254('0x35')]=function(_0x195c98,_0x3ba45f,_0x4e209e){var _0x4e7bf9={'agent':{},'channel':'chat'};if(_0x195c98[_0xb254('0x5b')]['id']){delete _0x195c98[_0xb254('0x5b')]['id'];}_0x195c98[_0xb254('0x5b')]['UserId']=_0x195c98[_0xb254('0x5b')]['UserId']||_0x195c98['user']['id'];_0x4e7bf9[_0xb254('0x65')]['id']=_0x195c98[_0xb254('0x5b')]['UserId'];return db[_0xb254('0x3d')][_0xb254('0x59')]({'where':{'id':_0x195c98['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3ba45f,null))['then'](function(_0xa918f){if(_0xa918f){_0x4e7bf9[_0xb254('0x27')]=_0xa918f[_0xb254('0x66')]({'plain':!![]});return db[_0xb254('0x67')]['find']({'where':{'id':_0xa918f[_0xb254('0x68')]}});}return null;})[_0xb254('0x1f')](handleEntityNotFound(_0x3ba45f,null))[_0xb254('0x1f')](function(_0x3baaf1){if(_0x3baaf1){_0x4e7bf9[_0xb254('0x6a')]=_0x3baaf1['get']({'plain':!![]});interaction_log[_0xb254('0x20')](_0xb254('0x80'),_0x195c98[_0xb254('0x64')]['id'],_0x195c98[_0xb254('0x64')][_0xb254('0x39')],_0x195c98[_0xb254('0x64')][_0xb254('0x81')],_0x4e7bf9[_0xb254('0x6a')]['id'],_0x195c98[_0xb254('0x5b')]?JSON[_0xb254('0x24')](_0x195c98['body']):_0xb254('0x6c'));return respondWithRpcPromise(_0xb254('0x82'),_0xb254('0x83'),_0x4e7bf9);}return null;})[_0xb254('0x1f')](function(_0x174d04){var _0x5e6c97=_0xb254('0x6f')+_0x174d04[_0xb254('0x27')][_0xb254('0x70')];return db[_0xb254('0x71')][_0xb254('0x42')](_0x5e6c97,{'type':db[_0xb254('0x84')][_0xb254('0x72')]['SELECT'],'raw':!![]})[_0xb254('0x1f')](function(_0x287a7d){return _0x287a7d;});})[_0xb254('0x1f')](function(_0x5f37c0){if(_0x5f37c0){_0x4e7bf9['message'][_0xb254('0x73')]=_0x5f37c0[0x0];if(!_0x195c98[_0xb254('0x5b')][_0xb254('0x63')])return;return db[_0xb254('0x85')]['find']({'where':{'id':_0x195c98[_0xb254('0x5b')][_0xb254('0x63')],'role':'agent'},'attributes':['id',_0xb254('0x39'),'fullname',_0xb254('0x74'),_0xb254('0x75')],'raw':!![]});}return null;})[_0xb254('0x1f')](function(_0x4fabd3){if(!_0x4fabd3)return null;_0x4e7bf9[_0xb254('0x27')][_0xb254('0x65')]=_0x4fabd3;return _0x4e7bf9;})['then'](function(_0x54e167){if(_0x54e167){_0x54e167[_0xb254('0x27')][_0xb254('0x77')]=util[_0xb254('0x61')](_0xb254('0x78'),_0x195c98[_0xb254('0x64')]['name']);_0x54e167[_0xb254('0x27')]['channel']=_0x4e7bf9[_0xb254('0x79')];_0x54e167[_0xb254('0x27')][_0xb254('0x7a')]=_0x4e7bf9['channel'];_0x54e167['message'][_0xb254('0x7b')]=_0xb254('0x35');respondWithRpcPromise('EventManager','EventManager',{'event':_0xb254('0x86'),'message':_[_0xb254('0x58')](_0x4e7bf9[_0xb254('0x27')],JSON['parse'](_0x4e7bf9[_0xb254('0x6a')][_0xb254('0x7f')]))},client9002);return _0x4e7bf9;}return null;})[_0xb254('0x1f')](respondWithResult(_0x3ba45f,null))[_0xb254('0x29')](handleError(_0x3ba45f,null));};
\ No newline at end of file
+var _0xff71=['desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','undefined','limit','count','set','apply','reject','update','destroy','name','send','index','map','ChatMessage','rawAttributes','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','where','filter','merge','type','options','includeAll','findAll','rows','params','include','find','create','body','describe','../../config/logger','chat-interactions','accept','read','format','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','ContactId','sequelize','QueryTypes','SELECT','fullname','email','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','parse','interaction','formData','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','Sequelize','contact','rejectmessage','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','fs-extra','squel','crypto','jsforce'];(function(_0x54fc58,_0x98c62a){var _0x36f9d8=function(_0x55ffa5){while(--_0x55ffa5){_0x54fc58['push'](_0x54fc58['shift']());}};_0x36f9d8(++_0x98c62a);}(_0xff71,0x1eb));var _0x1ff7=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xff71[_0x4a9fb1];return _0x348672;};'use strict';var emlformat=require(_0x1ff7('0x0'));var rimraf=require(_0x1ff7('0x1'));var zipdir=require(_0x1ff7('0x2'));var jsonpatch=require(_0x1ff7('0x3'));var rp=require('request-promise');var moment=require(_0x1ff7('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1ff7('0x5'));var util=require(_0x1ff7('0x6'));var path=require(_0x1ff7('0x7'));var sox=require(_0x1ff7('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x1ff7('0x9'));var _=require('lodash');var squel=require(_0x1ff7('0xa'));var crypto=require(_0x1ff7('0xb'));var jsforce=require(_0x1ff7('0xc'));var deskjs=require(_0x1ff7('0xd'));var toCsv=require(_0x1ff7('0xe'));var querystring=require('querystring');var Papa=require(_0x1ff7('0xf'));var Redis=require(_0x1ff7('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1ff7('0x11'));var as=require(_0x1ff7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1ff7('0x13'));var config=require(_0x1ff7('0x14'));var licenseUtil=require('../../config/license/util');var db=require(_0x1ff7('0x15'))['db'];config[_0x1ff7('0x16')]=_[_0x1ff7('0x17')](config[_0x1ff7('0x16')],{'host':_0x1ff7('0x18'),'port':0x18eb});var socket=require(_0x1ff7('0x19'))(new Redis(config[_0x1ff7('0x16')]));require('./chatMessage.socket')[_0x1ff7('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x1ff7('0x1b')][_0x1ff7('0x1c')]({'port':0x232c});var client9002=jayson[_0x1ff7('0x1b')][_0x1ff7('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x46a237,_0x2e73ec,_0xb14f7d,_0x34bbb3){return new BPromise(function(_0x3b1204,_0x2a0a36){var _0x2261a5=_0x34bbb3||client;return _0x2261a5['request'](_0x46a237,_0xb14f7d)[_0x1ff7('0x1d')](function(_0x405659){logger[_0x1ff7('0x1e')](_0x1ff7('0x1f'),_0x2e73ec,_0x1ff7('0x20'));logger[_0x1ff7('0x21')](_0x1ff7('0x22'),_0x2e73ec,_0x1ff7('0x20'),JSON[_0x1ff7('0x23')](_0x405659));if(_0x405659[_0x1ff7('0x24')]){if(_0x405659[_0x1ff7('0x24')][_0x1ff7('0x25')]===0x1f4){logger['error'](_0x1ff7('0x1f'),_0x2e73ec,_0x405659[_0x1ff7('0x24')][_0x1ff7('0x26')]);return _0x2a0a36(_0x405659[_0x1ff7('0x24')][_0x1ff7('0x26')]);}logger['error'](_0x1ff7('0x1f'),_0x2e73ec,_0x405659[_0x1ff7('0x24')]['message']);return _0x3b1204(_0x405659[_0x1ff7('0x24')][_0x1ff7('0x26')]);}else{logger[_0x1ff7('0x1e')]('ChatMessage,\x20%s,\x20%s',_0x2e73ec,_0x1ff7('0x20'));_0x3b1204(_0x405659[_0x1ff7('0x27')][_0x1ff7('0x26')]);}})[_0x1ff7('0x28')](function(_0x1ee932){logger[_0x1ff7('0x24')](_0x1ff7('0x1f'),_0x2e73ec,_0x1ee932);_0x2a0a36(_0x1ee932);});});}function respondWithStatusCode(_0x3879ac,_0xb71c00){_0xb71c00=_0xb71c00||0xcc;return function(_0x5657e6){if(_0x5657e6){return _0x3879ac[_0x1ff7('0x29')](_0xb71c00);}return _0x3879ac[_0x1ff7('0x2a')](_0xb71c00)[_0x1ff7('0x2b')]();};}function respondWithResult(_0x51cb91,_0x406592){_0x406592=_0x406592||0xc8;return function(_0x5bf599){if(_0x5bf599){return _0x51cb91[_0x1ff7('0x2a')](_0x406592)[_0x1ff7('0x2c')](_0x5bf599);}};}function respondWithFilteredResult(_0x5e652e,_0x424891){return function(_0x45bc1e){if(_0x45bc1e){var _0x2b73d9=typeof _0x424891[_0x1ff7('0x2d')]===_0x1ff7('0x2e')&&typeof _0x424891[_0x1ff7('0x2f')]===_0x1ff7('0x2e');var _0x3ab82c=_0x45bc1e['count'];var _0x2cadfb=_0x2b73d9?0x0:_0x424891[_0x1ff7('0x2d')];var _0x3351c2=_0x2b73d9?_0x45bc1e[_0x1ff7('0x30')]:_0x424891[_0x1ff7('0x2d')]+_0x424891[_0x1ff7('0x2f')];var _0x52d944;if(_0x3351c2>=_0x3ab82c){_0x3351c2=_0x3ab82c;_0x52d944=0xc8;}else{_0x52d944=0xce;}_0x5e652e[_0x1ff7('0x2a')](_0x52d944);return _0x5e652e[_0x1ff7('0x31')]('Content-Range',_0x2cadfb+'-'+_0x3351c2+'/'+_0x3ab82c)[_0x1ff7('0x2c')](_0x45bc1e);}return null;};}function patchUpdates(_0x36a142){return function(_0x79274a){try{jsonpatch[_0x1ff7('0x32')](_0x79274a,_0x36a142,!![]);}catch(_0x4b2fb1){return BPromise[_0x1ff7('0x33')](_0x4b2fb1);}return _0x79274a['save']();};}function saveUpdates(_0x48a668,_0xcea70){return function(_0x36a491){if(_0x36a491){return _0x36a491[_0x1ff7('0x34')](_0x48a668)['then'](function(_0x387e4a){return _0x387e4a;});}return null;};}function removeEntity(_0x256da8,_0x5334ea){return function(_0x20d6e5){if(_0x20d6e5){return _0x20d6e5[_0x1ff7('0x35')]()[_0x1ff7('0x1d')](function(){_0x256da8[_0x1ff7('0x2a')](0xcc)[_0x1ff7('0x2b')]();});}};}function handleEntityNotFound(_0x1af059,_0x5ac27e){return function(_0x1c0b05){if(!_0x1c0b05){_0x1af059[_0x1ff7('0x29')](0x194);}return _0x1c0b05;};}function handleError(_0xb1b5f0,_0x4e30fa){_0x4e30fa=_0x4e30fa||0x1f4;return function(_0x3af093){logger[_0x1ff7('0x24')](_0x3af093['stack']);if(_0x3af093[_0x1ff7('0x36')]){delete _0x3af093[_0x1ff7('0x36')];}_0xb1b5f0['status'](_0x4e30fa)[_0x1ff7('0x37')](_0x3af093);};}exports[_0x1ff7('0x38')]=function(_0x45b241,_0x5d9800){var _0x40a0d4={},_0x28bf7b={},_0x3898b6={'count':0x0,'rows':[]};var _0x17460c=_[_0x1ff7('0x39')](db[_0x1ff7('0x3a')][_0x1ff7('0x3b')],function(_0x132220){return{'name':_0x132220['fieldName'],'type':_0x132220['type'][_0x1ff7('0x3c')]};});_0x28bf7b[_0x1ff7('0x3d')]=_[_0x1ff7('0x39')](_0x17460c,_0x1ff7('0x36'));_0x28bf7b['query']=_[_0x1ff7('0x3e')](_0x45b241[_0x1ff7('0x3f')]);_0x28bf7b[_0x1ff7('0x40')]=_[_0x1ff7('0x41')](_0x28bf7b[_0x1ff7('0x3d')],_0x28bf7b[_0x1ff7('0x3f')]);_0x40a0d4['attributes']=_[_0x1ff7('0x41')](_0x28bf7b[_0x1ff7('0x3d')],qs[_0x1ff7('0x42')](_0x45b241['query']['fields']));_0x40a0d4[_0x1ff7('0x43')]=_0x40a0d4['attributes'][_0x1ff7('0x44')]?_0x40a0d4['attributes']:_0x28bf7b[_0x1ff7('0x3d')];if(!_0x45b241[_0x1ff7('0x3f')][_0x1ff7('0x45')]('nolimit')){_0x40a0d4['limit']=qs[_0x1ff7('0x2f')](_0x45b241[_0x1ff7('0x3f')]['limit']);_0x40a0d4[_0x1ff7('0x2d')]=qs[_0x1ff7('0x2d')](_0x45b241[_0x1ff7('0x3f')][_0x1ff7('0x2d')]);}_0x40a0d4['order']=qs['sort'](_0x45b241[_0x1ff7('0x3f')]['sort']);_0x40a0d4[_0x1ff7('0x46')]=qs['filters'](_['pick'](_0x45b241[_0x1ff7('0x3f')],_0x28bf7b[_0x1ff7('0x40')]),_0x17460c);if(_0x45b241[_0x1ff7('0x3f')][_0x1ff7('0x47')]){_0x40a0d4[_0x1ff7('0x46')]=_[_0x1ff7('0x48')](_0x40a0d4['where'],{'$or':_[_0x1ff7('0x39')](_0x17460c,function(_0x5164a7){if(_0x5164a7[_0x1ff7('0x49')]!=='VIRTUAL'){var _0x453510={};_0x453510[_0x5164a7['name']]={'$like':'%'+_0x45b241[_0x1ff7('0x3f')][_0x1ff7('0x47')]+'%'};return _0x453510;}})});}_0x40a0d4=_[_0x1ff7('0x48')]({},_0x40a0d4,_0x45b241[_0x1ff7('0x4a')]);var _0x50153d={'where':_0x40a0d4[_0x1ff7('0x46')]};return db[_0x1ff7('0x3a')][_0x1ff7('0x30')](_0x50153d)[_0x1ff7('0x1d')](function(_0x2c3d57){_0x3898b6[_0x1ff7('0x30')]=_0x2c3d57;if(_0x45b241[_0x1ff7('0x3f')][_0x1ff7('0x4b')]){_0x40a0d4['include']=[{'all':!![]}];}return db[_0x1ff7('0x3a')][_0x1ff7('0x4c')](_0x40a0d4);})['then'](function(_0x109b29){_0x3898b6[_0x1ff7('0x4d')]=_0x109b29;return _0x3898b6;})['then'](respondWithFilteredResult(_0x5d9800,_0x40a0d4))['catch'](handleError(_0x5d9800,null));};exports['show']=function(_0x4fc674,_0x4c80a2){var _0x1867dc={'raw':!![],'where':{'id':_0x4fc674[_0x1ff7('0x4e')]['id']}},_0x4457c6={};_0x4457c6[_0x1ff7('0x3d')]=_[_0x1ff7('0x3e')](db[_0x1ff7('0x3a')][_0x1ff7('0x3b')]);_0x4457c6['query']=_[_0x1ff7('0x3e')](_0x4fc674['query']);_0x4457c6[_0x1ff7('0x40')]=_[_0x1ff7('0x41')](_0x4457c6[_0x1ff7('0x3d')],_0x4457c6[_0x1ff7('0x3f')]);_0x1867dc[_0x1ff7('0x43')]=_[_0x1ff7('0x41')](_0x4457c6[_0x1ff7('0x3d')],qs['fields'](_0x4fc674[_0x1ff7('0x3f')][_0x1ff7('0x42')]));_0x1867dc[_0x1ff7('0x43')]=_0x1867dc[_0x1ff7('0x43')][_0x1ff7('0x44')]?_0x1867dc[_0x1ff7('0x43')]:_0x4457c6[_0x1ff7('0x3d')];if(_0x4fc674[_0x1ff7('0x3f')][_0x1ff7('0x4b')]){_0x1867dc[_0x1ff7('0x4f')]=[{'all':!![]}];}_0x1867dc=_['merge']({},_0x1867dc,_0x4fc674[_0x1ff7('0x4a')]);return db[_0x1ff7('0x3a')][_0x1ff7('0x50')](_0x1867dc)[_0x1ff7('0x1d')](handleEntityNotFound(_0x4c80a2,null))[_0x1ff7('0x1d')](respondWithResult(_0x4c80a2,null))['catch'](handleError(_0x4c80a2,null));};exports[_0x1ff7('0x51')]=function(_0x43a115,_0x1b53e7){return db[_0x1ff7('0x3a')][_0x1ff7('0x51')](_0x43a115['body'],{})['then'](respondWithResult(_0x1b53e7,0xc9))[_0x1ff7('0x28')](handleError(_0x1b53e7,null));};exports[_0x1ff7('0x34')]=function(_0x5d816c,_0x88bb2a){if(_0x5d816c[_0x1ff7('0x52')]['id']){delete _0x5d816c[_0x1ff7('0x52')]['id'];}return db[_0x1ff7('0x3a')]['find']({'where':{'id':_0x5d816c[_0x1ff7('0x4e')]['id']}})[_0x1ff7('0x1d')](handleEntityNotFound(_0x88bb2a,null))[_0x1ff7('0x1d')](saveUpdates(_0x5d816c[_0x1ff7('0x52')],null))[_0x1ff7('0x1d')](respondWithResult(_0x88bb2a,null))['catch'](handleError(_0x88bb2a,null));};exports[_0x1ff7('0x35')]=function(_0x2a3d51,_0x4bf45f){return db[_0x1ff7('0x3a')][_0x1ff7('0x50')]({'where':{'id':_0x2a3d51['params']['id']}})['then'](handleEntityNotFound(_0x4bf45f,null))[_0x1ff7('0x1d')](removeEntity(_0x4bf45f,null))[_0x1ff7('0x28')](handleError(_0x4bf45f,null));};exports['describe']=function(_0x47c58c,_0x43d60f){return db[_0x1ff7('0x3a')][_0x1ff7('0x53')]()['then'](respondWithResult(_0x43d60f,null))['catch'](handleError(_0x43d60f,null));};var interaction_log=require(_0x1ff7('0x54'))(_0x1ff7('0x55'));exports[_0x1ff7('0x56')]=function(_0x148668,_0x535461,_0x34775d){var _0x4aea58={'agent':{},'channel':'chat'};if(_0x148668[_0x1ff7('0x52')]['id']){delete _0x148668['body']['id'];}_0x148668['body'][_0x1ff7('0x57')]=!![];_0x148668[_0x1ff7('0x52')]['readAt']=moment()[_0x1ff7('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x148668[_0x1ff7('0x52')][_0x1ff7('0x59')]=_0x148668[_0x1ff7('0x52')]['UserId']||_0x148668[_0x1ff7('0x5a')]['id'];_0x4aea58[_0x1ff7('0x5b')]['id']=_0x148668['body'][_0x1ff7('0x59')];return db[_0x1ff7('0x3a')][_0x1ff7('0x50')]({'where':{'id':_0x148668['params']['id'],'UserId':null}})[_0x1ff7('0x1d')](handleEntityNotFound(_0x535461,null))['then'](saveUpdates(_0x148668['body'],null))[_0x1ff7('0x1d')](function(_0x52d141){if(_0x52d141){_0x4aea58[_0x1ff7('0x26')]=_0x52d141[_0x1ff7('0x5c')]({'plain':!![]});return db[_0x1ff7('0x5d')][_0x1ff7('0x50')]({'where':{'id':_0x52d141[_0x1ff7('0x5e')]}});}return null;})[_0x1ff7('0x1d')](handleEntityNotFound(_0x535461,null))[_0x1ff7('0x1d')](function(_0x1caffa){if(_0x1caffa){return _0x1caffa[_0x1ff7('0x34')]({'UserId':_0x148668[_0x1ff7('0x52')][_0x1ff7('0x59')],'read1stAt':_[_0x1ff7('0x5f')](_0x1caffa['read1stAt'])?moment()[_0x1ff7('0x58')](_0x1ff7('0x60')):undefined});}return null;})[_0x1ff7('0x1d')](function(_0x4d1df5){if(_0x4d1df5){_0x4aea58['interaction']=_0x4d1df5[_0x1ff7('0x5c')]({'plain':!![]});interaction_log[_0x1ff7('0x1e')](_0x1ff7('0x61'),_0x148668[_0x1ff7('0x5a')]['id'],_0x148668[_0x1ff7('0x5a')][_0x1ff7('0x36')],_0x148668[_0x1ff7('0x5a')]['role'],_0x4aea58['interaction']['id'],_0x148668[_0x1ff7('0x52')]?JSON[_0x1ff7('0x23')](_0x148668[_0x1ff7('0x52')]):_0x1ff7('0x62'));return respondWithRpcPromise(_0x1ff7('0x63'),_0x1ff7('0x64'),_0x4aea58);}return null;})[_0x1ff7('0x1d')](function(_0x1f6a92){var _0x22d636='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x1f6a92['message'][_0x1ff7('0x65')];return db[_0x1ff7('0x66')][_0x1ff7('0x3f')](_0x22d636,{'type':db['Sequelize'][_0x1ff7('0x67')][_0x1ff7('0x68')],'raw':!![]})[_0x1ff7('0x1d')](function(_0x1ebb7c){return _0x1ebb7c;});})[_0x1ff7('0x1d')](function(_0x4e7693){if(_0x4e7693){_0x4aea58[_0x1ff7('0x26')]['contact']=_0x4e7693[0x0];if(!_0x148668[_0x1ff7('0x52')][_0x1ff7('0x59')])return;return db['User']['find']({'where':{'id':_0x148668[_0x1ff7('0x52')]['UserId'],'role':_0x1ff7('0x5b')},'attributes':['id','name',_0x1ff7('0x69'),_0x1ff7('0x6a'),_0x1ff7('0x6b')],'raw':!![]});}return null;})['then'](function(_0x5cfead){if(!_0x5cfead)return null;_0x4aea58[_0x1ff7('0x26')][_0x1ff7('0x5b')]=_0x5cfead;return _0x4aea58;})[_0x1ff7('0x1d')](function(_0x50cfa1){if(_0x50cfa1){if(_0x148668[_0x1ff7('0x52')][_0x1ff7('0x6c')]){_0x4aea58[_0x1ff7('0x26')][_0x1ff7('0x6d')]=util[_0x1ff7('0x58')](_0x1ff7('0x6e'),_0x148668[_0x1ff7('0x5a')]['name']);_0x4aea58[_0x1ff7('0x26')][_0x1ff7('0x6f')]=_0x4aea58[_0x1ff7('0x6f')];_0x4aea58[_0x1ff7('0x26')][_0x1ff7('0x70')]=_0x4aea58[_0x1ff7('0x6f')];_0x4aea58[_0x1ff7('0x26')][_0x1ff7('0x71')]=_0x1ff7('0x56');return respondWithRpcPromise(_0x1ff7('0x72'),_0x1ff7('0x72'),{'event':'acceptmessage','message':_[_0x1ff7('0x48')](_0x4aea58[_0x1ff7('0x26')],JSON[_0x1ff7('0x73')](_0x4aea58[_0x1ff7('0x74')][_0x1ff7('0x75')]))},client9002)[_0x1ff7('0x1d')](function(){return _0x4aea58;});}return _0x4aea58;}return null;})[_0x1ff7('0x1d')](respondWithResult(_0x535461,null))[_0x1ff7('0x28')](handleError(_0x535461,null));};var interaction_log=require(_0x1ff7('0x54'))(_0x1ff7('0x55'));exports[_0x1ff7('0x33')]=function(_0x39035e,_0x2c9188,_0x4ca434){var _0x41278a={'agent':{},'channel':_0x1ff7('0x76')};if(_0x39035e[_0x1ff7('0x52')]['id']){delete _0x39035e[_0x1ff7('0x52')]['id'];}_0x39035e['body'][_0x1ff7('0x59')]=_0x39035e[_0x1ff7('0x52')][_0x1ff7('0x59')]||_0x39035e[_0x1ff7('0x5a')]['id'];_0x41278a['agent']['id']=_0x39035e[_0x1ff7('0x52')]['UserId'];return db[_0x1ff7('0x3a')][_0x1ff7('0x50')]({'where':{'id':_0x39035e[_0x1ff7('0x4e')]['id'],'UserId':null}})[_0x1ff7('0x1d')](handleEntityNotFound(_0x2c9188,null))['then'](function(_0x1eb4b3){if(_0x1eb4b3){_0x41278a[_0x1ff7('0x26')]=_0x1eb4b3[_0x1ff7('0x5c')]({'plain':!![]});return db[_0x1ff7('0x5d')][_0x1ff7('0x50')]({'where':{'id':_0x1eb4b3[_0x1ff7('0x5e')]}});}return null;})[_0x1ff7('0x1d')](handleEntityNotFound(_0x2c9188,null))[_0x1ff7('0x1d')](function(_0x8da563){if(_0x8da563){_0x41278a[_0x1ff7('0x74')]=_0x8da563[_0x1ff7('0x5c')]({'plain':!![]});interaction_log[_0x1ff7('0x1e')](_0x1ff7('0x77'),_0x39035e['user']['id'],_0x39035e['user']['name'],_0x39035e['user']['role'],_0x41278a[_0x1ff7('0x74')]['id'],_0x39035e[_0x1ff7('0x52')]?JSON['stringify'](_0x39035e[_0x1ff7('0x52')]):'null');return respondWithRpcPromise(_0x1ff7('0x78'),_0x1ff7('0x79'),_0x41278a);}return null;})[_0x1ff7('0x1d')](function(_0x2cba6a){var _0x2f1940=_0x1ff7('0x7a')+_0x2cba6a['message']['ContactId'];return db[_0x1ff7('0x66')]['query'](_0x2f1940,{'type':db[_0x1ff7('0x7b')][_0x1ff7('0x67')][_0x1ff7('0x68')],'raw':!![]})[_0x1ff7('0x1d')](function(_0xc10793){return _0xc10793;});})[_0x1ff7('0x1d')](function(_0x1578f8){if(_0x1578f8){_0x41278a[_0x1ff7('0x26')][_0x1ff7('0x7c')]=_0x1578f8[0x0];if(!_0x39035e[_0x1ff7('0x52')]['UserId'])return;return db['User'][_0x1ff7('0x50')]({'where':{'id':_0x39035e[_0x1ff7('0x52')][_0x1ff7('0x59')],'role':'agent'},'attributes':['id',_0x1ff7('0x36'),'fullname','email',_0x1ff7('0x6b')],'raw':!![]});}return null;})[_0x1ff7('0x1d')](function(_0x419d0d){if(!_0x419d0d)return null;_0x41278a[_0x1ff7('0x26')][_0x1ff7('0x5b')]=_0x419d0d;return _0x41278a;})[_0x1ff7('0x1d')](function(_0x3d82bc){if(_0x3d82bc){_0x3d82bc['message'][_0x1ff7('0x6d')]=util[_0x1ff7('0x58')](_0x1ff7('0x6e'),_0x39035e['user'][_0x1ff7('0x36')]);_0x3d82bc['message'][_0x1ff7('0x6f')]=_0x41278a[_0x1ff7('0x6f')];_0x3d82bc[_0x1ff7('0x26')]['motionChannel']=_0x41278a[_0x1ff7('0x6f')];_0x3d82bc[_0x1ff7('0x26')][_0x1ff7('0x71')]=_0x1ff7('0x33');respondWithRpcPromise(_0x1ff7('0x72'),_0x1ff7('0x72'),{'event':_0x1ff7('0x7d'),'message':_[_0x1ff7('0x48')](_0x41278a['message'],JSON[_0x1ff7('0x73')](_0x41278a[_0x1ff7('0x74')][_0x1ff7('0x75')]))},client9002);return _0x41278a;}return null;})[_0x1ff7('0x1d')](respondWithResult(_0x2c9188,null))[_0x1ff7('0x28')](handleError(_0x2c9188,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 4e5cf05..93a2938 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 _0xabca=['events','../../mysqldb','ChatMessage','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x5698a6,_0x8403be){var _0x49e78e=function(_0x3b8195){while(--_0x3b8195){_0x5698a6['push'](_0x5698a6['shift']());}};_0x49e78e(++_0x8403be);}(_0xabca,0x190));var _0xaabc=function(_0x1a61cf,_0x31a24c){_0x1a61cf=_0x1a61cf-0x0;var _0x1af75f=_0xabca[_0x1a61cf];return _0x1af75f;};'use strict';var EventEmitter=require(_0xaabc('0x0'));var ChatMessage=require(_0xaabc('0x1'))['db'][_0xaabc('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaabc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xaabc('0x4'),'afterDestroy':_0xaabc('0x5')};function emitEvent(_0x744d38){return function(_0x2722f6,_0x3ce7d0,_0x1eafee){ChatMessageEvents['emit'](_0x744d38+':'+_0x2722f6['id'],_0x2722f6);ChatMessageEvents[_0xaabc('0x6')](_0x744d38,_0x2722f6);_0x1eafee(null);};}for(var e in events){if(events[_0xaabc('0x7')](e)){var event=events[e];ChatMessage[_0xaabc('0x8')](e,emitEvent(event));}}module[_0xaabc('0x9')]=ChatMessageEvents;
\ No newline at end of file
+var _0xea6a=['setMaxListeners','save','emit','hasOwnProperty','events','../../mysqldb','ChatMessage'];(function(_0x381589,_0x27a707){var _0x2a075d=function(_0x4ea19d){while(--_0x4ea19d){_0x381589['push'](_0x381589['shift']());}};_0x2a075d(++_0x27a707);}(_0xea6a,0x12a));var _0xaea6=function(_0x156618,_0x5ad92f){_0x156618=_0x156618-0x0;var _0x1344e8=_0xea6a[_0x156618];return _0x1344e8;};'use strict';var EventEmitter=require(_0xaea6('0x0'));var ChatMessage=require(_0xaea6('0x1'))['db'][_0xaea6('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaea6('0x3')](0x0);var events={'afterCreate':_0xaea6('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x4be2d7){return function(_0x2af543,_0x4e166e,_0x775abc){ChatMessageEvents[_0xaea6('0x5')](_0x4be2d7+':'+_0x2af543['id'],_0x2af543);ChatMessageEvents[_0xaea6('0x5')](_0x4be2d7,_0x2af543);_0x775abc(null);};}for(var e in events){if(events[_0xaea6('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 74e0351..a55fb77 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 _0xcc6d=['findOne','ChatInteractionId','then','catch','error','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatMessage.attributes','exports','define','chat_messages','fti_chat_messages','models','get','toLowerCase','direction','out','secret','UserId'];(function(_0x598e2b,_0x486c61){var _0x9ad78c=function(_0x4ab2a0){while(--_0x4ab2a0){_0x598e2b['push'](_0x598e2b['shift']());}};_0x9ad78c(++_0x486c61);}(_0xcc6d,0x1c8));var _0xdcc6=function(_0x2bed5a,_0x11d68f){_0x2bed5a=_0x2bed5a-0x0;var _0x2ebb3f=_0xcc6d[_0x2bed5a];return _0x2ebb3f;};'use strict';var _=require(_0xdcc6('0x0'));var util=require('util');var logger=require(_0xdcc6('0x1'))(_0xdcc6('0x2'));var moment=require(_0xdcc6('0x3'));var BPromise=require(_0xdcc6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdcc6('0x5'));var rimraf=require('rimraf');var config=require(_0xdcc6('0x6'));var attributes=require(_0xdcc6('0x7'));module[_0xdcc6('0x8')]=function(_0x143166,_0x5bb669){return _0x143166[_0xdcc6('0x9')]('ChatMessage',attributes,{'tableName':_0xdcc6('0xa'),'paranoid':![],'indexes':[{'name':_0xdcc6('0xb'),'fields':['body'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x14234f,_0x6c0ea2,_0x1e85f9){var _0x2ffd9e=_0x143166[_0xdcc6('0xc')];var _0x4dffe5=_0x14234f[_0xdcc6('0xd')]({'plain':!![]});if(_0x4dffe5['direction'][_0xdcc6('0xe')]()==='in'||_0x4dffe5[_0xdcc6('0xf')][_0xdcc6('0xe')]()===_0xdcc6('0x10')&&!_0x4dffe5[_0xdcc6('0x11')]&&!_['isNil'](_0x4dffe5[_0xdcc6('0x12')])){_0x2ffd9e['ChatInteraction'][_0xdcc6('0x13')]({'where':{'id':_0x4dffe5[_0xdcc6('0x14')]}})[_0xdcc6('0x15')](function(_0x5ef974){if(_0x5ef974){_0x5ef974['update']({'lastMsgAt':_0x4dffe5['createdAt'],'lastMsgDirection':_0x4dffe5[_0xdcc6('0xf')][_0xdcc6('0xe')]()});}})[_0xdcc6('0x16')](function(_0x501ecc){console[_0xdcc6('0x17')](_0x501ecc);});}_0x1e85f9();}},'charset':'utf8mb4','collate':_0xdcc6('0x18')});};
\ No newline at end of file
+var _0x3036=['../../config/logger','api','moment','request-promise','./chatMessage.attributes','define','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','update','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci'];(function(_0x31022d,_0x79dd91){var _0x5456d6=function(_0x90e8d2){while(--_0x90e8d2){_0x31022d['push'](_0x31022d['shift']());}};_0x5456d6(++_0x79dd91);}(_0x3036,0x1a9));var _0x6303=function(_0x469a09,_0x6181ee){_0x469a09=_0x469a09-0x0;var _0x2886b9=_0x3036[_0x469a09];return _0x2886b9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6303('0x0'))(_0x6303('0x1'));var moment=require(_0x6303('0x2'));var BPromise=require('bluebird');var rp=require(_0x6303('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6303('0x4'));module['exports']=function(_0x464b99,_0xaa32ef){return _0x464b99[_0x6303('0x5')]('ChatMessage',attributes,{'tableName':_0x6303('0x6'),'paranoid':![],'indexes':[{'name':_0x6303('0x7'),'fields':[_0x6303('0x8')],'type':_0x6303('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x7f88f,_0x2684ac,_0x23b326){var _0x179151=_0x464b99[_0x6303('0xa')];var _0x558fca=_0x7f88f[_0x6303('0xb')]({'plain':!![]});if(_0x558fca[_0x6303('0xc')][_0x6303('0xd')]()==='in'||_0x558fca[_0x6303('0xc')][_0x6303('0xd')]()==='out'&&!_0x558fca[_0x6303('0xe')]&&!_[_0x6303('0xf')](_0x558fca[_0x6303('0x10')])){_0x179151[_0x6303('0x11')][_0x6303('0x12')]({'where':{'id':_0x558fca['ChatInteractionId']}})['then'](function(_0x5d75c1){if(_0x5d75c1){_0x5d75c1[_0x6303('0x13')]({'lastMsgAt':_0x558fca[_0x6303('0x14')],'lastMsgDirection':_0x558fca[_0x6303('0xc')][_0x6303('0xd')]()});}})[_0x6303('0x15')](function(_0x43526d){console[_0x6303('0x16')](_0x43526d);});}_0x23b326();}},'charset':_0x6303('0x17'),'collate':_0x6303('0x18')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 60da445..f2d7d32 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 _0xc9b0=['../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','info','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','result','CreateChatMessage','ChatMessage','create','body','options','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x574689,_0x12cfa6){var _0xcb5742=function(_0x434a45){while(--_0x434a45){_0x574689['push'](_0x574689['shift']());}};_0xcb5742(++_0x12cfa6);}(_0xc9b0,0x143));var _0x0c9b=function(_0x596804,_0x33b50e){_0x596804=_0x596804-0x0;var _0x471d18=_0xc9b0[_0x596804];return _0x471d18;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var BPromise=require(_0x0c9b('0x3'));var rs=require(_0x0c9b('0x4'));var fs=require('fs');var Redis=require(_0x0c9b('0x5'));var db=require(_0x0c9b('0x6'))['db'];var utils=require(_0x0c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c9b('0x8'));var jayson=require(_0x0c9b('0x9'));var client=jayson[_0x0c9b('0xa')][_0x0c9b('0xb')]({'port':0x232a});config[_0x0c9b('0xc')]=_[_0x0c9b('0xd')](config[_0x0c9b('0xc')],{'host':_0x0c9b('0xe'),'port':0x18eb});var socket=require(_0x0c9b('0xf'))(new Redis(config['redis']));require('./chatMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1108b4,_0x16bde2,_0x1b6d84){return new BPromise(function(_0x3e271f,_0x1a8ee2){return client[_0x0c9b('0x10')](_0x1108b4,_0x1b6d84)['then'](function(_0x156cc7){logger[_0x0c9b('0x11')]('ChatMessage,\x20%s,\x20%s',_0x16bde2,_0x0c9b('0x12'));logger['debug'](_0x0c9b('0x13'),_0x16bde2,_0x0c9b('0x12'),JSON[_0x0c9b('0x14')](_0x156cc7));if(_0x156cc7[_0x0c9b('0x15')]){if(_0x156cc7[_0x0c9b('0x15')][_0x0c9b('0x16')]===0x1f4){logger[_0x0c9b('0x15')](_0x0c9b('0x17'),_0x16bde2,_0x156cc7[_0x0c9b('0x15')][_0x0c9b('0x18')]);return _0x1a8ee2(_0x156cc7['error']['message']);}logger['error'](_0x0c9b('0x17'),_0x16bde2,_0x156cc7[_0x0c9b('0x15')]['message']);return _0x3e271f(_0x156cc7[_0x0c9b('0x15')][_0x0c9b('0x18')]);}else{logger[_0x0c9b('0x11')](_0x0c9b('0x17'),_0x16bde2,_0x0c9b('0x12'));_0x3e271f(_0x156cc7[_0x0c9b('0x19')][_0x0c9b('0x18')]);}})['catch'](function(_0x5502d5){logger[_0x0c9b('0x15')]('ChatMessage,\x20%s,\x20%s',_0x16bde2,_0x5502d5);_0x1a8ee2(_0x5502d5);});});}exports[_0x0c9b('0x1a')]=function(_0x2cb320){var _0x1b8e61=this;return new Promise(function(_0xb5ce29,_0x1bf9f1){return db[_0x0c9b('0x1b')][_0x0c9b('0x1c')](_0x2cb320[_0x0c9b('0x1d')],{'raw':_0x2cb320[_0x0c9b('0x1e')]?_0x2cb320[_0x0c9b('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x0c9b('0x1f')](function(_0x3dfd64){logger[_0x0c9b('0x11')]('CreateChatMessage',_0x2cb320);logger[_0x0c9b('0x20')](_0x0c9b('0x1a'),_0x2cb320,JSON[_0x0c9b('0x14')](_0x3dfd64));_0xb5ce29(_0x3dfd64);})['catch'](function(_0xfe2576){logger['error'](_0x0c9b('0x1a'),_0xfe2576[_0x0c9b('0x18')],_0x2cb320);_0x1bf9f1(_0x1b8e61[_0x0c9b('0x15')](0x1f4,_0xfe2576[_0x0c9b('0x18')]));});});};
\ No newline at end of file
+var _0x93b2=['ioredis','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatMessage.socket','register','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateChatMessage','ChatMessage','options','raw','lodash','util','moment','bluebird','randomstring'];(function(_0x38bf76,_0x313689){var _0x141848=function(_0x2ed9d6){while(--_0x2ed9d6){_0x38bf76['push'](_0x38bf76['shift']());}};_0x141848(++_0x313689);}(_0x93b2,0xcd));var _0x293b=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x93b2[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x293b('0x0'));var util=require(_0x293b('0x1'));var moment=require(_0x293b('0x2'));var BPromise=require(_0x293b('0x3'));var rs=require(_0x293b('0x4'));var fs=require('fs');var Redis=require(_0x293b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x293b('0x6'));var logger=require('../../config/logger')(_0x293b('0x7'));var config=require(_0x293b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x293b('0x9')][_0x293b('0xa')]({'port':0x232a});config[_0x293b('0xb')]=_[_0x293b('0xc')](config[_0x293b('0xb')],{'host':_0x293b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x293b('0xb')]));require(_0x293b('0xe'))[_0x293b('0xf')](socket);function respondWithRpcPromise(_0x24ed6e,_0x45581d,_0x4eeec4){return new BPromise(function(_0x53ccf6,_0x5bf0d8){return client['request'](_0x24ed6e,_0x4eeec4)[_0x293b('0x10')](function(_0x5e44b2){logger[_0x293b('0x11')](_0x293b('0x12'),_0x45581d,_0x293b('0x13'));logger[_0x293b('0x14')](_0x293b('0x15'),_0x45581d,_0x293b('0x13'),JSON[_0x293b('0x16')](_0x5e44b2));if(_0x5e44b2[_0x293b('0x17')]){if(_0x5e44b2[_0x293b('0x17')]['code']===0x1f4){logger['error']('ChatMessage,\x20%s,\x20%s',_0x45581d,_0x5e44b2[_0x293b('0x17')][_0x293b('0x18')]);return _0x5bf0d8(_0x5e44b2[_0x293b('0x17')][_0x293b('0x18')]);}logger[_0x293b('0x17')](_0x293b('0x12'),_0x45581d,_0x5e44b2[_0x293b('0x17')]['message']);return _0x53ccf6(_0x5e44b2['error'][_0x293b('0x18')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0x45581d,'request\x20sent');_0x53ccf6(_0x5e44b2['result'][_0x293b('0x18')]);}})[_0x293b('0x19')](function(_0x2cfadb){logger[_0x293b('0x17')](_0x293b('0x12'),_0x45581d,_0x2cfadb);_0x5bf0d8(_0x2cfadb);});});}exports[_0x293b('0x1a')]=function(_0x488fe6){var _0x42e79e=this;return new Promise(function(_0x5f58cd,_0xa4a7bf){return db[_0x293b('0x1b')]['create'](_0x488fe6['body'],{'raw':_0x488fe6['options']?_0x488fe6[_0x293b('0x1c')][_0x293b('0x1d')]===undefined?!![]:![]:!![]})[_0x293b('0x10')](function(_0x1dbad8){logger[_0x293b('0x11')](_0x293b('0x1a'),_0x488fe6);logger[_0x293b('0x14')](_0x293b('0x1a'),_0x488fe6,JSON[_0x293b('0x16')](_0x1dbad8));_0x5f58cd(_0x1dbad8);})[_0x293b('0x19')](function(_0x55d8c1){logger[_0x293b('0x17')](_0x293b('0x1a'),_0x55d8c1[_0x293b('0x18')],_0x488fe6);_0xa4a7bf(_0x42e79e[_0x293b('0x17')](0x1f4,_0x55d8c1[_0x293b('0x18')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index 8f1f6bd..b3ee39c 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 _0x56e6=['save','remove','update','emit','removeListener','register','length','chatMessage:','./chatMessage.events'];(function(_0x45c569,_0x255cd0){var _0x1cc195=function(_0x23248c){while(--_0x23248c){_0x45c569['push'](_0x45c569['shift']());}};_0x1cc195(++_0x255cd0);}(_0x56e6,0x6b));var _0x656e=function(_0x4ce93d,_0x552831){_0x4ce93d=_0x4ce93d-0x0;var _0x209b1a=_0x56e6[_0x4ce93d];return _0x209b1a;};'use strict';var ChatMessageEvents=require(_0x656e('0x0'));var events=[_0x656e('0x1'),_0x656e('0x2'),_0x656e('0x3')];function createListener(_0x3a7a6a,_0x3833eb){return function(_0x5adaa8){_0x3833eb[_0x656e('0x4')](_0x3a7a6a,_0x5adaa8);};}function removeListener(_0x23c947,_0xe7d540){return function(){ChatMessageEvents[_0x656e('0x5')](_0x23c947,_0xe7d540);};}exports[_0x656e('0x6')]=function(_0x3fef98){for(var _0x81c232=0x0,_0x54eddb=events[_0x656e('0x7')];_0x81c232<_0x54eddb;_0x81c232++){var _0x1538a5=events[_0x81c232];var _0x1dad4e=createListener(_0x656e('0x8')+_0x1538a5,_0x3fef98);ChatMessageEvents['on'](_0x1538a5,_0x1dad4e);}};
\ No newline at end of file
+var _0x2f2e=['emit','length','save','remove'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x2f2e,0x146));var _0xe2f2=function(_0x366e99,_0x15d82d){_0x366e99=_0x366e99-0x0;var _0x180bbe=_0x2f2e[_0x366e99];return _0x180bbe;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xe2f2('0x0'),_0xe2f2('0x1'),'update'];function createListener(_0xc8150e,_0x5c1823){return function(_0x1d89ba){_0x5c1823[_0xe2f2('0x2')](_0xc8150e,_0x1d89ba);};}function removeListener(_0x2da048,_0x14543c){return function(){ChatMessageEvents['removeListener'](_0x2da048,_0x14543c);};}exports['register']=function(_0x5b202f){for(var _0x3dca30=0x0,_0x23f7a8=events[_0xe2f2('0x3')];_0x3dca30<_0x23f7a8;_0x3dca30++){var _0xc44c89=events[_0x3dca30];var _0x48111c=createListener('chatMessage:'+_0xc44c89,_0x5b202f);ChatMessageEvents['on'](_0xc44c89,_0x48111c);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index b9101a9..bca3ed5 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 _0x0da6=['util','path','connect-timeout','Router','fs-extra','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','chatmessage:create','create','put','/:id','update','accept','/:id/reject','reject','destroy','multer'];(function(_0x139624,_0xafbf9){var _0x4542d0=function(_0x136bd8){while(--_0x136bd8){_0x139624['push'](_0x139624['shift']());}};_0x4542d0(++_0xafbf9);}(_0x0da6,0x7d));var _0x60da=function(_0x1cc3ce,_0x43791e){_0x1cc3ce=_0x1cc3ce-0x0;var _0x4ac6ac=_0x0da6[_0x1cc3ce];return _0x4ac6ac;};'use strict';var multer=require(_0x60da('0x0'));var util=require(_0x60da('0x1'));var path=require(_0x60da('0x2'));var timeout=require(_0x60da('0x3'));var express=require('express');var router=express[_0x60da('0x4')]();var fs_extra=require(_0x60da('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x60da('0x6'));var controller=require(_0x60da('0x7'));router[_0x60da('0x8')]('/',auth[_0x60da('0x9')](),controller['index']);router[_0x60da('0x8')](_0x60da('0xa'),auth[_0x60da('0x9')](),controller[_0x60da('0xb')]);router[_0x60da('0x8')]('/:id',auth[_0x60da('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),interaction['tracked']('chat',_0x60da('0xc')),controller[_0x60da('0xd')]);router[_0x60da('0xe')](_0x60da('0xf'),controller[_0x60da('0x10')]);router[_0x60da('0xe')]('/:id/accept',auth['isAuthenticated'](),controller[_0x60da('0x11')]);router['put'](_0x60da('0x12'),auth[_0x60da('0x9')](),controller[_0x60da('0x13')]);router['delete'](_0x60da('0xf'),auth[_0x60da('0x9')](),controller[_0x60da('0x14')]);module['exports']=router;
\ No newline at end of file
+var _0x1c13=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatMessage.controller','isAuthenticated','index','get','/describe','/:id','show','post','tracked','chat','chatmessage:create','put','accept','reject','delete','exports','multer'];(function(_0x2f4462,_0x2c6499){var _0x41c315=function(_0x4b1d53){while(--_0x4b1d53){_0x2f4462['push'](_0x2f4462['shift']());}};_0x41c315(++_0x2c6499);}(_0x1c13,0xef));var _0x31c1=function(_0x37e233,_0x483494){_0x37e233=_0x37e233-0x0;var _0x26a59f=_0x1c13[_0x37e233];return _0x26a59f;};'use strict';var multer=require(_0x31c1('0x0'));var util=require(_0x31c1('0x1'));var path=require(_0x31c1('0x2'));var timeout=require(_0x31c1('0x3'));var express=require(_0x31c1('0x4'));var router=express[_0x31c1('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x31c1('0x6'));var interaction=require(_0x31c1('0x7'));var config=require('../../config/environment');var controller=require(_0x31c1('0x8'));router['get']('/',auth[_0x31c1('0x9')](),controller[_0x31c1('0xa')]);router[_0x31c1('0xb')](_0x31c1('0xc'),auth[_0x31c1('0x9')](),controller['describe']);router[_0x31c1('0xb')](_0x31c1('0xd'),auth[_0x31c1('0x9')](),controller[_0x31c1('0xe')]);router[_0x31c1('0xf')]('/',auth[_0x31c1('0x9')](),interaction[_0x31c1('0x10')](_0x31c1('0x11'),_0x31c1('0x12')),controller['create']);router[_0x31c1('0x13')]('/:id',controller['update']);router[_0x31c1('0x13')]('/:id/accept',auth['isAuthenticated'](),controller[_0x31c1('0x14')]);router[_0x31c1('0x13')]('/:id/reject',auth[_0x31c1('0x9')](),controller[_0x31c1('0x15')]);router[_0x31c1('0x16')](_0x31c1('0xd'),auth[_0x31c1('0x9')](),controller['destroy']);module[_0x31c1('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index 55c2ad3..ac87ddc 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 _0x5f66=['medium','TEXT','exports'];(function(_0x315855,_0x3c86b6){var _0x2bfb60=function(_0x17f486){while(--_0x17f486){_0x315855['push'](_0x315855['shift']());}};_0x2bfb60(++_0x3c86b6);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require('sequelize');module[_0x65f6('0x0')]={'body':{'type':Sequelize['TEXT'](_0x65f6('0x1')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x65f6('0x2')](_0x65f6('0x1')),'allowNull':![]}};
\ No newline at end of file
+var _0x0b0e=['medium','sequelize','TEXT'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x0b0e[_0x478414];return _0x5eb6b9;};'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
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 8dce84c..35847a0 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(_0x198142,_0x3db6a9){var _0x41c75c=function(_0x39e459){while(--_0x39e459){_0x198142['push'](_0x198142['shift']());}};_0x41c75c(++_0x3db6a9);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _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(_0x26368d,_0x51d04d){var _0x336739=function(_0x1eed79){while(--_0x1eed79){_0x26368d['push'](_0x26368d['shift']());}};_0x336739(++_0x51d04d);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'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 4891813..b0d7254 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 _0x954a=['save','update','emit','hook','events','ChatOfflineMessage','setMaxListeners'];(function(_0x5bd112,_0xb078a4){var _0x480d09=function(_0xb912d8){while(--_0xb912d8){_0x5bd112['push'](_0x5bd112['shift']());}};_0x480d09(++_0xb078a4);}(_0x954a,0x66));var _0xa954=function(_0x45abd4,_0x888b10){_0x45abd4=_0x45abd4-0x0;var _0x243c9c=_0x954a[_0x45abd4];return _0x243c9c;};'use strict';var EventEmitter=require(_0xa954('0x0'));var ChatOfflineMessage=require('../../mysqldb')['db'][_0xa954('0x1')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xa954('0x2')](0x0);var events={'afterCreate':_0xa954('0x3'),'afterUpdate':_0xa954('0x4'),'afterDestroy':'remove'};function emitEvent(_0x43abfc){return function(_0x4ed3d9,_0x14bd69,_0x17aa7b){ChatOfflineMessageEvents[_0xa954('0x5')](_0x43abfc+':'+_0x4ed3d9['id'],_0x4ed3d9);ChatOfflineMessageEvents[_0xa954('0x5')](_0x43abfc,_0x4ed3d9);_0x17aa7b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatOfflineMessage[_0xa954('0x6')](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0xc039=['emit','hasOwnProperty','exports','../../mysqldb','remove'];(function(_0x54e5b0,_0x2a0cde){var _0x32761f=function(_0x24011f){while(--_0x24011f){_0x54e5b0['push'](_0x54e5b0['shift']());}};_0x32761f(++_0x2a0cde);}(_0xc039,0x19d));var _0x9c03=function(_0xcef73f,_0x595c46){_0xcef73f=_0xcef73f-0x0;var _0x36f839=_0xc039[_0xcef73f];return _0x36f839;};'use strict';var EventEmitter=require('events');var ChatOfflineMessage=require(_0x9c03('0x0'))['db']['ChatOfflineMessage'];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9c03('0x1')};function emitEvent(_0x2e6d2f){return function(_0x104bbd,_0xfd5178,_0x30d60d){ChatOfflineMessageEvents['emit'](_0x2e6d2f+':'+_0x104bbd['id'],_0x104bbd);ChatOfflineMessageEvents[_0x9c03('0x2')](_0x2e6d2f,_0x104bbd);_0x30d60d(null);};}for(var e in events){if(events[_0x9c03('0x3')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module[_0x9c03('0x4')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index d8049d6..9ac1ae9 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 _0x4b62=['utf8mb4_unicode_ci','./chatOfflineMessage.attributes','ChatOfflineMessage','utf8mb4'];(function(_0x2123b0,_0x23a59d){var _0x32f000=function(_0x390a4d){while(--_0x390a4d){_0x2123b0['push'](_0x2123b0['shift']());}};_0x32f000(++_0x23a59d);}(_0x4b62,0xd9));var _0x24b6=function(_0x159f56,_0x96204c){_0x159f56=_0x159f56-0x0;var _0x1042eb=_0x4b62[_0x159f56];return _0x1042eb;};'use strict';var attributes=require(_0x24b6('0x0'));module['exports']=function(_0x16a8d9){return _0x16a8d9['define'](_0x24b6('0x1'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24b6('0x2'),'collate':_0x24b6('0x3')});};
\ No newline at end of file
+var _0x81ea=['exports','define','chat_offline_messages','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0x5c7a85,_0x41dd19){var _0x35290f=function(_0x26215b){while(--_0x26215b){_0x5c7a85['push'](_0x5c7a85['shift']());}};_0x35290f(++_0x41dd19);}(_0x81ea,0x1b2));var _0xa81e=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x81ea[_0xa464c9];return _0x3d73c4;};'use strict';var attributes=require(_0xa81e('0x0'));module[_0xa81e('0x1')]=function(_0x28a799){return _0x28a799[_0xa81e('0x2')]('ChatOfflineMessage',attributes,{'tableName':_0xa81e('0x3'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa81e('0x4')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index ca046b4..7350f02 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 _0x68c6=['then','info','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2c21fc,_0x4afc78){var _0x2adcef=function(_0x55a58b){while(--_0x55a58b){_0x2c21fc['push'](_0x2c21fc['shift']());}};_0x2adcef(++_0x4afc78);}(_0x68c6,0x137));var _0x668c=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x68c6[_0x54a9e3];return _0x247cce;};'use strict';var _=require('lodash');var util=require(_0x668c('0x0'));var moment=require(_0x668c('0x1'));var BPromise=require(_0x668c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x668c('0x3'));var logger=require(_0x668c('0x4'))(_0x668c('0x5'));var config=require(_0x668c('0x6'));var jayson=require(_0x668c('0x7'));var client=jayson['client'][_0x668c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3420d5,_0x3c4f87,_0x44b279){return new BPromise(function(_0x483ef6,_0x29758b){return client['request'](_0x3420d5,_0x44b279)[_0x668c('0x9')](function(_0x5ba1b8){logger[_0x668c('0xa')]('ChatOfflineMessage,\x20%s,\x20%s',_0x3c4f87,_0x668c('0xb'));logger[_0x668c('0xc')](_0x668c('0xd'),_0x3c4f87,_0x668c('0xb'),JSON[_0x668c('0xe')](_0x5ba1b8));if(_0x5ba1b8[_0x668c('0xf')]){if(_0x5ba1b8[_0x668c('0xf')][_0x668c('0x10')]===0x1f4){logger['error'](_0x668c('0x11'),_0x3c4f87,_0x5ba1b8[_0x668c('0xf')][_0x668c('0x12')]);return _0x29758b(_0x5ba1b8['error'][_0x668c('0x12')]);}logger[_0x668c('0xf')](_0x668c('0x11'),_0x3c4f87,_0x5ba1b8['error']['message']);return _0x483ef6(_0x5ba1b8[_0x668c('0xf')][_0x668c('0x12')]);}else{logger[_0x668c('0xa')](_0x668c('0x11'),_0x3c4f87,_0x668c('0xb'));_0x483ef6(_0x5ba1b8['result'][_0x668c('0x12')]);}})[_0x668c('0x13')](function(_0x1cdb1d){logger[_0x668c('0xf')](_0x668c('0x11'),_0x3c4f87,_0x1cdb1d);_0x29758b(_0x1cdb1d);});});}
\ No newline at end of file
+var _0x66dd=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch'];(function(_0x45c572,_0x34ac34){var _0x53888f=function(_0x2988b2){while(--_0x2988b2){_0x45c572['push'](_0x45c572['shift']());}};_0x53888f(++_0x34ac34);}(_0x66dd,0xb8));var _0xd66d=function(_0x1c3fbd,_0x2a5a2d){_0x1c3fbd=_0x1c3fbd-0x0;var _0x2082ec=_0x66dd[_0x1c3fbd];return _0x2082ec;};'use strict';var _=require('lodash');var util=require(_0xd66d('0x0'));var moment=require(_0xd66d('0x1'));var BPromise=require(_0xd66d('0x2'));var rs=require(_0xd66d('0x3'));var fs=require('fs');var Redis=require(_0xd66d('0x4'));var db=require(_0xd66d('0x5'))['db'];var utils=require(_0xd66d('0x6'));var logger=require('../../config/logger')(_0xd66d('0x7'));var config=require(_0xd66d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xd66d('0x9')][_0xd66d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40432c,_0x1bfd1c,_0x5c631c){return new BPromise(function(_0x4d2723,_0x174b22){return client[_0xd66d('0xb')](_0x40432c,_0x5c631c)[_0xd66d('0xc')](function(_0x5b5651){logger[_0xd66d('0xd')](_0xd66d('0xe'),_0x1bfd1c,'request\x20sent');logger[_0xd66d('0xf')]('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x1bfd1c,_0xd66d('0x10'),JSON[_0xd66d('0x11')](_0x5b5651));if(_0x5b5651[_0xd66d('0x12')]){if(_0x5b5651[_0xd66d('0x12')][_0xd66d('0x13')]===0x1f4){logger[_0xd66d('0x12')](_0xd66d('0xe'),_0x1bfd1c,_0x5b5651[_0xd66d('0x12')][_0xd66d('0x14')]);return _0x174b22(_0x5b5651['error'][_0xd66d('0x14')]);}logger['error'](_0xd66d('0xe'),_0x1bfd1c,_0x5b5651[_0xd66d('0x12')][_0xd66d('0x14')]);return _0x4d2723(_0x5b5651[_0xd66d('0x12')][_0xd66d('0x14')]);}else{logger[_0xd66d('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1bfd1c,_0xd66d('0x10'));_0x4d2723(_0x5b5651[_0xd66d('0x15')][_0xd66d('0x14')]);}})[_0xd66d('0x16')](function(_0x3ea3f7){logger['error'](_0xd66d('0xe'),_0x1bfd1c,_0x3ea3f7);_0x174b22(_0x3ea3f7);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index e1218dc..3fa3310 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 _0xfc0d=['destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update','delete'];(function(_0x58aad3,_0x2a1647){var _0x2618d9=function(_0x3b760a){while(--_0x3b760a){_0x58aad3['push'](_0x58aad3['shift']());}};_0x2618d9(++_0x2a1647);}(_0xfc0d,0xe9));var _0xdfc0=function(_0x5cb29e,_0x237e9d){_0x5cb29e=_0x5cb29e-0x0;var _0x462274=_0xfc0d[_0x5cb29e];return _0x462274;};'use strict';var multer=require(_0xdfc0('0x0'));var util=require(_0xdfc0('0x1'));var path=require(_0xdfc0('0x2'));var timeout=require('connect-timeout');var express=require(_0xdfc0('0x3'));var router=express[_0xdfc0('0x4')]();var fs_extra=require(_0xdfc0('0x5'));var auth=require(_0xdfc0('0x6'));var interaction=require(_0xdfc0('0x7'));var config=require(_0xdfc0('0x8'));var controller=require(_0xdfc0('0x9'));router[_0xdfc0('0xa')]('/',auth[_0xdfc0('0xb')](),controller[_0xdfc0('0xc')]);router['get']('/describe',auth[_0xdfc0('0xb')](),controller['describe']);router[_0xdfc0('0xa')](_0xdfc0('0xd'),auth[_0xdfc0('0xb')](),controller[_0xdfc0('0xe')]);router[_0xdfc0('0xf')]('/',auth[_0xdfc0('0xb')](),controller['create']);router[_0xdfc0('0x10')]('/:id',auth[_0xdfc0('0xb')](),controller[_0xdfc0('0x11')]);router[_0xdfc0('0x12')]('/:id',auth[_0xdfc0('0xb')](),controller[_0xdfc0('0x13')]);module[_0xdfc0('0x14')]=router;
\ No newline at end of file
+var _0x71e3=['describe','/:id','show','create','delete','exports','path','connect-timeout','express','Router','../../components/auth/service','./chatOfflineMessage.controller','get','isAuthenticated','/describe'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x71e3,0x150));var _0x371e=function(_0x4ebb6f,_0x49b0ee){_0x4ebb6f=_0x4ebb6f-0x0;var _0x552ccd=_0x71e3[_0x4ebb6f];return _0x552ccd;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x371e('0x0'));var timeout=require(_0x371e('0x1'));var express=require(_0x371e('0x2'));var router=express[_0x371e('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x371e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x371e('0x5'));router[_0x371e('0x6')]('/',auth[_0x371e('0x7')](),controller['index']);router[_0x371e('0x6')](_0x371e('0x8'),auth[_0x371e('0x7')](),controller[_0x371e('0x9')]);router['get'](_0x371e('0xa'),auth[_0x371e('0x7')](),controller[_0x371e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x371e('0xc')]);router['put']('/:id',auth[_0x371e('0x7')](),controller['update']);router[_0x371e('0xd')]('/:id',auth[_0x371e('0x7')](),controller['destroy']);module[_0x371e('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index 2482e32..0a7c17c 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 _0x2595=['exports','ENUM','mouseOver','timeout','STRING','INTEGER','sequelize'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x2595,0xf4));var _0x5259=function(_0x3f8759,_0x3fe6fb){_0x3f8759=_0x3f8759-0x0;var _0x2d33ca=_0x2595[_0x3f8759];return _0x2d33ca;};'use strict';var Sequelize=require(_0x5259('0x0'));module[_0x5259('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x5259('0x2')](_0x5259('0x3'),_0x5259('0x4')),'defaultValue':_0x5259('0x3')},'selector':{'type':Sequelize[_0x5259('0x5')]},'timeout':{'type':Sequelize[_0x5259('0x6')]}};
\ No newline at end of file
+var _0xa569=['exports','STRING','ENUM','mouseOver','timeout','sequelize'];(function(_0x589bad,_0x391d31){var _0x2fea56=function(_0x9aafbe){while(--_0x9aafbe){_0x589bad['push'](_0x589bad['shift']());}};_0x2fea56(++_0x391d31);}(_0xa569,0x137));var _0x9a56=function(_0x4314d7,_0x355218){_0x4314d7=_0x4314d7-0x0;var _0x5c599b=_0xa569[_0x4314d7];return _0x5c599b;};'use strict';var Sequelize=require(_0x9a56('0x0'));module[_0x9a56('0x1')]={'name':{'type':Sequelize[_0x9a56('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9a56('0x3')](_0x9a56('0x4'),_0x9a56('0x5')),'defaultValue':_0x9a56('0x4')},'selector':{'type':Sequelize[_0x9a56('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 8f791d8..1bb2474 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 _0xb6f1=['eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','set','reject','save','update','destroy','then','stack','send','show','params','model','keys','rawAttributes','filters','intersection','query','attributes','fields','length','include','merge','options','ChatProactiveAction','catch','create','body','find'];(function(_0x41f537,_0x356716){var _0x140b28=function(_0x199957){while(--_0x199957){_0x41f537['push'](_0x41f537['shift']());}};_0x140b28(++_0x356716);}(_0xb6f1,0x118));var _0x1b6f=function(_0xdeefbd,_0x9e1b3d){_0xdeefbd=_0xdeefbd-0x0;var _0x4ff63f=_0xb6f1[_0xdeefbd];return _0x4ff63f;};'use strict';var emlformat=require(_0x1b6f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1b6f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1b6f('0x2'));var moment=require(_0x1b6f('0x3'));var BPromise=require(_0x1b6f('0x4'));var Mustache=require('mustache');var util=require(_0x1b6f('0x5'));var path=require('path');var sox=require(_0x1b6f('0x6'));var csv=require(_0x1b6f('0x7'));var ejs=require(_0x1b6f('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require('lodash');var squel=require(_0x1b6f('0x9'));var crypto=require(_0x1b6f('0xa'));var jsforce=require(_0x1b6f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1b6f('0x7'));var querystring=require(_0x1b6f('0xc'));var Papa=require('papaparse');var Redis=require(_0x1b6f('0xd'));var authService=require(_0x1b6f('0xe'));var qs=require(_0x1b6f('0xf'));var as=require(_0x1b6f('0x10'));var hardwareService=require(_0x1b6f('0x11'));var logger=require(_0x1b6f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x1b6f('0x13'));var licenseUtil=require(_0x1b6f('0x14'));var db=require(_0x1b6f('0x15'))['db'];function respondWithStatusCode(_0x2ec009,_0x213a23){_0x213a23=_0x213a23||0xcc;return function(_0x19c1a9){if(_0x19c1a9){return _0x2ec009[_0x1b6f('0x16')](_0x213a23);}return _0x2ec009[_0x1b6f('0x17')](_0x213a23)[_0x1b6f('0x18')]();};}function respondWithResult(_0x433889,_0x3a8364){_0x3a8364=_0x3a8364||0xc8;return function(_0x195740){if(_0x195740){return _0x433889[_0x1b6f('0x17')](_0x3a8364)[_0x1b6f('0x19')](_0x195740);}};}function respondWithFilteredResult(_0x39c048,_0x283bd4){return function(_0x2c4d44){if(_0x2c4d44){var _0x3a3b48=typeof _0x283bd4[_0x1b6f('0x1a')]===_0x1b6f('0x1b')&&typeof _0x283bd4['limit']==='undefined';var _0x214184=_0x2c4d44[_0x1b6f('0x1c')];var _0x1cdf6e=_0x3a3b48?0x0:_0x283bd4[_0x1b6f('0x1a')];var _0x437798=_0x3a3b48?_0x2c4d44[_0x1b6f('0x1c')]:_0x283bd4[_0x1b6f('0x1a')]+_0x283bd4['limit'];var _0x1b7fb5;if(_0x437798>=_0x214184){_0x437798=_0x214184;_0x1b7fb5=0xc8;}else{_0x1b7fb5=0xce;}_0x39c048[_0x1b6f('0x17')](_0x1b7fb5);return _0x39c048[_0x1b6f('0x1d')]('Content-Range',_0x1cdf6e+'-'+_0x437798+'/'+_0x214184)[_0x1b6f('0x19')](_0x2c4d44);}return null;};}function patchUpdates(_0x1ea885){return function(_0x43121d){try{jsonpatch['apply'](_0x43121d,_0x1ea885,!![]);}catch(_0x32dc20){return BPromise[_0x1b6f('0x1e')](_0x32dc20);}return _0x43121d[_0x1b6f('0x1f')]();};}function saveUpdates(_0x419d93,_0x8e95df){return function(_0x1a8996){if(_0x1a8996){return _0x1a8996[_0x1b6f('0x20')](_0x419d93)['then'](function(_0x24d551){return _0x24d551;});}return null;};}function removeEntity(_0x4c236c,_0x2345db){return function(_0x375f4f){if(_0x375f4f){return _0x375f4f[_0x1b6f('0x21')]()[_0x1b6f('0x22')](function(){_0x4c236c[_0x1b6f('0x17')](0xcc)[_0x1b6f('0x18')]();});}};}function handleEntityNotFound(_0x39eb93,_0x163933){return function(_0x13486f){if(!_0x13486f){_0x39eb93['sendStatus'](0x194);}return _0x13486f;};}function handleError(_0x428187,_0x5a490b){_0x5a490b=_0x5a490b||0x1f4;return function(_0x15b953){logger['error'](_0x15b953[_0x1b6f('0x23')]);if(_0x15b953['name']){delete _0x15b953['name'];}_0x428187[_0x1b6f('0x17')](_0x5a490b)[_0x1b6f('0x24')](_0x15b953);};}exports[_0x1b6f('0x25')]=function(_0xe8b510,_0x42d2b3){var _0x3a566={'raw':!![],'where':{'id':_0xe8b510[_0x1b6f('0x26')]['id']}},_0x9483ef={};_0x9483ef[_0x1b6f('0x27')]=_[_0x1b6f('0x28')](db['ChatProactiveAction'][_0x1b6f('0x29')]);_0x9483ef['query']=_['keys'](_0xe8b510['query']);_0x9483ef[_0x1b6f('0x2a')]=_[_0x1b6f('0x2b')](_0x9483ef[_0x1b6f('0x27')],_0x9483ef[_0x1b6f('0x2c')]);_0x3a566[_0x1b6f('0x2d')]=_['intersection'](_0x9483ef['model'],qs[_0x1b6f('0x2e')](_0xe8b510[_0x1b6f('0x2c')][_0x1b6f('0x2e')]));_0x3a566[_0x1b6f('0x2d')]=_0x3a566[_0x1b6f('0x2d')][_0x1b6f('0x2f')]?_0x3a566['attributes']:_0x9483ef[_0x1b6f('0x27')];if(_0xe8b510[_0x1b6f('0x2c')]['includeAll']){_0x3a566[_0x1b6f('0x30')]=[{'all':!![]}];}_0x3a566=_[_0x1b6f('0x31')]({},_0x3a566,_0xe8b510[_0x1b6f('0x32')]);return db[_0x1b6f('0x33')]['find'](_0x3a566)[_0x1b6f('0x22')](handleEntityNotFound(_0x42d2b3,null))[_0x1b6f('0x22')](respondWithResult(_0x42d2b3,null))[_0x1b6f('0x34')](handleError(_0x42d2b3,null));};exports[_0x1b6f('0x35')]=function(_0x2ed7a2,_0x4c135f){return db[_0x1b6f('0x33')][_0x1b6f('0x35')](_0x2ed7a2[_0x1b6f('0x36')],{})[_0x1b6f('0x22')](respondWithResult(_0x4c135f,0xc9))['catch'](handleError(_0x4c135f,null));};exports[_0x1b6f('0x20')]=function(_0x49c141,_0x4f1459){if(_0x49c141[_0x1b6f('0x36')]['id']){delete _0x49c141[_0x1b6f('0x36')]['id'];}return db[_0x1b6f('0x33')][_0x1b6f('0x37')]({'where':{'id':_0x49c141['params']['id']}})['then'](handleEntityNotFound(_0x4f1459,null))['then'](saveUpdates(_0x49c141[_0x1b6f('0x36')],null))['then'](respondWithResult(_0x4f1459,null))[_0x1b6f('0x34')](handleError(_0x4f1459,null));};exports[_0x1b6f('0x21')]=function(_0x58cc42,_0x5728d8){return db['ChatProactiveAction']['find']({'where':{'id':_0x58cc42[_0x1b6f('0x26')]['id']}})['then'](handleEntityNotFound(_0x5728d8,null))[_0x1b6f('0x22')](removeEntity(_0x5728d8,null))[_0x1b6f('0x34')](handleError(_0x5728d8,null));};
\ No newline at end of file
+var _0x1af5=['destroy','sendStatus','error','stack','name','send','params','model','ChatProactiveAction','keys','query','filters','intersection','attributes','includeAll','options','find','catch','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','then'];(function(_0x9dfc10,_0x19c2d5){var _0x4f938a=function(_0x12b1e5){while(--_0x12b1e5){_0x9dfc10['push'](_0x9dfc10['shift']());}};_0x4f938a(++_0x19c2d5);}(_0x1af5,0x17d));var _0x51af=function(_0x18c5a5,_0x526d6f){_0x18c5a5=_0x18c5a5-0x0;var _0x8be903=_0x1af5[_0x18c5a5];return _0x8be903;};'use strict';var emlformat=require(_0x51af('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x51af('0x1'));var jsonpatch=require(_0x51af('0x2'));var rp=require(_0x51af('0x3'));var moment=require(_0x51af('0x4'));var BPromise=require(_0x51af('0x5'));var Mustache=require(_0x51af('0x6'));var util=require(_0x51af('0x7'));var path=require(_0x51af('0x8'));var sox=require(_0x51af('0x9'));var csv=require(_0x51af('0xa'));var ejs=require(_0x51af('0xb'));var fs=require('fs');var fs_extra=require(_0x51af('0xc'));var _=require(_0x51af('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x51af('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x51af('0xa'));var querystring=require(_0x51af('0xf'));var Papa=require(_0x51af('0x10'));var Redis=require(_0x51af('0x11'));var authService=require(_0x51af('0x12'));var qs=require(_0x51af('0x13'));var as=require(_0x51af('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x51af('0x15'))(_0x51af('0x16'));var utils=require(_0x51af('0x17'));var config=require(_0x51af('0x18'));var licenseUtil=require(_0x51af('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xeb29b4,_0x50b48d){_0x50b48d=_0x50b48d||0xcc;return function(_0x24eca2){if(_0x24eca2){return _0xeb29b4['sendStatus'](_0x50b48d);}return _0xeb29b4[_0x51af('0x1a')](_0x50b48d)[_0x51af('0x1b')]();};}function respondWithResult(_0x85a6ba,_0x5d5d40){_0x5d5d40=_0x5d5d40||0xc8;return function(_0x432a5d){if(_0x432a5d){return _0x85a6ba[_0x51af('0x1a')](_0x5d5d40)[_0x51af('0x1c')](_0x432a5d);}};}function respondWithFilteredResult(_0x3a5414,_0x51f544){return function(_0x32ea74){if(_0x32ea74){var _0x255e7e=typeof _0x51f544[_0x51af('0x1d')]==='undefined'&&typeof _0x51f544['limit']===_0x51af('0x1e');var _0x1f1592=_0x32ea74[_0x51af('0x1f')];var _0x5ecc27=_0x255e7e?0x0:_0x51f544[_0x51af('0x1d')];var _0x1b86f0=_0x255e7e?_0x32ea74[_0x51af('0x1f')]:_0x51f544[_0x51af('0x1d')]+_0x51f544[_0x51af('0x20')];var _0x23d8df;if(_0x1b86f0>=_0x1f1592){_0x1b86f0=_0x1f1592;_0x23d8df=0xc8;}else{_0x23d8df=0xce;}_0x3a5414[_0x51af('0x1a')](_0x23d8df);return _0x3a5414[_0x51af('0x21')](_0x51af('0x22'),_0x5ecc27+'-'+_0x1b86f0+'/'+_0x1f1592)['json'](_0x32ea74);}return null;};}function patchUpdates(_0x530861){return function(_0x733b3b){try{jsonpatch[_0x51af('0x23')](_0x733b3b,_0x530861,!![]);}catch(_0x233e9e){return BPromise[_0x51af('0x24')](_0x233e9e);}return _0x733b3b[_0x51af('0x25')]();};}function saveUpdates(_0x4962a9,_0x31f4c0){return function(_0x5a7360){if(_0x5a7360){return _0x5a7360['update'](_0x4962a9)[_0x51af('0x26')](function(_0x58f227){return _0x58f227;});}return null;};}function removeEntity(_0x81d1b1,_0x5efc62){return function(_0x5e47d3){if(_0x5e47d3){return _0x5e47d3[_0x51af('0x27')]()['then'](function(){_0x81d1b1['status'](0xcc)[_0x51af('0x1b')]();});}};}function handleEntityNotFound(_0x4e771f,_0x3f725a){return function(_0x152ebd){if(!_0x152ebd){_0x4e771f[_0x51af('0x28')](0x194);}return _0x152ebd;};}function handleError(_0x2de497,_0x4d81f9){_0x4d81f9=_0x4d81f9||0x1f4;return function(_0x1320a8){logger[_0x51af('0x29')](_0x1320a8[_0x51af('0x2a')]);if(_0x1320a8[_0x51af('0x2b')]){delete _0x1320a8[_0x51af('0x2b')];}_0x2de497[_0x51af('0x1a')](_0x4d81f9)[_0x51af('0x2c')](_0x1320a8);};}exports['show']=function(_0x203d49,_0x1ba74d){var _0x3eb45c={'raw':!![],'where':{'id':_0x203d49[_0x51af('0x2d')]['id']}},_0x31891e={};_0x31891e[_0x51af('0x2e')]=_['keys'](db[_0x51af('0x2f')]['rawAttributes']);_0x31891e['query']=_[_0x51af('0x30')](_0x203d49[_0x51af('0x31')]);_0x31891e[_0x51af('0x32')]=_[_0x51af('0x33')](_0x31891e[_0x51af('0x2e')],_0x31891e[_0x51af('0x31')]);_0x3eb45c['attributes']=_[_0x51af('0x33')](_0x31891e['model'],qs['fields'](_0x203d49[_0x51af('0x31')]['fields']));_0x3eb45c['attributes']=_0x3eb45c['attributes']['length']?_0x3eb45c[_0x51af('0x34')]:_0x31891e[_0x51af('0x2e')];if(_0x203d49[_0x51af('0x31')][_0x51af('0x35')]){_0x3eb45c['include']=[{'all':!![]}];}_0x3eb45c=_['merge']({},_0x3eb45c,_0x203d49[_0x51af('0x36')]);return db[_0x51af('0x2f')][_0x51af('0x37')](_0x3eb45c)[_0x51af('0x26')](handleEntityNotFound(_0x1ba74d,null))[_0x51af('0x26')](respondWithResult(_0x1ba74d,null))[_0x51af('0x38')](handleError(_0x1ba74d,null));};exports[_0x51af('0x39')]=function(_0x57cfb7,_0xf7b110){return db[_0x51af('0x2f')][_0x51af('0x39')](_0x57cfb7[_0x51af('0x3a')],{})['then'](respondWithResult(_0xf7b110,0xc9))[_0x51af('0x38')](handleError(_0xf7b110,null));};exports[_0x51af('0x3b')]=function(_0x4c3596,_0x1c0432){if(_0x4c3596[_0x51af('0x3a')]['id']){delete _0x4c3596[_0x51af('0x3a')]['id'];}return db[_0x51af('0x2f')][_0x51af('0x37')]({'where':{'id':_0x4c3596[_0x51af('0x2d')]['id']}})[_0x51af('0x26')](handleEntityNotFound(_0x1c0432,null))[_0x51af('0x26')](saveUpdates(_0x4c3596[_0x51af('0x3a')],null))[_0x51af('0x26')](respondWithResult(_0x1c0432,null))[_0x51af('0x38')](handleError(_0x1c0432,null));};exports[_0x51af('0x27')]=function(_0x4f160c,_0x43db83){return db[_0x51af('0x2f')][_0x51af('0x37')]({'where':{'id':_0x4f160c[_0x51af('0x2d')]['id']}})[_0x51af('0x26')](handleEntityNotFound(_0x43db83,null))[_0x51af('0x26')](removeEntity(_0x43db83,null))['catch'](handleError(_0x43db83,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index 82f22f6..c3e3017 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 _0x7643=['define','ChatProactiveAction','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./chatProactiveAction.attributes'];(function(_0x94fb76,_0x1f88a0){var _0x246631=function(_0x59c5e0){while(--_0x59c5e0){_0x94fb76['push'](_0x94fb76['shift']());}};_0x246631(++_0x1f88a0);}(_0x7643,0x98));var _0x3764=function(_0x7ecc0,_0x3c5cc5){_0x7ecc0=_0x7ecc0-0x0;var _0x5d016b=_0x7643[_0x7ecc0];return _0x5d016b;};'use strict';var _=require(_0x3764('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3764('0x1'));var moment=require(_0x3764('0x2'));var BPromise=require(_0x3764('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3764('0x4'));var rimraf=require(_0x3764('0x5'));var config=require(_0x3764('0x6'));var attributes=require(_0x3764('0x7'));module['exports']=function(_0x349cc2,_0xf1c899){return _0x349cc2[_0x3764('0x8')](_0x3764('0x9'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd004=['path','rimraf','../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x20918a,_0x5878e5){var _0x14843f=function(_0x28be32){while(--_0x28be32){_0x20918a['push'](_0x20918a['shift']());}};_0x14843f(++_0x5878e5);}(_0xd004,0xe4));var _0x4d00=function(_0x15ec4e,_0x40b7e0){_0x15ec4e=_0x15ec4e-0x0;var _0xb5e5dd=_0xd004[_0x15ec4e];return _0xb5e5dd;};'use strict';var _=require(_0x4d00('0x0'));var util=require('util');var logger=require(_0x4d00('0x1'))(_0x4d00('0x2'));var moment=require(_0x4d00('0x3'));var BPromise=require(_0x4d00('0x4'));var rp=require(_0x4d00('0x5'));var fs=require('fs');var path=require(_0x4d00('0x6'));var rimraf=require(_0x4d00('0x7'));var config=require(_0x4d00('0x8'));var attributes=require(_0x4d00('0x9'));module[_0x4d00('0xa')]=function(_0x721021,_0x2e7a45){return _0x721021[_0x4d00('0xb')](_0x4d00('0xc'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js
index cd4f805..1f51213 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 _0x77d6=['request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','ChatProactiveAction,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','client','http','request','then','info'];(function(_0x123fa4,_0x187e84){var _0x509fae=function(_0x2e4e4e){while(--_0x2e4e4e){_0x123fa4['push'](_0x123fa4['shift']());}};_0x509fae(++_0x187e84);}(_0x77d6,0x71));var _0x677d=function(_0x18226e,_0x4c502e){_0x18226e=_0x18226e-0x0;var _0x59d69c=_0x77d6[_0x18226e];return _0x59d69c;};'use strict';var _=require(_0x677d('0x0'));var util=require(_0x677d('0x1'));var moment=require(_0x677d('0x2'));var BPromise=require(_0x677d('0x3'));var rs=require(_0x677d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x677d('0x5'));var logger=require(_0x677d('0x6'))(_0x677d('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x677d('0x8')][_0x677d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1bbcb3,_0x12cad4,_0x15e22c){return new BPromise(function(_0x3ccd2b,_0x21dd66){return client[_0x677d('0xa')](_0x1bbcb3,_0x15e22c)[_0x677d('0xb')](function(_0x3a2672){logger[_0x677d('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x12cad4,_0x677d('0xd'));logger['debug'](_0x677d('0xe'),_0x12cad4,'request\x20sent',JSON[_0x677d('0xf')](_0x3a2672));if(_0x3a2672[_0x677d('0x10')]){if(_0x3a2672[_0x677d('0x10')]['code']===0x1f4){logger[_0x677d('0x10')](_0x677d('0x11'),_0x12cad4,_0x3a2672[_0x677d('0x10')]['message']);return _0x21dd66(_0x3a2672[_0x677d('0x10')][_0x677d('0x12')]);}logger[_0x677d('0x10')](_0x677d('0x11'),_0x12cad4,_0x3a2672[_0x677d('0x10')][_0x677d('0x12')]);return _0x3ccd2b(_0x3a2672['error']['message']);}else{logger[_0x677d('0xc')]('ChatProactiveAction,\x20%s,\x20%s',_0x12cad4,_0x677d('0xd'));_0x3ccd2b(_0x3a2672[_0x677d('0x13')][_0x677d('0x12')]);}})[_0x677d('0x14')](function(_0x51276a){logger[_0x677d('0x10')](_0x677d('0x11'),_0x12cad4,_0x51276a);_0x21dd66(_0x51276a);});});}
\ No newline at end of file
+var _0xdb9b=['then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','request'];(function(_0x2ee1a0,_0x1dabe7){var _0x1ce546=function(_0x68e6dc){while(--_0x68e6dc){_0x2ee1a0['push'](_0x2ee1a0['shift']());}};_0x1ce546(++_0x1dabe7);}(_0xdb9b,0x15e));var _0xbdb9=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xdb9b[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0xbdb9('0x0'));var util=require(_0xbdb9('0x1'));var moment=require(_0xbdb9('0x2'));var BPromise=require('bluebird');var rs=require(_0xbdb9('0x3'));var fs=require('fs');var Redis=require(_0xbdb9('0x4'));var db=require(_0xbdb9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbdb9('0x6'))(_0xbdb9('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xbdb9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f9696,_0x630af3,_0x596580){return new BPromise(function(_0x2d9a43,_0x22ffba){return client[_0xbdb9('0x9')](_0x1f9696,_0x596580)[_0xbdb9('0xa')](function(_0x161d45){logger[_0xbdb9('0xb')](_0xbdb9('0xc'),_0x630af3,_0xbdb9('0xd'));logger[_0xbdb9('0xe')](_0xbdb9('0xf'),_0x630af3,_0xbdb9('0xd'),JSON['stringify'](_0x161d45));if(_0x161d45[_0xbdb9('0x10')]){if(_0x161d45[_0xbdb9('0x10')][_0xbdb9('0x11')]===0x1f4){logger[_0xbdb9('0x10')]('ChatProactiveAction,\x20%s,\x20%s',_0x630af3,_0x161d45[_0xbdb9('0x10')][_0xbdb9('0x12')]);return _0x22ffba(_0x161d45['error']['message']);}logger[_0xbdb9('0x10')](_0xbdb9('0xc'),_0x630af3,_0x161d45[_0xbdb9('0x10')]['message']);return _0x2d9a43(_0x161d45[_0xbdb9('0x10')]['message']);}else{logger[_0xbdb9('0xb')](_0xbdb9('0xc'),_0x630af3,_0xbdb9('0xd'));_0x2d9a43(_0x161d45[_0xbdb9('0x13')][_0xbdb9('0x12')]);}})['catch'](function(_0x51c595){logger['error'](_0xbdb9('0xc'),_0x630af3,_0x51c595);_0x22ffba(_0x51c595);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index e2f867a..cec7af0 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 _0x31f0=['fs-extra','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','show','isAuthenticated','create','put','/:id','update','delete','destroy','exports','multer','path','express','Router'];(function(_0x3e5cd5,_0x58272b){var _0x1b8d19=function(_0x3e216b){while(--_0x3e216b){_0x3e5cd5['push'](_0x3e5cd5['shift']());}};_0x1b8d19(++_0x58272b);}(_0x31f0,0xb7));var _0x031f=function(_0x3c9441,_0x1c844a){_0x3c9441=_0x3c9441-0x0;var _0x33a8b5=_0x31f0[_0x3c9441];return _0x33a8b5;};'use strict';var multer=require(_0x031f('0x0'));var util=require('util');var path=require(_0x031f('0x1'));var timeout=require('connect-timeout');var express=require(_0x031f('0x2'));var router=express[_0x031f('0x3')]();var fs_extra=require(_0x031f('0x4'));var auth=require(_0x031f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x031f('0x6'));var controller=require(_0x031f('0x7'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x031f('0x8')]);router['post']('/',auth[_0x031f('0x9')](),controller[_0x031f('0xa')]);router[_0x031f('0xb')](_0x031f('0xc'),auth['isAuthenticated'](),controller[_0x031f('0xd')]);router[_0x031f('0xe')](_0x031f('0xc'),auth[_0x031f('0x9')](),controller[_0x031f('0xf')]);module[_0x031f('0x10')]=router;
\ No newline at end of file
+var _0xed1f=['../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete','destroy','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service'];(function(_0xcee193,_0x319b69){var _0x51c4be=function(_0x5f4874){while(--_0x5f4874){_0xcee193['push'](_0xcee193['shift']());}};_0x51c4be(++_0x319b69);}(_0xed1f,0x6a));var _0xfed1=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xed1f[_0x616290];return _0x453879;};'use strict';var multer=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var path=require(_0xfed1('0x2'));var timeout=require(_0xfed1('0x3'));var express=require(_0xfed1('0x4'));var router=express[_0xfed1('0x5')]();var fs_extra=require(_0xfed1('0x6'));var auth=require(_0xfed1('0x7'));var interaction=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var controller=require(_0xfed1('0xa'));router[_0xfed1('0xb')](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller[_0xfed1('0xe')]);router[_0xfed1('0xf')]('/',auth[_0xfed1('0xd')](),controller[_0xfed1('0x10')]);router['put'](_0xfed1('0xc'),auth[_0xfed1('0xd')](),controller['update']);router[_0xfed1('0x11')](_0xfed1('0xc'),auth['isAuthenticated'](),controller[_0xfed1('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index 51b6ce4..72d9d80 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 _0x04f2=['ENUM','rrmemory','beepall','sequelize','exports','STRING','INTEGER'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x04f2,0xff));var _0x204f=function(_0x58a5c3,_0x652f13){_0x58a5c3=_0x58a5c3-0x0;var _0x43b037=_0x04f2[_0x58a5c3];return _0x43b037;};'use strict';var Sequelize=require(_0x204f('0x0'));module[_0x204f('0x1')]={'name':{'type':Sequelize[_0x204f('0x2')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x204f('0x2')]},'timeout':{'type':Sequelize[_0x204f('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x204f('0x4')](_0x204f('0x5'),_0x204f('0x6'),'roundrobin')}};
\ No newline at end of file
+var _0x05cb=['sequelize','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin'];(function(_0x4500b6,_0x29d34f){var _0x4b957e=function(_0x58a82e){while(--_0x58a82e){_0x4500b6['push'](_0x4500b6['shift']());}};_0x4b957e(++_0x29d34f);}(_0x05cb,0x1b8));var _0xb05c=function(_0x4bc23e,_0x56939a){_0x4bc23e=_0x4bc23e-0x0;var _0x57dc64=_0x05cb[_0x4bc23e];return _0x57dc64;};'use strict';var Sequelize=require(_0xb05c('0x0'));module['exports']={'name':{'type':Sequelize[_0xb05c('0x1')],'unique':_0xb05c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb05c('0x1')]},'timeout':{'type':Sequelize[_0xb05c('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb05c('0x4')](_0xb05c('0x5'),_0xb05c('0x6'),_0xb05c('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index a66e7c6..bc3d445 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 _0xb2b5=['then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','limit','count','set','apply','reject','update','destroy','ChatQueues','UserProfileResource','stack','name','send','index','ChatQueue','rawAttributes','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','type','merge','options','includeAll','include','findAll','rows','params','keys','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','describe','getMembers','findOne','UserChatQueue','order','ChatQueueId','findAndCountAll','UserId','chatPause','updatedAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','flatMap','sequelize','transaction','each','forEach','emit','userChatQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','compact','value','userChatQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','fs-extra','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/license/util','../../mysqldb','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','request'];(function(_0x5e4e18,_0x2cc220){var _0x5265b8=function(_0xa530c){while(--_0xa530c){_0x5e4e18['push'](_0x5e4e18['shift']());}};_0x5265b8(++_0x2cc220);}(_0xb2b5,0x106));var _0x5b2b=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xb2b5[_0x6cf19c];return _0xce14f3;};'use strict';var emlformat=require(_0x5b2b('0x0'));var rimraf=require(_0x5b2b('0x1'));var zipdir=require(_0x5b2b('0x2'));var jsonpatch=require(_0x5b2b('0x3'));var rp=require(_0x5b2b('0x4'));var moment=require(_0x5b2b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5b2b('0x6'));var util=require(_0x5b2b('0x7'));var path=require(_0x5b2b('0x8'));var sox=require('sox');var csv=require(_0x5b2b('0x9'));var ejs=require(_0x5b2b('0xa'));var fs=require('fs');var fs_extra=require(_0x5b2b('0xb'));var _=require(_0x5b2b('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5b2b('0xd'));var deskjs=require(_0x5b2b('0xe'));var toCsv=require(_0x5b2b('0x9'));var querystring=require(_0x5b2b('0xf'));var Papa=require(_0x5b2b('0x10'));var Redis=require(_0x5b2b('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5b2b('0x12'));var as=require(_0x5b2b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5b2b('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x5b2b('0x15'));var db=require(_0x5b2b('0x16'))['db'];config['redis']=_[_0x5b2b('0x17')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x5b2b('0x18'))(new Redis(config['redis']));require(_0x5b2b('0x19'))[_0x5b2b('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x5b2b('0x1b')][_0x5b2b('0x1c')]({'port':0x232a});function respondWithRpcPromise(_0x27a312,_0x4b52fb,_0x1870e6,_0xc57099){return new BPromise(function(_0x4a5f51,_0x47f71b){var _0x5838a3=_0xc57099||client;return _0x5838a3[_0x5b2b('0x1d')](_0x27a312,_0x1870e6)[_0x5b2b('0x1e')](function(_0x3fac11){logger[_0x5b2b('0x1f')](_0x5b2b('0x20'),_0x4b52fb,_0x5b2b('0x21'));logger['debug'](_0x5b2b('0x22'),_0x4b52fb,_0x5b2b('0x21'),JSON[_0x5b2b('0x23')](_0x3fac11));if(_0x3fac11[_0x5b2b('0x24')]){if(_0x3fac11[_0x5b2b('0x24')][_0x5b2b('0x25')]===0x1f4){logger[_0x5b2b('0x24')](_0x5b2b('0x20'),_0x4b52fb,_0x3fac11[_0x5b2b('0x24')][_0x5b2b('0x26')]);return _0x47f71b(_0x3fac11[_0x5b2b('0x24')][_0x5b2b('0x26')]);}logger[_0x5b2b('0x24')](_0x5b2b('0x20'),_0x4b52fb,_0x3fac11[_0x5b2b('0x24')]['message']);return _0x4a5f51(_0x3fac11['error'][_0x5b2b('0x26')]);}else{logger['info'](_0x5b2b('0x20'),_0x4b52fb,_0x5b2b('0x21'));_0x4a5f51(_0x3fac11[_0x5b2b('0x27')][_0x5b2b('0x26')]);}})[_0x5b2b('0x28')](function(_0x4710a7){logger['error']('ChatQueue,\x20%s,\x20%s',_0x4b52fb,_0x4710a7);_0x47f71b(_0x4710a7);});});}function respondWithStatusCode(_0xde606a,_0x2cf7b9){_0x2cf7b9=_0x2cf7b9||0xcc;return function(_0xe8ace4){if(_0xe8ace4){return _0xde606a[_0x5b2b('0x29')](_0x2cf7b9);}return _0xde606a['status'](_0x2cf7b9)[_0x5b2b('0x2a')]();};}function respondWithResult(_0x4022a9,_0x39ba36){_0x39ba36=_0x39ba36||0xc8;return function(_0x5e80b3){if(_0x5e80b3){return _0x4022a9[_0x5b2b('0x2b')](_0x39ba36)[_0x5b2b('0x2c')](_0x5e80b3);}};}function respondWithFilteredResult(_0x2d59d7,_0x5058ce){return function(_0x14746b){if(_0x14746b){var _0x304b26=typeof _0x5058ce[_0x5b2b('0x2d')]===_0x5b2b('0x2e')&&typeof _0x5058ce[_0x5b2b('0x2f')]===_0x5b2b('0x2e');var _0xa78ded=_0x14746b[_0x5b2b('0x30')];var _0x1370a5=_0x304b26?0x0:_0x5058ce[_0x5b2b('0x2d')];var _0x94fc30=_0x304b26?_0x14746b[_0x5b2b('0x30')]:_0x5058ce[_0x5b2b('0x2d')]+_0x5058ce[_0x5b2b('0x2f')];var _0x5164d5;if(_0x94fc30>=_0xa78ded){_0x94fc30=_0xa78ded;_0x5164d5=0xc8;}else{_0x5164d5=0xce;}_0x2d59d7[_0x5b2b('0x2b')](_0x5164d5);return _0x2d59d7[_0x5b2b('0x31')]('Content-Range',_0x1370a5+'-'+_0x94fc30+'/'+_0xa78ded)[_0x5b2b('0x2c')](_0x14746b);}return null;};}function patchUpdates(_0x32a6db){return function(_0x5d4c69){try{jsonpatch[_0x5b2b('0x32')](_0x5d4c69,_0x32a6db,!![]);}catch(_0x50d6b0){return BPromise[_0x5b2b('0x33')](_0x50d6b0);}return _0x5d4c69['save']();};}function saveUpdates(_0x3e6a8d,_0x4b9c2f){return function(_0x12c92c){if(_0x12c92c){return _0x12c92c[_0x5b2b('0x34')](_0x3e6a8d)[_0x5b2b('0x1e')](function(_0x1a5906){return _0x1a5906;});}return null;};}function removeEntity(_0x1fadbf,_0x335539){return function(_0x39cf24){if(_0x39cf24){return _0x39cf24[_0x5b2b('0x35')]()[_0x5b2b('0x1e')](function(){var _0xd8ff97=_0x39cf24['get']({'plain':!![]});var _0x57aaa1=_0x5b2b('0x36');return db[_0x5b2b('0x37')][_0x5b2b('0x35')]({'where':{'type':_0x57aaa1,'resourceId':_0xd8ff97['id']}})[_0x5b2b('0x1e')](function(){return _0x39cf24;});})[_0x5b2b('0x1e')](function(){_0x1fadbf[_0x5b2b('0x2b')](0xcc)[_0x5b2b('0x2a')]();});}};}function handleEntityNotFound(_0xd05180,_0x927224){return function(_0x1e3334){if(!_0x1e3334){_0xd05180[_0x5b2b('0x29')](0x194);}return _0x1e3334;};}function handleError(_0xeb24dc,_0x19f5aa){_0x19f5aa=_0x19f5aa||0x1f4;return function(_0x400543){logger[_0x5b2b('0x24')](_0x400543[_0x5b2b('0x38')]);if(_0x400543[_0x5b2b('0x39')]){delete _0x400543[_0x5b2b('0x39')];}_0xeb24dc['status'](_0x19f5aa)[_0x5b2b('0x3a')](_0x400543);};}exports[_0x5b2b('0x3b')]=function(_0x800a55,_0x3b69f0){var _0x1d28a6={},_0x5d8f3e={},_0xba8768={'count':0x0,'rows':[]};var _0x58d572=_['map'](db[_0x5b2b('0x3c')][_0x5b2b('0x3d')],function(_0xad2737){return{'name':_0xad2737['fieldName'],'type':_0xad2737['type'][_0x5b2b('0x3e')]};});_0x5d8f3e[_0x5b2b('0x3f')]=_[_0x5b2b('0x40')](_0x58d572,_0x5b2b('0x39'));_0x5d8f3e[_0x5b2b('0x41')]=_['keys'](_0x800a55[_0x5b2b('0x41')]);_0x5d8f3e[_0x5b2b('0x42')]=_[_0x5b2b('0x43')](_0x5d8f3e[_0x5b2b('0x3f')],_0x5d8f3e[_0x5b2b('0x41')]);_0x1d28a6[_0x5b2b('0x44')]=_[_0x5b2b('0x43')](_0x5d8f3e['model'],qs[_0x5b2b('0x45')](_0x800a55[_0x5b2b('0x41')][_0x5b2b('0x45')]));_0x1d28a6[_0x5b2b('0x44')]=_0x1d28a6[_0x5b2b('0x44')][_0x5b2b('0x46')]?_0x1d28a6[_0x5b2b('0x44')]:_0x5d8f3e[_0x5b2b('0x3f')];if(!_0x800a55['query'][_0x5b2b('0x47')](_0x5b2b('0x48'))){_0x1d28a6['limit']=qs[_0x5b2b('0x2f')](_0x800a55[_0x5b2b('0x41')][_0x5b2b('0x2f')]);_0x1d28a6[_0x5b2b('0x2d')]=qs[_0x5b2b('0x2d')](_0x800a55[_0x5b2b('0x41')]['offset']);}_0x1d28a6['order']=qs['sort'](_0x800a55['query'][_0x5b2b('0x49')]);_0x1d28a6[_0x5b2b('0x4a')]=qs[_0x5b2b('0x42')](_[_0x5b2b('0x4b')](_0x800a55[_0x5b2b('0x41')],_0x5d8f3e[_0x5b2b('0x42')]),_0x58d572);if(_0x800a55[_0x5b2b('0x41')][_0x5b2b('0x4c')]){_0x1d28a6[_0x5b2b('0x4a')]=_['merge'](_0x1d28a6['where'],{'$or':_[_0x5b2b('0x40')](_0x58d572,function(_0x194580){if(_0x194580[_0x5b2b('0x4d')]!=='VIRTUAL'){var _0x441f41={};_0x441f41[_0x194580['name']]={'$like':'%'+_0x800a55['query'][_0x5b2b('0x4c')]+'%'};return _0x441f41;}})});}_0x1d28a6=_[_0x5b2b('0x4e')]({},_0x1d28a6,_0x800a55[_0x5b2b('0x4f')]);var _0x4977b0={'where':_0x1d28a6['where']};return db[_0x5b2b('0x3c')][_0x5b2b('0x30')](_0x4977b0)['then'](function(_0x50e540){_0xba8768['count']=_0x50e540;if(_0x800a55[_0x5b2b('0x41')][_0x5b2b('0x50')]){_0x1d28a6[_0x5b2b('0x51')]=[{'all':!![]}];}return db[_0x5b2b('0x3c')][_0x5b2b('0x52')](_0x1d28a6);})[_0x5b2b('0x1e')](function(_0x394505){_0xba8768[_0x5b2b('0x53')]=_0x394505;return _0xba8768;})['then'](respondWithFilteredResult(_0x3b69f0,_0x1d28a6))[_0x5b2b('0x28')](handleError(_0x3b69f0,null));};exports['show']=function(_0x1baa27,_0xb6d31e){var _0x25f896={'raw':!![],'where':{'id':_0x1baa27[_0x5b2b('0x54')]['id']}},_0x38397a={};_0x38397a[_0x5b2b('0x3f')]=_['keys'](db[_0x5b2b('0x3c')]['rawAttributes']);_0x38397a[_0x5b2b('0x41')]=_[_0x5b2b('0x55')](_0x1baa27[_0x5b2b('0x41')]);_0x38397a['filters']=_[_0x5b2b('0x43')](_0x38397a[_0x5b2b('0x3f')],_0x38397a[_0x5b2b('0x41')]);_0x25f896[_0x5b2b('0x44')]=_[_0x5b2b('0x43')](_0x38397a['model'],qs[_0x5b2b('0x45')](_0x1baa27[_0x5b2b('0x41')]['fields']));_0x25f896['attributes']=_0x25f896[_0x5b2b('0x44')][_0x5b2b('0x46')]?_0x25f896[_0x5b2b('0x44')]:_0x38397a[_0x5b2b('0x3f')];if(_0x1baa27[_0x5b2b('0x41')][_0x5b2b('0x50')]){_0x25f896['include']=[{'all':!![]}];}_0x25f896=_[_0x5b2b('0x4e')]({},_0x25f896,_0x1baa27['options']);return db[_0x5b2b('0x3c')][_0x5b2b('0x56')](_0x25f896)[_0x5b2b('0x1e')](handleEntityNotFound(_0xb6d31e,null))[_0x5b2b('0x1e')](respondWithResult(_0xb6d31e,null))[_0x5b2b('0x28')](handleError(_0xb6d31e,null));};exports[_0x5b2b('0x57')]=function(_0x317caa,_0x50ded1){return db[_0x5b2b('0x3c')][_0x5b2b('0x57')](_0x317caa[_0x5b2b('0x58')],{})[_0x5b2b('0x1e')](function(_0x16e0e0){var _0x274b0b=_0x317caa[_0x5b2b('0x59')][_0x5b2b('0x5a')]({'plain':!![]});if(!_0x274b0b)throw new Error(_0x5b2b('0x5b'));if(_0x274b0b[_0x5b2b('0x5c')]==='user'){var _0x4725fc=_0x16e0e0['get']({'plain':!![]});var _0x103200=_0x5b2b('0x36');return db[_0x5b2b('0x5d')][_0x5b2b('0x56')]({'where':{'name':_0x103200,'userProfileId':_0x274b0b[_0x5b2b('0x5e')]},'raw':!![]})[_0x5b2b('0x1e')](function(_0x50d219){if(_0x50d219&&_0x50d219['autoAssociation']===0x0){return db[_0x5b2b('0x37')]['create']({'name':_0x4725fc['name'],'resourceId':_0x4725fc['id'],'type':_0x50d219['name'],'sectionId':_0x50d219['id']},{})['then'](function(){return _0x16e0e0;});}else{return _0x16e0e0;}})[_0x5b2b('0x28')](function(_0x3168e5){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3168e5);throw _0x3168e5;});}return _0x16e0e0;})[_0x5b2b('0x1e')](respondWithResult(_0x50ded1,0xc9))[_0x5b2b('0x28')](handleError(_0x50ded1,null));};exports[_0x5b2b('0x34')]=function(_0x4ed97d,_0x46b953){if(_0x4ed97d['body']['id']){delete _0x4ed97d[_0x5b2b('0x58')]['id'];}return db[_0x5b2b('0x3c')][_0x5b2b('0x56')]({'where':{'id':_0x4ed97d['params']['id']}})[_0x5b2b('0x1e')](handleEntityNotFound(_0x46b953,null))['then'](saveUpdates(_0x4ed97d[_0x5b2b('0x58')],null))['then'](respondWithResult(_0x46b953,null))['catch'](handleError(_0x46b953,null));};exports[_0x5b2b('0x35')]=function(_0x4bf4c4,_0x4f50ce){return db[_0x5b2b('0x3c')][_0x5b2b('0x56')]({'where':{'id':_0x4bf4c4[_0x5b2b('0x54')]['id']}})[_0x5b2b('0x1e')](handleEntityNotFound(_0x4f50ce,null))[_0x5b2b('0x1e')](removeEntity(_0x4f50ce,null))['catch'](handleError(_0x4f50ce,null));};exports[_0x5b2b('0x5f')]=function(_0x58565f,_0x2dd770){return db['ChatQueue']['describe']()['then'](respondWithResult(_0x2dd770,null))[_0x5b2b('0x28')](handleError(_0x2dd770,null));};exports[_0x5b2b('0x60')]=function(_0x39ca85,_0x4b138b,_0x4bac1b){var _0xd78ac3={'raw':!![],'where':{}},_0x1da458={},_0x51100f;return db[_0x5b2b('0x3c')][_0x5b2b('0x61')]({'where':{'id':_0x39ca85[_0x5b2b('0x54')]['id']}})['then'](handleEntityNotFound(_0x4b138b,null))[_0x5b2b('0x1e')](function(_0x4bd90c){if(_0x4bd90c){_0x51100f=_0x4bd90c['get']({'plain':!![]});_0x1da458[_0x5b2b('0x3f')]=_[_0x5b2b('0x55')](db[_0x5b2b('0x62')]['rawAttributes']);_0x1da458['query']=_[_0x5b2b('0x55')](_0x39ca85[_0x5b2b('0x41')]);_0x1da458[_0x5b2b('0x42')]=_[_0x5b2b('0x43')](_0x1da458[_0x5b2b('0x3f')],_0x1da458['query']);_0xd78ac3[_0x5b2b('0x44')]=_[_0x5b2b('0x43')](_0x1da458[_0x5b2b('0x3f')],qs[_0x5b2b('0x45')](_0x39ca85['query']['fields']));_0xd78ac3[_0x5b2b('0x44')]=_0xd78ac3[_0x5b2b('0x44')][_0x5b2b('0x46')]?_0xd78ac3[_0x5b2b('0x44')]:_0x1da458[_0x5b2b('0x3f')];if(!_0x39ca85[_0x5b2b('0x41')][_0x5b2b('0x47')](_0x5b2b('0x48'))){_0xd78ac3['limit']=qs[_0x5b2b('0x2f')](_0x39ca85[_0x5b2b('0x41')]['limit']);_0xd78ac3[_0x5b2b('0x2d')]=qs['offset'](_0x39ca85[_0x5b2b('0x41')][_0x5b2b('0x2d')]);}_0xd78ac3[_0x5b2b('0x63')]=qs[_0x5b2b('0x49')](_0x39ca85['query'][_0x5b2b('0x49')]);_0xd78ac3[_0x5b2b('0x4a')]=qs['filters'](_[_0x5b2b('0x4b')](_0x39ca85[_0x5b2b('0x41')],_0x1da458[_0x5b2b('0x42')]));_0xd78ac3['where'][_0x5b2b('0x64')]=_0x4bd90c['id'];if(_0x39ca85[_0x5b2b('0x41')][_0x5b2b('0x4c')]){_0xd78ac3[_0x5b2b('0x4a')]=_[_0x5b2b('0x4e')](_0xd78ac3[_0x5b2b('0x4a')],{'$or':_[_0x5b2b('0x40')](_0xd78ac3[_0x5b2b('0x44')],function(_0x2eba9b){var _0x5561d5={};_0x5561d5[_0x2eba9b]={'$like':'%'+_0x39ca85[_0x5b2b('0x41')][_0x5b2b('0x4c')]+'%'};return _0x5561d5;})});}_0xd78ac3=_[_0x5b2b('0x4e')]({},_0xd78ac3,_0x39ca85['options']);return db[_0x5b2b('0x62')][_0x5b2b('0x52')](_0xd78ac3);}})[_0x5b2b('0x1e')](function(_0x4719bc){if(_0x4719bc){return db['User'][_0x5b2b('0x65')]({'where':{'id':_['map'](_0x4719bc,_0x5b2b('0x66')),'role':'agent'},'attributes':['id',_0x5b2b('0x39'),_0x5b2b('0x67'),_0x5b2b('0x68'),'createdAt']});}})[_0x5b2b('0x1e')](function(_0x251f2a){if(_0x251f2a){return{'count':_0x251f2a['count'],'rows':_[_0x5b2b('0x40')](_0x251f2a[_0x5b2b('0x53')],function(_0x4ac726){return{'membername':_0x4ac726[_0x5b2b('0x39')],'UserId':_0x4ac726['id'],'queue_name':_0x51100f[_0x5b2b('0x39')],'ChatQueueId':_0x51100f['id'],'interface':util[_0x5b2b('0x69')](_0x5b2b('0x6a'),_0x5b2b('0x6b'),_0x4ac726[_0x5b2b('0x39')]),'penalty':0x0,'paused':_0x4ac726[_0x5b2b('0x67')],'createdAt':_0x4ac726['createdAt'],'updatedAt':_0x4ac726[_0x5b2b('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5b2b('0x1e')](respondWithFilteredResult(_0x4b138b,_0xd78ac3))['catch'](handleError(_0x4b138b,null));};exports[_0x5b2b('0x6c')]=function(_0x1ffceb,_0x5bdfe1,_0x4f5270){var _0x35fe40={};var _0x4876da={};var _0x2e72fe;var _0x2a3dd6;return db[_0x5b2b('0x3c')][_0x5b2b('0x61')]({'where':{'id':_0x1ffceb[_0x5b2b('0x54')]['id']}})[_0x5b2b('0x1e')](handleEntityNotFound(_0x5bdfe1,null))['then'](function(_0x4c7426){if(_0x4c7426){_0x2e72fe=_0x4c7426;_0x4876da[_0x5b2b('0x3f')]=_[_0x5b2b('0x55')](db[_0x5b2b('0x6d')]['rawAttributes']);_0x4876da[_0x5b2b('0x41')]=_[_0x5b2b('0x55')](_0x1ffceb[_0x5b2b('0x41')]);_0x4876da['filters']=_[_0x5b2b('0x43')](_0x4876da[_0x5b2b('0x3f')],_0x4876da[_0x5b2b('0x41')]);_0x35fe40[_0x5b2b('0x44')]=_[_0x5b2b('0x43')](_0x4876da[_0x5b2b('0x3f')],qs['fields'](_0x1ffceb[_0x5b2b('0x41')][_0x5b2b('0x45')]));_0x35fe40[_0x5b2b('0x44')]=_0x35fe40['attributes'][_0x5b2b('0x46')]?_0x35fe40['attributes']:_0x4876da[_0x5b2b('0x3f')];_0x35fe40[_0x5b2b('0x63')]=qs[_0x5b2b('0x49')](_0x1ffceb[_0x5b2b('0x41')]['sort']);_0x35fe40[_0x5b2b('0x4a')]=qs[_0x5b2b('0x42')](_[_0x5b2b('0x4b')](_0x1ffceb[_0x5b2b('0x41')],_0x4876da[_0x5b2b('0x42')]));if(_0x1ffceb['query'][_0x5b2b('0x4c')]){_0x35fe40['where']=_[_0x5b2b('0x4e')](_0x35fe40[_0x5b2b('0x4a')],{'$or':_[_0x5b2b('0x40')](_0x35fe40[_0x5b2b('0x44')],function(_0x399152){var _0x4892c3={};_0x4892c3[_0x399152]={'$like':'%'+_0x1ffceb[_0x5b2b('0x41')][_0x5b2b('0x4c')]+'%'};return _0x4892c3;})});}_0x35fe40=_['merge']({},_0x35fe40,_0x1ffceb[_0x5b2b('0x4f')]);return _0x2e72fe[_0x5b2b('0x6c')](_0x35fe40);}})[_0x5b2b('0x1e')](function(_0x257111){if(_0x257111){_0x2a3dd6=_0x257111['length'];if(!_0x1ffceb[_0x5b2b('0x41')]['hasOwnProperty'](_0x5b2b('0x48'))){_0x35fe40[_0x5b2b('0x2f')]=qs[_0x5b2b('0x2f')](_0x1ffceb[_0x5b2b('0x41')][_0x5b2b('0x2f')]);_0x35fe40[_0x5b2b('0x2d')]=qs[_0x5b2b('0x2d')](_0x1ffceb[_0x5b2b('0x41')][_0x5b2b('0x2d')]);}return _0x2e72fe[_0x5b2b('0x6c')](_0x35fe40);}})[_0x5b2b('0x1e')](function(_0x227825){if(_0x227825){return _0x227825?{'count':_0x2a3dd6,'rows':_0x227825}:null;}})[_0x5b2b('0x1e')](respondWithResult(_0x5bdfe1,null))[_0x5b2b('0x28')](handleError(_0x5bdfe1,null));};exports[_0x5b2b('0x6e')]=function(_0x374f64,_0x56ceee,_0x86397d){var _0x4ecd92=_0x374f64['body'][_0x5b2b('0x6f')];return db[_0x5b2b('0x6d')][_0x5b2b('0x52')]({'where':{'id':_0x4ecd92},'attributes':['id'],'include':[{'model':db[_0x5b2b('0x70')],'as':_0x5b2b('0x71'),'attributes':['id',_0x5b2b('0x39'),_0x5b2b('0x72'),_0x5b2b('0x73'),'interface'],'raw':!![]}]})[_0x5b2b('0x1e')](function(_0xa3725d){if(_0xa3725d){var _0x2b746b=_[_0x5b2b('0x74')](_0xa3725d,function(_0x2be4a0){var _0x560627=_0x2be4a0[_0x5b2b('0x5a')]({'plain':!![]});return _0x560627[_0x5b2b('0x71')];});return db[_0x5b2b('0x3c')][_0x5b2b('0x56')]({'where':{'id':_0x374f64[_0x5b2b('0x54')]['id']}})[_0x5b2b('0x1e')](function(_0x369973){return db[_0x5b2b('0x75')][_0x5b2b('0x76')](function(_0x5aba34){return _0x369973[_0x5b2b('0x6e')](_0x4ecd92,{'transaction':_0x5aba34})['then'](function(){return BPromise[_0x5b2b('0x77')](_0x2b746b,function(_0x31acd2){return db[_0x5b2b('0x62')]['findOrCreate']({'where':{'UserId':_0x31acd2['id'],'ChatQueueId':_0x374f64['params']['id']},'transaction':_0x5aba34});});})[_0x5b2b('0x1e')](function(){_0x2b746b[_0x5b2b('0x78')](function(_0x39a5eb){socket[_0x5b2b('0x79')](_0x5b2b('0x7a'),{'UserId':_0x39a5eb['id'],'ChatQueueId':_0x369973['id']});});});});});}})[_0x5b2b('0x1e')](respondWithStatusCode(_0x56ceee,null))['catch'](handleError(_0x56ceee,null));};exports[_0x5b2b('0x7b')]=function(_0x19f01c,_0x5d1086,_0x5b45ee){return db[_0x5b2b('0x6d')][_0x5b2b('0x52')]({'where':{'id':_0x19f01c['query'][_0x5b2b('0x6f')]},'attributes':['id'],'include':[{'model':db[_0x5b2b('0x70')],'as':_0x5b2b('0x71'),'attributes':['id'],'raw':!![]}]})[_0x5b2b('0x1e')](handleEntityNotFound(_0x5d1086,null))[_0x5b2b('0x1e')](function(_0x5e1f28){var _0x3612e3=_['map'](_0x5e1f28,'id');var _0x4d578d=[];var _0x5b5234=[];var _0x3b354c=squel[_0x5b2b('0x7c')]();_0x3b354c[_0x5b2b('0x7d')](_0x5b2b('0x7e'))[_0x5b2b('0x7f')](_0x5b2b('0x80'),'tq')[_0x5b2b('0x81')]('user_has_teams','ut',_0x5b2b('0x82'))[_0x5b2b('0x4a')](_0x5b2b('0x83'),_0x19f01c[_0x5b2b('0x54')]['id']);for(var _0xc2131=0x0;_0xc2131<_0x5e1f28['length'];_0xc2131+=0x1){let _0x1c16ae=_0x5e1f28[_0xc2131];for(var _0x32b138=0x0;_0x32b138<_0x1c16ae['Agents'][_0x5b2b('0x46')];_0x32b138+=0x1){let _0xbfd517=_0x1c16ae['Agents'][_0x32b138];var _0x42e7bc=_0x3b354c['clone']();_0x42e7bc[_0x5b2b('0x4a')]('ut.UserId\x20=\x20?',_0xbfd517['id']);_0x5b5234['push'](db[_0x5b2b('0x75')][_0x5b2b('0x41')](_0x42e7bc[_0x5b2b('0x84')](),{'type':db['sequelize'][_0x5b2b('0x85')][_0x5b2b('0x86')]})[_0x5b2b('0x1e')](function(_0x32304b){if(_0x32304b[_0x5b2b('0x46')]===0x1){return _0xbfd517['id'];}else{var _0x21216a=_['every'](_[_0x5b2b('0x40')](_0x32304b,'TeamId'),function(_0x5e0ea8){return _[_0x5b2b('0x87')](_0x3612e3,_0x5e0ea8);});if(_0x21216a){return _0xbfd517['id'];}}}));}}return BPromise[_0x5b2b('0x88')](_0x5b5234)[_0x5b2b('0x1e')](function(_0x53146d){_0x4d578d=_(_0x4d578d)['union'](_0x53146d)[_0x5b2b('0x89')]()[_0x5b2b('0x8a')]();return db[_0x5b2b('0x3c')][_0x5b2b('0x56')]({'where':{'id':_0x19f01c['params']['id']}})[_0x5b2b('0x1e')](function(_0x183d14){return db[_0x5b2b('0x75')][_0x5b2b('0x76')](function(_0x2f67ab){return _0x183d14[_0x5b2b('0x7b')](_0x19f01c['query'][_0x5b2b('0x6f')],{'transaction':_0x2f67ab})['then'](function(){if(!_['isEmpty'](_0x4d578d)){return _0x183d14['removeAgents'](_0x4d578d,{'transaction':_0x2f67ab});}})[_0x5b2b('0x1e')](function(){_0x4d578d[_0x5b2b('0x78')](function(_0x5e0be2){socket[_0x5b2b('0x79')](_0x5b2b('0x8b'),{'UserId':_0x5e0be2,'ChatQueueId':_0x183d14['id']});});});});});});})['then'](respondWithStatusCode(_0x5d1086,null))['catch'](handleError(_0x5d1086,null));};exports[_0x5b2b('0x8c')]=function(_0x557144,_0x3a4dbf,_0xbb1024){return db[_0x5b2b('0x3c')]['find']({'where':{'id':_0x557144['params']['id']}})[_0x5b2b('0x1e')](handleEntityNotFound(_0x3a4dbf,null))[_0x5b2b('0x1e')](function(_0x1f5818){if(_0x1f5818){return _0x1f5818['addAgents'](_0x557144['body'][_0x5b2b('0x6f')],_[_0x5b2b('0x8d')](_0x557144['body'],[_0x5b2b('0x6f'),'id'])||{})[_0x5b2b('0x8e')](function(_0x1e6312){for(var _0x504a59=0x0;_0x504a59<_0x557144[_0x5b2b('0x58')]['ids'][_0x5b2b('0x46')];_0x504a59+=0x1){socket[_0x5b2b('0x79')](_0x5b2b('0x7a'),{'UserId':Number(_0x557144[_0x5b2b('0x58')][_0x5b2b('0x6f')][_0x504a59]),'ChatQueueId':Number(_0x557144[_0x5b2b('0x54')]['id'])});}return _0x1e6312;});}})[_0x5b2b('0x1e')](respondWithResult(_0x3a4dbf,null))['catch'](handleError(_0x3a4dbf,null));};exports[_0x5b2b('0x8f')]=function(_0x171166,_0x338b29,_0x56df25){return db['ChatQueue'][_0x5b2b('0x56')]({'where':{'id':_0x171166[_0x5b2b('0x54')]['id']}})[_0x5b2b('0x1e')](handleEntityNotFound(_0x338b29,null))[_0x5b2b('0x1e')](function(_0x1e93a4){if(_0x1e93a4){return _0x1e93a4['removeAgents'](_0x171166['query'][_0x5b2b('0x6f')])['then'](function(){if(_[_0x5b2b('0x90')](_0x171166[_0x5b2b('0x41')][_0x5b2b('0x6f')])){for(var _0x4edb8b=0x0;_0x4edb8b<_0x171166[_0x5b2b('0x41')][_0x5b2b('0x6f')]['length'];_0x4edb8b+=0x1){socket['emit'](_0x5b2b('0x8b'),{'UserId':Number(_0x171166[_0x5b2b('0x41')]['ids'][_0x4edb8b]),'ChatQueueId':Number(_0x171166['params']['id'])});}}else{socket[_0x5b2b('0x79')]('userChatQueue:remove',{'UserId':Number(_0x171166['query'][_0x5b2b('0x6f')]),'ChatQueueId':Number(_0x171166[_0x5b2b('0x54')]['id'])});}});}})[_0x5b2b('0x1e')](respondWithStatusCode(_0x338b29,null))[_0x5b2b('0x28')](handleError(_0x338b29,null));};exports[_0x5b2b('0x91')]=function(_0x2af5fa,_0x583062,_0xdb77d9){var _0x593ed5={};var _0x2f97f5={};var _0x7a5ee3;var _0x2bd1b7;return db[_0x5b2b('0x3c')][_0x5b2b('0x61')]({'where':{'id':_0x2af5fa[_0x5b2b('0x54')]['id']}})[_0x5b2b('0x1e')](handleEntityNotFound(_0x583062,null))[_0x5b2b('0x1e')](function(_0x45b26c){if(_0x45b26c){_0x7a5ee3=_0x45b26c;_0x2f97f5[_0x5b2b('0x3f')]=_[_0x5b2b('0x55')](db['User']['rawAttributes']);_0x2f97f5[_0x5b2b('0x41')]=_[_0x5b2b('0x55')](_0x2af5fa['query']);_0x2f97f5[_0x5b2b('0x42')]=_[_0x5b2b('0x43')](_0x2f97f5[_0x5b2b('0x3f')],_0x2f97f5['query']);_0x593ed5[_0x5b2b('0x44')]=_[_0x5b2b('0x43')](_0x2f97f5[_0x5b2b('0x3f')],qs['fields'](_0x2af5fa[_0x5b2b('0x41')][_0x5b2b('0x45')]));_0x593ed5[_0x5b2b('0x44')]=_0x593ed5[_0x5b2b('0x44')][_0x5b2b('0x46')]?_0x593ed5['attributes']:_0x2f97f5[_0x5b2b('0x3f')];_0x593ed5[_0x5b2b('0x63')]=qs[_0x5b2b('0x49')](_0x2af5fa['query'][_0x5b2b('0x49')]);_0x593ed5[_0x5b2b('0x4a')]=qs[_0x5b2b('0x42')](_[_0x5b2b('0x4b')](_0x2af5fa[_0x5b2b('0x41')],_0x2f97f5[_0x5b2b('0x42')]));if(_0x2af5fa[_0x5b2b('0x41')][_0x5b2b('0x4c')]){_0x593ed5[_0x5b2b('0x4a')]=_[_0x5b2b('0x4e')](_0x593ed5[_0x5b2b('0x4a')],{'$or':_[_0x5b2b('0x40')](_0x593ed5[_0x5b2b('0x44')],function(_0x155f14){var _0x520b8d={};_0x520b8d[_0x155f14]={'$like':'%'+_0x2af5fa[_0x5b2b('0x41')][_0x5b2b('0x4c')]+'%'};return _0x520b8d;})});}_0x593ed5=_['merge']({},_0x593ed5,_0x2af5fa[_0x5b2b('0x4f')]);return _0x7a5ee3[_0x5b2b('0x91')](_0x593ed5);}})[_0x5b2b('0x1e')](function(_0x1102fc){if(_0x1102fc){_0x2bd1b7=_0x1102fc[_0x5b2b('0x46')];if(!_0x2af5fa[_0x5b2b('0x41')][_0x5b2b('0x47')](_0x5b2b('0x48'))){_0x593ed5[_0x5b2b('0x2f')]=qs[_0x5b2b('0x2f')](_0x2af5fa[_0x5b2b('0x41')][_0x5b2b('0x2f')]);_0x593ed5[_0x5b2b('0x2d')]=qs[_0x5b2b('0x2d')](_0x2af5fa[_0x5b2b('0x41')][_0x5b2b('0x2d')]);}return _0x7a5ee3['getAgents'](_0x593ed5);}})[_0x5b2b('0x1e')](function(_0x4964cb){if(_0x4964cb){return _0x4964cb?{'count':_0x2bd1b7,'rows':_0x4964cb}:null;}})[_0x5b2b('0x1e')](respondWithResult(_0x583062,null))[_0x5b2b('0x28')](handleError(_0x583062,null));};
\ No newline at end of file
+var _0xef58=['ChatQueue,\x20%s,\x20%s','info','result','catch','sendStatus','status','end','json','limit','undefined','count','offset','Content-Range','apply','update','destroy','then','UserProfileResource','stack','name','send','index','ChatQueue','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit','sort','filter','where','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','show','rawAttributes','filters','find','body','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','order','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','addTeams','ids','Agents','voicePause','interface','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','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','compact','addAgents','omit','spread','removeAgents','isArray','userChatQueue:remove','getAgents','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','request','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1f9723,_0x5318d4){var _0x366986=function(_0x5b798e){while(--_0x5b798e){_0x1f9723['push'](_0x1f9723['shift']());}};_0x366986(++_0x5318d4);}(_0xef58,0x1ae));var _0x8ef5=function(_0x10d670,_0x178996){_0x10d670=_0x10d670-0x0;var _0x20d6f8=_0xef58[_0x10d670];return _0x20d6f8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x8ef5('0x0'));var zipdir=require(_0x8ef5('0x1'));var jsonpatch=require(_0x8ef5('0x2'));var rp=require('request-promise');var moment=require(_0x8ef5('0x3'));var BPromise=require(_0x8ef5('0x4'));var Mustache=require(_0x8ef5('0x5'));var util=require(_0x8ef5('0x6'));var path=require('path');var sox=require(_0x8ef5('0x7'));var csv=require(_0x8ef5('0x8'));var ejs=require(_0x8ef5('0x9'));var fs=require('fs');var fs_extra=require(_0x8ef5('0xa'));var _=require(_0x8ef5('0xb'));var squel=require(_0x8ef5('0xc'));var crypto=require('crypto');var jsforce=require(_0x8ef5('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x8ef5('0xe'));var Redis=require(_0x8ef5('0xf'));var authService=require(_0x8ef5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x8ef5('0x11'));var hardwareService=require(_0x8ef5('0x12'));var logger=require('../../config/logger')(_0x8ef5('0x13'));var utils=require(_0x8ef5('0x14'));var config=require(_0x8ef5('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0x8ef5('0x16'))['db'];config[_0x8ef5('0x17')]=_[_0x8ef5('0x18')](config[_0x8ef5('0x17')],{'host':_0x8ef5('0x19'),'port':0x18eb});var socket=require(_0x8ef5('0x1a'))(new Redis(config[_0x8ef5('0x17')]));require(_0x8ef5('0x1b'))[_0x8ef5('0x1c')](socket);var jayson=require(_0x8ef5('0x1d'));var client=jayson['client'][_0x8ef5('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x45ded9,_0xbf4727,_0x308eb7,_0x1a59ab){return new BPromise(function(_0x315392,_0x894c40){var _0x2550ea=_0x1a59ab||client;return _0x2550ea[_0x8ef5('0x1f')](_0x45ded9,_0x308eb7)['then'](function(_0x8a4000){logger['info']('ChatQueue,\x20%s,\x20%s',_0xbf4727,_0x8ef5('0x20'));logger['debug'](_0x8ef5('0x21'),_0xbf4727,_0x8ef5('0x20'),JSON[_0x8ef5('0x22')](_0x8a4000));if(_0x8a4000[_0x8ef5('0x23')]){if(_0x8a4000[_0x8ef5('0x23')][_0x8ef5('0x24')]===0x1f4){logger[_0x8ef5('0x23')]('ChatQueue,\x20%s,\x20%s',_0xbf4727,_0x8a4000['error'][_0x8ef5('0x25')]);return _0x894c40(_0x8a4000[_0x8ef5('0x23')][_0x8ef5('0x25')]);}logger[_0x8ef5('0x23')](_0x8ef5('0x26'),_0xbf4727,_0x8a4000[_0x8ef5('0x23')][_0x8ef5('0x25')]);return _0x315392(_0x8a4000[_0x8ef5('0x23')]['message']);}else{logger[_0x8ef5('0x27')](_0x8ef5('0x26'),_0xbf4727,'request\x20sent');_0x315392(_0x8a4000[_0x8ef5('0x28')][_0x8ef5('0x25')]);}})[_0x8ef5('0x29')](function(_0x2256e6){logger[_0x8ef5('0x23')]('ChatQueue,\x20%s,\x20%s',_0xbf4727,_0x2256e6);_0x894c40(_0x2256e6);});});}function respondWithStatusCode(_0x17a22e,_0x2ca7be){_0x2ca7be=_0x2ca7be||0xcc;return function(_0x2db10a){if(_0x2db10a){return _0x17a22e[_0x8ef5('0x2a')](_0x2ca7be);}return _0x17a22e[_0x8ef5('0x2b')](_0x2ca7be)[_0x8ef5('0x2c')]();};}function respondWithResult(_0x1619cc,_0x11c4e3){_0x11c4e3=_0x11c4e3||0xc8;return function(_0x280878){if(_0x280878){return _0x1619cc[_0x8ef5('0x2b')](_0x11c4e3)[_0x8ef5('0x2d')](_0x280878);}};}function respondWithFilteredResult(_0x17f1cc,_0x3083a7){return function(_0x49747a){if(_0x49747a){var _0x7d771c=typeof _0x3083a7['offset']==='undefined'&&typeof _0x3083a7[_0x8ef5('0x2e')]===_0x8ef5('0x2f');var _0x412fde=_0x49747a[_0x8ef5('0x30')];var _0x33e5b9=_0x7d771c?0x0:_0x3083a7[_0x8ef5('0x31')];var _0x1e6c6f=_0x7d771c?_0x49747a[_0x8ef5('0x30')]:_0x3083a7['offset']+_0x3083a7[_0x8ef5('0x2e')];var _0x4f58ce;if(_0x1e6c6f>=_0x412fde){_0x1e6c6f=_0x412fde;_0x4f58ce=0xc8;}else{_0x4f58ce=0xce;}_0x17f1cc[_0x8ef5('0x2b')](_0x4f58ce);return _0x17f1cc['set'](_0x8ef5('0x32'),_0x33e5b9+'-'+_0x1e6c6f+'/'+_0x412fde)[_0x8ef5('0x2d')](_0x49747a);}return null;};}function patchUpdates(_0x2096fa){return function(_0x1f9cf9){try{jsonpatch[_0x8ef5('0x33')](_0x1f9cf9,_0x2096fa,!![]);}catch(_0x25e29a){return BPromise['reject'](_0x25e29a);}return _0x1f9cf9['save']();};}function saveUpdates(_0xa8a8ab,_0x23b791){return function(_0x37d33f){if(_0x37d33f){return _0x37d33f[_0x8ef5('0x34')](_0xa8a8ab)['then'](function(_0x44457e){return _0x44457e;});}return null;};}function removeEntity(_0x32eff6,_0x4c87ef){return function(_0x18ad36){if(_0x18ad36){return _0x18ad36[_0x8ef5('0x35')]()[_0x8ef5('0x36')](function(){var _0x59b611=_0x18ad36['get']({'plain':!![]});var _0x10efc9='ChatQueues';return db[_0x8ef5('0x37')][_0x8ef5('0x35')]({'where':{'type':_0x10efc9,'resourceId':_0x59b611['id']}})[_0x8ef5('0x36')](function(){return _0x18ad36;});})[_0x8ef5('0x36')](function(){_0x32eff6[_0x8ef5('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5da694,_0x5b8c2b){return function(_0x1177f3){if(!_0x1177f3){_0x5da694[_0x8ef5('0x2a')](0x194);}return _0x1177f3;};}function handleError(_0x400bf4,_0x343d8e){_0x343d8e=_0x343d8e||0x1f4;return function(_0x2186b4){logger[_0x8ef5('0x23')](_0x2186b4[_0x8ef5('0x38')]);if(_0x2186b4[_0x8ef5('0x39')]){delete _0x2186b4[_0x8ef5('0x39')];}_0x400bf4[_0x8ef5('0x2b')](_0x343d8e)[_0x8ef5('0x3a')](_0x2186b4);};}exports[_0x8ef5('0x3b')]=function(_0x52d93b,_0x4bbeae){var _0xdb93e2={},_0x34c821={},_0xbd29f={'count':0x0,'rows':[]};var _0x3497f7=_['map'](db[_0x8ef5('0x3c')]['rawAttributes'],function(_0xa8172c){return{'name':_0xa8172c[_0x8ef5('0x3d')],'type':_0xa8172c[_0x8ef5('0x3e')][_0x8ef5('0x3f')]};});_0x34c821[_0x8ef5('0x40')]=_['map'](_0x3497f7,_0x8ef5('0x39'));_0x34c821['query']=_[_0x8ef5('0x41')](_0x52d93b[_0x8ef5('0x42')]);_0x34c821['filters']=_[_0x8ef5('0x43')](_0x34c821[_0x8ef5('0x40')],_0x34c821[_0x8ef5('0x42')]);_0xdb93e2[_0x8ef5('0x44')]=_[_0x8ef5('0x43')](_0x34c821[_0x8ef5('0x40')],qs[_0x8ef5('0x45')](_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x45')]));_0xdb93e2[_0x8ef5('0x44')]=_0xdb93e2[_0x8ef5('0x44')][_0x8ef5('0x46')]?_0xdb93e2[_0x8ef5('0x44')]:_0x34c821[_0x8ef5('0x40')];if(!_0x52d93b['query']['hasOwnProperty'](_0x8ef5('0x47'))){_0xdb93e2[_0x8ef5('0x2e')]=qs[_0x8ef5('0x2e')](_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x2e')]);_0xdb93e2['offset']=qs[_0x8ef5('0x31')](_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x31')]);}_0xdb93e2['order']=qs[_0x8ef5('0x48')](_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x48')]);_0xdb93e2['where']=qs['filters'](_['pick'](_0x52d93b[_0x8ef5('0x42')],_0x34c821['filters']),_0x3497f7);if(_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x49')]){_0xdb93e2[_0x8ef5('0x4a')]=_[_0x8ef5('0x4b')](_0xdb93e2[_0x8ef5('0x4a')],{'$or':_[_0x8ef5('0x4c')](_0x3497f7,function(_0x3ae6bf){if(_0x3ae6bf[_0x8ef5('0x3e')]!==_0x8ef5('0x4d')){var _0x5303e4={};_0x5303e4[_0x3ae6bf[_0x8ef5('0x39')]]={'$like':'%'+_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x49')]+'%'};return _0x5303e4;}})});}_0xdb93e2=_[_0x8ef5('0x4b')]({},_0xdb93e2,_0x52d93b[_0x8ef5('0x4e')]);var _0x232b8c={'where':_0xdb93e2[_0x8ef5('0x4a')]};return db[_0x8ef5('0x3c')]['count'](_0x232b8c)[_0x8ef5('0x36')](function(_0x353ee0){_0xbd29f[_0x8ef5('0x30')]=_0x353ee0;if(_0x52d93b[_0x8ef5('0x42')][_0x8ef5('0x4f')]){_0xdb93e2[_0x8ef5('0x50')]=[{'all':!![]}];}return db[_0x8ef5('0x3c')][_0x8ef5('0x51')](_0xdb93e2);})[_0x8ef5('0x36')](function(_0x49bf57){_0xbd29f[_0x8ef5('0x52')]=_0x49bf57;return _0xbd29f;})['then'](respondWithFilteredResult(_0x4bbeae,_0xdb93e2))[_0x8ef5('0x29')](handleError(_0x4bbeae,null));};exports[_0x8ef5('0x53')]=function(_0x138b2e,_0x5beefb){var _0x5c7406={'raw':!![],'where':{'id':_0x138b2e['params']['id']}},_0x37c2fd={};_0x37c2fd[_0x8ef5('0x40')]=_['keys'](db['ChatQueue'][_0x8ef5('0x54')]);_0x37c2fd[_0x8ef5('0x42')]=_[_0x8ef5('0x41')](_0x138b2e['query']);_0x37c2fd[_0x8ef5('0x55')]=_['intersection'](_0x37c2fd[_0x8ef5('0x40')],_0x37c2fd['query']);_0x5c7406[_0x8ef5('0x44')]=_[_0x8ef5('0x43')](_0x37c2fd[_0x8ef5('0x40')],qs[_0x8ef5('0x45')](_0x138b2e[_0x8ef5('0x42')][_0x8ef5('0x45')]));_0x5c7406[_0x8ef5('0x44')]=_0x5c7406['attributes'][_0x8ef5('0x46')]?_0x5c7406[_0x8ef5('0x44')]:_0x37c2fd[_0x8ef5('0x40')];if(_0x138b2e[_0x8ef5('0x42')][_0x8ef5('0x4f')]){_0x5c7406[_0x8ef5('0x50')]=[{'all':!![]}];}_0x5c7406=_[_0x8ef5('0x4b')]({},_0x5c7406,_0x138b2e[_0x8ef5('0x4e')]);return db['ChatQueue'][_0x8ef5('0x56')](_0x5c7406)[_0x8ef5('0x36')](handleEntityNotFound(_0x5beefb,null))['then'](respondWithResult(_0x5beefb,null))[_0x8ef5('0x29')](handleError(_0x5beefb,null));};exports['create']=function(_0x9da3bb,_0x1e9c0e){return db[_0x8ef5('0x3c')]['create'](_0x9da3bb[_0x8ef5('0x57')],{})[_0x8ef5('0x36')](function(_0x575791){var _0x31075d=_0x9da3bb['user'][_0x8ef5('0x58')]({'plain':!![]});if(!_0x31075d)throw new Error(_0x8ef5('0x59'));if(_0x31075d[_0x8ef5('0x5a')]===_0x8ef5('0x5b')){var _0x537da8=_0x575791[_0x8ef5('0x58')]({'plain':!![]});var _0x498c9a='ChatQueues';return db[_0x8ef5('0x5c')]['find']({'where':{'name':_0x498c9a,'userProfileId':_0x31075d[_0x8ef5('0x5d')]},'raw':!![]})['then'](function(_0x485f61){if(_0x485f61&&_0x485f61[_0x8ef5('0x5e')]===0x0){return db[_0x8ef5('0x37')]['create']({'name':_0x537da8['name'],'resourceId':_0x537da8['id'],'type':_0x485f61[_0x8ef5('0x39')],'sectionId':_0x485f61['id']},{})['then'](function(){return _0x575791;});}else{return _0x575791;}})[_0x8ef5('0x29')](function(_0x4fc3aa){logger[_0x8ef5('0x23')](_0x8ef5('0x5f'),_0x4fc3aa);throw _0x4fc3aa;});}return _0x575791;})[_0x8ef5('0x36')](respondWithResult(_0x1e9c0e,0xc9))[_0x8ef5('0x29')](handleError(_0x1e9c0e,null));};exports[_0x8ef5('0x34')]=function(_0x121066,_0x24cf03){if(_0x121066[_0x8ef5('0x57')]['id']){delete _0x121066[_0x8ef5('0x57')]['id'];}return db[_0x8ef5('0x3c')][_0x8ef5('0x56')]({'where':{'id':_0x121066[_0x8ef5('0x60')]['id']}})[_0x8ef5('0x36')](handleEntityNotFound(_0x24cf03,null))[_0x8ef5('0x36')](saveUpdates(_0x121066['body'],null))[_0x8ef5('0x36')](respondWithResult(_0x24cf03,null))[_0x8ef5('0x29')](handleError(_0x24cf03,null));};exports['destroy']=function(_0x523d0d,_0x5e08a5){return db[_0x8ef5('0x3c')]['find']({'where':{'id':_0x523d0d[_0x8ef5('0x60')]['id']}})['then'](handleEntityNotFound(_0x5e08a5,null))[_0x8ef5('0x36')](removeEntity(_0x5e08a5,null))[_0x8ef5('0x29')](handleError(_0x5e08a5,null));};exports[_0x8ef5('0x61')]=function(_0x3faf83,_0x1c81ad){return db['ChatQueue'][_0x8ef5('0x61')]()[_0x8ef5('0x36')](respondWithResult(_0x1c81ad,null))[_0x8ef5('0x29')](handleError(_0x1c81ad,null));};exports[_0x8ef5('0x62')]=function(_0x5e70c7,_0x445691,_0x47c25f){var _0x2c9cac={'raw':!![],'where':{}},_0x2de3f7={},_0x2b75e5;return db[_0x8ef5('0x3c')][_0x8ef5('0x63')]({'where':{'id':_0x5e70c7[_0x8ef5('0x60')]['id']}})[_0x8ef5('0x36')](handleEntityNotFound(_0x445691,null))[_0x8ef5('0x36')](function(_0x186e03){if(_0x186e03){_0x2b75e5=_0x186e03[_0x8ef5('0x58')]({'plain':!![]});_0x2de3f7[_0x8ef5('0x40')]=_[_0x8ef5('0x41')](db[_0x8ef5('0x64')][_0x8ef5('0x54')]);_0x2de3f7['query']=_['keys'](_0x5e70c7[_0x8ef5('0x42')]);_0x2de3f7[_0x8ef5('0x55')]=_[_0x8ef5('0x43')](_0x2de3f7[_0x8ef5('0x40')],_0x2de3f7[_0x8ef5('0x42')]);_0x2c9cac[_0x8ef5('0x44')]=_[_0x8ef5('0x43')](_0x2de3f7[_0x8ef5('0x40')],qs[_0x8ef5('0x45')](_0x5e70c7[_0x8ef5('0x42')][_0x8ef5('0x45')]));_0x2c9cac[_0x8ef5('0x44')]=_0x2c9cac[_0x8ef5('0x44')][_0x8ef5('0x46')]?_0x2c9cac[_0x8ef5('0x44')]:_0x2de3f7[_0x8ef5('0x40')];if(!_0x5e70c7[_0x8ef5('0x42')][_0x8ef5('0x65')]('nolimit')){_0x2c9cac[_0x8ef5('0x2e')]=qs['limit'](_0x5e70c7[_0x8ef5('0x42')][_0x8ef5('0x2e')]);_0x2c9cac['offset']=qs[_0x8ef5('0x31')](_0x5e70c7[_0x8ef5('0x42')][_0x8ef5('0x31')]);}_0x2c9cac[_0x8ef5('0x66')]=qs[_0x8ef5('0x48')](_0x5e70c7[_0x8ef5('0x42')][_0x8ef5('0x48')]);_0x2c9cac[_0x8ef5('0x4a')]=qs[_0x8ef5('0x55')](_[_0x8ef5('0x67')](_0x5e70c7[_0x8ef5('0x42')],_0x2de3f7[_0x8ef5('0x55')]));_0x2c9cac[_0x8ef5('0x4a')][_0x8ef5('0x68')]=_0x186e03['id'];if(_0x5e70c7[_0x8ef5('0x42')][_0x8ef5('0x49')]){_0x2c9cac[_0x8ef5('0x4a')]=_['merge'](_0x2c9cac['where'],{'$or':_[_0x8ef5('0x4c')](_0x2c9cac[_0x8ef5('0x44')],function(_0x4257de){var _0x408c72={};_0x408c72[_0x4257de]={'$like':'%'+_0x5e70c7['query'][_0x8ef5('0x49')]+'%'};return _0x408c72;})});}_0x2c9cac=_['merge']({},_0x2c9cac,_0x5e70c7[_0x8ef5('0x4e')]);return db[_0x8ef5('0x64')][_0x8ef5('0x51')](_0x2c9cac);}})[_0x8ef5('0x36')](function(_0x16eb82){if(_0x16eb82){return db[_0x8ef5('0x69')][_0x8ef5('0x6a')]({'where':{'id':_['map'](_0x16eb82,_0x8ef5('0x6b')),'role':_0x8ef5('0x6c')},'attributes':['id','name',_0x8ef5('0x6d'),_0x8ef5('0x6e'),_0x8ef5('0x6f')]});}})['then'](function(_0x16dc2d){if(_0x16dc2d){return{'count':_0x16dc2d[_0x8ef5('0x30')],'rows':_[_0x8ef5('0x4c')](_0x16dc2d[_0x8ef5('0x52')],function(_0x225f10){return{'membername':_0x225f10[_0x8ef5('0x39')],'UserId':_0x225f10['id'],'queue_name':_0x2b75e5['name'],'ChatQueueId':_0x2b75e5['id'],'interface':util[_0x8ef5('0x70')](_0x8ef5('0x71'),_0x8ef5('0x72'),_0x225f10[_0x8ef5('0x39')]),'penalty':0x0,'paused':_0x225f10[_0x8ef5('0x6d')],'createdAt':_0x225f10[_0x8ef5('0x6f')],'updatedAt':_0x225f10[_0x8ef5('0x6e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x8ef5('0x36')](respondWithFilteredResult(_0x445691,_0x2c9cac))['catch'](handleError(_0x445691,null));};exports[_0x8ef5('0x73')]=function(_0x6ebacf,_0x36c24e,_0x24717f){var _0x3c1f9f={};var _0x2b3fda={};var _0x1d3967;var _0x49441f;return db[_0x8ef5('0x3c')][_0x8ef5('0x63')]({'where':{'id':_0x6ebacf[_0x8ef5('0x60')]['id']}})[_0x8ef5('0x36')](handleEntityNotFound(_0x36c24e,null))[_0x8ef5('0x36')](function(_0x2a9e08){if(_0x2a9e08){_0x1d3967=_0x2a9e08;_0x2b3fda[_0x8ef5('0x40')]=_[_0x8ef5('0x41')](db[_0x8ef5('0x74')][_0x8ef5('0x54')]);_0x2b3fda[_0x8ef5('0x42')]=_[_0x8ef5('0x41')](_0x6ebacf[_0x8ef5('0x42')]);_0x2b3fda[_0x8ef5('0x55')]=_[_0x8ef5('0x43')](_0x2b3fda['model'],_0x2b3fda[_0x8ef5('0x42')]);_0x3c1f9f[_0x8ef5('0x44')]=_[_0x8ef5('0x43')](_0x2b3fda['model'],qs['fields'](_0x6ebacf[_0x8ef5('0x42')]['fields']));_0x3c1f9f[_0x8ef5('0x44')]=_0x3c1f9f[_0x8ef5('0x44')][_0x8ef5('0x46')]?_0x3c1f9f[_0x8ef5('0x44')]:_0x2b3fda[_0x8ef5('0x40')];_0x3c1f9f[_0x8ef5('0x66')]=qs['sort'](_0x6ebacf['query'][_0x8ef5('0x48')]);_0x3c1f9f[_0x8ef5('0x4a')]=qs[_0x8ef5('0x55')](_['pick'](_0x6ebacf[_0x8ef5('0x42')],_0x2b3fda['filters']));if(_0x6ebacf['query']['filter']){_0x3c1f9f[_0x8ef5('0x4a')]=_[_0x8ef5('0x4b')](_0x3c1f9f[_0x8ef5('0x4a')],{'$or':_['map'](_0x3c1f9f[_0x8ef5('0x44')],function(_0x3c8e41){var _0x2b85f6={};_0x2b85f6[_0x3c8e41]={'$like':'%'+_0x6ebacf[_0x8ef5('0x42')][_0x8ef5('0x49')]+'%'};return _0x2b85f6;})});}_0x3c1f9f=_[_0x8ef5('0x4b')]({},_0x3c1f9f,_0x6ebacf[_0x8ef5('0x4e')]);return _0x1d3967[_0x8ef5('0x73')](_0x3c1f9f);}})[_0x8ef5('0x36')](function(_0x531f65){if(_0x531f65){_0x49441f=_0x531f65[_0x8ef5('0x46')];if(!_0x6ebacf[_0x8ef5('0x42')][_0x8ef5('0x65')](_0x8ef5('0x47'))){_0x3c1f9f[_0x8ef5('0x2e')]=qs[_0x8ef5('0x2e')](_0x6ebacf[_0x8ef5('0x42')]['limit']);_0x3c1f9f['offset']=qs[_0x8ef5('0x31')](_0x6ebacf[_0x8ef5('0x42')][_0x8ef5('0x31')]);}return _0x1d3967[_0x8ef5('0x73')](_0x3c1f9f);}})[_0x8ef5('0x36')](function(_0xca4c37){if(_0xca4c37){return _0xca4c37?{'count':_0x49441f,'rows':_0xca4c37}:null;}})[_0x8ef5('0x36')](respondWithResult(_0x36c24e,null))[_0x8ef5('0x29')](handleError(_0x36c24e,null));};exports[_0x8ef5('0x75')]=function(_0x685f56,_0x5edd93,_0x2e8118){var _0x423884=_0x685f56[_0x8ef5('0x57')][_0x8ef5('0x76')];return db[_0x8ef5('0x74')]['findAll']({'where':{'id':_0x423884},'attributes':['id'],'include':[{'model':db['User'],'as':_0x8ef5('0x77'),'attributes':['id',_0x8ef5('0x39'),'online',_0x8ef5('0x78'),_0x8ef5('0x79')],'raw':!![]}]})[_0x8ef5('0x36')](function(_0xa0c3aa){if(_0xa0c3aa){var _0x43b9f2=_[_0x8ef5('0x7a')](_0xa0c3aa,function(_0xf6aeea){var _0x45cbea=_0xf6aeea[_0x8ef5('0x58')]({'plain':!![]});return _0x45cbea[_0x8ef5('0x77')];});return db['ChatQueue'][_0x8ef5('0x56')]({'where':{'id':_0x685f56[_0x8ef5('0x60')]['id']}})[_0x8ef5('0x36')](function(_0x189e51){return db[_0x8ef5('0x7b')][_0x8ef5('0x7c')](function(_0x795542){return _0x189e51[_0x8ef5('0x75')](_0x423884,{'transaction':_0x795542})['then'](function(){return BPromise[_0x8ef5('0x7d')](_0x43b9f2,function(_0x4cd3cf){return db['UserChatQueue'][_0x8ef5('0x7e')]({'where':{'UserId':_0x4cd3cf['id'],'ChatQueueId':_0x685f56[_0x8ef5('0x60')]['id']},'transaction':_0x795542});});})[_0x8ef5('0x36')](function(){_0x43b9f2[_0x8ef5('0x7f')](function(_0x2d51cf){socket[_0x8ef5('0x80')](_0x8ef5('0x81'),{'UserId':_0x2d51cf['id'],'ChatQueueId':_0x189e51['id']});});});});});}})['then'](respondWithStatusCode(_0x5edd93,null))[_0x8ef5('0x29')](handleError(_0x5edd93,null));};exports[_0x8ef5('0x82')]=function(_0x1d67ba,_0x24548f,_0x4a56c5){return db[_0x8ef5('0x74')][_0x8ef5('0x51')]({'where':{'id':_0x1d67ba[_0x8ef5('0x42')][_0x8ef5('0x76')]},'attributes':['id'],'include':[{'model':db[_0x8ef5('0x69')],'as':_0x8ef5('0x77'),'attributes':['id'],'raw':!![]}]})[_0x8ef5('0x36')](handleEntityNotFound(_0x24548f,null))['then'](function(_0x595efc){var _0x145f17=_['map'](_0x595efc,'id');var _0x2a7643=[];var _0x548cde=[];var _0x344906=squel[_0x8ef5('0x83')]();_0x344906[_0x8ef5('0x84')](_0x8ef5('0x85'))[_0x8ef5('0x86')](_0x8ef5('0x87'),'tq')[_0x8ef5('0x88')](_0x8ef5('0x89'),'ut',_0x8ef5('0x8a'))[_0x8ef5('0x4a')](_0x8ef5('0x8b'),_0x1d67ba[_0x8ef5('0x60')]['id']);for(var _0x51c146=0x0;_0x51c146<_0x595efc[_0x8ef5('0x46')];_0x51c146+=0x1){let _0x190f44=_0x595efc[_0x51c146];for(var _0x1ccf2f=0x0;_0x1ccf2f<_0x190f44[_0x8ef5('0x77')][_0x8ef5('0x46')];_0x1ccf2f+=0x1){let _0xc3a8a7=_0x190f44[_0x8ef5('0x77')][_0x1ccf2f];var _0x30aec4=_0x344906[_0x8ef5('0x8c')]();_0x30aec4['where'](_0x8ef5('0x8d'),_0xc3a8a7['id']);_0x548cde[_0x8ef5('0x8e')](db[_0x8ef5('0x7b')][_0x8ef5('0x42')](_0x30aec4[_0x8ef5('0x8f')](),{'type':db[_0x8ef5('0x7b')][_0x8ef5('0x90')][_0x8ef5('0x91')]})[_0x8ef5('0x36')](function(_0x4cd2d1){if(_0x4cd2d1[_0x8ef5('0x46')]===0x1){return _0xc3a8a7['id'];}else{var _0xbc200c=_['every'](_[_0x8ef5('0x4c')](_0x4cd2d1,_0x8ef5('0x92')),function(_0x441660){return _[_0x8ef5('0x93')](_0x145f17,_0x441660);});if(_0xbc200c){return _0xc3a8a7['id'];}}}));}}return BPromise['all'](_0x548cde)[_0x8ef5('0x36')](function(_0x5916c2){_0x2a7643=_(_0x2a7643)['union'](_0x5916c2)[_0x8ef5('0x94')]()['value']();return db[_0x8ef5('0x3c')]['find']({'where':{'id':_0x1d67ba['params']['id']}})[_0x8ef5('0x36')](function(_0x5425c9){return db[_0x8ef5('0x7b')][_0x8ef5('0x7c')](function(_0x2866c5){return _0x5425c9[_0x8ef5('0x82')](_0x1d67ba[_0x8ef5('0x42')][_0x8ef5('0x76')],{'transaction':_0x2866c5})[_0x8ef5('0x36')](function(){if(!_['isEmpty'](_0x2a7643)){return _0x5425c9['removeAgents'](_0x2a7643,{'transaction':_0x2866c5});}})['then'](function(){_0x2a7643[_0x8ef5('0x7f')](function(_0x1507c9){socket['emit']('userChatQueue:remove',{'UserId':_0x1507c9,'ChatQueueId':_0x5425c9['id']});});});});});});})['then'](respondWithStatusCode(_0x24548f,null))[_0x8ef5('0x29')](handleError(_0x24548f,null));};exports[_0x8ef5('0x95')]=function(_0x513c9d,_0x6c27ec,_0x3ce571){return db[_0x8ef5('0x3c')]['find']({'where':{'id':_0x513c9d[_0x8ef5('0x60')]['id']}})[_0x8ef5('0x36')](handleEntityNotFound(_0x6c27ec,null))[_0x8ef5('0x36')](function(_0x39451e){if(_0x39451e){return _0x39451e[_0x8ef5('0x95')](_0x513c9d[_0x8ef5('0x57')][_0x8ef5('0x76')],_[_0x8ef5('0x96')](_0x513c9d[_0x8ef5('0x57')],[_0x8ef5('0x76'),'id'])||{})[_0x8ef5('0x97')](function(_0x1c784b){for(var _0x556838=0x0;_0x556838<_0x513c9d[_0x8ef5('0x57')]['ids'][_0x8ef5('0x46')];_0x556838+=0x1){socket['emit'](_0x8ef5('0x81'),{'UserId':Number(_0x513c9d['body'][_0x8ef5('0x76')][_0x556838]),'ChatQueueId':Number(_0x513c9d[_0x8ef5('0x60')]['id'])});}return _0x1c784b;});}})[_0x8ef5('0x36')](respondWithResult(_0x6c27ec,null))[_0x8ef5('0x29')](handleError(_0x6c27ec,null));};exports[_0x8ef5('0x98')]=function(_0x51f7ce,_0x5052d6,_0x4416dc){return db[_0x8ef5('0x3c')][_0x8ef5('0x56')]({'where':{'id':_0x51f7ce['params']['id']}})['then'](handleEntityNotFound(_0x5052d6,null))[_0x8ef5('0x36')](function(_0x5474aa){if(_0x5474aa){return _0x5474aa['removeAgents'](_0x51f7ce['query'][_0x8ef5('0x76')])[_0x8ef5('0x36')](function(){if(_[_0x8ef5('0x99')](_0x51f7ce[_0x8ef5('0x42')][_0x8ef5('0x76')])){for(var _0x3175e4=0x0;_0x3175e4<_0x51f7ce[_0x8ef5('0x42')][_0x8ef5('0x76')]['length'];_0x3175e4+=0x1){socket[_0x8ef5('0x80')]('userChatQueue:remove',{'UserId':Number(_0x51f7ce['query'][_0x8ef5('0x76')][_0x3175e4]),'ChatQueueId':Number(_0x51f7ce[_0x8ef5('0x60')]['id'])});}}else{socket[_0x8ef5('0x80')](_0x8ef5('0x9a'),{'UserId':Number(_0x51f7ce[_0x8ef5('0x42')][_0x8ef5('0x76')]),'ChatQueueId':Number(_0x51f7ce[_0x8ef5('0x60')]['id'])});}});}})[_0x8ef5('0x36')](respondWithStatusCode(_0x5052d6,null))[_0x8ef5('0x29')](handleError(_0x5052d6,null));};exports[_0x8ef5('0x9b')]=function(_0x2c2276,_0x43cf7f,_0x5547ff){var _0x5ca7d0={};var _0x29b84e={};var _0x271134;var _0x4652ba;return db[_0x8ef5('0x3c')][_0x8ef5('0x63')]({'where':{'id':_0x2c2276[_0x8ef5('0x60')]['id']}})[_0x8ef5('0x36')](handleEntityNotFound(_0x43cf7f,null))[_0x8ef5('0x36')](function(_0x27117f){if(_0x27117f){_0x271134=_0x27117f;_0x29b84e[_0x8ef5('0x40')]=_[_0x8ef5('0x41')](db['User'][_0x8ef5('0x54')]);_0x29b84e[_0x8ef5('0x42')]=_[_0x8ef5('0x41')](_0x2c2276[_0x8ef5('0x42')]);_0x29b84e[_0x8ef5('0x55')]=_[_0x8ef5('0x43')](_0x29b84e[_0x8ef5('0x40')],_0x29b84e[_0x8ef5('0x42')]);_0x5ca7d0[_0x8ef5('0x44')]=_[_0x8ef5('0x43')](_0x29b84e['model'],qs['fields'](_0x2c2276[_0x8ef5('0x42')][_0x8ef5('0x45')]));_0x5ca7d0[_0x8ef5('0x44')]=_0x5ca7d0[_0x8ef5('0x44')][_0x8ef5('0x46')]?_0x5ca7d0['attributes']:_0x29b84e['model'];_0x5ca7d0[_0x8ef5('0x66')]=qs[_0x8ef5('0x48')](_0x2c2276[_0x8ef5('0x42')][_0x8ef5('0x48')]);_0x5ca7d0[_0x8ef5('0x4a')]=qs[_0x8ef5('0x55')](_[_0x8ef5('0x67')](_0x2c2276[_0x8ef5('0x42')],_0x29b84e[_0x8ef5('0x55')]));if(_0x2c2276[_0x8ef5('0x42')][_0x8ef5('0x49')]){_0x5ca7d0[_0x8ef5('0x4a')]=_[_0x8ef5('0x4b')](_0x5ca7d0[_0x8ef5('0x4a')],{'$or':_[_0x8ef5('0x4c')](_0x5ca7d0[_0x8ef5('0x44')],function(_0xf605d){var _0x9e0d1d={};_0x9e0d1d[_0xf605d]={'$like':'%'+_0x2c2276[_0x8ef5('0x42')]['filter']+'%'};return _0x9e0d1d;})});}_0x5ca7d0=_['merge']({},_0x5ca7d0,_0x2c2276[_0x8ef5('0x4e')]);return _0x271134['getAgents'](_0x5ca7d0);}})['then'](function(_0x193c75){if(_0x193c75){_0x4652ba=_0x193c75[_0x8ef5('0x46')];if(!_0x2c2276['query'][_0x8ef5('0x65')](_0x8ef5('0x47'))){_0x5ca7d0[_0x8ef5('0x2e')]=qs[_0x8ef5('0x2e')](_0x2c2276[_0x8ef5('0x42')][_0x8ef5('0x2e')]);_0x5ca7d0[_0x8ef5('0x31')]=qs[_0x8ef5('0x31')](_0x2c2276['query'][_0x8ef5('0x31')]);}return _0x271134[_0x8ef5('0x9b')](_0x5ca7d0);}})[_0x8ef5('0x36')](function(_0x52fd9f){if(_0x52fd9f){return _0x52fd9f?{'count':_0x4652ba,'rows':_0x52fd9f}:null;}})['then'](respondWithResult(_0x43cf7f,null))[_0x8ef5('0x29')](handleError(_0x43cf7f,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 772fa62..1356e52 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 _0x2d90=['events','../../mysqldb','ChatQueue','setMaxListeners','save','remove','emit','hasOwnProperty','exports'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0x2d90,0x1c2));var _0x02d9=function(_0x214a74,_0x1ac282){_0x214a74=_0x214a74-0x0;var _0x3c4532=_0x2d90[_0x214a74];return _0x3c4532;};'use strict';var EventEmitter=require(_0x02d9('0x0'));var ChatQueue=require(_0x02d9('0x1'))['db'][_0x02d9('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x02d9('0x3')](0x0);var events={'afterCreate':_0x02d9('0x4'),'afterUpdate':'update','afterDestroy':_0x02d9('0x5')};function emitEvent(_0x590524){return function(_0x2daf5d,_0xd95cb3,_0x2971d3){ChatQueueEvents[_0x02d9('0x6')](_0x590524+':'+_0x2daf5d['id'],_0x2daf5d);ChatQueueEvents[_0x02d9('0x6')](_0x590524,_0x2daf5d);_0x2971d3(null);};}for(var e in events){if(events[_0x02d9('0x7')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x02d9('0x8')]=ChatQueueEvents;
\ No newline at end of file
+var _0x385b=['emit','exports','events','ChatQueue','setMaxListeners','save','update','remove'];(function(_0x470e67,_0x4a596d){var _0x28bbde=function(_0x1bbf56){while(--_0x1bbf56){_0x470e67['push'](_0x470e67['shift']());}};_0x28bbde(++_0x4a596d);}(_0x385b,0x17a));var _0xb385=function(_0x242a4f,_0x369c57){_0x242a4f=_0x242a4f-0x0;var _0x122117=_0x385b[_0x242a4f];return _0x122117;};'use strict';var EventEmitter=require(_0xb385('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xb385('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xb385('0x2')](0x0);var events={'afterCreate':_0xb385('0x3'),'afterUpdate':_0xb385('0x4'),'afterDestroy':_0xb385('0x5')};function emitEvent(_0x3df07f){return function(_0x4a5f1e,_0x599a2d,_0xff424d){ChatQueueEvents[_0xb385('0x6')](_0x3df07f+':'+_0x4a5f1e['id'],_0x4a5f1e);ChatQueueEvents[_0xb385('0x6')](_0x3df07f,_0x4a5f1e);_0xff424d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0xb385('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 de89f67..0c2d668 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 _0x0c09=['bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','util','moment'];(function(_0x203d73,_0x6bfa0f){var _0x2abb5d=function(_0x4b61c9){while(--_0x4b61c9){_0x203d73['push'](_0x203d73['shift']());}};_0x2abb5d(++_0x6bfa0f);}(_0x0c09,0x1b7));var _0x90c0=function(_0x53a5e0,_0x192863){_0x53a5e0=_0x53a5e0-0x0;var _0x4fc739=_0x0c09[_0x53a5e0];return _0x4fc739;};'use strict';var _=require('lodash');var util=require(_0x90c0('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x90c0('0x1'));var BPromise=require(_0x90c0('0x2'));var rp=require(_0x90c0('0x3'));var fs=require('fs');var path=require(_0x90c0('0x4'));var rimraf=require(_0x90c0('0x5'));var config=require(_0x90c0('0x6'));var attributes=require(_0x90c0('0x7'));module[_0x90c0('0x8')]=function(_0x30652b,_0x2aa588){return _0x30652b['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9e53=['lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues'];(function(_0x225a75,_0x43c1de){var _0xee995d=function(_0x31a816){while(--_0x31a816){_0x225a75['push'](_0x225a75['shift']());}};_0xee995d(++_0x43c1de);}(_0x9e53,0xc3));var _0x39e5=function(_0x2b9d5c,_0x173518){_0x2b9d5c=_0x2b9d5c-0x0;var _0x37bb93=_0x9e53[_0x2b9d5c];return _0x37bb93;};'use strict';var _=require(_0x39e5('0x0'));var util=require(_0x39e5('0x1'));var logger=require(_0x39e5('0x2'))(_0x39e5('0x3'));var moment=require(_0x39e5('0x4'));var BPromise=require('bluebird');var rp=require(_0x39e5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x39e5('0x6'));var config=require(_0x39e5('0x7'));var attributes=require(_0x39e5('0x8'));module[_0x39e5('0x9')]=function(_0x35a6ad,_0x559cf9){return _0x35a6ad[_0x39e5('0xa')](_0x39e5('0xb'),attributes,{'tableName':_0x39e5('0xc'),'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 d34482d..54ccdd6 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 _0xb396=['include','model','attributes','then','debug','ShowChatQueue','ChatQueue','find','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatQueue.socket','register','request','ChatQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetChatQueue','findAll','options','raw','where','limit','map'];(function(_0x1187d2,_0x528ad5){var _0x5d41ec=function(_0x519ada){while(--_0x519ada){_0x1187d2['push'](_0x1187d2['shift']());}};_0x5d41ec(++_0x528ad5);}(_0xb396,0x1e8));var _0x6b39=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xb396[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x6b39('0x0'));var util=require(_0x6b39('0x1'));var moment=require(_0x6b39('0x2'));var BPromise=require(_0x6b39('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6b39('0x4'));var db=require(_0x6b39('0x5'))['db'];var utils=require(_0x6b39('0x6'));var logger=require(_0x6b39('0x7'))(_0x6b39('0x8'));var config=require(_0x6b39('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6b39('0xa')]['http']({'port':0x232a});config[_0x6b39('0xb')]=_['defaults'](config['redis'],{'host':_0x6b39('0xc'),'port':0x18eb});var socket=require(_0x6b39('0xd'))(new Redis(config[_0x6b39('0xb')]));require(_0x6b39('0xe'))[_0x6b39('0xf')](socket);function respondWithRpcPromise(_0x36606d,_0x32c7b2,_0x5adff6){return new BPromise(function(_0x4a1b39,_0x5c098a){return client[_0x6b39('0x10')](_0x36606d,_0x5adff6)['then'](function(_0x5ba3af){logger['info'](_0x6b39('0x11'),_0x32c7b2,_0x6b39('0x12'));logger['debug']('ChatQueue,\x20%s,\x20%s,\x20%s',_0x32c7b2,_0x6b39('0x12'),JSON[_0x6b39('0x13')](_0x5ba3af));if(_0x5ba3af[_0x6b39('0x14')]){if(_0x5ba3af[_0x6b39('0x14')][_0x6b39('0x15')]===0x1f4){logger['error'](_0x6b39('0x11'),_0x32c7b2,_0x5ba3af['error'][_0x6b39('0x16')]);return _0x5c098a(_0x5ba3af[_0x6b39('0x14')][_0x6b39('0x16')]);}logger['error'](_0x6b39('0x11'),_0x32c7b2,_0x5ba3af['error'][_0x6b39('0x16')]);return _0x4a1b39(_0x5ba3af[_0x6b39('0x14')][_0x6b39('0x16')]);}else{logger[_0x6b39('0x17')](_0x6b39('0x11'),_0x32c7b2,_0x6b39('0x12'));_0x4a1b39(_0x5ba3af[_0x6b39('0x18')][_0x6b39('0x16')]);}})['catch'](function(_0x51a7dc){logger[_0x6b39('0x14')](_0x6b39('0x11'),_0x32c7b2,_0x51a7dc);_0x5c098a(_0x51a7dc);});});}exports[_0x6b39('0x19')]=function(_0x3a8b5b){var _0x1893ad=this;return new Promise(function(_0x299538,_0x458e7d){return db['ChatQueue'][_0x6b39('0x1a')]({'raw':_0x3a8b5b[_0x6b39('0x1b')]?_0x3a8b5b['options'][_0x6b39('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a8b5b[_0x6b39('0x1b')]?_0x3a8b5b[_0x6b39('0x1b')][_0x6b39('0x1d')]||null:null,'attributes':_0x3a8b5b['options']?_0x3a8b5b[_0x6b39('0x1b')]['attributes']||null:null,'limit':_0x3a8b5b['options']?_0x3a8b5b[_0x6b39('0x1b')][_0x6b39('0x1e')]||null:null,'include':_0x3a8b5b[_0x6b39('0x1b')]?_0x3a8b5b['options']['include']?_[_0x6b39('0x1f')](_0x3a8b5b['options'][_0x6b39('0x20')],function(_0x2423bb){return{'model':db[_0x2423bb[_0x6b39('0x21')]],'as':_0x2423bb['as'],'attributes':_0x2423bb['attributes'],'include':_0x2423bb[_0x6b39('0x20')]?_['map'](_0x2423bb[_0x6b39('0x20')],function(_0x4f0c90){return{'model':db[_0x4f0c90[_0x6b39('0x21')]],'as':_0x4f0c90['as'],'attributes':_0x4f0c90[_0x6b39('0x22')],'include':_0x4f0c90[_0x6b39('0x20')]?_['map'](_0x4f0c90[_0x6b39('0x20')],function(_0x26ef5b){return{'model':db[_0x26ef5b[_0x6b39('0x21')]],'as':_0x26ef5b['as'],'attributes':_0x26ef5b['attributes']};}):[]};}):[]};}):[]:[]})[_0x6b39('0x23')](function(_0x2fa81a){logger[_0x6b39('0x17')]('GetChatQueue',_0x3a8b5b);logger[_0x6b39('0x24')](_0x6b39('0x19'),_0x3a8b5b,JSON[_0x6b39('0x13')](_0x2fa81a));_0x299538(_0x2fa81a);})['catch'](function(_0x267443){logger[_0x6b39('0x14')](_0x6b39('0x19'),_0x267443[_0x6b39('0x16')],_0x3a8b5b);_0x458e7d(_0x1893ad[_0x6b39('0x14')](0x1f4,_0x267443[_0x6b39('0x16')]));});});};exports[_0x6b39('0x25')]=function(_0x5be8ab){var _0x2f9e5d=this;return new Promise(function(_0x2a0702,_0x5d9859){return db[_0x6b39('0x26')][_0x6b39('0x27')]({'raw':_0x5be8ab[_0x6b39('0x1b')]?_0x5be8ab[_0x6b39('0x1b')][_0x6b39('0x1c')]===undefined?!![]:![]:!![],'where':_0x5be8ab[_0x6b39('0x1b')]?_0x5be8ab['options'][_0x6b39('0x1d')]||null:null,'attributes':_0x5be8ab[_0x6b39('0x1b')]?_0x5be8ab[_0x6b39('0x1b')][_0x6b39('0x22')]||null:null,'include':_0x5be8ab['options']?_0x5be8ab[_0x6b39('0x1b')][_0x6b39('0x20')]?_[_0x6b39('0x1f')](_0x5be8ab[_0x6b39('0x1b')][_0x6b39('0x20')],function(_0x449afc){return{'model':db[_0x449afc[_0x6b39('0x21')]],'as':_0x449afc['as'],'attributes':_0x449afc[_0x6b39('0x22')],'include':_0x449afc[_0x6b39('0x20')]?_['map'](_0x449afc['include'],function(_0xc40fe7){return{'model':db[_0xc40fe7[_0x6b39('0x21')]],'as':_0xc40fe7['as'],'attributes':_0xc40fe7[_0x6b39('0x22')],'include':_0xc40fe7['include']?_['map'](_0xc40fe7[_0x6b39('0x20')],function(_0x215032){return{'model':db[_0x215032[_0x6b39('0x21')]],'as':_0x215032['as'],'attributes':_0x215032[_0x6b39('0x22')]};}):[]};}):[]};}):[]:[]})[_0x6b39('0x23')](function(_0x2c981c){logger['info'](_0x6b39('0x25'),_0x5be8ab);logger[_0x6b39('0x24')](_0x6b39('0x25'),_0x5be8ab,JSON[_0x6b39('0x13')](_0x2c981c));_0x2a0702(_0x2c981c);})['catch'](function(_0x72e6b6){logger[_0x6b39('0x14')](_0x6b39('0x25'),_0x72e6b6[_0x6b39('0x16')],_0x5be8ab);_0x5d9859(_0x2f9e5d[_0x6b39('0x14')](0x1f4,_0x72e6b6[_0x6b39('0x16')]));});});};
\ No newline at end of file
+var _0x2d28=['localhost','./chatQueue.socket','register','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','GetChatQueue','findAll','options','raw','where','include','map','model','attributes','catch','ChatQueue','find','ShowChatQueue','lodash','util','../../mysqldb','../../config/utils','rpc','../../config/environment','client','redis','defaults'];(function(_0x4857c9,_0x4ccb50){var _0x1da42e=function(_0x5cdedf){while(--_0x5cdedf){_0x4857c9['push'](_0x4857c9['shift']());}};_0x1da42e(++_0x4ccb50);}(_0x2d28,0x1be));var _0x82d2=function(_0x7261e6,_0x3e3bf7){_0x7261e6=_0x7261e6-0x0;var _0x20d5ed=_0x2d28[_0x7261e6];return _0x20d5ed;};'use strict';var _=require(_0x82d2('0x0'));var util=require(_0x82d2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x82d2('0x2'))['db'];var utils=require(_0x82d2('0x3'));var logger=require('../../config/logger')(_0x82d2('0x4'));var config=require(_0x82d2('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x82d2('0x6')]['http']({'port':0x232a});config[_0x82d2('0x7')]=_[_0x82d2('0x8')](config[_0x82d2('0x7')],{'host':_0x82d2('0x9'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x82d2('0xa'))[_0x82d2('0xb')](socket);function respondWithRpcPromise(_0x17c1c8,_0x132cf9,_0x3c55a5){return new BPromise(function(_0x2affca,_0x508e51){return client['request'](_0x17c1c8,_0x3c55a5)[_0x82d2('0xc')](function(_0x483b6e){logger[_0x82d2('0xd')](_0x82d2('0xe'),_0x132cf9,_0x82d2('0xf'));logger[_0x82d2('0x10')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x132cf9,_0x82d2('0xf'),JSON[_0x82d2('0x11')](_0x483b6e));if(_0x483b6e['error']){if(_0x483b6e['error'][_0x82d2('0x12')]===0x1f4){logger[_0x82d2('0x13')](_0x82d2('0xe'),_0x132cf9,_0x483b6e[_0x82d2('0x13')][_0x82d2('0x14')]);return _0x508e51(_0x483b6e[_0x82d2('0x13')][_0x82d2('0x14')]);}logger[_0x82d2('0x13')](_0x82d2('0xe'),_0x132cf9,_0x483b6e[_0x82d2('0x13')][_0x82d2('0x14')]);return _0x2affca(_0x483b6e[_0x82d2('0x13')]['message']);}else{logger[_0x82d2('0xd')]('ChatQueue,\x20%s,\x20%s',_0x132cf9,_0x82d2('0xf'));_0x2affca(_0x483b6e[_0x82d2('0x15')][_0x82d2('0x14')]);}})['catch'](function(_0x2539ad){logger[_0x82d2('0x13')](_0x82d2('0xe'),_0x132cf9,_0x2539ad);_0x508e51(_0x2539ad);});});}exports[_0x82d2('0x16')]=function(_0x1d5422){var _0x492348=this;return new Promise(function(_0xb023a3,_0x2374c6){return db['ChatQueue'][_0x82d2('0x17')]({'raw':_0x1d5422[_0x82d2('0x18')]?_0x1d5422[_0x82d2('0x18')][_0x82d2('0x19')]===undefined?!![]:![]:!![],'where':_0x1d5422[_0x82d2('0x18')]?_0x1d5422[_0x82d2('0x18')][_0x82d2('0x1a')]||null:null,'attributes':_0x1d5422[_0x82d2('0x18')]?_0x1d5422['options']['attributes']||null:null,'limit':_0x1d5422[_0x82d2('0x18')]?_0x1d5422['options']['limit']||null:null,'include':_0x1d5422[_0x82d2('0x18')]?_0x1d5422['options'][_0x82d2('0x1b')]?_[_0x82d2('0x1c')](_0x1d5422[_0x82d2('0x18')][_0x82d2('0x1b')],function(_0x23d153){return{'model':db[_0x23d153[_0x82d2('0x1d')]],'as':_0x23d153['as'],'attributes':_0x23d153[_0x82d2('0x1e')],'include':_0x23d153[_0x82d2('0x1b')]?_[_0x82d2('0x1c')](_0x23d153[_0x82d2('0x1b')],function(_0x39b82d){return{'model':db[_0x39b82d[_0x82d2('0x1d')]],'as':_0x39b82d['as'],'attributes':_0x39b82d['attributes'],'include':_0x39b82d[_0x82d2('0x1b')]?_[_0x82d2('0x1c')](_0x39b82d[_0x82d2('0x1b')],function(_0x488f48){return{'model':db[_0x488f48[_0x82d2('0x1d')]],'as':_0x488f48['as'],'attributes':_0x488f48[_0x82d2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x82d2('0xc')](function(_0x2a6564){logger[_0x82d2('0xd')](_0x82d2('0x16'),_0x1d5422);logger[_0x82d2('0x10')]('GetChatQueue',_0x1d5422,JSON[_0x82d2('0x11')](_0x2a6564));_0xb023a3(_0x2a6564);})[_0x82d2('0x1f')](function(_0x489b1a){logger[_0x82d2('0x13')](_0x82d2('0x16'),_0x489b1a[_0x82d2('0x14')],_0x1d5422);_0x2374c6(_0x492348['error'](0x1f4,_0x489b1a[_0x82d2('0x14')]));});});};exports['ShowChatQueue']=function(_0xcd7014){var _0x552851=this;return new Promise(function(_0x2e1044,_0x4c98fb){return db[_0x82d2('0x20')][_0x82d2('0x21')]({'raw':_0xcd7014[_0x82d2('0x18')]?_0xcd7014[_0x82d2('0x18')][_0x82d2('0x19')]===undefined?!![]:![]:!![],'where':_0xcd7014[_0x82d2('0x18')]?_0xcd7014['options'][_0x82d2('0x1a')]||null:null,'attributes':_0xcd7014[_0x82d2('0x18')]?_0xcd7014[_0x82d2('0x18')][_0x82d2('0x1e')]||null:null,'include':_0xcd7014[_0x82d2('0x18')]?_0xcd7014[_0x82d2('0x18')][_0x82d2('0x1b')]?_[_0x82d2('0x1c')](_0xcd7014[_0x82d2('0x18')][_0x82d2('0x1b')],function(_0x27745a){return{'model':db[_0x27745a[_0x82d2('0x1d')]],'as':_0x27745a['as'],'attributes':_0x27745a[_0x82d2('0x1e')],'include':_0x27745a['include']?_[_0x82d2('0x1c')](_0x27745a['include'],function(_0x4e7ff2){return{'model':db[_0x4e7ff2[_0x82d2('0x1d')]],'as':_0x4e7ff2['as'],'attributes':_0x4e7ff2['attributes'],'include':_0x4e7ff2[_0x82d2('0x1b')]?_[_0x82d2('0x1c')](_0x4e7ff2[_0x82d2('0x1b')],function(_0x37de6c){return{'model':db[_0x37de6c[_0x82d2('0x1d')]],'as':_0x37de6c['as'],'attributes':_0x37de6c[_0x82d2('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x82d2('0xc')](function(_0x214a9c){logger[_0x82d2('0xd')](_0x82d2('0x22'),_0xcd7014);logger[_0x82d2('0x10')](_0x82d2('0x22'),_0xcd7014,JSON[_0x82d2('0x11')](_0x214a9c));_0x2e1044(_0x214a9c);})[_0x82d2('0x1f')](function(_0x1c2bd6){logger[_0x82d2('0x13')](_0x82d2('0x22'),_0x1c2bd6['message'],_0xcd7014);_0x4c98fb(_0x552851[_0x82d2('0x13')](0x1f4,_0x1c2bd6[_0x82d2('0x14')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 2721d29..f7a57fc 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 _0x579c=['chatQueue:','./chatQueue.events','save','remove','update','removeListener','register'];(function(_0x2aca0b,_0x5de98f){var _0x27a68c=function(_0x42ebcf){while(--_0x42ebcf){_0x2aca0b['push'](_0x2aca0b['shift']());}};_0x27a68c(++_0x5de98f);}(_0x579c,0xda));var _0xc579=function(_0x5c5d03,_0x338a78){_0x5c5d03=_0x5c5d03-0x0;var _0x4d326f=_0x579c[_0x5c5d03];return _0x4d326f;};'use strict';var ChatQueueEvents=require(_0xc579('0x0'));var events=[_0xc579('0x1'),_0xc579('0x2'),_0xc579('0x3')];function createListener(_0x397136,_0x586948){return function(_0x1e2808){_0x586948['emit'](_0x397136,_0x1e2808);};}function removeListener(_0x21a0a2,_0x3b913c){return function(){ChatQueueEvents[_0xc579('0x4')](_0x21a0a2,_0x3b913c);};}exports[_0xc579('0x5')]=function(_0x124ee5){for(var _0x1bd276=0x0,_0x2e451b=events['length'];_0x1bd276<_0x2e451b;_0x1bd276++){var _0x1c6d9c=events[_0x1bd276];var _0x293c4a=createListener(_0xc579('0x6')+_0x1c6d9c,_0x124ee5);ChatQueueEvents['on'](_0x1c6d9c,_0x293c4a);}};
\ No newline at end of file
+var _0xadb8=['emit','removeListener','length','chatQueue:','remove'];(function(_0x4a563b,_0x36f42d){var _0x2935ef=function(_0x32593f){while(--_0x32593f){_0x4a563b['push'](_0x4a563b['shift']());}};_0x2935ef(++_0x36f42d);}(_0xadb8,0x1d0));var _0x8adb=function(_0x4f4c53,_0x58ba7b){_0x4f4c53=_0x4f4c53-0x0;var _0x568ff1=_0xadb8[_0x4f4c53];return _0x568ff1;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=['save',_0x8adb('0x0'),'update'];function createListener(_0x2b8a76,_0x2a0b30){return function(_0x24f912){_0x2a0b30[_0x8adb('0x1')](_0x2b8a76,_0x24f912);};}function removeListener(_0x44fdf7,_0x2baedb){return function(){ChatQueueEvents[_0x8adb('0x2')](_0x44fdf7,_0x2baedb);};}exports['register']=function(_0x15bc63){for(var _0x1a5f36=0x0,_0x9f435=events[_0x8adb('0x3')];_0x1a5f36<_0x9f435;_0x1a5f36++){var _0x271bed=events[_0x1a5f36];var _0x16b932=createListener(_0x8adb('0x4')+_0x271bed,_0x15bc63);ChatQueueEvents['on'](_0x271bed,_0x16b932);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index e73b7c2..5a0d6b2 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 _0x5fc3=['update','delete','destroy','removeTeams','removeAgents','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','describe','/:id','show','getMembers','/:id/teams','/:id/users','post','create','addTeams','put'];(function(_0x34021d,_0x753aa6){var _0x16597b=function(_0x2d040a){while(--_0x2d040a){_0x34021d['push'](_0x34021d['shift']());}};_0x16597b(++_0x753aa6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3d9176,_0x399d6f){_0x3d9176=_0x3d9176-0x0;var _0x12adc5=_0x5fc3[_0x3d9176];return _0x12adc5;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var fs_extra=require(_0x35fc('0x5'));var auth=require(_0x35fc('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x35fc('0x7'));var controller=require(_0x35fc('0x8'));router[_0x35fc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x35fc('0x9')]('/describe',auth[_0x35fc('0xa')](),controller[_0x35fc('0xb')]);router[_0x35fc('0x9')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0xd')]);router[_0x35fc('0x9')]('/:id/members',auth[_0x35fc('0xa')](),controller[_0x35fc('0xe')]);router['get'](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller['getTeams']);router[_0x35fc('0x9')](_0x35fc('0x10'),auth['isAuthenticated'](),controller['getAgents']);router[_0x35fc('0x11')]('/',auth['isAuthenticated'](),controller[_0x35fc('0x12')]);router[_0x35fc('0x11')](_0x35fc('0xf'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x13')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0x35fc('0x14')](_0x35fc('0xc'),auth[_0x35fc('0xa')](),controller[_0x35fc('0x15')]);router[_0x35fc('0x16')](_0x35fc('0xc'),auth['isAuthenticated'](),controller[_0x35fc('0x17')]);router[_0x35fc('0x16')]('/:id/teams',auth[_0x35fc('0xa')](),controller[_0x35fc('0x18')]);router[_0x35fc('0x16')]('/:id/users',auth[_0x35fc('0xa')](),controller[_0x35fc('0x19')]);module[_0x35fc('0x1a')]=router;
\ No newline at end of file
+var _0x814b=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','removeTeams','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0x393bdf,_0xf2ccb4){var _0xd57701=function(_0x4c9c1a){while(--_0x4c9c1a){_0x393bdf['push'](_0x393bdf['shift']());}};_0xd57701(++_0xf2ccb4);}(_0x814b,0x1a2));var _0xb814=function(_0x16e73a,_0x146629){_0x16e73a=_0x16e73a-0x0;var _0x187aa1=_0x814b[_0x16e73a];return _0x187aa1;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xb814('0x6'));var interaction=require(_0xb814('0x7'));var config=require(_0xb814('0x8'));var controller=require(_0xb814('0x9'));router[_0xb814('0xa')]('/',auth[_0xb814('0xb')](),controller['index']);router[_0xb814('0xa')](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0xd')]);router[_0xb814('0xa')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0xf')]);router[_0xb814('0xa')](_0xb814('0x10'),auth[_0xb814('0xb')](),controller[_0xb814('0x11')]);router[_0xb814('0xa')](_0xb814('0x12'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router['get'](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x15')]);router[_0xb814('0x16')]('/',auth[_0xb814('0xb')](),controller[_0xb814('0x17')]);router[_0xb814('0x16')](_0xb814('0x12'),auth[_0xb814('0xb')](),controller[_0xb814('0x18')]);router[_0xb814('0x16')](_0xb814('0x14'),auth[_0xb814('0xb')](),controller[_0xb814('0x19')]);router[_0xb814('0x1a')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller[_0xb814('0x1b')]);router[_0xb814('0x1c')](_0xb814('0xe'),auth[_0xb814('0xb')](),controller['destroy']);router[_0xb814('0x1c')]('/:id/teams',auth[_0xb814('0xb')](),controller[_0xb814('0x1d')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xb814('0x1e')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 3ffa7c3..33bb525 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 _0x8488=['sequelize','exports','STRING','DATE','moment'];(function(_0x2d94dc,_0x56bed1){var _0x42f80d=function(_0x23916b){while(--_0x23916b){_0x2d94dc['push'](_0x2d94dc['shift']());}};_0x42f80d(++_0x56bed1);}(_0x8488,0x1b7));var _0x8848=function(_0x2eb135,_0x424cf9){_0x2eb135=_0x2eb135-0x0;var _0x3d55a2=_0x8488[_0x2eb135];return _0x3d55a2;};'use strict';var moment=require(_0x8848('0x0'));var Sequelize=require(_0x8848('0x1'));module[_0x8848('0x2')]={'uniqueid':{'type':Sequelize[_0x8848('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x8848('0x3')]},'joinAt':{'type':Sequelize[_0x8848('0x4')]},'leaveAt':{'type':Sequelize[_0x8848('0x4')]},'acceptAt':{'type':Sequelize[_0x8848('0x4')]},'exitAt':{'type':Sequelize[_0x8848('0x4')]},'reason':{'type':Sequelize[_0x8848('0x3')]}};
\ No newline at end of file
+var _0x7bee=['DATE','sequelize','exports','STRING'];(function(_0x259cdb,_0x3696ff){var _0x102792=function(_0x59aa1e){while(--_0x59aa1e){_0x259cdb['push'](_0x259cdb['shift']());}};_0x102792(++_0x3696ff);}(_0x7bee,0x13d));var _0xe7be=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7bee[_0x42cae2];return _0x5f256f;};'use strict';var moment=require('moment');var Sequelize=require(_0xe7be('0x0'));module[_0xe7be('0x1')]={'uniqueid':{'type':Sequelize[_0xe7be('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xe7be('0x2')]},'joinAt':{'type':Sequelize[_0xe7be('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe7be('0x3')]},'exitAt':{'type':Sequelize[_0xe7be('0x3')]},'reason':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js
index daa5039..c37d4dc 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 _0x5785=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','query','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','filter','merge','options','includeAll','findAll','rows','catch','show','keys','find','create','body','params','describe','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','papaparse','../../components/auth/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5785,0x119));var _0x5578=function(_0x24259d,_0x64a194){_0x24259d=_0x24259d-0x0;var _0x5a701=_0x5785[_0x24259d];return _0x5a701;};'use strict';var emlformat=require(_0x5578('0x0'));var rimraf=require(_0x5578('0x1'));var zipdir=require(_0x5578('0x2'));var jsonpatch=require(_0x5578('0x3'));var rp=require(_0x5578('0x4'));var moment=require('moment');var BPromise=require(_0x5578('0x5'));var Mustache=require(_0x5578('0x6'));var util=require(_0x5578('0x7'));var path=require(_0x5578('0x8'));var sox=require(_0x5578('0x9'));var csv=require(_0x5578('0xa'));var ejs=require(_0x5578('0xb'));var fs=require('fs');var fs_extra=require(_0x5578('0xc'));var _=require(_0x5578('0xd'));var squel=require(_0x5578('0xe'));var crypto=require('crypto');var jsforce=require(_0x5578('0xf'));var deskjs=require(_0x5578('0x10'));var toCsv=require(_0x5578('0xa'));var querystring=require('querystring');var Papa=require(_0x5578('0x11'));var Redis=require('ioredis');var authService=require(_0x5578('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5578('0x13'));var hardwareService=require(_0x5578('0x14'));var logger=require(_0x5578('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x5578('0x16'));var licenseUtil=require(_0x5578('0x17'));var db=require(_0x5578('0x18'))['db'];function respondWithStatusCode(_0x1506ac,_0x4592df){_0x4592df=_0x4592df||0xcc;return function(_0xa355d3){if(_0xa355d3){return _0x1506ac[_0x5578('0x19')](_0x4592df);}return _0x1506ac[_0x5578('0x1a')](_0x4592df)[_0x5578('0x1b')]();};}function respondWithResult(_0x34bacc,_0x4f6d2a){_0x4f6d2a=_0x4f6d2a||0xc8;return function(_0xe7ea50){if(_0xe7ea50){return _0x34bacc[_0x5578('0x1a')](_0x4f6d2a)[_0x5578('0x1c')](_0xe7ea50);}};}function respondWithFilteredResult(_0x21df98,_0x44ef23){return function(_0xb8e9c8){if(_0xb8e9c8){var _0x3fa05b=typeof _0x44ef23[_0x5578('0x1d')]===_0x5578('0x1e')&&typeof _0x44ef23[_0x5578('0x1f')]==='undefined';var _0x24b5b1=_0xb8e9c8[_0x5578('0x20')];var _0x5db57a=_0x3fa05b?0x0:_0x44ef23['offset'];var _0x3826b9=_0x3fa05b?_0xb8e9c8[_0x5578('0x20')]:_0x44ef23['offset']+_0x44ef23[_0x5578('0x1f')];var _0x2021b6;if(_0x3826b9>=_0x24b5b1){_0x3826b9=_0x24b5b1;_0x2021b6=0xc8;}else{_0x2021b6=0xce;}_0x21df98[_0x5578('0x1a')](_0x2021b6);return _0x21df98[_0x5578('0x21')](_0x5578('0x22'),_0x5db57a+'-'+_0x3826b9+'/'+_0x24b5b1)[_0x5578('0x1c')](_0xb8e9c8);}return null;};}function patchUpdates(_0x3dfadd){return function(_0x3a6b68){try{jsonpatch[_0x5578('0x23')](_0x3a6b68,_0x3dfadd,!![]);}catch(_0x38d06f){return BPromise[_0x5578('0x24')](_0x38d06f);}return _0x3a6b68[_0x5578('0x25')]();};}function saveUpdates(_0x2542eb,_0x10dd37){return function(_0x5d0a54){if(_0x5d0a54){return _0x5d0a54[_0x5578('0x26')](_0x2542eb)['then'](function(_0x208952){return _0x208952;});}return null;};}function removeEntity(_0x2d57b5,_0x394421){return function(_0x199853){if(_0x199853){return _0x199853[_0x5578('0x27')]()[_0x5578('0x28')](function(){_0x2d57b5['status'](0xcc)[_0x5578('0x1b')]();});}};}function handleEntityNotFound(_0x5d2c0c,_0x4c4d89){return function(_0x16cea){if(!_0x16cea){_0x5d2c0c['sendStatus'](0x194);}return _0x16cea;};}function handleError(_0x1d1861,_0x43adbd){_0x43adbd=_0x43adbd||0x1f4;return function(_0x2a752e){logger['error'](_0x2a752e[_0x5578('0x29')]);if(_0x2a752e[_0x5578('0x2a')]){delete _0x2a752e['name'];}_0x1d1861['status'](_0x43adbd)[_0x5578('0x2b')](_0x2a752e);};}exports[_0x5578('0x2c')]=function(_0x807da6,_0x25fb3b){var _0x44f200={},_0x593423={},_0x2d28d5={'count':0x0,'rows':[]};var _0xbe03a3=_[_0x5578('0x2d')](db[_0x5578('0x2e')][_0x5578('0x2f')],function(_0xe44d1b){return{'name':_0xe44d1b[_0x5578('0x30')],'type':_0xe44d1b[_0x5578('0x31')]['key']};});_0x593423['model']=_['map'](_0xbe03a3,_0x5578('0x2a'));_0x593423['query']=_['keys'](_0x807da6[_0x5578('0x32')]);_0x593423['filters']=_[_0x5578('0x33')](_0x593423[_0x5578('0x34')],_0x593423[_0x5578('0x32')]);_0x44f200[_0x5578('0x35')]=_['intersection'](_0x593423[_0x5578('0x34')],qs[_0x5578('0x36')](_0x807da6[_0x5578('0x32')][_0x5578('0x36')]));_0x44f200['attributes']=_0x44f200[_0x5578('0x35')][_0x5578('0x37')]?_0x44f200[_0x5578('0x35')]:_0x593423['model'];if(!_0x807da6[_0x5578('0x32')][_0x5578('0x38')]('nolimit')){_0x44f200[_0x5578('0x1f')]=qs['limit'](_0x807da6[_0x5578('0x32')][_0x5578('0x1f')]);_0x44f200['offset']=qs[_0x5578('0x1d')](_0x807da6[_0x5578('0x32')][_0x5578('0x1d')]);}_0x44f200[_0x5578('0x39')]=qs['sort'](_0x807da6[_0x5578('0x32')][_0x5578('0x3a')]);_0x44f200[_0x5578('0x3b')]=qs[_0x5578('0x3c')](_['pick'](_0x807da6[_0x5578('0x32')],_0x593423[_0x5578('0x3c')]),_0xbe03a3);if(_0x807da6[_0x5578('0x32')]['filter']){_0x44f200[_0x5578('0x3b')]=_['merge'](_0x44f200['where'],{'$or':_[_0x5578('0x2d')](_0xbe03a3,function(_0x2ee835){if(_0x2ee835[_0x5578('0x31')]!=='VIRTUAL'){var _0x55e2be={};_0x55e2be[_0x2ee835[_0x5578('0x2a')]]={'$like':'%'+_0x807da6[_0x5578('0x32')][_0x5578('0x3d')]+'%'};return _0x55e2be;}})});}_0x44f200=_[_0x5578('0x3e')]({},_0x44f200,_0x807da6[_0x5578('0x3f')]);var _0x5a3c64={'where':_0x44f200['where']};return db[_0x5578('0x2e')]['count'](_0x5a3c64)['then'](function(_0x2084a8){_0x2d28d5[_0x5578('0x20')]=_0x2084a8;if(_0x807da6[_0x5578('0x32')][_0x5578('0x40')]){_0x44f200['include']=[{'all':!![]}];}return db[_0x5578('0x2e')][_0x5578('0x41')](_0x44f200);})[_0x5578('0x28')](function(_0xade035){_0x2d28d5[_0x5578('0x42')]=_0xade035;return _0x2d28d5;})['then'](respondWithFilteredResult(_0x25fb3b,_0x44f200))[_0x5578('0x43')](handleError(_0x25fb3b,null));};exports[_0x5578('0x44')]=function(_0x535fdd,_0x410909){var _0x677d99={'raw':!![],'where':{'id':_0x535fdd['params']['id']}},_0x23ee49={};_0x23ee49[_0x5578('0x34')]=_[_0x5578('0x45')](db[_0x5578('0x2e')][_0x5578('0x2f')]);_0x23ee49['query']=_[_0x5578('0x45')](_0x535fdd[_0x5578('0x32')]);_0x23ee49[_0x5578('0x3c')]=_['intersection'](_0x23ee49['model'],_0x23ee49[_0x5578('0x32')]);_0x677d99[_0x5578('0x35')]=_['intersection'](_0x23ee49[_0x5578('0x34')],qs[_0x5578('0x36')](_0x535fdd[_0x5578('0x32')][_0x5578('0x36')]));_0x677d99[_0x5578('0x35')]=_0x677d99[_0x5578('0x35')][_0x5578('0x37')]?_0x677d99['attributes']:_0x23ee49['model'];if(_0x535fdd[_0x5578('0x32')][_0x5578('0x40')]){_0x677d99['include']=[{'all':!![]}];}_0x677d99=_['merge']({},_0x677d99,_0x535fdd[_0x5578('0x3f')]);return db[_0x5578('0x2e')][_0x5578('0x46')](_0x677d99)[_0x5578('0x28')](handleEntityNotFound(_0x410909,null))[_0x5578('0x28')](respondWithResult(_0x410909,null))[_0x5578('0x43')](handleError(_0x410909,null));};exports['create']=function(_0x5bb12c,_0x2ed4f9){return db[_0x5578('0x2e')][_0x5578('0x47')](_0x5bb12c[_0x5578('0x48')],{})[_0x5578('0x28')](respondWithResult(_0x2ed4f9,0xc9))[_0x5578('0x43')](handleError(_0x2ed4f9,null));};exports['update']=function(_0x1da278,_0x4da7bd){if(_0x1da278[_0x5578('0x48')]['id']){delete _0x1da278['body']['id'];}return db['ChatQueueReport'][_0x5578('0x46')]({'where':{'id':_0x1da278[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x4da7bd,null))['then'](saveUpdates(_0x1da278[_0x5578('0x48')],null))[_0x5578('0x28')](respondWithResult(_0x4da7bd,null))[_0x5578('0x43')](handleError(_0x4da7bd,null));};exports[_0x5578('0x27')]=function(_0x4cc550,_0x34c9fd){return db[_0x5578('0x2e')]['find']({'where':{'id':_0x4cc550[_0x5578('0x49')]['id']}})[_0x5578('0x28')](handleEntityNotFound(_0x34c9fd,null))['then'](removeEntity(_0x34c9fd,null))[_0x5578('0x43')](handleError(_0x34c9fd,null));};exports['describe']=function(_0x8fdb59,_0x205275){return db[_0x5578('0x2e')][_0x5578('0x4a')]()[_0x5578('0x28')](respondWithResult(_0x205275,null))[_0x5578('0x43')](handleError(_0x205275,null));};
\ No newline at end of file
+var _0xe08b=['undefined','limit','count','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','map','ChatQueueReport','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','catch','length','include','create','body','find','params','describe','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','end','json','offset'];(function(_0x12f9e3,_0x3fadc1){var _0x2de0c8=function(_0x31b5c5){while(--_0x31b5c5){_0x12f9e3['push'](_0x12f9e3['shift']());}};_0x2de0c8(++_0x3fadc1);}(_0xe08b,0x10e));var _0xbe08=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0xe08b[_0x26da89];return _0xc95b7b;};'use strict';var emlformat=require(_0xbe08('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbe08('0x1'));var jsonpatch=require(_0xbe08('0x2'));var rp=require('request-promise');var moment=require(_0xbe08('0x3'));var BPromise=require(_0xbe08('0x4'));var Mustache=require(_0xbe08('0x5'));var util=require(_0xbe08('0x6'));var path=require(_0xbe08('0x7'));var sox=require(_0xbe08('0x8'));var csv=require(_0xbe08('0x9'));var ejs=require(_0xbe08('0xa'));var fs=require('fs');var fs_extra=require(_0xbe08('0xb'));var _=require(_0xbe08('0xc'));var squel=require(_0xbe08('0xd'));var crypto=require(_0xbe08('0xe'));var jsforce=require(_0xbe08('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xbe08('0x9'));var querystring=require(_0xbe08('0x10'));var Papa=require('papaparse');var Redis=require(_0xbe08('0x11'));var authService=require(_0xbe08('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbe08('0x13'));var hardwareService=require(_0xbe08('0x14'));var logger=require('../../config/logger')(_0xbe08('0x15'));var utils=require(_0xbe08('0x16'));var config=require(_0xbe08('0x17'));var licenseUtil=require(_0xbe08('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42ab71,_0x49410b){_0x49410b=_0x49410b||0xcc;return function(_0x18ee13){if(_0x18ee13){return _0x42ab71[_0xbe08('0x19')](_0x49410b);}return _0x42ab71[_0xbe08('0x1a')](_0x49410b)[_0xbe08('0x1b')]();};}function respondWithResult(_0xe1dafa,_0x3050f1){_0x3050f1=_0x3050f1||0xc8;return function(_0x434646){if(_0x434646){return _0xe1dafa[_0xbe08('0x1a')](_0x3050f1)[_0xbe08('0x1c')](_0x434646);}};}function respondWithFilteredResult(_0x191f51,_0x457129){return function(_0x2b0901){if(_0x2b0901){var _0x122f44=typeof _0x457129[_0xbe08('0x1d')]===_0xbe08('0x1e')&&typeof _0x457129[_0xbe08('0x1f')]===_0xbe08('0x1e');var _0x344019=_0x2b0901['count'];var _0x2fa9b3=_0x122f44?0x0:_0x457129[_0xbe08('0x1d')];var _0x154559=_0x122f44?_0x2b0901[_0xbe08('0x20')]:_0x457129[_0xbe08('0x1d')]+_0x457129[_0xbe08('0x1f')];var _0x1f9808;if(_0x154559>=_0x344019){_0x154559=_0x344019;_0x1f9808=0xc8;}else{_0x1f9808=0xce;}_0x191f51['status'](_0x1f9808);return _0x191f51[_0xbe08('0x21')](_0xbe08('0x22'),_0x2fa9b3+'-'+_0x154559+'/'+_0x344019)['json'](_0x2b0901);}return null;};}function patchUpdates(_0x5ab5f5){return function(_0x439a78){try{jsonpatch[_0xbe08('0x23')](_0x439a78,_0x5ab5f5,!![]);}catch(_0x3785e4){return BPromise['reject'](_0x3785e4);}return _0x439a78[_0xbe08('0x24')]();};}function saveUpdates(_0x25ce24,_0x42143c){return function(_0x45697b){if(_0x45697b){return _0x45697b[_0xbe08('0x25')](_0x25ce24)[_0xbe08('0x26')](function(_0xf1c94a){return _0xf1c94a;});}return null;};}function removeEntity(_0x451732,_0x2d6493){return function(_0x493d13){if(_0x493d13){return _0x493d13[_0xbe08('0x27')]()[_0xbe08('0x26')](function(){_0x451732[_0xbe08('0x1a')](0xcc)[_0xbe08('0x1b')]();});}};}function handleEntityNotFound(_0x3310be,_0x28d47b){return function(_0x368122){if(!_0x368122){_0x3310be[_0xbe08('0x19')](0x194);}return _0x368122;};}function handleError(_0x628624,_0x361b06){_0x361b06=_0x361b06||0x1f4;return function(_0x5e470c){logger[_0xbe08('0x28')](_0x5e470c[_0xbe08('0x29')]);if(_0x5e470c[_0xbe08('0x2a')]){delete _0x5e470c[_0xbe08('0x2a')];}_0x628624[_0xbe08('0x1a')](_0x361b06)[_0xbe08('0x2b')](_0x5e470c);};}exports['index']=function(_0x415da3,_0x2aaa12){var _0x3b77bb={},_0x465b7b={},_0x1135c3={'count':0x0,'rows':[]};var _0x523be0=_[_0xbe08('0x2c')](db[_0xbe08('0x2d')][_0xbe08('0x2e')],function(_0x54c913){return{'name':_0x54c913[_0xbe08('0x2f')],'type':_0x54c913[_0xbe08('0x30')]['key']};});_0x465b7b[_0xbe08('0x31')]=_[_0xbe08('0x2c')](_0x523be0,'name');_0x465b7b[_0xbe08('0x32')]=_[_0xbe08('0x33')](_0x415da3[_0xbe08('0x32')]);_0x465b7b[_0xbe08('0x34')]=_[_0xbe08('0x35')](_0x465b7b[_0xbe08('0x31')],_0x465b7b[_0xbe08('0x32')]);_0x3b77bb[_0xbe08('0x36')]=_[_0xbe08('0x35')](_0x465b7b[_0xbe08('0x31')],qs[_0xbe08('0x37')](_0x415da3[_0xbe08('0x32')][_0xbe08('0x37')]));_0x3b77bb[_0xbe08('0x36')]=_0x3b77bb[_0xbe08('0x36')]['length']?_0x3b77bb['attributes']:_0x465b7b[_0xbe08('0x31')];if(!_0x415da3[_0xbe08('0x32')]['hasOwnProperty'](_0xbe08('0x38'))){_0x3b77bb[_0xbe08('0x1f')]=qs[_0xbe08('0x1f')](_0x415da3[_0xbe08('0x32')]['limit']);_0x3b77bb[_0xbe08('0x1d')]=qs[_0xbe08('0x1d')](_0x415da3['query']['offset']);}_0x3b77bb[_0xbe08('0x39')]=qs[_0xbe08('0x3a')](_0x415da3[_0xbe08('0x32')][_0xbe08('0x3a')]);_0x3b77bb['where']=qs[_0xbe08('0x34')](_['pick'](_0x415da3[_0xbe08('0x32')],_0x465b7b[_0xbe08('0x34')]),_0x523be0);if(_0x415da3['query'][_0xbe08('0x3b')]){_0x3b77bb[_0xbe08('0x3c')]=_[_0xbe08('0x3d')](_0x3b77bb[_0xbe08('0x3c')],{'$or':_[_0xbe08('0x2c')](_0x523be0,function(_0x56db9c){if(_0x56db9c[_0xbe08('0x30')]!==_0xbe08('0x3e')){var _0x2c80d7={};_0x2c80d7[_0x56db9c[_0xbe08('0x2a')]]={'$like':'%'+_0x415da3[_0xbe08('0x32')][_0xbe08('0x3b')]+'%'};return _0x2c80d7;}})});}_0x3b77bb=_[_0xbe08('0x3d')]({},_0x3b77bb,_0x415da3[_0xbe08('0x3f')]);var _0x357158={'where':_0x3b77bb['where']};return db[_0xbe08('0x2d')][_0xbe08('0x20')](_0x357158)['then'](function(_0x4f0bbe){_0x1135c3[_0xbe08('0x20')]=_0x4f0bbe;if(_0x415da3['query'][_0xbe08('0x40')]){_0x3b77bb['include']=[{'all':!![]}];}return db[_0xbe08('0x2d')][_0xbe08('0x41')](_0x3b77bb);})[_0xbe08('0x26')](function(_0x337c2b){_0x1135c3[_0xbe08('0x42')]=_0x337c2b;return _0x1135c3;})[_0xbe08('0x26')](respondWithFilteredResult(_0x2aaa12,_0x3b77bb))[_0xbe08('0x43')](handleError(_0x2aaa12,null));};exports['show']=function(_0x274139,_0x16d412){var _0x4b4d7a={'raw':!![],'where':{'id':_0x274139['params']['id']}},_0x59179f={};_0x59179f[_0xbe08('0x31')]=_[_0xbe08('0x33')](db['ChatQueueReport']['rawAttributes']);_0x59179f[_0xbe08('0x32')]=_[_0xbe08('0x33')](_0x274139[_0xbe08('0x32')]);_0x59179f[_0xbe08('0x34')]=_[_0xbe08('0x35')](_0x59179f[_0xbe08('0x31')],_0x59179f[_0xbe08('0x32')]);_0x4b4d7a[_0xbe08('0x36')]=_['intersection'](_0x59179f[_0xbe08('0x31')],qs[_0xbe08('0x37')](_0x274139[_0xbe08('0x32')][_0xbe08('0x37')]));_0x4b4d7a[_0xbe08('0x36')]=_0x4b4d7a[_0xbe08('0x36')][_0xbe08('0x44')]?_0x4b4d7a['attributes']:_0x59179f['model'];if(_0x274139[_0xbe08('0x32')][_0xbe08('0x40')]){_0x4b4d7a[_0xbe08('0x45')]=[{'all':!![]}];}_0x4b4d7a=_[_0xbe08('0x3d')]({},_0x4b4d7a,_0x274139[_0xbe08('0x3f')]);return db['ChatQueueReport']['find'](_0x4b4d7a)['then'](handleEntityNotFound(_0x16d412,null))[_0xbe08('0x26')](respondWithResult(_0x16d412,null))['catch'](handleError(_0x16d412,null));};exports['create']=function(_0x1e6e6e,_0x9a9e38){return db[_0xbe08('0x2d')][_0xbe08('0x46')](_0x1e6e6e[_0xbe08('0x47')],{})[_0xbe08('0x26')](respondWithResult(_0x9a9e38,0xc9))[_0xbe08('0x43')](handleError(_0x9a9e38,null));};exports[_0xbe08('0x25')]=function(_0x592a7e,_0x2bd33a){if(_0x592a7e[_0xbe08('0x47')]['id']){delete _0x592a7e[_0xbe08('0x47')]['id'];}return db['ChatQueueReport'][_0xbe08('0x48')]({'where':{'id':_0x592a7e[_0xbe08('0x49')]['id']}})['then'](handleEntityNotFound(_0x2bd33a,null))[_0xbe08('0x26')](saveUpdates(_0x592a7e[_0xbe08('0x47')],null))['then'](respondWithResult(_0x2bd33a,null))[_0xbe08('0x43')](handleError(_0x2bd33a,null));};exports[_0xbe08('0x27')]=function(_0x50c0ec,_0x52c6f1){return db['ChatQueueReport']['find']({'where':{'id':_0x50c0ec['params']['id']}})[_0xbe08('0x26')](handleEntityNotFound(_0x52c6f1,null))[_0xbe08('0x26')](removeEntity(_0x52c6f1,null))['catch'](handleError(_0x52c6f1,null));};exports['describe']=function(_0x2ecf8d,_0x3b0488){return db[_0xbe08('0x2d')][_0xbe08('0x4a')]()[_0xbe08('0x26')](respondWithResult(_0x3b0488,null))[_0xbe08('0x43')](handleError(_0x3b0488,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 9834cc0..888085f 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 _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x47e9da,_0x46a2d6){var _0x2d0e15=function(_0x855457){while(--_0x855457){_0x47e9da['push'](_0x47e9da['shift']());}};_0x2d0e15(++_0x46a2d6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var logger=require(_0x0baf('0x1'))(_0x0baf('0x2'));var moment=require(_0x0baf('0x3'));var BPromise=require(_0x0baf('0x4'));var rp=require(_0x0baf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0baf('0x6'));var config=require(_0x0baf('0x7'));var attributes=require(_0x0baf('0x8'));module[_0x0baf('0x9')]=function(_0xe4c3c4,_0x335e24){return _0xe4c3c4[_0x0baf('0xa')](_0x0baf('0xb'),attributes,{'tableName':_0x0baf('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x0baf('0xd')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x36f16e,_0x4b7a16){var _0x5967c4=function(_0x570e32){while(--_0x570e32){_0x36f16e['push'](_0x36f16e['shift']());}};_0x5967c4(++_0x4b7a16);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./chatQueueReport.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('ChatQueueReport',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[{'name':_0x0d8b('0x9'),'fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 74a7265..1308534 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 _0x0246=['stringify','error','code','message','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport','where','limit','debug','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x556654,_0x3fd5ba){var _0x48c4d2=function(_0x3aba78){while(--_0x3aba78){_0x556654['push'](_0x556654['shift']());}};_0x48c4d2(++_0x3fd5ba);}(_0x0246,0x1c1));var _0x6024=function(_0x45de6d,_0xccce5b){_0x45de6d=_0x45de6d-0x0;var _0x596bda=_0x0246[_0x45de6d];return _0x596bda;};'use strict';var _=require(_0x6024('0x0'));var util=require(_0x6024('0x1'));var moment=require(_0x6024('0x2'));var BPromise=require(_0x6024('0x3'));var rs=require(_0x6024('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6024('0x5'));var logger=require('../../config/logger')(_0x6024('0x6'));var config=require('../../config/environment');var jayson=require(_0x6024('0x7'));var client=jayson[_0x6024('0x8')][_0x6024('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x50255f,_0x5ec5a2,_0x355165){return new BPromise(function(_0x9ec4b5,_0x24b563){return client[_0x6024('0xa')](_0x50255f,_0x355165)[_0x6024('0xb')](function(_0x7f4c9d){logger[_0x6024('0xc')](_0x6024('0xd'),_0x5ec5a2,_0x6024('0xe'));logger['debug'](_0x6024('0xf'),_0x5ec5a2,'request\x20sent',JSON[_0x6024('0x10')](_0x7f4c9d));if(_0x7f4c9d[_0x6024('0x11')]){if(_0x7f4c9d['error'][_0x6024('0x12')]===0x1f4){logger[_0x6024('0x11')](_0x6024('0xd'),_0x5ec5a2,_0x7f4c9d['error'][_0x6024('0x13')]);return _0x24b563(_0x7f4c9d[_0x6024('0x11')][_0x6024('0x13')]);}logger[_0x6024('0x11')](_0x6024('0xd'),_0x5ec5a2,_0x7f4c9d[_0x6024('0x11')]['message']);return _0x9ec4b5(_0x7f4c9d['error'][_0x6024('0x13')]);}else{logger[_0x6024('0xc')](_0x6024('0xd'),_0x5ec5a2,_0x6024('0xe'));_0x9ec4b5(_0x7f4c9d['result'][_0x6024('0x13')]);}})[_0x6024('0x14')](function(_0x28bf6c){logger['error'](_0x6024('0xd'),_0x5ec5a2,_0x28bf6c);_0x24b563(_0x28bf6c);});});}exports[_0x6024('0x15')]=function(_0x1dc902){var _0x394cb9=this;return new Promise(function(_0x22ec9d,_0x294af6){return db['ChatQueueReport'][_0x6024('0x16')](_0x1dc902[_0x6024('0x17')],{'raw':_0x1dc902['options']?_0x1dc902[_0x6024('0x18')][_0x6024('0x19')]===undefined?!![]:![]:!![]})[_0x6024('0xb')](function(_0x523585){logger[_0x6024('0xc')](_0x6024('0x15'),_0x1dc902);logger['debug'](_0x6024('0x15'),_0x1dc902,JSON['stringify'](_0x523585));_0x22ec9d(_0x523585);})[_0x6024('0x14')](function(_0x104515){logger['error'](_0x6024('0x15'),_0x104515[_0x6024('0x13')],_0x1dc902);_0x294af6(_0x394cb9[_0x6024('0x11')](0x1f4,_0x104515[_0x6024('0x13')]));});});};exports[_0x6024('0x1a')]=function(_0x535fcf){var _0x1b5aff=this;return new Promise(function(_0x396392,_0x212373){return db[_0x6024('0x1b')]['update'](_0x535fcf[_0x6024('0x17')],{'raw':_0x535fcf[_0x6024('0x18')]?_0x535fcf[_0x6024('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x535fcf['options']?_0x535fcf['options'][_0x6024('0x1c')]||null:null,'attributes':_0x535fcf['options']?_0x535fcf[_0x6024('0x18')]['attributes']||null:null,'limit':_0x535fcf[_0x6024('0x18')]?_0x535fcf[_0x6024('0x18')][_0x6024('0x1d')]||null:null})[_0x6024('0xb')](function(_0x4fd30a){logger['info'](_0x6024('0x1a'),_0x535fcf);logger[_0x6024('0x1e')](_0x6024('0x1a'),_0x535fcf,JSON['stringify'](_0x4fd30a));_0x396392(_0x4fd30a);})[_0x6024('0x14')](function(_0x5c0fb8){logger[_0x6024('0x11')](_0x6024('0x1a'),_0x5c0fb8[_0x6024('0x13')],_0x535fcf);_0x212373(_0x1b5aff[_0x6024('0x11')](0x1f4,_0x5c0fb8['message']));});});};
\ No newline at end of file
+var _0x9c9c=['stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','raw','UpdateChatQueueReport','update','body','options','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','client','http','request','then','info','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x334fa2,_0x147cc6){var _0x3a1066=function(_0xeb20b){while(--_0xeb20b){_0x334fa2['push'](_0x334fa2['shift']());}};_0x3a1066(++_0x147cc6);}(_0x9c9c,0x1a4));var _0xc9c9=function(_0x22fc1d,_0x5b8ee1){_0x22fc1d=_0x22fc1d-0x0;var _0x29e032=_0x9c9c[_0x22fc1d];return _0x29e032;};'use strict';var _=require(_0xc9c9('0x0'));var util=require(_0xc9c9('0x1'));var moment=require(_0xc9c9('0x2'));var BPromise=require('bluebird');var rs=require(_0xc9c9('0x3'));var fs=require('fs');var Redis=require(_0xc9c9('0x4'));var db=require(_0xc9c9('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc9c9('0x6')][_0xc9c9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1ae062,_0x54a7d2,_0x2b3df){return new BPromise(function(_0x1e3d50,_0x4feac9){return client[_0xc9c9('0x8')](_0x1ae062,_0x2b3df)[_0xc9c9('0x9')](function(_0x462948){logger[_0xc9c9('0xa')]('ChatQueueReport,\x20%s,\x20%s',_0x54a7d2,_0xc9c9('0xb'));logger[_0xc9c9('0xc')](_0xc9c9('0xd'),_0x54a7d2,_0xc9c9('0xb'),JSON[_0xc9c9('0xe')](_0x462948));if(_0x462948[_0xc9c9('0xf')]){if(_0x462948[_0xc9c9('0xf')][_0xc9c9('0x10')]===0x1f4){logger[_0xc9c9('0xf')](_0xc9c9('0x11'),_0x54a7d2,_0x462948[_0xc9c9('0xf')][_0xc9c9('0x12')]);return _0x4feac9(_0x462948[_0xc9c9('0xf')][_0xc9c9('0x12')]);}logger['error'](_0xc9c9('0x11'),_0x54a7d2,_0x462948[_0xc9c9('0xf')][_0xc9c9('0x12')]);return _0x1e3d50(_0x462948['error'][_0xc9c9('0x12')]);}else{logger[_0xc9c9('0xa')](_0xc9c9('0x11'),_0x54a7d2,_0xc9c9('0xb'));_0x1e3d50(_0x462948[_0xc9c9('0x13')][_0xc9c9('0x12')]);}})[_0xc9c9('0x14')](function(_0x59c94d){logger[_0xc9c9('0xf')](_0xc9c9('0x11'),_0x54a7d2,_0x59c94d);_0x4feac9(_0x59c94d);});});}exports[_0xc9c9('0x15')]=function(_0x1d2e29){var _0x2ac465=this;return new Promise(function(_0x418b43,_0xef507f){return db[_0xc9c9('0x16')]['create'](_0x1d2e29['body'],{'raw':_0x1d2e29['options']?_0x1d2e29['options'][_0xc9c9('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x244638){logger[_0xc9c9('0xa')](_0xc9c9('0x15'),_0x1d2e29);logger[_0xc9c9('0xc')](_0xc9c9('0x15'),_0x1d2e29,JSON['stringify'](_0x244638));_0x418b43(_0x244638);})[_0xc9c9('0x14')](function(_0x4642a8){logger[_0xc9c9('0xf')](_0xc9c9('0x15'),_0x4642a8['message'],_0x1d2e29);_0xef507f(_0x2ac465['error'](0x1f4,_0x4642a8[_0xc9c9('0x12')]));});});};exports[_0xc9c9('0x18')]=function(_0x322f8c){var _0x181ede=this;return new Promise(function(_0x42c3ba,_0x3a1770){return db[_0xc9c9('0x16')][_0xc9c9('0x19')](_0x322f8c[_0xc9c9('0x1a')],{'raw':_0x322f8c[_0xc9c9('0x1b')]?_0x322f8c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x322f8c[_0xc9c9('0x1b')]?_0x322f8c['options'][_0xc9c9('0x1c')]||null:null,'attributes':_0x322f8c[_0xc9c9('0x1b')]?_0x322f8c['options'][_0xc9c9('0x1d')]||null:null,'limit':_0x322f8c[_0xc9c9('0x1b')]?_0x322f8c['options'][_0xc9c9('0x1e')]||null:null})[_0xc9c9('0x9')](function(_0x4e2b8e){logger[_0xc9c9('0xa')](_0xc9c9('0x18'),_0x322f8c);logger[_0xc9c9('0xc')](_0xc9c9('0x18'),_0x322f8c,JSON[_0xc9c9('0xe')](_0x4e2b8e));_0x42c3ba(_0x4e2b8e);})[_0xc9c9('0x14')](function(_0x2f738c){logger[_0xc9c9('0xf')](_0xc9c9('0x18'),_0x2f738c['message'],_0x322f8c);_0x3a1770(_0x181ede[_0xc9c9('0xf')](0x1f4,_0x2f738c[_0xc9c9('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index aa503ae..8913f1b 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 _0x5c20=['put','update','delete','exports','multer','util','path','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','post'];(function(_0x2cb0c1,_0x426f52){var _0xe59b55=function(_0xdab165){while(--_0xdab165){_0x2cb0c1['push'](_0x2cb0c1['shift']());}};_0xe59b55(++_0x426f52);}(_0x5c20,0x1e4));var _0x05c2=function(_0x170310,_0x31acf9){_0x170310=_0x170310-0x0;var _0x1b6006=_0x5c20[_0x170310];return _0x1b6006;};'use strict';var multer=require(_0x05c2('0x0'));var util=require(_0x05c2('0x1'));var path=require(_0x05c2('0x2'));var timeout=require(_0x05c2('0x3'));var express=require('express');var router=express[_0x05c2('0x4')]();var fs_extra=require(_0x05c2('0x5'));var auth=require(_0x05c2('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x05c2('0x7'));var controller=require(_0x05c2('0x8'));router['get']('/',auth[_0x05c2('0x9')](),controller[_0x05c2('0xa')]);router[_0x05c2('0xb')](_0x05c2('0xc'),auth['isAuthenticated'](),controller[_0x05c2('0xd')]);router[_0x05c2('0xb')](_0x05c2('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x05c2('0xf')]('/',auth[_0x05c2('0x9')](),controller['create']);router[_0x05c2('0x10')](_0x05c2('0xe'),auth[_0x05c2('0x9')](),controller[_0x05c2('0x11')]);router[_0x05c2('0x12')](_0x05c2('0xe'),auth[_0x05c2('0x9')](),controller['destroy']);module[_0x05c2('0x13')]=router;
\ No newline at end of file
+var _0x0ee5=['Router','fs-extra','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','describe','/:id','post','create','update','destroy','path','connect-timeout','express'];(function(_0x51c819,_0xd812db){var _0x15c5d2=function(_0x2977f0){while(--_0x2977f0){_0x51c819['push'](_0x51c819['shift']());}};_0x15c5d2(++_0xd812db);}(_0x0ee5,0xcd));var _0x50ee=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x0ee5[_0x57b54c];return _0x59cc19;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x50ee('0x0'));var timeout=require(_0x50ee('0x1'));var express=require(_0x50ee('0x2'));var router=express[_0x50ee('0x3')]();var fs_extra=require(_0x50ee('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x50ee('0x5'));var config=require(_0x50ee('0x6'));var controller=require(_0x50ee('0x7'));router[_0x50ee('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x50ee('0x9')](),controller[_0x50ee('0xa')]);router[_0x50ee('0x8')](_0x50ee('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x50ee('0xc')]('/',auth[_0x50ee('0x9')](),controller[_0x50ee('0xd')]);router['put'](_0x50ee('0xb'),auth[_0x50ee('0x9')](),controller[_0x50ee('0xe')]);router['delete']('/:id',auth[_0x50ee('0x9')](),controller[_0x50ee('0xf')]);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 55e20e2..a55a685 100644
--- a/server/api/chatTransferReport/chatTransferReport.attributes.js
+++ b/server/api/chatTransferReport/chatTransferReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xaa88=['account','agent','queue','DATE','NOW','moment','sequelize','exports','STRING'];(function(_0x10f604,_0x120edd){var _0x17119d=function(_0x5e7336){while(--_0x5e7336){_0x10f604['push'](_0x10f604['shift']());}};_0x17119d(++_0x120edd);}(_0xaa88,0x137));var _0x8aa8=function(_0x1ed116,_0x23bc80){_0x1ed116=_0x1ed116-0x0;var _0x574066=_0xaa88[_0x1ed116];return _0x574066;};'use strict';var moment=require(_0x8aa8('0x0'));var Sequelize=require(_0x8aa8('0x1'));module[_0x8aa8('0x2')]={'uniqueid':{'type':Sequelize[_0x8aa8('0x3')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8aa8('0x4'),_0x8aa8('0x5'),_0x8aa8('0x6')),'allowNull':![],'defaultValue':_0x8aa8('0x6')},'transferredAt':{'type':Sequelize[_0x8aa8('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x8aa8('0x8')]}};
\ No newline at end of file
+var _0xedd9=['account','agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x52cd64,_0x3d18a0){var _0x90fb85=function(_0x24c71f){while(--_0x24c71f){_0x52cd64['push'](_0x52cd64['shift']());}};_0x90fb85(++_0x3d18a0);}(_0xedd9,0xfc));var _0x9edd=function(_0x35dc22,_0x1a4b64){_0x35dc22=_0x35dc22-0x0;var _0x56d8e6=_0xedd9[_0x35dc22];return _0x56d8e6;};'use strict';var moment=require('moment');var Sequelize=require(_0x9edd('0x0'));module[_0x9edd('0x1')]={'uniqueid':{'type':Sequelize[_0x9edd('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9edd('0x3')](_0x9edd('0x4'),_0x9edd('0x5'),_0x9edd('0x6')),'allowNull':![],'defaultValue':_0x9edd('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9edd('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index a034a6c..ded5cca 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 _0x9d2b=['stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','create','body','catch','describe','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','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','status','end','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x54ce76,_0x541ef9){var _0x5908d0=function(_0x369d48){while(--_0x369d48){_0x54ce76['push'](_0x54ce76['shift']());}};_0x5908d0(++_0x541ef9);}(_0x9d2b,0x15d));var _0xb9d2=function(_0x2e04ef,_0x31a596){_0x2e04ef=_0x2e04ef-0x0;var _0x5722b0=_0x9d2b[_0x2e04ef];return _0x5722b0;};'use strict';var emlformat=require(_0xb9d2('0x0'));var rimraf=require(_0xb9d2('0x1'));var zipdir=require(_0xb9d2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb9d2('0x3'));var moment=require('moment');var BPromise=require(_0xb9d2('0x4'));var Mustache=require(_0xb9d2('0x5'));var util=require('util');var path=require(_0xb9d2('0x6'));var sox=require(_0xb9d2('0x7'));var csv=require(_0xb9d2('0x8'));var ejs=require(_0xb9d2('0x9'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xb9d2('0xa'));var squel=require(_0xb9d2('0xb'));var crypto=require(_0xb9d2('0xc'));var jsforce=require(_0xb9d2('0xd'));var deskjs=require(_0xb9d2('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xb9d2('0xf'));var qs=require(_0xb9d2('0x10'));var as=require(_0xb9d2('0x11'));var hardwareService=require(_0xb9d2('0x12'));var logger=require(_0xb9d2('0x13'))(_0xb9d2('0x14'));var utils=require(_0xb9d2('0x15'));var config=require(_0xb9d2('0x16'));var licenseUtil=require(_0xb9d2('0x17'));var db=require(_0xb9d2('0x18'))['db'];function respondWithStatusCode(_0x1b4535,_0x381216){_0x381216=_0x381216||0xcc;return function(_0xfd625d){if(_0xfd625d){return _0x1b4535[_0xb9d2('0x19')](_0x381216);}return _0x1b4535[_0xb9d2('0x1a')](_0x381216)[_0xb9d2('0x1b')]();};}function respondWithResult(_0xbfe12,_0x215fe1){_0x215fe1=_0x215fe1||0xc8;return function(_0x3b0d4f){if(_0x3b0d4f){return _0xbfe12[_0xb9d2('0x1a')](_0x215fe1)[_0xb9d2('0x1c')](_0x3b0d4f);}};}function respondWithFilteredResult(_0xd2d92d,_0x4b7836){return function(_0x3e4ce5){if(_0x3e4ce5){var _0x21016a=typeof _0x4b7836[_0xb9d2('0x1d')]===_0xb9d2('0x1e')&&typeof _0x4b7836['limit']==='undefined';var _0x590c2b=_0x3e4ce5[_0xb9d2('0x1f')];var _0x6a8d68=_0x21016a?0x0:_0x4b7836[_0xb9d2('0x1d')];var _0x5cf558=_0x21016a?_0x3e4ce5[_0xb9d2('0x1f')]:_0x4b7836[_0xb9d2('0x1d')]+_0x4b7836[_0xb9d2('0x20')];var _0x360b31;if(_0x5cf558>=_0x590c2b){_0x5cf558=_0x590c2b;_0x360b31=0xc8;}else{_0x360b31=0xce;}_0xd2d92d['status'](_0x360b31);return _0xd2d92d[_0xb9d2('0x21')](_0xb9d2('0x22'),_0x6a8d68+'-'+_0x5cf558+'/'+_0x590c2b)['json'](_0x3e4ce5);}return null;};}function patchUpdates(_0x5e7e0a){return function(_0x490aab){try{jsonpatch[_0xb9d2('0x23')](_0x490aab,_0x5e7e0a,!![]);}catch(_0x120bf4){return BPromise[_0xb9d2('0x24')](_0x120bf4);}return _0x490aab[_0xb9d2('0x25')]();};}function saveUpdates(_0x59379d,_0x118c55){return function(_0x5e423a){if(_0x5e423a){return _0x5e423a[_0xb9d2('0x26')](_0x59379d)[_0xb9d2('0x27')](function(_0x5a46f6){return _0x5a46f6;});}return null;};}function removeEntity(_0x3c11b2,_0x225f84){return function(_0x1cfb3b){if(_0x1cfb3b){return _0x1cfb3b[_0xb9d2('0x28')]()[_0xb9d2('0x27')](function(){_0x3c11b2[_0xb9d2('0x1a')](0xcc)[_0xb9d2('0x1b')]();});}};}function handleEntityNotFound(_0xc7d770,_0x4fdb74){return function(_0x1ad5c7){if(!_0x1ad5c7){_0xc7d770[_0xb9d2('0x19')](0x194);}return _0x1ad5c7;};}function handleError(_0x44b52b,_0x6e9f9b){_0x6e9f9b=_0x6e9f9b||0x1f4;return function(_0x3695ae){logger['error'](_0x3695ae[_0xb9d2('0x29')]);if(_0x3695ae[_0xb9d2('0x2a')]){delete _0x3695ae['name'];}_0x44b52b[_0xb9d2('0x1a')](_0x6e9f9b)[_0xb9d2('0x2b')](_0x3695ae);};}exports[_0xb9d2('0x2c')]=function(_0x4bd696,_0x5d37e1){var _0x231ef2={},_0x3fed60={},_0x1a667e={'count':0x0,'rows':[]};var _0x509a5f=_[_0xb9d2('0x2d')](db[_0xb9d2('0x2e')][_0xb9d2('0x2f')],function(_0x2e8dfd){return{'name':_0x2e8dfd[_0xb9d2('0x30')],'type':_0x2e8dfd['type'][_0xb9d2('0x31')]};});_0x3fed60['model']=_['map'](_0x509a5f,'name');_0x3fed60[_0xb9d2('0x32')]=_['keys'](_0x4bd696['query']);_0x3fed60[_0xb9d2('0x33')]=_[_0xb9d2('0x34')](_0x3fed60[_0xb9d2('0x35')],_0x3fed60[_0xb9d2('0x32')]);_0x231ef2['attributes']=_['intersection'](_0x3fed60[_0xb9d2('0x35')],qs[_0xb9d2('0x36')](_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x36')]));_0x231ef2['attributes']=_0x231ef2['attributes'][_0xb9d2('0x37')]?_0x231ef2[_0xb9d2('0x38')]:_0x3fed60['model'];if(!_0x4bd696['query'][_0xb9d2('0x39')](_0xb9d2('0x3a'))){_0x231ef2[_0xb9d2('0x20')]=qs[_0xb9d2('0x20')](_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x20')]);_0x231ef2[_0xb9d2('0x1d')]=qs[_0xb9d2('0x1d')](_0x4bd696[_0xb9d2('0x32')]['offset']);}_0x231ef2['order']=qs[_0xb9d2('0x3b')](_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x3b')]);_0x231ef2[_0xb9d2('0x3c')]=qs[_0xb9d2('0x33')](_[_0xb9d2('0x3d')](_0x4bd696[_0xb9d2('0x32')],_0x3fed60[_0xb9d2('0x33')]),_0x509a5f);if(_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x3e')]){_0x231ef2[_0xb9d2('0x3c')]=_[_0xb9d2('0x3f')](_0x231ef2[_0xb9d2('0x3c')],{'$or':_[_0xb9d2('0x2d')](_0x509a5f,function(_0x532a09){if(_0x532a09['type']!==_0xb9d2('0x40')){var _0x458269={};_0x458269[_0x532a09['name']]={'$like':'%'+_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x3e')]+'%'};return _0x458269;}})});}_0x231ef2=_[_0xb9d2('0x3f')]({},_0x231ef2,_0x4bd696[_0xb9d2('0x41')]);var _0x399c36={'where':_0x231ef2[_0xb9d2('0x3c')]};return db[_0xb9d2('0x2e')][_0xb9d2('0x1f')](_0x399c36)[_0xb9d2('0x27')](function(_0x436ee1){_0x1a667e['count']=_0x436ee1;if(_0x4bd696[_0xb9d2('0x32')][_0xb9d2('0x42')]){_0x231ef2[_0xb9d2('0x43')]=[{'all':!![]}];}return db['ChatTransferReport'][_0xb9d2('0x44')](_0x231ef2);})['then'](function(_0x5ce7b8){_0x1a667e[_0xb9d2('0x45')]=_0x5ce7b8;return _0x1a667e;})[_0xb9d2('0x27')](respondWithFilteredResult(_0x5d37e1,_0x231ef2))['catch'](handleError(_0x5d37e1,null));};exports[_0xb9d2('0x46')]=function(_0x2bf800,_0x1a83f9){var _0x28929e={'raw':!![],'where':{'id':_0x2bf800[_0xb9d2('0x47')]['id']}},_0x267d7c={};_0x267d7c[_0xb9d2('0x35')]=_['keys'](db[_0xb9d2('0x2e')]['rawAttributes']);_0x267d7c[_0xb9d2('0x32')]=_[_0xb9d2('0x48')](_0x2bf800[_0xb9d2('0x32')]);_0x267d7c[_0xb9d2('0x33')]=_['intersection'](_0x267d7c[_0xb9d2('0x35')],_0x267d7c[_0xb9d2('0x32')]);_0x28929e[_0xb9d2('0x38')]=_[_0xb9d2('0x34')](_0x267d7c[_0xb9d2('0x35')],qs[_0xb9d2('0x36')](_0x2bf800[_0xb9d2('0x32')][_0xb9d2('0x36')]));_0x28929e[_0xb9d2('0x38')]=_0x28929e[_0xb9d2('0x38')][_0xb9d2('0x37')]?_0x28929e[_0xb9d2('0x38')]:_0x267d7c['model'];if(_0x2bf800[_0xb9d2('0x32')][_0xb9d2('0x42')]){_0x28929e[_0xb9d2('0x43')]=[{'all':!![]}];}_0x28929e=_[_0xb9d2('0x3f')]({},_0x28929e,_0x2bf800[_0xb9d2('0x41')]);return db[_0xb9d2('0x2e')][_0xb9d2('0x49')](_0x28929e)[_0xb9d2('0x27')](handleEntityNotFound(_0x1a83f9,null))[_0xb9d2('0x27')](respondWithResult(_0x1a83f9,null))['catch'](handleError(_0x1a83f9,null));};exports[_0xb9d2('0x4a')]=function(_0x21e1b6,_0x704924){return db[_0xb9d2('0x2e')][_0xb9d2('0x4a')](_0x21e1b6[_0xb9d2('0x4b')],{})[_0xb9d2('0x27')](respondWithResult(_0x704924,0xc9))[_0xb9d2('0x4c')](handleError(_0x704924,null));};exports[_0xb9d2('0x26')]=function(_0x3bf264,_0xd13b87){if(_0x3bf264[_0xb9d2('0x4b')]['id']){delete _0x3bf264[_0xb9d2('0x4b')]['id'];}return db[_0xb9d2('0x2e')]['find']({'where':{'id':_0x3bf264[_0xb9d2('0x47')]['id']}})[_0xb9d2('0x27')](handleEntityNotFound(_0xd13b87,null))[_0xb9d2('0x27')](saveUpdates(_0x3bf264['body'],null))[_0xb9d2('0x27')](respondWithResult(_0xd13b87,null))['catch'](handleError(_0xd13b87,null));};exports['destroy']=function(_0x32cc54,_0x2fb812){return db[_0xb9d2('0x2e')][_0xb9d2('0x49')]({'where':{'id':_0x32cc54[_0xb9d2('0x47')]['id']}})['then'](handleEntityNotFound(_0x2fb812,null))['then'](removeEntity(_0x2fb812,null))[_0xb9d2('0x4c')](handleError(_0x2fb812,null));};exports[_0xb9d2('0x4d')]=function(_0x98baf5,_0x1f7023){return db[_0xb9d2('0x2e')][_0xb9d2('0x4d')]()['then'](respondWithResult(_0x1f7023,null))[_0xb9d2('0x4c')](handleError(_0x1f7023,null));};
\ No newline at end of file
+var _0xdb24=['index','map','ChatTransferReport','rawAttributes','type','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','include','findAll','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','fs-extra','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','set','Content-Range','save','then','destroy','error','stack','name','send'];(function(_0x507d89,_0x4f46a4){var _0x2cc381=function(_0x132c2d){while(--_0x132c2d){_0x507d89['push'](_0x507d89['shift']());}};_0x2cc381(++_0x4f46a4);}(_0xdb24,0x18e));var _0x4db2=function(_0x4e2bf9,_0x43a8ea){_0x4e2bf9=_0x4e2bf9-0x0;var _0x51c21e=_0xdb24[_0x4e2bf9];return _0x51c21e;};'use strict';var emlformat=require(_0x4db2('0x0'));var rimraf=require(_0x4db2('0x1'));var zipdir=require(_0x4db2('0x2'));var jsonpatch=require(_0x4db2('0x3'));var rp=require('request-promise');var moment=require(_0x4db2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x4db2('0x5'));var util=require(_0x4db2('0x6'));var path=require('path');var sox=require(_0x4db2('0x7'));var csv=require(_0x4db2('0x8'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x4db2('0x9'));var _=require(_0x4db2('0xa'));var squel=require(_0x4db2('0xb'));var crypto=require(_0x4db2('0xc'));var jsforce=require(_0x4db2('0xd'));var deskjs=require(_0x4db2('0xe'));var toCsv=require(_0x4db2('0x8'));var querystring=require('querystring');var Papa=require(_0x4db2('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x4db2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4db2('0x11'));var logger=require(_0x4db2('0x12'))(_0x4db2('0x13'));var utils=require(_0x4db2('0x14'));var config=require(_0x4db2('0x15'));var licenseUtil=require(_0x4db2('0x16'));var db=require(_0x4db2('0x17'))['db'];function respondWithStatusCode(_0x3741db,_0x3fed12){_0x3fed12=_0x3fed12||0xcc;return function(_0x535d40){if(_0x535d40){return _0x3741db[_0x4db2('0x18')](_0x3fed12);}return _0x3741db[_0x4db2('0x19')](_0x3fed12)[_0x4db2('0x1a')]();};}function respondWithResult(_0x532628,_0x2af98e){_0x2af98e=_0x2af98e||0xc8;return function(_0x559970){if(_0x559970){return _0x532628['status'](_0x2af98e)[_0x4db2('0x1b')](_0x559970);}};}function respondWithFilteredResult(_0x2788c4,_0x590b2b){return function(_0x2b81f7){if(_0x2b81f7){var _0x2c29e8=typeof _0x590b2b[_0x4db2('0x1c')]===_0x4db2('0x1d')&&typeof _0x590b2b['limit']===_0x4db2('0x1d');var _0x9ba8c0=_0x2b81f7['count'];var _0x1931d5=_0x2c29e8?0x0:_0x590b2b[_0x4db2('0x1c')];var _0x2aaec9=_0x2c29e8?_0x2b81f7['count']:_0x590b2b['offset']+_0x590b2b[_0x4db2('0x1e')];var _0x104bed;if(_0x2aaec9>=_0x9ba8c0){_0x2aaec9=_0x9ba8c0;_0x104bed=0xc8;}else{_0x104bed=0xce;}_0x2788c4[_0x4db2('0x19')](_0x104bed);return _0x2788c4[_0x4db2('0x1f')](_0x4db2('0x20'),_0x1931d5+'-'+_0x2aaec9+'/'+_0x9ba8c0)[_0x4db2('0x1b')](_0x2b81f7);}return null;};}function patchUpdates(_0x343755){return function(_0x457586){try{jsonpatch['apply'](_0x457586,_0x343755,!![]);}catch(_0x269f58){return BPromise['reject'](_0x269f58);}return _0x457586[_0x4db2('0x21')]();};}function saveUpdates(_0x103b39,_0x5592eb){return function(_0xeaf744){if(_0xeaf744){return _0xeaf744['update'](_0x103b39)[_0x4db2('0x22')](function(_0x660f85){return _0x660f85;});}return null;};}function removeEntity(_0x143e07,_0x104098){return function(_0x4375b2){if(_0x4375b2){return _0x4375b2[_0x4db2('0x23')]()['then'](function(){_0x143e07[_0x4db2('0x19')](0xcc)[_0x4db2('0x1a')]();});}};}function handleEntityNotFound(_0x229934,_0x157bb8){return function(_0x5e3831){if(!_0x5e3831){_0x229934[_0x4db2('0x18')](0x194);}return _0x5e3831;};}function handleError(_0x245dbb,_0x386a70){_0x386a70=_0x386a70||0x1f4;return function(_0x1857aa){logger[_0x4db2('0x24')](_0x1857aa[_0x4db2('0x25')]);if(_0x1857aa[_0x4db2('0x26')]){delete _0x1857aa['name'];}_0x245dbb[_0x4db2('0x19')](_0x386a70)[_0x4db2('0x27')](_0x1857aa);};}exports[_0x4db2('0x28')]=function(_0x13fef7,_0x316a75){var _0x5756cb={},_0x2924c6={},_0x306931={'count':0x0,'rows':[]};var _0x5ab071=_[_0x4db2('0x29')](db[_0x4db2('0x2a')][_0x4db2('0x2b')],function(_0x54fc54){return{'name':_0x54fc54['fieldName'],'type':_0x54fc54[_0x4db2('0x2c')]['key']};});_0x2924c6[_0x4db2('0x2d')]=_[_0x4db2('0x29')](_0x5ab071,_0x4db2('0x26'));_0x2924c6['query']=_[_0x4db2('0x2e')](_0x13fef7['query']);_0x2924c6['filters']=_[_0x4db2('0x2f')](_0x2924c6[_0x4db2('0x2d')],_0x2924c6[_0x4db2('0x30')]);_0x5756cb[_0x4db2('0x31')]=_[_0x4db2('0x2f')](_0x2924c6['model'],qs['fields'](_0x13fef7[_0x4db2('0x30')][_0x4db2('0x32')]));_0x5756cb[_0x4db2('0x31')]=_0x5756cb['attributes'][_0x4db2('0x33')]?_0x5756cb[_0x4db2('0x31')]:_0x2924c6['model'];if(!_0x13fef7['query'][_0x4db2('0x34')](_0x4db2('0x35'))){_0x5756cb['limit']=qs[_0x4db2('0x1e')](_0x13fef7[_0x4db2('0x30')][_0x4db2('0x1e')]);_0x5756cb[_0x4db2('0x1c')]=qs[_0x4db2('0x1c')](_0x13fef7[_0x4db2('0x30')][_0x4db2('0x1c')]);}_0x5756cb[_0x4db2('0x36')]=qs[_0x4db2('0x37')](_0x13fef7[_0x4db2('0x30')][_0x4db2('0x37')]);_0x5756cb[_0x4db2('0x38')]=qs[_0x4db2('0x39')](_[_0x4db2('0x3a')](_0x13fef7['query'],_0x2924c6['filters']),_0x5ab071);if(_0x13fef7[_0x4db2('0x30')][_0x4db2('0x3b')]){_0x5756cb[_0x4db2('0x38')]=_[_0x4db2('0x3c')](_0x5756cb[_0x4db2('0x38')],{'$or':_['map'](_0x5ab071,function(_0x225df8){if(_0x225df8['type']!=='VIRTUAL'){var _0xc75225={};_0xc75225[_0x225df8[_0x4db2('0x26')]]={'$like':'%'+_0x13fef7[_0x4db2('0x30')]['filter']+'%'};return _0xc75225;}})});}_0x5756cb=_[_0x4db2('0x3c')]({},_0x5756cb,_0x13fef7[_0x4db2('0x3d')]);var _0x4b393e={'where':_0x5756cb['where']};return db[_0x4db2('0x2a')][_0x4db2('0x3e')](_0x4b393e)[_0x4db2('0x22')](function(_0x44d3da){_0x306931[_0x4db2('0x3e')]=_0x44d3da;if(_0x13fef7[_0x4db2('0x30')][_0x4db2('0x3f')]){_0x5756cb[_0x4db2('0x40')]=[{'all':!![]}];}return db[_0x4db2('0x2a')][_0x4db2('0x41')](_0x5756cb);})['then'](function(_0x5ca982){_0x306931['rows']=_0x5ca982;return _0x306931;})[_0x4db2('0x22')](respondWithFilteredResult(_0x316a75,_0x5756cb))[_0x4db2('0x42')](handleError(_0x316a75,null));};exports['show']=function(_0x115ddf,_0x255be8){var _0x205eee={'raw':!![],'where':{'id':_0x115ddf[_0x4db2('0x43')]['id']}},_0x50f48f={};_0x50f48f[_0x4db2('0x2d')]=_[_0x4db2('0x2e')](db[_0x4db2('0x2a')][_0x4db2('0x2b')]);_0x50f48f[_0x4db2('0x30')]=_[_0x4db2('0x2e')](_0x115ddf[_0x4db2('0x30')]);_0x50f48f['filters']=_[_0x4db2('0x2f')](_0x50f48f['model'],_0x50f48f[_0x4db2('0x30')]);_0x205eee['attributes']=_['intersection'](_0x50f48f[_0x4db2('0x2d')],qs[_0x4db2('0x32')](_0x115ddf[_0x4db2('0x30')]['fields']));_0x205eee[_0x4db2('0x31')]=_0x205eee['attributes'][_0x4db2('0x33')]?_0x205eee[_0x4db2('0x31')]:_0x50f48f[_0x4db2('0x2d')];if(_0x115ddf[_0x4db2('0x30')][_0x4db2('0x3f')]){_0x205eee[_0x4db2('0x40')]=[{'all':!![]}];}_0x205eee=_[_0x4db2('0x3c')]({},_0x205eee,_0x115ddf['options']);return db[_0x4db2('0x2a')][_0x4db2('0x44')](_0x205eee)[_0x4db2('0x22')](handleEntityNotFound(_0x255be8,null))[_0x4db2('0x22')](respondWithResult(_0x255be8,null))[_0x4db2('0x42')](handleError(_0x255be8,null));};exports[_0x4db2('0x45')]=function(_0x4499f0,_0x36d7db){return db[_0x4db2('0x2a')][_0x4db2('0x45')](_0x4499f0[_0x4db2('0x46')],{})[_0x4db2('0x22')](respondWithResult(_0x36d7db,0xc9))[_0x4db2('0x42')](handleError(_0x36d7db,null));};exports[_0x4db2('0x47')]=function(_0x1d0cd2,_0x56d149){if(_0x1d0cd2[_0x4db2('0x46')]['id']){delete _0x1d0cd2[_0x4db2('0x46')]['id'];}return db['ChatTransferReport'][_0x4db2('0x44')]({'where':{'id':_0x1d0cd2['params']['id']}})[_0x4db2('0x22')](handleEntityNotFound(_0x56d149,null))[_0x4db2('0x22')](saveUpdates(_0x1d0cd2[_0x4db2('0x46')],null))[_0x4db2('0x22')](respondWithResult(_0x56d149,null))['catch'](handleError(_0x56d149,null));};exports[_0x4db2('0x23')]=function(_0x37beae,_0x168b01){return db[_0x4db2('0x2a')][_0x4db2('0x44')]({'where':{'id':_0x37beae[_0x4db2('0x43')]['id']}})[_0x4db2('0x22')](handleEntityNotFound(_0x168b01,null))[_0x4db2('0x22')](removeEntity(_0x168b01,null))[_0x4db2('0x42')](handleError(_0x168b01,null));};exports['describe']=function(_0x30f663,_0x55c99b){return db[_0x4db2('0x2a')][_0x4db2('0x48')]()[_0x4db2('0x22')](respondWithResult(_0x55c99b,null))[_0x4db2('0x42')](handleError(_0x55c99b,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index 4192131..684bbb7 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 _0x20cb=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','lodash','../../config/logger'];(function(_0x20b70a,_0x210a27){var _0x4dddfe=function(_0x120218){while(--_0x120218){_0x20b70a['push'](_0x20b70a['shift']());}};_0x4dddfe(++_0x210a27);}(_0x20cb,0xb4));var _0xb20c=function(_0x1ac086,_0x479fe4){_0x1ac086=_0x1ac086-0x0;var _0x4a7140=_0x20cb[_0x1ac086];return _0x4a7140;};'use strict';var _=require(_0xb20c('0x0'));var util=require('util');var logger=require(_0xb20c('0x1'))(_0xb20c('0x2'));var moment=require(_0xb20c('0x3'));var BPromise=require(_0xb20c('0x4'));var rp=require(_0xb20c('0x5'));var fs=require('fs');var path=require(_0xb20c('0x6'));var rimraf=require(_0xb20c('0x7'));var config=require(_0xb20c('0x8'));var attributes=require(_0xb20c('0x9'));module[_0xb20c('0xa')]=function(_0x383304,_0x39ca1b){return _0x383304['define'](_0xb20c('0xb'),attributes,{'tableName':_0xb20c('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
+var _0x210b=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x5b8476,_0x30945c){var _0x46cf96=function(_0x234a89){while(--_0x234a89){_0x5b8476['push'](_0x5b8476['shift']());}};_0x46cf96(++_0x30945c);}(_0x210b,0x74));var _0xb210=function(_0xbc346f,_0x3db5c0){_0xbc346f=_0xbc346f-0x0;var _0x9f9260=_0x210b[_0xbc346f];return _0x9f9260;};'use strict';var _=require(_0xb210('0x0'));var util=require(_0xb210('0x1'));var logger=require(_0xb210('0x2'))(_0xb210('0x3'));var moment=require(_0xb210('0x4'));var BPromise=require(_0xb210('0x5'));var rp=require(_0xb210('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb210('0x7'));var config=require('../../config/environment');var attributes=require(_0xb210('0x8'));module[_0xb210('0x9')]=function(_0x39ef17,_0x3e7149){return _0x39ef17['define'](_0xb210('0xa'),attributes,{'tableName':_0xb210('0xb'),'paranoid':![],'indexes':[{'name':_0xb210('0xc'),'fields':[_0xb210('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 44e9b84..28d0222 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 _0xbe5f=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatTransferReport,\x20%s,\x20%s','message','info','result','catch'];(function(_0x12cf1f,_0x3bc1b5){var _0x6a1d52=function(_0x5a5ef9){while(--_0x5a5ef9){_0x12cf1f['push'](_0x12cf1f['shift']());}};_0x6a1d52(++_0x3bc1b5);}(_0xbe5f,0x160));var _0xfbe5=function(_0x204da5,_0x418eeb){_0x204da5=_0x204da5-0x0;var _0x2c7d00=_0xbe5f[_0x204da5];return _0x2c7d00;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfbe5('0x0'));var BPromise=require(_0xfbe5('0x1'));var rs=require(_0xfbe5('0x2'));var fs=require('fs');var Redis=require(_0xfbe5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfbe5('0x4'));var logger=require(_0xfbe5('0x5'))(_0xfbe5('0x6'));var config=require(_0xfbe5('0x7'));var jayson=require(_0xfbe5('0x8'));var client=jayson[_0xfbe5('0x9')][_0xfbe5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2e37ba,_0x5f3d1a,_0x30b9bf){return new BPromise(function(_0x54719a,_0x3b18dc){return client['request'](_0x2e37ba,_0x30b9bf)[_0xfbe5('0xb')](function(_0x2d11cc){logger['info']('ChatTransferReport,\x20%s,\x20%s',_0x5f3d1a,'request\x20sent');logger[_0xfbe5('0xc')](_0xfbe5('0xd'),_0x5f3d1a,_0xfbe5('0xe'),JSON['stringify'](_0x2d11cc));if(_0x2d11cc[_0xfbe5('0xf')]){if(_0x2d11cc[_0xfbe5('0xf')][_0xfbe5('0x10')]===0x1f4){logger[_0xfbe5('0xf')](_0xfbe5('0x11'),_0x5f3d1a,_0x2d11cc[_0xfbe5('0xf')]['message']);return _0x3b18dc(_0x2d11cc[_0xfbe5('0xf')]['message']);}logger[_0xfbe5('0xf')](_0xfbe5('0x11'),_0x5f3d1a,_0x2d11cc[_0xfbe5('0xf')][_0xfbe5('0x12')]);return _0x54719a(_0x2d11cc[_0xfbe5('0xf')][_0xfbe5('0x12')]);}else{logger[_0xfbe5('0x13')](_0xfbe5('0x11'),_0x5f3d1a,_0xfbe5('0xe'));_0x54719a(_0x2d11cc[_0xfbe5('0x14')]['message']);}})[_0xfbe5('0x15')](function(_0xdf4e4c){logger['error'](_0xfbe5('0x11'),_0x5f3d1a,_0xdf4e4c);_0x3b18dc(_0xdf4e4c);});});}
\ No newline at end of file
+var _0xb8f5=['ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x5c0194,_0x4f8c24){var _0x5372c6=function(_0x3c6bf2){while(--_0x3c6bf2){_0x5c0194['push'](_0x5c0194['shift']());}};_0x5372c6(++_0x4f8c24);}(_0xb8f5,0xc7));var _0x5b8f=function(_0x3fd10c,_0x444b43){_0x3fd10c=_0x3fd10c-0x0;var _0x3fc148=_0xb8f5[_0x3fd10c];return _0x3fc148;};'use strict';var _=require(_0x5b8f('0x0'));var util=require(_0x5b8f('0x1'));var moment=require(_0x5b8f('0x2'));var BPromise=require(_0x5b8f('0x3'));var rs=require(_0x5b8f('0x4'));var fs=require('fs');var Redis=require(_0x5b8f('0x5'));var db=require(_0x5b8f('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5b8f('0x7'));var config=require(_0x5b8f('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5b8f('0x9')][_0x5b8f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bb351,_0x4d748d,_0x131f66){return new BPromise(function(_0x53900e,_0x662fe2){return client[_0x5b8f('0xb')](_0x2bb351,_0x131f66)[_0x5b8f('0xc')](function(_0x5ae0d5){logger[_0x5b8f('0xd')](_0x5b8f('0xe'),_0x4d748d,_0x5b8f('0xf'));logger[_0x5b8f('0x10')](_0x5b8f('0x11'),_0x4d748d,'request\x20sent',JSON[_0x5b8f('0x12')](_0x5ae0d5));if(_0x5ae0d5[_0x5b8f('0x13')]){if(_0x5ae0d5[_0x5b8f('0x13')][_0x5b8f('0x14')]===0x1f4){logger[_0x5b8f('0x13')](_0x5b8f('0xe'),_0x4d748d,_0x5ae0d5[_0x5b8f('0x13')][_0x5b8f('0x15')]);return _0x662fe2(_0x5ae0d5[_0x5b8f('0x13')][_0x5b8f('0x15')]);}logger[_0x5b8f('0x13')](_0x5b8f('0xe'),_0x4d748d,_0x5ae0d5[_0x5b8f('0x13')]['message']);return _0x53900e(_0x5ae0d5[_0x5b8f('0x13')][_0x5b8f('0x15')]);}else{logger[_0x5b8f('0xd')]('ChatTransferReport,\x20%s,\x20%s',_0x4d748d,_0x5b8f('0xf'));_0x53900e(_0x5ae0d5[_0x5b8f('0x16')][_0x5b8f('0x15')]);}})[_0x5b8f('0x17')](function(_0x21cc49){logger['error'](_0x5b8f('0xe'),_0x4d748d,_0x21cc49);_0x662fe2(_0x21cc49);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index ebd9011..0d5634c 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 _0xd0ab=['get','isAuthenticated','/describe','describe','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','./chatTransferReport.controller'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd0ab,0x11c));var _0xbd0a=function(_0x21d38f,_0x4bedde){_0x21d38f=_0x21d38f-0x0;var _0x4ca6c9=_0xd0ab[_0x21d38f];return _0x4ca6c9;};'use strict';var multer=require(_0xbd0a('0x0'));var util=require(_0xbd0a('0x1'));var path=require(_0xbd0a('0x2'));var timeout=require(_0xbd0a('0x3'));var express=require(_0xbd0a('0x4'));var router=express[_0xbd0a('0x5')]();var fs_extra=require(_0xbd0a('0x6'));var auth=require(_0xbd0a('0x7'));var interaction=require(_0xbd0a('0x8'));var config=require('../../config/environment');var controller=require(_0xbd0a('0x9'));router[_0xbd0a('0xa')]('/',auth[_0xbd0a('0xb')](),controller['index']);router['get'](_0xbd0a('0xc'),auth['isAuthenticated'](),controller[_0xbd0a('0xd')]);router['get'](_0xbd0a('0xe'),auth['isAuthenticated'](),controller['show']);router[_0xbd0a('0xf')]('/',auth[_0xbd0a('0xb')](),controller[_0xbd0a('0x10')]);router[_0xbd0a('0x11')](_0xbd0a('0xe'),auth['isAuthenticated'](),controller['update']);router[_0xbd0a('0x12')](_0xbd0a('0xe'),auth[_0xbd0a('0xb')](),controller[_0xbd0a('0x13')]);module[_0xbd0a('0x14')]=router;
\ No newline at end of file
+var _0xe9d6=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xe9d6,0x67));var _0x6e9d=function(_0x459af2,_0x8dc490){_0x459af2=_0x459af2-0x0;var _0xfada3c=_0xe9d6[_0x459af2];return _0xfada3c;};'use strict';var multer=require(_0x6e9d('0x0'));var util=require(_0x6e9d('0x1'));var path=require(_0x6e9d('0x2'));var timeout=require(_0x6e9d('0x3'));var express=require(_0x6e9d('0x4'));var router=express[_0x6e9d('0x5')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0x6e9d('0x6'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0x6e9d('0x7')]('/',auth[_0x6e9d('0x8')](),controller[_0x6e9d('0x9')]);router[_0x6e9d('0x7')](_0x6e9d('0xa'),auth[_0x6e9d('0x8')](),controller[_0x6e9d('0xb')]);router[_0x6e9d('0x7')](_0x6e9d('0xc'),auth['isAuthenticated'](),controller[_0x6e9d('0xd')]);router[_0x6e9d('0xe')]('/',auth['isAuthenticated'](),controller[_0x6e9d('0xf')]);router[_0x6e9d('0x10')](_0x6e9d('0xc'),auth[_0x6e9d('0x8')](),controller['update']);router[_0x6e9d('0x11')]('/:id',auth[_0x6e9d('0x8')](),controller[_0x6e9d('0x12')]);module[_0x6e9d('0x13')]=router;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js
index 163860f..207b1e2 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 _0x1be1=['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.','Skip','CHAT','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDisposition','Generated\x20by\x20XCALLY\x20Motion','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','#011F6A','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Send','Contact\x20us','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Feedback','star','thumb','TEXT','stringify','input','name','getDataValue','onlineForm','parse','setDataValue'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1be1,0x192));var _0x11be=function(_0x1a81c8,_0x4ada14){_0x1a81c8=_0x1a81c8-0x0;var _0xe7ed7f=_0x1be1[_0x1a81c8];return _0xe7ed7f;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x11be('0x0')]={'name':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x11be('0x2')},'description':{'type':Sequelize[_0x11be('0x1')]},'mapKey':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x3')},'key':{'type':Sequelize[_0x11be('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x4'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x5'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x9'),_0x11be('0xa')),'defaultValue':'rounded'},'header_online':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xb')},'start_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xd')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xe')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x10')},'noteTitle':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x11')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x12')},'closingMessageButton':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0xc')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x13')},'ratingType':{'type':Sequelize[_0x11be('0x8')](_0x11be('0x14'),_0x11be('0x15')),'defaultValue':_0x11be('0x14')},'ratingStarsNumber':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON[_0x11be('0x17')]({'items':[{'type':_0x11be('0x18'),'variable':null,'config':{'placeholder':_0x11be('0x19'),'type':'text','required':!![]},'props':{'title':_0x11be('0x19'),'helpText':''}},{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':'email'},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x11be('0x1a')](_0x11be('0x1b'))?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x1b'))):{};},'set':function(_0x518e2b){return this[_0x11be('0x1d')]('onlineForm',JSON[_0x11be('0x17')](_0x518e2b));}},'offlineForm':{'type':Sequelize[_0x11be('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x11be('0x18'),'props':{'title':_0x11be('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x11be('0x3'),'type':_0x11be('0x3')},'variable':null},{'type':_0x11be('0x1e'),'config':{'placeholder':_0x11be('0x1f')},'props':{'title':_0x11be('0x1f'),'helpText':_0x11be('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x11be('0x1a')]('offlineForm')?JSON[_0x11be('0x1c')](this['getDataValue'](_0x11be('0x21'))):{};},'set':function(_0x147b62){return this['setDataValue']('offlineForm',JSON[_0x11be('0x17')](_0x147b62));}},'token':{'type':Sequelize[_0x11be('0x1')],'defaultValue':function(){return rs[_0x11be('0x22')]();}},'autoclose':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x11be('0x1')]},'forwardOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x11be('0x1')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x23')},'waitingMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x25')},'offlineMessageBody':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:'},'enableUnmanagedNote':{'type':Sequelize[_0x11be('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x26')},'skipUnmanaged':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x27')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0xc')},'enableCustomerAttachment':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize['TEXT']},'showAgentAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'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[_0x11be('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x11be('0x1')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x11be('0x6')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x28')},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x11be('0x29')},'defaultTitle':{'type':Sequelize[_0x11be('0x1')]},'customerAvatar':{'type':Sequelize[_0x11be('0x16')]},'showCustomerAvatar':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x11be('0x1')],'allowNull':![],'defaultValue':_0x11be('0x2a'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x11be('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x11be('0x1')],'defaultValue':_0x11be('0x2b')},'systemAvatar':{'type':Sequelize[_0x11be('0x16')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x11be('0x6')],'comment':_0x11be('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x11be('0x7')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x2618f5){if(!_0x2618f5)this[_0x11be('0x1d')]('mandatoryDispositionPauseId',null);this[_0x11be('0x1d')](_0x11be('0x2d'),_0x2618f5);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x11be('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x11be('0x2e')},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x11be('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x11be('0x16')],'defaultValue':null},'openNewInteraction':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x11be('0x16')]}};
\ No newline at end of file
+var _0x2750=['BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Send','Feedback','thumb','star','stringify','name','input','getDataValue','parse','onlineForm','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Skip','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','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}}','sequelize','exports','STRING','address','email','Agent','#011F6A','#ffffff','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2750,0x13b));var _0x0275=function(_0x2ae76b,_0x741258){_0x2ae76b=_0x2ae76b-0x0;var _0xc2448e=_0x2750[_0x2ae76b];return _0xc2448e;};'use strict';var Sequelize=require(_0x0275('0x0'));var rs=require('randomstring');module[_0x0275('0x1')]={'name':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'unique':_0x0275('0x3')},'description':{'type':Sequelize[_0x0275('0x2')]},'mapKey':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'mapKeyOffline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x4')},'key':{'type':Sequelize[_0x0275('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x5')},'customerAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x0275('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x7'),'validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x0275('0xa')](_0x0275('0xb'),_0x0275('0xc')),'defaultValue':_0x0275('0xb')},'header_online':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0xd')},'start_chat_button':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xe')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0xf')},'download_transcript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x0275('0x11')]},'closingQuestion':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x13')},'noteTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x14')},'skipMessageButton':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Skip'},'conditionAgreement':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x15')},'ratingType':{'type':Sequelize['ENUM']('star',_0x0275('0x16')),'defaultValue':_0x0275('0x17')},'ratingStarsNumber':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x0275('0x19'),'type':'text','required':!![]},'props':{'title':_0x0275('0x19'),'helpText':''}},{'type':_0x0275('0x1a'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':_0x0275('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x0275('0x1b')]('onlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x1d'))):{};},'set':function(_0x15813f){return this[_0x0275('0x1e')](_0x0275('0x1d'),JSON['stringify'](_0x15813f));}},'offlineForm':{'type':Sequelize[_0x0275('0x11')],'defaultValue':function(){return JSON[_0x0275('0x18')]({'items':[{'type':_0x0275('0x1a'),'props':{'title':_0x0275('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x0275('0x4'),'type':'email'},'variable':null},{'type':_0x0275('0x1f'),'config':{'placeholder':_0x0275('0x20')},'props':{'title':_0x0275('0x20'),'helpText':_0x0275('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x0275('0x1b')]('offlineForm')?JSON[_0x0275('0x1c')](this[_0x0275('0x1b')](_0x0275('0x22'))):{};},'set':function(_0x489d7f){return this['setDataValue'](_0x0275('0x22'),JSON[_0x0275('0x18')](_0x489d7f));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x0275('0x23')]();}},'autoclose':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize['STRING']},'forwardOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x0275('0x2')]},'waitingTitle':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x25')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x26')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x27')},'enableUnmanagedNote':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x0275('0x28')},'skipUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x29')},'sendUnmanaged':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x0275('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x0275('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x0275('0x2a');}},'notificationSound':{'type':Sequelize[_0x0275('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2b')},'waitForTheAssignedAgent':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2c')},'verticalAlignment':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x0275('0x2')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2d')},'defaultTitle':{'type':Sequelize[_0x0275('0x2')]},'customerAvatar':{'type':Sequelize[_0x0275('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x0275('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x2e'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0275('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x0275('0x2')],'defaultValue':_0x0275('0x2f')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0275('0x8')],'comment':_0x0275('0x30')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0275('0x31'),'set':function(_0x76b8fa){if(!_0x76b8fa)this[_0x0275('0x1e')](_0x0275('0x32'),null);this[_0x0275('0x1e')](_0x0275('0x33'),_0x76b8fa);}},'vidaooEscalation':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize['STRING']},'vidaooTopic':{'type':Sequelize[_0x0275('0x2')],'allowNull':![],'defaultValue':_0x0275('0x34')},'vidaooNote':{'type':Sequelize[_0x0275('0x2')],'defaultValue':function(){return _0x0275('0x35');}},'vidaooMetadata':{'type':Sequelize['TEXT'],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x0275('0x9')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x0275('0x11')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index 4bcca23..b47721d 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 _0xc04f=['findAll','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','addLogo','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','getLicense','custom','isNil','existsSync','server/files/images/logos/','getAvatar','server/files/images/avatars/default_avatar.png','download','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','server/files/images/avatars/','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','list','applications','orderBy','priority','asc','account','contact','customerIp','cf-connecting-ip','x-forwarded-for','split','firstName','referer','browser','version','format','unknown','%s\x20%s','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','server','attachments','offline-chat','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','offlineMessageSubject','MailAccountId','subjectOffline','toPairsIn','mapValues','email','NotifyMailAccount','remove','addInteraction','omit','getInteractions','fullname','internal','Tag','Tags','color','tag','Command','iftime\x20%s,%s','timezone','iftime\x20%s','interval','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','getSnippet','Interval','Intervals','getProactiveActions','../../config/license/util','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','x-real-ip','connection','virtual','replace','verticalAlignment','labelText','textButtonColor','color_button','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','finally','getApplications','chatProactiveAction','getFields','false','items','fromKey','getOfflineMessages','Contact','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','bluebird','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','http','client','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','result','message','catch','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','Pause','map','ChatWebsite','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','rows','show','params','mandatoryDispositionPause','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne'];(function(_0x181a3e,_0x515ca1){var _0x4c135d=function(_0x296928){while(--_0x296928){_0x181a3e['push'](_0x181a3e['shift']());}};_0x4c135d(++_0x515ca1);}(_0xc04f,0xcc));var _0xfc04=function(_0x59be39,_0x38558d){_0x59be39=_0x59be39-0x0;var _0x136795=_0xc04f[_0x59be39];return _0x136795;};'use strict';var BPromise=require(_0xfc04('0x0'));var Mustache=require('mustache');var util=require('util');var path=require('path');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xfc04('0x1'));var _=require(_0xfc04('0x2'));var querystring=require(_0xfc04('0x3'));var Redis=require(_0xfc04('0x4'));var qs=require(_0xfc04('0x5'));var logger=require('../../config/logger')(_0xfc04('0x6'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xfc04('0x7')]=_[_0xfc04('0x8')](config[_0xfc04('0x7')],{'host':_0xfc04('0x9'),'port':0x18eb});var socket=require(_0xfc04('0xa'))(new Redis(config[_0xfc04('0x7')]));require(_0xfc04('0xb'))[_0xfc04('0xc')](socket);var htmlToText=require(_0xfc04('0xd'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc04('0xe')]({'port':0x232c});var client9002=jayson[_0xfc04('0xf')][_0xfc04('0xe')]({'port':0x232a});var client9003=jayson[_0xfc04('0xf')][_0xfc04('0xe')]({'port':0x232b});var client9001=jayson[_0xfc04('0xf')][_0xfc04('0xe')]({'port':0x2329});function respondWithRpcPromise(_0x1bcf6f,_0x32cd54,_0x171a63,_0x27b55a){return new BPromise(function(_0x2550fb,_0x5b793f){var _0x5b3b1b=_0x27b55a||client;return _0x5b3b1b[_0xfc04('0x10')](_0x1bcf6f,_0x171a63)[_0xfc04('0x11')](function(_0x4a6123){logger[_0xfc04('0x12')]('ChatWebsite,\x20%s,\x20%s',_0x32cd54,_0xfc04('0x13'));logger[_0xfc04('0x14')](_0xfc04('0x15'),_0x32cd54,_0xfc04('0x13'),JSON[_0xfc04('0x16')](_0x4a6123));if(_0x4a6123['error']){if(_0x4a6123[_0xfc04('0x17')]['code']===0x1f4){logger[_0xfc04('0x17')](_0xfc04('0x18'),_0x32cd54,_0x4a6123[_0xfc04('0x17')]['message']);return _0x5b793f(_0x4a6123['error']['message']);}logger[_0xfc04('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x32cd54,_0x4a6123[_0xfc04('0x17')]['message']);return _0x2550fb(_0x4a6123[_0xfc04('0x17')]['message']);}else{logger['info'](_0xfc04('0x18'),_0x32cd54,_0xfc04('0x13'));_0x2550fb(_0x4a6123[_0xfc04('0x19')][_0xfc04('0x1a')]);}})[_0xfc04('0x1b')](function(_0x7b37d5){logger[_0xfc04('0x17')](_0xfc04('0x18'),_0x32cd54,_0x7b37d5);_0x5b793f(_0x7b37d5);});});}function respondWithStatusCode(_0x1dbc62,_0x3cc5eb){_0x3cc5eb=_0x3cc5eb||0xcc;return function(_0x46698b){if(_0x46698b){return _0x1dbc62[_0xfc04('0x1c')](_0x3cc5eb);}return _0x1dbc62[_0xfc04('0x1d')](_0x3cc5eb)[_0xfc04('0x1e')]();};}function respondWithResult(_0x311fef,_0x153b71){_0x153b71=_0x153b71||0xc8;return function(_0x5ca82b){if(_0x5ca82b){return _0x311fef[_0xfc04('0x1d')](_0x153b71)[_0xfc04('0x1f')](_0x5ca82b);}};}function respondWithFilteredResult(_0x32c4a9,_0x2c7859){return function(_0x5783bf){if(_0x5783bf){var _0x477a9c=typeof _0x2c7859[_0xfc04('0x20')]==='undefined'&&typeof _0x2c7859[_0xfc04('0x21')]===_0xfc04('0x22');var _0x3fd21a=_0x5783bf[_0xfc04('0x23')];var _0x30dafd=_0x477a9c?0x0:_0x2c7859[_0xfc04('0x20')];var _0x519fec=_0x477a9c?_0x5783bf[_0xfc04('0x23')]:_0x2c7859[_0xfc04('0x20')]+_0x2c7859[_0xfc04('0x21')];var _0x2b7308;if(_0x519fec>=_0x3fd21a){_0x519fec=_0x3fd21a;_0x2b7308=0xc8;}else{_0x2b7308=0xce;}_0x32c4a9[_0xfc04('0x1d')](_0x2b7308);return _0x32c4a9[_0xfc04('0x24')](_0xfc04('0x25'),_0x30dafd+'-'+_0x519fec+'/'+_0x3fd21a)['json'](_0x5783bf);}return null;};}function saveUpdates(_0x4f56f7){return function(_0x19bdfd){if(_0x19bdfd){return _0x19bdfd[_0xfc04('0x26')](_0x4f56f7)['then'](function(_0x1f77c3){return _0x1f77c3;});}return null;};}function removeEntity(_0x35870b){return function(_0x28bcfe){if(_0x28bcfe){return _0x28bcfe[_0xfc04('0x27')]()[_0xfc04('0x11')](function(){var _0x1fd33e=_0x28bcfe[_0xfc04('0x28')]({'plain':!![]});var _0x48cb05=_0xfc04('0x29');return db[_0xfc04('0x2a')][_0xfc04('0x27')]({'where':{'type':_0x48cb05,'resourceId':_0x1fd33e['id']}})['then'](function(){return _0x28bcfe;});})[_0xfc04('0x11')](function(){_0x35870b['status'](0xcc)[_0xfc04('0x1e')]();});}};}function handleEntityNotFound(_0x3f7f03){return function(_0x1385b3){if(!_0x1385b3){_0x3f7f03[_0xfc04('0x1c')](0x194);}return _0x1385b3;};}function handleError(_0x67a6c3,_0x5f1008){_0x5f1008=_0x5f1008||0x1f4;return function(_0x5137b5){logger[_0xfc04('0x17')](_0x5137b5['stack']);if(_0x5137b5[_0xfc04('0x2b')]){delete _0x5137b5[_0xfc04('0x2b')];}_0x67a6c3[_0xfc04('0x1d')](_0x5f1008)[_0xfc04('0x2c')](_0x5137b5);};}exports[_0xfc04('0x2d')]=function(_0x1c7209,_0x474cf4){var _0x536f12={'include':[{'model':db[_0xfc04('0x2e')],'as':'mandatoryDispositionPause'}]},_0x37f386={},_0x2f626e={'count':0x0,'rows':[]};var _0x3ae43d=_[_0xfc04('0x2f')](db[_0xfc04('0x30')][_0xfc04('0x31')],function(_0x2ed721){return{'name':_0x2ed721[_0xfc04('0x32')],'type':_0x2ed721[_0xfc04('0x33')][_0xfc04('0x34')]};});_0x37f386[_0xfc04('0x35')]=_[_0xfc04('0x2f')](_0x3ae43d,_0xfc04('0x2b'));_0x37f386['query']=_[_0xfc04('0x36')](_0x1c7209['query']);_0x37f386[_0xfc04('0x37')]=_[_0xfc04('0x38')](_0x37f386[_0xfc04('0x35')],_0x37f386[_0xfc04('0x39')]);_0x536f12['attributes']=_['intersection'](_0x37f386[_0xfc04('0x35')],qs['fields'](_0x1c7209[_0xfc04('0x39')][_0xfc04('0x3a')]));_0x536f12[_0xfc04('0x3b')]=_0x536f12[_0xfc04('0x3b')][_0xfc04('0x3c')]?_0x536f12[_0xfc04('0x3b')]:_0x37f386[_0xfc04('0x35')];if(!_0x1c7209[_0xfc04('0x39')][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x536f12[_0xfc04('0x21')]=qs[_0xfc04('0x21')](_0x1c7209[_0xfc04('0x39')][_0xfc04('0x21')]);_0x536f12[_0xfc04('0x20')]=qs[_0xfc04('0x20')](_0x1c7209[_0xfc04('0x39')][_0xfc04('0x20')]);}_0x536f12[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x1c7209[_0xfc04('0x39')][_0xfc04('0x40')]);_0x536f12['where']=qs['filters'](_[_0xfc04('0x41')](_0x1c7209[_0xfc04('0x39')],_0x37f386[_0xfc04('0x37')]),_0x3ae43d);if(_0x1c7209[_0xfc04('0x39')][_0xfc04('0x42')]){_0x536f12[_0xfc04('0x43')]=_[_0xfc04('0x44')](_0x536f12['where'],{'$or':_['map'](_0x3ae43d,function(_0x38d4c7){if(_0x38d4c7['type']!=='VIRTUAL'){var _0x3a2488={};_0x3a2488[_0x38d4c7[_0xfc04('0x2b')]]={'$like':'%'+_0x1c7209['query']['filter']+'%'};return _0x3a2488;}})});}_0x536f12=_[_0xfc04('0x44')]({},_0x536f12,_0x1c7209[_0xfc04('0x45')]);var _0x5ec0a8={'where':_0x536f12[_0xfc04('0x43')]};return db[_0xfc04('0x30')][_0xfc04('0x23')](_0x5ec0a8)['then'](function(_0x2ad3b2){_0x2f626e[_0xfc04('0x23')]=_0x2ad3b2;if(_0x1c7209['query'][_0xfc04('0x46')]){_0x536f12['include']=[{'all':!![]}];}return db[_0xfc04('0x30')]['findAll'](_0x536f12);})[_0xfc04('0x11')](function(_0x370aac){_0x2f626e[_0xfc04('0x47')]=_0x370aac;return _0x2f626e;})[_0xfc04('0x11')](respondWithFilteredResult(_0x474cf4,_0x536f12))[_0xfc04('0x1b')](handleError(_0x474cf4,null));};exports[_0xfc04('0x48')]=function(_0x464bd8,_0x2b3100){var _0x4503fa={'raw':![],'where':{'id':_0x464bd8[_0xfc04('0x49')]['id']},'include':[{'model':db[_0xfc04('0x2e')],'as':_0xfc04('0x4a')}]},_0x39c59d={};_0x39c59d['model']=_[_0xfc04('0x36')](db['ChatWebsite']['rawAttributes']);_0x39c59d[_0xfc04('0x39')]=_[_0xfc04('0x36')](_0x464bd8[_0xfc04('0x39')]);_0x39c59d['filters']=_[_0xfc04('0x38')](_0x39c59d[_0xfc04('0x35')],_0x39c59d[_0xfc04('0x39')]);_0x4503fa[_0xfc04('0x3b')]=_[_0xfc04('0x38')](_0x39c59d[_0xfc04('0x35')],qs['fields'](_0x464bd8[_0xfc04('0x39')]['fields']));_0x4503fa[_0xfc04('0x3b')]=_0x4503fa['attributes'][_0xfc04('0x3c')]?_0x4503fa[_0xfc04('0x3b')]:_0x39c59d[_0xfc04('0x35')];if(_0x464bd8[_0xfc04('0x39')][_0xfc04('0x46')]){_0x4503fa[_0xfc04('0x4b')]=[{'all':!![]}];}_0x4503fa=_[_0xfc04('0x44')]({},_0x4503fa,_0x464bd8[_0xfc04('0x45')]);return db[_0xfc04('0x30')][_0xfc04('0x4c')](_0x4503fa)[_0xfc04('0x11')](handleEntityNotFound(_0x2b3100,null))[_0xfc04('0x11')](respondWithResult(_0x2b3100,null))[_0xfc04('0x1b')](handleError(_0x2b3100,null));};exports['create']=function(_0x440ea0,_0x5648a6){return db[_0xfc04('0x30')][_0xfc04('0x4d')](_0x440ea0['body'],{})[_0xfc04('0x11')](function(_0x5034c4){var _0x1e7fc0=_0x440ea0[_0xfc04('0x4e')][_0xfc04('0x28')]({'plain':!![]});if(!_0x1e7fc0)throw new Error(_0xfc04('0x4f'));if(_0x1e7fc0['role']===_0xfc04('0x4e')){var _0x353481=_0x5034c4[_0xfc04('0x28')]({'plain':!![]});var _0x221873='ChatWebsites';return db['UserProfileSection'][_0xfc04('0x4c')]({'where':{'name':_0x221873,'userProfileId':_0x1e7fc0[_0xfc04('0x50')]},'raw':!![]})[_0xfc04('0x11')](function(_0x580b08){if(_0x580b08&&_0x580b08['autoAssociation']===0x0){return db[_0xfc04('0x2a')][_0xfc04('0x4d')]({'name':_0x353481[_0xfc04('0x2b')],'resourceId':_0x353481['id'],'type':_0x580b08['name'],'sectionId':_0x580b08['id']},{})[_0xfc04('0x11')](function(){return _0x5034c4;});}else{return _0x5034c4;}})[_0xfc04('0x1b')](function(_0x4b3520){logger[_0xfc04('0x17')](_0xfc04('0x51'),_0x4b3520);throw _0x4b3520;});}return _0x5034c4;})[_0xfc04('0x11')](respondWithResult(_0x5648a6,0xc9))[_0xfc04('0x1b')](handleError(_0x5648a6,null));};exports[_0xfc04('0x26')]=function(_0x41384c,_0x25337e){if(_0x41384c[_0xfc04('0x52')]['id']){delete _0x41384c['body']['id'];}return db[_0xfc04('0x30')]['find']({'where':{'id':_0x41384c[_0xfc04('0x49')]['id']},'include':[{'model':db[_0xfc04('0x2e')],'as':'mandatoryDispositionPause'}]})[_0xfc04('0x11')](handleEntityNotFound(_0x25337e,null))[_0xfc04('0x11')](saveUpdates(_0x41384c[_0xfc04('0x52')],null))[_0xfc04('0x11')](respondWithResult(_0x25337e,null))['catch'](handleError(_0x25337e,null));};exports[_0xfc04('0x27')]=function(_0x4b5c5d,_0x549129){return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x4b5c5d[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x549129,null))[_0xfc04('0x11')](removeEntity(_0x549129,null))[_0xfc04('0x1b')](handleError(_0x549129,null));};exports['describe']=function(_0x339fbf,_0x56eabc){return db[_0xfc04('0x30')][_0xfc04('0x53')]()[_0xfc04('0x11')](respondWithResult(_0x56eabc,null))[_0xfc04('0x1b')](handleError(_0x56eabc,null));};exports[_0xfc04('0x54')]=function(_0x58c022,_0x5b3a91){if(_0x58c022[_0xfc04('0x52')]['id']){delete _0x58c022[_0xfc04('0x52')]['id'];}return db[_0xfc04('0x30')]['find']({'where':{'id':_0x58c022[_0xfc04('0x49')]['id']}})['then'](handleEntityNotFound(_0x5b3a91,null))[_0xfc04('0x11')](function(_0x2a4dd4){if(_0x2a4dd4){_0x58c022[_0xfc04('0x52')][_0xfc04('0x55')]=_0x2a4dd4['id'];return db[_0xfc04('0x56')]['create'](_0x58c022['body']);}})[_0xfc04('0x11')](respondWithResult(_0x5b3a91,null))[_0xfc04('0x1b')](handleError(_0x5b3a91,null));};exports[_0xfc04('0x57')]=function(_0x1e41a7,_0x176211){var _0x14579c={'raw':![],'where':{}};var _0x445c4d={};var _0x52a756={'count':0x0,'rows':[]};return db[_0xfc04('0x30')][_0xfc04('0x58')]({'where':{'id':_0x1e41a7[_0xfc04('0x49')]['id']}})['then'](handleEntityNotFound(_0x176211,null))[_0xfc04('0x11')](function(_0x431c71){if(_0x431c71){_0x445c4d['model']=_['keys'](db[_0xfc04('0x56')][_0xfc04('0x31')]);_0x445c4d[_0xfc04('0x39')]=_['keys'](_0x1e41a7[_0xfc04('0x39')]);_0x445c4d[_0xfc04('0x37')]=_[_0xfc04('0x38')](_0x445c4d[_0xfc04('0x35')],_0x445c4d[_0xfc04('0x39')]);_0x14579c[_0xfc04('0x3b')]=_[_0xfc04('0x38')](_0x445c4d['model'],qs[_0xfc04('0x3a')](_0x1e41a7['query'][_0xfc04('0x3a')]));_0x14579c[_0xfc04('0x3b')]=_0x14579c['attributes'][_0xfc04('0x3c')]?_0x14579c[_0xfc04('0x3b')]:_0x445c4d['model'];if(!_0x1e41a7[_0xfc04('0x39')][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x14579c['limit']=qs[_0xfc04('0x21')](_0x1e41a7['query'][_0xfc04('0x21')]);_0x14579c[_0xfc04('0x20')]=qs[_0xfc04('0x20')](_0x1e41a7[_0xfc04('0x39')][_0xfc04('0x20')]);}_0x14579c[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x1e41a7[_0xfc04('0x39')][_0xfc04('0x40')]);_0x14579c[_0xfc04('0x43')]=qs[_0xfc04('0x37')](_[_0xfc04('0x41')](_0x1e41a7[_0xfc04('0x39')],_0x445c4d[_0xfc04('0x37')]));_0x14579c[_0xfc04('0x43')][_0xfc04('0x55')]=_0x431c71['id'];if(_0x1e41a7[_0xfc04('0x39')]['filter']){_0x14579c[_0xfc04('0x43')]=_[_0xfc04('0x44')](_0x14579c['where'],{'$or':_['map'](_0x14579c['attributes'],function(_0x4f10db){var _0x1a27e1={};_0x1a27e1[_0x4f10db]={'$like':'%'+_0x1e41a7[_0xfc04('0x39')][_0xfc04('0x42')]+'%'};return _0x1a27e1;})});}_0x14579c=_['merge']({},_0x14579c,_0x1e41a7[_0xfc04('0x45')]);return db['Disposition']['count']({'where':_0x14579c[_0xfc04('0x43')]})[_0xfc04('0x11')](function(_0x43d7e0){_0x52a756[_0xfc04('0x23')]=_0x43d7e0;if(_0x1e41a7[_0xfc04('0x39')][_0xfc04('0x46')]){_0x14579c[_0xfc04('0x4b')]=[{'all':!![]}];}return db[_0xfc04('0x56')][_0xfc04('0x59')](_0x14579c);})[_0xfc04('0x11')](function(_0x322733){_0x52a756[_0xfc04('0x47')]=_0x322733;return _0x52a756;});}})['then'](respondWithFilteredResult(_0x176211,_0x14579c))[_0xfc04('0x1b')](handleError(_0x176211,null));};exports[_0xfc04('0x5a')]=function(_0x4c58b6,_0x1b350c){return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x4c58b6[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x1b350c,null))['then'](function(_0x348c50){if(_0x348c50){return _0x348c50[_0xfc04('0x5a')](_0x4c58b6[_0xfc04('0x39')][_0xfc04('0x5b')]);}})['then'](respondWithStatusCode(_0x1b350c,null))[_0xfc04('0x1b')](handleError(_0x1b350c,null));};exports['addAnswer']=function(_0x49d5b3,_0x5e1db5){if(_0x49d5b3[_0xfc04('0x52')]['id']){delete _0x49d5b3['body']['id'];}return db['ChatWebsite'][_0xfc04('0x4c')]({'where':{'id':_0x49d5b3['params']['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x5e1db5,null))[_0xfc04('0x11')](function(_0xe08281){if(_0xe08281){_0x49d5b3['body']['ChatWebsiteId']=_0xe08281['id'];return db[_0xfc04('0x5c')][_0xfc04('0x4d')](_0x49d5b3[_0xfc04('0x52')]);}})['then'](respondWithResult(_0x5e1db5,null))['catch'](handleError(_0x5e1db5,null));};exports[_0xfc04('0x5d')]=function(_0x5dfadf,_0x1fa2dd){var _0x37c4f8={'raw':![],'where':{}};var _0x38c791={};var _0x15f7c8={'count':0x0,'rows':[]};return db[_0xfc04('0x30')][_0xfc04('0x58')]({'where':{'id':_0x5dfadf['params']['id']}})['then'](handleEntityNotFound(_0x1fa2dd,null))[_0xfc04('0x11')](function(_0x69ca8b){if(_0x69ca8b){_0x38c791['model']=_[_0xfc04('0x36')](db[_0xfc04('0x5c')][_0xfc04('0x31')]);_0x38c791[_0xfc04('0x39')]=_[_0xfc04('0x36')](_0x5dfadf[_0xfc04('0x39')]);_0x38c791[_0xfc04('0x37')]=_['intersection'](_0x38c791[_0xfc04('0x35')],_0x38c791[_0xfc04('0x39')]);_0x37c4f8['attributes']=_['intersection'](_0x38c791[_0xfc04('0x35')],qs[_0xfc04('0x3a')](_0x5dfadf[_0xfc04('0x39')]['fields']));_0x37c4f8[_0xfc04('0x3b')]=_0x37c4f8[_0xfc04('0x3b')]['length']?_0x37c4f8[_0xfc04('0x3b')]:_0x38c791[_0xfc04('0x35')];if(!_0x5dfadf[_0xfc04('0x39')][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x37c4f8['limit']=qs[_0xfc04('0x21')](_0x5dfadf[_0xfc04('0x39')][_0xfc04('0x21')]);_0x37c4f8[_0xfc04('0x20')]=qs[_0xfc04('0x20')](_0x5dfadf['query'][_0xfc04('0x20')]);}_0x37c4f8[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x5dfadf[_0xfc04('0x39')][_0xfc04('0x40')]);_0x37c4f8['where']=qs[_0xfc04('0x37')](_[_0xfc04('0x41')](_0x5dfadf[_0xfc04('0x39')],_0x38c791[_0xfc04('0x37')]));_0x37c4f8['where'][_0xfc04('0x55')]=_0x69ca8b['id'];if(_0x5dfadf[_0xfc04('0x39')]['filter']){_0x37c4f8['where']=_[_0xfc04('0x44')](_0x37c4f8[_0xfc04('0x43')],{'$or':_[_0xfc04('0x2f')](_0x37c4f8[_0xfc04('0x3b')],function(_0x3bd997){var _0x1df1f2={};_0x1df1f2[_0x3bd997]={'$like':'%'+_0x5dfadf['query']['filter']+'%'};return _0x1df1f2;})});}_0x37c4f8=_[_0xfc04('0x44')]({},_0x37c4f8,_0x5dfadf[_0xfc04('0x45')]);return db['CannedAnswer']['count']({'where':_0x37c4f8[_0xfc04('0x43')]})[_0xfc04('0x11')](function(_0x19e3f0){_0x15f7c8[_0xfc04('0x23')]=_0x19e3f0;if(_0x5dfadf[_0xfc04('0x39')][_0xfc04('0x46')]){_0x37c4f8['include']=[{'all':!![]}];}return db[_0xfc04('0x5c')][_0xfc04('0x59')](_0x37c4f8);})[_0xfc04('0x11')](function(_0x28b665){_0x15f7c8[_0xfc04('0x47')]=_0x28b665;return _0x15f7c8;});}})[_0xfc04('0x11')](respondWithFilteredResult(_0x1fa2dd,_0x37c4f8))['catch'](handleError(_0x1fa2dd,null));};exports[_0xfc04('0x5e')]=function(_0x10bde6,_0x3560d3){return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x10bde6[_0xfc04('0x49')]['id']}})['then'](handleEntityNotFound(_0x3560d3,null))[_0xfc04('0x11')](function(_0x1ec5a8){if(_0x1ec5a8){return _0x1ec5a8[_0xfc04('0x5e')](_0x10bde6[_0xfc04('0x39')][_0xfc04('0x5b')]);}})[_0xfc04('0x11')](respondWithStatusCode(_0x3560d3,null))[_0xfc04('0x1b')](handleError(_0x3560d3,null));};exports[_0xfc04('0x5f')]=function(_0x1faf01,_0xc5e095){_0x1faf01[_0xfc04('0x52')]['sitepic']=_0x1faf01[_0xfc04('0x60')][_0xfc04('0x61')];return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x1faf01[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0xc5e095,null))[_0xfc04('0x11')](saveUpdates(_0x1faf01[_0xfc04('0x52')],null))['then'](respondWithResult(_0xc5e095,null))[_0xfc04('0x1b')](handleError(_0xc5e095,null));};exports['addAvatar']=function(_0x149da1,_0x38926d){_0x149da1[_0xfc04('0x52')][_0xfc04('0x62')]=_0x149da1[_0xfc04('0x60')]['filename'];return db['ChatWebsite']['find']({'where':{'id':_0x149da1[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x38926d,null))[_0xfc04('0x11')](saveUpdates(_0x149da1['body'],null))[_0xfc04('0x11')](respondWithResult(_0x38926d,null))['catch'](handleError(_0x38926d,null));};exports[_0xfc04('0x63')]=function(_0x422d05,_0x10a9e0){_0x422d05[_0xfc04('0x52')][_0xfc04('0x64')]=_0x422d05[_0xfc04('0x60')][_0xfc04('0x61')];return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x422d05[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x10a9e0,null))[_0xfc04('0x11')](saveUpdates(_0x422d05['body'],null))[_0xfc04('0x11')](respondWithResult(_0x10a9e0,null))['catch'](handleError(_0x10a9e0,null));};exports[_0xfc04('0x65')]=function(_0x3ded5b,_0x2ae7ca){_0x3ded5b['body'][_0xfc04('0x66')]=_0x3ded5b['file'][_0xfc04('0x61')];return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x3ded5b[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x2ae7ca,null))[_0xfc04('0x11')](saveUpdates(_0x3ded5b[_0xfc04('0x52')],null))['then'](respondWithResult(_0x2ae7ca,null))[_0xfc04('0x1b')](handleError(_0x2ae7ca,null));};exports[_0xfc04('0x67')]=function(_0x517926,_0x29304b){var _0x588aa3=path[_0xfc04('0x68')](config[_0xfc04('0x69')],_0xfc04('0x6a'));var _0x249bdd={'where':{'id':_0x517926[_0xfc04('0x49')]['id']},'attributes':['id',_0xfc04('0x6b')],'raw':!![]};var _0x118a57=![];return require('../../config/license/util')[_0xfc04('0x6c')]()['then'](function(_0x420b3f){if(_0x420b3f){_0x118a57=_0x420b3f[_0xfc04('0x6d')];}})[_0xfc04('0x11')](function(){return db[_0xfc04('0x30')][_0xfc04('0x4c')](_0x249bdd);})[_0xfc04('0x11')](handleEntityNotFound(_0x29304b,null))[_0xfc04('0x11')](function(_0xf8f6ea){if(_0xf8f6ea){if(!_[_0xfc04('0x6e')](_0xf8f6ea[_0xfc04('0x6b')])){if(fs[_0xfc04('0x6f')](path[_0xfc04('0x68')](config[_0xfc04('0x69')],_0xfc04('0x70'),_0xf8f6ea[_0xfc04('0x6b')]))&&_0x118a57){_0x588aa3=path[_0xfc04('0x68')](config[_0xfc04('0x69')],_0xfc04('0x70'),_0xf8f6ea[_0xfc04('0x6b')]);}}return _0x29304b['download'](_0x588aa3);}})[_0xfc04('0x1b')](handleError(_0x29304b,null));};exports[_0xfc04('0x71')]=function(_0xd882d3,_0x51860b){var _0x3c24d1=path['join'](config[_0xfc04('0x69')],_0xfc04('0x72'));var _0x2977ab={'where':{'id':_0xd882d3[_0xfc04('0x49')]['id']},'attributes':['id',_0xfc04('0x62')],'raw':!![]};return db[_0xfc04('0x30')][_0xfc04('0x4c')](_0x2977ab)[_0xfc04('0x11')](handleEntityNotFound(_0x51860b,null))[_0xfc04('0x11')](function(_0x594a57){if(_0x594a57){if(!_[_0xfc04('0x6e')](_0x594a57[_0xfc04('0x62')])){if(fs[_0xfc04('0x6f')](path[_0xfc04('0x68')](config[_0xfc04('0x69')],'server/files/images/avatars/',_0x594a57[_0xfc04('0x62')]))){_0x3c24d1=path['join'](config[_0xfc04('0x69')],'server/files/images/avatars/',_0x594a57[_0xfc04('0x62')]);}}return _0x51860b[_0xfc04('0x73')](_0x3c24d1);}})[_0xfc04('0x1b')](handleError(_0x51860b,null));};exports[_0xfc04('0x74')]=function(_0x1ee20a,_0x4fd80e){var _0x55dece=path['join'](config['root'],_0xfc04('0x75'));var _0x5c922b={'where':{'id':_0x1ee20a[_0xfc04('0x49')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0xfc04('0x30')][_0xfc04('0x4c')](_0x5c922b)['then'](handleEntityNotFound(_0x4fd80e,null))[_0xfc04('0x11')](function(_0x58e3cc){if(_0x58e3cc){if(!_[_0xfc04('0x6e')](_0x58e3cc[_0xfc04('0x64')])){if(fs[_0xfc04('0x6f')](path[_0xfc04('0x68')](config[_0xfc04('0x69')],'server/files/images/avatars/',_0x58e3cc['customerAvatar']))&&_0x58e3cc[_0xfc04('0x76')]){_0x55dece=path['join'](config[_0xfc04('0x69')],_0xfc04('0x77'),_0x58e3cc[_0xfc04('0x64')]);}}return _0x4fd80e['download'](_0x55dece);}})[_0xfc04('0x1b')](handleError(_0x4fd80e,null));};exports[_0xfc04('0x78')]=function(_0x433e86,_0x384204){var _0x581c31=path[_0xfc04('0x68')](config[_0xfc04('0x69')],_0xfc04('0x79'));var _0x20f4e9={'where':{'id':_0x433e86[_0xfc04('0x49')]['id']},'attributes':['id',_0xfc04('0x66')],'raw':!![]};return db[_0xfc04('0x30')]['find'](_0x20f4e9)[_0xfc04('0x11')](handleEntityNotFound(_0x384204,null))[_0xfc04('0x11')](function(_0x3950d5){if(_0x3950d5){if(!_[_0xfc04('0x6e')](_0x3950d5[_0xfc04('0x66')])){if(fs['existsSync'](path[_0xfc04('0x68')](config['root'],_0xfc04('0x77'),_0x3950d5[_0xfc04('0x66')]))){_0x581c31=path['join'](config[_0xfc04('0x69')],'server/files/images/avatars/',_0x3950d5[_0xfc04('0x66')]);}}return _0x384204[_0xfc04('0x73')](_0x581c31);}})[_0xfc04('0x1b')](handleError(_0x384204,null));};exports[_0xfc04('0x7a')]=function(_0x29851f,_0x1a5bb8){var _0x57b308=require('user-agent-parser');var _0x29d771=new _0x57b308();var _0xa127d9=_0x29d771['setUA'](_0x29851f[_0xfc04('0x7b')][_0xfc04('0x7c')])[_0xfc04('0x7d')]();var _0x969f76={'body':_0x29851f['body'],'channel':_0xfc04('0x7e')};var _0x3dcc6c=[];var _0x3b2950=[];var _0x275fdb={};var _0x3456f1=![];return db[_0xfc04('0x7f')][_0xfc04('0x53')]()['then'](function(_0x72c6c6){if(!_0x72c6c6){throw new db[(_0xfc04('0x80'))][(_0xfc04('0x81'))](_0xfc04('0x82'));}_0x3dcc6c=_[_0xfc04('0x83')](_[_0xfc04('0x36')](_0x72c6c6),[_0xfc04('0x84'),'updatedAt']);_0x3b2950=_['difference'](_[_0xfc04('0x36')](_0x72c6c6),[_0xfc04('0x84'),_0xfc04('0x85'),'CompanyId',_0xfc04('0x86')]);if(_0x29851f[_0xfc04('0x52')]['id']){delete _0x29851f[_0xfc04('0x52')]['id'];}if(_[_0xfc04('0x6e')](_0x29851f[_0xfc04('0x52')]['from'])){throw new db['Sequelize'][(_0xfc04('0x81'))](_0xfc04('0x87'));}if(_['isNil'](_0x29851f[_0xfc04('0x52')]['body'])||_0x29851f['body']['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xfc04('0x6e')](_0x29851f[_0xfc04('0x52')][_0xfc04('0x88')])){throw new db['Sequelize'][(_0xfc04('0x81'))](_0xfc04('0x89')+_0x3b2950);}if(!_[_0xfc04('0x8a')](_0x3b2950,_0x29851f['body'][_0xfc04('0x88')])){throw new db[(_0xfc04('0x80'))][(_0xfc04('0x81'))](_0xfc04('0x8b')+_0x3b2950);}_0x275fdb[_0x29851f['body'][_0xfc04('0x88')]]=_0x29851f[_0xfc04('0x52')][_0xfc04('0x8c')];})[_0xfc04('0x11')](function(){return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x29851f['params']['id']},'include':[{'model':db[_0xfc04('0x8d')],'as':_0xfc04('0x8e'),'include':[{'model':db[_0xfc04('0x7f')],'as':_0xfc04('0x8f'),'where':_0x275fdb,'limit':0x1,'order':[['updatedAt',_0xfc04('0x90')]]}]},{'model':db[_0xfc04('0x91')],'as':_0xfc04('0x92')}]});})[_0xfc04('0x11')](handleEntityNotFound(_0x1a5bb8,null))[_0xfc04('0x11')](function(_0x4706c3){if(_0x4706c3&&_0x4706c3[_0xfc04('0x8e')]){_0x969f76['account']=_0x4706c3;_0x969f76['applications']=_0x4706c3[_0xfc04('0x92')];_0x969f76[_0xfc04('0x93')]=_0x4706c3[_0xfc04('0x8e')];_0x969f76[_0xfc04('0x94')]=_[_0xfc04('0x95')](_0x969f76['applications'],[_0xfc04('0x96')],[_0xfc04('0x97')]);if(_0x969f76[_0xfc04('0x98')][_0xfc04('0x92')]){delete _0x969f76[_0xfc04('0x98')][_0xfc04('0x92')];}if(_0x969f76[_0xfc04('0x98')][_0xfc04('0x8e')]&&_0x969f76[_0xfc04('0x98')][_0xfc04('0x8e')]['Contacts'][_0xfc04('0x3c')]){return _0x969f76[_0xfc04('0x98')][_0xfc04('0x8e')][_0xfc04('0x8f')][0x0];}var _0x4ab49a=_[_0xfc04('0x8')](_0x29851f[_0xfc04('0x52')],{'firstName':_0x29851f[_0xfc04('0x52')][_0xfc04('0x8c')],'ListId':_0x4706c3[_0xfc04('0x86')]});_0x4ab49a[_0x29851f[_0xfc04('0x52')][_0xfc04('0x88')]]=_0x29851f[_0xfc04('0x52')]['from'];return db[_0xfc04('0x7f')][_0xfc04('0x4d')](_0x4ab49a,{'fields':_0x3dcc6c,'raw':!![]});}})[_0xfc04('0x11')](handleEntityNotFound(_0x1a5bb8,null))['then'](function(_0x2f7a4a){_0x969f76[_0xfc04('0x99')]=_0x2f7a4a;var _0x4167ea=_0x29851f[_0xfc04('0x52')][_0xfc04('0x9a')];if(_0x29851f[_0xfc04('0x7b')][_0xfc04('0x9b')]){_0x4167ea=_0x29851f[_0xfc04('0x7b')][_0xfc04('0x9b')];}else if(_0x29851f['headers'][_0xfc04('0x9c')]){_0x4167ea=_['first'](_0x29851f[_0xfc04('0x7b')][_0xfc04('0x9c')][_0xfc04('0x9d')](','));}if(_0x2f7a4a){var _0x114d27={'ContactId':_0x2f7a4a['id'],'ChatWebsiteId':_0x29851f[_0xfc04('0x49')]['id'],'from':(_0x2f7a4a[_0xfc04('0x9e')]||'')+'\x20'+(_0x2f7a4a['lastName']||''),'customerIp':_0x4167ea,'customerPort':_0x29851f[_0xfc04('0x7b')]['x-real-port']?_0x29851f[_0xfc04('0x7b')]['x-real-port']:null,'referer':_0x29851f[_0xfc04('0x52')][_0xfc04('0x9f')],'browserName':_0xa127d9[_0xfc04('0xa0')][_0xfc04('0x2b')]&&_0xa127d9['browser'][_0xfc04('0xa1')]?util[_0xfc04('0xa2')]('%s\x20%s',_0xa127d9[_0xfc04('0xa0')][_0xfc04('0x2b')],_0xa127d9[_0xfc04('0xa0')][_0xfc04('0xa1')]):'unknown','browserVersion':_0xa127d9[_0xfc04('0xa0')][_0xfc04('0xa1')]||_0xfc04('0xa3'),'osName':util[_0xfc04('0xa2')](_0xfc04('0xa4'),_0xa127d9['os'][_0xfc04('0x2b')],_0xa127d9['os'][_0xfc04('0xa1')]),'osVersion':_0xa127d9['os'][_0xfc04('0xa1')],'deviceModel':_0xa127d9[_0xfc04('0xa5')][_0xfc04('0x35')]&&_0xa127d9[_0xfc04('0xa5')][_0xfc04('0xa6')]?util['format']('%s\x20%s\x20%s',_0xa127d9[_0xfc04('0xa5')][_0xfc04('0x35')],_0xa127d9[_0xfc04('0xa5')]['vendor'],_0xa127d9[_0xfc04('0xa5')]['type']):null,'deviceVendor':_0xa127d9[_0xfc04('0xa5')][_0xfc04('0xa6')],'deviceType':_0xa127d9[_0xfc04('0xa5')]['type'],'formData':JSON[_0xfc04('0x16')](_0x29851f[_0xfc04('0x52')])};var _0x1fad34={'ChatWebsiteId':_0x29851f[_0xfc04('0x49')]['id'],'closed':![]};if(_0x29851f['body'][_0xfc04('0xa7')]){_0x1fad34[_0xfc04('0xa7')]=_0x29851f['body'][_0xfc04('0xa7')];return db[_0xfc04('0xa8')][_0xfc04('0x4c')]({'where':_0x1fad34})['then'](function(_0x27fdae){if(_0x27fdae){return[_0x27fdae,![]];}_0x114d27[_0xfc04('0xa7')]=_0x29851f[_0xfc04('0x52')]['threadId'];_0x114d27[_0xfc04('0xa9')]=_0x29851f[_0xfc04('0x52')][_0xfc04('0xa9')];return db[_0xfc04('0xa8')][_0xfc04('0x4d')](_0x114d27)['then'](function(_0x6cafad){return[_0x6cafad,!![]];});});}_0x1fad34[_0xfc04('0xaa')]=_0x2f7a4a['id'];if(_0x29851f[_0xfc04('0x52')][_0xfc04('0xab')]&&_0x29851f['body'][_0xfc04('0xab')]['id']){_0x1fad34['id']=_0x29851f[_0xfc04('0x52')][_0xfc04('0xab')]['id'];return db['ChatInteraction']['find']({'where':_0x1fad34})[_0xfc04('0x11')](function(_0x5882c6){if(_0x5882c6){return[_0x5882c6,![]];}return db['ChatInteraction'][_0xfc04('0x4d')](_0x114d27)[_0xfc04('0x11')](function(_0x308f2d){return[_0x308f2d,!![]];});});}return db[_0xfc04('0xa8')][_0xfc04('0x4d')](_0x114d27)[_0xfc04('0x11')](function(_0x20bad5){return[_0x20bad5,!![]];});}})[_0xfc04('0xac')](function(_0x4a3f8e,_0x258745){if(_0x4a3f8e){_0x3456f1=_0x258745;if(!_0x258745){var _0x122890={'from':(_0x969f76[_0xfc04('0x99')][_0xfc04('0x9e')]||'')+'\x20'+(_0x969f76[_0xfc04('0x99')][_0xfc04('0xad')]||'')};if(_0x29851f[_0xfc04('0x52')][_0xfc04('0xa7')]&&_0x29851f[_0xfc04('0x52')]['messageId']&&_0x29851f['body']['threadId']!=_0x29851f['body'][_0xfc04('0xae')]){_0x122890['threadId']=_0x29851f[_0xfc04('0x52')][_0xfc04('0xae')];}return _0x4a3f8e['update'](_0x122890);}else{return _0x4a3f8e;}}})[_0xfc04('0x11')](function(_0x12b636){_0x969f76[_0xfc04('0xab')]=_0x12b636[_0xfc04('0x28')]({'plain':!![]});_0x969f76[_0xfc04('0xab')][_0xfc04('0xaf')]=_0x3456f1;if(_0x969f76[_0xfc04('0xab')][_0xfc04('0xaf')]){if(_0x969f76['account']['autoclose']){_0x969f76[_0xfc04('0x94')][_0xfc04('0xb0')]({'id':0x0,'priority':_0x969f76[_0xfc04('0x94')]['length']+0x1,'app':_0xfc04('0xb1'),'appdata':_0xfc04('0xb2'),'interval':_0xfc04('0xb3')});}}return db[_0xfc04('0xb4')][_0xfc04('0x4d')]({'body':_0x29851f['body'][_0xfc04('0x52')],'ChatWebsiteId':_0x29851f[_0xfc04('0x49')]['id'],'ChatInteractionId':_0x12b636['id'],'direction':'in','ContactId':_0x969f76[_0xfc04('0x99')]['id'],'AttachmentId':_0x29851f[_0xfc04('0x52')][_0xfc04('0xb5')]});})[_0xfc04('0x11')](function(_0x337214){_0x969f76[_0xfc04('0x1a')]=_0x337214;if(_0x969f76['interaction'][_0xfc04('0xb6')]){return db[_0xfc04('0xb7')][_0xfc04('0x4c')]({'attributes':['id','name'],'where':{'id':_0x969f76[_0xfc04('0xab')]['UserId']}})['then'](function(_0x4f3b8f){if(_0x4f3b8f){_0x969f76[_0xfc04('0x94')][_0xfc04('0xb8')]({'id':0x0,'priority':0x0,'app':_0xfc04('0xb9'),'appdata':_0x4f3b8f[_0xfc04('0x2b')]+','+(_0x969f76['account'][_0xfc04('0xba')]||0xa),'interval':_0xfc04('0xb3')});_0x969f76[_0xfc04('0xbb')]=!![];}return respondWithRpcPromise(_0xfc04('0xbc'),'startRouting',_0x969f76);});}return respondWithRpcPromise(_0xfc04('0xbc'),_0xfc04('0xbd'),_0x969f76);})['then'](function(_0x21140b){respondWithRpcPromise('EventManager',_0xfc04('0xbe'),{'event':_0xfc04('0x7a'),'message':_0x21140b},client9002);return _0x21140b;})[_0xfc04('0x11')](respondWithResult(_0x1a5bb8,null))[_0xfc04('0x1b')](handleError(_0x1a5bb8,null));};exports[_0xfc04('0xbf')]=function(_0x2e7dcf,_0x472a3e){var _0x160210,_0xf53d0b,_0xa92160;var _0x36931b=[];var _0x2df4c3={};var _0x58f2ce=_0x2e7dcf[_0xfc04('0xc0')]||[];var _0x5e2274=[];var _0x26a779;return db[_0xfc04('0x7f')][_0xfc04('0x53')]()[_0xfc04('0x11')](function(_0x375f9b){if(!_0x375f9b){throw new db['Sequelize'][(_0xfc04('0x81'))](_0xfc04('0x82'));}_0x36931b=_['difference'](_[_0xfc04('0x36')](_0x375f9b),[_0xfc04('0x84'),'updatedAt',_0xfc04('0xc1'),'ListId']);if(_0x2e7dcf[_0xfc04('0x52')]['id']){delete _0x2e7dcf[_0xfc04('0x52')]['id'];}if(_[_0xfc04('0x6e')](_0x2e7dcf[_0xfc04('0x52')][_0xfc04('0x8c')])){throw _0x472a3e[_0xfc04('0x1d')](0x1f4)[_0xfc04('0x2c')](new db[(_0xfc04('0x80'))]['ValidationError'](_0xfc04('0x87')));}if(_[_0xfc04('0x6e')](_0x2e7dcf[_0xfc04('0x52')][_0xfc04('0x52')])||_0x2e7dcf[_0xfc04('0x52')]['body']===''){throw _0x472a3e[_0xfc04('0x1d')](0x1f4)[_0xfc04('0x2c')](new db[(_0xfc04('0x80'))]['ValidationError'](_0xfc04('0xc2')));}if(_['isNil'](_0x2e7dcf['body']['mapKeyOffline'])){throw _0x472a3e[_0xfc04('0x1d')](0x1f4)[_0xfc04('0x2c')](new db[(_0xfc04('0x80'))][(_0xfc04('0x81'))](_0xfc04('0xc3')+_0x36931b));}if(!_[_0xfc04('0x8a')](_0x36931b,_0x2e7dcf['body']['mapKeyOffline'])){throw _0x472a3e[_0xfc04('0x1d')](0x1f4)[_0xfc04('0x2c')](new db[(_0xfc04('0x80'))]['ValidationError'](_0xfc04('0xc4')+_0x36931b));}_0x2df4c3[_0x2e7dcf[_0xfc04('0x52')][_0xfc04('0xc5')]]=_0x2e7dcf['body'][_0xfc04('0x8c')];})[_0xfc04('0x11')](function(){return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x2e7dcf[_0xfc04('0x49')]['id']},'include':[{'model':db[_0xfc04('0x8d')],'as':'List'},{'model':db[_0xfc04('0xc6')],'as':'MailAccount'}]});})[_0xfc04('0x11')](handleEntityNotFound(_0x472a3e,null))['then'](function(_0x8208bd){if(_0x8208bd&&_0x8208bd['List']){_0xf53d0b=_0x8208bd;var _0x19a489=_[_0xfc04('0x8')](_0x2e7dcf['body'],{'firstName':_0x2e7dcf[_0xfc04('0x52')]['from'],'phone':_0x2e7dcf[_0xfc04('0x52')][_0xfc04('0x8c')],'ListId':_0x8208bd[_0xfc04('0x86')]});_0x19a489[_0x2e7dcf[_0xfc04('0x52')][_0xfc04('0xc5')]]=_0x2e7dcf[_0xfc04('0x52')]['from'];return db['CmContact'][_0xfc04('0xc7')]({'where':_0x2df4c3,'defaults':_0x19a489});}})[_0xfc04('0xac')](function(_0x313811){if(_0x313811){_0xa92160=_0x313811;var _0x5f251d=fs[_0xfc04('0xc8')](path[_0xfc04('0x68')](config[_0xfc04('0x69')],_0xfc04('0xc9')),_0xfc04('0xca'));var _0x17a477=ejs[_0xfc04('0xcb')](_0x5f251d,{'body':_[_0xfc04('0xcc')](_0x2e7dcf[_0xfc04('0x52')]['body']),'bodyTitle':_0xf53d0b[_0xfc04('0xcd')]});return db[_0xfc04('0xce')][_0xfc04('0x4d')]({'body':_0x17a477,'plainBody':htmlToText[_0xfc04('0xcf')](_0x17a477),'ContactId':_0x313811['id'],'ChatWebsiteId':_0xf53d0b['id']});}})[_0xfc04('0x11')](function(_0x5b6ed5){_0x26a779=_0x5b6ed5;if(_0x58f2ce['length']){var _0x5e2db5=_0x58f2ce[_0xfc04('0x2f')](function(_0xd4625a){return{'name':_0xd4625a[_0xfc04('0xd0')],'basename':_0xd4625a[_0xfc04('0x61')],'type':_0xd4625a[_0xfc04('0xd1')],'ChatOfflineMessageId':_0x5b6ed5['id']};});_0x5e2274=_0x5e2db5[_0xfc04('0x2f')](_0x3c4ce8=>{var _0x519e5a={'filename':_0x3c4ce8[_0xfc04('0x2b')],'path':path['join'](config[_0xfc04('0x69')],_0xfc04('0xd2'),_0xfc04('0xc0'),_0xfc04('0xd3'),_0xfc04('0xd4'),_0x3c4ce8['basename'])};return _0x519e5a;});if(!_0xf53d0b[_0xfc04('0xd5')]){return db[_0xfc04('0xd6')][_0xfc04('0xd7')](function(_0x4e78cd){return db[_0xfc04('0xd8')]['bulkCreate'](_0x5e2db5,{'transaction':_0x4e78cd});});}}})['then'](function(){if(_0x26a779){_0x160210=_0x26a779;return db['MailAccount'][_0xfc04('0x58')]({'where':{'service':!![]},'include':[{'model':db[_0xfc04('0xd9')],'as':_0xfc04('0xda'),'raw':!![],'include':[{'model':db[_0xfc04('0xdb')],'as':_0xfc04('0xdb'),'raw':!![]}]}]});}})[_0xfc04('0x11')](function(_0x3cf906){if(_0x3cf906&&_0x3cf906[_0xfc04('0xda')]&&_0xf53d0b[_0xfc04('0xdc')]&&_0xf53d0b['forwardOfflineAddress']){var _0x4afbf5=_0x3cf906[_0xfc04('0xdd')]();return respondWithRpcPromise(_0xfc04('0xde'),_0xfc04('0xdf'),{'account':_0x4afbf5,'message':{'from':util['format'](_0xfc04('0xe0'),_0x3cf906[_0xfc04('0x2b')],_0x3cf906['email']||_0x3cf906[_0xfc04('0xda')][_0xfc04('0x4e')]),'to':_0xf53d0b['forwardOfflineAddress'],'subject':_0xf53d0b[_0xfc04('0xe1')],'html':_0x160210[_0xfc04('0x52')],'attachments':_0x5e2274}},client9003)[_0xfc04('0x11')](function(){return _0x160210;})[_0xfc04('0x1b')](function(_0x8f4dc0){logger[_0xfc04('0x17')](_0x8f4dc0);});}})['then'](function(){if(_0xf53d0b&&_0xf53d0b['openNewInteraction']&&_0xf53d0b[_0xfc04('0xe2')]){var _0x3b0ef7=[];if(_0x58f2ce['length']){_0x3b0ef7=_0x58f2ce[_0xfc04('0x2f')](function(_0x352cc7){return{'name':_0x352cc7['originalname'],'basename':_0x352cc7[_0xfc04('0x61')],'type':_0x352cc7[_0xfc04('0xd1')],'ChatOfflineMessageId':_0x26a779['id']};});}var _0x22c22d;if(!_[_0xfc04('0x6e')](_0xf53d0b[_0xfc04('0xe3')])){var _0xbc4768=_[_0xfc04('0x2f')](_0x2e7dcf[_0xfc04('0x52')],function(_0x1bb9fd){return _0x1bb9fd;});var _0x522c56=_[_0xfc04('0xe4')](_0xbc4768)[0x0];var _0x483443=_[_0xfc04('0xe5')](_0x522c56,function(_0x4a0b13){return _0x4a0b13;});_0x22c22d=_0x483443[0x1][_0xf53d0b[_0xfc04('0xe3')]];}var _0x1e3866={'from':_0xa92160[_0xfc04('0xe6')],'firstName':_0xa92160[_0xfc04('0x9e')],'lastName':_0xa92160['lastName'],'mapKey':_0xfc04('0xe6'),'message':{'from':_0xa92160[_0xfc04('0xe6')],'to':_0xf53d0b[_0xfc04('0xc6')][_0xfc04('0xe6')],'cc':'','subject':_['isNil'](_0x22c22d)?_0xf53d0b['offlineMessageSubject']:_0x22c22d,'messageId':'','sentAt':new Date(),'attach':_0x3b0ef7[_0xfc04('0x3c')],'attachments':_0x3b0ef7,'originChannel':'Chat','ChatWebsiteId':_0xf53d0b['id'],'ChatOfflineMessageId':_0x160210['id'],'originTo':_0xf53d0b[_0xfc04('0xc6')]['email']},'body':_0x160210[_0xfc04('0x52')]};var _0x25a833={'account':{'id':_0xf53d0b[_0xfc04('0xe2')]},'body':_0x1e3866,'log':_0xfc04('0xe7')};return respondWithRpcPromise(_0xfc04('0xe7'),'notifyMail',_0x25a833,client9001)['then'](function(){return _0x160210;})[_0xfc04('0x1b')](function(_0x232c72){logger['error'](_0x232c72);});}return;})[_0xfc04('0x11')](function(){if(_0x160210){return _0x160210;}})['then'](respondWithResult(_0x472a3e,null))[_0xfc04('0x1b')](function(_0x7731d1){logger[_0xfc04('0x17')](_0xfc04('0x1b'),_0x7731d1);for(var _0x1978e4 of _0x58f2ce){var _0x213888=path[_0xfc04('0x68')](config[_0xfc04('0x69')],'server',_0xfc04('0xc0'),_0xfc04('0xd3'),_0xfc04('0xd4'),_0x1978e4[_0xfc04('0x61')]);fs_extra[_0xfc04('0xe8')](_0x213888)[_0xfc04('0x1b')](function(_0x26bd2f){logger[_0xfc04('0x17')]('Could\x20not\x20remove\x20attachment\x20file',_0x213888,_0x26bd2f);});}});};exports[_0xfc04('0xe9')]=function(_0x1db0c6,_0xf3e4a8){return db['ChatInteraction']['find']({'where':{'id':_0x1db0c6[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0xf3e4a8,null))[_0xfc04('0x11')](function(_0x3c292e){if(_0x3c292e){return _0x3c292e[_0xfc04('0xe9')](_0x1db0c6[_0xfc04('0x52')]['ids'],_[_0xfc04('0xea')](_0x1db0c6['body'],[_0xfc04('0x5b'),'id'])||{});}})['then'](respondWithResult(_0xf3e4a8,null))[_0xfc04('0x1b')](handleError(_0xf3e4a8,null));};exports[_0xfc04('0xeb')]=function(_0x25dd64,_0x98f514){var _0x4b70c9={'raw':![],'where':{}};var _0x40bf26={};var _0x2fd8ec={'count':0x0,'rows':[]};return db[_0xfc04('0x30')][_0xfc04('0x58')]({'where':{'id':_0x25dd64[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x98f514,null))['then'](function(_0xef17aa){if(_0xef17aa){_0x40bf26[_0xfc04('0x35')]=_['keys'](db[_0xfc04('0xa8')]['rawAttributes']);_0x40bf26['query']=_[_0xfc04('0x36')](_0x25dd64[_0xfc04('0x39')]);_0x40bf26[_0xfc04('0x37')]=_[_0xfc04('0x38')](_0x40bf26[_0xfc04('0x35')],_0x40bf26['query']);_0x4b70c9[_0xfc04('0x3b')]=_[_0xfc04('0x38')](_0x40bf26[_0xfc04('0x35')],qs[_0xfc04('0x3a')](_0x25dd64[_0xfc04('0x39')][_0xfc04('0x3a')]));_0x4b70c9[_0xfc04('0x3b')]=_0x4b70c9[_0xfc04('0x3b')][_0xfc04('0x3c')]?_0x4b70c9[_0xfc04('0x3b')]:_0x40bf26[_0xfc04('0x35')];if(!_0x25dd64['query']['hasOwnProperty']('nolimit')){_0x4b70c9[_0xfc04('0x21')]=qs['limit'](_0x25dd64[_0xfc04('0x39')][_0xfc04('0x21')]);_0x4b70c9[_0xfc04('0x20')]=qs[_0xfc04('0x20')](_0x25dd64['query'][_0xfc04('0x20')]);}_0x4b70c9[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x25dd64[_0xfc04('0x39')][_0xfc04('0x40')]);_0x4b70c9['where']=qs[_0xfc04('0x37')](_[_0xfc04('0x41')](_0x25dd64[_0xfc04('0x39')],_0x40bf26['filters']));_0x4b70c9['where']['ChatWebsiteId']=_0xef17aa['id'];if(_0x25dd64[_0xfc04('0x39')][_0xfc04('0x42')]){_0x4b70c9[_0xfc04('0x43')]=_[_0xfc04('0x44')](_0x4b70c9['where'],{'$or':_['map'](_0x4b70c9['attributes'],function(_0x480428){var _0x13bfe9={};_0x13bfe9[_0x480428]={'$like':'%'+_0x25dd64[_0xfc04('0x39')][_0xfc04('0x42')]+'%'};return _0x13bfe9;})});}_0x4b70c9=_[_0xfc04('0x44')]({},_0x4b70c9,_0x25dd64['options']);return db[_0xfc04('0xa8')][_0xfc04('0x23')]({'where':_0x4b70c9['where']})[_0xfc04('0x11')](function(_0x29318f){_0x2fd8ec[_0xfc04('0x23')]=_0x29318f;if(_0x25dd64['query'][_0xfc04('0x46')]){_0x4b70c9['include']=[{'model':db[_0xfc04('0x7f')],'as':'Contact','required':![]},{'model':db[_0xfc04('0xb7')],'as':'Owner','attributes':[_0xfc04('0x2b'),_0xfc04('0xec'),_0xfc04('0xed')],'required':![]},{'model':db[_0xfc04('0xee')],'as':_0xfc04('0xef'),'attributes':['id',_0xfc04('0x2b'),_0xfc04('0xf0')],'where':_0x25dd64['query']['tag']?{'id':_0x25dd64[_0xfc04('0x39')]['tag']}:undefined,'required':_0x25dd64['query'][_0xfc04('0xf1')]?!![]:![]}];}return db[_0xfc04('0xa8')]['findAll'](_0x4b70c9);})[_0xfc04('0x11')](function(_0x2d89ee){_0x2fd8ec[_0xfc04('0x47')]=_0x2d89ee;return _0x2fd8ec;});}})[_0xfc04('0x11')](respondWithFilteredResult(_0x98f514,_0x4b70c9))[_0xfc04('0x1b')](handleError(_0x98f514,null));};function iftimePromise(_0x3311a1,_0x440b61){return respondWithRpcPromise(_0xfc04('0xf2'),'getSnippet',{'command':_0x440b61['timezone']?util[_0xfc04('0xa2')](_0xfc04('0xf3'),_0x3311a1['interval'],_0x440b61[_0xfc04('0xf4')]):util[_0xfc04('0xa2')](_0xfc04('0xf5'),_0x3311a1[_0xfc04('0xf6')])},client9002)[_0xfc04('0x11')](function(_0x1b6ec6){var _0x5bbd34=_0x1b6ec6&&_0x1b6ec6[_0xfc04('0xf7')](_0xfc04('0xf8'))>=0x0?!![]:![];logger['info'](_0xfc04('0xf9'),_0x440b61['id'],_0x3311a1['id'],_0x3311a1[_0xfc04('0xf6')],_0x5bbd34?'ONLINE':_0xfc04('0xfa'),_0x440b61[_0xfc04('0xf4')]?_0x440b61[_0xfc04('0xf4')]:'No\x20timezone');return _0x5bbd34;})[_0xfc04('0x1b')](function(_0x311529){logger[_0xfc04('0x17')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x440b61['id'],_0x3311a1['id'],_0x3311a1[_0xfc04('0xf6')],util[_0xfc04('0xfb')](_0x311529,{'showHidden':![],'depth':null}),_0x440b61[_0xfc04('0xf4')]?_0x440b61[_0xfc04('0xf4')]:_0xfc04('0xfc'));return![];});}exports[_0xfc04('0xfd')]=function(_0x3d5a80,_0x3ee0b3){var _0x37fd8d=0x0;var _0x32d324=0x0;var _0x20f17e=![];var _0x2334b6;var _0x38ba71;return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x3d5a80['params']['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db[_0xfc04('0xfe')],'as':_0xfc04('0xff'),'attributes':['id',_0xfc04('0xf6')],'raw':!![]}]}]})[_0xfc04('0x11')](handleEntityNotFound(_0x3ee0b3,null))['then'](function(_0x33946b){if(_0x33946b){_0x2334b6=_0x33946b;return _0x33946b[_0xfc04('0x100')]({'raw':!![]});}})['then'](function(_0x458fc7){if(_0x2334b6){if(_0x458fc7){_0x38ba71=_0x458fc7;}}return require(_0xfc04('0x101'))['getLicense']();})[_0xfc04('0x11')](function(_0x2a0a68){if(_0x2a0a68){_0x32d324=_0x2a0a68['virtual'];_0x20f17e=_0x2a0a68[_0xfc04('0x6d')];}})[_0xfc04('0x11')](function(){return db[_0xfc04('0xa8')][_0xfc04('0x23')]({'where':{'closed':![]}});})[_0xfc04('0x11')](function(_0x13a7c7){_0x37fd8d=_0x13a7c7;if(_0x32d324&&_0x13a7c7>_0x32d324){return db['License'][_0xfc04('0x58')]({'where':{'id':0x1}})[_0xfc04('0x11')](function(_0x1c2e8e){if(_0x1c2e8e){_0x1c2e8e[_0xfc04('0x102')](_0xfc04('0x103'));}});}})[_0xfc04('0x11')](function(){if(_0x2334b6['Interval']&&_0x2334b6[_0xfc04('0xfe')][_0xfc04('0xff')]){var _0x4096b1=[];for(var _0x35a015=0x0;_0x35a015<_0x2334b6[_0xfc04('0xfe')]['Intervals'][_0xfc04('0x3c')];_0x35a015++){var _0x1252a9=_0x2334b6[_0xfc04('0xfe')]['Intervals'][_0x35a015][_0xfc04('0x28')]({'plain':!![]});_0x4096b1[_0xfc04('0xb0')](iftimePromise(_0x1252a9,_0x2334b6));}return BPromise[_0xfc04('0x104')](_0x4096b1)[_0xfc04('0x11')](function(_0x840b40){return _[_0xfc04('0x105')](_0x840b40);});}else{return!![];}})['then'](function(_0x5b06fe){var _0x56d7ed=fs[_0xfc04('0xc8')](path[_0xfc04('0x68')](config[_0xfc04('0x69')],_0xfc04('0x106')),_0xfc04('0xca'));var _0x4000af={'remote':_0x2334b6['remote'],'query':querystring['stringify'](_[_0xfc04('0x44')](_0x2334b6[_0xfc04('0x28')]({'plain':!![]}),{'customerIp':_0x3d5a80[_0xfc04('0x7b')][_0xfc04('0x9c')]||_0x3d5a80[_0xfc04('0x7b')][_0xfc04('0x107')]||_0x3d5a80[_0xfc04('0x108')]['remoteAddress']||_0x3d5a80['ip'],'referer':_0x3d5a80[_0xfc04('0x7b')]['referer'],'openedInteractions':_0x37fd8d,'maxInteractions':_0x32d324,'virtual':_0x20f17e[_0xfc04('0x109')],'online':_0x5b06fe,'custom':_0x20f17e}))[_0xfc04('0x10a')](/'/g,'\x5c\x27')};_0x3ee0b3[_0xfc04('0x2c')](ejs[_0xfc04('0xcb')](Mustache['render'](_0x56d7ed,_0x4000af),{'proactiveActions':_0x38ba71,'alignment':_0x2334b6['alignment'],'verticalAlignment':_0x2334b6[_0xfc04('0x10b')],'div_color':_0x2334b6['color'],'labelText':_0x2334b6[_0xfc04('0x10c')],'text_color':_0x2334b6['textColor'],'text_button_color':_0x2334b6[_0xfc04('0x10d')],'button_color':_0x2334b6[_0xfc04('0x10e')],'background_color':_0x2334b6['backgroundColor'],'hideWhenOffline':_0x2334b6[_0xfc04('0x10f')],'interval':_0x2334b6[_0xfc04('0x110')]}));})['catch'](handleError(_0x3ee0b3,null));};exports[_0xfc04('0x111')]=function(_0x589fce,_0x2b2967){var _0x4d39b5=_0x589fce[_0xfc04('0x49')]['id'];var _0x3bfd3c=_0x589fce[_0xfc04('0x52')];var _0x34d613=0xc8;var _0x4c2687=null;return db[_0xfc04('0xd6')][_0xfc04('0xd7')]({'isolationLevel':db[_0xfc04('0xd6')][_0xfc04('0x112')][_0xfc04('0x113')][_0xfc04('0x114')]},function(_0x329e78){return db[_0xfc04('0x30')][_0xfc04('0x58')]({'where':{'id':_0x4d39b5},'transaction':_0x329e78})[_0xfc04('0x11')](function(_0x946970){if(_0x946970){return db[_0xfc04('0x91')]['destroy']({'where':{'ChatWebsiteId':_0x4d39b5},'transaction':_0x329e78})[_0xfc04('0x11')](function(){var _0x1bd12a=_[_0xfc04('0x2f')](_0x3bfd3c,function(_0x342032){_0x342032['ChatWebsiteId']=_0x4d39b5;return _0x342032;});return db['ChatApplication']['bulkCreate'](_0x1bd12a,{'transaction':_0x329e78});});}else{_0x34d613=0x194;_0x4c2687=[];}});})[_0xfc04('0x11')](function(){if(_0x34d613!==0x194){return db[_0xfc04('0x91')][_0xfc04('0x115')]({'where':{'ChatWebsiteId':_0x4d39b5},'order':_0xfc04('0x96')})[_0xfc04('0x11')](function(_0x1a79e1){_0x4c2687=_0x1a79e1;});}})[_0xfc04('0x1b')](function(_0x412afa){_0x34d613=0x1f4;logger[_0xfc04('0x17')](_0x412afa['stack']);if(_0x412afa[_0xfc04('0x2b')]){delete _0x412afa[_0xfc04('0x2b')];}_0x4c2687=_0x412afa;})[_0xfc04('0x116')](function(){if(_0x4c2687===null){_0x2b2967[_0xfc04('0x1c')](_0x34d613);}else{if(_0x34d613===0x1f4){_0x2b2967[_0xfc04('0x1d')](_0x34d613)[_0xfc04('0x2c')](_0x4c2687);}else{_0x2b2967[_0xfc04('0x1d')](_0x34d613)[_0xfc04('0x1f')](_0x4c2687);}}});};exports[_0xfc04('0x117')]=function(_0x23801e,_0x170d49){var _0x224b2a={};var _0x366617={};var _0x4becd0;var _0x58fdac;return db[_0xfc04('0x30')][_0xfc04('0x58')]({'where':{'id':_0x23801e[_0xfc04('0x49')]['id']}})['then'](handleEntityNotFound(_0x170d49,null))[_0xfc04('0x11')](function(_0xdf8f9d){if(_0xdf8f9d){_0x4becd0=_0xdf8f9d;_0x366617[_0xfc04('0x35')]=_[_0xfc04('0x36')](db[_0xfc04('0x91')][_0xfc04('0x31')]);_0x366617[_0xfc04('0x39')]=_['keys'](_0x23801e['query']);_0x366617[_0xfc04('0x37')]=_[_0xfc04('0x38')](_0x366617['model'],_0x366617['query']);_0x224b2a['attributes']=_[_0xfc04('0x38')](_0x366617[_0xfc04('0x35')],qs[_0xfc04('0x3a')](_0x23801e['query'][_0xfc04('0x3a')]));_0x224b2a[_0xfc04('0x3b')]=_0x224b2a['attributes'][_0xfc04('0x3c')]?_0x224b2a[_0xfc04('0x3b')]:_0x366617[_0xfc04('0x35')];_0x224b2a[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x23801e['query'][_0xfc04('0x40')]);_0x224b2a[_0xfc04('0x43')]=qs[_0xfc04('0x37')](_[_0xfc04('0x41')](_0x23801e[_0xfc04('0x39')],_0x366617[_0xfc04('0x37')]));if(_0x23801e['query'][_0xfc04('0x42')]){_0x224b2a[_0xfc04('0x43')]=_[_0xfc04('0x44')](_0x224b2a['where'],{'$or':_[_0xfc04('0x2f')](_0x224b2a[_0xfc04('0x3b')],function(_0x3588c7){var _0x22d792={};_0x22d792[_0x3588c7]={'$like':'%'+_0x23801e[_0xfc04('0x39')]['filter']+'%'};return _0x22d792;})});}_0x224b2a=_['merge']({},_0x224b2a,_0x23801e[_0xfc04('0x45')]);return _0x4becd0['getApplications'](_0x224b2a);}})[_0xfc04('0x11')](function(_0x2977fa){if(_0x2977fa){_0x58fdac=_0x2977fa['length'];if(!_0x23801e[_0xfc04('0x39')][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x224b2a[_0xfc04('0x21')]=qs[_0xfc04('0x21')](_0x23801e[_0xfc04('0x39')][_0xfc04('0x21')]);_0x224b2a[_0xfc04('0x20')]=qs['offset'](_0x23801e[_0xfc04('0x39')]['offset']);}return _0x4becd0['getApplications'](_0x224b2a);}})['then'](function(_0xeea78b){if(_0xeea78b){return _0xeea78b?{'count':_0x58fdac,'rows':_0xeea78b}:null;}})[_0xfc04('0x11')](respondWithResult(_0x170d49,null))[_0xfc04('0x1b')](handleError(_0x170d49,null));};exports['addProactiveActions']=function(_0x138776,_0x20ce43){return db[_0xfc04('0x118')][_0xfc04('0x4c')]({'where':{'id':_0x138776[_0xfc04('0x49')]['id']}})['then'](handleEntityNotFound(_0x20ce43,null))[_0xfc04('0x11')](function(_0x53abe3){if(_0x53abe3){return _0x53abe3['addProactiveActions'](_0x138776[_0xfc04('0x52')][_0xfc04('0x5b')],_[_0xfc04('0xea')](_0x138776[_0xfc04('0x52')],[_0xfc04('0x5b'),'id'])||{});}})[_0xfc04('0x11')](respondWithResult(_0x20ce43,null))['catch'](handleError(_0x20ce43,null));};exports[_0xfc04('0x100')]=function(_0x5a44b8,_0x6167f6){var _0x5f37fb={};var _0x306f5b={};var _0x4d28f5;var _0xbfba2a;return db[_0xfc04('0x30')]['findOne']({'where':{'id':_0x5a44b8[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x6167f6,null))[_0xfc04('0x11')](function(_0x3b5b91){if(_0x3b5b91){_0x4d28f5=_0x3b5b91;_0x306f5b[_0xfc04('0x35')]=_[_0xfc04('0x36')](db['ChatProactiveAction'][_0xfc04('0x31')]);_0x306f5b[_0xfc04('0x39')]=_[_0xfc04('0x36')](_0x5a44b8[_0xfc04('0x39')]);_0x306f5b['filters']=_[_0xfc04('0x38')](_0x306f5b[_0xfc04('0x35')],_0x306f5b[_0xfc04('0x39')]);_0x5f37fb['attributes']=_[_0xfc04('0x38')](_0x306f5b[_0xfc04('0x35')],qs['fields'](_0x5a44b8[_0xfc04('0x39')][_0xfc04('0x3a')]));_0x5f37fb['attributes']=_0x5f37fb['attributes'][_0xfc04('0x3c')]?_0x5f37fb['attributes']:_0x306f5b[_0xfc04('0x35')];_0x5f37fb[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x5a44b8[_0xfc04('0x39')][_0xfc04('0x40')]);_0x5f37fb['where']=qs[_0xfc04('0x37')](_['pick'](_0x5a44b8[_0xfc04('0x39')],_0x306f5b[_0xfc04('0x37')]));if(_0x5a44b8['query'][_0xfc04('0x42')]){_0x5f37fb['where']=_[_0xfc04('0x44')](_0x5f37fb[_0xfc04('0x43')],{'$or':_[_0xfc04('0x2f')](_0x5f37fb[_0xfc04('0x3b')],function(_0x4f5f02){var _0x1cb55c={};_0x1cb55c[_0x4f5f02]={'$like':'%'+_0x5a44b8[_0xfc04('0x39')][_0xfc04('0x42')]+'%'};return _0x1cb55c;})});}_0x5f37fb=_[_0xfc04('0x44')]({},_0x5f37fb,_0x5a44b8['options']);return _0x4d28f5['getProactiveActions'](_0x5f37fb);}})['then'](function(_0xe4fff6){if(_0xe4fff6){_0xbfba2a=_0xe4fff6[_0xfc04('0x3c')];if(!_0x5a44b8[_0xfc04('0x39')][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x5f37fb['limit']=qs[_0xfc04('0x21')](_0x5a44b8['query']['limit']);_0x5f37fb[_0xfc04('0x20')]=qs[_0xfc04('0x20')](_0x5a44b8[_0xfc04('0x39')][_0xfc04('0x20')]);}return _0x4d28f5[_0xfc04('0x100')](_0x5f37fb);}})[_0xfc04('0x11')](function(_0x5d1696){if(_0x5d1696){return _0x5d1696?{'count':_0xbfba2a,'rows':_0x5d1696}:null;}})[_0xfc04('0x11')](respondWithResult(_0x6167f6,null))[_0xfc04('0x1b')](handleError(_0x6167f6,null));};exports[_0xfc04('0x119')]=function(_0x4d438f,_0x248a1a){var _0xbc5ee8=_0x4d438f[_0xfc04('0x39')]['online']===_0xfc04('0x11a')?'offlineForm':'onlineForm';return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'attributes':['id',_0xbc5ee8],'where':{'id':_0x4d438f[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x248a1a,null))['then'](function(_0x2ac2b1){if(_0x2ac2b1){var _0x30e52e=_0x2ac2b1[_0xbc5ee8];var _0x56f486=_0x30e52e&&_0x30e52e[_0xfc04('0x11b')]?_0x30e52e['items']:[];_0x248a1a['send']({'fromKey':_[_0xfc04('0x6e')](_0x30e52e[_0xfc04('0x11c')])?undefined:_0x30e52e['fromKey'],'count':_0x56f486[_0xfc04('0x3c')],'rows':_0x56f486});}})[_0xfc04('0x1b')](handleError(_0x248a1a,null));};exports[_0xfc04('0x11d')]=function(_0x396512,_0x111b63){var _0x5bc121={'raw':![],'where':{}};var _0xb5acbd={};var _0x36aa9f={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xfc04('0x58')]({'where':{'id':_0x396512[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x111b63,null))[_0xfc04('0x11')](function(_0x326af3){if(_0x326af3){_0xb5acbd[_0xfc04('0x35')]=_[_0xfc04('0x36')](db[_0xfc04('0xce')]['rawAttributes']);_0xb5acbd[_0xfc04('0x39')]=_[_0xfc04('0x36')](_0x396512[_0xfc04('0x39')]);_0xb5acbd[_0xfc04('0x37')]=_[_0xfc04('0x38')](_0xb5acbd[_0xfc04('0x35')],_0xb5acbd[_0xfc04('0x39')]);_0x5bc121['attributes']=_[_0xfc04('0x38')](_0xb5acbd[_0xfc04('0x35')],qs[_0xfc04('0x3a')](_0x396512[_0xfc04('0x39')][_0xfc04('0x3a')]));_0x5bc121['attributes']=_0x5bc121[_0xfc04('0x3b')][_0xfc04('0x3c')]?_0x5bc121['attributes']:_0xb5acbd[_0xfc04('0x35')];if(!_0x396512['query'][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x5bc121[_0xfc04('0x21')]=qs[_0xfc04('0x21')](_0x396512[_0xfc04('0x39')]['limit']);_0x5bc121[_0xfc04('0x20')]=qs[_0xfc04('0x20')](_0x396512[_0xfc04('0x39')][_0xfc04('0x20')]);}_0x5bc121['order']=qs['sort'](_0x396512[_0xfc04('0x39')][_0xfc04('0x40')]);_0x5bc121[_0xfc04('0x43')]=qs[_0xfc04('0x37')](_[_0xfc04('0x41')](_0x396512[_0xfc04('0x39')],_0xb5acbd[_0xfc04('0x37')]));_0x5bc121['where'][_0xfc04('0x55')]=_0x326af3['id'];if(_0x396512[_0xfc04('0x39')]['filter']){_0x5bc121[_0xfc04('0x43')]=_[_0xfc04('0x44')](_0x5bc121[_0xfc04('0x43')],{'$or':_[_0xfc04('0x2f')](_0x5bc121[_0xfc04('0x3b')],function(_0x3f35a4){var _0x2e4cdd={};_0x2e4cdd[_0x3f35a4]={'$like':'%'+_0x396512[_0xfc04('0x39')][_0xfc04('0x42')]+'%'};return _0x2e4cdd;})});}_0x5bc121=_['merge']({},_0x5bc121,_0x396512[_0xfc04('0x45')]);return db[_0xfc04('0xce')][_0xfc04('0x23')]({'where':_0x5bc121[_0xfc04('0x43')]})[_0xfc04('0x11')](function(_0x431d9b){_0x36aa9f['count']=_0x431d9b;if(_0x396512[_0xfc04('0x39')]['includeAll']){_0x5bc121[_0xfc04('0x4b')]=[{'all':!![]}];}else{_0x5bc121['include']=[{'model':db[_0xfc04('0x7f')],'as':_0xfc04('0x11e'),'required':![]},{'model':db[_0xfc04('0xd8')],'as':'Attachments','required':![]}];}return db[_0xfc04('0xce')][_0xfc04('0x59')](_0x5bc121);})[_0xfc04('0x11')](function(_0x5ca41c){_0x36aa9f[_0xfc04('0x47')]=_0x5ca41c;return _0x36aa9f;});}})[_0xfc04('0x11')](respondWithFilteredResult(_0x111b63,_0x5bc121))['catch'](handleError(_0x111b63,null));};exports[_0xfc04('0x11f')]=function(_0x4f59a0,_0x22f02b){return db[_0xfc04('0x30')]['find']({'where':{'id':_0x4f59a0[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x22f02b,null))[_0xfc04('0x11')](function(_0x552b40){if(_0x552b40){return _0x552b40[_0xfc04('0x11f')](_0x4f59a0[_0xfc04('0x52')][_0xfc04('0x5b')],_[_0xfc04('0xea')](_0x4f59a0[_0xfc04('0x52')],[_0xfc04('0x5b'),'id'])||{})['spread'](function(_0x303d6c){for(var _0x4e555b=0x0;_0x4e555b<_0x4f59a0['body'][_0xfc04('0x5b')][_0xfc04('0x3c')];_0x4e555b+=0x1){socket[_0xfc04('0x120')]('userChatWebsite:save',{'UserId':Number(_0x4f59a0[_0xfc04('0x52')]['ids'][_0x4e555b]),'ChatWebsiteId':Number(_0x4f59a0[_0xfc04('0x49')]['id'])});}return _0x303d6c;});}})[_0xfc04('0x11')](respondWithResult(_0x22f02b,null))[_0xfc04('0x1b')](handleError(_0x22f02b,null));};exports[_0xfc04('0x121')]=function(_0x2afe96,_0x2c0c0f){return db[_0xfc04('0x30')][_0xfc04('0x4c')]({'where':{'id':_0x2afe96[_0xfc04('0x49')]['id']}})[_0xfc04('0x11')](handleEntityNotFound(_0x2c0c0f,null))[_0xfc04('0x11')](function(_0x3efa04){if(_0x3efa04){return _0x3efa04[_0xfc04('0x121')](_0x2afe96[_0xfc04('0x39')][_0xfc04('0x5b')])[_0xfc04('0x11')](function(){if(_[_0xfc04('0x122')](_0x2afe96['query']['ids'])){for(var _0x4ef942=0x0;_0x4ef942<_0x2afe96[_0xfc04('0x39')]['ids']['length'];_0x4ef942+=0x1){socket[_0xfc04('0x120')](_0xfc04('0x123'),{'UserId':Number(_0x2afe96[_0xfc04('0x39')][_0xfc04('0x5b')][_0x4ef942]),'ChatWebsiteId':Number(_0x2afe96[_0xfc04('0x49')]['id'])});}}else{socket[_0xfc04('0x120')](_0xfc04('0x123'),{'UserId':Number(_0x2afe96[_0xfc04('0x39')][_0xfc04('0x5b')]),'ChatWebsiteId':Number(_0x2afe96[_0xfc04('0x49')]['id'])});}});}})[_0xfc04('0x11')](respondWithStatusCode(_0x2c0c0f,null))['catch'](handleError(_0x2c0c0f,null));};exports[_0xfc04('0x124')]=function(_0x2fc05c,_0x3e76fc){var _0x3de96c={};var _0x3b6fbf={};var _0x1cba9d;var _0x24a865;return db[_0xfc04('0x30')][_0xfc04('0x58')]({'where':{'id':_0x2fc05c[_0xfc04('0x49')]['id']}})['then'](handleEntityNotFound(_0x3e76fc,null))[_0xfc04('0x11')](function(_0x476441){if(_0x476441){_0x1cba9d=_0x476441;_0x3b6fbf[_0xfc04('0x35')]=_[_0xfc04('0x36')](db[_0xfc04('0xb7')][_0xfc04('0x31')]);_0x3b6fbf[_0xfc04('0x39')]=_[_0xfc04('0x36')](_0x2fc05c['query']);_0x3b6fbf[_0xfc04('0x37')]=_[_0xfc04('0x38')](_0x3b6fbf[_0xfc04('0x35')],_0x3b6fbf['query']);_0x3de96c[_0xfc04('0x3b')]=_[_0xfc04('0x38')](_0x3b6fbf['model'],qs[_0xfc04('0x3a')](_0x2fc05c[_0xfc04('0x39')]['fields']));_0x3de96c[_0xfc04('0x3b')]=_0x3de96c[_0xfc04('0x3b')]['length']?_0x3de96c[_0xfc04('0x3b')]:_0x3b6fbf['model'];_0x3de96c[_0xfc04('0x3f')]=qs[_0xfc04('0x40')](_0x2fc05c[_0xfc04('0x39')][_0xfc04('0x40')]);_0x3de96c[_0xfc04('0x43')]=qs[_0xfc04('0x37')](_[_0xfc04('0x41')](_0x2fc05c[_0xfc04('0x39')],_0x3b6fbf[_0xfc04('0x37')]));if(_0x2fc05c['query'][_0xfc04('0x42')]){_0x3de96c[_0xfc04('0x43')]=_[_0xfc04('0x44')](_0x3de96c[_0xfc04('0x43')],{'$or':_['map'](_0x3de96c[_0xfc04('0x3b')],function(_0x18e3a9){var _0x2eeff7={};_0x2eeff7[_0x18e3a9]={'$like':'%'+_0x2fc05c[_0xfc04('0x39')][_0xfc04('0x42')]+'%'};return _0x2eeff7;})});}_0x3de96c=_[_0xfc04('0x44')]({},_0x3de96c,_0x2fc05c['options']);return _0x1cba9d[_0xfc04('0x124')](_0x3de96c);}})[_0xfc04('0x11')](function(_0xf9099b){if(_0xf9099b){_0x24a865=_0xf9099b['length'];if(!_0x2fc05c[_0xfc04('0x39')][_0xfc04('0x3d')](_0xfc04('0x3e'))){_0x3de96c[_0xfc04('0x21')]=qs['limit'](_0x2fc05c[_0xfc04('0x39')][_0xfc04('0x21')]);_0x3de96c['offset']=qs['offset'](_0x2fc05c[_0xfc04('0x39')][_0xfc04('0x20')]);}return _0x1cba9d[_0xfc04('0x124')](_0x3de96c);}})[_0xfc04('0x11')](function(_0x3bc324){if(_0x3bc324){return _0x3bc324?{'count':_0x24a865,'rows':_0x3bc324}:null;}})[_0xfc04('0x11')](respondWithResult(_0x3e76fc,null))[_0xfc04('0x1b')](handleError(_0x3e76fc,null));};
\ No newline at end of file
+var _0xa539=['getAnswers','removeAnswers','addLogo','addAvatar','agentAvatar','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.svg','sitepic','../../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','user-agent-parser','setUA','user-agent','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','ChatApplication','List','account','applications','Applications','orderBy','priority','ListId','from','contact','customerIp','headers','cf-connecting-ip','x-forwarded-for','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','vendor','%s\x20%s\x20%s','device','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','lastName','messageId','created','autoclose','push','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','files','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','server','basename','sequelize','transaction','bulkCreate','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','email','user','openNewInteraction','MailAccountId','subjectOffline','mapValues','MailAccount','offlineMessageSubject','notifyMail','offline-chat','remove','addInteraction','omit','Contact','fullname','internal','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','info','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','No\x20timezone','inspect','Interval','getProactiveActions','License','increment','Intervals','all','some','remote','stringify','connection','remoteAddress','alignment','verticalAlignment','labelText','textColor','backgroundColor','hideWhenOffline','IntervalId','addApplications','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','stack','finally','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Attachment','Attachments','addAgents','emit','userChatWebsite:save','removeAgents','getAgents','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','message','result','catch','status','end','json','limit','count','offset','set','Content-Range','update','destroy','get','ChatWebsites','sendStatus','name','send','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','filters','model','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','intersection','length','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','order','Disposition','removeDispositions','ids','addAnswer','CannedAnswer'];(function(_0x587fb1,_0x1fa311){var _0x5aa5d5=function(_0x5d96c7){while(--_0x5d96c7){_0x587fb1['push'](_0x587fb1['shift']());}};_0x5aa5d5(++_0x1fa311);}(_0xa539,0x1e9));var _0x9a53=function(_0x9a460d,_0x17c929){_0x9a460d=_0x9a460d-0x0;var _0x4b915a=_0xa539[_0x9a460d];return _0x4b915a;};'use strict';var BPromise=require('bluebird');var Mustache=require(_0x9a53('0x0'));var util=require(_0x9a53('0x1'));var path=require(_0x9a53('0x2'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x9a53('0x3'));var _=require(_0x9a53('0x4'));var querystring=require(_0x9a53('0x5'));var Redis=require(_0x9a53('0x6'));var qs=require(_0x9a53('0x7'));var logger=require('../../config/logger')(_0x9a53('0x8'));var config=require(_0x9a53('0x9'));var db=require(_0x9a53('0xa'))['db'];config[_0x9a53('0xb')]=_[_0x9a53('0xc')](config[_0x9a53('0xb')],{'host':_0x9a53('0xd'),'port':0x18eb});var socket=require(_0x9a53('0xe'))(new Redis(config[_0x9a53('0xb')]));require(_0x9a53('0xf'))[_0x9a53('0x10')](socket);var htmlToText=require(_0x9a53('0x11'));var jayson=require(_0x9a53('0x12'));var client=jayson[_0x9a53('0x13')][_0x9a53('0x14')]({'port':0x232c});var client9002=jayson[_0x9a53('0x13')][_0x9a53('0x14')]({'port':0x232a});var client9003=jayson[_0x9a53('0x13')][_0x9a53('0x14')]({'port':0x232b});var client9001=jayson[_0x9a53('0x13')]['http']({'port':0x2329});function respondWithRpcPromise(_0x3ab0d3,_0x5c0650,_0x245ba1,_0x46bc5e){return new BPromise(function(_0x538255,_0x3b08c3){var _0x3322a8=_0x46bc5e||client;return _0x3322a8[_0x9a53('0x15')](_0x3ab0d3,_0x245ba1)[_0x9a53('0x16')](function(_0x2eeff2){logger['info'](_0x9a53('0x17'),_0x5c0650,_0x9a53('0x18'));logger[_0x9a53('0x19')](_0x9a53('0x1a'),_0x5c0650,'request\x20sent',JSON['stringify'](_0x2eeff2));if(_0x2eeff2[_0x9a53('0x1b')]){if(_0x2eeff2['error']['code']===0x1f4){logger[_0x9a53('0x1b')](_0x9a53('0x17'),_0x5c0650,_0x2eeff2[_0x9a53('0x1b')][_0x9a53('0x1c')]);return _0x3b08c3(_0x2eeff2[_0x9a53('0x1b')]['message']);}logger[_0x9a53('0x1b')](_0x9a53('0x17'),_0x5c0650,_0x2eeff2[_0x9a53('0x1b')][_0x9a53('0x1c')]);return _0x538255(_0x2eeff2['error'][_0x9a53('0x1c')]);}else{logger['info'](_0x9a53('0x17'),_0x5c0650,'request\x20sent');_0x538255(_0x2eeff2[_0x9a53('0x1d')][_0x9a53('0x1c')]);}})[_0x9a53('0x1e')](function(_0x2255ac){logger[_0x9a53('0x1b')](_0x9a53('0x17'),_0x5c0650,_0x2255ac);_0x3b08c3(_0x2255ac);});});}function respondWithStatusCode(_0x136657,_0x21abb9){_0x21abb9=_0x21abb9||0xcc;return function(_0x4cc45e){if(_0x4cc45e){return _0x136657['sendStatus'](_0x21abb9);}return _0x136657[_0x9a53('0x1f')](_0x21abb9)[_0x9a53('0x20')]();};}function respondWithResult(_0x461f00,_0x592af1){_0x592af1=_0x592af1||0xc8;return function(_0x2d602d){if(_0x2d602d){return _0x461f00[_0x9a53('0x1f')](_0x592af1)[_0x9a53('0x21')](_0x2d602d);}};}function respondWithFilteredResult(_0x288300,_0x2671b1){return function(_0x551c1d){if(_0x551c1d){var _0x3456b3=typeof _0x2671b1['offset']==='undefined'&&typeof _0x2671b1[_0x9a53('0x22')]==='undefined';var _0x24aad7=_0x551c1d[_0x9a53('0x23')];var _0x2a92b1=_0x3456b3?0x0:_0x2671b1[_0x9a53('0x24')];var _0x507ceb=_0x3456b3?_0x551c1d['count']:_0x2671b1[_0x9a53('0x24')]+_0x2671b1['limit'];var _0x18f9d5;if(_0x507ceb>=_0x24aad7){_0x507ceb=_0x24aad7;_0x18f9d5=0xc8;}else{_0x18f9d5=0xce;}_0x288300[_0x9a53('0x1f')](_0x18f9d5);return _0x288300[_0x9a53('0x25')](_0x9a53('0x26'),_0x2a92b1+'-'+_0x507ceb+'/'+_0x24aad7)[_0x9a53('0x21')](_0x551c1d);}return null;};}function saveUpdates(_0xa5150b){return function(_0x20e6aa){if(_0x20e6aa){return _0x20e6aa[_0x9a53('0x27')](_0xa5150b)[_0x9a53('0x16')](function(_0x2be02a){return _0x2be02a;});}return null;};}function removeEntity(_0x400947){return function(_0x227f22){if(_0x227f22){return _0x227f22[_0x9a53('0x28')]()[_0x9a53('0x16')](function(){var _0x4b3fdb=_0x227f22[_0x9a53('0x29')]({'plain':!![]});var _0x3f48b1=_0x9a53('0x2a');return db['UserProfileResource'][_0x9a53('0x28')]({'where':{'type':_0x3f48b1,'resourceId':_0x4b3fdb['id']}})[_0x9a53('0x16')](function(){return _0x227f22;});})['then'](function(){_0x400947[_0x9a53('0x1f')](0xcc)[_0x9a53('0x20')]();});}};}function handleEntityNotFound(_0x4e8aeb){return function(_0x16e9a1){if(!_0x16e9a1){_0x4e8aeb[_0x9a53('0x2b')](0x194);}return _0x16e9a1;};}function handleError(_0x4f9218,_0x5d429d){_0x5d429d=_0x5d429d||0x1f4;return function(_0x2d1d9a){logger[_0x9a53('0x1b')](_0x2d1d9a['stack']);if(_0x2d1d9a[_0x9a53('0x2c')]){delete _0x2d1d9a[_0x9a53('0x2c')];}_0x4f9218[_0x9a53('0x1f')](_0x5d429d)[_0x9a53('0x2d')](_0x2d1d9a);};}exports[_0x9a53('0x2e')]=function(_0x396720,_0x1fc9b8){var _0x4ed0c5={'include':[{'model':db[_0x9a53('0x2f')],'as':_0x9a53('0x30')}]},_0x11c839={},_0x5efec8={'count':0x0,'rows':[]};var _0x205b66=_[_0x9a53('0x31')](db[_0x9a53('0x32')][_0x9a53('0x33')],function(_0x16014e){return{'name':_0x16014e[_0x9a53('0x34')],'type':_0x16014e[_0x9a53('0x35')][_0x9a53('0x36')]};});_0x11c839['model']=_['map'](_0x205b66,'name');_0x11c839[_0x9a53('0x37')]=_['keys'](_0x396720['query']);_0x11c839[_0x9a53('0x38')]=_['intersection'](_0x11c839[_0x9a53('0x39')],_0x11c839[_0x9a53('0x37')]);_0x4ed0c5[_0x9a53('0x3a')]=_['intersection'](_0x11c839[_0x9a53('0x39')],qs[_0x9a53('0x3b')](_0x396720[_0x9a53('0x37')][_0x9a53('0x3b')]));_0x4ed0c5[_0x9a53('0x3a')]=_0x4ed0c5[_0x9a53('0x3a')]['length']?_0x4ed0c5[_0x9a53('0x3a')]:_0x11c839[_0x9a53('0x39')];if(!_0x396720[_0x9a53('0x37')][_0x9a53('0x3c')](_0x9a53('0x3d'))){_0x4ed0c5['limit']=qs[_0x9a53('0x22')](_0x396720[_0x9a53('0x37')][_0x9a53('0x22')]);_0x4ed0c5[_0x9a53('0x24')]=qs[_0x9a53('0x24')](_0x396720[_0x9a53('0x37')][_0x9a53('0x24')]);}_0x4ed0c5['order']=qs[_0x9a53('0x3e')](_0x396720[_0x9a53('0x37')]['sort']);_0x4ed0c5['where']=qs[_0x9a53('0x38')](_[_0x9a53('0x3f')](_0x396720[_0x9a53('0x37')],_0x11c839['filters']),_0x205b66);if(_0x396720[_0x9a53('0x37')][_0x9a53('0x40')]){_0x4ed0c5[_0x9a53('0x41')]=_[_0x9a53('0x42')](_0x4ed0c5[_0x9a53('0x41')],{'$or':_[_0x9a53('0x31')](_0x205b66,function(_0x2fe36e){if(_0x2fe36e[_0x9a53('0x35')]!==_0x9a53('0x43')){var _0x38cd58={};_0x38cd58[_0x2fe36e[_0x9a53('0x2c')]]={'$like':'%'+_0x396720[_0x9a53('0x37')][_0x9a53('0x40')]+'%'};return _0x38cd58;}})});}_0x4ed0c5=_[_0x9a53('0x42')]({},_0x4ed0c5,_0x396720[_0x9a53('0x44')]);var _0x86e2ab={'where':_0x4ed0c5[_0x9a53('0x41')]};return db[_0x9a53('0x32')]['count'](_0x86e2ab)[_0x9a53('0x16')](function(_0x408253){_0x5efec8[_0x9a53('0x23')]=_0x408253;if(_0x396720[_0x9a53('0x37')][_0x9a53('0x45')]){_0x4ed0c5[_0x9a53('0x46')]=[{'all':!![]}];}return db[_0x9a53('0x32')][_0x9a53('0x47')](_0x4ed0c5);})[_0x9a53('0x16')](function(_0x5f16df){_0x5efec8[_0x9a53('0x48')]=_0x5f16df;return _0x5efec8;})[_0x9a53('0x16')](respondWithFilteredResult(_0x1fc9b8,_0x4ed0c5))[_0x9a53('0x1e')](handleError(_0x1fc9b8,null));};exports[_0x9a53('0x49')]=function(_0x253f14,_0x455d0c){var _0x595000={'raw':![],'where':{'id':_0x253f14[_0x9a53('0x4a')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x20157c={};_0x20157c[_0x9a53('0x39')]=_[_0x9a53('0x4b')](db[_0x9a53('0x32')][_0x9a53('0x33')]);_0x20157c[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0x253f14[_0x9a53('0x37')]);_0x20157c[_0x9a53('0x38')]=_[_0x9a53('0x4c')](_0x20157c[_0x9a53('0x39')],_0x20157c[_0x9a53('0x37')]);_0x595000[_0x9a53('0x3a')]=_[_0x9a53('0x4c')](_0x20157c[_0x9a53('0x39')],qs['fields'](_0x253f14['query'][_0x9a53('0x3b')]));_0x595000[_0x9a53('0x3a')]=_0x595000['attributes'][_0x9a53('0x4d')]?_0x595000[_0x9a53('0x3a')]:_0x20157c['model'];if(_0x253f14[_0x9a53('0x37')]['includeAll']){_0x595000[_0x9a53('0x46')]=[{'all':!![]}];}_0x595000=_[_0x9a53('0x42')]({},_0x595000,_0x253f14['options']);return db['ChatWebsite'][_0x9a53('0x4e')](_0x595000)[_0x9a53('0x16')](handleEntityNotFound(_0x455d0c,null))['then'](respondWithResult(_0x455d0c,null))['catch'](handleError(_0x455d0c,null));};exports['create']=function(_0x26faa7,_0x2a547a){return db[_0x9a53('0x32')][_0x9a53('0x4f')](_0x26faa7[_0x9a53('0x50')],{})[_0x9a53('0x16')](function(_0x38d68a){var _0x41784f=_0x26faa7['user']['get']({'plain':!![]});if(!_0x41784f)throw new Error(_0x9a53('0x51'));if(_0x41784f[_0x9a53('0x52')]==='user'){var _0x7b40f0=_0x38d68a['get']({'plain':!![]});var _0x50b6c8=_0x9a53('0x2a');return db[_0x9a53('0x53')]['find']({'where':{'name':_0x50b6c8,'userProfileId':_0x41784f[_0x9a53('0x54')]},'raw':!![]})[_0x9a53('0x16')](function(_0x21831b){if(_0x21831b&&_0x21831b[_0x9a53('0x55')]===0x0){return db[_0x9a53('0x56')][_0x9a53('0x4f')]({'name':_0x7b40f0[_0x9a53('0x2c')],'resourceId':_0x7b40f0['id'],'type':_0x21831b[_0x9a53('0x2c')],'sectionId':_0x21831b['id']},{})[_0x9a53('0x16')](function(){return _0x38d68a;});}else{return _0x38d68a;}})[_0x9a53('0x1e')](function(_0x52c235){logger[_0x9a53('0x1b')](_0x9a53('0x57'),_0x52c235);throw _0x52c235;});}return _0x38d68a;})[_0x9a53('0x16')](respondWithResult(_0x2a547a,0xc9))['catch'](handleError(_0x2a547a,null));};exports[_0x9a53('0x27')]=function(_0x1b5a5a,_0x45e76c){if(_0x1b5a5a['body']['id']){delete _0x1b5a5a[_0x9a53('0x50')]['id'];}return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x1b5a5a[_0x9a53('0x4a')]['id']},'include':[{'model':db[_0x9a53('0x2f')],'as':_0x9a53('0x30')}]})[_0x9a53('0x16')](handleEntityNotFound(_0x45e76c,null))[_0x9a53('0x16')](saveUpdates(_0x1b5a5a[_0x9a53('0x50')],null))[_0x9a53('0x16')](respondWithResult(_0x45e76c,null))[_0x9a53('0x1e')](handleError(_0x45e76c,null));};exports['destroy']=function(_0x192d55,_0xb812fd){return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x192d55['params']['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0xb812fd,null))[_0x9a53('0x16')](removeEntity(_0xb812fd,null))[_0x9a53('0x1e')](handleError(_0xb812fd,null));};exports[_0x9a53('0x58')]=function(_0x4602be,_0x3ff117){return db[_0x9a53('0x32')][_0x9a53('0x58')]()[_0x9a53('0x16')](respondWithResult(_0x3ff117,null))['catch'](handleError(_0x3ff117,null));};exports[_0x9a53('0x59')]=function(_0x1513d8,_0x2b9575){if(_0x1513d8[_0x9a53('0x50')]['id']){delete _0x1513d8[_0x9a53('0x50')]['id'];}return db['ChatWebsite'][_0x9a53('0x4e')]({'where':{'id':_0x1513d8[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x2b9575,null))['then'](function(_0x17e26e){if(_0x17e26e){_0x1513d8[_0x9a53('0x50')][_0x9a53('0x5a')]=_0x17e26e['id'];return db['Disposition'][_0x9a53('0x4f')](_0x1513d8[_0x9a53('0x50')]);}})[_0x9a53('0x16')](respondWithResult(_0x2b9575,null))[_0x9a53('0x1e')](handleError(_0x2b9575,null));};exports[_0x9a53('0x5b')]=function(_0x3a55bf,_0x430277){var _0x51967b={'raw':![],'where':{}};var _0x6fcca={};var _0x420564={'count':0x0,'rows':[]};return db['ChatWebsite'][_0x9a53('0x5c')]({'where':{'id':_0x3a55bf[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x430277,null))[_0x9a53('0x16')](function(_0x1d87a8){if(_0x1d87a8){_0x6fcca[_0x9a53('0x39')]=_[_0x9a53('0x4b')](db['Disposition']['rawAttributes']);_0x6fcca[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0x3a55bf['query']);_0x6fcca[_0x9a53('0x38')]=_[_0x9a53('0x4c')](_0x6fcca[_0x9a53('0x39')],_0x6fcca['query']);_0x51967b[_0x9a53('0x3a')]=_[_0x9a53('0x4c')](_0x6fcca['model'],qs[_0x9a53('0x3b')](_0x3a55bf[_0x9a53('0x37')][_0x9a53('0x3b')]));_0x51967b[_0x9a53('0x3a')]=_0x51967b[_0x9a53('0x3a')]['length']?_0x51967b[_0x9a53('0x3a')]:_0x6fcca[_0x9a53('0x39')];if(!_0x3a55bf[_0x9a53('0x37')][_0x9a53('0x3c')](_0x9a53('0x3d'))){_0x51967b[_0x9a53('0x22')]=qs[_0x9a53('0x22')](_0x3a55bf['query'][_0x9a53('0x22')]);_0x51967b[_0x9a53('0x24')]=qs['offset'](_0x3a55bf[_0x9a53('0x37')][_0x9a53('0x24')]);}_0x51967b[_0x9a53('0x5d')]=qs[_0x9a53('0x3e')](_0x3a55bf[_0x9a53('0x37')][_0x9a53('0x3e')]);_0x51967b[_0x9a53('0x41')]=qs['filters'](_[_0x9a53('0x3f')](_0x3a55bf['query'],_0x6fcca[_0x9a53('0x38')]));_0x51967b[_0x9a53('0x41')][_0x9a53('0x5a')]=_0x1d87a8['id'];if(_0x3a55bf[_0x9a53('0x37')][_0x9a53('0x40')]){_0x51967b[_0x9a53('0x41')]=_[_0x9a53('0x42')](_0x51967b[_0x9a53('0x41')],{'$or':_[_0x9a53('0x31')](_0x51967b[_0x9a53('0x3a')],function(_0xc15f6){var _0x2f34fc={};_0x2f34fc[_0xc15f6]={'$like':'%'+_0x3a55bf['query'][_0x9a53('0x40')]+'%'};return _0x2f34fc;})});}_0x51967b=_['merge']({},_0x51967b,_0x3a55bf[_0x9a53('0x44')]);return db[_0x9a53('0x5e')]['count']({'where':_0x51967b[_0x9a53('0x41')]})[_0x9a53('0x16')](function(_0x1f0c1a){_0x420564[_0x9a53('0x23')]=_0x1f0c1a;if(_0x3a55bf[_0x9a53('0x37')][_0x9a53('0x45')]){_0x51967b[_0x9a53('0x46')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x51967b);})['then'](function(_0x367260){_0x420564[_0x9a53('0x48')]=_0x367260;return _0x420564;});}})['then'](respondWithFilteredResult(_0x430277,_0x51967b))[_0x9a53('0x1e')](handleError(_0x430277,null));};exports[_0x9a53('0x5f')]=function(_0x2d99a8,_0x482e3f){return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x2d99a8[_0x9a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x482e3f,null))['then'](function(_0xfe4319){if(_0xfe4319){return _0xfe4319[_0x9a53('0x5f')](_0x2d99a8[_0x9a53('0x37')][_0x9a53('0x60')]);}})['then'](respondWithStatusCode(_0x482e3f,null))[_0x9a53('0x1e')](handleError(_0x482e3f,null));};exports[_0x9a53('0x61')]=function(_0xd65fe3,_0x15f396){if(_0xd65fe3['body']['id']){delete _0xd65fe3[_0x9a53('0x50')]['id'];}return db[_0x9a53('0x32')]['find']({'where':{'id':_0xd65fe3['params']['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x15f396,null))['then'](function(_0x41bcad){if(_0x41bcad){_0xd65fe3[_0x9a53('0x50')][_0x9a53('0x5a')]=_0x41bcad['id'];return db[_0x9a53('0x62')][_0x9a53('0x4f')](_0xd65fe3[_0x9a53('0x50')]);}})[_0x9a53('0x16')](respondWithResult(_0x15f396,null))[_0x9a53('0x1e')](handleError(_0x15f396,null));};exports[_0x9a53('0x63')]=function(_0x5ebba2,_0x568b7b){var _0xba0dd0={'raw':![],'where':{}};var _0x3fe61d={};var _0x1fd699={'count':0x0,'rows':[]};return db[_0x9a53('0x32')]['findOne']({'where':{'id':_0x5ebba2['params']['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x568b7b,null))['then'](function(_0x22ddb5){if(_0x22ddb5){_0x3fe61d[_0x9a53('0x39')]=_[_0x9a53('0x4b')](db['CannedAnswer']['rawAttributes']);_0x3fe61d[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0x5ebba2[_0x9a53('0x37')]);_0x3fe61d['filters']=_[_0x9a53('0x4c')](_0x3fe61d['model'],_0x3fe61d[_0x9a53('0x37')]);_0xba0dd0[_0x9a53('0x3a')]=_[_0x9a53('0x4c')](_0x3fe61d['model'],qs[_0x9a53('0x3b')](_0x5ebba2['query']['fields']));_0xba0dd0[_0x9a53('0x3a')]=_0xba0dd0[_0x9a53('0x3a')][_0x9a53('0x4d')]?_0xba0dd0[_0x9a53('0x3a')]:_0x3fe61d[_0x9a53('0x39')];if(!_0x5ebba2[_0x9a53('0x37')][_0x9a53('0x3c')](_0x9a53('0x3d'))){_0xba0dd0[_0x9a53('0x22')]=qs[_0x9a53('0x22')](_0x5ebba2['query'][_0x9a53('0x22')]);_0xba0dd0[_0x9a53('0x24')]=qs['offset'](_0x5ebba2[_0x9a53('0x37')][_0x9a53('0x24')]);}_0xba0dd0['order']=qs[_0x9a53('0x3e')](_0x5ebba2[_0x9a53('0x37')]['sort']);_0xba0dd0[_0x9a53('0x41')]=qs[_0x9a53('0x38')](_['pick'](_0x5ebba2[_0x9a53('0x37')],_0x3fe61d[_0x9a53('0x38')]));_0xba0dd0[_0x9a53('0x41')][_0x9a53('0x5a')]=_0x22ddb5['id'];if(_0x5ebba2[_0x9a53('0x37')][_0x9a53('0x40')]){_0xba0dd0[_0x9a53('0x41')]=_[_0x9a53('0x42')](_0xba0dd0[_0x9a53('0x41')],{'$or':_[_0x9a53('0x31')](_0xba0dd0[_0x9a53('0x3a')],function(_0x4564da){var _0x3d98e0={};_0x3d98e0[_0x4564da]={'$like':'%'+_0x5ebba2['query'][_0x9a53('0x40')]+'%'};return _0x3d98e0;})});}_0xba0dd0=_[_0x9a53('0x42')]({},_0xba0dd0,_0x5ebba2[_0x9a53('0x44')]);return db[_0x9a53('0x62')][_0x9a53('0x23')]({'where':_0xba0dd0['where']})[_0x9a53('0x16')](function(_0x17530e){_0x1fd699[_0x9a53('0x23')]=_0x17530e;if(_0x5ebba2[_0x9a53('0x37')][_0x9a53('0x45')]){_0xba0dd0[_0x9a53('0x46')]=[{'all':!![]}];}return db[_0x9a53('0x62')][_0x9a53('0x47')](_0xba0dd0);})[_0x9a53('0x16')](function(_0x19b52b){_0x1fd699[_0x9a53('0x48')]=_0x19b52b;return _0x1fd699;});}})[_0x9a53('0x16')](respondWithFilteredResult(_0x568b7b,_0xba0dd0))[_0x9a53('0x1e')](handleError(_0x568b7b,null));};exports[_0x9a53('0x64')]=function(_0x230c64,_0x36fffa){return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x230c64[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x36fffa,null))[_0x9a53('0x16')](function(_0x11ce42){if(_0x11ce42){return _0x11ce42['removeAnswers'](_0x230c64['query'][_0x9a53('0x60')]);}})[_0x9a53('0x16')](respondWithStatusCode(_0x36fffa,null))[_0x9a53('0x1e')](handleError(_0x36fffa,null));};exports[_0x9a53('0x65')]=function(_0x57389f,_0x584502){_0x57389f[_0x9a53('0x50')]['sitepic']=_0x57389f['file']['filename'];return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x57389f[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x584502,null))[_0x9a53('0x16')](saveUpdates(_0x57389f[_0x9a53('0x50')],null))[_0x9a53('0x16')](respondWithResult(_0x584502,null))['catch'](handleError(_0x584502,null));};exports[_0x9a53('0x66')]=function(_0x1158aa,_0x144242){_0x1158aa[_0x9a53('0x50')][_0x9a53('0x67')]=_0x1158aa[_0x9a53('0x68')][_0x9a53('0x69')];return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x1158aa[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x144242,null))['then'](saveUpdates(_0x1158aa['body'],null))[_0x9a53('0x16')](respondWithResult(_0x144242,null))[_0x9a53('0x1e')](handleError(_0x144242,null));};exports[_0x9a53('0x6a')]=function(_0x547f10,_0x4f4d70){_0x547f10[_0x9a53('0x50')][_0x9a53('0x6b')]=_0x547f10[_0x9a53('0x68')][_0x9a53('0x69')];return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x547f10[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x4f4d70,null))[_0x9a53('0x16')](saveUpdates(_0x547f10[_0x9a53('0x50')],null))['then'](respondWithResult(_0x4f4d70,null))[_0x9a53('0x1e')](handleError(_0x4f4d70,null));};exports[_0x9a53('0x6c')]=function(_0x296c15,_0x33c79e){_0x296c15[_0x9a53('0x50')][_0x9a53('0x6d')]=_0x296c15['file'][_0x9a53('0x69')];return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x296c15[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x33c79e,null))[_0x9a53('0x16')](saveUpdates(_0x296c15[_0x9a53('0x50')],null))[_0x9a53('0x16')](respondWithResult(_0x33c79e,null))[_0x9a53('0x1e')](handleError(_0x33c79e,null));};exports[_0x9a53('0x6e')]=function(_0x1ed85c,_0x488642){var _0x2a3d84=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0x71'));var _0x11b52b={'where':{'id':_0x1ed85c[_0x9a53('0x4a')]['id']},'attributes':['id',_0x9a53('0x72')],'raw':!![]};var _0x19a5e4=![];return require(_0x9a53('0x73'))[_0x9a53('0x74')]()[_0x9a53('0x16')](function(_0x8c39ad){if(_0x8c39ad){_0x19a5e4=_0x8c39ad[_0x9a53('0x75')];}})[_0x9a53('0x16')](function(){return db[_0x9a53('0x32')][_0x9a53('0x4e')](_0x11b52b);})[_0x9a53('0x16')](handleEntityNotFound(_0x488642,null))[_0x9a53('0x16')](function(_0x3ec5ef){if(_0x3ec5ef){if(!_[_0x9a53('0x76')](_0x3ec5ef[_0x9a53('0x72')])){if(fs[_0x9a53('0x77')](path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0x78'),_0x3ec5ef[_0x9a53('0x72')]))&&_0x19a5e4){_0x2a3d84=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],'server/files/images/logos/',_0x3ec5ef[_0x9a53('0x72')]);}}return _0x488642[_0x9a53('0x79')](_0x2a3d84);}})[_0x9a53('0x1e')](handleError(_0x488642,null));};exports[_0x9a53('0x7a')]=function(_0x89f352,_0x27f58a){var _0x2d77d9=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],'server/files/images/avatars/default_avatar.png');var _0x41c4f2={'where':{'id':_0x89f352[_0x9a53('0x4a')]['id']},'attributes':['id',_0x9a53('0x67')],'raw':!![]};return db[_0x9a53('0x32')]['find'](_0x41c4f2)[_0x9a53('0x16')](handleEntityNotFound(_0x27f58a,null))[_0x9a53('0x16')](function(_0x4823ab){if(_0x4823ab){if(!_[_0x9a53('0x76')](_0x4823ab[_0x9a53('0x67')])){if(fs['existsSync'](path[_0x9a53('0x6f')](config['root'],_0x9a53('0x7b'),_0x4823ab[_0x9a53('0x67')]))){_0x2d77d9=path[_0x9a53('0x6f')](config['root'],_0x9a53('0x7b'),_0x4823ab[_0x9a53('0x67')]);}}return _0x27f58a['download'](_0x2d77d9);}})[_0x9a53('0x1e')](handleError(_0x27f58a,null));};exports[_0x9a53('0x7c')]=function(_0x58787b,_0x24af34){var _0x5885c3=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0x7d'));var _0x1cb6a8={'where':{'id':_0x58787b[_0x9a53('0x4a')]['id']},'attributes':['id',_0x9a53('0x6b'),_0x9a53('0x7e')],'raw':!![]};return db['ChatWebsite']['find'](_0x1cb6a8)['then'](handleEntityNotFound(_0x24af34,null))[_0x9a53('0x16')](function(_0x27c9a7){if(_0x27c9a7){if(!_[_0x9a53('0x76')](_0x27c9a7[_0x9a53('0x6b')])){if(fs[_0x9a53('0x77')](path[_0x9a53('0x6f')](config['root'],_0x9a53('0x7b'),_0x27c9a7[_0x9a53('0x6b')]))&&_0x27c9a7[_0x9a53('0x7e')]){_0x5885c3=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],'server/files/images/avatars/',_0x27c9a7['customerAvatar']);}}return _0x24af34[_0x9a53('0x79')](_0x5885c3);}})['catch'](handleError(_0x24af34,null));};exports[_0x9a53('0x7f')]=function(_0x531ad4,_0x53462a){var _0xb485e5=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0x80'));var _0x5c8a46={'where':{'id':_0x531ad4[_0x9a53('0x4a')]['id']},'attributes':['id',_0x9a53('0x6d')],'raw':!![]};return db['ChatWebsite'][_0x9a53('0x4e')](_0x5c8a46)[_0x9a53('0x16')](handleEntityNotFound(_0x53462a,null))[_0x9a53('0x16')](function(_0x3b58e4){if(_0x3b58e4){if(!_[_0x9a53('0x76')](_0x3b58e4[_0x9a53('0x6d')])){if(fs[_0x9a53('0x77')](path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0x7b'),_0x3b58e4[_0x9a53('0x6d')]))){_0xb485e5=path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0x7b'),_0x3b58e4[_0x9a53('0x6d')]);}}return _0x53462a[_0x9a53('0x79')](_0xb485e5);}})['catch'](handleError(_0x53462a,null));};exports[_0x9a53('0x81')]=function(_0x1bec48,_0x58f832){var _0x35f46f=require(_0x9a53('0x82'));var _0x57ae27=new _0x35f46f();var _0x1b764c=_0x57ae27[_0x9a53('0x83')](_0x1bec48['headers'][_0x9a53('0x84')])['getResult']();var _0x1a7302={'body':_0x1bec48[_0x9a53('0x50')],'channel':'chat'};var _0x2df2c7=[];var _0x6b1a36=[];var _0x4a1c16={};var _0x17738e=![];return db[_0x9a53('0x85')]['describe']()['then'](function(_0x146ac3){if(!_0x146ac3){throw new db[(_0x9a53('0x86'))][(_0x9a53('0x87'))](_0x9a53('0x88'));}_0x2df2c7=_[_0x9a53('0x89')](_[_0x9a53('0x4b')](_0x146ac3),[_0x9a53('0x8a'),_0x9a53('0x8b')]);_0x6b1a36=_[_0x9a53('0x89')](_['keys'](_0x146ac3),[_0x9a53('0x8a'),'updatedAt',_0x9a53('0x8c'),'ListId']);if(_0x1bec48[_0x9a53('0x50')]['id']){delete _0x1bec48[_0x9a53('0x50')]['id'];}if(_[_0x9a53('0x76')](_0x1bec48[_0x9a53('0x50')]['from'])){throw new db[(_0x9a53('0x86'))][(_0x9a53('0x87'))](_0x9a53('0x8d'));}if(_['isNil'](_0x1bec48[_0x9a53('0x50')][_0x9a53('0x50')])||_0x1bec48[_0x9a53('0x50')]['body']===''){throw new db[(_0x9a53('0x86'))]['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x9a53('0x76')](_0x1bec48[_0x9a53('0x50')][_0x9a53('0x8e')])){throw new db[(_0x9a53('0x86'))][(_0x9a53('0x87'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x6b1a36);}if(!_[_0x9a53('0x8f')](_0x6b1a36,_0x1bec48[_0x9a53('0x50')][_0x9a53('0x8e')])){throw new db[(_0x9a53('0x86'))]['ValidationError'](_0x9a53('0x90')+_0x6b1a36);}_0x4a1c16[_0x1bec48['body'][_0x9a53('0x8e')]]=_0x1bec48[_0x9a53('0x50')]['from'];})[_0x9a53('0x16')](function(){return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x1bec48['params']['id']},'include':[{'model':db[_0x9a53('0x91')],'as':'List','include':[{'model':db[_0x9a53('0x85')],'as':_0x9a53('0x92'),'where':_0x4a1c16,'limit':0x1,'order':[['updatedAt','DESC']]}]},{'model':db[_0x9a53('0x93')],'as':'Applications'}]});})[_0x9a53('0x16')](handleEntityNotFound(_0x58f832,null))[_0x9a53('0x16')](function(_0x478c2f){if(_0x478c2f&&_0x478c2f[_0x9a53('0x94')]){_0x1a7302[_0x9a53('0x95')]=_0x478c2f;_0x1a7302[_0x9a53('0x96')]=_0x478c2f[_0x9a53('0x97')];_0x1a7302['list']=_0x478c2f[_0x9a53('0x94')];_0x1a7302[_0x9a53('0x96')]=_[_0x9a53('0x98')](_0x1a7302[_0x9a53('0x96')],[_0x9a53('0x99')],['asc']);if(_0x1a7302['account'][_0x9a53('0x97')]){delete _0x1a7302[_0x9a53('0x95')][_0x9a53('0x97')];}if(_0x1a7302[_0x9a53('0x95')][_0x9a53('0x94')]&&_0x1a7302['account'][_0x9a53('0x94')]['Contacts'][_0x9a53('0x4d')]){return _0x1a7302[_0x9a53('0x95')]['List'][_0x9a53('0x92')][0x0];}var _0x532a45=_[_0x9a53('0xc')](_0x1bec48[_0x9a53('0x50')],{'firstName':_0x1bec48[_0x9a53('0x50')]['from'],'ListId':_0x478c2f[_0x9a53('0x9a')]});_0x532a45[_0x1bec48[_0x9a53('0x50')]['mapKey']]=_0x1bec48[_0x9a53('0x50')][_0x9a53('0x9b')];return db[_0x9a53('0x85')][_0x9a53('0x4f')](_0x532a45,{'fields':_0x2df2c7,'raw':!![]});}})['then'](handleEntityNotFound(_0x58f832,null))[_0x9a53('0x16')](function(_0x3fd26a){_0x1a7302[_0x9a53('0x9c')]=_0x3fd26a;var _0x69fea3=_0x1bec48[_0x9a53('0x50')][_0x9a53('0x9d')];if(_0x1bec48[_0x9a53('0x9e')][_0x9a53('0x9f')]){_0x69fea3=_0x1bec48['headers']['cf-connecting-ip'];}else if(_0x1bec48[_0x9a53('0x9e')]['x-forwarded-for']){_0x69fea3=_['first'](_0x1bec48[_0x9a53('0x9e')][_0x9a53('0xa0')][_0x9a53('0xa1')](','));}if(_0x3fd26a){var _0x44709f={'ContactId':_0x3fd26a['id'],'ChatWebsiteId':_0x1bec48[_0x9a53('0x4a')]['id'],'from':(_0x3fd26a[_0x9a53('0xa2')]||'')+'\x20'+(_0x3fd26a['lastName']||''),'customerIp':_0x69fea3,'customerPort':_0x1bec48[_0x9a53('0x9e')]['x-real-port']?_0x1bec48['headers'][_0x9a53('0xa3')]:null,'referer':_0x1bec48['body'][_0x9a53('0xa4')],'browserName':_0x1b764c[_0x9a53('0xa5')][_0x9a53('0x2c')]&&_0x1b764c['browser'][_0x9a53('0xa6')]?util[_0x9a53('0xa7')](_0x9a53('0xa8'),_0x1b764c[_0x9a53('0xa5')][_0x9a53('0x2c')],_0x1b764c[_0x9a53('0xa5')][_0x9a53('0xa6')]):_0x9a53('0xa9'),'browserVersion':_0x1b764c['browser'][_0x9a53('0xa6')]||_0x9a53('0xa9'),'osName':util[_0x9a53('0xa7')](_0x9a53('0xa8'),_0x1b764c['os'][_0x9a53('0x2c')],_0x1b764c['os'][_0x9a53('0xa6')]),'osVersion':_0x1b764c['os']['version'],'deviceModel':_0x1b764c['device'][_0x9a53('0x39')]&&_0x1b764c['device'][_0x9a53('0xaa')]?util['format'](_0x9a53('0xab'),_0x1b764c[_0x9a53('0xac')][_0x9a53('0x39')],_0x1b764c[_0x9a53('0xac')][_0x9a53('0xaa')],_0x1b764c[_0x9a53('0xac')][_0x9a53('0x35')]):null,'deviceVendor':_0x1b764c[_0x9a53('0xac')][_0x9a53('0xaa')],'deviceType':_0x1b764c['device'][_0x9a53('0x35')],'formData':JSON['stringify'](_0x1bec48[_0x9a53('0x50')])};var _0x214762={'ChatWebsiteId':_0x1bec48['params']['id'],'closed':![]};if(_0x1bec48['body'][_0x9a53('0xad')]){_0x214762['threadId']=_0x1bec48[_0x9a53('0x50')]['threadId'];return db[_0x9a53('0xae')][_0x9a53('0x4e')]({'where':_0x214762})[_0x9a53('0x16')](function(_0x4e7266){if(_0x4e7266){return[_0x4e7266,![]];}_0x44709f[_0x9a53('0xad')]=_0x1bec48[_0x9a53('0x50')][_0x9a53('0xad')];_0x44709f[_0x9a53('0xaf')]=_0x1bec48[_0x9a53('0x50')][_0x9a53('0xaf')];return db[_0x9a53('0xae')][_0x9a53('0x4f')](_0x44709f)[_0x9a53('0x16')](function(_0x1ab198){return[_0x1ab198,!![]];});});}_0x214762[_0x9a53('0xb0')]=_0x3fd26a['id'];if(_0x1bec48[_0x9a53('0x50')][_0x9a53('0xb1')]&&_0x1bec48[_0x9a53('0x50')][_0x9a53('0xb1')]['id']){_0x214762['id']=_0x1bec48[_0x9a53('0x50')]['interaction']['id'];return db[_0x9a53('0xae')]['find']({'where':_0x214762})[_0x9a53('0x16')](function(_0xc13c9a){if(_0xc13c9a){return[_0xc13c9a,![]];}return db[_0x9a53('0xae')][_0x9a53('0x4f')](_0x44709f)[_0x9a53('0x16')](function(_0x59aa11){return[_0x59aa11,!![]];});});}return db[_0x9a53('0xae')]['create'](_0x44709f)[_0x9a53('0x16')](function(_0x16be41){return[_0x16be41,!![]];});}})[_0x9a53('0xb2')](function(_0x5f1148,_0x28fcc0){if(_0x5f1148){_0x17738e=_0x28fcc0;if(!_0x28fcc0){var _0x1a6173={'from':(_0x1a7302[_0x9a53('0x9c')][_0x9a53('0xa2')]||'')+'\x20'+(_0x1a7302['contact'][_0x9a53('0xb3')]||'')};if(_0x1bec48[_0x9a53('0x50')][_0x9a53('0xad')]&&_0x1bec48[_0x9a53('0x50')]['messageId']&&_0x1bec48[_0x9a53('0x50')][_0x9a53('0xad')]!=_0x1bec48[_0x9a53('0x50')]['messageId']){_0x1a6173['threadId']=_0x1bec48['body'][_0x9a53('0xb4')];}return _0x5f1148['update'](_0x1a6173);}else{return _0x5f1148;}}})[_0x9a53('0x16')](function(_0x277172){_0x1a7302[_0x9a53('0xb1')]=_0x277172[_0x9a53('0x29')]({'plain':!![]});_0x1a7302['interaction'][_0x9a53('0xb5')]=_0x17738e;if(_0x1a7302['interaction'][_0x9a53('0xb5')]){if(_0x1a7302[_0x9a53('0x95')][_0x9a53('0xb6')]){_0x1a7302[_0x9a53('0x96')][_0x9a53('0xb7')]({'id':0x0,'priority':_0x1a7302[_0x9a53('0x96')][_0x9a53('0x4d')]+0x1,'app':'close','appdata':_0x9a53('0xb8'),'interval':_0x9a53('0xb9')});}}return db[_0x9a53('0xba')][_0x9a53('0x4f')]({'body':_0x1bec48[_0x9a53('0x50')][_0x9a53('0x50')],'ChatWebsiteId':_0x1bec48[_0x9a53('0x4a')]['id'],'ChatInteractionId':_0x277172['id'],'direction':'in','ContactId':_0x1a7302[_0x9a53('0x9c')]['id'],'AttachmentId':_0x1bec48[_0x9a53('0x50')]['AttachmentId']});})[_0x9a53('0x16')](function(_0x4904b7){_0x1a7302[_0x9a53('0x1c')]=_0x4904b7;if(_0x1a7302['interaction'][_0x9a53('0xbb')]){return db[_0x9a53('0xbc')][_0x9a53('0x4e')]({'attributes':['id',_0x9a53('0x2c')],'where':{'id':_0x1a7302[_0x9a53('0xb1')][_0x9a53('0xbb')]}})['then'](function(_0x30c5da){if(_0x30c5da){_0x1a7302[_0x9a53('0x96')]['unshift']({'id':0x0,'priority':0x0,'app':_0x9a53('0xbd'),'appdata':_0x30c5da[_0x9a53('0x2c')]+','+(_0x1a7302[_0x9a53('0x95')][_0x9a53('0xbe')]||0xa),'interval':_0x9a53('0xb9')});_0x1a7302[_0x9a53('0xbf')]=!![];}return respondWithRpcPromise(_0x9a53('0xc0'),_0x9a53('0xc1'),_0x1a7302);});}return respondWithRpcPromise(_0x9a53('0xc0'),_0x9a53('0xc1'),_0x1a7302);})['then'](function(_0x1fe2f9){respondWithRpcPromise(_0x9a53('0xc2'),_0x9a53('0xc2'),{'event':_0x9a53('0x81'),'message':_0x1fe2f9},client9002);return _0x1fe2f9;})[_0x9a53('0x16')](respondWithResult(_0x58f832,null))[_0x9a53('0x1e')](handleError(_0x58f832,null));};exports[_0x9a53('0xc3')]=function(_0x15bdc8,_0x7d7498){var _0x4357d7,_0x1fb33,_0x39dade;var _0x5284e1=[];var _0x10ce66={};var _0x9e6485=_0x15bdc8[_0x9a53('0xc4')]||[];var _0x2a3039=[];var _0xf6e343;return db['CmContact'][_0x9a53('0x58')]()['then'](function(_0x60b0b0){if(!_0x60b0b0){throw new db[(_0x9a53('0x86'))]['ValidationError']('no\x20available\x20attributes');}_0x5284e1=_[_0x9a53('0x89')](_[_0x9a53('0x4b')](_0x60b0b0),['createdAt',_0x9a53('0x8b'),'CompanyId',_0x9a53('0x9a')]);if(_0x15bdc8[_0x9a53('0x50')]['id']){delete _0x15bdc8[_0x9a53('0x50')]['id'];}if(_[_0x9a53('0x76')](_0x15bdc8[_0x9a53('0x50')][_0x9a53('0x9b')])){throw _0x7d7498[_0x9a53('0x1f')](0x1f4)[_0x9a53('0x2d')](new db[(_0x9a53('0x86'))][(_0x9a53('0x87'))](_0x9a53('0x8d')));}if(_[_0x9a53('0x76')](_0x15bdc8['body'][_0x9a53('0x50')])||_0x15bdc8['body'][_0x9a53('0x50')]===''){throw _0x7d7498[_0x9a53('0x1f')](0x1f4)['send'](new db[(_0x9a53('0x86'))][(_0x9a53('0x87'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x9a53('0x76')](_0x15bdc8[_0x9a53('0x50')][_0x9a53('0xc5')])){throw _0x7d7498['status'](0x1f4)[_0x9a53('0x2d')](new db[(_0x9a53('0x86'))][(_0x9a53('0x87'))](_0x9a53('0xc6')+_0x5284e1));}if(!_[_0x9a53('0x8f')](_0x5284e1,_0x15bdc8[_0x9a53('0x50')]['mapKeyOffline'])){throw _0x7d7498[_0x9a53('0x1f')](0x1f4)['send'](new db[(_0x9a53('0x86'))]['ValidationError'](_0x9a53('0xc7')+_0x5284e1));}_0x10ce66[_0x15bdc8[_0x9a53('0x50')]['mapKeyOffline']]=_0x15bdc8[_0x9a53('0x50')][_0x9a53('0x9b')];})['then'](function(){return db['ChatWebsite'][_0x9a53('0x4e')]({'where':{'id':_0x15bdc8[_0x9a53('0x4a')]['id']},'include':[{'model':db[_0x9a53('0x91')],'as':'List'},{'model':db['MailAccount'],'as':'MailAccount'}]});})[_0x9a53('0x16')](handleEntityNotFound(_0x7d7498,null))[_0x9a53('0x16')](function(_0x5739e9){if(_0x5739e9&&_0x5739e9[_0x9a53('0x94')]){_0x1fb33=_0x5739e9;var _0x35e471=_['defaults'](_0x15bdc8[_0x9a53('0x50')],{'firstName':_0x15bdc8[_0x9a53('0x50')]['from'],'phone':_0x15bdc8[_0x9a53('0x50')][_0x9a53('0x9b')],'ListId':_0x5739e9[_0x9a53('0x9a')]});_0x35e471[_0x15bdc8['body']['mapKeyOffline']]=_0x15bdc8[_0x9a53('0x50')][_0x9a53('0x9b')];return db[_0x9a53('0x85')][_0x9a53('0xc8')]({'where':_0x10ce66,'defaults':_0x35e471});}})[_0x9a53('0xb2')](function(_0x951004){if(_0x951004){_0x39dade=_0x951004;var _0x2eec47=fs[_0x9a53('0xc9')](path[_0x9a53('0x6f')](config[_0x9a53('0x70')],'server/files/templates/chatOfflineMessage.ejs'),_0x9a53('0xca'));var _0x5be535=ejs[_0x9a53('0xcb')](_0x2eec47,{'body':_[_0x9a53('0xcc')](_0x15bdc8[_0x9a53('0x50')][_0x9a53('0x50')]),'bodyTitle':_0x1fb33[_0x9a53('0xcd')]});return db[_0x9a53('0xce')][_0x9a53('0x4f')]({'body':_0x5be535,'plainBody':htmlToText[_0x9a53('0xcf')](_0x5be535),'ContactId':_0x951004['id'],'ChatWebsiteId':_0x1fb33['id']});}})[_0x9a53('0x16')](function(_0x692650){_0xf6e343=_0x692650;if(_0x9e6485[_0x9a53('0x4d')]){var _0x584c57=_0x9e6485[_0x9a53('0x31')](function(_0x3aff0b){return{'name':_0x3aff0b[_0x9a53('0xd0')],'basename':_0x3aff0b['filename'],'type':_0x3aff0b['mimetype'],'ChatOfflineMessageId':_0x692650['id']};});_0x2a3039=_0x584c57[_0x9a53('0x31')](_0x5c08e1=>{var _0x4c12aa={'filename':_0x5c08e1[_0x9a53('0x2c')],'path':path[_0x9a53('0x6f')](config[_0x9a53('0x70')],_0x9a53('0xd1'),'files','attachments','offline-chat',_0x5c08e1[_0x9a53('0xd2')])};return _0x4c12aa;});if(!_0x1fb33['openNewInteraction']){return db[_0x9a53('0xd3')][_0x9a53('0xd4')](function(_0x22bdad){return db['Attachment'][_0x9a53('0xd5')](_0x584c57,{'transaction':_0x22bdad});});}}})[_0x9a53('0x16')](function(){if(_0xf6e343){_0x4357d7=_0xf6e343;return db['MailAccount'][_0x9a53('0x5c')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x9a53('0xd6'),'raw':!![],'include':[{'model':db[_0x9a53('0xd7')],'as':'CloudProvider','raw':!![]}]}]});}})[_0x9a53('0x16')](function(_0x2c9746){if(_0x2c9746&&_0x2c9746[_0x9a53('0xd6')]&&_0x1fb33[_0x9a53('0xd8')]&&_0x1fb33[_0x9a53('0xd9')]){var _0x4d922f=_0x2c9746[_0x9a53('0xda')]();return respondWithRpcPromise('SendMail','sendMail',{'account':_0x4d922f,'message':{'from':util[_0x9a53('0xa7')]('\x22%s\x22\x20<%s>',_0x2c9746[_0x9a53('0x2c')],_0x2c9746[_0x9a53('0xdb')]||_0x2c9746['Smtp'][_0x9a53('0xdc')]),'to':_0x1fb33[_0x9a53('0xd9')],'subject':_0x1fb33['offlineMessageSubject'],'html':_0x4357d7[_0x9a53('0x50')],'attachments':_0x2a3039}},client9003)[_0x9a53('0x16')](function(){return _0x4357d7;})[_0x9a53('0x1e')](function(_0x257370){logger[_0x9a53('0x1b')](_0x257370);});}})[_0x9a53('0x16')](function(){if(_0x1fb33&&_0x1fb33[_0x9a53('0xdd')]&&_0x1fb33[_0x9a53('0xde')]){var _0x1f9a41=[];if(_0x9e6485[_0x9a53('0x4d')]){_0x1f9a41=_0x9e6485[_0x9a53('0x31')](function(_0x3b9469){return{'name':_0x3b9469[_0x9a53('0xd0')],'basename':_0x3b9469[_0x9a53('0x69')],'type':_0x3b9469['mimetype'],'ChatOfflineMessageId':_0xf6e343['id']};});}var _0x3ce8cb;if(!_[_0x9a53('0x76')](_0x1fb33[_0x9a53('0xdf')])){var _0x36bb17=_[_0x9a53('0x31')](_0x15bdc8[_0x9a53('0x50')],function(_0x25f19f){return _0x25f19f;});var _0x385e2=_['toPairsIn'](_0x36bb17)[0x0];var _0x70e47d=_[_0x9a53('0xe0')](_0x385e2,function(_0x302db7){return _0x302db7;});_0x3ce8cb=_0x70e47d[0x1][_0x1fb33['subjectOffline']];}var _0x8602cd={'from':_0x39dade[_0x9a53('0xdb')],'firstName':_0x39dade['firstName'],'lastName':_0x39dade['lastName'],'mapKey':'email','message':{'from':_0x39dade[_0x9a53('0xdb')],'to':_0x1fb33[_0x9a53('0xe1')][_0x9a53('0xdb')],'cc':'','subject':_[_0x9a53('0x76')](_0x3ce8cb)?_0x1fb33[_0x9a53('0xe2')]:_0x3ce8cb,'messageId':'','sentAt':new Date(),'attach':_0x1f9a41[_0x9a53('0x4d')],'attachments':_0x1f9a41,'originChannel':'Chat','ChatWebsiteId':_0x1fb33['id'],'ChatOfflineMessageId':_0x4357d7['id'],'originTo':_0x1fb33[_0x9a53('0xe1')]['email']},'body':_0x4357d7[_0x9a53('0x50')]};var _0x49af96={'account':{'id':_0x1fb33[_0x9a53('0xde')]},'body':_0x8602cd,'log':'NotifyMailAccount'};return respondWithRpcPromise('NotifyMailAccount',_0x9a53('0xe3'),_0x49af96,client9001)[_0x9a53('0x16')](function(){return _0x4357d7;})['catch'](function(_0x1913b2){logger['error'](_0x1913b2);});}return;})['then'](function(){if(_0x4357d7){return _0x4357d7;}})[_0x9a53('0x16')](respondWithResult(_0x7d7498,null))['catch'](function(_0x5a46f6){logger[_0x9a53('0x1b')](_0x9a53('0x1e'),_0x5a46f6);for(var _0x330cd1 of _0x9e6485){var _0x263ae1=path['join'](config[_0x9a53('0x70')],_0x9a53('0xd1'),_0x9a53('0xc4'),'attachments',_0x9a53('0xe4'),_0x330cd1[_0x9a53('0x69')]);fs_extra[_0x9a53('0xe5')](_0x263ae1)[_0x9a53('0x1e')](function(_0x580141){logger[_0x9a53('0x1b')]('Could\x20not\x20remove\x20attachment\x20file',_0x263ae1,_0x580141);});}});};exports[_0x9a53('0xe6')]=function(_0x106b35,_0x2da7bf){return db['ChatInteraction']['find']({'where':{'id':_0x106b35[_0x9a53('0x4a')]['id']}})['then'](handleEntityNotFound(_0x2da7bf,null))['then'](function(_0x1b1d9d){if(_0x1b1d9d){return _0x1b1d9d[_0x9a53('0xe6')](_0x106b35[_0x9a53('0x50')][_0x9a53('0x60')],_[_0x9a53('0xe7')](_0x106b35[_0x9a53('0x50')],[_0x9a53('0x60'),'id'])||{});}})[_0x9a53('0x16')](respondWithResult(_0x2da7bf,null))[_0x9a53('0x1e')](handleError(_0x2da7bf,null));};exports['getInteractions']=function(_0xa48909,_0x1eec4e){var _0x1f2b52={'raw':![],'where':{}};var _0x59cffb={};var _0x122c7d={'count':0x0,'rows':[]};return db[_0x9a53('0x32')]['findOne']({'where':{'id':_0xa48909[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x1eec4e,null))['then'](function(_0xc6b7b9){if(_0xc6b7b9){_0x59cffb[_0x9a53('0x39')]=_[_0x9a53('0x4b')](db['ChatInteraction']['rawAttributes']);_0x59cffb[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0xa48909[_0x9a53('0x37')]);_0x59cffb[_0x9a53('0x38')]=_[_0x9a53('0x4c')](_0x59cffb[_0x9a53('0x39')],_0x59cffb['query']);_0x1f2b52[_0x9a53('0x3a')]=_[_0x9a53('0x4c')](_0x59cffb[_0x9a53('0x39')],qs['fields'](_0xa48909[_0x9a53('0x37')][_0x9a53('0x3b')]));_0x1f2b52[_0x9a53('0x3a')]=_0x1f2b52[_0x9a53('0x3a')]['length']?_0x1f2b52[_0x9a53('0x3a')]:_0x59cffb[_0x9a53('0x39')];if(!_0xa48909[_0x9a53('0x37')][_0x9a53('0x3c')](_0x9a53('0x3d'))){_0x1f2b52[_0x9a53('0x22')]=qs[_0x9a53('0x22')](_0xa48909[_0x9a53('0x37')][_0x9a53('0x22')]);_0x1f2b52[_0x9a53('0x24')]=qs['offset'](_0xa48909[_0x9a53('0x37')][_0x9a53('0x24')]);}_0x1f2b52[_0x9a53('0x5d')]=qs[_0x9a53('0x3e')](_0xa48909[_0x9a53('0x37')][_0x9a53('0x3e')]);_0x1f2b52[_0x9a53('0x41')]=qs['filters'](_['pick'](_0xa48909[_0x9a53('0x37')],_0x59cffb[_0x9a53('0x38')]));_0x1f2b52[_0x9a53('0x41')][_0x9a53('0x5a')]=_0xc6b7b9['id'];if(_0xa48909['query'][_0x9a53('0x40')]){_0x1f2b52[_0x9a53('0x41')]=_['merge'](_0x1f2b52[_0x9a53('0x41')],{'$or':_['map'](_0x1f2b52[_0x9a53('0x3a')],function(_0x3f8b42){var _0x547f93={};_0x547f93[_0x3f8b42]={'$like':'%'+_0xa48909['query'][_0x9a53('0x40')]+'%'};return _0x547f93;})});}_0x1f2b52=_['merge']({},_0x1f2b52,_0xa48909[_0x9a53('0x44')]);return db['ChatInteraction'][_0x9a53('0x23')]({'where':_0x1f2b52[_0x9a53('0x41')]})[_0x9a53('0x16')](function(_0x28b60e){_0x122c7d[_0x9a53('0x23')]=_0x28b60e;if(_0xa48909[_0x9a53('0x37')][_0x9a53('0x45')]){_0x1f2b52[_0x9a53('0x46')]=[{'model':db[_0x9a53('0x85')],'as':_0x9a53('0xe8'),'required':![]},{'model':db['User'],'as':'Owner','attributes':['name',_0x9a53('0xe9'),_0x9a53('0xea')],'required':![]},{'model':db[_0x9a53('0xeb')],'as':_0x9a53('0xec'),'attributes':['id',_0x9a53('0x2c'),_0x9a53('0xed')],'where':_0xa48909[_0x9a53('0x37')][_0x9a53('0xee')]?{'id':_0xa48909['query'][_0x9a53('0xee')]}:undefined,'required':_0xa48909[_0x9a53('0x37')][_0x9a53('0xee')]?!![]:![]}];}return db['ChatInteraction']['findAll'](_0x1f2b52);})['then'](function(_0x2af14b){_0x122c7d[_0x9a53('0x48')]=_0x2af14b;return _0x122c7d;});}})[_0x9a53('0x16')](respondWithFilteredResult(_0x1eec4e,_0x1f2b52))[_0x9a53('0x1e')](handleError(_0x1eec4e,null));};function iftimePromise(_0x36cd4f,_0x17336d){return respondWithRpcPromise(_0x9a53('0xef'),_0x9a53('0xf0'),{'command':_0x17336d[_0x9a53('0xf1')]?util[_0x9a53('0xa7')](_0x9a53('0xf2'),_0x36cd4f[_0x9a53('0xf3')],_0x17336d[_0x9a53('0xf1')]):util[_0x9a53('0xa7')](_0x9a53('0xf4'),_0x36cd4f['interval'])},client9002)['then'](function(_0x45cc70){var _0x2ac284=_0x45cc70&&_0x45cc70[_0x9a53('0xf5')]('true')>=0x0?!![]:![];logger[_0x9a53('0xf6')](_0x9a53('0xf7'),_0x17336d['id'],_0x36cd4f['id'],_0x36cd4f['interval'],_0x2ac284?_0x9a53('0xf8'):'OFFLINE',_0x17336d[_0x9a53('0xf1')]?_0x17336d[_0x9a53('0xf1')]:_0x9a53('0xf9'));return _0x2ac284;})[_0x9a53('0x1e')](function(_0xb3ca85){logger[_0x9a53('0x1b')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x17336d['id'],_0x36cd4f['id'],_0x36cd4f['interval'],util[_0x9a53('0xfa')](_0xb3ca85,{'showHidden':![],'depth':null}),_0x17336d[_0x9a53('0xf1')]?_0x17336d[_0x9a53('0xf1')]:_0x9a53('0xf9'));return![];});}exports['getSnippet']=function(_0x2f26b9,_0x2e362c){var _0x5a3ff6=0x0;var _0x4f18cb=0x0;var _0xbdc602=![];var _0xdb7ce6;var _0x4f7f20;return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x2f26b9[_0x9a53('0x4a')]['id']},'include':[{'model':db['Interval'],'as':_0x9a53('0xfb'),'include':[{'model':db[_0x9a53('0xfb')],'as':'Intervals','attributes':['id','interval'],'raw':!![]}]}]})[_0x9a53('0x16')](handleEntityNotFound(_0x2e362c,null))['then'](function(_0x3d52ad){if(_0x3d52ad){_0xdb7ce6=_0x3d52ad;return _0x3d52ad[_0x9a53('0xfc')]({'raw':!![]});}})[_0x9a53('0x16')](function(_0x43dfe2){if(_0xdb7ce6){if(_0x43dfe2){_0x4f7f20=_0x43dfe2;}}return require(_0x9a53('0x73'))[_0x9a53('0x74')]();})[_0x9a53('0x16')](function(_0x6c9c6a){if(_0x6c9c6a){_0x4f18cb=_0x6c9c6a['virtual'];_0xbdc602=_0x6c9c6a['custom'];}})[_0x9a53('0x16')](function(){return db[_0x9a53('0xae')][_0x9a53('0x23')]({'where':{'closed':![]}});})['then'](function(_0x3c2eaa){_0x5a3ff6=_0x3c2eaa;if(_0x4f18cb&&_0x3c2eaa>_0x4f18cb){return db[_0x9a53('0xfd')][_0x9a53('0x5c')]({'where':{'id':0x1}})[_0x9a53('0x16')](function(_0x495216){if(_0x495216){_0x495216[_0x9a53('0xfe')]('chatLicenseExceeded');}});}})[_0x9a53('0x16')](function(){if(_0xdb7ce6[_0x9a53('0xfb')]&&_0xdb7ce6[_0x9a53('0xfb')][_0x9a53('0xff')]){var _0x6c866=[];for(var _0x3d3913=0x0;_0x3d3913<_0xdb7ce6[_0x9a53('0xfb')][_0x9a53('0xff')][_0x9a53('0x4d')];_0x3d3913++){var _0x37f926=_0xdb7ce6[_0x9a53('0xfb')][_0x9a53('0xff')][_0x3d3913]['get']({'plain':!![]});_0x6c866[_0x9a53('0xb7')](iftimePromise(_0x37f926,_0xdb7ce6));}return BPromise[_0x9a53('0x100')](_0x6c866)[_0x9a53('0x16')](function(_0x31f3d9){return _[_0x9a53('0x101')](_0x31f3d9);});}else{return!![];}})[_0x9a53('0x16')](function(_0x2bfe38){var _0x2c4747=fs[_0x9a53('0xc9')](path[_0x9a53('0x6f')](config['root'],'server/files/chat/iframe.ejs'),'utf8');var _0x2c3e4f={'remote':_0xdb7ce6[_0x9a53('0x102')],'query':querystring[_0x9a53('0x103')](_['merge'](_0xdb7ce6['get']({'plain':!![]}),{'customerIp':_0x2f26b9[_0x9a53('0x9e')]['x-forwarded-for']||_0x2f26b9[_0x9a53('0x9e')]['x-real-ip']||_0x2f26b9[_0x9a53('0x104')][_0x9a53('0x105')]||_0x2f26b9['ip'],'referer':_0x2f26b9[_0x9a53('0x9e')][_0x9a53('0xa4')],'openedInteractions':_0x5a3ff6,'maxInteractions':_0x4f18cb,'virtual':_0xbdc602['virtual'],'online':_0x2bfe38,'custom':_0xbdc602}))['replace'](/'/g,'\x5c\x27')};_0x2e362c['send'](ejs[_0x9a53('0xcb')](Mustache[_0x9a53('0xcb')](_0x2c4747,_0x2c3e4f),{'proactiveActions':_0x4f7f20,'alignment':_0xdb7ce6[_0x9a53('0x106')],'verticalAlignment':_0xdb7ce6[_0x9a53('0x107')],'div_color':_0xdb7ce6[_0x9a53('0xed')],'labelText':_0xdb7ce6[_0x9a53('0x108')],'text_color':_0xdb7ce6[_0x9a53('0x109')],'text_button_color':_0xdb7ce6['textButtonColor'],'button_color':_0xdb7ce6['color_button'],'background_color':_0xdb7ce6[_0x9a53('0x10a')],'hideWhenOffline':_0xdb7ce6[_0x9a53('0x10b')],'interval':_0xdb7ce6[_0x9a53('0x10c')]}));})[_0x9a53('0x1e')](handleError(_0x2e362c,null));};exports[_0x9a53('0x10d')]=function(_0x27bd73,_0x339e83){var _0x2fa37e=_0x27bd73[_0x9a53('0x4a')]['id'];var _0x3c2458=_0x27bd73[_0x9a53('0x50')];var _0x2093c1=0xc8;var _0x509c87=null;return db[_0x9a53('0xd3')][_0x9a53('0xd4')]({'isolationLevel':db[_0x9a53('0xd3')]['Transaction'][_0x9a53('0x10e')][_0x9a53('0x10f')]},function(_0x488def){return db[_0x9a53('0x32')][_0x9a53('0x5c')]({'where':{'id':_0x2fa37e},'transaction':_0x488def})[_0x9a53('0x16')](function(_0x4d2690){if(_0x4d2690){return db[_0x9a53('0x93')][_0x9a53('0x28')]({'where':{'ChatWebsiteId':_0x2fa37e},'transaction':_0x488def})[_0x9a53('0x16')](function(){var _0x11237d=_[_0x9a53('0x31')](_0x3c2458,function(_0x238b9d){_0x238b9d['ChatWebsiteId']=_0x2fa37e;return _0x238b9d;});return db[_0x9a53('0x93')][_0x9a53('0xd5')](_0x11237d,{'transaction':_0x488def});});}else{_0x2093c1=0x194;_0x509c87=[];}});})['then'](function(){if(_0x2093c1!==0x194){return db[_0x9a53('0x93')][_0x9a53('0x110')]({'where':{'ChatWebsiteId':_0x2fa37e},'order':_0x9a53('0x99')})['then'](function(_0xf045d6){_0x509c87=_0xf045d6;});}})[_0x9a53('0x1e')](function(_0x4af3d6){_0x2093c1=0x1f4;logger[_0x9a53('0x1b')](_0x4af3d6[_0x9a53('0x111')]);if(_0x4af3d6[_0x9a53('0x2c')]){delete _0x4af3d6[_0x9a53('0x2c')];}_0x509c87=_0x4af3d6;})[_0x9a53('0x112')](function(){if(_0x509c87===null){_0x339e83[_0x9a53('0x2b')](_0x2093c1);}else{if(_0x2093c1===0x1f4){_0x339e83[_0x9a53('0x1f')](_0x2093c1)[_0x9a53('0x2d')](_0x509c87);}else{_0x339e83[_0x9a53('0x1f')](_0x2093c1)[_0x9a53('0x21')](_0x509c87);}}});};exports[_0x9a53('0x113')]=function(_0x49903f,_0x1e610a){var _0x598c8c={};var _0x2f5de0={};var _0x3f6c6d;var _0x233d31;return db[_0x9a53('0x32')][_0x9a53('0x5c')]({'where':{'id':_0x49903f[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x1e610a,null))['then'](function(_0x95f618){if(_0x95f618){_0x3f6c6d=_0x95f618;_0x2f5de0[_0x9a53('0x39')]=_[_0x9a53('0x4b')](db[_0x9a53('0x93')][_0x9a53('0x33')]);_0x2f5de0[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0x49903f[_0x9a53('0x37')]);_0x2f5de0[_0x9a53('0x38')]=_['intersection'](_0x2f5de0[_0x9a53('0x39')],_0x2f5de0[_0x9a53('0x37')]);_0x598c8c['attributes']=_['intersection'](_0x2f5de0[_0x9a53('0x39')],qs[_0x9a53('0x3b')](_0x49903f[_0x9a53('0x37')][_0x9a53('0x3b')]));_0x598c8c['attributes']=_0x598c8c['attributes'][_0x9a53('0x4d')]?_0x598c8c[_0x9a53('0x3a')]:_0x2f5de0[_0x9a53('0x39')];_0x598c8c['order']=qs[_0x9a53('0x3e')](_0x49903f[_0x9a53('0x37')]['sort']);_0x598c8c[_0x9a53('0x41')]=qs[_0x9a53('0x38')](_[_0x9a53('0x3f')](_0x49903f['query'],_0x2f5de0[_0x9a53('0x38')]));if(_0x49903f[_0x9a53('0x37')]['filter']){_0x598c8c[_0x9a53('0x41')]=_['merge'](_0x598c8c['where'],{'$or':_[_0x9a53('0x31')](_0x598c8c[_0x9a53('0x3a')],function(_0x321a88){var _0x193f5e={};_0x193f5e[_0x321a88]={'$like':'%'+_0x49903f[_0x9a53('0x37')][_0x9a53('0x40')]+'%'};return _0x193f5e;})});}_0x598c8c=_[_0x9a53('0x42')]({},_0x598c8c,_0x49903f[_0x9a53('0x44')]);return _0x3f6c6d[_0x9a53('0x113')](_0x598c8c);}})[_0x9a53('0x16')](function(_0x40af54){if(_0x40af54){_0x233d31=_0x40af54['length'];if(!_0x49903f['query']['hasOwnProperty'](_0x9a53('0x3d'))){_0x598c8c[_0x9a53('0x22')]=qs[_0x9a53('0x22')](_0x49903f[_0x9a53('0x37')][_0x9a53('0x22')]);_0x598c8c[_0x9a53('0x24')]=qs[_0x9a53('0x24')](_0x49903f[_0x9a53('0x37')]['offset']);}return _0x3f6c6d[_0x9a53('0x113')](_0x598c8c);}})[_0x9a53('0x16')](function(_0x5b4900){if(_0x5b4900){return _0x5b4900?{'count':_0x233d31,'rows':_0x5b4900}:null;}})[_0x9a53('0x16')](respondWithResult(_0x1e610a,null))[_0x9a53('0x1e')](handleError(_0x1e610a,null));};exports[_0x9a53('0x114')]=function(_0x43615a,_0x4b2505){return db[_0x9a53('0x115')][_0x9a53('0x4e')]({'where':{'id':_0x43615a[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x4b2505,null))[_0x9a53('0x16')](function(_0x3a3dc6){if(_0x3a3dc6){return _0x3a3dc6[_0x9a53('0x114')](_0x43615a[_0x9a53('0x50')][_0x9a53('0x60')],_[_0x9a53('0xe7')](_0x43615a[_0x9a53('0x50')],[_0x9a53('0x60'),'id'])||{});}})['then'](respondWithResult(_0x4b2505,null))[_0x9a53('0x1e')](handleError(_0x4b2505,null));};exports['getProactiveActions']=function(_0x352af1,_0x43f010){var _0x4a93a3={};var _0x584eb5={};var _0x3e494c;var _0xf25850;return db[_0x9a53('0x32')][_0x9a53('0x5c')]({'where':{'id':_0x352af1[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x43f010,null))['then'](function(_0x134c53){if(_0x134c53){_0x3e494c=_0x134c53;_0x584eb5[_0x9a53('0x39')]=_['keys'](db[_0x9a53('0x116')][_0x9a53('0x33')]);_0x584eb5['query']=_[_0x9a53('0x4b')](_0x352af1[_0x9a53('0x37')]);_0x584eb5['filters']=_[_0x9a53('0x4c')](_0x584eb5['model'],_0x584eb5['query']);_0x4a93a3[_0x9a53('0x3a')]=_['intersection'](_0x584eb5['model'],qs[_0x9a53('0x3b')](_0x352af1['query'][_0x9a53('0x3b')]));_0x4a93a3[_0x9a53('0x3a')]=_0x4a93a3[_0x9a53('0x3a')][_0x9a53('0x4d')]?_0x4a93a3['attributes']:_0x584eb5[_0x9a53('0x39')];_0x4a93a3[_0x9a53('0x5d')]=qs[_0x9a53('0x3e')](_0x352af1[_0x9a53('0x37')][_0x9a53('0x3e')]);_0x4a93a3[_0x9a53('0x41')]=qs['filters'](_[_0x9a53('0x3f')](_0x352af1[_0x9a53('0x37')],_0x584eb5[_0x9a53('0x38')]));if(_0x352af1['query']['filter']){_0x4a93a3[_0x9a53('0x41')]=_[_0x9a53('0x42')](_0x4a93a3[_0x9a53('0x41')],{'$or':_[_0x9a53('0x31')](_0x4a93a3['attributes'],function(_0x4e98aa){var _0x5220a5={};_0x5220a5[_0x4e98aa]={'$like':'%'+_0x352af1[_0x9a53('0x37')][_0x9a53('0x40')]+'%'};return _0x5220a5;})});}_0x4a93a3=_[_0x9a53('0x42')]({},_0x4a93a3,_0x352af1['options']);return _0x3e494c[_0x9a53('0xfc')](_0x4a93a3);}})[_0x9a53('0x16')](function(_0x194514){if(_0x194514){_0xf25850=_0x194514[_0x9a53('0x4d')];if(!_0x352af1[_0x9a53('0x37')]['hasOwnProperty'](_0x9a53('0x3d'))){_0x4a93a3['limit']=qs[_0x9a53('0x22')](_0x352af1['query']['limit']);_0x4a93a3[_0x9a53('0x24')]=qs[_0x9a53('0x24')](_0x352af1[_0x9a53('0x37')][_0x9a53('0x24')]);}return _0x3e494c[_0x9a53('0xfc')](_0x4a93a3);}})['then'](function(_0x1975fe){if(_0x1975fe){return _0x1975fe?{'count':_0xf25850,'rows':_0x1975fe}:null;}})[_0x9a53('0x16')](respondWithResult(_0x43f010,null))['catch'](handleError(_0x43f010,null));};exports[_0x9a53('0x117')]=function(_0x50c521,_0x280000){var _0x1c7dbe=_0x50c521['query'][_0x9a53('0x118')]===_0x9a53('0x119')?_0x9a53('0x11a'):_0x9a53('0x11b');return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'attributes':['id',_0x1c7dbe],'where':{'id':_0x50c521[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x280000,null))['then'](function(_0x306166){if(_0x306166){var _0x3f1a43=_0x306166[_0x1c7dbe];var _0x27df75=_0x3f1a43&&_0x3f1a43[_0x9a53('0x11c')]?_0x3f1a43[_0x9a53('0x11c')]:[];_0x280000[_0x9a53('0x2d')]({'fromKey':_[_0x9a53('0x76')](_0x3f1a43[_0x9a53('0x11d')])?undefined:_0x3f1a43[_0x9a53('0x11d')],'count':_0x27df75[_0x9a53('0x4d')],'rows':_0x27df75});}})['catch'](handleError(_0x280000,null));};exports[_0x9a53('0x11e')]=function(_0x24e469,_0x5c438b){var _0x55a9e3={'raw':![],'where':{}};var _0x456aba={};var _0x5e738a={'count':0x0,'rows':[]};return db[_0x9a53('0x32')]['findOne']({'where':{'id':_0x24e469['params']['id']}})['then'](handleEntityNotFound(_0x5c438b,null))[_0x9a53('0x16')](function(_0x32195a){if(_0x32195a){_0x456aba['model']=_[_0x9a53('0x4b')](db[_0x9a53('0xce')][_0x9a53('0x33')]);_0x456aba[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0x24e469[_0x9a53('0x37')]);_0x456aba[_0x9a53('0x38')]=_[_0x9a53('0x4c')](_0x456aba[_0x9a53('0x39')],_0x456aba['query']);_0x55a9e3[_0x9a53('0x3a')]=_['intersection'](_0x456aba[_0x9a53('0x39')],qs[_0x9a53('0x3b')](_0x24e469[_0x9a53('0x37')][_0x9a53('0x3b')]));_0x55a9e3[_0x9a53('0x3a')]=_0x55a9e3[_0x9a53('0x3a')][_0x9a53('0x4d')]?_0x55a9e3[_0x9a53('0x3a')]:_0x456aba[_0x9a53('0x39')];if(!_0x24e469['query'][_0x9a53('0x3c')]('nolimit')){_0x55a9e3[_0x9a53('0x22')]=qs[_0x9a53('0x22')](_0x24e469[_0x9a53('0x37')][_0x9a53('0x22')]);_0x55a9e3[_0x9a53('0x24')]=qs['offset'](_0x24e469[_0x9a53('0x37')][_0x9a53('0x24')]);}_0x55a9e3[_0x9a53('0x5d')]=qs[_0x9a53('0x3e')](_0x24e469[_0x9a53('0x37')][_0x9a53('0x3e')]);_0x55a9e3[_0x9a53('0x41')]=qs[_0x9a53('0x38')](_['pick'](_0x24e469[_0x9a53('0x37')],_0x456aba[_0x9a53('0x38')]));_0x55a9e3[_0x9a53('0x41')][_0x9a53('0x5a')]=_0x32195a['id'];if(_0x24e469[_0x9a53('0x37')]['filter']){_0x55a9e3[_0x9a53('0x41')]=_[_0x9a53('0x42')](_0x55a9e3[_0x9a53('0x41')],{'$or':_[_0x9a53('0x31')](_0x55a9e3[_0x9a53('0x3a')],function(_0x280d00){var _0x579946={};_0x579946[_0x280d00]={'$like':'%'+_0x24e469[_0x9a53('0x37')][_0x9a53('0x40')]+'%'};return _0x579946;})});}_0x55a9e3=_[_0x9a53('0x42')]({},_0x55a9e3,_0x24e469[_0x9a53('0x44')]);return db['ChatOfflineMessage'][_0x9a53('0x23')]({'where':_0x55a9e3['where']})[_0x9a53('0x16')](function(_0x4ac857){_0x5e738a['count']=_0x4ac857;if(_0x24e469['query']['includeAll']){_0x55a9e3['include']=[{'all':!![]}];}else{_0x55a9e3[_0x9a53('0x46')]=[{'model':db[_0x9a53('0x85')],'as':'Contact','required':![]},{'model':db[_0x9a53('0x11f')],'as':_0x9a53('0x120'),'required':![]}];}return db[_0x9a53('0xce')][_0x9a53('0x47')](_0x55a9e3);})[_0x9a53('0x16')](function(_0x58a106){_0x5e738a['rows']=_0x58a106;return _0x5e738a;});}})[_0x9a53('0x16')](respondWithFilteredResult(_0x5c438b,_0x55a9e3))[_0x9a53('0x1e')](handleError(_0x5c438b,null));};exports['addAgents']=function(_0x3bc2d1,_0xdccdb3){return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x3bc2d1[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0xdccdb3,null))[_0x9a53('0x16')](function(_0x214f6c){if(_0x214f6c){return _0x214f6c[_0x9a53('0x121')](_0x3bc2d1[_0x9a53('0x50')][_0x9a53('0x60')],_[_0x9a53('0xe7')](_0x3bc2d1['body'],[_0x9a53('0x60'),'id'])||{})['spread'](function(_0x9519e5){for(var _0x53293a=0x0;_0x53293a<_0x3bc2d1[_0x9a53('0x50')][_0x9a53('0x60')]['length'];_0x53293a+=0x1){socket[_0x9a53('0x122')](_0x9a53('0x123'),{'UserId':Number(_0x3bc2d1[_0x9a53('0x50')][_0x9a53('0x60')][_0x53293a]),'ChatWebsiteId':Number(_0x3bc2d1[_0x9a53('0x4a')]['id'])});}return _0x9519e5;});}})[_0x9a53('0x16')](respondWithResult(_0xdccdb3,null))[_0x9a53('0x1e')](handleError(_0xdccdb3,null));};exports[_0x9a53('0x124')]=function(_0x1dfc7c,_0x3a6b28){return db[_0x9a53('0x32')][_0x9a53('0x4e')]({'where':{'id':_0x1dfc7c[_0x9a53('0x4a')]['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x3a6b28,null))[_0x9a53('0x16')](function(_0x121275){if(_0x121275){return _0x121275[_0x9a53('0x124')](_0x1dfc7c[_0x9a53('0x37')]['ids'])['then'](function(){if(_['isArray'](_0x1dfc7c[_0x9a53('0x37')][_0x9a53('0x60')])){for(var _0x11eaf5=0x0;_0x11eaf5<_0x1dfc7c[_0x9a53('0x37')][_0x9a53('0x60')][_0x9a53('0x4d')];_0x11eaf5+=0x1){socket[_0x9a53('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x1dfc7c[_0x9a53('0x37')][_0x9a53('0x60')][_0x11eaf5]),'ChatWebsiteId':Number(_0x1dfc7c[_0x9a53('0x4a')]['id'])});}}else{socket[_0x9a53('0x122')]('userChatWebsite:remove',{'UserId':Number(_0x1dfc7c[_0x9a53('0x37')][_0x9a53('0x60')]),'ChatWebsiteId':Number(_0x1dfc7c[_0x9a53('0x4a')]['id'])});}});}})[_0x9a53('0x16')](respondWithStatusCode(_0x3a6b28,null))[_0x9a53('0x1e')](handleError(_0x3a6b28,null));};exports[_0x9a53('0x125')]=function(_0x579b00,_0x45da9e){var _0x32034e={};var _0x3e241a={};var _0xeaa98e;var _0x5b97ab;return db[_0x9a53('0x32')][_0x9a53('0x5c')]({'where':{'id':_0x579b00['params']['id']}})[_0x9a53('0x16')](handleEntityNotFound(_0x45da9e,null))[_0x9a53('0x16')](function(_0x462ed9){if(_0x462ed9){_0xeaa98e=_0x462ed9;_0x3e241a['model']=_[_0x9a53('0x4b')](db[_0x9a53('0xbc')][_0x9a53('0x33')]);_0x3e241a[_0x9a53('0x37')]=_[_0x9a53('0x4b')](_0x579b00[_0x9a53('0x37')]);_0x3e241a[_0x9a53('0x38')]=_[_0x9a53('0x4c')](_0x3e241a[_0x9a53('0x39')],_0x3e241a[_0x9a53('0x37')]);_0x32034e[_0x9a53('0x3a')]=_['intersection'](_0x3e241a[_0x9a53('0x39')],qs[_0x9a53('0x3b')](_0x579b00['query'][_0x9a53('0x3b')]));_0x32034e[_0x9a53('0x3a')]=_0x32034e[_0x9a53('0x3a')][_0x9a53('0x4d')]?_0x32034e[_0x9a53('0x3a')]:_0x3e241a[_0x9a53('0x39')];_0x32034e[_0x9a53('0x5d')]=qs[_0x9a53('0x3e')](_0x579b00[_0x9a53('0x37')]['sort']);_0x32034e[_0x9a53('0x41')]=qs[_0x9a53('0x38')](_[_0x9a53('0x3f')](_0x579b00[_0x9a53('0x37')],_0x3e241a['filters']));if(_0x579b00[_0x9a53('0x37')][_0x9a53('0x40')]){_0x32034e[_0x9a53('0x41')]=_[_0x9a53('0x42')](_0x32034e[_0x9a53('0x41')],{'$or':_['map'](_0x32034e[_0x9a53('0x3a')],function(_0x1bada0){var _0x522325={};_0x522325[_0x1bada0]={'$like':'%'+_0x579b00[_0x9a53('0x37')][_0x9a53('0x40')]+'%'};return _0x522325;})});}_0x32034e=_[_0x9a53('0x42')]({},_0x32034e,_0x579b00['options']);return _0xeaa98e[_0x9a53('0x125')](_0x32034e);}})[_0x9a53('0x16')](function(_0x3cd147){if(_0x3cd147){_0x5b97ab=_0x3cd147[_0x9a53('0x4d')];if(!_0x579b00[_0x9a53('0x37')][_0x9a53('0x3c')](_0x9a53('0x3d'))){_0x32034e['limit']=qs[_0x9a53('0x22')](_0x579b00[_0x9a53('0x37')]['limit']);_0x32034e['offset']=qs['offset'](_0x579b00[_0x9a53('0x37')]['offset']);}return _0xeaa98e[_0x9a53('0x125')](_0x32034e);}})[_0x9a53('0x16')](function(_0x4acba4){if(_0x4acba4){return _0x4acba4?{'count':_0x5b97ab,'rows':_0x4acba4}:null;}})[_0x9a53('0x16')](respondWithResult(_0x45da9e,null))['catch'](handleError(_0x45da9e,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index 8cf5151..0ba2aea 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 _0x979e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners','update'];(function(_0x7c75bf,_0x42bdfb){var _0x1d7299=function(_0x20e75d){while(--_0x20e75d){_0x7c75bf['push'](_0x7c75bf['shift']());}};_0x1d7299(++_0x42bdfb);}(_0x979e,0x195));var _0xe979=function(_0x5123cd,_0x38c053){_0x5123cd=_0x5123cd-0x0;var _0x3b690c=_0x979e[_0x5123cd];return _0x3b690c;};'use strict';var EventEmitter=require(_0xe979('0x0'));var ChatWebsite=require(_0xe979('0x1'))['db'][_0xe979('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xe979('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe979('0x4'),'afterDestroy':_0xe979('0x5')};function emitEvent(_0x386036){return function(_0x3b4b06,_0x2d62dd,_0x5afb7f){ChatWebsiteEvents[_0xe979('0x6')](_0x386036+':'+_0x3b4b06['id'],_0x3b4b06);ChatWebsiteEvents['emit'](_0x386036,_0x3b4b06);_0x5afb7f(null);};}for(var e in events){if(events[_0xe979('0x7')](e)){var event=events[e];ChatWebsite[_0xe979('0x8')](e,emitEvent(event));}}module[_0xe979('0x9')]=ChatWebsiteEvents;
\ No newline at end of file
+var _0xac21=['ChatWebsite','save','remove','emit','hasOwnProperty','hook','exports','../../mysqldb'];(function(_0x22c169,_0x3298a6){var _0x30cc6f=function(_0x2cd339){while(--_0x2cd339){_0x22c169['push'](_0x22c169['shift']());}};_0x30cc6f(++_0x3298a6);}(_0xac21,0x1af));var _0x1ac2=function(_0x341462,_0x330bb1){_0x341462=_0x341462-0x0;var _0x3332ab=_0xac21[_0x341462];return _0x3332ab;};'use strict';var EventEmitter=require('events');var ChatWebsite=require(_0x1ac2('0x0'))['db'][_0x1ac2('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1ac2('0x2'),'afterUpdate':'update','afterDestroy':_0x1ac2('0x3')};function emitEvent(_0x15bc3f){return function(_0x5b81be,_0x454461,_0x4efe94){ChatWebsiteEvents[_0x1ac2('0x4')](_0x15bc3f+':'+_0x5b81be['id'],_0x5b81be);ChatWebsiteEvents[_0x1ac2('0x4')](_0x15bc3f,_0x5b81be);_0x4efe94(null);};}for(var e in events){if(events[_0x1ac2('0x5')](e)){var event=events[e];ChatWebsite[_0x1ac2('0x6')](e,emitEvent(event));}}module[_0x1ac2('0x7')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index ed3f1ef..9760d8d 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 _0x5719=['exports','chat_websites','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./chatWebsite.attributes'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x5719,0x178));var _0x9571=function(_0x3f1699,_0x40690c){_0x3f1699=_0x3f1699-0x0;var _0x5d8fb7=_0x5719[_0x3f1699];return _0x5d8fb7;};'use strict';var _=require(_0x9571('0x0'));var util=require(_0x9571('0x1'));var logger=require(_0x9571('0x2'))('api');var moment=require(_0x9571('0x3'));var BPromise=require(_0x9571('0x4'));var rp=require(_0x9571('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9571('0x6'));var config=require(_0x9571('0x7'));var attributes=require(_0x9571('0x8'));module[_0x9571('0x9')]=function(_0x109aa7,_0x5a5545){return _0x109aa7['define']('ChatWebsite',attributes,{'tableName':_0x9571('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x61ac=['../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x2e3df6,_0x19b323){var _0x12526d=function(_0x2d27df){while(--_0x2d27df){_0x2e3df6['push'](_0x2e3df6['shift']());}};_0x12526d(++_0x19b323);}(_0x61ac,0x131));var _0xc61a=function(_0x389832,_0x10a4a9){_0x389832=_0x389832-0x0;var _0x59429e=_0x61ac[_0x389832];return _0x59429e;};'use strict';var _=require(_0xc61a('0x0'));var util=require(_0xc61a('0x1'));var logger=require(_0xc61a('0x2'))('api');var moment=require(_0xc61a('0x3'));var BPromise=require(_0xc61a('0x4'));var rp=require(_0xc61a('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc61a('0x6'));var config=require(_0xc61a('0x7'));var attributes=require(_0xc61a('0x8'));module[_0xc61a('0x9')]=function(_0x1847ba,_0x54b600){return _0x1847ba[_0xc61a('0xa')](_0xc61a('0xb'),attributes,{'tableName':_0xc61a('0xc'),'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 9aaddbf..f3f2367 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 _0xe07b=['http','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client'];(function(_0x38209b,_0x77370){var _0x4da974=function(_0x258161){while(--_0x258161){_0x38209b['push'](_0x38209b['shift']());}};_0x4da974(++_0x77370);}(_0xe07b,0x146));var _0xbe07=function(_0x5aabac,_0x20d569){_0x5aabac=_0x5aabac-0x0;var _0x3f0401=_0xe07b[_0x5aabac];return _0x3f0401;};'use strict';var _=require(_0xbe07('0x0'));var util=require(_0xbe07('0x1'));var moment=require(_0xbe07('0x2'));var BPromise=require(_0xbe07('0x3'));var rs=require(_0xbe07('0x4'));var fs=require('fs');var Redis=require(_0xbe07('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbe07('0x6'));var logger=require(_0xbe07('0x7'))('rpc');var config=require(_0xbe07('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe07('0x9')][_0xbe07('0xa')]({'port':0x232a});config['redis']=_[_0xbe07('0xb')](config[_0xbe07('0xc')],{'host':_0xbe07('0xd'),'port':0x18eb});var socket=require(_0xbe07('0xe'))(new Redis(config[_0xbe07('0xc')]));require(_0xbe07('0xf'))[_0xbe07('0x10')](socket);function respondWithRpcPromise(_0x335a00,_0x5acdb0,_0x449b6f){return new BPromise(function(_0x3661b7,_0x3d85b3){return client[_0xbe07('0x11')](_0x335a00,_0x449b6f)[_0xbe07('0x12')](function(_0x5e28a3){logger[_0xbe07('0x13')](_0xbe07('0x14'),_0x5acdb0,_0xbe07('0x15'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5acdb0,_0xbe07('0x15'),JSON[_0xbe07('0x16')](_0x5e28a3));if(_0x5e28a3['error']){if(_0x5e28a3[_0xbe07('0x17')][_0xbe07('0x18')]===0x1f4){logger[_0xbe07('0x17')]('ChatWebsite,\x20%s,\x20%s',_0x5acdb0,_0x5e28a3[_0xbe07('0x17')][_0xbe07('0x19')]);return _0x3d85b3(_0x5e28a3[_0xbe07('0x17')][_0xbe07('0x19')]);}logger[_0xbe07('0x17')](_0xbe07('0x14'),_0x5acdb0,_0x5e28a3[_0xbe07('0x17')][_0xbe07('0x19')]);return _0x3661b7(_0x5e28a3['error']['message']);}else{logger[_0xbe07('0x13')](_0xbe07('0x14'),_0x5acdb0,_0xbe07('0x15'));_0x3661b7(_0x5e28a3[_0xbe07('0x1a')][_0xbe07('0x19')]);}})[_0xbe07('0x1b')](function(_0x45f3b2){logger[_0xbe07('0x17')](_0xbe07('0x14'),_0x5acdb0,_0x45f3b2);_0x3d85b3(_0x45f3b2);});});}
\ No newline at end of file
+var _0xfaee=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','then','request\x20sent','stringify','error','code','ChatWebsite,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xfaee,0x17e));var _0xefae=function(_0x88ffd4,_0x25f7e6){_0x88ffd4=_0x88ffd4-0x0;var _0x528f9c=_0xfaee[_0x88ffd4];return _0x528f9c;};'use strict';var _=require(_0xefae('0x0'));var util=require(_0xefae('0x1'));var moment=require(_0xefae('0x2'));var BPromise=require(_0xefae('0x3'));var rs=require(_0xefae('0x4'));var fs=require('fs');var Redis=require(_0xefae('0x5'));var db=require(_0xefae('0x6'))['db'];var utils=require(_0xefae('0x7'));var logger=require(_0xefae('0x8'))(_0xefae('0x9'));var config=require('../../config/environment');var jayson=require(_0xefae('0xa'));var client=jayson[_0xefae('0xb')][_0xefae('0xc')]({'port':0x232a});config['redis']=_[_0xefae('0xd')](config['redis'],{'host':_0xefae('0xe'),'port':0x18eb});var socket=require(_0xefae('0xf'))(new Redis(config[_0xefae('0x10')]));require('./chatWebsite.socket')['register'](socket);function respondWithRpcPromise(_0x5f34bf,_0x1165c9,_0x27dd2b){return new BPromise(function(_0x32fb25,_0x21a718){return client['request'](_0x5f34bf,_0x27dd2b)[_0xefae('0x11')](function(_0x3ade28){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x1165c9,_0xefae('0x12'));logger['debug']('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x1165c9,_0xefae('0x12'),JSON[_0xefae('0x13')](_0x3ade28));if(_0x3ade28[_0xefae('0x14')]){if(_0x3ade28[_0xefae('0x14')][_0xefae('0x15')]===0x1f4){logger[_0xefae('0x14')](_0xefae('0x16'),_0x1165c9,_0x3ade28['error'][_0xefae('0x17')]);return _0x21a718(_0x3ade28[_0xefae('0x14')]['message']);}logger[_0xefae('0x14')](_0xefae('0x16'),_0x1165c9,_0x3ade28[_0xefae('0x14')][_0xefae('0x17')]);return _0x32fb25(_0x3ade28[_0xefae('0x14')][_0xefae('0x17')]);}else{logger[_0xefae('0x18')](_0xefae('0x16'),_0x1165c9,'request\x20sent');_0x32fb25(_0x3ade28[_0xefae('0x19')][_0xefae('0x17')]);}})[_0xefae('0x1a')](function(_0x5062de){logger['error'](_0xefae('0x16'),_0x1165c9,_0x5062de);_0x21a718(_0x5062de);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 01ba3ac..e4ee1f7 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 _0x8487=['register','length','chatWebsite:','save','remove','update','emit','removeListener'];(function(_0x12d44c,_0xf11296){var _0x4fde20=function(_0x3c1ad6){while(--_0x3c1ad6){_0x12d44c['push'](_0x12d44c['shift']());}};_0x4fde20(++_0xf11296);}(_0x8487,0xe3));var _0x7848=function(_0x16c4d6,_0x32836b){_0x16c4d6=_0x16c4d6-0x0;var _0x5d377a=_0x8487[_0x16c4d6];return _0x5d377a;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=[_0x7848('0x0'),_0x7848('0x1'),_0x7848('0x2')];function createListener(_0x140a78,_0x134563){return function(_0x15eb82){_0x134563[_0x7848('0x3')](_0x140a78,_0x15eb82);};}function removeListener(_0x22fb77,_0x5cd4d6){return function(){ChatWebsiteEvents[_0x7848('0x4')](_0x22fb77,_0x5cd4d6);};}exports[_0x7848('0x5')]=function(_0x4d5bd4){for(var _0x277613=0x0,_0x5d48e5=events[_0x7848('0x6')];_0x277613<_0x5d48e5;_0x277613++){var _0xf03616=events[_0x277613];var _0x45007c=createListener(_0x7848('0x7')+_0xf03616,_0x4d5bd4);ChatWebsiteEvents['on'](_0xf03616,_0x45007c);}};
\ No newline at end of file
+var _0x883c=['register','length','chatWebsite:','remove','update','removeListener'];(function(_0x257268,_0x1d0221){var _0x4812bf=function(_0x4d7ea6){while(--_0x4d7ea6){_0x257268['push'](_0x257268['shift']());}};_0x4812bf(++_0x1d0221);}(_0x883c,0xe7));var _0xc883=function(_0x48c784,_0x52b6fc){_0x48c784=_0x48c784-0x0;var _0x4634d9=_0x883c[_0x48c784];return _0x4634d9;};'use strict';var ChatWebsiteEvents=require('./chatWebsite.events');var events=['save',_0xc883('0x0'),_0xc883('0x1')];function createListener(_0x263f2b,_0x5a072c){return function(_0x1c1a7f){_0x5a072c['emit'](_0x263f2b,_0x1c1a7f);};}function removeListener(_0x291457,_0x101a6f){return function(){ChatWebsiteEvents[_0xc883('0x2')](_0x291457,_0x101a6f);};}exports[_0xc883('0x3')]=function(_0x400300){for(var _0x57d3b3=0x0,_0x5778b4=events[_0xc883('0x4')];_0x57d3b3<_0x5778b4;_0x57d3b3++){var _0x2b2d4c=events[_0x57d3b3];var _0x232d78=createListener(_0xc883('0x5')+_0x2b2d4c,_0x400300);ChatWebsiteEvents['on'](_0x2b2d4c,_0x232d78);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index c660ab3..410d763 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 _0xb658=['removeDispositions','delete','removeAnswers','removeAgents','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','isAuthenticated','index','get','/describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getSnippet','getProactiveActions','/:id/fields','getFields','getOfflineMessages','/:id/users','getAgents','post','create','diskStorage','join','root','server/files/images/logos/','format','now','originalname','single','addLogo','server/files/images/avatars/','%s-%s','file','addCustomerAvatar','addSystemAvatar','notify','server/files','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','/:id/applications','addApplications','/:id/proactive_actions','addAgents','update','/:id/dispositions'];(function(_0x5b1cdd,_0x4faa96){var _0x240dbc=function(_0x5ee779){while(--_0x5ee779){_0x5b1cdd['push'](_0x5b1cdd['shift']());}};_0x240dbc(++_0x4faa96);}(_0xb658,0x115));var _0x8b65=function(_0x441d5c,_0x2eb221){_0x441d5c=_0x441d5c-0x0;var _0x52413c=_0xb658[_0x441d5c];return _0x52413c;};'use strict';var multer=require(_0x8b65('0x0'));var util=require(_0x8b65('0x1'));var path=require('path');var timeout=require(_0x8b65('0x2'));var express=require('express');var router=express[_0x8b65('0x3')]();var fs_extra=require(_0x8b65('0x4'));var auth=require(_0x8b65('0x5'));var interaction=require(_0x8b65('0x6'));var config=require(_0x8b65('0x7'));var controller=require(_0x8b65('0x8'));router['get']('/',auth[_0x8b65('0x9')](),controller[_0x8b65('0xa')]);router[_0x8b65('0xb')](_0x8b65('0xc'),auth[_0x8b65('0x9')](),controller['describe']);router['get'](_0x8b65('0xd'),auth[_0x8b65('0x9')](),controller[_0x8b65('0xe')]);router['get']('/:id/dispositions',auth[_0x8b65('0x9')](),controller[_0x8b65('0xf')]);router[_0x8b65('0xb')](_0x8b65('0x10'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x11')]);router[_0x8b65('0xb')](_0x8b65('0x12'),controller[_0x8b65('0x13')]);router[_0x8b65('0xb')](_0x8b65('0x14'),controller['getAvatar']);router[_0x8b65('0xb')](_0x8b65('0x15'),controller['getCustomerAvatar']);router[_0x8b65('0xb')](_0x8b65('0x16'),controller[_0x8b65('0x17')]);router[_0x8b65('0xb')](_0x8b65('0x18'),auth[_0x8b65('0x9')](),controller['getInteractions']);router[_0x8b65('0xb')]('/:id/snippet',controller[_0x8b65('0x19')]);router[_0x8b65('0xb')]('/:id/applications',auth[_0x8b65('0x9')](),controller['getApplications']);router[_0x8b65('0xb')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x8b65('0x1a')]);router[_0x8b65('0xb')](_0x8b65('0x1b'),controller[_0x8b65('0x1c')]);router[_0x8b65('0xb')]('/:id/offline_messages',auth[_0x8b65('0x9')](),controller[_0x8b65('0x1d')]);router[_0x8b65('0xb')](_0x8b65('0x1e'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x1f')]);router[_0x8b65('0x20')]('/',auth['isAuthenticated'](),controller[_0x8b65('0x21')]);router[_0x8b65('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x8b65('0x20')](_0x8b65('0x10'),auth[_0x8b65('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x8b65('0x22')]({'destination':function(_0x2173ba,_0x53d67e,_0x31afca){_0x31afca(null,path[_0x8b65('0x23')](config[_0x8b65('0x24')],_0x8b65('0x25')));},'filename':function(_0x499b83,_0x1578e8,_0x575b98){_0x575b98(null,util[_0x8b65('0x26')]('%s-%s',Date[_0x8b65('0x27')](),_0x1578e8[_0x8b65('0x28')]));}})});router[_0x8b65('0x20')](_0x8b65('0x12'),upload[_0x8b65('0x29')]('file'),controller[_0x8b65('0x2a')]);var upload=multer({'storage':multer[_0x8b65('0x22')]({'destination':function(_0x3ae0f5,_0xdf4fa5,_0x235aa8){_0x235aa8(null,path[_0x8b65('0x23')](config[_0x8b65('0x24')],_0x8b65('0x2b')));},'filename':function(_0x306444,_0x2915af,_0x1f6756){_0x1f6756(null,util['format'](_0x8b65('0x2c'),Date['now'](),_0x2915af[_0x8b65('0x28')]));}})});router[_0x8b65('0x20')](_0x8b65('0x14'),upload[_0x8b65('0x29')](_0x8b65('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x8b65('0x22')]({'destination':function(_0x5036b5,_0x54aa86,_0x417d9c){_0x417d9c(null,path['join'](config['root'],_0x8b65('0x2b')));},'filename':function(_0x2c8250,_0x454926,_0x2e88c8){_0x2e88c8(null,util[_0x8b65('0x26')](_0x8b65('0x2c'),Date[_0x8b65('0x27')](),_0x454926['originalname']));}})});router[_0x8b65('0x20')](_0x8b65('0x15'),upload[_0x8b65('0x29')](_0x8b65('0x2d')),controller[_0x8b65('0x2e')]);var upload=multer({'storage':multer[_0x8b65('0x22')]({'destination':function(_0x48506e,_0x4e4e55,_0x3c5ee6){_0x3c5ee6(null,path[_0x8b65('0x23')](config[_0x8b65('0x24')],_0x8b65('0x2b')));},'filename':function(_0x5b1f19,_0x1c7631,_0x2cc919){_0x2cc919(null,util[_0x8b65('0x26')]('%s-%s',Date[_0x8b65('0x27')](),_0x1c7631[_0x8b65('0x28')]));}})});router['post'](_0x8b65('0x16'),upload['single'](_0x8b65('0x2d')),controller[_0x8b65('0x2f')]);router[_0x8b65('0x20')]('/:id/notify',controller[_0x8b65('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x2c40fa,_0x520fc0,_0x34535f){const _0x301fca=path[_0x8b65('0x23')](config[_0x8b65('0x24')],_0x8b65('0x31'),'attachments',_0x8b65('0x32'));fs_extra[_0x8b65('0x33')](_0x301fca,function(){_0x34535f(null,_0x301fca);});},'filename':function(_0x57492d,_0x2e7c58,_0x3570a6){const _0x40ad0f=_0x2e7c58['originalname'][_0x8b65('0x34')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x246177=path[_0x8b65('0x35')](_0x40ad0f);const _0x4b245a=Date[_0x8b65('0x27')]()+'-'+_0x40ad0f[_0x8b65('0x34')](_0x246177,'')+_0x246177;_0x3570a6(null,_0x4b245a);}})});router[_0x8b65('0x20')](_0x8b65('0x36'),offlineUploadMulter[_0x8b65('0x37')](),controller[_0x8b65('0x38')]);router[_0x8b65('0x20')]('/:id/interactions',auth[_0x8b65('0x9')](),controller['addInteraction']);router['post'](_0x8b65('0x39'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x3a')]);router[_0x8b65('0x20')](_0x8b65('0x3b'),auth[_0x8b65('0x9')](),controller['addProactiveActions']);router[_0x8b65('0x20')](_0x8b65('0x1e'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x3c')]);router['put'](_0x8b65('0xd'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x3d')]);router['delete']('/:id',auth[_0x8b65('0x9')](),controller['destroy']);router['delete'](_0x8b65('0x3e'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x3f')]);router[_0x8b65('0x40')](_0x8b65('0x10'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x41')]);router[_0x8b65('0x40')](_0x8b65('0x1e'),auth[_0x8b65('0x9')](),controller[_0x8b65('0x42')]);module[_0x8b65('0x43')]=router;
\ No newline at end of file
+var _0x8f77=['getSnippet','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','post','create','addDisposition','diskStorage','join','root','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','format','/:id/notify','notify','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','/:id/applications','addApplications','/:id/proactive_actions','addProactiveActions','addAgents','put','update','delete','destroy','removeAnswers','multer','util','path','express','fs-extra','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','get','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet'];(function(_0x54fafa,_0x31c33f){var _0x24363f=function(_0x1c2204){while(--_0x1c2204){_0x54fafa['push'](_0x54fafa['shift']());}};_0x24363f(++_0x31c33f);}(_0x8f77,0xf1));var _0x78f7=function(_0xc9afae,_0x5303e4){_0xc9afae=_0xc9afae-0x0;var _0x14b3fb=_0x8f77[_0xc9afae];return _0x14b3fb;};'use strict';var multer=require(_0x78f7('0x0'));var util=require(_0x78f7('0x1'));var path=require(_0x78f7('0x2'));var timeout=require('connect-timeout');var express=require(_0x78f7('0x3'));var router=express['Router']();var fs_extra=require(_0x78f7('0x4'));var auth=require(_0x78f7('0x5'));var interaction=require(_0x78f7('0x6'));var config=require('../../config/environment');var controller=require(_0x78f7('0x7'));router[_0x78f7('0x8')]('/',auth[_0x78f7('0x9')](),controller['index']);router[_0x78f7('0x8')]('/describe',auth[_0x78f7('0x9')](),controller[_0x78f7('0xa')]);router['get'](_0x78f7('0xb'),auth[_0x78f7('0x9')](),controller['show']);router[_0x78f7('0x8')](_0x78f7('0xc'),auth[_0x78f7('0x9')](),controller[_0x78f7('0xd')]);router[_0x78f7('0x8')](_0x78f7('0xe'),auth[_0x78f7('0x9')](),controller[_0x78f7('0xf')]);router[_0x78f7('0x8')](_0x78f7('0x10'),controller[_0x78f7('0x11')]);router[_0x78f7('0x8')](_0x78f7('0x12'),controller[_0x78f7('0x13')]);router[_0x78f7('0x8')](_0x78f7('0x14'),controller[_0x78f7('0x15')]);router[_0x78f7('0x8')](_0x78f7('0x16'),controller[_0x78f7('0x17')]);router[_0x78f7('0x8')](_0x78f7('0x18'),auth['isAuthenticated'](),controller[_0x78f7('0x19')]);router[_0x78f7('0x8')](_0x78f7('0x1a'),controller[_0x78f7('0x1b')]);router[_0x78f7('0x8')]('/:id/applications',auth[_0x78f7('0x9')](),controller[_0x78f7('0x1c')]);router[_0x78f7('0x8')]('/:id/proactive_actions',auth['isAuthenticated'](),controller[_0x78f7('0x1d')]);router[_0x78f7('0x8')](_0x78f7('0x1e'),controller[_0x78f7('0x1f')]);router[_0x78f7('0x8')](_0x78f7('0x20'),auth[_0x78f7('0x9')](),controller['getOfflineMessages']);router[_0x78f7('0x8')](_0x78f7('0x21'),auth['isAuthenticated'](),controller[_0x78f7('0x22')]);router[_0x78f7('0x23')]('/',auth[_0x78f7('0x9')](),controller[_0x78f7('0x24')]);router[_0x78f7('0x23')](_0x78f7('0xc'),auth[_0x78f7('0x9')](),controller[_0x78f7('0x25')]);router[_0x78f7('0x23')]('/:id/canned_answers',auth[_0x78f7('0x9')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x78f7('0x26')]({'destination':function(_0x54f2c3,_0x582cf0,_0x2c941f){_0x2c941f(null,path[_0x78f7('0x27')](config[_0x78f7('0x28')],'server/files/images/logos/'));},'filename':function(_0x956b02,_0x38a4cb,_0xd79d07){_0xd79d07(null,util['format'](_0x78f7('0x29'),Date[_0x78f7('0x2a')](),_0x38a4cb[_0x78f7('0x2b')]));}})});router[_0x78f7('0x23')](_0x78f7('0x10'),upload[_0x78f7('0x2c')](_0x78f7('0x2d')),controller[_0x78f7('0x2e')]);var upload=multer({'storage':multer[_0x78f7('0x26')]({'destination':function(_0x414181,_0x47c3a7,_0x4d106){_0x4d106(null,path[_0x78f7('0x27')](config['root'],_0x78f7('0x2f')));},'filename':function(_0x44faff,_0x3dfc13,_0x46e9aa){_0x46e9aa(null,util['format'](_0x78f7('0x29'),Date[_0x78f7('0x2a')](),_0x3dfc13[_0x78f7('0x2b')]));}})});router[_0x78f7('0x23')](_0x78f7('0x12'),upload['single'](_0x78f7('0x2d')),controller['addAvatar']);var upload=multer({'storage':multer[_0x78f7('0x26')]({'destination':function(_0x4e9360,_0x96b77a,_0x1593bb){_0x1593bb(null,path[_0x78f7('0x27')](config[_0x78f7('0x28')],_0x78f7('0x2f')));},'filename':function(_0xd7663b,_0x2416c7,_0x878ef0){_0x878ef0(null,util[_0x78f7('0x30')](_0x78f7('0x29'),Date[_0x78f7('0x2a')](),_0x2416c7[_0x78f7('0x2b')]));}})});router['post']('/:id/customer_avatar',upload['single'](_0x78f7('0x2d')),controller['addCustomerAvatar']);var upload=multer({'storage':multer[_0x78f7('0x26')]({'destination':function(_0x47e0b1,_0x151eca,_0x4e08a7){_0x4e08a7(null,path[_0x78f7('0x27')](config[_0x78f7('0x28')],_0x78f7('0x2f')));},'filename':function(_0x151221,_0x113fc7,_0x2caa20){_0x2caa20(null,util[_0x78f7('0x30')]('%s-%s',Date[_0x78f7('0x2a')](),_0x113fc7[_0x78f7('0x2b')]));}})});router[_0x78f7('0x23')](_0x78f7('0x16'),upload['single'](_0x78f7('0x2d')),controller['addSystemAvatar']);router[_0x78f7('0x23')](_0x78f7('0x31'),controller[_0x78f7('0x32')]);const offlineUploadMulter=multer({'storage':multer[_0x78f7('0x26')]({'destination':function(_0xb4ace8,_0x4738b6,_0x342a2a){const _0x31e11b=path[_0x78f7('0x27')](config['root'],'server/files',_0x78f7('0x33'),_0x78f7('0x34'));fs_extra[_0x78f7('0x35')](_0x31e11b,function(){_0x342a2a(null,_0x31e11b);});},'filename':function(_0x51cdd8,_0x757ac7,_0x353a56){const _0x1f0c3b=_0x757ac7[_0x78f7('0x2b')][_0x78f7('0x36')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x533b2c=path[_0x78f7('0x37')](_0x1f0c3b);const _0x2dd0b4=Date[_0x78f7('0x2a')]()+'-'+_0x1f0c3b[_0x78f7('0x36')](_0x533b2c,'')+_0x533b2c;_0x353a56(null,_0x2dd0b4);}})});router['post'](_0x78f7('0x38'),offlineUploadMulter['any'](),controller['offline']);router['post'](_0x78f7('0x18'),auth[_0x78f7('0x9')](),controller['addInteraction']);router['post'](_0x78f7('0x39'),auth[_0x78f7('0x9')](),controller[_0x78f7('0x3a')]);router[_0x78f7('0x23')](_0x78f7('0x3b'),auth[_0x78f7('0x9')](),controller[_0x78f7('0x3c')]);router['post'](_0x78f7('0x21'),auth[_0x78f7('0x9')](),controller[_0x78f7('0x3d')]);router[_0x78f7('0x3e')]('/:id',auth[_0x78f7('0x9')](),controller[_0x78f7('0x3f')]);router[_0x78f7('0x40')]('/:id',auth[_0x78f7('0x9')](),controller[_0x78f7('0x41')]);router['delete'](_0x78f7('0xc'),auth[_0x78f7('0x9')](),controller['removeDispositions']);router[_0x78f7('0x40')](_0x78f7('0xe'),auth[_0x78f7('0x9')](),controller[_0x78f7('0x42')]);router['delete'](_0x78f7('0x21'),auth['isAuthenticated'](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 101edab..31b9be3 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 _0xcb54=['expressEndpoint','/client-logs','exports','beaver-logger/server','../components/auth/service','../config/environment','production','app','client-side-logger','Client-Side\x20logger\x20not\x20found!'];(function(_0xb0d13d,_0x5e65ea){var _0x311a39=function(_0x5e3da6){while(--_0x5e3da6){_0xb0d13d['push'](_0xb0d13d['shift']());}};_0x311a39(++_0x5e65ea);}(_0xcb54,0x175));var _0x4cb5=function(_0x19a241,_0x2b5948){_0x19a241=_0x19a241-0x0;var _0x1297e9=_0xcb54[_0x19a241];return _0x1297e9;};var beaverLogger=require(_0x4cb5('0x0'));var express=require('express');var auth=require(_0x4cb5('0x1'));var config=require(_0x4cb5('0x2'));var router=express['Router']();var isProduction=config['env']===_0x4cb5('0x3')||![];function clientSideLogs(_0x1b2a3f,_0x4a9cc4,_0x444e77){var _0x51f493=_0x1b2a3f[_0x4cb5('0x4')]['get'](_0x4cb5('0x5'));if(!_0x51f493){throw new Error(_0x4cb5('0x6'));}return beaverLogger[_0x4cb5('0x7')]({'uri':_0x4cb5('0x8'),'logger':_0x51f493,'enableCors':!isProduction})(_0x1b2a3f,_0x4a9cc4,_0x444e77);}router['use'](auth['isAuthenticated'](),clientSideLogs);module[_0x4cb5('0x9')]=router;
\ No newline at end of file
+var _0xf8a2=['../config/environment','Router','env','production','app','get','client-side-logger','Client-Side\x20logger\x20not\x20found!','/client-logs','use','exports','beaver-logger/server','express'];(function(_0x10e504,_0x42e73e){var _0x5c7678=function(_0x32efb9){while(--_0x32efb9){_0x10e504['push'](_0x10e504['shift']());}};_0x5c7678(++_0x42e73e);}(_0xf8a2,0xe8));var _0x2f8a=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xf8a2[_0x575a38];return _0x5a7bdd;};var beaverLogger=require(_0x2f8a('0x0'));var express=require(_0x2f8a('0x1'));var auth=require('../components/auth/service');var config=require(_0x2f8a('0x2'));var router=express[_0x2f8a('0x3')]();var isProduction=config[_0x2f8a('0x4')]===_0x2f8a('0x5')||![];function clientSideLogs(_0x42c2fa,_0x1567ac,_0x7366ff){var _0x320235=_0x42c2fa[_0x2f8a('0x6')][_0x2f8a('0x7')](_0x2f8a('0x8'));if(!_0x320235){throw new Error(_0x2f8a('0x9'));}return beaverLogger['expressEndpoint']({'uri':_0x2f8a('0xa'),'logger':_0x320235,'enableCors':!isProduction})(_0x42c2fa,_0x1567ac,_0x7366ff);}router[_0x2f8a('0xb')](auth['isAuthenticated'](),clientSideLogs);module[_0x2f8a('0xc')]=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index f1653d3..a46c5d7 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 _0x2e7d=['exports','STRING','ENUM','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20refresh_token','sequelize'];(function(_0x4b0c78,_0x3c3f28){var _0x47900c=function(_0x36989a){while(--_0x36989a){_0x4b0c78['push'](_0x4b0c78['shift']());}};_0x47900c(++_0x3c3f28);}(_0x2e7d,0x187));var _0xd2e7=function(_0x819464,_0x46fc91){_0x819464=_0x819464-0x0;var _0x49dcc0=_0x2e7d[_0x819464];return _0x49dcc0;};'use strict';var Sequelize=require(_0xd2e7('0x0'));module[_0xd2e7('0x1')]={'name':{'type':Sequelize[_0xd2e7('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xd2e7('0x3')]('AmazonAWS',_0xd2e7('0x4'),_0xd2e7('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xd2e7('0x3')](_0xd2e7('0x6'),_0xd2e7('0x7'))},'data1':{'type':Sequelize[_0xd2e7('0x2')],'comment':_0xd2e7('0x8')},'data2':{'type':Sequelize[_0xd2e7('0x2')],'comment':_0xd2e7('0x9')},'data3':{'type':Sequelize[_0xd2e7('0x2')],'comment':'MicrosoftAzure\x20=>\x20client_secret'},'data4':{'type':Sequelize[_0xd2e7('0x2')],'comment':_0xd2e7('0xa')},'data5':{'type':Sequelize[_0xd2e7('0xb')],'comment':_0xd2e7('0xc')},'data6':{'type':Sequelize['TEXT'],'comment':_0xd2e7('0xd')},'data7':{'type':Sequelize[_0xd2e7('0xb')],'comment':'MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri'}};
\ No newline at end of file
+var _0x6c2e=['MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','MicrosoftAzure\x20=>\x20access_token','TEXT','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM','AmazonAWS','Google','MicrosoftAzure','Outlook365','Dynamics365','MicrosoftAzure\x20=>\x20tenant'];(function(_0x17a647,_0x2bbe12){var _0x219a38=function(_0x131c5d){while(--_0x131c5d){_0x17a647['push'](_0x17a647['shift']());}};_0x219a38(++_0x2bbe12);}(_0x6c2e,0x67));var _0xe6c2=function(_0x17fadf,_0x394d52){_0x17fadf=_0x17fadf-0x0;var _0x19dba6=_0x6c2e[_0x17fadf];return _0x19dba6;};'use strict';var Sequelize=require('sequelize');module[_0xe6c2('0x0')]={'name':{'type':Sequelize[_0xe6c2('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xe6c2('0x2')](_0xe6c2('0x3'),_0xe6c2('0x4'),_0xe6c2('0x5')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xe6c2('0x2')](_0xe6c2('0x6'),_0xe6c2('0x7'))},'data1':{'type':Sequelize[_0xe6c2('0x1')],'comment':'MicrosoftAzure\x20=>\x20client_id'},'data2':{'type':Sequelize[_0xe6c2('0x1')],'comment':_0xe6c2('0x8')},'data3':{'type':Sequelize[_0xe6c2('0x1')],'comment':_0xe6c2('0x9')},'data4':{'type':Sequelize[_0xe6c2('0x1')],'comment':_0xe6c2('0xa')},'data5':{'type':Sequelize['TEXT'],'comment':_0xe6c2('0xb')},'data6':{'type':Sequelize[_0xe6c2('0xc')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize['TEXT'],'comment':_0xe6c2('0xd')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 5cf9b06..7bdf4dc 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 _0xc57b=['../../config/environment','api','../../mysqldb','./cloudProvider.oauth','defaults','redis','localhost','socket.io-emitter','end','status','json','offset','undefined','limit','count','set','Content-Range','update','destroy','then','sendStatus','error','stack','name','send','slice','index','map','CloudProvider','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','MicrosoftAzure','data3','catch','show','params','find','decryptString','body','service','Service\x20parameter\x20not\x20specified','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','encryptString','create','oauth2MicrosoftAuthorize','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','Invalid\x20state\x20parameter','from','state','base64','toString','ascii','parse','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','refresh_token','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','../../components/encryptor'];(function(_0x277bec,_0x593224){var _0x2efd60=function(_0x3cef68){while(--_0x3cef68){_0x277bec['push'](_0x277bec['shift']());}};_0x2efd60(++_0x593224);}(_0xc57b,0x122));var _0xbc57=function(_0x2792b2,_0x12efa9){_0x2792b2=_0x2792b2-0x0;var _0x12aafa=_0xc57b[_0x2792b2];return _0x12aafa;};'use strict';var _=require(_0xbc57('0x0'));var Redis=require(_0xbc57('0x1'));var qs=require(_0xbc57('0x2'));var encryptor=require(_0xbc57('0x3'));var config=require(_0xbc57('0x4'));var logger=require('../../config/logger')(_0xbc57('0x5'));var db=require(_0xbc57('0x6'))['db'];var oauth=require(_0xbc57('0x7'));config['redis']=_[_0xbc57('0x8')](config[_0xbc57('0x9')],{'host':_0xbc57('0xa'),'port':0x18eb});var socket=require(_0xbc57('0xb'))(new Redis(config[_0xbc57('0x9')]));var redis=new Redis(config[_0xbc57('0x9')]);function respondWithStatusCode(_0x35191b,_0x18c761){_0x18c761=_0x18c761||0xcc;return function(_0x394135){if(_0x394135){return _0x35191b['sendStatus'](_0x18c761);}return _0x35191b['status'](_0x18c761)[_0xbc57('0xc')]();};}function respondWithResult(_0x4df49a,_0x2efab3){_0x2efab3=_0x2efab3||0xc8;return function(_0x37825b){if(_0x37825b){return _0x4df49a[_0xbc57('0xd')](_0x2efab3)[_0xbc57('0xe')](_0x37825b);}};}function respondWithFilteredResult(_0xbb331b,_0x147504){return function(_0x221ac8){if(_0x221ac8){var _0x1e220a=typeof _0x147504[_0xbc57('0xf')]===_0xbc57('0x10')&&typeof _0x147504[_0xbc57('0x11')]===_0xbc57('0x10');var _0x55d179=_0x221ac8[_0xbc57('0x12')];var _0x3196ac=_0x1e220a?0x0:_0x147504[_0xbc57('0xf')];var _0x4aa8=_0x1e220a?_0x221ac8[_0xbc57('0x12')]:_0x147504[_0xbc57('0xf')]+_0x147504[_0xbc57('0x11')];var _0x57ddda;if(_0x4aa8>=_0x55d179){_0x4aa8=_0x55d179;_0x57ddda=0xc8;}else{_0x57ddda=0xce;}_0xbb331b[_0xbc57('0xd')](_0x57ddda);return _0xbb331b[_0xbc57('0x13')](_0xbc57('0x14'),_0x3196ac+'-'+_0x4aa8+'/'+_0x55d179)[_0xbc57('0xe')](_0x221ac8);}return null;};}function saveUpdates(_0x5fc5d7){return function(_0x23d730){if(_0x23d730){return _0x23d730[_0xbc57('0x15')](_0x5fc5d7)['then'](function(_0xefc12c){return _0xefc12c;});}return null;};}function removeEntity(_0x3bbec3){return function(_0x4462d5){if(_0x4462d5){return _0x4462d5[_0xbc57('0x16')]()[_0xbc57('0x17')](function(){_0x3bbec3['status'](0xcc)[_0xbc57('0xc')]();});}};}function handleEntityNotFound(_0x1246be){return function(_0x3e11c2){if(!_0x3e11c2){_0x1246be[_0xbc57('0x18')](0x194);}return _0x3e11c2;};}function handleError(_0x3c95f3,_0x555daf){_0x555daf=_0x555daf||0x1f4;return function(_0x21a648){logger[_0xbc57('0x19')](_0x21a648[_0xbc57('0x1a')]);if(_0x21a648[_0xbc57('0x1b')]){delete _0x21a648['name'];}_0x3c95f3[_0xbc57('0xd')](_0x555daf)[_0xbc57('0x1c')](_0x21a648);};}function maskClientSecret(_0x756f2f){return _['padEnd'](_0x756f2f[_0xbc57('0x1d')](0x0,0x3),0x14,'*');}exports[_0xbc57('0x1e')]=function(_0x3b6191,_0x5b3fcb){var _0x24e332={},_0x56bab9={},_0x24c62b={'count':0x0,'rows':[]};var _0x5881a3=_[_0xbc57('0x1f')](db[_0xbc57('0x20')][_0xbc57('0x21')],function(_0x1a8ecc){return{'name':_0x1a8ecc['fieldName'],'type':_0x1a8ecc[_0xbc57('0x22')][_0xbc57('0x23')]};});_0x56bab9[_0xbc57('0x24')]=_['map'](_0x5881a3,'name');_0x56bab9[_0xbc57('0x25')]=_[_0xbc57('0x26')](_0x3b6191[_0xbc57('0x25')]);_0x56bab9[_0xbc57('0x27')]=_[_0xbc57('0x28')](_0x56bab9[_0xbc57('0x24')],_0x56bab9[_0xbc57('0x25')]);_0x24e332[_0xbc57('0x29')]=_[_0xbc57('0x28')](_0x56bab9[_0xbc57('0x24')],qs[_0xbc57('0x2a')](_0x3b6191[_0xbc57('0x25')][_0xbc57('0x2a')]));_0x24e332['attributes']=_0x24e332[_0xbc57('0x29')][_0xbc57('0x2b')]?_0x24e332[_0xbc57('0x29')]:_0x56bab9[_0xbc57('0x24')];if(!_0x3b6191[_0xbc57('0x25')][_0xbc57('0x2c')]('nolimit')){_0x24e332['limit']=qs[_0xbc57('0x11')](_0x3b6191[_0xbc57('0x25')]['limit']);_0x24e332[_0xbc57('0xf')]=qs[_0xbc57('0xf')](_0x3b6191[_0xbc57('0x25')][_0xbc57('0xf')]);}_0x24e332[_0xbc57('0x2d')]=qs[_0xbc57('0x2e')](_0x3b6191[_0xbc57('0x25')][_0xbc57('0x2e')]);_0x24e332[_0xbc57('0x2f')]=qs[_0xbc57('0x27')](_[_0xbc57('0x30')](_0x3b6191['query'],_0x56bab9['filters']),_0x5881a3);if(_0x3b6191[_0xbc57('0x25')][_0xbc57('0x31')]){_0x24e332[_0xbc57('0x2f')]=_[_0xbc57('0x32')](_0x24e332[_0xbc57('0x2f')],{'$or':_[_0xbc57('0x1f')](_0x5881a3,function(_0x32c16d){if(_0x32c16d['type']!==_0xbc57('0x33')){var _0x19bcd9={};_0x19bcd9[_0x32c16d[_0xbc57('0x1b')]]={'$like':'%'+_0x3b6191[_0xbc57('0x25')][_0xbc57('0x31')]+'%'};return _0x19bcd9;}})});}_0x24e332=_[_0xbc57('0x32')]({},_0x24e332,_0x3b6191[_0xbc57('0x34')]);var _0x3b314d={'where':_0x24e332[_0xbc57('0x2f')]};return db[_0xbc57('0x20')][_0xbc57('0x12')](_0x3b314d)[_0xbc57('0x17')](function(_0x3d72a5){_0x24c62b[_0xbc57('0x12')]=_0x3d72a5;if(_0x3b6191[_0xbc57('0x25')][_0xbc57('0x35')]){_0x24e332[_0xbc57('0x36')]=[{'all':!![]}];}return db['CloudProvider'][_0xbc57('0x37')](_0x24e332);})['then'](function(_0x37c7b8){_0x24c62b[_0xbc57('0x38')]=_['map'](_0x37c7b8,function(_0x5014c3){if(_0x5014c3['service']===_0xbc57('0x39')){var _0x4fa215=encryptor['decryptString'](_0x5014c3[_0xbc57('0x3a')]);_0x5014c3[_0xbc57('0x3a')]=maskClientSecret(_0x4fa215);}return _0x5014c3;});return _0x24c62b;})[_0xbc57('0x17')](respondWithFilteredResult(_0x5b3fcb,_0x24e332))[_0xbc57('0x3b')](handleError(_0x5b3fcb,null));};exports[_0xbc57('0x3c')]=function(_0x1c8084,_0x3f55ea){var _0x45c88b={'raw':!![],'where':{'id':_0x1c8084[_0xbc57('0x3d')]['id']}},_0x4b7f27={};_0x4b7f27[_0xbc57('0x24')]=_['keys'](db[_0xbc57('0x20')][_0xbc57('0x21')]);_0x4b7f27['query']=_[_0xbc57('0x26')](_0x1c8084[_0xbc57('0x25')]);_0x4b7f27[_0xbc57('0x27')]=_[_0xbc57('0x28')](_0x4b7f27[_0xbc57('0x24')],_0x4b7f27['query']);_0x45c88b['attributes']=_[_0xbc57('0x28')](_0x4b7f27[_0xbc57('0x24')],qs[_0xbc57('0x2a')](_0x1c8084[_0xbc57('0x25')][_0xbc57('0x2a')]));_0x45c88b[_0xbc57('0x29')]=_0x45c88b[_0xbc57('0x29')]['length']?_0x45c88b[_0xbc57('0x29')]:_0x4b7f27[_0xbc57('0x24')];if(_0x1c8084[_0xbc57('0x25')][_0xbc57('0x35')]){_0x45c88b[_0xbc57('0x36')]=[{'all':!![]}];}_0x45c88b=_[_0xbc57('0x32')]({},_0x45c88b,_0x1c8084['options']);return db[_0xbc57('0x20')][_0xbc57('0x3e')](_0x45c88b)[_0xbc57('0x17')](handleEntityNotFound(_0x3f55ea,null))[_0xbc57('0x17')](function(_0x2f9110){if(_0x2f9110['service']===_0xbc57('0x39')){var _0x1b7111=encryptor[_0xbc57('0x3f')](_0x2f9110[_0xbc57('0x3a')]);_0x2f9110[_0xbc57('0x3a')]=maskClientSecret(_0x1b7111);}return _0x2f9110;})[_0xbc57('0x17')](respondWithResult(_0x3f55ea,null))['catch'](handleError(_0x3f55ea,null));};exports['create']=function(_0x23eb99,_0x2c5480){if(!_0x23eb99[_0xbc57('0x40')][_0xbc57('0x1b')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x23eb99[_0xbc57('0x40')][_0xbc57('0x41')])throw new Error(_0xbc57('0x42'));var _0x352619=db[_0xbc57('0x20')][_0xbc57('0x21')][_0xbc57('0x41')]['values'];if(!_0x352619[_0xbc57('0x43')](_0x23eb99['body'][_0xbc57('0x41')]))throw new Error(_0xbc57('0x44')+_0x352619['join'](',\x20'));if(_0x23eb99[_0xbc57('0x40')][_0xbc57('0x41')]==='MicrosoftAzure'&&_0x23eb99[_0xbc57('0x40')][_0xbc57('0x3a')]){_0x23eb99[_0xbc57('0x40')]['data3']=encryptor[_0xbc57('0x45')](_0x23eb99[_0xbc57('0x40')][_0xbc57('0x3a')]);}return db[_0xbc57('0x20')][_0xbc57('0x46')](_0x23eb99['body'],{})[_0xbc57('0x17')](respondWithResult(_0x2c5480,0xc9))[_0xbc57('0x3b')](handleError(_0x2c5480,null));};exports[_0xbc57('0x15')]=function(_0x49d73e,_0x480c44){if(_0x49d73e['body']['id']){delete _0x49d73e[_0xbc57('0x40')]['id'];}return db[_0xbc57('0x20')]['find']({'where':{'id':_0x49d73e[_0xbc57('0x3d')]['id']}})['then'](handleEntityNotFound(_0x480c44,null))[_0xbc57('0x17')](function(_0x5b5c01){if(_0x5b5c01[_0xbc57('0x41')]===_0xbc57('0x39')&&_0x49d73e[_0xbc57('0x40')][_0xbc57('0x3a')]){_0x49d73e['body']['data3']=encryptor[_0xbc57('0x45')](_0x49d73e[_0xbc57('0x40')]['data3']);}return _0x5b5c01;})[_0xbc57('0x17')](saveUpdates(_0x49d73e['body'],null))[_0xbc57('0x17')](respondWithResult(_0x480c44,null))[_0xbc57('0x3b')](handleError(_0x480c44,null));};exports[_0xbc57('0x16')]=function(_0x2b32cc,_0x4d9e31){return db[_0xbc57('0x20')]['find']({'where':{'id':_0x2b32cc[_0xbc57('0x3d')]['id']}})['then'](handleEntityNotFound(_0x4d9e31,null))['then'](removeEntity(_0x4d9e31,null))[_0xbc57('0x3b')](handleError(_0x4d9e31,null));};exports[_0xbc57('0x47')]=function(_0x41b0d2,_0x22d13d){return db[_0xbc57('0x20')][_0xbc57('0x48')]({'where':{'id':_0x41b0d2[_0xbc57('0x3d')]['id']},'raw':!![]})[_0xbc57('0x17')](function(_0x53eed4){if(!_0x53eed4)return _0x22d13d['sendStatus'](0x194);return{'url':oauth[_0xbc57('0x49')](_0x53eed4,_0x41b0d2[_0xbc57('0x4a')]['id'])};})['then'](respondWithResult(_0x22d13d,null))[_0xbc57('0x3b')](handleError(_0x22d13d,null));};exports[_0xbc57('0x4b')]=function(_0xce8c52,_0x2efa46){var _0x403d2a=_0xce8c52[_0xbc57('0x40')];var _0x688799;var _0x187ffb;if(_0x403d2a[_0xbc57('0x19')])throw _0x403d2a;redis['get'](_0x403d2a['state'])[_0xbc57('0x17')](function(_0x592b40){if(!_0x592b40)throw new Error(_0xbc57('0x4c'));_0x688799=JSON['parse'](_0x592b40);var _0x2d4338=Buffer[_0xbc57('0x4d')](_0x403d2a[_0xbc57('0x4e')],_0xbc57('0x4f'))[_0xbc57('0x50')](_0xbc57('0x51'));_0x187ffb=JSON[_0xbc57('0x52')](_0x2d4338);if(!oauth['isValidIdToken'](_0x403d2a[_0xbc57('0x53')],_0x688799[_0xbc57('0x54')]))throw new Error(_0xbc57('0x55'));redis[_0xbc57('0x56')](_0x403d2a[_0xbc57('0x4e')]);return oauth[_0xbc57('0x57')](_0x403d2a[_0xbc57('0x58')],_0x688799);})[_0xbc57('0x17')](function(_0x521d2f){_0x688799[_0xbc57('0x59')]=_0x521d2f['access_token'];_0x688799[_0xbc57('0x5a')]=_0x521d2f[_0xbc57('0x5b')];return db[_0xbc57('0x20')]['update']({'data5':_0x688799[_0xbc57('0x59')],'data6':_0x688799[_0xbc57('0x5a')]},{'where':{'id':_0x688799['id']}});})['then'](function(){oauth['startRefreshInterval'](_0x688799);socket[_0xbc57('0x5c')](_0xbc57('0x5d'),{'id':_0x187ffb['id']});return;})['then'](respondWithStatusCode(_0x2efa46,null))[_0xbc57('0x3b')](function(_0x3549cb){if(_0x187ffb){socket[_0xbc57('0x5c')](_0xbc57('0x5e'),{'id':_0x187ffb['id']});}if(!_0x688799){logger[_0xbc57('0x19')](_0xbc57('0x5f'),_0x3549cb);return _0x2efa46[_0xbc57('0xd')](0x1f4)[_0xbc57('0x1c')](_0x3549cb['message']);}logger[_0xbc57('0x19')](_0xbc57('0x60'),_0x688799['id'],JSON[_0xbc57('0x61')](_0x3549cb));});};
\ No newline at end of file
+var _0x92e6=['oauth2MicrosoftCallback','parse','state','base64','toString','ascii','isValidIdToken','id_token','oauth2Claims','Unable\x20to\x20validate\x20id_token','getOauth2MicrosoftAccessToken','access_token','data6','data5','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','../../components/parsers/qs','../../components/encryptor','../../config/logger','api','redis','socket.io-emitter','sendStatus','status','end','json','offset','count','limit','set','Content-Range','then','destroy','error','name','send','padEnd','slice','index','map','CloudProvider','rawAttributes','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','service','MicrosoftAzure','decryptString','data3','catch','show','params','keys','include','find','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20','update','encryptString','oauth2MicrosoftAuthorize','user'];(function(_0x209d2a,_0x59a302){var _0x2d2a4a=function(_0x4d5084){while(--_0x4d5084){_0x209d2a['push'](_0x209d2a['shift']());}};_0x2d2a4a(++_0x59a302);}(_0x92e6,0x16b));var _0x692e=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0x92e6[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var Redis=require('ioredis');var qs=require(_0x692e('0x0'));var encryptor=require(_0x692e('0x1'));var config=require('../../config/environment');var logger=require(_0x692e('0x2'))(_0x692e('0x3'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0x692e('0x4')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x692e('0x5'))(new Redis(config['redis']));var redis=new Redis(config[_0x692e('0x4')]);function respondWithStatusCode(_0x5099eb,_0x515ed7){_0x515ed7=_0x515ed7||0xcc;return function(_0x4d4145){if(_0x4d4145){return _0x5099eb[_0x692e('0x6')](_0x515ed7);}return _0x5099eb[_0x692e('0x7')](_0x515ed7)[_0x692e('0x8')]();};}function respondWithResult(_0x34b385,_0x4e2ca2){_0x4e2ca2=_0x4e2ca2||0xc8;return function(_0x5e2c92){if(_0x5e2c92){return _0x34b385['status'](_0x4e2ca2)[_0x692e('0x9')](_0x5e2c92);}};}function respondWithFilteredResult(_0x397c97,_0x4679d3){return function(_0x3dc6b1){if(_0x3dc6b1){var _0x396c62=typeof _0x4679d3[_0x692e('0xa')]==='undefined'&&typeof _0x4679d3['limit']==='undefined';var _0x129613=_0x3dc6b1[_0x692e('0xb')];var _0x50b4c0=_0x396c62?0x0:_0x4679d3['offset'];var _0x11ee32=_0x396c62?_0x3dc6b1['count']:_0x4679d3[_0x692e('0xa')]+_0x4679d3[_0x692e('0xc')];var _0x17398c;if(_0x11ee32>=_0x129613){_0x11ee32=_0x129613;_0x17398c=0xc8;}else{_0x17398c=0xce;}_0x397c97[_0x692e('0x7')](_0x17398c);return _0x397c97[_0x692e('0xd')](_0x692e('0xe'),_0x50b4c0+'-'+_0x11ee32+'/'+_0x129613)[_0x692e('0x9')](_0x3dc6b1);}return null;};}function saveUpdates(_0x3be789){return function(_0x1cc7f6){if(_0x1cc7f6){return _0x1cc7f6['update'](_0x3be789)[_0x692e('0xf')](function(_0x32f19a){return _0x32f19a;});}return null;};}function removeEntity(_0x5e2d26){return function(_0x219dda){if(_0x219dda){return _0x219dda[_0x692e('0x10')]()[_0x692e('0xf')](function(){_0x5e2d26['status'](0xcc)[_0x692e('0x8')]();});}};}function handleEntityNotFound(_0x149d53){return function(_0x103e9f){if(!_0x103e9f){_0x149d53[_0x692e('0x6')](0x194);}return _0x103e9f;};}function handleError(_0x41bead,_0x2ec76a){_0x2ec76a=_0x2ec76a||0x1f4;return function(_0x496265){logger[_0x692e('0x11')](_0x496265['stack']);if(_0x496265[_0x692e('0x12')]){delete _0x496265[_0x692e('0x12')];}_0x41bead[_0x692e('0x7')](_0x2ec76a)[_0x692e('0x13')](_0x496265);};}function maskClientSecret(_0x4bdb74){return _[_0x692e('0x14')](_0x4bdb74[_0x692e('0x15')](0x0,0x3),0x14,'*');}exports[_0x692e('0x16')]=function(_0x34d641,_0x4cc31b){var _0x228519={},_0x1c503d={},_0x30d72a={'count':0x0,'rows':[]};var _0x19f5fe=_[_0x692e('0x17')](db[_0x692e('0x18')][_0x692e('0x19')],function(_0x4d91d9){return{'name':_0x4d91d9['fieldName'],'type':_0x4d91d9['type'][_0x692e('0x1a')]};});_0x1c503d[_0x692e('0x1b')]=_[_0x692e('0x17')](_0x19f5fe,'name');_0x1c503d[_0x692e('0x1c')]=_['keys'](_0x34d641[_0x692e('0x1c')]);_0x1c503d[_0x692e('0x1d')]=_['intersection'](_0x1c503d[_0x692e('0x1b')],_0x1c503d[_0x692e('0x1c')]);_0x228519['attributes']=_[_0x692e('0x1e')](_0x1c503d[_0x692e('0x1b')],qs[_0x692e('0x1f')](_0x34d641[_0x692e('0x1c')][_0x692e('0x1f')]));_0x228519[_0x692e('0x20')]=_0x228519['attributes'][_0x692e('0x21')]?_0x228519[_0x692e('0x20')]:_0x1c503d[_0x692e('0x1b')];if(!_0x34d641[_0x692e('0x1c')][_0x692e('0x22')](_0x692e('0x23'))){_0x228519['limit']=qs[_0x692e('0xc')](_0x34d641['query'][_0x692e('0xc')]);_0x228519[_0x692e('0xa')]=qs[_0x692e('0xa')](_0x34d641[_0x692e('0x1c')][_0x692e('0xa')]);}_0x228519[_0x692e('0x24')]=qs[_0x692e('0x25')](_0x34d641[_0x692e('0x1c')]['sort']);_0x228519[_0x692e('0x26')]=qs[_0x692e('0x1d')](_[_0x692e('0x27')](_0x34d641[_0x692e('0x1c')],_0x1c503d[_0x692e('0x1d')]),_0x19f5fe);if(_0x34d641['query'][_0x692e('0x28')]){_0x228519[_0x692e('0x26')]=_[_0x692e('0x29')](_0x228519[_0x692e('0x26')],{'$or':_[_0x692e('0x17')](_0x19f5fe,function(_0x1a5520){if(_0x1a5520['type']!==_0x692e('0x2a')){var _0x2fe4c3={};_0x2fe4c3[_0x1a5520[_0x692e('0x12')]]={'$like':'%'+_0x34d641[_0x692e('0x1c')][_0x692e('0x28')]+'%'};return _0x2fe4c3;}})});}_0x228519=_['merge']({},_0x228519,_0x34d641[_0x692e('0x2b')]);var _0x42179a={'where':_0x228519[_0x692e('0x26')]};return db[_0x692e('0x18')][_0x692e('0xb')](_0x42179a)[_0x692e('0xf')](function(_0x55c532){_0x30d72a[_0x692e('0xb')]=_0x55c532;if(_0x34d641['query'][_0x692e('0x2c')]){_0x228519['include']=[{'all':!![]}];}return db[_0x692e('0x18')][_0x692e('0x2d')](_0x228519);})[_0x692e('0xf')](function(_0x5991c3){_0x30d72a['rows']=_[_0x692e('0x17')](_0x5991c3,function(_0x31d4e9){if(_0x31d4e9[_0x692e('0x2e')]===_0x692e('0x2f')){var _0x141837=encryptor[_0x692e('0x30')](_0x31d4e9[_0x692e('0x31')]);_0x31d4e9[_0x692e('0x31')]=maskClientSecret(_0x141837);}return _0x31d4e9;});return _0x30d72a;})[_0x692e('0xf')](respondWithFilteredResult(_0x4cc31b,_0x228519))[_0x692e('0x32')](handleError(_0x4cc31b,null));};exports[_0x692e('0x33')]=function(_0x2d210a,_0xaf23ad){var _0x7b06ef={'raw':!![],'where':{'id':_0x2d210a[_0x692e('0x34')]['id']}},_0x122310={};_0x122310[_0x692e('0x1b')]=_[_0x692e('0x35')](db[_0x692e('0x18')]['rawAttributes']);_0x122310[_0x692e('0x1c')]=_[_0x692e('0x35')](_0x2d210a[_0x692e('0x1c')]);_0x122310[_0x692e('0x1d')]=_[_0x692e('0x1e')](_0x122310[_0x692e('0x1b')],_0x122310[_0x692e('0x1c')]);_0x7b06ef[_0x692e('0x20')]=_[_0x692e('0x1e')](_0x122310[_0x692e('0x1b')],qs[_0x692e('0x1f')](_0x2d210a[_0x692e('0x1c')][_0x692e('0x1f')]));_0x7b06ef[_0x692e('0x20')]=_0x7b06ef[_0x692e('0x20')][_0x692e('0x21')]?_0x7b06ef[_0x692e('0x20')]:_0x122310[_0x692e('0x1b')];if(_0x2d210a[_0x692e('0x1c')]['includeAll']){_0x7b06ef[_0x692e('0x36')]=[{'all':!![]}];}_0x7b06ef=_[_0x692e('0x29')]({},_0x7b06ef,_0x2d210a[_0x692e('0x2b')]);return db[_0x692e('0x18')][_0x692e('0x37')](_0x7b06ef)[_0x692e('0xf')](handleEntityNotFound(_0xaf23ad,null))[_0x692e('0xf')](function(_0x534464){if(_0x534464[_0x692e('0x2e')]===_0x692e('0x2f')){var _0xf6f6bd=encryptor[_0x692e('0x30')](_0x534464[_0x692e('0x31')]);_0x534464[_0x692e('0x31')]=maskClientSecret(_0xf6f6bd);}return _0x534464;})['then'](respondWithResult(_0xaf23ad,null))['catch'](handleError(_0xaf23ad,null));};exports[_0x692e('0x38')]=function(_0x31d823,_0x467b35){if(!_0x31d823[_0x692e('0x39')][_0x692e('0x12')])throw new Error(_0x692e('0x3a'));if(!_0x31d823['body'][_0x692e('0x2e')])throw new Error(_0x692e('0x3b'));var _0xb6b009=db[_0x692e('0x18')][_0x692e('0x19')][_0x692e('0x2e')][_0x692e('0x3c')];if(!_0xb6b009[_0x692e('0x3d')](_0x31d823[_0x692e('0x39')][_0x692e('0x2e')]))throw new Error(_0x692e('0x3e')+_0xb6b009['join'](',\x20'));if(_0x31d823['body']['service']===_0x692e('0x2f')&&_0x31d823[_0x692e('0x39')][_0x692e('0x31')]){_0x31d823[_0x692e('0x39')][_0x692e('0x31')]=encryptor['encryptString'](_0x31d823['body'][_0x692e('0x31')]);}return db[_0x692e('0x18')][_0x692e('0x38')](_0x31d823[_0x692e('0x39')],{})[_0x692e('0xf')](respondWithResult(_0x467b35,0xc9))['catch'](handleError(_0x467b35,null));};exports[_0x692e('0x3f')]=function(_0x169717,_0x49ec2e){if(_0x169717['body']['id']){delete _0x169717[_0x692e('0x39')]['id'];}return db[_0x692e('0x18')][_0x692e('0x37')]({'where':{'id':_0x169717[_0x692e('0x34')]['id']}})[_0x692e('0xf')](handleEntityNotFound(_0x49ec2e,null))['then'](function(_0x214390){if(_0x214390[_0x692e('0x2e')]==='MicrosoftAzure'&&_0x169717[_0x692e('0x39')][_0x692e('0x31')]){_0x169717[_0x692e('0x39')]['data3']=encryptor[_0x692e('0x40')](_0x169717[_0x692e('0x39')]['data3']);}return _0x214390;})[_0x692e('0xf')](saveUpdates(_0x169717[_0x692e('0x39')],null))['then'](respondWithResult(_0x49ec2e,null))['catch'](handleError(_0x49ec2e,null));};exports[_0x692e('0x10')]=function(_0x12f19e,_0x17df67){return db[_0x692e('0x18')][_0x692e('0x37')]({'where':{'id':_0x12f19e[_0x692e('0x34')]['id']}})[_0x692e('0xf')](handleEntityNotFound(_0x17df67,null))['then'](removeEntity(_0x17df67,null))['catch'](handleError(_0x17df67,null));};exports[_0x692e('0x41')]=function(_0x103e92,_0x340b41){return db[_0x692e('0x18')]['findOne']({'where':{'id':_0x103e92[_0x692e('0x34')]['id']},'raw':!![]})[_0x692e('0xf')](function(_0x5408e8){if(!_0x5408e8)return _0x340b41['sendStatus'](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x5408e8,_0x103e92[_0x692e('0x42')]['id'])};})['then'](respondWithResult(_0x340b41,null))[_0x692e('0x32')](handleError(_0x340b41,null));};exports[_0x692e('0x43')]=function(_0x309f78,_0x5cd72b){var _0xb5f283=_0x309f78[_0x692e('0x39')];var _0x45ee5a;var _0x42199f;if(_0xb5f283[_0x692e('0x11')])throw _0xb5f283;redis['get'](_0xb5f283['state'])[_0x692e('0xf')](function(_0x302f1d){if(!_0x302f1d)throw new Error('Invalid\x20state\x20parameter');_0x45ee5a=JSON[_0x692e('0x44')](_0x302f1d);var _0x64b6f9=Buffer['from'](_0xb5f283[_0x692e('0x45')],_0x692e('0x46'))[_0x692e('0x47')](_0x692e('0x48'));_0x42199f=JSON[_0x692e('0x44')](_0x64b6f9);if(!oauth[_0x692e('0x49')](_0xb5f283[_0x692e('0x4a')],_0x45ee5a[_0x692e('0x4b')]))throw new Error(_0x692e('0x4c'));redis['del'](_0xb5f283[_0x692e('0x45')]);return oauth[_0x692e('0x4d')](_0xb5f283['code'],_0x45ee5a);})['then'](function(_0x1420ea){_0x45ee5a['data5']=_0x1420ea[_0x692e('0x4e')];_0x45ee5a[_0x692e('0x4f')]=_0x1420ea['refresh_token'];return db['CloudProvider']['update']({'data5':_0x45ee5a[_0x692e('0x50')],'data6':_0x45ee5a[_0x692e('0x4f')]},{'where':{'id':_0x45ee5a['id']}});})['then'](function(){oauth[_0x692e('0x51')](_0x45ee5a);socket[_0x692e('0x52')](_0x692e('0x53'),{'id':_0x42199f['id']});return;})['then'](respondWithStatusCode(_0x5cd72b,null))[_0x692e('0x32')](function(_0x1cf7a4){if(_0x42199f){socket[_0x692e('0x52')](_0x692e('0x54'),{'id':_0x42199f['id']});}if(!_0x45ee5a){logger['error'](_0x692e('0x55'),_0x1cf7a4);return _0x5cd72b[_0x692e('0x7')](0x1f4)[_0x692e('0x13')](_0x1cf7a4['message']);}logger[_0x692e('0x11')]('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x45ee5a['id'],JSON['stringify'](_0x1cf7a4));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index 5e5376a..b164911 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 _0x9eed=['cloud_providers','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define'];(function(_0x5c9ad0,_0x6b130c){var _0x3996f4=function(_0x4edb4b){while(--_0x4edb4b){_0x5c9ad0['push'](_0x5c9ad0['shift']());}};_0x3996f4(++_0x6b130c);}(_0x9eed,0x6d));var _0xd9ee=function(_0x459939,_0x3e3b6a){_0x459939=_0x459939-0x0;var _0x378bdf=_0x9eed[_0x459939];return _0x378bdf;};'use strict';var _=require(_0xd9ee('0x0'));var util=require(_0xd9ee('0x1'));var logger=require('../../config/logger')(_0xd9ee('0x2'));var moment=require(_0xd9ee('0x3'));var BPromise=require(_0xd9ee('0x4'));var rp=require(_0xd9ee('0x5'));var fs=require('fs');var path=require(_0xd9ee('0x6'));var rimraf=require(_0xd9ee('0x7'));var config=require(_0xd9ee('0x8'));var attributes=require(_0xd9ee('0x9'));module['exports']=function(_0x5222f6,_0x3ea896){return _0x5222f6[_0xd9ee('0xa')]('CloudProvider',attributes,{'tableName':_0xd9ee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x5c25=['CloudProvider','cloud_providers','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./cloudProvider.attributes','exports','define'];(function(_0x23a9fd,_0x51c59a){var _0x541e7c=function(_0x4297d8){while(--_0x4297d8){_0x23a9fd['push'](_0x23a9fd['shift']());}};_0x541e7c(++_0x51c59a);}(_0x5c25,0x9e));var _0x55c2=function(_0x1378d8,_0x70eabd){_0x1378d8=_0x1378d8-0x0;var _0x445476=_0x5c25[_0x1378d8];return _0x445476;};'use strict';var _=require(_0x55c2('0x0'));var util=require(_0x55c2('0x1'));var logger=require(_0x55c2('0x2'))(_0x55c2('0x3'));var moment=require(_0x55c2('0x4'));var BPromise=require('bluebird');var rp=require(_0x55c2('0x5'));var fs=require('fs');var path=require(_0x55c2('0x6'));var rimraf=require(_0x55c2('0x7'));var config=require('../../config/environment');var attributes=require(_0x55c2('0x8'));module[_0x55c2('0x9')]=function(_0x4bfd59,_0x19739e){return _0x4bfd59[_0x55c2('0xa')](_0x55c2('0xb'),attributes,{'tableName':_0x55c2('0xc'),'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 7ff9d72..9788aff 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 _0x087a=['access_token','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','bind','findAll','all','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','lodash','crypto','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/logger','api','../../mysqldb','defaults','redis','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','openid','profile','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/POP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','offline_access','/authorize','/token','type','Dynamics365','push','data7','join','/.default','replace','{TENANT_ID}','data2','id_token','stringify','randomBytes','toString','hex','data1','response_type','redirect_uri','response_mode','scope','state','nonce','prompt','login','key','value','oauth2Claims','oauth2/','set','decode','payload','iss','issuer','aud','audience','unix','resolve','then','data3','CloudProvider','findOne','refresh_token','data6','data4','decryptString','POST','data5'];(function(_0x23493a,_0x295688){var _0x3a4322=function(_0x1fc11f){while(--_0x1fc11f){_0x23493a['push'](_0x23493a['shift']());}};_0x3a4322(++_0x295688);}(_0x087a,0x147));var _0xa087=function(_0x472c3e,_0x4f119e){_0x472c3e=_0x472c3e-0x0;var _0x3f8481=_0x087a[_0x472c3e];return _0x3f8481;};'use strict';var _=require(_0xa087('0x0'));var crypto=require(_0xa087('0x1'));var jwt=require(_0xa087('0x2'));var moment=require(_0xa087('0x3'));var Redis=require('ioredis');var rp=require(_0xa087('0x4'));var util=require(_0xa087('0x5'));var encryptor=require(_0xa087('0x6'));var config=require('../../config/environment');var logger=require(_0xa087('0x7'))(_0xa087('0x8'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xa087('0x9'))['db'];config['redis']=_[_0xa087('0xa')](config[_0xa087('0xb')],{'host':_0xa087('0xc'),'port':0x18eb});var redis=new Redis(config[_0xa087('0xb')]);var MICROSOFT_AUTH_URL=_0xa087('0xd');var AZURE_AUTH_SCOPES={'Outlook365':[_0xa087('0xe'),_0xa087('0xf'),'email','offline_access',_0xa087('0x10'),_0xa087('0x11'),_0xa087('0x12')],'Dynamics365':[_0xa087('0xe'),_0xa087('0x13')]};var MICROSOFT_AUTH_ENDPOINT=_0xa087('0x14');var MICROSOFT_TOKEN_ENDPOINT=_0xa087('0x15');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0xcf3086){var _0x4bd4fe=_['map'](AZURE_AUTH_SCOPES[_0xcf3086[_0xa087('0x16')]]);if(_0xcf3086[_0xa087('0x16')]===_0xa087('0x17'))_0x4bd4fe[_0xa087('0x18')](_0xcf3086[_0xa087('0x19')]+'/.default');return _0x4bd4fe[_0xa087('0x1a')]('\x20');}function getAccessTokenScope(_0x356923){if(_0x356923[_0xa087('0x16')]==='Outlook365')return _0xa087('0x10');if(_0x356923[_0xa087('0x16')]===_0xa087('0x17'))return _0x356923[_0xa087('0x19')]+_0xa087('0x1b');}function generateMicrosoftAuthorizationUrl(_0x62909e,_0x59459e){var _0x29f406=MICROSOFT_AUTH_URL[_0xa087('0x1c')](_0xa087('0x1d'),_0x62909e[_0xa087('0x1e')]);var _0x1904b0=['code',_0xa087('0x1f')];var _0x3c3e36=Buffer['from'](JSON[_0xa087('0x20')]({'id':_0x59459e}))['toString']('base64');var _0x8277ed=crypto[_0xa087('0x21')](0x10)[_0xa087('0x22')](_0xa087('0x23'));var _0xdbb85f=getAuthorizationScopes(_0x62909e);var _0x4a7345=[{'key':'client_id','value':_0x62909e[_0xa087('0x24')]},{'key':_0xa087('0x25'),'value':encodeURIComponent(_0x1904b0[_0xa087('0x1a')]('\x20'))},{'key':_0xa087('0x26'),'value':_0x62909e['data4']},{'key':_0xa087('0x27'),'value':'form_post'},{'key':_0xa087('0x28'),'value':encodeURIComponent(_0xdbb85f)},{'key':_0xa087('0x29'),'value':_0x3c3e36},{'key':_0xa087('0x2a'),'value':_0x8277ed},{'key':_0xa087('0x2b'),'value':_0xa087('0x2c')}];var _0x21af1f=_0x29f406+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x4a7345,function(_0x3475ed){return _0x3475ed[_0xa087('0x2d')]+'='+_0x3475ed[_0xa087('0x2e')];})[_0xa087('0x1a')]('&');_0x62909e[_0xa087('0x2f')]={'issuer':_0x29f406[_0xa087('0x1c')](_0xa087('0x30'),''),'audience':_0x62909e[_0xa087('0x24')],'state':_0x3c3e36,'nonce':_0x8277ed};redis[_0xa087('0x31')](_0x3c3e36,JSON[_0xa087('0x20')](_0x62909e));return _0x21af1f;}function isValidIdToken(_0x10e5cf,_0x373be3){try{var _0x36de6d=jwt[_0xa087('0x32')](_0x10e5cf,{'complete':!![]});var _0x349ae1=_0x36de6d[_0xa087('0x33')];if(_0x349ae1[_0xa087('0x34')]!==_0x373be3[_0xa087('0x35')])return![];if(_0x349ae1[_0xa087('0x36')]!==_0x373be3[_0xa087('0x37')])return![];if(_0x349ae1[_0xa087('0x2a')]!==_0x373be3['nonce'])return![];if(moment()['isAfter'](moment[_0xa087('0x38')](_0x349ae1['exp'])))return![];return!![];}catch(_0x352dd1){throw _0x352dd1;}}function refreshOauth2MicrosoftAccessToken(_0x301b14){return Promise[_0xa087('0x39')]()[_0xa087('0x3a')](function(){if(_0x301b14[_0xa087('0x3b')])return _0x301b14;return db[_0xa087('0x3c')][_0xa087('0x3d')]({'where':{'id':_0x301b14['id']},'raw':!![]});})['then'](function(_0x4a9e94){var _0x4bd620={'grant_type':_0xa087('0x3e'),'refresh_token':_0x4a9e94[_0xa087('0x3f')],'scope':getAccessTokenScope(_0x4a9e94),'redirect_uri':_0x4a9e94[_0xa087('0x40')],'client_id':_0x4a9e94[_0xa087('0x24')],'client_secret':encryptor[_0xa087('0x41')](_0x4a9e94[_0xa087('0x3b')])};var _0x13a9b9={'method':_0xa087('0x42'),'uri':MICROSOFT_AUTH_URL[_0xa087('0x1c')](_0xa087('0x1d'),_0x4a9e94[_0xa087('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x4bd620,'json':!![]};return rp(_0x13a9b9);})[_0xa087('0x3a')](function(_0x10c89c){_0x301b14[_0xa087('0x43')]=_0x10c89c[_0xa087('0x44')];_0x301b14['data6']=_0x10c89c[_0xa087('0x3e')];return db[_0xa087('0x3c')]['update']({'data5':_0x301b14[_0xa087('0x43')],'data6':_0x301b14[_0xa087('0x3f')]},{'where':{'id':_0x301b14['id']}});})[_0xa087('0x3a')](function(){return _0x301b14;})['catch'](function(_0xd3b4d9){logger['error'](_0xa087('0x45'),_0x301b14['id'],_0xd3b4d9);});}function getOauth2MicrosoftAccessToken(_0x4cc957,_0x3f0eb3){var _0x6568b={'grant_type':_0xa087('0x46'),'code':_0x4cc957,'scope':getAccessTokenScope(_0x3f0eb3),'redirect_uri':_0x3f0eb3[_0xa087('0x40')],'client_id':_0x3f0eb3[_0xa087('0x24')],'client_secret':encryptor[_0xa087('0x41')](_0x3f0eb3['data3'])};var _0x2a7703={'method':_0xa087('0x42'),'uri':MICROSOFT_AUTH_URL[_0xa087('0x1c')](_0xa087('0x1d'),_0x3f0eb3[_0xa087('0x1e')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x6568b,'json':!![]};return rp(_0x2a7703);}function startRefreshInterval(_0x295bc8){var _0x3d0df7=schedule[_0xa087('0x47')];if(_0x3d0df7[_0x295bc8['id']])clearInterval(_0x3d0df7[_0x295bc8['id']]);_0x3d0df7[_0x295bc8['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xa087('0x48')](this,{'id':_0x295bc8['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xa087('0x47')]=_0x3d0df7;}function startAllRefreshIntervals(){return db[_0xa087('0x3c')][_0xa087('0x49')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x1f698e){var _0x1e78fb=_0x1f698e['map'](function(_0x24bb6d){return refreshOauth2MicrosoftAccessToken(_0x24bb6d)[_0xa087('0x3a')](function(_0x18ebad){startRefreshInterval(_0x18ebad);});});return Promise[_0xa087('0x4a')](_0x1e78fb);})[_0xa087('0x4b')](function(_0x37ecc7){var _0x81fa2e=_0x37ecc7?util[_0xa087('0x4c')](_0x37ecc7,{'showHidden':![],'depth':null}):'';logger['error'](_0xa087('0x4d'),_0x81fa2e);});}module[_0xa087('0x4e')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9cc3=['inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','crypto','jsonwebtoken','moment','ioredis','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../config/schedule/cloud-provider','../../mysqldb','defaults','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','/authorize','/token','type','push','data7','/.default','join','Dynamics365','replace','{TENANT_ID}','data2','id_token','stringify','toString','hex','client_id','response_type','response_mode','scope','state','nonce','prompt','key','value','oauth2Claims','oauth2/','data1','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','data4','decryptString','POST','data5','access_token','data6','catch','error','authorization_code','intervals','findAll','map','all'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9cc3,0xf6));var _0x39cc=function(_0x486b2e,_0x5b752a){_0x486b2e=_0x486b2e-0x0;var _0xe43bdd=_0x9cc3[_0x486b2e];return _0xe43bdd;};'use strict';var _=require('lodash');var crypto=require(_0x39cc('0x0'));var jwt=require(_0x39cc('0x1'));var moment=require(_0x39cc('0x2'));var Redis=require(_0x39cc('0x3'));var rp=require(_0x39cc('0x4'));var util=require(_0x39cc('0x5'));var encryptor=require(_0x39cc('0x6'));var config=require(_0x39cc('0x7'));var logger=require(_0x39cc('0x8'))(_0x39cc('0x9'));var schedule=require(_0x39cc('0xa'));var db=require(_0x39cc('0xb'))['db'];config['redis']=_[_0x39cc('0xc')](config[_0x39cc('0xd')],{'host':_0x39cc('0xe'),'port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL=_0x39cc('0xf');var AZURE_AUTH_SCOPES={'Outlook365':[_0x39cc('0x10'),_0x39cc('0x11'),_0x39cc('0x12'),_0x39cc('0x13'),_0x39cc('0x14'),_0x39cc('0x15'),_0x39cc('0x16')],'Dynamics365':[_0x39cc('0x10'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0x39cc('0x17');var MICROSOFT_TOKEN_ENDPOINT=_0x39cc('0x18');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x3863b7){var _0x2c5e2f=_['map'](AZURE_AUTH_SCOPES[_0x3863b7['type']]);if(_0x3863b7[_0x39cc('0x19')]==='Dynamics365')_0x2c5e2f[_0x39cc('0x1a')](_0x3863b7[_0x39cc('0x1b')]+_0x39cc('0x1c'));return _0x2c5e2f[_0x39cc('0x1d')]('\x20');}function getAccessTokenScope(_0x10e9d0){if(_0x10e9d0[_0x39cc('0x19')]==='Outlook365')return _0x39cc('0x14');if(_0x10e9d0[_0x39cc('0x19')]===_0x39cc('0x1e'))return _0x10e9d0[_0x39cc('0x1b')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5b618b,_0x5b1aa0){var _0x166b65=MICROSOFT_AUTH_URL[_0x39cc('0x1f')](_0x39cc('0x20'),_0x5b618b[_0x39cc('0x21')]);var _0x805058=['code',_0x39cc('0x22')];var _0x3331e8=Buffer['from'](JSON[_0x39cc('0x23')]({'id':_0x5b1aa0}))[_0x39cc('0x24')]('base64');var _0x4da815=crypto['randomBytes'](0x10)['toString'](_0x39cc('0x25'));var _0x5dd158=getAuthorizationScopes(_0x5b618b);var _0x16c0f1=[{'key':_0x39cc('0x26'),'value':_0x5b618b['data1']},{'key':_0x39cc('0x27'),'value':encodeURIComponent(_0x805058[_0x39cc('0x1d')]('\x20'))},{'key':'redirect_uri','value':_0x5b618b['data4']},{'key':_0x39cc('0x28'),'value':'form_post'},{'key':_0x39cc('0x29'),'value':encodeURIComponent(_0x5dd158)},{'key':_0x39cc('0x2a'),'value':_0x3331e8},{'key':_0x39cc('0x2b'),'value':_0x4da815},{'key':_0x39cc('0x2c'),'value':'login'}];var _0x2559b8=_0x166b65+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x16c0f1,function(_0x4bd133){return _0x4bd133[_0x39cc('0x2d')]+'='+_0x4bd133[_0x39cc('0x2e')];})[_0x39cc('0x1d')]('&');_0x5b618b[_0x39cc('0x2f')]={'issuer':_0x166b65['replace'](_0x39cc('0x30'),''),'audience':_0x5b618b[_0x39cc('0x31')],'state':_0x3331e8,'nonce':_0x4da815};redis['set'](_0x3331e8,JSON[_0x39cc('0x23')](_0x5b618b));return _0x2559b8;}function isValidIdToken(_0x31736a,_0x19370e){try{var _0x1bcee3=jwt[_0x39cc('0x32')](_0x31736a,{'complete':!![]});var _0x57c98c=_0x1bcee3[_0x39cc('0x33')];if(_0x57c98c[_0x39cc('0x34')]!==_0x19370e[_0x39cc('0x35')])return![];if(_0x57c98c[_0x39cc('0x36')]!==_0x19370e[_0x39cc('0x37')])return![];if(_0x57c98c[_0x39cc('0x2b')]!==_0x19370e['nonce'])return![];if(moment()[_0x39cc('0x38')](moment[_0x39cc('0x39')](_0x57c98c[_0x39cc('0x3a')])))return![];return!![];}catch(_0x5c4c02){throw _0x5c4c02;}}function refreshOauth2MicrosoftAccessToken(_0x5b1d8e){return Promise[_0x39cc('0x3b')]()[_0x39cc('0x3c')](function(){if(_0x5b1d8e[_0x39cc('0x3d')])return _0x5b1d8e;return db[_0x39cc('0x3e')][_0x39cc('0x3f')]({'where':{'id':_0x5b1d8e['id']},'raw':!![]});})[_0x39cc('0x3c')](function(_0x42eaf8){var _0x187c3e={'grant_type':_0x39cc('0x40'),'refresh_token':_0x42eaf8['data6'],'scope':getAccessTokenScope(_0x42eaf8),'redirect_uri':_0x42eaf8[_0x39cc('0x41')],'client_id':_0x42eaf8[_0x39cc('0x31')],'client_secret':encryptor[_0x39cc('0x42')](_0x42eaf8[_0x39cc('0x3d')])};var _0x132ae0={'method':_0x39cc('0x43'),'uri':MICROSOFT_AUTH_URL[_0x39cc('0x1f')]('{TENANT_ID}',_0x42eaf8[_0x39cc('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x187c3e,'json':!![]};return rp(_0x132ae0);})[_0x39cc('0x3c')](function(_0x36f37d){_0x5b1d8e[_0x39cc('0x44')]=_0x36f37d[_0x39cc('0x45')];_0x5b1d8e[_0x39cc('0x46')]=_0x36f37d['refresh_token'];return db[_0x39cc('0x3e')]['update']({'data5':_0x5b1d8e[_0x39cc('0x44')],'data6':_0x5b1d8e[_0x39cc('0x46')]},{'where':{'id':_0x5b1d8e['id']}});})[_0x39cc('0x3c')](function(){return _0x5b1d8e;})[_0x39cc('0x47')](function(_0x5d85d7){logger[_0x39cc('0x48')]('Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s',_0x5b1d8e['id'],_0x5d85d7);});}function getOauth2MicrosoftAccessToken(_0x1a3e97,_0x10c59f){var _0x368336={'grant_type':_0x39cc('0x49'),'code':_0x1a3e97,'scope':getAccessTokenScope(_0x10c59f),'redirect_uri':_0x10c59f[_0x39cc('0x41')],'client_id':_0x10c59f[_0x39cc('0x31')],'client_secret':encryptor[_0x39cc('0x42')](_0x10c59f[_0x39cc('0x3d')])};var _0x42290d={'method':_0x39cc('0x43'),'uri':MICROSOFT_AUTH_URL[_0x39cc('0x1f')]('{TENANT_ID}',_0x10c59f[_0x39cc('0x21')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x368336,'json':!![]};return rp(_0x42290d);}function startRefreshInterval(_0x26b582){var _0x56e6c2=schedule['intervals'];if(_0x56e6c2[_0x26b582['id']])clearInterval(_0x56e6c2[_0x26b582['id']]);_0x56e6c2[_0x26b582['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x26b582['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x39cc('0x4a')]=_0x56e6c2;}function startAllRefreshIntervals(){return db['CloudProvider'][_0x39cc('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})['then'](function(_0x558779){var _0x36a084=_0x558779[_0x39cc('0x4c')](function(_0x5279f4){return refreshOauth2MicrosoftAccessToken(_0x5279f4)['then'](function(_0x120f47){startRefreshInterval(_0x120f47);});});return Promise[_0x39cc('0x4d')](_0x36a084);})['catch'](function(_0x33d5b6){var _0x3cd737=_0x33d5b6?util[_0x39cc('0x4e')](_0x33d5b6,{'showHidden':![],'depth':null}):'';logger['error'](_0x39cc('0x4f'),_0x3cd737);});}module[_0x39cc('0x50')]={'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 681359a..1162d3a 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 _0xfb11=['info','CloudProvider,\x20%s,\x20%s','request\x20sent','CloudProvider,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then'];(function(_0x845505,_0x19e5f3){var _0x2513b9=function(_0x10e7af){while(--_0x10e7af){_0x845505['push'](_0x845505['shift']());}};_0x2513b9(++_0x19e5f3);}(_0xfb11,0x1ad));var _0x1fb1=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xfb11[_0x5bd426];return _0x23a7eb;};'use strict';var _=require(_0x1fb1('0x0'));var util=require('util');var moment=require(_0x1fb1('0x1'));var BPromise=require(_0x1fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1fb1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1fb1('0x4'));var logger=require('../../config/logger')(_0x1fb1('0x5'));var config=require(_0x1fb1('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x1fb1('0x7')][_0x1fb1('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4c098d,_0x1859da,_0x2596c2){return new BPromise(function(_0x34e61a,_0x236b20){return client[_0x1fb1('0x9')](_0x4c098d,_0x2596c2)[_0x1fb1('0xa')](function(_0x438d15){logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,_0x1fb1('0xd'));logger['debug'](_0x1fb1('0xe'),_0x1859da,'request\x20sent',JSON[_0x1fb1('0xf')](_0x438d15));if(_0x438d15['error']){if(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x11')]===0x1f4){logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x236b20(_0x438d15['error'][_0x1fb1('0x12')]);}logger[_0x1fb1('0x10')](_0x1fb1('0xc'),_0x1859da,_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);return _0x34e61a(_0x438d15[_0x1fb1('0x10')][_0x1fb1('0x12')]);}else{logger[_0x1fb1('0xb')](_0x1fb1('0xc'),_0x1859da,'request\x20sent');_0x34e61a(_0x438d15['result'][_0x1fb1('0x12')]);}})[_0x1fb1('0x13')](function(_0x3924ab){logger['error'](_0x1fb1('0xc'),_0x1859da,_0x3924ab);_0x236b20(_0x3924ab);});});}
\ No newline at end of file
+var _0x87bc=['http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent','debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/logger','client'];(function(_0x4bd67a,_0x4f9725){var _0x2be5fb=function(_0x33e132){while(--_0x33e132){_0x4bd67a['push'](_0x4bd67a['shift']());}};_0x2be5fb(++_0x4f9725);}(_0x87bc,0x189));var _0xc87b=function(_0x585c82,_0x3d5c40){_0x585c82=_0x585c82-0x0;var _0x26ddfa=_0x87bc[_0x585c82];return _0x26ddfa;};'use strict';var _=require(_0xc87b('0x0'));var util=require(_0xc87b('0x1'));var moment=require('moment');var BPromise=require(_0xc87b('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc87b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xc87b('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xc87b('0x5')][_0xc87b('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x402aac,_0x5d1813,_0x50b19b){return new BPromise(function(_0x4ed0c5,_0x1999f8){return client[_0xc87b('0x7')](_0x402aac,_0x50b19b)[_0xc87b('0x8')](function(_0x19b571){logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));logger[_0xc87b('0xc')](_0xc87b('0xd'),_0x5d1813,'request\x20sent',JSON['stringify'](_0x19b571));if(_0x19b571[_0xc87b('0xe')]){if(_0x19b571['error'][_0xc87b('0xf')]===0x1f4){logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571[_0xc87b('0xe')]['message']);return _0x1999f8(_0x19b571[_0xc87b('0xe')]['message']);}logger[_0xc87b('0xe')](_0xc87b('0xa'),_0x5d1813,_0x19b571['error'][_0xc87b('0x10')]);return _0x4ed0c5(_0x19b571[_0xc87b('0xe')]['message']);}else{logger[_0xc87b('0x9')](_0xc87b('0xa'),_0x5d1813,_0xc87b('0xb'));_0x4ed0c5(_0x19b571[_0xc87b('0x11')][_0xc87b('0x10')]);}})[_0xc87b('0x12')](function(_0x4009ef){logger[_0xc87b('0xe')]('CloudProvider,\x20%s,\x20%s',_0x5d1813,_0x4009ef);_0x1999f8(_0x4009ef);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index 7eb16c3..11d8f75 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 _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(_0x171f29,_0x34d81a){var _0x557905=function(_0xc08fb4){while(--_0xc08fb4){_0x171f29['push'](_0x171f29['shift']());}};_0x557905(++_0x34d81a);}(_0x2ef3,0xba));var _0x32ef=function(_0x85f875,_0x36c2a0){_0x85f875=_0x85f875-0x0;var _0x1c37be=_0x2ef3[_0x85f875];return _0x1c37be;};'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
+var _0x5f2f=['exports','express','Router','../../components/auth/service','./cloudProvider.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','oauth2MicrosoftCallback'];(function(_0x147497,_0x43e433){var _0x35f45=function(_0x584421){while(--_0x584421){_0x147497['push'](_0x147497['shift']());}};_0x35f45(++_0x43e433);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4c0fbb,_0x420492){_0x4c0fbb=_0x4c0fbb-0x0;var _0x462c3d=_0x5f2f[_0x4c0fbb];return _0x462c3d;};'use strict';var express=require(_0xf5f2('0x0'));var router=express[_0xf5f2('0x1')]();var auth=require(_0xf5f2('0x2'));var controller=require(_0xf5f2('0x3'));router[_0xf5f2('0x4')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x6')]);router[_0xf5f2('0x4')]('/:id',auth['isAuthenticated'](),controller[_0xf5f2('0x7')]);router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x5')](),controller[_0xf5f2('0x9')]);router[_0xf5f2('0xa')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xc')]);router[_0xf5f2('0xd')](_0xf5f2('0xb'),auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0x4')](_0xf5f2('0xf'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router['post']('/oauth2/microsoft/callback',controller[_0xf5f2('0x11')]);module[_0xf5f2('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index cff9d8d..d9d39c5 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 _0xc794=['name','exports','STRING'];(function(_0x438ec4,_0x5c5de3){var _0xc7bb37=function(_0xafe219){while(--_0xafe219){_0x438ec4['push'](_0x438ec4['shift']());}};_0xc7bb37(++_0x5c5de3);}(_0xc794,0x17b));var _0x4c79=function(_0x530e37,_0x11e459){_0x530e37=_0x530e37-0x0;var _0x4f1777=_0xc794[_0x530e37];return _0x4f1777;};'use strict';var Sequelize=require('sequelize');module[_0x4c79('0x0')]={'name':{'type':Sequelize[_0x4c79('0x1')],'unique':_0x4c79('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0x4c79('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4c79('0x1')]},'fax':{'type':Sequelize[_0x4c79('0x1')]},'type':{'type':Sequelize[_0x4c79('0x1')]},'street':{'type':Sequelize[_0x4c79('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4c79('0x1')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x4c79('0x1')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x4c79('0x1')]},'sCountry':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x4c79('0x1')]}};
\ No newline at end of file
+var _0xfdba=['sequelize','exports','STRING','name'];(function(_0x30bff4,_0x5d2581){var _0x14518d=function(_0x1e2998){while(--_0x1e2998){_0x30bff4['push'](_0x30bff4['shift']());}};_0x14518d(++_0x5d2581);}(_0xfdba,0xf4));var _0xafdb=function(_0x3cbff8,_0x33ab36){_0x3cbff8=_0x3cbff8-0x0;var _0x10e0e1=_0xfdba[_0x3cbff8];return _0x10e0e1;};'use strict';var Sequelize=require(_0xafdb('0x0'));module[_0xafdb('0x1')]={'name':{'type':Sequelize[_0xafdb('0x2')],'unique':_0xafdb('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xafdb('0x2')]},'companyId':{'type':Sequelize[_0xafdb('0x2')]},'website':{'type':Sequelize[_0xafdb('0x2')]},'phone':{'type':Sequelize[_0xafdb('0x2')]},'fax':{'type':Sequelize[_0xafdb('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0xafdb('0x2')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0xafdb('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xafdb('0x2')]},'sStreet':{'type':Sequelize[_0xafdb('0x2')]},'sPostalCode':{'type':Sequelize[_0xafdb('0x2')]},'sCity':{'type':Sequelize[_0xafdb('0x2')]},'sCountry':{'type':Sequelize[_0xafdb('0x2')]},'description':{'type':Sequelize[_0xafdb('0x2')]}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index 95aa263..29ac5ef 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 _0xb935=['../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','then','get','Companies','destroy','end','error','name','index','CmCompany','keys','query','filters','intersection','model','attributes','fields','length','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','catch','show','params','rawAttributes','find','create','body','role','user','userProfileId','autoAssociation','UserProfileResource','describe','addContacts','CmContact','ids','omit','getContacts','findOne','hasOwnProperty','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x209bbf,_0x2e2375){var _0x592d4b=function(_0x419947){while(--_0x419947){_0x209bbf['push'](_0x209bbf['shift']());}};_0x592d4b(++_0x2e2375);}(_0xb935,0x1a9));var _0x5b93=function(_0x98148,_0x1eb9a3){_0x98148=_0x98148-0x0;var _0x51750d=_0xb935[_0x98148];return _0x51750d;};'use strict';var emlformat=require(_0x5b93('0x0'));var rimraf=require(_0x5b93('0x1'));var zipdir=require(_0x5b93('0x2'));var jsonpatch=require(_0x5b93('0x3'));var rp=require(_0x5b93('0x4'));var moment=require(_0x5b93('0x5'));var BPromise=require(_0x5b93('0x6'));var Mustache=require(_0x5b93('0x7'));var util=require(_0x5b93('0x8'));var path=require(_0x5b93('0x9'));var sox=require(_0x5b93('0xa'));var csv=require(_0x5b93('0xb'));var ejs=require(_0x5b93('0xc'));var fs=require('fs');var fs_extra=require(_0x5b93('0xd'));var _=require(_0x5b93('0xe'));var squel=require(_0x5b93('0xf'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5b93('0x10'));var toCsv=require(_0x5b93('0xb'));var querystring=require(_0x5b93('0x11'));var Papa=require(_0x5b93('0x12'));var Redis=require(_0x5b93('0x13'));var authService=require(_0x5b93('0x14'));var qs=require(_0x5b93('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5b93('0x16'));var logger=require(_0x5b93('0x17'))(_0x5b93('0x18'));var utils=require(_0x5b93('0x19'));var config=require(_0x5b93('0x1a'));var licenseUtil=require(_0x5b93('0x1b'));var db=require(_0x5b93('0x1c'))['db'];function respondWithStatusCode(_0x103452,_0xdf46fb){_0xdf46fb=_0xdf46fb||0xcc;return function(_0x1fa759){if(_0x1fa759){return _0x103452[_0x5b93('0x1d')](_0xdf46fb);}return _0x103452[_0x5b93('0x1e')](_0xdf46fb)['end']();};}function respondWithResult(_0x5f4ed7,_0x4ac9c5){_0x4ac9c5=_0x4ac9c5||0xc8;return function(_0x29dd71){if(_0x29dd71){return _0x5f4ed7['status'](_0x4ac9c5)['json'](_0x29dd71);}};}function respondWithFilteredResult(_0x4120ca,_0x8806f0){return function(_0x38d4bb){if(_0x38d4bb){var _0x7bfbc6=typeof _0x8806f0[_0x5b93('0x1f')]===_0x5b93('0x20')&&typeof _0x8806f0[_0x5b93('0x21')]===_0x5b93('0x20');var _0x15e336=_0x38d4bb[_0x5b93('0x22')];var _0x41f42c=_0x7bfbc6?0x0:_0x8806f0['offset'];var _0x25ef23=_0x7bfbc6?_0x38d4bb[_0x5b93('0x22')]:_0x8806f0[_0x5b93('0x1f')]+_0x8806f0[_0x5b93('0x21')];var _0x4facc1;if(_0x25ef23>=_0x15e336){_0x25ef23=_0x15e336;_0x4facc1=0xc8;}else{_0x4facc1=0xce;}_0x4120ca[_0x5b93('0x1e')](_0x4facc1);return _0x4120ca[_0x5b93('0x23')](_0x5b93('0x24'),_0x41f42c+'-'+_0x25ef23+'/'+_0x15e336)['json'](_0x38d4bb);}return null;};}function patchUpdates(_0x598d1e){return function(_0x29e9b3){try{jsonpatch[_0x5b93('0x25')](_0x29e9b3,_0x598d1e,!![]);}catch(_0x386ee6){return BPromise[_0x5b93('0x26')](_0x386ee6);}return _0x29e9b3[_0x5b93('0x27')]();};}function saveUpdates(_0x5a3f4c,_0x25f6c6){return function(_0x2bca47){if(_0x2bca47){return _0x2bca47[_0x5b93('0x28')](_0x5a3f4c)['then'](function(_0x51792){return _0x51792;});}return null;};}function removeEntity(_0x3ba9c7,_0x3bc956){return function(_0x232658){if(_0x232658){return _0x232658['destroy']()[_0x5b93('0x29')](function(){var _0x48d6ca=_0x232658[_0x5b93('0x2a')]({'plain':!![]});var _0x19001b=_0x5b93('0x2b');return db['UserProfileResource'][_0x5b93('0x2c')]({'where':{'type':_0x19001b,'resourceId':_0x48d6ca['id']}})['then'](function(){return _0x232658;});})[_0x5b93('0x29')](function(){_0x3ba9c7[_0x5b93('0x1e')](0xcc)[_0x5b93('0x2d')]();});}};}function handleEntityNotFound(_0x152007,_0x45593e){return function(_0x2cdf48){if(!_0x2cdf48){_0x152007[_0x5b93('0x1d')](0x194);}return _0x2cdf48;};}function handleError(_0x753117,_0x3e3017){_0x3e3017=_0x3e3017||0x1f4;return function(_0x2f01c7){logger[_0x5b93('0x2e')](_0x2f01c7['stack']);if(_0x2f01c7['name']){delete _0x2f01c7[_0x5b93('0x2f')];}_0x753117[_0x5b93('0x1e')](_0x3e3017)['send'](_0x2f01c7);};}exports[_0x5b93('0x30')]=function(_0x241bf6,_0x1d3ef7){var _0x43de1e={},_0x50d2ba={},_0xbfaf2e={'count':0x0,'rows':[]};return db[_0x5b93('0x31')]['describe']()[_0x5b93('0x29')](function(_0x457965){_0x50d2ba['model']=_[_0x5b93('0x32')](_0x457965);_0x50d2ba['query']=_[_0x5b93('0x32')](_0x241bf6[_0x5b93('0x33')]);_0x50d2ba[_0x5b93('0x34')]=_[_0x5b93('0x35')](_0x50d2ba[_0x5b93('0x36')],_0x50d2ba[_0x5b93('0x33')]);_0x43de1e[_0x5b93('0x37')]=_['intersection'](_0x50d2ba['model'],qs[_0x5b93('0x38')](_0x241bf6[_0x5b93('0x33')][_0x5b93('0x38')]));_0x43de1e[_0x5b93('0x37')]=_0x43de1e[_0x5b93('0x37')][_0x5b93('0x39')]?_0x43de1e['attributes']:_0x50d2ba[_0x5b93('0x36')];if(!_0x241bf6[_0x5b93('0x33')]['hasOwnProperty']('nolimit')){_0x43de1e[_0x5b93('0x21')]=qs['limit'](_0x241bf6[_0x5b93('0x33')][_0x5b93('0x21')]);_0x43de1e[_0x5b93('0x1f')]=qs[_0x5b93('0x1f')](_0x241bf6[_0x5b93('0x33')][_0x5b93('0x1f')]);}_0x43de1e[_0x5b93('0x3a')]=qs['sort'](_0x241bf6[_0x5b93('0x33')][_0x5b93('0x3b')]);_0x43de1e[_0x5b93('0x3c')]=qs['filters'](_[_0x5b93('0x3d')](_0x241bf6[_0x5b93('0x33')],_0x50d2ba['filters']),_0x457965);if(_0x241bf6[_0x5b93('0x33')][_0x5b93('0x3e')]){_0x43de1e[_0x5b93('0x3c')]=_[_0x5b93('0x3f')](_0x43de1e[_0x5b93('0x3c')],{'$or':_[_0x5b93('0x40')](_0x43de1e[_0x5b93('0x37')],function(_0x327148){var _0x49ce01={};_0x49ce01[_0x327148]={'$like':'%'+_0x241bf6[_0x5b93('0x33')]['filter']+'%'};return _0x49ce01;})});}_0x43de1e=_[_0x5b93('0x3f')]({},_0x43de1e,_0x241bf6[_0x5b93('0x41')]);var _0x1226a8={'where':_0x43de1e['where']};return db['CmCompany'][_0x5b93('0x22')](_0x1226a8)[_0x5b93('0x29')](function(_0x58c8ad){_0xbfaf2e[_0x5b93('0x22')]=_0x58c8ad;if(_0x241bf6[_0x5b93('0x33')][_0x5b93('0x42')]){_0x43de1e[_0x5b93('0x43')]=[{'all':!![]}];}return db[_0x5b93('0x31')][_0x5b93('0x44')](_0x43de1e);})['then'](function(_0x34d5f0){_0xbfaf2e['rows']=_0x34d5f0;return _0xbfaf2e;})[_0x5b93('0x29')](respondWithFilteredResult(_0x1d3ef7,_0x43de1e))[_0x5b93('0x45')](handleError(_0x1d3ef7,null));})[_0x5b93('0x45')](handleError(_0x1d3ef7,null));};exports[_0x5b93('0x46')]=function(_0x3da711,_0x2e1f1a){var _0x171195={'raw':![],'where':{'id':_0x3da711[_0x5b93('0x47')]['id']}},_0x216cd5={};_0x216cd5['model']=_[_0x5b93('0x32')](db[_0x5b93('0x31')][_0x5b93('0x48')]);_0x216cd5[_0x5b93('0x33')]=_[_0x5b93('0x32')](_0x3da711[_0x5b93('0x33')]);_0x216cd5[_0x5b93('0x34')]=_[_0x5b93('0x35')](_0x216cd5[_0x5b93('0x36')],_0x216cd5['query']);_0x171195[_0x5b93('0x37')]=_['intersection'](_0x216cd5[_0x5b93('0x36')],qs[_0x5b93('0x38')](_0x3da711[_0x5b93('0x33')][_0x5b93('0x38')]));_0x171195[_0x5b93('0x37')]=_0x171195[_0x5b93('0x37')]['length']?_0x171195['attributes']:_0x216cd5['model'];if(_0x3da711['query'][_0x5b93('0x42')]){_0x171195[_0x5b93('0x43')]=[{'all':!![]}];}_0x171195=_[_0x5b93('0x3f')]({},_0x171195,_0x3da711['options']);return db['CmCompany'][_0x5b93('0x49')](_0x171195)['then'](handleEntityNotFound(_0x2e1f1a,null))['then'](respondWithResult(_0x2e1f1a,null))[_0x5b93('0x45')](handleError(_0x2e1f1a,null));};exports['create']=function(_0x412c3f,_0x4341e9){return db[_0x5b93('0x31')][_0x5b93('0x4a')](_0x412c3f[_0x5b93('0x4b')],{})[_0x5b93('0x29')](function(_0x449f42){var _0xe34298=_0x412c3f['user'][_0x5b93('0x2a')]({'plain':!![]});if(!_0xe34298)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe34298[_0x5b93('0x4c')]===_0x5b93('0x4d')){var _0x3331cd=_0x449f42['get']({'plain':!![]});var _0x15c773=_0x5b93('0x2b');return db['UserProfileSection'][_0x5b93('0x49')]({'where':{'name':_0x15c773,'userProfileId':_0xe34298[_0x5b93('0x4e')]},'raw':!![]})['then'](function(_0x1dec18){if(_0x1dec18&&_0x1dec18[_0x5b93('0x4f')]===0x0){return db[_0x5b93('0x50')]['create']({'name':_0x3331cd['name'],'resourceId':_0x3331cd['id'],'type':_0x1dec18[_0x5b93('0x2f')],'sectionId':_0x1dec18['id']},{})['then'](function(){return _0x449f42;});}else{return _0x449f42;}})[_0x5b93('0x45')](function(_0x4fd5bd){logger[_0x5b93('0x2e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fd5bd);throw _0x4fd5bd;});}return _0x449f42;})[_0x5b93('0x29')](respondWithResult(_0x4341e9,0xc9))[_0x5b93('0x45')](handleError(_0x4341e9,null));};exports[_0x5b93('0x28')]=function(_0x13c887,_0x24c426){if(_0x13c887['body']['id']){delete _0x13c887['body']['id'];}return db['CmCompany'][_0x5b93('0x49')]({'where':{'id':_0x13c887[_0x5b93('0x47')]['id']}})[_0x5b93('0x29')](handleEntityNotFound(_0x24c426,null))[_0x5b93('0x29')](saveUpdates(_0x13c887['body'],null))[_0x5b93('0x29')](respondWithResult(_0x24c426,null))[_0x5b93('0x45')](handleError(_0x24c426,null));};exports[_0x5b93('0x2c')]=function(_0x48bbcf,_0xb4e655){return db[_0x5b93('0x31')][_0x5b93('0x49')]({'where':{'id':_0x48bbcf[_0x5b93('0x47')]['id']}})['then'](handleEntityNotFound(_0xb4e655,null))[_0x5b93('0x29')](removeEntity(_0xb4e655,null))[_0x5b93('0x45')](handleError(_0xb4e655,null));};exports[_0x5b93('0x51')]=function(_0x15694a,_0x21e860){return db[_0x5b93('0x31')][_0x5b93('0x51')]()[_0x5b93('0x29')](respondWithResult(_0x21e860,null))[_0x5b93('0x45')](handleError(_0x21e860,null));};exports[_0x5b93('0x52')]=function(_0x4c39c8,_0x36c740,_0x3a5ad6){return db[_0x5b93('0x53')][_0x5b93('0x49')]({'where':{'id':_0x4c39c8['params']['id']}})[_0x5b93('0x29')](handleEntityNotFound(_0x36c740,null))[_0x5b93('0x29')](function(_0x5ef024){if(_0x5ef024){return _0x5ef024[_0x5b93('0x52')](_0x4c39c8['body'][_0x5b93('0x54')],_[_0x5b93('0x55')](_0x4c39c8[_0x5b93('0x4b')],[_0x5b93('0x54'),'id'])||{});}})[_0x5b93('0x29')](respondWithResult(_0x36c740,null))[_0x5b93('0x45')](handleError(_0x36c740,null));};exports[_0x5b93('0x56')]=function(_0x3f9847,_0x23ea85,_0x28c3cd){var _0x594deb={};var _0x4ab2c9={};var _0x144621;var _0x1db251;return db[_0x5b93('0x31')][_0x5b93('0x57')]({'where':{'id':_0x3f9847[_0x5b93('0x47')]['id']}})[_0x5b93('0x29')](handleEntityNotFound(_0x23ea85,null))[_0x5b93('0x29')](function(_0x21ee7d){if(_0x21ee7d){_0x144621=_0x21ee7d;_0x4ab2c9[_0x5b93('0x36')]=_['keys'](db[_0x5b93('0x53')]['rawAttributes']);_0x4ab2c9[_0x5b93('0x33')]=_[_0x5b93('0x32')](_0x3f9847[_0x5b93('0x33')]);_0x4ab2c9['filters']=_[_0x5b93('0x35')](_0x4ab2c9[_0x5b93('0x36')],_0x4ab2c9['query']);_0x594deb[_0x5b93('0x37')]=_[_0x5b93('0x35')](_0x4ab2c9[_0x5b93('0x36')],qs[_0x5b93('0x38')](_0x3f9847[_0x5b93('0x33')]['fields']));_0x594deb['attributes']=_0x594deb['attributes'][_0x5b93('0x39')]?_0x594deb[_0x5b93('0x37')]:_0x4ab2c9[_0x5b93('0x36')];_0x594deb[_0x5b93('0x3a')]=qs[_0x5b93('0x3b')](_0x3f9847['query'][_0x5b93('0x3b')]);_0x594deb['where']=qs['filters'](_[_0x5b93('0x3d')](_0x3f9847['query'],_0x4ab2c9[_0x5b93('0x34')]));if(_0x3f9847[_0x5b93('0x33')][_0x5b93('0x3e')]){_0x594deb[_0x5b93('0x3c')]=_[_0x5b93('0x3f')](_0x594deb[_0x5b93('0x3c')],{'$or':_[_0x5b93('0x40')](_0x594deb[_0x5b93('0x37')],function(_0x554900){var _0x32a797={};_0x32a797[_0x554900]={'$like':'%'+_0x3f9847['query'][_0x5b93('0x3e')]+'%'};return _0x32a797;})});}_0x594deb=_[_0x5b93('0x3f')]({},_0x594deb,_0x3f9847[_0x5b93('0x41')]);return _0x144621[_0x5b93('0x56')](_0x594deb);}})[_0x5b93('0x29')](function(_0x510422){if(_0x510422){_0x1db251=_0x510422['length'];if(!_0x3f9847[_0x5b93('0x33')][_0x5b93('0x58')](_0x5b93('0x59'))){_0x594deb[_0x5b93('0x21')]=qs['limit'](_0x3f9847[_0x5b93('0x33')][_0x5b93('0x21')]);_0x594deb['offset']=qs[_0x5b93('0x1f')](_0x3f9847[_0x5b93('0x33')][_0x5b93('0x1f')]);}return _0x144621[_0x5b93('0x56')](_0x594deb);}})[_0x5b93('0x29')](function(_0x16c6f9){if(_0x16c6f9){return _0x16c6f9?{'count':_0x1db251,'rows':_0x16c6f9}:null;}})[_0x5b93('0x29')](respondWithResult(_0x23ea85,null))[_0x5b93('0x45')](handleError(_0x23ea85,null));};
\ No newline at end of file
+var _0x7fd2=['sort','where','pick','merge','map','filter','options','includeAll','include','rows','catch','show','rawAttributes','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addContacts','CmContact','ids','omit','getContacts','findOne','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','destroy','then','Companies','UserProfileResource','stack','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','length','nolimit'];(function(_0x1c9818,_0x29688a){var _0x2a9b82=function(_0x4bd8ac){while(--_0x4bd8ac){_0x1c9818['push'](_0x1c9818['shift']());}};_0x2a9b82(++_0x29688a);}(_0x7fd2,0xcb));var _0x27fd=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x7fd2[_0x138adb];return _0x1b27f2;};'use strict';var emlformat=require(_0x27fd('0x0'));var rimraf=require(_0x27fd('0x1'));var zipdir=require(_0x27fd('0x2'));var jsonpatch=require(_0x27fd('0x3'));var rp=require(_0x27fd('0x4'));var moment=require(_0x27fd('0x5'));var BPromise=require(_0x27fd('0x6'));var Mustache=require('mustache');var util=require(_0x27fd('0x7'));var path=require(_0x27fd('0x8'));var sox=require('sox');var csv=require(_0x27fd('0x9'));var ejs=require(_0x27fd('0xa'));var fs=require('fs');var fs_extra=require(_0x27fd('0xb'));var _=require(_0x27fd('0xc'));var squel=require(_0x27fd('0xd'));var crypto=require(_0x27fd('0xe'));var jsforce=require(_0x27fd('0xf'));var deskjs=require(_0x27fd('0x10'));var toCsv=require('to-csv');var querystring=require(_0x27fd('0x11'));var Papa=require(_0x27fd('0x12'));var Redis=require(_0x27fd('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x27fd('0x14'));var hardwareService=require(_0x27fd('0x15'));var logger=require(_0x27fd('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x27fd('0x17'));var licenseUtil=require(_0x27fd('0x18'));var db=require(_0x27fd('0x19'))['db'];function respondWithStatusCode(_0x3f2e5a,_0x16e225){_0x16e225=_0x16e225||0xcc;return function(_0x2b1b32){if(_0x2b1b32){return _0x3f2e5a[_0x27fd('0x1a')](_0x16e225);}return _0x3f2e5a[_0x27fd('0x1b')](_0x16e225)[_0x27fd('0x1c')]();};}function respondWithResult(_0x5c1bcf,_0x368405){_0x368405=_0x368405||0xc8;return function(_0x546727){if(_0x546727){return _0x5c1bcf['status'](_0x368405)[_0x27fd('0x1d')](_0x546727);}};}function respondWithFilteredResult(_0x52e215,_0x1c7501){return function(_0x1e4a67){if(_0x1e4a67){var _0x56b7da=typeof _0x1c7501[_0x27fd('0x1e')]===_0x27fd('0x1f')&&typeof _0x1c7501['limit']===_0x27fd('0x1f');var _0x1ceb72=_0x1e4a67['count'];var _0x525e07=_0x56b7da?0x0:_0x1c7501[_0x27fd('0x1e')];var _0x39629c=_0x56b7da?_0x1e4a67[_0x27fd('0x20')]:_0x1c7501['offset']+_0x1c7501[_0x27fd('0x21')];var _0x3f888e;if(_0x39629c>=_0x1ceb72){_0x39629c=_0x1ceb72;_0x3f888e=0xc8;}else{_0x3f888e=0xce;}_0x52e215[_0x27fd('0x1b')](_0x3f888e);return _0x52e215[_0x27fd('0x22')](_0x27fd('0x23'),_0x525e07+'-'+_0x39629c+'/'+_0x1ceb72)[_0x27fd('0x1d')](_0x1e4a67);}return null;};}function patchUpdates(_0x3d270c){return function(_0x4e3f3a){try{jsonpatch['apply'](_0x4e3f3a,_0x3d270c,!![]);}catch(_0x23ba8b){return BPromise['reject'](_0x23ba8b);}return _0x4e3f3a['save']();};}function saveUpdates(_0x381907,_0x264782){return function(_0x297742){if(_0x297742){return _0x297742[_0x27fd('0x24')](_0x381907)['then'](function(_0x1a63ab){return _0x1a63ab;});}return null;};}function removeEntity(_0x573a1e,_0x2b9e06){return function(_0x34c6b9){if(_0x34c6b9){return _0x34c6b9[_0x27fd('0x25')]()[_0x27fd('0x26')](function(){var _0x5ccba3=_0x34c6b9['get']({'plain':!![]});var _0x421146=_0x27fd('0x27');return db[_0x27fd('0x28')][_0x27fd('0x25')]({'where':{'type':_0x421146,'resourceId':_0x5ccba3['id']}})[_0x27fd('0x26')](function(){return _0x34c6b9;});})[_0x27fd('0x26')](function(){_0x573a1e[_0x27fd('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbad5b3,_0x413637){return function(_0x3acea4){if(!_0x3acea4){_0xbad5b3[_0x27fd('0x1a')](0x194);}return _0x3acea4;};}function handleError(_0x46106e,_0x52b576){_0x52b576=_0x52b576||0x1f4;return function(_0x562252){logger['error'](_0x562252[_0x27fd('0x29')]);if(_0x562252[_0x27fd('0x2a')]){delete _0x562252[_0x27fd('0x2a')];}_0x46106e[_0x27fd('0x1b')](_0x52b576)['send'](_0x562252);};}exports[_0x27fd('0x2b')]=function(_0x1b026c,_0x2289f5){var _0x4b2e0a={},_0x5034e2={},_0x37b91b={'count':0x0,'rows':[]};return db[_0x27fd('0x2c')][_0x27fd('0x2d')]()[_0x27fd('0x26')](function(_0x338e47){_0x5034e2[_0x27fd('0x2e')]=_[_0x27fd('0x2f')](_0x338e47);_0x5034e2[_0x27fd('0x30')]=_[_0x27fd('0x2f')](_0x1b026c[_0x27fd('0x30')]);_0x5034e2[_0x27fd('0x31')]=_[_0x27fd('0x32')](_0x5034e2[_0x27fd('0x2e')],_0x5034e2['query']);_0x4b2e0a[_0x27fd('0x33')]=_['intersection'](_0x5034e2['model'],qs['fields'](_0x1b026c[_0x27fd('0x30')][_0x27fd('0x34')]));_0x4b2e0a[_0x27fd('0x33')]=_0x4b2e0a[_0x27fd('0x33')][_0x27fd('0x35')]?_0x4b2e0a['attributes']:_0x5034e2['model'];if(!_0x1b026c['query']['hasOwnProperty'](_0x27fd('0x36'))){_0x4b2e0a['limit']=qs[_0x27fd('0x21')](_0x1b026c['query'][_0x27fd('0x21')]);_0x4b2e0a['offset']=qs[_0x27fd('0x1e')](_0x1b026c[_0x27fd('0x30')][_0x27fd('0x1e')]);}_0x4b2e0a['order']=qs['sort'](_0x1b026c['query'][_0x27fd('0x37')]);_0x4b2e0a[_0x27fd('0x38')]=qs['filters'](_[_0x27fd('0x39')](_0x1b026c[_0x27fd('0x30')],_0x5034e2[_0x27fd('0x31')]),_0x338e47);if(_0x1b026c['query']['filter']){_0x4b2e0a[_0x27fd('0x38')]=_[_0x27fd('0x3a')](_0x4b2e0a[_0x27fd('0x38')],{'$or':_[_0x27fd('0x3b')](_0x4b2e0a[_0x27fd('0x33')],function(_0x2a9db9){var _0x50bf32={};_0x50bf32[_0x2a9db9]={'$like':'%'+_0x1b026c['query'][_0x27fd('0x3c')]+'%'};return _0x50bf32;})});}_0x4b2e0a=_[_0x27fd('0x3a')]({},_0x4b2e0a,_0x1b026c[_0x27fd('0x3d')]);var _0x45af30={'where':_0x4b2e0a[_0x27fd('0x38')]};return db[_0x27fd('0x2c')][_0x27fd('0x20')](_0x45af30)['then'](function(_0x3a3997){_0x37b91b[_0x27fd('0x20')]=_0x3a3997;if(_0x1b026c['query'][_0x27fd('0x3e')]){_0x4b2e0a[_0x27fd('0x3f')]=[{'all':!![]}];}return db[_0x27fd('0x2c')]['findAll'](_0x4b2e0a);})[_0x27fd('0x26')](function(_0x565c7e){_0x37b91b[_0x27fd('0x40')]=_0x565c7e;return _0x37b91b;})['then'](respondWithFilteredResult(_0x2289f5,_0x4b2e0a))[_0x27fd('0x41')](handleError(_0x2289f5,null));})[_0x27fd('0x41')](handleError(_0x2289f5,null));};exports[_0x27fd('0x42')]=function(_0x44c2cc,_0x20c12d){var _0x37cf71={'raw':![],'where':{'id':_0x44c2cc['params']['id']}},_0x23dc66={};_0x23dc66['model']=_[_0x27fd('0x2f')](db['CmCompany'][_0x27fd('0x43')]);_0x23dc66['query']=_[_0x27fd('0x2f')](_0x44c2cc[_0x27fd('0x30')]);_0x23dc66[_0x27fd('0x31')]=_[_0x27fd('0x32')](_0x23dc66[_0x27fd('0x2e')],_0x23dc66['query']);_0x37cf71[_0x27fd('0x33')]=_[_0x27fd('0x32')](_0x23dc66[_0x27fd('0x2e')],qs[_0x27fd('0x34')](_0x44c2cc[_0x27fd('0x30')][_0x27fd('0x34')]));_0x37cf71[_0x27fd('0x33')]=_0x37cf71[_0x27fd('0x33')][_0x27fd('0x35')]?_0x37cf71[_0x27fd('0x33')]:_0x23dc66[_0x27fd('0x2e')];if(_0x44c2cc[_0x27fd('0x30')][_0x27fd('0x3e')]){_0x37cf71[_0x27fd('0x3f')]=[{'all':!![]}];}_0x37cf71=_['merge']({},_0x37cf71,_0x44c2cc['options']);return db[_0x27fd('0x2c')]['find'](_0x37cf71)[_0x27fd('0x26')](handleEntityNotFound(_0x20c12d,null))['then'](respondWithResult(_0x20c12d,null))[_0x27fd('0x41')](handleError(_0x20c12d,null));};exports[_0x27fd('0x44')]=function(_0x539d54,_0x345ea8){return db[_0x27fd('0x2c')][_0x27fd('0x44')](_0x539d54[_0x27fd('0x45')],{})[_0x27fd('0x26')](function(_0x5b6532){var _0x38f2a3=_0x539d54[_0x27fd('0x46')][_0x27fd('0x47')]({'plain':!![]});if(!_0x38f2a3)throw new Error(_0x27fd('0x48'));if(_0x38f2a3[_0x27fd('0x49')]===_0x27fd('0x46')){var _0x29c69c=_0x5b6532[_0x27fd('0x47')]({'plain':!![]});var _0x362a94=_0x27fd('0x27');return db['UserProfileSection'][_0x27fd('0x4a')]({'where':{'name':_0x362a94,'userProfileId':_0x38f2a3[_0x27fd('0x4b')]},'raw':!![]})['then'](function(_0x2e5906){if(_0x2e5906&&_0x2e5906[_0x27fd('0x4c')]===0x0){return db[_0x27fd('0x28')][_0x27fd('0x44')]({'name':_0x29c69c[_0x27fd('0x2a')],'resourceId':_0x29c69c['id'],'type':_0x2e5906[_0x27fd('0x2a')],'sectionId':_0x2e5906['id']},{})['then'](function(){return _0x5b6532;});}else{return _0x5b6532;}})[_0x27fd('0x41')](function(_0x2fbe37){logger['error'](_0x27fd('0x4d'),_0x2fbe37);throw _0x2fbe37;});}return _0x5b6532;})[_0x27fd('0x26')](respondWithResult(_0x345ea8,0xc9))[_0x27fd('0x41')](handleError(_0x345ea8,null));};exports[_0x27fd('0x24')]=function(_0x119af6,_0x309f07){if(_0x119af6['body']['id']){delete _0x119af6[_0x27fd('0x45')]['id'];}return db[_0x27fd('0x2c')][_0x27fd('0x4a')]({'where':{'id':_0x119af6[_0x27fd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x309f07,null))[_0x27fd('0x26')](saveUpdates(_0x119af6['body'],null))[_0x27fd('0x26')](respondWithResult(_0x309f07,null))[_0x27fd('0x41')](handleError(_0x309f07,null));};exports[_0x27fd('0x25')]=function(_0x424e7c,_0x18e9a6){return db[_0x27fd('0x2c')]['find']({'where':{'id':_0x424e7c['params']['id']}})[_0x27fd('0x26')](handleEntityNotFound(_0x18e9a6,null))['then'](removeEntity(_0x18e9a6,null))[_0x27fd('0x41')](handleError(_0x18e9a6,null));};exports[_0x27fd('0x2d')]=function(_0x5a96e1,_0x24a9f6){return db[_0x27fd('0x2c')][_0x27fd('0x2d')]()[_0x27fd('0x26')](respondWithResult(_0x24a9f6,null))[_0x27fd('0x41')](handleError(_0x24a9f6,null));};exports[_0x27fd('0x4f')]=function(_0x1cbce1,_0x1dfa48,_0x144594){return db[_0x27fd('0x50')][_0x27fd('0x4a')]({'where':{'id':_0x1cbce1[_0x27fd('0x4e')]['id']}})[_0x27fd('0x26')](handleEntityNotFound(_0x1dfa48,null))[_0x27fd('0x26')](function(_0x2644f1){if(_0x2644f1){return _0x2644f1[_0x27fd('0x4f')](_0x1cbce1[_0x27fd('0x45')][_0x27fd('0x51')],_[_0x27fd('0x52')](_0x1cbce1['body'],['ids','id'])||{});}})[_0x27fd('0x26')](respondWithResult(_0x1dfa48,null))[_0x27fd('0x41')](handleError(_0x1dfa48,null));};exports[_0x27fd('0x53')]=function(_0xa26b1c,_0x222e8d,_0x43d344){var _0x560005={};var _0x126ac0={};var _0x7d0f1;var _0x5e0dc5;return db['CmCompany'][_0x27fd('0x54')]({'where':{'id':_0xa26b1c[_0x27fd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x222e8d,null))[_0x27fd('0x26')](function(_0x2fcf8e){if(_0x2fcf8e){_0x7d0f1=_0x2fcf8e;_0x126ac0[_0x27fd('0x2e')]=_['keys'](db[_0x27fd('0x50')]['rawAttributes']);_0x126ac0[_0x27fd('0x30')]=_[_0x27fd('0x2f')](_0xa26b1c[_0x27fd('0x30')]);_0x126ac0[_0x27fd('0x31')]=_[_0x27fd('0x32')](_0x126ac0[_0x27fd('0x2e')],_0x126ac0[_0x27fd('0x30')]);_0x560005[_0x27fd('0x33')]=_[_0x27fd('0x32')](_0x126ac0['model'],qs[_0x27fd('0x34')](_0xa26b1c[_0x27fd('0x30')]['fields']));_0x560005[_0x27fd('0x33')]=_0x560005['attributes'][_0x27fd('0x35')]?_0x560005['attributes']:_0x126ac0[_0x27fd('0x2e')];_0x560005['order']=qs[_0x27fd('0x37')](_0xa26b1c[_0x27fd('0x30')][_0x27fd('0x37')]);_0x560005[_0x27fd('0x38')]=qs[_0x27fd('0x31')](_[_0x27fd('0x39')](_0xa26b1c[_0x27fd('0x30')],_0x126ac0[_0x27fd('0x31')]));if(_0xa26b1c[_0x27fd('0x30')]['filter']){_0x560005[_0x27fd('0x38')]=_[_0x27fd('0x3a')](_0x560005['where'],{'$or':_[_0x27fd('0x3b')](_0x560005[_0x27fd('0x33')],function(_0x425aed){var _0x44bbfa={};_0x44bbfa[_0x425aed]={'$like':'%'+_0xa26b1c[_0x27fd('0x30')][_0x27fd('0x3c')]+'%'};return _0x44bbfa;})});}_0x560005=_[_0x27fd('0x3a')]({},_0x560005,_0xa26b1c[_0x27fd('0x3d')]);return _0x7d0f1[_0x27fd('0x53')](_0x560005);}})[_0x27fd('0x26')](function(_0x30ebe2){if(_0x30ebe2){_0x5e0dc5=_0x30ebe2['length'];if(!_0xa26b1c[_0x27fd('0x30')][_0x27fd('0x55')](_0x27fd('0x36'))){_0x560005[_0x27fd('0x21')]=qs[_0x27fd('0x21')](_0xa26b1c[_0x27fd('0x30')][_0x27fd('0x21')]);_0x560005[_0x27fd('0x1e')]=qs['offset'](_0xa26b1c[_0x27fd('0x30')][_0x27fd('0x1e')]);}return _0x7d0f1[_0x27fd('0x53')](_0x560005);}})['then'](function(_0x396b4c){if(_0x396b4c){return _0x396b4c?{'count':_0x5e0dc5,'rows':_0x396b4c}:null;}})[_0x27fd('0x26')](respondWithResult(_0x222e8d,null))[_0x27fd('0x41')](handleError(_0x222e8d,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index eb9b51b..f730a08 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 _0x4e68=['moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','cm_companies','lodash','util','../../config/logger','api'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x4e68,0xd4));var _0x84e6=function(_0x2937d4,_0x3b5932){_0x2937d4=_0x2937d4-0x0;var _0x8917b9=_0x4e68[_0x2937d4];return _0x8917b9;};'use strict';var _=require(_0x84e6('0x0'));var util=require(_0x84e6('0x1'));var logger=require(_0x84e6('0x2'))(_0x84e6('0x3'));var moment=require(_0x84e6('0x4'));var BPromise=require(_0x84e6('0x5'));var rp=require(_0x84e6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x84e6('0x7'));var config=require(_0x84e6('0x8'));var attributes=require('./cmCompany.attributes');module[_0x84e6('0x9')]=function(_0x4534ac,_0x1be97d){return _0x4534ac[_0x84e6('0xa')]('CmCompany',attributes,{'tableName':_0x84e6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xb202=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger'];(function(_0x56801d,_0x4a7cef){var _0x4d7a9a=function(_0x34f06b){while(--_0x34f06b){_0x56801d['push'](_0x56801d['shift']());}};_0x4d7a9a(++_0x4a7cef);}(_0xb202,0x77));var _0x2b20=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb202[_0x38a7ac];return _0x53061a;};'use strict';var _=require('lodash');var util=require(_0x2b20('0x0'));var logger=require(_0x2b20('0x1'))(_0x2b20('0x2'));var moment=require(_0x2b20('0x3'));var BPromise=require(_0x2b20('0x4'));var rp=require(_0x2b20('0x5'));var fs=require('fs');var path=require(_0x2b20('0x6'));var rimraf=require(_0x2b20('0x7'));var config=require(_0x2b20('0x8'));var attributes=require('./cmCompany.attributes');module[_0x2b20('0x9')]=function(_0x401ce8,_0x47f5a8){return _0x401ce8[_0x2b20('0xa')]('CmCompany',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 6da21cc..f9103b8 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 _0xf9a3=['http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x179d19,_0x3f63fc){var _0x1ca47f=function(_0x42ef71){while(--_0x42ef71){_0x179d19['push'](_0x179d19['shift']());}};_0x1ca47f(++_0x3f63fc);}(_0xf9a3,0x16d));var _0x3f9a=function(_0x19a64d,_0x2159bd){_0x19a64d=_0x19a64d-0x0;var _0x10e885=_0xf9a3[_0x19a64d];return _0x10e885;};'use strict';var _=require(_0x3f9a('0x0'));var util=require(_0x3f9a('0x1'));var moment=require(_0x3f9a('0x2'));var BPromise=require(_0x3f9a('0x3'));var rs=require(_0x3f9a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3f9a('0x5'));var logger=require(_0x3f9a('0x6'))(_0x3f9a('0x7'));var config=require(_0x3f9a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3f9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x526865,_0x2e974b,_0x1b5fd4){return new BPromise(function(_0x220698,_0x43e9c7){return client[_0x3f9a('0xa')](_0x526865,_0x1b5fd4)[_0x3f9a('0xb')](function(_0x5e0b53){logger[_0x3f9a('0xc')](_0x3f9a('0xd'),_0x2e974b,_0x3f9a('0xe'));logger[_0x3f9a('0xf')](_0x3f9a('0x10'),_0x2e974b,_0x3f9a('0xe'),JSON[_0x3f9a('0x11')](_0x5e0b53));if(_0x5e0b53['error']){if(_0x5e0b53[_0x3f9a('0x12')][_0x3f9a('0x13')]===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x2e974b,_0x5e0b53[_0x3f9a('0x12')]['message']);return _0x43e9c7(_0x5e0b53[_0x3f9a('0x12')]['message']);}logger[_0x3f9a('0x12')](_0x3f9a('0xd'),_0x2e974b,_0x5e0b53['error'][_0x3f9a('0x14')]);return _0x220698(_0x5e0b53[_0x3f9a('0x12')]['message']);}else{logger[_0x3f9a('0xc')](_0x3f9a('0xd'),_0x2e974b,_0x3f9a('0xe'));_0x220698(_0x5e0b53['result']['message']);}})[_0x3f9a('0x15')](function(_0x4652a2){logger[_0x3f9a('0x12')](_0x3f9a('0xd'),_0x2e974b,_0x4652a2);_0x43e9c7(_0x4652a2);});});}
\ No newline at end of file
+var _0x00c6=['error','message','info','catch','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','request','CmCompany,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1992f1,_0x5c61f0){var _0x413dfe=function(_0x2136e5){while(--_0x2136e5){_0x1992f1['push'](_0x1992f1['shift']());}};_0x413dfe(++_0x5c61f0);}(_0x00c6,0x1a8));var _0x600c=function(_0x23d923,_0x2850db){_0x23d923=_0x23d923-0x0;var _0x469b7e=_0x00c6[_0x23d923];return _0x469b7e;};'use strict';var _=require(_0x600c('0x0'));var util=require('util');var moment=require(_0x600c('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x600c('0x2'));var db=require(_0x600c('0x3'))['db'];var utils=require(_0x600c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x600c('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x600c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x593221,_0x2c048c,_0x539001){return new BPromise(function(_0x268221,_0x2a7df7){return client[_0x600c('0x7')](_0x593221,_0x539001)['then'](function(_0x20514a){logger['info'](_0x600c('0x8'),_0x2c048c,_0x600c('0x9'));logger[_0x600c('0xa')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2c048c,_0x600c('0x9'),JSON['stringify'](_0x20514a));if(_0x20514a[_0x600c('0xb')]){if(_0x20514a[_0x600c('0xb')]['code']===0x1f4){logger['error']('CmCompany,\x20%s,\x20%s',_0x2c048c,_0x20514a[_0x600c('0xb')]['message']);return _0x2a7df7(_0x20514a[_0x600c('0xb')][_0x600c('0xc')]);}logger[_0x600c('0xb')](_0x600c('0x8'),_0x2c048c,_0x20514a[_0x600c('0xb')][_0x600c('0xc')]);return _0x268221(_0x20514a[_0x600c('0xb')][_0x600c('0xc')]);}else{logger[_0x600c('0xd')](_0x600c('0x8'),_0x2c048c,_0x600c('0x9'));_0x268221(_0x20514a['result'][_0x600c('0xc')]);}})[_0x600c('0xe')](function(_0xa4e625){logger[_0x600c('0xb')]('CmCompany,\x20%s,\x20%s',_0x2c048c,_0xa4e625);_0x2a7df7(_0xa4e625);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 93b76a9..8735013 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 _0x3366=['post','addContacts','put','update','delete','exports','multer','connect-timeout','express','Router','../../config/environment','./cmCompany.controller','isAuthenticated','/describe','get','/:id','show','/:id/contacts','getContacts'];(function(_0x74296,_0x113859){var _0x54497a=function(_0x2fe685){while(--_0x2fe685){_0x74296['push'](_0x74296['shift']());}};_0x54497a(++_0x113859);}(_0x3366,0x15c));var _0x6336=function(_0x9be28f,_0x231334){_0x9be28f=_0x9be28f-0x0;var _0xa9f52d=_0x3366[_0x9be28f];return _0xa9f52d;};'use strict';var multer=require(_0x6336('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6336('0x1'));var express=require(_0x6336('0x2'));var router=express[_0x6336('0x3')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6336('0x4'));var controller=require(_0x6336('0x5'));router['get']('/',auth[_0x6336('0x6')](),controller['index']);router['get'](_0x6336('0x7'),auth[_0x6336('0x6')](),controller['describe']);router[_0x6336('0x8')](_0x6336('0x9'),auth[_0x6336('0x6')](),controller[_0x6336('0xa')]);router[_0x6336('0x8')](_0x6336('0xb'),auth[_0x6336('0x6')](),controller[_0x6336('0xc')]);router[_0x6336('0xd')]('/',auth[_0x6336('0x6')](),controller['create']);router[_0x6336('0xd')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x6336('0xe')]);router[_0x6336('0xf')](_0x6336('0x9'),auth['isAuthenticated'](),controller[_0x6336('0x10')]);router[_0x6336('0x11')]('/:id',auth[_0x6336('0x6')](),controller['destroy']);module[_0x6336('0x12')]=router;
\ No newline at end of file
+var _0x4d63=['/:id/contacts','post','create','addContacts','put','update','delete','destroy','multer','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','/:id','show'];(function(_0x4b7730,_0x160b00){var _0x4f0285=function(_0xd1b8e1){while(--_0xd1b8e1){_0x4b7730['push'](_0x4b7730['shift']());}};_0x4f0285(++_0x160b00);}(_0x4d63,0xee));var _0x34d6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4d63[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x34d6('0x0'));var util=require('util');var path=require(_0x34d6('0x1'));var timeout=require('connect-timeout');var express=require(_0x34d6('0x2'));var router=express[_0x34d6('0x3')]();var fs_extra=require(_0x34d6('0x4'));var auth=require(_0x34d6('0x5'));var interaction=require(_0x34d6('0x6'));var config=require(_0x34d6('0x7'));var controller=require(_0x34d6('0x8'));router[_0x34d6('0x9')]('/',auth[_0x34d6('0xa')](),controller[_0x34d6('0xb')]);router[_0x34d6('0x9')](_0x34d6('0xc'),auth[_0x34d6('0xa')](),controller['describe']);router[_0x34d6('0x9')](_0x34d6('0xd'),auth[_0x34d6('0xa')](),controller[_0x34d6('0xe')]);router[_0x34d6('0x9')](_0x34d6('0xf'),auth['isAuthenticated'](),controller['getContacts']);router[_0x34d6('0x10')]('/',auth[_0x34d6('0xa')](),controller[_0x34d6('0x11')]);router[_0x34d6('0x10')](_0x34d6('0xf'),auth[_0x34d6('0xa')](),controller[_0x34d6('0x12')]);router[_0x34d6('0x13')](_0x34d6('0xd'),auth[_0x34d6('0xa')](),controller[_0x34d6('0x14')]);router[_0x34d6('0x15')](_0x34d6('0xd'),auth[_0x34d6('0xa')](),controller[_0x34d6('0x16')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 3a0062a..dcfb0de 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 _0xb1a9=['STRING','INTEGER','DATE','NOW','sequelize','exports'];(function(_0x577a6d,_0x2dde1){var _0x777ba3=function(_0xac806f){while(--_0xac806f){_0x577a6d['push'](_0x577a6d['shift']());}};_0x777ba3(++_0x2dde1);}(_0xb1a9,0x178));var _0x9b1a=function(_0xbc1a4b,_0x4dfbe4){_0xbc1a4b=_0xbc1a4b-0x0;var _0x108b87=_0xb1a9[_0xbc1a4b];return _0x108b87;};'use strict';var _=require('lodash');var Sequelize=require(_0x9b1a('0x0'));module[_0x9b1a('0x1')]={'firstName':{'type':Sequelize[_0x9b1a('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x9b1a('0x2')]},'street':{'type':Sequelize[_0x9b1a('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x9b1a('0x2')]},'country':{'type':Sequelize[_0x9b1a('0x2')]},'dateOfBirth':{'type':Sequelize[_0x9b1a('0x2')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0x9b1a('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x9b1a('0x2')]},'email':{'type':Sequelize[_0x9b1a('0x2')]},'url':{'type':Sequelize[_0x9b1a('0x2')]},'facebook':{'type':Sequelize[_0x9b1a('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9b1a('0x2')]},'skype':{'type':Sequelize[_0x9b1a('0x2')]},'teams':{'type':Sequelize[_0x9b1a('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0x9b1a('0x2')]},'wechat':{'type':Sequelize[_0x9b1a('0x2')]},'telegram':{'type':Sequelize[_0x9b1a('0x2')]},'UserId':{'type':Sequelize[_0x9b1a('0x3')]},'AdditionalPhones':{'type':Sequelize[_0x9b1a('0x2')]},'priority':{'type':Sequelize['INTEGER'](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9b1a('0x4')],'defaultValue':Sequelize[_0x9b1a('0x5')]},'dialTimezone':{'type':Sequelize[_0x9b1a('0x2')]},'utcOffset':{'type':Sequelize['INTEGER']}};
\ No newline at end of file
+var _0xd0a9=['INTEGER','UNSIGNED','DATE','lodash','sequelize','STRING','TEXT'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0xd0a9,0x15a));var _0x9d0a=function(_0x2ed8f3,_0x4aa12f){_0x2ed8f3=_0x2ed8f3-0x0;var _0x525a55=_0xd0a9[_0x2ed8f3];return _0x525a55;};'use strict';var _=require(_0x9d0a('0x0'));var Sequelize=require(_0x9d0a('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x9d0a('0x2')]},'street':{'type':Sequelize[_0x9d0a('0x2')]},'postalCode':{'type':Sequelize[_0x9d0a('0x2')]},'city':{'type':Sequelize[_0x9d0a('0x2')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x9d0a('0x3')]},'phone':{'type':Sequelize[_0x9d0a('0x2')]},'mobile':{'type':Sequelize[_0x9d0a('0x2')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9d0a('0x2')]},'url':{'type':Sequelize[_0x9d0a('0x2')]},'facebook':{'type':Sequelize[_0x9d0a('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x9d0a('0x2')]},'skype':{'type':Sequelize[_0x9d0a('0x2')]},'teams':{'type':Sequelize[_0x9d0a('0x2')]},'viber':{'type':Sequelize[_0x9d0a('0x2')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x9d0a('0x2')]},'telegram':{'type':Sequelize[_0x9d0a('0x2')]},'UserId':{'type':Sequelize[_0x9d0a('0x4')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x9d0a('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x9d0a('0x6')],'defaultValue':Sequelize['NOW']},'dialTimezone':{'type':Sequelize[_0x9d0a('0x2')]},'utcOffset':{'type':Sequelize[_0x9d0a('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index cd8790f..66bffc8 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 _0xb2cb=['from','[CmContact][merge][destroy][CmHopper],\x20%s','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperHistory','ReportAgentPreview','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','isNil','dialTimezone','utcOffset','timezones','additionalPhones','bulkCreate','each','duplicates','$or','spread','contact','Tag','color','ContactItemType','literal','Phones.OrderBy','$and','format','cf_%d','omit','table','setFields','id\x20=\x20?','toParam','phone','getTags','rawAttributes','pick','setTags','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','CmHopper','item','PHONE','ItemType','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','fromContactId','CmContactId','toContactId','rescheduleAdditionalPhones','hopperId','getHoppers','ContactId','includeAll','include','options','rows','getHopperFinals','CmHopperFinal','uploadCsv','No\x20ListId\x20specified','binding_keys','binding_values','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','filename','chmodSync','0777','child_process','fork','pid','upload','createReadStream','parse','meta','binding','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','importUpdates','../../components/import/cm/csvUpdates','getJourney','mail','chat','sms','fax','whatsapp','channel','toLowerCase','Invalid\x20channel','range','Invalid\x20date\x20for\x20range\x20from\x20filter','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter','voice','uniqueid','source','starttime','endtime','duration','note','userThirdDisposition','UserId','fullname','createdAt','VoiceCallReport','findAndCountAll','startCase','Account','closed','closedAt','disposition','secondDisposition','thirdDisposition','key','Owner','browserName','deviceModel','osName','ratingType','ratingValue','referer','subject','openchannel','externalUrl','threadId','sortBy','moment','bluebird','util','path','lodash','squel','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../config/environment/shared','../../mysqldb','redis','defaults','localhost','register','status','json','offset','undefined','limit','count','set','Content-Range','update','then','destroy','sendStatus','error','stack','name','send','index','CmContact','describe','keys','startsWith','cf_','CmCustomField','findOne','trimStart','all','length','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','sort','where','select','field','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','search','parseSearch','sqlOperator','conditions','find','value','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','DATE','buildExpression','text','start','end','map','hasOwnProperty','Contact','push','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','forEach','filter','replace','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','isNumeric','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','clone','order','DESC','having','t.id\x20IN\x20?','resolve','user','role','agent','some','c.ListId\x20IS\x20NULL','toString','sequelize','merge','c.firstName','c.lastName','c.phone','c.email','c.ListId','c.deletedAt','c.CompanyId','GROUP_CONCAT(DISTINCT\x20t.id)','Tags','TagIds','catch','params','tags','columnName','displayName','alias','custom','values','findAll','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s'];(function(_0x2b0690,_0x4f742f){var _0x82be1=function(_0x1e1084){while(--_0x1e1084){_0x2b0690['push'](_0x2b0690['shift']());}};_0x82be1(++_0x4f742f);}(_0xb2cb,0xa2));var _0xbb2c=function(_0x172948,_0x4262cc){_0x172948=_0x172948-0x0;var _0x4aeaa9=_0xb2cb[_0x172948];return _0x4aeaa9;};'use strict';var moment=require(_0xbb2c('0x0'));var BPromise=require(_0xbb2c('0x1'));var util=require(_0xbb2c('0x2'));var path=require(_0xbb2c('0x3'));var fs=require('fs');var _=require(_0xbb2c('0x4'));var squel=require(_0xbb2c('0x5'));var Papa=require(_0xbb2c('0x6'));var Redis=require(_0xbb2c('0x7'));var qs=require(_0xbb2c('0x8'));var as=require(_0xbb2c('0x9'));var logger=require('../../config/logger')(_0xbb2c('0xa'));var config=require(_0xbb2c('0xb'));var shared=require(_0xbb2c('0xc'));var db=require(_0xbb2c('0xd'))['db'];config[_0xbb2c('0xe')]=_[_0xbb2c('0xf')](config['redis'],{'host':_0xbb2c('0x10'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbb2c('0xe')]));require('./cmContact.socket')[_0xbb2c('0x11')](socket);function respondWithResult(_0x2749d3,_0x4cce4b){_0x4cce4b=_0x4cce4b||0xc8;return function(_0x5ed0d6){if(_0x5ed0d6){return _0x2749d3[_0xbb2c('0x12')](_0x4cce4b)[_0xbb2c('0x13')](_0x5ed0d6);}};}function respondWithFilteredResult(_0x576659,_0x52195f){return function(_0x5a034f){if(_0x5a034f){var _0x285231=typeof _0x52195f[_0xbb2c('0x14')]===_0xbb2c('0x15')&&typeof _0x52195f[_0xbb2c('0x16')]===_0xbb2c('0x15');var _0x297857=_0x5a034f[_0xbb2c('0x17')];var _0x370d13=_0x285231?0x0:_0x52195f['offset'];var _0x2adbe2=_0x285231?_0x5a034f[_0xbb2c('0x17')]:_0x52195f[_0xbb2c('0x14')]+_0x52195f['limit'];var _0x291b7d;if(_0x2adbe2>=_0x297857){_0x2adbe2=_0x297857;_0x291b7d=0xc8;}else{_0x291b7d=0xce;}_0x576659['status'](_0x291b7d);return _0x576659[_0xbb2c('0x18')](_0xbb2c('0x19'),_0x370d13+'-'+_0x2adbe2+'/'+_0x297857)[_0xbb2c('0x13')](_0x5a034f);}return null;};}function saveUpdates(_0x51b088){return function(_0x9d1bf1){if(_0x9d1bf1){return _0x9d1bf1[_0xbb2c('0x1a')](_0x51b088)[_0xbb2c('0x1b')](function(_0x2667ff){return _0x2667ff;});}return null;};}function removeEntity(_0x10c77d){return function(_0x1eaba3){if(_0x1eaba3){return _0x1eaba3[_0xbb2c('0x1c')]()[_0xbb2c('0x1b')](function(){_0x10c77d[_0xbb2c('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a13b7){return function(_0x386ff5){if(!_0x386ff5){_0x1a13b7[_0xbb2c('0x1d')](0x194);}return _0x386ff5;};}function handleError(_0x5d331d,_0x27baed){_0x27baed=_0x27baed||0x1f4;return function(_0x396bc7){logger[_0xbb2c('0x1e')](_0x396bc7[_0xbb2c('0x1f')]);if(_0x396bc7[_0xbb2c('0x20')]){delete _0x396bc7[_0xbb2c('0x20')];}_0x5d331d['status'](_0x27baed)[_0xbb2c('0x21')](_0x396bc7);};}exports[_0xbb2c('0x22')]=function(_0x6877c0,_0x3bc232){var _0x3fca6b={},_0x2f441b={},_0x11764b={'count':0x0,'rows':[]};return db[_0xbb2c('0x23')][_0xbb2c('0x24')]()[_0xbb2c('0x1b')](function(_0x904047){var _0x90b144=[];for(var _0x2fd615=0x0;_0x2fd615
','Attachments','Title','generateXOAuth2Token','user=','toString','base64','moment','randomstring','path','util','../../../config/environment','head','value','address','generate','@xcally.com','name','indexOf','split','length','slice','join','Anonymous','pop','isEmpty','anonymous','html','test','replace','includes','\x20[Attachment:\x20'];(function(_0x3dc587,_0x2ebc6c){var _0x29f93a=function(_0x5ab3d4){while(--_0x5ab3d4){_0x3dc587['push'](_0x3dc587['shift']());}};_0x29f93a(++_0x2ebc6c);}(_0x9afc,0x73));var _0xc9af=function(_0x4aa2c9,_0x3c74e5){_0x4aa2c9=_0x4aa2c9-0x0;var _0x212e33=_0x9afc[_0x4aa2c9];return _0x212e33;};'use strict';var _=require('lodash');var moment=require(_0xc9af('0x0'));var random=require(_0xc9af('0x1'));var fs=require('fs');var path=require(_0xc9af('0x2'));var util=require(_0xc9af('0x3'));var tnef=require('node-tnef');var logger=require('../../../config/logger')('email');var config=require(_0xc9af('0x4'));function getAddress(_0x6714ca){var _0x230a09=_[_0xc9af('0x5')](_0x6714ca[_0xc9af('0x6')]);return _0x230a09&&_0x230a09[_0xc9af('0x7')]?_0x230a09[_0xc9af('0x7')]:'anonymous'+random[_0xc9af('0x8')](0x6)+_0xc9af('0x9');}function getFirstName(_0x412d57){var _0x404973=_['head'](_0x412d57['value']);if(_0x404973&&_0x404973[_0xc9af('0xa')]){if(_0x404973[_0xc9af('0xa')]==_0x404973[_0xc9af('0x7')]){return _0x404973['name']['substring'](0x0,_0x404973[_0xc9af('0xa')][_0xc9af('0xb')]('@'));}var _0x632dcf=_0x404973['name'][_0xc9af('0xc')](/\s+/);return _0x632dcf[_0xc9af('0xd')]>0x1?_0x632dcf[_0xc9af('0xe')](0x0,-0x1)[_0xc9af('0xf')]('\x20'):_0x404973[_0xc9af('0xa')];}return _0xc9af('0x10');}function getLastName(_0x342bfd){var _0x1a1f9e=_[_0xc9af('0x5')](_0x342bfd['value']);if(_0x1a1f9e&&_0x1a1f9e['name']){var _0x7e2718=_0x1a1f9e[_0xc9af('0xa')][_0xc9af('0xc')](/\s+/);return _0x7e2718[_0xc9af('0xd')]>0x1?_0x7e2718[_0xc9af('0x11')]():'';}return'';}function getMails(_0x3d7e70,_0x4ed329){var _0x133f2a='';for(var _0xc25134=0x0;_0xc25134<_0x4ed329['value']['length'];_0xc25134+=0x1){if(_0x4ed329[_0xc9af('0x6')][_0xc25134]['address']!==_0x3d7e70){if(!_[_0xc9af('0x12')](_0x133f2a)){_0x133f2a+=',';}_0x133f2a+=_0x4ed329[_0xc9af('0x6')][_0xc25134][_0xc9af('0xa')]||_0x4ed329[_0xc9af('0x6')][_0xc25134]['address']||'';_0x133f2a+='\x20<';_0x133f2a+=_0x4ed329[_0xc9af('0x6')][_0xc25134][_0xc9af('0x7')]?_0x4ed329['value'][_0xc25134][_0xc9af('0x7')]:_0xc9af('0x13')+random[_0xc9af('0x8')](0x6)+_0xc9af('0x9');_0x133f2a+='>';}}return _0x133f2a;}function parseEmail(_0x4bd570,_0x231408,_0x3d47ff){if(_0x231408[_0xc9af('0x14')]){var _0x2fd877=/