From: support
Date: Mon, 2 May 2022 09:28:23 +0000 (+0000)
Subject: Built motion from commit ddad7253.|2.6.9
X-Git-Url: http://repos.xcallymotion.com/base//%22angular-material.themes.css/%22?a=commitdiff_plain;h=a158bba4beca277a437aa976926bd9f86b8696ec;p=motion2.git
Built motion from commit ddad7253.|2.6.9
---
diff --git a/apidoc/api_project.js b/apidoc/api_project.js
index 1481de0..66675e6 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-05-02T08:25:41.072Z",
+ "time": "2022-05-02T09:20:28.352Z",
"url": "http://apidocjs.com",
"version": "0.24.0"
}
diff --git a/apidoc/api_project.json b/apidoc/api_project.json
index 25be963..217c7ea 100644
--- a/apidoc/api_project.json
+++ b/apidoc/api_project.json
@@ -17,7 +17,7 @@
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
- "time": "2022-05-02T08:25:41.072Z",
+ "time": "2022-05-02T09:20:28.352Z",
"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 d656fd0..1f7bf97 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 _0xbda9=['getDataValue','action','STRING','contactManager','integration','jscripty','urlForward','browser','script','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','urlForward[headers],\x20browser[wsindowHeight]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL'];(function(_0x5c364d,_0x34f589){var _0xe70993=function(_0xa0c937){while(--_0xa0c937){_0x5c364d['push'](_0x5c364d['shift']());}};_0xe70993(++_0x34f589);}(_0xbda9,0x101));var _0x9bda=function(_0x13c70c,_0x546b34){_0x13c70c=_0x13c70c-0x0;var _0x50f0f2=_0xbda9[_0x13c70c];return _0x50f0f2;};'use strict';var Sequelize=require(_0x9bda('0x0'));module[_0x9bda('0x1')]={'name':{'type':Sequelize[_0x9bda('0x2')],'get':function(_0x203d94){return this[_0x9bda('0x3')](_0x9bda('0x4'));}},'action':{'type':Sequelize[_0x9bda('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x9bda('0x6'),_0x9bda('0x7'),'motionbar',_0x9bda('0x8'),_0x9bda('0x9'),_0x9bda('0xa'),'bot',_0x9bda('0xb')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'},'data1':{'type':Sequelize[_0x9bda('0x5')](0x1000),'comment':_0x9bda('0xc')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x9bda('0xd')},'data3':{'type':Sequelize[_0x9bda('0x5')](0x1000),'comment':_0x9bda('0xe')},'data4':{'type':Sequelize[_0x9bda('0x5')](0x1000),'comments':_0x9bda('0xf')},'data5':{'type':Sequelize[_0x9bda('0x5')](0x1000),'comments':_0x9bda('0x10')},'data6':{'type':Sequelize['STRING'],'comments':_0x9bda('0x11')},'data7':{'type':Sequelize[_0x9bda('0x12')],'comments':_0x9bda('0x13')}};
\ No newline at end of file
+var _0x9096=['motionbar','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','jscripty[ProjectId],\x20browser[type(0=Popup,1=CTI\x20URL)],\x20contactManager[ListId],\x20urlForward[type(GET,POST,PUT,DELETE)],\x20script[info],\x20integration[intName(desk,dynamics365,freshdesk,freshsales,salesforce,sugarcrm,vtiger,zendesk,zoho)],\x20motionbar[type(0=Popup,1=CTI\x20URL,2=WinApp)]','contactManager[autoCreate(0=No,1=Yes)],\x20urlForward[URL],\x20script[type],\x20integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20browser[TemplateId,URL]','contactManager[searchFields],\x20script[script],\x20integration[ConfigurationId],\x20motionbar[NULL,eventVariables(0=No,1=Yes),WinAppArguments],\x20browser[NULL,eventVariables(0=No,1=Yes)]','urlForward[timeout],\x20browser[windowWidth],\x20contactManager[ignoreDialerContactId]','TEXT','urlForward[body]','sequelize','exports','VIRTUAL','getDataValue','action','contactManager'];(function(_0x505e56,_0x310801){var _0x2e2a22=function(_0x23f438){while(--_0x23f438){_0x505e56['push'](_0x505e56['shift']());}};_0x2e2a22(++_0x310801);}(_0x9096,0x174));var _0x6909=function(_0x478f05,_0x2439b3){_0x478f05=_0x478f05-0x0;var _0x299201=_0x9096[_0x478f05];return _0x299201;};'use strict';var Sequelize=require(_0x6909('0x0'));module[_0x6909('0x1')]={'name':{'type':Sequelize[_0x6909('0x2')],'get':function(_0x44ff5b){return this[_0x6909('0x3')](_0x6909('0x4'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x6909('0x5'),'integration',_0x6909('0x6'),_0x6909('0x7'),_0x6909('0x8'),'browser','bot',_0x6909('0x9')]],'msg':_0x6909('0xa')}},'comment':_0x6909('0xa')},'data1':{'type':Sequelize[_0x6909('0xb')](0x1000),'comment':_0x6909('0xc')},'data2':{'type':Sequelize[_0x6909('0xb')](0x1000),'comment':_0x6909('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':_0x6909('0xe')},'data4':{'type':Sequelize[_0x6909('0xb')](0x1000),'comments':'browser[location(0=NewTab,1=NewWindow,2=MotionTab)],\x20contactManager[autoCreateField]'},'data5':{'type':Sequelize[_0x6909('0xb')](0x1000),'comments':_0x6909('0xf')},'data6':{'type':Sequelize[_0x6909('0xb')],'comments':'urlForward[headers],\x20browser[wsindowHeight]'},'data7':{'type':Sequelize[_0x6909('0x10')],'comments':_0x6909('0x11')}};
\ No newline at end of file
diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js
index 703095e..3894f29 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 _0x0341=['sendStatus','status','offset','undefined','limit','count','set','Content-Range','apply','reject','update','destroy','then','end','error','stack','name','send','body','Action','find','params','catch','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/license/util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0341,0x17f));var _0x1034=function(_0x371adf,_0x4f537d){_0x371adf=_0x371adf-0x0;var _0x552c62=_0x0341[_0x371adf];return _0x552c62;};'use strict';var emlformat=require(_0x1034('0x0'));var rimraf=require(_0x1034('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1034('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1034('0x3'));var Mustache=require(_0x1034('0x4'));var util=require(_0x1034('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x1034('0x6'));var ejs=require(_0x1034('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x1034('0x8'));var squel=require(_0x1034('0x9'));var crypto=require(_0x1034('0xa'));var jsforce=require(_0x1034('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x1034('0x6'));var querystring=require(_0x1034('0xc'));var Papa=require(_0x1034('0xd'));var Redis=require(_0x1034('0xe'));var authService=require(_0x1034('0xf'));var qs=require(_0x1034('0x10'));var as=require(_0x1034('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1034('0x12'))(_0x1034('0x13'));var utils=require(_0x1034('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0x1034('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4d7528,_0x23ccdb){_0x23ccdb=_0x23ccdb||0xcc;return function(_0x44fe2d){if(_0x44fe2d){return _0x4d7528[_0x1034('0x16')](_0x23ccdb);}return _0x4d7528[_0x1034('0x17')](_0x23ccdb)['end']();};}function respondWithResult(_0x39b8de,_0x5551e3){_0x5551e3=_0x5551e3||0xc8;return function(_0x157066){if(_0x157066){return _0x39b8de[_0x1034('0x17')](_0x5551e3)['json'](_0x157066);}};}function respondWithFilteredResult(_0x30c91,_0x3c08e5){return function(_0x109b2b){if(_0x109b2b){var _0x41bd6c=typeof _0x3c08e5[_0x1034('0x18')]===_0x1034('0x19')&&typeof _0x3c08e5[_0x1034('0x1a')]==='undefined';var _0x1b33cb=_0x109b2b[_0x1034('0x1b')];var _0x1fab03=_0x41bd6c?0x0:_0x3c08e5[_0x1034('0x18')];var _0x50eee7=_0x41bd6c?_0x109b2b[_0x1034('0x1b')]:_0x3c08e5[_0x1034('0x18')]+_0x3c08e5[_0x1034('0x1a')];var _0x490878;if(_0x50eee7>=_0x1b33cb){_0x50eee7=_0x1b33cb;_0x490878=0xc8;}else{_0x490878=0xce;}_0x30c91[_0x1034('0x17')](_0x490878);return _0x30c91[_0x1034('0x1c')](_0x1034('0x1d'),_0x1fab03+'-'+_0x50eee7+'/'+_0x1b33cb)['json'](_0x109b2b);}return null;};}function patchUpdates(_0x567937){return function(_0x1cd552){try{jsonpatch[_0x1034('0x1e')](_0x1cd552,_0x567937,!![]);}catch(_0x5da967){return BPromise[_0x1034('0x1f')](_0x5da967);}return _0x1cd552['save']();};}function saveUpdates(_0x314465,_0x2068d8){return function(_0x33a6e9){if(_0x33a6e9){return _0x33a6e9[_0x1034('0x20')](_0x314465)['then'](function(_0x3f4571){return _0x3f4571;});}return null;};}function removeEntity(_0x24815f,_0x5ae46b){return function(_0x53d2e3){if(_0x53d2e3){return _0x53d2e3[_0x1034('0x21')]()[_0x1034('0x22')](function(){_0x24815f[_0x1034('0x17')](0xcc)[_0x1034('0x23')]();});}};}function handleEntityNotFound(_0x57bbff,_0x3aec98){return function(_0x41fd6d){if(!_0x41fd6d){_0x57bbff[_0x1034('0x16')](0x194);}return _0x41fd6d;};}function handleError(_0x5543ee,_0x558b72){_0x558b72=_0x558b72||0x1f4;return function(_0x5e384b){logger[_0x1034('0x24')](_0x5e384b[_0x1034('0x25')]);if(_0x5e384b[_0x1034('0x26')]){delete _0x5e384b[_0x1034('0x26')];}_0x5543ee['status'](_0x558b72)[_0x1034('0x27')](_0x5e384b);};}exports[_0x1034('0x20')]=function(_0x94094e,_0x11a195){if(_0x94094e[_0x1034('0x28')]['id']){delete _0x94094e['body']['id'];}return db[_0x1034('0x29')][_0x1034('0x2a')]({'where':{'id':_0x94094e[_0x1034('0x2b')]['id']}})[_0x1034('0x22')](handleEntityNotFound(_0x11a195,null))[_0x1034('0x22')](saveUpdates(_0x94094e[_0x1034('0x28')],null))[_0x1034('0x22')](respondWithResult(_0x11a195,null))[_0x1034('0x2c')](handleError(_0x11a195,null));};exports[_0x1034('0x21')]=function(_0x1419c4,_0xd4ea60){return db[_0x1034('0x29')][_0x1034('0x2a')]({'where':{'id':_0x1419c4[_0x1034('0x2b')]['id']}})['then'](handleEntityNotFound(_0xd4ea60,null))[_0x1034('0x22')](removeEntity(_0xd4ea60,null))[_0x1034('0x2c')](handleError(_0xd4ea60,null));};
\ No newline at end of file
+var _0x6856=['status','json','offset','undefined','count','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','send','body','Action','params','then','catch','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','fs-extra','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','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6856,0x14f));var _0x6685=function(_0xdca98f,_0x32451a){_0xdca98f=_0xdca98f-0x0;var _0xebea52=_0x6856[_0xdca98f];return _0xebea52;};'use strict';var emlformat=require(_0x6685('0x0'));var rimraf=require(_0x6685('0x1'));var zipdir=require(_0x6685('0x2'));var jsonpatch=require(_0x6685('0x3'));var rp=require(_0x6685('0x4'));var moment=require(_0x6685('0x5'));var BPromise=require(_0x6685('0x6'));var Mustache=require(_0x6685('0x7'));var util=require(_0x6685('0x8'));var path=require(_0x6685('0x9'));var sox=require(_0x6685('0xa'));var csv=require('to-csv');var ejs=require(_0x6685('0xb'));var fs=require('fs');var fs_extra=require(_0x6685('0xc'));var _=require(_0x6685('0xd'));var squel=require(_0x6685('0xe'));var crypto=require(_0x6685('0xf'));var jsforce=require(_0x6685('0x10'));var deskjs=require(_0x6685('0x11'));var toCsv=require(_0x6685('0x12'));var querystring=require(_0x6685('0x13'));var Papa=require('papaparse');var Redis=require(_0x6685('0x14'));var authService=require(_0x6685('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x6685('0x16'));var hardwareService=require(_0x6685('0x17'));var logger=require(_0x6685('0x18'))(_0x6685('0x19'));var utils=require(_0x6685('0x1a'));var config=require(_0x6685('0x1b'));var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xb91dbf,_0x1fbde6){_0x1fbde6=_0x1fbde6||0xcc;return function(_0x138c50){if(_0x138c50){return _0xb91dbf[_0x6685('0x1c')](_0x1fbde6);}return _0xb91dbf[_0x6685('0x1d')](_0x1fbde6)['end']();};}function respondWithResult(_0x133fa8,_0x37fa13){_0x37fa13=_0x37fa13||0xc8;return function(_0x30a8e3){if(_0x30a8e3){return _0x133fa8['status'](_0x37fa13)[_0x6685('0x1e')](_0x30a8e3);}};}function respondWithFilteredResult(_0x84fbf5,_0x2bd51e){return function(_0x380070){if(_0x380070){var _0x494d67=typeof _0x2bd51e[_0x6685('0x1f')]===_0x6685('0x20')&&typeof _0x2bd51e['limit']===_0x6685('0x20');var _0xc11c9d=_0x380070[_0x6685('0x21')];var _0x110cbb=_0x494d67?0x0:_0x2bd51e['offset'];var _0x1ec653=_0x494d67?_0x380070[_0x6685('0x21')]:_0x2bd51e[_0x6685('0x1f')]+_0x2bd51e[_0x6685('0x22')];var _0xec4d9c;if(_0x1ec653>=_0xc11c9d){_0x1ec653=_0xc11c9d;_0xec4d9c=0xc8;}else{_0xec4d9c=0xce;}_0x84fbf5['status'](_0xec4d9c);return _0x84fbf5[_0x6685('0x23')](_0x6685('0x24'),_0x110cbb+'-'+_0x1ec653+'/'+_0xc11c9d)[_0x6685('0x1e')](_0x380070);}return null;};}function patchUpdates(_0x15b1bd){return function(_0x4bf6ef){try{jsonpatch[_0x6685('0x25')](_0x4bf6ef,_0x15b1bd,!![]);}catch(_0x1e6523){return BPromise[_0x6685('0x26')](_0x1e6523);}return _0x4bf6ef[_0x6685('0x27')]();};}function saveUpdates(_0x28b8fe,_0x395668){return function(_0x318e6b){if(_0x318e6b){return _0x318e6b[_0x6685('0x28')](_0x28b8fe)['then'](function(_0x342bb8){return _0x342bb8;});}return null;};}function removeEntity(_0x2eeb03,_0x1060ad){return function(_0x1c9363){if(_0x1c9363){return _0x1c9363[_0x6685('0x29')]()['then'](function(){_0x2eeb03['status'](0xcc)[_0x6685('0x2a')]();});}};}function handleEntityNotFound(_0x1e4bed,_0xa03b5){return function(_0x5b5410){if(!_0x5b5410){_0x1e4bed['sendStatus'](0x194);}return _0x5b5410;};}function handleError(_0xd8c80a,_0x5932c9){_0x5932c9=_0x5932c9||0x1f4;return function(_0x3477e2){logger[_0x6685('0x2b')](_0x3477e2[_0x6685('0x2c')]);if(_0x3477e2['name']){delete _0x3477e2['name'];}_0xd8c80a[_0x6685('0x1d')](_0x5932c9)[_0x6685('0x2d')](_0x3477e2);};}exports[_0x6685('0x28')]=function(_0x539d1c,_0x250e8b){if(_0x539d1c[_0x6685('0x2e')]['id']){delete _0x539d1c[_0x6685('0x2e')]['id'];}return db[_0x6685('0x2f')]['find']({'where':{'id':_0x539d1c[_0x6685('0x30')]['id']}})[_0x6685('0x31')](handleEntityNotFound(_0x250e8b,null))['then'](saveUpdates(_0x539d1c[_0x6685('0x2e')],null))['then'](respondWithResult(_0x250e8b,null))[_0x6685('0x32')](handleError(_0x250e8b,null));};exports[_0x6685('0x29')]=function(_0x5a2c9b,_0x58c130){return db[_0x6685('0x2f')][_0x6685('0x33')]({'where':{'id':_0x5a2c9b['params']['id']}})[_0x6685('0x31')](handleEntityNotFound(_0x58c130,null))[_0x6685('0x31')](removeEntity(_0x58c130,null))['catch'](handleError(_0x58c130,null));};
\ No newline at end of file
diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js
index 0d5a57a..815c5d8 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 _0x9037=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./action.attributes','exports','define','tools_actions','util'];(function(_0x215e7f,_0x11276f){var _0x2374c1=function(_0x4e4a59){while(--_0x4e4a59){_0x215e7f['push'](_0x215e7f['shift']());}};_0x2374c1(++_0x11276f);}(_0x9037,0xbf));var _0x7903=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9037[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x7903('0x0'));var logger=require('../../config/logger')(_0x7903('0x1'));var moment=require(_0x7903('0x2'));var BPromise=require(_0x7903('0x3'));var rp=require(_0x7903('0x4'));var fs=require('fs');var path=require(_0x7903('0x5'));var rimraf=require(_0x7903('0x6'));var config=require(_0x7903('0x7'));var attributes=require(_0x7903('0x8'));module[_0x7903('0x9')]=function(_0x3ac717,_0x3f13aa){return _0x3ac717[_0x7903('0xa')]('Action',attributes,{'tableName':_0x7903('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6881=['define','Action','tools_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./action.attributes','exports'];(function(_0xc587ed,_0x11cbc2){var _0x41d137=function(_0x2d288f){while(--_0x2d288f){_0xc587ed['push'](_0xc587ed['shift']());}};_0x41d137(++_0x11cbc2);}(_0x6881,0x1bd));var _0x1688=function(_0x200932,_0x250301){_0x200932=_0x200932-0x0;var _0x239ae8=_0x6881[_0x200932];return _0x239ae8;};'use strict';var _=require(_0x1688('0x0'));var util=require(_0x1688('0x1'));var logger=require(_0x1688('0x2'))(_0x1688('0x3'));var moment=require(_0x1688('0x4'));var BPromise=require(_0x1688('0x5'));var rp=require(_0x1688('0x6'));var fs=require('fs');var path=require(_0x1688('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1688('0x8'));module[_0x1688('0x9')]=function(_0x4c51ca,_0x5d70bb){return _0x4c51ca[_0x1688('0xa')](_0x1688('0xb'),attributes,{'tableName':_0x1688('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js
index 05e8115..664cc0c 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 _0x326f=['info','Action,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x209118,_0x1e6e18){var _0x5e4e47=function(_0x253f37){while(--_0x253f37){_0x209118['push'](_0x209118['shift']());}};_0x5e4e47(++_0x1e6e18);}(_0x326f,0xd1));var _0xf326=function(_0x468446,_0x545129){_0x468446=_0x468446-0x0;var _0x16f880=_0x326f[_0x468446];return _0x16f880;};'use strict';var _=require(_0xf326('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf326('0x1'));var rs=require(_0xf326('0x2'));var fs=require('fs');var Redis=require(_0xf326('0x3'));var db=require(_0xf326('0x4'))['db'];var utils=require(_0xf326('0x5'));var logger=require(_0xf326('0x6'))(_0xf326('0x7'));var config=require(_0xf326('0x8'));var jayson=require(_0xf326('0x9'));var client=jayson[_0xf326('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3c254d,_0x3851eb,_0x165f95){return new BPromise(function(_0x1e7b8a,_0x515bfa){return client['request'](_0x3c254d,_0x165f95)['then'](function(_0x3bacf2){logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));logger[_0xf326('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x3851eb,_0xf326('0xd'),JSON['stringify'](_0x3bacf2));if(_0x3bacf2[_0xf326('0xf')]){if(_0x3bacf2['error'][_0xf326('0x10')]===0x1f4){logger['error'](_0xf326('0xc'),_0x3851eb,_0x3bacf2[_0xf326('0xf')]['message']);return _0x515bfa(_0x3bacf2[_0xf326('0xf')][_0xf326('0x11')]);}logger[_0xf326('0xf')](_0xf326('0xc'),_0x3851eb,_0x3bacf2['error'][_0xf326('0x11')]);return _0x1e7b8a(_0x3bacf2['error']['message']);}else{logger[_0xf326('0xb')](_0xf326('0xc'),_0x3851eb,_0xf326('0xd'));_0x1e7b8a(_0x3bacf2[_0xf326('0x12')][_0xf326('0x11')]);}})[_0xf326('0x13')](function(_0x34128e){logger[_0xf326('0xf')]('Action,\x20%s,\x20%s',_0x3851eb,_0x34128e);_0x515bfa(_0x34128e);});});}
\ No newline at end of file
+var _0x5fc3=['../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','stringify','error','code','message','Action,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0x32e40d,_0x44c6aa){var _0x38a639=function(_0x56c203){while(--_0x56c203){_0x32e40d['push'](_0x32e40d['shift']());}};_0x38a639(++_0x44c6aa);}(_0x5fc3,0xa8));var _0x35fc=function(_0x13ce0c,_0x3f2a0d){_0x13ce0c=_0x13ce0c-0x0;var _0x4388fb=_0x5fc3[_0x13ce0c];return _0x4388fb;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x19a0d1,_0x508b32,_0x16e153){return new BPromise(function(_0x27524f,_0xc72d93){return client[_0x35fc('0xa')](_0x19a0d1,_0x16e153)[_0x35fc('0xb')](function(_0xf9d3a6){logger[_0x35fc('0xc')]('Action,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'));logger[_0x35fc('0xe')]('Action,\x20%s,\x20%s,\x20%s',_0x508b32,_0x35fc('0xd'),JSON[_0x35fc('0xf')](_0xf9d3a6));if(_0xf9d3a6['error']){if(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x11')]===0x1f4){logger['error']('Action,\x20%s,\x20%s',_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0xc72d93(_0xf9d3a6[_0x35fc('0x10')][_0x35fc('0x12')]);}logger[_0x35fc('0x10')](_0x35fc('0x13'),_0x508b32,_0xf9d3a6[_0x35fc('0x10')]['message']);return _0x27524f(_0xf9d3a6['error']['message']);}else{logger['info'](_0x35fc('0x13'),_0x508b32,_0x35fc('0xd'));_0x27524f(_0xf9d3a6[_0x35fc('0x14')][_0x35fc('0x12')]);}})[_0x35fc('0x15')](function(_0x1121fa){logger['error'](_0x35fc('0x13'),_0x508b32,_0x1121fa);_0xc72d93(_0x1121fa);});});}
\ No newline at end of file
diff --git a/server/api/action/index.js b/server/api/action/index.js
index b30a32d..4e785f7 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 _0x5ee5=['put','/:id','isAuthenticated','update','delete','destroy','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x5ee5,0x1aa));var _0x55ee=function(_0x223bdb,_0x5882e6){_0x223bdb=_0x223bdb-0x0;var _0xef8e68=_0x5ee5[_0x223bdb];return _0xef8e68;};'use strict';var multer=require(_0x55ee('0x0'));var util=require(_0x55ee('0x1'));var path=require('path');var timeout=require(_0x55ee('0x2'));var express=require(_0x55ee('0x3'));var router=express['Router']();var fs_extra=require(_0x55ee('0x4'));var auth=require(_0x55ee('0x5'));var interaction=require(_0x55ee('0x6'));var config=require(_0x55ee('0x7'));var controller=require(_0x55ee('0x8'));router[_0x55ee('0x9')](_0x55ee('0xa'),auth[_0x55ee('0xb')](),controller[_0x55ee('0xc')]);router[_0x55ee('0xd')](_0x55ee('0xa'),auth['isAuthenticated'](),controller[_0x55ee('0xe')]);module['exports']=router;
\ No newline at end of file
+var _0x7952=['./action.controller','put','update','delete','/:id','isAuthenticated','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../config/environment'];(function(_0x33ff87,_0x3455ee){var _0x5c9017=function(_0x4a8d60){while(--_0x4a8d60){_0x33ff87['push'](_0x33ff87['shift']());}};_0x5c9017(++_0x3455ee);}(_0x7952,0x1ca));var _0x2795=function(_0x33bcdb,_0x11846b){_0x33bcdb=_0x33bcdb-0x0;var _0x18a9bf=_0x7952[_0x33bcdb];return _0x18a9bf;};'use strict';var multer=require(_0x2795('0x0'));var util=require('util');var path=require(_0x2795('0x1'));var timeout=require(_0x2795('0x2'));var express=require(_0x2795('0x3'));var router=express[_0x2795('0x4')]();var fs_extra=require(_0x2795('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2795('0x6'));var controller=require(_0x2795('0x7'));router[_0x2795('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2795('0x9')]);router[_0x2795('0xa')](_0x2795('0xb'),auth[_0x2795('0xc')](),controller[_0x2795('0xd')]);module[_0x2795('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js
index 417d28a..948d7e8 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 _0xbd51=['sequelize','STRING'];(function(_0x5b95f2,_0x2adb49){var _0x376b33=function(_0x57c21b){while(--_0x57c21b){_0x5b95f2['push'](_0x5b95f2['shift']());}};_0x376b33(++_0x2adb49);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x224572,_0x40bf1a){_0x224572=_0x224572-0x0;var _0x498369=_0xbd51[_0x224572];return _0x498369;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0xdc97=['exports','STRING','TEXT','sequelize'];(function(_0x29c261,_0x3af39a){var _0x1a9335=function(_0x40d1e8){while(--_0x40d1e8){_0x29c261['push'](_0x29c261['shift']());}};_0x1a9335(++_0x3af39a);}(_0xdc97,0x13b));var _0x7dc9=function(_0x489b4a,_0x204f4a){_0x489b4a=_0x489b4a-0x0;var _0x596632=_0xdc97[_0x489b4a];return _0x596632;};'use strict';var Sequelize=require(_0x7dc9('0x0'));module[_0x7dc9('0x1')]={'name':{'type':Sequelize[_0x7dc9('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x7dc9('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x7dc9('0x3')]},'joins':{'type':Sequelize[_0x7dc9('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js
index 3c2a060..509acf8 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 _0xd5fc=['output','csv','custom','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','../../components/export/','../../files/reports','savename','countTable','runReport','COUNT(%s)','AVG(%s)','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','fs-extra','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','set','reject','update','then','destroy','get','CustomReports','UserProfileResource','end','stack','name','send','index','map','AnalyticCustomReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','Reports','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','join','left_join','right_join','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','table','MetricId','metric','format','replace','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','includes','IS\x20EMPTY','Sequelize','ValidationErrorItem','from','function','web','fullPath','%s-%s.%s'];(function(_0xe8dbd2,_0x11e2a8){var _0x46836c=function(_0x1b833c){while(--_0x1b833c){_0xe8dbd2['push'](_0xe8dbd2['shift']());}};_0x46836c(++_0x11e2a8);}(_0xd5fc,0xae));var _0xcd5f=function(_0x5b159e,_0x1a7b63){_0x5b159e=_0x5b159e-0x0;var _0x574d5b=_0xd5fc[_0x5b159e];return _0x574d5b;};'use strict';var emlformat=require(_0xcd5f('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcd5f('0x1'));var moment=require(_0xcd5f('0x2'));var BPromise=require(_0xcd5f('0x3'));var Mustache=require(_0xcd5f('0x4'));var util=require(_0xcd5f('0x5'));var path=require(_0xcd5f('0x6'));var sox=require('sox');var csv=require(_0xcd5f('0x7'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xcd5f('0x8'));var _=require(_0xcd5f('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcd5f('0xa'));var toCsv=require('to-csv');var querystring=require(_0xcd5f('0xb'));var Papa=require(_0xcd5f('0xc'));var Redis=require('ioredis');var authService=require(_0xcd5f('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xcd5f('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcd5f('0xf'))(_0xcd5f('0x10'));var utils=require(_0xcd5f('0x11'));var config=require(_0xcd5f('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0xcd5f('0x13'))['db'];var dbH=require(_0xcd5f('0x13'))['dbH'];function respondWithStatusCode(_0x14125f,_0x2c23a7){_0x2c23a7=_0x2c23a7||0xcc;return function(_0x2bebdd){if(_0x2bebdd){return _0x14125f[_0xcd5f('0x14')](_0x2c23a7);}return _0x14125f[_0xcd5f('0x15')](_0x2c23a7)['end']();};}function respondWithResult(_0x2ff7e1,_0x42b369){_0x42b369=_0x42b369||0xc8;return function(_0xc088a3){if(_0xc088a3){return _0x2ff7e1[_0xcd5f('0x15')](_0x42b369)[_0xcd5f('0x16')](_0xc088a3);}};}function respondWithFilteredResult(_0xb4503d,_0x29a1c8){return function(_0x503ab6){if(_0x503ab6){var _0x398e16=typeof _0x29a1c8[_0xcd5f('0x17')]===_0xcd5f('0x18')&&typeof _0x29a1c8[_0xcd5f('0x19')]==='undefined';var _0x1a4cb6=_0x503ab6['count'];var _0xb23761=_0x398e16?0x0:_0x29a1c8[_0xcd5f('0x17')];var _0x48d5bb=_0x398e16?_0x503ab6[_0xcd5f('0x1a')]:_0x29a1c8[_0xcd5f('0x17')]+_0x29a1c8['limit'];var _0x3a952b;if(_0x48d5bb>=_0x1a4cb6){_0x48d5bb=_0x1a4cb6;_0x3a952b=0xc8;}else{_0x3a952b=0xce;}_0xb4503d['status'](_0x3a952b);return _0xb4503d[_0xcd5f('0x1b')]('Content-Range',_0xb23761+'-'+_0x48d5bb+'/'+_0x1a4cb6)['json'](_0x503ab6);}return null;};}function patchUpdates(_0x152424){return function(_0x5e7a24){try{jsonpatch['apply'](_0x5e7a24,_0x152424,!![]);}catch(_0x5a26f2){return BPromise[_0xcd5f('0x1c')](_0x5a26f2);}return _0x5e7a24['save']();};}function saveUpdates(_0x154449,_0x3728e5){return function(_0x2c6a1b){if(_0x2c6a1b){return _0x2c6a1b[_0xcd5f('0x1d')](_0x154449)[_0xcd5f('0x1e')](function(_0x50d4c3){return _0x50d4c3;});}return null;};}function removeEntity(_0x388290,_0x41015c){return function(_0x4dc7ab){if(_0x4dc7ab){return _0x4dc7ab[_0xcd5f('0x1f')]()[_0xcd5f('0x1e')](function(){var _0x221adc=_0x4dc7ab[_0xcd5f('0x20')]({'plain':!![]});var _0x97fff9=_0xcd5f('0x21');return db[_0xcd5f('0x22')][_0xcd5f('0x1f')]({'where':{'type':_0x97fff9,'resourceId':_0x221adc['id']}})[_0xcd5f('0x1e')](function(){return _0x4dc7ab;});})[_0xcd5f('0x1e')](function(){_0x388290[_0xcd5f('0x15')](0xcc)[_0xcd5f('0x23')]();});}};}function handleEntityNotFound(_0x1051c3,_0x29857a){return function(_0x56a74a){if(!_0x56a74a){_0x1051c3[_0xcd5f('0x14')](0x194);}return _0x56a74a;};}function handleError(_0x3ae2f1,_0x561414){_0x561414=_0x561414||0x1f4;return function(_0xd7f50f){logger['error'](_0xd7f50f[_0xcd5f('0x24')]);if(_0xd7f50f[_0xcd5f('0x25')]){delete _0xd7f50f[_0xcd5f('0x25')];}_0x3ae2f1[_0xcd5f('0x15')](_0x561414)[_0xcd5f('0x26')](_0xd7f50f);};}exports[_0xcd5f('0x27')]=function(_0x57e5cf,_0x5955bb){var _0x116223={},_0x168d97={},_0x327260={'count':0x0,'rows':[]};var _0x10507f=_[_0xcd5f('0x28')](db[_0xcd5f('0x29')][_0xcd5f('0x2a')],function(_0x4b0eb8){return{'name':_0x4b0eb8[_0xcd5f('0x2b')],'type':_0x4b0eb8[_0xcd5f('0x2c')][_0xcd5f('0x2d')]};});_0x168d97[_0xcd5f('0x2e')]=_['map'](_0x10507f,_0xcd5f('0x25'));_0x168d97[_0xcd5f('0x2f')]=_[_0xcd5f('0x30')](_0x57e5cf['query']);_0x168d97[_0xcd5f('0x31')]=_[_0xcd5f('0x32')](_0x168d97[_0xcd5f('0x2e')],_0x168d97[_0xcd5f('0x2f')]);_0x116223[_0xcd5f('0x33')]=_[_0xcd5f('0x32')](_0x168d97[_0xcd5f('0x2e')],qs[_0xcd5f('0x34')](_0x57e5cf['query']['fields']));_0x116223[_0xcd5f('0x33')]=_0x116223['attributes'][_0xcd5f('0x35')]?_0x116223[_0xcd5f('0x33')]:_0x168d97[_0xcd5f('0x2e')];if(!_0x57e5cf['query'][_0xcd5f('0x36')](_0xcd5f('0x37'))){_0x116223[_0xcd5f('0x19')]=qs[_0xcd5f('0x19')](_0x57e5cf['query'][_0xcd5f('0x19')]);_0x116223['offset']=qs[_0xcd5f('0x17')](_0x57e5cf[_0xcd5f('0x2f')][_0xcd5f('0x17')]);}_0x116223[_0xcd5f('0x38')]=qs[_0xcd5f('0x39')](_0x57e5cf[_0xcd5f('0x2f')]['sort']);_0x116223[_0xcd5f('0x3a')]=qs['filters'](_[_0xcd5f('0x3b')](_0x57e5cf[_0xcd5f('0x2f')],_0x168d97[_0xcd5f('0x31')]),_0x10507f);if(_0x57e5cf['query'][_0xcd5f('0x3c')]){_0x116223[_0xcd5f('0x3a')]=_[_0xcd5f('0x3d')](_0x116223[_0xcd5f('0x3a')],{'$or':_[_0xcd5f('0x28')](_0x10507f,function(_0xcb04bf){if(_0xcb04bf[_0xcd5f('0x2c')]!=='VIRTUAL'){var _0x429db3={};_0x429db3[_0xcb04bf[_0xcd5f('0x25')]]={'$like':'%'+_0x57e5cf[_0xcd5f('0x2f')]['filter']+'%'};return _0x429db3;}})});}_0x116223=_['merge']({},_0x116223,_0x57e5cf[_0xcd5f('0x3e')]);var _0x555a85={'where':_0x116223[_0xcd5f('0x3a')]};return db[_0xcd5f('0x29')][_0xcd5f('0x1a')](_0x555a85)[_0xcd5f('0x1e')](function(_0x53d800){_0x327260[_0xcd5f('0x1a')]=_0x53d800;if(_0x57e5cf['query'][_0xcd5f('0x3f')]){_0x116223[_0xcd5f('0x40')]=[{'all':!![]}];}return db[_0xcd5f('0x29')]['findAll'](_0x116223);})[_0xcd5f('0x1e')](function(_0x1920da){_0x327260[_0xcd5f('0x41')]=_0x1920da;return _0x327260;})[_0xcd5f('0x1e')](respondWithFilteredResult(_0x5955bb,_0x116223))[_0xcd5f('0x42')](handleError(_0x5955bb,null));};exports[_0xcd5f('0x43')]=function(_0x223de4,_0x302ed7){var _0x295dd6={'raw':![],'where':{'id':_0x223de4['params']['id']}},_0x19fb5d={};_0x19fb5d['model']=_[_0xcd5f('0x30')](db[_0xcd5f('0x29')][_0xcd5f('0x2a')]);_0x19fb5d[_0xcd5f('0x2f')]=_['keys'](_0x223de4[_0xcd5f('0x2f')]);_0x19fb5d['filters']=_[_0xcd5f('0x32')](_0x19fb5d[_0xcd5f('0x2e')],_0x19fb5d[_0xcd5f('0x2f')]);_0x295dd6['attributes']=_['intersection'](_0x19fb5d[_0xcd5f('0x2e')],qs[_0xcd5f('0x34')](_0x223de4[_0xcd5f('0x2f')][_0xcd5f('0x34')]));_0x295dd6[_0xcd5f('0x33')]=_0x295dd6[_0xcd5f('0x33')][_0xcd5f('0x35')]?_0x295dd6[_0xcd5f('0x33')]:_0x19fb5d[_0xcd5f('0x2e')];if(_0x223de4['query']['includeAll']){_0x295dd6[_0xcd5f('0x40')]=[{'all':!![]}];}_0x295dd6=_[_0xcd5f('0x3d')]({},_0x295dd6,_0x223de4[_0xcd5f('0x3e')]);return db['AnalyticCustomReport'][_0xcd5f('0x44')](_0x295dd6)[_0xcd5f('0x1e')](handleEntityNotFound(_0x302ed7,null))[_0xcd5f('0x1e')](respondWithResult(_0x302ed7,null))[_0xcd5f('0x42')](handleError(_0x302ed7,null));};exports[_0xcd5f('0x45')]=function(_0x59fa3a,_0x183ac3){return db[_0xcd5f('0x29')][_0xcd5f('0x45')](_0x59fa3a[_0xcd5f('0x46')],{})[_0xcd5f('0x1e')](function(_0xf30d3d){var _0x3e4c92=_0x59fa3a['user']['get']({'plain':!![]});if(!_0x3e4c92)throw new Error(_0xcd5f('0x47'));if(_0x3e4c92['role']===_0xcd5f('0x48')){var _0x4c5a98=_0xf30d3d[_0xcd5f('0x20')]({'plain':!![]});var _0x3d05a9=_0xcd5f('0x49');return db[_0xcd5f('0x4a')][_0xcd5f('0x44')]({'where':{'name':_0x3d05a9,'userProfileId':_0x3e4c92['userProfileId']},'raw':!![]})[_0xcd5f('0x1e')](function(_0x3d856e){if(_0x3d856e&&_0x3d856e[_0xcd5f('0x4b')]===0x0){return db[_0xcd5f('0x22')][_0xcd5f('0x45')]({'name':_0x4c5a98['name'],'resourceId':_0x4c5a98['id'],'type':_0xcd5f('0x21'),'sectionId':_0x3d856e['id']},{})[_0xcd5f('0x1e')](function(){return _0xf30d3d;});}else{return _0xf30d3d;}})[_0xcd5f('0x42')](function(_0x4aa2c0){logger[_0xcd5f('0x4c')](_0xcd5f('0x4d'),_0x4aa2c0);throw _0x4aa2c0;});}return _0xf30d3d;})['then'](respondWithResult(_0x183ac3,0xc9))[_0xcd5f('0x42')](handleError(_0x183ac3,null));};exports[_0xcd5f('0x1d')]=function(_0xc8d6a,_0x8bc8d1){if(_0xc8d6a[_0xcd5f('0x46')]['id']){delete _0xc8d6a[_0xcd5f('0x46')]['id'];}return db[_0xcd5f('0x29')][_0xcd5f('0x44')]({'where':{'id':_0xc8d6a[_0xcd5f('0x4e')]['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x8bc8d1,null))[_0xcd5f('0x1e')](saveUpdates(_0xc8d6a[_0xcd5f('0x46')],null))[_0xcd5f('0x1e')](respondWithResult(_0x8bc8d1,null))['catch'](handleError(_0x8bc8d1,null));};exports['destroy']=function(_0x157c69,_0x4e269f){return db['AnalyticCustomReport'][_0xcd5f('0x44')]({'where':{'id':_0x157c69['params']['id']}})[_0xcd5f('0x1e')](handleEntityNotFound(_0x4e269f,null))[_0xcd5f('0x1e')](removeEntity(_0x4e269f,null))[_0xcd5f('0x42')](handleError(_0x4e269f,null));};exports['preview']=function(_0x356b97,_0x4da639){var _0x4a3c69=0xa;var _0x59943f=[_0xcd5f('0x4f'),_0xcd5f('0x50'),_0xcd5f('0x51'),'cross_join'];var _0x43b8a9={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xcd5f('0x52'),'MIN':_0xcd5f('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcd5f('0x54'),'GROUP_CONCAT ASC':_0xcd5f('0x55'),'GROUP_CONCAT DESC':_0xcd5f('0x56')};var _0x28078f={'SEC_TO_TIME':_0xcd5f('0x57'),'DATE':_0xcd5f('0x58'),'HOUR':_0xcd5f('0x59'),'ROUND':_0xcd5f('0x5a'),'UNIX_TIMESTAMP':_0xcd5f('0x5b')};var _0x3c9ae4=function(_0x4263ec){return!_['includes']([_0xcd5f('0x5c'),_0xcd5f('0x5d'),'IS\x20EMPTY',_0xcd5f('0x5e')],_0x4263ec);};var _0x1bb74b=function(_0x2c9eae){if(!_0x2c9eae||!_0x2c9eae[_0xcd5f('0x5f')][_0xcd5f('0x35')]){return'';}for(var _0x232b7f='(',_0x132636=0x0;_0x132636<_0x2c9eae[_0xcd5f('0x5f')][_0xcd5f('0x35')];_0x132636+=0x1){_0x132636>0x0&&(_0x232b7f+='\x20'+_0x2c9eae[_0xcd5f('0x60')]+'\x20');_0x232b7f+=_0x2c9eae['rules'][_0x132636]['group']?_0x1bb74b(_0x2c9eae[_0xcd5f('0x5f')][_0x132636][_0xcd5f('0x61')]):_0x2c9eae[_0xcd5f('0x5f')][_0x132636][_0xcd5f('0x62')]+'\x20'+_0x2c9eae[_0xcd5f('0x5f')][_0x132636][_0xcd5f('0x63')]+(_0x3c9ae4(_0x2c9eae[_0xcd5f('0x5f')][_0x132636][_0xcd5f('0x63')])?'\x20'+_0x2c9eae[_0xcd5f('0x5f')][_0x132636][_0xcd5f('0x64')]:'');}return _0x232b7f+')';};var _0x22dd4a={'where':{'id':_0x356b97[_0xcd5f('0x4e')]['id']}},_0x4b3f83,_0xe12197,_0x26339e,_0x241243,_0x441bfb;_0x22dd4a=_[_0xcd5f('0x3d')]({},_0x22dd4a,_0x356b97[_0xcd5f('0x3e')]);return db['AnalyticCustomReport'][_0xcd5f('0x44')](_0x22dd4a)[_0xcd5f('0x1e')](function(_0x16b4dc){if(_0x16b4dc){_0x4b3f83=_0x16b4dc;return _0x16b4dc[_0xcd5f('0x65')]();}return null;})[_0xcd5f('0x1e')](function(_0x31c395){if(_0x31c395){if(!_0x31c395[_0xcd5f('0x35')]){throw new db['Sequelize']['ValidationErrorItem'](_0xcd5f('0x66'),0x193);}_0xe12197=_0x31c395;return db[_0xcd5f('0x67')][_0xcd5f('0x68')]({'raw':!![]});}return null;})[_0xcd5f('0x1e')](function(_0x507c27){if(_0x507c27){_0x26339e=_[_0xcd5f('0x69')](_0x507c27,'id');var _0x523760;var _0x100531=squel[_0xcd5f('0x6a')]();_0x100531['from'](_0x4b3f83[_0xcd5f('0x6b')]);for(var _0x46dd28=0x0;_0x46dd28<_0xe12197[_0xcd5f('0x35')];_0x46dd28+=0x1){_0x523760=_0xe12197[_0x46dd28][_0xcd5f('0x6c')]?_0x26339e[_0xe12197[_0x46dd28][_0xcd5f('0x6c')]][_0xcd5f('0x6d')]:_0xe12197[_0x46dd28][_0xcd5f('0x62')];_0x523760=_0xe12197[_0x46dd28]['function']?_['replace'](_0x43b8a9[_0xe12197[_0x46dd28]['function']],'%s',_0x523760):_0x523760;_0x523760=_0xe12197[_0x46dd28][_0xcd5f('0x6e')]?_[_0xcd5f('0x6f')](_0x28078f[_0xe12197[_0x46dd28][_0xcd5f('0x6e')]],'%s',_0x523760):_0x523760;if(_0xe12197[_0x46dd28][_0xcd5f('0x70')]){_0x100531[_0xcd5f('0x61')](_0x523760);}_0xe12197[_0x46dd28][_0xcd5f('0x71')]&&_0x100531[_0xcd5f('0x38')](_0x523760,_0xe12197[_0x46dd28][_0xcd5f('0x71')]===_0xcd5f('0x72')?![]:!![]);_0x100531[_0xcd5f('0x62')](_0x523760,_0xe12197[_0x46dd28][_0xcd5f('0x73')]||_0x523760);}if(_0x4b3f83['joins']){_0x4b3f83[_0xcd5f('0x74')]=JSON[_0xcd5f('0x75')](_0x4b3f83[_0xcd5f('0x74')]);for(var _0x6365f3=0x0;_0x6365f3<_0x4b3f83[_0xcd5f('0x74')]['length'];_0x6365f3+=0x1){if(_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x2c')]&&_['includes'](_0x59943f,_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x2c')])&&_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x76')]&&_0x4b3f83['joins'][_0x6365f3]['foreignTable']&&_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x77')]){_0x100531[_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x2c')]](_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x78')],null,util[_0xcd5f('0x6e')](_0xcd5f('0x79'),_0x4b3f83[_0xcd5f('0x6b')],_0x4b3f83[_0xcd5f('0x74')][_0x6365f3]['parentKey'],_0x4b3f83[_0xcd5f('0x74')][_0x6365f3]['foreignTable'],_0x4b3f83[_0xcd5f('0x74')][_0x6365f3][_0xcd5f('0x77')]));}}}if(_0x4b3f83[_0xcd5f('0x7a')]){_0x4b3f83[_0xcd5f('0x7a')]=JSON[_0xcd5f('0x75')](_0x4b3f83['conditions']);_0x100531[_0xcd5f('0x3a')](_0x1bb74b(_0x4b3f83[_0xcd5f('0x7a')][_0xcd5f('0x61')]));}_0x441bfb=_0x100531[_0xcd5f('0x7b')]();_0x100531[_0xcd5f('0x19')](_0x4a3c69);_0x100531[_0xcd5f('0x17')](0x0);logger[_0xcd5f('0x7c')](_0xcd5f('0x7d'),_0x100531[_0xcd5f('0x7e')]());return dbH[_0xcd5f('0x7f')][_0xcd5f('0x2f')](_0x100531[_0xcd5f('0x7e')](),{'type':dbH[_0xcd5f('0x7f')][_0xcd5f('0x80')][_0xcd5f('0x81')]});}})[_0xcd5f('0x1e')](respondWithResult(_0x4da639,null))[_0xcd5f('0x42')](handleError(_0x4da639,null));};function runReport(_0x567382,_0x14817d,_0x45ea22){var _0x520147=_0x14817d[_0xcd5f('0x25')];var _0x4724cb=0xa;var _0x562e1e=['join',_0xcd5f('0x50'),'right_join',_0xcd5f('0x82')];var _0x4bbde9={'SUM':_0xcd5f('0x83'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcd5f('0x84'),'MAX':_0xcd5f('0x52'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xcd5f('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcd5f('0x56')};var _0x255955={'SEC_TO_TIME':_0xcd5f('0x57'),'DATE':'DATE(%s)','HOUR':_0xcd5f('0x59'),'ROUND':_0xcd5f('0x5a'),'UNIX_TIMESTAMP':_0xcd5f('0x5b')};var _0x526bcc=function(_0x5a5c91){return!_[_0xcd5f('0x85')]([_0xcd5f('0x5c'),'IS\x20NOT\x20NULL',_0xcd5f('0x86'),_0xcd5f('0x5e')],_0x5a5c91);};var _0x2fcafb=function(_0x3b9917){if(!_0x3b9917||!_0x3b9917[_0xcd5f('0x5f')][_0xcd5f('0x35')]){return'';}for(var _0x230a68='(',_0x3b89fc=0x0;_0x3b89fc<_0x3b9917[_0xcd5f('0x5f')][_0xcd5f('0x35')];_0x3b89fc+=0x1){_0x3b89fc>0x0&&(_0x230a68+='\x20'+_0x3b9917[_0xcd5f('0x60')]+'\x20');_0x230a68+=_0x3b9917['rules'][_0x3b89fc][_0xcd5f('0x61')]?_0x2fcafb(_0x3b9917[_0xcd5f('0x5f')][_0x3b89fc][_0xcd5f('0x61')]):_0x3b9917['rules'][_0x3b89fc]['field']+'\x20'+_0x3b9917[_0xcd5f('0x5f')][_0x3b89fc][_0xcd5f('0x63')]+(_0x526bcc(_0x3b9917[_0xcd5f('0x5f')][_0x3b89fc][_0xcd5f('0x63')])?'\x20'+_0x3b9917['rules'][_0x3b89fc][_0xcd5f('0x64')]:'');}return _0x230a68+')';};var _0x464914={'where':{'id':_0x567382['id']}},_0x1a86e9,_0x1bff64,_0x65dc56,_0x2b3cd5,_0x5e0fb3;_0x464914=_[_0xcd5f('0x3d')]({},_0x464914,_0x45ea22);return db['AnalyticCustomReport'][_0xcd5f('0x44')](_0x464914)[_0xcd5f('0x1e')](function(_0x37f298){if(_0x37f298){_0x1a86e9=_0x37f298;return _0x37f298['getFields']();}return null;})[_0xcd5f('0x1e')](function(_0x487587){if(_0x487587){if(!_0x487587[_0xcd5f('0x35')]){throw new db[(_0xcd5f('0x87'))][(_0xcd5f('0x88'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x1bff64=_0x487587;return db['AnalyticMetric'][_0xcd5f('0x68')]({'raw':!![]});}return null;})['then'](function(_0x371f25){if(_0x371f25){_0x65dc56=_['keyBy'](_0x371f25,'id');var _0x1a57db;var _0x4da8bc=squel[_0xcd5f('0x6a')]();_0x4da8bc[_0xcd5f('0x89')](_0x1a86e9[_0xcd5f('0x6b')]);for(var _0xbbb053=0x0;_0xbbb053<_0x1bff64[_0xcd5f('0x35')];_0xbbb053+=0x1){_0x1a57db=_0x1bff64[_0xbbb053][_0xcd5f('0x6c')]?_0x65dc56[_0x1bff64[_0xbbb053][_0xcd5f('0x6c')]][_0xcd5f('0x6d')]:_0x1bff64[_0xbbb053][_0xcd5f('0x62')];_0x1a57db=_0x1bff64[_0xbbb053][_0xcd5f('0x8a')]?_[_0xcd5f('0x6f')](_0x4bbde9[_0x1bff64[_0xbbb053]['function']],'%s',_0x1a57db):_0x1a57db;_0x1a57db=_0x1bff64[_0xbbb053]['format']?_[_0xcd5f('0x6f')](_0x255955[_0x1bff64[_0xbbb053][_0xcd5f('0x6e')]],'%s',_0x1a57db):_0x1a57db;if(_0x1bff64[_0xbbb053][_0xcd5f('0x70')]){_0x4da8bc[_0xcd5f('0x61')](_0x1a57db);}_0x1bff64[_0xbbb053][_0xcd5f('0x71')]&&_0x4da8bc[_0xcd5f('0x38')](_0x1a57db,_0x1bff64[_0xbbb053][_0xcd5f('0x71')]===_0xcd5f('0x72')?![]:!![]);_0x4da8bc[_0xcd5f('0x62')](_0x1a57db,_0x1bff64[_0xbbb053]['alias']||_0x1a57db);}if(_0x1a86e9[_0xcd5f('0x74')]){_0x1a86e9[_0xcd5f('0x74')]=JSON[_0xcd5f('0x75')](_0x1a86e9['joins']);for(var _0x24bc3e=0x0;_0x24bc3e<_0x1a86e9[_0xcd5f('0x74')][_0xcd5f('0x35')];_0x24bc3e+=0x1){if(_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e]['type']&&_[_0xcd5f('0x85')](_0x562e1e,_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e][_0xcd5f('0x2c')])&&_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e][_0xcd5f('0x76')]&&_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e]['foreignTable']&&_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e][_0xcd5f('0x77')]){_0x4da8bc[_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e]['type']](_0x1a86e9['joins'][_0x24bc3e]['foreignTable'],null,util[_0xcd5f('0x6e')](_0xcd5f('0x79'),_0x1a86e9[_0xcd5f('0x6b')],_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e][_0xcd5f('0x76')],_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e]['foreignTable'],_0x1a86e9[_0xcd5f('0x74')][_0x24bc3e]['foreignKey']));}}}if(_0x1a86e9[_0xcd5f('0x7a')]){_0x1a86e9[_0xcd5f('0x7a')]=JSON[_0xcd5f('0x75')](_0x1a86e9[_0xcd5f('0x7a')]);_0x4da8bc['where'](_0x2fcafb(_0x1a86e9['conditions'][_0xcd5f('0x61')]));}_0x5e0fb3=_0x4da8bc[_0xcd5f('0x7b')]();_0x4da8bc[_0xcd5f('0x19')](_0x4724cb);_0x4da8bc[_0xcd5f('0x17')](0x0);return;}})[_0xcd5f('0x1e')](function(){if(_0x14817d['output']===_0xcd5f('0x8b')){return null;}var _0x82bbd3=_[_0xcd5f('0x3d')](_0x14817d,{'name':_0x14817d[_0xcd5f('0x8c')]||_0x14817d[_0xcd5f('0x25')]||_0x1a86e9[_0xcd5f('0x25')],'basename':_0x520147,'savename':util[_0xcd5f('0x6e')](_0xcd5f('0x8d'),_0x14817d[_0xcd5f('0x25')]||_0x1a86e9[_0xcd5f('0x25')],require('randomstring')['generate'](0x4),_0x14817d[_0xcd5f('0x8e')]||_0xcd5f('0x8f')),'reportId':_0x1a86e9['id'],'reportType':_0xcd5f('0x90')});return db['AnalyticExtractedReport'][_0xcd5f('0x45')](_0x82bbd3,{'raw':!![]});})[_0xcd5f('0x1e')](function(_0x18435d){if(_0x1a86e9[_0xcd5f('0x6b')]===_0xcd5f('0x91')){_0x5e0fb3[_0xcd5f('0x3a')](_0x1a86e9[_0xcd5f('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x14817d[_0xcd5f('0x92')],_0x14817d[_0xcd5f('0x93')]);}else{_0x5e0fb3[_0xcd5f('0x3a')](_0x1a86e9[_0xcd5f('0x6b')]+_0xcd5f('0x94'),_0x14817d[_0xcd5f('0x92')],_0x14817d[_0xcd5f('0x93')]);}if(_0x18435d){logger[_0xcd5f('0x95')](_0xcd5f('0x96'),_0x5e0fb3[_0xcd5f('0x7e')]());require('child_process')['fork'](path['join'](__dirname,_0xcd5f('0x97'),_0x18435d[_0xcd5f('0x8e')]),[_0x18435d['id'],_0x5e0fb3[_0xcd5f('0x7e')](),path[_0xcd5f('0x4f')](__dirname,_0xcd5f('0x98'),_0x18435d[_0xcd5f('0x99')]),_0x520147]);return _0x18435d;}else{var _0x31e684=squel[_0xcd5f('0x6a')]();_0x31e684[_0xcd5f('0x89')]('('+_0x5e0fb3[_0xcd5f('0x7e')]()+')',_0xcd5f('0x9a'));_0x31e684[_0xcd5f('0x62')]('COUNT(*)','count');_0x5e0fb3[_0xcd5f('0x19')](_0x14817d[_0xcd5f('0x19')]||_0x4724cb);_0x5e0fb3[_0xcd5f('0x17')](_0x14817d['offset']||0x0);return dbH[_0xcd5f('0x7f')][_0xcd5f('0x2f')](_0x31e684[_0xcd5f('0x7e')](),{'type':dbH['sequelize'][_0xcd5f('0x80')]['SELECT']})[_0xcd5f('0x1e')](function(_0x561c06){if(!_0x561c06['length']){_0x2b3cd5=0x0;}else{_0x2b3cd5=_0x561c06[0x0][_0xcd5f('0x1a')]||0x0;}return dbH[_0xcd5f('0x7f')][_0xcd5f('0x2f')](_0x5e0fb3[_0xcd5f('0x7e')](),{'type':dbH[_0xcd5f('0x7f')][_0xcd5f('0x80')][_0xcd5f('0x81')]});})[_0xcd5f('0x1e')](function(_0x4306e0){return{'rows':_0x4306e0||[],'count':_0x2b3cd5};});}});}exports['run']=function(_0x4a4ca6,_0x1bdfe3){return runReport(_0x4a4ca6[_0xcd5f('0x4e')],_0x4a4ca6['query'],_0x4a4ca6['options'])[_0xcd5f('0x1e')](respondWithResult(_0x1bdfe3,null))[_0xcd5f('0x42')](handleError(_0x1bdfe3,null));};exports[_0xcd5f('0x9b')]=runReport;exports[_0xcd5f('0x2f')]=function(_0x21744d,_0x395241){var _0x15c2cc=0xa;var _0x4b8e2a=[_0xcd5f('0x4f'),_0xcd5f('0x50'),'right_join','cross_join'];var _0x133461={'SUM':_0xcd5f('0x83'),'COUNT':_0xcd5f('0x9c'),'COUNT DISTINCT':_0xcd5f('0x84'),'MAX':_0xcd5f('0x52'),'MIN':_0xcd5f('0x53'),'AVG':_0xcd5f('0x9d'),'GROUP_CONCAT':_0xcd5f('0x54'),'GROUP_CONCAT ASC':_0xcd5f('0x55'),'GROUP_CONCAT DESC':_0xcd5f('0x56')};var _0x49cdf6={'SEC_TO_TIME':_0xcd5f('0x57'),'DATE':_0xcd5f('0x58'),'HOUR':_0xcd5f('0x59'),'ROUND':_0xcd5f('0x5a'),'UNIX_TIMESTAMP':_0xcd5f('0x5b')};var _0xda3b13=function(_0xaf6b9e){return!_[_0xcd5f('0x85')](['IS\x20NULL',_0xcd5f('0x5d'),_0xcd5f('0x86'),_0xcd5f('0x5e')],_0xaf6b9e);};var _0x227dd8=function(_0x482171){if(!_0x482171||!_0x482171['rules']['length']){return'';}for(var _0x3cec60='(',_0x4faa89=0x0;_0x4faa89<_0x482171[_0xcd5f('0x5f')]['length'];_0x4faa89+=0x1){_0x4faa89>0x0&&(_0x3cec60+='\x20'+_0x482171[_0xcd5f('0x60')]+'\x20');_0x3cec60+=_0x482171[_0xcd5f('0x5f')][_0x4faa89][_0xcd5f('0x61')]?_0x227dd8(_0x482171['rules'][_0x4faa89][_0xcd5f('0x61')]):_0x482171[_0xcd5f('0x5f')][_0x4faa89]['field']+'\x20'+_0x482171['rules'][_0x4faa89]['condition']+(_0xda3b13(_0x482171[_0xcd5f('0x5f')][_0x4faa89][_0xcd5f('0x63')])?'\x20'+_0x482171[_0xcd5f('0x5f')][_0x4faa89][_0xcd5f('0x64')]:'');}return _0x3cec60+')';};var _0x1a8864={'where':{'id':_0x21744d[_0xcd5f('0x4e')]['id']}},_0x36ca3e,_0x36115b,_0x3f9031,_0x315102,_0x177a91;_0x1a8864=_[_0xcd5f('0x3d')]({},_0x1a8864,_0x21744d[_0xcd5f('0x3e')]);return db[_0xcd5f('0x29')][_0xcd5f('0x44')](_0x1a8864)[_0xcd5f('0x1e')](function(_0x5e1d4a){if(_0x5e1d4a){_0x36ca3e=_0x5e1d4a;return _0x5e1d4a[_0xcd5f('0x65')]();}return null;})[_0xcd5f('0x1e')](function(_0x1c101a){if(_0x1c101a){if(!_0x1c101a[_0xcd5f('0x35')]){throw new db[(_0xcd5f('0x87'))][(_0xcd5f('0x88'))](_0xcd5f('0x66'),0x193);}_0x36115b=_0x1c101a;return db['AnalyticMetric'][_0xcd5f('0x68')]({'raw':!![]});}return null;})[_0xcd5f('0x1e')](function(_0x5e68ee){if(_0x5e68ee){_0x3f9031=_[_0xcd5f('0x69')](_0x5e68ee,'id');var _0x234374;var _0x4820d7=squel[_0xcd5f('0x6a')]();_0x4820d7[_0xcd5f('0x89')](_0x36ca3e[_0xcd5f('0x6b')]);for(var _0x1b1dd5=0x0;_0x1b1dd5<_0x36115b[_0xcd5f('0x35')];_0x1b1dd5+=0x1){_0x234374=_0x36115b[_0x1b1dd5][_0xcd5f('0x6c')]?_0x3f9031[_0x36115b[_0x1b1dd5][_0xcd5f('0x6c')]][_0xcd5f('0x6d')]:_0x36115b[_0x1b1dd5][_0xcd5f('0x62')];_0x234374=_0x36115b[_0x1b1dd5][_0xcd5f('0x8a')]?_[_0xcd5f('0x6f')](_0x133461[_0x36115b[_0x1b1dd5][_0xcd5f('0x8a')]],'%s',_0x234374):_0x234374;_0x234374=_0x36115b[_0x1b1dd5][_0xcd5f('0x6e')]?_['replace'](_0x49cdf6[_0x36115b[_0x1b1dd5][_0xcd5f('0x6e')]],'%s',_0x234374):_0x234374;if(_0x36115b[_0x1b1dd5][_0xcd5f('0x70')]){_0x4820d7[_0xcd5f('0x61')](_0x234374);}_0x36115b[_0x1b1dd5][_0xcd5f('0x71')]&&_0x4820d7[_0xcd5f('0x38')](_0x234374,_0x36115b[_0x1b1dd5][_0xcd5f('0x71')]===_0xcd5f('0x72')?![]:!![]);_0x4820d7['field'](_0x234374,_0x36115b[_0x1b1dd5]['alias']||_0x234374);}if(_0x36ca3e[_0xcd5f('0x74')]){_0x36ca3e[_0xcd5f('0x74')]=JSON['parse'](_0x36ca3e[_0xcd5f('0x74')]);for(var _0x41145d=0x0;_0x41145d<_0x36ca3e[_0xcd5f('0x74')][_0xcd5f('0x35')];_0x41145d+=0x1){if(_0x36ca3e[_0xcd5f('0x74')][_0x41145d][_0xcd5f('0x2c')]&&_[_0xcd5f('0x85')](_0x4b8e2a,_0x36ca3e['joins'][_0x41145d][_0xcd5f('0x2c')])&&_0x36ca3e['joins'][_0x41145d][_0xcd5f('0x76')]&&_0x36ca3e[_0xcd5f('0x74')][_0x41145d][_0xcd5f('0x78')]&&_0x36ca3e[_0xcd5f('0x74')][_0x41145d][_0xcd5f('0x77')]){_0x4820d7[_0x36ca3e[_0xcd5f('0x74')][_0x41145d][_0xcd5f('0x2c')]](_0x36ca3e[_0xcd5f('0x74')][_0x41145d]['foreignTable'],null,util[_0xcd5f('0x6e')](_0xcd5f('0x79'),_0x36ca3e[_0xcd5f('0x6b')],_0x36ca3e[_0xcd5f('0x74')][_0x41145d]['parentKey'],_0x36ca3e[_0xcd5f('0x74')][_0x41145d]['foreignTable'],_0x36ca3e[_0xcd5f('0x74')][_0x41145d][_0xcd5f('0x77')]));}}}if(_0x36ca3e[_0xcd5f('0x7a')]){_0x36ca3e[_0xcd5f('0x7a')]=JSON[_0xcd5f('0x75')](_0x36ca3e[_0xcd5f('0x7a')]);_0x4820d7[_0xcd5f('0x3a')](_0x227dd8(_0x36ca3e['conditions'][_0xcd5f('0x61')]));}_0x177a91=_0x4820d7[_0xcd5f('0x7b')]();_0x4820d7[_0xcd5f('0x19')](_0x15c2cc);_0x4820d7[_0xcd5f('0x17')](0x0);logger[_0xcd5f('0x7c')](_0xcd5f('0x7d'),_0x4820d7[_0xcd5f('0x7e')]());return dbH['sequelize'][_0xcd5f('0x2f')](_0x4820d7[_0xcd5f('0x7e')](),{'type':dbH['sequelize'][_0xcd5f('0x80')][_0xcd5f('0x81')]});}})[_0xcd5f('0x1e')](function(){return{'sql':_0x177a91[_0xcd5f('0x7e')]()};})['then'](respondWithResult(_0x395241,null))[_0xcd5f('0x42')](handleError(_0x395241,null));};
\ No newline at end of file
+var _0x8b00=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','left_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','value','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','order','DESC','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','getFields','AnalyticMetric','groupBy','alias','web','%s-%s.%s','randomstring','generate','output','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','runReport','right_join','ValidationErrorItem','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','ejs','fs-extra','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','update','then','get','CustomReports','UserProfileResource','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','AnalyticCustomReport','findAll','show','params','include','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId'];(function(_0x413042,_0x2b6f11){var _0x595e71=function(_0x1812c4){while(--_0x1812c4){_0x413042['push'](_0x413042['shift']());}};_0x595e71(++_0x2b6f11);}(_0x8b00,0x100));var _0x08b0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8b00[_0x20a584];return _0x4b41a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x08b0('0x0'));var zipdir=require(_0x08b0('0x1'));var jsonpatch=require(_0x08b0('0x2'));var rp=require('request-promise');var moment=require(_0x08b0('0x3'));var BPromise=require(_0x08b0('0x4'));var Mustache=require(_0x08b0('0x5'));var util=require('util');var path=require(_0x08b0('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x08b0('0x7'));var fs=require('fs');var fs_extra=require(_0x08b0('0x8'));var _=require(_0x08b0('0x9'));var squel=require(_0x08b0('0xa'));var crypto=require(_0x08b0('0xb'));var jsforce=require(_0x08b0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x08b0('0xd'));var querystring=require(_0x08b0('0xe'));var Papa=require(_0x08b0('0xf'));var Redis=require(_0x08b0('0x10'));var authService=require(_0x08b0('0x11'));var qs=require(_0x08b0('0x12'));var as=require(_0x08b0('0x13'));var hardwareService=require(_0x08b0('0x14'));var logger=require(_0x08b0('0x15'))(_0x08b0('0x16'));var utils=require('../../config/utils');var config=require(_0x08b0('0x17'));var licenseUtil=require(_0x08b0('0x18'));var db=require(_0x08b0('0x19'))['db'];var dbH=require(_0x08b0('0x19'))['dbH'];function respondWithStatusCode(_0x34e5c6,_0x388908){_0x388908=_0x388908||0xcc;return function(_0x3b5826){if(_0x3b5826){return _0x34e5c6[_0x08b0('0x1a')](_0x388908);}return _0x34e5c6[_0x08b0('0x1b')](_0x388908)[_0x08b0('0x1c')]();};}function respondWithResult(_0x557eeb,_0x5e4b8e){_0x5e4b8e=_0x5e4b8e||0xc8;return function(_0x286d21){if(_0x286d21){return _0x557eeb['status'](_0x5e4b8e)[_0x08b0('0x1d')](_0x286d21);}};}function respondWithFilteredResult(_0x1f0b00,_0x53c9e9){return function(_0x1fc578){if(_0x1fc578){var _0x2d605e=typeof _0x53c9e9[_0x08b0('0x1e')]===_0x08b0('0x1f')&&typeof _0x53c9e9[_0x08b0('0x20')]===_0x08b0('0x1f');var _0x3b00cd=_0x1fc578[_0x08b0('0x21')];var _0x4a4b93=_0x2d605e?0x0:_0x53c9e9[_0x08b0('0x1e')];var _0x334240=_0x2d605e?_0x1fc578[_0x08b0('0x21')]:_0x53c9e9[_0x08b0('0x1e')]+_0x53c9e9[_0x08b0('0x20')];var _0xe68c88;if(_0x334240>=_0x3b00cd){_0x334240=_0x3b00cd;_0xe68c88=0xc8;}else{_0xe68c88=0xce;}_0x1f0b00[_0x08b0('0x1b')](_0xe68c88);return _0x1f0b00[_0x08b0('0x22')](_0x08b0('0x23'),_0x4a4b93+'-'+_0x334240+'/'+_0x3b00cd)[_0x08b0('0x1d')](_0x1fc578);}return null;};}function patchUpdates(_0x394c4d){return function(_0x433b81){try{jsonpatch['apply'](_0x433b81,_0x394c4d,!![]);}catch(_0x19569d){return BPromise[_0x08b0('0x24')](_0x19569d);}return _0x433b81['save']();};}function saveUpdates(_0x4b668f,_0x13c9bc){return function(_0x244e9e){if(_0x244e9e){return _0x244e9e[_0x08b0('0x25')](_0x4b668f)['then'](function(_0x3af93c){return _0x3af93c;});}return null;};}function removeEntity(_0x1e33f5,_0x44dfc6){return function(_0x3c8122){if(_0x3c8122){return _0x3c8122['destroy']()[_0x08b0('0x26')](function(){var _0xbe5385=_0x3c8122[_0x08b0('0x27')]({'plain':!![]});var _0x263ef6=_0x08b0('0x28');return db[_0x08b0('0x29')][_0x08b0('0x2a')]({'where':{'type':_0x263ef6,'resourceId':_0xbe5385['id']}})[_0x08b0('0x26')](function(){return _0x3c8122;});})[_0x08b0('0x26')](function(){_0x1e33f5[_0x08b0('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x573985,_0xf3508b){return function(_0x55bd7b){if(!_0x55bd7b){_0x573985[_0x08b0('0x1a')](0x194);}return _0x55bd7b;};}function handleError(_0x5ea49f,_0x4fcfb0){_0x4fcfb0=_0x4fcfb0||0x1f4;return function(_0x399813){logger[_0x08b0('0x2b')](_0x399813[_0x08b0('0x2c')]);if(_0x399813[_0x08b0('0x2d')]){delete _0x399813[_0x08b0('0x2d')];}_0x5ea49f['status'](_0x4fcfb0)[_0x08b0('0x2e')](_0x399813);};}exports[_0x08b0('0x2f')]=function(_0x297068,_0x288e72){var _0x20e122={},_0x4cf622={},_0x2fd7a1={'count':0x0,'rows':[]};var _0x20892d=_[_0x08b0('0x30')](db['AnalyticCustomReport'][_0x08b0('0x31')],function(_0x35a951){return{'name':_0x35a951['fieldName'],'type':_0x35a951[_0x08b0('0x32')][_0x08b0('0x33')]};});_0x4cf622[_0x08b0('0x34')]=_[_0x08b0('0x30')](_0x20892d,'name');_0x4cf622['query']=_[_0x08b0('0x35')](_0x297068[_0x08b0('0x36')]);_0x4cf622[_0x08b0('0x37')]=_[_0x08b0('0x38')](_0x4cf622['model'],_0x4cf622[_0x08b0('0x36')]);_0x20e122[_0x08b0('0x39')]=_['intersection'](_0x4cf622[_0x08b0('0x34')],qs[_0x08b0('0x3a')](_0x297068[_0x08b0('0x36')][_0x08b0('0x3a')]));_0x20e122['attributes']=_0x20e122[_0x08b0('0x39')][_0x08b0('0x3b')]?_0x20e122[_0x08b0('0x39')]:_0x4cf622[_0x08b0('0x34')];if(!_0x297068[_0x08b0('0x36')][_0x08b0('0x3c')](_0x08b0('0x3d'))){_0x20e122[_0x08b0('0x20')]=qs[_0x08b0('0x20')](_0x297068['query']['limit']);_0x20e122['offset']=qs[_0x08b0('0x1e')](_0x297068[_0x08b0('0x36')][_0x08b0('0x1e')]);}_0x20e122['order']=qs[_0x08b0('0x3e')](_0x297068[_0x08b0('0x36')][_0x08b0('0x3e')]);_0x20e122[_0x08b0('0x3f')]=qs[_0x08b0('0x37')](_[_0x08b0('0x40')](_0x297068[_0x08b0('0x36')],_0x4cf622[_0x08b0('0x37')]),_0x20892d);if(_0x297068[_0x08b0('0x36')]['filter']){_0x20e122[_0x08b0('0x3f')]=_[_0x08b0('0x41')](_0x20e122['where'],{'$or':_[_0x08b0('0x30')](_0x20892d,function(_0x128e67){if(_0x128e67[_0x08b0('0x32')]!==_0x08b0('0x42')){var _0x2e1258={};_0x2e1258[_0x128e67['name']]={'$like':'%'+_0x297068[_0x08b0('0x36')]['filter']+'%'};return _0x2e1258;}})});}_0x20e122=_['merge']({},_0x20e122,_0x297068[_0x08b0('0x43')]);var _0x56dee8={'where':_0x20e122[_0x08b0('0x3f')]};return db['AnalyticCustomReport'][_0x08b0('0x21')](_0x56dee8)['then'](function(_0x2333fe){_0x2fd7a1['count']=_0x2333fe;if(_0x297068[_0x08b0('0x36')][_0x08b0('0x44')]){_0x20e122['include']=[{'all':!![]}];}return db[_0x08b0('0x45')][_0x08b0('0x46')](_0x20e122);})[_0x08b0('0x26')](function(_0x22ea69){_0x2fd7a1['rows']=_0x22ea69;return _0x2fd7a1;})[_0x08b0('0x26')](respondWithFilteredResult(_0x288e72,_0x20e122))['catch'](handleError(_0x288e72,null));};exports[_0x08b0('0x47')]=function(_0x1c684e,_0x22e9d3){var _0x36cc4e={'raw':![],'where':{'id':_0x1c684e[_0x08b0('0x48')]['id']}},_0x5e4721={};_0x5e4721['model']=_[_0x08b0('0x35')](db['AnalyticCustomReport']['rawAttributes']);_0x5e4721['query']=_[_0x08b0('0x35')](_0x1c684e[_0x08b0('0x36')]);_0x5e4721[_0x08b0('0x37')]=_[_0x08b0('0x38')](_0x5e4721[_0x08b0('0x34')],_0x5e4721[_0x08b0('0x36')]);_0x36cc4e[_0x08b0('0x39')]=_[_0x08b0('0x38')](_0x5e4721['model'],qs['fields'](_0x1c684e['query'][_0x08b0('0x3a')]));_0x36cc4e[_0x08b0('0x39')]=_0x36cc4e['attributes'][_0x08b0('0x3b')]?_0x36cc4e[_0x08b0('0x39')]:_0x5e4721[_0x08b0('0x34')];if(_0x1c684e['query'][_0x08b0('0x44')]){_0x36cc4e[_0x08b0('0x49')]=[{'all':!![]}];}_0x36cc4e=_['merge']({},_0x36cc4e,_0x1c684e[_0x08b0('0x43')]);return db['AnalyticCustomReport'][_0x08b0('0x4a')](_0x36cc4e)['then'](handleEntityNotFound(_0x22e9d3,null))['then'](respondWithResult(_0x22e9d3,null))[_0x08b0('0x4b')](handleError(_0x22e9d3,null));};exports[_0x08b0('0x4c')]=function(_0x22e7bb,_0xdf9309){return db[_0x08b0('0x45')][_0x08b0('0x4c')](_0x22e7bb[_0x08b0('0x4d')],{})[_0x08b0('0x26')](function(_0x4b756f){var _0x263aeb=_0x22e7bb['user']['get']({'plain':!![]});if(!_0x263aeb)throw new Error(_0x08b0('0x4e'));if(_0x263aeb[_0x08b0('0x4f')]===_0x08b0('0x50')){var _0xd76553=_0x4b756f[_0x08b0('0x27')]({'plain':!![]});var _0xe393cd=_0x08b0('0x51');return db[_0x08b0('0x52')][_0x08b0('0x4a')]({'where':{'name':_0xe393cd,'userProfileId':_0x263aeb[_0x08b0('0x53')]},'raw':!![]})[_0x08b0('0x26')](function(_0x1a0873){if(_0x1a0873&&_0x1a0873[_0x08b0('0x54')]===0x0){return db[_0x08b0('0x29')][_0x08b0('0x4c')]({'name':_0xd76553[_0x08b0('0x2d')],'resourceId':_0xd76553['id'],'type':_0x08b0('0x28'),'sectionId':_0x1a0873['id']},{})[_0x08b0('0x26')](function(){return _0x4b756f;});}else{return _0x4b756f;}})[_0x08b0('0x4b')](function(_0x239cdd){logger[_0x08b0('0x2b')](_0x08b0('0x55'),_0x239cdd);throw _0x239cdd;});}return _0x4b756f;})[_0x08b0('0x26')](respondWithResult(_0xdf9309,0xc9))[_0x08b0('0x4b')](handleError(_0xdf9309,null));};exports['update']=function(_0x1c6e95,_0x351a52){if(_0x1c6e95[_0x08b0('0x4d')]['id']){delete _0x1c6e95['body']['id'];}return db[_0x08b0('0x45')][_0x08b0('0x4a')]({'where':{'id':_0x1c6e95[_0x08b0('0x48')]['id']}})[_0x08b0('0x26')](handleEntityNotFound(_0x351a52,null))[_0x08b0('0x26')](saveUpdates(_0x1c6e95['body'],null))[_0x08b0('0x26')](respondWithResult(_0x351a52,null))[_0x08b0('0x4b')](handleError(_0x351a52,null));};exports[_0x08b0('0x2a')]=function(_0x3ab8d4,_0x531ae3){return db[_0x08b0('0x45')][_0x08b0('0x4a')]({'where':{'id':_0x3ab8d4[_0x08b0('0x48')]['id']}})['then'](handleEntityNotFound(_0x531ae3,null))[_0x08b0('0x26')](removeEntity(_0x531ae3,null))[_0x08b0('0x4b')](handleError(_0x531ae3,null));};exports['preview']=function(_0x35a06c,_0xe7be22){var _0x5ccdaf=0xa;var _0x61f14a=[_0x08b0('0x56'),_0x08b0('0x57'),'right_join',_0x08b0('0x58')];var _0x2e37f7={'SUM':_0x08b0('0x59'),'COUNT':_0x08b0('0x5a'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x08b0('0x5b'),'MIN':_0x08b0('0x5c'),'AVG':_0x08b0('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x08b0('0x5e')};var _0x2759b1={'SEC_TO_TIME':_0x08b0('0x5f'),'DATE':'DATE(%s)','HOUR':_0x08b0('0x60'),'ROUND':_0x08b0('0x61'),'UNIX_TIMESTAMP':_0x08b0('0x62')};var _0x474a3e=function(_0x51bc83){return!_[_0x08b0('0x63')]([_0x08b0('0x64'),'IS\x20NOT\x20NULL',_0x08b0('0x65'),'IS\x20NOT\x20EMPTY'],_0x51bc83);};var _0x47db85=function(_0xa362f){if(!_0xa362f||!_0xa362f[_0x08b0('0x66')]['length']){return'';}for(var _0x18198e='(',_0x19047d=0x0;_0x19047d<_0xa362f['rules']['length'];_0x19047d+=0x1){_0x19047d>0x0&&(_0x18198e+='\x20'+_0xa362f[_0x08b0('0x67')]+'\x20');_0x18198e+=_0xa362f[_0x08b0('0x66')][_0x19047d][_0x08b0('0x68')]?_0x47db85(_0xa362f[_0x08b0('0x66')][_0x19047d][_0x08b0('0x68')]):_0xa362f[_0x08b0('0x66')][_0x19047d][_0x08b0('0x69')]+'\x20'+_0xa362f[_0x08b0('0x66')][_0x19047d][_0x08b0('0x6a')]+(_0x474a3e(_0xa362f[_0x08b0('0x66')][_0x19047d][_0x08b0('0x6a')])?'\x20'+_0xa362f['rules'][_0x19047d][_0x08b0('0x6b')]:'');}return _0x18198e+')';};var _0x547f6f={'where':{'id':_0x35a06c[_0x08b0('0x48')]['id']}},_0x274ae0,_0x2e45b8,_0x467214,_0x35a02d,_0x479ebb;_0x547f6f=_[_0x08b0('0x41')]({},_0x547f6f,_0x35a06c[_0x08b0('0x43')]);return db[_0x08b0('0x45')]['find'](_0x547f6f)[_0x08b0('0x26')](function(_0x3dd0da){if(_0x3dd0da){_0x274ae0=_0x3dd0da;return _0x3dd0da['getFields']();}return null;})['then'](function(_0x21a617){if(_0x21a617){if(!_0x21a617[_0x08b0('0x3b')]){throw new db[(_0x08b0('0x6c'))]['ValidationErrorItem'](_0x08b0('0x6d'),0x193);}_0x2e45b8=_0x21a617;return db['AnalyticMetric'][_0x08b0('0x46')]({'raw':!![]});}return null;})[_0x08b0('0x26')](function(_0x3b6182){if(_0x3b6182){_0x467214=_[_0x08b0('0x6e')](_0x3b6182,'id');var _0x322474;var _0x10e5d1=squel[_0x08b0('0x6f')]();_0x10e5d1[_0x08b0('0x70')](_0x274ae0[_0x08b0('0x71')]);for(var _0x18d978=0x0;_0x18d978<_0x2e45b8['length'];_0x18d978+=0x1){_0x322474=_0x2e45b8[_0x18d978][_0x08b0('0x72')]?_0x467214[_0x2e45b8[_0x18d978]['MetricId']][_0x08b0('0x73')]:_0x2e45b8[_0x18d978]['field'];_0x322474=_0x2e45b8[_0x18d978][_0x08b0('0x74')]?_[_0x08b0('0x75')](_0x2e37f7[_0x2e45b8[_0x18d978][_0x08b0('0x74')]],'%s',_0x322474):_0x322474;_0x322474=_0x2e45b8[_0x18d978][_0x08b0('0x76')]?_[_0x08b0('0x75')](_0x2759b1[_0x2e45b8[_0x18d978][_0x08b0('0x76')]],'%s',_0x322474):_0x322474;if(_0x2e45b8[_0x18d978]['groupBy']){_0x10e5d1[_0x08b0('0x68')](_0x322474);}_0x2e45b8[_0x18d978][_0x08b0('0x77')]&&_0x10e5d1[_0x08b0('0x78')](_0x322474,_0x2e45b8[_0x18d978]['orderBy']===_0x08b0('0x79')?![]:!![]);_0x10e5d1[_0x08b0('0x69')](_0x322474,_0x2e45b8[_0x18d978]['alias']||_0x322474);}if(_0x274ae0[_0x08b0('0x7a')]){_0x274ae0['joins']=JSON[_0x08b0('0x7b')](_0x274ae0[_0x08b0('0x7a')]);for(var _0x152a1d=0x0;_0x152a1d<_0x274ae0['joins'][_0x08b0('0x3b')];_0x152a1d+=0x1){if(_0x274ae0[_0x08b0('0x7a')][_0x152a1d][_0x08b0('0x32')]&&_[_0x08b0('0x63')](_0x61f14a,_0x274ae0[_0x08b0('0x7a')][_0x152a1d][_0x08b0('0x32')])&&_0x274ae0[_0x08b0('0x7a')][_0x152a1d][_0x08b0('0x7c')]&&_0x274ae0[_0x08b0('0x7a')][_0x152a1d]['foreignTable']&&_0x274ae0['joins'][_0x152a1d][_0x08b0('0x7d')]){_0x10e5d1[_0x274ae0['joins'][_0x152a1d][_0x08b0('0x32')]](_0x274ae0[_0x08b0('0x7a')][_0x152a1d][_0x08b0('0x7e')],null,util['format'](_0x08b0('0x7f'),_0x274ae0[_0x08b0('0x71')],_0x274ae0[_0x08b0('0x7a')][_0x152a1d][_0x08b0('0x7c')],_0x274ae0[_0x08b0('0x7a')][_0x152a1d]['foreignTable'],_0x274ae0[_0x08b0('0x7a')][_0x152a1d][_0x08b0('0x7d')]));}}}if(_0x274ae0['conditions']){_0x274ae0[_0x08b0('0x80')]=JSON[_0x08b0('0x7b')](_0x274ae0[_0x08b0('0x80')]);_0x10e5d1[_0x08b0('0x3f')](_0x47db85(_0x274ae0[_0x08b0('0x80')][_0x08b0('0x68')]));}_0x479ebb=_0x10e5d1[_0x08b0('0x81')]();_0x10e5d1[_0x08b0('0x20')](_0x5ccdaf);_0x10e5d1['offset'](0x0);logger[_0x08b0('0x82')](_0x08b0('0x83'),_0x10e5d1[_0x08b0('0x84')]());return dbH[_0x08b0('0x85')]['query'](_0x10e5d1[_0x08b0('0x84')](),{'type':dbH[_0x08b0('0x85')][_0x08b0('0x86')][_0x08b0('0x87')]});}})[_0x08b0('0x26')](respondWithResult(_0xe7be22,null))[_0x08b0('0x4b')](handleError(_0xe7be22,null));};function runReport(_0x270186,_0x3046f9,_0x4246b7){var _0x510b8e=_0x3046f9[_0x08b0('0x2d')];var _0x3826f4=0xa;var _0x4feb35=[_0x08b0('0x56'),'left_join','right_join',_0x08b0('0x58')];var _0x3cbedb={'SUM':_0x08b0('0x59'),'COUNT':_0x08b0('0x5a'),'COUNT DISTINCT':_0x08b0('0x88'),'MAX':_0x08b0('0x5b'),'MIN':_0x08b0('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x08b0('0x89'),'GROUP_CONCAT ASC':_0x08b0('0x8a'),'GROUP_CONCAT DESC':_0x08b0('0x5e')};var _0x1f43f0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x08b0('0x8b'),'HOUR':_0x08b0('0x60'),'ROUND':_0x08b0('0x61'),'UNIX_TIMESTAMP':_0x08b0('0x62')};var _0x4e05ff=function(_0x555dd0){return!_[_0x08b0('0x63')]([_0x08b0('0x64'),_0x08b0('0x8c'),_0x08b0('0x65'),_0x08b0('0x8d')],_0x555dd0);};var _0x3bef09=function(_0x189057){if(!_0x189057||!_0x189057[_0x08b0('0x66')][_0x08b0('0x3b')]){return'';}for(var _0x4b876f='(',_0x2bcff4=0x0;_0x2bcff4<_0x189057[_0x08b0('0x66')]['length'];_0x2bcff4+=0x1){_0x2bcff4>0x0&&(_0x4b876f+='\x20'+_0x189057[_0x08b0('0x67')]+'\x20');_0x4b876f+=_0x189057[_0x08b0('0x66')][_0x2bcff4]['group']?_0x3bef09(_0x189057[_0x08b0('0x66')][_0x2bcff4][_0x08b0('0x68')]):_0x189057[_0x08b0('0x66')][_0x2bcff4][_0x08b0('0x69')]+'\x20'+_0x189057[_0x08b0('0x66')][_0x2bcff4][_0x08b0('0x6a')]+(_0x4e05ff(_0x189057['rules'][_0x2bcff4]['condition'])?'\x20'+_0x189057[_0x08b0('0x66')][_0x2bcff4][_0x08b0('0x6b')]:'');}return _0x4b876f+')';};var _0x3a9478={'where':{'id':_0x270186['id']}},_0x1aa8a0,_0x41fc9e,_0x26d7f2,_0x5d66b1,_0x2e440a;_0x3a9478=_[_0x08b0('0x41')]({},_0x3a9478,_0x4246b7);return db['AnalyticCustomReport'][_0x08b0('0x4a')](_0x3a9478)['then'](function(_0xd0cea8){if(_0xd0cea8){_0x1aa8a0=_0xd0cea8;return _0xd0cea8[_0x08b0('0x8e')]();}return null;})['then'](function(_0x3d1bd9){if(_0x3d1bd9){if(!_0x3d1bd9[_0x08b0('0x3b')]){throw new db[(_0x08b0('0x6c'))]['ValidationErrorItem'](_0x08b0('0x6d'),0x193);}_0x41fc9e=_0x3d1bd9;return db[_0x08b0('0x8f')][_0x08b0('0x46')]({'raw':!![]});}return null;})[_0x08b0('0x26')](function(_0x4b01d9){if(_0x4b01d9){_0x26d7f2=_['keyBy'](_0x4b01d9,'id');var _0x43a37d;var _0x3c89d9=squel[_0x08b0('0x6f')]();_0x3c89d9[_0x08b0('0x70')](_0x1aa8a0[_0x08b0('0x71')]);for(var _0x3d53f7=0x0;_0x3d53f7<_0x41fc9e[_0x08b0('0x3b')];_0x3d53f7+=0x1){_0x43a37d=_0x41fc9e[_0x3d53f7]['MetricId']?_0x26d7f2[_0x41fc9e[_0x3d53f7][_0x08b0('0x72')]][_0x08b0('0x73')]:_0x41fc9e[_0x3d53f7]['field'];_0x43a37d=_0x41fc9e[_0x3d53f7]['function']?_[_0x08b0('0x75')](_0x3cbedb[_0x41fc9e[_0x3d53f7]['function']],'%s',_0x43a37d):_0x43a37d;_0x43a37d=_0x41fc9e[_0x3d53f7]['format']?_['replace'](_0x1f43f0[_0x41fc9e[_0x3d53f7][_0x08b0('0x76')]],'%s',_0x43a37d):_0x43a37d;if(_0x41fc9e[_0x3d53f7][_0x08b0('0x90')]){_0x3c89d9[_0x08b0('0x68')](_0x43a37d);}_0x41fc9e[_0x3d53f7][_0x08b0('0x77')]&&_0x3c89d9[_0x08b0('0x78')](_0x43a37d,_0x41fc9e[_0x3d53f7]['orderBy']===_0x08b0('0x79')?![]:!![]);_0x3c89d9[_0x08b0('0x69')](_0x43a37d,_0x41fc9e[_0x3d53f7][_0x08b0('0x91')]||_0x43a37d);}if(_0x1aa8a0['joins']){_0x1aa8a0[_0x08b0('0x7a')]=JSON[_0x08b0('0x7b')](_0x1aa8a0[_0x08b0('0x7a')]);for(var _0x1ad82e=0x0;_0x1ad82e<_0x1aa8a0[_0x08b0('0x7a')][_0x08b0('0x3b')];_0x1ad82e+=0x1){if(_0x1aa8a0['joins'][_0x1ad82e][_0x08b0('0x32')]&&_[_0x08b0('0x63')](_0x4feb35,_0x1aa8a0['joins'][_0x1ad82e][_0x08b0('0x32')])&&_0x1aa8a0['joins'][_0x1ad82e]['parentKey']&&_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e][_0x08b0('0x7e')]&&_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e]['foreignKey']){_0x3c89d9[_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e][_0x08b0('0x32')]](_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e][_0x08b0('0x7e')],null,util[_0x08b0('0x76')]('%s.%s\x20=\x20%s.%s',_0x1aa8a0[_0x08b0('0x71')],_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e][_0x08b0('0x7c')],_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e][_0x08b0('0x7e')],_0x1aa8a0[_0x08b0('0x7a')][_0x1ad82e]['foreignKey']));}}}if(_0x1aa8a0['conditions']){_0x1aa8a0[_0x08b0('0x80')]=JSON['parse'](_0x1aa8a0['conditions']);_0x3c89d9[_0x08b0('0x3f')](_0x3bef09(_0x1aa8a0[_0x08b0('0x80')][_0x08b0('0x68')]));}_0x2e440a=_0x3c89d9['clone']();_0x3c89d9[_0x08b0('0x20')](_0x3826f4);_0x3c89d9[_0x08b0('0x1e')](0x0);return;}})['then'](function(){if(_0x3046f9['output']===_0x08b0('0x92')){return null;}var _0x801dea=_['merge'](_0x3046f9,{'name':_0x3046f9['fullPath']||_0x3046f9[_0x08b0('0x2d')]||_0x1aa8a0[_0x08b0('0x2d')],'basename':_0x510b8e,'savename':util['format'](_0x08b0('0x93'),_0x3046f9[_0x08b0('0x2d')]||_0x1aa8a0[_0x08b0('0x2d')],require(_0x08b0('0x94'))[_0x08b0('0x95')](0x4),_0x3046f9[_0x08b0('0x96')]||_0x08b0('0x97')),'reportId':_0x1aa8a0['id'],'reportType':_0x08b0('0x98')});return db[_0x08b0('0x99')]['create'](_0x801dea,{'raw':!![]});})['then'](function(_0x39eb0f){if(_0x1aa8a0[_0x08b0('0x71')]===_0x08b0('0x9a')){_0x2e440a['where'](_0x1aa8a0['table']+_0x08b0('0x9b'),_0x3046f9[_0x08b0('0x9c')],_0x3046f9[_0x08b0('0x9d')]);}else{_0x2e440a[_0x08b0('0x3f')](_0x1aa8a0['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3046f9[_0x08b0('0x9c')],_0x3046f9[_0x08b0('0x9d')]);}if(_0x39eb0f){logger[_0x08b0('0x9e')](_0x08b0('0x9f'),_0x2e440a[_0x08b0('0x84')]());require(_0x08b0('0xa0'))[_0x08b0('0xa1')](path[_0x08b0('0x56')](__dirname,_0x08b0('0xa2'),_0x39eb0f[_0x08b0('0x96')]),[_0x39eb0f['id'],_0x2e440a[_0x08b0('0x84')](),path[_0x08b0('0x56')](__dirname,'../../files/reports',_0x39eb0f[_0x08b0('0xa3')]),_0x510b8e]);return _0x39eb0f;}else{var _0x28def0=squel['select']();_0x28def0[_0x08b0('0x70')]('('+_0x2e440a[_0x08b0('0x84')]()+')',_0x08b0('0xa4'));_0x28def0[_0x08b0('0x69')](_0x08b0('0xa5'),'count');_0x2e440a[_0x08b0('0x20')](_0x3046f9[_0x08b0('0x20')]||_0x3826f4);_0x2e440a['offset'](_0x3046f9[_0x08b0('0x1e')]||0x0);return dbH['sequelize'][_0x08b0('0x36')](_0x28def0[_0x08b0('0x84')](),{'type':dbH[_0x08b0('0x85')][_0x08b0('0x86')][_0x08b0('0x87')]})['then'](function(_0x25a336){if(!_0x25a336[_0x08b0('0x3b')]){_0x5d66b1=0x0;}else{_0x5d66b1=_0x25a336[0x0][_0x08b0('0x21')]||0x0;}return dbH[_0x08b0('0x85')][_0x08b0('0x36')](_0x2e440a[_0x08b0('0x84')](),{'type':dbH[_0x08b0('0x85')][_0x08b0('0x86')]['SELECT']});})['then'](function(_0x1947c7){return{'rows':_0x1947c7||[],'count':_0x5d66b1};});}});}exports[_0x08b0('0xa6')]=function(_0x575fc8,_0x11d594){return runReport(_0x575fc8[_0x08b0('0x48')],_0x575fc8[_0x08b0('0x36')],_0x575fc8[_0x08b0('0x43')])[_0x08b0('0x26')](respondWithResult(_0x11d594,null))['catch'](handleError(_0x11d594,null));};exports[_0x08b0('0xa7')]=runReport;exports[_0x08b0('0x36')]=function(_0x20f68c,_0x4ed9b8){var _0x47f830=0xa;var _0x3931d0=['join',_0x08b0('0x57'),_0x08b0('0xa8'),_0x08b0('0x58')];var _0x1e6120={'SUM':'SUM(%s)','COUNT':'COUNT(%s)','COUNT DISTINCT':_0x08b0('0x88'),'MAX':'MAX(%s)','MIN':_0x08b0('0x5c'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x08b0('0x89'),'GROUP_CONCAT ASC':_0x08b0('0x8a'),'GROUP_CONCAT DESC':_0x08b0('0x5e')};var _0x5f3fbc={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x08b0('0x8b'),'HOUR':_0x08b0('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x08b0('0x62')};var _0x3437c1=function(_0x7a7026){return!_['includes']([_0x08b0('0x64'),_0x08b0('0x8c'),_0x08b0('0x65'),_0x08b0('0x8d')],_0x7a7026);};var _0x44265a=function(_0x362895){if(!_0x362895||!_0x362895[_0x08b0('0x66')][_0x08b0('0x3b')]){return'';}for(var _0x573430='(',_0x293197=0x0;_0x293197<_0x362895[_0x08b0('0x66')][_0x08b0('0x3b')];_0x293197+=0x1){_0x293197>0x0&&(_0x573430+='\x20'+_0x362895[_0x08b0('0x67')]+'\x20');_0x573430+=_0x362895[_0x08b0('0x66')][_0x293197][_0x08b0('0x68')]?_0x44265a(_0x362895['rules'][_0x293197][_0x08b0('0x68')]):_0x362895[_0x08b0('0x66')][_0x293197]['field']+'\x20'+_0x362895[_0x08b0('0x66')][_0x293197]['condition']+(_0x3437c1(_0x362895[_0x08b0('0x66')][_0x293197][_0x08b0('0x6a')])?'\x20'+_0x362895[_0x08b0('0x66')][_0x293197]['value']:'');}return _0x573430+')';};var _0xcb8f9a={'where':{'id':_0x20f68c[_0x08b0('0x48')]['id']}},_0x5a3504,_0x53307a,_0x9496b9,_0x1e3942,_0x15f77f;_0xcb8f9a=_[_0x08b0('0x41')]({},_0xcb8f9a,_0x20f68c['options']);return db[_0x08b0('0x45')][_0x08b0('0x4a')](_0xcb8f9a)[_0x08b0('0x26')](function(_0x5640e6){if(_0x5640e6){_0x5a3504=_0x5640e6;return _0x5640e6[_0x08b0('0x8e')]();}return null;})[_0x08b0('0x26')](function(_0x13a58f){if(_0x13a58f){if(!_0x13a58f['length']){throw new db[(_0x08b0('0x6c'))][(_0x08b0('0xa9'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x53307a=_0x13a58f;return db[_0x08b0('0x8f')]['findAll']({'raw':!![]});}return null;})[_0x08b0('0x26')](function(_0x21e854){if(_0x21e854){_0x9496b9=_[_0x08b0('0x6e')](_0x21e854,'id');var _0x179caa;var _0x1affec=squel[_0x08b0('0x6f')]();_0x1affec['from'](_0x5a3504[_0x08b0('0x71')]);for(var _0x1bdfd7=0x0;_0x1bdfd7<_0x53307a[_0x08b0('0x3b')];_0x1bdfd7+=0x1){_0x179caa=_0x53307a[_0x1bdfd7][_0x08b0('0x72')]?_0x9496b9[_0x53307a[_0x1bdfd7][_0x08b0('0x72')]][_0x08b0('0x73')]:_0x53307a[_0x1bdfd7][_0x08b0('0x69')];_0x179caa=_0x53307a[_0x1bdfd7][_0x08b0('0x74')]?_[_0x08b0('0x75')](_0x1e6120[_0x53307a[_0x1bdfd7][_0x08b0('0x74')]],'%s',_0x179caa):_0x179caa;_0x179caa=_0x53307a[_0x1bdfd7][_0x08b0('0x76')]?_[_0x08b0('0x75')](_0x5f3fbc[_0x53307a[_0x1bdfd7]['format']],'%s',_0x179caa):_0x179caa;if(_0x53307a[_0x1bdfd7][_0x08b0('0x90')]){_0x1affec[_0x08b0('0x68')](_0x179caa);}_0x53307a[_0x1bdfd7][_0x08b0('0x77')]&&_0x1affec[_0x08b0('0x78')](_0x179caa,_0x53307a[_0x1bdfd7][_0x08b0('0x77')]===_0x08b0('0x79')?![]:!![]);_0x1affec[_0x08b0('0x69')](_0x179caa,_0x53307a[_0x1bdfd7][_0x08b0('0x91')]||_0x179caa);}if(_0x5a3504['joins']){_0x5a3504[_0x08b0('0x7a')]=JSON[_0x08b0('0x7b')](_0x5a3504[_0x08b0('0x7a')]);for(var _0x1db67d=0x0;_0x1db67d<_0x5a3504[_0x08b0('0x7a')][_0x08b0('0x3b')];_0x1db67d+=0x1){if(_0x5a3504[_0x08b0('0x7a')][_0x1db67d]['type']&&_[_0x08b0('0x63')](_0x3931d0,_0x5a3504[_0x08b0('0x7a')][_0x1db67d][_0x08b0('0x32')])&&_0x5a3504[_0x08b0('0x7a')][_0x1db67d][_0x08b0('0x7c')]&&_0x5a3504['joins'][_0x1db67d][_0x08b0('0x7e')]&&_0x5a3504['joins'][_0x1db67d][_0x08b0('0x7d')]){_0x1affec[_0x5a3504[_0x08b0('0x7a')][_0x1db67d]['type']](_0x5a3504[_0x08b0('0x7a')][_0x1db67d][_0x08b0('0x7e')],null,util[_0x08b0('0x76')](_0x08b0('0x7f'),_0x5a3504[_0x08b0('0x71')],_0x5a3504[_0x08b0('0x7a')][_0x1db67d][_0x08b0('0x7c')],_0x5a3504[_0x08b0('0x7a')][_0x1db67d][_0x08b0('0x7e')],_0x5a3504[_0x08b0('0x7a')][_0x1db67d]['foreignKey']));}}}if(_0x5a3504[_0x08b0('0x80')]){_0x5a3504[_0x08b0('0x80')]=JSON['parse'](_0x5a3504['conditions']);_0x1affec[_0x08b0('0x3f')](_0x44265a(_0x5a3504[_0x08b0('0x80')][_0x08b0('0x68')]));}_0x15f77f=_0x1affec[_0x08b0('0x81')]();_0x1affec['limit'](_0x47f830);_0x1affec[_0x08b0('0x1e')](0x0);logger['debug'](_0x08b0('0x83'),_0x1affec[_0x08b0('0x84')]());return dbH['sequelize'][_0x08b0('0x36')](_0x1affec[_0x08b0('0x84')](),{'type':dbH['sequelize']['QueryTypes'][_0x08b0('0x87')]});}})['then'](function(){return{'sql':_0x15f77f['toString']()};})['then'](respondWithResult(_0x4ed9b8,null))[_0x08b0('0x4b')](handleError(_0x4ed9b8,null));};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js
index ecfe73e..2a59083 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 _0x6b08=['request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','define','analytics_custom_reports','util','../../config/logger','api','bluebird'];(function(_0x7ad6cb,_0xffee6c){var _0x22a0ba=function(_0x47f291){while(--_0x47f291){_0x7ad6cb['push'](_0x7ad6cb['shift']());}};_0x22a0ba(++_0xffee6c);}(_0x6b08,0x1ca));var _0x86b0=function(_0x3335e7,_0x28bd34){_0x3335e7=_0x3335e7-0x0;var _0x41c51f=_0x6b08[_0x3335e7];return _0x41c51f;};'use strict';var _=require('lodash');var util=require(_0x86b0('0x0'));var logger=require(_0x86b0('0x1'))(_0x86b0('0x2'));var moment=require('moment');var BPromise=require(_0x86b0('0x3'));var rp=require(_0x86b0('0x4'));var fs=require('fs');var path=require(_0x86b0('0x5'));var rimraf=require(_0x86b0('0x6'));var config=require(_0x86b0('0x7'));var attributes=require(_0x86b0('0x8'));module['exports']=function(_0x4840b9,_0x8cdd5d){return _0x4840b9[_0x86b0('0x9')]('AnalyticCustomReport',attributes,{'tableName':_0x86b0('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x1aac=['path','rimraf','./analyticCustomReport.attributes','exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3650ea,_0x4cf9ba){var _0x444030=function(_0x5051e8){while(--_0x5051e8){_0x3650ea['push'](_0x3650ea['shift']());}};_0x444030(++_0x4cf9ba);}(_0x1aac,0x159));var _0xc1aa=function(_0x294ae3,_0x418087){_0x294ae3=_0x294ae3-0x0;var _0x312b44=_0x1aac[_0x294ae3];return _0x312b44;};'use strict';var _=require(_0xc1aa('0x0'));var util=require(_0xc1aa('0x1'));var logger=require(_0xc1aa('0x2'))(_0xc1aa('0x3'));var moment=require(_0xc1aa('0x4'));var BPromise=require(_0xc1aa('0x5'));var rp=require(_0xc1aa('0x6'));var fs=require('fs');var path=require(_0xc1aa('0x7'));var rimraf=require(_0xc1aa('0x8'));var config=require('../../config/environment');var attributes=require(_0xc1aa('0x9'));module[_0xc1aa('0xa')]=function(_0x128b47,_0x2102c3){return _0x128b47['define']('AnalyticCustomReport',attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/analyticCustomReport.rpc.js b/server/api/analyticCustomReport/analyticCustomReport.rpc.js
index c90226b..96bfbfa 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 _0xce4e=['info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x138208,_0x140722){var _0x4f93b5=function(_0x1df020){while(--_0x1df020){_0x138208['push'](_0x138208['shift']());}};_0x4f93b5(++_0x140722);}(_0xce4e,0x1eb));var _0xece4=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xce4e[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xece4('0x0'));var util=require(_0xece4('0x1'));var moment=require(_0xece4('0x2'));var BPromise=require(_0xece4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xece4('0x4'));var db=require(_0xece4('0x5'))['db'];var utils=require(_0xece4('0x6'));var logger=require(_0xece4('0x7'))(_0xece4('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xece4('0x9')][_0xece4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a8616,_0x31107d,_0x410d3b){return new BPromise(function(_0x5eaaf7,_0x22cff2){return client[_0xece4('0xb')](_0x4a8616,_0x410d3b)[_0xece4('0xc')](function(_0x1257b9){logger[_0xece4('0xd')](_0xece4('0xe'),_0x31107d,'request\x20sent');logger[_0xece4('0xf')](_0xece4('0x10'),_0x31107d,_0xece4('0x11'),JSON[_0xece4('0x12')](_0x1257b9));if(_0x1257b9[_0xece4('0x13')]){if(_0x1257b9[_0xece4('0x13')][_0xece4('0x14')]===0x1f4){logger[_0xece4('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x31107d,_0x1257b9[_0xece4('0x13')][_0xece4('0x15')]);return _0x22cff2(_0x1257b9[_0xece4('0x13')]['message']);}logger[_0xece4('0x13')](_0xece4('0xe'),_0x31107d,_0x1257b9['error'][_0xece4('0x15')]);return _0x5eaaf7(_0x1257b9[_0xece4('0x13')]['message']);}else{logger[_0xece4('0xd')](_0xece4('0xe'),_0x31107d,_0xece4('0x11'));_0x5eaaf7(_0x1257b9[_0xece4('0x16')]['message']);}})[_0xece4('0x17')](function(_0x598222){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x31107d,_0x598222);_0x22cff2(_0x598222);});});}
\ No newline at end of file
+var _0xc626=['bluebird','../../config/utils','../../config/environment','jayson/promise','http','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util'];(function(_0x4557dc,_0x3687b2){var _0x1377aa=function(_0x41c62a){while(--_0x41c62a){_0x4557dc['push'](_0x4557dc['shift']());}};_0x1377aa(++_0x3687b2);}(_0xc626,0x18e));var _0x6c62=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc626[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6c62('0x0'));var util=require(_0x6c62('0x1'));var moment=require('moment');var BPromise=require(_0x6c62('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x6c62('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0x6c62('0x4'));var jayson=require(_0x6c62('0x5'));var client=jayson['client'][_0x6c62('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x59697a,_0x30f9e0,_0x117cc8){return new BPromise(function(_0x109f52,_0x3e7352){return client['request'](_0x59697a,_0x117cc8)['then'](function(_0x246d63){logger[_0x6c62('0x7')](_0x6c62('0x8'),_0x30f9e0,'request\x20sent');logger[_0x6c62('0x9')](_0x6c62('0xa'),_0x30f9e0,_0x6c62('0xb'),JSON[_0x6c62('0xc')](_0x246d63));if(_0x246d63[_0x6c62('0xd')]){if(_0x246d63[_0x6c62('0xd')]['code']===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x30f9e0,_0x246d63[_0x6c62('0xd')]['message']);return _0x3e7352(_0x246d63[_0x6c62('0xd')][_0x6c62('0xe')]);}logger[_0x6c62('0xd')]('AnalyticCustomReport,\x20%s,\x20%s',_0x30f9e0,_0x246d63[_0x6c62('0xd')][_0x6c62('0xe')]);return _0x109f52(_0x246d63[_0x6c62('0xd')]['message']);}else{logger[_0x6c62('0x7')](_0x6c62('0x8'),_0x30f9e0,'request\x20sent');_0x109f52(_0x246d63['result'][_0x6c62('0xe')]);}})[_0x6c62('0xf')](function(_0x1a586c){logger['error'](_0x6c62('0x8'),_0x30f9e0,_0x1a586c);_0x3e7352(_0x1a586c);});});}
\ No newline at end of file
diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js
index ff227cd..5929bff 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 _0xc7a3=['run','/:id/query','query','post','put','update','delete','destroy','exports','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','show','preview'];(function(_0x23f558,_0x34d026){var _0x55e9ec=function(_0x7f94e){while(--_0x7f94e){_0x23f558['push'](_0x23f558['shift']());}};_0x55e9ec(++_0x34d026);}(_0xc7a3,0x11a));var _0x3c7a=function(_0x3c293a,_0x170e9a){_0x3c293a=_0x3c293a-0x0;var _0x1a9e99=_0xc7a3[_0x3c293a];return _0x1a9e99;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x3c7a('0x0'));var express=require(_0x3c7a('0x1'));var router=express[_0x3c7a('0x2')]();var fs_extra=require(_0x3c7a('0x3'));var auth=require(_0x3c7a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3c7a('0x5'));var controller=require(_0x3c7a('0x6'));router[_0x3c7a('0x7')]('/',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0x9')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x3c7a('0xa')]);router[_0x3c7a('0x7')]('/:id/preview',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0xb')]);router['get']('/:id/run',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0xc')]);router[_0x3c7a('0x7')](_0x3c7a('0xd'),auth[_0x3c7a('0x8')](),controller[_0x3c7a('0xe')]);router[_0x3c7a('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3c7a('0x10')]('/:id',auth[_0x3c7a('0x8')](),controller[_0x3c7a('0x11')]);router[_0x3c7a('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3c7a('0x13')]);module[_0x3c7a('0x14')]=router;
\ No newline at end of file
+var _0xa7c6=['../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','preview','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','fs-extra','../../components/auth/service'];(function(_0x3dbf18,_0x3117a1){var _0x2f7531=function(_0x28e27d){while(--_0x28e27d){_0x3dbf18['push'](_0x3dbf18['shift']());}};_0x2f7531(++_0x3117a1);}(_0xa7c6,0x182));var _0x6a7c=function(_0x5ead07,_0x48677f){_0x5ead07=_0x5ead07-0x0;var _0x5c6896=_0xa7c6[_0x5ead07];return _0x5c6896;};'use strict';var multer=require(_0x6a7c('0x0'));var util=require(_0x6a7c('0x1'));var path=require('path');var timeout=require(_0x6a7c('0x2'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x6a7c('0x3'));var auth=require(_0x6a7c('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6a7c('0x5'));var controller=require(_0x6a7c('0x6'));router[_0x6a7c('0x7')]('/',auth[_0x6a7c('0x8')](),controller[_0x6a7c('0x9')]);router[_0x6a7c('0x7')](_0x6a7c('0xa'),auth[_0x6a7c('0x8')](),controller[_0x6a7c('0xb')]);router['get']('/:id/preview',auth[_0x6a7c('0x8')](),controller[_0x6a7c('0xc')]);router['get']('/:id/run',auth[_0x6a7c('0x8')](),controller[_0x6a7c('0xd')]);router[_0x6a7c('0x7')](_0x6a7c('0xe'),auth['isAuthenticated'](),controller[_0x6a7c('0xf')]);router[_0x6a7c('0x10')]('/',auth[_0x6a7c('0x8')](),controller[_0x6a7c('0x11')]);router[_0x6a7c('0x12')](_0x6a7c('0xa'),auth['isAuthenticated'](),controller[_0x6a7c('0x13')]);router[_0x6a7c('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6a7c('0x15')]);module[_0x6a7c('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
index db6ccc4..14a9d0e 100644
--- a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
+++ b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xbd51=['sequelize','STRING'];(function(_0x470d17,_0x32e508){var _0xd6558d=function(_0x23f372){while(--_0x23f372){_0x470d17['push'](_0x470d17['shift']());}};_0xd6558d(++_0x32e508);}(_0xbd51,0x1a8));var _0x1bd5=function(_0x54d9b0,_0x29b545){_0x54d9b0=_0x54d9b0-0x0;var _0x1f9ad0=_0xbd51[_0x54d9b0];return _0x1f9ad0;};'use strict';var Sequelize=require(_0x1bd5('0x0'));module['exports']={'name':{'type':Sequelize[_0x1bd5('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x1bd5('0x1')]},'parent':{'type':Sequelize[_0x1bd5('0x1')]},'table':{'type':Sequelize[_0x1bd5('0x1')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
+var _0x7217=['sequelize','STRING','TEXT'];(function(_0x189371,_0x41008e){var _0xd76c39=function(_0x1cbb20){while(--_0x1cbb20){_0x189371['push'](_0x189371['shift']());}};_0xd76c39(++_0x41008e);}(_0x7217,0x19e));var _0x7721=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0x7217[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x7721('0x0'));module['exports']={'name':{'type':Sequelize[_0x7721('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7721('0x1')]},'parent':{'type':Sequelize[_0x7721('0x1')]},'table':{'type':Sequelize[_0x7721('0x1')]},'conditions':{'type':Sequelize[_0x7721('0x2')]},'joins':{'type':Sequelize['TEXT']}};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js
index 9801e08..edadda2 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 _0xc4aa=['Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','AnalyticDefaultReport','findAll','rows','catch','show','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','AnalyticMetric','keyBy','select','from','table','MetricId','metric','function','replace','format','orderBy','joins','parentKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','parse','clone','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','COUNT(%s)','MAX(%s)','AVG(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','value','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','groupBy','alias','includes','foreignKey','output','web','fullPath','%s-%s.%s','randomstring','default','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','startDate','info','Run\x20Query:','child_process','fork','countTable','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NOT\x20NULL','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set'];(function(_0x23a299,_0x30e49c){var _0x560bb3=function(_0x1c8073){while(--_0x1c8073){_0x23a299['push'](_0x23a299['shift']());}};_0x560bb3(++_0x30e49c);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x342baa,_0x4a110f){_0x342baa=_0x342baa-0x0;var _0x1208f3=_0xc4aa[_0x342baa];return _0x1208f3;};'use strict';var emlformat=require(_0xac4a('0x0'));var rimraf=require(_0xac4a('0x1'));var zipdir=require(_0xac4a('0x2'));var jsonpatch=require(_0xac4a('0x3'));var rp=require(_0xac4a('0x4'));var moment=require(_0xac4a('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xac4a('0x6'));var sox=require(_0xac4a('0x7'));var csv=require(_0xac4a('0x8'));var ejs=require(_0xac4a('0x9'));var fs=require('fs');var fs_extra=require(_0xac4a('0xa'));var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x8'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var licenseUtil=require(_0xac4a('0x15'));var db=require(_0xac4a('0x16'))['db'];var dbH=require(_0xac4a('0x16'))['dbH'];function respondWithStatusCode(_0x21a79,_0x68424a){_0x68424a=_0x68424a||0xcc;return function(_0x247b78){if(_0x247b78){return _0x21a79[_0xac4a('0x17')](_0x68424a);}return _0x21a79[_0xac4a('0x18')](_0x68424a)[_0xac4a('0x19')]();};}function respondWithResult(_0x34bc01,_0x33c287){_0x33c287=_0x33c287||0xc8;return function(_0x190418){if(_0x190418){return _0x34bc01[_0xac4a('0x18')](_0x33c287)[_0xac4a('0x1a')](_0x190418);}};}function respondWithFilteredResult(_0x26dbb8,_0x4a2119){return function(_0x402fff){if(_0x402fff){var _0x34d797=typeof _0x4a2119[_0xac4a('0x1b')]===_0xac4a('0x1c')&&typeof _0x4a2119[_0xac4a('0x1d')]===_0xac4a('0x1c');var _0x28e304=_0x402fff[_0xac4a('0x1e')];var _0x546c5d=_0x34d797?0x0:_0x4a2119['offset'];var _0x21a729=_0x34d797?_0x402fff[_0xac4a('0x1e')]:_0x4a2119[_0xac4a('0x1b')]+_0x4a2119['limit'];var _0x39e83e;if(_0x21a729>=_0x28e304){_0x21a729=_0x28e304;_0x39e83e=0xc8;}else{_0x39e83e=0xce;}_0x26dbb8[_0xac4a('0x18')](_0x39e83e);return _0x26dbb8[_0xac4a('0x1f')](_0xac4a('0x20'),_0x546c5d+'-'+_0x21a729+'/'+_0x28e304)[_0xac4a('0x1a')](_0x402fff);}return null;};}function patchUpdates(_0x3e829c){return function(_0xe38996){try{jsonpatch[_0xac4a('0x21')](_0xe38996,_0x3e829c,!![]);}catch(_0x534092){return BPromise[_0xac4a('0x22')](_0x534092);}return _0xe38996[_0xac4a('0x23')]();};}function saveUpdates(_0x599787,_0x3d7ce0){return function(_0x4169c0){if(_0x4169c0){return _0x4169c0[_0xac4a('0x24')](_0x599787)[_0xac4a('0x25')](function(_0x4d2d6c){return _0x4d2d6c;});}return null;};}function removeEntity(_0x1b7998,_0x2503d8){return function(_0x15435c){if(_0x15435c){return _0x15435c[_0xac4a('0x26')]()[_0xac4a('0x25')](function(){var _0x2b0dc2=_0x15435c[_0xac4a('0x27')]({'plain':!![]});var _0x36054a=_0xac4a('0x28');return db[_0xac4a('0x29')][_0xac4a('0x26')]({'where':{'type':_0x36054a,'resourceId':_0x2b0dc2['id']}})[_0xac4a('0x25')](function(){return _0x15435c;});})[_0xac4a('0x25')](function(){_0x1b7998[_0xac4a('0x18')](0xcc)[_0xac4a('0x19')]();});}};}function handleEntityNotFound(_0x20202c,_0x4e17ce){return function(_0x23b061){if(!_0x23b061){_0x20202c[_0xac4a('0x17')](0x194);}return _0x23b061;};}function handleError(_0x42a33c,_0x2772fe){_0x2772fe=_0x2772fe||0x1f4;return function(_0x116700){logger['error'](_0x116700['stack']);if(_0x116700[_0xac4a('0x2a')]){delete _0x116700[_0xac4a('0x2a')];}_0x42a33c[_0xac4a('0x18')](_0x2772fe)['send'](_0x116700);};}exports['index']=function(_0x355755,_0x2896bc){var _0x228629={},_0x432066={},_0x17118e={'count':0x0,'rows':[]};var _0x53d3a5=_[_0xac4a('0x2b')](db['AnalyticDefaultReport'][_0xac4a('0x2c')],function(_0x57adcf){return{'name':_0x57adcf[_0xac4a('0x2d')],'type':_0x57adcf[_0xac4a('0x2e')][_0xac4a('0x2f')]};});_0x432066[_0xac4a('0x30')]=_[_0xac4a('0x2b')](_0x53d3a5,_0xac4a('0x2a'));_0x432066[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x355755[_0xac4a('0x31')]);_0x432066[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x432066[_0xac4a('0x30')],_0x432066[_0xac4a('0x31')]);_0x228629[_0xac4a('0x35')]=_['intersection'](_0x432066[_0xac4a('0x30')],qs[_0xac4a('0x36')](_0x355755['query'][_0xac4a('0x36')]));_0x228629[_0xac4a('0x35')]=_0x228629['attributes']['length']?_0x228629[_0xac4a('0x35')]:_0x432066[_0xac4a('0x30')];if(!_0x355755[_0xac4a('0x31')][_0xac4a('0x37')]('nolimit')){_0x228629[_0xac4a('0x1d')]=qs[_0xac4a('0x1d')](_0x355755['query'][_0xac4a('0x1d')]);_0x228629[_0xac4a('0x1b')]=qs[_0xac4a('0x1b')](_0x355755['query'][_0xac4a('0x1b')]);}_0x228629[_0xac4a('0x38')]=qs[_0xac4a('0x39')](_0x355755['query'][_0xac4a('0x39')]);_0x228629[_0xac4a('0x3a')]=qs['filters'](_['pick'](_0x355755[_0xac4a('0x31')],_0x432066['filters']),_0x53d3a5);if(_0x355755['query']['filter']){_0x228629['where']=_[_0xac4a('0x3b')](_0x228629[_0xac4a('0x3a')],{'$or':_[_0xac4a('0x2b')](_0x53d3a5,function(_0x472484){if(_0x472484[_0xac4a('0x2e')]!==_0xac4a('0x3c')){var _0x4220e2={};_0x4220e2[_0x472484[_0xac4a('0x2a')]]={'$like':'%'+_0x355755[_0xac4a('0x31')][_0xac4a('0x3d')]+'%'};return _0x4220e2;}})});}_0x228629=_[_0xac4a('0x3b')]({},_0x228629,_0x355755[_0xac4a('0x3e')]);var _0x4e4994={'where':_0x228629['where']};return db['AnalyticDefaultReport'][_0xac4a('0x1e')](_0x4e4994)[_0xac4a('0x25')](function(_0x14e80b){_0x17118e[_0xac4a('0x1e')]=_0x14e80b;if(_0x355755[_0xac4a('0x31')][_0xac4a('0x3f')]){_0x228629[_0xac4a('0x40')]=[{'all':!![]}];}return db[_0xac4a('0x41')][_0xac4a('0x42')](_0x228629);})[_0xac4a('0x25')](function(_0x561cb7){_0x17118e[_0xac4a('0x43')]=_0x561cb7;return _0x17118e;})[_0xac4a('0x25')](respondWithFilteredResult(_0x2896bc,_0x228629))[_0xac4a('0x44')](handleError(_0x2896bc,null));};exports[_0xac4a('0x45')]=function(_0x1a96cf,_0x57b879){var _0x8700b4={'raw':!![],'where':{'id':_0x1a96cf['params']['id']}},_0x1b77bb={};_0x1b77bb[_0xac4a('0x30')]=_['keys'](db[_0xac4a('0x41')][_0xac4a('0x2c')]);_0x1b77bb[_0xac4a('0x31')]=_[_0xac4a('0x32')](_0x1a96cf[_0xac4a('0x31')]);_0x1b77bb[_0xac4a('0x33')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],_0x1b77bb[_0xac4a('0x31')]);_0x8700b4[_0xac4a('0x35')]=_[_0xac4a('0x34')](_0x1b77bb[_0xac4a('0x30')],qs['fields'](_0x1a96cf[_0xac4a('0x31')][_0xac4a('0x36')]));_0x8700b4[_0xac4a('0x35')]=_0x8700b4['attributes'][_0xac4a('0x46')]?_0x8700b4[_0xac4a('0x35')]:_0x1b77bb['model'];if(_0x1a96cf[_0xac4a('0x31')]['includeAll']){_0x8700b4[_0xac4a('0x40')]=[{'all':!![]}];}_0x8700b4=_[_0xac4a('0x3b')]({},_0x8700b4,_0x1a96cf[_0xac4a('0x3e')]);return db['AnalyticDefaultReport']['find'](_0x8700b4)[_0xac4a('0x25')](handleEntityNotFound(_0x57b879,null))['then'](respondWithResult(_0x57b879,null))[_0xac4a('0x44')](handleError(_0x57b879,null));};exports['create']=function(_0x3d2aaf,_0x530bbb){return db[_0xac4a('0x41')][_0xac4a('0x47')](_0x3d2aaf[_0xac4a('0x48')],{})[_0xac4a('0x25')](function(_0x54782f){var _0x31c794=_0x3d2aaf[_0xac4a('0x49')][_0xac4a('0x27')]({'plain':!![]});if(!_0x31c794)throw new Error(_0xac4a('0x4a'));if(_0x31c794[_0xac4a('0x4b')]===_0xac4a('0x49')){var _0x187306=_0x54782f['get']({'plain':!![]});var _0x35dee5=_0xac4a('0x4c');return db['UserProfileSection'][_0xac4a('0x4d')]({'where':{'name':_0x35dee5,'userProfileId':_0x31c794[_0xac4a('0x4e')]},'raw':!![]})[_0xac4a('0x25')](function(_0x3ac36e){if(_0x3ac36e&&_0x3ac36e['autoAssociation']===0x0){return db[_0xac4a('0x29')][_0xac4a('0x47')]({'name':_0x187306[_0xac4a('0x2a')],'resourceId':_0x187306['id'],'type':_0xac4a('0x28'),'sectionId':_0x3ac36e['id']},{})[_0xac4a('0x25')](function(){return _0x54782f;});}else{return _0x54782f;}})['catch'](function(_0x179373){logger['error'](_0xac4a('0x4f'),_0x179373);throw _0x179373;});}return _0x54782f;})[_0xac4a('0x25')](respondWithResult(_0x530bbb,0xc9))['catch'](handleError(_0x530bbb,null));};exports['update']=function(_0x437466,_0x70fdc3){if(_0x437466['body']['id']){delete _0x437466[_0xac4a('0x48')]['id'];}return db[_0xac4a('0x41')][_0xac4a('0x4d')]({'where':{'id':_0x437466[_0xac4a('0x50')]['id']}})['then'](handleEntityNotFound(_0x70fdc3,null))[_0xac4a('0x25')](saveUpdates(_0x437466[_0xac4a('0x48')],null))[_0xac4a('0x25')](respondWithResult(_0x70fdc3,null))[_0xac4a('0x44')](handleError(_0x70fdc3,null));};exports[_0xac4a('0x26')]=function(_0x411547,_0x36179a){return db['AnalyticDefaultReport'][_0xac4a('0x4d')]({'where':{'id':_0x411547[_0xac4a('0x50')]['id']}})[_0xac4a('0x25')](handleEntityNotFound(_0x36179a,null))[_0xac4a('0x25')](removeEntity(_0x36179a,null))[_0xac4a('0x44')](handleError(_0x36179a,null));};exports[_0xac4a('0x51')]=function(_0x213df2,_0x236f57){var _0x159e43=0xa;var _0x786d9=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x5222f3={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xac4a('0x57'),'MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x5cac9b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x2f9940=function(_0xb7b884){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),'IS\x20NOT\x20EMPTY'],_0xb7b884);};var _0x347880=function(_0x19ce2c){if(!_0x19ce2c||!_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x429273='(',_0x2bc39a=0x0;_0x2bc39a<_0x19ce2c[_0xac4a('0x61')][_0xac4a('0x46')];_0x2bc39a+=0x1){_0x2bc39a>0x0&&(_0x429273+='\x20'+_0x19ce2c[_0xac4a('0x62')]+'\x20');_0x429273+=_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]?_0x347880(_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x63')]):_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x64')]+'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a][_0xac4a('0x65')]+(_0x2f9940(_0x19ce2c['rules'][_0x2bc39a][_0xac4a('0x65')])?'\x20'+_0x19ce2c[_0xac4a('0x61')][_0x2bc39a]['value']:'');}return _0x429273+')';};var _0x3c3576={'where':{'id':_0x213df2['params']['id']}},_0x34bd1c,_0x2d24c7,_0x2b8562,_0x357cac,_0x4d1440;_0x3c3576=_[_0xac4a('0x3b')]({},_0x3c3576,_0x213df2[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x3c3576)[_0xac4a('0x25')](function(_0x21ef8b){if(_0x21ef8b){_0x34bd1c=_0x21ef8b;return _0x21ef8b[_0xac4a('0x66')]();}return null;})[_0xac4a('0x25')](function(_0x44c60b){if(_0x44c60b){if(!_0x44c60b[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem']('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2d24c7=_0x44c60b;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x423f70){if(_0x423f70){_0x2b8562=_[_0xac4a('0x69')](_0x423f70,'id');var _0x283107;var _0x1d24bb=squel[_0xac4a('0x6a')]();_0x1d24bb[_0xac4a('0x6b')](_0x34bd1c[_0xac4a('0x6c')]);for(var _0xb09b89=0x0;_0xb09b89<_0x2d24c7[_0xac4a('0x46')];_0xb09b89+=0x1){_0x283107=_0x2d24c7[_0xb09b89]['MetricId']?_0x2b8562[_0x2d24c7[_0xb09b89][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x2d24c7[_0xb09b89][_0xac4a('0x64')];_0x283107=_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]?_['replace'](_0x5222f3[_0x2d24c7[_0xb09b89][_0xac4a('0x6f')]],'%s',_0x283107):_0x283107;_0x283107=_0x2d24c7[_0xb09b89]['format']?_[_0xac4a('0x70')](_0x5cac9b[_0x2d24c7[_0xb09b89][_0xac4a('0x71')]],'%s',_0x283107):_0x283107;if(_0x2d24c7[_0xb09b89]['groupBy']){_0x1d24bb['group'](_0x283107);}_0x2d24c7[_0xb09b89][_0xac4a('0x72')]&&_0x1d24bb[_0xac4a('0x38')](_0x283107,_0x2d24c7[_0xb09b89][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x1d24bb[_0xac4a('0x64')](_0x283107,_0x2d24c7[_0xb09b89]['alias']||_0x283107);}if(_0x34bd1c[_0xac4a('0x73')]){_0x34bd1c['joins']=JSON['parse'](_0x34bd1c[_0xac4a('0x73')]);for(var _0x56ef2a=0x0;_0x56ef2a<_0x34bd1c[_0xac4a('0x73')]['length'];_0x56ef2a+=0x1){if(_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x2e')]&&_['includes'](_0x786d9,_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type'])&&_0x34bd1c[_0xac4a('0x73')][_0x56ef2a][_0xac4a('0x74')]&&_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')]&&_0x34bd1c['joins'][_0x56ef2a]['foreignKey']){_0x1d24bb[_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['type']](_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignTable'],null,util['format'](_0xac4a('0x76'),_0x34bd1c[_0xac4a('0x6c')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['parentKey'],_0x34bd1c['joins'][_0x56ef2a][_0xac4a('0x75')],_0x34bd1c[_0xac4a('0x73')][_0x56ef2a]['foreignKey']));}}}if(_0x34bd1c['conditions']){_0x34bd1c[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x34bd1c[_0xac4a('0x77')]);_0x1d24bb[_0xac4a('0x3a')](_0x347880(_0x34bd1c[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x4d1440=_0x1d24bb[_0xac4a('0x79')]();_0x1d24bb[_0xac4a('0x1d')](_0x159e43);_0x1d24bb[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x1d24bb[_0xac4a('0x7b')]());return dbH[_0xac4a('0x7c')]['query'](_0x1d24bb[_0xac4a('0x7b')](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')][_0xac4a('0x7e')]});}})[_0xac4a('0x25')](respondWithResult(_0x236f57,null))['catch'](handleError(_0x236f57,null));};function runReport(_0x290a73,_0x19ce24,_0xc9d040){var _0x37e519=_0x19ce24[_0xac4a('0x2a')];var _0x451248=0xa;var _0xd7bdd6=['join',_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0x35a97c={'SUM':_0xac4a('0x56'),'COUNT':_0xac4a('0x7f'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xac4a('0x80'),'MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0x56a934={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x212a22=function(_0x1fe86a){return!_['includes']([_0xac4a('0x5f'),'IS\x20NOT\x20NULL',_0xac4a('0x60'),_0xac4a('0x83')],_0x1fe86a);};var _0x406b64=function(_0x35328e){if(!_0x35328e||!_0x35328e[_0xac4a('0x61')]['length']){return'';}for(var _0x50f471='(',_0x31cda0=0x0;_0x31cda0<_0x35328e[_0xac4a('0x61')][_0xac4a('0x46')];_0x31cda0+=0x1){_0x31cda0>0x0&&(_0x50f471+='\x20'+_0x35328e[_0xac4a('0x62')]+'\x20');_0x50f471+=_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]?_0x406b64(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x63')]):_0x35328e['rules'][_0x31cda0]['field']+'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')]+(_0x212a22(_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x65')])?'\x20'+_0x35328e[_0xac4a('0x61')][_0x31cda0][_0xac4a('0x84')]:'');}return _0x50f471+')';};var _0xdaa2ef={'where':{'id':_0x290a73['id']}},_0x2e704b,_0x540d8e,_0x5e0be4,_0x32fd0c,_0x168f30;_0xdaa2ef=_[_0xac4a('0x3b')]({},_0xdaa2ef,_0xc9d040);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0xdaa2ef)[_0xac4a('0x25')](function(_0x338af3){if(_0x338af3){_0x2e704b=_0x338af3;return _0x338af3['getFields']();}return null;})[_0xac4a('0x25')](function(_0x1bacf2){if(_0x1bacf2){if(!_0x1bacf2[_0xac4a('0x46')]){throw new db['Sequelize'][(_0xac4a('0x85'))](_0xac4a('0x86'),0x193);}_0x540d8e=_0x1bacf2;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x27d023){if(_0x27d023){_0x5e0be4=_[_0xac4a('0x69')](_0x27d023,'id');var _0x2ef42a;var _0x322465=squel['select']();_0x322465[_0xac4a('0x6b')](_0x2e704b['table']);for(var _0x203321=0x0;_0x203321<_0x540d8e[_0xac4a('0x46')];_0x203321+=0x1){_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6d')]?_0x5e0be4[_0x540d8e[_0x203321][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x540d8e[_0x203321][_0xac4a('0x64')];_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x6f')]?_['replace'](_0x35a97c[_0x540d8e[_0x203321][_0xac4a('0x6f')]],'%s',_0x2ef42a):_0x2ef42a;_0x2ef42a=_0x540d8e[_0x203321][_0xac4a('0x71')]?_[_0xac4a('0x70')](_0x56a934[_0x540d8e[_0x203321][_0xac4a('0x71')]],'%s',_0x2ef42a):_0x2ef42a;if(_0x540d8e[_0x203321][_0xac4a('0x87')]){_0x322465['group'](_0x2ef42a);}_0x540d8e[_0x203321][_0xac4a('0x72')]&&_0x322465[_0xac4a('0x38')](_0x2ef42a,_0x540d8e[_0x203321]['orderBy']==='DESC'?![]:!![]);_0x322465[_0xac4a('0x64')](_0x2ef42a,_0x540d8e[_0x203321][_0xac4a('0x88')]||_0x2ef42a);}if(_0x2e704b['joins']){_0x2e704b[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x73')]);for(var _0x37657e=0x0;_0x37657e<_0x2e704b[_0xac4a('0x73')][_0xac4a('0x46')];_0x37657e+=0x1){if(_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]&&_[_0xac4a('0x89')](_0xd7bdd6,_0x2e704b[_0xac4a('0x73')][_0x37657e]['type'])&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x74')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x75')]&&_0x2e704b[_0xac4a('0x73')][_0x37657e][_0xac4a('0x8a')]){_0x322465[_0x2e704b['joins'][_0x37657e][_0xac4a('0x2e')]](_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],null,util[_0xac4a('0x71')]('%s.%s\x20=\x20%s.%s',_0x2e704b[_0xac4a('0x6c')],_0x2e704b[_0xac4a('0x73')][_0x37657e]['parentKey'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignTable'],_0x2e704b[_0xac4a('0x73')][_0x37657e]['foreignKey']));}}}if(_0x2e704b[_0xac4a('0x77')]){_0x2e704b[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2e704b[_0xac4a('0x77')]);_0x322465[_0xac4a('0x3a')](_0x406b64(_0x2e704b[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x168f30=_0x322465[_0xac4a('0x79')]();_0x322465[_0xac4a('0x1d')](_0x451248);_0x322465[_0xac4a('0x1b')](0x0);return;}})[_0xac4a('0x25')](function(){if(_0x19ce24[_0xac4a('0x8b')]===_0xac4a('0x8c')){return null;}var _0x4217df=_['merge'](_0x19ce24,{'name':_0x19ce24[_0xac4a('0x8d')]||_0x19ce24[_0xac4a('0x2a')]||_0x2e704b['name'],'basename':_0x37e519,'savename':util[_0xac4a('0x71')](_0xac4a('0x8e'),_0x19ce24[_0xac4a('0x2a')]||_0x2e704b[_0xac4a('0x2a')],require(_0xac4a('0x8f'))['generate'](0x4),_0x19ce24[_0xac4a('0x8b')]||'csv'),'reportId':_0x2e704b['id'],'reportType':_0xac4a('0x90')});return db[_0xac4a('0x91')][_0xac4a('0x47')](_0x4217df,{'raw':!![]});})[_0xac4a('0x25')](function(_0x53f23d){if(_0x2e704b[_0xac4a('0x6c')]==='cdr'){_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+_0xac4a('0x92'),_0x19ce24['startDate'],_0x19ce24[_0xac4a('0x93')]);}else{_0x168f30[_0xac4a('0x3a')](_0x2e704b[_0xac4a('0x6c')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x19ce24[_0xac4a('0x94')],_0x19ce24[_0xac4a('0x93')]);}if(_0x53f23d){logger[_0xac4a('0x95')](_0xac4a('0x96'),_0x168f30[_0xac4a('0x7b')]());require(_0xac4a('0x97'))[_0xac4a('0x98')](path[_0xac4a('0x52')](__dirname,'../../components/export/',_0x53f23d[_0xac4a('0x8b')]),[_0x53f23d['id'],_0x168f30['toString'](),path['join'](__dirname,'../../files/reports',_0x53f23d['savename']),_0x37e519]);return _0x53f23d;}else{var _0x502275=squel[_0xac4a('0x6a')]();_0x502275[_0xac4a('0x6b')]('('+_0x168f30[_0xac4a('0x7b')]()+')',_0xac4a('0x99'));_0x502275[_0xac4a('0x64')]('COUNT(*)',_0xac4a('0x1e'));_0x168f30[_0xac4a('0x1d')](_0x19ce24[_0xac4a('0x1d')]||_0x451248);_0x168f30[_0xac4a('0x1b')](_0x19ce24[_0xac4a('0x1b')]||0x0);return dbH[_0xac4a('0x7c')][_0xac4a('0x31')](_0x502275[_0xac4a('0x7b')](),{'type':dbH['sequelize'][_0xac4a('0x7d')][_0xac4a('0x7e')]})[_0xac4a('0x25')](function(_0x25331f){if(!_0x25331f[_0xac4a('0x46')]){_0x32fd0c=0x0;}else{_0x32fd0c=_0x25331f[0x0][_0xac4a('0x1e')]||0x0;}return dbH[_0xac4a('0x7c')]['query'](_0x168f30['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});})[_0xac4a('0x25')](function(_0x366f5a){return{'rows':_0x366f5a||[],'count':_0x32fd0c};});}});}exports['run']=function(_0x5bd013,_0x2fe103){return runReport(_0x5bd013[_0xac4a('0x50')],_0x5bd013[_0xac4a('0x31')],_0x5bd013[_0xac4a('0x3e')])[_0xac4a('0x25')](respondWithResult(_0x2fe103,null))['catch'](handleError(_0x2fe103,null));};exports[_0xac4a('0x9a')]=runReport;exports['query']=function(_0x4f2d85,_0x538cfd){var _0x63c30=0xa;var _0x4301c3=[_0xac4a('0x52'),_0xac4a('0x53'),_0xac4a('0x54'),_0xac4a('0x55')];var _0xcad25d={'SUM':_0xac4a('0x56'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xac4a('0x58'),'AVG':_0xac4a('0x81'),'GROUP_CONCAT':_0xac4a('0x59'),'GROUP_CONCAT ASC':_0xac4a('0x9b'),'GROUP_CONCAT DESC':_0xac4a('0x5a')};var _0xcd140e={'SEC_TO_TIME':_0xac4a('0x82'),'DATE':_0xac4a('0x5b'),'HOUR':_0xac4a('0x5c'),'ROUND':_0xac4a('0x5d'),'UNIX_TIMESTAMP':_0xac4a('0x5e')};var _0x37cb49=function(_0xe0fd57){return!_[_0xac4a('0x89')]([_0xac4a('0x5f'),_0xac4a('0x9c'),_0xac4a('0x60'),_0xac4a('0x83')],_0xe0fd57);};var _0x41cdb5=function(_0x172d03){if(!_0x172d03||!_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')]){return'';}for(var _0x3e2575='(',_0x4cc581=0x0;_0x4cc581<_0x172d03[_0xac4a('0x61')][_0xac4a('0x46')];_0x4cc581+=0x1){_0x4cc581>0x0&&(_0x3e2575+='\x20'+_0x172d03[_0xac4a('0x62')]+'\x20');_0x3e2575+=_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]?_0x41cdb5(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x63')]):_0x172d03[_0xac4a('0x61')][_0x4cc581]['field']+'\x20'+_0x172d03['rules'][_0x4cc581][_0xac4a('0x65')]+(_0x37cb49(_0x172d03[_0xac4a('0x61')][_0x4cc581][_0xac4a('0x65')])?'\x20'+_0x172d03['rules'][_0x4cc581]['value']:'');}return _0x3e2575+')';};var _0x5de198={'where':{'id':_0x4f2d85[_0xac4a('0x50')]['id']}},_0x2b6773,_0x52df82,_0x59e82c,_0x216055,_0x52963c;_0x5de198=_['merge']({},_0x5de198,_0x4f2d85[_0xac4a('0x3e')]);return db[_0xac4a('0x41')][_0xac4a('0x4d')](_0x5de198)[_0xac4a('0x25')](function(_0x403a16){if(_0x403a16){_0x2b6773=_0x403a16;return _0x403a16[_0xac4a('0x66')]();}return null;})['then'](function(_0x25bf23){if(_0x25bf23){if(!_0x25bf23[_0xac4a('0x46')]){throw new db[(_0xac4a('0x67'))]['ValidationErrorItem'](_0xac4a('0x86'),0x193);}_0x52df82=_0x25bf23;return db[_0xac4a('0x68')][_0xac4a('0x42')]({'raw':!![]});}return null;})[_0xac4a('0x25')](function(_0x5bb911){if(_0x5bb911){_0x59e82c=_[_0xac4a('0x69')](_0x5bb911,'id');var _0x403f5a;var _0x3eae2f=squel[_0xac4a('0x6a')]();_0x3eae2f[_0xac4a('0x6b')](_0x2b6773[_0xac4a('0x6c')]);for(var _0x4a0cd9=0x0;_0x4a0cd9<_0x52df82['length'];_0x4a0cd9+=0x1){_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]?_0x59e82c[_0x52df82[_0x4a0cd9][_0xac4a('0x6d')]][_0xac4a('0x6e')]:_0x52df82[_0x4a0cd9][_0xac4a('0x64')];_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x6f')]?_[_0xac4a('0x70')](_0xcad25d[_0x52df82[_0x4a0cd9]['function']],'%s',_0x403f5a):_0x403f5a;_0x403f5a=_0x52df82[_0x4a0cd9][_0xac4a('0x71')]?_['replace'](_0xcd140e[_0x52df82[_0x4a0cd9][_0xac4a('0x71')]],'%s',_0x403f5a):_0x403f5a;if(_0x52df82[_0x4a0cd9]['groupBy']){_0x3eae2f[_0xac4a('0x63')](_0x403f5a);}_0x52df82[_0x4a0cd9][_0xac4a('0x72')]&&_0x3eae2f[_0xac4a('0x38')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x72')]==='DESC'?![]:!![]);_0x3eae2f[_0xac4a('0x64')](_0x403f5a,_0x52df82[_0x4a0cd9][_0xac4a('0x88')]||_0x403f5a);}if(_0x2b6773[_0xac4a('0x73')]){_0x2b6773[_0xac4a('0x73')]=JSON[_0xac4a('0x78')](_0x2b6773['joins']);for(var _0x3dd60a=0x0;_0x3dd60a<_0x2b6773[_0xac4a('0x73')][_0xac4a('0x46')];_0x3dd60a+=0x1){if(_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')]&&_['includes'](_0x4301c3,_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x2e')])&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')]&&_0x2b6773[_0xac4a('0x73')][_0x3dd60a]['foreignTable']&&_0x2b6773['joins'][_0x3dd60a]['foreignKey']){_0x3eae2f[_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x2e')]](_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x75')],null,util[_0xac4a('0x71')](_0xac4a('0x76'),_0x2b6773['table'],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x74')],_0x2b6773['joins'][_0x3dd60a][_0xac4a('0x75')],_0x2b6773[_0xac4a('0x73')][_0x3dd60a][_0xac4a('0x8a')]));}}}if(_0x2b6773['conditions']){_0x2b6773[_0xac4a('0x77')]=JSON[_0xac4a('0x78')](_0x2b6773[_0xac4a('0x77')]);_0x3eae2f[_0xac4a('0x3a')](_0x41cdb5(_0x2b6773[_0xac4a('0x77')][_0xac4a('0x63')]));}_0x52963c=_0x3eae2f[_0xac4a('0x79')]();_0x3eae2f[_0xac4a('0x1d')](_0x63c30);_0x3eae2f[_0xac4a('0x1b')](0x0);logger['debug'](_0xac4a('0x7a'),_0x3eae2f[_0xac4a('0x7b')]());return dbH['sequelize'][_0xac4a('0x31')](_0x3eae2f['toString'](),{'type':dbH[_0xac4a('0x7c')][_0xac4a('0x7d')]['SELECT']});}})[_0xac4a('0x25')](function(){return{'sql':_0x52963c[_0xac4a('0x7b')]()};})[_0xac4a('0x25')](respondWithResult(_0x538cfd,null))[_0xac4a('0x44')](handleError(_0x538cfd,null));};
\ No newline at end of file
+var _0x6d38=['Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','select','countTable','COUNT(*)','sequelize','run','SEC_TO_TIME(%s)','rimraf','zip-dir','fast-json-patch','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','dbH','sendStatus','status','json','offset','undefined','limit','count','Content-Range','save','update','then','get','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','AnalyticDefaultReport','findAll','rows','show','keys','fields','find','catch','create','body','user','role','Reports','autoAssociation','UserProfileResource','DefaultReports','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20EMPTY','rules','operator','group','field','condition','value','getFields','ValidationErrorItem','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','alias','joins','parse','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','QueryTypes','SELECT','left_join','COUNT(DISTINCT\x20%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','DESC','%s.%s\x20=\x20%s.%s','output','web','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','info'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x6d38,0x1ef));var _0x86d3=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x6d38[_0x173441];return _0x2423a8;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x86d3('0x0'));var zipdir=require(_0x86d3('0x1'));var jsonpatch=require(_0x86d3('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x86d3('0x3'));var Mustache=require('mustache');var util=require(_0x86d3('0x4'));var path=require(_0x86d3('0x5'));var sox=require(_0x86d3('0x6'));var csv=require('to-csv');var ejs=require(_0x86d3('0x7'));var fs=require('fs');var fs_extra=require(_0x86d3('0x8'));var _=require(_0x86d3('0x9'));var squel=require(_0x86d3('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x86d3('0xb'));var toCsv=require(_0x86d3('0xc'));var querystring=require(_0x86d3('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86d3('0xe'));var qs=require(_0x86d3('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x86d3('0x10'))(_0x86d3('0x11'));var utils=require('../../config/utils');var config=require(_0x86d3('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x86d3('0x13'))['db'];var dbH=require(_0x86d3('0x13'))[_0x86d3('0x14')];function respondWithStatusCode(_0x26d64c,_0xe1b3d7){_0xe1b3d7=_0xe1b3d7||0xcc;return function(_0x1b8d0a){if(_0x1b8d0a){return _0x26d64c[_0x86d3('0x15')](_0xe1b3d7);}return _0x26d64c[_0x86d3('0x16')](_0xe1b3d7)['end']();};}function respondWithResult(_0x1c1ba8,_0x1f35cf){_0x1f35cf=_0x1f35cf||0xc8;return function(_0x356e7d){if(_0x356e7d){return _0x1c1ba8[_0x86d3('0x16')](_0x1f35cf)[_0x86d3('0x17')](_0x356e7d);}};}function respondWithFilteredResult(_0x34fb3b,_0x1ff008){return function(_0x44436d){if(_0x44436d){var _0x53b437=typeof _0x1ff008[_0x86d3('0x18')]===_0x86d3('0x19')&&typeof _0x1ff008[_0x86d3('0x1a')]===_0x86d3('0x19');var _0x46feec=_0x44436d[_0x86d3('0x1b')];var _0x33e459=_0x53b437?0x0:_0x1ff008[_0x86d3('0x18')];var _0x9b76f2=_0x53b437?_0x44436d['count']:_0x1ff008[_0x86d3('0x18')]+_0x1ff008['limit'];var _0x6ced9e;if(_0x9b76f2>=_0x46feec){_0x9b76f2=_0x46feec;_0x6ced9e=0xc8;}else{_0x6ced9e=0xce;}_0x34fb3b['status'](_0x6ced9e);return _0x34fb3b['set'](_0x86d3('0x1c'),_0x33e459+'-'+_0x9b76f2+'/'+_0x46feec)[_0x86d3('0x17')](_0x44436d);}return null;};}function patchUpdates(_0x988066){return function(_0x1720ae){try{jsonpatch['apply'](_0x1720ae,_0x988066,!![]);}catch(_0x2901de){return BPromise['reject'](_0x2901de);}return _0x1720ae[_0x86d3('0x1d')]();};}function saveUpdates(_0x3fdf67,_0x1ce849){return function(_0x5b990d){if(_0x5b990d){return _0x5b990d[_0x86d3('0x1e')](_0x3fdf67)[_0x86d3('0x1f')](function(_0x1fa4ac){return _0x1fa4ac;});}return null;};}function removeEntity(_0x4bf5b8,_0x58ba51){return function(_0x26262a){if(_0x26262a){return _0x26262a['destroy']()[_0x86d3('0x1f')](function(){var _0x1bea5e=_0x26262a[_0x86d3('0x20')]({'plain':!![]});var _0x3c5fe4='DefaultReports';return db['UserProfileResource'][_0x86d3('0x21')]({'where':{'type':_0x3c5fe4,'resourceId':_0x1bea5e['id']}})[_0x86d3('0x1f')](function(){return _0x26262a;});})['then'](function(){_0x4bf5b8[_0x86d3('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x42413c,_0x41e2f0){return function(_0x287b96){if(!_0x287b96){_0x42413c[_0x86d3('0x15')](0x194);}return _0x287b96;};}function handleError(_0x11a6fd,_0x14c9ff){_0x14c9ff=_0x14c9ff||0x1f4;return function(_0x1f203e){logger[_0x86d3('0x22')](_0x1f203e[_0x86d3('0x23')]);if(_0x1f203e[_0x86d3('0x24')]){delete _0x1f203e[_0x86d3('0x24')];}_0x11a6fd[_0x86d3('0x16')](_0x14c9ff)[_0x86d3('0x25')](_0x1f203e);};}exports[_0x86d3('0x26')]=function(_0x5b09f6,_0x120a0c){var _0x403be3={},_0x2bda35={},_0x31cefe={'count':0x0,'rows':[]};var _0x7709f0=_[_0x86d3('0x27')](db['AnalyticDefaultReport'][_0x86d3('0x28')],function(_0x5c71df){return{'name':_0x5c71df['fieldName'],'type':_0x5c71df[_0x86d3('0x29')][_0x86d3('0x2a')]};});_0x2bda35[_0x86d3('0x2b')]=_['map'](_0x7709f0,_0x86d3('0x24'));_0x2bda35[_0x86d3('0x2c')]=_['keys'](_0x5b09f6[_0x86d3('0x2c')]);_0x2bda35[_0x86d3('0x2d')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],_0x2bda35[_0x86d3('0x2c')]);_0x403be3[_0x86d3('0x2f')]=_[_0x86d3('0x2e')](_0x2bda35[_0x86d3('0x2b')],qs['fields'](_0x5b09f6['query']['fields']));_0x403be3[_0x86d3('0x2f')]=_0x403be3['attributes'][_0x86d3('0x30')]?_0x403be3['attributes']:_0x2bda35[_0x86d3('0x2b')];if(!_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x31')](_0x86d3('0x32'))){_0x403be3[_0x86d3('0x1a')]=qs[_0x86d3('0x1a')](_0x5b09f6[_0x86d3('0x2c')]['limit']);_0x403be3[_0x86d3('0x18')]=qs[_0x86d3('0x18')](_0x5b09f6['query'][_0x86d3('0x18')]);}_0x403be3[_0x86d3('0x33')]=qs[_0x86d3('0x34')](_0x5b09f6[_0x86d3('0x2c')]['sort']);_0x403be3[_0x86d3('0x35')]=qs[_0x86d3('0x2d')](_[_0x86d3('0x36')](_0x5b09f6['query'],_0x2bda35[_0x86d3('0x2d')]),_0x7709f0);if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x37')]){_0x403be3[_0x86d3('0x35')]=_[_0x86d3('0x38')](_0x403be3[_0x86d3('0x35')],{'$or':_[_0x86d3('0x27')](_0x7709f0,function(_0x436065){if(_0x436065['type']!==_0x86d3('0x39')){var _0x470978={};_0x470978[_0x436065[_0x86d3('0x24')]]={'$like':'%'+_0x5b09f6[_0x86d3('0x2c')]['filter']+'%'};return _0x470978;}})});}_0x403be3=_[_0x86d3('0x38')]({},_0x403be3,_0x5b09f6[_0x86d3('0x3a')]);var _0x6f72be={'where':_0x403be3[_0x86d3('0x35')]};return db['AnalyticDefaultReport']['count'](_0x6f72be)[_0x86d3('0x1f')](function(_0x4f422b){_0x31cefe['count']=_0x4f422b;if(_0x5b09f6[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x403be3[_0x86d3('0x3c')]=[{'all':!![]}];}return db[_0x86d3('0x3d')][_0x86d3('0x3e')](_0x403be3);})['then'](function(_0x2a5f6c){_0x31cefe[_0x86d3('0x3f')]=_0x2a5f6c;return _0x31cefe;})[_0x86d3('0x1f')](respondWithFilteredResult(_0x120a0c,_0x403be3))['catch'](handleError(_0x120a0c,null));};exports[_0x86d3('0x40')]=function(_0x810d10,_0x5dfae8){var _0x369f68={'raw':!![],'where':{'id':_0x810d10['params']['id']}},_0xcf6c9e={};_0xcf6c9e['model']=_['keys'](db[_0x86d3('0x3d')][_0x86d3('0x28')]);_0xcf6c9e[_0x86d3('0x2c')]=_[_0x86d3('0x41')](_0x810d10[_0x86d3('0x2c')]);_0xcf6c9e[_0x86d3('0x2d')]=_['intersection'](_0xcf6c9e[_0x86d3('0x2b')],_0xcf6c9e[_0x86d3('0x2c')]);_0x369f68['attributes']=_[_0x86d3('0x2e')](_0xcf6c9e[_0x86d3('0x2b')],qs[_0x86d3('0x42')](_0x810d10[_0x86d3('0x2c')][_0x86d3('0x42')]));_0x369f68[_0x86d3('0x2f')]=_0x369f68['attributes'][_0x86d3('0x30')]?_0x369f68[_0x86d3('0x2f')]:_0xcf6c9e['model'];if(_0x810d10[_0x86d3('0x2c')][_0x86d3('0x3b')]){_0x369f68[_0x86d3('0x3c')]=[{'all':!![]}];}_0x369f68=_[_0x86d3('0x38')]({},_0x369f68,_0x810d10[_0x86d3('0x3a')]);return db['AnalyticDefaultReport'][_0x86d3('0x43')](_0x369f68)[_0x86d3('0x1f')](handleEntityNotFound(_0x5dfae8,null))[_0x86d3('0x1f')](respondWithResult(_0x5dfae8,null))[_0x86d3('0x44')](handleError(_0x5dfae8,null));};exports[_0x86d3('0x45')]=function(_0x7af7b3,_0x1a4345){return db[_0x86d3('0x3d')][_0x86d3('0x45')](_0x7af7b3[_0x86d3('0x46')],{})[_0x86d3('0x1f')](function(_0x1236ea){var _0x4ea940=_0x7af7b3[_0x86d3('0x47')][_0x86d3('0x20')]({'plain':!![]});if(!_0x4ea940)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4ea940[_0x86d3('0x48')]===_0x86d3('0x47')){var _0x197047=_0x1236ea[_0x86d3('0x20')]({'plain':!![]});var _0x1dcff0=_0x86d3('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x1dcff0,'userProfileId':_0x4ea940['userProfileId']},'raw':!![]})['then'](function(_0x159253){if(_0x159253&&_0x159253[_0x86d3('0x4a')]===0x0){return db[_0x86d3('0x4b')][_0x86d3('0x45')]({'name':_0x197047[_0x86d3('0x24')],'resourceId':_0x197047['id'],'type':_0x86d3('0x4c'),'sectionId':_0x159253['id']},{})[_0x86d3('0x1f')](function(){return _0x1236ea;});}else{return _0x1236ea;}})['catch'](function(_0x2afb07){logger[_0x86d3('0x22')](_0x86d3('0x4d'),_0x2afb07);throw _0x2afb07;});}return _0x1236ea;})[_0x86d3('0x1f')](respondWithResult(_0x1a4345,0xc9))[_0x86d3('0x44')](handleError(_0x1a4345,null));};exports[_0x86d3('0x1e')]=function(_0x34935f,_0x4c8828){if(_0x34935f[_0x86d3('0x46')]['id']){delete _0x34935f['body']['id'];}return db[_0x86d3('0x3d')][_0x86d3('0x43')]({'where':{'id':_0x34935f[_0x86d3('0x4e')]['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4c8828,null))[_0x86d3('0x1f')](saveUpdates(_0x34935f['body'],null))[_0x86d3('0x1f')](respondWithResult(_0x4c8828,null))[_0x86d3('0x44')](handleError(_0x4c8828,null));};exports[_0x86d3('0x21')]=function(_0x4e10d9,_0x4ad164){return db['AnalyticDefaultReport'][_0x86d3('0x43')]({'where':{'id':_0x4e10d9['params']['id']}})[_0x86d3('0x1f')](handleEntityNotFound(_0x4ad164,null))[_0x86d3('0x1f')](removeEntity(_0x4ad164,null))[_0x86d3('0x44')](handleError(_0x4ad164,null));};exports[_0x86d3('0x4f')]=function(_0x5963bb,_0x4cd835){var _0x551806=0xa;var _0x28655a=[_0x86d3('0x50'),'left_join',_0x86d3('0x51'),_0x86d3('0x52')];var _0xa085b2={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x86d3('0x59')};var _0x41fad7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x86d3('0x5a'),'HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':_0x86d3('0x5d')};var _0x4598d4=function(_0x4029a4){return!_[_0x86d3('0x5e')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x86d3('0x5f'),'IS\x20NOT\x20EMPTY'],_0x4029a4);};var _0x528ca8=function(_0x58e4b6){if(!_0x58e4b6||!_0x58e4b6[_0x86d3('0x60')]['length']){return'';}for(var _0x254ac3='(',_0x5f2ed6=0x0;_0x5f2ed6<_0x58e4b6[_0x86d3('0x60')][_0x86d3('0x30')];_0x5f2ed6+=0x1){_0x5f2ed6>0x0&&(_0x254ac3+='\x20'+_0x58e4b6[_0x86d3('0x61')]+'\x20');_0x254ac3+=_0x58e4b6['rules'][_0x5f2ed6]['group']?_0x528ca8(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x62')]):_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x63')]+'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')]+(_0x4598d4(_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x64')])?'\x20'+_0x58e4b6[_0x86d3('0x60')][_0x5f2ed6][_0x86d3('0x65')]:'');}return _0x254ac3+')';};var _0x1e3479={'where':{'id':_0x5963bb[_0x86d3('0x4e')]['id']}},_0x265beb,_0xfaf168,_0xf0dbbb,_0x3f978c,_0x5e1835;_0x1e3479=_[_0x86d3('0x38')]({},_0x1e3479,_0x5963bb['options']);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x1e3479)[_0x86d3('0x1f')](function(_0x52dc99){if(_0x52dc99){_0x265beb=_0x52dc99;return _0x52dc99[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x45e8d9){if(_0x45e8d9){if(!_0x45e8d9[_0x86d3('0x30')]){throw new db['Sequelize'][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xfaf168=_0x45e8d9;return db[_0x86d3('0x68')][_0x86d3('0x3e')]({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2d4bc1){if(_0x2d4bc1){_0xf0dbbb=_[_0x86d3('0x69')](_0x2d4bc1,'id');var _0x56fd96;var _0x3cc1d8=squel['select']();_0x3cc1d8[_0x86d3('0x6a')](_0x265beb[_0x86d3('0x6b')]);for(var _0x5866fe=0x0;_0x5866fe<_0xfaf168[_0x86d3('0x30')];_0x5866fe+=0x1){_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6c')]?_0xf0dbbb[_0xfaf168[_0x5866fe][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0xfaf168[_0x5866fe][_0x86d3('0x63')];_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0xa085b2[_0xfaf168[_0x5866fe]['function']],'%s',_0x56fd96):_0x56fd96;_0x56fd96=_0xfaf168[_0x5866fe][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x41fad7[_0xfaf168[_0x5866fe][_0x86d3('0x70')]],'%s',_0x56fd96):_0x56fd96;if(_0xfaf168[_0x5866fe][_0x86d3('0x71')]){_0x3cc1d8[_0x86d3('0x62')](_0x56fd96);}_0xfaf168[_0x5866fe]['orderBy']&&_0x3cc1d8[_0x86d3('0x33')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x72')]==='DESC'?![]:!![]);_0x3cc1d8[_0x86d3('0x63')](_0x56fd96,_0xfaf168[_0x5866fe][_0x86d3('0x73')]||_0x56fd96);}if(_0x265beb[_0x86d3('0x74')]){_0x265beb[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x265beb[_0x86d3('0x74')]);for(var _0x1bf5ba=0x0;_0x1bf5ba<_0x265beb[_0x86d3('0x74')][_0x86d3('0x30')];_0x1bf5ba+=0x1){if(_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x28655a,_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')])&&_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')]&&_0x265beb[_0x86d3('0x74')][_0x1bf5ba]['foreignKey']){_0x3cc1d8[_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x29')]](_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x77')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x265beb[_0x86d3('0x6b')],_0x265beb['joins'][_0x1bf5ba][_0x86d3('0x76')],_0x265beb['joins'][_0x1bf5ba]['foreignTable'],_0x265beb[_0x86d3('0x74')][_0x1bf5ba][_0x86d3('0x78')]));}}}if(_0x265beb[_0x86d3('0x79')]){_0x265beb[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x265beb['conditions']);_0x3cc1d8[_0x86d3('0x35')](_0x528ca8(_0x265beb[_0x86d3('0x79')]['group']));}_0x5e1835=_0x3cc1d8[_0x86d3('0x7a')]();_0x3cc1d8[_0x86d3('0x1a')](_0x551806);_0x3cc1d8['offset'](0x0);logger[_0x86d3('0x7b')]('Limited\x20Query:',_0x3cc1d8[_0x86d3('0x7c')]());return dbH['sequelize']['query'](_0x3cc1d8[_0x86d3('0x7c')](),{'type':dbH['sequelize'][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})[_0x86d3('0x1f')](respondWithResult(_0x4cd835,null))[_0x86d3('0x44')](handleError(_0x4cd835,null));};function runReport(_0x3193d5,_0x3a1acc,_0x268c93){var _0x3b989c=_0x3a1acc['name'];var _0x245b39=0xa;var _0x158f56=[_0x86d3('0x50'),_0x86d3('0x7f'),_0x86d3('0x51'),'cross_join'];var _0x3d8b35={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':_0x86d3('0x57'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xca2e0={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':_0x86d3('0x5c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1b503a=function(_0x24410c){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x24410c);};var _0x5f4a38=function(_0x593b85){if(!_0x593b85||!_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x3fac94='(',_0x28d98e=0x0;_0x28d98e<_0x593b85[_0x86d3('0x60')][_0x86d3('0x30')];_0x28d98e+=0x1){_0x28d98e>0x0&&(_0x3fac94+='\x20'+_0x593b85['operator']+'\x20');_0x3fac94+=_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]?_0x5f4a38(_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x62')]):_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x63')]+'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x64')]+(_0x1b503a(_0x593b85[_0x86d3('0x60')][_0x28d98e]['condition'])?'\x20'+_0x593b85[_0x86d3('0x60')][_0x28d98e][_0x86d3('0x65')]:'');}return _0x3fac94+')';};var _0x4b871b={'where':{'id':_0x3193d5['id']}},_0x584a57,_0x36ee46,_0x1cbc3a,_0x682a6d,_0x5004cd;_0x4b871b=_[_0x86d3('0x38')]({},_0x4b871b,_0x268c93);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x4b871b)[_0x86d3('0x1f')](function(_0x3d3e7f){if(_0x3d3e7f){_0x584a57=_0x3d3e7f;return _0x3d3e7f['getFields']();}return null;})[_0x86d3('0x1f')](function(_0x1aaf08){if(_0x1aaf08){if(!_0x1aaf08['length']){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))](_0x86d3('0x86'),0x193);}_0x36ee46=_0x1aaf08;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})[_0x86d3('0x1f')](function(_0x2896e1){if(_0x2896e1){_0x1cbc3a=_[_0x86d3('0x69')](_0x2896e1,'id');var _0x18295c;var _0x44af1c=squel['select']();_0x44af1c[_0x86d3('0x6a')](_0x584a57[_0x86d3('0x6b')]);for(var _0x3582a2=0x0;_0x3582a2<_0x36ee46[_0x86d3('0x30')];_0x3582a2+=0x1){_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6c')]?_0x1cbc3a[_0x36ee46[_0x3582a2][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x36ee46[_0x3582a2][_0x86d3('0x63')];_0x18295c=_0x36ee46[_0x3582a2][_0x86d3('0x6e')]?_[_0x86d3('0x6f')](_0x3d8b35[_0x36ee46[_0x3582a2]['function']],'%s',_0x18295c):_0x18295c;_0x18295c=_0x36ee46[_0x3582a2]['format']?_[_0x86d3('0x6f')](_0xca2e0[_0x36ee46[_0x3582a2][_0x86d3('0x70')]],'%s',_0x18295c):_0x18295c;if(_0x36ee46[_0x3582a2]['groupBy']){_0x44af1c[_0x86d3('0x62')](_0x18295c);}_0x36ee46[_0x3582a2][_0x86d3('0x72')]&&_0x44af1c[_0x86d3('0x33')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x72')]===_0x86d3('0x87')?![]:!![]);_0x44af1c[_0x86d3('0x63')](_0x18295c,_0x36ee46[_0x3582a2][_0x86d3('0x73')]||_0x18295c);}if(_0x584a57[_0x86d3('0x74')]){_0x584a57[_0x86d3('0x74')]=JSON['parse'](_0x584a57['joins']);for(var _0x48a6d7=0x0;_0x48a6d7<_0x584a57['joins'][_0x86d3('0x30')];_0x48a6d7+=0x1){if(_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x158f56,_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x29')])&&_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey']&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x77')]&&_0x584a57[_0x86d3('0x74')][_0x48a6d7][_0x86d3('0x78')]){_0x44af1c[_0x584a57['joins'][_0x48a6d7][_0x86d3('0x29')]](_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],null,util[_0x86d3('0x70')](_0x86d3('0x88'),_0x584a57[_0x86d3('0x6b')],_0x584a57[_0x86d3('0x74')][_0x48a6d7]['parentKey'],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x77')],_0x584a57['joins'][_0x48a6d7][_0x86d3('0x78')]));}}}if(_0x584a57['conditions']){_0x584a57[_0x86d3('0x79')]=JSON['parse'](_0x584a57['conditions']);_0x44af1c[_0x86d3('0x35')](_0x5f4a38(_0x584a57[_0x86d3('0x79')][_0x86d3('0x62')]));}_0x5004cd=_0x44af1c[_0x86d3('0x7a')]();_0x44af1c[_0x86d3('0x1a')](_0x245b39);_0x44af1c[_0x86d3('0x18')](0x0);return;}})[_0x86d3('0x1f')](function(){if(_0x3a1acc[_0x86d3('0x89')]===_0x86d3('0x8a')){return null;}var _0x120a85=_[_0x86d3('0x38')](_0x3a1acc,{'name':_0x3a1acc[_0x86d3('0x8b')]||_0x3a1acc[_0x86d3('0x24')]||_0x584a57[_0x86d3('0x24')],'basename':_0x3b989c,'savename':util[_0x86d3('0x70')]('%s-%s.%s',_0x3a1acc['name']||_0x584a57['name'],require(_0x86d3('0x8c'))[_0x86d3('0x8d')](0x4),_0x3a1acc[_0x86d3('0x89')]||_0x86d3('0x8e')),'reportId':_0x584a57['id'],'reportType':_0x86d3('0x8f')});return db[_0x86d3('0x90')][_0x86d3('0x45')](_0x120a85,{'raw':!![]});})[_0x86d3('0x1f')](function(_0x10e23d){if(_0x584a57[_0x86d3('0x6b')]===_0x86d3('0x91')){_0x5004cd['where'](_0x584a57[_0x86d3('0x6b')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}else{_0x5004cd[_0x86d3('0x35')](_0x584a57[_0x86d3('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3a1acc[_0x86d3('0x92')],_0x3a1acc[_0x86d3('0x93')]);}if(_0x10e23d){logger[_0x86d3('0x94')](_0x86d3('0x95'),_0x5004cd[_0x86d3('0x7c')]());require(_0x86d3('0x96'))[_0x86d3('0x97')](path[_0x86d3('0x50')](__dirname,_0x86d3('0x98'),_0x10e23d[_0x86d3('0x89')]),[_0x10e23d['id'],_0x5004cd[_0x86d3('0x7c')](),path[_0x86d3('0x50')](__dirname,_0x86d3('0x99'),_0x10e23d[_0x86d3('0x9a')]),_0x3b989c]);return _0x10e23d;}else{var _0x428b11=squel[_0x86d3('0x9b')]();_0x428b11[_0x86d3('0x6a')]('('+_0x5004cd['toString']()+')',_0x86d3('0x9c'));_0x428b11[_0x86d3('0x63')](_0x86d3('0x9d'),_0x86d3('0x1b'));_0x5004cd['limit'](_0x3a1acc[_0x86d3('0x1a')]||_0x245b39);_0x5004cd['offset'](_0x3a1acc['offset']||0x0);return dbH[_0x86d3('0x9e')][_0x86d3('0x2c')](_0x428b11[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]})[_0x86d3('0x1f')](function(_0x4777f1){if(!_0x4777f1['length']){_0x682a6d=0x0;}else{_0x682a6d=_0x4777f1[0x0]['count']||0x0;}return dbH['sequelize'][_0x86d3('0x2c')](_0x5004cd[_0x86d3('0x7c')](),{'type':dbH[_0x86d3('0x9e')]['QueryTypes'][_0x86d3('0x7e')]});})['then'](function(_0x435b8e){return{'rows':_0x435b8e||[],'count':_0x682a6d};});}});}exports[_0x86d3('0x9f')]=function(_0x73b8e6,_0x2c98e1){return runReport(_0x73b8e6['params'],_0x73b8e6[_0x86d3('0x2c')],_0x73b8e6[_0x86d3('0x3a')])[_0x86d3('0x1f')](respondWithResult(_0x2c98e1,null))['catch'](handleError(_0x2c98e1,null));};exports['runReport']=runReport;exports['query']=function(_0x458997,_0x1e3559){var _0x49a101=0xa;var _0x38d724=['join',_0x86d3('0x7f'),_0x86d3('0x51'),_0x86d3('0x52')];var _0x56ff91={'SUM':_0x86d3('0x53'),'COUNT':_0x86d3('0x54'),'COUNT DISTINCT':_0x86d3('0x80'),'MAX':_0x86d3('0x55'),'MIN':_0x86d3('0x56'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x86d3('0x58'),'GROUP_CONCAT ASC':_0x86d3('0x81'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1f347e={'SEC_TO_TIME':_0x86d3('0xa0'),'DATE':'DATE(%s)','HOUR':_0x86d3('0x5b'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x45b210=function(_0x144e43){return!_[_0x86d3('0x5e')]([_0x86d3('0x82'),_0x86d3('0x83'),_0x86d3('0x5f'),_0x86d3('0x84')],_0x144e43);};var _0xdc7c21=function(_0x2e0397){if(!_0x2e0397||!_0x2e0397[_0x86d3('0x60')][_0x86d3('0x30')]){return'';}for(var _0x2cc617='(',_0x25339c=0x0;_0x25339c<_0x2e0397['rules'][_0x86d3('0x30')];_0x25339c+=0x1){_0x25339c>0x0&&(_0x2cc617+='\x20'+_0x2e0397[_0x86d3('0x61')]+'\x20');_0x2cc617+=_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]?_0xdc7c21(_0x2e0397[_0x86d3('0x60')][_0x25339c][_0x86d3('0x62')]):_0x2e0397['rules'][_0x25339c][_0x86d3('0x63')]+'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x64')]+(_0x45b210(_0x2e0397[_0x86d3('0x60')][_0x25339c]['condition'])?'\x20'+_0x2e0397['rules'][_0x25339c][_0x86d3('0x65')]:'');}return _0x2cc617+')';};var _0x2c0070={'where':{'id':_0x458997[_0x86d3('0x4e')]['id']}},_0x31d436,_0x56e713,_0x525559,_0x3b9e1e,_0x1d8d7c;_0x2c0070=_['merge']({},_0x2c0070,_0x458997[_0x86d3('0x3a')]);return db[_0x86d3('0x3d')][_0x86d3('0x43')](_0x2c0070)[_0x86d3('0x1f')](function(_0x1f80be){if(_0x1f80be){_0x31d436=_0x1f80be;return _0x1f80be[_0x86d3('0x66')]();}return null;})[_0x86d3('0x1f')](function(_0x3dddbe){if(_0x3dddbe){if(!_0x3dddbe[_0x86d3('0x30')]){throw new db[(_0x86d3('0x85'))][(_0x86d3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x56e713=_0x3dddbe;return db[_0x86d3('0x68')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1d7e83){if(_0x1d7e83){_0x525559=_[_0x86d3('0x69')](_0x1d7e83,'id');var _0x5d9385;var _0x49a499=squel[_0x86d3('0x9b')]();_0x49a499[_0x86d3('0x6a')](_0x31d436[_0x86d3('0x6b')]);for(var _0x33e0a5=0x0;_0x33e0a5<_0x56e713['length'];_0x33e0a5+=0x1){_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6c')]?_0x525559[_0x56e713[_0x33e0a5][_0x86d3('0x6c')]][_0x86d3('0x6d')]:_0x56e713[_0x33e0a5][_0x86d3('0x63')];_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x6e')]?_['replace'](_0x56ff91[_0x56e713[_0x33e0a5][_0x86d3('0x6e')]],'%s',_0x5d9385):_0x5d9385;_0x5d9385=_0x56e713[_0x33e0a5][_0x86d3('0x70')]?_[_0x86d3('0x6f')](_0x1f347e[_0x56e713[_0x33e0a5]['format']],'%s',_0x5d9385):_0x5d9385;if(_0x56e713[_0x33e0a5][_0x86d3('0x71')]){_0x49a499['group'](_0x5d9385);}_0x56e713[_0x33e0a5][_0x86d3('0x72')]&&_0x49a499[_0x86d3('0x33')](_0x5d9385,_0x56e713[_0x33e0a5]['orderBy']===_0x86d3('0x87')?![]:!![]);_0x49a499[_0x86d3('0x63')](_0x5d9385,_0x56e713[_0x33e0a5][_0x86d3('0x73')]||_0x5d9385);}if(_0x31d436[_0x86d3('0x74')]){_0x31d436[_0x86d3('0x74')]=JSON[_0x86d3('0x75')](_0x31d436['joins']);for(var _0x10af91=0x0;_0x10af91<_0x31d436['joins'][_0x86d3('0x30')];_0x10af91+=0x1){if(_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]&&_[_0x86d3('0x5e')](_0x38d724,_0x31d436['joins'][_0x10af91][_0x86d3('0x29')])&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')]&&_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x77')]&&_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignKey']){_0x49a499[_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x29')]](_0x31d436['joins'][_0x10af91]['foreignTable'],null,util[_0x86d3('0x70')]('%s.%s\x20=\x20%s.%s',_0x31d436['table'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x76')],_0x31d436[_0x86d3('0x74')][_0x10af91]['foreignTable'],_0x31d436[_0x86d3('0x74')][_0x10af91][_0x86d3('0x78')]));}}}if(_0x31d436[_0x86d3('0x79')]){_0x31d436[_0x86d3('0x79')]=JSON[_0x86d3('0x75')](_0x31d436['conditions']);_0x49a499[_0x86d3('0x35')](_0xdc7c21(_0x31d436[_0x86d3('0x79')]['group']));}_0x1d8d7c=_0x49a499['clone']();_0x49a499['limit'](_0x49a101);_0x49a499[_0x86d3('0x18')](0x0);logger['debug']('Limited\x20Query:',_0x49a499[_0x86d3('0x7c')]());return dbH[_0x86d3('0x9e')]['query'](_0x49a499['toString'](),{'type':dbH[_0x86d3('0x9e')][_0x86d3('0x7d')][_0x86d3('0x7e')]});}})['then'](function(){return{'sql':_0x1d8d7c[_0x86d3('0x7c')]()};})[_0x86d3('0x1f')](respondWithResult(_0x1e3559,null))[_0x86d3('0x44')](handleError(_0x1e3559,null));};
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js
index 8f70262..3a9d11e 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 _0xa822=['../../config/environment','./analyticDefaultReport.attributes','define','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x59a9d3,_0x5df6ed){var _0x13bca4=function(_0x2a1879){while(--_0x2a1879){_0x59a9d3['push'](_0x59a9d3['shift']());}};_0x13bca4(++_0x5df6ed);}(_0xa822,0x1ed));var _0x2a82=function(_0x50f112,_0xd38e53){_0x50f112=_0x50f112-0x0;var _0x4ecf28=_0xa822[_0x50f112];return _0x4ecf28;};'use strict';var _=require(_0x2a82('0x0'));var util=require(_0x2a82('0x1'));var logger=require('../../config/logger')(_0x2a82('0x2'));var moment=require(_0x2a82('0x3'));var BPromise=require(_0x2a82('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a82('0x5'));var rimraf=require(_0x2a82('0x6'));var config=require(_0x2a82('0x7'));var attributes=require(_0x2a82('0x8'));module['exports']=function(_0x37968c,_0x5ee7a0){return _0x37968c[_0x2a82('0x9')]('AnalyticDefaultReport',attributes,{'tableName':'analytics_default_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe9d=['api','moment','bluebird','request-promise','path','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger'];(function(_0x2f68c6,_0x277ab5){var _0x2a52e0=function(_0x2b9682){while(--_0x2b9682){_0x2f68c6['push'](_0x2f68c6['shift']());}};_0x2a52e0(++_0x277ab5);}(_0xfe9d,0xf9));var _0xdfe9=function(_0x14e6d7,_0x5410db){_0x14e6d7=_0x14e6d7-0x0;var _0x40acdb=_0xfe9d[_0x14e6d7];return _0x40acdb;};'use strict';var _=require(_0xdfe9('0x0'));var util=require(_0xdfe9('0x1'));var logger=require(_0xdfe9('0x2'))(_0xdfe9('0x3'));var moment=require(_0xdfe9('0x4'));var BPromise=require(_0xdfe9('0x5'));var rp=require(_0xdfe9('0x6'));var fs=require('fs');var path=require(_0xdfe9('0x7'));var rimraf=require('rimraf');var config=require(_0xdfe9('0x8'));var attributes=require(_0xdfe9('0x9'));module[_0xdfe9('0xa')]=function(_0x254954,_0x1e5f71){return _0x254954[_0xdfe9('0xb')](_0xdfe9('0xc'),attributes,{'tableName':_0xdfe9('0xd'),'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 16a8f42..75b8271 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 _0x530f=['info','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','request\x20sent','result','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x3001cf,_0x43854a){var _0x31d20c=function(_0x2e4f95){while(--_0x2e4f95){_0x3001cf['push'](_0x3001cf['shift']());}};_0x31d20c(++_0x43854a);}(_0x530f,0x16f));var _0xf530=function(_0xc7d92f,_0x2f2193){_0xc7d92f=_0xc7d92f-0x0;var _0x3a17ea=_0x530f[_0xc7d92f];return _0x3a17ea;};'use strict';var _=require('lodash');var util=require(_0xf530('0x0'));var moment=require(_0xf530('0x1'));var BPromise=require('bluebird');var rs=require(_0xf530('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf530('0x3'))['db'];var utils=require(_0xf530('0x4'));var logger=require('../../config/logger')(_0xf530('0x5'));var config=require(_0xf530('0x6'));var jayson=require(_0xf530('0x7'));var client=jayson[_0xf530('0x8')][_0xf530('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xebe87c,_0x343692,_0x3c9cc4){return new BPromise(function(_0x92d72,_0x575225){return client['request'](_0xebe87c,_0x3c9cc4)[_0xf530('0xa')](function(_0x49b9a2){logger[_0xf530('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x343692,'request\x20sent');logger[_0xf530('0xc')](_0xf530('0xd'),_0x343692,'request\x20sent',JSON[_0xf530('0xe')](_0x49b9a2));if(_0x49b9a2[_0xf530('0xf')]){if(_0x49b9a2[_0xf530('0xf')][_0xf530('0x10')]===0x1f4){logger[_0xf530('0xf')](_0xf530('0x11'),_0x343692,_0x49b9a2[_0xf530('0xf')]['message']);return _0x575225(_0x49b9a2['error']['message']);}logger[_0xf530('0xf')](_0xf530('0x11'),_0x343692,_0x49b9a2[_0xf530('0xf')][_0xf530('0x12')]);return _0x92d72(_0x49b9a2[_0xf530('0xf')][_0xf530('0x12')]);}else{logger[_0xf530('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x343692,_0xf530('0x13'));_0x92d72(_0x49b9a2[_0xf530('0x14')][_0xf530('0x12')]);}})['catch'](function(_0xaac6c5){logger[_0xf530('0xf')](_0xf530('0x11'),_0x343692,_0xaac6c5);_0x575225(_0xaac6c5);});});}
\ No newline at end of file
+var _0x1ff0=['AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x23dc17,_0x4d700d){var _0x2d094c=function(_0x4a0810){while(--_0x4a0810){_0x23dc17['push'](_0x23dc17['shift']());}};_0x2d094c(++_0x4d700d);}(_0x1ff0,0x125));var _0x01ff=function(_0x3b5b66,_0x191961){_0x3b5b66=_0x3b5b66-0x0;var _0x5120f4=_0x1ff0[_0x3b5b66];return _0x5120f4;};'use strict';var _=require(_0x01ff('0x0'));var util=require(_0x01ff('0x1'));var moment=require(_0x01ff('0x2'));var BPromise=require(_0x01ff('0x3'));var rs=require(_0x01ff('0x4'));var fs=require('fs');var Redis=require(_0x01ff('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x01ff('0x6'));var logger=require(_0x01ff('0x7'))('rpc');var config=require(_0x01ff('0x8'));var jayson=require(_0x01ff('0x9'));var client=jayson[_0x01ff('0xa')][_0x01ff('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d871c,_0x8d5f57,_0xf9833b){return new BPromise(function(_0x2023d3,_0x372dfa){return client[_0x01ff('0xc')](_0x2d871c,_0xf9833b)[_0x01ff('0xd')](function(_0x33862b){logger[_0x01ff('0xe')](_0x01ff('0xf'),_0x8d5f57,'request\x20sent');logger[_0x01ff('0x10')](_0x01ff('0x11'),_0x8d5f57,_0x01ff('0x12'),JSON['stringify'](_0x33862b));if(_0x33862b[_0x01ff('0x13')]){if(_0x33862b['error']['code']===0x1f4){logger[_0x01ff('0x13')](_0x01ff('0xf'),_0x8d5f57,_0x33862b[_0x01ff('0x13')][_0x01ff('0x14')]);return _0x372dfa(_0x33862b[_0x01ff('0x13')][_0x01ff('0x14')]);}logger['error'](_0x01ff('0xf'),_0x8d5f57,_0x33862b['error'][_0x01ff('0x14')]);return _0x2023d3(_0x33862b[_0x01ff('0x13')][_0x01ff('0x14')]);}else{logger[_0x01ff('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x8d5f57,_0x01ff('0x12'));_0x2023d3(_0x33862b[_0x01ff('0x15')]['message']);}})['catch'](function(_0x5c811f){logger[_0x01ff('0x13')](_0x01ff('0xf'),_0x8d5f57,_0x5c811f);_0x372dfa(_0x5c811f);});});}
\ No newline at end of file
diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js
index 8996b3f..8acf9bf 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 _0x981d=['path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','isAuthenticated','index','get','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','query','post','create','put','delete','exports'];(function(_0x49191a,_0x5de212){var _0x142cf0=function(_0x26208c){while(--_0x26208c){_0x49191a['push'](_0x49191a['shift']());}};_0x142cf0(++_0x5de212);}(_0x981d,0x18c));var _0xd981=function(_0x3d4c69,_0x54010d){_0x3d4c69=_0x3d4c69-0x0;var _0x2e402b=_0x981d[_0x3d4c69];return _0x2e402b;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd981('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xd981('0x1'));var auth=require(_0xd981('0x2'));var interaction=require(_0xd981('0x3'));var config=require(_0xd981('0x4'));var controller=require(_0xd981('0x5'));router['get']('/',auth[_0xd981('0x6')](),controller[_0xd981('0x7')]);router[_0xd981('0x8')](_0xd981('0x9'),auth[_0xd981('0x6')](),controller[_0xd981('0xa')]);router[_0xd981('0x8')](_0xd981('0xb'),auth['isAuthenticated'](),controller[_0xd981('0xc')]);router[_0xd981('0x8')](_0xd981('0xd'),auth[_0xd981('0x6')](),controller[_0xd981('0xe')]);router['get'](_0xd981('0xf'),auth[_0xd981('0x6')](),controller[_0xd981('0x10')]);router[_0xd981('0x11')]('/',auth['isAuthenticated'](),controller[_0xd981('0x12')]);router[_0xd981('0x13')](_0xd981('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xd981('0x14')](_0xd981('0x9'),auth[_0xd981('0x6')](),controller['destroy']);module[_0xd981('0x15')]=router;
\ No newline at end of file
+var _0x15bf=['post','create','put','/:id','update','delete','destroy','exports','multer','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','/:id/preview','preview','/:id/run','run','/:id/query'];(function(_0x139a8d,_0x2057b9){var _0x2dc764=function(_0x27c279){while(--_0x27c279){_0x139a8d['push'](_0x139a8d['shift']());}};_0x2dc764(++_0x2057b9);}(_0x15bf,0x9e));var _0xf15b=function(_0x46a671,_0x758e9a){_0x46a671=_0x46a671-0x0;var _0x526d75=_0x15bf[_0x46a671];return _0x526d75;};'use strict';var multer=require(_0xf15b('0x0'));var util=require(_0xf15b('0x1'));var path=require(_0xf15b('0x2'));var timeout=require('connect-timeout');var express=require(_0xf15b('0x3'));var router=express[_0xf15b('0x4')]();var fs_extra=require(_0xf15b('0x5'));var auth=require(_0xf15b('0x6'));var interaction=require(_0xf15b('0x7'));var config=require(_0xf15b('0x8'));var controller=require(_0xf15b('0x9'));router[_0xf15b('0xa')]('/',auth[_0xf15b('0xb')](),controller['index']);router[_0xf15b('0xa')]('/:id',auth[_0xf15b('0xb')](),controller['show']);router[_0xf15b('0xa')](_0xf15b('0xc'),auth[_0xf15b('0xb')](),controller[_0xf15b('0xd')]);router[_0xf15b('0xa')](_0xf15b('0xe'),auth['isAuthenticated'](),controller[_0xf15b('0xf')]);router[_0xf15b('0xa')](_0xf15b('0x10'),auth[_0xf15b('0xb')](),controller['query']);router[_0xf15b('0x11')]('/',auth['isAuthenticated'](),controller[_0xf15b('0x12')]);router[_0xf15b('0x13')](_0xf15b('0x14'),auth[_0xf15b('0xb')](),controller[_0xf15b('0x15')]);router[_0xf15b('0x16')](_0xf15b('0x14'),auth[_0xf15b('0xb')](),controller[_0xf15b('0x17')]);module[_0xf15b('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 47dc0d6..cfdc5e0 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 _0x9dee=['xlsx','csv','ENUM','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','exports','STRING','pdf'];(function(_0x519be2,_0x4a57aa){var _0xbebc66=function(_0x489500){while(--_0x489500){_0x519be2['push'](_0x519be2['shift']());}};_0xbebc66(++_0x4a57aa);}(_0x9dee,0xf7));var _0xe9de=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0x9dee[_0x4d2993];return _0x427374;};'use strict';var Sequelize=require(_0xe9de('0x0'));var moment=require(_0xe9de('0x1'));module[_0xe9de('0x2')]={'name':{'type':Sequelize[_0xe9de('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0xe9de('0x3')],'allowNull':![]},'output':{'type':Sequelize['ENUM']('csv',_0xe9de('0x4'),_0xe9de('0x5')),'allowNull':![],'defaultValue':_0xe9de('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize['STRING'],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xe9de('0x7')](_0xe9de('0x8'),_0xe9de('0x9')),'allowNull':![],'defaultValue':_0xe9de('0x8')},'reportId':{'type':Sequelize[_0xe9de('0xa')](0xb)[_0xe9de('0xb')]},'reportType':{'type':Sequelize[_0xe9de('0x3')]}};
\ No newline at end of file
+var _0x437b=['scheduled','INTEGER','UNSIGNED','moment','exports','ENUM','csv','STRING','manual'];(function(_0xe10b6a,_0x271eef){var _0xc7c0e1=function(_0x31a009){while(--_0x31a009){_0xe10b6a['push'](_0xe10b6a['shift']());}};_0xc7c0e1(++_0x271eef);}(_0x437b,0x16b));var _0xb437=function(_0x5b26cb,_0x527ab0){_0x5b26cb=_0x5b26cb-0x0;var _0x563d12=_0x437b[_0x5b26cb];return _0x563d12;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xb437('0x0'));module[_0xb437('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0xb437('0x2')](_0xb437('0x3'),'pdf','xlsx'),'allowNull':![],'defaultValue':_0xb437('0x3')},'savename':{'type':Sequelize[_0xb437('0x4')],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xb437('0x4')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0xb437('0x2')](_0xb437('0x5'),_0xb437('0x6')),'allowNull':![],'defaultValue':_0xb437('0x5')},'reportId':{'type':Sequelize[_0xb437('0x7')](0xb)[_0xb437('0x8')]},'reportType':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js
index 553ab74..816930e 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 _0x120d=['get','find','userProfileId','autoAssociation','UserProfileResource','catch','download','savename','existsSync','join','exists','root','server/files/reports','format','%s.%s','basename','output','toLowerCase','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','squel','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','json','offset','undefined','limit','count','status','set','Content-Range','reject','update','then','destroy','ExtractedReports','error','name','send','index','map','AnalyticExtractedReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','include','findAll','rows','show','params','length','includeAll','options','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user'];(function(_0xf95100,_0xc52bd){var _0x52f169=function(_0x257021){while(--_0x257021){_0xf95100['push'](_0xf95100['shift']());}};_0x52f169(++_0xc52bd);}(_0x120d,0x6d));var _0xd120=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x120d[_0x4d35f3];return _0x382fea;};'use strict';var emlformat=require(_0xd120('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xd120('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd120('0x2'));var moment=require(_0xd120('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xd120('0x4'));var util=require(_0xd120('0x5'));var path=require(_0xd120('0x6'));var sox=require(_0xd120('0x7'));var csv=require(_0xd120('0x8'));var ejs=require(_0xd120('0x9'));var fs=require('fs');var fs_extra=require(_0xd120('0xa'));var _=require('lodash');var squel=require(_0xd120('0xb'));var crypto=require('crypto');var jsforce=require(_0xd120('0xc'));var deskjs=require(_0xd120('0xd'));var toCsv=require(_0xd120('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xd120('0xe'));var qs=require(_0xd120('0xf'));var as=require(_0xd120('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd120('0x11'))('api');var utils=require('../../config/utils');var config=require(_0xd120('0x12'));var licenseUtil=require(_0xd120('0x13'));var db=require(_0xd120('0x14'))['db'];function respondWithStatusCode(_0x5af93f,_0x525620){_0x525620=_0x525620||0xcc;return function(_0x44ad56){if(_0x44ad56){return _0x5af93f[_0xd120('0x15')](_0x525620);}return _0x5af93f['status'](_0x525620)[_0xd120('0x16')]();};}function respondWithResult(_0x4e8a16,_0x38960f){_0x38960f=_0x38960f||0xc8;return function(_0x47e559){if(_0x47e559){return _0x4e8a16['status'](_0x38960f)[_0xd120('0x17')](_0x47e559);}};}function respondWithFilteredResult(_0x1e6f29,_0x3343ed){return function(_0x51ce5d){if(_0x51ce5d){var _0xf6647b=typeof _0x3343ed[_0xd120('0x18')]===_0xd120('0x19')&&typeof _0x3343ed[_0xd120('0x1a')]===_0xd120('0x19');var _0x1e2ca8=_0x51ce5d[_0xd120('0x1b')];var _0x3b5c17=_0xf6647b?0x0:_0x3343ed[_0xd120('0x18')];var _0x1528d6=_0xf6647b?_0x51ce5d[_0xd120('0x1b')]:_0x3343ed[_0xd120('0x18')]+_0x3343ed['limit'];var _0x5b2869;if(_0x1528d6>=_0x1e2ca8){_0x1528d6=_0x1e2ca8;_0x5b2869=0xc8;}else{_0x5b2869=0xce;}_0x1e6f29[_0xd120('0x1c')](_0x5b2869);return _0x1e6f29[_0xd120('0x1d')](_0xd120('0x1e'),_0x3b5c17+'-'+_0x1528d6+'/'+_0x1e2ca8)[_0xd120('0x17')](_0x51ce5d);}return null;};}function patchUpdates(_0x17e7c0){return function(_0x5b1eaa){try{jsonpatch['apply'](_0x5b1eaa,_0x17e7c0,!![]);}catch(_0x3ecf2a){return BPromise[_0xd120('0x1f')](_0x3ecf2a);}return _0x5b1eaa['save']();};}function saveUpdates(_0x4d2fe1,_0x443c3e){return function(_0x2c2b9b){if(_0x2c2b9b){return _0x2c2b9b[_0xd120('0x20')](_0x4d2fe1)[_0xd120('0x21')](function(_0x585ab6){return _0x585ab6;});}return null;};}function removeEntity(_0x133bd7,_0xf08a1e){return function(_0x486255){if(_0x486255){return _0x486255[_0xd120('0x22')]()['then'](function(){var _0x5aba05=_0x486255['get']({'plain':!![]});var _0x337071=_0xd120('0x23');return db['UserProfileResource'][_0xd120('0x22')]({'where':{'type':_0x337071,'resourceId':_0x5aba05['id']}})[_0xd120('0x21')](function(){return _0x486255;});})[_0xd120('0x21')](function(){_0x133bd7[_0xd120('0x1c')](0xcc)[_0xd120('0x16')]();});}};}function handleEntityNotFound(_0x35c6cf,_0x412650){return function(_0x185479){if(!_0x185479){_0x35c6cf[_0xd120('0x15')](0x194);}return _0x185479;};}function handleError(_0x13bdea,_0x3f780c){_0x3f780c=_0x3f780c||0x1f4;return function(_0x398e2f){logger[_0xd120('0x24')](_0x398e2f['stack']);if(_0x398e2f[_0xd120('0x25')]){delete _0x398e2f['name'];}_0x13bdea['status'](_0x3f780c)[_0xd120('0x26')](_0x398e2f);};}exports[_0xd120('0x27')]=function(_0x49c69e,_0x47039d){var _0x331334={},_0x431913={},_0x2c0252={'count':0x0,'rows':[]};var _0x4d8cdd=_[_0xd120('0x28')](db[_0xd120('0x29')][_0xd120('0x2a')],function(_0x35523d){return{'name':_0x35523d[_0xd120('0x2b')],'type':_0x35523d['type'][_0xd120('0x2c')]};});_0x431913['model']=_[_0xd120('0x28')](_0x4d8cdd,'name');_0x431913[_0xd120('0x2d')]=_[_0xd120('0x2e')](_0x49c69e[_0xd120('0x2d')]);_0x431913[_0xd120('0x2f')]=_['intersection'](_0x431913[_0xd120('0x30')],_0x431913[_0xd120('0x2d')]);_0x331334[_0xd120('0x31')]=_[_0xd120('0x32')](_0x431913[_0xd120('0x30')],qs['fields'](_0x49c69e['query'][_0xd120('0x33')]));_0x331334[_0xd120('0x31')]=_0x331334[_0xd120('0x31')]['length']?_0x331334[_0xd120('0x31')]:_0x431913['model'];if(!_0x49c69e[_0xd120('0x2d')][_0xd120('0x34')](_0xd120('0x35'))){_0x331334[_0xd120('0x1a')]=qs['limit'](_0x49c69e['query'][_0xd120('0x1a')]);_0x331334[_0xd120('0x18')]=qs[_0xd120('0x18')](_0x49c69e[_0xd120('0x2d')][_0xd120('0x18')]);}_0x331334[_0xd120('0x36')]=qs[_0xd120('0x37')](_0x49c69e[_0xd120('0x2d')]['sort']);_0x331334[_0xd120('0x38')]=qs[_0xd120('0x2f')](_[_0xd120('0x39')](_0x49c69e[_0xd120('0x2d')],_0x431913[_0xd120('0x2f')]),_0x4d8cdd);if(_0x49c69e[_0xd120('0x2d')]['filter']){_0x331334[_0xd120('0x38')]=_[_0xd120('0x3a')](_0x331334[_0xd120('0x38')],{'$or':_['map'](_0x4d8cdd,function(_0xe0176b){if(_0xe0176b[_0xd120('0x3b')]!=='VIRTUAL'){var _0x2d9f3e={};_0x2d9f3e[_0xe0176b[_0xd120('0x25')]]={'$like':'%'+_0x49c69e[_0xd120('0x2d')][_0xd120('0x3c')]+'%'};return _0x2d9f3e;}})});}_0x331334=_[_0xd120('0x3a')]({},_0x331334,_0x49c69e['options']);var _0xddb2cf={'where':_0x331334['where']};return db[_0xd120('0x29')][_0xd120('0x1b')](_0xddb2cf)[_0xd120('0x21')](function(_0x1c4021){_0x2c0252[_0xd120('0x1b')]=_0x1c4021;if(_0x49c69e[_0xd120('0x2d')]['includeAll']){_0x331334[_0xd120('0x3d')]=[{'all':!![]}];}return db[_0xd120('0x29')][_0xd120('0x3e')](_0x331334);})['then'](function(_0x313e36){_0x2c0252[_0xd120('0x3f')]=_0x313e36;return _0x2c0252;})[_0xd120('0x21')](respondWithFilteredResult(_0x47039d,_0x331334))['catch'](handleError(_0x47039d,null));};exports[_0xd120('0x40')]=function(_0x49f366,_0x5ab119){var _0x16f780={'raw':!![],'where':{'id':_0x49f366[_0xd120('0x41')]['id']}},_0x47738b={};_0x47738b[_0xd120('0x30')]=_[_0xd120('0x2e')](db[_0xd120('0x29')]['rawAttributes']);_0x47738b[_0xd120('0x2d')]=_[_0xd120('0x2e')](_0x49f366[_0xd120('0x2d')]);_0x47738b[_0xd120('0x2f')]=_['intersection'](_0x47738b[_0xd120('0x30')],_0x47738b[_0xd120('0x2d')]);_0x16f780['attributes']=_[_0xd120('0x32')](_0x47738b['model'],qs['fields'](_0x49f366['query']['fields']));_0x16f780['attributes']=_0x16f780[_0xd120('0x31')][_0xd120('0x42')]?_0x16f780['attributes']:_0x47738b[_0xd120('0x30')];if(_0x49f366[_0xd120('0x2d')][_0xd120('0x43')]){_0x16f780['include']=[{'all':!![]}];}_0x16f780=_[_0xd120('0x3a')]({},_0x16f780,_0x49f366[_0xd120('0x44')]);return db[_0xd120('0x29')]['find'](_0x16f780)[_0xd120('0x21')](handleEntityNotFound(_0x5ab119,null))['then'](respondWithResult(_0x5ab119,null))['catch'](handleError(_0x5ab119,null));};exports[_0xd120('0x45')]=function(_0x1abff9,_0x16665a){return db[_0xd120('0x29')][_0xd120('0x45')](_0x1abff9[_0xd120('0x46')],{})[_0xd120('0x21')](function(_0x69ac0c){var _0x1fc2cb=_0x1abff9['user']['get']({'plain':!![]});if(!_0x1fc2cb)throw new Error(_0xd120('0x47'));if(_0x1fc2cb['role']===_0xd120('0x48')){var _0x122e5f=_0x69ac0c[_0xd120('0x49')]({'plain':!![]});var _0x284b77='ExtractedReports';return db['UserProfileSection'][_0xd120('0x4a')]({'where':{'name':_0x284b77,'userProfileId':_0x1fc2cb[_0xd120('0x4b')]},'raw':!![]})[_0xd120('0x21')](function(_0x6e6935){if(_0x6e6935&&_0x6e6935[_0xd120('0x4c')]===0x0){return db[_0xd120('0x4d')][_0xd120('0x45')]({'name':_0x122e5f[_0xd120('0x25')],'resourceId':_0x122e5f['id'],'type':_0x6e6935[_0xd120('0x25')],'sectionId':_0x6e6935['id']},{})[_0xd120('0x21')](function(){return _0x69ac0c;});}else{return _0x69ac0c;}})[_0xd120('0x4e')](function(_0x2d9d71){logger[_0xd120('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2d9d71);throw _0x2d9d71;});}return _0x69ac0c;})[_0xd120('0x21')](respondWithResult(_0x16665a,0xc9))['catch'](handleError(_0x16665a,null));};exports[_0xd120('0x20')]=function(_0x37b4f5,_0x40f865){if(_0x37b4f5[_0xd120('0x46')]['id']){delete _0x37b4f5[_0xd120('0x46')]['id'];}return db[_0xd120('0x29')][_0xd120('0x4a')]({'where':{'id':_0x37b4f5[_0xd120('0x41')]['id']}})[_0xd120('0x21')](handleEntityNotFound(_0x40f865,null))[_0xd120('0x21')](saveUpdates(_0x37b4f5[_0xd120('0x46')],null))[_0xd120('0x21')](respondWithResult(_0x40f865,null))[_0xd120('0x4e')](handleError(_0x40f865,null));};exports[_0xd120('0x22')]=function(_0x7f36de,_0x238278){return db[_0xd120('0x29')][_0xd120('0x4a')]({'where':{'id':_0x7f36de[_0xd120('0x41')]['id']}})[_0xd120('0x21')](handleEntityNotFound(_0x238278,null))[_0xd120('0x21')](removeEntity(_0x238278,null))['catch'](handleError(_0x238278,null));};exports[_0xd120('0x4f')]=function(_0x215985,_0x32e46b,_0x5356c7){return db['AnalyticExtractedReport'][_0xd120('0x4a')]({'where':{'id':_0x215985[_0xd120('0x41')]['id']},'attributes':[_0xd120('0x25'),'basename',_0xd120('0x50'),'output'],'raw':!![]})[_0xd120('0x21')](handleEntityNotFound(_0x32e46b,null))['then'](function(_0x310739){if(_0x310739){if(!fs[_0xd120('0x51')](path[_0xd120('0x52')](config['root'],'server/files/reports',_0x310739['savename']))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x215985['query'][_0xd120('0x53')]){return _0x32e46b[_0xd120('0x15')](0xc8);}return _0x32e46b[_0xd120('0x4f')](path[_0xd120('0x52')](config[_0xd120('0x54')],_0xd120('0x55'),_0x310739[_0xd120('0x50')]),util[_0xd120('0x56')](_0xd120('0x57'),_0x310739[_0xd120('0x58')]||_0x310739['name'],_0x310739[_0xd120('0x59')][_0xd120('0x5a')]()));}})[_0xd120('0x4e')](handleError(_0x32e46b,null));};
\ No newline at end of file
+var _0x931d=['VIRTUAL','options','includeAll','include','AnalyticExtractedReport','findAll','rows','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','basename','savename','output','join','server/files/reports','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','sendStatus','root','format','toLowerCase','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','offset','limit','undefined','count','json','apply','reject','save','then','destroy','get','end','error','name','send','index','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','merge'];(function(_0x5e2152,_0x172f3d){var _0x5ddcf6=function(_0x30a5cc){while(--_0x30a5cc){_0x5e2152['push'](_0x5e2152['shift']());}};_0x5ddcf6(++_0x172f3d);}(_0x931d,0x1eb));var _0xd931=function(_0x469262,_0x11b807){_0x469262=_0x469262-0x0;var _0x15d569=_0x931d[_0x469262];return _0x15d569;};'use strict';var emlformat=require(_0xd931('0x0'));var rimraf=require(_0xd931('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd931('0x2'));var rp=require(_0xd931('0x3'));var moment=require(_0xd931('0x4'));var BPromise=require(_0xd931('0x5'));var Mustache=require('mustache');var util=require(_0xd931('0x6'));var path=require(_0xd931('0x7'));var sox=require(_0xd931('0x8'));var csv=require(_0xd931('0x9'));var ejs=require(_0xd931('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xd931('0xb'));var squel=require(_0xd931('0xc'));var crypto=require('crypto');var jsforce=require(_0xd931('0xd'));var deskjs=require(_0xd931('0xe'));var toCsv=require(_0xd931('0x9'));var querystring=require(_0xd931('0xf'));var Papa=require(_0xd931('0x10'));var Redis=require(_0xd931('0x11'));var authService=require(_0xd931('0x12'));var qs=require(_0xd931('0x13'));var as=require(_0xd931('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd931('0x15'))(_0xd931('0x16'));var utils=require('../../config/utils');var config=require(_0xd931('0x17'));var licenseUtil=require(_0xd931('0x18'));var db=require(_0xd931('0x19'))['db'];function respondWithStatusCode(_0x1aade2,_0x5262cc){_0x5262cc=_0x5262cc||0xcc;return function(_0x345de8){if(_0x345de8){return _0x1aade2['sendStatus'](_0x5262cc);}return _0x1aade2[_0xd931('0x1a')](_0x5262cc)['end']();};}function respondWithResult(_0x3a5554,_0x4e2247){_0x4e2247=_0x4e2247||0xc8;return function(_0x2ac2ad){if(_0x2ac2ad){return _0x3a5554[_0xd931('0x1a')](_0x4e2247)['json'](_0x2ac2ad);}};}function respondWithFilteredResult(_0x4c3e9b,_0x55e2c8){return function(_0x190cc2){if(_0x190cc2){var _0x3e98fe=typeof _0x55e2c8[_0xd931('0x1b')]==='undefined'&&typeof _0x55e2c8[_0xd931('0x1c')]===_0xd931('0x1d');var _0x4964de=_0x190cc2[_0xd931('0x1e')];var _0x37a758=_0x3e98fe?0x0:_0x55e2c8[_0xd931('0x1b')];var _0x9d97cb=_0x3e98fe?_0x190cc2[_0xd931('0x1e')]:_0x55e2c8[_0xd931('0x1b')]+_0x55e2c8[_0xd931('0x1c')];var _0x5422c4;if(_0x9d97cb>=_0x4964de){_0x9d97cb=_0x4964de;_0x5422c4=0xc8;}else{_0x5422c4=0xce;}_0x4c3e9b[_0xd931('0x1a')](_0x5422c4);return _0x4c3e9b['set']('Content-Range',_0x37a758+'-'+_0x9d97cb+'/'+_0x4964de)[_0xd931('0x1f')](_0x190cc2);}return null;};}function patchUpdates(_0x3c7bcf){return function(_0x2e339b){try{jsonpatch[_0xd931('0x20')](_0x2e339b,_0x3c7bcf,!![]);}catch(_0x49a742){return BPromise[_0xd931('0x21')](_0x49a742);}return _0x2e339b[_0xd931('0x22')]();};}function saveUpdates(_0xc891ec,_0x16b5a4){return function(_0x366502){if(_0x366502){return _0x366502['update'](_0xc891ec)[_0xd931('0x23')](function(_0xe23b4c){return _0xe23b4c;});}return null;};}function removeEntity(_0xe8abba,_0x950600){return function(_0x169d82){if(_0x169d82){return _0x169d82[_0xd931('0x24')]()['then'](function(){var _0x5d0716=_0x169d82[_0xd931('0x25')]({'plain':!![]});var _0x43b507='ExtractedReports';return db['UserProfileResource'][_0xd931('0x24')]({'where':{'type':_0x43b507,'resourceId':_0x5d0716['id']}})[_0xd931('0x23')](function(){return _0x169d82;});})['then'](function(){_0xe8abba[_0xd931('0x1a')](0xcc)[_0xd931('0x26')]();});}};}function handleEntityNotFound(_0x38ab09,_0x180103){return function(_0x2f5a3d){if(!_0x2f5a3d){_0x38ab09['sendStatus'](0x194);}return _0x2f5a3d;};}function handleError(_0x1a298c,_0x46f663){_0x46f663=_0x46f663||0x1f4;return function(_0x418571){logger[_0xd931('0x27')](_0x418571['stack']);if(_0x418571[_0xd931('0x28')]){delete _0x418571[_0xd931('0x28')];}_0x1a298c[_0xd931('0x1a')](_0x46f663)[_0xd931('0x29')](_0x418571);};}exports[_0xd931('0x2a')]=function(_0x45b0be,_0x542173){var _0x181e7e={},_0x5f488f={},_0x3379a3={'count':0x0,'rows':[]};var _0x1917d5=_[_0xd931('0x2b')](db['AnalyticExtractedReport'][_0xd931('0x2c')],function(_0x377632){return{'name':_0x377632['fieldName'],'type':_0x377632[_0xd931('0x2d')][_0xd931('0x2e')]};});_0x5f488f[_0xd931('0x2f')]=_[_0xd931('0x2b')](_0x1917d5,_0xd931('0x28'));_0x5f488f[_0xd931('0x30')]=_[_0xd931('0x31')](_0x45b0be[_0xd931('0x30')]);_0x5f488f['filters']=_[_0xd931('0x32')](_0x5f488f[_0xd931('0x2f')],_0x5f488f[_0xd931('0x30')]);_0x181e7e[_0xd931('0x33')]=_[_0xd931('0x32')](_0x5f488f[_0xd931('0x2f')],qs[_0xd931('0x34')](_0x45b0be['query'][_0xd931('0x34')]));_0x181e7e['attributes']=_0x181e7e[_0xd931('0x33')][_0xd931('0x35')]?_0x181e7e['attributes']:_0x5f488f[_0xd931('0x2f')];if(!_0x45b0be[_0xd931('0x30')]['hasOwnProperty'](_0xd931('0x36'))){_0x181e7e[_0xd931('0x1c')]=qs[_0xd931('0x1c')](_0x45b0be[_0xd931('0x30')][_0xd931('0x1c')]);_0x181e7e[_0xd931('0x1b')]=qs['offset'](_0x45b0be[_0xd931('0x30')][_0xd931('0x1b')]);}_0x181e7e['order']=qs[_0xd931('0x37')](_0x45b0be[_0xd931('0x30')][_0xd931('0x37')]);_0x181e7e[_0xd931('0x38')]=qs[_0xd931('0x39')](_[_0xd931('0x3a')](_0x45b0be['query'],_0x5f488f[_0xd931('0x39')]),_0x1917d5);if(_0x45b0be[_0xd931('0x30')][_0xd931('0x3b')]){_0x181e7e[_0xd931('0x38')]=_[_0xd931('0x3c')](_0x181e7e[_0xd931('0x38')],{'$or':_[_0xd931('0x2b')](_0x1917d5,function(_0x5e7c70){if(_0x5e7c70['type']!==_0xd931('0x3d')){var _0x385d69={};_0x385d69[_0x5e7c70[_0xd931('0x28')]]={'$like':'%'+_0x45b0be[_0xd931('0x30')]['filter']+'%'};return _0x385d69;}})});}_0x181e7e=_['merge']({},_0x181e7e,_0x45b0be[_0xd931('0x3e')]);var _0x2c9564={'where':_0x181e7e['where']};return db['AnalyticExtractedReport'][_0xd931('0x1e')](_0x2c9564)[_0xd931('0x23')](function(_0x43b847){_0x3379a3[_0xd931('0x1e')]=_0x43b847;if(_0x45b0be[_0xd931('0x30')][_0xd931('0x3f')]){_0x181e7e[_0xd931('0x40')]=[{'all':!![]}];}return db[_0xd931('0x41')][_0xd931('0x42')](_0x181e7e);})['then'](function(_0x1694f1){_0x3379a3[_0xd931('0x43')]=_0x1694f1;return _0x3379a3;})[_0xd931('0x23')](respondWithFilteredResult(_0x542173,_0x181e7e))[_0xd931('0x44')](handleError(_0x542173,null));};exports['show']=function(_0x56fa1f,_0x109123){var _0x3513dc={'raw':!![],'where':{'id':_0x56fa1f['params']['id']}},_0x2d1890={};_0x2d1890[_0xd931('0x2f')]=_['keys'](db['AnalyticExtractedReport'][_0xd931('0x2c')]);_0x2d1890['query']=_[_0xd931('0x31')](_0x56fa1f[_0xd931('0x30')]);_0x2d1890['filters']=_['intersection'](_0x2d1890[_0xd931('0x2f')],_0x2d1890[_0xd931('0x30')]);_0x3513dc[_0xd931('0x33')]=_[_0xd931('0x32')](_0x2d1890['model'],qs[_0xd931('0x34')](_0x56fa1f['query'][_0xd931('0x34')]));_0x3513dc[_0xd931('0x33')]=_0x3513dc['attributes']['length']?_0x3513dc[_0xd931('0x33')]:_0x2d1890[_0xd931('0x2f')];if(_0x56fa1f[_0xd931('0x30')][_0xd931('0x3f')]){_0x3513dc['include']=[{'all':!![]}];}_0x3513dc=_[_0xd931('0x3c')]({},_0x3513dc,_0x56fa1f[_0xd931('0x3e')]);return db[_0xd931('0x41')]['find'](_0x3513dc)[_0xd931('0x23')](handleEntityNotFound(_0x109123,null))[_0xd931('0x23')](respondWithResult(_0x109123,null))['catch'](handleError(_0x109123,null));};exports['create']=function(_0x4430b4,_0x2c2f86){return db[_0xd931('0x41')]['create'](_0x4430b4[_0xd931('0x45')],{})[_0xd931('0x23')](function(_0x120507){var _0x41a49b=_0x4430b4['user']['get']({'plain':!![]});if(!_0x41a49b)throw new Error(_0xd931('0x46'));if(_0x41a49b[_0xd931('0x47')]===_0xd931('0x48')){var _0x56e5f9=_0x120507['get']({'plain':!![]});var _0x3d42f9='ExtractedReports';return db['UserProfileSection'][_0xd931('0x49')]({'where':{'name':_0x3d42f9,'userProfileId':_0x41a49b[_0xd931('0x4a')]},'raw':!![]})[_0xd931('0x23')](function(_0x27eb9c){if(_0x27eb9c&&_0x27eb9c[_0xd931('0x4b')]===0x0){return db[_0xd931('0x4c')]['create']({'name':_0x56e5f9[_0xd931('0x28')],'resourceId':_0x56e5f9['id'],'type':_0x27eb9c[_0xd931('0x28')],'sectionId':_0x27eb9c['id']},{})[_0xd931('0x23')](function(){return _0x120507;});}else{return _0x120507;}})[_0xd931('0x44')](function(_0x11f8fa){logger[_0xd931('0x27')](_0xd931('0x4d'),_0x11f8fa);throw _0x11f8fa;});}return _0x120507;})[_0xd931('0x23')](respondWithResult(_0x2c2f86,0xc9))[_0xd931('0x44')](handleError(_0x2c2f86,null));};exports['update']=function(_0x477cd1,_0x458d8f){if(_0x477cd1['body']['id']){delete _0x477cd1[_0xd931('0x45')]['id'];}return db['AnalyticExtractedReport'][_0xd931('0x49')]({'where':{'id':_0x477cd1[_0xd931('0x4e')]['id']}})['then'](handleEntityNotFound(_0x458d8f,null))[_0xd931('0x23')](saveUpdates(_0x477cd1[_0xd931('0x45')],null))[_0xd931('0x23')](respondWithResult(_0x458d8f,null))[_0xd931('0x44')](handleError(_0x458d8f,null));};exports[_0xd931('0x24')]=function(_0x4d87ec,_0x3f6973){return db['AnalyticExtractedReport'][_0xd931('0x49')]({'where':{'id':_0x4d87ec[_0xd931('0x4e')]['id']}})[_0xd931('0x23')](handleEntityNotFound(_0x3f6973,null))['then'](removeEntity(_0x3f6973,null))[_0xd931('0x44')](handleError(_0x3f6973,null));};exports[_0xd931('0x4f')]=function(_0x245d2a,_0x116a5e,_0x275580){return db[_0xd931('0x41')][_0xd931('0x49')]({'where':{'id':_0x245d2a['params']['id']},'attributes':['name',_0xd931('0x50'),_0xd931('0x51'),_0xd931('0x52')],'raw':!![]})[_0xd931('0x23')](handleEntityNotFound(_0x116a5e,null))[_0xd931('0x23')](function(_0x4a9473){if(_0x4a9473){if(!fs['existsSync'](path[_0xd931('0x53')](config['root'],_0xd931('0x54'),_0x4a9473[_0xd931('0x51')]))){throw new db['Sequelize'][(_0xd931('0x55'))](_0xd931('0x56'));}if(_0x245d2a['query'][_0xd931('0x57')]){return _0x116a5e[_0xd931('0x58')](0xc8);}return _0x116a5e['download'](path[_0xd931('0x53')](config[_0xd931('0x59')],_0xd931('0x54'),_0x4a9473[_0xd931('0x51')]),util[_0xd931('0x5a')]('%s.%s',_0x4a9473[_0xd931('0x50')]||_0x4a9473['name'],_0x4a9473[_0xd931('0x52')][_0xd931('0x5b')]()));}})[_0xd931('0x44')](handleError(_0x116a5e,null));};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js
index 0883f54..ef4b0b8 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 _0x49aa=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','AnalyticExtractedReport'];(function(_0x1ce793,_0x3b957c){var _0x962895=function(_0x5403f4){while(--_0x5403f4){_0x1ce793['push'](_0x1ce793['shift']());}};_0x962895(++_0x3b957c);}(_0x49aa,0x194));var _0xa49a=function(_0x2abdcd,_0x2af6c7){_0x2abdcd=_0x2abdcd-0x0;var _0x48f3c3=_0x49aa[_0x2abdcd];return _0x48f3c3;};'use strict';var _=require(_0xa49a('0x0'));var util=require(_0xa49a('0x1'));var logger=require(_0xa49a('0x2'))(_0xa49a('0x3'));var moment=require(_0xa49a('0x4'));var BPromise=require(_0xa49a('0x5'));var rp=require(_0xa49a('0x6'));var fs=require('fs');var path=require(_0xa49a('0x7'));var rimraf=require(_0xa49a('0x8'));var config=require(_0xa49a('0x9'));var attributes=require(_0xa49a('0xa'));module['exports']=function(_0xe488b2,_0x461162){return _0xe488b2['define'](_0xa49a('0xb'),attributes,{'tableName':_0xa49a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x6f4a=['exports','define','AnalyticExtractedReport','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0x6f4a,0x18f));var _0xa6f4=function(_0x22056d,_0x33be11){_0x22056d=_0x22056d-0x0;var _0x5b06aa=_0x6f4a[_0x22056d];return _0x5b06aa;};'use strict';var _=require(_0xa6f4('0x0'));var util=require('util');var logger=require(_0xa6f4('0x1'))('api');var moment=require(_0xa6f4('0x2'));var BPromise=require(_0xa6f4('0x3'));var rp=require(_0xa6f4('0x4'));var fs=require('fs');var path=require(_0xa6f4('0x5'));var rimraf=require(_0xa6f4('0x6'));var config=require(_0xa6f4('0x7'));var attributes=require(_0xa6f4('0x8'));module[_0xa6f4('0x9')]=function(_0x10f72d,_0x5d6930){return _0x10f72d[_0xa6f4('0xa')](_0xa6f4('0xb'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js
index a42b7fd..73995b6 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 _0xfc23=['error','code','message','AnalyticExtractedReport,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','info','request\x20sent','debug'];(function(_0x202466,_0x140172){var _0x34ca86=function(_0x46f570){while(--_0x46f570){_0x202466['push'](_0x202466['shift']());}};_0x34ca86(++_0x140172);}(_0xfc23,0x10f));var _0x3fc2=function(_0xc9fb7e,_0x485054){_0xc9fb7e=_0xc9fb7e-0x0;var _0x3563ed=_0xfc23[_0xc9fb7e];return _0x3563ed;};'use strict';var _=require(_0x3fc2('0x0'));var util=require('util');var moment=require(_0x3fc2('0x1'));var BPromise=require(_0x3fc2('0x2'));var rs=require(_0x3fc2('0x3'));var fs=require('fs');var Redis=require(_0x3fc2('0x4'));var db=require(_0x3fc2('0x5'))['db'];var utils=require(_0x3fc2('0x6'));var logger=require('../../config/logger')(_0x3fc2('0x7'));var config=require(_0x3fc2('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3fc2('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c270c,_0x13dbcd,_0x1c9d6a){return new BPromise(function(_0x293bb3,_0x3c9f74){return client[_0x3fc2('0xa')](_0x5c270c,_0x1c9d6a)['then'](function(_0x1dd0d3){logger[_0x3fc2('0xb')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x13dbcd,_0x3fc2('0xc'));logger[_0x3fc2('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x13dbcd,'request\x20sent',JSON['stringify'](_0x1dd0d3));if(_0x1dd0d3[_0x3fc2('0xe')]){if(_0x1dd0d3[_0x3fc2('0xe')][_0x3fc2('0xf')]===0x1f4){logger[_0x3fc2('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x13dbcd,_0x1dd0d3['error'][_0x3fc2('0x10')]);return _0x3c9f74(_0x1dd0d3[_0x3fc2('0xe')][_0x3fc2('0x10')]);}logger[_0x3fc2('0xe')](_0x3fc2('0x11'),_0x13dbcd,_0x1dd0d3[_0x3fc2('0xe')][_0x3fc2('0x10')]);return _0x293bb3(_0x1dd0d3[_0x3fc2('0xe')][_0x3fc2('0x10')]);}else{logger[_0x3fc2('0xb')](_0x3fc2('0x11'),_0x13dbcd,'request\x20sent');_0x293bb3(_0x1dd0d3[_0x3fc2('0x12')][_0x3fc2('0x10')]);}})['catch'](function(_0x125eee){logger['error'](_0x3fc2('0x11'),_0x13dbcd,_0x125eee);_0x3c9f74(_0x125eee);});});}
\ No newline at end of file
+var _0x7599=['../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x39cc8f,_0xb60cd8){var _0x15e616=function(_0x513d9e){while(--_0x513d9e){_0x39cc8f['push'](_0x39cc8f['shift']());}};_0x15e616(++_0xb60cd8);}(_0x7599,0x14f));var _0x9759=function(_0x1129da,_0x47a93c){_0x1129da=_0x1129da-0x0;var _0x31fb25=_0x7599[_0x1129da];return _0x31fb25;};'use strict';var _=require(_0x9759('0x0'));var util=require(_0x9759('0x1'));var moment=require(_0x9759('0x2'));var BPromise=require(_0x9759('0x3'));var rs=require(_0x9759('0x4'));var fs=require('fs');var Redis=require(_0x9759('0x5'));var db=require(_0x9759('0x6'))['db'];var utils=require(_0x9759('0x7'));var logger=require(_0x9759('0x8'))(_0x9759('0x9'));var config=require(_0x9759('0xa'));var jayson=require(_0x9759('0xb'));var client=jayson[_0x9759('0xc')][_0x9759('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x2966a9,_0x3a4579,_0x55f814){return new BPromise(function(_0x1a7e47,_0x32c920){return client[_0x9759('0xe')](_0x2966a9,_0x55f814)['then'](function(_0x9eedb){logger[_0x9759('0xf')](_0x9759('0x10'),_0x3a4579,_0x9759('0x11'));logger[_0x9759('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x3a4579,'request\x20sent',JSON['stringify'](_0x9eedb));if(_0x9eedb[_0x9759('0x13')]){if(_0x9eedb[_0x9759('0x13')][_0x9759('0x14')]===0x1f4){logger[_0x9759('0x13')](_0x9759('0x10'),_0x3a4579,_0x9eedb[_0x9759('0x13')]['message']);return _0x32c920(_0x9eedb[_0x9759('0x13')][_0x9759('0x15')]);}logger[_0x9759('0x13')](_0x9759('0x10'),_0x3a4579,_0x9eedb[_0x9759('0x13')][_0x9759('0x15')]);return _0x1a7e47(_0x9eedb['error'][_0x9759('0x15')]);}else{logger[_0x9759('0xf')](_0x9759('0x10'),_0x3a4579,_0x9759('0x11'));_0x1a7e47(_0x9eedb[_0x9759('0x16')][_0x9759('0x15')]);}})['catch'](function(_0x11c209){logger[_0x9759('0x13')](_0x9759('0x10'),_0x3a4579,_0x11c209);_0x32c920(_0x11c209);});});}
\ No newline at end of file
diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js
index a622c3f..5a64704 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 _0x9762=['fs-extra','../../components/auth/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id','show','/:id/download','download','post','create','put','update','destroy','exports','multer','util','express','Router'];(function(_0x483089,_0xf9b5c7){var _0x2861c5=function(_0x3110ff){while(--_0x3110ff){_0x483089['push'](_0x483089['shift']());}};_0x2861c5(++_0xf9b5c7);}(_0x9762,0x165));var _0x2976=function(_0x2eaa2b,_0x21830f){_0x2eaa2b=_0x2eaa2b-0x0;var _0x3b9b47=_0x9762[_0x2eaa2b];return _0x3b9b47;};'use strict';var multer=require(_0x2976('0x0'));var util=require(_0x2976('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2976('0x2'));var router=express[_0x2976('0x3')]();var fs_extra=require(_0x2976('0x4'));var auth=require(_0x2976('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2976('0x6'));router[_0x2976('0x7')]('/',auth[_0x2976('0x8')](),controller['index']);router['get'](_0x2976('0x9'),auth['isAuthenticated'](),controller[_0x2976('0xa')]);router[_0x2976('0x7')](_0x2976('0xb'),auth[_0x2976('0x8')](),controller[_0x2976('0xc')]);router[_0x2976('0xd')]('/',auth[_0x2976('0x8')](),controller[_0x2976('0xe')]);router[_0x2976('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x2976('0x10')]);router['delete'](_0x2976('0x9'),auth[_0x2976('0x8')](),controller[_0x2976('0x11')]);module[_0x2976('0x12')]=router;
\ No newline at end of file
+var _0x15aa=['get','show','/:id/download','download','create','delete','/:id','destroy','exports','multer','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x515a41,_0x4c631c){var _0x5a435b=function(_0x5dc9b4){while(--_0x5dc9b4){_0x515a41['push'](_0x515a41['shift']());}};_0x5a435b(++_0x4c631c);}(_0x15aa,0x99));var _0xa15a=function(_0x2318b8,_0x3ff9f9){_0x2318b8=_0x2318b8-0x0;var _0x313dde=_0x15aa[_0x2318b8];return _0x313dde;};'use strict';var multer=require(_0xa15a('0x0'));var util=require(_0xa15a('0x1'));var path=require('path');var timeout=require(_0xa15a('0x2'));var express=require(_0xa15a('0x3'));var router=express[_0xa15a('0x4')]();var fs_extra=require(_0xa15a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0xa15a('0x6'));var config=require(_0xa15a('0x7'));var controller=require('./analyticExtractedReport.controller');router['get']('/',auth[_0xa15a('0x8')](),controller['index']);router[_0xa15a('0x9')]('/:id',auth[_0xa15a('0x8')](),controller[_0xa15a('0xa')]);router[_0xa15a('0x9')](_0xa15a('0xb'),auth['isAuthenticated'](),controller[_0xa15a('0xc')]);router['post']('/',auth[_0xa15a('0x8')](),controller[_0xa15a('0xd')]);router['put']('/:id',auth[_0xa15a('0x8')](),controller['update']);router[_0xa15a('0xe')](_0xa15a('0xf'),auth[_0xa15a('0x8')](),controller[_0xa15a('0x10')]);module[_0xa15a('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js
index 1a82efd..f508988 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 _0x3c80=['exports','TEXT','STRING','BOOLEAN','sequelize'];(function(_0x4bfe08,_0x48ae7b){var _0x1f9125=function(_0x11450e){while(--_0x11450e){_0x4bfe08['push'](_0x4bfe08['shift']());}};_0x1f9125(++_0x48ae7b);}(_0x3c80,0x72));var _0x03c8=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x3c80[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x03c8('0x0'));module[_0x03c8('0x1')]={'field':{'type':Sequelize[_0x03c8('0x2')]},'alias':{'type':Sequelize[_0x03c8('0x3')]},'function':{'type':Sequelize[_0x03c8('0x3')]},'format':{'type':Sequelize[_0x03c8('0x3')]},'groupBy':{'type':Sequelize[_0x03c8('0x4')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x03c8('0x3')]},'custom':{'type':Sequelize[_0x03c8('0x4')],'defaultValue':![]}};
\ No newline at end of file
+var _0xc026=['exports','TEXT','STRING','BOOLEAN'];(function(_0x4ef7b9,_0x489c99){var _0x19e127=function(_0x55ba05){while(--_0x55ba05){_0x4ef7b9['push'](_0x4ef7b9['shift']());}};_0x19e127(++_0x489c99);}(_0xc026,0xf0));var _0x6c02=function(_0x35f901,_0x4dd58a){_0x35f901=_0x35f901-0x0;var _0x497a0a=_0xc026[_0x35f901];return _0x497a0a;};'use strict';var Sequelize=require('sequelize');module[_0x6c02('0x0')]={'field':{'type':Sequelize[_0x6c02('0x1')]},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x6c02('0x2')]},'groupBy':{'type':Sequelize[_0x6c02('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize[_0x6c02('0x3')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js
index a26a65a..4b7cb86 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 _0xb983=['path','sox','to-csv','ejs','fs-extra','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','reject','save','then','destroy','stack','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','name','options','AnalyticFieldReport','includeAll','rows','catch','show','params','filters','find','create','body','bulkCreate','update','ids','addFields','AnalyticCustomReport','findOne','sequelize','transaction','map','CustomReportId','findAll','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util'];(function(_0x45a9a7,_0x190213){var _0xcd7892=function(_0x415487){while(--_0x415487){_0x45a9a7['push'](_0x45a9a7['shift']());}};_0xcd7892(++_0x190213);}(_0xb983,0x149));var _0x3b98=function(_0x4854d6,_0x2f1264){_0x4854d6=_0x4854d6-0x0;var _0x3885c0=_0xb983[_0x4854d6];return _0x3885c0;};'use strict';var emlformat=require(_0x3b98('0x0'));var rimraf=require(_0x3b98('0x1'));var zipdir=require(_0x3b98('0x2'));var jsonpatch=require(_0x3b98('0x3'));var rp=require(_0x3b98('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3b98('0x5'));var util=require(_0x3b98('0x6'));var path=require(_0x3b98('0x7'));var sox=require(_0x3b98('0x8'));var csv=require(_0x3b98('0x9'));var ejs=require(_0x3b98('0xa'));var fs=require('fs');var fs_extra=require(_0x3b98('0xb'));var _=require(_0x3b98('0xc'));var squel=require(_0x3b98('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x3b98('0xe'));var toCsv=require(_0x3b98('0x9'));var querystring=require(_0x3b98('0xf'));var Papa=require(_0x3b98('0x10'));var Redis=require(_0x3b98('0x11'));var authService=require(_0x3b98('0x12'));var qs=require(_0x3b98('0x13'));var as=require(_0x3b98('0x14'));var hardwareService=require(_0x3b98('0x15'));var logger=require(_0x3b98('0x16'))(_0x3b98('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var licenseUtil=require(_0x3b98('0x18'));var db=require(_0x3b98('0x19'))['db'];function respondWithStatusCode(_0x8d39ca,_0x2ce0a3){_0x2ce0a3=_0x2ce0a3||0xcc;return function(_0x3da023){if(_0x3da023){return _0x8d39ca[_0x3b98('0x1a')](_0x2ce0a3);}return _0x8d39ca[_0x3b98('0x1b')](_0x2ce0a3)[_0x3b98('0x1c')]();};}function respondWithResult(_0x1d966b,_0x2a8a2c){_0x2a8a2c=_0x2a8a2c||0xc8;return function(_0x206ab5){if(_0x206ab5){return _0x1d966b[_0x3b98('0x1b')](_0x2a8a2c)[_0x3b98('0x1d')](_0x206ab5);}};}function respondWithFilteredResult(_0x2ef2ba,_0x31fe2b){return function(_0x6b9cec){if(_0x6b9cec){var _0x31030d=typeof _0x31fe2b[_0x3b98('0x1e')]===_0x3b98('0x1f')&&typeof _0x31fe2b[_0x3b98('0x20')]==='undefined';var _0x87e54=_0x6b9cec[_0x3b98('0x21')];var _0x2fcda4=_0x31030d?0x0:_0x31fe2b[_0x3b98('0x1e')];var _0x4aefa7=_0x31030d?_0x6b9cec[_0x3b98('0x21')]:_0x31fe2b['offset']+_0x31fe2b[_0x3b98('0x20')];var _0x53ac66;if(_0x4aefa7>=_0x87e54){_0x4aefa7=_0x87e54;_0x53ac66=0xc8;}else{_0x53ac66=0xce;}_0x2ef2ba[_0x3b98('0x1b')](_0x53ac66);return _0x2ef2ba[_0x3b98('0x22')](_0x3b98('0x23'),_0x2fcda4+'-'+_0x4aefa7+'/'+_0x87e54)['json'](_0x6b9cec);}return null;};}function patchUpdates(_0x584b97){return function(_0x3f1e3a){try{jsonpatch['apply'](_0x3f1e3a,_0x584b97,!![]);}catch(_0x5db960){return BPromise[_0x3b98('0x24')](_0x5db960);}return _0x3f1e3a[_0x3b98('0x25')]();};}function saveUpdates(_0x315af4,_0x44ef91){return function(_0x2590c6){if(_0x2590c6){return _0x2590c6['update'](_0x315af4)[_0x3b98('0x26')](function(_0x41e229){return _0x41e229;});}return null;};}function removeEntity(_0x2d2926,_0x2919e7){return function(_0x17476f){if(_0x17476f){return _0x17476f[_0x3b98('0x27')]()['then'](function(){_0x2d2926[_0x3b98('0x1b')](0xcc)[_0x3b98('0x1c')]();});}};}function handleEntityNotFound(_0x183bbc,_0x4afd4d){return function(_0x37df98){if(!_0x37df98){_0x183bbc[_0x3b98('0x1a')](0x194);}return _0x37df98;};}function handleError(_0x3f46cc,_0x1c0f7e){_0x1c0f7e=_0x1c0f7e||0x1f4;return function(_0x2c0534){logger['error'](_0x2c0534[_0x3b98('0x28')]);if(_0x2c0534['name']){delete _0x2c0534['name'];}_0x3f46cc[_0x3b98('0x1b')](_0x1c0f7e)[_0x3b98('0x29')](_0x2c0534);};}exports[_0x3b98('0x2a')]=function(_0x36915e,_0x1872de){var _0x3943b2={},_0x4b8446={},_0x207681={'count':0x0,'rows':[]};var _0x58aca6=_['map'](db['AnalyticFieldReport'][_0x3b98('0x2b')],function(_0x4b4992){return{'name':_0x4b4992[_0x3b98('0x2c')],'type':_0x4b4992[_0x3b98('0x2d')][_0x3b98('0x2e')]};});_0x4b8446[_0x3b98('0x2f')]=_['map'](_0x58aca6,'name');_0x4b8446[_0x3b98('0x30')]=_[_0x3b98('0x31')](_0x36915e[_0x3b98('0x30')]);_0x4b8446['filters']=_[_0x3b98('0x32')](_0x4b8446[_0x3b98('0x2f')],_0x4b8446[_0x3b98('0x30')]);_0x3943b2[_0x3b98('0x33')]=_[_0x3b98('0x32')](_0x4b8446[_0x3b98('0x2f')],qs[_0x3b98('0x34')](_0x36915e[_0x3b98('0x30')][_0x3b98('0x34')]));_0x3943b2[_0x3b98('0x33')]=_0x3943b2['attributes'][_0x3b98('0x35')]?_0x3943b2['attributes']:_0x4b8446[_0x3b98('0x2f')];if(!_0x36915e[_0x3b98('0x30')]['hasOwnProperty'](_0x3b98('0x36'))){_0x3943b2['limit']=qs[_0x3b98('0x20')](_0x36915e[_0x3b98('0x30')][_0x3b98('0x20')]);_0x3943b2[_0x3b98('0x1e')]=qs[_0x3b98('0x1e')](_0x36915e['query'][_0x3b98('0x1e')]);}_0x3943b2[_0x3b98('0x37')]=qs[_0x3b98('0x38')](_0x36915e['query'][_0x3b98('0x38')]);_0x3943b2[_0x3b98('0x39')]=qs['filters'](_['pick'](_0x36915e['query'],_0x4b8446['filters']),_0x58aca6);if(_0x36915e[_0x3b98('0x30')][_0x3b98('0x3a')]){_0x3943b2[_0x3b98('0x39')]=_[_0x3b98('0x3b')](_0x3943b2[_0x3b98('0x39')],{'$or':_['map'](_0x58aca6,function(_0x38fa81){if(_0x38fa81[_0x3b98('0x2d')]!==_0x3b98('0x3c')){var _0x276957={};_0x276957[_0x38fa81[_0x3b98('0x3d')]]={'$like':'%'+_0x36915e['query'][_0x3b98('0x3a')]+'%'};return _0x276957;}})});}_0x3943b2=_['merge']({},_0x3943b2,_0x36915e[_0x3b98('0x3e')]);var _0x5df555={'where':_0x3943b2[_0x3b98('0x39')]};return db[_0x3b98('0x3f')][_0x3b98('0x21')](_0x5df555)[_0x3b98('0x26')](function(_0x2b2975){_0x207681['count']=_0x2b2975;if(_0x36915e[_0x3b98('0x30')][_0x3b98('0x40')]){_0x3943b2['include']=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x3943b2);})[_0x3b98('0x26')](function(_0x4e77a2){_0x207681[_0x3b98('0x41')]=_0x4e77a2;return _0x207681;})[_0x3b98('0x26')](respondWithFilteredResult(_0x1872de,_0x3943b2))[_0x3b98('0x42')](handleError(_0x1872de,null));};exports[_0x3b98('0x43')]=function(_0x388ee9,_0xe97f78){var _0x5734cc={'raw':![],'where':{'id':_0x388ee9[_0x3b98('0x44')]['id']}},_0x4ea1dc={};_0x4ea1dc[_0x3b98('0x2f')]=_[_0x3b98('0x31')](db[_0x3b98('0x3f')][_0x3b98('0x2b')]);_0x4ea1dc[_0x3b98('0x30')]=_[_0x3b98('0x31')](_0x388ee9[_0x3b98('0x30')]);_0x4ea1dc[_0x3b98('0x45')]=_[_0x3b98('0x32')](_0x4ea1dc['model'],_0x4ea1dc[_0x3b98('0x30')]);_0x5734cc[_0x3b98('0x33')]=_['intersection'](_0x4ea1dc[_0x3b98('0x2f')],qs[_0x3b98('0x34')](_0x388ee9[_0x3b98('0x30')][_0x3b98('0x34')]));_0x5734cc[_0x3b98('0x33')]=_0x5734cc['attributes']['length']?_0x5734cc['attributes']:_0x4ea1dc[_0x3b98('0x2f')];if(_0x388ee9[_0x3b98('0x30')][_0x3b98('0x40')]){_0x5734cc['include']=[{'all':!![]}];}_0x5734cc=_[_0x3b98('0x3b')]({},_0x5734cc,_0x388ee9[_0x3b98('0x3e')]);return db['AnalyticFieldReport'][_0x3b98('0x46')](_0x5734cc)[_0x3b98('0x26')](handleEntityNotFound(_0xe97f78,null))[_0x3b98('0x26')](respondWithResult(_0xe97f78,null))['catch'](handleError(_0xe97f78,null));};exports[_0x3b98('0x47')]=function(_0x30ae0b,_0x218813){return db[_0x3b98('0x3f')][_0x3b98('0x47')](_0x30ae0b[_0x3b98('0x48')],{})['then'](respondWithResult(_0x218813,0xc9))[_0x3b98('0x42')](handleError(_0x218813,null));};exports[_0x3b98('0x49')]=function(_0xefe293,_0x264a16){return db[_0x3b98('0x3f')][_0x3b98('0x49')](_0xefe293[_0x3b98('0x48')],{'raw':![],'individualHooks':!![]})[_0x3b98('0x26')](respondWithResult(_0x264a16,0xc9))[_0x3b98('0x42')](handleError(_0x264a16,null));};exports[_0x3b98('0x4a')]=function(_0x5958a6,_0x50844e){if(_0x5958a6['body']['id']){delete _0x5958a6[_0x3b98('0x48')]['id'];}return db[_0x3b98('0x3f')][_0x3b98('0x46')]({'where':{'id':_0x5958a6['params']['id']}})[_0x3b98('0x26')](handleEntityNotFound(_0x50844e,null))[_0x3b98('0x26')](saveUpdates(_0x5958a6[_0x3b98('0x48')],null))['then'](respondWithResult(_0x50844e,null))['catch'](handleError(_0x50844e,null));};exports[_0x3b98('0x27')]=function(_0x22ad3d,_0x4ce708){return db[_0x3b98('0x3f')][_0x3b98('0x46')]({'where':{'id':_0x22ad3d['params']['id']}})[_0x3b98('0x26')](handleEntityNotFound(_0x4ce708,null))['then'](removeEntity(_0x4ce708,null))['catch'](handleError(_0x4ce708,null));};exports['bulkDestroy']=function(_0x51153e,_0x5d3e2b){return db['AnalyticFieldReport'][_0x3b98('0x27')]({'where':{'id':_0x51153e[_0x3b98('0x30')][_0x3b98('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0x3b98('0x26')](respondWithResult(_0x5d3e2b,0xcc))[_0x3b98('0x42')](handleError(_0x5d3e2b,null));};exports[_0x3b98('0x4c')]=function(_0x4be68d,_0x415cb5,_0x41eb15){return db[_0x3b98('0x4d')][_0x3b98('0x4e')]({'where':{'id':_0x4be68d[_0x3b98('0x44')]['id']}})[_0x3b98('0x26')](handleEntityNotFound(_0x415cb5,null))['then'](function(_0x75f2f8){if(_0x75f2f8){return db[_0x3b98('0x4f')][_0x3b98('0x50')](function(_0x10f4ac){return db['AnalyticFieldReport']['destroy']({'where':{'CustomReportId':_0x4be68d[_0x3b98('0x44')]['id']},'transaction':_0x10f4ac})['then'](function(_0x417c6d){var _0xf615b3=_[_0x3b98('0x51')](_0x4be68d[_0x3b98('0x48')],function(_0x9a0bb6){delete _0x9a0bb6['id'];_0x9a0bb6[_0x3b98('0x52')]=_0x4be68d[_0x3b98('0x44')]['id'];return _0x9a0bb6;});return db['AnalyticFieldReport'][_0x3b98('0x49')](_0xf615b3,{'transaction':_0x10f4ac});});})[_0x3b98('0x26')](function(){return db['AnalyticFieldReport'][_0x3b98('0x53')]({'where':{'CustomReportId':_0x4be68d[_0x3b98('0x44')]['id']}});});}})['then'](respondWithResult(_0x415cb5,null))[_0x3b98('0x42')](handleError(_0x415cb5,null));};
\ No newline at end of file
+var _0xab0a=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','undefined','offset','count','limit','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','model','query','filters','intersection','attributes','fields','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','keys','length','include','find','create','bulkCreate','body','update','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','eml-format','rimraf'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0xab0a,0x1f0));var _0xaab0=function(_0x1846f2,_0x353922){_0x1846f2=_0x1846f2-0x0;var _0x3f2021=_0xab0a[_0x1846f2];return _0x3f2021;};'use strict';var emlformat=require(_0xaab0('0x0'));var rimraf=require(_0xaab0('0x1'));var zipdir=require(_0xaab0('0x2'));var jsonpatch=require(_0xaab0('0x3'));var rp=require(_0xaab0('0x4'));var moment=require(_0xaab0('0x5'));var BPromise=require(_0xaab0('0x6'));var Mustache=require('mustache');var util=require(_0xaab0('0x7'));var path=require(_0xaab0('0x8'));var sox=require(_0xaab0('0x9'));var csv=require(_0xaab0('0xa'));var ejs=require(_0xaab0('0xb'));var fs=require('fs');var fs_extra=require(_0xaab0('0xc'));var _=require(_0xaab0('0xd'));var squel=require(_0xaab0('0xe'));var crypto=require(_0xaab0('0xf'));var jsforce=require(_0xaab0('0x10'));var deskjs=require(_0xaab0('0x11'));var toCsv=require(_0xaab0('0xa'));var querystring=require(_0xaab0('0x12'));var Papa=require('papaparse');var Redis=require(_0xaab0('0x13'));var authService=require(_0xaab0('0x14'));var qs=require(_0xaab0('0x15'));var as=require(_0xaab0('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaab0('0x17'))('api');var utils=require(_0xaab0('0x18'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xaab0('0x19'))['db'];function respondWithStatusCode(_0x572f54,_0x1fc101){_0x1fc101=_0x1fc101||0xcc;return function(_0xc18cdc){if(_0xc18cdc){return _0x572f54[_0xaab0('0x1a')](_0x1fc101);}return _0x572f54['status'](_0x1fc101)['end']();};}function respondWithResult(_0x176ead,_0x14a681){_0x14a681=_0x14a681||0xc8;return function(_0x303fe2){if(_0x303fe2){return _0x176ead[_0xaab0('0x1b')](_0x14a681)['json'](_0x303fe2);}};}function respondWithFilteredResult(_0x40e793,_0x5780f4){return function(_0x14557e){if(_0x14557e){var _0x20b344=typeof _0x5780f4['offset']===_0xaab0('0x1c')&&typeof _0x5780f4['limit']==='undefined';var _0x47799f=_0x14557e['count'];var _0x4ce35c=_0x20b344?0x0:_0x5780f4[_0xaab0('0x1d')];var _0x22e1eb=_0x20b344?_0x14557e[_0xaab0('0x1e')]:_0x5780f4[_0xaab0('0x1d')]+_0x5780f4[_0xaab0('0x1f')];var _0x41d12a;if(_0x22e1eb>=_0x47799f){_0x22e1eb=_0x47799f;_0x41d12a=0xc8;}else{_0x41d12a=0xce;}_0x40e793[_0xaab0('0x1b')](_0x41d12a);return _0x40e793[_0xaab0('0x20')](_0xaab0('0x21'),_0x4ce35c+'-'+_0x22e1eb+'/'+_0x47799f)[_0xaab0('0x22')](_0x14557e);}return null;};}function patchUpdates(_0x3e2352){return function(_0x4b70e6){try{jsonpatch[_0xaab0('0x23')](_0x4b70e6,_0x3e2352,!![]);}catch(_0x73f678){return BPromise[_0xaab0('0x24')](_0x73f678);}return _0x4b70e6[_0xaab0('0x25')]();};}function saveUpdates(_0x4e88fc,_0x42e436){return function(_0x40aa85){if(_0x40aa85){return _0x40aa85['update'](_0x4e88fc)[_0xaab0('0x26')](function(_0x5d893e){return _0x5d893e;});}return null;};}function removeEntity(_0xc43e43,_0x352c0e){return function(_0x57265a){if(_0x57265a){return _0x57265a[_0xaab0('0x27')]()[_0xaab0('0x26')](function(){_0xc43e43[_0xaab0('0x1b')](0xcc)[_0xaab0('0x28')]();});}};}function handleEntityNotFound(_0x1e985e,_0x32675c){return function(_0x39c5a9){if(!_0x39c5a9){_0x1e985e[_0xaab0('0x1a')](0x194);}return _0x39c5a9;};}function handleError(_0x3e98c6,_0x182d8a){_0x182d8a=_0x182d8a||0x1f4;return function(_0x217cf5){logger[_0xaab0('0x29')](_0x217cf5['stack']);if(_0x217cf5[_0xaab0('0x2a')]){delete _0x217cf5[_0xaab0('0x2a')];}_0x3e98c6['status'](_0x182d8a)['send'](_0x217cf5);};}exports[_0xaab0('0x2b')]=function(_0x5bada7,_0x49823c){var _0x19c2b2={},_0x177d83={},_0x3dd07b={'count':0x0,'rows':[]};var _0x53d4b4=_[_0xaab0('0x2c')](db[_0xaab0('0x2d')][_0xaab0('0x2e')],function(_0x30b2e5){return{'name':_0x30b2e5[_0xaab0('0x2f')],'type':_0x30b2e5[_0xaab0('0x30')]['key']};});_0x177d83[_0xaab0('0x31')]=_[_0xaab0('0x2c')](_0x53d4b4,_0xaab0('0x2a'));_0x177d83[_0xaab0('0x32')]=_['keys'](_0x5bada7[_0xaab0('0x32')]);_0x177d83[_0xaab0('0x33')]=_[_0xaab0('0x34')](_0x177d83[_0xaab0('0x31')],_0x177d83['query']);_0x19c2b2[_0xaab0('0x35')]=_['intersection'](_0x177d83[_0xaab0('0x31')],qs['fields'](_0x5bada7[_0xaab0('0x32')][_0xaab0('0x36')]));_0x19c2b2[_0xaab0('0x35')]=_0x19c2b2[_0xaab0('0x35')]['length']?_0x19c2b2[_0xaab0('0x35')]:_0x177d83['model'];if(!_0x5bada7['query']['hasOwnProperty']('nolimit')){_0x19c2b2['limit']=qs['limit'](_0x5bada7[_0xaab0('0x32')][_0xaab0('0x1f')]);_0x19c2b2['offset']=qs[_0xaab0('0x1d')](_0x5bada7[_0xaab0('0x32')][_0xaab0('0x1d')]);}_0x19c2b2[_0xaab0('0x37')]=qs[_0xaab0('0x38')](_0x5bada7[_0xaab0('0x32')]['sort']);_0x19c2b2[_0xaab0('0x39')]=qs['filters'](_[_0xaab0('0x3a')](_0x5bada7[_0xaab0('0x32')],_0x177d83[_0xaab0('0x33')]),_0x53d4b4);if(_0x5bada7[_0xaab0('0x32')][_0xaab0('0x3b')]){_0x19c2b2[_0xaab0('0x39')]=_[_0xaab0('0x3c')](_0x19c2b2[_0xaab0('0x39')],{'$or':_[_0xaab0('0x2c')](_0x53d4b4,function(_0x589856){if(_0x589856['type']!==_0xaab0('0x3d')){var _0x3b681c={};_0x3b681c[_0x589856[_0xaab0('0x2a')]]={'$like':'%'+_0x5bada7['query'][_0xaab0('0x3b')]+'%'};return _0x3b681c;}})});}_0x19c2b2=_[_0xaab0('0x3c')]({},_0x19c2b2,_0x5bada7[_0xaab0('0x3e')]);var _0x5ade55={'where':_0x19c2b2[_0xaab0('0x39')]};return db[_0xaab0('0x2d')]['count'](_0x5ade55)[_0xaab0('0x26')](function(_0x2e58ce){_0x3dd07b[_0xaab0('0x1e')]=_0x2e58ce;if(_0x5bada7[_0xaab0('0x32')][_0xaab0('0x3f')]){_0x19c2b2['include']=[{'all':!![]}];}return db[_0xaab0('0x2d')][_0xaab0('0x40')](_0x19c2b2);})[_0xaab0('0x26')](function(_0xb12582){_0x3dd07b[_0xaab0('0x41')]=_0xb12582;return _0x3dd07b;})[_0xaab0('0x26')](respondWithFilteredResult(_0x49823c,_0x19c2b2))[_0xaab0('0x42')](handleError(_0x49823c,null));};exports['show']=function(_0x54a259,_0x45b027){var _0x398bec={'raw':![],'where':{'id':_0x54a259[_0xaab0('0x43')]['id']}},_0x4ceb00={};_0x4ceb00['model']=_[_0xaab0('0x44')](db[_0xaab0('0x2d')]['rawAttributes']);_0x4ceb00['query']=_[_0xaab0('0x44')](_0x54a259[_0xaab0('0x32')]);_0x4ceb00[_0xaab0('0x33')]=_[_0xaab0('0x34')](_0x4ceb00[_0xaab0('0x31')],_0x4ceb00[_0xaab0('0x32')]);_0x398bec[_0xaab0('0x35')]=_[_0xaab0('0x34')](_0x4ceb00['model'],qs[_0xaab0('0x36')](_0x54a259[_0xaab0('0x32')][_0xaab0('0x36')]));_0x398bec[_0xaab0('0x35')]=_0x398bec[_0xaab0('0x35')][_0xaab0('0x45')]?_0x398bec[_0xaab0('0x35')]:_0x4ceb00['model'];if(_0x54a259[_0xaab0('0x32')][_0xaab0('0x3f')]){_0x398bec[_0xaab0('0x46')]=[{'all':!![]}];}_0x398bec=_[_0xaab0('0x3c')]({},_0x398bec,_0x54a259[_0xaab0('0x3e')]);return db[_0xaab0('0x2d')][_0xaab0('0x47')](_0x398bec)['then'](handleEntityNotFound(_0x45b027,null))[_0xaab0('0x26')](respondWithResult(_0x45b027,null))[_0xaab0('0x42')](handleError(_0x45b027,null));};exports[_0xaab0('0x48')]=function(_0x167d78,_0x8ffc71){return db[_0xaab0('0x2d')]['create'](_0x167d78['body'],{})[_0xaab0('0x26')](respondWithResult(_0x8ffc71,0xc9))['catch'](handleError(_0x8ffc71,null));};exports[_0xaab0('0x49')]=function(_0x2e3c8a,_0x36dcb2){return db[_0xaab0('0x2d')][_0xaab0('0x49')](_0x2e3c8a[_0xaab0('0x4a')],{'raw':![],'individualHooks':!![]})[_0xaab0('0x26')](respondWithResult(_0x36dcb2,0xc9))['catch'](handleError(_0x36dcb2,null));};exports[_0xaab0('0x4b')]=function(_0x538948,_0x2cdc99){if(_0x538948[_0xaab0('0x4a')]['id']){delete _0x538948[_0xaab0('0x4a')]['id'];}return db['AnalyticFieldReport'][_0xaab0('0x47')]({'where':{'id':_0x538948[_0xaab0('0x43')]['id']}})['then'](handleEntityNotFound(_0x2cdc99,null))[_0xaab0('0x26')](saveUpdates(_0x538948[_0xaab0('0x4a')],null))[_0xaab0('0x26')](respondWithResult(_0x2cdc99,null))['catch'](handleError(_0x2cdc99,null));};exports['destroy']=function(_0x1f46b6,_0x49a3f9){return db[_0xaab0('0x2d')][_0xaab0('0x47')]({'where':{'id':_0x1f46b6[_0xaab0('0x43')]['id']}})['then'](handleEntityNotFound(_0x49a3f9,null))[_0xaab0('0x26')](removeEntity(_0x49a3f9,null))['catch'](handleError(_0x49a3f9,null));};exports[_0xaab0('0x4c')]=function(_0x1871a2,_0x4a2ce5){return db['AnalyticFieldReport'][_0xaab0('0x27')]({'where':{'id':_0x1871a2[_0xaab0('0x32')][_0xaab0('0x4d')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4a2ce5,0xcc))[_0xaab0('0x42')](handleError(_0x4a2ce5,null));};exports[_0xaab0('0x4e')]=function(_0x78696f,_0x46cb2f,_0x406217){return db[_0xaab0('0x4f')][_0xaab0('0x50')]({'where':{'id':_0x78696f['params']['id']}})['then'](handleEntityNotFound(_0x46cb2f,null))['then'](function(_0x80af22){if(_0x80af22){return db[_0xaab0('0x51')]['transaction'](function(_0x569d93){return db['AnalyticFieldReport'][_0xaab0('0x27')]({'where':{'CustomReportId':_0x78696f[_0xaab0('0x43')]['id']},'transaction':_0x569d93})['then'](function(_0x3683cc){var _0x4b7e3d=_[_0xaab0('0x2c')](_0x78696f[_0xaab0('0x4a')],function(_0x26889e){delete _0x26889e['id'];_0x26889e[_0xaab0('0x52')]=_0x78696f[_0xaab0('0x43')]['id'];return _0x26889e;});return db[_0xaab0('0x2d')][_0xaab0('0x49')](_0x4b7e3d,{'transaction':_0x569d93});});})['then'](function(){return db[_0xaab0('0x2d')][_0xaab0('0x40')]({'where':{'CustomReportId':_0x78696f[_0xaab0('0x43')]['id']}});});}})['then'](respondWithResult(_0x46cb2f,null))['catch'](handleError(_0x46cb2f,null));};
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js
index e14ccef..c78c1d5 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 _0x69e8=['analytics_report_fields','lodash','../../config/logger','moment','bluebird','path','rimraf','./analyticFieldReport.attributes'];(function(_0x1d0c54,_0x5ae9a4){var _0x4baf3d=function(_0x36383c){while(--_0x36383c){_0x1d0c54['push'](_0x1d0c54['shift']());}};_0x4baf3d(++_0x5ae9a4);}(_0x69e8,0x1a9));var _0x869e=function(_0x433110,_0x19bb15){_0x433110=_0x433110-0x0;var _0x44cbc5=_0x69e8[_0x433110];return _0x44cbc5;};'use strict';var _=require(_0x869e('0x0'));var util=require('util');var logger=require(_0x869e('0x1'))('api');var moment=require(_0x869e('0x2'));var BPromise=require(_0x869e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x869e('0x4'));var rimraf=require(_0x869e('0x5'));var config=require('../../config/environment');var attributes=require(_0x869e('0x6'));module['exports']=function(_0x488faa,_0x5cf90f){return _0x488faa['define']('AnalyticFieldReport',attributes,{'tableName':_0x869e('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x15d8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields'];(function(_0x16cec8,_0x4d8d60){var _0x21906b=function(_0x523698){while(--_0x523698){_0x16cec8['push'](_0x16cec8['shift']());}};_0x21906b(++_0x4d8d60);}(_0x15d8,0xc3));var _0x815d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x15d8[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x815d('0x0'))(_0x815d('0x1'));var moment=require(_0x815d('0x2'));var BPromise=require(_0x815d('0x3'));var rp=require(_0x815d('0x4'));var fs=require('fs');var path=require(_0x815d('0x5'));var rimraf=require(_0x815d('0x6'));var config=require(_0x815d('0x7'));var attributes=require(_0x815d('0x8'));module[_0x815d('0x9')]=function(_0x310e32,_0xe7adbf){return _0x310e32[_0x815d('0xa')](_0x815d('0xb'),attributes,{'tableName':_0x815d('0xc'),'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 b14435c..0ac0adc 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 _0x3571=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request'];(function(_0xc04c1e,_0x41a274){var _0x5c6225=function(_0x25ee19){while(--_0x25ee19){_0xc04c1e['push'](_0xc04c1e['shift']());}};_0x5c6225(++_0x41a274);}(_0x3571,0x67));var _0x1357=function(_0x516ffb,_0x5b5b42){_0x516ffb=_0x516ffb-0x0;var _0x319667=_0x3571[_0x516ffb];return _0x319667;};'use strict';var _=require(_0x1357('0x0'));var util=require(_0x1357('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1357('0x2'));var fs=require('fs');var Redis=require(_0x1357('0x3'));var db=require(_0x1357('0x4'))['db'];var utils=require(_0x1357('0x5'));var logger=require(_0x1357('0x6'))(_0x1357('0x7'));var config=require(_0x1357('0x8'));var jayson=require(_0x1357('0x9'));var client=jayson[_0x1357('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58f16b,_0xa6a248,_0x4220f2){return new BPromise(function(_0x273bb9,_0x210428){return client[_0x1357('0xb')](_0x58f16b,_0x4220f2)[_0x1357('0xc')](function(_0x212b88){logger[_0x1357('0xd')](_0x1357('0xe'),_0xa6a248,_0x1357('0xf'));logger[_0x1357('0x10')](_0x1357('0x11'),_0xa6a248,_0x1357('0xf'),JSON[_0x1357('0x12')](_0x212b88));if(_0x212b88[_0x1357('0x13')]){if(_0x212b88[_0x1357('0x13')]['code']===0x1f4){logger[_0x1357('0x13')](_0x1357('0xe'),_0xa6a248,_0x212b88[_0x1357('0x13')]['message']);return _0x210428(_0x212b88[_0x1357('0x13')][_0x1357('0x14')]);}logger[_0x1357('0x13')](_0x1357('0xe'),_0xa6a248,_0x212b88[_0x1357('0x13')][_0x1357('0x14')]);return _0x273bb9(_0x212b88[_0x1357('0x13')][_0x1357('0x14')]);}else{logger[_0x1357('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0xa6a248,_0x1357('0xf'));_0x273bb9(_0x212b88[_0x1357('0x15')][_0x1357('0x14')]);}})[_0x1357('0x16')](function(_0x1a96c3){logger[_0x1357('0x13')](_0x1357('0xe'),_0xa6a248,_0x1a96c3);_0x210428(_0x1a96c3);});});}
\ No newline at end of file
+var _0x0ca2=['info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0xd3ea95,_0x2cb732){var _0x1f2306=function(_0x26b115){while(--_0x26b115){_0xd3ea95['push'](_0xd3ea95['shift']());}};_0x1f2306(++_0x2cb732);}(_0x0ca2,0x1c0));var _0x20ca=function(_0x125233,_0x522bf1){_0x125233=_0x125233-0x0;var _0x42d385=_0x0ca2[_0x125233];return _0x42d385;};'use strict';var _=require(_0x20ca('0x0'));var util=require(_0x20ca('0x1'));var moment=require(_0x20ca('0x2'));var BPromise=require(_0x20ca('0x3'));var rs=require(_0x20ca('0x4'));var fs=require('fs');var Redis=require(_0x20ca('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x20ca('0x6'))(_0x20ca('0x7'));var config=require(_0x20ca('0x8'));var jayson=require(_0x20ca('0x9'));var client=jayson['client'][_0x20ca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58cff7,_0x3914ec,_0x264852){return new BPromise(function(_0x2a6b7d,_0x13d5bd){return client[_0x20ca('0xb')](_0x58cff7,_0x264852)['then'](function(_0x448146){logger[_0x20ca('0xc')](_0x20ca('0xd'),_0x3914ec,_0x20ca('0xe'));logger[_0x20ca('0xf')](_0x20ca('0x10'),_0x3914ec,_0x20ca('0xe'),JSON[_0x20ca('0x11')](_0x448146));if(_0x448146[_0x20ca('0x12')]){if(_0x448146['error'][_0x20ca('0x13')]===0x1f4){logger[_0x20ca('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3914ec,_0x448146['error'][_0x20ca('0x14')]);return _0x13d5bd(_0x448146[_0x20ca('0x12')]['message']);}logger['error'](_0x20ca('0xd'),_0x3914ec,_0x448146[_0x20ca('0x12')][_0x20ca('0x14')]);return _0x2a6b7d(_0x448146[_0x20ca('0x12')][_0x20ca('0x14')]);}else{logger[_0x20ca('0xc')](_0x20ca('0xd'),_0x3914ec,_0x20ca('0xe'));_0x2a6b7d(_0x448146[_0x20ca('0x15')][_0x20ca('0x14')]);}})[_0x20ca('0x16')](function(_0x59d97b){logger[_0x20ca('0x12')](_0x20ca('0xd'),_0x3914ec,_0x59d97b);_0x13d5bd(_0x59d97b);});});}
\ No newline at end of file
diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js
index a9bf4a4..7d1fed0 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(_0x29fd64,_0x2446ad){var _0x2b00b7=function(_0x50d454){while(--_0x50d454){_0x29fd64['push'](_0x29fd64['shift']());}};_0x2b00b7(++_0x2446ad);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'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(_0x34c719,_0x2a5384){var _0x21d890=function(_0x364a6b){while(--_0x364a6b){_0x34c719['push'](_0x34c719['shift']());}};_0x21d890(++_0x2a5384);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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 05167fb..c53285f 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 _0x6075=['name','STRING','sequelize','exports'];(function(_0x1fc122,_0x5e2c17){var _0xa2cb13=function(_0x263b13){while(--_0x263b13){_0x1fc122['push'](_0x1fc122['shift']());}};_0xa2cb13(++_0x5e2c17);}(_0x6075,0x142));var _0x5607=function(_0x4ba5f5,_0xb00659){_0x4ba5f5=_0x4ba5f5-0x0;var _0x3af93f=_0x6075[_0x4ba5f5];return _0x3af93f;};'use strict';var Sequelize=require(_0x5607('0x0'));module[_0x5607('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x5607('0x2')},'table':{'type':Sequelize[_0x5607('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
+var _0x74f4=['name','STRING','sequelize','exports'];(function(_0x46aff0,_0x122890){var _0x9d78cf=function(_0x3f14cb){while(--_0x3f14cb){_0x46aff0['push'](_0x46aff0['shift']());}};_0x9d78cf(++_0x122890);}(_0x74f4,0xaa));var _0x474f=function(_0x52cc14,_0x1fc7f4){_0x52cc14=_0x52cc14-0x0;var _0x12ed0c=_0x74f4[_0x52cc14];return _0x12ed0c;};'use strict';var Sequelize=require(_0x474f('0x0'));module[_0x474f('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x474f('0x2')},'table':{'type':Sequelize[_0x474f('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0x474f('0x3')]}};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js
index 1b7cb6c..a324320 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 _0x1cb9=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','reject','save','update','then','destroy','get','Metrics','error','stack','name','send','index','map','AnalyticMetric','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','filter','options','includeAll','include','findAll','show','params','keys','length','find','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2e4837,_0x58859a){_0x2e4837=_0x2e4837-0x0;var _0x124dad=_0x1cb9[_0x2e4837];return _0x124dad;};'use strict';var emlformat=require(_0x91cb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x91cb('0x1'));var jsonpatch=require(_0x91cb('0x2'));var rp=require(_0x91cb('0x3'));var moment=require(_0x91cb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x91cb('0x5'));var util=require(_0x91cb('0x6'));var path=require('path');var sox=require(_0x91cb('0x7'));var csv=require(_0x91cb('0x8'));var ejs=require(_0x91cb('0x9'));var fs=require('fs');var fs_extra=require(_0x91cb('0xa'));var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x8'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0x91cb('0x18'))['db'];function respondWithStatusCode(_0x366f09,_0x4ba2f2){_0x4ba2f2=_0x4ba2f2||0xcc;return function(_0x20e6e0){if(_0x20e6e0){return _0x366f09[_0x91cb('0x19')](_0x4ba2f2);}return _0x366f09[_0x91cb('0x1a')](_0x4ba2f2)[_0x91cb('0x1b')]();};}function respondWithResult(_0x4a7d45,_0x4cc6ef){_0x4cc6ef=_0x4cc6ef||0xc8;return function(_0x4aae25){if(_0x4aae25){return _0x4a7d45[_0x91cb('0x1a')](_0x4cc6ef)['json'](_0x4aae25);}};}function respondWithFilteredResult(_0x528f73,_0x576369){return function(_0xc3629e){if(_0xc3629e){var _0x347980=typeof _0x576369['offset']===_0x91cb('0x1c')&&typeof _0x576369[_0x91cb('0x1d')]==='undefined';var _0xc594e3=_0xc3629e[_0x91cb('0x1e')];var _0x1cd34b=_0x347980?0x0:_0x576369[_0x91cb('0x1f')];var _0x5cc1c3=_0x347980?_0xc3629e[_0x91cb('0x1e')]:_0x576369[_0x91cb('0x1f')]+_0x576369['limit'];var _0x123847;if(_0x5cc1c3>=_0xc594e3){_0x5cc1c3=_0xc594e3;_0x123847=0xc8;}else{_0x123847=0xce;}_0x528f73['status'](_0x123847);return _0x528f73['set'](_0x91cb('0x20'),_0x1cd34b+'-'+_0x5cc1c3+'/'+_0xc594e3)[_0x91cb('0x21')](_0xc3629e);}return null;};}function patchUpdates(_0x56e409){return function(_0x51a1d5){try{jsonpatch['apply'](_0x51a1d5,_0x56e409,!![]);}catch(_0x438162){return BPromise[_0x91cb('0x22')](_0x438162);}return _0x51a1d5[_0x91cb('0x23')]();};}function saveUpdates(_0x1dbee2,_0x5c6a15){return function(_0x45c4b3){if(_0x45c4b3){return _0x45c4b3[_0x91cb('0x24')](_0x1dbee2)[_0x91cb('0x25')](function(_0x55fa78){return _0x55fa78;});}return null;};}function removeEntity(_0x26f18f,_0x1a7a54){return function(_0x2447e7){if(_0x2447e7){return _0x2447e7[_0x91cb('0x26')]()[_0x91cb('0x25')](function(){var _0x7ad361=_0x2447e7[_0x91cb('0x27')]({'plain':!![]});var _0x423c4f=_0x91cb('0x28');return db['UserProfileResource']['destroy']({'where':{'type':_0x423c4f,'resourceId':_0x7ad361['id']}})[_0x91cb('0x25')](function(){return _0x2447e7;});})['then'](function(){_0x26f18f[_0x91cb('0x1a')](0xcc)[_0x91cb('0x1b')]();});}};}function handleEntityNotFound(_0x318031,_0x5595c5){return function(_0x9b26a6){if(!_0x9b26a6){_0x318031['sendStatus'](0x194);}return _0x9b26a6;};}function handleError(_0x4572f6,_0x308e8c){_0x308e8c=_0x308e8c||0x1f4;return function(_0x3b3ee6){logger[_0x91cb('0x29')](_0x3b3ee6[_0x91cb('0x2a')]);if(_0x3b3ee6['name']){delete _0x3b3ee6[_0x91cb('0x2b')];}_0x4572f6['status'](_0x308e8c)[_0x91cb('0x2c')](_0x3b3ee6);};}exports[_0x91cb('0x2d')]=function(_0x445fe1,_0x4944bd){var _0x775c25={},_0x146e1f={},_0x25bbf9={'count':0x0,'rows':[]};var _0x361e4c=_[_0x91cb('0x2e')](db[_0x91cb('0x2f')][_0x91cb('0x30')],function(_0x3bbde3){return{'name':_0x3bbde3[_0x91cb('0x31')],'type':_0x3bbde3['type'][_0x91cb('0x32')]};});_0x146e1f[_0x91cb('0x33')]=_[_0x91cb('0x2e')](_0x361e4c,_0x91cb('0x2b'));_0x146e1f[_0x91cb('0x34')]=_['keys'](_0x445fe1[_0x91cb('0x34')]);_0x146e1f[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x146e1f[_0x91cb('0x33')],_0x146e1f[_0x91cb('0x34')]);_0x775c25['attributes']=_[_0x91cb('0x36')](_0x146e1f['model'],qs['fields'](_0x445fe1['query'][_0x91cb('0x37')]));_0x775c25['attributes']=_0x775c25[_0x91cb('0x38')]['length']?_0x775c25['attributes']:_0x146e1f[_0x91cb('0x33')];if(!_0x445fe1[_0x91cb('0x34')][_0x91cb('0x39')](_0x91cb('0x3a'))){_0x775c25[_0x91cb('0x1d')]=qs['limit'](_0x445fe1[_0x91cb('0x34')][_0x91cb('0x1d')]);_0x775c25[_0x91cb('0x1f')]=qs[_0x91cb('0x1f')](_0x445fe1['query']['offset']);}_0x775c25[_0x91cb('0x3b')]=qs[_0x91cb('0x3c')](_0x445fe1['query'][_0x91cb('0x3c')]);_0x775c25[_0x91cb('0x3d')]=qs['filters'](_[_0x91cb('0x3e')](_0x445fe1[_0x91cb('0x34')],_0x146e1f['filters']),_0x361e4c);if(_0x445fe1[_0x91cb('0x34')]['filter']){_0x775c25[_0x91cb('0x3d')]=_[_0x91cb('0x3f')](_0x775c25[_0x91cb('0x3d')],{'$or':_[_0x91cb('0x2e')](_0x361e4c,function(_0x51d0ea){if(_0x51d0ea[_0x91cb('0x40')]!=='VIRTUAL'){var _0xa90111={};_0xa90111[_0x51d0ea[_0x91cb('0x2b')]]={'$like':'%'+_0x445fe1['query'][_0x91cb('0x41')]+'%'};return _0xa90111;}})});}_0x775c25=_['merge']({},_0x775c25,_0x445fe1[_0x91cb('0x42')]);var _0x2eac87={'where':_0x775c25[_0x91cb('0x3d')]};return db[_0x91cb('0x2f')]['count'](_0x2eac87)[_0x91cb('0x25')](function(_0x5af0e6){_0x25bbf9[_0x91cb('0x1e')]=_0x5af0e6;if(_0x445fe1[_0x91cb('0x34')][_0x91cb('0x43')]){_0x775c25[_0x91cb('0x44')]=[{'all':!![]}];}return db[_0x91cb('0x2f')][_0x91cb('0x45')](_0x775c25);})[_0x91cb('0x25')](function(_0x3cc4c1){_0x25bbf9['rows']=_0x3cc4c1;return _0x25bbf9;})[_0x91cb('0x25')](respondWithFilteredResult(_0x4944bd,_0x775c25))['catch'](handleError(_0x4944bd,null));};exports[_0x91cb('0x46')]=function(_0x5537a0,_0x335879){var _0x52e82c={'raw':!![],'where':{'id':_0x5537a0[_0x91cb('0x47')]['id']}},_0x138f48={};_0x138f48[_0x91cb('0x33')]=_[_0x91cb('0x48')](db['AnalyticMetric'][_0x91cb('0x30')]);_0x138f48[_0x91cb('0x34')]=_['keys'](_0x5537a0[_0x91cb('0x34')]);_0x138f48[_0x91cb('0x35')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],_0x138f48[_0x91cb('0x34')]);_0x52e82c[_0x91cb('0x38')]=_[_0x91cb('0x36')](_0x138f48[_0x91cb('0x33')],qs[_0x91cb('0x37')](_0x5537a0['query'][_0x91cb('0x37')]));_0x52e82c[_0x91cb('0x38')]=_0x52e82c[_0x91cb('0x38')][_0x91cb('0x49')]?_0x52e82c[_0x91cb('0x38')]:_0x138f48[_0x91cb('0x33')];if(_0x5537a0[_0x91cb('0x34')][_0x91cb('0x43')]){_0x52e82c['include']=[{'all':!![]}];}_0x52e82c=_[_0x91cb('0x3f')]({},_0x52e82c,_0x5537a0[_0x91cb('0x42')]);return db[_0x91cb('0x2f')][_0x91cb('0x4a')](_0x52e82c)['then'](handleEntityNotFound(_0x335879,null))[_0x91cb('0x25')](respondWithResult(_0x335879,null))[_0x91cb('0x4b')](handleError(_0x335879,null));};exports['create']=function(_0x212473,_0x47cdb7){return db[_0x91cb('0x2f')]['create'](_0x212473['body'],{})['then'](function(_0x98245b){var _0xff3d11=_0x212473[_0x91cb('0x4c')][_0x91cb('0x27')]({'plain':!![]});if(!_0xff3d11)throw new Error(_0x91cb('0x4d'));if(_0xff3d11['role']==='user'){var _0x1d26b8=_0x98245b[_0x91cb('0x27')]({'plain':!![]});var _0x140994=_0x91cb('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x140994,'userProfileId':_0xff3d11['userProfileId']},'raw':!![]})[_0x91cb('0x25')](function(_0x490417){if(_0x490417&&_0x490417[_0x91cb('0x4e')]===0x0){return db['UserProfileResource'][_0x91cb('0x4f')]({'name':_0x1d26b8[_0x91cb('0x2b')],'resourceId':_0x1d26b8['id'],'type':_0x490417[_0x91cb('0x2b')],'sectionId':_0x490417['id']},{})[_0x91cb('0x25')](function(){return _0x98245b;});}else{return _0x98245b;}})[_0x91cb('0x4b')](function(_0x362532){logger[_0x91cb('0x29')](_0x91cb('0x50'),_0x362532);throw _0x362532;});}return _0x98245b;})[_0x91cb('0x25')](respondWithResult(_0x47cdb7,0xc9))[_0x91cb('0x4b')](handleError(_0x47cdb7,null));};exports[_0x91cb('0x24')]=function(_0x5752ed,_0x1e445a){if(_0x5752ed[_0x91cb('0x51')]['id']){delete _0x5752ed['body']['id'];}return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x5752ed['params']['id']}})[_0x91cb('0x25')](handleEntityNotFound(_0x1e445a,null))[_0x91cb('0x25')](saveUpdates(_0x5752ed[_0x91cb('0x51')],null))[_0x91cb('0x25')](respondWithResult(_0x1e445a,null))[_0x91cb('0x4b')](handleError(_0x1e445a,null));};exports[_0x91cb('0x26')]=function(_0x1d4b96,_0x274fff){return db[_0x91cb('0x2f')][_0x91cb('0x4a')]({'where':{'id':_0x1d4b96[_0x91cb('0x47')]['id']}})['then'](handleEntityNotFound(_0x274fff,null))[_0x91cb('0x25')](removeEntity(_0x274fff,null))['catch'](handleError(_0x274fff,null));};
\ No newline at end of file
+var _0x7fbe=['util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json','offset','undefined','limit','count','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','AnalyticMetric','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','rows','show','params','create','body','role','user','Metrics','find','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x1a53ea,_0x13cb83){var _0x227ec0=function(_0x43df7b){while(--_0x43df7b){_0x1a53ea['push'](_0x1a53ea['shift']());}};_0x227ec0(++_0x13cb83);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x301ca3,_0x4233c5){_0x301ca3=_0x301ca3-0x0;var _0x131292=_0x7fbe[_0x301ca3];return _0x131292;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe7fb('0x0'));var jsonpatch=require(_0xe7fb('0x1'));var rp=require(_0xe7fb('0x2'));var moment=require(_0xe7fb('0x3'));var BPromise=require(_0xe7fb('0x4'));var Mustache=require(_0xe7fb('0x5'));var util=require(_0xe7fb('0x6'));var path=require(_0xe7fb('0x7'));var sox=require(_0xe7fb('0x8'));var csv=require(_0xe7fb('0x9'));var ejs=require(_0xe7fb('0xa'));var fs=require('fs');var fs_extra=require(_0xe7fb('0xb'));var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0x9'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var licenseUtil=require(_0xe7fb('0x19'));var db=require(_0xe7fb('0x1a'))['db'];function respondWithStatusCode(_0x2437d4,_0x188e1d){_0x188e1d=_0x188e1d||0xcc;return function(_0xdf9760){if(_0xdf9760){return _0x2437d4[_0xe7fb('0x1b')](_0x188e1d);}return _0x2437d4[_0xe7fb('0x1c')](_0x188e1d)['end']();};}function respondWithResult(_0x278b75,_0x2225e5){_0x2225e5=_0x2225e5||0xc8;return function(_0x5573ab){if(_0x5573ab){return _0x278b75[_0xe7fb('0x1c')](_0x2225e5)[_0xe7fb('0x1d')](_0x5573ab);}};}function respondWithFilteredResult(_0x482f7d,_0xa76acf){return function(_0x559129){if(_0x559129){var _0x12fff6=typeof _0xa76acf[_0xe7fb('0x1e')]===_0xe7fb('0x1f')&&typeof _0xa76acf[_0xe7fb('0x20')]==='undefined';var _0x892b0f=_0x559129['count'];var _0x293a47=_0x12fff6?0x0:_0xa76acf['offset'];var _0x1e77fd=_0x12fff6?_0x559129[_0xe7fb('0x21')]:_0xa76acf[_0xe7fb('0x1e')]+_0xa76acf[_0xe7fb('0x20')];var _0x5df1a1;if(_0x1e77fd>=_0x892b0f){_0x1e77fd=_0x892b0f;_0x5df1a1=0xc8;}else{_0x5df1a1=0xce;}_0x482f7d[_0xe7fb('0x1c')](_0x5df1a1);return _0x482f7d['set'](_0xe7fb('0x22'),_0x293a47+'-'+_0x1e77fd+'/'+_0x892b0f)['json'](_0x559129);}return null;};}function patchUpdates(_0x15f7a4){return function(_0x4ea664){try{jsonpatch[_0xe7fb('0x23')](_0x4ea664,_0x15f7a4,!![]);}catch(_0x135624){return BPromise['reject'](_0x135624);}return _0x4ea664[_0xe7fb('0x24')]();};}function saveUpdates(_0x4742bd,_0x3ae8f1){return function(_0x4dcb4b){if(_0x4dcb4b){return _0x4dcb4b[_0xe7fb('0x25')](_0x4742bd)[_0xe7fb('0x26')](function(_0x5da3d9){return _0x5da3d9;});}return null;};}function removeEntity(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(_0x35e4db){return _0x35e4db['destroy']()['then'](function(){var _0x4026b1=_0x35e4db[_0xe7fb('0x27')]({'plain':!![]});var _0x2996ae='Metrics';return db[_0xe7fb('0x28')][_0xe7fb('0x29')]({'where':{'type':_0x2996ae,'resourceId':_0x4026b1['id']}})[_0xe7fb('0x26')](function(){return _0x35e4db;});})[_0xe7fb('0x26')](function(){_0x5bea27[_0xe7fb('0x1c')](0xcc)[_0xe7fb('0x2a')]();});}};}function handleEntityNotFound(_0x380130,_0x59e015){return function(_0x5df9f2){if(!_0x5df9f2){_0x380130[_0xe7fb('0x1b')](0x194);}return _0x5df9f2;};}function handleError(_0x3bdee9,_0xead63){_0xead63=_0xead63||0x1f4;return function(_0x4fd290){logger[_0xe7fb('0x2b')](_0x4fd290[_0xe7fb('0x2c')]);if(_0x4fd290[_0xe7fb('0x2d')]){delete _0x4fd290[_0xe7fb('0x2d')];}_0x3bdee9[_0xe7fb('0x1c')](_0xead63)[_0xe7fb('0x2e')](_0x4fd290);};}exports[_0xe7fb('0x2f')]=function(_0x3dd0be,_0x4ce993){var _0x3d1fb5={},_0x1742f3={},_0x29d1ca={'count':0x0,'rows':[]};var _0x547a04=_['map'](db[_0xe7fb('0x30')]['rawAttributes'],function(_0xac56b4){return{'name':_0xac56b4[_0xe7fb('0x31')],'type':_0xac56b4[_0xe7fb('0x32')][_0xe7fb('0x33')]};});_0x1742f3['model']=_[_0xe7fb('0x34')](_0x547a04,_0xe7fb('0x2d'));_0x1742f3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x3dd0be[_0xe7fb('0x35')]);_0x1742f3['filters']=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],_0x1742f3[_0xe7fb('0x35')]);_0x3d1fb5[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x1742f3[_0xe7fb('0x38')],qs[_0xe7fb('0x3a')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3a')]));_0x3d1fb5['attributes']=_0x3d1fb5[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x3d1fb5[_0xe7fb('0x39')]:_0x1742f3['model'];if(!_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3c')](_0xe7fb('0x3d'))){_0x3d1fb5[_0xe7fb('0x20')]=qs[_0xe7fb('0x20')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x20')]);_0x3d1fb5[_0xe7fb('0x1e')]=qs[_0xe7fb('0x1e')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x1e')]);}_0x3d1fb5[_0xe7fb('0x3e')]=qs[_0xe7fb('0x3f')](_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x3f')]);_0x3d1fb5[_0xe7fb('0x40')]=qs[_0xe7fb('0x41')](_[_0xe7fb('0x42')](_0x3dd0be[_0xe7fb('0x35')],_0x1742f3['filters']),_0x547a04);if(_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]){_0x3d1fb5[_0xe7fb('0x40')]=_[_0xe7fb('0x44')](_0x3d1fb5['where'],{'$or':_[_0xe7fb('0x34')](_0x547a04,function(_0x186418){if(_0x186418[_0xe7fb('0x32')]!==_0xe7fb('0x45')){var _0x49fe9d={};_0x49fe9d[_0x186418[_0xe7fb('0x2d')]]={'$like':'%'+_0x3dd0be[_0xe7fb('0x35')][_0xe7fb('0x43')]+'%'};return _0x49fe9d;}})});}_0x3d1fb5=_[_0xe7fb('0x44')]({},_0x3d1fb5,_0x3dd0be[_0xe7fb('0x46')]);var _0xb729fc={'where':_0x3d1fb5['where']};return db[_0xe7fb('0x30')][_0xe7fb('0x21')](_0xb729fc)[_0xe7fb('0x26')](function(_0x4b263d){_0x29d1ca[_0xe7fb('0x21')]=_0x4b263d;if(_0x3dd0be[_0xe7fb('0x35')]['includeAll']){_0x3d1fb5['include']=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x3d1fb5);})['then'](function(_0x900d67){_0x29d1ca[_0xe7fb('0x47')]=_0x900d67;return _0x29d1ca;})[_0xe7fb('0x26')](respondWithFilteredResult(_0x4ce993,_0x3d1fb5))['catch'](handleError(_0x4ce993,null));};exports[_0xe7fb('0x48')]=function(_0x58d743,_0x19277f){var _0x32cfa4={'raw':!![],'where':{'id':_0x58d743[_0xe7fb('0x49')]['id']}},_0x4d29d3={};_0x4d29d3[_0xe7fb('0x38')]=_[_0xe7fb('0x36')](db[_0xe7fb('0x30')]['rawAttributes']);_0x4d29d3[_0xe7fb('0x35')]=_[_0xe7fb('0x36')](_0x58d743[_0xe7fb('0x35')]);_0x4d29d3['filters']=_[_0xe7fb('0x37')](_0x4d29d3[_0xe7fb('0x38')],_0x4d29d3[_0xe7fb('0x35')]);_0x32cfa4[_0xe7fb('0x39')]=_[_0xe7fb('0x37')](_0x4d29d3['model'],qs[_0xe7fb('0x3a')](_0x58d743['query'][_0xe7fb('0x3a')]));_0x32cfa4[_0xe7fb('0x39')]=_0x32cfa4[_0xe7fb('0x39')][_0xe7fb('0x3b')]?_0x32cfa4[_0xe7fb('0x39')]:_0x4d29d3['model'];if(_0x58d743[_0xe7fb('0x35')]['includeAll']){_0x32cfa4['include']=[{'all':!![]}];}_0x32cfa4=_[_0xe7fb('0x44')]({},_0x32cfa4,_0x58d743[_0xe7fb('0x46')]);return db[_0xe7fb('0x30')]['find'](_0x32cfa4)[_0xe7fb('0x26')](handleEntityNotFound(_0x19277f,null))[_0xe7fb('0x26')](respondWithResult(_0x19277f,null))['catch'](handleError(_0x19277f,null));};exports['create']=function(_0x284bcb,_0x42270b){return db[_0xe7fb('0x30')][_0xe7fb('0x4a')](_0x284bcb[_0xe7fb('0x4b')],{})[_0xe7fb('0x26')](function(_0x18a590){var _0x347177=_0x284bcb['user'][_0xe7fb('0x27')]({'plain':!![]});if(!_0x347177)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x347177[_0xe7fb('0x4c')]===_0xe7fb('0x4d')){var _0x5cedfb=_0x18a590[_0xe7fb('0x27')]({'plain':!![]});var _0x5efd24=_0xe7fb('0x4e');return db['UserProfileSection'][_0xe7fb('0x4f')]({'where':{'name':_0x5efd24,'userProfileId':_0x347177['userProfileId']},'raw':!![]})[_0xe7fb('0x26')](function(_0x59158c){if(_0x59158c&&_0x59158c[_0xe7fb('0x50')]===0x0){return db[_0xe7fb('0x28')][_0xe7fb('0x4a')]({'name':_0x5cedfb[_0xe7fb('0x2d')],'resourceId':_0x5cedfb['id'],'type':_0x59158c[_0xe7fb('0x2d')],'sectionId':_0x59158c['id']},{})[_0xe7fb('0x26')](function(){return _0x18a590;});}else{return _0x18a590;}})[_0xe7fb('0x51')](function(_0x582a4a){logger['error'](_0xe7fb('0x52'),_0x582a4a);throw _0x582a4a;});}return _0x18a590;})['then'](respondWithResult(_0x42270b,0xc9))['catch'](handleError(_0x42270b,null));};exports['update']=function(_0x50b8df,_0x539252){if(_0x50b8df[_0xe7fb('0x4b')]['id']){delete _0x50b8df[_0xe7fb('0x4b')]['id'];}return db[_0xe7fb('0x30')][_0xe7fb('0x4f')]({'where':{'id':_0x50b8df['params']['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x539252,null))[_0xe7fb('0x26')](saveUpdates(_0x50b8df[_0xe7fb('0x4b')],null))['then'](respondWithResult(_0x539252,null))['catch'](handleError(_0x539252,null));};exports[_0xe7fb('0x29')]=function(_0x377e5f,_0x300b8e){return db['AnalyticMetric'][_0xe7fb('0x4f')]({'where':{'id':_0x377e5f[_0xe7fb('0x49')]['id']}})[_0xe7fb('0x26')](handleEntityNotFound(_0x300b8e,null))[_0xe7fb('0x26')](removeEntity(_0x300b8e,null))['catch'](handleError(_0x300b8e,null));};
\ No newline at end of file
diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js
index 49771e0..8206502 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 _0x872a=['exports','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger','api','path','rimraf','../../config/environment','./analyticMetric.attributes'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0x872a,0x100));var _0xa872=function(_0x5f0085,_0xde7f4){_0x5f0085=_0x5f0085-0x0;var _0x57e491=_0x872a[_0x5f0085];return _0x57e491;};'use strict';var _=require(_0xa872('0x0'));var util=require(_0xa872('0x1'));var logger=require(_0xa872('0x2'))(_0xa872('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa872('0x4'));var rimraf=require(_0xa872('0x5'));var config=require(_0xa872('0x6'));var attributes=require(_0xa872('0x7'));module[_0xa872('0x8')]=function(_0x1c8d2f,_0x3e3cd4){return _0x1c8d2f['define'](_0xa872('0x9'),attributes,{'tableName':_0xa872('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc86=['../../config/environment','exports','define','AnalyticMetric','analytics_metrics','util','api','bluebird','request-promise','path','rimraf'];(function(_0x32bf3b,_0xfb8518){var _0x5c74a4=function(_0x317a74){while(--_0x317a74){_0x32bf3b['push'](_0x32bf3b['shift']());}};_0x5c74a4(++_0xfb8518);}(_0xdc86,0x118));var _0x6dc8=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0xdc86[_0x599f41];return _0x2e4d58;};'use strict';var _=require('lodash');var util=require(_0x6dc8('0x0'));var logger=require('../../config/logger')(_0x6dc8('0x1'));var moment=require('moment');var BPromise=require(_0x6dc8('0x2'));var rp=require(_0x6dc8('0x3'));var fs=require('fs');var path=require(_0x6dc8('0x4'));var rimraf=require(_0x6dc8('0x5'));var config=require(_0x6dc8('0x6'));var attributes=require('./analyticMetric.attributes');module[_0x6dc8('0x7')]=function(_0x3109bf,_0xbc9bc4){return _0x3109bf[_0x6dc8('0x8')](_0x6dc8('0x9'),attributes,{'tableName':_0x6dc8('0xa'),'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 0ef2cd5..1daa424 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 _0xd29d=['ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','code','message','error','result','lodash','moment','randomstring'];(function(_0x14f21c,_0x315b28){var _0x2b509b=function(_0x19ea1f){while(--_0x19ea1f){_0x14f21c['push'](_0x14f21c['shift']());}};_0x2b509b(++_0x315b28);}(_0xd29d,0xe4));var _0xdd29=function(_0x4224f9,_0x4e33fe){_0x4224f9=_0x4224f9-0x0;var _0xb36a10=_0xd29d[_0x4224f9];return _0xb36a10;};'use strict';var _=require(_0xdd29('0x0'));var util=require('util');var moment=require(_0xdd29('0x1'));var BPromise=require('bluebird');var rs=require(_0xdd29('0x2'));var fs=require('fs');var Redis=require(_0xdd29('0x3'));var db=require(_0xdd29('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdd29('0x5'));var config=require(_0xdd29('0x6'));var jayson=require(_0xdd29('0x7'));var client=jayson[_0xdd29('0x8')][_0xdd29('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x71fb13,_0x29b1d8,_0x465858){return new BPromise(function(_0xe00969,_0xfbe12d){return client[_0xdd29('0xa')](_0x71fb13,_0x465858)[_0xdd29('0xb')](function(_0x4e450f){logger[_0xdd29('0xc')](_0xdd29('0xd'),_0x29b1d8,_0xdd29('0xe'));logger[_0xdd29('0xf')](_0xdd29('0x10'),_0x29b1d8,_0xdd29('0xe'),JSON['stringify'](_0x4e450f));if(_0x4e450f['error']){if(_0x4e450f['error'][_0xdd29('0x11')]===0x1f4){logger['error'](_0xdd29('0xd'),_0x29b1d8,_0x4e450f['error'][_0xdd29('0x12')]);return _0xfbe12d(_0x4e450f[_0xdd29('0x13')][_0xdd29('0x12')]);}logger[_0xdd29('0x13')](_0xdd29('0xd'),_0x29b1d8,_0x4e450f['error'][_0xdd29('0x12')]);return _0xe00969(_0x4e450f['error'][_0xdd29('0x12')]);}else{logger[_0xdd29('0xc')]('AnalyticMetric,\x20%s,\x20%s',_0x29b1d8,'request\x20sent');_0xe00969(_0x4e450f[_0xdd29('0x14')][_0xdd29('0x12')]);}})['catch'](function(_0x3aca7d){logger[_0xdd29('0x13')](_0xdd29('0xd'),_0x29b1d8,_0x3aca7d);_0xfbe12d(_0x3aca7d);});});}
\ No newline at end of file
+var _0x8384=['result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','http','request','then','AnalyticMetric,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x8384,0xa2));var _0x4838=function(_0x131eb1,_0x55b270){_0x131eb1=_0x131eb1-0x0;var _0x3a3b7a=_0x8384[_0x131eb1];return _0x3a3b7a;};'use strict';var _=require(_0x4838('0x0'));var util=require('util');var moment=require(_0x4838('0x1'));var BPromise=require(_0x4838('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4838('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4838('0x4'));var logger=require(_0x4838('0x5'))(_0x4838('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4838('0x7')][_0x4838('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x598bb3,_0x37e7ab,_0x859be0){return new BPromise(function(_0x1cb9e8,_0x43d5c5){return client[_0x4838('0x9')](_0x598bb3,_0x859be0)[_0x4838('0xa')](function(_0x784cb1){logger['info'](_0x4838('0xb'),_0x37e7ab,_0x4838('0xc'));logger['debug']('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x37e7ab,_0x4838('0xc'),JSON[_0x4838('0xd')](_0x784cb1));if(_0x784cb1['error']){if(_0x784cb1[_0x4838('0xe')][_0x4838('0xf')]===0x1f4){logger[_0x4838('0xe')](_0x4838('0xb'),_0x37e7ab,_0x784cb1['error']['message']);return _0x43d5c5(_0x784cb1[_0x4838('0xe')][_0x4838('0x10')]);}logger['error'](_0x4838('0xb'),_0x37e7ab,_0x784cb1[_0x4838('0xe')]['message']);return _0x1cb9e8(_0x784cb1[_0x4838('0xe')][_0x4838('0x10')]);}else{logger[_0x4838('0x11')](_0x4838('0xb'),_0x37e7ab,'request\x20sent');_0x1cb9e8(_0x784cb1[_0x4838('0x12')]['message']);}})[_0x4838('0x13')](function(_0x1ba060){logger[_0x4838('0xe')](_0x4838('0xb'),_0x37e7ab,_0x1ba060);_0x43d5c5(_0x1ba060);});});}
\ No newline at end of file
diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js
index ab343e4..2761bae 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 _0x29d4=['put','update','destroy','multer','path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x2a6109,_0x47853d){var _0x36c3d9=function(_0x4194c7){while(--_0x4194c7){_0x2a6109['push'](_0x2a6109['shift']());}};_0x36c3d9(++_0x47853d);}(_0x29d4,0x1a1));var _0x429d=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0x29d4[_0x21aec3];return _0x288bbc;};'use strict';var multer=require(_0x429d('0x0'));var util=require('util');var path=require(_0x429d('0x1'));var timeout=require(_0x429d('0x2'));var express=require(_0x429d('0x3'));var router=express[_0x429d('0x4')]();var fs_extra=require(_0x429d('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x429d('0x6'));var config=require(_0x429d('0x7'));var controller=require(_0x429d('0x8'));router[_0x429d('0x9')]('/',auth[_0x429d('0xa')](),controller[_0x429d('0xb')]);router[_0x429d('0x9')](_0x429d('0xc'),auth['isAuthenticated'](),controller[_0x429d('0xd')]);router['post']('/',auth[_0x429d('0xa')](),controller[_0x429d('0xe')]);router[_0x429d('0xf')]('/:id',auth[_0x429d('0xa')](),controller[_0x429d('0x10')]);router['delete'](_0x429d('0xc'),auth[_0x429d('0xa')](),controller[_0x429d('0x11')]);module['exports']=router;
\ No newline at end of file
+var _0x85d8=['isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x48f9d2,_0x33ba0d){var _0x5228da=function(_0x20e0cc){while(--_0x20e0cc){_0x48f9d2['push'](_0x48f9d2['shift']());}};_0x5228da(++_0x33ba0d);}(_0x85d8,0x1b0));var _0x885d=function(_0x279004,_0x358748){_0x279004=_0x279004-0x0;var _0x272f09=_0x85d8[_0x279004];return _0x272f09;};'use strict';var multer=require(_0x885d('0x0'));var util=require(_0x885d('0x1'));var path=require(_0x885d('0x2'));var timeout=require(_0x885d('0x3'));var express=require(_0x885d('0x4'));var router=express['Router']();var fs_extra=require(_0x885d('0x5'));var auth=require(_0x885d('0x6'));var interaction=require(_0x885d('0x7'));var config=require(_0x885d('0x8'));var controller=require('./analyticMetric.controller');router['get']('/',auth[_0x885d('0x9')](),controller[_0x885d('0xa')]);router[_0x885d('0xb')](_0x885d('0xc'),auth[_0x885d('0x9')](),controller[_0x885d('0xd')]);router[_0x885d('0xe')]('/',auth[_0x885d('0x9')](),controller[_0x885d('0xf')]);router[_0x885d('0x10')](_0x885d('0xc'),auth[_0x885d('0x9')](),controller[_0x885d('0x11')]);router[_0x885d('0x12')](_0x885d('0xc'),auth[_0x885d('0x9')](),controller[_0x885d('0x13')]);module[_0x885d('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js
index 56b13e1..23ad790 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 _0x855f=['TEXT'];(function(_0x245d28,_0x5089d4){var _0x486301=function(_0x438087){while(--_0x438087){_0x245d28['push'](_0x245d28['shift']());}};_0x486301(++_0x5089d4);}(_0x855f,0x7a));var _0xf855=function(_0x554201,_0x27d493){_0x554201=_0x554201-0x0;var _0x2d066d=_0x855f[_0x554201];return _0x2d066d;};'use strict';var Sequelize=require('sequelize');module['exports']={'tree':{'type':Sequelize[_0xf855('0x0')],'allowNull':![]}};
\ No newline at end of file
+var _0x0361=['exports','TEXT','sequelize'];(function(_0x226221,_0x4bda72){var _0x2bdda4=function(_0x579c53){while(--_0x579c53){_0x226221['push'](_0x226221['shift']());}};_0x2bdda4(++_0x4bda72);}(_0x0361,0x1f1));var _0x1036=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x0361[_0x397e5f];return _0x5302b8;};'use strict';var Sequelize=require(_0x1036('0x0'));module[_0x1036('0x1')]={'tree':{'type':Sequelize[_0x1036('0x2')],'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js
index deac945..7030176 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 _0xdd22=['create','update','body','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','limit','count','offset','set','Content-Range','apply','reject','then','destroy','error','name','index','map','AnalyticTreeReport','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','catch','show','params','rawAttributes','find'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0xdd22,0x9d));var _0x2dd2=function(_0x54dad6,_0xceaf01){_0x54dad6=_0x54dad6-0x0;var _0x316654=_0xdd22[_0x54dad6];return _0x316654;};'use strict';var emlformat=require(_0x2dd2('0x0'));var rimraf=require(_0x2dd2('0x1'));var zipdir=require(_0x2dd2('0x2'));var jsonpatch=require(_0x2dd2('0x3'));var rp=require('request-promise');var moment=require(_0x2dd2('0x4'));var BPromise=require(_0x2dd2('0x5'));var Mustache=require('mustache');var util=require(_0x2dd2('0x6'));var path=require(_0x2dd2('0x7'));var sox=require(_0x2dd2('0x8'));var csv=require(_0x2dd2('0x9'));var ejs=require(_0x2dd2('0xa'));var fs=require('fs');var fs_extra=require(_0x2dd2('0xb'));var _=require(_0x2dd2('0xc'));var squel=require(_0x2dd2('0xd'));var crypto=require(_0x2dd2('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2dd2('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2dd2('0x10'));var Papa=require(_0x2dd2('0x11'));var Redis=require(_0x2dd2('0x12'));var authService=require(_0x2dd2('0x13'));var qs=require(_0x2dd2('0x14'));var as=require(_0x2dd2('0x15'));var hardwareService=require(_0x2dd2('0x16'));var logger=require(_0x2dd2('0x17'))(_0x2dd2('0x18'));var utils=require(_0x2dd2('0x19'));var config=require(_0x2dd2('0x1a'));var licenseUtil=require(_0x2dd2('0x1b'));var db=require(_0x2dd2('0x1c'))['db'];function respondWithStatusCode(_0x1264a5,_0x3d46d5){_0x3d46d5=_0x3d46d5||0xcc;return function(_0x5323f3){if(_0x5323f3){return _0x1264a5[_0x2dd2('0x1d')](_0x3d46d5);}return _0x1264a5[_0x2dd2('0x1e')](_0x3d46d5)[_0x2dd2('0x1f')]();};}function respondWithResult(_0x41c3e7,_0x504955){_0x504955=_0x504955||0xc8;return function(_0x215839){if(_0x215839){return _0x41c3e7[_0x2dd2('0x1e')](_0x504955)[_0x2dd2('0x20')](_0x215839);}};}function respondWithFilteredResult(_0x3be983,_0x447db3){return function(_0x220144){if(_0x220144){var _0x4dd45e=typeof _0x447db3['offset']===_0x2dd2('0x21')&&typeof _0x447db3[_0x2dd2('0x22')]==='undefined';var _0x2167a8=_0x220144[_0x2dd2('0x23')];var _0xcffc02=_0x4dd45e?0x0:_0x447db3[_0x2dd2('0x24')];var _0x16f7a4=_0x4dd45e?_0x220144['count']:_0x447db3['offset']+_0x447db3[_0x2dd2('0x22')];var _0x592cec;if(_0x16f7a4>=_0x2167a8){_0x16f7a4=_0x2167a8;_0x592cec=0xc8;}else{_0x592cec=0xce;}_0x3be983[_0x2dd2('0x1e')](_0x592cec);return _0x3be983[_0x2dd2('0x25')](_0x2dd2('0x26'),_0xcffc02+'-'+_0x16f7a4+'/'+_0x2167a8)[_0x2dd2('0x20')](_0x220144);}return null;};}function patchUpdates(_0x3bd49c){return function(_0x445f05){try{jsonpatch[_0x2dd2('0x27')](_0x445f05,_0x3bd49c,!![]);}catch(_0x4adc69){return BPromise[_0x2dd2('0x28')](_0x4adc69);}return _0x445f05['save']();};}function saveUpdates(_0x1f8f5b,_0x16f6bc){return function(_0x5b28ac){if(_0x5b28ac){return _0x5b28ac['update'](_0x1f8f5b)[_0x2dd2('0x29')](function(_0x1bfae4){return _0x1bfae4;});}return null;};}function removeEntity(_0x5c2775,_0x334e76){return function(_0x2e98f9){if(_0x2e98f9){return _0x2e98f9[_0x2dd2('0x2a')]()[_0x2dd2('0x29')](function(){_0x5c2775[_0x2dd2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5c86b8,_0x3c501d){return function(_0x5d33ce){if(!_0x5d33ce){_0x5c86b8[_0x2dd2('0x1d')](0x194);}return _0x5d33ce;};}function handleError(_0x31a81c,_0x340902){_0x340902=_0x340902||0x1f4;return function(_0x2cf92d){logger[_0x2dd2('0x2b')](_0x2cf92d['stack']);if(_0x2cf92d[_0x2dd2('0x2c')]){delete _0x2cf92d[_0x2dd2('0x2c')];}_0x31a81c[_0x2dd2('0x1e')](_0x340902)['send'](_0x2cf92d);};}exports[_0x2dd2('0x2d')]=function(_0x4165fb,_0x1fd89c){var _0x37cd1a={},_0x197bbd={},_0x33da62={'count':0x0,'rows':[]};var _0x27089e=_[_0x2dd2('0x2e')](db[_0x2dd2('0x2f')]['rawAttributes'],function(_0x32c0f9){return{'name':_0x32c0f9['fieldName'],'type':_0x32c0f9[_0x2dd2('0x30')][_0x2dd2('0x31')]};});_0x197bbd[_0x2dd2('0x32')]=_['map'](_0x27089e,_0x2dd2('0x2c'));_0x197bbd[_0x2dd2('0x33')]=_[_0x2dd2('0x34')](_0x4165fb['query']);_0x197bbd[_0x2dd2('0x35')]=_[_0x2dd2('0x36')](_0x197bbd['model'],_0x197bbd[_0x2dd2('0x33')]);_0x37cd1a['attributes']=_['intersection'](_0x197bbd['model'],qs['fields'](_0x4165fb[_0x2dd2('0x33')][_0x2dd2('0x37')]));_0x37cd1a[_0x2dd2('0x38')]=_0x37cd1a[_0x2dd2('0x38')][_0x2dd2('0x39')]?_0x37cd1a[_0x2dd2('0x38')]:_0x197bbd['model'];if(!_0x4165fb[_0x2dd2('0x33')][_0x2dd2('0x3a')](_0x2dd2('0x3b'))){_0x37cd1a[_0x2dd2('0x22')]=qs[_0x2dd2('0x22')](_0x4165fb[_0x2dd2('0x33')][_0x2dd2('0x22')]);_0x37cd1a[_0x2dd2('0x24')]=qs[_0x2dd2('0x24')](_0x4165fb[_0x2dd2('0x33')][_0x2dd2('0x24')]);}_0x37cd1a[_0x2dd2('0x3c')]=qs['sort'](_0x4165fb['query'][_0x2dd2('0x3d')]);_0x37cd1a[_0x2dd2('0x3e')]=qs[_0x2dd2('0x35')](_[_0x2dd2('0x3f')](_0x4165fb[_0x2dd2('0x33')],_0x197bbd[_0x2dd2('0x35')]),_0x27089e);if(_0x4165fb[_0x2dd2('0x33')]['filter']){_0x37cd1a['where']=_[_0x2dd2('0x40')](_0x37cd1a[_0x2dd2('0x3e')],{'$or':_[_0x2dd2('0x2e')](_0x27089e,function(_0x47d143){if(_0x47d143[_0x2dd2('0x30')]!==_0x2dd2('0x41')){var _0x5efcda={};_0x5efcda[_0x47d143[_0x2dd2('0x2c')]]={'$like':'%'+_0x4165fb['query'][_0x2dd2('0x42')]+'%'};return _0x5efcda;}})});}_0x37cd1a=_[_0x2dd2('0x40')]({},_0x37cd1a,_0x4165fb['options']);var _0x2ff6d3={'where':_0x37cd1a[_0x2dd2('0x3e')]};return db[_0x2dd2('0x2f')]['count'](_0x2ff6d3)['then'](function(_0x258334){_0x33da62[_0x2dd2('0x23')]=_0x258334;if(_0x4165fb['query'][_0x2dd2('0x43')]){_0x37cd1a[_0x2dd2('0x44')]=[{'all':!![]}];}return db[_0x2dd2('0x2f')]['findAll'](_0x37cd1a);})[_0x2dd2('0x29')](function(_0x44a6a3){_0x33da62['rows']=_0x44a6a3;return _0x33da62;})[_0x2dd2('0x29')](respondWithFilteredResult(_0x1fd89c,_0x37cd1a))[_0x2dd2('0x45')](handleError(_0x1fd89c,null));};exports[_0x2dd2('0x46')]=function(_0x3b8607,_0x41ca3c){var _0x4f5c41={'raw':!![],'where':{'id':_0x3b8607[_0x2dd2('0x47')]['id']}},_0x3b0cd3={};_0x3b0cd3[_0x2dd2('0x32')]=_[_0x2dd2('0x34')](db[_0x2dd2('0x2f')][_0x2dd2('0x48')]);_0x3b0cd3['query']=_[_0x2dd2('0x34')](_0x3b8607[_0x2dd2('0x33')]);_0x3b0cd3[_0x2dd2('0x35')]=_[_0x2dd2('0x36')](_0x3b0cd3[_0x2dd2('0x32')],_0x3b0cd3[_0x2dd2('0x33')]);_0x4f5c41[_0x2dd2('0x38')]=_[_0x2dd2('0x36')](_0x3b0cd3['model'],qs['fields'](_0x3b8607[_0x2dd2('0x33')]['fields']));_0x4f5c41[_0x2dd2('0x38')]=_0x4f5c41[_0x2dd2('0x38')][_0x2dd2('0x39')]?_0x4f5c41[_0x2dd2('0x38')]:_0x3b0cd3['model'];if(_0x3b8607[_0x2dd2('0x33')][_0x2dd2('0x43')]){_0x4f5c41['include']=[{'all':!![]}];}_0x4f5c41=_[_0x2dd2('0x40')]({},_0x4f5c41,_0x3b8607['options']);return db[_0x2dd2('0x2f')][_0x2dd2('0x49')](_0x4f5c41)['then'](handleEntityNotFound(_0x41ca3c,null))['then'](respondWithResult(_0x41ca3c,null))[_0x2dd2('0x45')](handleError(_0x41ca3c,null));};exports[_0x2dd2('0x4a')]=function(_0x105c67,_0x4ab647){return db[_0x2dd2('0x2f')][_0x2dd2('0x4a')](_0x105c67['body'],{})[_0x2dd2('0x29')](respondWithResult(_0x4ab647,0xc9))[_0x2dd2('0x45')](handleError(_0x4ab647,null));};exports[_0x2dd2('0x4b')]=function(_0x353e96,_0x510396){if(_0x353e96['body']['id']){delete _0x353e96[_0x2dd2('0x4c')]['id'];}return db['AnalyticTreeReport'][_0x2dd2('0x49')]({'where':{'id':_0x353e96['params']['id']}})[_0x2dd2('0x29')](handleEntityNotFound(_0x510396,null))['then'](saveUpdates(_0x353e96[_0x2dd2('0x4c')],null))[_0x2dd2('0x29')](respondWithResult(_0x510396,null))[_0x2dd2('0x45')](handleError(_0x510396,null));};exports['destroy']=function(_0x3c9413,_0x3768f6){return db['AnalyticTreeReport'][_0x2dd2('0x49')]({'where':{'id':_0x3c9413[_0x2dd2('0x47')]['id']}})['then'](handleEntityNotFound(_0x3768f6,null))[_0x2dd2('0x29')](removeEntity(_0x3768f6,null))[_0x2dd2('0x45')](handleError(_0x3768f6,null));};
\ No newline at end of file
+var _0x363f=['model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','options','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','merge','create','body','find','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','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','json','offset','undefined','limit','count','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','send','map','AnalyticTreeReport','fieldName','type','key'];(function(_0x29b155,_0x3b2fb0){var _0x105c42=function(_0x15aaaa){while(--_0x15aaaa){_0x29b155['push'](_0x29b155['shift']());}};_0x105c42(++_0x3b2fb0);}(_0x363f,0x157));var _0xf363=function(_0x22d944,_0x313411){_0x22d944=_0x22d944-0x0;var _0x2221c7=_0x363f[_0x22d944];return _0x2221c7;};'use strict';var emlformat=require(_0xf363('0x0'));var rimraf=require(_0xf363('0x1'));var zipdir=require(_0xf363('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf363('0x3'));var moment=require(_0xf363('0x4'));var BPromise=require(_0xf363('0x5'));var Mustache=require(_0xf363('0x6'));var util=require(_0xf363('0x7'));var path=require(_0xf363('0x8'));var sox=require(_0xf363('0x9'));var csv=require(_0xf363('0xa'));var ejs=require(_0xf363('0xb'));var fs=require('fs');var fs_extra=require(_0xf363('0xc'));var _=require(_0xf363('0xd'));var squel=require(_0xf363('0xe'));var crypto=require(_0xf363('0xf'));var jsforce=require(_0xf363('0x10'));var deskjs=require(_0xf363('0x11'));var toCsv=require(_0xf363('0xa'));var querystring=require(_0xf363('0x12'));var Papa=require('papaparse');var Redis=require(_0xf363('0x13'));var authService=require(_0xf363('0x14'));var qs=require(_0xf363('0x15'));var as=require(_0xf363('0x16'));var hardwareService=require(_0xf363('0x17'));var logger=require(_0xf363('0x18'))('api');var utils=require(_0xf363('0x19'));var config=require(_0xf363('0x1a'));var licenseUtil=require(_0xf363('0x1b'));var db=require(_0xf363('0x1c'))['db'];function respondWithStatusCode(_0x174481,_0x3b72c7){_0x3b72c7=_0x3b72c7||0xcc;return function(_0x2016b8){if(_0x2016b8){return _0x174481[_0xf363('0x1d')](_0x3b72c7);}return _0x174481[_0xf363('0x1e')](_0x3b72c7)['end']();};}function respondWithResult(_0x420486,_0x4a172d){_0x4a172d=_0x4a172d||0xc8;return function(_0xc9947a){if(_0xc9947a){return _0x420486[_0xf363('0x1e')](_0x4a172d)[_0xf363('0x1f')](_0xc9947a);}};}function respondWithFilteredResult(_0x409a29,_0x502a86){return function(_0x4b96fe){if(_0x4b96fe){var _0x183293=typeof _0x502a86[_0xf363('0x20')]===_0xf363('0x21')&&typeof _0x502a86[_0xf363('0x22')]===_0xf363('0x21');var _0xd19339=_0x4b96fe[_0xf363('0x23')];var _0x343317=_0x183293?0x0:_0x502a86[_0xf363('0x20')];var _0x405dab=_0x183293?_0x4b96fe[_0xf363('0x23')]:_0x502a86[_0xf363('0x20')]+_0x502a86['limit'];var _0x2210b9;if(_0x405dab>=_0xd19339){_0x405dab=_0xd19339;_0x2210b9=0xc8;}else{_0x2210b9=0xce;}_0x409a29[_0xf363('0x1e')](_0x2210b9);return _0x409a29['set'](_0xf363('0x24'),_0x343317+'-'+_0x405dab+'/'+_0xd19339)['json'](_0x4b96fe);}return null;};}function patchUpdates(_0x16399e){return function(_0x35c465){try{jsonpatch[_0xf363('0x25')](_0x35c465,_0x16399e,!![]);}catch(_0x19b105){return BPromise[_0xf363('0x26')](_0x19b105);}return _0x35c465[_0xf363('0x27')]();};}function saveUpdates(_0x3b5090,_0x13b642){return function(_0x1c1ed0){if(_0x1c1ed0){return _0x1c1ed0[_0xf363('0x28')](_0x3b5090)['then'](function(_0x30cf8b){return _0x30cf8b;});}return null;};}function removeEntity(_0x41e70e,_0x41d997){return function(_0x452e16){if(_0x452e16){return _0x452e16[_0xf363('0x29')]()[_0xf363('0x2a')](function(){_0x41e70e['status'](0xcc)[_0xf363('0x2b')]();});}};}function handleEntityNotFound(_0x5ee41a,_0x3090eb){return function(_0x3c0960){if(!_0x3c0960){_0x5ee41a['sendStatus'](0x194);}return _0x3c0960;};}function handleError(_0xffa13a,_0x2e2ac6){_0x2e2ac6=_0x2e2ac6||0x1f4;return function(_0x2d41b4){logger['error'](_0x2d41b4[_0xf363('0x2c')]);if(_0x2d41b4[_0xf363('0x2d')]){delete _0x2d41b4[_0xf363('0x2d')];}_0xffa13a['status'](_0x2e2ac6)[_0xf363('0x2e')](_0x2d41b4);};}exports['index']=function(_0x510121,_0x321b65){var _0xb56c97={},_0x34e398={},_0x5bc66c={'count':0x0,'rows':[]};var _0x32af83=_[_0xf363('0x2f')](db[_0xf363('0x30')]['rawAttributes'],function(_0x9f6055){return{'name':_0x9f6055[_0xf363('0x31')],'type':_0x9f6055[_0xf363('0x32')][_0xf363('0x33')]};});_0x34e398[_0xf363('0x34')]=_[_0xf363('0x2f')](_0x32af83,'name');_0x34e398[_0xf363('0x35')]=_['keys'](_0x510121[_0xf363('0x35')]);_0x34e398['filters']=_[_0xf363('0x36')](_0x34e398[_0xf363('0x34')],_0x34e398[_0xf363('0x35')]);_0xb56c97[_0xf363('0x37')]=_[_0xf363('0x36')](_0x34e398[_0xf363('0x34')],qs[_0xf363('0x38')](_0x510121['query']['fields']));_0xb56c97[_0xf363('0x37')]=_0xb56c97[_0xf363('0x37')][_0xf363('0x39')]?_0xb56c97[_0xf363('0x37')]:_0x34e398['model'];if(!_0x510121[_0xf363('0x35')][_0xf363('0x3a')](_0xf363('0x3b'))){_0xb56c97['limit']=qs[_0xf363('0x22')](_0x510121[_0xf363('0x35')][_0xf363('0x22')]);_0xb56c97['offset']=qs[_0xf363('0x20')](_0x510121[_0xf363('0x35')][_0xf363('0x20')]);}_0xb56c97[_0xf363('0x3c')]=qs[_0xf363('0x3d')](_0x510121[_0xf363('0x35')]['sort']);_0xb56c97[_0xf363('0x3e')]=qs[_0xf363('0x3f')](_[_0xf363('0x40')](_0x510121[_0xf363('0x35')],_0x34e398['filters']),_0x32af83);if(_0x510121[_0xf363('0x35')][_0xf363('0x41')]){_0xb56c97['where']=_['merge'](_0xb56c97['where'],{'$or':_['map'](_0x32af83,function(_0x46e42d){if(_0x46e42d[_0xf363('0x32')]!=='VIRTUAL'){var _0x457edb={};_0x457edb[_0x46e42d[_0xf363('0x2d')]]={'$like':'%'+_0x510121[_0xf363('0x35')][_0xf363('0x41')]+'%'};return _0x457edb;}})});}_0xb56c97=_['merge']({},_0xb56c97,_0x510121[_0xf363('0x42')]);var _0x4ea522={'where':_0xb56c97[_0xf363('0x3e')]};return db['AnalyticTreeReport'][_0xf363('0x23')](_0x4ea522)['then'](function(_0x50ff1f){_0x5bc66c[_0xf363('0x23')]=_0x50ff1f;if(_0x510121[_0xf363('0x35')]['includeAll']){_0xb56c97[_0xf363('0x43')]=[{'all':!![]}];}return db[_0xf363('0x30')][_0xf363('0x44')](_0xb56c97);})[_0xf363('0x2a')](function(_0xf49348){_0x5bc66c[_0xf363('0x45')]=_0xf49348;return _0x5bc66c;})[_0xf363('0x2a')](respondWithFilteredResult(_0x321b65,_0xb56c97))[_0xf363('0x46')](handleError(_0x321b65,null));};exports['show']=function(_0x1f390e,_0x6ccd1a){var _0xd60d1b={'raw':!![],'where':{'id':_0x1f390e[_0xf363('0x47')]['id']}},_0x543fb0={};_0x543fb0[_0xf363('0x34')]=_[_0xf363('0x48')](db[_0xf363('0x30')][_0xf363('0x49')]);_0x543fb0['query']=_[_0xf363('0x48')](_0x1f390e[_0xf363('0x35')]);_0x543fb0[_0xf363('0x3f')]=_[_0xf363('0x36')](_0x543fb0[_0xf363('0x34')],_0x543fb0[_0xf363('0x35')]);_0xd60d1b['attributes']=_['intersection'](_0x543fb0[_0xf363('0x34')],qs[_0xf363('0x38')](_0x1f390e[_0xf363('0x35')][_0xf363('0x38')]));_0xd60d1b[_0xf363('0x37')]=_0xd60d1b['attributes'][_0xf363('0x39')]?_0xd60d1b['attributes']:_0x543fb0[_0xf363('0x34')];if(_0x1f390e[_0xf363('0x35')][_0xf363('0x4a')]){_0xd60d1b[_0xf363('0x43')]=[{'all':!![]}];}_0xd60d1b=_[_0xf363('0x4b')]({},_0xd60d1b,_0x1f390e[_0xf363('0x42')]);return db[_0xf363('0x30')]['find'](_0xd60d1b)[_0xf363('0x2a')](handleEntityNotFound(_0x6ccd1a,null))['then'](respondWithResult(_0x6ccd1a,null))[_0xf363('0x46')](handleError(_0x6ccd1a,null));};exports[_0xf363('0x4c')]=function(_0x2decbf,_0x26d36b){return db[_0xf363('0x30')][_0xf363('0x4c')](_0x2decbf['body'],{})[_0xf363('0x2a')](respondWithResult(_0x26d36b,0xc9))['catch'](handleError(_0x26d36b,null));};exports[_0xf363('0x28')]=function(_0x15114e,_0xac6c97){if(_0x15114e[_0xf363('0x4d')]['id']){delete _0x15114e[_0xf363('0x4d')]['id'];}return db[_0xf363('0x30')][_0xf363('0x4e')]({'where':{'id':_0x15114e[_0xf363('0x47')]['id']}})[_0xf363('0x2a')](handleEntityNotFound(_0xac6c97,null))[_0xf363('0x2a')](saveUpdates(_0x15114e[_0xf363('0x4d')],null))['then'](respondWithResult(_0xac6c97,null))[_0xf363('0x46')](handleError(_0xac6c97,null));};exports['destroy']=function(_0x3d9d7f,_0xcce62){return db[_0xf363('0x30')][_0xf363('0x4e')]({'where':{'id':_0x3d9d7f['params']['id']}})[_0xf363('0x2a')](handleEntityNotFound(_0xcce62,null))[_0xf363('0x2a')](removeEntity(_0xcce62,null))[_0xf363('0x46')](handleError(_0xcce62,null));};
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js
index 1935a7e..d94175f 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 _0xde25=['AnalyticTreeReport','analytics_report_trees','lodash','util','moment','bluebird','path','rimraf','../../config/environment','./analyticTreeReport.attributes'];(function(_0x523e9e,_0x17440){var _0x569909=function(_0x366a3c){while(--_0x366a3c){_0x523e9e['push'](_0x523e9e['shift']());}};_0x569909(++_0x17440);}(_0xde25,0x17e));var _0x5de2=function(_0x24ec64,_0x105e31){_0x24ec64=_0x24ec64-0x0;var _0x5f28ab=_0xde25[_0x24ec64];return _0x5f28ab;};'use strict';var _=require(_0x5de2('0x0'));var util=require(_0x5de2('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5de2('0x2'));var BPromise=require(_0x5de2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5de2('0x4'));var rimraf=require(_0x5de2('0x5'));var config=require(_0x5de2('0x6'));var attributes=require(_0x5de2('0x7'));module['exports']=function(_0x199d61,_0x2a366b){return _0x199d61['define'](_0x5de2('0x8'),attributes,{'tableName':_0x5de2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x668a=['AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./analyticTreeReport.attributes','define'];(function(_0x154192,_0x2d360f){var _0x3c2792=function(_0x2e257b){while(--_0x2e257b){_0x154192['push'](_0x154192['shift']());}};_0x3c2792(++_0x2d360f);}(_0x668a,0xce));var _0xa668=function(_0xa3e712,_0x221d44){_0xa3e712=_0xa3e712-0x0;var _0x3be788=_0x668a[_0xa3e712];return _0x3be788;};'use strict';var _=require(_0xa668('0x0'));var util=require(_0xa668('0x1'));var logger=require('../../config/logger')(_0xa668('0x2'));var moment=require(_0xa668('0x3'));var BPromise=require(_0xa668('0x4'));var rp=require(_0xa668('0x5'));var fs=require('fs');var path=require(_0xa668('0x6'));var rimraf=require('rimraf');var config=require(_0xa668('0x7'));var attributes=require(_0xa668('0x8'));module['exports']=function(_0x5d6e9d,_0x4481d1){return _0x5d6e9d[_0xa668('0x9')](_0xa668('0xa'),attributes,{'tableName':_0xa668('0xb'),'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 ed2de7c..43d6145 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 _0xadb5=['error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x4c9393,_0x20e6de){var _0x580eda=function(_0x5dfce1){while(--_0x5dfce1){_0x4c9393['push'](_0x4c9393['shift']());}};_0x580eda(++_0x20e6de);}(_0xadb5,0xad));var _0x5adb=function(_0x3cc89a,_0x507773){_0x3cc89a=_0x3cc89a-0x0;var _0x3b1f2d=_0xadb5[_0x3cc89a];return _0x3b1f2d;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var moment=require('moment');var BPromise=require(_0x5adb('0x1'));var rs=require(_0x5adb('0x2'));var fs=require('fs');var Redis=require(_0x5adb('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5adb('0x4'));var logger=require(_0x5adb('0x5'))(_0x5adb('0x6'));var config=require('../../config/environment');var jayson=require(_0x5adb('0x7'));var client=jayson[_0x5adb('0x8')][_0x5adb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3213e8,_0xdf3776,_0x353885){return new BPromise(function(_0x47228a,_0x6d1b45){return client[_0x5adb('0xa')](_0x3213e8,_0x353885)[_0x5adb('0xb')](function(_0x34f59d){logger[_0x5adb('0xc')](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xdf3776,_0x5adb('0xe'),JSON[_0x5adb('0xf')](_0x34f59d));if(_0x34f59d[_0x5adb('0x10')]){if(_0x34f59d['error'][_0x5adb('0x11')]===0x1f4){logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d['error'][_0x5adb('0x12')]);return _0x6d1b45(_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);}logger['error'](_0x5adb('0xd'),_0xdf3776,_0x34f59d[_0x5adb('0x10')][_0x5adb('0x12')]);return _0x47228a(_0x34f59d['error'][_0x5adb('0x12')]);}else{logger['info'](_0x5adb('0xd'),_0xdf3776,_0x5adb('0xe'));_0x47228a(_0x34f59d[_0x5adb('0x13')][_0x5adb('0x12')]);}})[_0x5adb('0x14')](function(_0x39d24d){logger[_0x5adb('0x10')](_0x5adb('0xd'),_0xdf3776,_0x39d24d);_0x6d1b45(_0x39d24d);});});}
\ No newline at end of file
+var _0x2ef3=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x58f363,_0x135c64){var _0xcb2c83=function(_0x55d7fd){while(--_0x55d7fd){_0x58f363['push'](_0x58f363['shift']());}};_0xcb2c83(++_0x135c64);}(_0x2ef3,0xba));var _0x32ef=function(_0x2dee88,_0xb8a4ee){_0x2dee88=_0x2dee88-0x0;var _0x514d9d=_0x2ef3[_0x2dee88];return _0x514d9d;};'use strict';var _=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var moment=require(_0x32ef('0x2'));var BPromise=require(_0x32ef('0x3'));var rs=require(_0x32ef('0x4'));var fs=require('fs');var Redis=require(_0x32ef('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x32ef('0x6'));var logger=require(_0x32ef('0x7'))('rpc');var config=require(_0x32ef('0x8'));var jayson=require(_0x32ef('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2c0089,_0x4bfcf8,_0x367c39){return new BPromise(function(_0x2fb8eb,_0x234863){return client[_0x32ef('0xa')](_0x2c0089,_0x367c39)[_0x32ef('0xb')](function(_0x2bbb50){logger[_0x32ef('0xc')](_0x32ef('0xd'),_0x4bfcf8,'request\x20sent');logger['debug'](_0x32ef('0xe'),_0x4bfcf8,_0x32ef('0xf'),JSON[_0x32ef('0x10')](_0x2bbb50));if(_0x2bbb50[_0x32ef('0x11')]){if(_0x2bbb50['error'][_0x32ef('0x12')]===0x1f4){logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x234863(_0x2bbb50[_0x32ef('0x11')]['message']);}logger['error'](_0x32ef('0xd'),_0x4bfcf8,_0x2bbb50['error'][_0x32ef('0x13')]);return _0x2fb8eb(_0x2bbb50[_0x32ef('0x11')][_0x32ef('0x13')]);}else{logger[_0x32ef('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,'request\x20sent');_0x2fb8eb(_0x2bbb50['result'][_0x32ef('0x13')]);}})[_0x32ef('0x14')](function(_0xb5aed2){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4bfcf8,_0xb5aed2);_0x234863(_0xb5aed2);});});}
\ No newline at end of file
diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js
index 3f9b9d8..36ac953 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 _0x0f0a=['path','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','show','create','/:id','update','delete','destroy','multer','util'];(function(_0x280b5b,_0x4e4a42){var _0x3eb96b=function(_0x348bd9){while(--_0x348bd9){_0x280b5b['push'](_0x280b5b['shift']());}};_0x3eb96b(++_0x4e4a42);}(_0x0f0a,0x70));var _0xa0f0=function(_0x9708aa,_0x174b2d){_0x9708aa=_0x9708aa-0x0;var _0x24afd1=_0x0f0a[_0x9708aa];return _0x24afd1;};'use strict';var multer=require(_0xa0f0('0x0'));var util=require(_0xa0f0('0x1'));var path=require(_0xa0f0('0x2'));var timeout=require(_0xa0f0('0x3'));var express=require(_0xa0f0('0x4'));var router=express[_0xa0f0('0x5')]();var fs_extra=require(_0xa0f0('0x6'));var auth=require('../../components/auth/service');var interaction=require(_0xa0f0('0x7'));var config=require(_0xa0f0('0x8'));var controller=require(_0xa0f0('0x9'));router[_0xa0f0('0xa')]('/',auth[_0xa0f0('0xb')](),controller[_0xa0f0('0xc')]);router[_0xa0f0('0xa')]('/:id',auth[_0xa0f0('0xb')](),controller[_0xa0f0('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa0f0('0xe')]);router['put'](_0xa0f0('0xf'),auth[_0xa0f0('0xb')](),controller[_0xa0f0('0x10')]);router[_0xa0f0('0x11')](_0xa0f0('0xf'),auth['isAuthenticated'](),controller[_0xa0f0('0x12')]);module['exports']=router;
\ No newline at end of file
+var _0x36ae=['delete','destroy','exports','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','update'];(function(_0x44d385,_0x1a313a){var _0x5c2cc5=function(_0x5d1d76){while(--_0x5d1d76){_0x44d385['push'](_0x44d385['shift']());}};_0x5c2cc5(++_0x1a313a);}(_0x36ae,0x198));var _0xe36a=function(_0xc55d64,_0x133f2d){_0xc55d64=_0xc55d64-0x0;var _0x4194f6=_0x36ae[_0xc55d64];return _0x4194f6;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe36a('0x0'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe36a('0x1')]();var fs_extra=require('fs-extra');var auth=require(_0xe36a('0x2'));var interaction=require(_0xe36a('0x3'));var config=require(_0xe36a('0x4'));var controller=require('./analyticTreeReport.controller');router[_0xe36a('0x5')]('/',auth[_0xe36a('0x6')](),controller[_0xe36a('0x7')]);router[_0xe36a('0x5')](_0xe36a('0x8'),auth[_0xe36a('0x6')](),controller['show']);router[_0xe36a('0x9')]('/',auth[_0xe36a('0x6')](),controller[_0xe36a('0xa')]);router['put'](_0xe36a('0x8'),auth[_0xe36a('0x6')](),controller[_0xe36a('0xb')]);router[_0xe36a('0xc')]('/:id',auth[_0xe36a('0x6')](),controller[_0xe36a('0xd')]);module[_0xe36a('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js
index eb329e2..5ddc2a0 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 _0xe0c3=['sequelize','STRING'];(function(_0x49f1be,_0x3cf7a4){var _0xe6b3bd=function(_0x38d1e5){while(--_0x38d1e5){_0x49f1be['push'](_0x49f1be['shift']());}};_0xe6b3bd(++_0x3cf7a4);}(_0xe0c3,0xea));var _0x3e0c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe0c3[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3e0c('0x0'));module['exports']={'name':{'type':Sequelize[_0x3e0c('0x1')]},'basename':{'type':Sequelize[_0x3e0c('0x1')]},'type':{'type':Sequelize[_0x3e0c('0x1')]}};
\ No newline at end of file
+var _0x6ddd=['STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x6ddd,0xae));var _0xd6dd=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x6ddd[_0x432682];return _0x463d05;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd6dd('0x0')]},'basename':{'type':Sequelize[_0xd6dd('0x0')]},'type':{'type':Sequelize[_0xd6dd('0x0')]}};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js
index 0a47142..dce2f32 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 _0x9751=['updatedAt','body','create','file','originalname','basename','mimetype','download','findOne','join','root','server/files/attachments/','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../config/license/util','sendStatus','status','offset','undefined','count','set','Content-Range','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','Attachment','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','options','includeAll','include','findAll','rows','catch','show','clone','params','find','get','createdAt'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9751,0x164));var _0x1975=function(_0x5ae9c3,_0x3fc8b1){_0x5ae9c3=_0x5ae9c3-0x0;var _0x58913d=_0x9751[_0x5ae9c3];return _0x58913d;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x1975('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x1975('0x1'));var moment=require(_0x1975('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x1975('0x3'));var util=require(_0x1975('0x4'));var path=require(_0x1975('0x5'));var sox=require(_0x1975('0x6'));var csv=require(_0x1975('0x7'));var ejs=require(_0x1975('0x8'));var fs=require('fs');var fs_extra=require(_0x1975('0x9'));var _=require(_0x1975('0xa'));var squel=require(_0x1975('0xb'));var crypto=require(_0x1975('0xc'));var jsforce=require(_0x1975('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1975('0xe'));var Papa=require(_0x1975('0xf'));var Redis=require('ioredis');var authService=require(_0x1975('0x10'));var qs=require(_0x1975('0x11'));var as=require(_0x1975('0x12'));var hardwareService=require(_0x1975('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x1975('0x14'));var config=require(_0x1975('0x15'));var licenseUtil=require(_0x1975('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x59e9cd,_0x36b6bd){_0x36b6bd=_0x36b6bd||0xcc;return function(_0x59801e){if(_0x59801e){return _0x59e9cd[_0x1975('0x17')](_0x36b6bd);}return _0x59e9cd[_0x1975('0x18')](_0x36b6bd)['end']();};}function respondWithResult(_0x6de7db,_0x4f8a30){_0x4f8a30=_0x4f8a30||0xc8;return function(_0x475008){if(_0x475008){return _0x6de7db[_0x1975('0x18')](_0x4f8a30)['json'](_0x475008);}};}function respondWithFilteredResult(_0x4f902a,_0x412713){return function(_0x4ab15b){if(_0x4ab15b){var _0x37f66b=typeof _0x412713[_0x1975('0x19')]==='undefined'&&typeof _0x412713['limit']===_0x1975('0x1a');var _0x4efa35=_0x4ab15b[_0x1975('0x1b')];var _0x3e7cca=_0x37f66b?0x0:_0x412713[_0x1975('0x19')];var _0xab1125=_0x37f66b?_0x4ab15b[_0x1975('0x1b')]:_0x412713['offset']+_0x412713['limit'];var _0x2f3dfd;if(_0xab1125>=_0x4efa35){_0xab1125=_0x4efa35;_0x2f3dfd=0xc8;}else{_0x2f3dfd=0xce;}_0x4f902a[_0x1975('0x18')](_0x2f3dfd);return _0x4f902a[_0x1975('0x1c')](_0x1975('0x1d'),_0x3e7cca+'-'+_0xab1125+'/'+_0x4efa35)['json'](_0x4ab15b);}return null;};}function patchUpdates(_0x1d55d9){return function(_0x37ea85){try{jsonpatch[_0x1975('0x1e')](_0x37ea85,_0x1d55d9,!![]);}catch(_0x43c71d){return BPromise[_0x1975('0x1f')](_0x43c71d);}return _0x37ea85['save']();};}function saveUpdates(_0x529524,_0xe77836){return function(_0x4fda9e){if(_0x4fda9e){return _0x4fda9e[_0x1975('0x20')](_0x529524)[_0x1975('0x21')](function(_0x4ec8d4){return _0x4ec8d4;});}return null;};}function removeEntity(_0x38d429,_0x27378c){return function(_0x132141){if(_0x132141){return _0x132141[_0x1975('0x22')]()[_0x1975('0x21')](function(){_0x38d429[_0x1975('0x18')](0xcc)[_0x1975('0x23')]();});}};}function handleEntityNotFound(_0x44211d,_0x2f35bd){return function(_0x86fd79){if(!_0x86fd79){_0x44211d[_0x1975('0x17')](0x194);}return _0x86fd79;};}function handleError(_0x5d069b,_0x3d73bd){_0x3d73bd=_0x3d73bd||0x1f4;return function(_0x3f5a1f){logger[_0x1975('0x24')](_0x3f5a1f[_0x1975('0x25')]);if(_0x3f5a1f['name']){delete _0x3f5a1f[_0x1975('0x26')];}_0x5d069b[_0x1975('0x18')](_0x3d73bd)[_0x1975('0x27')](_0x3f5a1f);};}exports[_0x1975('0x28')]=function(_0x57a998,_0x3190e7){var _0x12e6f2={},_0x4d33ed={},_0x5265a4={'count':0x0,'rows':[]};var _0x536a08=_[_0x1975('0x29')](db[_0x1975('0x2a')][_0x1975('0x2b')],function(_0x203b48){return{'name':_0x203b48['fieldName'],'type':_0x203b48['type'][_0x1975('0x2c')]};});_0x4d33ed[_0x1975('0x2d')]=_['map'](_0x536a08,_0x1975('0x26'));_0x4d33ed[_0x1975('0x2e')]=_[_0x1975('0x2f')](_0x57a998[_0x1975('0x2e')]);_0x4d33ed[_0x1975('0x30')]=_[_0x1975('0x31')](_0x4d33ed[_0x1975('0x2d')],_0x4d33ed['query']);_0x12e6f2[_0x1975('0x32')]=_[_0x1975('0x31')](_0x4d33ed[_0x1975('0x2d')],qs[_0x1975('0x33')](_0x57a998['query']['fields']));_0x12e6f2[_0x1975('0x32')]=_0x12e6f2['attributes'][_0x1975('0x34')]?_0x12e6f2[_0x1975('0x32')]:_0x4d33ed[_0x1975('0x2d')];if(!_0x57a998[_0x1975('0x2e')]['hasOwnProperty'](_0x1975('0x35'))){_0x12e6f2[_0x1975('0x36')]=qs[_0x1975('0x36')](_0x57a998['query'][_0x1975('0x36')]);_0x12e6f2[_0x1975('0x19')]=qs[_0x1975('0x19')](_0x57a998[_0x1975('0x2e')]['offset']);}_0x12e6f2[_0x1975('0x37')]=qs[_0x1975('0x38')](_0x57a998[_0x1975('0x2e')]['sort']);_0x12e6f2[_0x1975('0x39')]=qs[_0x1975('0x30')](_[_0x1975('0x3a')](_0x57a998[_0x1975('0x2e')],_0x4d33ed[_0x1975('0x30')]),_0x536a08);if(_0x57a998['query'][_0x1975('0x3b')]){_0x12e6f2[_0x1975('0x39')]=_[_0x1975('0x3c')](_0x12e6f2[_0x1975('0x39')],{'$or':_[_0x1975('0x29')](_0x536a08,function(_0x3d4074){if(_0x3d4074[_0x1975('0x3d')]!=='VIRTUAL'){var _0x462127={};_0x462127[_0x3d4074[_0x1975('0x26')]]={'$like':'%'+_0x57a998[_0x1975('0x2e')][_0x1975('0x3b')]+'%'};return _0x462127;}})});}_0x12e6f2=_[_0x1975('0x3c')]({},_0x12e6f2,_0x57a998[_0x1975('0x3e')]);var _0x23d88f={'where':_0x12e6f2[_0x1975('0x39')]};return db[_0x1975('0x2a')][_0x1975('0x1b')](_0x23d88f)[_0x1975('0x21')](function(_0x488999){_0x5265a4[_0x1975('0x1b')]=_0x488999;if(_0x57a998[_0x1975('0x2e')][_0x1975('0x3f')]){_0x12e6f2[_0x1975('0x40')]=[{'all':!![]}];}return db[_0x1975('0x2a')][_0x1975('0x41')](_0x12e6f2);})[_0x1975('0x21')](function(_0x43ee8d){_0x5265a4[_0x1975('0x42')]=_0x43ee8d;return _0x5265a4;})[_0x1975('0x21')](respondWithFilteredResult(_0x3190e7,_0x12e6f2))[_0x1975('0x43')](handleError(_0x3190e7,null));};exports[_0x1975('0x44')]=function(_0x5803ad,_0x5062b4){var _0xc218c9={'raw':!![],'where':{'id':_0x5803ad['params']['id']}},_0x4b8240={};_0x4b8240[_0x1975('0x2d')]=_[_0x1975('0x2f')](db['Attachment'][_0x1975('0x2b')]);_0x4b8240['query']=_[_0x1975('0x2f')](_0x5803ad['query']);_0x4b8240[_0x1975('0x30')]=_[_0x1975('0x31')](_0x4b8240[_0x1975('0x2d')],_0x4b8240[_0x1975('0x2e')]);_0xc218c9['attributes']=_[_0x1975('0x31')](_0x4b8240['model'],qs[_0x1975('0x33')](_0x5803ad[_0x1975('0x2e')]['fields']));_0xc218c9[_0x1975('0x32')]=_0xc218c9[_0x1975('0x32')][_0x1975('0x34')]?_0xc218c9[_0x1975('0x32')]:_0x4b8240[_0x1975('0x2d')];if(_0x5803ad['query']['includeAll']){_0xc218c9[_0x1975('0x40')]=[{'all':!![]}];}_0xc218c9=_[_0x1975('0x3c')]({},_0xc218c9,_0x5803ad[_0x1975('0x3e')]);return db[_0x1975('0x2a')]['find'](_0xc218c9)['then'](handleEntityNotFound(_0x5062b4,null))[_0x1975('0x21')](respondWithResult(_0x5062b4,null))[_0x1975('0x43')](handleError(_0x5062b4,null));};exports[_0x1975('0x45')]=function(_0x14c38e,_0x2d067e){var _0x9d11ca={'where':{'id':_0x14c38e[_0x1975('0x46')]['id']}},_0x332e76={};_0x332e76[_0x1975('0x2d')]=_['keys'](db['Attachment'][_0x1975('0x2b')]);_0x9d11ca[_0x1975('0x32')]=_[_0x1975('0x31')](_0x332e76['model'],qs['fields'](_0x14c38e[_0x1975('0x2e')][_0x1975('0x33')]));_0x9d11ca[_0x1975('0x32')]=_0x9d11ca[_0x1975('0x32')][_0x1975('0x34')]?_0x9d11ca[_0x1975('0x32')]:_0x332e76[_0x1975('0x2d')];if(_0x14c38e[_0x1975('0x2e')][_0x1975('0x3f')]){_0x9d11ca['include']=[{'all':!![]}];}_0x9d11ca=_[_0x1975('0x3c')]({},_0x9d11ca,_0x14c38e['options']);return db[_0x1975('0x2a')][_0x1975('0x47')](_0x9d11ca)['then'](handleEntityNotFound(_0x2d067e,null))[_0x1975('0x21')](function(_0x173ccd){if(_0x173ccd){var _0x11e282=_0x173ccd[_0x1975('0x48')]({'plain':!![]});_0x11e282=qs['omit'](_0x11e282,['id',_0x1975('0x49'),_0x1975('0x4a')]);_0x14c38e[_0x1975('0x4b')]=_['omit'](_0x14c38e[_0x1975('0x4b')],['id',_0x1975('0x49'),_0x1975('0x4a')]);return db['Attachment'][_0x1975('0x4c')](_[_0x1975('0x3c')](_0x11e282,_0x14c38e[_0x1975('0x4b')]),{'include':_0x14c38e['query'][_0x1975('0x3f')]?[{'all':!![]}]:undefined});}})[_0x1975('0x21')](respondWithResult(_0x2d067e,0xc9))['catch'](handleError(_0x2d067e,null));};exports[_0x1975('0x20')]=function(_0xb3204c,_0xac863){if(_0xb3204c[_0x1975('0x4b')]['id']){delete _0xb3204c[_0x1975('0x4b')]['id'];}return db[_0x1975('0x2a')][_0x1975('0x47')]({'where':{'id':_0xb3204c[_0x1975('0x46')]['id']}})[_0x1975('0x21')](handleEntityNotFound(_0xac863,null))[_0x1975('0x21')](saveUpdates(_0xb3204c[_0x1975('0x4b')],null))[_0x1975('0x21')](respondWithResult(_0xac863,null))[_0x1975('0x43')](handleError(_0xac863,null));};exports[_0x1975('0x22')]=function(_0x575217,_0x18c9bf){return db[_0x1975('0x2a')][_0x1975('0x47')]({'where':{'id':_0x575217['params']['id']}})[_0x1975('0x21')](handleEntityNotFound(_0x18c9bf,null))[_0x1975('0x21')](removeEntity(_0x18c9bf,null))['catch'](handleError(_0x18c9bf,null));};exports[_0x1975('0x4c')]=function(_0x2e6d9f,_0x2920a3,_0x59f47b){_0x2e6d9f[_0x1975('0x4b')][_0x1975('0x26')]=_0x2e6d9f[_0x1975('0x4d')][_0x1975('0x4e')];_0x2e6d9f[_0x1975('0x4b')][_0x1975('0x4f')]=_0x2e6d9f[_0x1975('0x4d')]['filename'];_0x2e6d9f[_0x1975('0x4b')]['type']=_0x2e6d9f[_0x1975('0x4d')][_0x1975('0x50')];return db[_0x1975('0x2a')][_0x1975('0x4c')](_0x2e6d9f['body'])['then'](respondWithResult(_0x2920a3,0xc9))[_0x1975('0x43')](handleError(_0x2920a3,null));};exports[_0x1975('0x51')]=function(_0x14ce29,_0xaea527,_0x4394bf){return db[_0x1975('0x2a')][_0x1975('0x52')]({'where':{'id':_0x14ce29[_0x1975('0x46')]['id']},'raw':!![]})[_0x1975('0x21')](handleEntityNotFound(_0xaea527,null))[_0x1975('0x21')](function(_0x7597f8){if(_0x7597f8){var _0x3494aa=_0x7597f8['ChatOfflineMessageId']!==null;var _0x11d68c=path[_0x1975('0x53')](config[_0x1975('0x54')],_0x1975('0x55'));if(_0x3494aa){_0x11d68c=path[_0x1975('0x53')](_0x11d68c,'offline-chat/');}var _0x86df30=path[_0x1975('0x53')](_0x11d68c,_0x7597f8['basename']);return _0xaea527[_0x1975('0x51')](_0x86df30);}})['catch'](handleError(_0xaea527,null));};
\ No newline at end of file
+var _0xf4ac=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','status','json','limit','undefined','count','offset','Content-Range','save','update','then','sendStatus','error','stack','name','send','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','find','clone','params','keys','get','omit','createdAt','updatedAt','body','create','destroy','file','originalname','basename','filename','mimetype','download','findOne','ChatOfflineMessageId','join','root','server/files/attachments/','offline-chat/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service'];(function(_0xd20213,_0xca7303){var _0x363b4a=function(_0x24bae5){while(--_0x24bae5){_0xd20213['push'](_0xd20213['shift']());}};_0x363b4a(++_0xca7303);}(_0xf4ac,0xfe));var _0xcf4a=function(_0x4dbfb9,_0x510387){_0x4dbfb9=_0x4dbfb9-0x0;var _0x1104d3=_0xf4ac[_0x4dbfb9];return _0x1104d3;};'use strict';var emlformat=require(_0xcf4a('0x0'));var rimraf=require(_0xcf4a('0x1'));var zipdir=require(_0xcf4a('0x2'));var jsonpatch=require(_0xcf4a('0x3'));var rp=require(_0xcf4a('0x4'));var moment=require(_0xcf4a('0x5'));var BPromise=require(_0xcf4a('0x6'));var Mustache=require(_0xcf4a('0x7'));var util=require(_0xcf4a('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xcf4a('0x9'));var ejs=require(_0xcf4a('0xa'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xcf4a('0xb'));var squel=require(_0xcf4a('0xc'));var crypto=require(_0xcf4a('0xd'));var jsforce=require(_0xcf4a('0xe'));var deskjs=require(_0xcf4a('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcf4a('0x10'));var Papa=require(_0xcf4a('0x11'));var Redis=require('ioredis');var authService=require(_0xcf4a('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcf4a('0x13'));var hardwareService=require(_0xcf4a('0x14'));var logger=require(_0xcf4a('0x15'))(_0xcf4a('0x16'));var utils=require('../../config/utils');var config=require(_0xcf4a('0x17'));var licenseUtil=require(_0xcf4a('0x18'));var db=require(_0xcf4a('0x19'))['db'];function respondWithStatusCode(_0x3ad791,_0xf1be85){_0xf1be85=_0xf1be85||0xcc;return function(_0x1a6f33){if(_0x1a6f33){return _0x3ad791['sendStatus'](_0xf1be85);}return _0x3ad791[_0xcf4a('0x1a')](_0xf1be85)['end']();};}function respondWithResult(_0x5ef889,_0xd7d34d){_0xd7d34d=_0xd7d34d||0xc8;return function(_0x3a4d0a){if(_0x3a4d0a){return _0x5ef889[_0xcf4a('0x1a')](_0xd7d34d)[_0xcf4a('0x1b')](_0x3a4d0a);}};}function respondWithFilteredResult(_0x495415,_0x506840){return function(_0x4002ce){if(_0x4002ce){var _0x54548e=typeof _0x506840['offset']==='undefined'&&typeof _0x506840[_0xcf4a('0x1c')]===_0xcf4a('0x1d');var _0x7a6bfb=_0x4002ce[_0xcf4a('0x1e')];var _0x517ed0=_0x54548e?0x0:_0x506840[_0xcf4a('0x1f')];var _0x4b871b=_0x54548e?_0x4002ce[_0xcf4a('0x1e')]:_0x506840[_0xcf4a('0x1f')]+_0x506840[_0xcf4a('0x1c')];var _0x65a266;if(_0x4b871b>=_0x7a6bfb){_0x4b871b=_0x7a6bfb;_0x65a266=0xc8;}else{_0x65a266=0xce;}_0x495415[_0xcf4a('0x1a')](_0x65a266);return _0x495415['set'](_0xcf4a('0x20'),_0x517ed0+'-'+_0x4b871b+'/'+_0x7a6bfb)[_0xcf4a('0x1b')](_0x4002ce);}return null;};}function patchUpdates(_0x5eaa06){return function(_0x3c3efb){try{jsonpatch['apply'](_0x3c3efb,_0x5eaa06,!![]);}catch(_0x157389){return BPromise['reject'](_0x157389);}return _0x3c3efb[_0xcf4a('0x21')]();};}function saveUpdates(_0x4a2f02,_0x572993){return function(_0x2a8db9){if(_0x2a8db9){return _0x2a8db9[_0xcf4a('0x22')](_0x4a2f02)[_0xcf4a('0x23')](function(_0x46bf85){return _0x46bf85;});}return null;};}function removeEntity(_0x5b3931,_0x119c42){return function(_0x57ac61){if(_0x57ac61){return _0x57ac61['destroy']()[_0xcf4a('0x23')](function(){_0x5b3931[_0xcf4a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2daa14,_0x28f9fb){return function(_0x243273){if(!_0x243273){_0x2daa14[_0xcf4a('0x24')](0x194);}return _0x243273;};}function handleError(_0x4be8aa,_0x56ce7a){_0x56ce7a=_0x56ce7a||0x1f4;return function(_0x588bdc){logger[_0xcf4a('0x25')](_0x588bdc[_0xcf4a('0x26')]);if(_0x588bdc[_0xcf4a('0x27')]){delete _0x588bdc[_0xcf4a('0x27')];}_0x4be8aa['status'](_0x56ce7a)[_0xcf4a('0x28')](_0x588bdc);};}exports[_0xcf4a('0x29')]=function(_0xd8773b,_0x6b80f7){var _0x51ca5d={},_0x54fda5={},_0x37ed41={'count':0x0,'rows':[]};var _0x1a0d35=_[_0xcf4a('0x2a')](db[_0xcf4a('0x2b')][_0xcf4a('0x2c')],function(_0x2da102){return{'name':_0x2da102[_0xcf4a('0x2d')],'type':_0x2da102[_0xcf4a('0x2e')][_0xcf4a('0x2f')]};});_0x54fda5[_0xcf4a('0x30')]=_[_0xcf4a('0x2a')](_0x1a0d35,'name');_0x54fda5['query']=_['keys'](_0xd8773b[_0xcf4a('0x31')]);_0x54fda5[_0xcf4a('0x32')]=_[_0xcf4a('0x33')](_0x54fda5[_0xcf4a('0x30')],_0x54fda5['query']);_0x51ca5d[_0xcf4a('0x34')]=_[_0xcf4a('0x33')](_0x54fda5[_0xcf4a('0x30')],qs[_0xcf4a('0x35')](_0xd8773b['query'][_0xcf4a('0x35')]));_0x51ca5d[_0xcf4a('0x34')]=_0x51ca5d[_0xcf4a('0x34')][_0xcf4a('0x36')]?_0x51ca5d[_0xcf4a('0x34')]:_0x54fda5[_0xcf4a('0x30')];if(!_0xd8773b['query'][_0xcf4a('0x37')]('nolimit')){_0x51ca5d[_0xcf4a('0x1c')]=qs[_0xcf4a('0x1c')](_0xd8773b[_0xcf4a('0x31')]['limit']);_0x51ca5d[_0xcf4a('0x1f')]=qs[_0xcf4a('0x1f')](_0xd8773b[_0xcf4a('0x31')]['offset']);}_0x51ca5d[_0xcf4a('0x38')]=qs['sort'](_0xd8773b[_0xcf4a('0x31')][_0xcf4a('0x39')]);_0x51ca5d[_0xcf4a('0x3a')]=qs[_0xcf4a('0x32')](_[_0xcf4a('0x3b')](_0xd8773b[_0xcf4a('0x31')],_0x54fda5['filters']),_0x1a0d35);if(_0xd8773b[_0xcf4a('0x31')][_0xcf4a('0x3c')]){_0x51ca5d[_0xcf4a('0x3a')]=_['merge'](_0x51ca5d['where'],{'$or':_['map'](_0x1a0d35,function(_0x13ea2c){if(_0x13ea2c['type']!==_0xcf4a('0x3d')){var _0x16d207={};_0x16d207[_0x13ea2c[_0xcf4a('0x27')]]={'$like':'%'+_0xd8773b[_0xcf4a('0x31')][_0xcf4a('0x3c')]+'%'};return _0x16d207;}})});}_0x51ca5d=_[_0xcf4a('0x3e')]({},_0x51ca5d,_0xd8773b[_0xcf4a('0x3f')]);var _0xd3c8c5={'where':_0x51ca5d['where']};return db[_0xcf4a('0x2b')]['count'](_0xd3c8c5)['then'](function(_0x5812b1){_0x37ed41['count']=_0x5812b1;if(_0xd8773b[_0xcf4a('0x31')][_0xcf4a('0x40')]){_0x51ca5d[_0xcf4a('0x41')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x51ca5d);})[_0xcf4a('0x23')](function(_0x46d00d){_0x37ed41[_0xcf4a('0x42')]=_0x46d00d;return _0x37ed41;})['then'](respondWithFilteredResult(_0x6b80f7,_0x51ca5d))[_0xcf4a('0x43')](handleError(_0x6b80f7,null));};exports['show']=function(_0x465ed9,_0x2c4af7){var _0x5aae4a={'raw':!![],'where':{'id':_0x465ed9['params']['id']}},_0x362533={};_0x362533['model']=_['keys'](db[_0xcf4a('0x2b')][_0xcf4a('0x2c')]);_0x362533[_0xcf4a('0x31')]=_['keys'](_0x465ed9[_0xcf4a('0x31')]);_0x362533[_0xcf4a('0x32')]=_[_0xcf4a('0x33')](_0x362533['model'],_0x362533[_0xcf4a('0x31')]);_0x5aae4a[_0xcf4a('0x34')]=_[_0xcf4a('0x33')](_0x362533['model'],qs[_0xcf4a('0x35')](_0x465ed9[_0xcf4a('0x31')][_0xcf4a('0x35')]));_0x5aae4a[_0xcf4a('0x34')]=_0x5aae4a['attributes'][_0xcf4a('0x36')]?_0x5aae4a[_0xcf4a('0x34')]:_0x362533[_0xcf4a('0x30')];if(_0x465ed9[_0xcf4a('0x31')][_0xcf4a('0x40')]){_0x5aae4a[_0xcf4a('0x41')]=[{'all':!![]}];}_0x5aae4a=_[_0xcf4a('0x3e')]({},_0x5aae4a,_0x465ed9['options']);return db[_0xcf4a('0x2b')][_0xcf4a('0x44')](_0x5aae4a)['then'](handleEntityNotFound(_0x2c4af7,null))[_0xcf4a('0x23')](respondWithResult(_0x2c4af7,null))[_0xcf4a('0x43')](handleError(_0x2c4af7,null));};exports[_0xcf4a('0x45')]=function(_0x2f1242,_0x3696b5){var _0x11ad96={'where':{'id':_0x2f1242[_0xcf4a('0x46')]['id']}},_0x4df0af={};_0x4df0af[_0xcf4a('0x30')]=_[_0xcf4a('0x47')](db['Attachment'][_0xcf4a('0x2c')]);_0x11ad96['attributes']=_[_0xcf4a('0x33')](_0x4df0af[_0xcf4a('0x30')],qs[_0xcf4a('0x35')](_0x2f1242[_0xcf4a('0x31')][_0xcf4a('0x35')]));_0x11ad96[_0xcf4a('0x34')]=_0x11ad96[_0xcf4a('0x34')][_0xcf4a('0x36')]?_0x11ad96[_0xcf4a('0x34')]:_0x4df0af[_0xcf4a('0x30')];if(_0x2f1242[_0xcf4a('0x31')][_0xcf4a('0x40')]){_0x11ad96[_0xcf4a('0x41')]=[{'all':!![]}];}_0x11ad96=_['merge']({},_0x11ad96,_0x2f1242[_0xcf4a('0x3f')]);return db[_0xcf4a('0x2b')][_0xcf4a('0x44')](_0x11ad96)['then'](handleEntityNotFound(_0x3696b5,null))[_0xcf4a('0x23')](function(_0x2ccf8b){if(_0x2ccf8b){var _0x441214=_0x2ccf8b[_0xcf4a('0x48')]({'plain':!![]});_0x441214=qs[_0xcf4a('0x49')](_0x441214,['id',_0xcf4a('0x4a'),_0xcf4a('0x4b')]);_0x2f1242[_0xcf4a('0x4c')]=_[_0xcf4a('0x49')](_0x2f1242[_0xcf4a('0x4c')],['id','createdAt',_0xcf4a('0x4b')]);return db['Attachment'][_0xcf4a('0x4d')](_[_0xcf4a('0x3e')](_0x441214,_0x2f1242['body']),{'include':_0x2f1242['query'][_0xcf4a('0x40')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3696b5,0xc9))[_0xcf4a('0x43')](handleError(_0x3696b5,null));};exports[_0xcf4a('0x22')]=function(_0x3be976,_0x36f62e){if(_0x3be976[_0xcf4a('0x4c')]['id']){delete _0x3be976[_0xcf4a('0x4c')]['id'];}return db[_0xcf4a('0x2b')][_0xcf4a('0x44')]({'where':{'id':_0x3be976[_0xcf4a('0x46')]['id']}})[_0xcf4a('0x23')](handleEntityNotFound(_0x36f62e,null))[_0xcf4a('0x23')](saveUpdates(_0x3be976[_0xcf4a('0x4c')],null))['then'](respondWithResult(_0x36f62e,null))[_0xcf4a('0x43')](handleError(_0x36f62e,null));};exports[_0xcf4a('0x4e')]=function(_0x403bf0,_0x173efc){return db[_0xcf4a('0x2b')][_0xcf4a('0x44')]({'where':{'id':_0x403bf0[_0xcf4a('0x46')]['id']}})[_0xcf4a('0x23')](handleEntityNotFound(_0x173efc,null))[_0xcf4a('0x23')](removeEntity(_0x173efc,null))['catch'](handleError(_0x173efc,null));};exports['create']=function(_0x44ea7f,_0x2e08c0,_0x1dc1d4){_0x44ea7f[_0xcf4a('0x4c')][_0xcf4a('0x27')]=_0x44ea7f[_0xcf4a('0x4f')][_0xcf4a('0x50')];_0x44ea7f[_0xcf4a('0x4c')][_0xcf4a('0x51')]=_0x44ea7f[_0xcf4a('0x4f')][_0xcf4a('0x52')];_0x44ea7f[_0xcf4a('0x4c')]['type']=_0x44ea7f[_0xcf4a('0x4f')][_0xcf4a('0x53')];return db[_0xcf4a('0x2b')][_0xcf4a('0x4d')](_0x44ea7f[_0xcf4a('0x4c')])[_0xcf4a('0x23')](respondWithResult(_0x2e08c0,0xc9))['catch'](handleError(_0x2e08c0,null));};exports[_0xcf4a('0x54')]=function(_0x33c9d4,_0x3c46d0,_0x2293dc){return db[_0xcf4a('0x2b')][_0xcf4a('0x55')]({'where':{'id':_0x33c9d4[_0xcf4a('0x46')]['id']},'raw':!![]})[_0xcf4a('0x23')](handleEntityNotFound(_0x3c46d0,null))[_0xcf4a('0x23')](function(_0x389085){if(_0x389085){var _0x1c6348=_0x389085[_0xcf4a('0x56')]!==null;var _0x2c08b6=path[_0xcf4a('0x57')](config[_0xcf4a('0x58')],_0xcf4a('0x59'));if(_0x1c6348){_0x2c08b6=path[_0xcf4a('0x57')](_0x2c08b6,_0xcf4a('0x5a'));}var _0x4e2c76=path['join'](_0x2c08b6,_0x389085[_0xcf4a('0x51')]);return _0x3c46d0['download'](_0x4e2c76);}})[_0xcf4a('0x43')](handleError(_0x3c46d0,null));};
\ No newline at end of file
diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js
index a9417ea..de90a42 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 _0x2832=['./attachment.attributes','exports','define','Attachment','attachments','lodash','util','api','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x2832,0x13d));var _0x2283=function(_0x238150,_0x1a510f){_0x238150=_0x238150-0x0;var _0x5b89f4=_0x2832[_0x238150];return _0x5b89f4;};'use strict';var _=require(_0x2283('0x0'));var util=require(_0x2283('0x1'));var logger=require('../../config/logger')(_0x2283('0x2'));var moment=require('moment');var BPromise=require(_0x2283('0x3'));var rp=require(_0x2283('0x4'));var fs=require('fs');var path=require(_0x2283('0x5'));var rimraf=require(_0x2283('0x6'));var config=require(_0x2283('0x7'));var attributes=require(_0x2283('0x8'));module[_0x2283('0x9')]=function(_0x172ae7,_0x162193){return _0x172ae7[_0x2283('0xa')](_0x2283('0xb'),attributes,{'tableName':_0x2283('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc54=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./attachment.attributes','exports','Attachment','attachments','util'];(function(_0x697113,_0x44159a){var _0x35f036=function(_0x1fd84b){while(--_0x1fd84b){_0x697113['push'](_0x697113['shift']());}};_0x35f036(++_0x44159a);}(_0xdc54,0x1c2));var _0x4dc5=function(_0x270247,_0x2a8229){_0x270247=_0x270247-0x0;var _0x3838be=_0xdc54[_0x270247];return _0x3838be;};'use strict';var _=require('lodash');var util=require(_0x4dc5('0x0'));var logger=require(_0x4dc5('0x1'))('api');var moment=require(_0x4dc5('0x2'));var BPromise=require(_0x4dc5('0x3'));var rp=require(_0x4dc5('0x4'));var fs=require('fs');var path=require(_0x4dc5('0x5'));var rimraf=require('rimraf');var config=require(_0x4dc5('0x6'));var attributes=require(_0x4dc5('0x7'));module[_0x4dc5('0x8')]=function(_0x11f784,_0x54540e){return _0x11f784['define'](_0x4dc5('0x9'),attributes,{'tableName':_0x4dc5('0xa'),'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 2140cac..64d8efb 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 _0x8e44=['debug','Attachment,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateAttachment','create','options','raw','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Attachment,\x20%s,\x20%s'];(function(_0x44bcb0,_0x235aa9){var _0xfaf881=function(_0x25d81d){while(--_0x25d81d){_0x44bcb0['push'](_0x44bcb0['shift']());}};_0xfaf881(++_0x235aa9);}(_0x8e44,0x1ac));var _0x48e4=function(_0x50971f,_0x16256c){_0x50971f=_0x50971f-0x0;var _0x466891=_0x8e44[_0x50971f];return _0x466891;};'use strict';var _=require(_0x48e4('0x0'));var util=require(_0x48e4('0x1'));var moment=require(_0x48e4('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48e4('0x3'));var db=require(_0x48e4('0x4'))['db'];var utils=require(_0x48e4('0x5'));var logger=require(_0x48e4('0x6'))('rpc');var config=require(_0x48e4('0x7'));var jayson=require(_0x48e4('0x8'));var client=jayson[_0x48e4('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e2c12,_0x26c5de,_0xfd30df){return new BPromise(function(_0x552cb1,_0x1ae7a7){return client[_0x48e4('0xa')](_0x4e2c12,_0xfd30df)[_0x48e4('0xb')](function(_0x2ba319){logger[_0x48e4('0xc')](_0x48e4('0xd'),_0x26c5de,'request\x20sent');logger[_0x48e4('0xe')](_0x48e4('0xf'),_0x26c5de,_0x48e4('0x10'),JSON['stringify'](_0x2ba319));if(_0x2ba319['error']){if(_0x2ba319[_0x48e4('0x11')][_0x48e4('0x12')]===0x1f4){logger[_0x48e4('0x11')](_0x48e4('0xd'),_0x26c5de,_0x2ba319['error'][_0x48e4('0x13')]);return _0x1ae7a7(_0x2ba319['error'][_0x48e4('0x13')]);}logger[_0x48e4('0x11')](_0x48e4('0xd'),_0x26c5de,_0x2ba319[_0x48e4('0x11')][_0x48e4('0x13')]);return _0x552cb1(_0x2ba319[_0x48e4('0x11')][_0x48e4('0x13')]);}else{logger['info'](_0x48e4('0xd'),_0x26c5de,_0x48e4('0x10'));_0x552cb1(_0x2ba319['result'][_0x48e4('0x13')]);}})[_0x48e4('0x14')](function(_0x4dc92e){logger[_0x48e4('0x11')](_0x48e4('0xd'),_0x26c5de,_0x4dc92e);_0x1ae7a7(_0x4dc92e);});});}exports[_0x48e4('0x15')]=function(_0x4ffc0d){var _0x231dcd=this;return new Promise(function(_0x16e405,_0x4e3943){return db['Attachment'][_0x48e4('0x16')](_0x4ffc0d['body'],{'raw':_0x4ffc0d['options']?_0x4ffc0d[_0x48e4('0x17')][_0x48e4('0x18')]===undefined?!![]:![]:!![]})[_0x48e4('0xb')](function(_0xad2f7d){logger[_0x48e4('0xc')]('CreateAttachment',_0x4ffc0d);logger['debug'](_0x48e4('0x15'),_0x4ffc0d,JSON[_0x48e4('0x19')](_0xad2f7d));_0x16e405(_0xad2f7d);})[_0x48e4('0x14')](function(_0x131817){logger[_0x48e4('0x11')](_0x48e4('0x15'),_0x131817[_0x48e4('0x13')],_0x4ffc0d);_0x4e3943(_0x231dcd[_0x48e4('0x11')](0x1f4,_0x131817[_0x48e4('0x13')]));});});};
\ No newline at end of file
+var _0x00b3=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','CreateAttachment','create','body','options','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0x00b3,0x17a));var _0x300b=function(_0x2f07ac,_0x2c0208){_0x2f07ac=_0x2f07ac-0x0;var _0x540458=_0x00b3[_0x2f07ac];return _0x540458;};'use strict';var _=require('lodash');var util=require(_0x300b('0x0'));var moment=require(_0x300b('0x1'));var BPromise=require(_0x300b('0x2'));var rs=require(_0x300b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x300b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x300b('0x5'))('rpc');var config=require(_0x300b('0x6'));var jayson=require(_0x300b('0x7'));var client=jayson[_0x300b('0x8')][_0x300b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5af470,_0x5dabb9,_0x30b3fe){return new BPromise(function(_0x590c4d,_0x5e283c){return client[_0x300b('0xa')](_0x5af470,_0x30b3fe)[_0x300b('0xb')](function(_0x457aa3){logger['info'](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));logger[_0x300b('0xe')](_0x300b('0xf'),_0x5dabb9,'request\x20sent',JSON[_0x300b('0x10')](_0x457aa3));if(_0x457aa3[_0x300b('0x11')]){if(_0x457aa3[_0x300b('0x11')]['code']===0x1f4){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);return _0x5e283c(_0x457aa3[_0x300b('0x11')][_0x300b('0x12')]);}logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x457aa3['error']['message']);return _0x590c4d(_0x457aa3['error']['message']);}else{logger[_0x300b('0x13')](_0x300b('0xc'),_0x5dabb9,_0x300b('0xd'));_0x590c4d(_0x457aa3[_0x300b('0x14')]['message']);}})['catch'](function(_0x35b1d7){logger[_0x300b('0x11')](_0x300b('0xc'),_0x5dabb9,_0x35b1d7);_0x5e283c(_0x35b1d7);});});}exports[_0x300b('0x15')]=function(_0x4d2024){var _0x1fbf16=this;return new Promise(function(_0x2a7d96,_0xb4b3fa){return db['Attachment'][_0x300b('0x16')](_0x4d2024[_0x300b('0x17')],{'raw':_0x4d2024[_0x300b('0x18')]?_0x4d2024[_0x300b('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x300b('0xb')](function(_0x16bfc6){logger[_0x300b('0x13')]('CreateAttachment',_0x4d2024);logger[_0x300b('0xe')](_0x300b('0x15'),_0x4d2024,JSON[_0x300b('0x10')](_0x16bfc6));_0x2a7d96(_0x16bfc6);})[_0x300b('0x19')](function(_0x26913f){logger['error']('CreateAttachment',_0x26913f[_0x300b('0x12')],_0x4d2024);_0xb4b3fa(_0x1fbf16[_0x300b('0x11')](0x1f4,_0x26913f[_0x300b('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js
index 3845e98..bc4d495 100644
--- a/server/api/attachment/index.js
+++ b/server/api/attachment/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x757a=['put','/:id','update','delete','destroy','exports','util','path','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','index','isAuthenticated','show','/:id/download','post','/:id/clone','clone','diskStorage','%s-%s','replace','single','file','create'];(function(_0x504aac,_0x46f0ab){var _0x5c2ab5=function(_0x37b56b){while(--_0x37b56b){_0x504aac['push'](_0x504aac['shift']());}};_0x5c2ab5(++_0x46f0ab);}(_0x757a,0xde));var _0xa757=function(_0x48c80a,_0x2759f9){_0x48c80a=_0x48c80a-0x0;var _0x3aeca6=_0x757a[_0x48c80a];return _0x3aeca6;};'use strict';var multer=require('multer');var util=require(_0xa757('0x0'));var path=require(_0xa757('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0xa757('0x2'));var auth=require(_0xa757('0x3'));var interaction=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var controller=require(_0xa757('0x6'));router[_0xa757('0x7')]('/',auth['isAuthenticated'](),controller[_0xa757('0x8')]);router[_0xa757('0x7')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0xa')]);router[_0xa757('0x7')](_0xa757('0xb'),auth[_0xa757('0x9')](),controller['download']);router[_0xa757('0xc')](_0xa757('0xd'),auth[_0xa757('0x9')](),controller[_0xa757('0xe')]);var upload=multer({'storage':multer[_0xa757('0xf')]({'destination':function(_0x188ad5,_0x17408b,_0x483d77){_0x483d77(null,path['join'](config['root'],'server/files/attachments/'));},'filename':function(_0x4db68e,_0x421040,_0x544b45){_0x544b45(null,util['format'](_0xa757('0x10'),Date['now'](),_0x421040['originalname'][_0xa757('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xa757('0xc')]('/',upload[_0xa757('0x12')](_0xa757('0x13')),controller[_0xa757('0x14')]);router[_0xa757('0x15')](_0xa757('0x16'),auth[_0xa757('0x9')](),controller[_0xa757('0x17')]);router[_0xa757('0x18')]('/:id',auth[_0xa757('0x9')](),controller[_0xa757('0x19')]);module[_0xa757('0x1a')]=router;
\ No newline at end of file
+var _0xadb5=['root','format','%s-%s','originalname','replace','file','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','/:id/clone'];(function(_0x40ea13,_0x2a639a){var _0x3dd17c=function(_0x273c7f){while(--_0x273c7f){_0x40ea13['push'](_0x40ea13['shift']());}};_0x3dd17c(++_0x2a639a);}(_0xadb5,0xad));var _0x5adb=function(_0x7ab40f,_0x476aea){_0x7ab40f=_0x7ab40f-0x0;var _0x47ccaf=_0xadb5[_0x7ab40f];return _0x47ccaf;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x5adb('0x4'));var interaction=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var controller=require('./attachment.controller');router[_0x5adb('0x7')]('/',auth[_0x5adb('0x8')](),controller[_0x5adb('0x9')]);router[_0x5adb('0x7')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x7')](_0x5adb('0xc'),auth[_0x5adb('0x8')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')](_0x5adb('0xf'),auth[_0x5adb('0x8')](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1a8f66,_0x1ea238,_0x82e67e){_0x82e67e(null,path['join'](config[_0x5adb('0x10')],'server/files/attachments/'));},'filename':function(_0x2a0b70,_0x5433bf,_0x8cfcc6){_0x8cfcc6(null,util[_0x5adb('0x11')](_0x5adb('0x12'),Date['now'](),_0x5433bf[_0x5adb('0x13')][_0x5adb('0x14')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5adb('0xe')]('/',upload['single'](_0x5adb('0x15')),controller['create']);router[_0x5adb('0x16')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x17')]);router[_0x5adb('0x18')](_0x5adb('0xa'),auth[_0x5adb('0x8')](),controller[_0x5adb('0x19')]);module[_0x5adb('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/authActiveDirectory.controller.js b/server/api/authActiveDirectory/authActiveDirectory.controller.js
index 8b2fe6d..f69fbf5 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 _0x9108=['api','activedirectory','baseDN','domain','authenticate','Error\x20authenticate\x20%s:\x20%s','inspect','error','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','then','adSsoEnabled','name','password','salt','role','disabled','blocked','blockedAt','online','user','blockDuration','add','minutes','clearBlockUser','getLicense','catch','status','send','login','ad-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','use','User','passport','passport-local','Strategy','moment','activedirectory2','bluebird','util','../../components/auth/service','../../config/utils','../../config/environment'];(function(_0xf1121d,_0x5d917b){var _0x4b0f5b=function(_0x2c2e09){while(--_0x2c2e09){_0xf1121d['push'](_0xf1121d['shift']());}};_0x4b0f5b(++_0x5d917b);}(_0x9108,0x1d6));var _0x8910=function(_0x49c69c,_0x2e6150){_0x49c69c=_0x49c69c-0x0;var _0x55cdd2=_0x9108[_0x49c69c];return _0x55cdd2;};'use strict';var passport=require(_0x8910('0x0'));var LocalStrategy=require(_0x8910('0x1'))[_0x8910('0x2')];var moment=require(_0x8910('0x3'));var ActiveDirectory=require(_0x8910('0x4'));var BPromise=require(_0x8910('0x5'));var util=require(_0x8910('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x8910('0x7'));var utils=require(_0x8910('0x8'));var config=require(_0x8910('0x9'));var logger=require('../../config/logger')(_0x8910('0xa'));function isActiveDirectoryConfigured(_0x454c57){var _0x1a39d2=![];if(typeof _0x454c57[_0x8910('0xb')]!=='undefined'){_0x1a39d2=_0x454c57[_0x8910('0xb')][_0x8910('0xc')]&&_0x454c57[_0x8910('0xb')]['url']&&_0x454c57[_0x8910('0xb')][_0x8910('0xd')];}return _0x1a39d2;}function adAuthenticate(_0x29e986,_0x4b4825,_0x1d1b73){return new BPromise(function(_0x35e3a3,_0x1fc80f){try{var _0x483bb2=new ActiveDirectory(_0x29e986);_0x483bb2[_0x8910('0xe')](_0x4b4825,_0x1d1b73,function(_0x44a48c,_0x330324){if(_0x44a48c){logger['error'](_0x8910('0xf'),_0x4b4825,util[_0x8910('0x10')](_0x44a48c,{'showHidden':![],'depth':null}));_0x1fc80f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(!_0x330324){logger[_0x8910('0x11')]('Error\x20authenticate\x20%s:\x20Wrong\x20credentials',_0x4b4825);_0x1fc80f(_0x8910('0x12'));}else{_0x35e3a3(_0x330324);}});}catch(_0x342e79){_0x1fc80f(_0x342e79);}});}function ActiveDirectoryAuthenticate(_0x41548d,_0x3416ef,_0x2cd9ed,_0x239d33){var _0x2aad27,_0x25ad53;if(!isActiveDirectoryConfigured(config)){logger[_0x8910('0x11')](_0x8910('0x13'),_0x3416ef);return _0x239d33(null,![],{'message':_0x8910('0x12')});}return db[_0x8910('0x14')][_0x8910('0x15')]({'where':{'id':0x1},'attributes':['adSsoEnabled','blockDuration'],'raw':!![]})[_0x8910('0x16')](function(_0x5f2fce){_0x2aad27=_0x5f2fce;if(!_0x2aad27[_0x8910('0x17')]){logger[_0x8910('0x11')]('Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled',_0x3416ef);throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return _0x41548d[_0x8910('0x15')]({'attributes':['id',_0x8910('0x18'),_0x8910('0x19'),_0x8910('0x1a'),_0x8910('0x1b'),_0x8910('0x1c'),_0x8910('0x1d'),_0x8910('0x1e'),_0x8910('0x1f')],'where':{'name':_0x3416ef,'role':{'$or':['admin',_0x8910('0x20'),'agent']},'adSsoEnabled':!![]}});})['then'](function(_0xeb1cbf){if(!_0xeb1cbf||_0xeb1cbf&&_0xeb1cbf[_0x8910('0x18')]!==_0x3416ef){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}_0x25ad53=_0xeb1cbf;var _0xd1e0ad=_0x25ad53['name']+'@'+config[_0x8910('0xb')][_0x8910('0xd')];return adAuthenticate(config[_0x8910('0xb')],_0xd1e0ad,_0x2cd9ed);})[_0x8910('0x16')](function(_0x31c35d){if(_0x25ad53['disabled']){throw new Error(_0x8910('0x12'));}if(_0x2aad27[_0x8910('0x21')]>0x0){if(_0x25ad53[_0x8910('0x1d')]){if(moment(_0x25ad53[_0x8910('0x1e')])[_0x8910('0x22')](_0x2aad27[_0x8910('0x21')],_0x8910('0x23'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils[_0x8910('0x24')](_0x25ad53,0x0,![],null)[_0x8910('0x16')](function(){return utils[_0x8910('0x25')](_0x25ad53);})[_0x8910('0x16')](function(){return _0x239d33(null,_0x25ad53);});}else{return utils[_0x8910('0x25')](_0x25ad53)['then'](function(){return _0x239d33(null,_0x25ad53);});}}else{return utils[_0x8910('0x25')](_0x25ad53)['then'](function(){return _0x239d33(null,_0x25ad53);});}})[_0x8910('0x26')](function(_0xaad70b){return _0x239d33(null,![],_0xaad70b);});}function handleError(_0x18d45d,_0x395330,_0xc2de4f){return _0x18d45d[_0x8910('0x27')](_0x395330||0x1f4)[_0x8910('0x28')]({'message':_0xc2de4f?_0xc2de4f['message']||_0xc2de4f:''});}exports[_0x8910('0x29')]=function(_0x4a13a5,_0x38982f,_0xfbaf9f){passport['authenticate'](_0x8910('0x2a'),function(_0x5e0595,_0x2b18f2,_0x5c0fa8){var _0x1b83a5=_0x5e0595||_0x5c0fa8;if(_0x1b83a5){return handleError(_0x38982f,0x191,_0x1b83a5);}if(!_0x2b18f2){return handleError(_0x38982f,0x194,{'message':_0x8910('0x2b')});}else{var _0x1c671f={'payload':{'id':_0x2b18f2['id'],'role':_0x2b18f2[_0x8910('0x1b')]},'options':{'expiresIn':0x15180}};return authService[_0x8910('0x2c')](_0x1c671f)[_0x8910('0x16')](function(_0xeb075e){_0x38982f[_0x8910('0x2d')]({'id':_0x2b18f2['id'],'token':_0xeb075e,'statusCall':'','isAlreadyLogged':_0x2b18f2[_0x8910('0x1f')]});});}})(_0x4a13a5,_0x38982f,_0xfbaf9f);};passport[_0x8910('0x2e')](_0x8910('0x2a'),new LocalStrategy({'usernameField':_0x8910('0x18'),'passwordField':_0x8910('0x19')},function(_0x4451e7,_0x25cb6c,_0x1f28d9){return ActiveDirectoryAuthenticate(db[_0x8910('0x2f')],_0x4451e7,_0x25cb6c,_0x1f28d9);}));
\ No newline at end of file
+var _0xaafc=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','Error\x20authenticate\x20%s:\x20Wrong\x20credentials','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20configured','Setting','findOne','adSsoEnabled','blockDuration','Error\x20authenticate\x20%s:\x20Active\x20Directory\x20not\x20enabled','name','password','salt','role','disabled','blocked','blockedAt','online','user','agent','then','domain','add','minutes','getLicense','catch','status','message','json','use','ad-login','User','passport-local','Strategy','moment','activedirectory2','util','../../mysqldb','../../config/environment','api','activedirectory','undefined','authenticate','error','Error\x20authenticate\x20%s:\x20%s'];(function(_0x11da55,_0x1456f0){var _0x127e89=function(_0x342b99){while(--_0x342b99){_0x11da55['push'](_0x11da55['shift']());}};_0x127e89(++_0x1456f0);}(_0xaafc,0x176));var _0xcaaf=function(_0x3caffc,_0x393921){_0x3caffc=_0x3caffc-0x0;var _0x533d1b=_0xaafc[_0x3caffc];return _0x533d1b;};'use strict';var passport=require('passport');var LocalStrategy=require(_0xcaaf('0x0'))[_0xcaaf('0x1')];var moment=require(_0xcaaf('0x2'));var ActiveDirectory=require(_0xcaaf('0x3'));var BPromise=require('bluebird');var util=require(_0xcaaf('0x4'));var db=require(_0xcaaf('0x5'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var config=require(_0xcaaf('0x6'));var logger=require('../../config/logger')(_0xcaaf('0x7'));function isActiveDirectoryConfigured(_0x54757a){var _0x31e6bb=![];if(typeof _0x54757a[_0xcaaf('0x8')]!==_0xcaaf('0x9')){_0x31e6bb=_0x54757a[_0xcaaf('0x8')]['baseDN']&&_0x54757a[_0xcaaf('0x8')]['url']&&_0x54757a[_0xcaaf('0x8')]['domain'];}return _0x31e6bb;}function adAuthenticate(_0x94f4d6,_0x5f11b0,_0x163ced){return new BPromise(function(_0x12f13d,_0x2563a0){try{var _0x9dc02=new ActiveDirectory(_0x94f4d6);_0x9dc02[_0xcaaf('0xa')](_0x5f11b0,_0x163ced,function(_0x42078d,_0x46f2e1){if(_0x42078d){logger[_0xcaaf('0xb')](_0xcaaf('0xc'),_0x5f11b0,util['inspect'](_0x42078d,{'showHidden':![],'depth':null}));_0x2563a0(_0xcaaf('0xd'));}else if(!_0x46f2e1){logger[_0xcaaf('0xb')](_0xcaaf('0xe'),_0x5f11b0);_0x2563a0(_0xcaaf('0xd'));}else{_0x12f13d(_0x46f2e1);}});}catch(_0x215949){_0x2563a0(_0x215949);}});}function ActiveDirectoryAuthenticate(_0x35d596,_0x6afc3,_0x439c40,_0x42861d){var _0x168550,_0x953779;if(!isActiveDirectoryConfigured(config)){logger['error'](_0xcaaf('0xf'),_0x6afc3);return _0x42861d(null,![],{'message':_0xcaaf('0xd')});}return db[_0xcaaf('0x10')][_0xcaaf('0x11')]({'where':{'id':0x1},'attributes':[_0xcaaf('0x12'),_0xcaaf('0x13')],'raw':!![]})['then'](function(_0xf8e303){_0x168550=_0xf8e303;if(!_0x168550[_0xcaaf('0x12')]){logger['error'](_0xcaaf('0x14'),_0x6afc3);throw new Error(_0xcaaf('0xd'));}return _0x35d596[_0xcaaf('0x11')]({'attributes':['id',_0xcaaf('0x15'),_0xcaaf('0x16'),_0xcaaf('0x17'),_0xcaaf('0x18'),_0xcaaf('0x19'),_0xcaaf('0x1a'),_0xcaaf('0x1b'),_0xcaaf('0x1c')],'where':{'name':_0x6afc3,'role':{'$or':['admin',_0xcaaf('0x1d'),_0xcaaf('0x1e')]},'adSsoEnabled':!![]}});})[_0xcaaf('0x1f')](function(_0x110974){if(!_0x110974||_0x110974&&_0x110974[_0xcaaf('0x15')]!==_0x6afc3){throw new Error(_0xcaaf('0xd'));}_0x953779=_0x110974;var _0x189f56=_0x953779['name']+'@'+config[_0xcaaf('0x8')][_0xcaaf('0x20')];return adAuthenticate(config[_0xcaaf('0x8')],_0x189f56,_0x439c40);})['then'](function(_0x34f878){if(_0x953779[_0xcaaf('0x19')]){throw new Error(_0xcaaf('0xd'));}if(_0x168550[_0xcaaf('0x13')]>0x0){if(_0x953779[_0xcaaf('0x1a')]){if(moment(_0x953779[_0xcaaf('0x1b')])[_0xcaaf('0x21')](_0x168550['blockDuration'],_0xcaaf('0x22'))>moment()){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}return utils['clearBlockUser'](_0x953779,0x0,![],null)['then'](function(){return utils[_0xcaaf('0x23')](_0x953779);})[_0xcaaf('0x1f')](function(){return _0x42861d(null,_0x953779);});}else{return utils[_0xcaaf('0x23')](_0x953779)[_0xcaaf('0x1f')](function(){return _0x42861d(null,_0x953779);});}}else{return utils[_0xcaaf('0x23')](_0x953779)[_0xcaaf('0x1f')](function(){return _0x42861d(null,_0x953779);});}})[_0xcaaf('0x24')](function(_0x34019c){return _0x42861d(null,![],_0x34019c);});}function handleError(_0x1523bc,_0x4c75a9,_0x4cacf9){return _0x1523bc[_0xcaaf('0x25')](_0x4c75a9||0x1f4)['send']({'message':_0x4cacf9?_0x4cacf9[_0xcaaf('0x26')]||_0x4cacf9:''});}exports['login']=function(_0x343cd5,_0x10fec3,_0x2e8530){passport[_0xcaaf('0xa')]('ad-login',function(_0x20ee40,_0x2d0881,_0x35bec2){var _0x571948=_0x20ee40||_0x35bec2;if(_0x571948){return handleError(_0x10fec3,0x191,_0x571948);}if(!_0x2d0881){return handleError(_0x10fec3,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x120e52={'payload':{'id':_0x2d0881['id'],'role':_0x2d0881[_0xcaaf('0x18')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x120e52)[_0xcaaf('0x1f')](function(_0x315565){_0x10fec3[_0xcaaf('0x27')]({'id':_0x2d0881['id'],'token':_0x315565,'statusCall':'','isAlreadyLogged':_0x2d0881[_0xcaaf('0x1c')]});});}})(_0x343cd5,_0x10fec3,_0x2e8530);};passport[_0xcaaf('0x28')](_0xcaaf('0x29'),new LocalStrategy({'usernameField':_0xcaaf('0x15'),'passwordField':_0xcaaf('0x16')},function(_0x2bc7f6,_0x4f1eb1,_0x48b018){return ActiveDirectoryAuthenticate(db[_0xcaaf('0x2a')],_0x2bc7f6,_0x4f1eb1,_0x48b018);}));
\ No newline at end of file
diff --git a/server/api/authActiveDirectory/index.js b/server/api/authActiveDirectory/index.js
index 9ee3f94..773593c 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 _0x6cc5=['./authActiveDirectory.controller','post','login','exports','express'];(function(_0x32cbe0,_0x594209){var _0x49b861=function(_0x55812b){while(--_0x55812b){_0x32cbe0['push'](_0x32cbe0['shift']());}};_0x49b861(++_0x594209);}(_0x6cc5,0xb3));var _0x56cc=function(_0x5bf65d,_0x3cc52e){_0x5bf65d=_0x5bf65d-0x0;var _0x4ebeb7=_0x6cc5[_0x5bf65d];return _0x4ebeb7;};'use strict';var express=require(_0x56cc('0x0'));var router=express['Router']();var controller=require(_0x56cc('0x1'));router[_0x56cc('0x2')]('/',controller[_0x56cc('0x3')]);module[_0x56cc('0x4')]=router;
\ No newline at end of file
+var _0x97ea=['express','Router','./authActiveDirectory.controller','post','exports'];(function(_0xa546b9,_0x265b5f){var _0x1a5815=function(_0x55a467){while(--_0x55a467){_0xa546b9['push'](_0xa546b9['shift']());}};_0x1a5815(++_0x265b5f);}(_0x97ea,0x15e));var _0xa97e=function(_0x364997,_0x3ce8bd){_0x364997=_0x364997-0x0;var _0x27e571=_0x97ea[_0x364997];return _0x27e571;};'use strict';var express=require(_0xa97e('0x0'));var router=express[_0xa97e('0x1')]();var controller=require(_0xa97e('0x2'));router[_0xa97e('0x3')]('/',controller['login']);module[_0xa97e('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 8d5204a..452a676 100644
--- a/server/api/authGoogle/authGoogle.controller.js
+++ b/server/api/authGoogle/authGoogle.controller.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x7a54=['blockedAt','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/utils','login','authenticate','google','/login','email','use','secret','callbackURL','findOne','allowedLoginAttempts','blockDuration','then','User','find','map','value','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x7a54,0x106));var _0x47a5=function(_0x463577,_0x5832ef){_0x463577=_0x463577-0x0;var _0x22c594=_0x7a54[_0x463577];return _0x22c594;};'use strict';var _=require(_0x47a5('0x0'));var passport=require(_0x47a5('0x1'));var GoogleStrategy=require(_0x47a5('0x2'))['Strategy'];var moment=require(_0x47a5('0x3'));var db=require(_0x47a5('0x4'))['db'];var config=require('../../config/environment');var utils=require(_0x47a5('0x5'));exports[_0x47a5('0x6')]=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':_0x47a5('0x9'),'scope':['profile',_0x47a5('0xa')],'session':![]});exports['callback']=passport[_0x47a5('0x7')](_0x47a5('0x8'),{'failureRedirect':'/login','session':![]});passport[_0x47a5('0xb')](new GoogleStrategy({'clientID':config['google']?config['google']['clientID']:'id','clientSecret':config[_0x47a5('0x8')]?config[_0x47a5('0x8')]['clientSecret']:_0x47a5('0xc'),'callbackURL':config['google']?config['google'][_0x47a5('0xd')]:''},function(_0x69e4d4,_0x2f399b,_0x250fad,_0xd612dd){var _0xd308b8,_0x1eae59;return db['Setting'][_0x47a5('0xe')]({'where':{'id':0x1},'attributes':[_0x47a5('0xf'),_0x47a5('0x10')],'raw':!![]})[_0x47a5('0x11')](function(_0x139f25){_0xd308b8=_0x139f25;return db[_0x47a5('0x12')][_0x47a5('0x13')]({'where':{'email':_[_0x47a5('0x14')](_0x250fad['emails'],_0x47a5('0x15')),'role':{'$or':[_0x47a5('0x16'),_0x47a5('0x17'),_0x47a5('0x18')]}}});})[_0x47a5('0x11')](function(_0x574af6){_0x1eae59=_0x574af6;if(_0x1eae59){if(_0x1eae59['disabled']){return _0xd612dd(_0x47a5('0x19'));}else if(_0xd308b8['blockDuration']>0x0){if(_0x1eae59['blocked']){if(moment(_0x1eae59[_0x47a5('0x1a')])[_0x47a5('0x1b')](_0xd308b8[_0x47a5('0x10')],_0x47a5('0x1c'))>moment()){return _0xd612dd(_0x47a5('0x19'));}else{return utils[_0x47a5('0x1d')](_0x1eae59,0x0,![],null)[_0x47a5('0x11')](function(){return utils[_0x47a5('0x1e')](_0x1eae59);})[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils['getLicense'](_0x1eae59)[_0x47a5('0x11')](function(){return _0xd612dd(null,_0x1eae59);});}}else{return utils[_0x47a5('0x1e')](_0x1eae59)['then'](function(){return _0xd612dd(null,_0x1eae59);});}}return _0xd612dd(_0x47a5('0x19'));})[_0x47a5('0x1f')](function(_0x36874d){_0xd612dd(_0x36874d);});}));
\ No newline at end of file
+var _0x9957=['../../config/environment','../../config/utils','login','google','/login','profile','email','callback','authenticate','use','clientID','clientSecret','secret','callbackURL','Setting','findOne','allowedLoginAttempts','User','find','map','emails','value','admin','user','then','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','getLicense','catch','lodash','passport','passport-google-oauth20','Strategy','../../mysqldb'];(function(_0x8ee685,_0x2c7a1e){var _0x33187a=function(_0x97494c){while(--_0x97494c){_0x8ee685['push'](_0x8ee685['shift']());}};_0x33187a(++_0x2c7a1e);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'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 df9db01..7894340 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 _0x1d05=['get','/callback','callback','exports','passport','Router','./authGoogle.controller','../../components/auth/service'];(function(_0x27c112,_0x503e0c){var _0x4c82c7=function(_0x16597e){while(--_0x16597e){_0x27c112['push'](_0x27c112['shift']());}};_0x4c82c7(++_0x503e0c);}(_0x1d05,0xc4));var _0x51d0=function(_0x15d15b,_0x3eb0b0){_0x15d15b=_0x15d15b-0x0;var _0x45be4b=_0x1d05[_0x15d15b];return _0x45be4b;};'use strict';var express=require('express');var passport=require(_0x51d0('0x0'));var router=express[_0x51d0('0x1')]();var controller=require(_0x51d0('0x2'));var userController=require('../user/user.controller.js');var authService=require(_0x51d0('0x3'));router[_0x51d0('0x4')]('/',controller['login']);router['get'](_0x51d0('0x5'),controller[_0x51d0('0x6')],authService['isMiddleware'],userController['login'],authService['setTokenCookie']);module[_0x51d0('0x7')]=router;
\ No newline at end of file
+var _0x2462=['isMiddleware','exports','passport','./authGoogle.controller','../../components/auth/service','get','login','/callback','callback'];(function(_0x56f879,_0x2dad26){var _0x35d0c3=function(_0x25a1dd){while(--_0x25a1dd){_0x56f879['push'](_0x56f879['shift']());}};_0x35d0c3(++_0x2dad26);}(_0x2462,0x77));var _0x2246=function(_0xd0fbce,_0x1c418c){_0xd0fbce=_0xd0fbce-0x0;var _0x2fedd4=_0x2462[_0xd0fbce];return _0x2fedd4;};'use strict';var express=require('express');var passport=require(_0x2246('0x0'));var router=express['Router']();var controller=require(_0x2246('0x1'));var userController=require('../user/user.controller.js');var authService=require(_0x2246('0x2'));router[_0x2246('0x3')]('/',controller[_0x2246('0x4')]);router['get'](_0x2246('0x5'),controller[_0x2246('0x6')],authService[_0x2246('0x7')],userController[_0x2246('0x4')],authService['setTokenCookie']);module[_0x2246('0x8')]=router;
\ No newline at end of file
diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js
index e4f4053..68a6b17 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 _0xffb5=['../../mysqldb','../../components/auth/service','../../config/utils','client','http','findOne','allowedLoginAttempts','blockDuration','name','password','salt','role','disabled','blocked','admin','user','then','authenticate','loginAttempts','blockedAt','add','clearBlockUser','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','minutes','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','getSmtpOptions','merge','\x22%s\x22\x20<%s>','request','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','status','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','headers','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','Setting','securePassword','enforcePasswordHistory','passwordHistoryLimit','validatePasswordPattern','validatePasswordHistory','Password\x20reset!','use','util','passport-local','jayson/promise','lodash'];(function(_0x13ac0c,_0x23a735){var _0x909f31=function(_0x3ffad0){while(--_0x3ffad0){_0x13ac0c['push'](_0x13ac0c['shift']());}};_0x909f31(++_0x23a735);}(_0xffb5,0x1ee));var _0x5ffb=function(_0x18b90e,_0x452a6){_0x18b90e=_0x18b90e-0x0;var _0x2913a5=_0xffb5[_0x18b90e];return _0x2913a5;};'use strict';var util=require(_0x5ffb('0x0'));var passport=require('passport');var LocalStrategy=require(_0x5ffb('0x1'))['Strategy'];var jayson=require(_0x5ffb('0x2'));var _=require(_0x5ffb('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0x5ffb('0x4'))['db'];var authService=require(_0x5ffb('0x5'));var utils=require(_0x5ffb('0x6'));var client=jayson[_0x5ffb('0x7')][_0x5ffb('0x8')]({'port':0x232b});function localAuthenticate(_0x15dee0,_0x45c74c,_0x49c24b,_0x4c6896){var _0x12265c,_0x5f323c;return db['Setting'][_0x5ffb('0x9')]({'where':{'id':0x1},'attributes':[_0x5ffb('0xa'),_0x5ffb('0xb')],'raw':!![]})['then'](function(_0x3e454c){_0x12265c=_0x3e454c;return _0x15dee0[_0x5ffb('0x9')]({'attributes':['id',_0x5ffb('0xc'),_0x5ffb('0xd'),_0x5ffb('0xe'),_0x5ffb('0xf'),_0x5ffb('0x10'),_0x5ffb('0x11'),'blockedAt','loginAttempts'],'where':{'name':_0x45c74c,'role':{'$or':[_0x5ffb('0x12'),_0x5ffb('0x13'),'agent']}}});})[_0x5ffb('0x14')](function(_0x27198e){if(!_0x27198e||_0x27198e&&_0x27198e[_0x5ffb('0xc')]!==_0x45c74c){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x5f323c=_0x27198e;return _0x5f323c;}})[_0x5ffb('0x14')](function(){_0x5f323c[_0x5ffb('0x15')](_0x49c24b,function(_0x153384,_0x241f8c){var _0x31c2b1=_0x5f323c[_0x5ffb('0x16')]+0x1;if(_0x153384){return _0x4c6896(_0x153384);}else if(!_0x241f8c){if(_0x5f323c[_0x5ffb('0x10')]){return _0x4c6896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x12265c[_0x5ffb('0xa')]>0x0){if(_0x5f323c['blocked']){if(_0x12265c[_0x5ffb('0xb')]>0x0){if(moment(_0x5f323c[_0x5ffb('0x17')])[_0x5ffb('0x18')](_0x12265c[_0x5ffb('0xb')],'minutes')>moment()){return _0x4c6896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5ffb('0x19')](_0x5f323c,_0x31c2b1,![],null)[_0x5ffb('0x14')](function(){return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});});}}else{return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});}}else{if(_0x31c2b1>=_0x12265c[_0x5ffb('0xa')]){return utils[_0x5ffb('0x19')](_0x5f323c,0x0,!![],moment())[_0x5ffb('0x14')](function(){return _0x4c6896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}else{return utils['clearBlockUser'](_0x5f323c,_0x31c2b1,![],null)[_0x5ffb('0x14')](function(){return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});});}}}else{return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});}}else{if(_0x5f323c['disabled']){return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});}else if(_0x12265c[_0x5ffb('0xa')]>0x0){if(_0x5f323c[_0x5ffb('0x11')]){if(_0x12265c[_0x5ffb('0xb')]>0x0){if(moment(_0x5f323c[_0x5ffb('0x17')])[_0x5ffb('0x18')](_0x12265c[_0x5ffb('0xb')],_0x5ffb('0x1b'))>moment()){return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});}else{return utils[_0x5ffb('0x19')](_0x5f323c,0x0,![],null)[_0x5ffb('0x14')](function(){return utils[_0x5ffb('0x1c')](_0x5f323c);})[_0x5ffb('0x14')](function(){return _0x4c6896(null,_0x5f323c);});}}else{return _0x4c6896(null,![],{'message':_0x5ffb('0x1a')});}}else{return utils['clearBlockUser'](_0x5f323c,0x0,![],null)['then'](function(){return utils[_0x5ffb('0x1c')](_0x5f323c);})['then'](function(){return _0x4c6896(null,_0x5f323c);})[_0x5ffb('0x1d')](function(_0xa98da3){return _0x4c6896(null,![],_0xa98da3);});}}else{if(_0x5f323c[_0x5ffb('0x11')]){return _0x4c6896(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x5ffb('0x1c')](_0x5f323c)[_0x5ffb('0x14')](function(){return _0x4c6896(null,_0x5f323c);});}}}});})[_0x5ffb('0x1d')](function(_0x3b0188){return _0x4c6896(null,![],_0x3b0188);});}function sendServiceMail(_0x8f060c){return db[_0x5ffb('0x1e')][_0x5ffb('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x5ffb('0xc'),_0x5ffb('0x20')],'include':[{'model':db[_0x5ffb('0x21')],'as':_0x5ffb('0x22'),'include':[{'model':db['CloudProvider'],'as':_0x5ffb('0x23')}]}]})[_0x5ffb('0x14')](function(_0x5b295a){if(!_0x5b295a){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x511cb8=_0x5b295a[_0x5ffb('0x24')]();var _0x3bb6fe={'account':_0x511cb8,'message':_[_0x5ffb('0x25')]({'from':util['format'](_0x5ffb('0x26'),_0x5b295a[_0x5ffb('0xc')],_0x5b295a[_0x5ffb('0x20')]||_0x5b295a[_0x5ffb('0x22')]['user'])},_0x8f060c)};return client[_0x5ffb('0x27')]('SendMail',_0x3bb6fe);})['then'](function(_0x3cdd9a){if(_0x3cdd9a[_0x5ffb('0x28')]){throw new Error(util['format'](_0x5ffb('0x29'),_0x3cdd9a['error'][_0x5ffb('0x2a')]||JSON['stringify'](_0x3cdd9a[_0x5ffb('0x28')])));}return!![];});}function handleError(_0x599318,_0x1858ab,_0x30edac){return _0x599318[_0x5ffb('0x2b')](_0x1858ab||0x1f4)['send']({'message':_0x30edac?_0x30edac['message']||_0x30edac:''});}exports['login']=function(_0x5dc8d2,_0x3a38e2,_0x1f05d8){passport[_0x5ffb('0x15')](_0x5ffb('0x2c'),function(_0x3c82a1,_0x4d8402,_0x373b61){var _0x100963=_0x3c82a1||_0x373b61;if(_0x100963){return handleError(_0x3a38e2,0x191,_0x100963);}if(!_0x4d8402){return handleError(_0x3a38e2,0x194,{'message':_0x5ffb('0x2d')});}else{var _0x17d324={'payload':{'id':_0x4d8402['id'],'role':_0x4d8402[_0x5ffb('0xf')]},'options':{'expiresIn':0x15180}};return authService[_0x5ffb('0x2e')](_0x17d324)[_0x5ffb('0x14')](function(_0xe055f){_0x3a38e2[_0x5ffb('0x2f')]({'id':_0x4d8402['id'],'token':_0xe055f,'statusCall':'','isAlreadyLogged':_0x4d8402[_0x5ffb('0x30')]});});}})(_0x5dc8d2,_0x3a38e2,_0x1f05d8);};exports[_0x5ffb('0x31')]=function(_0x3559b8,_0x1c6a95){if(!_0x3559b8[_0x5ffb('0x32')][_0x5ffb('0x20')]){return handleError(_0x1c6a95,0x1f4,{'message':_0x5ffb('0x33')});}var _0x34377a=rs[_0x5ffb('0x34')]();_0x3559b8[_0x5ffb('0x32')]['email']=_0x3559b8[_0x5ffb('0x32')][_0x5ffb('0x20')]['trim']()[_0x5ffb('0x35')]();var _0x5e1588;return db['Setting'][_0x5ffb('0x9')]({'where':{'id':0x1},'attributes':[_0x5ffb('0xa'),'blockDuration'],'raw':!![]})[_0x5ffb('0x14')](function(_0x5e50b6){_0x5e1588=_0x5e50b6;return db[_0x5ffb('0x36')]['find']({'where':{'email':_0x3559b8[_0x5ffb('0x32')][_0x5ffb('0x20')]}});})[_0x5ffb('0x14')](function(_0x16ab11){if(!_0x16ab11){throw new Error(_0x5ffb('0x37'));}if(_0x16ab11['disabled']){throw new Error(_0x5ffb('0x38'));}if(_0x16ab11[_0x5ffb('0x11')]){if(moment(_0x16ab11[_0x5ffb('0x17')])['add'](_0x5e1588[_0x5ffb('0xb')],_0x5ffb('0x1b'))>moment()){throw new Error(_0x5ffb('0x39'));}else{_0x16ab11[_0x5ffb('0x11')]=![];_0x16ab11[_0x5ffb('0x17')]=null;}}_0x16ab11[_0x5ffb('0x3a')]=_0x34377a;_0x16ab11[_0x5ffb('0x3b')]=Date[_0x5ffb('0x3c')]()+0x36ee80;return _0x16ab11[_0x5ffb('0x3d')]();})[_0x5ffb('0x14')](function(){return sendServiceMail({'to':_0x3559b8[_0x5ffb('0x32')]['email'],'subject':_0x5ffb('0x3e'),'text':_0x5ffb('0x3f')+_0x5ffb('0x40')+_0x5ffb('0x41')+_0x3559b8[_0x5ffb('0x42')][_0x5ffb('0x43')]+'/reset/'+_0x34377a+'\x0a\x0a'+_0x5ffb('0x44')});})[_0x5ffb('0x14')](function(){_0x1c6a95['status'](0xc8)[_0x5ffb('0x45')]({'message':_0x5ffb('0x46')});})[_0x5ffb('0x1d')](function(_0x48b6f4){return handleError(_0x1c6a95,0x1f4,_0x48b6f4);});};exports[_0x5ffb('0x47')]=function(_0x4a9383,_0x2a1f48){return db[_0x5ffb('0x36')][_0x5ffb('0x1f')]({'where':{'resetPasswordToken':_0x4a9383[_0x5ffb('0x48')][_0x5ffb('0x49')],'resetPasswordExpires':{'$gt':Date[_0x5ffb('0x3c')]()}}})[_0x5ffb('0x14')](function(_0x2c8a70){if(!_0x2c8a70){throw new Error(_0x5ffb('0x4a'));}return db[_0x5ffb('0x4b')][_0x5ffb('0x9')]({'attributes':['id',_0x5ffb('0x4c'),_0x5ffb('0x4d'),_0x5ffb('0x4e')]})['then'](function(_0xf5d989){if(_0xf5d989[_0x5ffb('0x4c')])authService[_0x5ffb('0x4f')](_0x4a9383[_0x5ffb('0x32')][_0x5ffb('0xd')]);if(!_0xf5d989['enforcePasswordHistory']||!_0x2c8a70['previousPasswords'])return _0x2c8a70;authService[_0x5ffb('0x50')](_0x4a9383[_0x5ffb('0x32')]['password'],_0x2c8a70['previousPasswords'],_0xf5d989[_0x5ffb('0x4e')]);return _0x2c8a70;})[_0x5ffb('0x14')](function(){_0x2c8a70[_0x5ffb('0xd')]=_0x4a9383[_0x5ffb('0x32')][_0x5ffb('0xd')];_0x2c8a70[_0x5ffb('0x3a')]=null;_0x2c8a70[_0x5ffb('0x3b')]=null;return _0x2c8a70[_0x5ffb('0x3d')]();});})[_0x5ffb('0x14')](function(){_0x2a1f48['status'](0xc8)[_0x5ffb('0x45')]({'message':_0x5ffb('0x51')});})[_0x5ffb('0x1d')](function(_0x34b087){return handleError(_0x2a1f48,0x1f4,_0x34b087);});};passport[_0x5ffb('0x52')](_0x5ffb('0x2c'),new LocalStrategy({'usernameField':'name','passwordField':_0x5ffb('0xd')},function(_0x535d48,_0x225dbe,_0x4991f8){return localAuthenticate(db[_0x5ffb('0x36')],_0x535d48,_0x225dbe,_0x4991f8);}));
\ No newline at end of file
+var _0x47f3=['validatePasswordPattern','enforcePasswordHistory','previousPasswords','validatePasswordHistory','resetPasswordToken','resetPasswordExpires','use','util','Strategy','moment','../../components/auth/service','../../config/utils','http','Setting','findOne','allowedLoginAttempts','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','email','MailServerOut','Smtp','CloudProvider','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','getSmtpOptions','format','\x22%s\x22\x20<%s>','request','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','status','send','login','local-login','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate','body','trim','toLowerCase','User','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','https://','host','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','Reset\x20Email\x20sent!','token','securePassword','passwordHistoryLimit'];(function(_0x597f5d,_0x38b919){var _0x4f94f6=function(_0x43ef1c){while(--_0x43ef1c){_0x597f5d['push'](_0x597f5d['shift']());}};_0x4f94f6(++_0x38b919);}(_0x47f3,0xf4));var _0x347f=function(_0x413004,_0x1fd8a7){_0x413004=_0x413004-0x0;var _0x36328a=_0x47f3[_0x413004];return _0x36328a;};'use strict';var util=require(_0x347f('0x0'));var passport=require('passport');var LocalStrategy=require('passport-local')[_0x347f('0x1')];var jayson=require('jayson/promise');var _=require('lodash');var rs=require('randomstring');var moment=require(_0x347f('0x2'));var db=require('../../mysqldb')['db'];var authService=require(_0x347f('0x3'));var utils=require(_0x347f('0x4'));var client=jayson['client'][_0x347f('0x5')]({'port':0x232b});function localAuthenticate(_0x3b402c,_0xcc6d0a,_0x49dd8a,_0x3a5e9f){var _0x2d9433,_0x5543e8;return db[_0x347f('0x6')][_0x347f('0x7')]({'where':{'id':0x1},'attributes':[_0x347f('0x8'),'blockDuration'],'raw':!![]})[_0x347f('0x9')](function(_0x41b234){_0x2d9433=_0x41b234;return _0x3b402c[_0x347f('0x7')]({'attributes':['id',_0x347f('0xa'),_0x347f('0xb'),_0x347f('0xc'),_0x347f('0xd'),_0x347f('0xe'),_0x347f('0xf'),_0x347f('0x10'),_0x347f('0x11')],'where':{'name':_0xcc6d0a,'role':{'$or':[_0x347f('0x12'),_0x347f('0x13'),_0x347f('0x14')]}}});})['then'](function(_0x107185){if(!_0x107185||_0x107185&&_0x107185[_0x347f('0xa')]!==_0xcc6d0a){throw new Error(_0x347f('0x15'));}else{_0x5543e8=_0x107185;return _0x5543e8;}})[_0x347f('0x9')](function(){_0x5543e8[_0x347f('0x16')](_0x49dd8a,function(_0x2ca519,_0x10dc05){var _0x53f01a=_0x5543e8[_0x347f('0x11')]+0x1;if(_0x2ca519){return _0x3a5e9f(_0x2ca519);}else if(!_0x10dc05){if(_0x5543e8[_0x347f('0xe')]){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}else if(_0x2d9433[_0x347f('0x8')]>0x0){if(_0x5543e8[_0x347f('0xf')]){if(_0x2d9433[_0x347f('0x17')]>0x0){if(moment(_0x5543e8[_0x347f('0x10')])[_0x347f('0x18')](_0x2d9433['blockDuration'],_0x347f('0x19'))>moment()){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}else{return utils['clearBlockUser'](_0x5543e8,_0x53f01a,![],null)[_0x347f('0x9')](function(){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});});}}else{return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}}else{if(_0x53f01a>=_0x2d9433[_0x347f('0x8')]){return utils['clearBlockUser'](_0x5543e8,0x0,!![],moment())[_0x347f('0x9')](function(){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});});}else{return utils[_0x347f('0x1a')](_0x5543e8,_0x53f01a,![],null)['then'](function(){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});});}}}else{return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}}else{if(_0x5543e8['disabled']){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}else if(_0x2d9433[_0x347f('0x8')]>0x0){if(_0x5543e8[_0x347f('0xf')]){if(_0x2d9433[_0x347f('0x17')]>0x0){if(moment(_0x5543e8[_0x347f('0x10')])[_0x347f('0x18')](_0x2d9433[_0x347f('0x17')],_0x347f('0x19'))>moment()){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}else{return utils['clearBlockUser'](_0x5543e8,0x0,![],null)[_0x347f('0x9')](function(){return utils['getLicense'](_0x5543e8);})[_0x347f('0x9')](function(){return _0x3a5e9f(null,_0x5543e8);});}}else{return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}}else{return utils[_0x347f('0x1a')](_0x5543e8,0x0,![],null)[_0x347f('0x9')](function(){return utils[_0x347f('0x1b')](_0x5543e8);})['then'](function(){return _0x3a5e9f(null,_0x5543e8);})[_0x347f('0x1c')](function(_0x1e9d13){return _0x3a5e9f(null,![],_0x1e9d13);});}}else{if(_0x5543e8[_0x347f('0xf')]){return _0x3a5e9f(null,![],{'message':_0x347f('0x15')});}else{return utils['getLicense'](_0x5543e8)['then'](function(){return _0x3a5e9f(null,_0x5543e8);});}}}});})[_0x347f('0x1c')](function(_0x5ee1d4){return _0x3a5e9f(null,![],_0x5ee1d4);});}function sendServiceMail(_0x1ceb27){return db[_0x347f('0x1d')][_0x347f('0x1e')]({'where':{'service':!![]},'attributes':['id','name',_0x347f('0x1f')],'include':[{'model':db[_0x347f('0x20')],'as':_0x347f('0x21'),'include':[{'model':db['CloudProvider'],'as':_0x347f('0x22')}]}]})[_0x347f('0x9')](function(_0x58a0b0){if(!_0x58a0b0){throw new Error(_0x347f('0x23'));}var _0x497af8=_0x58a0b0[_0x347f('0x24')]();var _0x4dd1e4={'account':_0x497af8,'message':_['merge']({'from':util[_0x347f('0x25')](_0x347f('0x26'),_0x58a0b0[_0x347f('0xa')],_0x58a0b0[_0x347f('0x1f')]||_0x58a0b0['Smtp'][_0x347f('0x13')])},_0x1ceb27)};return client[_0x347f('0x27')](_0x347f('0x28'),_0x4dd1e4);})['then'](function(_0x50bc33){if(_0x50bc33['error']){throw new Error(util[_0x347f('0x25')](_0x347f('0x29'),_0x50bc33['error'][_0x347f('0x2a')]||JSON[_0x347f('0x2b')](_0x50bc33['error'])));}return!![];});}function handleError(_0x3525f5,_0x45c929,_0x4d81ee){return _0x3525f5[_0x347f('0x2c')](_0x45c929||0x1f4)[_0x347f('0x2d')]({'message':_0x4d81ee?_0x4d81ee[_0x347f('0x2a')]||_0x4d81ee:''});}exports[_0x347f('0x2e')]=function(_0x3a0954,_0x17a338,_0x103860){passport['authenticate'](_0x347f('0x2f'),function(_0x258af7,_0x4b71ab,_0x2b0ed2){var _0xa1cdcf=_0x258af7||_0x2b0ed2;if(_0xa1cdcf){return handleError(_0x17a338,0x191,_0xa1cdcf);}if(!_0x4b71ab){return handleError(_0x17a338,0x194,{'message':_0x347f('0x30')});}else{var _0x3daca0={'payload':{'id':_0x4b71ab['id'],'role':_0x4b71ab[_0x347f('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x347f('0x31')](_0x3daca0)[_0x347f('0x9')](function(_0xdd04af){_0x17a338[_0x347f('0x32')]({'id':_0x4b71ab['id'],'token':_0xdd04af,'statusCall':'','isAlreadyLogged':_0x4b71ab[_0x347f('0x33')]});});}})(_0x3a0954,_0x17a338,_0x103860);};exports[_0x347f('0x34')]=function(_0x7e9cfe,_0x393e1a){if(!_0x7e9cfe['body'][_0x347f('0x1f')]){return handleError(_0x393e1a,0x1f4,{'message':_0x347f('0x35')});}var _0x2d2f99=rs[_0x347f('0x36')]();_0x7e9cfe[_0x347f('0x37')][_0x347f('0x1f')]=_0x7e9cfe[_0x347f('0x37')][_0x347f('0x1f')][_0x347f('0x38')]()[_0x347f('0x39')]();var _0x46914b;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x347f('0x8'),_0x347f('0x17')],'raw':!![]})[_0x347f('0x9')](function(_0x1ddb25){_0x46914b=_0x1ddb25;return db[_0x347f('0x3a')]['find']({'where':{'email':_0x7e9cfe[_0x347f('0x37')][_0x347f('0x1f')]}});})[_0x347f('0x9')](function(_0x23ef4e){if(!_0x23ef4e){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x23ef4e['disabled']){throw new Error('The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.');}if(_0x23ef4e[_0x347f('0xf')]){if(moment(_0x23ef4e[_0x347f('0x10')])[_0x347f('0x18')](_0x46914b[_0x347f('0x17')],_0x347f('0x19'))>moment()){throw new Error(_0x347f('0x3b'));}else{_0x23ef4e[_0x347f('0xf')]=![];_0x23ef4e['blockedAt']=null;}}_0x23ef4e['resetPasswordToken']=_0x2d2f99;_0x23ef4e['resetPasswordExpires']=Date[_0x347f('0x3c')]()+0x36ee80;return _0x23ef4e[_0x347f('0x3d')]();})[_0x347f('0x9')](function(){return sendServiceMail({'to':_0x7e9cfe[_0x347f('0x37')][_0x347f('0x1f')],'subject':_0x347f('0x3e'),'text':_0x347f('0x3f')+_0x347f('0x40')+_0x347f('0x41')+_0x7e9cfe['headers'][_0x347f('0x42')]+'/reset/'+_0x2d2f99+'\x0a\x0a'+_0x347f('0x43')});})[_0x347f('0x9')](function(){_0x393e1a[_0x347f('0x2c')](0xc8)[_0x347f('0x2d')]({'message':_0x347f('0x44')});})[_0x347f('0x1c')](function(_0x3c5109){return handleError(_0x393e1a,0x1f4,_0x3c5109);});};exports['reset']=function(_0x96410f,_0x5dd4f5){return db[_0x347f('0x3a')]['find']({'where':{'resetPasswordToken':_0x96410f['params'][_0x347f('0x45')],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x347f('0x9')](function(_0x5b55e2){if(!_0x5b55e2){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db[_0x347f('0x6')][_0x347f('0x7')]({'attributes':['id',_0x347f('0x46'),'enforcePasswordHistory',_0x347f('0x47')]})['then'](function(_0x18fe9a){if(_0x18fe9a[_0x347f('0x46')])authService[_0x347f('0x48')](_0x96410f[_0x347f('0x37')][_0x347f('0xb')]);if(!_0x18fe9a[_0x347f('0x49')]||!_0x5b55e2[_0x347f('0x4a')])return _0x5b55e2;authService[_0x347f('0x4b')](_0x96410f[_0x347f('0x37')][_0x347f('0xb')],_0x5b55e2['previousPasswords'],_0x18fe9a[_0x347f('0x47')]);return _0x5b55e2;})[_0x347f('0x9')](function(){_0x5b55e2['password']=_0x96410f['body'][_0x347f('0xb')];_0x5b55e2[_0x347f('0x4c')]=null;_0x5b55e2[_0x347f('0x4d')]=null;return _0x5b55e2[_0x347f('0x3d')]();});})['then'](function(){_0x5dd4f5[_0x347f('0x2c')](0xc8)[_0x347f('0x2d')]({'message':'Password\x20reset!'});})[_0x347f('0x1c')](function(_0x56d0d3){return handleError(_0x5dd4f5,0x1f4,_0x56d0d3);});};passport[_0x347f('0x4e')](_0x347f('0x2f'),new LocalStrategy({'usernameField':_0x347f('0xa'),'passwordField':'password'},function(_0x1021c0,_0x3b3794,_0x40765f){return localAuthenticate(db[_0x347f('0x3a')],_0x1021c0,_0x3b3794,_0x40765f);}));
\ No newline at end of file
diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js
index 2ff13b6..2e466cb 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 _0x6ebf=['./authLocal.controller','post','login','/forgot','/reset/:token','reset','exports','Router'];(function(_0x259e1b,_0x75e844){var _0x2bb2e3=function(_0x369ce7){while(--_0x369ce7){_0x259e1b['push'](_0x259e1b['shift']());}};_0x2bb2e3(++_0x75e844);}(_0x6ebf,0x10f));var _0xf6eb=function(_0x5b6cf1,_0x32fdcd){_0x5b6cf1=_0x5b6cf1-0x0;var _0x46278c=_0x6ebf[_0x5b6cf1];return _0x46278c;};'use strict';var express=require('express');var router=express[_0xf6eb('0x0')]();var controller=require(_0xf6eb('0x1'));router[_0xf6eb('0x2')]('/',controller[_0xf6eb('0x3')]);router['post'](_0xf6eb('0x4'),controller['forgot']);router['post'](_0xf6eb('0x5'),controller[_0xf6eb('0x6')]);module[_0xf6eb('0x7')]=router;
\ No newline at end of file
+var _0x7999=['login','/forgot','forgot','/reset/:token','reset','exports','express','Router','./authLocal.controller','post'];(function(_0x47c9fc,_0x476d34){var _0x5909dc=function(_0x207b6b){while(--_0x207b6b){_0x47c9fc['push'](_0x47c9fc['shift']());}};_0x5909dc(++_0x476d34);}(_0x7999,0x1e6));var _0x9799=function(_0x35036f,_0x5dc350){_0x35036f=_0x35036f-0x0;var _0x1d4fb1=_0x7999[_0x35036f];return _0x1d4fb1;};'use strict';var express=require(_0x9799('0x0'));var router=express[_0x9799('0x1')]();var controller=require(_0x9799('0x2'));router[_0x9799('0x3')]('/',controller[_0x9799('0x4')]);router[_0x9799('0x3')](_0x9799('0x5'),controller[_0x9799('0x6')]);router['post'](_0x9799('0x7'),controller[_0x9799('0x8')]);module[_0x9799('0x9')]=router;
\ No newline at end of file
diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js
index 2dda5b5..950d90c 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 _0x7b40=['exports','STRING','BOOLEAN','INTEGER'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7b40,0x118));var _0x07b4=function(_0x58f606,_0x442520){_0x58f606=_0x58f606-0x0;var _0x3b2bc7=_0x7b40[_0x58f606];return _0x3b2bc7;};'use strict';var Sequelize=require('sequelize');module[_0x07b4('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x07b4('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x07b4('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x07b4('0x3')],'defaultValue':0xa}};
\ No newline at end of file
+var _0x22be=['INTEGER','sequelize','exports','STRING','BOOLEAN'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x22be,0x1b4));var _0xe22b=function(_0x301c34,_0x15701e){_0x301c34=_0x301c34-0x0;var _0x1a8c5a=_0x22be[_0x301c34];return _0x1a8c5a;};'use strict';var Sequelize=require(_0xe22b('0x0'));module[_0xe22b('0x1')]={'name':{'type':Sequelize[_0xe22b('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0xe22b('0x2')]},'description':{'type':Sequelize[_0xe22b('0x2')]},'status':{'type':Sequelize[_0xe22b('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0xe22b('0x4')],'defaultValue':0xa}};
\ No newline at end of file
diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js
index c8c1642..41f3d64 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 _0xedce=['undefined','limit','count','apply','reject','save','update','destroy','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','Automation','includeAll','include','findAll','rows','catch','show','params','find','create','body','addConditions','ids','omit','getConditions','findOne','Condition','addActions','Action','getActions','pick','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xedce,0x8a));var _0xeedc=function(_0x124096,_0xbb4341){_0x124096=_0x124096-0x0;var _0x123aed=_0xedce[_0x124096];return _0x123aed;};'use strict';var emlformat=require(_0xeedc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeedc('0x1'));var jsonpatch=require(_0xeedc('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xeedc('0x3'));var Mustache=require(_0xeedc('0x4'));var util=require(_0xeedc('0x5'));var path=require('path');var sox=require(_0xeedc('0x6'));var csv=require(_0xeedc('0x7'));var ejs=require(_0xeedc('0x8'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xeedc('0x9'));var squel=require('squel');var crypto=require(_0xeedc('0xa'));var jsforce=require(_0xeedc('0xb'));var deskjs=require(_0xeedc('0xc'));var toCsv=require(_0xeedc('0x7'));var querystring=require(_0xeedc('0xd'));var Papa=require(_0xeedc('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xeedc('0xf'));var as=require(_0xeedc('0x10'));var hardwareService=require(_0xeedc('0x11'));var logger=require(_0xeedc('0x12'))(_0xeedc('0x13'));var utils=require(_0xeedc('0x14'));var config=require(_0xeedc('0x15'));var licenseUtil=require('../../config/license/util');var db=require(_0xeedc('0x16'))['db'];function respondWithStatusCode(_0x3c73bb,_0x499290){_0x499290=_0x499290||0xcc;return function(_0x5acaea){if(_0x5acaea){return _0x3c73bb[_0xeedc('0x17')](_0x499290);}return _0x3c73bb[_0xeedc('0x18')](_0x499290)[_0xeedc('0x19')]();};}function respondWithResult(_0x143ca2,_0x2c4f10){_0x2c4f10=_0x2c4f10||0xc8;return function(_0x595984){if(_0x595984){return _0x143ca2[_0xeedc('0x18')](_0x2c4f10)[_0xeedc('0x1a')](_0x595984);}};}function respondWithFilteredResult(_0x37c3da,_0x4e9fcc){return function(_0x2396d5){if(_0x2396d5){var _0x56bda3=typeof _0x4e9fcc[_0xeedc('0x1b')]===_0xeedc('0x1c')&&typeof _0x4e9fcc[_0xeedc('0x1d')]===_0xeedc('0x1c');var _0x4fa0b8=_0x2396d5['count'];var _0x24dab9=_0x56bda3?0x0:_0x4e9fcc[_0xeedc('0x1b')];var _0x471733=_0x56bda3?_0x2396d5[_0xeedc('0x1e')]:_0x4e9fcc['offset']+_0x4e9fcc[_0xeedc('0x1d')];var _0x975cd;if(_0x471733>=_0x4fa0b8){_0x471733=_0x4fa0b8;_0x975cd=0xc8;}else{_0x975cd=0xce;}_0x37c3da[_0xeedc('0x18')](_0x975cd);return _0x37c3da['set']('Content-Range',_0x24dab9+'-'+_0x471733+'/'+_0x4fa0b8)[_0xeedc('0x1a')](_0x2396d5);}return null;};}function patchUpdates(_0x455343){return function(_0x4af127){try{jsonpatch[_0xeedc('0x1f')](_0x4af127,_0x455343,!![]);}catch(_0x5ccbd9){return BPromise[_0xeedc('0x20')](_0x5ccbd9);}return _0x4af127[_0xeedc('0x21')]();};}function saveUpdates(_0x418f4b,_0xd2571d){return function(_0x304ac8){if(_0x304ac8){return _0x304ac8[_0xeedc('0x22')](_0x418f4b)['then'](function(_0x58af43){return _0x58af43;});}return null;};}function removeEntity(_0x4e442d,_0x8d767b){return function(_0x3025f5){if(_0x3025f5){return _0x3025f5[_0xeedc('0x23')]()[_0xeedc('0x24')](function(){_0x4e442d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xebb551,_0x17094a){return function(_0x2c90c7){if(!_0x2c90c7){_0xebb551['sendStatus'](0x194);}return _0x2c90c7;};}function handleError(_0x4e495c,_0x1affed){_0x1affed=_0x1affed||0x1f4;return function(_0x4a58dc){logger[_0xeedc('0x25')](_0x4a58dc['stack']);if(_0x4a58dc[_0xeedc('0x26')]){delete _0x4a58dc[_0xeedc('0x26')];}_0x4e495c[_0xeedc('0x18')](_0x1affed)[_0xeedc('0x27')](_0x4a58dc);};}exports[_0xeedc('0x28')]=function(_0x24f955,_0x48289e){var _0x2d551e={},_0x53d4a6={},_0xf27dbc={'count':0x0,'rows':[]};var _0x4ea8d4=_[_0xeedc('0x29')](db['Automation'][_0xeedc('0x2a')],function(_0x95250d){return{'name':_0x95250d[_0xeedc('0x2b')],'type':_0x95250d[_0xeedc('0x2c')][_0xeedc('0x2d')]};});_0x53d4a6[_0xeedc('0x2e')]=_['map'](_0x4ea8d4,_0xeedc('0x26'));_0x53d4a6[_0xeedc('0x2f')]=_[_0xeedc('0x30')](_0x24f955[_0xeedc('0x2f')]);_0x53d4a6[_0xeedc('0x31')]=_[_0xeedc('0x32')](_0x53d4a6['model'],_0x53d4a6[_0xeedc('0x2f')]);_0x2d551e[_0xeedc('0x33')]=_[_0xeedc('0x32')](_0x53d4a6[_0xeedc('0x2e')],qs['fields'](_0x24f955[_0xeedc('0x2f')][_0xeedc('0x34')]));_0x2d551e[_0xeedc('0x33')]=_0x2d551e[_0xeedc('0x33')][_0xeedc('0x35')]?_0x2d551e[_0xeedc('0x33')]:_0x53d4a6['model'];if(!_0x24f955[_0xeedc('0x2f')][_0xeedc('0x36')](_0xeedc('0x37'))){_0x2d551e['limit']=qs[_0xeedc('0x1d')](_0x24f955[_0xeedc('0x2f')][_0xeedc('0x1d')]);_0x2d551e['offset']=qs[_0xeedc('0x1b')](_0x24f955[_0xeedc('0x2f')]['offset']);}_0x2d551e[_0xeedc('0x38')]=qs['sort'](_0x24f955['query'][_0xeedc('0x39')]);_0x2d551e[_0xeedc('0x3a')]=qs[_0xeedc('0x31')](_['pick'](_0x24f955[_0xeedc('0x2f')],_0x53d4a6[_0xeedc('0x31')]),_0x4ea8d4);if(_0x24f955[_0xeedc('0x2f')]['filter']){_0x2d551e[_0xeedc('0x3a')]=_['merge'](_0x2d551e[_0xeedc('0x3a')],{'$or':_['map'](_0x4ea8d4,function(_0x235d1d){if(_0x235d1d[_0xeedc('0x2c')]!=='VIRTUAL'){var _0x4a7201={};_0x4a7201[_0x235d1d['name']]={'$like':'%'+_0x24f955[_0xeedc('0x2f')][_0xeedc('0x3b')]+'%'};return _0x4a7201;}})});}_0x2d551e=_[_0xeedc('0x3c')]({},_0x2d551e,_0x24f955[_0xeedc('0x3d')]);var _0x5f5c65={'where':_0x2d551e[_0xeedc('0x3a')]};return db[_0xeedc('0x3e')][_0xeedc('0x1e')](_0x5f5c65)[_0xeedc('0x24')](function(_0x55c52d){_0xf27dbc['count']=_0x55c52d;if(_0x24f955[_0xeedc('0x2f')][_0xeedc('0x3f')]){_0x2d551e[_0xeedc('0x40')]=[{'all':!![]}];}return db['Automation'][_0xeedc('0x41')](_0x2d551e);})[_0xeedc('0x24')](function(_0xa85cad){_0xf27dbc[_0xeedc('0x42')]=_0xa85cad;return _0xf27dbc;})[_0xeedc('0x24')](respondWithFilteredResult(_0x48289e,_0x2d551e))[_0xeedc('0x43')](handleError(_0x48289e,null));};exports[_0xeedc('0x44')]=function(_0x58ee4d,_0x2127cd){var _0x3567ed={'raw':![],'where':{'id':_0x58ee4d[_0xeedc('0x45')]['id']}},_0x29ff51={};_0x29ff51[_0xeedc('0x2e')]=_[_0xeedc('0x30')](db[_0xeedc('0x3e')][_0xeedc('0x2a')]);_0x29ff51[_0xeedc('0x2f')]=_[_0xeedc('0x30')](_0x58ee4d['query']);_0x29ff51[_0xeedc('0x31')]=_[_0xeedc('0x32')](_0x29ff51[_0xeedc('0x2e')],_0x29ff51[_0xeedc('0x2f')]);_0x3567ed[_0xeedc('0x33')]=_[_0xeedc('0x32')](_0x29ff51[_0xeedc('0x2e')],qs[_0xeedc('0x34')](_0x58ee4d[_0xeedc('0x2f')][_0xeedc('0x34')]));_0x3567ed[_0xeedc('0x33')]=_0x3567ed['attributes'][_0xeedc('0x35')]?_0x3567ed[_0xeedc('0x33')]:_0x29ff51[_0xeedc('0x2e')];if(_0x58ee4d['query'][_0xeedc('0x3f')]){_0x3567ed[_0xeedc('0x40')]=[{'all':!![]}];}_0x3567ed=_[_0xeedc('0x3c')]({},_0x3567ed,_0x58ee4d[_0xeedc('0x3d')]);return db[_0xeedc('0x3e')][_0xeedc('0x46')](_0x3567ed)[_0xeedc('0x24')](handleEntityNotFound(_0x2127cd,null))[_0xeedc('0x24')](respondWithResult(_0x2127cd,null))[_0xeedc('0x43')](handleError(_0x2127cd,null));};exports[_0xeedc('0x47')]=function(_0x4dfdb1,_0x29fde2){return db[_0xeedc('0x3e')][_0xeedc('0x47')](_0x4dfdb1[_0xeedc('0x48')],{})['then'](respondWithResult(_0x29fde2,0xc9))['catch'](handleError(_0x29fde2,null));};exports[_0xeedc('0x22')]=function(_0x3fbe36,_0x1fd90f){if(_0x3fbe36['body']['id']){delete _0x3fbe36[_0xeedc('0x48')]['id'];}return db['Automation'][_0xeedc('0x46')]({'where':{'id':_0x3fbe36[_0xeedc('0x45')]['id']}})['then'](handleEntityNotFound(_0x1fd90f,null))[_0xeedc('0x24')](saveUpdates(_0x3fbe36[_0xeedc('0x48')],null))[_0xeedc('0x24')](respondWithResult(_0x1fd90f,null))[_0xeedc('0x43')](handleError(_0x1fd90f,null));};exports[_0xeedc('0x23')]=function(_0x18a341,_0x369ffc){return db[_0xeedc('0x3e')][_0xeedc('0x46')]({'where':{'id':_0x18a341[_0xeedc('0x45')]['id']}})[_0xeedc('0x24')](handleEntityNotFound(_0x369ffc,null))[_0xeedc('0x24')](removeEntity(_0x369ffc,null))[_0xeedc('0x43')](handleError(_0x369ffc,null));};exports[_0xeedc('0x49')]=function(_0xa6c205,_0xf80708,_0x5d224f){return db['Condition'][_0xeedc('0x46')]({'where':{'id':_0xa6c205[_0xeedc('0x45')]['id']}})[_0xeedc('0x24')](handleEntityNotFound(_0xf80708,null))[_0xeedc('0x24')](function(_0x233a99){if(_0x233a99){return _0x233a99[_0xeedc('0x49')](_0xa6c205[_0xeedc('0x48')][_0xeedc('0x4a')],_[_0xeedc('0x4b')](_0xa6c205[_0xeedc('0x48')],[_0xeedc('0x4a'),'id'])||{});}})['then'](respondWithResult(_0xf80708,null))[_0xeedc('0x43')](handleError(_0xf80708,null));};exports[_0xeedc('0x4c')]=function(_0x4ae1ad,_0x2cd8ad,_0x4cd3a0){var _0x1d435d={};var _0x14eeff={};var _0x553e76;var _0x1e2434;return db['Automation'][_0xeedc('0x4d')]({'where':{'id':_0x4ae1ad[_0xeedc('0x45')]['id']}})[_0xeedc('0x24')](handleEntityNotFound(_0x2cd8ad,null))[_0xeedc('0x24')](function(_0x4fe31f){if(_0x4fe31f){_0x553e76=_0x4fe31f;_0x14eeff['model']=_[_0xeedc('0x30')](db[_0xeedc('0x4e')][_0xeedc('0x2a')]);_0x14eeff[_0xeedc('0x2f')]=_[_0xeedc('0x30')](_0x4ae1ad['query']);_0x14eeff[_0xeedc('0x31')]=_[_0xeedc('0x32')](_0x14eeff[_0xeedc('0x2e')],_0x14eeff[_0xeedc('0x2f')]);_0x1d435d[_0xeedc('0x33')]=_[_0xeedc('0x32')](_0x14eeff[_0xeedc('0x2e')],qs[_0xeedc('0x34')](_0x4ae1ad[_0xeedc('0x2f')]['fields']));_0x1d435d[_0xeedc('0x33')]=_0x1d435d[_0xeedc('0x33')][_0xeedc('0x35')]?_0x1d435d[_0xeedc('0x33')]:_0x14eeff[_0xeedc('0x2e')];_0x1d435d[_0xeedc('0x38')]=qs['sort'](_0x4ae1ad['query'][_0xeedc('0x39')]);_0x1d435d['where']=qs[_0xeedc('0x31')](_['pick'](_0x4ae1ad[_0xeedc('0x2f')],_0x14eeff[_0xeedc('0x31')]));if(_0x4ae1ad['query'][_0xeedc('0x3b')]){_0x1d435d['where']=_[_0xeedc('0x3c')](_0x1d435d['where'],{'$or':_[_0xeedc('0x29')](_0x1d435d[_0xeedc('0x33')],function(_0x381622){var _0x13bbb4={};_0x13bbb4[_0x381622]={'$like':'%'+_0x4ae1ad[_0xeedc('0x2f')][_0xeedc('0x3b')]+'%'};return _0x13bbb4;})});}_0x1d435d=_['merge']({},_0x1d435d,_0x4ae1ad['options']);return _0x553e76['getConditions'](_0x1d435d);}})[_0xeedc('0x24')](function(_0x1136b2){if(_0x1136b2){_0x1e2434=_0x1136b2['length'];if(!_0x4ae1ad[_0xeedc('0x2f')][_0xeedc('0x36')]('nolimit')){_0x1d435d['limit']=qs[_0xeedc('0x1d')](_0x4ae1ad[_0xeedc('0x2f')]['limit']);_0x1d435d[_0xeedc('0x1b')]=qs[_0xeedc('0x1b')](_0x4ae1ad['query']['offset']);}return _0x553e76[_0xeedc('0x4c')](_0x1d435d);}})['then'](function(_0x214d43){if(_0x214d43){return _0x214d43?{'count':_0x1e2434,'rows':_0x214d43}:null;}})['then'](respondWithResult(_0x2cd8ad,null))[_0xeedc('0x43')](handleError(_0x2cd8ad,null));};exports[_0xeedc('0x4f')]=function(_0x559dba,_0xd6f4a7,_0x8d0029){return db[_0xeedc('0x50')][_0xeedc('0x46')]({'where':{'id':_0x559dba[_0xeedc('0x45')]['id']}})[_0xeedc('0x24')](handleEntityNotFound(_0xd6f4a7,null))['then'](function(_0x3efaa8){if(_0x3efaa8){return _0x3efaa8['addActions'](_0x559dba[_0xeedc('0x48')][_0xeedc('0x4a')],_[_0xeedc('0x4b')](_0x559dba['body'],[_0xeedc('0x4a'),'id'])||{});}})['then'](respondWithResult(_0xd6f4a7,null))[_0xeedc('0x43')](handleError(_0xd6f4a7,null));};exports[_0xeedc('0x51')]=function(_0x303877,_0x34289d,_0x5b6a8a){var _0x2e597f={};var _0x42e157={};var _0x1493ae;var _0x16826d;return db['Automation'][_0xeedc('0x4d')]({'where':{'id':_0x303877[_0xeedc('0x45')]['id']}})[_0xeedc('0x24')](handleEntityNotFound(_0x34289d,null))[_0xeedc('0x24')](function(_0x1eff55){if(_0x1eff55){_0x1493ae=_0x1eff55;_0x42e157[_0xeedc('0x2e')]=_[_0xeedc('0x30')](db['Action'][_0xeedc('0x2a')]);_0x42e157[_0xeedc('0x2f')]=_[_0xeedc('0x30')](_0x303877[_0xeedc('0x2f')]);_0x42e157[_0xeedc('0x31')]=_[_0xeedc('0x32')](_0x42e157['model'],_0x42e157['query']);_0x2e597f[_0xeedc('0x33')]=_[_0xeedc('0x32')](_0x42e157[_0xeedc('0x2e')],qs[_0xeedc('0x34')](_0x303877['query'][_0xeedc('0x34')]));_0x2e597f[_0xeedc('0x33')]=_0x2e597f[_0xeedc('0x33')][_0xeedc('0x35')]?_0x2e597f[_0xeedc('0x33')]:_0x42e157['model'];_0x2e597f['order']=qs[_0xeedc('0x39')](_0x303877[_0xeedc('0x2f')][_0xeedc('0x39')]);_0x2e597f['where']=qs['filters'](_[_0xeedc('0x52')](_0x303877['query'],_0x42e157['filters']));if(_0x303877[_0xeedc('0x2f')][_0xeedc('0x3b')]){_0x2e597f[_0xeedc('0x3a')]=_[_0xeedc('0x3c')](_0x2e597f[_0xeedc('0x3a')],{'$or':_[_0xeedc('0x29')](_0x2e597f[_0xeedc('0x33')],function(_0x49a339){var _0xf473a5={};_0xf473a5[_0x49a339]={'$like':'%'+_0x303877['query'][_0xeedc('0x3b')]+'%'};return _0xf473a5;})});}_0x2e597f=_[_0xeedc('0x3c')]({},_0x2e597f,_0x303877[_0xeedc('0x3d')]);return _0x1493ae[_0xeedc('0x51')](_0x2e597f);}})[_0xeedc('0x24')](function(_0x2d2faa){if(_0x2d2faa){_0x16826d=_0x2d2faa['length'];if(!_0x303877[_0xeedc('0x2f')][_0xeedc('0x36')](_0xeedc('0x37'))){_0x2e597f['limit']=qs[_0xeedc('0x1d')](_0x303877[_0xeedc('0x2f')][_0xeedc('0x1d')]);_0x2e597f[_0xeedc('0x1b')]=qs[_0xeedc('0x1b')](_0x303877[_0xeedc('0x2f')][_0xeedc('0x1b')]);}return _0x1493ae[_0xeedc('0x51')](_0x2e597f);}})[_0xeedc('0x24')](function(_0x1afbf8){if(_0x1afbf8){return _0x1afbf8?{'count':_0x16826d,'rows':_0x1afbf8}:null;}})[_0xeedc('0x24')](respondWithResult(_0x34289d,null))[_0xeedc('0x43')](handleError(_0x34289d,null));};
\ No newline at end of file
+var _0x87d1=['mustache','fs-extra','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','merge','filter','options','include','findAll','rows','catch','show','params','keys','find','body','addConditions','Condition','ids','nolimit','addActions','omit','findOne','Action','getActions','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x3d5037,_0x50df6a){var _0x1ff849=function(_0x398fea){while(--_0x398fea){_0x3d5037['push'](_0x3d5037['shift']());}};_0x1ff849(++_0x50df6a);}(_0x87d1,0x95));var _0x187d=function(_0x14f773,_0x4c09c7){_0x14f773=_0x14f773-0x0;var _0x2a8be9=_0x87d1[_0x14f773];return _0x2a8be9;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x187d('0x0'));var jsonpatch=require(_0x187d('0x1'));var rp=require(_0x187d('0x2'));var moment=require(_0x187d('0x3'));var BPromise=require(_0x187d('0x4'));var Mustache=require(_0x187d('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x187d('0x6'));var _=require(_0x187d('0x7'));var squel=require(_0x187d('0x8'));var crypto=require('crypto');var jsforce=require(_0x187d('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x187d('0xa'));var Redis=require(_0x187d('0xb'));var authService=require(_0x187d('0xc'));var qs=require(_0x187d('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x187d('0xe'));var logger=require(_0x187d('0xf'))(_0x187d('0x10'));var utils=require(_0x187d('0x11'));var config=require(_0x187d('0x12'));var licenseUtil=require(_0x187d('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2a28e6,_0x5265d9){_0x5265d9=_0x5265d9||0xcc;return function(_0x451825){if(_0x451825){return _0x2a28e6['sendStatus'](_0x5265d9);}return _0x2a28e6[_0x187d('0x14')](_0x5265d9)[_0x187d('0x15')]();};}function respondWithResult(_0x115039,_0xa1cfd8){_0xa1cfd8=_0xa1cfd8||0xc8;return function(_0x15d667){if(_0x15d667){return _0x115039[_0x187d('0x14')](_0xa1cfd8)['json'](_0x15d667);}};}function respondWithFilteredResult(_0x430124,_0x42e709){return function(_0x1c93d2){if(_0x1c93d2){var _0x55bbb9=typeof _0x42e709[_0x187d('0x16')]===_0x187d('0x17')&&typeof _0x42e709[_0x187d('0x18')]===_0x187d('0x17');var _0x4c8ba5=_0x1c93d2['count'];var _0x51f0f9=_0x55bbb9?0x0:_0x42e709['offset'];var _0x1325f7=_0x55bbb9?_0x1c93d2[_0x187d('0x19')]:_0x42e709[_0x187d('0x16')]+_0x42e709[_0x187d('0x18')];var _0x352ebd;if(_0x1325f7>=_0x4c8ba5){_0x1325f7=_0x4c8ba5;_0x352ebd=0xc8;}else{_0x352ebd=0xce;}_0x430124[_0x187d('0x14')](_0x352ebd);return _0x430124[_0x187d('0x1a')](_0x187d('0x1b'),_0x51f0f9+'-'+_0x1325f7+'/'+_0x4c8ba5)[_0x187d('0x1c')](_0x1c93d2);}return null;};}function patchUpdates(_0x1fd077){return function(_0x105fec){try{jsonpatch[_0x187d('0x1d')](_0x105fec,_0x1fd077,!![]);}catch(_0x1b1856){return BPromise['reject'](_0x1b1856);}return _0x105fec[_0x187d('0x1e')]();};}function saveUpdates(_0x1a7529,_0x22b6d0){return function(_0x5073dc){if(_0x5073dc){return _0x5073dc[_0x187d('0x1f')](_0x1a7529)[_0x187d('0x20')](function(_0x2d8d1b){return _0x2d8d1b;});}return null;};}function removeEntity(_0x456856,_0x4f3978){return function(_0x5b0a1b){if(_0x5b0a1b){return _0x5b0a1b[_0x187d('0x21')]()['then'](function(){_0x456856[_0x187d('0x14')](0xcc)[_0x187d('0x15')]();});}};}function handleEntityNotFound(_0x6ef3b5,_0x57474e){return function(_0x5ab687){if(!_0x5ab687){_0x6ef3b5[_0x187d('0x22')](0x194);}return _0x5ab687;};}function handleError(_0x1bf39c,_0x921862){_0x921862=_0x921862||0x1f4;return function(_0x1e0efb){logger['error'](_0x1e0efb[_0x187d('0x23')]);if(_0x1e0efb[_0x187d('0x24')]){delete _0x1e0efb[_0x187d('0x24')];}_0x1bf39c[_0x187d('0x14')](_0x921862)['send'](_0x1e0efb);};}exports[_0x187d('0x25')]=function(_0x35fdaa,_0x4771fc){var _0x1de97b={},_0x454fe7={},_0x8cb797={'count':0x0,'rows':[]};var _0x53784d=_[_0x187d('0x26')](db[_0x187d('0x27')][_0x187d('0x28')],function(_0x51575e){return{'name':_0x51575e[_0x187d('0x29')],'type':_0x51575e[_0x187d('0x2a')][_0x187d('0x2b')]};});_0x454fe7[_0x187d('0x2c')]=_[_0x187d('0x26')](_0x53784d,'name');_0x454fe7['query']=_['keys'](_0x35fdaa['query']);_0x454fe7[_0x187d('0x2d')]=_['intersection'](_0x454fe7[_0x187d('0x2c')],_0x454fe7[_0x187d('0x2e')]);_0x1de97b[_0x187d('0x2f')]=_[_0x187d('0x30')](_0x454fe7[_0x187d('0x2c')],qs[_0x187d('0x31')](_0x35fdaa['query'][_0x187d('0x31')]));_0x1de97b[_0x187d('0x2f')]=_0x1de97b[_0x187d('0x2f')][_0x187d('0x32')]?_0x1de97b[_0x187d('0x2f')]:_0x454fe7[_0x187d('0x2c')];if(!_0x35fdaa[_0x187d('0x2e')][_0x187d('0x33')]('nolimit')){_0x1de97b[_0x187d('0x18')]=qs[_0x187d('0x18')](_0x35fdaa[_0x187d('0x2e')][_0x187d('0x18')]);_0x1de97b[_0x187d('0x16')]=qs[_0x187d('0x16')](_0x35fdaa[_0x187d('0x2e')][_0x187d('0x16')]);}_0x1de97b[_0x187d('0x34')]=qs['sort'](_0x35fdaa[_0x187d('0x2e')][_0x187d('0x35')]);_0x1de97b[_0x187d('0x36')]=qs[_0x187d('0x2d')](_[_0x187d('0x37')](_0x35fdaa[_0x187d('0x2e')],_0x454fe7['filters']),_0x53784d);if(_0x35fdaa[_0x187d('0x2e')]['filter']){_0x1de97b[_0x187d('0x36')]=_[_0x187d('0x38')](_0x1de97b[_0x187d('0x36')],{'$or':_[_0x187d('0x26')](_0x53784d,function(_0x5cefde){if(_0x5cefde[_0x187d('0x2a')]!=='VIRTUAL'){var _0x4deccf={};_0x4deccf[_0x5cefde[_0x187d('0x24')]]={'$like':'%'+_0x35fdaa[_0x187d('0x2e')][_0x187d('0x39')]+'%'};return _0x4deccf;}})});}_0x1de97b=_['merge']({},_0x1de97b,_0x35fdaa[_0x187d('0x3a')]);var _0x58f2eb={'where':_0x1de97b[_0x187d('0x36')]};return db[_0x187d('0x27')][_0x187d('0x19')](_0x58f2eb)['then'](function(_0x5c4453){_0x8cb797[_0x187d('0x19')]=_0x5c4453;if(_0x35fdaa['query']['includeAll']){_0x1de97b[_0x187d('0x3b')]=[{'all':!![]}];}return db[_0x187d('0x27')][_0x187d('0x3c')](_0x1de97b);})[_0x187d('0x20')](function(_0x4c0712){_0x8cb797[_0x187d('0x3d')]=_0x4c0712;return _0x8cb797;})[_0x187d('0x20')](respondWithFilteredResult(_0x4771fc,_0x1de97b))[_0x187d('0x3e')](handleError(_0x4771fc,null));};exports[_0x187d('0x3f')]=function(_0x274e33,_0x39faae){var _0x4df1c2={'raw':![],'where':{'id':_0x274e33[_0x187d('0x40')]['id']}},_0x47dad9={};_0x47dad9[_0x187d('0x2c')]=_[_0x187d('0x41')](db[_0x187d('0x27')][_0x187d('0x28')]);_0x47dad9[_0x187d('0x2e')]=_[_0x187d('0x41')](_0x274e33[_0x187d('0x2e')]);_0x47dad9[_0x187d('0x2d')]=_['intersection'](_0x47dad9[_0x187d('0x2c')],_0x47dad9[_0x187d('0x2e')]);_0x4df1c2[_0x187d('0x2f')]=_[_0x187d('0x30')](_0x47dad9[_0x187d('0x2c')],qs[_0x187d('0x31')](_0x274e33['query']['fields']));_0x4df1c2[_0x187d('0x2f')]=_0x4df1c2['attributes'][_0x187d('0x32')]?_0x4df1c2[_0x187d('0x2f')]:_0x47dad9[_0x187d('0x2c')];if(_0x274e33[_0x187d('0x2e')]['includeAll']){_0x4df1c2[_0x187d('0x3b')]=[{'all':!![]}];}_0x4df1c2=_[_0x187d('0x38')]({},_0x4df1c2,_0x274e33['options']);return db[_0x187d('0x27')][_0x187d('0x42')](_0x4df1c2)['then'](handleEntityNotFound(_0x39faae,null))[_0x187d('0x20')](respondWithResult(_0x39faae,null))['catch'](handleError(_0x39faae,null));};exports['create']=function(_0x4934d3,_0x2f897b){return db[_0x187d('0x27')]['create'](_0x4934d3['body'],{})[_0x187d('0x20')](respondWithResult(_0x2f897b,0xc9))[_0x187d('0x3e')](handleError(_0x2f897b,null));};exports['update']=function(_0x541317,_0x46225a){if(_0x541317['body']['id']){delete _0x541317[_0x187d('0x43')]['id'];}return db[_0x187d('0x27')][_0x187d('0x42')]({'where':{'id':_0x541317[_0x187d('0x40')]['id']}})[_0x187d('0x20')](handleEntityNotFound(_0x46225a,null))[_0x187d('0x20')](saveUpdates(_0x541317[_0x187d('0x43')],null))[_0x187d('0x20')](respondWithResult(_0x46225a,null))[_0x187d('0x3e')](handleError(_0x46225a,null));};exports[_0x187d('0x21')]=function(_0x3a64d8,_0x7f3680){return db[_0x187d('0x27')]['find']({'where':{'id':_0x3a64d8[_0x187d('0x40')]['id']}})['then'](handleEntityNotFound(_0x7f3680,null))['then'](removeEntity(_0x7f3680,null))[_0x187d('0x3e')](handleError(_0x7f3680,null));};exports[_0x187d('0x44')]=function(_0x50f517,_0x587f2d,_0x14aec4){return db[_0x187d('0x45')][_0x187d('0x42')]({'where':{'id':_0x50f517[_0x187d('0x40')]['id']}})['then'](handleEntityNotFound(_0x587f2d,null))['then'](function(_0xbb491a){if(_0xbb491a){return _0xbb491a[_0x187d('0x44')](_0x50f517[_0x187d('0x43')][_0x187d('0x46')],_['omit'](_0x50f517['body'],[_0x187d('0x46'),'id'])||{});}})[_0x187d('0x20')](respondWithResult(_0x587f2d,null))[_0x187d('0x3e')](handleError(_0x587f2d,null));};exports['getConditions']=function(_0x5f18bf,_0x45a4e1,_0x424f71){var _0x59e12a={};var _0x71330d={};var _0x214857;var _0x32ea5d;return db['Automation']['findOne']({'where':{'id':_0x5f18bf[_0x187d('0x40')]['id']}})['then'](handleEntityNotFound(_0x45a4e1,null))['then'](function(_0x3e9262){if(_0x3e9262){_0x214857=_0x3e9262;_0x71330d[_0x187d('0x2c')]=_[_0x187d('0x41')](db[_0x187d('0x45')]['rawAttributes']);_0x71330d['query']=_[_0x187d('0x41')](_0x5f18bf[_0x187d('0x2e')]);_0x71330d[_0x187d('0x2d')]=_[_0x187d('0x30')](_0x71330d[_0x187d('0x2c')],_0x71330d['query']);_0x59e12a[_0x187d('0x2f')]=_[_0x187d('0x30')](_0x71330d['model'],qs[_0x187d('0x31')](_0x5f18bf['query'][_0x187d('0x31')]));_0x59e12a['attributes']=_0x59e12a['attributes'][_0x187d('0x32')]?_0x59e12a[_0x187d('0x2f')]:_0x71330d[_0x187d('0x2c')];_0x59e12a['order']=qs['sort'](_0x5f18bf['query']['sort']);_0x59e12a[_0x187d('0x36')]=qs[_0x187d('0x2d')](_[_0x187d('0x37')](_0x5f18bf['query'],_0x71330d['filters']));if(_0x5f18bf[_0x187d('0x2e')]['filter']){_0x59e12a['where']=_[_0x187d('0x38')](_0x59e12a[_0x187d('0x36')],{'$or':_['map'](_0x59e12a[_0x187d('0x2f')],function(_0x20179b){var _0x434955={};_0x434955[_0x20179b]={'$like':'%'+_0x5f18bf[_0x187d('0x2e')]['filter']+'%'};return _0x434955;})});}_0x59e12a=_[_0x187d('0x38')]({},_0x59e12a,_0x5f18bf[_0x187d('0x3a')]);return _0x214857['getConditions'](_0x59e12a);}})[_0x187d('0x20')](function(_0x1be63d){if(_0x1be63d){_0x32ea5d=_0x1be63d[_0x187d('0x32')];if(!_0x5f18bf['query'][_0x187d('0x33')](_0x187d('0x47'))){_0x59e12a['limit']=qs[_0x187d('0x18')](_0x5f18bf['query'][_0x187d('0x18')]);_0x59e12a[_0x187d('0x16')]=qs[_0x187d('0x16')](_0x5f18bf[_0x187d('0x2e')][_0x187d('0x16')]);}return _0x214857['getConditions'](_0x59e12a);}})[_0x187d('0x20')](function(_0xd05c3d){if(_0xd05c3d){return _0xd05c3d?{'count':_0x32ea5d,'rows':_0xd05c3d}:null;}})[_0x187d('0x20')](respondWithResult(_0x45a4e1,null))[_0x187d('0x3e')](handleError(_0x45a4e1,null));};exports[_0x187d('0x48')]=function(_0x3bf74c,_0x289ca7,_0x106ab3){return db['Action'][_0x187d('0x42')]({'where':{'id':_0x3bf74c[_0x187d('0x40')]['id']}})['then'](handleEntityNotFound(_0x289ca7,null))[_0x187d('0x20')](function(_0x4c7948){if(_0x4c7948){return _0x4c7948[_0x187d('0x48')](_0x3bf74c['body']['ids'],_[_0x187d('0x49')](_0x3bf74c['body'],[_0x187d('0x46'),'id'])||{});}})[_0x187d('0x20')](respondWithResult(_0x289ca7,null))[_0x187d('0x3e')](handleError(_0x289ca7,null));};exports['getActions']=function(_0x33713b,_0x52eb9d,_0x59c8db){var _0x285ec4={};var _0x4c003e={};var _0x2fb0b0;var _0x5e4655;return db[_0x187d('0x27')][_0x187d('0x4a')]({'where':{'id':_0x33713b[_0x187d('0x40')]['id']}})[_0x187d('0x20')](handleEntityNotFound(_0x52eb9d,null))[_0x187d('0x20')](function(_0x457d19){if(_0x457d19){_0x2fb0b0=_0x457d19;_0x4c003e[_0x187d('0x2c')]=_[_0x187d('0x41')](db[_0x187d('0x4b')][_0x187d('0x28')]);_0x4c003e[_0x187d('0x2e')]=_[_0x187d('0x41')](_0x33713b['query']);_0x4c003e[_0x187d('0x2d')]=_['intersection'](_0x4c003e['model'],_0x4c003e['query']);_0x285ec4[_0x187d('0x2f')]=_[_0x187d('0x30')](_0x4c003e['model'],qs[_0x187d('0x31')](_0x33713b['query'][_0x187d('0x31')]));_0x285ec4[_0x187d('0x2f')]=_0x285ec4[_0x187d('0x2f')]['length']?_0x285ec4[_0x187d('0x2f')]:_0x4c003e[_0x187d('0x2c')];_0x285ec4[_0x187d('0x34')]=qs[_0x187d('0x35')](_0x33713b[_0x187d('0x2e')][_0x187d('0x35')]);_0x285ec4['where']=qs[_0x187d('0x2d')](_[_0x187d('0x37')](_0x33713b[_0x187d('0x2e')],_0x4c003e['filters']));if(_0x33713b[_0x187d('0x2e')][_0x187d('0x39')]){_0x285ec4[_0x187d('0x36')]=_[_0x187d('0x38')](_0x285ec4[_0x187d('0x36')],{'$or':_[_0x187d('0x26')](_0x285ec4[_0x187d('0x2f')],function(_0x5b84c1){var _0x583575={};_0x583575[_0x5b84c1]={'$like':'%'+_0x33713b[_0x187d('0x2e')][_0x187d('0x39')]+'%'};return _0x583575;})});}_0x285ec4=_[_0x187d('0x38')]({},_0x285ec4,_0x33713b[_0x187d('0x3a')]);return _0x2fb0b0[_0x187d('0x4c')](_0x285ec4);}})[_0x187d('0x20')](function(_0x2544bd){if(_0x2544bd){_0x5e4655=_0x2544bd[_0x187d('0x32')];if(!_0x33713b['query'][_0x187d('0x33')](_0x187d('0x47'))){_0x285ec4['limit']=qs[_0x187d('0x18')](_0x33713b[_0x187d('0x2e')][_0x187d('0x18')]);_0x285ec4[_0x187d('0x16')]=qs[_0x187d('0x16')](_0x33713b[_0x187d('0x2e')][_0x187d('0x16')]);}return _0x2fb0b0[_0x187d('0x4c')](_0x285ec4);}})[_0x187d('0x20')](function(_0x886fe){if(_0x886fe){return _0x886fe?{'count':_0x5e4655,'rows':_0x886fe}:null;}})['then'](respondWithResult(_0x52eb9d,null))[_0x187d('0x3e')](handleError(_0x52eb9d,null));};
\ No newline at end of file
diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js
index 6d139c5..66794dc 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 _0xaf86=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','exports','Automation','tools_automations'];(function(_0x221c7e,_0x108b1d){var _0x5b68e6=function(_0x2ae798){while(--_0x2ae798){_0x221c7e['push'](_0x221c7e['shift']());}};_0x5b68e6(++_0x108b1d);}(_0xaf86,0x1a4));var _0x6af8=function(_0x5de1bc,_0x434be1){_0x5de1bc=_0x5de1bc-0x0;var _0x19f4b8=_0xaf86[_0x5de1bc];return _0x19f4b8;};'use strict';var _=require(_0x6af8('0x0'));var util=require(_0x6af8('0x1'));var logger=require('../../config/logger')(_0x6af8('0x2'));var moment=require(_0x6af8('0x3'));var BPromise=require('bluebird');var rp=require(_0x6af8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6af8('0x5'));var config=require(_0x6af8('0x6'));var attributes=require('./automation.attributes');module[_0x6af8('0x7')]=function(_0x2df360,_0x3efa14){return _0x2df360['define'](_0x6af8('0x8'),attributes,{'tableName':_0x6af8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfbdf=['Automation','tools_automations','../../config/logger','api','moment','path','rimraf','../../config/environment','./automation.attributes','define'];(function(_0x444eb4,_0x560b86){var _0x2ba90c=function(_0xe79e48){while(--_0xe79e48){_0x444eb4['push'](_0x444eb4['shift']());}};_0x2ba90c(++_0x560b86);}(_0xfbdf,0x106));var _0xffbd=function(_0x3e4a61,_0x59a7c0){_0x3e4a61=_0x3e4a61-0x0;var _0x2361b5=_0xfbdf[_0x3e4a61];return _0x2361b5;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xffbd('0x0'))(_0xffbd('0x1'));var moment=require(_0xffbd('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xffbd('0x3'));var rimraf=require(_0xffbd('0x4'));var config=require(_0xffbd('0x5'));var attributes=require(_0xffbd('0x6'));module['exports']=function(_0x44007e,_0x56bd9c){return _0x44007e[_0xffbd('0x7')](_0xffbd('0x8'),attributes,{'tableName':_0xffbd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js
index f6f21bc..3c44de8 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 _0xd0e4=['util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','lodash'];(function(_0x415c79,_0xbdaeaf){var _0x302b34=function(_0x4b5e68){while(--_0x4b5e68){_0x415c79['push'](_0x415c79['shift']());}};_0x302b34(++_0xbdaeaf);}(_0xd0e4,0x1d3));var _0x4d0e=function(_0x5396d4,_0x86297a){_0x5396d4=_0x5396d4-0x0;var _0x9fa122=_0xd0e4[_0x5396d4];return _0x9fa122;};'use strict';var _=require(_0x4d0e('0x0'));var util=require(_0x4d0e('0x1'));var moment=require(_0x4d0e('0x2'));var BPromise=require(_0x4d0e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d0e('0x4'))['db'];var utils=require(_0x4d0e('0x5'));var logger=require(_0x4d0e('0x6'))(_0x4d0e('0x7'));var config=require(_0x4d0e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x103596,_0x39e5c6,_0x50cd74){return new BPromise(function(_0x2f900a,_0x1731e4){return client['request'](_0x103596,_0x50cd74)['then'](function(_0x9358f5){logger['info'](_0x4d0e('0x9'),_0x39e5c6,_0x4d0e('0xa'));logger[_0x4d0e('0xb')]('Automation,\x20%s,\x20%s,\x20%s',_0x39e5c6,_0x4d0e('0xa'),JSON[_0x4d0e('0xc')](_0x9358f5));if(_0x9358f5['error']){if(_0x9358f5['error'][_0x4d0e('0xd')]===0x1f4){logger[_0x4d0e('0xe')](_0x4d0e('0x9'),_0x39e5c6,_0x9358f5[_0x4d0e('0xe')][_0x4d0e('0xf')]);return _0x1731e4(_0x9358f5[_0x4d0e('0xe')][_0x4d0e('0xf')]);}logger[_0x4d0e('0xe')](_0x4d0e('0x9'),_0x39e5c6,_0x9358f5['error'][_0x4d0e('0xf')]);return _0x2f900a(_0x9358f5[_0x4d0e('0xe')][_0x4d0e('0xf')]);}else{logger['info'](_0x4d0e('0x9'),_0x39e5c6,'request\x20sent');_0x2f900a(_0x9358f5[_0x4d0e('0x10')][_0x4d0e('0xf')]);}})[_0x4d0e('0x11')](function(_0x956477){logger[_0x4d0e('0xe')](_0x4d0e('0x9'),_0x39e5c6,_0x956477);_0x1731e4(_0x956477);});});}
\ No newline at end of file
+var _0x45c2=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash'];(function(_0x2a151f,_0x4bf6ce){var _0x5dbe32=function(_0x5eb831){while(--_0x5eb831){_0x2a151f['push'](_0x2a151f['shift']());}};_0x5dbe32(++_0x4bf6ce);}(_0x45c2,0x68));var _0x245c=function(_0x68361,_0x231f90){_0x68361=_0x68361-0x0;var _0xbb709a=_0x45c2[_0x68361];return _0xbb709a;};'use strict';var _=require(_0x245c('0x0'));var util=require(_0x245c('0x1'));var moment=require(_0x245c('0x2'));var BPromise=require(_0x245c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x245c('0x4'));var db=require(_0x245c('0x5'))['db'];var utils=require(_0x245c('0x6'));var logger=require('../../config/logger')(_0x245c('0x7'));var config=require(_0x245c('0x8'));var jayson=require(_0x245c('0x9'));var client=jayson[_0x245c('0xa')][_0x245c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e1860,_0x20a6d7,_0x10da3e){return new BPromise(function(_0x20c72d,_0x40eab8){return client[_0x245c('0xc')](_0x2e1860,_0x10da3e)[_0x245c('0xd')](function(_0x558ef3){logger[_0x245c('0xe')](_0x245c('0xf'),_0x20a6d7,_0x245c('0x10'));logger['debug']('Automation,\x20%s,\x20%s,\x20%s',_0x20a6d7,_0x245c('0x10'),JSON[_0x245c('0x11')](_0x558ef3));if(_0x558ef3['error']){if(_0x558ef3[_0x245c('0x12')]['code']===0x1f4){logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x558ef3[_0x245c('0x12')][_0x245c('0x13')]);return _0x40eab8(_0x558ef3[_0x245c('0x12')]['message']);}logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x558ef3[_0x245c('0x12')][_0x245c('0x13')]);return _0x20c72d(_0x558ef3['error'][_0x245c('0x13')]);}else{logger['info'](_0x245c('0xf'),_0x20a6d7,_0x245c('0x10'));_0x20c72d(_0x558ef3[_0x245c('0x14')][_0x245c('0x13')]);}})['catch'](function(_0x124e02){logger[_0x245c('0x12')](_0x245c('0xf'),_0x20a6d7,_0x124e02);_0x40eab8(_0x124e02);});});}
\ No newline at end of file
diff --git a/server/api/automation/index.js b/server/api/automation/index.js
index cf3e6ac..6b01a91 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 _0xdeee=['get','isAuthenticated','index','/:id','show','/:id/conditions','/:id/actions','post','addActions','put','update','delete','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller'];(function(_0x59ab24,_0x172f42){var _0x1bbef4=function(_0x18cabb){while(--_0x18cabb){_0x59ab24['push'](_0x59ab24['shift']());}};_0x1bbef4(++_0x172f42);}(_0xdeee,0x10a));var _0xedee=function(_0x2ba164,_0x149761){_0x2ba164=_0x2ba164-0x0;var _0x2d0945=_0xdeee[_0x2ba164];return _0x2d0945;};'use strict';var multer=require('multer');var util=require(_0xedee('0x0'));var path=require(_0xedee('0x1'));var timeout=require(_0xedee('0x2'));var express=require(_0xedee('0x3'));var router=express[_0xedee('0x4')]();var fs_extra=require(_0xedee('0x5'));var auth=require(_0xedee('0x6'));var interaction=require(_0xedee('0x7'));var config=require(_0xedee('0x8'));var controller=require(_0xedee('0x9'));router[_0xedee('0xa')]('/',auth[_0xedee('0xb')](),controller[_0xedee('0xc')]);router[_0xedee('0xa')](_0xedee('0xd'),auth[_0xedee('0xb')](),controller[_0xedee('0xe')]);router['get'](_0xedee('0xf'),auth[_0xedee('0xb')](),controller['getConditions']);router[_0xedee('0xa')](_0xedee('0x10'),auth['isAuthenticated'](),controller['getActions']);router['post']('/',auth[_0xedee('0xb')](),controller['create']);router[_0xedee('0x11')](_0xedee('0xf'),auth[_0xedee('0xb')](),controller['addConditions']);router[_0xedee('0x11')](_0xedee('0x10'),auth[_0xedee('0xb')](),controller[_0xedee('0x12')]);router[_0xedee('0x13')]('/:id',auth[_0xedee('0xb')](),controller[_0xedee('0x14')]);router[_0xedee('0x15')]('/:id',auth[_0xedee('0xb')](),controller['destroy']);module[_0xedee('0x16')]=router;
\ No newline at end of file
+var _0x0a25=['addActions','put','destroy','exports','multer','util','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions'];(function(_0x2117c4,_0x4acb1c){var _0x49159d=function(_0x38a20b){while(--_0x38a20b){_0x2117c4['push'](_0x2117c4['shift']());}};_0x49159d(++_0x4acb1c);}(_0x0a25,0x68));var _0x50a2=function(_0xacd1fd,_0x24f8ea){_0xacd1fd=_0xacd1fd-0x0;var _0x3d370b=_0x0a25[_0xacd1fd];return _0x3d370b;};'use strict';var multer=require(_0x50a2('0x0'));var util=require(_0x50a2('0x1'));var path=require('path');var timeout=require(_0x50a2('0x2'));var express=require(_0x50a2('0x3'));var router=express['Router']();var fs_extra=require(_0x50a2('0x4'));var auth=require(_0x50a2('0x5'));var interaction=require(_0x50a2('0x6'));var config=require(_0x50a2('0x7'));var controller=require(_0x50a2('0x8'));router[_0x50a2('0x9')]('/',auth[_0x50a2('0xa')](),controller[_0x50a2('0xb')]);router[_0x50a2('0x9')](_0x50a2('0xc'),auth[_0x50a2('0xa')](),controller[_0x50a2('0xd')]);router[_0x50a2('0x9')](_0x50a2('0xe'),auth[_0x50a2('0xa')](),controller[_0x50a2('0xf')]);router[_0x50a2('0x9')](_0x50a2('0x10'),auth['isAuthenticated'](),controller[_0x50a2('0x11')]);router[_0x50a2('0x12')]('/',auth[_0x50a2('0xa')](),controller[_0x50a2('0x13')]);router[_0x50a2('0x12')](_0x50a2('0xe'),auth['isAuthenticated'](),controller[_0x50a2('0x14')]);router[_0x50a2('0x12')](_0x50a2('0x10'),auth[_0x50a2('0xa')](),controller[_0x50a2('0x15')]);router[_0x50a2('0x16')](_0x50a2('0xc'),auth[_0x50a2('0xa')](),controller['update']);router['delete']('/:id',auth[_0x50a2('0xa')](),controller[_0x50a2('0x17')]);module[_0x50a2('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 d12d58d..35a10ef 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 _0x0c6b=['sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x495c1b,_0x269f02){var _0x41c4be=function(_0x51463a){while(--_0x51463a){_0x495c1b['push'](_0x495c1b['shift']());}};_0x41c4be(++_0x269f02);}(_0x0c6b,0x1bc));var _0xb0c6=function(_0x16c1f6,_0x354ed1){_0x16c1f6=_0x16c1f6-0x0;var _0x475d24=_0x0c6b[_0x16c1f6];return _0x475d24;};'use strict';var Sequelize=require(_0xb0c6('0x0'));module['exports']={'name':{'type':Sequelize[_0xb0c6('0x1')],'unique':_0xb0c6('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xb0c6('0x3')](_0xb0c6('0x4')),'allowNull':![],'defaultValue':_0xb0c6('0x4')},'description':{'type':Sequelize[_0xb0c6('0x1')]},'active':{'type':Sequelize[_0xb0c6('0x5')],'defaultValue':0x0,'comment':_0xb0c6('0x6')},'limitCalls':{'type':Sequelize[_0xb0c6('0x7')](0x4)[_0xb0c6('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0xb0c6('0x9')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0c6('0xa')},'dialCongestionMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0c6('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0c6('0xc')},'dialBusyRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xb0c6('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xb0c6('0xe')},'dialTimezone':{'type':Sequelize[_0xb0c6('0x1')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xb0c6('0x1')],'defaultValue':_0xb0c6('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xb0c6('0x3')](_0xb0c6('0x10'),'never',_0xb0c6('0x11')),'defaultValue':_0xb0c6('0x10')},'dialAMDActive':{'type':Sequelize[_0xb0c6('0x5')],'defaultValue':0x0,'comment':_0xb0c6('0x12')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xb0c6('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xb0c6('0x13')},'dialAMDGreeting':{'type':Sequelize[_0xb0c6('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xb0c6('0x14')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xb0c6('0x7')](0x9)[_0xb0c6('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xb0c6('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xb0c6('0x7')](0x9)[_0xb0c6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0c6('0x16')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xb0c6('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xb0c6('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xb0c6('0x18')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xb0c6('0x7')](0x9)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0xb0c6('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xb0c6('0x7')](0x9)[_0xb0c6('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xb0c6('0x19')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xb0c6('0x1a'),_0xb0c6('0x1b')),'defaultValue':_0xb0c6('0x1a')},'dialPrefix':{'type':Sequelize[_0xb0c6('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0c6('0x1c')},'dialCutDigit':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xb0c6('0x1d')},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0c6('0x1e')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0c6('0x1f')},'dialAbandonedMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0c6('0x20')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0c6('0x21')},'dialMachineMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0c6('0x22')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xb0c6('0x7')](0x3)[_0xb0c6('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xb0c6('0x23')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xb0c6('0x7')](0x5)[_0xb0c6('0x8')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xb0c6('0x24')}};
\ No newline at end of file
+var _0x83e4=['#Abandoned\x20Retry\x20(min:1,\x20max:999)','Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Machine\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','Active/Disactive\x20Campaign','INTEGER','Max\x20200\x20calls.','UNSIGNED','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#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','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x83e4,0x137));var _0x483e=function(_0x2eea5f,_0x34cfa2){_0x2eea5f=_0x2eea5f-0x0;var _0x381ef7=_0x83e4[_0x2eea5f];return _0x381ef7;};'use strict';var Sequelize=require(_0x483e('0x0'));module[_0x483e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x483e('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x483e('0x3')](_0x483e('0x4')),'allowNull':![],'defaultValue':_0x483e('0x4')},'description':{'type':Sequelize[_0x483e('0x5')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x483e('0x6')},'limitCalls':{'type':Sequelize[_0x483e('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x483e('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x483e('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x483e('0x5')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0x483e('0x7')](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x483e('0x7')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x483e('0xa')},'dialBusyRetryFrequency':{'type':Sequelize[_0x483e('0x7')](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x483e('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x483e('0x7')](0x3)[_0x483e('0x9')],'defaultValue':0x3,'comment':_0x483e('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x483e('0x7')](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x483e('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x483e('0x7')](0x3)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x483e('0xe')},'dialTimezone':{'type':Sequelize[_0x483e('0x5')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x483e('0x5')],'defaultValue':_0x483e('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0x483e('0x3')](_0x483e('0x10'),'never','onlyIfOpen'),'defaultValue':_0x483e('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x483e('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x483e('0x7')](0x9)[_0x483e('0x9')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x483e('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x483e('0x7')](0x9)[_0x483e('0x9')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x483e('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x483e('0x9')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x483e('0x14')},'dialAMDMinWordLength':{'type':Sequelize[_0x483e('0x7')](0x9)[_0x483e('0x9')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x483e('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x483e('0x7')](0x9)[_0x483e('0x9')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x483e('0x7')](0x9)[_0x483e('0x9')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x483e('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x483e('0x9')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x483e('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x483e('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x483e('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x483e('0x3')](_0x483e('0x19'),'ASC'),'defaultValue':_0x483e('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x483e('0x7')](0x3)[_0x483e('0x9')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x483e('0x1a')},'dialCutDigit':{'type':Sequelize[_0x483e('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)'},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x483e('0x7')](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x483e('0x1b')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x483e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x483e('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialAbandonedMaxRetry':{'type':Sequelize[_0x483e('0x7')](0x3)[_0x483e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x483e('0x1d')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x483e('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x483e('0x1e')},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x483e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x483e('0x1f')},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x483e('0x20')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x483e('0x7')](0x3)[_0x483e('0x9')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x483e('0x7')](0x5)[_0x483e('0x9')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x483e('0x21')}};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js
index 202c342..316e0f6 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 _0x4631=['CmList','addLists','format','YYYY-MM-DD\x20HH:mm:ss','ids','spread','dialCheckDuplicateType','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','createdAt','select','field','from','deletedAt\x20IS\x20NULL','CmListId','toString','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','into','NOW()','cm_contacts','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','cm_hopper_additional_phones','cmHopperId','OrderBy','cm_contact_has_items','join','h.ListId\x20=\x20?','h.CampaignId=?','h.createdAt\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','removeBlackLists','eml-format','rimraf','fast-json-patch','util','path','sox','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','UserProfileResource','stack','name','index','map','Campaign','rawAttributes','type','model','query','keys','intersection','attributes','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','body','user','role','get','IvrCampaigns','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','rows','getHopperHistories','CmHopperHistory','getHopperFinals','nolimit','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists'];(function(_0x4f0a77,_0x221a0f){var _0x5e91b8=function(_0xc584d9){while(--_0xc584d9){_0x4f0a77['push'](_0x4f0a77['shift']());}};_0x5e91b8(++_0x221a0f);}(_0x4631,0xb9));var _0x1463=function(_0x3fcc20,_0x57c31b){_0x3fcc20=_0x3fcc20-0x0;var _0x15d3ce=_0x4631[_0x3fcc20];return _0x15d3ce;};'use strict';var emlformat=require(_0x1463('0x0'));var rimraf=require(_0x1463('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1463('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1463('0x3'));var path=require(_0x1463('0x4'));var sox=require(_0x1463('0x5'));var csv=require(_0x1463('0x6'));var ejs=require(_0x1463('0x7'));var fs=require('fs');var fs_extra=require(_0x1463('0x8'));var _=require(_0x1463('0x9'));var squel=require('squel');var crypto=require(_0x1463('0xa'));var jsforce=require(_0x1463('0xb'));var deskjs=require(_0x1463('0xc'));var toCsv=require(_0x1463('0x6'));var querystring=require('querystring');var Papa=require(_0x1463('0xd'));var Redis=require(_0x1463('0xe'));var authService=require(_0x1463('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x1463('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1463('0x11'))('api');var utils=require(_0x1463('0x12'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44be30,_0x1694b5){_0x1694b5=_0x1694b5||0xcc;return function(_0x51432c){if(_0x51432c){return _0x44be30[_0x1463('0x13')](_0x1694b5);}return _0x44be30[_0x1463('0x14')](_0x1694b5)[_0x1463('0x15')]();};}function respondWithResult(_0x462b48,_0x2649f1){_0x2649f1=_0x2649f1||0xc8;return function(_0x3b9a22){if(_0x3b9a22){return _0x462b48[_0x1463('0x14')](_0x2649f1)[_0x1463('0x16')](_0x3b9a22);}};}function respondWithFilteredResult(_0x2f4e02,_0x1404da){return function(_0x220b5a){if(_0x220b5a){var _0x5e606d=typeof _0x1404da[_0x1463('0x17')]===_0x1463('0x18')&&typeof _0x1404da[_0x1463('0x19')]===_0x1463('0x18');var _0x5e8c64=_0x220b5a[_0x1463('0x1a')];var _0x12892b=_0x5e606d?0x0:_0x1404da[_0x1463('0x17')];var _0x134de5=_0x5e606d?_0x220b5a[_0x1463('0x1a')]:_0x1404da[_0x1463('0x17')]+_0x1404da[_0x1463('0x19')];var _0x1a0173;if(_0x134de5>=_0x5e8c64){_0x134de5=_0x5e8c64;_0x1a0173=0xc8;}else{_0x1a0173=0xce;}_0x2f4e02[_0x1463('0x14')](_0x1a0173);return _0x2f4e02[_0x1463('0x1b')](_0x1463('0x1c'),_0x12892b+'-'+_0x134de5+'/'+_0x5e8c64)['json'](_0x220b5a);}return null;};}function patchUpdates(_0x5671b8){return function(_0x1e9188){try{jsonpatch[_0x1463('0x1d')](_0x1e9188,_0x5671b8,!![]);}catch(_0x22a836){return BPromise[_0x1463('0x1e')](_0x22a836);}return _0x1e9188[_0x1463('0x1f')]();};}function saveUpdates(_0x6de5b1,_0x1ffd2e){return function(_0xd8834a){if(_0xd8834a){return _0xd8834a[_0x1463('0x20')](_0x6de5b1)['then'](function(_0x3181b3){return _0x3181b3;});}return null;};}function removeEntity(_0x540160,_0x3e5938){return function(_0x1ab5b5){if(_0x1ab5b5){return _0x1ab5b5[_0x1463('0x21')]()[_0x1463('0x22')](function(){var _0x1f7609=_0x1ab5b5['get']({'plain':!![]});var _0x1cb809='IvrCampaigns';return db[_0x1463('0x23')][_0x1463('0x21')]({'where':{'type':_0x1cb809,'resourceId':_0x1f7609['id']}})['then'](function(){return _0x1ab5b5;});})[_0x1463('0x22')](function(){_0x540160[_0x1463('0x14')](0xcc)[_0x1463('0x15')]();});}};}function handleEntityNotFound(_0x515e3f,_0x45d64a){return function(_0x783bfa){if(!_0x783bfa){_0x515e3f['sendStatus'](0x194);}return _0x783bfa;};}function handleError(_0x38a7d6,_0x6dc66b){_0x6dc66b=_0x6dc66b||0x1f4;return function(_0x42c280){logger['error'](_0x42c280[_0x1463('0x24')]);if(_0x42c280[_0x1463('0x25')]){delete _0x42c280[_0x1463('0x25')];}_0x38a7d6['status'](_0x6dc66b)['send'](_0x42c280);};}exports[_0x1463('0x26')]=function(_0x4555f2,_0x282d3d){var _0x93bad6={},_0x27778d={},_0x3d63c6={'count':0x0,'rows':[]};var _0x10bd8b=_[_0x1463('0x27')](db[_0x1463('0x28')][_0x1463('0x29')],function(_0x355539){return{'name':_0x355539['fieldName'],'type':_0x355539[_0x1463('0x2a')]['key']};});_0x27778d[_0x1463('0x2b')]=_[_0x1463('0x27')](_0x10bd8b,_0x1463('0x25'));_0x27778d[_0x1463('0x2c')]=_[_0x1463('0x2d')](_0x4555f2[_0x1463('0x2c')]);_0x27778d['filters']=_[_0x1463('0x2e')](_0x27778d[_0x1463('0x2b')],_0x27778d[_0x1463('0x2c')]);_0x93bad6[_0x1463('0x2f')]=_[_0x1463('0x2e')](_0x27778d['model'],qs[_0x1463('0x30')](_0x4555f2[_0x1463('0x2c')]['fields']));_0x93bad6['attributes']=_0x93bad6[_0x1463('0x2f')][_0x1463('0x31')]?_0x93bad6[_0x1463('0x2f')]:_0x27778d[_0x1463('0x2b')];if(!_0x4555f2[_0x1463('0x2c')]['hasOwnProperty']('nolimit')){_0x93bad6[_0x1463('0x19')]=qs[_0x1463('0x19')](_0x4555f2[_0x1463('0x2c')][_0x1463('0x19')]);_0x93bad6['offset']=qs[_0x1463('0x17')](_0x4555f2['query']['offset']);}_0x93bad6[_0x1463('0x32')]=qs[_0x1463('0x33')](_0x4555f2['query']['sort']);_0x93bad6[_0x1463('0x34')]=qs[_0x1463('0x35')](_[_0x1463('0x36')](_0x4555f2[_0x1463('0x2c')],_0x27778d[_0x1463('0x35')]),_0x10bd8b);if(_0x4555f2[_0x1463('0x2c')][_0x1463('0x37')]){_0x93bad6['where']=_[_0x1463('0x38')](_0x93bad6[_0x1463('0x34')],{'$or':_[_0x1463('0x27')](_0x10bd8b,function(_0x1fef32){if(_0x1fef32[_0x1463('0x2a')]!==_0x1463('0x39')){var _0x208931={};_0x208931[_0x1fef32['name']]={'$like':'%'+_0x4555f2[_0x1463('0x2c')]['filter']+'%'};return _0x208931;}})});}_0x93bad6=_[_0x1463('0x38')]({},_0x93bad6,_0x4555f2[_0x1463('0x3a')]);var _0xfa9b63={'where':_0x93bad6[_0x1463('0x34')]};return db[_0x1463('0x28')][_0x1463('0x1a')](_0xfa9b63)['then'](function(_0x13a54a){_0x3d63c6[_0x1463('0x1a')]=_0x13a54a;if(_0x4555f2[_0x1463('0x2c')][_0x1463('0x3b')]){_0x93bad6[_0x1463('0x3c')]=[{'all':!![]}];}return db[_0x1463('0x28')][_0x1463('0x3d')](_0x93bad6);})[_0x1463('0x22')](function(_0x394b6e){_0x3d63c6['rows']=_0x394b6e;return _0x3d63c6;})[_0x1463('0x22')](respondWithFilteredResult(_0x282d3d,_0x93bad6))[_0x1463('0x3e')](handleError(_0x282d3d,null));};exports['show']=function(_0x4845e2,_0x241050){var _0x43ab2b={'raw':![],'where':{'id':_0x4845e2[_0x1463('0x3f')]['id']}},_0x3393cb={};_0x3393cb[_0x1463('0x2b')]=_[_0x1463('0x2d')](db[_0x1463('0x28')]['rawAttributes']);_0x3393cb['query']=_['keys'](_0x4845e2[_0x1463('0x2c')]);_0x3393cb[_0x1463('0x35')]=_['intersection'](_0x3393cb[_0x1463('0x2b')],_0x3393cb[_0x1463('0x2c')]);_0x43ab2b[_0x1463('0x2f')]=_[_0x1463('0x2e')](_0x3393cb[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x4845e2[_0x1463('0x2c')]['fields']));_0x43ab2b['attributes']=_0x43ab2b[_0x1463('0x2f')][_0x1463('0x31')]?_0x43ab2b[_0x1463('0x2f')]:_0x3393cb[_0x1463('0x2b')];if(_0x4845e2[_0x1463('0x2c')]['includeAll']){_0x43ab2b['include']=[{'all':!![]}];}_0x43ab2b=_[_0x1463('0x38')]({},_0x43ab2b,_0x4845e2[_0x1463('0x3a')]);return db[_0x1463('0x28')][_0x1463('0x40')](_0x43ab2b)['then'](handleEntityNotFound(_0x241050,null))[_0x1463('0x22')](respondWithResult(_0x241050,null))[_0x1463('0x3e')](handleError(_0x241050,null));};exports[_0x1463('0x41')]=function(_0x13cd4a,_0xd43749){return db['Campaign']['create'](_0x13cd4a[_0x1463('0x42')],{})[_0x1463('0x22')](function(_0x26d895){var _0x55ce29=_0x13cd4a[_0x1463('0x43')]['get']({'plain':!![]});if(!_0x55ce29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x55ce29[_0x1463('0x44')]==='user'){var _0x5742ae=_0x26d895[_0x1463('0x45')]({'plain':!![]});var _0x1a7dc1=_0x1463('0x46');return db[_0x1463('0x47')][_0x1463('0x40')]({'where':{'name':_0x1a7dc1,'userProfileId':_0x55ce29['userProfileId']},'raw':!![]})[_0x1463('0x22')](function(_0x169f6b){if(_0x169f6b&&_0x169f6b['autoAssociation']===0x0){return db['UserProfileResource'][_0x1463('0x41')]({'name':_0x5742ae['name'],'resourceId':_0x5742ae['id'],'type':_0x169f6b[_0x1463('0x25')],'sectionId':_0x169f6b['id']},{})[_0x1463('0x22')](function(){return _0x26d895;});}else{return _0x26d895;}})['catch'](function(_0x8673ad){logger[_0x1463('0x48')](_0x1463('0x49'),_0x8673ad);throw _0x8673ad;});}return _0x26d895;})['then'](respondWithResult(_0xd43749,0xc9))[_0x1463('0x3e')](handleError(_0xd43749,null));};exports[_0x1463('0x4a')]=function(_0x4262,_0x1722ca){var _0x20513a={'where':{'id':_0x4262['params']['id']}},_0x33bb02={};_0x33bb02[_0x1463('0x2b')]=_[_0x1463('0x2d')](db['Campaign'][_0x1463('0x29')]);_0x20513a[_0x1463('0x2f')]=_[_0x1463('0x2e')](_0x33bb02[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x4262[_0x1463('0x2c')][_0x1463('0x30')]));_0x20513a['attributes']=_0x20513a['attributes'][_0x1463('0x31')]?_0x20513a[_0x1463('0x2f')]:_0x33bb02[_0x1463('0x2b')];if(_0x4262['query'][_0x1463('0x3b')]){_0x20513a['include']=[{'all':!![]}];}_0x20513a=_['merge']({},_0x20513a,_0x4262[_0x1463('0x3a')]);return db[_0x1463('0x28')]['find'](_0x20513a)['then'](handleEntityNotFound(_0x1722ca,null))['then'](function(_0x4c6b64){if(_0x4c6b64){var _0x53e9d7=_0x4c6b64[_0x1463('0x45')]({'plain':!![]});_0x53e9d7=qs[_0x1463('0x4b')](_0x53e9d7,['id','createdAt',_0x1463('0x4c')]);_0x4262[_0x1463('0x42')]=_['omit'](_0x4262[_0x1463('0x42')],['id','createdAt',_0x1463('0x4c')]);return db[_0x1463('0x28')][_0x1463('0x41')](_[_0x1463('0x38')](_0x53e9d7,_0x4262['body']),{'include':_0x4262['query'][_0x1463('0x3b')]?[{'all':!![]}]:undefined})[_0x1463('0x22')](function(_0x4ad490){var _0x263c97=_0x4262[_0x1463('0x43')][_0x1463('0x45')]({'plain':!![]});if(!_0x263c97)throw new Error(_0x1463('0x4d'));if(_0x263c97['role']===_0x1463('0x43')){var _0x149c21=_0x4ad490['get']({'plain':!![]});var _0x543dd8=_0x1463('0x46');return db[_0x1463('0x47')][_0x1463('0x40')]({'where':{'name':_0x543dd8,'userProfileId':_0x263c97['userProfileId']},'raw':!![]})[_0x1463('0x22')](function(_0x51319e){if(_0x51319e&&_0x51319e[_0x1463('0x4e')]===0x0){return db[_0x1463('0x23')]['create']({'name':_0x149c21[_0x1463('0x25')],'resourceId':_0x149c21['id'],'type':_0x51319e[_0x1463('0x25')],'sectionId':_0x51319e['id']},{})['then'](function(){return _0x4ad490;});}else{return _0x4ad490;}})[_0x1463('0x3e')](function(_0x3a69c9){logger['error'](_0x1463('0x49'),_0x3a69c9);throw _0x3a69c9;});}return _0x4ad490;});}})[_0x1463('0x22')](respondWithResult(_0x1722ca,0xc9))[_0x1463('0x3e')](handleError(_0x1722ca,null));};exports['update']=function(_0x1b02bb,_0x174f5b){if(_0x1b02bb[_0x1463('0x42')]['id']){delete _0x1b02bb[_0x1463('0x42')]['id'];}return db[_0x1463('0x28')]['find']({'where':{'id':_0x1b02bb[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x174f5b,null))['then'](saveUpdates(_0x1b02bb[_0x1463('0x42')],null))[_0x1463('0x22')](respondWithResult(_0x174f5b,null))['catch'](handleError(_0x174f5b,null));};exports[_0x1463('0x21')]=function(_0x59a07b,_0xe76713){return db['Campaign'][_0x1463('0x40')]({'where':{'id':_0x59a07b[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0xe76713,null))[_0x1463('0x22')](removeEntity(_0xe76713,null))[_0x1463('0x3e')](handleError(_0xe76713,null));};exports[_0x1463('0x4f')]=function(_0x1c58fc,_0x49cacc,_0x5c24bb){var _0x29dca9={'raw':!![],'where':{}};var _0x2e6dc5={};var _0x4ac1fa={'count':0x0,'rows':[]};return db[_0x1463('0x28')][_0x1463('0x50')]({'where':{'id':_0x1c58fc[_0x1463('0x3f')]['id']}})['then'](handleEntityNotFound(_0x49cacc,null))[_0x1463('0x22')](function(_0x1ccdd4){if(_0x1ccdd4){_0x2e6dc5[_0x1463('0x2b')]=_[_0x1463('0x2d')](db['CmHopper'][_0x1463('0x29')]);_0x2e6dc5['query']=_[_0x1463('0x2d')](_0x1c58fc[_0x1463('0x2c')]);_0x2e6dc5['filters']=_[_0x1463('0x2e')](_0x2e6dc5['model'],_0x2e6dc5[_0x1463('0x2c')]);_0x29dca9[_0x1463('0x2f')]=_['intersection'](_0x2e6dc5[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x1c58fc[_0x1463('0x2c')][_0x1463('0x30')]));_0x29dca9[_0x1463('0x2f')]=_0x29dca9[_0x1463('0x2f')][_0x1463('0x31')]?_0x29dca9[_0x1463('0x2f')]:_0x2e6dc5[_0x1463('0x2b')];if(!_0x1c58fc[_0x1463('0x2c')][_0x1463('0x51')]('nolimit')){_0x29dca9[_0x1463('0x19')]=qs[_0x1463('0x19')](_0x1c58fc[_0x1463('0x2c')][_0x1463('0x19')]);_0x29dca9[_0x1463('0x17')]=qs[_0x1463('0x17')](_0x1c58fc[_0x1463('0x2c')][_0x1463('0x17')]);}_0x29dca9[_0x1463('0x32')]=qs[_0x1463('0x33')](_0x1c58fc['query'][_0x1463('0x33')]);_0x29dca9[_0x1463('0x34')]=qs[_0x1463('0x35')](_[_0x1463('0x36')](_0x1c58fc[_0x1463('0x2c')],_0x2e6dc5['filters']));_0x29dca9['where'][_0x1463('0x52')]=_0x1ccdd4['id'];if(_0x1c58fc[_0x1463('0x2c')]['filter']){_0x29dca9[_0x1463('0x34')]=_['merge'](_0x29dca9[_0x1463('0x34')],{'$or':_[_0x1463('0x27')](_0x29dca9[_0x1463('0x2f')],function(_0x30081a){var _0x2a5a36={};_0x2a5a36[_0x30081a]={'$like':'%'+_0x1c58fc[_0x1463('0x2c')]['filter']+'%'};return _0x2a5a36;})});}_0x29dca9=_['merge']({},_0x29dca9,_0x1c58fc['options']);return db['CmHopper'][_0x1463('0x1a')]({'where':_0x29dca9[_0x1463('0x34')]})['then'](function(_0xa7e8a4){_0x4ac1fa[_0x1463('0x1a')]=_0xa7e8a4;if(_0x1c58fc[_0x1463('0x2c')][_0x1463('0x3b')]){_0x29dca9[_0x1463('0x3c')]=[{'all':!![]}];}return db[_0x1463('0x53')][_0x1463('0x3d')](_0x29dca9);})[_0x1463('0x22')](function(_0x26cdb7){_0x4ac1fa[_0x1463('0x54')]=_0x26cdb7;return _0x4ac1fa;});}})['then'](respondWithFilteredResult(_0x49cacc,_0x29dca9))[_0x1463('0x3e')](handleError(_0x49cacc,null));};exports[_0x1463('0x55')]=function(_0x12dae1,_0x2ca229,_0x2cfc93){var _0x1cb64e={'raw':!![],'where':{}};var _0x14f295={};var _0x5d90b3={'count':0x0,'rows':[]};return db[_0x1463('0x28')]['findOne']({'where':{'id':_0x12dae1[_0x1463('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2ca229,null))[_0x1463('0x22')](function(_0x154c07){if(_0x154c07){_0x14f295[_0x1463('0x2b')]=_['keys'](db[_0x1463('0x56')]['rawAttributes']);_0x14f295[_0x1463('0x2c')]=_[_0x1463('0x2d')](_0x12dae1[_0x1463('0x2c')]);_0x14f295['filters']=_[_0x1463('0x2e')](_0x14f295['model'],_0x14f295[_0x1463('0x2c')]);_0x1cb64e[_0x1463('0x2f')]=_['intersection'](_0x14f295[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x12dae1[_0x1463('0x2c')][_0x1463('0x30')]));_0x1cb64e[_0x1463('0x2f')]=_0x1cb64e[_0x1463('0x2f')][_0x1463('0x31')]?_0x1cb64e['attributes']:_0x14f295[_0x1463('0x2b')];if(!_0x12dae1['query']['hasOwnProperty']('nolimit')){_0x1cb64e[_0x1463('0x19')]=qs[_0x1463('0x19')](_0x12dae1[_0x1463('0x2c')][_0x1463('0x19')]);_0x1cb64e[_0x1463('0x17')]=qs[_0x1463('0x17')](_0x12dae1[_0x1463('0x2c')][_0x1463('0x17')]);}_0x1cb64e[_0x1463('0x32')]=qs[_0x1463('0x33')](_0x12dae1['query'][_0x1463('0x33')]);_0x1cb64e[_0x1463('0x34')]=qs['filters'](_[_0x1463('0x36')](_0x12dae1[_0x1463('0x2c')],_0x14f295[_0x1463('0x35')]));_0x1cb64e[_0x1463('0x34')][_0x1463('0x52')]=_0x154c07['id'];if(_0x12dae1[_0x1463('0x2c')][_0x1463('0x37')]){_0x1cb64e[_0x1463('0x34')]=_[_0x1463('0x38')](_0x1cb64e['where'],{'$or':_[_0x1463('0x27')](_0x1cb64e[_0x1463('0x2f')],function(_0x3d7879){var _0x31445e={};_0x31445e[_0x3d7879]={'$like':'%'+_0x12dae1['query'][_0x1463('0x37')]+'%'};return _0x31445e;})});}_0x1cb64e=_[_0x1463('0x38')]({},_0x1cb64e,_0x12dae1[_0x1463('0x3a')]);return db[_0x1463('0x56')][_0x1463('0x1a')]({'where':_0x1cb64e[_0x1463('0x34')]})[_0x1463('0x22')](function(_0x3e599e){_0x5d90b3[_0x1463('0x1a')]=_0x3e599e;if(_0x12dae1['query'][_0x1463('0x3b')]){_0x1cb64e['include']=[{'all':!![]}];}return db[_0x1463('0x56')][_0x1463('0x3d')](_0x1cb64e);})[_0x1463('0x22')](function(_0x22e0a4){_0x5d90b3[_0x1463('0x54')]=_0x22e0a4;return _0x5d90b3;});}})[_0x1463('0x22')](respondWithFilteredResult(_0x2ca229,_0x1cb64e))[_0x1463('0x3e')](handleError(_0x2ca229,null));};exports[_0x1463('0x57')]=function(_0x314a79,_0x5dbd80,_0x3725a4){var _0x3a9359={'raw':!![],'where':{}};var _0x15bb0f={};var _0x2e549e={'count':0x0,'rows':[]};return db[_0x1463('0x28')]['findOne']({'where':{'id':_0x314a79[_0x1463('0x3f')]['id']}})['then'](handleEntityNotFound(_0x5dbd80,null))[_0x1463('0x22')](function(_0x449598){if(_0x449598){_0x15bb0f[_0x1463('0x2b')]=_[_0x1463('0x2d')](db['CmHopperFinal']['rawAttributes']);_0x15bb0f[_0x1463('0x2c')]=_[_0x1463('0x2d')](_0x314a79[_0x1463('0x2c')]);_0x15bb0f[_0x1463('0x35')]=_[_0x1463('0x2e')](_0x15bb0f[_0x1463('0x2b')],_0x15bb0f['query']);_0x3a9359[_0x1463('0x2f')]=_[_0x1463('0x2e')](_0x15bb0f[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x314a79['query'][_0x1463('0x30')]));_0x3a9359[_0x1463('0x2f')]=_0x3a9359['attributes'][_0x1463('0x31')]?_0x3a9359[_0x1463('0x2f')]:_0x15bb0f[_0x1463('0x2b')];if(!_0x314a79[_0x1463('0x2c')][_0x1463('0x51')](_0x1463('0x58'))){_0x3a9359[_0x1463('0x19')]=qs['limit'](_0x314a79[_0x1463('0x2c')][_0x1463('0x19')]);_0x3a9359['offset']=qs['offset'](_0x314a79[_0x1463('0x2c')][_0x1463('0x17')]);}_0x3a9359[_0x1463('0x32')]=qs['sort'](_0x314a79[_0x1463('0x2c')][_0x1463('0x33')]);_0x3a9359['where']=qs['filters'](_[_0x1463('0x36')](_0x314a79[_0x1463('0x2c')],_0x15bb0f[_0x1463('0x35')]));_0x3a9359['where']['CampaignId']=_0x449598['id'];if(_0x314a79[_0x1463('0x2c')]['filter']){_0x3a9359['where']=_['merge'](_0x3a9359['where'],{'$or':_[_0x1463('0x27')](_0x3a9359[_0x1463('0x2f')],function(_0x4dfd54){var _0x41e2af={};_0x41e2af[_0x4dfd54]={'$like':'%'+_0x314a79[_0x1463('0x2c')][_0x1463('0x37')]+'%'};return _0x41e2af;})});}_0x3a9359=_[_0x1463('0x38')]({},_0x3a9359,_0x314a79[_0x1463('0x3a')]);return db[_0x1463('0x59')][_0x1463('0x1a')]({'where':_0x3a9359[_0x1463('0x34')]})['then'](function(_0x5958f6){_0x2e549e['count']=_0x5958f6;if(_0x314a79['query']['includeAll']){_0x3a9359['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0x1463('0x3d')](_0x3a9359);})['then'](function(_0x533447){_0x2e549e[_0x1463('0x54')]=_0x533447;return _0x2e549e;});}})[_0x1463('0x22')](respondWithFilteredResult(_0x5dbd80,_0x3a9359))[_0x1463('0x3e')](handleError(_0x5dbd80,null));};exports[_0x1463('0x5a')]=function(_0x5c907c,_0x5e48dd,_0x24134e){var _0x2027a2={'raw':!![],'where':{}};var _0x231649={};var _0x29ae92={'count':0x0,'rows':[]};return db['Campaign'][_0x1463('0x50')]({'where':{'id':_0x5c907c[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x5e48dd,null))[_0x1463('0x22')](function(_0x20cfe9){if(_0x20cfe9){_0x231649[_0x1463('0x2b')]=_[_0x1463('0x2d')](db['CmHopperBlack']['rawAttributes']);_0x231649[_0x1463('0x2c')]=_[_0x1463('0x2d')](_0x5c907c['query']);_0x231649['filters']=_[_0x1463('0x2e')](_0x231649[_0x1463('0x2b')],_0x231649[_0x1463('0x2c')]);_0x2027a2['attributes']=_[_0x1463('0x2e')](_0x231649[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x5c907c[_0x1463('0x2c')][_0x1463('0x30')]));_0x2027a2['attributes']=_0x2027a2['attributes'][_0x1463('0x31')]?_0x2027a2[_0x1463('0x2f')]:_0x231649[_0x1463('0x2b')];if(!_0x5c907c[_0x1463('0x2c')][_0x1463('0x51')](_0x1463('0x58'))){_0x2027a2[_0x1463('0x19')]=qs[_0x1463('0x19')](_0x5c907c[_0x1463('0x2c')][_0x1463('0x19')]);_0x2027a2['offset']=qs['offset'](_0x5c907c[_0x1463('0x2c')][_0x1463('0x17')]);}_0x2027a2[_0x1463('0x32')]=qs[_0x1463('0x33')](_0x5c907c[_0x1463('0x2c')][_0x1463('0x33')]);_0x2027a2['where']=qs[_0x1463('0x35')](_[_0x1463('0x36')](_0x5c907c['query'],_0x231649['filters']));_0x2027a2['where'][_0x1463('0x52')]=_0x20cfe9['id'];if(_0x5c907c[_0x1463('0x2c')][_0x1463('0x37')]){_0x2027a2[_0x1463('0x34')]=_[_0x1463('0x38')](_0x2027a2[_0x1463('0x34')],{'$or':_[_0x1463('0x27')](_0x2027a2[_0x1463('0x2f')],function(_0x129ee7){var _0x589f70={};_0x589f70[_0x129ee7]={'$like':'%'+_0x5c907c[_0x1463('0x2c')][_0x1463('0x37')]+'%'};return _0x589f70;})});}_0x2027a2=_['merge']({},_0x2027a2,_0x5c907c['options']);return db[_0x1463('0x5b')][_0x1463('0x1a')]({'where':_0x2027a2['where']})[_0x1463('0x22')](function(_0xf99e9d){_0x29ae92[_0x1463('0x1a')]=_0xf99e9d;if(_0x5c907c[_0x1463('0x2c')][_0x1463('0x3b')]){_0x2027a2[_0x1463('0x3c')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2027a2);})[_0x1463('0x22')](function(_0x5ea8b7){_0x29ae92['rows']=_0x5ea8b7;return _0x29ae92;});}})[_0x1463('0x22')](respondWithFilteredResult(_0x5e48dd,_0x2027a2))[_0x1463('0x3e')](handleError(_0x5e48dd,null));};exports[_0x1463('0x5c')]=function(_0x574ef9,_0x344257,_0x550426){var _0x1667f6={};var _0x2c7a69={};var _0x56cf47;var _0x3d8435;return db[_0x1463('0x28')]['findOne']({'where':{'id':_0x574ef9[_0x1463('0x3f')]['id']}})['then'](handleEntityNotFound(_0x344257,null))['then'](function(_0xa93d7f){if(_0xa93d7f){_0x56cf47=_0xa93d7f;_0x2c7a69[_0x1463('0x2b')]=_[_0x1463('0x2d')](db[_0x1463('0x5d')][_0x1463('0x29')]);_0x2c7a69['query']=_[_0x1463('0x2d')](_0x574ef9[_0x1463('0x2c')]);_0x2c7a69['filters']=_[_0x1463('0x2e')](_0x2c7a69['model'],_0x2c7a69['query']);_0x1667f6['attributes']=_['intersection'](_0x2c7a69[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x574ef9['query'][_0x1463('0x30')]));_0x1667f6[_0x1463('0x2f')]=_0x1667f6['attributes']['length']?_0x1667f6[_0x1463('0x2f')]:_0x2c7a69['model'];_0x1667f6['order']=qs[_0x1463('0x33')](_0x574ef9[_0x1463('0x2c')][_0x1463('0x33')]);_0x1667f6[_0x1463('0x34')]=qs[_0x1463('0x35')](_[_0x1463('0x36')](_0x574ef9['query'],_0x2c7a69[_0x1463('0x35')]));if(_0x574ef9['query'][_0x1463('0x37')]){_0x1667f6['where']=_[_0x1463('0x38')](_0x1667f6[_0x1463('0x34')],{'$or':_[_0x1463('0x27')](_0x1667f6['attributes'],function(_0x18ec73){var _0x1210a8={};_0x1210a8[_0x18ec73]={'$like':'%'+_0x574ef9['query'][_0x1463('0x37')]+'%'};return _0x1210a8;})});}_0x1667f6=_[_0x1463('0x38')]({},_0x1667f6,_0x574ef9[_0x1463('0x3a')]);return _0x56cf47[_0x1463('0x5c')](_0x1667f6);}})[_0x1463('0x22')](function(_0x59ea49){if(_0x59ea49){_0x3d8435=_0x59ea49[_0x1463('0x31')];if(!_0x574ef9[_0x1463('0x2c')][_0x1463('0x51')]('nolimit')){_0x1667f6['limit']=qs['limit'](_0x574ef9[_0x1463('0x2c')]['limit']);_0x1667f6['offset']=qs[_0x1463('0x17')](_0x574ef9[_0x1463('0x2c')][_0x1463('0x17')]);}return _0x56cf47[_0x1463('0x5c')](_0x1667f6);}})[_0x1463('0x22')](function(_0x3b9047){if(_0x3b9047){return _0x3b9047?{'count':_0x3d8435,'rows':_0x3b9047}:null;}})[_0x1463('0x22')](respondWithResult(_0x344257,null))[_0x1463('0x3e')](handleError(_0x344257,null));};exports[_0x1463('0x5e')]=function(_0x1b5d43,_0x47accd,_0x1af33c){var _0x2fd505,_0x1dd3e2;var _0x5c60df=[];var _0x555104=moment()[_0x1463('0x5f')](_0x1463('0x60'));return db[_0x1463('0x28')]['find']({'where':{'id':_0x1b5d43[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x47accd,null))[_0x1463('0x22')](function(_0x6a1c0c){if(_0x6a1c0c){_0x1dd3e2=_0x6a1c0c;return _0x6a1c0c[_0x1463('0x5e')](_0x1b5d43['body']['ids'],_['omit'](_0x1b5d43['body'],[_0x1463('0x61'),'id'])||{});}return null;})[_0x1463('0x62')](function(_0x5f3e63){var _0x151a0f;var _0x558875;_0x2fd505=_0x5f3e63||[];var _0x706271=[];if(_0x5f3e63){for(var _0x56e94e=0x0;_0x56e94e<_0x5f3e63[_0x1463('0x31')];_0x56e94e+=0x1){var _0x52d6ba=_0x5f3e63[_0x56e94e][_0x1463('0x45')]({'plain':!![]});_0x1dd3e2[_0x1463('0x63')]=_0x1b5d43['body'][_0x1463('0x63')]?_0x1b5d43[_0x1463('0x42')][_0x1463('0x63')]:_0x1dd3e2['dialCheckDuplicateType'];switch(_0x1dd3e2['dialCheckDuplicateType']){case'always':_0x151a0f=squel[_0x1463('0x64')]()['into'](_0x1463('0x65'))[_0x1463('0x66')]([_0x1463('0x67'),_0x1463('0x68'),_0x1463('0x69'),_0x1463('0x6a'),_0x1463('0x52'),_0x1463('0x6b'),'updatedAt'],squel[_0x1463('0x6c')]()['field'](_0x1463('0x67'),_0x1463('0x67'))[_0x1463('0x6d')]('NOW()','scheduledAt')[_0x1463('0x6d')]('id','ContactId')['field'](_0x52d6ba['CmListId']['toString'](),_0x1463('0x6a'))[_0x1463('0x6d')](_0x1b5d43[_0x1463('0x3f')]['id']['toString'](),_0x1463('0x52'))[_0x1463('0x6d')]('\x27'+_0x555104+'\x27','createdAt')[_0x1463('0x6d')]('\x27'+_0x555104+'\x27',_0x1463('0x4c'))[_0x1463('0x6e')]('cm_contacts')[_0x1463('0x34')](_0x1463('0x6f'))[_0x1463('0x34')]('ListId\x20=\x20?',_0x52d6ba[_0x1463('0x70')][_0x1463('0x71')]())[_0x1463('0x34')]('phone\x20IS\x20NOT\x20NULL')[_0x1463('0x34')](_0x1463('0x72'),squel[_0x1463('0x6c')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x1463('0x6e')](_0x1463('0x73'))[_0x1463('0x34')](_0x1463('0x74'),_0x1b5d43[_0x1463('0x3f')]['id'][_0x1463('0x71')]()))['where'](_0x1463('0x72'),squel[_0x1463('0x6c')]()[_0x1463('0x6d')](_0x1463('0x75'))[_0x1463('0x6e')]('cm_hopper')[_0x1463('0x34')](_0x1463('0x74'),_0x1b5d43[_0x1463('0x3f')]['id']['toString']())))[_0x1463('0x71')]();break;case _0x1463('0x76'):_0x151a0f=squel[_0x1463('0x64')]()[_0x1463('0x77')]('cm_hopper')['fromQuery']([_0x1463('0x67'),_0x1463('0x68'),_0x1463('0x69'),_0x1463('0x6a'),_0x1463('0x52'),'createdAt',_0x1463('0x4c')],squel[_0x1463('0x6c')]()[_0x1463('0x6d')](_0x1463('0x67'),_0x1463('0x67'))['field'](_0x1463('0x78'),_0x1463('0x68'))['field']('id',_0x1463('0x69'))[_0x1463('0x6d')](_0x52d6ba[_0x1463('0x70')]['toString'](),'ListId')[_0x1463('0x6d')](_0x1b5d43[_0x1463('0x3f')]['id']['toString'](),_0x1463('0x52'))['field']('\x27'+_0x555104+'\x27',_0x1463('0x6b'))[_0x1463('0x6d')]('\x27'+_0x555104+'\x27',_0x1463('0x4c'))[_0x1463('0x6e')](_0x1463('0x79'))['where'](_0x1463('0x6f'))[_0x1463('0x34')](_0x1463('0x7a'),_0x52d6ba['CmListId']['toString']())[_0x1463('0x34')](_0x1463('0x7b'))[_0x1463('0x34')](_0x1463('0x72'),squel[_0x1463('0x6c')]()[_0x1463('0x6d')](_0x1463('0x75'))[_0x1463('0x6e')](_0x1463('0x65'))[_0x1463('0x34')](_0x1463('0x74'),_0x1b5d43[_0x1463('0x3f')]['id'][_0x1463('0x71')]())))['toString']();break;default:_0x151a0f=squel[_0x1463('0x64')]()['into'](_0x1463('0x65'))[_0x1463('0x66')]([_0x1463('0x67'),'scheduledAt',_0x1463('0x69'),'ListId','CampaignId',_0x1463('0x6b'),'updatedAt'],squel[_0x1463('0x6c')]()[_0x1463('0x6d')](_0x1463('0x67'),_0x1463('0x67'))['field'](_0x1463('0x78'),_0x1463('0x68'))[_0x1463('0x6d')]('id',_0x1463('0x69'))[_0x1463('0x6d')](_0x52d6ba[_0x1463('0x70')][_0x1463('0x71')](),'ListId')[_0x1463('0x6d')](_0x1b5d43[_0x1463('0x3f')]['id'][_0x1463('0x71')](),_0x1463('0x52'))[_0x1463('0x6d')]('\x27'+_0x555104+'\x27',_0x1463('0x6b'))['field']('\x27'+_0x555104+'\x27',_0x1463('0x4c'))[_0x1463('0x6e')](_0x1463('0x79'))['where'](_0x1463('0x6f'))[_0x1463('0x34')](_0x1463('0x7a'),_0x52d6ba[_0x1463('0x70')][_0x1463('0x71')]())[_0x1463('0x34')](_0x1463('0x7b')))[_0x1463('0x71')]();}_0x558875=squel['insert']()[_0x1463('0x77')](_0x1463('0x7c'))['fromQuery']([_0x1463('0x7d'),'scheduledAt',_0x1463('0x67'),_0x1463('0x7e'),'createdAt',_0x1463('0x4c')],squel[_0x1463('0x6c')]()[_0x1463('0x6d')]('h.id','id')[_0x1463('0x6d')](_0x1463('0x78'),_0x1463('0x68'))[_0x1463('0x6d')]('ci.item',_0x1463('0x67'))[_0x1463('0x6d')]('ci.OrderBY','OrderBy')[_0x1463('0x6d')]('\x27'+_0x555104+'\x27','createdAt')[_0x1463('0x6d')]('\x27'+_0x555104+'\x27','updatedAt')[_0x1463('0x6e')](_0x1463('0x7f'),'ci')[_0x1463('0x80')]('cm_hopper','h','h.ContactId\x20=\x20ci.CmContactId')['where'](_0x1463('0x81'),_0x52d6ba[_0x1463('0x70')][_0x1463('0x71')]())['where'](_0x1463('0x82'),_0x1b5d43['params']['id'][_0x1463('0x71')]())[_0x1463('0x34')](_0x1463('0x83'),_0x555104))[_0x1463('0x71')]();_0x706271[_0x1463('0x84')](db[_0x1463('0x85')]['query'](_0x151a0f));_0x5c60df[_0x1463('0x84')](db[_0x1463('0x85')][_0x1463('0x2c')](_0x558875));}return BPromise[_0x1463('0x86')](_0x706271);}})[_0x1463('0x22')](function(){return BPromise[_0x1463('0x86')](_0x5c60df);})['then'](function(){return _0x2fd505;})[_0x1463('0x22')](respondWithResult(_0x47accd,null))['catch'](handleError(_0x47accd,null));};exports[_0x1463('0x87')]=function(_0x1090b0,_0x5b9281,_0x56a75f){return db['Campaign'][_0x1463('0x40')]({'where':{'id':_0x1090b0[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x5b9281,null))[_0x1463('0x22')](function(_0x3455a2){if(_0x3455a2){return _0x3455a2['removeLists'](_0x1090b0[_0x1463('0x2c')][_0x1463('0x61')]);}})[_0x1463('0x22')](function(_0x24746d){if(_0x24746d){return db[_0x1463('0x53')][_0x1463('0x21')]({'where':{'ListId':_0x1090b0[_0x1463('0x2c')][_0x1463('0x61')],'CampaignId':_0x1090b0[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](function(){return _0x24746d;});}})[_0x1463('0x22')](respondWithStatusCode(_0x5b9281,null))['catch'](handleError(_0x5b9281,null));};exports['getBlackLists']=function(_0x14f1a8,_0x15acad,_0x46777a){var _0x4369d6={};var _0x5e8cec={};var _0x29f238;var _0xb424f1;return db[_0x1463('0x28')][_0x1463('0x50')]({'where':{'id':_0x14f1a8[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x15acad,null))[_0x1463('0x22')](function(_0x570661){if(_0x570661){_0x29f238=_0x570661;_0x5e8cec[_0x1463('0x2b')]=_[_0x1463('0x2d')](db[_0x1463('0x5d')][_0x1463('0x29')]);_0x5e8cec[_0x1463('0x2c')]=_[_0x1463('0x2d')](_0x14f1a8[_0x1463('0x2c')]);_0x5e8cec['filters']=_[_0x1463('0x2e')](_0x5e8cec['model'],_0x5e8cec[_0x1463('0x2c')]);_0x4369d6[_0x1463('0x2f')]=_[_0x1463('0x2e')](_0x5e8cec[_0x1463('0x2b')],qs[_0x1463('0x30')](_0x14f1a8[_0x1463('0x2c')][_0x1463('0x30')]));_0x4369d6[_0x1463('0x2f')]=_0x4369d6[_0x1463('0x2f')][_0x1463('0x31')]?_0x4369d6['attributes']:_0x5e8cec['model'];_0x4369d6[_0x1463('0x32')]=qs['sort'](_0x14f1a8[_0x1463('0x2c')][_0x1463('0x33')]);_0x4369d6[_0x1463('0x34')]=qs['filters'](_['pick'](_0x14f1a8[_0x1463('0x2c')],_0x5e8cec[_0x1463('0x35')]));if(_0x14f1a8[_0x1463('0x2c')][_0x1463('0x37')]){_0x4369d6[_0x1463('0x34')]=_[_0x1463('0x38')](_0x4369d6[_0x1463('0x34')],{'$or':_[_0x1463('0x27')](_0x4369d6['attributes'],function(_0x9eb97e){var _0x21e5f9={};_0x21e5f9[_0x9eb97e]={'$like':'%'+_0x14f1a8['query'][_0x1463('0x37')]+'%'};return _0x21e5f9;})});}_0x4369d6=_[_0x1463('0x38')]({},_0x4369d6,_0x14f1a8[_0x1463('0x3a')]);return _0x29f238[_0x1463('0x88')](_0x4369d6);}})['then'](function(_0x31adcd){if(_0x31adcd){_0xb424f1=_0x31adcd[_0x1463('0x31')];if(!_0x14f1a8[_0x1463('0x2c')][_0x1463('0x51')](_0x1463('0x58'))){_0x4369d6['limit']=qs['limit'](_0x14f1a8['query'][_0x1463('0x19')]);_0x4369d6[_0x1463('0x17')]=qs[_0x1463('0x17')](_0x14f1a8[_0x1463('0x2c')]['offset']);}return _0x29f238['getBlackLists'](_0x4369d6);}})['then'](function(_0x49233f){if(_0x49233f){return _0x49233f?{'count':_0xb424f1,'rows':_0x49233f}:null;}})[_0x1463('0x22')](respondWithResult(_0x15acad,null))[_0x1463('0x3e')](handleError(_0x15acad,null));};exports['addBlackLists']=function(_0x49000e,_0x3628c3,_0xe20133){var _0x349544,_0x2ee4df;var _0x4e8f5e=[];var _0x44888a=moment()[_0x1463('0x5f')](_0x1463('0x60'));return db[_0x1463('0x28')]['find']({'where':{'id':_0x49000e[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x3628c3,null))[_0x1463('0x22')](function(_0x4c9c1e){if(_0x4c9c1e){_0x2ee4df=_0x4c9c1e;return _0x4c9c1e[_0x1463('0x89')](_0x49000e[_0x1463('0x42')][_0x1463('0x61')],_[_0x1463('0x4b')](_0x49000e[_0x1463('0x42')],[_0x1463('0x61'),'id'])||{});}return null;})[_0x1463('0x62')](function(_0x585fc7){var _0x15223f;var _0x1353f5;_0x349544=_0x585fc7||[];var _0x34066a=[];if(_0x585fc7){for(var _0x583272=0x0;_0x583272<_0x585fc7[_0x1463('0x31')];_0x583272+=0x1){var _0x579130=_0x585fc7[_0x583272][_0x1463('0x45')]({'plain':!![]});_0x15223f=squel['insert']()[_0x1463('0x77')]('cm_hopper_black')[_0x1463('0x66')]([_0x1463('0x67'),_0x1463('0x69'),_0x1463('0x6a'),_0x1463('0x52'),_0x1463('0x6b'),_0x1463('0x4c')],squel[_0x1463('0x6c')]()['field'](_0x1463('0x67'),_0x1463('0x67'))[_0x1463('0x6d')]('id',_0x1463('0x69'))['field'](_0x579130['CmListId'][_0x1463('0x71')](),_0x1463('0x6a'))[_0x1463('0x6d')](_0x49000e[_0x1463('0x3f')]['id'][_0x1463('0x71')](),_0x1463('0x52'))[_0x1463('0x6d')](_0x1463('0x78'),'createdAt')[_0x1463('0x6d')](_0x1463('0x78'),_0x1463('0x4c'))['from'](_0x1463('0x79'))[_0x1463('0x34')](_0x1463('0x6f'))['where']('ListId\x20=\x20?',_0x579130[_0x1463('0x70')][_0x1463('0x71')]())[_0x1463('0x34')](_0x1463('0x7b')))[_0x1463('0x71')]();_0x34066a[_0x1463('0x84')](db[_0x1463('0x85')][_0x1463('0x2c')](_0x15223f));}return BPromise[_0x1463('0x86')](_0x34066a);}})[_0x1463('0x22')](function(){return _0x349544;})[_0x1463('0x22')](respondWithResult(_0x3628c3,null))['catch'](handleError(_0x3628c3,null));};exports[_0x1463('0x8a')]=function(_0x4d0ca4,_0x598e80,_0x3d07a9){return db['Campaign'][_0x1463('0x40')]({'where':{'id':_0x4d0ca4[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](handleEntityNotFound(_0x598e80,null))['then'](function(_0x151a9f){if(_0x151a9f){return _0x151a9f['removeBlackLists'](_0x4d0ca4['query'][_0x1463('0x61')]);}})[_0x1463('0x22')](function(_0x113c67){if(_0x113c67){return db[_0x1463('0x5b')][_0x1463('0x21')]({'where':{'ListId':_0x4d0ca4[_0x1463('0x2c')][_0x1463('0x61')],'CampaignId':_0x4d0ca4[_0x1463('0x3f')]['id']}})[_0x1463('0x22')](function(){return _0x113c67;});}})[_0x1463('0x22')](respondWithStatusCode(_0x598e80,null))[_0x1463('0x3e')](handleError(_0x598e80,null));};
\ No newline at end of file
+var _0x6b72=['jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','Content-Range','apply','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','name','send','index','Campaign','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','filter','merge','options','include','findAll','rows','catch','params','keys','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','includeAll','createdAt','updatedAt','body','getHoppers','findOne','CmHopper','nolimit','order','CampaignId','CmHopperHistory','sort','CmHopperFinal','CmHopperBlack','getLists','CmList','addLists','YYYY-MM-DD\x20HH:mm:ss','ids','omit','spread','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','field','NOW()','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper_additional_phones','cmHopperId','OrderBy','h.id','ci.item','ci.OrderBY','cm_contact_has_items','h.ContactId\x20=\x20ci.CmContactId','h.ListId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','eml-format','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto'];(function(_0x373531,_0x4646bf){var _0x3d07ff=function(_0x1e68f5){while(--_0x1e68f5){_0x373531['push'](_0x373531['shift']());}};_0x3d07ff(++_0x4646bf);}(_0x6b72,0x19d));var _0x26b7=function(_0x22f2bf,_0xd36df4){_0x22f2bf=_0x22f2bf-0x0;var _0x45fcd8=_0x6b72[_0x22f2bf];return _0x45fcd8;};'use strict';var emlformat=require(_0x26b7('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x26b7('0x1'));var jsonpatch=require(_0x26b7('0x2'));var rp=require('request-promise');var moment=require(_0x26b7('0x3'));var BPromise=require(_0x26b7('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x26b7('0x5'));var sox=require(_0x26b7('0x6'));var csv=require(_0x26b7('0x7'));var ejs=require(_0x26b7('0x8'));var fs=require('fs');var fs_extra=require(_0x26b7('0x9'));var _=require(_0x26b7('0xa'));var squel=require(_0x26b7('0xb'));var crypto=require(_0x26b7('0xc'));var jsforce=require(_0x26b7('0xd'));var deskjs=require(_0x26b7('0xe'));var toCsv=require(_0x26b7('0x7'));var querystring=require('querystring');var Papa=require(_0x26b7('0xf'));var Redis=require(_0x26b7('0x10'));var authService=require(_0x26b7('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x26b7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x26b7('0x13'))('api');var utils=require(_0x26b7('0x14'));var config=require(_0x26b7('0x15'));var licenseUtil=require(_0x26b7('0x16'));var db=require(_0x26b7('0x17'))['db'];function respondWithStatusCode(_0x5dc52a,_0x2d1fd1){_0x2d1fd1=_0x2d1fd1||0xcc;return function(_0x3def02){if(_0x3def02){return _0x5dc52a[_0x26b7('0x18')](_0x2d1fd1);}return _0x5dc52a[_0x26b7('0x19')](_0x2d1fd1)[_0x26b7('0x1a')]();};}function respondWithResult(_0x1caaa0,_0x33b34d){_0x33b34d=_0x33b34d||0xc8;return function(_0xf54dee){if(_0xf54dee){return _0x1caaa0[_0x26b7('0x19')](_0x33b34d)[_0x26b7('0x1b')](_0xf54dee);}};}function respondWithFilteredResult(_0x57cae7,_0x3304b1){return function(_0x42f377){if(_0x42f377){var _0x1ed5c0=typeof _0x3304b1[_0x26b7('0x1c')]==='undefined'&&typeof _0x3304b1[_0x26b7('0x1d')]===_0x26b7('0x1e');var _0xb34693=_0x42f377[_0x26b7('0x1f')];var _0x3529b5=_0x1ed5c0?0x0:_0x3304b1['offset'];var _0x2876d9=_0x1ed5c0?_0x42f377[_0x26b7('0x1f')]:_0x3304b1[_0x26b7('0x1c')]+_0x3304b1['limit'];var _0x51edda;if(_0x2876d9>=_0xb34693){_0x2876d9=_0xb34693;_0x51edda=0xc8;}else{_0x51edda=0xce;}_0x57cae7[_0x26b7('0x19')](_0x51edda);return _0x57cae7[_0x26b7('0x20')](_0x26b7('0x21'),_0x3529b5+'-'+_0x2876d9+'/'+_0xb34693)[_0x26b7('0x1b')](_0x42f377);}return null;};}function patchUpdates(_0x58f987){return function(_0x97e10d){try{jsonpatch[_0x26b7('0x22')](_0x97e10d,_0x58f987,!![]);}catch(_0x539a73){return BPromise['reject'](_0x539a73);}return _0x97e10d['save']();};}function saveUpdates(_0x515609,_0x30c116){return function(_0x9327dd){if(_0x9327dd){return _0x9327dd[_0x26b7('0x23')](_0x515609)[_0x26b7('0x24')](function(_0x4b8b23){return _0x4b8b23;});}return null;};}function removeEntity(_0x545109,_0x499eb9){return function(_0x105036){if(_0x105036){return _0x105036[_0x26b7('0x25')]()[_0x26b7('0x24')](function(){var _0x2f751b=_0x105036[_0x26b7('0x26')]({'plain':!![]});var _0x3bc867=_0x26b7('0x27');return db[_0x26b7('0x28')][_0x26b7('0x25')]({'where':{'type':_0x3bc867,'resourceId':_0x2f751b['id']}})['then'](function(){return _0x105036;});})['then'](function(){_0x545109[_0x26b7('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e5b0f,_0x203e0f){return function(_0x172760){if(!_0x172760){_0x1e5b0f[_0x26b7('0x18')](0x194);}return _0x172760;};}function handleError(_0x2c2618,_0x39b567){_0x39b567=_0x39b567||0x1f4;return function(_0x1fbfe1){logger[_0x26b7('0x29')](_0x1fbfe1['stack']);if(_0x1fbfe1['name']){delete _0x1fbfe1[_0x26b7('0x2a')];}_0x2c2618[_0x26b7('0x19')](_0x39b567)[_0x26b7('0x2b')](_0x1fbfe1);};}exports[_0x26b7('0x2c')]=function(_0x4305ff,_0x2ce45c){var _0x2edc29={},_0x100954={},_0x3ded9b={'count':0x0,'rows':[]};var _0x555669=_['map'](db[_0x26b7('0x2d')][_0x26b7('0x2e')],function(_0x5f0335){return{'name':_0x5f0335[_0x26b7('0x2f')],'type':_0x5f0335[_0x26b7('0x30')][_0x26b7('0x31')]};});_0x100954[_0x26b7('0x32')]=_[_0x26b7('0x33')](_0x555669,_0x26b7('0x2a'));_0x100954['query']=_['keys'](_0x4305ff[_0x26b7('0x34')]);_0x100954[_0x26b7('0x35')]=_[_0x26b7('0x36')](_0x100954['model'],_0x100954[_0x26b7('0x34')]);_0x2edc29[_0x26b7('0x37')]=_[_0x26b7('0x36')](_0x100954[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x4305ff[_0x26b7('0x34')][_0x26b7('0x38')]));_0x2edc29[_0x26b7('0x37')]=_0x2edc29[_0x26b7('0x37')][_0x26b7('0x39')]?_0x2edc29[_0x26b7('0x37')]:_0x100954['model'];if(!_0x4305ff['query'][_0x26b7('0x3a')]('nolimit')){_0x2edc29['limit']=qs[_0x26b7('0x1d')](_0x4305ff[_0x26b7('0x34')][_0x26b7('0x1d')]);_0x2edc29['offset']=qs[_0x26b7('0x1c')](_0x4305ff[_0x26b7('0x34')]['offset']);}_0x2edc29['order']=qs['sort'](_0x4305ff[_0x26b7('0x34')]['sort']);_0x2edc29[_0x26b7('0x3b')]=qs[_0x26b7('0x35')](_[_0x26b7('0x3c')](_0x4305ff[_0x26b7('0x34')],_0x100954[_0x26b7('0x35')]),_0x555669);if(_0x4305ff['query'][_0x26b7('0x3d')]){_0x2edc29[_0x26b7('0x3b')]=_[_0x26b7('0x3e')](_0x2edc29['where'],{'$or':_['map'](_0x555669,function(_0x23ed73){if(_0x23ed73[_0x26b7('0x30')]!=='VIRTUAL'){var _0x14f3a6={};_0x14f3a6[_0x23ed73[_0x26b7('0x2a')]]={'$like':'%'+_0x4305ff[_0x26b7('0x34')][_0x26b7('0x3d')]+'%'};return _0x14f3a6;}})});}_0x2edc29=_[_0x26b7('0x3e')]({},_0x2edc29,_0x4305ff[_0x26b7('0x3f')]);var _0x2c5689={'where':_0x2edc29[_0x26b7('0x3b')]};return db[_0x26b7('0x2d')][_0x26b7('0x1f')](_0x2c5689)[_0x26b7('0x24')](function(_0x32433b){_0x3ded9b[_0x26b7('0x1f')]=_0x32433b;if(_0x4305ff[_0x26b7('0x34')]['includeAll']){_0x2edc29[_0x26b7('0x40')]=[{'all':!![]}];}return db[_0x26b7('0x2d')][_0x26b7('0x41')](_0x2edc29);})[_0x26b7('0x24')](function(_0xa5ee4b){_0x3ded9b[_0x26b7('0x42')]=_0xa5ee4b;return _0x3ded9b;})[_0x26b7('0x24')](respondWithFilteredResult(_0x2ce45c,_0x2edc29))[_0x26b7('0x43')](handleError(_0x2ce45c,null));};exports['show']=function(_0x361c0d,_0x59fd4d){var _0x5f3891={'raw':![],'where':{'id':_0x361c0d[_0x26b7('0x44')]['id']}},_0xa98580={};_0xa98580[_0x26b7('0x32')]=_[_0x26b7('0x45')](db['Campaign'][_0x26b7('0x2e')]);_0xa98580['query']=_['keys'](_0x361c0d['query']);_0xa98580[_0x26b7('0x35')]=_[_0x26b7('0x36')](_0xa98580[_0x26b7('0x32')],_0xa98580[_0x26b7('0x34')]);_0x5f3891[_0x26b7('0x37')]=_[_0x26b7('0x36')](_0xa98580[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x361c0d[_0x26b7('0x34')]['fields']));_0x5f3891['attributes']=_0x5f3891['attributes'][_0x26b7('0x39')]?_0x5f3891['attributes']:_0xa98580[_0x26b7('0x32')];if(_0x361c0d['query']['includeAll']){_0x5f3891[_0x26b7('0x40')]=[{'all':!![]}];}_0x5f3891=_[_0x26b7('0x3e')]({},_0x5f3891,_0x361c0d[_0x26b7('0x3f')]);return db[_0x26b7('0x2d')][_0x26b7('0x46')](_0x5f3891)[_0x26b7('0x24')](handleEntityNotFound(_0x59fd4d,null))[_0x26b7('0x24')](respondWithResult(_0x59fd4d,null))['catch'](handleError(_0x59fd4d,null));};exports[_0x26b7('0x47')]=function(_0x17747b,_0x255d4c){return db[_0x26b7('0x2d')][_0x26b7('0x47')](_0x17747b['body'],{})[_0x26b7('0x24')](function(_0x46bc98){var _0x5989d2=_0x17747b['user'][_0x26b7('0x26')]({'plain':!![]});if(!_0x5989d2)throw new Error(_0x26b7('0x48'));if(_0x5989d2[_0x26b7('0x49')]===_0x26b7('0x4a')){var _0x1ae010=_0x46bc98[_0x26b7('0x26')]({'plain':!![]});var _0x493a6a='IvrCampaigns';return db[_0x26b7('0x4b')][_0x26b7('0x46')]({'where':{'name':_0x493a6a,'userProfileId':_0x5989d2[_0x26b7('0x4c')]},'raw':!![]})[_0x26b7('0x24')](function(_0x2962ec){if(_0x2962ec&&_0x2962ec[_0x26b7('0x4d')]===0x0){return db[_0x26b7('0x28')]['create']({'name':_0x1ae010[_0x26b7('0x2a')],'resourceId':_0x1ae010['id'],'type':_0x2962ec[_0x26b7('0x2a')],'sectionId':_0x2962ec['id']},{})[_0x26b7('0x24')](function(){return _0x46bc98;});}else{return _0x46bc98;}})[_0x26b7('0x43')](function(_0x5ba4fa){logger[_0x26b7('0x29')](_0x26b7('0x4e'),_0x5ba4fa);throw _0x5ba4fa;});}return _0x46bc98;})[_0x26b7('0x24')](respondWithResult(_0x255d4c,0xc9))[_0x26b7('0x43')](handleError(_0x255d4c,null));};exports[_0x26b7('0x4f')]=function(_0x4e74d9,_0x1c3ff9){var _0x15628b={'where':{'id':_0x4e74d9[_0x26b7('0x44')]['id']}},_0x2b7b0e={};_0x2b7b0e[_0x26b7('0x32')]=_[_0x26b7('0x45')](db[_0x26b7('0x2d')][_0x26b7('0x2e')]);_0x15628b[_0x26b7('0x37')]=_[_0x26b7('0x36')](_0x2b7b0e[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x4e74d9[_0x26b7('0x34')][_0x26b7('0x38')]));_0x15628b['attributes']=_0x15628b[_0x26b7('0x37')][_0x26b7('0x39')]?_0x15628b[_0x26b7('0x37')]:_0x2b7b0e[_0x26b7('0x32')];if(_0x4e74d9['query'][_0x26b7('0x50')]){_0x15628b[_0x26b7('0x40')]=[{'all':!![]}];}_0x15628b=_['merge']({},_0x15628b,_0x4e74d9[_0x26b7('0x3f')]);return db[_0x26b7('0x2d')][_0x26b7('0x46')](_0x15628b)[_0x26b7('0x24')](handleEntityNotFound(_0x1c3ff9,null))[_0x26b7('0x24')](function(_0x222469){if(_0x222469){var _0x955d79=_0x222469[_0x26b7('0x26')]({'plain':!![]});_0x955d79=qs['omit'](_0x955d79,['id',_0x26b7('0x51'),_0x26b7('0x52')]);_0x4e74d9[_0x26b7('0x53')]=_['omit'](_0x4e74d9[_0x26b7('0x53')],['id',_0x26b7('0x51'),_0x26b7('0x52')]);return db['Campaign'][_0x26b7('0x47')](_[_0x26b7('0x3e')](_0x955d79,_0x4e74d9[_0x26b7('0x53')]),{'include':_0x4e74d9[_0x26b7('0x34')][_0x26b7('0x50')]?[{'all':!![]}]:undefined})[_0x26b7('0x24')](function(_0x1f89d2){var _0x32457e=_0x4e74d9['user']['get']({'plain':!![]});if(!_0x32457e)throw new Error(_0x26b7('0x48'));if(_0x32457e[_0x26b7('0x49')]==='user'){var _0x351d0b=_0x1f89d2[_0x26b7('0x26')]({'plain':!![]});var _0xfa7259=_0x26b7('0x27');return db[_0x26b7('0x4b')][_0x26b7('0x46')]({'where':{'name':_0xfa7259,'userProfileId':_0x32457e[_0x26b7('0x4c')]},'raw':!![]})['then'](function(_0x1deda6){if(_0x1deda6&&_0x1deda6[_0x26b7('0x4d')]===0x0){return db['UserProfileResource']['create']({'name':_0x351d0b[_0x26b7('0x2a')],'resourceId':_0x351d0b['id'],'type':_0x1deda6[_0x26b7('0x2a')],'sectionId':_0x1deda6['id']},{})[_0x26b7('0x24')](function(){return _0x1f89d2;});}else{return _0x1f89d2;}})[_0x26b7('0x43')](function(_0x35c9bf){logger[_0x26b7('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x35c9bf);throw _0x35c9bf;});}return _0x1f89d2;});}})[_0x26b7('0x24')](respondWithResult(_0x1c3ff9,0xc9))[_0x26b7('0x43')](handleError(_0x1c3ff9,null));};exports['update']=function(_0x4f5b9f,_0x366320){if(_0x4f5b9f[_0x26b7('0x53')]['id']){delete _0x4f5b9f[_0x26b7('0x53')]['id'];}return db[_0x26b7('0x2d')][_0x26b7('0x46')]({'where':{'id':_0x4f5b9f[_0x26b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x366320,null))['then'](saveUpdates(_0x4f5b9f['body'],null))[_0x26b7('0x24')](respondWithResult(_0x366320,null))[_0x26b7('0x43')](handleError(_0x366320,null));};exports[_0x26b7('0x25')]=function(_0x958c74,_0x2fd84f){return db[_0x26b7('0x2d')][_0x26b7('0x46')]({'where':{'id':_0x958c74[_0x26b7('0x44')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x2fd84f,null))['then'](removeEntity(_0x2fd84f,null))[_0x26b7('0x43')](handleError(_0x2fd84f,null));};exports[_0x26b7('0x54')]=function(_0x9a7cab,_0x57b493,_0x37017c){var _0x49ef55={'raw':!![],'where':{}};var _0x237895={};var _0x1b219c={'count':0x0,'rows':[]};return db[_0x26b7('0x2d')][_0x26b7('0x55')]({'where':{'id':_0x9a7cab['params']['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x57b493,null))[_0x26b7('0x24')](function(_0x47d12a){if(_0x47d12a){_0x237895[_0x26b7('0x32')]=_[_0x26b7('0x45')](db[_0x26b7('0x56')]['rawAttributes']);_0x237895[_0x26b7('0x34')]=_[_0x26b7('0x45')](_0x9a7cab[_0x26b7('0x34')]);_0x237895[_0x26b7('0x35')]=_[_0x26b7('0x36')](_0x237895[_0x26b7('0x32')],_0x237895[_0x26b7('0x34')]);_0x49ef55[_0x26b7('0x37')]=_[_0x26b7('0x36')](_0x237895['model'],qs[_0x26b7('0x38')](_0x9a7cab[_0x26b7('0x34')]['fields']));_0x49ef55[_0x26b7('0x37')]=_0x49ef55[_0x26b7('0x37')][_0x26b7('0x39')]?_0x49ef55[_0x26b7('0x37')]:_0x237895[_0x26b7('0x32')];if(!_0x9a7cab[_0x26b7('0x34')][_0x26b7('0x3a')](_0x26b7('0x57'))){_0x49ef55[_0x26b7('0x1d')]=qs[_0x26b7('0x1d')](_0x9a7cab['query'][_0x26b7('0x1d')]);_0x49ef55['offset']=qs[_0x26b7('0x1c')](_0x9a7cab[_0x26b7('0x34')][_0x26b7('0x1c')]);}_0x49ef55[_0x26b7('0x58')]=qs['sort'](_0x9a7cab[_0x26b7('0x34')]['sort']);_0x49ef55[_0x26b7('0x3b')]=qs[_0x26b7('0x35')](_[_0x26b7('0x3c')](_0x9a7cab[_0x26b7('0x34')],_0x237895['filters']));_0x49ef55[_0x26b7('0x3b')][_0x26b7('0x59')]=_0x47d12a['id'];if(_0x9a7cab[_0x26b7('0x34')]['filter']){_0x49ef55[_0x26b7('0x3b')]=_[_0x26b7('0x3e')](_0x49ef55[_0x26b7('0x3b')],{'$or':_[_0x26b7('0x33')](_0x49ef55[_0x26b7('0x37')],function(_0x2fc262){var _0x5b360f={};_0x5b360f[_0x2fc262]={'$like':'%'+_0x9a7cab[_0x26b7('0x34')]['filter']+'%'};return _0x5b360f;})});}_0x49ef55=_['merge']({},_0x49ef55,_0x9a7cab[_0x26b7('0x3f')]);return db[_0x26b7('0x56')][_0x26b7('0x1f')]({'where':_0x49ef55['where']})[_0x26b7('0x24')](function(_0x389b56){_0x1b219c['count']=_0x389b56;if(_0x9a7cab[_0x26b7('0x34')]['includeAll']){_0x49ef55[_0x26b7('0x40')]=[{'all':!![]}];}return db['CmHopper'][_0x26b7('0x41')](_0x49ef55);})[_0x26b7('0x24')](function(_0x5a6578){_0x1b219c[_0x26b7('0x42')]=_0x5a6578;return _0x1b219c;});}})[_0x26b7('0x24')](respondWithFilteredResult(_0x57b493,_0x49ef55))[_0x26b7('0x43')](handleError(_0x57b493,null));};exports['getHopperHistories']=function(_0xc4bbce,_0x23a231,_0x2361fa){var _0x5325a0={'raw':!![],'where':{}};var _0x4c8117={};var _0x51b384={'count':0x0,'rows':[]};return db[_0x26b7('0x2d')][_0x26b7('0x55')]({'where':{'id':_0xc4bbce[_0x26b7('0x44')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x23a231,null))[_0x26b7('0x24')](function(_0x23643b){if(_0x23643b){_0x4c8117[_0x26b7('0x32')]=_[_0x26b7('0x45')](db[_0x26b7('0x5a')][_0x26b7('0x2e')]);_0x4c8117[_0x26b7('0x34')]=_[_0x26b7('0x45')](_0xc4bbce[_0x26b7('0x34')]);_0x4c8117[_0x26b7('0x35')]=_[_0x26b7('0x36')](_0x4c8117[_0x26b7('0x32')],_0x4c8117[_0x26b7('0x34')]);_0x5325a0[_0x26b7('0x37')]=_[_0x26b7('0x36')](_0x4c8117[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0xc4bbce['query'][_0x26b7('0x38')]));_0x5325a0[_0x26b7('0x37')]=_0x5325a0[_0x26b7('0x37')]['length']?_0x5325a0[_0x26b7('0x37')]:_0x4c8117[_0x26b7('0x32')];if(!_0xc4bbce[_0x26b7('0x34')][_0x26b7('0x3a')](_0x26b7('0x57'))){_0x5325a0[_0x26b7('0x1d')]=qs[_0x26b7('0x1d')](_0xc4bbce[_0x26b7('0x34')][_0x26b7('0x1d')]);_0x5325a0['offset']=qs[_0x26b7('0x1c')](_0xc4bbce[_0x26b7('0x34')][_0x26b7('0x1c')]);}_0x5325a0[_0x26b7('0x58')]=qs[_0x26b7('0x5b')](_0xc4bbce[_0x26b7('0x34')][_0x26b7('0x5b')]);_0x5325a0[_0x26b7('0x3b')]=qs[_0x26b7('0x35')](_['pick'](_0xc4bbce[_0x26b7('0x34')],_0x4c8117[_0x26b7('0x35')]));_0x5325a0[_0x26b7('0x3b')][_0x26b7('0x59')]=_0x23643b['id'];if(_0xc4bbce[_0x26b7('0x34')][_0x26b7('0x3d')]){_0x5325a0['where']=_[_0x26b7('0x3e')](_0x5325a0[_0x26b7('0x3b')],{'$or':_[_0x26b7('0x33')](_0x5325a0['attributes'],function(_0x480ef7){var _0x264d4b={};_0x264d4b[_0x480ef7]={'$like':'%'+_0xc4bbce[_0x26b7('0x34')][_0x26b7('0x3d')]+'%'};return _0x264d4b;})});}_0x5325a0=_[_0x26b7('0x3e')]({},_0x5325a0,_0xc4bbce['options']);return db[_0x26b7('0x5a')][_0x26b7('0x1f')]({'where':_0x5325a0[_0x26b7('0x3b')]})[_0x26b7('0x24')](function(_0x2dffed){_0x51b384[_0x26b7('0x1f')]=_0x2dffed;if(_0xc4bbce[_0x26b7('0x34')]['includeAll']){_0x5325a0[_0x26b7('0x40')]=[{'all':!![]}];}return db[_0x26b7('0x5a')][_0x26b7('0x41')](_0x5325a0);})[_0x26b7('0x24')](function(_0x35870e){_0x51b384[_0x26b7('0x42')]=_0x35870e;return _0x51b384;});}})['then'](respondWithFilteredResult(_0x23a231,_0x5325a0))[_0x26b7('0x43')](handleError(_0x23a231,null));};exports['getHopperFinals']=function(_0x15c97a,_0x141975,_0x386810){var _0x2c5806={'raw':!![],'where':{}};var _0x13a9d4={};var _0x5962c9={'count':0x0,'rows':[]};return db[_0x26b7('0x2d')]['findOne']({'where':{'id':_0x15c97a[_0x26b7('0x44')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x141975,null))[_0x26b7('0x24')](function(_0x39fb2f){if(_0x39fb2f){_0x13a9d4[_0x26b7('0x32')]=_[_0x26b7('0x45')](db[_0x26b7('0x5c')][_0x26b7('0x2e')]);_0x13a9d4['query']=_[_0x26b7('0x45')](_0x15c97a[_0x26b7('0x34')]);_0x13a9d4['filters']=_['intersection'](_0x13a9d4[_0x26b7('0x32')],_0x13a9d4[_0x26b7('0x34')]);_0x2c5806['attributes']=_[_0x26b7('0x36')](_0x13a9d4[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x15c97a[_0x26b7('0x34')][_0x26b7('0x38')]));_0x2c5806['attributes']=_0x2c5806[_0x26b7('0x37')][_0x26b7('0x39')]?_0x2c5806[_0x26b7('0x37')]:_0x13a9d4[_0x26b7('0x32')];if(!_0x15c97a[_0x26b7('0x34')]['hasOwnProperty'](_0x26b7('0x57'))){_0x2c5806[_0x26b7('0x1d')]=qs['limit'](_0x15c97a['query'][_0x26b7('0x1d')]);_0x2c5806[_0x26b7('0x1c')]=qs[_0x26b7('0x1c')](_0x15c97a[_0x26b7('0x34')]['offset']);}_0x2c5806[_0x26b7('0x58')]=qs[_0x26b7('0x5b')](_0x15c97a['query'][_0x26b7('0x5b')]);_0x2c5806[_0x26b7('0x3b')]=qs[_0x26b7('0x35')](_[_0x26b7('0x3c')](_0x15c97a['query'],_0x13a9d4[_0x26b7('0x35')]));_0x2c5806[_0x26b7('0x3b')][_0x26b7('0x59')]=_0x39fb2f['id'];if(_0x15c97a['query']['filter']){_0x2c5806[_0x26b7('0x3b')]=_[_0x26b7('0x3e')](_0x2c5806[_0x26b7('0x3b')],{'$or':_[_0x26b7('0x33')](_0x2c5806[_0x26b7('0x37')],function(_0x398c28){var _0x344644={};_0x344644[_0x398c28]={'$like':'%'+_0x15c97a[_0x26b7('0x34')][_0x26b7('0x3d')]+'%'};return _0x344644;})});}_0x2c5806=_[_0x26b7('0x3e')]({},_0x2c5806,_0x15c97a['options']);return db[_0x26b7('0x5c')][_0x26b7('0x1f')]({'where':_0x2c5806['where']})['then'](function(_0x2cd4fe){_0x5962c9['count']=_0x2cd4fe;if(_0x15c97a[_0x26b7('0x34')][_0x26b7('0x50')]){_0x2c5806['include']=[{'all':!![]}];}return db[_0x26b7('0x5c')][_0x26b7('0x41')](_0x2c5806);})['then'](function(_0x33a5fb){_0x5962c9[_0x26b7('0x42')]=_0x33a5fb;return _0x5962c9;});}})['then'](respondWithFilteredResult(_0x141975,_0x2c5806))['catch'](handleError(_0x141975,null));};exports['getHopperBlacks']=function(_0x2ce881,_0x3484e6,_0x275c59){var _0x1c2233={'raw':!![],'where':{}};var _0x462b80={};var _0x3358bc={'count':0x0,'rows':[]};return db[_0x26b7('0x2d')][_0x26b7('0x55')]({'where':{'id':_0x2ce881[_0x26b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x3484e6,null))['then'](function(_0x50abcc){if(_0x50abcc){_0x462b80['model']=_[_0x26b7('0x45')](db[_0x26b7('0x5d')][_0x26b7('0x2e')]);_0x462b80[_0x26b7('0x34')]=_[_0x26b7('0x45')](_0x2ce881[_0x26b7('0x34')]);_0x462b80[_0x26b7('0x35')]=_[_0x26b7('0x36')](_0x462b80[_0x26b7('0x32')],_0x462b80[_0x26b7('0x34')]);_0x1c2233[_0x26b7('0x37')]=_['intersection'](_0x462b80[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x2ce881[_0x26b7('0x34')][_0x26b7('0x38')]));_0x1c2233['attributes']=_0x1c2233[_0x26b7('0x37')][_0x26b7('0x39')]?_0x1c2233['attributes']:_0x462b80['model'];if(!_0x2ce881[_0x26b7('0x34')]['hasOwnProperty']('nolimit')){_0x1c2233['limit']=qs[_0x26b7('0x1d')](_0x2ce881[_0x26b7('0x34')][_0x26b7('0x1d')]);_0x1c2233['offset']=qs[_0x26b7('0x1c')](_0x2ce881[_0x26b7('0x34')][_0x26b7('0x1c')]);}_0x1c2233['order']=qs['sort'](_0x2ce881[_0x26b7('0x34')][_0x26b7('0x5b')]);_0x1c2233['where']=qs[_0x26b7('0x35')](_[_0x26b7('0x3c')](_0x2ce881[_0x26b7('0x34')],_0x462b80['filters']));_0x1c2233[_0x26b7('0x3b')][_0x26b7('0x59')]=_0x50abcc['id'];if(_0x2ce881[_0x26b7('0x34')][_0x26b7('0x3d')]){_0x1c2233[_0x26b7('0x3b')]=_[_0x26b7('0x3e')](_0x1c2233[_0x26b7('0x3b')],{'$or':_[_0x26b7('0x33')](_0x1c2233['attributes'],function(_0x32ef69){var _0xcda633={};_0xcda633[_0x32ef69]={'$like':'%'+_0x2ce881['query'][_0x26b7('0x3d')]+'%'};return _0xcda633;})});}_0x1c2233=_[_0x26b7('0x3e')]({},_0x1c2233,_0x2ce881[_0x26b7('0x3f')]);return db[_0x26b7('0x5d')][_0x26b7('0x1f')]({'where':_0x1c2233[_0x26b7('0x3b')]})[_0x26b7('0x24')](function(_0x2a1e96){_0x3358bc[_0x26b7('0x1f')]=_0x2a1e96;if(_0x2ce881[_0x26b7('0x34')]['includeAll']){_0x1c2233[_0x26b7('0x40')]=[{'all':!![]}];}return db[_0x26b7('0x5d')][_0x26b7('0x41')](_0x1c2233);})['then'](function(_0x26daf7){_0x3358bc[_0x26b7('0x42')]=_0x26daf7;return _0x3358bc;});}})['then'](respondWithFilteredResult(_0x3484e6,_0x1c2233))[_0x26b7('0x43')](handleError(_0x3484e6,null));};exports[_0x26b7('0x5e')]=function(_0x1ebaab,_0x41bf89,_0x24d589){var _0x24152e={};var _0x4a6e57={};var _0x5d47a3;var _0x193a6b;return db[_0x26b7('0x2d')][_0x26b7('0x55')]({'where':{'id':_0x1ebaab[_0x26b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x41bf89,null))[_0x26b7('0x24')](function(_0x1515cb){if(_0x1515cb){_0x5d47a3=_0x1515cb;_0x4a6e57[_0x26b7('0x32')]=_[_0x26b7('0x45')](db[_0x26b7('0x5f')][_0x26b7('0x2e')]);_0x4a6e57['query']=_['keys'](_0x1ebaab[_0x26b7('0x34')]);_0x4a6e57[_0x26b7('0x35')]=_[_0x26b7('0x36')](_0x4a6e57['model'],_0x4a6e57[_0x26b7('0x34')]);_0x24152e['attributes']=_['intersection'](_0x4a6e57[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x1ebaab[_0x26b7('0x34')][_0x26b7('0x38')]));_0x24152e[_0x26b7('0x37')]=_0x24152e[_0x26b7('0x37')][_0x26b7('0x39')]?_0x24152e[_0x26b7('0x37')]:_0x4a6e57[_0x26b7('0x32')];_0x24152e[_0x26b7('0x58')]=qs[_0x26b7('0x5b')](_0x1ebaab[_0x26b7('0x34')]['sort']);_0x24152e[_0x26b7('0x3b')]=qs[_0x26b7('0x35')](_[_0x26b7('0x3c')](_0x1ebaab[_0x26b7('0x34')],_0x4a6e57[_0x26b7('0x35')]));if(_0x1ebaab['query']['filter']){_0x24152e[_0x26b7('0x3b')]=_[_0x26b7('0x3e')](_0x24152e[_0x26b7('0x3b')],{'$or':_[_0x26b7('0x33')](_0x24152e[_0x26b7('0x37')],function(_0x5cacbf){var _0x483253={};_0x483253[_0x5cacbf]={'$like':'%'+_0x1ebaab['query'][_0x26b7('0x3d')]+'%'};return _0x483253;})});}_0x24152e=_['merge']({},_0x24152e,_0x1ebaab[_0x26b7('0x3f')]);return _0x5d47a3[_0x26b7('0x5e')](_0x24152e);}})[_0x26b7('0x24')](function(_0xf6e528){if(_0xf6e528){_0x193a6b=_0xf6e528[_0x26b7('0x39')];if(!_0x1ebaab['query'][_0x26b7('0x3a')](_0x26b7('0x57'))){_0x24152e['limit']=qs[_0x26b7('0x1d')](_0x1ebaab[_0x26b7('0x34')][_0x26b7('0x1d')]);_0x24152e['offset']=qs[_0x26b7('0x1c')](_0x1ebaab[_0x26b7('0x34')][_0x26b7('0x1c')]);}return _0x5d47a3[_0x26b7('0x5e')](_0x24152e);}})[_0x26b7('0x24')](function(_0x39efde){if(_0x39efde){return _0x39efde?{'count':_0x193a6b,'rows':_0x39efde}:null;}})[_0x26b7('0x24')](respondWithResult(_0x41bf89,null))[_0x26b7('0x43')](handleError(_0x41bf89,null));};exports[_0x26b7('0x60')]=function(_0x40f458,_0x59490a,_0x4ee8e3){var _0x679e55,_0x2a6507;var _0x1ea053=[];var _0x47e0ff=moment()['format'](_0x26b7('0x61'));return db[_0x26b7('0x2d')][_0x26b7('0x46')]({'where':{'id':_0x40f458[_0x26b7('0x44')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x59490a,null))[_0x26b7('0x24')](function(_0x33b8d5){if(_0x33b8d5){_0x2a6507=_0x33b8d5;return _0x33b8d5[_0x26b7('0x60')](_0x40f458[_0x26b7('0x53')][_0x26b7('0x62')],_[_0x26b7('0x63')](_0x40f458[_0x26b7('0x53')],['ids','id'])||{});}return null;})[_0x26b7('0x64')](function(_0x4a3933){var _0x387ee1;var _0xf4e734;_0x679e55=_0x4a3933||[];var _0x1c3996=[];if(_0x4a3933){for(var _0x370afe=0x0;_0x370afe<_0x4a3933[_0x26b7('0x39')];_0x370afe+=0x1){var _0x4aed50=_0x4a3933[_0x370afe][_0x26b7('0x26')]({'plain':!![]});_0x2a6507[_0x26b7('0x65')]=_0x40f458[_0x26b7('0x53')]['dialCheckDuplicateType']?_0x40f458[_0x26b7('0x53')][_0x26b7('0x65')]:_0x2a6507[_0x26b7('0x65')];switch(_0x2a6507[_0x26b7('0x65')]){case'always':_0x387ee1=squel[_0x26b7('0x66')]()[_0x26b7('0x67')](_0x26b7('0x68'))[_0x26b7('0x69')]([_0x26b7('0x6a'),_0x26b7('0x6b'),_0x26b7('0x6c'),_0x26b7('0x6d'),_0x26b7('0x59'),'createdAt','updatedAt'],squel['select']()['field'](_0x26b7('0x6a'),'phone')[_0x26b7('0x6e')](_0x26b7('0x6f'),_0x26b7('0x6b'))[_0x26b7('0x6e')]('id',_0x26b7('0x6c'))[_0x26b7('0x6e')](_0x4aed50['CmListId'][_0x26b7('0x70')](),_0x26b7('0x6d'))['field'](_0x40f458[_0x26b7('0x44')]['id']['toString'](),_0x26b7('0x59'))[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x51'))[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x52'))[_0x26b7('0x71')](_0x26b7('0x72'))[_0x26b7('0x3b')](_0x26b7('0x73'))['where'](_0x26b7('0x74'),_0x4aed50[_0x26b7('0x75')][_0x26b7('0x70')]())[_0x26b7('0x3b')](_0x26b7('0x76'))['where'](_0x26b7('0x77'),squel[_0x26b7('0x78')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x26b7('0x71')](_0x26b7('0x79'))[_0x26b7('0x3b')](_0x26b7('0x7a'),_0x40f458[_0x26b7('0x44')]['id']['toString']()))[_0x26b7('0x3b')](_0x26b7('0x77'),squel[_0x26b7('0x78')]()['field'](_0x26b7('0x7b'))[_0x26b7('0x71')]('cm_hopper')[_0x26b7('0x3b')]('CampaignId\x20=\x20?',_0x40f458[_0x26b7('0x44')]['id'][_0x26b7('0x70')]())))[_0x26b7('0x70')]();break;case _0x26b7('0x7c'):_0x387ee1=squel[_0x26b7('0x66')]()[_0x26b7('0x67')](_0x26b7('0x68'))['fromQuery']([_0x26b7('0x6a'),_0x26b7('0x6b'),_0x26b7('0x6c'),_0x26b7('0x6d'),'CampaignId',_0x26b7('0x51'),'updatedAt'],squel[_0x26b7('0x78')]()[_0x26b7('0x6e')]('phone',_0x26b7('0x6a'))[_0x26b7('0x6e')](_0x26b7('0x6f'),'scheduledAt')['field']('id','ContactId')['field'](_0x4aed50[_0x26b7('0x75')]['toString'](),_0x26b7('0x6d'))[_0x26b7('0x6e')](_0x40f458[_0x26b7('0x44')]['id'][_0x26b7('0x70')](),_0x26b7('0x59'))[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x51'))['field']('\x27'+_0x47e0ff+'\x27',_0x26b7('0x52'))['from']('cm_contacts')['where'](_0x26b7('0x73'))['where'](_0x26b7('0x74'),_0x4aed50[_0x26b7('0x75')][_0x26b7('0x70')]())['where'](_0x26b7('0x76'))['where'](_0x26b7('0x77'),squel['select']()['field']('COALESCE(phone,\x27\x27)')[_0x26b7('0x71')](_0x26b7('0x68'))[_0x26b7('0x3b')](_0x26b7('0x7a'),_0x40f458[_0x26b7('0x44')]['id'][_0x26b7('0x70')]())))['toString']();break;default:_0x387ee1=squel['insert']()[_0x26b7('0x67')](_0x26b7('0x68'))['fromQuery']([_0x26b7('0x6a'),_0x26b7('0x6b'),_0x26b7('0x6c'),_0x26b7('0x6d'),_0x26b7('0x59'),_0x26b7('0x51'),_0x26b7('0x52')],squel['select']()[_0x26b7('0x6e')](_0x26b7('0x6a'),_0x26b7('0x6a'))[_0x26b7('0x6e')](_0x26b7('0x6f'),_0x26b7('0x6b'))['field']('id',_0x26b7('0x6c'))[_0x26b7('0x6e')](_0x4aed50[_0x26b7('0x75')][_0x26b7('0x70')](),_0x26b7('0x6d'))[_0x26b7('0x6e')](_0x40f458[_0x26b7('0x44')]['id'][_0x26b7('0x70')](),'CampaignId')[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x51'))[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x52'))[_0x26b7('0x71')](_0x26b7('0x72'))[_0x26b7('0x3b')](_0x26b7('0x73'))[_0x26b7('0x3b')](_0x26b7('0x74'),_0x4aed50[_0x26b7('0x75')][_0x26b7('0x70')]())[_0x26b7('0x3b')](_0x26b7('0x76')))['toString']();}_0xf4e734=squel[_0x26b7('0x66')]()[_0x26b7('0x67')](_0x26b7('0x7d'))[_0x26b7('0x69')]([_0x26b7('0x7e'),'scheduledAt',_0x26b7('0x6a'),_0x26b7('0x7f'),_0x26b7('0x51'),_0x26b7('0x52')],squel['select']()[_0x26b7('0x6e')](_0x26b7('0x80'),'id')[_0x26b7('0x6e')]('NOW()',_0x26b7('0x6b'))[_0x26b7('0x6e')](_0x26b7('0x81'),'phone')[_0x26b7('0x6e')](_0x26b7('0x82'),_0x26b7('0x7f'))[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x51'))[_0x26b7('0x6e')]('\x27'+_0x47e0ff+'\x27',_0x26b7('0x52'))[_0x26b7('0x71')](_0x26b7('0x83'),'ci')['join'](_0x26b7('0x68'),'h',_0x26b7('0x84'))[_0x26b7('0x3b')](_0x26b7('0x85'),_0x4aed50[_0x26b7('0x75')][_0x26b7('0x70')]())[_0x26b7('0x3b')]('h.CampaignId=?',_0x40f458['params']['id'][_0x26b7('0x70')]())[_0x26b7('0x3b')]('h.createdAt\x20=\x20?',_0x47e0ff))['toString']();_0x1c3996[_0x26b7('0x86')](db['sequelize'][_0x26b7('0x34')](_0x387ee1));_0x1ea053[_0x26b7('0x86')](db[_0x26b7('0x87')][_0x26b7('0x34')](_0xf4e734));}return BPromise[_0x26b7('0x88')](_0x1c3996);}})['then'](function(){return BPromise[_0x26b7('0x88')](_0x1ea053);})[_0x26b7('0x24')](function(){return _0x679e55;})[_0x26b7('0x24')](respondWithResult(_0x59490a,null))[_0x26b7('0x43')](handleError(_0x59490a,null));};exports[_0x26b7('0x89')]=function(_0x5af56e,_0x5d552a,_0x2808f9){return db[_0x26b7('0x2d')][_0x26b7('0x46')]({'where':{'id':_0x5af56e[_0x26b7('0x44')]['id']}})['then'](handleEntityNotFound(_0x5d552a,null))['then'](function(_0x53b2cb){if(_0x53b2cb){return _0x53b2cb[_0x26b7('0x89')](_0x5af56e[_0x26b7('0x34')][_0x26b7('0x62')]);}})[_0x26b7('0x24')](function(_0x36d8c2){if(_0x36d8c2){return db[_0x26b7('0x56')][_0x26b7('0x25')]({'where':{'ListId':_0x5af56e[_0x26b7('0x34')][_0x26b7('0x62')],'CampaignId':_0x5af56e[_0x26b7('0x44')]['id']}})[_0x26b7('0x24')](function(){return _0x36d8c2;});}})[_0x26b7('0x24')](respondWithStatusCode(_0x5d552a,null))[_0x26b7('0x43')](handleError(_0x5d552a,null));};exports[_0x26b7('0x8a')]=function(_0x57f6ba,_0x52c677,_0x2be56c){var _0x1cc563={};var _0x2914e5={};var _0x3df24a;var _0x47f95d;return db[_0x26b7('0x2d')][_0x26b7('0x55')]({'where':{'id':_0x57f6ba['params']['id']}})['then'](handleEntityNotFound(_0x52c677,null))['then'](function(_0x174c82){if(_0x174c82){_0x3df24a=_0x174c82;_0x2914e5['model']=_[_0x26b7('0x45')](db[_0x26b7('0x5f')][_0x26b7('0x2e')]);_0x2914e5[_0x26b7('0x34')]=_['keys'](_0x57f6ba[_0x26b7('0x34')]);_0x2914e5['filters']=_[_0x26b7('0x36')](_0x2914e5['model'],_0x2914e5[_0x26b7('0x34')]);_0x1cc563[_0x26b7('0x37')]=_[_0x26b7('0x36')](_0x2914e5[_0x26b7('0x32')],qs[_0x26b7('0x38')](_0x57f6ba['query'][_0x26b7('0x38')]));_0x1cc563[_0x26b7('0x37')]=_0x1cc563[_0x26b7('0x37')][_0x26b7('0x39')]?_0x1cc563[_0x26b7('0x37')]:_0x2914e5['model'];_0x1cc563['order']=qs['sort'](_0x57f6ba[_0x26b7('0x34')]['sort']);_0x1cc563[_0x26b7('0x3b')]=qs[_0x26b7('0x35')](_['pick'](_0x57f6ba[_0x26b7('0x34')],_0x2914e5[_0x26b7('0x35')]));if(_0x57f6ba[_0x26b7('0x34')][_0x26b7('0x3d')]){_0x1cc563['where']=_[_0x26b7('0x3e')](_0x1cc563[_0x26b7('0x3b')],{'$or':_['map'](_0x1cc563[_0x26b7('0x37')],function(_0x2540c0){var _0x320a7a={};_0x320a7a[_0x2540c0]={'$like':'%'+_0x57f6ba[_0x26b7('0x34')][_0x26b7('0x3d')]+'%'};return _0x320a7a;})});}_0x1cc563=_[_0x26b7('0x3e')]({},_0x1cc563,_0x57f6ba['options']);return _0x3df24a['getBlackLists'](_0x1cc563);}})[_0x26b7('0x24')](function(_0x5a779a){if(_0x5a779a){_0x47f95d=_0x5a779a[_0x26b7('0x39')];if(!_0x57f6ba['query']['hasOwnProperty'](_0x26b7('0x57'))){_0x1cc563[_0x26b7('0x1d')]=qs['limit'](_0x57f6ba[_0x26b7('0x34')]['limit']);_0x1cc563['offset']=qs['offset'](_0x57f6ba[_0x26b7('0x34')]['offset']);}return _0x3df24a[_0x26b7('0x8a')](_0x1cc563);}})[_0x26b7('0x24')](function(_0x438e5e){if(_0x438e5e){return _0x438e5e?{'count':_0x47f95d,'rows':_0x438e5e}:null;}})[_0x26b7('0x24')](respondWithResult(_0x52c677,null))[_0x26b7('0x43')](handleError(_0x52c677,null));};exports[_0x26b7('0x8b')]=function(_0xed2705,_0x2ac9cc,_0x584244){var _0x461124,_0x13f4ed;var _0x43b4b2=[];var _0x3bf522=moment()['format'](_0x26b7('0x61'));return db[_0x26b7('0x2d')][_0x26b7('0x46')]({'where':{'id':_0xed2705[_0x26b7('0x44')]['id']}})[_0x26b7('0x24')](handleEntityNotFound(_0x2ac9cc,null))[_0x26b7('0x24')](function(_0x2aa5d7){if(_0x2aa5d7){_0x13f4ed=_0x2aa5d7;return _0x2aa5d7[_0x26b7('0x8b')](_0xed2705[_0x26b7('0x53')][_0x26b7('0x62')],_['omit'](_0xed2705[_0x26b7('0x53')],['ids','id'])||{});}return null;})[_0x26b7('0x64')](function(_0x3cdc7f){var _0x3322cf;var _0x4dd5d0;_0x461124=_0x3cdc7f||[];var _0x109a8d=[];if(_0x3cdc7f){for(var _0x1b2ecc=0x0;_0x1b2ecc<_0x3cdc7f[_0x26b7('0x39')];_0x1b2ecc+=0x1){var _0x5256dd=_0x3cdc7f[_0x1b2ecc][_0x26b7('0x26')]({'plain':!![]});_0x3322cf=squel['insert']()[_0x26b7('0x67')](_0x26b7('0x8c'))[_0x26b7('0x69')]([_0x26b7('0x6a'),_0x26b7('0x6c'),_0x26b7('0x6d'),'CampaignId',_0x26b7('0x51'),_0x26b7('0x52')],squel['select']()[_0x26b7('0x6e')](_0x26b7('0x6a'),_0x26b7('0x6a'))[_0x26b7('0x6e')]('id',_0x26b7('0x6c'))[_0x26b7('0x6e')](_0x5256dd[_0x26b7('0x75')][_0x26b7('0x70')](),'ListId')[_0x26b7('0x6e')](_0xed2705['params']['id'][_0x26b7('0x70')](),_0x26b7('0x59'))['field'](_0x26b7('0x6f'),'createdAt')[_0x26b7('0x6e')](_0x26b7('0x6f'),_0x26b7('0x52'))['from']('cm_contacts')[_0x26b7('0x3b')](_0x26b7('0x73'))[_0x26b7('0x3b')](_0x26b7('0x74'),_0x5256dd[_0x26b7('0x75')]['toString']())[_0x26b7('0x3b')](_0x26b7('0x76')))[_0x26b7('0x70')]();_0x109a8d[_0x26b7('0x86')](db[_0x26b7('0x87')]['query'](_0x3322cf));}return BPromise[_0x26b7('0x88')](_0x109a8d);}})['then'](function(){return _0x461124;})['then'](respondWithResult(_0x2ac9cc,null))[_0x26b7('0x43')](handleError(_0x2ac9cc,null));};exports[_0x26b7('0x8d')]=function(_0x5d8050,_0x4eee67,_0x52f152){return db[_0x26b7('0x2d')][_0x26b7('0x46')]({'where':{'id':_0x5d8050['params']['id']}})['then'](handleEntityNotFound(_0x4eee67,null))[_0x26b7('0x24')](function(_0x551d28){if(_0x551d28){return _0x551d28['removeBlackLists'](_0x5d8050[_0x26b7('0x34')][_0x26b7('0x62')]);}})['then'](function(_0x3edb93){if(_0x3edb93){return db[_0x26b7('0x5d')][_0x26b7('0x25')]({'where':{'ListId':_0x5d8050[_0x26b7('0x34')][_0x26b7('0x62')],'CampaignId':_0x5d8050['params']['id']}})[_0x26b7('0x24')](function(){return _0x3edb93;});}})[_0x26b7('0x24')](respondWithStatusCode(_0x4eee67,null))['catch'](handleError(_0x4eee67,null));};
\ No newline at end of file
diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js
index ee1642e..59732f4 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(_0x496624,_0x16d7ab){var _0x3c4852=function(_0x457d13){while(--_0x457d13){_0x496624['push'](_0x496624['shift']());}};_0x3c4852(++_0x16d7ab);}(_0x7a54,0x106));var _0x47a5=function(_0x486a06,_0x2aa5bf){_0x486a06=_0x486a06-0x0;var _0x22a6c0=_0x7a54[_0x486a06];return _0x22a6c0;};'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(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'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 4b36525..ee291f5 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 _0xe189=['Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','map','include','model','info','GetCampaign','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xe189,0x194));var _0x9e18=function(_0x4c5c60,_0x3bdf2a){_0x4c5c60=_0x4c5c60-0x0;var _0x1ac59b=_0xe189[_0x4c5c60];return _0x1ac59b;};'use strict';var _=require(_0x9e18('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9e18('0x1'));var rs=require(_0x9e18('0x2'));var fs=require('fs');var Redis=require(_0x9e18('0x3'));var db=require(_0x9e18('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e18('0x5'));var config=require(_0x9e18('0x6'));var jayson=require(_0x9e18('0x7'));var client=jayson[_0x9e18('0x8')][_0x9e18('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e6097,_0x3153cf,_0x2e4691){return new BPromise(function(_0x4656a4,_0x50a0ce){return client[_0x9e18('0xa')](_0x5e6097,_0x2e4691)[_0x9e18('0xb')](function(_0x33e9cd){logger['info'](_0x9e18('0xc'),_0x3153cf,_0x9e18('0xd'));logger[_0x9e18('0xe')](_0x9e18('0xf'),_0x3153cf,_0x9e18('0xd'),JSON[_0x9e18('0x10')](_0x33e9cd));if(_0x33e9cd[_0x9e18('0x11')]){if(_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x12')]===0x1f4){logger['error'](_0x9e18('0xc'),_0x3153cf,_0x33e9cd['error'][_0x9e18('0x13')]);return _0x50a0ce(_0x33e9cd[_0x9e18('0x11')]['message']);}logger[_0x9e18('0x11')](_0x9e18('0xc'),_0x3153cf,_0x33e9cd[_0x9e18('0x11')][_0x9e18('0x13')]);return _0x4656a4(_0x33e9cd['error'][_0x9e18('0x13')]);}else{logger['info']('Campaign,\x20%s,\x20%s',_0x3153cf,_0x9e18('0xd'));_0x4656a4(_0x33e9cd['result'][_0x9e18('0x13')]);}})[_0x9e18('0x14')](function(_0x1f71fc){logger[_0x9e18('0x11')]('Campaign,\x20%s,\x20%s',_0x3153cf,_0x1f71fc);_0x50a0ce(_0x1f71fc);});});}exports['GetCampaign']=function(_0x15cf20){var _0x446098=this;return new Promise(function(_0x57cd1f,_0x1aa23f){return db['Campaign'][_0x9e18('0x15')]({'raw':_0x15cf20['options']?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x17')]===undefined?!![]:![]:!![],'where':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x18')]||null:null,'attributes':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')][_0x9e18('0x19')]||null:null,'limit':_0x15cf20[_0x9e18('0x16')]?_0x15cf20['options'][_0x9e18('0x1a')]||null:null,'include':_0x15cf20[_0x9e18('0x16')]?_0x15cf20[_0x9e18('0x16')]['include']?_[_0x9e18('0x1b')](_0x15cf20['options'][_0x9e18('0x1c')],function(_0x50131d){return{'model':db[_0x50131d[_0x9e18('0x1d')]],'as':_0x50131d['as'],'attributes':_0x50131d['attributes'],'include':_0x50131d[_0x9e18('0x1c')]?_[_0x9e18('0x1b')](_0x50131d['include'],function(_0x12f90d){return{'model':db[_0x12f90d['model']],'as':_0x12f90d['as'],'attributes':_0x12f90d['attributes'],'include':_0x12f90d[_0x9e18('0x1c')]?_['map'](_0x12f90d[_0x9e18('0x1c')],function(_0x49a3d6){return{'model':db[_0x49a3d6[_0x9e18('0x1d')]],'as':_0x49a3d6['as'],'attributes':_0x49a3d6[_0x9e18('0x19')]};}):[]};}):[]};}):[]:[]})[_0x9e18('0xb')](function(_0xd115f3){logger[_0x9e18('0x1e')](_0x9e18('0x1f'),_0x15cf20);logger[_0x9e18('0xe')](_0x9e18('0x1f'),_0x15cf20,JSON[_0x9e18('0x10')](_0xd115f3));_0x57cd1f(_0xd115f3);})['catch'](function(_0x2ee4da){logger[_0x9e18('0x11')](_0x9e18('0x1f'),_0x2ee4da[_0x9e18('0x13')],_0x15cf20);_0x1aa23f(_0x446098['error'](0x1f4,_0x2ee4da['message']));});});};
\ No newline at end of file
+var _0xc524=['message','info','result','catch','GetCampaign','Campaign','options','raw','where','attributes','limit','include','model','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc524,0x1bf));var _0x4c52=function(_0x56d2e9,_0x22fe0a){_0x56d2e9=_0x56d2e9-0x0;var _0x32d662=_0xc524[_0x56d2e9];return _0x32d662;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4c52('0x0'));var BPromise=require(_0x4c52('0x1'));var rs=require(_0x4c52('0x2'));var fs=require('fs');var Redis=require(_0x4c52('0x3'));var db=require(_0x4c52('0x4'))['db'];var utils=require(_0x4c52('0x5'));var logger=require(_0x4c52('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c52('0x7'));var client=jayson[_0x4c52('0x8')][_0x4c52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4756e3,_0x5378d3,_0x4ea85e){return new BPromise(function(_0x39591b,_0x212216){return client['request'](_0x4756e3,_0x4ea85e)[_0x4c52('0xa')](function(_0x231cda){logger['info'](_0x4c52('0xb'),_0x5378d3,_0x4c52('0xc'));logger[_0x4c52('0xd')](_0x4c52('0xe'),_0x5378d3,_0x4c52('0xc'),JSON[_0x4c52('0xf')](_0x231cda));if(_0x231cda[_0x4c52('0x10')]){if(_0x231cda[_0x4c52('0x10')][_0x4c52('0x11')]===0x1f4){logger['error'](_0x4c52('0xb'),_0x5378d3,_0x231cda[_0x4c52('0x10')][_0x4c52('0x12')]);return _0x212216(_0x231cda['error']['message']);}logger[_0x4c52('0x10')]('Campaign,\x20%s,\x20%s',_0x5378d3,_0x231cda[_0x4c52('0x10')][_0x4c52('0x12')]);return _0x39591b(_0x231cda['error'][_0x4c52('0x12')]);}else{logger[_0x4c52('0x13')](_0x4c52('0xb'),_0x5378d3,_0x4c52('0xc'));_0x39591b(_0x231cda[_0x4c52('0x14')][_0x4c52('0x12')]);}})[_0x4c52('0x15')](function(_0x1dabe0){logger[_0x4c52('0x10')](_0x4c52('0xb'),_0x5378d3,_0x1dabe0);_0x212216(_0x1dabe0);});});}exports[_0x4c52('0x16')]=function(_0x1f036c){var _0x35cffb=this;return new Promise(function(_0x2a498c,_0x146c35){return db[_0x4c52('0x17')]['findAll']({'raw':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x19')]===undefined?!![]:![]:!![],'where':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1a')]||null:null,'attributes':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1b')]||null:null,'limit':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1c')]||null:null,'include':_0x1f036c[_0x4c52('0x18')]?_0x1f036c[_0x4c52('0x18')]['include']?_['map'](_0x1f036c[_0x4c52('0x18')][_0x4c52('0x1d')],function(_0x13cf34){return{'model':db[_0x13cf34[_0x4c52('0x1e')]],'as':_0x13cf34['as'],'attributes':_0x13cf34[_0x4c52('0x1b')],'include':_0x13cf34[_0x4c52('0x1d')]?_['map'](_0x13cf34[_0x4c52('0x1d')],function(_0x19e4b9){return{'model':db[_0x19e4b9['model']],'as':_0x19e4b9['as'],'attributes':_0x19e4b9[_0x4c52('0x1b')],'include':_0x19e4b9[_0x4c52('0x1d')]?_['map'](_0x19e4b9[_0x4c52('0x1d')],function(_0x2385a9){return{'model':db[_0x2385a9[_0x4c52('0x1e')]],'as':_0x2385a9['as'],'attributes':_0x2385a9['attributes']};}):[]};}):[]};}):[]:[]})[_0x4c52('0xa')](function(_0x3500aa){logger[_0x4c52('0x13')](_0x4c52('0x16'),_0x1f036c);logger[_0x4c52('0xd')](_0x4c52('0x16'),_0x1f036c,JSON[_0x4c52('0xf')](_0x3500aa));_0x2a498c(_0x3500aa);})[_0x4c52('0x15')](function(_0x74eae1){logger[_0x4c52('0x10')]('GetCampaign',_0x74eae1[_0x4c52('0x12')],_0x1f036c);_0x146c35(_0x35cffb[_0x4c52('0x10')](0x1f4,_0x74eae1[_0x4c52('0x12')]));});});};
\ No newline at end of file
diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js
index 609a268..bc73e7c 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 _0x0830=['index','show','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','getLists','getBlackLists','post','/:id/clone','/:id/lists','addBlackLists','put','/:id','destroy','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x228184,_0x2a1c7a){var _0x4f2235=function(_0xff995){while(--_0xff995){_0x228184['push'](_0x228184['shift']());}};_0x4f2235(++_0x2a1c7a);}(_0x0830,0xd0));var _0x0083=function(_0x51ece4,_0x39165c){_0x51ece4=_0x51ece4-0x0;var _0x2b7e27=_0x0830[_0x51ece4];return _0x2b7e27;};'use strict';var multer=require(_0x0083('0x0'));var util=require(_0x0083('0x1'));var path=require('path');var timeout=require(_0x0083('0x2'));var express=require('express');var router=express[_0x0083('0x3')]();var fs_extra=require(_0x0083('0x4'));var auth=require(_0x0083('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0083('0x6'));var controller=require('./campaign.controller');router[_0x0083('0x7')]('/',auth[_0x0083('0x8')](),controller[_0x0083('0x9')]);router[_0x0083('0x7')]('/:id',auth[_0x0083('0x8')](),controller[_0x0083('0xa')]);router[_0x0083('0x7')]('/:id/hoppers',auth[_0x0083('0x8')](),controller[_0x0083('0xb')]);router[_0x0083('0x7')](_0x0083('0xc'),auth[_0x0083('0x8')](),controller[_0x0083('0xd')]);router['get'](_0x0083('0xe'),auth[_0x0083('0x8')](),controller[_0x0083('0xf')]);router[_0x0083('0x7')](_0x0083('0x10'),auth[_0x0083('0x8')](),controller[_0x0083('0x11')]);router['get']('/:id/lists',auth[_0x0083('0x8')](),controller[_0x0083('0x12')]);router[_0x0083('0x7')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x0083('0x13')]);router['post']('/',auth[_0x0083('0x8')](),controller['create']);router[_0x0083('0x14')](_0x0083('0x15'),auth['isAuthenticated'](),controller['clone']);router['post'](_0x0083('0x16'),auth[_0x0083('0x8')](),controller['addLists']);router['post']('/:id/blacklists',auth[_0x0083('0x8')](),controller[_0x0083('0x17')]);router[_0x0083('0x18')](_0x0083('0x19'),auth[_0x0083('0x8')](),controller['update']);router['delete'](_0x0083('0x19'),auth[_0x0083('0x8')](),controller[_0x0083('0x1a')]);router[_0x0083('0x1b')]('/:id/lists',auth[_0x0083('0x8')](),controller[_0x0083('0x1c')]);router[_0x0083('0x1b')]('/:id/blacklists',auth['isAuthenticated'](),controller[_0x0083('0x1d')]);module[_0x0083('0x1e')]=router;
\ No newline at end of file
+var _0xb2e1=['express','Router','fs-extra','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','/:id/blacklists','put','/:id','update','destroy','removeLists','removeBlackLists','exports','multer','util','path','connect-timeout'];(function(_0x273600,_0x19a8d1){var _0x431a0c=function(_0x382628){while(--_0x382628){_0x273600['push'](_0x273600['shift']());}};_0x431a0c(++_0x19a8d1);}(_0xb2e1,0xd4));var _0x1b2e=function(_0x42c56b,_0x58ae76){_0x42c56b=_0x42c56b-0x0;var _0x13f59d=_0xb2e1[_0x42c56b];return _0x13f59d;};'use strict';var multer=require(_0x1b2e('0x0'));var util=require(_0x1b2e('0x1'));var path=require(_0x1b2e('0x2'));var timeout=require(_0x1b2e('0x3'));var express=require(_0x1b2e('0x4'));var router=express[_0x1b2e('0x5')]();var fs_extra=require(_0x1b2e('0x6'));var auth=require(_0x1b2e('0x7'));var interaction=require('../../components/interaction/service');var config=require(_0x1b2e('0x8'));var controller=require('./campaign.controller');router[_0x1b2e('0x9')]('/',auth[_0x1b2e('0xa')](),controller[_0x1b2e('0xb')]);router[_0x1b2e('0x9')]('/:id',auth[_0x1b2e('0xa')](),controller[_0x1b2e('0xc')]);router[_0x1b2e('0x9')](_0x1b2e('0xd'),auth['isAuthenticated'](),controller[_0x1b2e('0xe')]);router[_0x1b2e('0x9')](_0x1b2e('0xf'),auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x10')]);router[_0x1b2e('0x9')](_0x1b2e('0x11'),auth[_0x1b2e('0xa')](),controller['getHopperFinals']);router[_0x1b2e('0x9')](_0x1b2e('0x12'),auth['isAuthenticated'](),controller[_0x1b2e('0x13')]);router[_0x1b2e('0x9')](_0x1b2e('0x14'),auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x15')]);router[_0x1b2e('0x9')]('/:id/blacklists',auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x16')]);router[_0x1b2e('0x17')]('/',auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x18')]);router[_0x1b2e('0x17')](_0x1b2e('0x19'),auth['isAuthenticated'](),controller[_0x1b2e('0x1a')]);router[_0x1b2e('0x17')]('/:id/lists',auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x1b')]);router[_0x1b2e('0x17')](_0x1b2e('0x1c'),auth[_0x1b2e('0xa')](),controller['addBlackLists']);router[_0x1b2e('0x1d')](_0x1b2e('0x1e'),auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x1f')]);router['delete'](_0x1b2e('0x1e'),auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x20')]);router['delete'](_0x1b2e('0x14'),auth[_0x1b2e('0xa')](),controller[_0x1b2e('0x21')]);router['delete']('/:id/blacklists',auth['isAuthenticated'](),controller[_0x1b2e('0x22')]);module[_0x1b2e('0x23')]=router;
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js
index b936874..40652a5 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 _0xa5ac=['exports','STRING','TEXT','VIRTUAL','key','sequelize'];(function(_0x38eb22,_0x458a8c){var _0x49553e=function(_0x2879fd){while(--_0x2879fd){_0x38eb22['push'](_0x38eb22['shift']());}};_0x49553e(++_0x458a8c);}(_0xa5ac,0x83));var _0xca5a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa5ac[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xca5a('0x0'));module[_0xca5a('0x1')]={'key':{'type':Sequelize[_0xca5a('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xca5a('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xca5a('0x2')]},'name':{'type':Sequelize[_0xca5a('0x4')],'get':function(){return this['getDataValue'](_0xca5a('0x5'));}}};
\ No newline at end of file
+var _0x0231=['STRING','TEXT','VIRTUAL','key','sequelize','exports'];(function(_0x533132,_0xf5b6fa){var _0x1a7447=function(_0x44d580){while(--_0x44d580){_0x533132['push'](_0x533132['shift']());}};_0x1a7447(++_0xf5b6fa);}(_0x0231,0xf4));var _0x1023=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x0231[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x1023('0x0'));module[_0x1023('0x1')]={'key':{'type':Sequelize[_0x1023('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x1023('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x1023('0x2')]},'name':{'type':Sequelize[_0x1023('0x4')],'get':function(){return this['getDataValue'](_0x1023('0x5'));}}};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js
index ffa1af8..70889e1 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 _0xedd3=['offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','get','UserProfileResource','then','end','error','stack','name','index','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','CannedAnswer','includeAll','include','rows','catch','show','params','find','body','destroy','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','json'];(function(_0x54f952,_0x376d41){var _0x2c8d08=function(_0x1e9a2c){while(--_0x1e9a2c){_0x54f952['push'](_0x54f952['shift']());}};_0x2c8d08(++_0x376d41);}(_0xedd3,0x1b4));var _0x3edd=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0xedd3[_0x2dea24];return _0x309d58;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x3edd('0x0'));var zipdir=require(_0x3edd('0x1'));var jsonpatch=require(_0x3edd('0x2'));var rp=require(_0x3edd('0x3'));var moment=require('moment');var BPromise=require(_0x3edd('0x4'));var Mustache=require(_0x3edd('0x5'));var util=require(_0x3edd('0x6'));var path=require(_0x3edd('0x7'));var sox=require(_0x3edd('0x8'));var csv=require(_0x3edd('0x9'));var ejs=require(_0x3edd('0xa'));var fs=require('fs');var fs_extra=require(_0x3edd('0xb'));var _=require(_0x3edd('0xc'));var squel=require(_0x3edd('0xd'));var crypto=require(_0x3edd('0xe'));var jsforce=require(_0x3edd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3edd('0x9'));var querystring=require(_0x3edd('0x10'));var Papa=require(_0x3edd('0x11'));var Redis=require(_0x3edd('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3edd('0x13'));var hardwareService=require(_0x3edd('0x14'));var logger=require('../../config/logger')(_0x3edd('0x15'));var utils=require(_0x3edd('0x16'));var config=require(_0x3edd('0x17'));var licenseUtil=require(_0x3edd('0x18'));var db=require(_0x3edd('0x19'))['db'];function respondWithStatusCode(_0x4ce713,_0x26cb2a){_0x26cb2a=_0x26cb2a||0xcc;return function(_0x327169){if(_0x327169){return _0x4ce713[_0x3edd('0x1a')](_0x26cb2a);}return _0x4ce713[_0x3edd('0x1b')](_0x26cb2a)['end']();};}function respondWithResult(_0x1ef2a9,_0xfa7e5d){_0xfa7e5d=_0xfa7e5d||0xc8;return function(_0x6520df){if(_0x6520df){return _0x1ef2a9[_0x3edd('0x1b')](_0xfa7e5d)[_0x3edd('0x1c')](_0x6520df);}};}function respondWithFilteredResult(_0xc04ef5,_0x2a7027){return function(_0x3c6d77){if(_0x3c6d77){var _0x2142d8=typeof _0x2a7027[_0x3edd('0x1d')]===_0x3edd('0x1e')&&typeof _0x2a7027[_0x3edd('0x1f')]===_0x3edd('0x1e');var _0x39a023=_0x3c6d77[_0x3edd('0x20')];var _0x4ac360=_0x2142d8?0x0:_0x2a7027[_0x3edd('0x1d')];var _0x3e54d5=_0x2142d8?_0x3c6d77[_0x3edd('0x20')]:_0x2a7027['offset']+_0x2a7027[_0x3edd('0x1f')];var _0x315c67;if(_0x3e54d5>=_0x39a023){_0x3e54d5=_0x39a023;_0x315c67=0xc8;}else{_0x315c67=0xce;}_0xc04ef5['status'](_0x315c67);return _0xc04ef5[_0x3edd('0x21')](_0x3edd('0x22'),_0x4ac360+'-'+_0x3e54d5+'/'+_0x39a023)[_0x3edd('0x1c')](_0x3c6d77);}return null;};}function patchUpdates(_0x4c1541){return function(_0x2b3968){try{jsonpatch[_0x3edd('0x23')](_0x2b3968,_0x4c1541,!![]);}catch(_0x3df59b){return BPromise[_0x3edd('0x24')](_0x3df59b);}return _0x2b3968[_0x3edd('0x25')]();};}function saveUpdates(_0xde169,_0x50ce8c){return function(_0x5e96a6){if(_0x5e96a6){return _0x5e96a6[_0x3edd('0x26')](_0xde169)['then'](function(_0x1dda77){return _0x1dda77;});}return null;};}function removeEntity(_0x5a60cc,_0x40bd9f){return function(_0x3bdad5){if(_0x3bdad5){return _0x3bdad5['destroy']()['then'](function(){var _0x1dffe7=_0x3bdad5[_0x3edd('0x27')]({'plain':!![]});var _0x100f1c='CannedAnswers';return db[_0x3edd('0x28')]['destroy']({'where':{'type':_0x100f1c,'resourceId':_0x1dffe7['id']}})['then'](function(){return _0x3bdad5;});})[_0x3edd('0x29')](function(){_0x5a60cc[_0x3edd('0x1b')](0xcc)[_0x3edd('0x2a')]();});}};}function handleEntityNotFound(_0x5b85ee,_0x2cc914){return function(_0x271414){if(!_0x271414){_0x5b85ee[_0x3edd('0x1a')](0x194);}return _0x271414;};}function handleError(_0x224ab3,_0xe06bce){_0xe06bce=_0xe06bce||0x1f4;return function(_0x14259b){logger[_0x3edd('0x2b')](_0x14259b[_0x3edd('0x2c')]);if(_0x14259b['name']){delete _0x14259b[_0x3edd('0x2d')];}_0x224ab3[_0x3edd('0x1b')](_0xe06bce)['send'](_0x14259b);};}exports[_0x3edd('0x2e')]=function(_0x2d9fd8,_0x186b5a){var _0x44c10d={},_0x28ecf7={},_0x452ce1={'count':0x0,'rows':[]};var _0x56f389=_['map'](db['CannedAnswer'][_0x3edd('0x2f')],function(_0x3cddaa){return{'name':_0x3cddaa[_0x3edd('0x30')],'type':_0x3cddaa[_0x3edd('0x31')][_0x3edd('0x32')]};});_0x28ecf7[_0x3edd('0x33')]=_[_0x3edd('0x34')](_0x56f389,_0x3edd('0x2d'));_0x28ecf7[_0x3edd('0x35')]=_[_0x3edd('0x36')](_0x2d9fd8[_0x3edd('0x35')]);_0x28ecf7[_0x3edd('0x37')]=_[_0x3edd('0x38')](_0x28ecf7[_0x3edd('0x33')],_0x28ecf7['query']);_0x44c10d[_0x3edd('0x39')]=_[_0x3edd('0x38')](_0x28ecf7[_0x3edd('0x33')],qs[_0x3edd('0x3a')](_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x3a')]));_0x44c10d[_0x3edd('0x39')]=_0x44c10d['attributes'][_0x3edd('0x3b')]?_0x44c10d[_0x3edd('0x39')]:_0x28ecf7[_0x3edd('0x33')];if(!_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x3c')](_0x3edd('0x3d'))){_0x44c10d[_0x3edd('0x1f')]=qs[_0x3edd('0x1f')](_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x1f')]);_0x44c10d[_0x3edd('0x1d')]=qs['offset'](_0x2d9fd8[_0x3edd('0x35')]['offset']);}_0x44c10d[_0x3edd('0x3e')]=qs[_0x3edd('0x3f')](_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x3f')]);_0x44c10d[_0x3edd('0x40')]=qs[_0x3edd('0x37')](_['pick'](_0x2d9fd8[_0x3edd('0x35')],_0x28ecf7[_0x3edd('0x37')]),_0x56f389);if(_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x41')]){_0x44c10d[_0x3edd('0x40')]=_[_0x3edd('0x42')](_0x44c10d[_0x3edd('0x40')],{'$or':[{'key':{'$like':'%'+_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x41')]+'%'}},{'value':{'$like':'%'+_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x41')]+'%'}}]});}_0x44c10d=_['merge']({},_0x44c10d,_0x2d9fd8[_0x3edd('0x43')]);var _0xa6a773={'where':_0x44c10d[_0x3edd('0x40')]};return db[_0x3edd('0x44')][_0x3edd('0x20')](_0xa6a773)['then'](function(_0x8cc41c){_0x452ce1[_0x3edd('0x20')]=_0x8cc41c;if(_0x2d9fd8[_0x3edd('0x35')][_0x3edd('0x45')]){_0x44c10d[_0x3edd('0x46')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x44c10d);})[_0x3edd('0x29')](function(_0x1e6489){_0x452ce1[_0x3edd('0x47')]=_0x1e6489;return _0x452ce1;})[_0x3edd('0x29')](respondWithFilteredResult(_0x186b5a,_0x44c10d))[_0x3edd('0x48')](handleError(_0x186b5a,null));};exports[_0x3edd('0x49')]=function(_0x36add4,_0x208e39){var _0x353239={'raw':!![],'where':{'id':_0x36add4[_0x3edd('0x4a')]['id']}},_0x2bf9dd={};_0x2bf9dd['model']=_[_0x3edd('0x36')](db[_0x3edd('0x44')][_0x3edd('0x2f')]);_0x2bf9dd[_0x3edd('0x35')]=_[_0x3edd('0x36')](_0x36add4[_0x3edd('0x35')]);_0x2bf9dd[_0x3edd('0x37')]=_[_0x3edd('0x38')](_0x2bf9dd['model'],_0x2bf9dd[_0x3edd('0x35')]);_0x353239['attributes']=_['intersection'](_0x2bf9dd['model'],qs[_0x3edd('0x3a')](_0x36add4[_0x3edd('0x35')][_0x3edd('0x3a')]));_0x353239[_0x3edd('0x39')]=_0x353239[_0x3edd('0x39')][_0x3edd('0x3b')]?_0x353239[_0x3edd('0x39')]:_0x2bf9dd[_0x3edd('0x33')];if(_0x36add4['query']['includeAll']){_0x353239[_0x3edd('0x46')]=[{'all':!![]}];}_0x353239=_['merge']({},_0x353239,_0x36add4[_0x3edd('0x43')]);return db[_0x3edd('0x44')][_0x3edd('0x4b')](_0x353239)[_0x3edd('0x29')](handleEntityNotFound(_0x208e39,null))[_0x3edd('0x29')](respondWithResult(_0x208e39,null))[_0x3edd('0x48')](handleError(_0x208e39,null));};exports[_0x3edd('0x26')]=function(_0x29b157,_0x2fec95){if(_0x29b157[_0x3edd('0x4c')]['id']){delete _0x29b157[_0x3edd('0x4c')]['id'];}return db[_0x3edd('0x44')][_0x3edd('0x4b')]({'where':{'id':_0x29b157[_0x3edd('0x4a')]['id']}})[_0x3edd('0x29')](handleEntityNotFound(_0x2fec95,null))[_0x3edd('0x29')](saveUpdates(_0x29b157[_0x3edd('0x4c')],null))[_0x3edd('0x29')](respondWithResult(_0x2fec95,null))[_0x3edd('0x48')](handleError(_0x2fec95,null));};exports[_0x3edd('0x4d')]=function(_0x3225ca,_0x487560){return db['CannedAnswer'][_0x3edd('0x4b')]({'where':{'id':_0x3225ca[_0x3edd('0x4a')]['id']}})[_0x3edd('0x29')](handleEntityNotFound(_0x487560,null))[_0x3edd('0x29')](removeEntity(_0x487560,null))[_0x3edd('0x48')](handleError(_0x487560,null));};exports['create']=function(_0x4cc774,_0x556a90){var _0x436611={'key':_0x4cc774[_0x3edd('0x4c')][_0x3edd('0x32')]};if(_0x4cc774[_0x3edd('0x4c')]['MailAccountId']){_0x436611[_0x3edd('0x4e')]=_0x4cc774[_0x3edd('0x4c')][_0x3edd('0x4e')];}else if(_0x4cc774['body'][_0x3edd('0x4f')]){_0x436611[_0x3edd('0x4f')]=_0x4cc774['body'][_0x3edd('0x4f')];}else if(_0x4cc774[_0x3edd('0x4c')][_0x3edd('0x50')]){_0x436611['OpenchannelAccountId']=_0x4cc774['body']['OpenchannelAccountId'];}else if(_0x4cc774[_0x3edd('0x4c')][_0x3edd('0x51')]){_0x436611[_0x3edd('0x51')]=_0x4cc774[_0x3edd('0x4c')][_0x3edd('0x51')];}return db[_0x3edd('0x44')][_0x3edd('0x4b')]({'where':_0x436611})[_0x3edd('0x29')](function(_0x5161fd){if(_0x5161fd){throw new db[(_0x3edd('0x52'))][(_0x3edd('0x53'))](_0x3edd('0x54'));}return db[_0x3edd('0x44')][_0x3edd('0x55')](_0x4cc774['body']);})[_0x3edd('0x29')](function(_0x290e79){var _0x5a738d=_0x4cc774['user'][_0x3edd('0x27')]({'plain':!![]});if(!_0x5a738d)throw new Error(_0x3edd('0x56'));if(_0x5a738d[_0x3edd('0x57')]===_0x3edd('0x58')){var _0x2d4ec5=_0x290e79[_0x3edd('0x27')]({'plain':!![]});return db[_0x3edd('0x59')][_0x3edd('0x4b')]({'where':{'name':'CannedAnswers','userProfileId':_0x5a738d[_0x3edd('0x5a')]},'raw':!![]})[_0x3edd('0x29')](function(_0x233dfa){if(_0x233dfa&&_0x233dfa[_0x3edd('0x5b')]===0x0){return db[_0x3edd('0x28')][_0x3edd('0x55')]({'name':_0x2d4ec5[_0x3edd('0x2d')],'resourceId':_0x2d4ec5['id'],'type':_0x233dfa['name'],'sectionId':_0x233dfa['id']},{})[_0x3edd('0x29')](function(){return _0x290e79;});}else{return _0x290e79;}})[_0x3edd('0x48')](function(_0x5f1c8f){logger[_0x3edd('0x2b')](_0x3edd('0x5c'),_0x5f1c8f);throw _0x5f1c8f;});}return _0x290e79;})[_0x3edd('0x29')](respondWithResult(_0x556a90,0xc9))[_0x3edd('0x48')](handleError(_0x556a90,null));};
\ No newline at end of file
+var _0xbb38=['pick','merge','filter','includeAll','include','rows','catch','show','params','length','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','fs-extra','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','limit','count','set','apply','save','update','then','destroy','get','CannedAnswers','UserProfileResource','error','stack','name','send','index','map','CannedAnswer','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where'];(function(_0x1c6f3b,_0x928ae3){var _0x50102b=function(_0x2e9047){while(--_0x2e9047){_0x1c6f3b['push'](_0x1c6f3b['shift']());}};_0x50102b(++_0x928ae3);}(_0xbb38,0x71));var _0x8bb3=function(_0x70a8a5,_0x35a384){_0x70a8a5=_0x70a8a5-0x0;var _0x2b563b=_0xbb38[_0x70a8a5];return _0x2b563b;};'use strict';var emlformat=require(_0x8bb3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8bb3('0x1'));var rp=require(_0x8bb3('0x2'));var moment=require(_0x8bb3('0x3'));var BPromise=require(_0x8bb3('0x4'));var Mustache=require('mustache');var util=require(_0x8bb3('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8bb3('0x6'));var ejs=require(_0x8bb3('0x7'));var fs=require('fs');var fs_extra=require(_0x8bb3('0x8'));var _=require(_0x8bb3('0x9'));var squel=require('squel');var crypto=require(_0x8bb3('0xa'));var jsforce=require(_0x8bb3('0xb'));var deskjs=require(_0x8bb3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8bb3('0xd'));var Papa=require(_0x8bb3('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x8bb3('0xf'));var as=require(_0x8bb3('0x10'));var hardwareService=require(_0x8bb3('0x11'));var logger=require(_0x8bb3('0x12'))(_0x8bb3('0x13'));var utils=require(_0x8bb3('0x14'));var config=require(_0x8bb3('0x15'));var licenseUtil=require(_0x8bb3('0x16'));var db=require(_0x8bb3('0x17'))['db'];function respondWithStatusCode(_0xb80880,_0x11a1a8){_0x11a1a8=_0x11a1a8||0xcc;return function(_0x1b47ab){if(_0x1b47ab){return _0xb80880[_0x8bb3('0x18')](_0x11a1a8);}return _0xb80880[_0x8bb3('0x19')](_0x11a1a8)[_0x8bb3('0x1a')]();};}function respondWithResult(_0x22063e,_0x16a9b0){_0x16a9b0=_0x16a9b0||0xc8;return function(_0x28a56e){if(_0x28a56e){return _0x22063e[_0x8bb3('0x19')](_0x16a9b0)[_0x8bb3('0x1b')](_0x28a56e);}};}function respondWithFilteredResult(_0x3e4e4c,_0x4cd408){return function(_0xfdf07f){if(_0xfdf07f){var _0x43808d=typeof _0x4cd408[_0x8bb3('0x1c')]==='undefined'&&typeof _0x4cd408[_0x8bb3('0x1d')]==='undefined';var _0x587c55=_0xfdf07f[_0x8bb3('0x1e')];var _0x36e65d=_0x43808d?0x0:_0x4cd408[_0x8bb3('0x1c')];var _0xd10240=_0x43808d?_0xfdf07f['count']:_0x4cd408[_0x8bb3('0x1c')]+_0x4cd408[_0x8bb3('0x1d')];var _0x54c71b;if(_0xd10240>=_0x587c55){_0xd10240=_0x587c55;_0x54c71b=0xc8;}else{_0x54c71b=0xce;}_0x3e4e4c[_0x8bb3('0x19')](_0x54c71b);return _0x3e4e4c[_0x8bb3('0x1f')]('Content-Range',_0x36e65d+'-'+_0xd10240+'/'+_0x587c55)[_0x8bb3('0x1b')](_0xfdf07f);}return null;};}function patchUpdates(_0x481799){return function(_0x5e17e0){try{jsonpatch[_0x8bb3('0x20')](_0x5e17e0,_0x481799,!![]);}catch(_0x705afa){return BPromise['reject'](_0x705afa);}return _0x5e17e0[_0x8bb3('0x21')]();};}function saveUpdates(_0x21620a,_0xd4be5d){return function(_0x30875b){if(_0x30875b){return _0x30875b[_0x8bb3('0x22')](_0x21620a)[_0x8bb3('0x23')](function(_0x25c88f){return _0x25c88f;});}return null;};}function removeEntity(_0xb2aef8,_0x2c9b4a){return function(_0x1e8498){if(_0x1e8498){return _0x1e8498[_0x8bb3('0x24')]()[_0x8bb3('0x23')](function(){var _0x3a3116=_0x1e8498[_0x8bb3('0x25')]({'plain':!![]});var _0x2a0933=_0x8bb3('0x26');return db[_0x8bb3('0x27')][_0x8bb3('0x24')]({'where':{'type':_0x2a0933,'resourceId':_0x3a3116['id']}})[_0x8bb3('0x23')](function(){return _0x1e8498;});})['then'](function(){_0xb2aef8['status'](0xcc)[_0x8bb3('0x1a')]();});}};}function handleEntityNotFound(_0x26c040,_0x133847){return function(_0x312bcb){if(!_0x312bcb){_0x26c040[_0x8bb3('0x18')](0x194);}return _0x312bcb;};}function handleError(_0x1a3b16,_0x107716){_0x107716=_0x107716||0x1f4;return function(_0x464a0e){logger[_0x8bb3('0x28')](_0x464a0e[_0x8bb3('0x29')]);if(_0x464a0e[_0x8bb3('0x2a')]){delete _0x464a0e[_0x8bb3('0x2a')];}_0x1a3b16[_0x8bb3('0x19')](_0x107716)[_0x8bb3('0x2b')](_0x464a0e);};}exports[_0x8bb3('0x2c')]=function(_0x599a30,_0x9245a2){var _0x2d60cf={},_0x135507={},_0x5c32e8={'count':0x0,'rows':[]};var _0x214223=_[_0x8bb3('0x2d')](db[_0x8bb3('0x2e')][_0x8bb3('0x2f')],function(_0x672aa2){return{'name':_0x672aa2[_0x8bb3('0x30')],'type':_0x672aa2[_0x8bb3('0x31')][_0x8bb3('0x32')]};});_0x135507['model']=_[_0x8bb3('0x2d')](_0x214223,_0x8bb3('0x2a'));_0x135507[_0x8bb3('0x33')]=_[_0x8bb3('0x34')](_0x599a30[_0x8bb3('0x33')]);_0x135507[_0x8bb3('0x35')]=_[_0x8bb3('0x36')](_0x135507[_0x8bb3('0x37')],_0x135507[_0x8bb3('0x33')]);_0x2d60cf[_0x8bb3('0x38')]=_[_0x8bb3('0x36')](_0x135507[_0x8bb3('0x37')],qs[_0x8bb3('0x39')](_0x599a30[_0x8bb3('0x33')]['fields']));_0x2d60cf['attributes']=_0x2d60cf[_0x8bb3('0x38')]['length']?_0x2d60cf[_0x8bb3('0x38')]:_0x135507[_0x8bb3('0x37')];if(!_0x599a30[_0x8bb3('0x33')][_0x8bb3('0x3a')](_0x8bb3('0x3b'))){_0x2d60cf['limit']=qs[_0x8bb3('0x1d')](_0x599a30[_0x8bb3('0x33')][_0x8bb3('0x1d')]);_0x2d60cf[_0x8bb3('0x1c')]=qs[_0x8bb3('0x1c')](_0x599a30['query'][_0x8bb3('0x1c')]);}_0x2d60cf[_0x8bb3('0x3c')]=qs[_0x8bb3('0x3d')](_0x599a30['query']['sort']);_0x2d60cf[_0x8bb3('0x3e')]=qs[_0x8bb3('0x35')](_[_0x8bb3('0x3f')](_0x599a30['query'],_0x135507[_0x8bb3('0x35')]),_0x214223);if(_0x599a30[_0x8bb3('0x33')]['filter']){_0x2d60cf[_0x8bb3('0x3e')]=_[_0x8bb3('0x40')](_0x2d60cf[_0x8bb3('0x3e')],{'$or':[{'key':{'$like':'%'+_0x599a30[_0x8bb3('0x33')][_0x8bb3('0x41')]+'%'}},{'value':{'$like':'%'+_0x599a30[_0x8bb3('0x33')]['filter']+'%'}}]});}_0x2d60cf=_[_0x8bb3('0x40')]({},_0x2d60cf,_0x599a30['options']);var _0xb4b8d3={'where':_0x2d60cf['where']};return db[_0x8bb3('0x2e')][_0x8bb3('0x1e')](_0xb4b8d3)[_0x8bb3('0x23')](function(_0x2bd7b0){_0x5c32e8['count']=_0x2bd7b0;if(_0x599a30[_0x8bb3('0x33')][_0x8bb3('0x42')]){_0x2d60cf[_0x8bb3('0x43')]=[{'all':!![]}];}return db['CannedAnswer']['findAll'](_0x2d60cf);})[_0x8bb3('0x23')](function(_0x22d742){_0x5c32e8[_0x8bb3('0x44')]=_0x22d742;return _0x5c32e8;})['then'](respondWithFilteredResult(_0x9245a2,_0x2d60cf))[_0x8bb3('0x45')](handleError(_0x9245a2,null));};exports[_0x8bb3('0x46')]=function(_0x5b6356,_0x52f880){var _0x5f5481={'raw':!![],'where':{'id':_0x5b6356[_0x8bb3('0x47')]['id']}},_0x3a12f1={};_0x3a12f1['model']=_[_0x8bb3('0x34')](db[_0x8bb3('0x2e')][_0x8bb3('0x2f')]);_0x3a12f1['query']=_[_0x8bb3('0x34')](_0x5b6356['query']);_0x3a12f1[_0x8bb3('0x35')]=_['intersection'](_0x3a12f1['model'],_0x3a12f1[_0x8bb3('0x33')]);_0x5f5481[_0x8bb3('0x38')]=_[_0x8bb3('0x36')](_0x3a12f1['model'],qs[_0x8bb3('0x39')](_0x5b6356[_0x8bb3('0x33')][_0x8bb3('0x39')]));_0x5f5481['attributes']=_0x5f5481[_0x8bb3('0x38')][_0x8bb3('0x48')]?_0x5f5481[_0x8bb3('0x38')]:_0x3a12f1[_0x8bb3('0x37')];if(_0x5b6356[_0x8bb3('0x33')][_0x8bb3('0x42')]){_0x5f5481['include']=[{'all':!![]}];}_0x5f5481=_[_0x8bb3('0x40')]({},_0x5f5481,_0x5b6356['options']);return db[_0x8bb3('0x2e')][_0x8bb3('0x49')](_0x5f5481)[_0x8bb3('0x23')](handleEntityNotFound(_0x52f880,null))[_0x8bb3('0x23')](respondWithResult(_0x52f880,null))[_0x8bb3('0x45')](handleError(_0x52f880,null));};exports[_0x8bb3('0x22')]=function(_0x48c7a5,_0x4166fd){if(_0x48c7a5[_0x8bb3('0x4a')]['id']){delete _0x48c7a5[_0x8bb3('0x4a')]['id'];}return db[_0x8bb3('0x2e')][_0x8bb3('0x49')]({'where':{'id':_0x48c7a5[_0x8bb3('0x47')]['id']}})[_0x8bb3('0x23')](handleEntityNotFound(_0x4166fd,null))['then'](saveUpdates(_0x48c7a5[_0x8bb3('0x4a')],null))[_0x8bb3('0x23')](respondWithResult(_0x4166fd,null))['catch'](handleError(_0x4166fd,null));};exports[_0x8bb3('0x24')]=function(_0x5eb362,_0x1a6c7c){return db[_0x8bb3('0x2e')][_0x8bb3('0x49')]({'where':{'id':_0x5eb362[_0x8bb3('0x47')]['id']}})[_0x8bb3('0x23')](handleEntityNotFound(_0x1a6c7c,null))[_0x8bb3('0x23')](removeEntity(_0x1a6c7c,null))[_0x8bb3('0x45')](handleError(_0x1a6c7c,null));};exports[_0x8bb3('0x4b')]=function(_0x57e774,_0x3d5894){var _0x138aa8={'key':_0x57e774['body'][_0x8bb3('0x32')]};if(_0x57e774[_0x8bb3('0x4a')][_0x8bb3('0x4c')]){_0x138aa8[_0x8bb3('0x4c')]=_0x57e774['body'][_0x8bb3('0x4c')];}else if(_0x57e774[_0x8bb3('0x4a')]['SmsAccountId']){_0x138aa8[_0x8bb3('0x4d')]=_0x57e774[_0x8bb3('0x4a')][_0x8bb3('0x4d')];}else if(_0x57e774[_0x8bb3('0x4a')][_0x8bb3('0x4e')]){_0x138aa8[_0x8bb3('0x4e')]=_0x57e774[_0x8bb3('0x4a')]['OpenchannelAccountId'];}else if(_0x57e774['body'][_0x8bb3('0x4f')]){_0x138aa8[_0x8bb3('0x4f')]=_0x57e774[_0x8bb3('0x4a')][_0x8bb3('0x4f')];}return db[_0x8bb3('0x2e')]['find']({'where':_0x138aa8})[_0x8bb3('0x23')](function(_0xfd1f1f){if(_0xfd1f1f){throw new db[(_0x8bb3('0x50'))][(_0x8bb3('0x51'))]('The\x20inserted\x20key\x20already\x20exists.');}return db[_0x8bb3('0x2e')][_0x8bb3('0x4b')](_0x57e774['body']);})[_0x8bb3('0x23')](function(_0x508e31){var _0x1fb3f9=_0x57e774[_0x8bb3('0x52')]['get']({'plain':!![]});if(!_0x1fb3f9)throw new Error(_0x8bb3('0x53'));if(_0x1fb3f9[_0x8bb3('0x54')]==='user'){var _0x1bc6d1=_0x508e31[_0x8bb3('0x25')]({'plain':!![]});return db[_0x8bb3('0x55')][_0x8bb3('0x49')]({'where':{'name':_0x8bb3('0x26'),'userProfileId':_0x1fb3f9[_0x8bb3('0x56')]},'raw':!![]})[_0x8bb3('0x23')](function(_0x47d973){if(_0x47d973&&_0x47d973['autoAssociation']===0x0){return db[_0x8bb3('0x27')][_0x8bb3('0x4b')]({'name':_0x1bc6d1['name'],'resourceId':_0x1bc6d1['id'],'type':_0x47d973[_0x8bb3('0x2a')],'sectionId':_0x47d973['id']},{})[_0x8bb3('0x23')](function(){return _0x508e31;});}else{return _0x508e31;}})[_0x8bb3('0x45')](function(_0x41ccb1){logger[_0x8bb3('0x28')](_0x8bb3('0x57'),_0x41ccb1);throw _0x41ccb1;});}return _0x508e31;})[_0x8bb3('0x23')](respondWithResult(_0x3d5894,0xc9))[_0x8bb3('0x45')](handleError(_0x3d5894,null));};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js
index ead5b21..c467354 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 _0xe889=['lodash','util','bluebird','request-promise','rimraf','../../config/environment','CannedAnswer','tools_canned_answers'];(function(_0x1e30b9,_0x1cfd31){var _0x56177a=function(_0x2408cb){while(--_0x2408cb){_0x1e30b9['push'](_0x1e30b9['shift']());}};_0x56177a(++_0x1cfd31);}(_0xe889,0x88));var _0x9e88=function(_0x18b926,_0x448a61){_0x18b926=_0x18b926-0x0;var _0xa877ec=_0xe889[_0x18b926];return _0xa877ec;};'use strict';var _=require(_0x9e88('0x0'));var util=require(_0x9e88('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x9e88('0x2'));var rp=require(_0x9e88('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9e88('0x4'));var config=require(_0x9e88('0x5'));var attributes=require('./cannedAnswer.attributes');module['exports']=function(_0x527a2a,_0x28bdcf){return _0x527a2a['define'](_0x9e88('0x6'),attributes,{'tableName':_0x9e88('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});};
\ No newline at end of file
+var _0x5447=['./cannedAnswer.attributes','CannedAnswer','utf8mb4_unicode_ci','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x446208,_0xb483fb){var _0xe49563=function(_0x1d3a21){while(--_0x1d3a21){_0x446208['push'](_0x446208['shift']());}};_0xe49563(++_0xb483fb);}(_0x5447,0x1a7));var _0x7544=function(_0x59a190,_0x1ce42e){_0x59a190=_0x59a190-0x0;var _0x39e7e4=_0x5447[_0x59a190];return _0x39e7e4;};'use strict';var _=require(_0x7544('0x0'));var util=require(_0x7544('0x1'));var logger=require(_0x7544('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x7544('0x3'));var fs=require('fs');var path=require(_0x7544('0x4'));var rimraf=require(_0x7544('0x5'));var config=require(_0x7544('0x6'));var attributes=require(_0x7544('0x7'));module['exports']=function(_0x1efed6,_0x5dbdeb){return _0x1efed6['define'](_0x7544('0x8'),attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x7544('0x9')});};
\ No newline at end of file
diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js
index c3ab756..f02a716 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(_0x30c882,_0x5f4ed7){var _0xe20540=function(_0x3a3958){while(--_0x3a3958){_0x30c882['push'](_0x30c882['shift']());}};_0xe20540(++_0x5f4ed7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xa9e0[_0x1c546c];return _0x2cc384;};'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(_0x51de72,_0x247b45){var _0x4efb2f=function(_0x2eec0e){while(--_0x2eec0e){_0x51de72['push'](_0x51de72['shift']());}};_0x4efb2f(++_0x247b45);}(_0xa9e0,0x123));var _0x0a9e=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0xa9e0[_0xa1e3e3];return _0xc980e9;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}
\ No newline at end of file
diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js
index 981cdce..4611953 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 _0xbfd2=['connect-timeout','Router','fs-extra','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','show','create','put','/:id','delete','exports','path'];(function(_0x39f34f,_0x298f45){var _0x59fee1=function(_0x6ebbb7){while(--_0x6ebbb7){_0x39f34f['push'](_0x39f34f['shift']());}};_0x59fee1(++_0x298f45);}(_0xbfd2,0x14f));var _0x2bfd=function(_0x1d6f17,_0x2a853b){_0x1d6f17=_0x1d6f17-0x0;var _0xbbd2b3=_0xbfd2[_0x1d6f17];return _0xbbd2b3;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2bfd('0x0'));var timeout=require(_0x2bfd('0x1'));var express=require('express');var router=express[_0x2bfd('0x2')]();var fs_extra=require(_0x2bfd('0x3'));var auth=require(_0x2bfd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2bfd('0x5'));var controller=require(_0x2bfd('0x6'));router[_0x2bfd('0x7')]('/',auth[_0x2bfd('0x8')](),controller[_0x2bfd('0x9')]);router['get']('/:id',auth[_0x2bfd('0x8')](),controller[_0x2bfd('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2bfd('0xb')]);router[_0x2bfd('0xc')](_0x2bfd('0xd'),auth[_0x2bfd('0x8')](),controller['update']);router[_0x2bfd('0xe')](_0x2bfd('0xd'),auth[_0x2bfd('0x8')](),controller['destroy']);module[_0x2bfd('0xf')]=router;
\ No newline at end of file
+var _0x7ca5=['fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x20056f,_0x72c6a8){var _0x2dc96e=function(_0x570b5c){while(--_0x570b5c){_0x20056f['push'](_0x20056f['shift']());}};_0x2dc96e(++_0x72c6a8);}(_0x7ca5,0x12b));var _0x57ca=function(_0x36614f,_0x5d8ded){_0x36614f=_0x36614f-0x0;var _0x233f0b=_0x7ca5[_0x36614f];return _0x233f0b;};'use strict';var multer=require(_0x57ca('0x0'));var util=require(_0x57ca('0x1'));var path=require(_0x57ca('0x2'));var timeout=require(_0x57ca('0x3'));var express=require(_0x57ca('0x4'));var router=express['Router']();var fs_extra=require(_0x57ca('0x5'));var auth=require(_0x57ca('0x6'));var interaction=require(_0x57ca('0x7'));var config=require(_0x57ca('0x8'));var controller=require('./cannedAnswer.controller');router['get']('/',auth[_0x57ca('0x9')](),controller[_0x57ca('0xa')]);router[_0x57ca('0xb')](_0x57ca('0xc'),auth[_0x57ca('0x9')](),controller['show']);router[_0x57ca('0xd')]('/',auth[_0x57ca('0x9')](),controller[_0x57ca('0xe')]);router[_0x57ca('0xf')](_0x57ca('0xc'),auth[_0x57ca('0x9')](),controller[_0x57ca('0x10')]);router[_0x57ca('0x11')](_0x57ca('0xc'),auth[_0x57ca('0x9')](),controller[_0x57ca('0x12')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js
index 12729b7..3ee34b9 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 _0xcb18=['DATE','STRING','INTEGER'];(function(_0x21a691,_0x1abe9c){var _0x130987=function(_0x123fe1){while(--_0x123fe1){_0x21a691['push'](_0x21a691['shift']());}};_0x130987(++_0x1abe9c);}(_0xcb18,0x159));var _0x8cb1=function(_0x4c8eb3,_0x3c4a9d){_0x4c8eb3=_0x4c8eb3-0x0;var _0x6a8354=_0xcb18[_0x4c8eb3];return _0x6a8354;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x8cb1('0x0')],'allowNull':![],'defaultValue':'1970-01-01\x2000:00:01'},'clid':{'type':Sequelize[_0x8cb1('0x1')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0x8cb1('0x1')]},'dcontext':{'type':Sequelize[_0x8cb1('0x1')]},'channel':{'type':Sequelize[_0x8cb1('0x1')]},'dstchannel':{'type':Sequelize[_0x8cb1('0x1')]},'lastapp':{'type':Sequelize[_0x8cb1('0x1')]},'lastdata':{'type':Sequelize[_0x8cb1('0x1')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x8cb1('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x8cb1('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x8cb1('0x1')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8cb1('0x1')]},'linkedid':{'type':Sequelize[_0x8cb1('0x1')]},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x8cb1('0x1')]},'type':{'type':Sequelize[_0x8cb1('0x1')]},'tag':{'type':Sequelize[_0x8cb1('0x1')]}};
\ No newline at end of file
+var _0x622f=['sequelize','exports','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x4f5327,_0x585b12){var _0x12b184=function(_0x5aa68e){while(--_0x5aa68e){_0x4f5327['push'](_0x4f5327['shift']());}};_0x12b184(++_0x585b12);}(_0x622f,0x172));var _0xf622=function(_0x575765,_0x26b960){_0x575765=_0x575765-0x0;var _0x50cced=_0x622f[_0x575765];return _0x50cced;};'use strict';var Sequelize=require(_0xf622('0x0'));module[_0xf622('0x1')]={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xf622('0x2')},'clid':{'type':Sequelize[_0xf622('0x3')]},'src':{'type':Sequelize[_0xf622('0x3')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xf622('0x3')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xf622('0x3')]},'lastapp':{'type':Sequelize[_0xf622('0x3')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xf622('0x4')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xf622('0x3')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xf622('0x3')]},'userfield':{'type':Sequelize[_0xf622('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0xf622('0x3')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xf622('0x3')]},'tag':{'type':Sequelize[_0xf622('0x3')]}};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js
index e726b7e..5c12d48 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 _0x2b83=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','keys','options','create','catch','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error'];(function(_0x57f597,_0x4bcfb3){var _0x5d6218=function(_0x58fe8c){while(--_0x58fe8c){_0x57f597['push'](_0x57f597['shift']());}};_0x5d6218(++_0x4bcfb3);}(_0x2b83,0x1d3));var _0x32b8=function(_0x5ea249,_0x4348be){_0x5ea249=_0x5ea249-0x0;var _0x2edc33=_0x2b83[_0x5ea249];return _0x2edc33;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32b8('0x0'));var zipdir=require(_0x32b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b8('0x2'));var moment=require(_0x32b8('0x3'));var BPromise=require(_0x32b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x32b8('0x5'));var sox=require(_0x32b8('0x6'));var csv=require('to-csv');var ejs=require(_0x32b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b8('0x8'));var squel=require(_0x32b8('0x9'));var crypto=require(_0x32b8('0xa'));var jsforce=require(_0x32b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32b8('0xc'));var querystring=require(_0x32b8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32b8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x32b8('0xf'));var hardwareService=require(_0x32b8('0x10'));var logger=require(_0x32b8('0x11'))(_0x32b8('0x12'));var utils=require('../../config/utils');var config=require(_0x32b8('0x13'));var licenseUtil=require(_0x32b8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c337,_0x30d00a){_0x30d00a=_0x30d00a||0xcc;return function(_0x5a0ef2){if(_0x5a0ef2){return _0x49c337[_0x32b8('0x15')](_0x30d00a);}return _0x49c337['status'](_0x30d00a)[_0x32b8('0x16')]();};}function respondWithResult(_0x6b533e,_0x3b0fac){_0x3b0fac=_0x3b0fac||0xc8;return function(_0xdf56fb){if(_0xdf56fb){return _0x6b533e[_0x32b8('0x17')](_0x3b0fac)['json'](_0xdf56fb);}};}function respondWithFilteredResult(_0x4c8fc9,_0x5e7b4f){return function(_0x5e49d1){if(_0x5e49d1){var _0x4e0d7a=typeof _0x5e7b4f['offset']===_0x32b8('0x18')&&typeof _0x5e7b4f['limit']==='undefined';var _0x2828fc=_0x5e49d1[_0x32b8('0x19')];var _0x2ba4eb=_0x4e0d7a?0x0:_0x5e7b4f[_0x32b8('0x1a')];var _0x599bc3=_0x4e0d7a?_0x5e49d1['count']:_0x5e7b4f['offset']+_0x5e7b4f[_0x32b8('0x1b')];var _0x2ffea2;if(_0x599bc3>=_0x2828fc){_0x599bc3=_0x2828fc;_0x2ffea2=0xc8;}else{_0x2ffea2=0xce;}_0x4c8fc9[_0x32b8('0x17')](_0x2ffea2);return _0x4c8fc9[_0x32b8('0x1c')]('Content-Range',_0x2ba4eb+'-'+_0x599bc3+'/'+_0x2828fc)[_0x32b8('0x1d')](_0x5e49d1);}return null;};}function patchUpdates(_0x3ddc5f){return function(_0xb51551){try{jsonpatch[_0x32b8('0x1e')](_0xb51551,_0x3ddc5f,!![]);}catch(_0xb9dd1d){return BPromise[_0x32b8('0x1f')](_0xb9dd1d);}return _0xb51551[_0x32b8('0x20')]();};}function saveUpdates(_0xcd4b26,_0x52347c){return function(_0x567055){if(_0x567055){return _0x567055[_0x32b8('0x21')](_0xcd4b26)['then'](function(_0x1ec58d){return _0x1ec58d;});}return null;};}function removeEntity(_0x4bc4a8,_0x1a4c2b){return function(_0x21ee32){if(_0x21ee32){return _0x21ee32[_0x32b8('0x22')]()[_0x32b8('0x23')](function(){_0x4bc4a8[_0x32b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1360,_0x25a917){return function(_0x3eea54){if(!_0x3eea54){_0x4e1360[_0x32b8('0x15')](0x194);}return _0x3eea54;};}function handleError(_0x23e195,_0x29988d){_0x29988d=_0x29988d||0x1f4;return function(_0x57a6a3){logger[_0x32b8('0x24')](_0x57a6a3[_0x32b8('0x25')]);if(_0x57a6a3[_0x32b8('0x26')]){delete _0x57a6a3[_0x32b8('0x26')];}_0x23e195[_0x32b8('0x17')](_0x29988d)[_0x32b8('0x27')](_0x57a6a3);};}exports[_0x32b8('0x28')]=function(_0x39ce15,_0x3fa029){var _0xa225ec={},_0x3e0548={},_0x2bc3ce={'count':0x0,'rows':[]};var _0x1fcba2=_['map'](db[_0x32b8('0x29')][_0x32b8('0x2a')],function(_0x383b0e){return{'name':_0x383b0e[_0x32b8('0x2b')],'type':_0x383b0e[_0x32b8('0x2c')][_0x32b8('0x2d')]};});_0x3e0548[_0x32b8('0x2e')]=_[_0x32b8('0x2f')](_0x1fcba2,_0x32b8('0x26'));_0x3e0548[_0x32b8('0x30')]=_['keys'](_0x39ce15[_0x32b8('0x30')]);_0x3e0548[_0x32b8('0x31')]=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],_0x3e0548['query']);_0xa225ec['attributes']=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],qs[_0x32b8('0x33')](_0x39ce15[_0x32b8('0x30')]['fields']));_0xa225ec[_0x32b8('0x34')]=_0xa225ec[_0x32b8('0x34')][_0x32b8('0x35')]?_0xa225ec[_0x32b8('0x34')]:_0x3e0548[_0x32b8('0x2e')];if(!_0x39ce15[_0x32b8('0x30')][_0x32b8('0x36')](_0x32b8('0x37'))){_0xa225ec['limit']=qs[_0x32b8('0x1b')](_0x39ce15['query'][_0x32b8('0x1b')]);_0xa225ec[_0x32b8('0x1a')]=qs[_0x32b8('0x1a')](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x1a')]);}_0xa225ec[_0x32b8('0x38')]=qs['sort'](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x39')]);_0xa225ec[_0x32b8('0x3a')]=qs['filters'](_[_0x32b8('0x3b')](_0x39ce15['query'],_0x3e0548[_0x32b8('0x31')]),_0x1fcba2);if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3c')]){_0xa225ec[_0x32b8('0x3a')]=_['merge'](_0xa225ec[_0x32b8('0x3a')],{'$or':_[_0x32b8('0x2f')](_0x1fcba2,function(_0x2d586f){if(_0x2d586f['type']!=='VIRTUAL'){var _0xa8115e={};_0xa8115e[_0x2d586f[_0x32b8('0x26')]]={'$like':'%'+_0x39ce15[_0x32b8('0x30')]['filter']+'%'};return _0xa8115e;}})});}_0xa225ec=_['merge']({},_0xa225ec,_0x39ce15['options']);var _0x1aa6ef={'where':_0xa225ec[_0x32b8('0x3a')]};return db[_0x32b8('0x29')]['count'](_0x1aa6ef)[_0x32b8('0x23')](function(_0x14c109){_0x2bc3ce[_0x32b8('0x19')]=_0x14c109;if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3d')]){_0xa225ec[_0x32b8('0x3e')]=[{'all':!![]}];}return db[_0x32b8('0x29')][_0x32b8('0x3f')](_0xa225ec);})['then'](function(_0x39ec33){_0x2bc3ce['rows']=_0x39ec33;return _0x2bc3ce;})['then'](respondWithFilteredResult(_0x3fa029,_0xa225ec))['catch'](handleError(_0x3fa029,null));};exports['show']=function(_0x2d9003,_0x50e6e3){var _0x2a3968={'raw':!![],'where':{'id':_0x2d9003['params']['id']}},_0x52709b={};_0x52709b[_0x32b8('0x2e')]=_[_0x32b8('0x40')](db[_0x32b8('0x29')]['rawAttributes']);_0x52709b[_0x32b8('0x30')]=_[_0x32b8('0x40')](_0x2d9003[_0x32b8('0x30')]);_0x52709b['filters']=_['intersection'](_0x52709b[_0x32b8('0x2e')],_0x52709b['query']);_0x2a3968[_0x32b8('0x34')]=_['intersection'](_0x52709b[_0x32b8('0x2e')],qs['fields'](_0x2d9003[_0x32b8('0x30')][_0x32b8('0x33')]));_0x2a3968[_0x32b8('0x34')]=_0x2a3968[_0x32b8('0x34')]['length']?_0x2a3968['attributes']:_0x52709b[_0x32b8('0x2e')];if(_0x2d9003[_0x32b8('0x30')][_0x32b8('0x3d')]){_0x2a3968['include']=[{'all':!![]}];}_0x2a3968=_['merge']({},_0x2a3968,_0x2d9003[_0x32b8('0x41')]);return db[_0x32b8('0x29')]['find'](_0x2a3968)[_0x32b8('0x23')](handleEntityNotFound(_0x50e6e3,null))['then'](respondWithResult(_0x50e6e3,null))['catch'](handleError(_0x50e6e3,null));};exports['create']=function(_0x250ebf,_0x2d2624){return db[_0x32b8('0x29')][_0x32b8('0x42')](_0x250ebf['body'],{})[_0x32b8('0x23')](respondWithResult(_0x2d2624,0xc9))[_0x32b8('0x43')](handleError(_0x2d2624,null));};exports[_0x32b8('0x21')]=function(_0x29a413,_0x1a5bd4){if(_0x29a413[_0x32b8('0x44')]['id']){delete _0x29a413[_0x32b8('0x44')]['id'];}return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x29a413[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x1a5bd4,null))[_0x32b8('0x23')](saveUpdates(_0x29a413[_0x32b8('0x44')],null))[_0x32b8('0x23')](respondWithResult(_0x1a5bd4,null))[_0x32b8('0x43')](handleError(_0x1a5bd4,null));};exports[_0x32b8('0x22')]=function(_0x68210a,_0x5b8ca9){return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x68210a[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x5b8ca9,null))[_0x32b8('0x23')](removeEntity(_0x5b8ca9,null))[_0x32b8('0x43')](handleError(_0x5b8ca9,null));};exports[_0x32b8('0x47')]=function(_0x4f7c6f,_0xde4f61){return db[_0x32b8('0x29')][_0x32b8('0x47')]()[_0x32b8('0x23')](respondWithResult(_0xde4f61,null))['catch'](handleError(_0xde4f61,null));};
\ No newline at end of file
+var _0x2b83=['stack','name','send','index','Cdr','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','includeAll','include','findAll','keys','options','create','catch','body','find','params','describe','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','sendStatus','end','status','undefined','count','offset','limit','set','json','apply','reject','save','update','destroy','then','error'];(function(_0x1eacf9,_0x3f4cfa){var _0x2725ff=function(_0x3f2237){while(--_0x3f2237){_0x1eacf9['push'](_0x1eacf9['shift']());}};_0x2725ff(++_0x3f4cfa);}(_0x2b83,0x1d3));var _0x32b8=function(_0x1ecd65,_0x4b7608){_0x1ecd65=_0x1ecd65-0x0;var _0x59b038=_0x2b83[_0x1ecd65];return _0x59b038;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0x32b8('0x0'));var zipdir=require(_0x32b8('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x32b8('0x2'));var moment=require(_0x32b8('0x3'));var BPromise=require(_0x32b8('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x32b8('0x5'));var sox=require(_0x32b8('0x6'));var csv=require('to-csv');var ejs=require(_0x32b8('0x7'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x32b8('0x8'));var squel=require(_0x32b8('0x9'));var crypto=require(_0x32b8('0xa'));var jsforce=require(_0x32b8('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x32b8('0xc'));var querystring=require(_0x32b8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x32b8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x32b8('0xf'));var hardwareService=require(_0x32b8('0x10'));var logger=require(_0x32b8('0x11'))(_0x32b8('0x12'));var utils=require('../../config/utils');var config=require(_0x32b8('0x13'));var licenseUtil=require(_0x32b8('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49c337,_0x30d00a){_0x30d00a=_0x30d00a||0xcc;return function(_0x5a0ef2){if(_0x5a0ef2){return _0x49c337[_0x32b8('0x15')](_0x30d00a);}return _0x49c337['status'](_0x30d00a)[_0x32b8('0x16')]();};}function respondWithResult(_0x6b533e,_0x3b0fac){_0x3b0fac=_0x3b0fac||0xc8;return function(_0xdf56fb){if(_0xdf56fb){return _0x6b533e[_0x32b8('0x17')](_0x3b0fac)['json'](_0xdf56fb);}};}function respondWithFilteredResult(_0x4c8fc9,_0x5e7b4f){return function(_0x5e49d1){if(_0x5e49d1){var _0x4e0d7a=typeof _0x5e7b4f['offset']===_0x32b8('0x18')&&typeof _0x5e7b4f['limit']==='undefined';var _0x2828fc=_0x5e49d1[_0x32b8('0x19')];var _0x2ba4eb=_0x4e0d7a?0x0:_0x5e7b4f[_0x32b8('0x1a')];var _0x599bc3=_0x4e0d7a?_0x5e49d1['count']:_0x5e7b4f['offset']+_0x5e7b4f[_0x32b8('0x1b')];var _0x2ffea2;if(_0x599bc3>=_0x2828fc){_0x599bc3=_0x2828fc;_0x2ffea2=0xc8;}else{_0x2ffea2=0xce;}_0x4c8fc9[_0x32b8('0x17')](_0x2ffea2);return _0x4c8fc9[_0x32b8('0x1c')]('Content-Range',_0x2ba4eb+'-'+_0x599bc3+'/'+_0x2828fc)[_0x32b8('0x1d')](_0x5e49d1);}return null;};}function patchUpdates(_0x3ddc5f){return function(_0xb51551){try{jsonpatch[_0x32b8('0x1e')](_0xb51551,_0x3ddc5f,!![]);}catch(_0xb9dd1d){return BPromise[_0x32b8('0x1f')](_0xb9dd1d);}return _0xb51551[_0x32b8('0x20')]();};}function saveUpdates(_0xcd4b26,_0x52347c){return function(_0x567055){if(_0x567055){return _0x567055[_0x32b8('0x21')](_0xcd4b26)['then'](function(_0x1ec58d){return _0x1ec58d;});}return null;};}function removeEntity(_0x4bc4a8,_0x1a4c2b){return function(_0x21ee32){if(_0x21ee32){return _0x21ee32[_0x32b8('0x22')]()[_0x32b8('0x23')](function(){_0x4bc4a8[_0x32b8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4e1360,_0x25a917){return function(_0x3eea54){if(!_0x3eea54){_0x4e1360[_0x32b8('0x15')](0x194);}return _0x3eea54;};}function handleError(_0x23e195,_0x29988d){_0x29988d=_0x29988d||0x1f4;return function(_0x57a6a3){logger[_0x32b8('0x24')](_0x57a6a3[_0x32b8('0x25')]);if(_0x57a6a3[_0x32b8('0x26')]){delete _0x57a6a3[_0x32b8('0x26')];}_0x23e195[_0x32b8('0x17')](_0x29988d)[_0x32b8('0x27')](_0x57a6a3);};}exports[_0x32b8('0x28')]=function(_0x39ce15,_0x3fa029){var _0xa225ec={},_0x3e0548={},_0x2bc3ce={'count':0x0,'rows':[]};var _0x1fcba2=_['map'](db[_0x32b8('0x29')][_0x32b8('0x2a')],function(_0x383b0e){return{'name':_0x383b0e[_0x32b8('0x2b')],'type':_0x383b0e[_0x32b8('0x2c')][_0x32b8('0x2d')]};});_0x3e0548[_0x32b8('0x2e')]=_[_0x32b8('0x2f')](_0x1fcba2,_0x32b8('0x26'));_0x3e0548[_0x32b8('0x30')]=_['keys'](_0x39ce15[_0x32b8('0x30')]);_0x3e0548[_0x32b8('0x31')]=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],_0x3e0548['query']);_0xa225ec['attributes']=_[_0x32b8('0x32')](_0x3e0548[_0x32b8('0x2e')],qs[_0x32b8('0x33')](_0x39ce15[_0x32b8('0x30')]['fields']));_0xa225ec[_0x32b8('0x34')]=_0xa225ec[_0x32b8('0x34')][_0x32b8('0x35')]?_0xa225ec[_0x32b8('0x34')]:_0x3e0548[_0x32b8('0x2e')];if(!_0x39ce15[_0x32b8('0x30')][_0x32b8('0x36')](_0x32b8('0x37'))){_0xa225ec['limit']=qs[_0x32b8('0x1b')](_0x39ce15['query'][_0x32b8('0x1b')]);_0xa225ec[_0x32b8('0x1a')]=qs[_0x32b8('0x1a')](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x1a')]);}_0xa225ec[_0x32b8('0x38')]=qs['sort'](_0x39ce15[_0x32b8('0x30')][_0x32b8('0x39')]);_0xa225ec[_0x32b8('0x3a')]=qs['filters'](_[_0x32b8('0x3b')](_0x39ce15['query'],_0x3e0548[_0x32b8('0x31')]),_0x1fcba2);if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3c')]){_0xa225ec[_0x32b8('0x3a')]=_['merge'](_0xa225ec[_0x32b8('0x3a')],{'$or':_[_0x32b8('0x2f')](_0x1fcba2,function(_0x2d586f){if(_0x2d586f['type']!=='VIRTUAL'){var _0xa8115e={};_0xa8115e[_0x2d586f[_0x32b8('0x26')]]={'$like':'%'+_0x39ce15[_0x32b8('0x30')]['filter']+'%'};return _0xa8115e;}})});}_0xa225ec=_['merge']({},_0xa225ec,_0x39ce15['options']);var _0x1aa6ef={'where':_0xa225ec[_0x32b8('0x3a')]};return db[_0x32b8('0x29')]['count'](_0x1aa6ef)[_0x32b8('0x23')](function(_0x14c109){_0x2bc3ce[_0x32b8('0x19')]=_0x14c109;if(_0x39ce15[_0x32b8('0x30')][_0x32b8('0x3d')]){_0xa225ec[_0x32b8('0x3e')]=[{'all':!![]}];}return db[_0x32b8('0x29')][_0x32b8('0x3f')](_0xa225ec);})['then'](function(_0x39ec33){_0x2bc3ce['rows']=_0x39ec33;return _0x2bc3ce;})['then'](respondWithFilteredResult(_0x3fa029,_0xa225ec))['catch'](handleError(_0x3fa029,null));};exports['show']=function(_0x2d9003,_0x50e6e3){var _0x2a3968={'raw':!![],'where':{'id':_0x2d9003['params']['id']}},_0x52709b={};_0x52709b[_0x32b8('0x2e')]=_[_0x32b8('0x40')](db[_0x32b8('0x29')]['rawAttributes']);_0x52709b[_0x32b8('0x30')]=_[_0x32b8('0x40')](_0x2d9003[_0x32b8('0x30')]);_0x52709b['filters']=_['intersection'](_0x52709b[_0x32b8('0x2e')],_0x52709b['query']);_0x2a3968[_0x32b8('0x34')]=_['intersection'](_0x52709b[_0x32b8('0x2e')],qs['fields'](_0x2d9003[_0x32b8('0x30')][_0x32b8('0x33')]));_0x2a3968[_0x32b8('0x34')]=_0x2a3968[_0x32b8('0x34')]['length']?_0x2a3968['attributes']:_0x52709b[_0x32b8('0x2e')];if(_0x2d9003[_0x32b8('0x30')][_0x32b8('0x3d')]){_0x2a3968['include']=[{'all':!![]}];}_0x2a3968=_['merge']({},_0x2a3968,_0x2d9003[_0x32b8('0x41')]);return db[_0x32b8('0x29')]['find'](_0x2a3968)[_0x32b8('0x23')](handleEntityNotFound(_0x50e6e3,null))['then'](respondWithResult(_0x50e6e3,null))['catch'](handleError(_0x50e6e3,null));};exports['create']=function(_0x250ebf,_0x2d2624){return db[_0x32b8('0x29')][_0x32b8('0x42')](_0x250ebf['body'],{})[_0x32b8('0x23')](respondWithResult(_0x2d2624,0xc9))[_0x32b8('0x43')](handleError(_0x2d2624,null));};exports[_0x32b8('0x21')]=function(_0x29a413,_0x1a5bd4){if(_0x29a413[_0x32b8('0x44')]['id']){delete _0x29a413[_0x32b8('0x44')]['id'];}return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x29a413[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x1a5bd4,null))[_0x32b8('0x23')](saveUpdates(_0x29a413[_0x32b8('0x44')],null))[_0x32b8('0x23')](respondWithResult(_0x1a5bd4,null))[_0x32b8('0x43')](handleError(_0x1a5bd4,null));};exports[_0x32b8('0x22')]=function(_0x68210a,_0x5b8ca9){return db['Cdr'][_0x32b8('0x45')]({'where':{'id':_0x68210a[_0x32b8('0x46')]['id']}})[_0x32b8('0x23')](handleEntityNotFound(_0x5b8ca9,null))[_0x32b8('0x23')](removeEntity(_0x5b8ca9,null))[_0x32b8('0x43')](handleError(_0x5b8ca9,null));};exports[_0x32b8('0x47')]=function(_0x4f7c6f,_0xde4f61){return db[_0x32b8('0x29')][_0x32b8('0x47')]()[_0x32b8('0x23')](respondWithResult(_0xde4f61,null))['catch'](handleError(_0xde4f61,null));};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js
index 1119d42..7e27485 100644
--- a/server/api/cdr/cdr.model.js
+++ b/server/api/cdr/cdr.model.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x5cb8cd,_0x5821d4){var _0x1bccd6=function(_0x42f1f8){while(--_0x42f1f8){_0x5cb8cd['push'](_0x5cb8cd['shift']());}};_0x1bccd6(++_0x5821d4);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
+var _0x9957=['dst','src','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','accountcode','calldate','disposition'];(function(_0x12cdab,_0x4b1d57){var _0x4c2d31=function(_0x1d2026){while(--_0x1d2026){_0x12cdab['push'](_0x12cdab['shift']());}};_0x4c2d31(++_0x4b1d57);}(_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':'cdr','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xc')]},{'name':'calldate','fields':[_0x7995('0xd')]},{'name':_0x7995('0xe'),'fields':[_0x7995('0xe')]},{'name':_0x7995('0xf'),'fields':[_0x7995('0xf')]},{'name':_0x7995('0x10'),'fields':[_0x7995('0x10')]},{'name':'uniqueid','fields':[_0x7995('0x11')]}],'timestamps':![]});};
\ No newline at end of file
diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js
index 41bf9cd..0c3d09c 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 _0x5043=['request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x5043,0x173));var _0x3504=function(_0xc4aebc,_0x34460d){_0xc4aebc=_0xc4aebc-0x0;var _0x150244=_0x5043[_0xc4aebc];return _0x150244;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3504('0x0'));var BPromise=require('bluebird');var rs=require(_0x3504('0x1'));var fs=require('fs');var Redis=require(_0x3504('0x2'));var db=require(_0x3504('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3504('0x4'))(_0x3504('0x5'));var config=require(_0x3504('0x6'));var jayson=require(_0x3504('0x7'));var client=jayson[_0x3504('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x308ee1,_0x121978,_0x1c6f73){return new BPromise(function(_0x288ed7,_0x5eafb8){return client[_0x3504('0x9')](_0x308ee1,_0x1c6f73)[_0x3504('0xa')](function(_0x2ed068){logger[_0x3504('0xb')](_0x3504('0xc'),_0x121978,_0x3504('0xd'));logger[_0x3504('0xe')]('Cdr,\x20%s,\x20%s,\x20%s',_0x121978,_0x3504('0xd'),JSON[_0x3504('0xf')](_0x2ed068));if(_0x2ed068[_0x3504('0x10')]){if(_0x2ed068['error'][_0x3504('0x11')]===0x1f4){logger['error'](_0x3504('0xc'),_0x121978,_0x2ed068[_0x3504('0x10')][_0x3504('0x12')]);return _0x5eafb8(_0x2ed068[_0x3504('0x10')][_0x3504('0x12')]);}logger[_0x3504('0x10')](_0x3504('0xc'),_0x121978,_0x2ed068[_0x3504('0x10')]['message']);return _0x288ed7(_0x2ed068['error'][_0x3504('0x12')]);}else{logger[_0x3504('0xb')](_0x3504('0xc'),_0x121978,_0x3504('0xd'));_0x288ed7(_0x2ed068[_0x3504('0x13')][_0x3504('0x12')]);}})['catch'](function(_0x51db56){logger[_0x3504('0x10')]('Cdr,\x20%s,\x20%s',_0x121978,_0x51db56);_0x5eafb8(_0x51db56);});});}
\ No newline at end of file
+var _0xdc77=['Cdr,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x2a1a6f,_0x4e01ac){var _0x38cb09=function(_0x186fc7){while(--_0x186fc7){_0x2a1a6f['push'](_0x2a1a6f['shift']());}};_0x38cb09(++_0x4e01ac);}(_0xdc77,0x12e));var _0x7dc7=function(_0x94157,_0xe20257){_0x94157=_0x94157-0x0;var _0x496b2f=_0xdc77[_0x94157];return _0x496b2f;};'use strict';var _=require('lodash');var util=require(_0x7dc7('0x0'));var moment=require('moment');var BPromise=require(_0x7dc7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7dc7('0x2'));var db=require(_0x7dc7('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7dc7('0x4'))(_0x7dc7('0x5'));var config=require(_0x7dc7('0x6'));var jayson=require(_0x7dc7('0x7'));var client=jayson[_0x7dc7('0x8')][_0x7dc7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x108d94,_0x5610cb,_0x176a7f){return new BPromise(function(_0x53ccfc,_0x288d2b){return client[_0x7dc7('0xa')](_0x108d94,_0x176a7f)[_0x7dc7('0xb')](function(_0x370c43){logger[_0x7dc7('0xc')](_0x7dc7('0xd'),_0x5610cb,_0x7dc7('0xe'));logger[_0x7dc7('0xf')]('Cdr,\x20%s,\x20%s,\x20%s',_0x5610cb,_0x7dc7('0xe'),JSON[_0x7dc7('0x10')](_0x370c43));if(_0x370c43[_0x7dc7('0x11')]){if(_0x370c43[_0x7dc7('0x11')]['code']===0x1f4){logger[_0x7dc7('0x11')](_0x7dc7('0xd'),_0x5610cb,_0x370c43[_0x7dc7('0x11')]['message']);return _0x288d2b(_0x370c43[_0x7dc7('0x11')][_0x7dc7('0x12')]);}logger[_0x7dc7('0x11')](_0x7dc7('0xd'),_0x5610cb,_0x370c43[_0x7dc7('0x11')][_0x7dc7('0x12')]);return _0x53ccfc(_0x370c43['error'][_0x7dc7('0x12')]);}else{logger[_0x7dc7('0xc')](_0x7dc7('0xd'),_0x5610cb,_0x7dc7('0xe'));_0x53ccfc(_0x370c43[_0x7dc7('0x13')][_0x7dc7('0x12')]);}})[_0x7dc7('0x14')](function(_0x16508a){logger[_0x7dc7('0x11')](_0x7dc7('0xd'),_0x5610cb,_0x16508a);_0x288d2b(_0x16508a);});});}
\ No newline at end of file
diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js
index fb55524..af9b84c 100644
--- a/server/api/cdr/index.js
+++ b/server/api/cdr/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0xd8b0=['destroy','exports','multer','util','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','describe','/:id','show','post','create','put','update'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var fs_extra=require(_0x0d8b('0x3'));var auth=require(_0x0d8b('0x4'));var interaction=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var controller=require('./cdr.controller');router['get']('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x8')]);router[_0x0d8b('0x9')]('/describe',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xa')]);router['get'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0xd')]('/',auth[_0x0d8b('0x7')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0xf')](_0x0d8b('0xb'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['delete'](_0x0d8b('0xb'),auth[_0x0d8b('0x7')](),controller[_0x0d8b('0x11')]);module[_0x0d8b('0x12')]=router;
\ No newline at end of file
+var _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(_0x531d15,_0x599af5){var _0x271a18=function(_0x31284d){while(--_0x31284d){_0x531d15['push'](_0x531d15['shift']());}};_0x271a18(++_0x599af5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x934425,_0x5af72f){_0x934425=_0x934425-0x0;var _0x31d596=_0xa9e0[_0x934425];return _0x31d596;};'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 f279074..db37aeb 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 _0xf7a5=['noop','TEXT','*,*,*,*','exports','INTEGER','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xf7a5,0xc3));var _0x5f7a=function(_0x5da54c,_0x520452){_0x5da54c=_0x5da54c-0x0;var _0x1246b0=_0xf7a5[_0x5da54c];return _0x1246b0;};'use strict';var Sequelize=require('sequelize');module[_0x5f7a('0x0')]={'priority':{'type':Sequelize[_0x5f7a('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x5f7a('0x2')],'allowNull':![],'defaultValue':_0x5f7a('0x3')},'appdata':{'type':Sequelize[_0x5f7a('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x5f7a('0x2')],'defaultValue':_0x5f7a('0x5')}};
\ No newline at end of file
+var _0x3f3b=['*,*,*,*','sequelize','exports','STRING','noop','TEXT'];(function(_0x39e7cf,_0x20bd10){var _0x3061a9=function(_0x49685b){while(--_0x49685b){_0x39e7cf['push'](_0x39e7cf['shift']());}};_0x3061a9(++_0x20bd10);}(_0x3f3b,0xd3));var _0xb3f3=function(_0x5a9ff5,_0x41e797){_0x5a9ff5=_0x5a9ff5-0x0;var _0x514aa7=_0x3f3b[_0x5a9ff5];return _0x514aa7;};'use strict';var Sequelize=require(_0xb3f3('0x0'));module[_0xb3f3('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb3f3('0x2')],'allowNull':![],'defaultValue':_0xb3f3('0x3')},'appdata':{'type':Sequelize[_0xb3f3('0x4')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xb3f3('0x2')],'defaultValue':_0xb3f3('0x5')}};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js
index a3ae40a..75dd139 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 _0x2333=['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','offset','undefined','limit','count','Content-Range','apply','save','update','destroy','error','stack','name','show','params','model','keys','ChatApplication','query','filters','intersection','attributes','fields','includeAll','merge','options','find','then','body','catch','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0x2333,0x11a));var _0x3233=function(_0x2d20d0,_0x39c308){_0x2d20d0=_0x2d20d0-0x0;var _0x464564=_0x2333[_0x2d20d0];return _0x464564;};'use strict';var emlformat=require(_0x3233('0x0'));var rimraf=require(_0x3233('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x3233('0x2'));var moment=require(_0x3233('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3233('0x4'));var util=require(_0x3233('0x5'));var path=require(_0x3233('0x6'));var sox=require(_0x3233('0x7'));var csv=require(_0x3233('0x8'));var ejs=require(_0x3233('0x9'));var fs=require('fs');var fs_extra=require(_0x3233('0xa'));var _=require(_0x3233('0xb'));var squel=require(_0x3233('0xc'));var crypto=require(_0x3233('0xd'));var jsforce=require(_0x3233('0xe'));var deskjs=require(_0x3233('0xf'));var toCsv=require(_0x3233('0x8'));var querystring=require(_0x3233('0x10'));var Papa=require(_0x3233('0x11'));var Redis=require(_0x3233('0x12'));var authService=require(_0x3233('0x13'));var qs=require(_0x3233('0x14'));var as=require(_0x3233('0x15'));var hardwareService=require(_0x3233('0x16'));var logger=require(_0x3233('0x17'))('api');var utils=require(_0x3233('0x18'));var config=require(_0x3233('0x19'));var licenseUtil=require(_0x3233('0x1a'));var db=require(_0x3233('0x1b'))['db'];function respondWithStatusCode(_0xd59689,_0x18166d){_0x18166d=_0x18166d||0xcc;return function(_0x44ef5f){if(_0x44ef5f){return _0xd59689[_0x3233('0x1c')](_0x18166d);}return _0xd59689[_0x3233('0x1d')](_0x18166d)[_0x3233('0x1e')]();};}function respondWithResult(_0x428b44,_0x27e9fd){_0x27e9fd=_0x27e9fd||0xc8;return function(_0x7f5e07){if(_0x7f5e07){return _0x428b44['status'](_0x27e9fd)['json'](_0x7f5e07);}};}function respondWithFilteredResult(_0xc71f65,_0x26a41e){return function(_0x45fc24){if(_0x45fc24){var _0x5885a5=typeof _0x26a41e[_0x3233('0x1f')]===_0x3233('0x20')&&typeof _0x26a41e[_0x3233('0x21')]==='undefined';var _0x33f2e5=_0x45fc24[_0x3233('0x22')];var _0x55fa30=_0x5885a5?0x0:_0x26a41e[_0x3233('0x1f')];var _0x58420c=_0x5885a5?_0x45fc24[_0x3233('0x22')]:_0x26a41e['offset']+_0x26a41e['limit'];var _0x5a6f13;if(_0x58420c>=_0x33f2e5){_0x58420c=_0x33f2e5;_0x5a6f13=0xc8;}else{_0x5a6f13=0xce;}_0xc71f65[_0x3233('0x1d')](_0x5a6f13);return _0xc71f65['set'](_0x3233('0x23'),_0x55fa30+'-'+_0x58420c+'/'+_0x33f2e5)['json'](_0x45fc24);}return null;};}function patchUpdates(_0x305227){return function(_0x161855){try{jsonpatch[_0x3233('0x24')](_0x161855,_0x305227,!![]);}catch(_0x42d311){return BPromise['reject'](_0x42d311);}return _0x161855[_0x3233('0x25')]();};}function saveUpdates(_0x2a9dd9,_0x56fa5a){return function(_0x531cd8){if(_0x531cd8){return _0x531cd8[_0x3233('0x26')](_0x2a9dd9)['then'](function(_0x199c37){return _0x199c37;});}return null;};}function removeEntity(_0xa73f3e,_0x43227e){return function(_0x4c3875){if(_0x4c3875){return _0x4c3875[_0x3233('0x27')]()['then'](function(){_0xa73f3e[_0x3233('0x1d')](0xcc)[_0x3233('0x1e')]();});}};}function handleEntityNotFound(_0x56f216,_0x3351d3){return function(_0x49a421){if(!_0x49a421){_0x56f216['sendStatus'](0x194);}return _0x49a421;};}function handleError(_0x430e8e,_0x39a345){_0x39a345=_0x39a345||0x1f4;return function(_0x5d8e63){logger[_0x3233('0x28')](_0x5d8e63[_0x3233('0x29')]);if(_0x5d8e63[_0x3233('0x2a')]){delete _0x5d8e63[_0x3233('0x2a')];}_0x430e8e[_0x3233('0x1d')](_0x39a345)['send'](_0x5d8e63);};}exports[_0x3233('0x2b')]=function(_0xd4171b,_0xabcf54){var _0xc87d63={'raw':!![],'where':{'id':_0xd4171b[_0x3233('0x2c')]['id']}},_0x233f6b={};_0x233f6b[_0x3233('0x2d')]=_[_0x3233('0x2e')](db[_0x3233('0x2f')]['rawAttributes']);_0x233f6b[_0x3233('0x30')]=_[_0x3233('0x2e')](_0xd4171b['query']);_0x233f6b[_0x3233('0x31')]=_[_0x3233('0x32')](_0x233f6b['model'],_0x233f6b[_0x3233('0x30')]);_0xc87d63[_0x3233('0x33')]=_['intersection'](_0x233f6b[_0x3233('0x2d')],qs[_0x3233('0x34')](_0xd4171b['query'][_0x3233('0x34')]));_0xc87d63[_0x3233('0x33')]=_0xc87d63['attributes']['length']?_0xc87d63[_0x3233('0x33')]:_0x233f6b['model'];if(_0xd4171b[_0x3233('0x30')][_0x3233('0x35')]){_0xc87d63['include']=[{'all':!![]}];}_0xc87d63=_[_0x3233('0x36')]({},_0xc87d63,_0xd4171b[_0x3233('0x37')]);return db[_0x3233('0x2f')][_0x3233('0x38')](_0xc87d63)[_0x3233('0x39')](handleEntityNotFound(_0xabcf54,null))[_0x3233('0x39')](respondWithResult(_0xabcf54,null))['catch'](handleError(_0xabcf54,null));};exports['update']=function(_0x33669b,_0x3c2ab8){if(_0x33669b['body']['id']){delete _0x33669b[_0x3233('0x3a')]['id'];}return db['ChatApplication'][_0x3233('0x38')]({'where':{'id':_0x33669b[_0x3233('0x2c')]['id']}})[_0x3233('0x39')](handleEntityNotFound(_0x3c2ab8,null))['then'](saveUpdates(_0x33669b[_0x3233('0x3a')],null))[_0x3233('0x39')](respondWithResult(_0x3c2ab8,null))[_0x3233('0x3b')](handleError(_0x3c2ab8,null));};exports['destroy']=function(_0x3edb85,_0x461eb7){return db[_0x3233('0x2f')][_0x3233('0x38')]({'where':{'id':_0x3edb85[_0x3233('0x2c')]['id']}})[_0x3233('0x39')](handleEntityNotFound(_0x461eb7,null))[_0x3233('0x39')](removeEntity(_0x461eb7,null))[_0x3233('0x3b')](handleError(_0x461eb7,null));};
\ No newline at end of file
+var _0x1339=['rimraf','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','fs-extra','lodash','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','show','model','keys','ChatApplication','rawAttributes','query','intersection','attributes','fields','length','include','merge','find','body','catch','params','eml-format'];(function(_0x11fe8d,_0x19aba4){var _0x356099=function(_0x50c919){while(--_0x50c919){_0x11fe8d['push'](_0x11fe8d['shift']());}};_0x356099(++_0x19aba4);}(_0x1339,0x1bf));var _0x9133=function(_0x2807a6,_0x582501){_0x2807a6=_0x2807a6-0x0;var _0x53ed61=_0x1339[_0x2807a6];return _0x53ed61;};'use strict';var emlformat=require(_0x9133('0x0'));var rimraf=require(_0x9133('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9133('0x2'));var rp=require(_0x9133('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x9133('0x4'));var util=require(_0x9133('0x5'));var path=require('path');var sox=require(_0x9133('0x6'));var csv=require(_0x9133('0x7'));var ejs=require(_0x9133('0x8'));var fs=require('fs');var fs_extra=require(_0x9133('0x9'));var _=require(_0x9133('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x9133('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9133('0x7'));var querystring=require('querystring');var Papa=require(_0x9133('0xc'));var Redis=require('ioredis');var authService=require(_0x9133('0xd'));var qs=require(_0x9133('0xe'));var as=require(_0x9133('0xf'));var hardwareService=require(_0x9133('0x10'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x9133('0x11'));var licenseUtil=require(_0x9133('0x12'));var db=require(_0x9133('0x13'))['db'];function respondWithStatusCode(_0x54bfc7,_0x3048a5){_0x3048a5=_0x3048a5||0xcc;return function(_0x177239){if(_0x177239){return _0x54bfc7[_0x9133('0x14')](_0x3048a5);}return _0x54bfc7[_0x9133('0x15')](_0x3048a5)[_0x9133('0x16')]();};}function respondWithResult(_0x35edae,_0x8e9362){_0x8e9362=_0x8e9362||0xc8;return function(_0xb05b1c){if(_0xb05b1c){return _0x35edae[_0x9133('0x15')](_0x8e9362)['json'](_0xb05b1c);}};}function respondWithFilteredResult(_0x18c203,_0x57f4d9){return function(_0x555651){if(_0x555651){var _0x8e3461=typeof _0x57f4d9[_0x9133('0x17')]===_0x9133('0x18')&&typeof _0x57f4d9[_0x9133('0x19')]===_0x9133('0x18');var _0x26b12a=_0x555651[_0x9133('0x1a')];var _0x4aa4be=_0x8e3461?0x0:_0x57f4d9['offset'];var _0x3d5506=_0x8e3461?_0x555651[_0x9133('0x1a')]:_0x57f4d9[_0x9133('0x17')]+_0x57f4d9['limit'];var _0x5f4d4d;if(_0x3d5506>=_0x26b12a){_0x3d5506=_0x26b12a;_0x5f4d4d=0xc8;}else{_0x5f4d4d=0xce;}_0x18c203[_0x9133('0x15')](_0x5f4d4d);return _0x18c203[_0x9133('0x1b')](_0x9133('0x1c'),_0x4aa4be+'-'+_0x3d5506+'/'+_0x26b12a)[_0x9133('0x1d')](_0x555651);}return null;};}function patchUpdates(_0x307671){return function(_0x21720){try{jsonpatch[_0x9133('0x1e')](_0x21720,_0x307671,!![]);}catch(_0x24cce0){return BPromise[_0x9133('0x1f')](_0x24cce0);}return _0x21720[_0x9133('0x20')]();};}function saveUpdates(_0x2f5e77,_0x2219d7){return function(_0xeb79c1){if(_0xeb79c1){return _0xeb79c1[_0x9133('0x21')](_0x2f5e77)['then'](function(_0xdb994d){return _0xdb994d;});}return null;};}function removeEntity(_0xdc20d9,_0x4bf1ed){return function(_0x4f6c6a){if(_0x4f6c6a){return _0x4f6c6a[_0x9133('0x22')]()[_0x9133('0x23')](function(){_0xdc20d9[_0x9133('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xbc4f92,_0x3a7c70){return function(_0x50d1da){if(!_0x50d1da){_0xbc4f92[_0x9133('0x14')](0x194);}return _0x50d1da;};}function handleError(_0x58907c,_0x552011){_0x552011=_0x552011||0x1f4;return function(_0x5a83e0){logger[_0x9133('0x24')](_0x5a83e0[_0x9133('0x25')]);if(_0x5a83e0['name']){delete _0x5a83e0[_0x9133('0x26')];}_0x58907c[_0x9133('0x15')](_0x552011)[_0x9133('0x27')](_0x5a83e0);};}exports[_0x9133('0x28')]=function(_0x52d0af,_0x276583){var _0x3f8b9b={'raw':!![],'where':{'id':_0x52d0af['params']['id']}},_0x3c8081={};_0x3c8081[_0x9133('0x29')]=_[_0x9133('0x2a')](db[_0x9133('0x2b')][_0x9133('0x2c')]);_0x3c8081[_0x9133('0x2d')]=_['keys'](_0x52d0af[_0x9133('0x2d')]);_0x3c8081['filters']=_[_0x9133('0x2e')](_0x3c8081[_0x9133('0x29')],_0x3c8081[_0x9133('0x2d')]);_0x3f8b9b[_0x9133('0x2f')]=_['intersection'](_0x3c8081[_0x9133('0x29')],qs[_0x9133('0x30')](_0x52d0af[_0x9133('0x2d')][_0x9133('0x30')]));_0x3f8b9b['attributes']=_0x3f8b9b[_0x9133('0x2f')][_0x9133('0x31')]?_0x3f8b9b[_0x9133('0x2f')]:_0x3c8081[_0x9133('0x29')];if(_0x52d0af[_0x9133('0x2d')]['includeAll']){_0x3f8b9b[_0x9133('0x32')]=[{'all':!![]}];}_0x3f8b9b=_[_0x9133('0x33')]({},_0x3f8b9b,_0x52d0af['options']);return db[_0x9133('0x2b')][_0x9133('0x34')](_0x3f8b9b)[_0x9133('0x23')](handleEntityNotFound(_0x276583,null))[_0x9133('0x23')](respondWithResult(_0x276583,null))['catch'](handleError(_0x276583,null));};exports[_0x9133('0x21')]=function(_0x55a860,_0x70d666){if(_0x55a860[_0x9133('0x35')]['id']){delete _0x55a860['body']['id'];}return db[_0x9133('0x2b')][_0x9133('0x34')]({'where':{'id':_0x55a860['params']['id']}})[_0x9133('0x23')](handleEntityNotFound(_0x70d666,null))[_0x9133('0x23')](saveUpdates(_0x55a860['body'],null))['then'](respondWithResult(_0x70d666,null))[_0x9133('0x36')](handleError(_0x70d666,null));};exports['destroy']=function(_0x31331b,_0x3f52ea){return db['ChatApplication'][_0x9133('0x34')]({'where':{'id':_0x31331b[_0x9133('0x37')]['id']}})['then'](handleEntityNotFound(_0x3f52ea,null))[_0x9133('0x23')](removeEntity(_0x3f52ea,null))[_0x9133('0x36')](handleError(_0x3f52ea,null));};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js
index 257e639..acb0c4a 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 _0x5c71=['moment','bluebird','path','exports','define','ChatApplication','chat_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4c53b7,_0x5af6a4){var _0x10653c=function(_0x359903){while(--_0x359903){_0x4c53b7['push'](_0x4c53b7['shift']());}};_0x10653c(++_0x5af6a4);}(_0x5c71,0x188));var _0x15c7=function(_0x41348e,_0x2d14a2){_0x41348e=_0x41348e-0x0;var _0x27891e=_0x5c71[_0x41348e];return _0x27891e;};'use strict';var _=require(_0x15c7('0x0'));var util=require(_0x15c7('0x1'));var logger=require(_0x15c7('0x2'))(_0x15c7('0x3'));var moment=require(_0x15c7('0x4'));var BPromise=require(_0x15c7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x15c7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatApplication.attributes');module[_0x15c7('0x7')]=function(_0x48fba1,_0xd64778){return _0x48fba1[_0x15c7('0x8')](_0x15c7('0x9'),attributes,{'tableName':_0x15c7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x15c7('0xb')});};
\ No newline at end of file
+var _0x265f=['define','ChatApplication','chat_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','./chatApplication.attributes','exports'];(function(_0x55d4fc,_0x56e45e){var _0x241b2=function(_0x362796){while(--_0x362796){_0x55d4fc['push'](_0x55d4fc['shift']());}};_0x241b2(++_0x56e45e);}(_0x265f,0x1e1));var _0xf265=function(_0x1aa13e,_0x12a40b){_0x1aa13e=_0x1aa13e-0x0;var _0x1144bd=_0x265f[_0x1aa13e];return _0x1144bd;};'use strict';var _=require(_0xf265('0x0'));var util=require(_0xf265('0x1'));var logger=require(_0xf265('0x2'))('api');var moment=require(_0xf265('0x3'));var BPromise=require(_0xf265('0x4'));var rp=require(_0xf265('0x5'));var fs=require('fs');var path=require(_0xf265('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf265('0x7'));module[_0xf265('0x8')]=function(_0x517063,_0x3842fd){return _0x517063[_0xf265('0x9')](_0xf265('0xa'),attributes,{'tableName':_0xf265('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xf265('0xc'),'collate':_0xf265('0xd')});};
\ No newline at end of file
diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js
index 91ca95c..57d739e 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 _0x7d70=['../../config/logger','../../config/environment','jayson/promise','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x1762b4,_0x33d836){var _0x29beda=function(_0x31c2fa){while(--_0x31c2fa){_0x1762b4['push'](_0x1762b4['shift']());}};_0x29beda(++_0x33d836);}(_0x7d70,0x129));var _0x07d7=function(_0x291c9b,_0x239710){_0x291c9b=_0x291c9b-0x0;var _0x204bb2=_0x7d70[_0x291c9b];return _0x204bb2;};'use strict';var _=require(_0x07d7('0x0'));var util=require(_0x07d7('0x1'));var moment=require(_0x07d7('0x2'));var BPromise=require('bluebird');var rs=require(_0x07d7('0x3'));var fs=require('fs');var Redis=require(_0x07d7('0x4'));var db=require(_0x07d7('0x5'))['db'];var utils=require(_0x07d7('0x6'));var logger=require(_0x07d7('0x7'))('rpc');var config=require(_0x07d7('0x8'));var jayson=require(_0x07d7('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x43df4f,_0x17b7b7,_0x181a64){return new BPromise(function(_0x44b935,_0x55b96b){return client['request'](_0x43df4f,_0x181a64)['then'](function(_0x4c8710){logger[_0x07d7('0xa')](_0x07d7('0xb'),_0x17b7b7,_0x07d7('0xc'));logger['debug'](_0x07d7('0xd'),_0x17b7b7,_0x07d7('0xc'),JSON[_0x07d7('0xe')](_0x4c8710));if(_0x4c8710[_0x07d7('0xf')]){if(_0x4c8710[_0x07d7('0xf')][_0x07d7('0x10')]===0x1f4){logger[_0x07d7('0xf')](_0x07d7('0xb'),_0x17b7b7,_0x4c8710[_0x07d7('0xf')][_0x07d7('0x11')]);return _0x55b96b(_0x4c8710[_0x07d7('0xf')][_0x07d7('0x11')]);}logger[_0x07d7('0xf')]('ChatApplication,\x20%s,\x20%s',_0x17b7b7,_0x4c8710[_0x07d7('0xf')][_0x07d7('0x11')]);return _0x44b935(_0x4c8710['error'][_0x07d7('0x11')]);}else{logger[_0x07d7('0xa')]('ChatApplication,\x20%s,\x20%s',_0x17b7b7,_0x07d7('0xc'));_0x44b935(_0x4c8710[_0x07d7('0x12')][_0x07d7('0x11')]);}})['catch'](function(_0x4c083c){logger[_0x07d7('0xf')](_0x07d7('0xb'),_0x17b7b7,_0x4c083c);_0x55b96b(_0x4c083c);});});}
\ No newline at end of file
+var _0x06c1=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','../../config/utils'];(function(_0x3e0d81,_0x258d37){var _0x1fa8ca=function(_0x1997a2){while(--_0x1997a2){_0x3e0d81['push'](_0x3e0d81['shift']());}};_0x1fa8ca(++_0x258d37);}(_0x06c1,0x137));var _0x106c=function(_0xaf5a6c,_0x1b9406){_0xaf5a6c=_0xaf5a6c-0x0;var _0x56e446=_0x06c1[_0xaf5a6c];return _0x56e446;};'use strict';var _=require(_0x106c('0x0'));var util=require(_0x106c('0x1'));var moment=require(_0x106c('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x106c('0x3'));var logger=require(_0x106c('0x4'))(_0x106c('0x5'));var config=require(_0x106c('0x6'));var jayson=require(_0x106c('0x7'));var client=jayson[_0x106c('0x8')][_0x106c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1ec91b,_0xae9137,_0xe86152){return new BPromise(function(_0x15873e,_0x44a42d){return client[_0x106c('0xa')](_0x1ec91b,_0xe86152)[_0x106c('0xb')](function(_0x5cbfc1){logger[_0x106c('0xc')](_0x106c('0xd'),_0xae9137,_0x106c('0xe'));logger['debug'](_0x106c('0xf'),_0xae9137,_0x106c('0xe'),JSON[_0x106c('0x10')](_0x5cbfc1));if(_0x5cbfc1['error']){if(_0x5cbfc1[_0x106c('0x11')][_0x106c('0x12')]===0x1f4){logger[_0x106c('0x11')](_0x106c('0xd'),_0xae9137,_0x5cbfc1[_0x106c('0x11')][_0x106c('0x13')]);return _0x44a42d(_0x5cbfc1['error']['message']);}logger[_0x106c('0x11')](_0x106c('0xd'),_0xae9137,_0x5cbfc1[_0x106c('0x11')][_0x106c('0x13')]);return _0x15873e(_0x5cbfc1[_0x106c('0x11')][_0x106c('0x13')]);}else{logger[_0x106c('0xc')]('ChatApplication,\x20%s,\x20%s',_0xae9137,'request\x20sent');_0x15873e(_0x5cbfc1['result'][_0x106c('0x13')]);}})[_0x106c('0x14')](function(_0x1c1995){logger[_0x106c('0x11')](_0x106c('0xd'),_0xae9137,_0x1c1995);_0x44a42d(_0x1c1995);});});}
\ No newline at end of file
diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js
index d4c1060..8bb5c59 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 _0xb19a=['multer','path','connect-timeout','express','Router','../../components/interaction/service','./chatApplication.controller','get','/:id','isAuthenticated','put','update','delete','destroy','exports'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xb19a,0x177));var _0xab19=function(_0xf9e153,_0x12d3ae){_0xf9e153=_0xf9e153-0x0;var _0x5e1a44=_0xb19a[_0xf9e153];return _0x5e1a44;};'use strict';var multer=require(_0xab19('0x0'));var util=require('util');var path=require(_0xab19('0x1'));var timeout=require(_0xab19('0x2'));var express=require(_0xab19('0x3'));var router=express[_0xab19('0x4')]();var fs_extra=require('fs-extra');var auth=require('../../components/auth/service');var interaction=require(_0xab19('0x5'));var config=require('../../config/environment');var controller=require(_0xab19('0x6'));router[_0xab19('0x7')](_0xab19('0x8'),auth[_0xab19('0x9')](),controller['show']);router[_0xab19('0xa')](_0xab19('0x8'),auth[_0xab19('0x9')](),controller[_0xab19('0xb')]);router[_0xab19('0xc')](_0xab19('0x8'),auth['isAuthenticated'](),controller[_0xab19('0xd')]);module[_0xab19('0xe')]=router;
\ No newline at end of file
+var _0xf0d7=['exports','util','connect-timeout','express','Router','fs-extra','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','put','isAuthenticated','update','delete','destroy'];(function(_0xfb8e9c,_0x4bfaec){var _0x432968=function(_0x574cce){while(--_0x574cce){_0xfb8e9c['push'](_0xfb8e9c['shift']());}};_0x432968(++_0x4bfaec);}(_0xf0d7,0xb1));var _0x7f0d=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xf0d7[_0x618414];return _0x21c19a;};'use strict';var multer=require('multer');var util=require(_0x7f0d('0x0'));var path=require('path');var timeout=require(_0x7f0d('0x1'));var express=require(_0x7f0d('0x2'));var router=express[_0x7f0d('0x3')]();var fs_extra=require(_0x7f0d('0x4'));var auth=require('../../components/auth/service');var interaction=require(_0x7f0d('0x5'));var config=require(_0x7f0d('0x6'));var controller=require(_0x7f0d('0x7'));router[_0x7f0d('0x8')](_0x7f0d('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x7f0d('0xa')](_0x7f0d('0x9'),auth[_0x7f0d('0xb')](),controller[_0x7f0d('0xc')]);router[_0x7f0d('0xd')](_0x7f0d('0x9'),auth[_0x7f0d('0xb')](),controller[_0x7f0d('0xe')]);module[_0x7f0d('0xf')]=router;
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js
index 7acb367..36791d1 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 _0xde74=['sequelize','exports','STRING'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xde74,0x1c8));var _0x4de7=function(_0x20f204,_0x4d9187){_0x20f204=_0x20f204-0x0;var _0x4a48f4=_0xde74[_0x20f204];return _0x4a48f4;};'use strict';var Sequelize=require(_0x4de7('0x0'));module[_0x4de7('0x1')]={'name':{'type':Sequelize[_0x4de7('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}};
\ No newline at end of file
+var _0xa53e=['sequelize','STRING'];(function(_0x253a03,_0xac1b){var _0x355862=function(_0x12c250){while(--_0x12c250){_0x253a03['push'](_0x253a03['shift']());}};_0x355862(++_0xac1b);}(_0xa53e,0xe6));var _0xea53=function(_0x3c5daf,_0xce52bf){_0x3c5daf=_0x3c5daf-0x0;var _0x5d48d7=_0xa53e[_0x3c5daf];return _0x5d48d7;};'use strict';var Sequelize=require(_0xea53('0x0'));module['exports']={'name':{'type':Sequelize[_0xea53('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xea53('0x1')]},'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 0ff5244..f0e9808 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 _0x5650=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','offset','limit','undefined','count','set','json','save','update','then','destroy','end','error','stack','name','send','map','ChatGroup','fieldName','keys','query','filters','intersection','model','attributes','fields','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','length','hasOwnProperty','nolimit','removeMembers','addMessage','ChatGroupId','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x14d896,_0x53578b){var _0x28679a=function(_0x14921f){while(--_0x14921f){_0x14d896['push'](_0x14d896['shift']());}};_0x28679a(++_0x53578b);}(_0x5650,0xba));var _0x0565=function(_0x2fa393,_0x57e26d){_0x2fa393=_0x2fa393-0x0;var _0x15a4fb=_0x5650[_0x2fa393];return _0x15a4fb;};'use strict';var emlformat=require(_0x0565('0x0'));var rimraf=require(_0x0565('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0565('0x2'));var rp=require(_0x0565('0x3'));var moment=require(_0x0565('0x4'));var BPromise=require(_0x0565('0x5'));var Mustache=require('mustache');var util=require(_0x0565('0x6'));var path=require(_0x0565('0x7'));var sox=require(_0x0565('0x8'));var csv=require('to-csv');var ejs=require(_0x0565('0x9'));var fs=require('fs');var fs_extra=require(_0x0565('0xa'));var _=require('lodash');var squel=require(_0x0565('0xb'));var crypto=require(_0x0565('0xc'));var jsforce=require(_0x0565('0xd'));var deskjs=require(_0x0565('0xe'));var toCsv=require(_0x0565('0xf'));var querystring=require(_0x0565('0x10'));var Papa=require(_0x0565('0x11'));var Redis=require(_0x0565('0x12'));var authService=require(_0x0565('0x13'));var qs=require(_0x0565('0x14'));var as=require(_0x0565('0x15'));var hardwareService=require(_0x0565('0x16'));var logger=require('../../config/logger')(_0x0565('0x17'));var utils=require(_0x0565('0x18'));var config=require(_0x0565('0x19'));var licenseUtil=require(_0x0565('0x1a'));var db=require(_0x0565('0x1b'))['db'];config[_0x0565('0x1c')]=_[_0x0565('0x1d')](config['redis'],{'host':_0x0565('0x1e'),'port':0x18eb});var socket=require(_0x0565('0x1f'))(new Redis(config[_0x0565('0x1c')]));require(_0x0565('0x20'))[_0x0565('0x21')](socket);function respondWithStatusCode(_0x58cc35,_0x37ba38){_0x37ba38=_0x37ba38||0xcc;return function(_0x4d51a0){if(_0x4d51a0){return _0x58cc35[_0x0565('0x22')](_0x37ba38);}return _0x58cc35[_0x0565('0x23')](_0x37ba38)['end']();};}function respondWithResult(_0x134d3c,_0x2c7fa6){_0x2c7fa6=_0x2c7fa6||0xc8;return function(_0x478db6){if(_0x478db6){return _0x134d3c[_0x0565('0x23')](_0x2c7fa6)['json'](_0x478db6);}};}function respondWithFilteredResult(_0x59f196,_0xf21ac6){return function(_0x73cdd4){if(_0x73cdd4){var _0x484e29=typeof _0xf21ac6[_0x0565('0x24')]==='undefined'&&typeof _0xf21ac6[_0x0565('0x25')]===_0x0565('0x26');var _0x131c5f=_0x73cdd4[_0x0565('0x27')];var _0x47bb38=_0x484e29?0x0:_0xf21ac6[_0x0565('0x24')];var _0x1b4074=_0x484e29?_0x73cdd4['count']:_0xf21ac6[_0x0565('0x24')]+_0xf21ac6[_0x0565('0x25')];var _0x39bdba;if(_0x1b4074>=_0x131c5f){_0x1b4074=_0x131c5f;_0x39bdba=0xc8;}else{_0x39bdba=0xce;}_0x59f196[_0x0565('0x23')](_0x39bdba);return _0x59f196[_0x0565('0x28')]('Content-Range',_0x47bb38+'-'+_0x1b4074+'/'+_0x131c5f)[_0x0565('0x29')](_0x73cdd4);}return null;};}function patchUpdates(_0x2185e6){return function(_0x511745){try{jsonpatch['apply'](_0x511745,_0x2185e6,!![]);}catch(_0x5771bc){return BPromise['reject'](_0x5771bc);}return _0x511745[_0x0565('0x2a')]();};}function saveUpdates(_0x3fa9d7,_0x2f724b){return function(_0x4b48b6){if(_0x4b48b6){return _0x4b48b6[_0x0565('0x2b')](_0x3fa9d7)[_0x0565('0x2c')](function(_0x17d71b){return _0x17d71b;});}return null;};}function removeEntity(_0x3c8f6f,_0x3c5a3e){return function(_0x41c4d2){if(_0x41c4d2){return _0x41c4d2[_0x0565('0x2d')]()['then'](function(){_0x3c8f6f[_0x0565('0x23')](0xcc)[_0x0565('0x2e')]();});}};}function handleEntityNotFound(_0x42bfeb,_0x3d800){return function(_0x14c950){if(!_0x14c950){_0x42bfeb[_0x0565('0x22')](0x194);}return _0x14c950;};}function handleError(_0x5f24d8,_0x412a90){_0x412a90=_0x412a90||0x1f4;return function(_0x4c905e){logger[_0x0565('0x2f')](_0x4c905e[_0x0565('0x30')]);if(_0x4c905e[_0x0565('0x31')]){delete _0x4c905e[_0x0565('0x31')];}_0x5f24d8[_0x0565('0x23')](_0x412a90)[_0x0565('0x32')](_0x4c905e);};}exports['index']=function(_0x2ffd7c,_0xc8feec){var _0x340ca0={},_0x2359a3={},_0x2446fd={'count':0x0,'rows':[]};var _0x156d50=_[_0x0565('0x33')](db[_0x0565('0x34')]['rawAttributes'],function(_0x4dded8){return{'name':_0x4dded8[_0x0565('0x35')],'type':_0x4dded8['type']['key']};});_0x2359a3['model']=_['map'](_0x156d50,_0x0565('0x31'));_0x2359a3['query']=_[_0x0565('0x36')](_0x2ffd7c[_0x0565('0x37')]);_0x2359a3[_0x0565('0x38')]=_[_0x0565('0x39')](_0x2359a3[_0x0565('0x3a')],_0x2359a3[_0x0565('0x37')]);_0x340ca0[_0x0565('0x3b')]=_[_0x0565('0x39')](_0x2359a3['model'],qs[_0x0565('0x3c')](_0x2ffd7c[_0x0565('0x37')][_0x0565('0x3c')]));_0x340ca0[_0x0565('0x3b')]=_0x340ca0[_0x0565('0x3b')]['length']?_0x340ca0[_0x0565('0x3b')]:_0x2359a3[_0x0565('0x3a')];if(!_0x2ffd7c[_0x0565('0x37')]['hasOwnProperty']('nolimit')){_0x340ca0[_0x0565('0x25')]=qs[_0x0565('0x25')](_0x2ffd7c[_0x0565('0x37')]['limit']);_0x340ca0[_0x0565('0x24')]=qs['offset'](_0x2ffd7c[_0x0565('0x37')]['offset']);}_0x340ca0[_0x0565('0x3d')]=qs[_0x0565('0x3e')](_0x2ffd7c[_0x0565('0x37')][_0x0565('0x3e')]);_0x340ca0[_0x0565('0x3f')]=qs['filters'](_[_0x0565('0x40')](_0x2ffd7c[_0x0565('0x37')],_0x2359a3[_0x0565('0x38')]),_0x156d50);if(_0x2ffd7c['query']['filter']){_0x340ca0[_0x0565('0x3f')]=_[_0x0565('0x41')](_0x340ca0[_0x0565('0x3f')],{'$or':_[_0x0565('0x33')](_0x156d50,function(_0x17096b){if(_0x17096b[_0x0565('0x42')]!==_0x0565('0x43')){var _0xbd32c5={};_0xbd32c5[_0x17096b[_0x0565('0x31')]]={'$like':'%'+_0x2ffd7c[_0x0565('0x37')][_0x0565('0x44')]+'%'};return _0xbd32c5;}})});}_0x340ca0=_[_0x0565('0x41')]({},_0x340ca0,_0x2ffd7c[_0x0565('0x45')]);var _0x415825={'where':_0x340ca0[_0x0565('0x3f')]};return db['ChatGroup'][_0x0565('0x27')](_0x415825)[_0x0565('0x2c')](function(_0x34a770){_0x2446fd[_0x0565('0x27')]=_0x34a770;if(_0x2ffd7c[_0x0565('0x37')][_0x0565('0x46')]){_0x340ca0[_0x0565('0x47')]=[{'all':!![]}];}return db[_0x0565('0x34')][_0x0565('0x48')](_0x340ca0);})[_0x0565('0x2c')](function(_0x1c006a){_0x2446fd[_0x0565('0x49')]=_0x1c006a;return _0x2446fd;})['then'](respondWithFilteredResult(_0xc8feec,_0x340ca0))['catch'](handleError(_0xc8feec,null));};exports[_0x0565('0x4a')]=function(_0x258759,_0x36856c){var _0x50e47d={'raw':!![],'where':{'id':_0x258759[_0x0565('0x4b')]['id']}},_0x4b0797={};_0x4b0797[_0x0565('0x3a')]=_[_0x0565('0x36')](db[_0x0565('0x34')][_0x0565('0x4c')]);_0x4b0797[_0x0565('0x37')]=_[_0x0565('0x36')](_0x258759[_0x0565('0x37')]);_0x4b0797[_0x0565('0x38')]=_[_0x0565('0x39')](_0x4b0797[_0x0565('0x3a')],_0x4b0797[_0x0565('0x37')]);_0x50e47d['attributes']=_['intersection'](_0x4b0797['model'],qs[_0x0565('0x3c')](_0x258759[_0x0565('0x37')][_0x0565('0x3c')]));_0x50e47d[_0x0565('0x3b')]=_0x50e47d['attributes']['length']?_0x50e47d[_0x0565('0x3b')]:_0x4b0797['model'];if(_0x258759['query'][_0x0565('0x46')]){_0x50e47d[_0x0565('0x47')]=[{'all':!![]}];}_0x50e47d=_[_0x0565('0x41')]({},_0x50e47d,_0x258759[_0x0565('0x45')]);return db[_0x0565('0x34')][_0x0565('0x4d')](_0x50e47d)[_0x0565('0x2c')](handleEntityNotFound(_0x36856c,null))['then'](respondWithResult(_0x36856c,null))[_0x0565('0x4e')](handleError(_0x36856c,null));};exports['create']=function(_0x5d3751,_0x3f9139){return db['ChatGroup'][_0x0565('0x4f')](_0x5d3751['body'],{})[_0x0565('0x2c')](respondWithResult(_0x3f9139,0xc9))[_0x0565('0x4e')](handleError(_0x3f9139,null));};exports[_0x0565('0x2b')]=function(_0x1406b4,_0x5a245e){if(_0x1406b4[_0x0565('0x50')]['id']){delete _0x1406b4[_0x0565('0x50')]['id'];}return db[_0x0565('0x34')][_0x0565('0x4d')]({'where':{'id':_0x1406b4[_0x0565('0x4b')]['id']}})['then'](handleEntityNotFound(_0x5a245e,null))['then'](saveUpdates(_0x1406b4[_0x0565('0x50')],null))['then'](respondWithResult(_0x5a245e,null))[_0x0565('0x4e')](handleError(_0x5a245e,null));};exports[_0x0565('0x2d')]=function(_0x4f1133,_0x3791eb){return db[_0x0565('0x34')][_0x0565('0x4d')]({'where':{'id':_0x4f1133['params']['id']}})['then'](handleEntityNotFound(_0x3791eb,null))[_0x0565('0x2c')](removeEntity(_0x3791eb,null))[_0x0565('0x4e')](handleError(_0x3791eb,null));};exports[_0x0565('0x51')]=function(_0x2643a8,_0x53b455){return db['ChatGroup'][_0x0565('0x51')]()[_0x0565('0x2c')](respondWithResult(_0x53b455,null))[_0x0565('0x4e')](handleError(_0x53b455,null));};exports[_0x0565('0x52')]=function(_0x1907bc,_0x393f15,_0x36be8e){return db[_0x0565('0x53')][_0x0565('0x27')]({'where':{'ChatGroupId':_0x1907bc[_0x0565('0x4b')]['id'],'ToId':_0x1907bc[_0x0565('0x54')]['id'],'read':![]}})[_0x0565('0x2c')](function(_0x2a01d4){return{'id':_[_0x0565('0x55')](_0x1907bc[_0x0565('0x4b')]['id']),'count':_0x2a01d4};})[_0x0565('0x2c')](respondWithResult(_0x393f15,null))[_0x0565('0x4e')](handleError(_0x393f15,null));};exports[_0x0565('0x56')]=function(_0xfa4fb3,_0x5c4f75,_0x1719be){return db[_0x0565('0x34')][_0x0565('0x4d')]({'where':{'id':_0xfa4fb3[_0x0565('0x4b')]['id']}})[_0x0565('0x2c')](handleEntityNotFound(_0x5c4f75,null))[_0x0565('0x2c')](function(_0x59440f){if(_0x59440f){return _0x59440f[_0x0565('0x56')](_0xfa4fb3[_0x0565('0x50')][_0x0565('0x57')],_[_0x0565('0x58')](_0xfa4fb3[_0x0565('0x50')],[_0x0565('0x57'),'id'])||{});}})[_0x0565('0x2c')](respondWithResult(_0x5c4f75,null))['catch'](handleError(_0x5c4f75,null));};exports[_0x0565('0x59')]=function(_0x366222,_0x29d123,_0x25f7d5){var _0x53d394={};var _0x37dcdd={};var _0x311996;var _0x18b6e6;return db[_0x0565('0x34')][_0x0565('0x5a')]({'where':{'id':_0x366222['params']['id']}})[_0x0565('0x2c')](handleEntityNotFound(_0x29d123,null))[_0x0565('0x2c')](function(_0x4c683b){if(_0x4c683b){_0x311996=_0x4c683b;_0x37dcdd[_0x0565('0x3a')]=_[_0x0565('0x36')](db[_0x0565('0x5b')][_0x0565('0x4c')]);_0x37dcdd[_0x0565('0x37')]=_[_0x0565('0x36')](_0x366222['query']);_0x37dcdd[_0x0565('0x38')]=_[_0x0565('0x39')](_0x37dcdd['model'],_0x37dcdd[_0x0565('0x37')]);_0x53d394[_0x0565('0x3b')]=_['intersection'](_0x37dcdd['model'],qs[_0x0565('0x3c')](_0x366222[_0x0565('0x37')]['fields']));_0x53d394['attributes']=_0x53d394[_0x0565('0x3b')]['length']?_0x53d394['attributes']:_0x37dcdd[_0x0565('0x3a')];_0x53d394[_0x0565('0x3d')]=qs['sort'](_0x366222['query']['sort']);_0x53d394['where']=qs[_0x0565('0x38')](_[_0x0565('0x40')](_0x366222['query'],_0x37dcdd[_0x0565('0x38')]));if(_0x366222[_0x0565('0x37')][_0x0565('0x44')]){_0x53d394[_0x0565('0x3f')]=_[_0x0565('0x41')](_0x53d394['where'],{'$or':_[_0x0565('0x33')](_0x53d394[_0x0565('0x3b')],function(_0x120a66){var _0x4f99fe={};_0x4f99fe[_0x120a66]={'$like':'%'+_0x366222[_0x0565('0x37')][_0x0565('0x44')]+'%'};return _0x4f99fe;})});}_0x53d394=_[_0x0565('0x41')]({},_0x53d394,_0x366222[_0x0565('0x45')]);return _0x311996[_0x0565('0x59')](_0x53d394);}})[_0x0565('0x2c')](function(_0x58fd33){if(_0x58fd33){_0x18b6e6=_0x58fd33[_0x0565('0x5c')];if(!_0x366222['query'][_0x0565('0x5d')](_0x0565('0x5e'))){_0x53d394[_0x0565('0x25')]=qs[_0x0565('0x25')](_0x366222[_0x0565('0x37')][_0x0565('0x25')]);_0x53d394[_0x0565('0x24')]=qs[_0x0565('0x24')](_0x366222[_0x0565('0x37')]['offset']);}return _0x311996[_0x0565('0x59')](_0x53d394);}})['then'](function(_0x44efe8){if(_0x44efe8){return _0x44efe8?{'count':_0x18b6e6,'rows':_0x44efe8}:null;}})['then'](respondWithResult(_0x29d123,null))['catch'](handleError(_0x29d123,null));};exports[_0x0565('0x5f')]=function(_0x27e4bb,_0x3926a7,_0x410f42){return db[_0x0565('0x34')][_0x0565('0x4d')]({'where':{'id':_0x27e4bb['params']['id']}})[_0x0565('0x2c')](handleEntityNotFound(_0x3926a7,null))['then'](function(_0x538b93){if(_0x538b93){return _0x538b93[_0x0565('0x5f')](_0x27e4bb[_0x0565('0x37')][_0x0565('0x57')]);}})[_0x0565('0x2c')](respondWithStatusCode(_0x3926a7,null))[_0x0565('0x4e')](handleError(_0x3926a7,null));};exports[_0x0565('0x60')]=function(_0x1d42d4,_0x693fed,_0x522da4){if(_0x1d42d4['body']['id']){delete _0x1d42d4[_0x0565('0x50')]['id'];}return db[_0x0565('0x34')][_0x0565('0x4d')]({'where':{'id':_0x1d42d4[_0x0565('0x4b')]['id']}})[_0x0565('0x2c')](handleEntityNotFound(_0x693fed,null))['then'](function(_0x2dbabe){if(_0x2dbabe){_0x1d42d4[_0x0565('0x50')][_0x0565('0x61')]=_0x2dbabe['id'];return db[_0x0565('0x53')][_0x0565('0x4f')](_0x1d42d4[_0x0565('0x50')]);}})[_0x0565('0x2c')](respondWithResult(_0x693fed,null))[_0x0565('0x4e')](handleError(_0x693fed,null));};exports['getMessages']=function(_0x4e84f9,_0x126e0e,_0x30551f){var _0x2afae0={};var _0x24ec09={};var _0x49f37e;var _0x5cdbf4;return db[_0x0565('0x34')][_0x0565('0x5a')]({'where':{'id':_0x4e84f9[_0x0565('0x4b')]['id']}})[_0x0565('0x2c')](handleEntityNotFound(_0x126e0e,null))[_0x0565('0x2c')](function(_0x2aa8f1){if(_0x2aa8f1){_0x49f37e=_0x2aa8f1;_0x24ec09[_0x0565('0x3a')]=_[_0x0565('0x36')](db['ChatInternalMessage'][_0x0565('0x4c')]);_0x24ec09[_0x0565('0x37')]=_[_0x0565('0x36')](_0x4e84f9['query']);_0x24ec09[_0x0565('0x38')]=_['intersection'](_0x24ec09['model'],_0x24ec09[_0x0565('0x37')]);_0x2afae0[_0x0565('0x3b')]=_['intersection'](_0x24ec09[_0x0565('0x3a')],qs[_0x0565('0x3c')](_0x4e84f9[_0x0565('0x37')]['fields']));_0x2afae0[_0x0565('0x3b')]=_0x2afae0[_0x0565('0x3b')][_0x0565('0x5c')]?_0x2afae0['attributes']:_0x24ec09[_0x0565('0x3a')];_0x2afae0[_0x0565('0x3d')]=qs[_0x0565('0x3e')](_0x4e84f9['query'][_0x0565('0x3e')]);_0x2afae0['where']=qs[_0x0565('0x38')](_[_0x0565('0x40')](_0x4e84f9[_0x0565('0x37')],_0x24ec09[_0x0565('0x38')]));if(_0x4e84f9[_0x0565('0x37')][_0x0565('0x44')]){_0x2afae0[_0x0565('0x3f')]=_[_0x0565('0x41')](_0x2afae0[_0x0565('0x3f')],{'$or':_[_0x0565('0x33')](_0x2afae0[_0x0565('0x3b')],function(_0x1226a8){var _0xe21df3={};_0xe21df3[_0x1226a8]={'$like':'%'+_0x4e84f9[_0x0565('0x37')][_0x0565('0x44')]+'%'};return _0xe21df3;})});}if(_0x4e84f9[_0x0565('0x37')][_0x0565('0x62')]){var _0x6ac547=_0x4e84f9[_0x0565('0x37')]['$gte'][_0x0565('0x63')](',');var _0x161b9c={};_0x161b9c[_0x6ac547[0x0]]={'$gte':moment(_0x6ac547[0x1])[_0x0565('0x64')](_0x0565('0x65'))};_0x2afae0[_0x0565('0x3f')]=_['merge'](_0x2afae0[_0x0565('0x3f')],_0x161b9c);}_0x2afae0=_[_0x0565('0x41')]({},_0x2afae0,_0x4e84f9['options']);return _0x49f37e['getMessages'](_0x2afae0);}})[_0x0565('0x2c')](function(_0xfb0b4c){if(_0xfb0b4c){_0x5cdbf4=_0xfb0b4c[_0x0565('0x5c')];if(!_0x4e84f9['query']['hasOwnProperty'](_0x0565('0x5e'))){_0x2afae0['limit']=qs['limit'](_0x4e84f9[_0x0565('0x37')][_0x0565('0x25')]);_0x2afae0['offset']=qs[_0x0565('0x24')](_0x4e84f9[_0x0565('0x37')][_0x0565('0x24')]);}return _0x49f37e[_0x0565('0x66')](_0x2afae0);}})[_0x0565('0x2c')](function(_0x3424c6){if(_0x3424c6){return _0x3424c6?{'count':_0x5cdbf4,'rows':_0x3424c6}:null;}})[_0x0565('0x2c')](respondWithResult(_0x126e0e,null))['catch'](handleError(_0x126e0e,null));};
\ No newline at end of file
+var _0x440b=['attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','VIRTUAL','options','include','ChatGroup','rows','catch','show','params','keys','length','includeAll','find','create','body','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','findOne','User','order','filter','getMembers','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','fs-extra','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatGroup.socket','register','sendStatus','status','end','undefined','count','offset','limit','set','update','then','error','name','send','index','rawAttributes','type','key','model','query','filters','intersection'];(function(_0x5bb7c8,_0x43c255){var _0x4ba624=function(_0x301223){while(--_0x301223){_0x5bb7c8['push'](_0x5bb7c8['shift']());}};_0x4ba624(++_0x43c255);}(_0x440b,0x8a));var _0xb440=function(_0x4030d4,_0x336ab2){_0x4030d4=_0x4030d4-0x0;var _0x342e02=_0x440b[_0x4030d4];return _0x342e02;};'use strict';var emlformat=require('eml-format');var rimraf=require(_0xb440('0x0'));var zipdir=require(_0xb440('0x1'));var jsonpatch=require(_0xb440('0x2'));var rp=require(_0xb440('0x3'));var moment=require('moment');var BPromise=require(_0xb440('0x4'));var Mustache=require('mustache');var util=require(_0xb440('0x5'));var path=require(_0xb440('0x6'));var sox=require(_0xb440('0x7'));var csv=require('to-csv');var ejs=require(_0xb440('0x8'));var fs=require('fs');var fs_extra=require(_0xb440('0x9'));var _=require(_0xb440('0xa'));var squel=require(_0xb440('0xb'));var crypto=require('crypto');var jsforce=require(_0xb440('0xc'));var deskjs=require(_0xb440('0xd'));var toCsv=require(_0xb440('0xe'));var querystring=require(_0xb440('0xf'));var Papa=require(_0xb440('0x10'));var Redis=require(_0xb440('0x11'));var authService=require(_0xb440('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb440('0x13'));var logger=require(_0xb440('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb440('0x15'));var licenseUtil=require(_0xb440('0x16'));var db=require(_0xb440('0x17'))['db'];config['redis']=_[_0xb440('0x18')](config[_0xb440('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb440('0x1a'))(new Redis(config[_0xb440('0x19')]));require(_0xb440('0x1b'))[_0xb440('0x1c')](socket);function respondWithStatusCode(_0x4acf64,_0x57b8f2){_0x57b8f2=_0x57b8f2||0xcc;return function(_0x462f00){if(_0x462f00){return _0x4acf64[_0xb440('0x1d')](_0x57b8f2);}return _0x4acf64[_0xb440('0x1e')](_0x57b8f2)[_0xb440('0x1f')]();};}function respondWithResult(_0x5e2522,_0x1d0585){_0x1d0585=_0x1d0585||0xc8;return function(_0x46c7d4){if(_0x46c7d4){return _0x5e2522[_0xb440('0x1e')](_0x1d0585)['json'](_0x46c7d4);}};}function respondWithFilteredResult(_0x32fbe3,_0x49673d){return function(_0x1b6341){if(_0x1b6341){var _0x555aa6=typeof _0x49673d['offset']===_0xb440('0x20')&&typeof _0x49673d['limit']===_0xb440('0x20');var _0x1fb9f8=_0x1b6341[_0xb440('0x21')];var _0x12d575=_0x555aa6?0x0:_0x49673d['offset'];var _0x5701a1=_0x555aa6?_0x1b6341[_0xb440('0x21')]:_0x49673d[_0xb440('0x22')]+_0x49673d[_0xb440('0x23')];var _0x352fdb;if(_0x5701a1>=_0x1fb9f8){_0x5701a1=_0x1fb9f8;_0x352fdb=0xc8;}else{_0x352fdb=0xce;}_0x32fbe3[_0xb440('0x1e')](_0x352fdb);return _0x32fbe3[_0xb440('0x24')]('Content-Range',_0x12d575+'-'+_0x5701a1+'/'+_0x1fb9f8)['json'](_0x1b6341);}return null;};}function patchUpdates(_0xe9a5cf){return function(_0x1d54c6){try{jsonpatch['apply'](_0x1d54c6,_0xe9a5cf,!![]);}catch(_0x287ddd){return BPromise['reject'](_0x287ddd);}return _0x1d54c6['save']();};}function saveUpdates(_0x43ce77,_0x4c97da){return function(_0x3056fe){if(_0x3056fe){return _0x3056fe[_0xb440('0x25')](_0x43ce77)[_0xb440('0x26')](function(_0x32cae3){return _0x32cae3;});}return null;};}function removeEntity(_0x5e162d,_0x451673){return function(_0xc71025){if(_0xc71025){return _0xc71025['destroy']()['then'](function(){_0x5e162d[_0xb440('0x1e')](0xcc)[_0xb440('0x1f')]();});}};}function handleEntityNotFound(_0x4cd27d,_0x25aaa1){return function(_0xf7582e){if(!_0xf7582e){_0x4cd27d[_0xb440('0x1d')](0x194);}return _0xf7582e;};}function handleError(_0x257a31,_0x2cfeaa){_0x2cfeaa=_0x2cfeaa||0x1f4;return function(_0x39018a){logger[_0xb440('0x27')](_0x39018a['stack']);if(_0x39018a[_0xb440('0x28')]){delete _0x39018a[_0xb440('0x28')];}_0x257a31['status'](_0x2cfeaa)[_0xb440('0x29')](_0x39018a);};}exports[_0xb440('0x2a')]=function(_0xd85279,_0x1b6efc){var _0x278121={},_0x379072={},_0x2f90c7={'count':0x0,'rows':[]};var _0x2440a1=_['map'](db['ChatGroup'][_0xb440('0x2b')],function(_0x3223b9){return{'name':_0x3223b9['fieldName'],'type':_0x3223b9[_0xb440('0x2c')][_0xb440('0x2d')]};});_0x379072[_0xb440('0x2e')]=_['map'](_0x2440a1,_0xb440('0x28'));_0x379072['query']=_['keys'](_0xd85279[_0xb440('0x2f')]);_0x379072[_0xb440('0x30')]=_[_0xb440('0x31')](_0x379072['model'],_0x379072['query']);_0x278121[_0xb440('0x32')]=_[_0xb440('0x31')](_0x379072['model'],qs[_0xb440('0x33')](_0xd85279[_0xb440('0x2f')][_0xb440('0x33')]));_0x278121[_0xb440('0x32')]=_0x278121[_0xb440('0x32')]['length']?_0x278121['attributes']:_0x379072[_0xb440('0x2e')];if(!_0xd85279[_0xb440('0x2f')][_0xb440('0x34')](_0xb440('0x35'))){_0x278121[_0xb440('0x23')]=qs[_0xb440('0x23')](_0xd85279[_0xb440('0x2f')]['limit']);_0x278121[_0xb440('0x22')]=qs[_0xb440('0x22')](_0xd85279[_0xb440('0x2f')]['offset']);}_0x278121['order']=qs[_0xb440('0x36')](_0xd85279[_0xb440('0x2f')][_0xb440('0x36')]);_0x278121[_0xb440('0x37')]=qs[_0xb440('0x30')](_[_0xb440('0x38')](_0xd85279[_0xb440('0x2f')],_0x379072[_0xb440('0x30')]),_0x2440a1);if(_0xd85279[_0xb440('0x2f')]['filter']){_0x278121[_0xb440('0x37')]=_[_0xb440('0x39')](_0x278121[_0xb440('0x37')],{'$or':_[_0xb440('0x3a')](_0x2440a1,function(_0xb8839c){if(_0xb8839c['type']!==_0xb440('0x3b')){var _0x49fe4e={};_0x49fe4e[_0xb8839c[_0xb440('0x28')]]={'$like':'%'+_0xd85279[_0xb440('0x2f')]['filter']+'%'};return _0x49fe4e;}})});}_0x278121=_[_0xb440('0x39')]({},_0x278121,_0xd85279[_0xb440('0x3c')]);var _0x9758d2={'where':_0x278121[_0xb440('0x37')]};return db['ChatGroup']['count'](_0x9758d2)[_0xb440('0x26')](function(_0x535124){_0x2f90c7[_0xb440('0x21')]=_0x535124;if(_0xd85279[_0xb440('0x2f')]['includeAll']){_0x278121[_0xb440('0x3d')]=[{'all':!![]}];}return db[_0xb440('0x3e')]['findAll'](_0x278121);})[_0xb440('0x26')](function(_0x2ff54e){_0x2f90c7[_0xb440('0x3f')]=_0x2ff54e;return _0x2f90c7;})[_0xb440('0x26')](respondWithFilteredResult(_0x1b6efc,_0x278121))[_0xb440('0x40')](handleError(_0x1b6efc,null));};exports[_0xb440('0x41')]=function(_0x545d1a,_0x162fe9){var _0x1c81a6={'raw':!![],'where':{'id':_0x545d1a[_0xb440('0x42')]['id']}},_0x5c98c6={};_0x5c98c6['model']=_[_0xb440('0x43')](db[_0xb440('0x3e')][_0xb440('0x2b')]);_0x5c98c6[_0xb440('0x2f')]=_[_0xb440('0x43')](_0x545d1a['query']);_0x5c98c6[_0xb440('0x30')]=_[_0xb440('0x31')](_0x5c98c6[_0xb440('0x2e')],_0x5c98c6[_0xb440('0x2f')]);_0x1c81a6[_0xb440('0x32')]=_[_0xb440('0x31')](_0x5c98c6[_0xb440('0x2e')],qs['fields'](_0x545d1a[_0xb440('0x2f')][_0xb440('0x33')]));_0x1c81a6[_0xb440('0x32')]=_0x1c81a6[_0xb440('0x32')][_0xb440('0x44')]?_0x1c81a6[_0xb440('0x32')]:_0x5c98c6['model'];if(_0x545d1a[_0xb440('0x2f')][_0xb440('0x45')]){_0x1c81a6[_0xb440('0x3d')]=[{'all':!![]}];}_0x1c81a6=_[_0xb440('0x39')]({},_0x1c81a6,_0x545d1a[_0xb440('0x3c')]);return db['ChatGroup'][_0xb440('0x46')](_0x1c81a6)[_0xb440('0x26')](handleEntityNotFound(_0x162fe9,null))[_0xb440('0x26')](respondWithResult(_0x162fe9,null))[_0xb440('0x40')](handleError(_0x162fe9,null));};exports['create']=function(_0x55ca97,_0xf4f5fa){return db[_0xb440('0x3e')][_0xb440('0x47')](_0x55ca97[_0xb440('0x48')],{})['then'](respondWithResult(_0xf4f5fa,0xc9))[_0xb440('0x40')](handleError(_0xf4f5fa,null));};exports[_0xb440('0x25')]=function(_0x3615ec,_0x5f13b4){if(_0x3615ec['body']['id']){delete _0x3615ec[_0xb440('0x48')]['id'];}return db[_0xb440('0x3e')][_0xb440('0x46')]({'where':{'id':_0x3615ec['params']['id']}})[_0xb440('0x26')](handleEntityNotFound(_0x5f13b4,null))[_0xb440('0x26')](saveUpdates(_0x3615ec['body'],null))[_0xb440('0x26')](respondWithResult(_0x5f13b4,null))[_0xb440('0x40')](handleError(_0x5f13b4,null));};exports[_0xb440('0x49')]=function(_0x481c09,_0x5f3a6a){return db[_0xb440('0x3e')]['find']({'where':{'id':_0x481c09[_0xb440('0x42')]['id']}})[_0xb440('0x26')](handleEntityNotFound(_0x5f3a6a,null))['then'](removeEntity(_0x5f3a6a,null))[_0xb440('0x40')](handleError(_0x5f3a6a,null));};exports[_0xb440('0x4a')]=function(_0x35a89e,_0x4455b5){return db[_0xb440('0x3e')][_0xb440('0x4a')]()[_0xb440('0x26')](respondWithResult(_0x4455b5,null))['catch'](handleError(_0x4455b5,null));};exports[_0xb440('0x4b')]=function(_0x2c06cb,_0x180518,_0x415873){return db[_0xb440('0x4c')][_0xb440('0x21')]({'where':{'ChatGroupId':_0x2c06cb['params']['id'],'ToId':_0x2c06cb[_0xb440('0x4d')]['id'],'read':![]}})[_0xb440('0x26')](function(_0x2570af){return{'id':_[_0xb440('0x4e')](_0x2c06cb[_0xb440('0x42')]['id']),'count':_0x2570af};})[_0xb440('0x26')](respondWithResult(_0x180518,null))[_0xb440('0x40')](handleError(_0x180518,null));};exports[_0xb440('0x4f')]=function(_0x17b71f,_0x4deba7,_0x1700ec){return db[_0xb440('0x3e')]['find']({'where':{'id':_0x17b71f[_0xb440('0x42')]['id']}})[_0xb440('0x26')](handleEntityNotFound(_0x4deba7,null))[_0xb440('0x26')](function(_0x2c2644){if(_0x2c2644){return _0x2c2644[_0xb440('0x4f')](_0x17b71f[_0xb440('0x48')]['ids'],_[_0xb440('0x50')](_0x17b71f['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x4deba7,null))[_0xb440('0x40')](handleError(_0x4deba7,null));};exports['getMembers']=function(_0x3d8923,_0x4d3cc3,_0x5cb79e){var _0x46c05b={};var _0xd19005={};var _0x16ed7d;var _0x43f918;return db[_0xb440('0x3e')][_0xb440('0x51')]({'where':{'id':_0x3d8923[_0xb440('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d3cc3,null))['then'](function(_0x2d8b21){if(_0x2d8b21){_0x16ed7d=_0x2d8b21;_0xd19005['model']=_[_0xb440('0x43')](db[_0xb440('0x52')][_0xb440('0x2b')]);_0xd19005['query']=_['keys'](_0x3d8923[_0xb440('0x2f')]);_0xd19005[_0xb440('0x30')]=_[_0xb440('0x31')](_0xd19005[_0xb440('0x2e')],_0xd19005[_0xb440('0x2f')]);_0x46c05b[_0xb440('0x32')]=_['intersection'](_0xd19005['model'],qs['fields'](_0x3d8923[_0xb440('0x2f')][_0xb440('0x33')]));_0x46c05b[_0xb440('0x32')]=_0x46c05b['attributes'][_0xb440('0x44')]?_0x46c05b[_0xb440('0x32')]:_0xd19005[_0xb440('0x2e')];_0x46c05b[_0xb440('0x53')]=qs[_0xb440('0x36')](_0x3d8923['query'][_0xb440('0x36')]);_0x46c05b['where']=qs[_0xb440('0x30')](_['pick'](_0x3d8923['query'],_0xd19005[_0xb440('0x30')]));if(_0x3d8923[_0xb440('0x2f')]['filter']){_0x46c05b['where']=_[_0xb440('0x39')](_0x46c05b[_0xb440('0x37')],{'$or':_[_0xb440('0x3a')](_0x46c05b['attributes'],function(_0x1a8548){var _0x431963={};_0x431963[_0x1a8548]={'$like':'%'+_0x3d8923[_0xb440('0x2f')][_0xb440('0x54')]+'%'};return _0x431963;})});}_0x46c05b=_[_0xb440('0x39')]({},_0x46c05b,_0x3d8923[_0xb440('0x3c')]);return _0x16ed7d[_0xb440('0x55')](_0x46c05b);}})[_0xb440('0x26')](function(_0x21fe28){if(_0x21fe28){_0x43f918=_0x21fe28['length'];if(!_0x3d8923['query'][_0xb440('0x34')]('nolimit')){_0x46c05b[_0xb440('0x23')]=qs[_0xb440('0x23')](_0x3d8923[_0xb440('0x2f')][_0xb440('0x23')]);_0x46c05b[_0xb440('0x22')]=qs[_0xb440('0x22')](_0x3d8923[_0xb440('0x2f')][_0xb440('0x22')]);}return _0x16ed7d['getMembers'](_0x46c05b);}})[_0xb440('0x26')](function(_0x553d6a){if(_0x553d6a){return _0x553d6a?{'count':_0x43f918,'rows':_0x553d6a}:null;}})[_0xb440('0x26')](respondWithResult(_0x4d3cc3,null))[_0xb440('0x40')](handleError(_0x4d3cc3,null));};exports[_0xb440('0x56')]=function(_0x1702e5,_0xbc9f0,_0x175c3a){return db['ChatGroup'][_0xb440('0x46')]({'where':{'id':_0x1702e5['params']['id']}})[_0xb440('0x26')](handleEntityNotFound(_0xbc9f0,null))[_0xb440('0x26')](function(_0x373ffc){if(_0x373ffc){return _0x373ffc[_0xb440('0x56')](_0x1702e5['query'][_0xb440('0x57')]);}})['then'](respondWithStatusCode(_0xbc9f0,null))[_0xb440('0x40')](handleError(_0xbc9f0,null));};exports[_0xb440('0x58')]=function(_0xadd259,_0x5e3f4a,_0x576194){if(_0xadd259[_0xb440('0x48')]['id']){delete _0xadd259[_0xb440('0x48')]['id'];}return db[_0xb440('0x3e')][_0xb440('0x46')]({'where':{'id':_0xadd259['params']['id']}})[_0xb440('0x26')](handleEntityNotFound(_0x5e3f4a,null))[_0xb440('0x26')](function(_0x2f31ca){if(_0x2f31ca){_0xadd259['body'][_0xb440('0x59')]=_0x2f31ca['id'];return db[_0xb440('0x4c')]['create'](_0xadd259[_0xb440('0x48')]);}})[_0xb440('0x26')](respondWithResult(_0x5e3f4a,null))[_0xb440('0x40')](handleError(_0x5e3f4a,null));};exports[_0xb440('0x5a')]=function(_0x476cd7,_0x28c5fc,_0x100c5c){var _0x47508d={};var _0x3e9b26={};var _0x3e748a;var _0x5317ab;return db[_0xb440('0x3e')][_0xb440('0x51')]({'where':{'id':_0x476cd7['params']['id']}})[_0xb440('0x26')](handleEntityNotFound(_0x28c5fc,null))[_0xb440('0x26')](function(_0x10af53){if(_0x10af53){_0x3e748a=_0x10af53;_0x3e9b26[_0xb440('0x2e')]=_[_0xb440('0x43')](db['ChatInternalMessage'][_0xb440('0x2b')]);_0x3e9b26[_0xb440('0x2f')]=_['keys'](_0x476cd7[_0xb440('0x2f')]);_0x3e9b26[_0xb440('0x30')]=_[_0xb440('0x31')](_0x3e9b26[_0xb440('0x2e')],_0x3e9b26[_0xb440('0x2f')]);_0x47508d[_0xb440('0x32')]=_[_0xb440('0x31')](_0x3e9b26[_0xb440('0x2e')],qs['fields'](_0x476cd7['query'][_0xb440('0x33')]));_0x47508d['attributes']=_0x47508d[_0xb440('0x32')][_0xb440('0x44')]?_0x47508d[_0xb440('0x32')]:_0x3e9b26[_0xb440('0x2e')];_0x47508d['order']=qs['sort'](_0x476cd7[_0xb440('0x2f')][_0xb440('0x36')]);_0x47508d[_0xb440('0x37')]=qs[_0xb440('0x30')](_['pick'](_0x476cd7[_0xb440('0x2f')],_0x3e9b26[_0xb440('0x30')]));if(_0x476cd7[_0xb440('0x2f')]['filter']){_0x47508d[_0xb440('0x37')]=_[_0xb440('0x39')](_0x47508d[_0xb440('0x37')],{'$or':_[_0xb440('0x3a')](_0x47508d[_0xb440('0x32')],function(_0x24354e){var _0x4221d9={};_0x4221d9[_0x24354e]={'$like':'%'+_0x476cd7['query'][_0xb440('0x54')]+'%'};return _0x4221d9;})});}if(_0x476cd7[_0xb440('0x2f')][_0xb440('0x5b')]){var _0x4969b3=_0x476cd7[_0xb440('0x2f')]['$gte'][_0xb440('0x5c')](',');var _0xe80748={};_0xe80748[_0x4969b3[0x0]]={'$gte':moment(_0x4969b3[0x1])[_0xb440('0x5d')]('YYYY-MM-DD\x20HH:mm:ss')};_0x47508d['where']=_['merge'](_0x47508d['where'],_0xe80748);}_0x47508d=_['merge']({},_0x47508d,_0x476cd7[_0xb440('0x3c')]);return _0x3e748a['getMessages'](_0x47508d);}})[_0xb440('0x26')](function(_0x5c6aa8){if(_0x5c6aa8){_0x5317ab=_0x5c6aa8[_0xb440('0x44')];if(!_0x476cd7[_0xb440('0x2f')][_0xb440('0x34')](_0xb440('0x35'))){_0x47508d[_0xb440('0x23')]=qs[_0xb440('0x23')](_0x476cd7[_0xb440('0x2f')][_0xb440('0x23')]);_0x47508d[_0xb440('0x22')]=qs[_0xb440('0x22')](_0x476cd7[_0xb440('0x2f')][_0xb440('0x22')]);}return _0x3e748a[_0xb440('0x5a')](_0x47508d);}})[_0xb440('0x26')](function(_0x271cdc){if(_0x271cdc){return _0x271cdc?{'count':_0x5317ab,'rows':_0x271cdc}:null;}})[_0xb440('0x26')](respondWithResult(_0x28c5fc,null))[_0xb440('0x40')](handleError(_0x28c5fc,null));};
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js
index dfe090e..eb691bd 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 _0x5557=['hook','exports','events','ChatGroup','save','update','emit','hasOwnProperty'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x5557,0x1ba));var _0x7555=function(_0x401c95,_0x15ef4b){_0x401c95=_0x401c95-0x0;var _0x5313f2=_0x5557[_0x401c95];return _0x5313f2;};'use strict';var EventEmitter=require(_0x7555('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0x7555('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7555('0x2'),'afterUpdate':_0x7555('0x3'),'afterDestroy':'remove'};function emitEvent(_0x150e74){return function(_0x5dd156,_0x2d0ded,_0x4679ca){ChatGroupEvents[_0x7555('0x4')](_0x150e74+':'+_0x5dd156['id'],_0x5dd156);ChatGroupEvents[_0x7555('0x4')](_0x150e74,_0x5dd156);_0x4679ca(null);};}for(var e in events){if(events[_0x7555('0x5')](e)){var event=events[e];ChatGroup[_0x7555('0x6')](e,emitEvent(event));}}module[_0x7555('0x7')]=ChatGroupEvents;
\ No newline at end of file
+var _0x4a9a=['update','emit','hasOwnProperty','../../mysqldb','ChatGroup','save'];(function(_0xb9398f,_0x364d49){var _0xc6808a=function(_0x5d6aad){while(--_0x5d6aad){_0xb9398f['push'](_0xb9398f['shift']());}};_0xc6808a(++_0x364d49);}(_0x4a9a,0x123));var _0xa4a9=function(_0x338bc1,_0x31820a){_0x338bc1=_0x338bc1-0x0;var _0x189a20=_0x4a9a[_0x338bc1];return _0x189a20;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0xa4a9('0x0'))['db'][_0xa4a9('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa4a9('0x2'),'afterUpdate':_0xa4a9('0x3'),'afterDestroy':'remove'};function emitEvent(_0x316159){return function(_0x2225d5,_0x5869ca,_0x5da1fa){ChatGroupEvents[_0xa4a9('0x4')](_0x316159+':'+_0x2225d5['id'],_0x2225d5);ChatGroupEvents[_0xa4a9('0x4')](_0x316159,_0x2225d5);_0x5da1fa(null);};}for(var e in events){if(events[_0xa4a9('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 7f8235f..198e82c 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 _0xd07b=['request-promise','path','rimraf','../../config/environment','exports','define','util','../../config/logger','api','moment','bluebird'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xd07b,0x1d4));var _0xbd07=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xd07b[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0xbd07('0x0'));var logger=require(_0xbd07('0x1'))(_0xbd07('0x2'));var moment=require(_0xbd07('0x3'));var BPromise=require(_0xbd07('0x4'));var rp=require(_0xbd07('0x5'));var fs=require('fs');var path=require(_0xbd07('0x6'));var rimraf=require(_0xbd07('0x7'));var config=require(_0xbd07('0x8'));var attributes=require('./chatGroup.attributes');module[_0xbd07('0x9')]=function(_0x24b0f3,_0xa2c235){return _0x24b0f3[_0xbd07('0xa')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x488f=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups'];(function(_0x739af,_0x4ed25b){var _0x20d65d=function(_0x2298a2){while(--_0x2298a2){_0x739af['push'](_0x739af['shift']());}};_0x20d65d(++_0x4ed25b);}(_0x488f,0x1cc));var _0xf488=function(_0x52ec86,_0x32fe83){_0x52ec86=_0x52ec86-0x0;var _0x45238f=_0x488f[_0x52ec86];return _0x45238f;};'use strict';var _=require(_0xf488('0x0'));var util=require(_0xf488('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf488('0x2'));var BPromise=require(_0xf488('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf488('0x4'));var rimraf=require(_0xf488('0x5'));var config=require(_0xf488('0x6'));var attributes=require(_0xf488('0x7'));module['exports']=function(_0x22d077,_0x55036a){return _0x22d077[_0xf488('0x8')]('ChatGroup',attributes,{'tableName':_0xf488('0x9'),'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 3773e79..dfc27f5 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 _0x3fec=['lodash','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x886061,_0x66e6cc){var _0x5d6aa4=function(_0x2fb90f){while(--_0x2fb90f){_0x886061['push'](_0x886061['shift']());}};_0x5d6aa4(++_0x66e6cc);}(_0x3fec,0x1ba));var _0xc3fe=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fec[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xc3fe('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xc3fe('0x1'));var rs=require(_0xc3fe('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc3fe('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc3fe('0x4'));var config=require('../../config/environment');var jayson=require(_0xc3fe('0x5'));var client=jayson[_0xc3fe('0x6')][_0xc3fe('0x7')]({'port':0x232a});config[_0xc3fe('0x8')]=_[_0xc3fe('0x9')](config[_0xc3fe('0x8')],{'host':_0xc3fe('0xa'),'port':0x18eb});var socket=require(_0xc3fe('0xb'))(new Redis(config[_0xc3fe('0x8')]));require(_0xc3fe('0xc'))[_0xc3fe('0xd')](socket);function respondWithRpcPromise(_0x3238af,_0x2852c9,_0x3ffe1a){return new BPromise(function(_0x22f543,_0x255c18){return client['request'](_0x3238af,_0x3ffe1a)[_0xc3fe('0xe')](function(_0x144702){logger['info'](_0xc3fe('0xf'),_0x2852c9,_0xc3fe('0x10'));logger[_0xc3fe('0x11')](_0xc3fe('0x12'),_0x2852c9,_0xc3fe('0x10'),JSON[_0xc3fe('0x13')](_0x144702));if(_0x144702[_0xc3fe('0x14')]){if(_0x144702[_0xc3fe('0x14')][_0xc3fe('0x15')]===0x1f4){logger[_0xc3fe('0x14')]('ChatGroup,\x20%s,\x20%s',_0x2852c9,_0x144702[_0xc3fe('0x14')]['message']);return _0x255c18(_0x144702[_0xc3fe('0x14')][_0xc3fe('0x16')]);}logger[_0xc3fe('0x14')](_0xc3fe('0xf'),_0x2852c9,_0x144702[_0xc3fe('0x14')][_0xc3fe('0x16')]);return _0x22f543(_0x144702[_0xc3fe('0x14')][_0xc3fe('0x16')]);}else{logger[_0xc3fe('0x17')](_0xc3fe('0xf'),_0x2852c9,_0xc3fe('0x10'));_0x22f543(_0x144702[_0xc3fe('0x18')][_0xc3fe('0x16')]);}})[_0xc3fe('0x19')](function(_0x3a86f2){logger['error'](_0xc3fe('0xf'),_0x2852c9,_0x3a86f2);_0x255c18(_0x3a86f2);});});}
\ No newline at end of file
+var _0x5d55=['../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','util','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x580cf8,_0x26751e){var _0xcc9a9e=function(_0x5a67ad){while(--_0x5a67ad){_0x580cf8['push'](_0x580cf8['shift']());}};_0xcc9a9e(++_0x26751e);}(_0x5d55,0x1a4));var _0x55d5=function(_0x47508b,_0x357f79){_0x47508b=_0x47508b-0x0;var _0x9ff13b=_0x5d55[_0x47508b];return _0x9ff13b;};'use strict';var _=require('lodash');var util=require(_0x55d5('0x0'));var moment=require('moment');var BPromise=require(_0x55d5('0x1'));var rs=require(_0x55d5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x55d5('0x3'))['db'];var utils=require(_0x55d5('0x4'));var logger=require(_0x55d5('0x5'))('rpc');var config=require(_0x55d5('0x6'));var jayson=require(_0x55d5('0x7'));var client=jayson[_0x55d5('0x8')][_0x55d5('0x9')]({'port':0x232a});config[_0x55d5('0xa')]=_[_0x55d5('0xb')](config[_0x55d5('0xa')],{'host':_0x55d5('0xc'),'port':0x18eb});var socket=require(_0x55d5('0xd'))(new Redis(config['redis']));require(_0x55d5('0xe'))[_0x55d5('0xf')](socket);function respondWithRpcPromise(_0x448938,_0x64f70a,_0xdac85){return new BPromise(function(_0x4db860,_0x45569e){return client['request'](_0x448938,_0xdac85)[_0x55d5('0x10')](function(_0x21d7c0){logger[_0x55d5('0x11')](_0x55d5('0x12'),_0x64f70a,_0x55d5('0x13'));logger['debug'](_0x55d5('0x14'),_0x64f70a,_0x55d5('0x13'),JSON[_0x55d5('0x15')](_0x21d7c0));if(_0x21d7c0['error']){if(_0x21d7c0[_0x55d5('0x16')]['code']===0x1f4){logger[_0x55d5('0x16')](_0x55d5('0x12'),_0x64f70a,_0x21d7c0[_0x55d5('0x16')][_0x55d5('0x17')]);return _0x45569e(_0x21d7c0['error'][_0x55d5('0x17')]);}logger[_0x55d5('0x16')](_0x55d5('0x12'),_0x64f70a,_0x21d7c0['error'][_0x55d5('0x17')]);return _0x4db860(_0x21d7c0['error'][_0x55d5('0x17')]);}else{logger['info'](_0x55d5('0x12'),_0x64f70a,_0x55d5('0x13'));_0x4db860(_0x21d7c0['result'][_0x55d5('0x17')]);}})[_0x55d5('0x18')](function(_0x2c0324){logger[_0x55d5('0x16')]('ChatGroup,\x20%s,\x20%s',_0x64f70a,_0x2c0324);_0x45569e(_0x2c0324);});});}
\ No newline at end of file
diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js
index 546b6b1..f309972 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 _0x25ab=['length','chatGroup:','save','remove','update'];(function(_0x1cc258,_0x15d913){var _0x7e4c60=function(_0x40cf88){while(--_0x40cf88){_0x1cc258['push'](_0x1cc258['shift']());}};_0x7e4c60(++_0x15d913);}(_0x25ab,0x98));var _0xb25a=function(_0x4fc984,_0x5773fa){_0x4fc984=_0x4fc984-0x0;var _0x3201eb=_0x25ab[_0x4fc984];return _0x3201eb;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xb25a('0x0'),_0xb25a('0x1'),_0xb25a('0x2')];function createListener(_0xed4b75,_0x14fd71){return function(_0x3b8f15){_0x14fd71['emit'](_0xed4b75,_0x3b8f15);};}function removeListener(_0x2f264b,_0x3f3ba5){return function(){ChatGroupEvents['removeListener'](_0x2f264b,_0x3f3ba5);};}exports['register']=function(_0x32c416){for(var _0x390152=0x0,_0xa14ef6=events[_0xb25a('0x3')];_0x390152<_0xa14ef6;_0x390152++){var _0x128caf=events[_0x390152];var _0x50c392=createListener(_0xb25a('0x4')+_0x128caf,_0x32c416);ChatGroupEvents['on'](_0x128caf,_0x50c392);}};
\ No newline at end of file
+var _0xb803=['register','length','chatGroup:','./chatGroup.events','save','remove','update'];(function(_0x2b8029,_0xd9e9f4){var _0x1f26db=function(_0x88adf1){while(--_0x88adf1){_0x2b8029['push'](_0x2b8029['shift']());}};_0x1f26db(++_0xd9e9f4);}(_0xb803,0x153));var _0x3b80=function(_0x648c71,_0x361903){_0x648c71=_0x648c71-0x0;var _0x241b97=_0xb803[_0x648c71];return _0x241b97;};'use strict';var ChatGroupEvents=require(_0x3b80('0x0'));var events=[_0x3b80('0x1'),_0x3b80('0x2'),_0x3b80('0x3')];function createListener(_0x15148c,_0x2424fd){return function(_0x352f21){_0x2424fd['emit'](_0x15148c,_0x352f21);};}function removeListener(_0x3eabb8,_0x2fe899){return function(){ChatGroupEvents['removeListener'](_0x3eabb8,_0x2fe899);};}exports[_0x3b80('0x4')]=function(_0x2d2d83){for(var _0x10f5a9=0x0,_0xc3ee5e=events[_0x3b80('0x5')];_0x10f5a9<_0xc3ee5e;_0x10f5a9++){var _0x8546c0=events[_0x10f5a9];var _0xf48e66=createListener(_0x3b80('0x6')+_0x8546c0,_0x2d2d83);ChatGroupEvents['on'](_0x8546c0,_0xf48e66);}};
\ No newline at end of file
diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js
index ae65bd4..7d8db26 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 _0xd5c6=['describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','addMembers','addMessage','update','delete','destroy','removeMembers','exports','util','path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index'];(function(_0x563500,_0x171097){var _0x5df0ca=function(_0x374a79){while(--_0x374a79){_0x563500['push'](_0x563500['shift']());}};_0x5df0ca(++_0x171097);}(_0xd5c6,0x64));var _0x6d5c=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xd5c6[_0x17d9e3];return _0x14192d;};'use strict';var multer=require('multer');var util=require(_0x6d5c('0x0'));var path=require(_0x6d5c('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d5c('0x2'));var router=express[_0x6d5c('0x3')]();var fs_extra=require(_0x6d5c('0x4'));var auth=require(_0x6d5c('0x5'));var interaction=require(_0x6d5c('0x6'));var config=require(_0x6d5c('0x7'));var controller=require(_0x6d5c('0x8'));router[_0x6d5c('0x9')]('/',auth[_0x6d5c('0xa')](),controller[_0x6d5c('0xb')]);router[_0x6d5c('0x9')]('/describe',auth[_0x6d5c('0xa')](),controller[_0x6d5c('0xc')]);router[_0x6d5c('0x9')]('/:id',auth[_0x6d5c('0xa')](),controller[_0x6d5c('0xd')]);router['get'](_0x6d5c('0xe'),auth['isAuthenticated'](),controller[_0x6d5c('0xf')]);router[_0x6d5c('0x9')](_0x6d5c('0x10'),auth[_0x6d5c('0xa')](),controller[_0x6d5c('0x11')]);router[_0x6d5c('0x9')](_0x6d5c('0x12'),auth['isAuthenticated'](),controller[_0x6d5c('0x13')]);router[_0x6d5c('0x14')]('/',auth[_0x6d5c('0xa')](),controller['create']);router[_0x6d5c('0x14')](_0x6d5c('0x10'),auth['isAuthenticated'](),controller[_0x6d5c('0x15')]);router['post'](_0x6d5c('0x12'),auth['isAuthenticated'](),controller[_0x6d5c('0x16')]);router['put']('/:id',auth[_0x6d5c('0xa')](),controller[_0x6d5c('0x17')]);router[_0x6d5c('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x6d5c('0x19')]);router[_0x6d5c('0x18')](_0x6d5c('0x10'),auth['isAuthenticated'](),controller[_0x6d5c('0x1a')]);module[_0x6d5c('0x1b')]=router;
\ No newline at end of file
+var _0x6e94=['../../components/interaction/service','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','post','addMessage','put','/:id','update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x55631c,_0x4e787d){var _0x35e56b=function(_0x26e9ac){while(--_0x26e9ac){_0x55631c['push'](_0x55631c['shift']());}};_0x35e56b(++_0x4e787d);}(_0x6e94,0xf6));var _0x46e9=function(_0x4c3f39,_0x394c52){_0x4c3f39=_0x4c3f39-0x0;var _0x46672e=_0x6e94[_0x4c3f39];return _0x46672e;};'use strict';var multer=require(_0x46e9('0x0'));var util=require(_0x46e9('0x1'));var path=require(_0x46e9('0x2'));var timeout=require(_0x46e9('0x3'));var express=require('express');var router=express[_0x46e9('0x4')]();var fs_extra=require('fs-extra');var auth=require(_0x46e9('0x5'));var interaction=require(_0x46e9('0x6'));var config=require('../../config/environment');var controller=require(_0x46e9('0x7'));router[_0x46e9('0x8')]('/',auth[_0x46e9('0x9')](),controller[_0x46e9('0xa')]);router[_0x46e9('0x8')](_0x46e9('0xb'),auth[_0x46e9('0x9')](),controller[_0x46e9('0xc')]);router[_0x46e9('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x46e9('0xd')]);router[_0x46e9('0x8')](_0x46e9('0xe'),auth[_0x46e9('0x9')](),controller[_0x46e9('0xf')]);router[_0x46e9('0x8')](_0x46e9('0x10'),auth['isAuthenticated'](),controller[_0x46e9('0x11')]);router[_0x46e9('0x8')](_0x46e9('0x12'),auth[_0x46e9('0x9')](),controller['getMessages']);router[_0x46e9('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x46e9('0x13')]('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x46e9('0x13')](_0x46e9('0x12'),auth[_0x46e9('0x9')](),controller[_0x46e9('0x14')]);router[_0x46e9('0x15')](_0x46e9('0x16'),auth[_0x46e9('0x9')](),controller[_0x46e9('0x17')]);router[_0x46e9('0x18')]('/:id',auth[_0x46e9('0x9')](),controller[_0x46e9('0x19')]);router[_0x46e9('0x18')](_0x46e9('0x10'),auth[_0x46e9('0x9')](),controller[_0x46e9('0x1a')]);module[_0x46e9('0x1b')]=router;
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js
index 3ffc3a6..51fd71b 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 _0x174b=['STRING','out','BOOLEAN','sequelize','INTEGER','ENUM','star','thumb','TEXT','DATE'];(function(_0x51870d,_0x3ae9de){var _0x1e502f=function(_0x4f7d24){while(--_0x4f7d24){_0x51870d['push'](_0x51870d['shift']());}};_0x1e502f(++_0x3ae9de);}(_0x174b,0x19d));var _0xb174=function(_0x3e4d64,_0x2e7e63){_0x3e4d64=_0x3e4d64-0x0;var _0x14389c=_0x174b[_0x3e4d64];return _0x14389c;};'use strict';var Sequelize=require(_0xb174('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xb174('0x1')]},'ratingType':{'type':Sequelize[_0xb174('0x2')](_0xb174('0x3'),_0xb174('0x4')),'defaultValue':_0xb174('0x3')},'ratingMessage':{'type':Sequelize[_0xb174('0x5')]},'pathTranscript':{'type':Sequelize['TEXT']},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xb174('0x6')]},'disposition':{'type':Sequelize[_0xb174('0x7')]},'secondDisposition':{'type':Sequelize[_0xb174('0x7')]},'thirdDisposition':{'type':Sequelize[_0xb174('0x7')]},'note':{'type':Sequelize[_0xb174('0x7')]},'browserName':{'type':Sequelize[_0xb174('0x7')]},'browserVersion':{'type':Sequelize[_0xb174('0x7')]},'osName':{'type':Sequelize[_0xb174('0x7')]},'osVersion':{'type':Sequelize[_0xb174('0x7')]},'deviceModel':{'type':Sequelize[_0xb174('0x7')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0xb174('0x7')]},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0xb174('0x7')]},'formData':{'type':Sequelize[_0xb174('0x5')]('long')},'read1stAt':{'type':Sequelize[_0xb174('0x6')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0xb174('0x2')]('in',_0xb174('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize['STRING']},'customerPort':{'type':Sequelize[_0xb174('0x7')]},'vidaooSessionId':{'type':Sequelize[_0xb174('0x5')]},'autoreplyExecuted':{'type':Sequelize[_0xb174('0x9')],'defaultValue':![]}};
\ No newline at end of file
+var _0xb921=['DATE','long','sequelize','exports','BOOLEAN','INTEGER','ENUM','star','TEXT','STRING'];(function(_0x32e672,_0x13f15f){var _0x457648=function(_0x3b5166){while(--_0x3b5166){_0x32e672['push'](_0x32e672['shift']());}};_0x457648(++_0x13f15f);}(_0xb921,0x16a));var _0x1b92=function(_0x4528a2,_0x145bc9){_0x4528a2=_0x4528a2-0x0;var _0x260acf=_0xb921[_0x4528a2];return _0x260acf;};'use strict';var Sequelize=require(_0x1b92('0x0'));module[_0x1b92('0x1')]={'closed':{'type':Sequelize[_0x1b92('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1b92('0x3')]},'ratingType':{'type':Sequelize[_0x1b92('0x4')]('star','thumb'),'defaultValue':_0x1b92('0x5')},'ratingMessage':{'type':Sequelize[_0x1b92('0x6')]},'pathTranscript':{'type':Sequelize[_0x1b92('0x6')]},'mailTranscript':{'type':Sequelize[_0x1b92('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1b92('0x8')]},'disposition':{'type':Sequelize[_0x1b92('0x7')]},'secondDisposition':{'type':Sequelize[_0x1b92('0x7')]},'thirdDisposition':{'type':Sequelize[_0x1b92('0x7')]},'note':{'type':Sequelize[_0x1b92('0x7')]},'browserName':{'type':Sequelize[_0x1b92('0x7')]},'browserVersion':{'type':Sequelize[_0x1b92('0x7')]},'osName':{'type':Sequelize[_0x1b92('0x7')]},'osVersion':{'type':Sequelize[_0x1b92('0x7')]},'deviceModel':{'type':Sequelize[_0x1b92('0x7')]},'deviceVendor':{'type':Sequelize[_0x1b92('0x7')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1b92('0x6')]},'customerIp':{'type':Sequelize[_0x1b92('0x7')]},'formData':{'type':Sequelize[_0x1b92('0x6')](_0x1b92('0x9'))},'read1stAt':{'type':Sequelize[_0x1b92('0x8')]},'lastMsgAt':{'type':Sequelize[_0x1b92('0x8')]},'lastMsgDirection':{'type':Sequelize[_0x1b92('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1b92('0x7')]},'customerPort':{'type':Sequelize[_0x1b92('0x7')]},'vidaooSessionId':{'type':Sequelize['TEXT']},'autoreplyExecuted':{'type':Sequelize[_0x1b92('0x2')],'defaultValue':![]}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js
index 68624d7..49e4fa4 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 _0x7c40=['lodash','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client','http','request','then','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','set','json','update','destroy','stack','name','send','render','merge','contact','agent','interaction','account','map','ChatInteraction','rawAttributes','fieldName','type','key','getOptions','findAll','chat','query','user','params','keys','filters','intersection','model','attributes','length','includeAll','include','find','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','fullname','email','POST','https://api-vidaoo.xcally.com/api/v1/meetings','metadata','Sequelize','Error\x20in\x20conversion\x20vidaooMetadata','ValidationError','Error\x20in\x20Vidaoo\x20configuration','join_url','out','ChatMessage','create','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','Contact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','Attachment','attachmentDownload','Unauthorized','attachId','ChatOfflineMessageId','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','Messages','ChatWebsite','UserId','%s%d','System','customer','Visitor','ContactId','agentIdentifier','agentAlias','agent_alias','User','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','CloudProvider','Smtp','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','addMessage','ids','fields','hasOwnProperty','nolimit','order','sort','pick','ChatInteractionId','filter','where','split','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','options','push','addTags','setTags','omit','color','emit','chatInteractionTags:save','removeTags','unix','toString','server','files','tmp','firstName','lastName','attachments','createdAt','read','Owner','mkdirSync','Chat','Account','N.A.','closedAt','browserName','osName','customerIp','customerPort','tail','existsSync','createReadStream','pipe','createWriteStream','value','renderFile','views','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML','download','err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs'];(function(_0xcc9b8b,_0x34e2a6){var _0x560f54=function(_0x2b43e3){while(--_0x2b43e3){_0xcc9b8b['push'](_0xcc9b8b['shift']());}};_0x560f54(++_0x34e2a6);}(_0x7c40,0xcd));var _0x07c4=function(_0x342de6,_0x343927){_0x342de6=_0x342de6-0x0;var _0x6b7e5a=_0x7c40[_0x342de6];return _0x6b7e5a;};'use strict';var rimraf=require(_0x07c4('0x0'));var zipdir=require(_0x07c4('0x1'));var rp=require(_0x07c4('0x2'));var moment=require(_0x07c4('0x3'));var BPromise=require(_0x07c4('0x4'));var Mustache=require(_0x07c4('0x5'));var util=require(_0x07c4('0x6'));var path=require(_0x07c4('0x7'));var ejs=require(_0x07c4('0x8'));var fs=require('fs');var _=require(_0x07c4('0x9'));var Redis=require(_0x07c4('0xa'));var interaction=require('../../components/interaction/service');var qs=require(_0x07c4('0xb'));var pdf=require('../../components/export/pdf');var logger=require(_0x07c4('0xc'))(_0x07c4('0xd'));var config=require(_0x07c4('0xe'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x07c4('0xf')](config[_0x07c4('0x10')],{'host':_0x07c4('0x11'),'port':0x18eb});var socket=require(_0x07c4('0x12'))(new Redis(config[_0x07c4('0x10')]));require('./chatInteraction.socket')[_0x07c4('0x13')](socket);var jayson=require(_0x07c4('0x14'));var client=jayson[_0x07c4('0x15')]['http']({'port':0x232b});var client9004=jayson[_0x07c4('0x15')][_0x07c4('0x16')]({'port':0x232c});function respondWithRpcPromise(_0x1d199f,_0x440cb2,_0x4caa35,_0x519fe8){return new BPromise(function(_0x4f6250,_0x28427e){var _0x3525eb=_0x519fe8||client;return _0x3525eb[_0x07c4('0x17')](_0x1d199f,_0x4caa35)[_0x07c4('0x18')](function(_0x5d5289){logger[_0x07c4('0x19')]('ChatInteraction,\x20%s,\x20%s',_0x440cb2,_0x07c4('0x1a'));logger[_0x07c4('0x1b')](_0x07c4('0x1c'),_0x440cb2,'request\x20sent',JSON[_0x07c4('0x1d')](_0x5d5289));if(_0x5d5289['error']){if(_0x5d5289[_0x07c4('0x1e')][_0x07c4('0x1f')]===0x1f4){logger['error'](_0x07c4('0x20'),_0x440cb2,_0x5d5289[_0x07c4('0x1e')][_0x07c4('0x21')]);return _0x28427e(_0x5d5289[_0x07c4('0x1e')][_0x07c4('0x21')]);}logger['error'](_0x07c4('0x20'),_0x440cb2,_0x5d5289[_0x07c4('0x1e')][_0x07c4('0x21')]);return _0x4f6250(_0x5d5289[_0x07c4('0x1e')]['message']);}else{logger[_0x07c4('0x19')](_0x07c4('0x20'),_0x440cb2,_0x07c4('0x1a'));_0x4f6250(_0x5d5289[_0x07c4('0x22')][_0x07c4('0x21')]);}})[_0x07c4('0x23')](function(_0x1425b6){logger[_0x07c4('0x1e')](_0x07c4('0x20'),_0x440cb2,_0x1425b6);_0x28427e(_0x1425b6);});});}function respondWithStatusCode(_0x3670f3,_0x174f57){_0x174f57=_0x174f57||0xcc;return function(_0xf64c15){if(_0xf64c15){return _0x3670f3[_0x07c4('0x24')](_0x174f57);}return _0x3670f3[_0x07c4('0x25')](_0x174f57)[_0x07c4('0x26')]();};}function respondWithResult(_0x55b4fe,_0x5d31f5){_0x5d31f5=_0x5d31f5||0xc8;return function(_0x222fc7){if(_0x222fc7){return _0x55b4fe[_0x07c4('0x25')](_0x5d31f5)['json'](_0x222fc7);}};}function respondWithFilteredResult(_0x404a2e,_0x3ca9b7){return function(_0x1cce45){if(_0x1cce45){var _0x129823=typeof _0x3ca9b7[_0x07c4('0x27')]==='undefined'&&typeof _0x3ca9b7[_0x07c4('0x28')]===_0x07c4('0x29');var _0xc28533=_0x1cce45[_0x07c4('0x2a')];var _0x7e43e9=_0x129823?0x0:_0x3ca9b7[_0x07c4('0x27')];var _0x2a653c=_0x129823?_0x1cce45[_0x07c4('0x2a')]:_0x3ca9b7[_0x07c4('0x27')]+_0x3ca9b7[_0x07c4('0x28')];var _0x38c235;if(_0x2a653c>=_0xc28533){_0x2a653c=_0xc28533;_0x38c235=0xc8;}else{_0x38c235=0xce;}_0x404a2e[_0x07c4('0x25')](_0x38c235);return _0x404a2e[_0x07c4('0x2b')]('Content-Range',_0x7e43e9+'-'+_0x2a653c+'/'+_0xc28533)[_0x07c4('0x2c')](_0x1cce45);}return null;};}function saveUpdates(_0x52eeeb){return function(_0x4eae30){if(_0x4eae30){return _0x4eae30[_0x07c4('0x2d')](_0x52eeeb)[_0x07c4('0x18')](function(_0x211083){return _0x211083;});}return null;};}function removeEntity(_0x2b5b7b){return function(_0x11e7b6){if(_0x11e7b6){return _0x11e7b6[_0x07c4('0x2e')]()[_0x07c4('0x18')](function(){_0x2b5b7b[_0x07c4('0x25')](0xcc)[_0x07c4('0x26')]();});}};}function handleEntityNotFound(_0x2ae371){return function(_0x1bfea5){if(!_0x1bfea5){_0x2ae371[_0x07c4('0x24')](0x194);}return _0x1bfea5;};}function handleError(_0x3d9ac,_0x2477f9){_0x2477f9=_0x2477f9||0x1f4;return function(_0x148011){logger[_0x07c4('0x1e')](_0x148011[_0x07c4('0x2f')]);if(_0x148011[_0x07c4('0x30')]){delete _0x148011['name'];}_0x3d9ac[_0x07c4('0x25')](_0x2477f9)[_0x07c4('0x31')](_0x148011);};}function getMustacheRender(_0x268f2f,_0x1667ad){return Mustache[_0x07c4('0x32')](_0x268f2f,_[_0x07c4('0x33')](_0x1667ad['body'],{'contact':_0x1667ad[_0x07c4('0x34')],'message':_0x1667ad[_0x07c4('0x21')],'agent':_0x1667ad[_0x07c4('0x35')],'interaction':_0x1667ad[_0x07c4('0x36')],'account':_0x1667ad[_0x07c4('0x37')]}))||'';}exports['index']=function(_0x3d1563,_0x4bbe74){var _0x411739={};var _0x420806=_[_0x07c4('0x38')](db[_0x07c4('0x39')][_0x07c4('0x3a')],function(_0x5d60e8){return{'name':_0x5d60e8[_0x07c4('0x3b')],'type':_0x5d60e8[_0x07c4('0x3c')][_0x07c4('0x3d')]};});_0x411739=qs[_0x07c4('0x3e')](_0x420806,_0x3d1563);return interaction[_0x07c4('0x3f')](_0x07c4('0x40'),_0x3d1563[_0x07c4('0x41')],_0x3d1563[_0x07c4('0x42')],_0x411739,_0x420806)[_0x07c4('0x18')](respondWithFilteredResult(_0x4bbe74,_0x411739))[_0x07c4('0x23')](handleError(_0x4bbe74,null));};exports['show']=function(_0x1a90fc,_0x2835d5){var _0x414cda={'raw':![],'where':{'id':_0x1a90fc[_0x07c4('0x43')]['id']}},_0x3823d6={};_0x3823d6['model']=_['keys'](db[_0x07c4('0x39')][_0x07c4('0x3a')]);_0x3823d6[_0x07c4('0x41')]=_[_0x07c4('0x44')](_0x1a90fc['query']);_0x3823d6[_0x07c4('0x45')]=_[_0x07c4('0x46')](_0x3823d6[_0x07c4('0x47')],_0x3823d6[_0x07c4('0x41')]);_0x414cda[_0x07c4('0x48')]=_[_0x07c4('0x46')](_0x3823d6['model'],qs['fields'](_0x1a90fc[_0x07c4('0x41')]['fields']));_0x414cda[_0x07c4('0x48')]=_0x414cda['attributes'][_0x07c4('0x49')]?_0x414cda['attributes']:_0x3823d6[_0x07c4('0x47')];if(_0x1a90fc[_0x07c4('0x41')][_0x07c4('0x4a')]){_0x414cda[_0x07c4('0x4b')]=[{'all':!![]}];}_0x414cda=_[_0x07c4('0x33')]({},_0x414cda,_0x1a90fc['options']);return db[_0x07c4('0x39')][_0x07c4('0x4c')](_0x414cda)[_0x07c4('0x18')](handleEntityNotFound(_0x2835d5,null))['then'](respondWithResult(_0x2835d5,null))[_0x07c4('0x23')](handleError(_0x2835d5,null));};exports['create']=function(_0x3c58f1,_0xacbc1){return db['ChatInteraction']['create'](_0x3c58f1[_0x07c4('0x4d')],{})[_0x07c4('0x18')](respondWithResult(_0xacbc1,0xc9))[_0x07c4('0x23')](handleError(_0xacbc1,null));};exports['update']=function(_0x5a3af5,_0x19c240){if(_0x5a3af5[_0x07c4('0x4d')]['id']){delete _0x5a3af5[_0x07c4('0x4d')]['id'];}return db['ChatInteraction'][_0x07c4('0x4c')]({'where':{'id':_0x5a3af5['params']['id']}})['then'](handleEntityNotFound(_0x19c240,null))[_0x07c4('0x18')](saveUpdates(_0x5a3af5['body'],null))[_0x07c4('0x18')](respondWithResult(_0x19c240,null))[_0x07c4('0x23')](handleError(_0x19c240,null));};exports[_0x07c4('0x2e')]=function(_0x55b7e8,_0x2caacb){return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0x55b7e8['params']['id']}})[_0x07c4('0x18')](handleEntityNotFound(_0x2caacb,null))[_0x07c4('0x18')](removeEntity(_0x2caacb,null))[_0x07c4('0x23')](handleError(_0x2caacb,null));};exports[_0x07c4('0x4e')]=function(_0x92051c,_0x4ef21f){return db[_0x07c4('0x39')][_0x07c4('0x4e')]()['then'](respondWithResult(_0x4ef21f,null))[_0x07c4('0x23')](handleError(_0x4ef21f,null));};exports[_0x07c4('0x4f')]=function(_0x3c0f46,_0x1a1533){var _0x1ed602=_0x3c0f46['params']['id'];var _0x3d75ac;var _0x3c3212;var _0x56698c;return db[_0x07c4('0x39')][_0x07c4('0x50')]({'where':{'id':_0x1ed602}})['then'](function(_0x319865){_0x3d75ac=_0x319865;return db['ChatWebsite'][_0x07c4('0x50')]({'where':{'id':_0x319865[_0x07c4('0x51')]},'attributes':['id',_0x07c4('0x52'),_0x07c4('0x53'),_0x07c4('0x54'),_0x07c4('0x55'),_0x07c4('0x56')],'raw':!![]});})[_0x07c4('0x18')](function(_0x4507b5){if(_0x4507b5&&_0x4507b5[_0x07c4('0x52')]&&_0x4507b5['vidaooEscalation']){_0x3c3212=_0x4507b5;var _0x17911f={'interaction':{'id':_0x1ed602},'agent':{'id':_0x3c0f46[_0x07c4('0x42')]['id'],'name':_0x3c0f46[_0x07c4('0x42')]['name'],'fullname':_0x3c0f46[_0x07c4('0x42')][_0x07c4('0x57')],'email':_0x3c0f46[_0x07c4('0x42')][_0x07c4('0x58')]},'contact':_0x3c0f46['body']['contact'],'account':_0x3c0f46[_0x07c4('0x4d')][_0x07c4('0x37')]};var _0x1ca68d={'rejectUnauthorized':![],'method':_0x07c4('0x59'),'url':_0x07c4('0x5a'),'headers':{'X-APIKEY':_0x4507b5['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x3c0f46[_0x07c4('0x42')][_0x07c4('0x58')]],'buttons':null,'topic':_0x3c3212['vidaooTopic'],'note':_['isNull'](_0x3c3212[_0x07c4('0x55')])?null:getMustacheRender(_0x3c3212[_0x07c4('0x55')],_0x17911f),'metadata':null},'redirect':'follow','json':!![]};try{if(!_['isNull'](_0x3c3212[_0x07c4('0x56')])){var _0x6d02fa=getMustacheRender(_0x3c3212[_0x07c4('0x56')],_0x17911f);var _0x4a79e8=JSON['parse'](_0x6d02fa);_0x1ca68d[_0x07c4('0x4d')][_0x07c4('0x5b')]=_0x4a79e8;}}catch(_0x523922){throw new db[(_0x07c4('0x5c'))]['ValidationError'](_0x07c4('0x5d'));}return rp(_0x1ca68d);}else{throw new db['Sequelize'][(_0x07c4('0x5e'))](_0x07c4('0x5f'));}})['then'](function(_0x4b1f2e){_0x56698c=_0x4b1f2e;if(_0x56698c['id']){var _0x1b365a={'body':_0x56698c[_0x07c4('0x60')],'ChatWebsiteId':_0x3c3212['id'],'ChatInteractionId':_0x3d75ac['id'],'direction':_0x07c4('0x61'),'UserId':_0x3c0f46[_0x07c4('0x42')]['id']};return db[_0x07c4('0x62')][_0x07c4('0x63')](_0x1b365a,{});}else{throw new db[(_0x07c4('0x5c'))]['ValidationError'](_0x07c4('0x64'));}})[_0x07c4('0x18')](function(){return _0x3d75ac[_0x07c4('0x65')]({'vidaooSessionId':_0x56698c['id']});})[_0x07c4('0x18')](respondWithResult(_0x1a1533,null))[_0x07c4('0x23')](handleError(_0x1a1533,null));};exports[_0x07c4('0x66')]=function(_0x36ec8f,_0x58a8d8){if(_0x36ec8f[_0x07c4('0x4d')]['id']){delete _0x36ec8f[_0x07c4('0x4d')]['id'];}return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0x36ec8f['params']['id']},'include':[{'model':db[_0x07c4('0x67')],'as':_0x07c4('0x68')}]})[_0x07c4('0x18')](handleEntityNotFound(_0x58a8d8,null))[_0x07c4('0x18')](saveUpdates(_0x36ec8f[_0x07c4('0x4d')],null))[_0x07c4('0x18')](respondWithResult(_0x58a8d8,null))[_0x07c4('0x23')](handleError(_0x58a8d8,null));};exports[_0x07c4('0x69')]=function(_0x9f8626,_0x1bba1e){if(_0x9f8626[_0x07c4('0x4d')]['id']){delete _0x9f8626[_0x07c4('0x4d')]['id'];}return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0x9f8626[_0x07c4('0x43')]['id']}})[_0x07c4('0x18')](function(_0x4d4097){if(!_0x4d4097){logger[_0x07c4('0x1e')](_0x07c4('0x6a'),'abandon',0x194,'entity\x20not\x20found');_0x1bba1e[_0x07c4('0x24')](0x194);}else{if(_0x4d4097['UserId']){throw new db[(_0x07c4('0x5c'))][(_0x07c4('0x5e'))](_0x07c4('0x6b'));}}return _0x4d4097;})[_0x07c4('0x18')](function(_0x48d605){if(_0x48d605){return _0x48d605['update']({'closed':_0x9f8626['body'][_0x07c4('0x6c')],'disposition':_0x9f8626[_0x07c4('0x4d')][_0x07c4('0x6d')]})['then'](function(_0x179694){return _0x179694;});}})[_0x07c4('0x18')](function(){return respondWithRpcPromise('AbandonInteraction','abandon',_0x9f8626[_0x07c4('0x4d')],client9004);})[_0x07c4('0x18')](respondWithResult(_0x1bba1e,null))[_0x07c4('0x23')](handleError(_0x1bba1e,null));};exports[_0x07c4('0x6e')]=function(_0x265a84,_0x5e2c89){_0x265a84[_0x07c4('0x4d')][_0x07c4('0x30')]=_0x265a84[_0x07c4('0x6f')][_0x07c4('0x70')];_0x265a84['body'][_0x07c4('0x71')]=_0x265a84[_0x07c4('0x6f')][_0x07c4('0x72')];_0x265a84[_0x07c4('0x4d')][_0x07c4('0x3c')]=_0x265a84[_0x07c4('0x6f')]['mimetype'];return db[_0x07c4('0x73')][_0x07c4('0x63')](_0x265a84[_0x07c4('0x4d')])[_0x07c4('0x18')](respondWithResult(_0x5e2c89,0xc9))[_0x07c4('0x23')](handleError(_0x5e2c89,null));};exports[_0x07c4('0x74')]=function(_0x3d2cfd,_0x43320f){return db['ChatInteraction']['findOne']({'where':{'id':_0x3d2cfd[_0x07c4('0x43')]['id']},'raw':!![]})[_0x07c4('0x18')](handleEntityNotFound(_0x43320f,null))[_0x07c4('0x18')](function(_0x385ec7){if(_0x385ec7){if(_0x385ec7['closed']){return _0x43320f['status'](0x193)['json']({'status':0x193,'message':_0x07c4('0x75')});}return db[_0x07c4('0x73')][_0x07c4('0x50')]({'where':{'id':_0x3d2cfd[_0x07c4('0x41')][_0x07c4('0x76')]},'raw':!![]})['then'](handleEntityNotFound(_0x43320f,null));}})[_0x07c4('0x18')](function(_0xa36e4f){if(_0xa36e4f){var _0x272856=_0xa36e4f[_0x07c4('0x77')]!==null;var _0xf3159f=path[_0x07c4('0x78')](config[_0x07c4('0x79')],_0x07c4('0x7a'));if(_0x272856){_0xf3159f=path[_0x07c4('0x78')](_0xf3159f,'offline-chat/');}var _0x3fc5b3=path[_0x07c4('0x78')](_0xf3159f,_0xa36e4f['basename']);return _0x43320f['download'](_0x3fc5b3);}})[_0x07c4('0x23')](handleError(_0x43320f,null));};exports[_0x07c4('0x7b')]=function(_0xcbdfc5,_0x417a04){var _0x33cae2=null;var _0x4f7fe6=null;var _0x3e263f=null;if(_0xcbdfc5[_0x07c4('0x4d')]['id']){delete _0xcbdfc5[_0x07c4('0x4d')]['id'];}if(_0xcbdfc5[_0x07c4('0x4d')][_0x07c4('0x7c')]){_0x3e263f=path[_0x07c4('0x78')](config[_0x07c4('0x79')],_0x07c4('0x7d'),util[_0x07c4('0x7e')](_0x07c4('0x7f'),Date['now']()));_0xcbdfc5['body'][_0x07c4('0x80')]=_0x3e263f;}return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0xcbdfc5[_0x07c4('0x43')]['id']},'include':[{'model':db[_0x07c4('0x62')],'as':_0x07c4('0x81'),'include':[{'model':db['User'],'as':'User'}]}]})['then'](handleEntityNotFound(_0x417a04,null))[_0x07c4('0x18')](saveUpdates(_0xcbdfc5[_0x07c4('0x4d')],null))[_0x07c4('0x18')](function(_0x556971){if(_0x556971){_0x33cae2=_0x556971;return db[_0x07c4('0x82')][_0x07c4('0x4c')]({'where':{'id':_0x33cae2[_0x07c4('0x51')]}});}})['then'](function(_0x4a2102){if(_0x4a2102){_0x4f7fe6=_0x4a2102;return db[_0x07c4('0x67')][_0x07c4('0x4c')]({'where':{'id':_0x33cae2['ContactId']}});}})[_0x07c4('0x18')](function(_0x3a616a){if(_0x3a616a){if(_0x3e263f){var _0x12564c=null;for(var _0x56fc44=0x1;_0x56fc44<_0x33cae2['Messages'][_0x07c4('0x49')];++_0x56fc44){_0x12564c=_0x33cae2[_0x07c4('0x81')][_0x56fc44];var _0x43ffb4=_0x12564c[_0x07c4('0x83')]?util[_0x07c4('0x7e')](_0x07c4('0x84'),_0x4f7fe6['agentAlias'],_0x12564c[_0x07c4('0x83')]):_0x07c4('0x85');var _0x7b9766=_0xcbdfc5[_0x07c4('0x4d')][_0x07c4('0x86')]||util[_0x07c4('0x7e')](_0x07c4('0x84'),_0x07c4('0x87'),_0x12564c[_0x07c4('0x88')]);switch(_0x4f7fe6[_0x07c4('0x89')]){case'website_alias':_0x43ffb4=_0x12564c[_0x07c4('0x83')]?util[_0x07c4('0x7e')](_0x07c4('0x84'),_0x4f7fe6[_0x07c4('0x8a')],_0x12564c[_0x07c4('0x83')]):_0x07c4('0x85');break;case _0x07c4('0x8b'):_0x43ffb4=_0x12564c['UserId']?_0x12564c[_0x07c4('0x8c')][_0x07c4('0x8d')]||_0x12564c[_0x07c4('0x8c')][_0x07c4('0x57')]:'System';break;case _0x07c4('0x8e'):_0x43ffb4=_0x12564c['UserId']?_0x12564c['User'][_0x07c4('0x57')]:_0x07c4('0x85');break;default:_0x43ffb4=_0x12564c['UserId']?util[_0x07c4('0x7e')](_0x07c4('0x84'),_0x4f7fe6['agentAlias'],_0x12564c[_0x07c4('0x83')]):'System';}var _0x572494=util[_0x07c4('0x7e')](_0x07c4('0x8f'),moment(_0x12564c['createdAt'])[_0x07c4('0x7e')](_0x07c4('0x90')),_0x12564c[_0x07c4('0x91')]==='in'?_0x7b9766:_0x43ffb4,_0x12564c[_0x07c4('0x4d')]);if(!_0x12564c[_0x07c4('0x92')]){fs['appendFileSync'](_0x3e263f,_0x572494);}}return db[_0x07c4('0x93')][_0x07c4('0x50')]({'where':{'service':!![]},'include':[{'model':db[_0x07c4('0x94')],'as':'Smtp','raw':!![],'include':[{'model':db[_0x07c4('0x95')],'as':_0x07c4('0x95'),'raw':!![]}]}]});}}})['then'](function(_0x1eb92c){if(!_0x1eb92c||!_0x1eb92c[_0x07c4('0x96')]||!_0xcbdfc5['body'])return _0x33cae2;var _0x574056=_0x1eb92c[_0x07c4('0x97')]();return respondWithRpcPromise(_0x07c4('0x98'),_0x07c4('0x99'),{'account':_0x574056,'message':{'from':util[_0x07c4('0x7e')](_0x07c4('0x9a'),_0x1eb92c[_0x07c4('0x30')],_0x1eb92c[_0x07c4('0x58')]||_0x1eb92c[_0x07c4('0x96')]['user']),'to':_0xcbdfc5[_0x07c4('0x4d')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0xcbdfc5[_0x07c4('0x4d')]['mailTranscript']),'attachments':[{'path':_0x3e263f}]}})['then'](function(){return _0x33cae2;})[_0x07c4('0x23')](function(_0x3486d2){logger['error'](_0x3486d2);});})[_0x07c4('0x18')](respondWithStatusCode(_0x417a04,0xc8))[_0x07c4('0x23')](handleError(_0x417a04,null));};exports[_0x07c4('0x9b')]=function(_0x49c87e,_0x2ef9ea){return db['ChatMessage'][_0x07c4('0x4c')]({'where':{'id':_0x49c87e[_0x07c4('0x43')]['id']}})[_0x07c4('0x18')](handleEntityNotFound(_0x2ef9ea,null))[_0x07c4('0x18')](function(_0x109d57){if(_0x109d57){return _0x109d57[_0x07c4('0x9b')](_0x49c87e['body'][_0x07c4('0x9c')],_['omit'](_0x49c87e[_0x07c4('0x4d')],[_0x07c4('0x9c'),'id'])||{});}})['then'](respondWithResult(_0x2ef9ea,null))[_0x07c4('0x23')](handleError(_0x2ef9ea,null));};exports['getMessages']=function(_0x4b09d0,_0x5e22d8){var _0xf50cef={'raw':![],'where':{}};var _0x5ebe41={};var _0x41df45={'count':0x0,'rows':[]};return db[_0x07c4('0x39')][_0x07c4('0x50')]({'where':{'id':_0x4b09d0['params']['id']}})[_0x07c4('0x18')](handleEntityNotFound(_0x5e22d8,null))[_0x07c4('0x18')](function(_0x25ab71){if(_0x25ab71){_0x5ebe41[_0x07c4('0x47')]=_[_0x07c4('0x44')](db['ChatMessage']['rawAttributes']);_0x5ebe41[_0x07c4('0x41')]=_[_0x07c4('0x44')](_0x4b09d0[_0x07c4('0x41')]);_0x5ebe41['filters']=_['intersection'](_0x5ebe41[_0x07c4('0x47')],_0x5ebe41['query']);_0xf50cef[_0x07c4('0x48')]=_[_0x07c4('0x46')](_0x5ebe41[_0x07c4('0x47')],qs[_0x07c4('0x9d')](_0x4b09d0[_0x07c4('0x41')][_0x07c4('0x9d')]));_0xf50cef[_0x07c4('0x48')]=_0xf50cef[_0x07c4('0x48')]['length']?_0xf50cef[_0x07c4('0x48')]:_0x5ebe41[_0x07c4('0x47')];if(!_0x4b09d0[_0x07c4('0x41')][_0x07c4('0x9e')](_0x07c4('0x9f'))){_0xf50cef['limit']=qs['limit'](_0x4b09d0[_0x07c4('0x41')][_0x07c4('0x28')]);_0xf50cef[_0x07c4('0x27')]=qs[_0x07c4('0x27')](_0x4b09d0[_0x07c4('0x41')][_0x07c4('0x27')]);}_0xf50cef[_0x07c4('0xa0')]=qs['sort'](_0x4b09d0[_0x07c4('0x41')][_0x07c4('0xa1')]);_0xf50cef['where']=qs[_0x07c4('0x45')](_[_0x07c4('0xa2')](_0x4b09d0[_0x07c4('0x41')],_0x5ebe41[_0x07c4('0x45')]));_0xf50cef['where'][_0x07c4('0xa3')]=_0x25ab71['id'];if(_0x4b09d0[_0x07c4('0x41')][_0x07c4('0xa4')]){_0xf50cef[_0x07c4('0xa5')]=_['merge'](_0xf50cef[_0x07c4('0xa5')],{'$or':_[_0x07c4('0x38')](_0xf50cef['attributes'],function(_0x1a7ad0){var _0x20e39f={};_0x20e39f[_0x1a7ad0]={'$like':'%'+_0x4b09d0[_0x07c4('0x41')][_0x07c4('0xa4')]+'%'};return _0x20e39f;})});}if(_0x4b09d0[_0x07c4('0x41')]['$gte']){var _0x598fce=_0x4b09d0[_0x07c4('0x41')]['$gte'][_0x07c4('0xa6')](',');var _0x2d3aac={};_0x2d3aac[_0x598fce[0x0]]={'$gte':moment(_0x598fce[0x1])['format'](_0x07c4('0xa7'))};_0xf50cef[_0x07c4('0xa5')]=_[_0x07c4('0x33')](_0xf50cef[_0x07c4('0xa5')],_0x2d3aac);}_0xf50cef=_[_0x07c4('0x33')]({},_0xf50cef,_0x4b09d0['options']);return db[_0x07c4('0x62')][_0x07c4('0x2a')]({'where':_0xf50cef[_0x07c4('0xa5')]})[_0x07c4('0x18')](function(_0x42e0b3){_0x41df45[_0x07c4('0x2a')]=_0x42e0b3;if(_0x4b09d0[_0x07c4('0x41')][_0x07c4('0x4a')]){_0xf50cef['include']=[{'all':!![]}];}return db[_0x07c4('0x62')][_0x07c4('0x3f')](_0xf50cef);})[_0x07c4('0x18')](function(_0x28f5d1){_0x41df45[_0x07c4('0xa8')]=_0x28f5d1;return _0x41df45;});}})[_0x07c4('0x18')](respondWithFilteredResult(_0x5e22d8,_0xf50cef))['catch'](handleError(_0x5e22d8,null));};exports[_0x07c4('0xa9')]=function(_0x37f292,_0x26f46d){var _0x59dd54={'where':{}},_0x2ec676={},_0x465996={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x07c4('0x50')]({'where':{'id':_0x37f292[_0x07c4('0x43')]['id']}})['then'](handleEntityNotFound(_0x26f46d,null))[_0x07c4('0x18')](function(_0x2176ee){if(_0x2176ee){_0x2ec676[_0x07c4('0x47')]=_[_0x07c4('0x44')](db[_0x07c4('0x62')][_0x07c4('0x3a')]);_0x2ec676[_0x07c4('0x41')]=_['keys'](_0x37f292[_0x07c4('0x41')]);_0x2ec676[_0x07c4('0x45')]=_[_0x07c4('0x46')](_0x2ec676[_0x07c4('0x47')],_0x2ec676[_0x07c4('0x41')]);_0x59dd54[_0x07c4('0x48')]=_[_0x07c4('0x46')](_0x2ec676[_0x07c4('0x47')],qs[_0x07c4('0x9d')](_0x37f292[_0x07c4('0x41')][_0x07c4('0x9d')]));_0x59dd54['attributes']=_0x59dd54[_0x07c4('0x48')][_0x07c4('0x49')]?_0x59dd54['attributes']:_0x2ec676[_0x07c4('0x47')];if(!_0x37f292['query'][_0x07c4('0x9e')](_0x07c4('0x9f'))){_0x59dd54[_0x07c4('0x28')]=qs[_0x07c4('0x28')](_0x37f292[_0x07c4('0x41')]['limit']);_0x59dd54[_0x07c4('0x27')]=qs[_0x07c4('0x27')](_0x37f292[_0x07c4('0x41')][_0x07c4('0x27')]);}_0x59dd54[_0x07c4('0xa0')]=qs['sort'](_0x37f292[_0x07c4('0x41')][_0x07c4('0xa1')]);_0x59dd54[_0x07c4('0xa5')]=qs[_0x07c4('0x45')](_[_0x07c4('0xa2')](_0x37f292[_0x07c4('0x41')],_0x2ec676[_0x07c4('0x45')]));_0x59dd54[_0x07c4('0xa5')][_0x07c4('0xa3')]=_0x2176ee['id'];if(_0x37f292[_0x07c4('0x41')]['filter']){_0x59dd54[_0x07c4('0xa5')]=_[_0x07c4('0x33')](_0x59dd54[_0x07c4('0xa5')],{'$or':_[_0x07c4('0x38')](_0x59dd54[_0x07c4('0x48')],function(_0x357e74){var _0x731b0c={};_0x731b0c[_0x357e74]={'$like':'%'+_0x37f292[_0x07c4('0x41')][_0x07c4('0xa4')]+'%'};return _0x731b0c;})});}_0x59dd54['where'][_0x07c4('0x92')]=![];if(_0x37f292[_0x07c4('0x41')]['id']){_0x59dd54['where']['id']={'$gt':_0x37f292[_0x07c4('0x41')]['id']};}_0x59dd54=_[_0x07c4('0x33')]({},_0x59dd54,_0x37f292[_0x07c4('0xaa')]);return db['ChatMessage'][_0x07c4('0x2a')]({'where':_0x59dd54[_0x07c4('0xa5')]})[_0x07c4('0x18')](function(_0x432c3e){_0x465996[_0x07c4('0x2a')]=_0x432c3e;_0x59dd54[_0x07c4('0x4b')]=[];if(_0x37f292['query']['includeAgent']){_0x59dd54[_0x07c4('0x4b')][_0x07c4('0xab')]({'model':db[_0x07c4('0x8c')],'as':_0x07c4('0x8c'),'attributes':['id',_0x07c4('0x57'),'alias']});}if(_0x37f292['query'][_0x07c4('0x4a')]){_0x59dd54[_0x07c4('0x4b')]=[{'all':!![]}];}return db[_0x07c4('0x62')]['findAll'](_0x59dd54);})[_0x07c4('0x18')](function(_0x58e577){_0x465996['rows']=_0x58e577;return _0x465996;});}})[_0x07c4('0x18')](respondWithFilteredResult(_0x26f46d,_0x59dd54))[_0x07c4('0x23')](handleError(_0x26f46d,null));};exports[_0x07c4('0xac')]=function(_0x3edebb,_0x12440c){return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0x3edebb[_0x07c4('0x43')]['id']}})['then'](handleEntityNotFound(_0x12440c,null))[_0x07c4('0x18')](function(_0x51bd3b){if(_0x51bd3b){return _0x51bd3b[_0x07c4('0xad')](_0x3edebb[_0x07c4('0x4d')][_0x07c4('0x9c')],_[_0x07c4('0xae')](_0x3edebb[_0x07c4('0x4d')],['ids','id'])||{})['spread'](function(){return db['Tag'][_0x07c4('0x3f')]({'attributes':['id',_0x07c4('0x30'),_0x07c4('0xaf')],'where':{'id':_0x3edebb[_0x07c4('0x4d')][_0x07c4('0x9c')]}});})['then'](function(_0xb83228){socket[_0x07c4('0xb0')](_0x07c4('0xb1'),{'id':Number(_0x3edebb[_0x07c4('0x43')]['id']),'tags':_0xb83228||[]});return{'id':Number(_0x3edebb[_0x07c4('0x43')]['id']),'tags':_0xb83228||[]};});}})[_0x07c4('0x18')](respondWithResult(_0x12440c,null))[_0x07c4('0x23')](handleError(_0x12440c,null));};exports[_0x07c4('0xb2')]=function(_0x1b9638,_0x5b37e0){return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0x1b9638[_0x07c4('0x43')]['id']}})[_0x07c4('0x18')](handleEntityNotFound(_0x5b37e0,null))[_0x07c4('0x18')](function(_0xd52aad){if(_0xd52aad){return _0xd52aad[_0x07c4('0xb2')](_0x1b9638['query'][_0x07c4('0x9c')]);}})[_0x07c4('0x18')](respondWithStatusCode(_0x5b37e0,null))['catch'](handleError(_0x5b37e0,null));};exports['download']=function(_0xeae675,_0x226eac){var _0x285977=moment()[_0x07c4('0xb3')]()[_0x07c4('0xb4')]();var _0x559c5b=path[_0x07c4('0x78')](config[_0x07c4('0x79')],_0x07c4('0xb5'),_0x07c4('0xb6'),_0x07c4('0xb7'));var _0x55c6af=path[_0x07c4('0x78')](config[_0x07c4('0x79')],'server',_0x07c4('0xb6'),'attachments');var _0x2bc7b7=path[_0x07c4('0x78')](_0x559c5b,_0x285977);var _0x3b63df=util['format']('transcript-%d-%s.zip',_0xeae675['params']['id'],_0x285977);var _0x442405=path[_0x07c4('0x78')](_0x559c5b,_0x3b63df);var _0x2e0d93=[];_0x2e0d93['push']({'model':db[_0x07c4('0x8c')],'as':_0x07c4('0x8c'),'attributes':['id',_0x07c4('0x57')],'raw':!![]});_0x2e0d93[_0x07c4('0xab')]({'model':db[_0x07c4('0x67')],'as':'Contact','attributes':['id',_0x07c4('0xb8'),_0x07c4('0xb9')],'raw':!![]});if(_0xeae675[_0x07c4('0x41')][_0x07c4('0xba')]){_0x2e0d93[_0x07c4('0xab')]({'model':db['Attachment'],'as':_0x07c4('0x73'),'raw':!![]});}var _0x10188e=[{'model':db['ChatMessage'],'as':_0x07c4('0x81'),'attributes':['id',_0x07c4('0x4d'),_0x07c4('0xbb'),_0x07c4('0x91'),_0x07c4('0x92'),_0x07c4('0xbc')],'include':_0x2e0d93}];_0x10188e[_0x07c4('0xab')]({'model':db[_0x07c4('0x82')],'as':'Account','attributes':['id',_0x07c4('0x30')]});_0x10188e[_0x07c4('0xab')]({'model':db[_0x07c4('0x8c')],'as':_0x07c4('0xbd'),'attributes':['id',_0x07c4('0x57')]});return db[_0x07c4('0x39')][_0x07c4('0x4c')]({'where':{'id':_0xeae675['params']['id']},'include':_0x10188e})[_0x07c4('0x18')](handleEntityNotFound(_0x226eac,null))[_0x07c4('0x18')](function(_0xa78072){if(_0xa78072){var _0x4d2b66=_0xa78072['get']({'plain':!![]});fs[_0x07c4('0xbe')](_0x2bc7b7);var _0x4fd9c4={'channel':_0x07c4('0xbf'),'account':_0x4d2b66[_0x07c4('0xc0')][_0x07c4('0x30')],'agent':_0x4d2b66[_0x07c4('0xbd')]?_0x4d2b66[_0x07c4('0xbd')]['fullname']:_0x07c4('0xc1'),'createdAt':moment(_0x4d2b66[_0x07c4('0xbb')])[_0x07c4('0x7e')](_0x07c4('0xa7'))[_0x07c4('0xb4')](),'closedAt':_0x4d2b66['closed']?moment(_0x4d2b66[_0x07c4('0xc2')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x07c4('0xb4')]():'','disposition':_0x4d2b66[_0x07c4('0x6d')],'chatInfo':{'browser':_0x4d2b66[_0x07c4('0xc3')],'os':_0x4d2b66[_0x07c4('0xc4')],'referer':_0x4d2b66['referer'],'customerIp':_0x4d2b66[_0x07c4('0xc5')],'customerPort':_0x4d2b66[_0x07c4('0xc6')]?_0x4d2b66[_0x07c4('0xc6')]:_0x07c4('0xc1')},'messages':_(_0x4d2b66[_0x07c4('0x81')])[_0x07c4('0xc7')]()[_0x07c4('0xa4')]({'secret':![]})['map'](function(_0x24714b){if(_0x24714b[_0x07c4('0x73')]){var _0x19e3be=path[_0x07c4('0x78')](_0x55c6af,_0x24714b[_0x07c4('0x73')][_0x07c4('0x71')]);if(fs[_0x07c4('0xc8')](_0x19e3be)){fs[_0x07c4('0xc9')](_0x19e3be)[_0x07c4('0xca')](fs[_0x07c4('0xcb')](path['join'](_0x2bc7b7,_0x24714b[_0x07c4('0x73')][_0x07c4('0x71')])));}}return{'date':moment(_0x24714b[_0x07c4('0xbb')])[_0x07c4('0x7e')](_0x07c4('0xa7'))[_0x07c4('0xb4')](),'sender':_0x24714b[_0x07c4('0x91')]==='out'?_0x24714b['User']?_0x24714b[_0x07c4('0x8c')][_0x07c4('0x57')]:_0x07c4('0x85'):_0x24714b[_0x07c4('0x68')][_0x07c4('0xb8')]+(_0x24714b[_0x07c4('0x68')][_0x07c4('0xb9')]?'\x20'+_0x24714b['Contact'][_0x07c4('0xb9')]:''),'body':_0x24714b[_0x07c4('0x73')]?_0x24714b[_0x07c4('0x73')][_0x07c4('0x71')]:_0x24714b[_0x07c4('0x4d')],'direction':_0x24714b['direction']===_0x07c4('0x61')?'A':'C','secret':_0x24714b[_0x07c4('0x92')],'read':_0x24714b[_0x07c4('0xbc')],'attachment':_0x24714b[_0x07c4('0x73')]};})[_0x07c4('0xcc')]()};return ejs[_0x07c4('0xcd')](path[_0x07c4('0x78')](config['root'],'server',_0x07c4('0xce'),_0x07c4('0xcf')),{'interaction':_0x4fd9c4})[_0x07c4('0x18')](function(_0x26ffb2){var _0x3acf50=path['join'](_0x2bc7b7,_0x07c4('0xd0')+_0x4d2b66['id']+'-'+_0x285977+_0x07c4('0xd1'));var _0x231cc0={'path':_0x3acf50,'channel':'Chat','interactionId':_0x4d2b66['id']};return pdf[_0x07c4('0xd2')](_0x26ffb2,_0x231cc0);})[_0x07c4('0x18')](function(){return new Promise(function(_0x3199c5,_0x3b8e1b){zipdir(_0x2bc7b7,{'saveTo':_0x442405},function(_0x2b2169,_0x3a3572){if(_0x2b2169)return _0x3b8e1b(_0x2b2169);return _0x3199c5(_0x3a3572);});})[_0x07c4('0x18')](function(){return new BPromise(function(_0x3dcc65,_0x4b14a3){rimraf(_0x2bc7b7,function(_0x1da8ba){if(_0x1da8ba)_0x4b14a3(_0x1da8ba);return _0x3dcc65();});});})[_0x07c4('0x18')](function(){return _0x226eac[_0x07c4('0xd3')](_0x442405,_0x3b63df,function(_0x37c993){if(_0x37c993){logger[_0x07c4('0x1e')](_0x07c4('0xd4'),_0x37c993);}else{fs[_0x07c4('0xd5')](_0x442405);}});});});}else{return _0x226eac[_0x07c4('0x24')](0xc8);}})[_0x07c4('0x23')](handleError(_0x226eac,null));};
\ No newline at end of file
+var _0x67b8=['err','unlinkSync','rimraf','zip-dir','request-promise','moment','bluebird','util','path','lodash','ioredis','../../components/interaction/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','http','client','info','ChatInteraction,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','undefined','count','update','then','destroy','stack','name','render','merge','contact','interaction','index','map','ChatInteraction','fieldName','type','key','chat','query','user','show','params','model','keys','filters','attributes','intersection','fields','includeAll','include','options','find','create','body','describe','createVidaooSession','findOne','ChatWebsiteId','vidaooApiKey','vidaooEscalation','vidaooTopic','vidaooNote','vidaooMetadata','email','account','POST','https://api-vidaoo.xcally.com/api/v1/meetings','isNull','follow','parse','metadata','Sequelize','ValidationError','Unable\x20to\x20create\x20Vidaoo\x20session','updateAttributes','customUpdate','CmContact','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','closed','disposition','AbandonInteraction','file','originalname','basename','mimetype','Attachment','attachmentDownload','json','Unauthorized','attachId','ChatOfflineMessageId','join','root','offline-chat/','close','server/files/chat/upload/','format','pathTranscript','Messages','User','ChatWebsite','ContactId','UserId','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','createdAt','direction','appendFileSync','MailAccount','CloudProvider','getSmtpOptions','SendMail','sendMail','\x22%s\x22\x20<%s>','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ChatMessage','addMessage','omit','ids','getMessages','length','nolimit','sort','where','pick','filter','$gte','split','findAll','rows','getMyMessages','rawAttributes','hasOwnProperty','order','ChatInteractionId','secret','includeAgent','push','addTags','setTags','Tag','color','emit','chatInteractionTags:save','removeTags','download','toString','server','files','tmp','attachments','transcript-%d-%s.zip','Contact','firstName','lastName','read','Owner','get','mkdirSync','Chat','N.A.','closedAt','browserName','referer','customerIp','customerPort','tail','existsSync','createReadStream','pipe','YYYY-MM-DD\x20HH:mm:ss','out','value','downloadInteraction.ejs','transcript-','.pdf','createPdfFromHTML'];(function(_0x47ca84,_0x53253a){var _0x2403b9=function(_0x5dc560){while(--_0x5dc560){_0x47ca84['push'](_0x47ca84['shift']());}};_0x2403b9(++_0x53253a);}(_0x67b8,0x1a2));var _0x867b=function(_0xd6f99a,_0x58b858){_0xd6f99a=_0xd6f99a-0x0;var _0x536558=_0x67b8[_0xd6f99a];return _0x536558;};'use strict';var rimraf=require(_0x867b('0x0'));var zipdir=require(_0x867b('0x1'));var rp=require(_0x867b('0x2'));var moment=require(_0x867b('0x3'));var BPromise=require(_0x867b('0x4'));var Mustache=require('mustache');var util=require(_0x867b('0x5'));var path=require(_0x867b('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x867b('0x7'));var Redis=require(_0x867b('0x8'));var interaction=require(_0x867b('0x9'));var qs=require(_0x867b('0xa'));var pdf=require('../../components/export/pdf');var logger=require(_0x867b('0xb'))(_0x867b('0xc'));var config=require(_0x867b('0xd'));var db=require(_0x867b('0xe'))['db'];config[_0x867b('0xf')]=_[_0x867b('0x10')](config[_0x867b('0xf')],{'host':_0x867b('0x11'),'port':0x18eb});var socket=require(_0x867b('0x12'))(new Redis(config[_0x867b('0xf')]));require(_0x867b('0x13'))[_0x867b('0x14')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x867b('0x15')]({'port':0x232b});var client9004=jayson[_0x867b('0x16')][_0x867b('0x15')]({'port':0x232c});function respondWithRpcPromise(_0x233244,_0x5159a7,_0xb3decd,_0x9636c0){return new BPromise(function(_0x3ef479,_0x19758e){var _0x20525f=_0x9636c0||client;return _0x20525f['request'](_0x233244,_0xb3decd)['then'](function(_0x369c12){logger[_0x867b('0x17')](_0x867b('0x18'),_0x5159a7,'request\x20sent');logger[_0x867b('0x19')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x5159a7,_0x867b('0x1a'),JSON[_0x867b('0x1b')](_0x369c12));if(_0x369c12[_0x867b('0x1c')]){if(_0x369c12[_0x867b('0x1c')][_0x867b('0x1d')]===0x1f4){logger[_0x867b('0x1c')]('ChatInteraction,\x20%s,\x20%s',_0x5159a7,_0x369c12['error'][_0x867b('0x1e')]);return _0x19758e(_0x369c12[_0x867b('0x1c')][_0x867b('0x1e')]);}logger[_0x867b('0x1c')](_0x867b('0x18'),_0x5159a7,_0x369c12['error'][_0x867b('0x1e')]);return _0x3ef479(_0x369c12[_0x867b('0x1c')][_0x867b('0x1e')]);}else{logger[_0x867b('0x17')]('ChatInteraction,\x20%s,\x20%s',_0x5159a7,'request\x20sent');_0x3ef479(_0x369c12[_0x867b('0x1f')][_0x867b('0x1e')]);}})[_0x867b('0x20')](function(_0xfa0d96){logger[_0x867b('0x1c')](_0x867b('0x18'),_0x5159a7,_0xfa0d96);_0x19758e(_0xfa0d96);});});}function respondWithStatusCode(_0x5be086,_0x21e54e){_0x21e54e=_0x21e54e||0xcc;return function(_0x365b26){if(_0x365b26){return _0x5be086[_0x867b('0x21')](_0x21e54e);}return _0x5be086[_0x867b('0x22')](_0x21e54e)[_0x867b('0x23')]();};}function respondWithResult(_0x330979,_0x242a5c){_0x242a5c=_0x242a5c||0xc8;return function(_0x15dd68){if(_0x15dd68){return _0x330979['status'](_0x242a5c)['json'](_0x15dd68);}};}function respondWithFilteredResult(_0x3a92d6,_0x33c339){return function(_0x4b952){if(_0x4b952){var _0x154637=typeof _0x33c339[_0x867b('0x24')]==='undefined'&&typeof _0x33c339[_0x867b('0x25')]===_0x867b('0x26');var _0x168541=_0x4b952[_0x867b('0x27')];var _0x3bcba8=_0x154637?0x0:_0x33c339['offset'];var _0x511ace=_0x154637?_0x4b952['count']:_0x33c339['offset']+_0x33c339[_0x867b('0x25')];var _0x170c43;if(_0x511ace>=_0x168541){_0x511ace=_0x168541;_0x170c43=0xc8;}else{_0x170c43=0xce;}_0x3a92d6[_0x867b('0x22')](_0x170c43);return _0x3a92d6['set']('Content-Range',_0x3bcba8+'-'+_0x511ace+'/'+_0x168541)['json'](_0x4b952);}return null;};}function saveUpdates(_0x11f73a){return function(_0x3a38fc){if(_0x3a38fc){return _0x3a38fc[_0x867b('0x28')](_0x11f73a)[_0x867b('0x29')](function(_0x72f82a){return _0x72f82a;});}return null;};}function removeEntity(_0x112344){return function(_0xad5ffb){if(_0xad5ffb){return _0xad5ffb[_0x867b('0x2a')]()[_0x867b('0x29')](function(){_0x112344[_0x867b('0x22')](0xcc)[_0x867b('0x23')]();});}};}function handleEntityNotFound(_0x5d8444){return function(_0x59ec88){if(!_0x59ec88){_0x5d8444['sendStatus'](0x194);}return _0x59ec88;};}function handleError(_0x55a797,_0x12262c){_0x12262c=_0x12262c||0x1f4;return function(_0x391a77){logger[_0x867b('0x1c')](_0x391a77[_0x867b('0x2b')]);if(_0x391a77[_0x867b('0x2c')]){delete _0x391a77['name'];}_0x55a797['status'](_0x12262c)['send'](_0x391a77);};}function getMustacheRender(_0x2c99ef,_0x336000){return Mustache[_0x867b('0x2d')](_0x2c99ef,_[_0x867b('0x2e')](_0x336000['body'],{'contact':_0x336000[_0x867b('0x2f')],'message':_0x336000[_0x867b('0x1e')],'agent':_0x336000['agent'],'interaction':_0x336000[_0x867b('0x30')],'account':_0x336000['account']}))||'';}exports[_0x867b('0x31')]=function(_0x36845d,_0x1148a7){var _0x2d6d2c={};var _0x253683=_[_0x867b('0x32')](db[_0x867b('0x33')]['rawAttributes'],function(_0x439fb3){return{'name':_0x439fb3[_0x867b('0x34')],'type':_0x439fb3[_0x867b('0x35')][_0x867b('0x36')]};});_0x2d6d2c=qs['getOptions'](_0x253683,_0x36845d);return interaction['findAll'](_0x867b('0x37'),_0x36845d[_0x867b('0x38')],_0x36845d[_0x867b('0x39')],_0x2d6d2c,_0x253683)[_0x867b('0x29')](respondWithFilteredResult(_0x1148a7,_0x2d6d2c))[_0x867b('0x20')](handleError(_0x1148a7,null));};exports[_0x867b('0x3a')]=function(_0x14b2ff,_0x5efe7c){var _0x541424={'raw':![],'where':{'id':_0x14b2ff[_0x867b('0x3b')]['id']}},_0x31bc26={};_0x31bc26[_0x867b('0x3c')]=_[_0x867b('0x3d')](db[_0x867b('0x33')]['rawAttributes']);_0x31bc26['query']=_[_0x867b('0x3d')](_0x14b2ff[_0x867b('0x38')]);_0x31bc26[_0x867b('0x3e')]=_['intersection'](_0x31bc26[_0x867b('0x3c')],_0x31bc26['query']);_0x541424[_0x867b('0x3f')]=_[_0x867b('0x40')](_0x31bc26[_0x867b('0x3c')],qs[_0x867b('0x41')](_0x14b2ff['query'][_0x867b('0x41')]));_0x541424[_0x867b('0x3f')]=_0x541424['attributes']['length']?_0x541424[_0x867b('0x3f')]:_0x31bc26[_0x867b('0x3c')];if(_0x14b2ff[_0x867b('0x38')][_0x867b('0x42')]){_0x541424[_0x867b('0x43')]=[{'all':!![]}];}_0x541424=_[_0x867b('0x2e')]({},_0x541424,_0x14b2ff[_0x867b('0x44')]);return db[_0x867b('0x33')][_0x867b('0x45')](_0x541424)[_0x867b('0x29')](handleEntityNotFound(_0x5efe7c,null))[_0x867b('0x29')](respondWithResult(_0x5efe7c,null))[_0x867b('0x20')](handleError(_0x5efe7c,null));};exports['create']=function(_0x1530d9,_0x99c0f0){return db['ChatInteraction'][_0x867b('0x46')](_0x1530d9['body'],{})[_0x867b('0x29')](respondWithResult(_0x99c0f0,0xc9))['catch'](handleError(_0x99c0f0,null));};exports[_0x867b('0x28')]=function(_0x5c0f0b,_0x4046aa){if(_0x5c0f0b[_0x867b('0x47')]['id']){delete _0x5c0f0b['body']['id'];}return db[_0x867b('0x33')][_0x867b('0x45')]({'where':{'id':_0x5c0f0b[_0x867b('0x3b')]['id']}})[_0x867b('0x29')](handleEntityNotFound(_0x4046aa,null))[_0x867b('0x29')](saveUpdates(_0x5c0f0b[_0x867b('0x47')],null))[_0x867b('0x29')](respondWithResult(_0x4046aa,null))[_0x867b('0x20')](handleError(_0x4046aa,null));};exports['destroy']=function(_0x415bb9,_0x4dc699){return db[_0x867b('0x33')][_0x867b('0x45')]({'where':{'id':_0x415bb9[_0x867b('0x3b')]['id']}})[_0x867b('0x29')](handleEntityNotFound(_0x4dc699,null))[_0x867b('0x29')](removeEntity(_0x4dc699,null))[_0x867b('0x20')](handleError(_0x4dc699,null));};exports[_0x867b('0x48')]=function(_0x4dc6e3,_0x170c86){return db[_0x867b('0x33')][_0x867b('0x48')]()[_0x867b('0x29')](respondWithResult(_0x170c86,null))[_0x867b('0x20')](handleError(_0x170c86,null));};exports[_0x867b('0x49')]=function(_0x4de4c1,_0x48b70b){var _0x413108=_0x4de4c1['params']['id'];var _0x5b794c;var _0x3c59e1;var _0x4967b4;return db[_0x867b('0x33')]['findOne']({'where':{'id':_0x413108}})[_0x867b('0x29')](function(_0x2dae4f){_0x5b794c=_0x2dae4f;return db['ChatWebsite'][_0x867b('0x4a')]({'where':{'id':_0x2dae4f[_0x867b('0x4b')]},'attributes':['id',_0x867b('0x4c'),_0x867b('0x4d'),_0x867b('0x4e'),_0x867b('0x4f'),_0x867b('0x50')],'raw':!![]});})[_0x867b('0x29')](function(_0x3d45d2){if(_0x3d45d2&&_0x3d45d2[_0x867b('0x4c')]&&_0x3d45d2['vidaooEscalation']){_0x3c59e1=_0x3d45d2;var _0x8b4909={'interaction':{'id':_0x413108},'agent':{'id':_0x4de4c1[_0x867b('0x39')]['id'],'name':_0x4de4c1[_0x867b('0x39')][_0x867b('0x2c')],'fullname':_0x4de4c1[_0x867b('0x39')]['fullname'],'email':_0x4de4c1[_0x867b('0x39')][_0x867b('0x51')]},'contact':_0x4de4c1[_0x867b('0x47')][_0x867b('0x2f')],'account':_0x4de4c1['body'][_0x867b('0x52')]};var _0xd05b75={'rejectUnauthorized':![],'method':_0x867b('0x53'),'url':_0x867b('0x54'),'headers':{'X-APIKEY':_0x3d45d2['vidaooApiKey']},'body':{'duration':null,'scheduledAt':null,'participants':[_0x4de4c1[_0x867b('0x39')][_0x867b('0x51')]],'buttons':null,'topic':_0x3c59e1[_0x867b('0x4e')],'note':_[_0x867b('0x55')](_0x3c59e1[_0x867b('0x4f')])?null:getMustacheRender(_0x3c59e1[_0x867b('0x4f')],_0x8b4909),'metadata':null},'redirect':_0x867b('0x56'),'json':!![]};try{if(!_[_0x867b('0x55')](_0x3c59e1[_0x867b('0x50')])){var _0x5df88f=getMustacheRender(_0x3c59e1[_0x867b('0x50')],_0x8b4909);var _0x4ebdd7=JSON[_0x867b('0x57')](_0x5df88f);_0xd05b75[_0x867b('0x47')][_0x867b('0x58')]=_0x4ebdd7;}}catch(_0x343c2f){throw new db[(_0x867b('0x59'))][(_0x867b('0x5a'))]('Error\x20in\x20conversion\x20vidaooMetadata');}return rp(_0xd05b75);}else{throw new db['Sequelize']['ValidationError']('Error\x20in\x20Vidaoo\x20configuration');}})['then'](function(_0xdcda02){_0x4967b4=_0xdcda02;if(_0x4967b4['id']){var _0x2f31ff={'body':_0x4967b4['join_url'],'ChatWebsiteId':_0x3c59e1['id'],'ChatInteractionId':_0x5b794c['id'],'direction':'out','UserId':_0x4de4c1['user']['id']};return db['ChatMessage']['create'](_0x2f31ff,{});}else{throw new db[(_0x867b('0x59'))][(_0x867b('0x5a'))](_0x867b('0x5b'));}})[_0x867b('0x29')](function(){return _0x5b794c[_0x867b('0x5c')]({'vidaooSessionId':_0x4967b4['id']});})[_0x867b('0x29')](respondWithResult(_0x48b70b,null))[_0x867b('0x20')](handleError(_0x48b70b,null));};exports[_0x867b('0x5d')]=function(_0x41710c,_0x340350){if(_0x41710c[_0x867b('0x47')]['id']){delete _0x41710c['body']['id'];}return db[_0x867b('0x33')]['find']({'where':{'id':_0x41710c[_0x867b('0x3b')]['id']},'include':[{'model':db[_0x867b('0x5e')],'as':'Contact'}]})[_0x867b('0x29')](handleEntityNotFound(_0x340350,null))['then'](saveUpdates(_0x41710c[_0x867b('0x47')],null))[_0x867b('0x29')](respondWithResult(_0x340350,null))['catch'](handleError(_0x340350,null));};exports[_0x867b('0x5f')]=function(_0xe174a1,_0x253e27){if(_0xe174a1[_0x867b('0x47')]['id']){delete _0xe174a1[_0x867b('0x47')]['id'];}return db['ChatInteraction'][_0x867b('0x45')]({'where':{'id':_0xe174a1[_0x867b('0x3b')]['id']}})[_0x867b('0x29')](function(_0x43bcb5){if(!_0x43bcb5){logger[_0x867b('0x1c')](_0x867b('0x60'),_0x867b('0x5f'),0x194,'entity\x20not\x20found');_0x253e27['sendStatus'](0x194);}else{if(_0x43bcb5['UserId']){throw new db[(_0x867b('0x59'))][(_0x867b('0x5a'))]('Interaction\x20already\x20assigned');}}return _0x43bcb5;})[_0x867b('0x29')](function(_0x1f5a90){if(_0x1f5a90){return _0x1f5a90[_0x867b('0x28')]({'closed':_0xe174a1[_0x867b('0x47')][_0x867b('0x61')],'disposition':_0xe174a1[_0x867b('0x47')][_0x867b('0x62')]})[_0x867b('0x29')](function(_0x1e64d0){return _0x1e64d0;});}})[_0x867b('0x29')](function(){return respondWithRpcPromise(_0x867b('0x63'),_0x867b('0x5f'),_0xe174a1['body'],client9004);})[_0x867b('0x29')](respondWithResult(_0x253e27,null))[_0x867b('0x20')](handleError(_0x253e27,null));};exports['attachmentUpload']=function(_0x4640a3,_0x3807ca){_0x4640a3[_0x867b('0x47')][_0x867b('0x2c')]=_0x4640a3[_0x867b('0x64')][_0x867b('0x65')];_0x4640a3['body'][_0x867b('0x66')]=_0x4640a3[_0x867b('0x64')]['filename'];_0x4640a3[_0x867b('0x47')][_0x867b('0x35')]=_0x4640a3[_0x867b('0x64')][_0x867b('0x67')];return db[_0x867b('0x68')][_0x867b('0x46')](_0x4640a3[_0x867b('0x47')])['then'](respondWithResult(_0x3807ca,0xc9))[_0x867b('0x20')](handleError(_0x3807ca,null));};exports[_0x867b('0x69')]=function(_0x1efc5f,_0x77e33c){return db[_0x867b('0x33')][_0x867b('0x4a')]({'where':{'id':_0x1efc5f[_0x867b('0x3b')]['id']},'raw':!![]})[_0x867b('0x29')](handleEntityNotFound(_0x77e33c,null))[_0x867b('0x29')](function(_0x22b597){if(_0x22b597){if(_0x22b597['closed']){return _0x77e33c[_0x867b('0x22')](0x193)[_0x867b('0x6a')]({'status':0x193,'message':_0x867b('0x6b')});}return db[_0x867b('0x68')][_0x867b('0x4a')]({'where':{'id':_0x1efc5f[_0x867b('0x38')][_0x867b('0x6c')]},'raw':!![]})[_0x867b('0x29')](handleEntityNotFound(_0x77e33c,null));}})[_0x867b('0x29')](function(_0x32bbc9){if(_0x32bbc9){var _0x5b714c=_0x32bbc9[_0x867b('0x6d')]!==null;var _0x465e39=path[_0x867b('0x6e')](config[_0x867b('0x6f')],'server/files/attachments/');if(_0x5b714c){_0x465e39=path[_0x867b('0x6e')](_0x465e39,_0x867b('0x70'));}var _0x46453d=path[_0x867b('0x6e')](_0x465e39,_0x32bbc9[_0x867b('0x66')]);return _0x77e33c['download'](_0x46453d);}})[_0x867b('0x20')](handleError(_0x77e33c,null));};exports[_0x867b('0x71')]=function(_0x404c5e,_0x36bfb3){var _0x2474d9=null;var _0x5e8edb=null;var _0x3b8a83=null;if(_0x404c5e[_0x867b('0x47')]['id']){delete _0x404c5e[_0x867b('0x47')]['id'];}if(_0x404c5e[_0x867b('0x47')]['mailTranscript']){_0x3b8a83=path[_0x867b('0x6e')](config[_0x867b('0x6f')],_0x867b('0x72'),util[_0x867b('0x73')]('transcript-%s.txt',Date['now']()));_0x404c5e[_0x867b('0x47')][_0x867b('0x74')]=_0x3b8a83;}return db['ChatInteraction'][_0x867b('0x45')]({'where':{'id':_0x404c5e[_0x867b('0x3b')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x867b('0x75'),'include':[{'model':db['User'],'as':_0x867b('0x76')}]}]})[_0x867b('0x29')](handleEntityNotFound(_0x36bfb3,null))[_0x867b('0x29')](saveUpdates(_0x404c5e[_0x867b('0x47')],null))[_0x867b('0x29')](function(_0x5399c8){if(_0x5399c8){_0x2474d9=_0x5399c8;return db[_0x867b('0x77')][_0x867b('0x45')]({'where':{'id':_0x2474d9[_0x867b('0x4b')]}});}})[_0x867b('0x29')](function(_0x27faa2){if(_0x27faa2){_0x5e8edb=_0x27faa2;return db[_0x867b('0x5e')]['find']({'where':{'id':_0x2474d9[_0x867b('0x78')]}});}})['then'](function(_0x3e6798){if(_0x3e6798){if(_0x3b8a83){var _0xd672b5=null;for(var _0x52b9fe=0x1;_0x52b9fe<_0x2474d9[_0x867b('0x75')]['length'];++_0x52b9fe){_0xd672b5=_0x2474d9[_0x867b('0x75')][_0x52b9fe];var _0x23a026=_0xd672b5[_0x867b('0x79')]?util[_0x867b('0x73')](_0x867b('0x7a'),_0x5e8edb[_0x867b('0x7b')],_0xd672b5[_0x867b('0x79')]):_0x867b('0x7c');var _0x310f46=_0x404c5e['body'][_0x867b('0x7d')]||util[_0x867b('0x73')](_0x867b('0x7a'),_0x867b('0x7e'),_0xd672b5['ContactId']);switch(_0x5e8edb[_0x867b('0x7f')]){case'website_alias':_0x23a026=_0xd672b5['UserId']?util[_0x867b('0x73')](_0x867b('0x7a'),_0x5e8edb[_0x867b('0x7b')],_0xd672b5[_0x867b('0x79')]):_0x867b('0x7c');break;case _0x867b('0x80'):_0x23a026=_0xd672b5['UserId']?_0xd672b5[_0x867b('0x76')][_0x867b('0x81')]||_0xd672b5[_0x867b('0x76')][_0x867b('0x82')]:_0x867b('0x7c');break;case _0x867b('0x83'):_0x23a026=_0xd672b5[_0x867b('0x79')]?_0xd672b5['User'][_0x867b('0x82')]:_0x867b('0x7c');break;default:_0x23a026=_0xd672b5[_0x867b('0x79')]?util[_0x867b('0x73')](_0x867b('0x7a'),_0x5e8edb[_0x867b('0x7b')],_0xd672b5[_0x867b('0x79')]):'System';}var _0x19c5dc=util[_0x867b('0x73')](_0x867b('0x84'),moment(_0xd672b5[_0x867b('0x85')])['format']('MM/DD/YYYY\x20HH:mm:ss'),_0xd672b5[_0x867b('0x86')]==='in'?_0x310f46:_0x23a026,_0xd672b5[_0x867b('0x47')]);if(!_0xd672b5['secret']){fs[_0x867b('0x87')](_0x3b8a83,_0x19c5dc);}}return db[_0x867b('0x88')][_0x867b('0x4a')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![],'include':[{'model':db[_0x867b('0x89')],'as':_0x867b('0x89'),'raw':!![]}]}]});}}})['then'](function(_0x3faf53){if(!_0x3faf53||!_0x3faf53['Smtp']||!_0x404c5e['body'])return _0x2474d9;var _0x5e9a45=_0x3faf53[_0x867b('0x8a')]();return respondWithRpcPromise(_0x867b('0x8b'),_0x867b('0x8c'),{'account':_0x5e9a45,'message':{'from':util[_0x867b('0x73')](_0x867b('0x8d'),_0x3faf53[_0x867b('0x2c')],_0x3faf53['email']||_0x3faf53['Smtp'][_0x867b('0x39')]),'to':_0x404c5e[_0x867b('0x47')][_0x867b('0x8e')],'subject':'Mail\x20Transcript','text':util[_0x867b('0x73')](_0x867b('0x8f'),_0x404c5e[_0x867b('0x47')][_0x867b('0x8e')]),'attachments':[{'path':_0x3b8a83}]}})[_0x867b('0x29')](function(){return _0x2474d9;})[_0x867b('0x20')](function(_0x2207d1){logger[_0x867b('0x1c')](_0x2207d1);});})[_0x867b('0x29')](respondWithStatusCode(_0x36bfb3,0xc8))['catch'](handleError(_0x36bfb3,null));};exports['addMessage']=function(_0x479d70,_0x5d2586){return db[_0x867b('0x90')]['find']({'where':{'id':_0x479d70[_0x867b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x5d2586,null))[_0x867b('0x29')](function(_0x416cfc){if(_0x416cfc){return _0x416cfc[_0x867b('0x91')](_0x479d70['body']['ids'],_[_0x867b('0x92')](_0x479d70['body'],[_0x867b('0x93'),'id'])||{});}})[_0x867b('0x29')](respondWithResult(_0x5d2586,null))[_0x867b('0x20')](handleError(_0x5d2586,null));};exports[_0x867b('0x94')]=function(_0x495843,_0xccac22){var _0x5b45f2={'raw':![],'where':{}};var _0x53127e={};var _0x259f16={'count':0x0,'rows':[]};return db[_0x867b('0x33')][_0x867b('0x4a')]({'where':{'id':_0x495843['params']['id']}})[_0x867b('0x29')](handleEntityNotFound(_0xccac22,null))[_0x867b('0x29')](function(_0x17300d){if(_0x17300d){_0x53127e['model']=_[_0x867b('0x3d')](db[_0x867b('0x90')]['rawAttributes']);_0x53127e['query']=_[_0x867b('0x3d')](_0x495843[_0x867b('0x38')]);_0x53127e[_0x867b('0x3e')]=_['intersection'](_0x53127e['model'],_0x53127e[_0x867b('0x38')]);_0x5b45f2['attributes']=_[_0x867b('0x40')](_0x53127e['model'],qs[_0x867b('0x41')](_0x495843[_0x867b('0x38')][_0x867b('0x41')]));_0x5b45f2['attributes']=_0x5b45f2['attributes'][_0x867b('0x95')]?_0x5b45f2[_0x867b('0x3f')]:_0x53127e[_0x867b('0x3c')];if(!_0x495843[_0x867b('0x38')]['hasOwnProperty'](_0x867b('0x96'))){_0x5b45f2[_0x867b('0x25')]=qs['limit'](_0x495843['query'][_0x867b('0x25')]);_0x5b45f2['offset']=qs[_0x867b('0x24')](_0x495843[_0x867b('0x38')][_0x867b('0x24')]);}_0x5b45f2['order']=qs[_0x867b('0x97')](_0x495843[_0x867b('0x38')]['sort']);_0x5b45f2[_0x867b('0x98')]=qs[_0x867b('0x3e')](_[_0x867b('0x99')](_0x495843[_0x867b('0x38')],_0x53127e[_0x867b('0x3e')]));_0x5b45f2[_0x867b('0x98')]['ChatInteractionId']=_0x17300d['id'];if(_0x495843[_0x867b('0x38')]['filter']){_0x5b45f2[_0x867b('0x98')]=_[_0x867b('0x2e')](_0x5b45f2['where'],{'$or':_[_0x867b('0x32')](_0x5b45f2[_0x867b('0x3f')],function(_0x42e083){var _0x306918={};_0x306918[_0x42e083]={'$like':'%'+_0x495843['query'][_0x867b('0x9a')]+'%'};return _0x306918;})});}if(_0x495843[_0x867b('0x38')][_0x867b('0x9b')]){var _0x3e6005=_0x495843[_0x867b('0x38')]['$gte'][_0x867b('0x9c')](',');var _0x527c93={};_0x527c93[_0x3e6005[0x0]]={'$gte':moment(_0x3e6005[0x1])[_0x867b('0x73')]('YYYY-MM-DD\x20HH:mm:ss')};_0x5b45f2[_0x867b('0x98')]=_[_0x867b('0x2e')](_0x5b45f2['where'],_0x527c93);}_0x5b45f2=_['merge']({},_0x5b45f2,_0x495843['options']);return db[_0x867b('0x90')][_0x867b('0x27')]({'where':_0x5b45f2[_0x867b('0x98')]})[_0x867b('0x29')](function(_0xac34db){_0x259f16['count']=_0xac34db;if(_0x495843['query']['includeAll']){_0x5b45f2[_0x867b('0x43')]=[{'all':!![]}];}return db[_0x867b('0x90')][_0x867b('0x9d')](_0x5b45f2);})[_0x867b('0x29')](function(_0x5d4b99){_0x259f16[_0x867b('0x9e')]=_0x5d4b99;return _0x259f16;});}})[_0x867b('0x29')](respondWithFilteredResult(_0xccac22,_0x5b45f2))[_0x867b('0x20')](handleError(_0xccac22,null));};exports[_0x867b('0x9f')]=function(_0x4b68c3,_0x9e383b){var _0x468cfc={'where':{}},_0x597665={},_0x54ab0f={'count':0x0,'rows':[]};return db['ChatInteraction'][_0x867b('0x4a')]({'where':{'id':_0x4b68c3[_0x867b('0x3b')]['id']}})[_0x867b('0x29')](handleEntityNotFound(_0x9e383b,null))[_0x867b('0x29')](function(_0x47db8c){if(_0x47db8c){_0x597665['model']=_[_0x867b('0x3d')](db[_0x867b('0x90')][_0x867b('0xa0')]);_0x597665[_0x867b('0x38')]=_[_0x867b('0x3d')](_0x4b68c3[_0x867b('0x38')]);_0x597665[_0x867b('0x3e')]=_['intersection'](_0x597665[_0x867b('0x3c')],_0x597665['query']);_0x468cfc[_0x867b('0x3f')]=_[_0x867b('0x40')](_0x597665[_0x867b('0x3c')],qs[_0x867b('0x41')](_0x4b68c3[_0x867b('0x38')]['fields']));_0x468cfc['attributes']=_0x468cfc[_0x867b('0x3f')][_0x867b('0x95')]?_0x468cfc[_0x867b('0x3f')]:_0x597665[_0x867b('0x3c')];if(!_0x4b68c3[_0x867b('0x38')][_0x867b('0xa1')](_0x867b('0x96'))){_0x468cfc[_0x867b('0x25')]=qs[_0x867b('0x25')](_0x4b68c3[_0x867b('0x38')][_0x867b('0x25')]);_0x468cfc[_0x867b('0x24')]=qs['offset'](_0x4b68c3['query']['offset']);}_0x468cfc[_0x867b('0xa2')]=qs[_0x867b('0x97')](_0x4b68c3[_0x867b('0x38')][_0x867b('0x97')]);_0x468cfc[_0x867b('0x98')]=qs['filters'](_[_0x867b('0x99')](_0x4b68c3[_0x867b('0x38')],_0x597665['filters']));_0x468cfc[_0x867b('0x98')][_0x867b('0xa3')]=_0x47db8c['id'];if(_0x4b68c3[_0x867b('0x38')][_0x867b('0x9a')]){_0x468cfc[_0x867b('0x98')]=_[_0x867b('0x2e')](_0x468cfc['where'],{'$or':_[_0x867b('0x32')](_0x468cfc[_0x867b('0x3f')],function(_0x4718ff){var _0x18612b={};_0x18612b[_0x4718ff]={'$like':'%'+_0x4b68c3[_0x867b('0x38')][_0x867b('0x9a')]+'%'};return _0x18612b;})});}_0x468cfc['where'][_0x867b('0xa4')]=![];if(_0x4b68c3[_0x867b('0x38')]['id']){_0x468cfc[_0x867b('0x98')]['id']={'$gt':_0x4b68c3['query']['id']};}_0x468cfc=_[_0x867b('0x2e')]({},_0x468cfc,_0x4b68c3['options']);return db[_0x867b('0x90')]['count']({'where':_0x468cfc[_0x867b('0x98')]})[_0x867b('0x29')](function(_0x15ec9b){_0x54ab0f[_0x867b('0x27')]=_0x15ec9b;_0x468cfc[_0x867b('0x43')]=[];if(_0x4b68c3[_0x867b('0x38')][_0x867b('0xa5')]){_0x468cfc[_0x867b('0x43')][_0x867b('0xa6')]({'model':db['User'],'as':_0x867b('0x76'),'attributes':['id',_0x867b('0x82'),_0x867b('0x81')]});}if(_0x4b68c3[_0x867b('0x38')][_0x867b('0x42')]){_0x468cfc['include']=[{'all':!![]}];}return db[_0x867b('0x90')]['findAll'](_0x468cfc);})[_0x867b('0x29')](function(_0x531c10){_0x54ab0f[_0x867b('0x9e')]=_0x531c10;return _0x54ab0f;});}})['then'](respondWithFilteredResult(_0x9e383b,_0x468cfc))[_0x867b('0x20')](handleError(_0x9e383b,null));};exports[_0x867b('0xa7')]=function(_0x126aad,_0x4e26bb){return db[_0x867b('0x33')][_0x867b('0x45')]({'where':{'id':_0x126aad[_0x867b('0x3b')]['id']}})['then'](handleEntityNotFound(_0x4e26bb,null))[_0x867b('0x29')](function(_0x5f53f0){if(_0x5f53f0){return _0x5f53f0[_0x867b('0xa8')](_0x126aad[_0x867b('0x47')][_0x867b('0x93')],_[_0x867b('0x92')](_0x126aad[_0x867b('0x47')],[_0x867b('0x93'),'id'])||{})['spread'](function(){return db[_0x867b('0xa9')][_0x867b('0x9d')]({'attributes':['id',_0x867b('0x2c'),_0x867b('0xaa')],'where':{'id':_0x126aad['body']['ids']}});})[_0x867b('0x29')](function(_0x2345ff){socket[_0x867b('0xab')](_0x867b('0xac'),{'id':Number(_0x126aad[_0x867b('0x3b')]['id']),'tags':_0x2345ff||[]});return{'id':Number(_0x126aad[_0x867b('0x3b')]['id']),'tags':_0x2345ff||[]};});}})[_0x867b('0x29')](respondWithResult(_0x4e26bb,null))[_0x867b('0x20')](handleError(_0x4e26bb,null));};exports[_0x867b('0xad')]=function(_0xc58ca5,_0x397e06){return db[_0x867b('0x33')][_0x867b('0x45')]({'where':{'id':_0xc58ca5[_0x867b('0x3b')]['id']}})[_0x867b('0x29')](handleEntityNotFound(_0x397e06,null))[_0x867b('0x29')](function(_0x180c8a){if(_0x180c8a){return _0x180c8a[_0x867b('0xad')](_0xc58ca5[_0x867b('0x38')][_0x867b('0x93')]);}})[_0x867b('0x29')](respondWithStatusCode(_0x397e06,null))['catch'](handleError(_0x397e06,null));};exports[_0x867b('0xae')]=function(_0x106d0b,_0xfc685f){var _0x54311c=moment()['unix']()[_0x867b('0xaf')]();var _0x23fca8=path[_0x867b('0x6e')](config[_0x867b('0x6f')],_0x867b('0xb0'),_0x867b('0xb1'),_0x867b('0xb2'));var _0x1b3cfa=path['join'](config[_0x867b('0x6f')],_0x867b('0xb0'),_0x867b('0xb1'),_0x867b('0xb3'));var _0x5b67af=path[_0x867b('0x6e')](_0x23fca8,_0x54311c);var _0x31c7a5=util[_0x867b('0x73')](_0x867b('0xb4'),_0x106d0b[_0x867b('0x3b')]['id'],_0x54311c);var _0x2d1ba3=path[_0x867b('0x6e')](_0x23fca8,_0x31c7a5);var _0x48d90c=[];_0x48d90c[_0x867b('0xa6')]({'model':db[_0x867b('0x76')],'as':_0x867b('0x76'),'attributes':['id','fullname'],'raw':!![]});_0x48d90c[_0x867b('0xa6')]({'model':db[_0x867b('0x5e')],'as':_0x867b('0xb5'),'attributes':['id',_0x867b('0xb6'),_0x867b('0xb7')],'raw':!![]});if(_0x106d0b[_0x867b('0x38')][_0x867b('0xb3')]){_0x48d90c[_0x867b('0xa6')]({'model':db['Attachment'],'as':_0x867b('0x68'),'raw':!![]});}var _0x4fd7ca=[{'model':db[_0x867b('0x90')],'as':_0x867b('0x75'),'attributes':['id',_0x867b('0x47'),_0x867b('0x85'),_0x867b('0x86'),_0x867b('0xa4'),_0x867b('0xb8')],'include':_0x48d90c}];_0x4fd7ca[_0x867b('0xa6')]({'model':db['ChatWebsite'],'as':'Account','attributes':['id','name']});_0x4fd7ca['push']({'model':db[_0x867b('0x76')],'as':_0x867b('0xb9'),'attributes':['id','fullname']});return db[_0x867b('0x33')]['find']({'where':{'id':_0x106d0b[_0x867b('0x3b')]['id']},'include':_0x4fd7ca})['then'](handleEntityNotFound(_0xfc685f,null))[_0x867b('0x29')](function(_0x29f1ef){if(_0x29f1ef){var _0x26e429=_0x29f1ef[_0x867b('0xba')]({'plain':!![]});fs[_0x867b('0xbb')](_0x5b67af);var _0x151d6a={'channel':_0x867b('0xbc'),'account':_0x26e429['Account']['name'],'agent':_0x26e429[_0x867b('0xb9')]?_0x26e429[_0x867b('0xb9')][_0x867b('0x82')]:_0x867b('0xbd'),'createdAt':moment(_0x26e429[_0x867b('0x85')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x26e429[_0x867b('0x61')]?moment(_0x26e429[_0x867b('0xbe')])[_0x867b('0x73')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x26e429['disposition'],'chatInfo':{'browser':_0x26e429[_0x867b('0xbf')],'os':_0x26e429['osName'],'referer':_0x26e429[_0x867b('0xc0')],'customerIp':_0x26e429[_0x867b('0xc1')],'customerPort':_0x26e429['customerPort']?_0x26e429[_0x867b('0xc2')]:_0x867b('0xbd')},'messages':_(_0x26e429['Messages'])[_0x867b('0xc3')]()[_0x867b('0x9a')]({'secret':![]})['map'](function(_0x285f2a){if(_0x285f2a[_0x867b('0x68')]){var _0x3150bd=path[_0x867b('0x6e')](_0x1b3cfa,_0x285f2a[_0x867b('0x68')]['basename']);if(fs[_0x867b('0xc4')](_0x3150bd)){fs[_0x867b('0xc5')](_0x3150bd)[_0x867b('0xc6')](fs['createWriteStream'](path['join'](_0x5b67af,_0x285f2a[_0x867b('0x68')]['basename'])));}}return{'date':moment(_0x285f2a[_0x867b('0x85')])[_0x867b('0x73')](_0x867b('0xc7'))[_0x867b('0xaf')](),'sender':_0x285f2a[_0x867b('0x86')]===_0x867b('0xc8')?_0x285f2a[_0x867b('0x76')]?_0x285f2a['User'][_0x867b('0x82')]:_0x867b('0x7c'):_0x285f2a[_0x867b('0xb5')][_0x867b('0xb6')]+(_0x285f2a[_0x867b('0xb5')][_0x867b('0xb7')]?'\x20'+_0x285f2a[_0x867b('0xb5')][_0x867b('0xb7')]:''),'body':_0x285f2a[_0x867b('0x68')]?_0x285f2a[_0x867b('0x68')]['basename']:_0x285f2a[_0x867b('0x47')],'direction':_0x285f2a[_0x867b('0x86')]===_0x867b('0xc8')?'A':'C','secret':_0x285f2a[_0x867b('0xa4')],'read':_0x285f2a[_0x867b('0xb8')],'attachment':_0x285f2a[_0x867b('0x68')]};})[_0x867b('0xc9')]()};return ejs['renderFile'](path[_0x867b('0x6e')](config[_0x867b('0x6f')],_0x867b('0xb0'),'views',_0x867b('0xca')),{'interaction':_0x151d6a})[_0x867b('0x29')](function(_0x13e5f1){var _0x5ee344=path[_0x867b('0x6e')](_0x5b67af,_0x867b('0xcb')+_0x26e429['id']+'-'+_0x54311c+_0x867b('0xcc'));var _0x1400ae={'path':_0x5ee344,'channel':'Chat','interactionId':_0x26e429['id']};return pdf[_0x867b('0xcd')](_0x13e5f1,_0x1400ae);})[_0x867b('0x29')](function(){return new Promise(function(_0x2ef25d,_0x1b7c82){zipdir(_0x5b67af,{'saveTo':_0x2d1ba3},function(_0x1c33ca,_0x3b10c5){if(_0x1c33ca)return _0x1b7c82(_0x1c33ca);return _0x2ef25d(_0x3b10c5);});})['then'](function(){return new BPromise(function(_0x2c9f5d,_0x11dff2){rimraf(_0x5b67af,function(_0x32625d){if(_0x32625d)_0x11dff2(_0x32625d);return _0x2c9f5d();});});})['then'](function(){return _0xfc685f[_0x867b('0xae')](_0x2d1ba3,_0x31c7a5,function(_0x4a3f7d){if(_0x4a3f7d){logger[_0x867b('0x1c')](_0x867b('0xce'),_0x4a3f7d);}else{fs[_0x867b('0xcf')](_0x2d1ba3);}});});});}else{return _0xfc685f['sendStatus'](0xc8);}})[_0x867b('0x20')](handleError(_0xfc685f,null));};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js
index 97cc3ea..ffdacf3 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 _0x4ee9=['events','ChatInteraction','../../mysqldb','ChatMessage','setMaxListeners','update','getUsers','then','findAll','setDataValue','unreadMessages','emit','catch','hasOwnProperty','hook'];(function(_0x4b7410,_0x47dfc9){var _0x30a546=function(_0x57b75d){while(--_0x57b75d){_0x4b7410['push'](_0x4b7410['shift']());}};_0x30a546(++_0x47dfc9);}(_0x4ee9,0x11d));var _0x94ee=function(_0x13c1d8,_0x5e4259){_0x13c1d8=_0x13c1d8-0x0;var _0x36607b=_0x4ee9[_0x13c1d8];return _0x36607b;};'use strict';var EventEmitter=require(_0x94ee('0x0'));var ChatInteraction=require('../../mysqldb')['db'][_0x94ee('0x1')];var ChatMessage=require(_0x94ee('0x2'))['db'][_0x94ee('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x94ee('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x94ee('0x5'),'afterDestroy':'remove'};function emitEvent(_0x558393){return function(_0x41600b,_0x55ff13,_0x274320){_0x41600b[_0x94ee('0x6')]({'attributes':['id'],'raw':!![]})[_0x94ee('0x7')](function(_0x41a0b1){_0x41600b['setDataValue']('Users',_0x41a0b1['map'](function(_0x38f8f4){return{'id':_0x38f8f4['id']};}));return ChatMessage[_0x94ee('0x8')]({'where':{'ChatInteractionId':_0x41600b['id'],'direction':'in','read':![]},'raw':!![]});})[_0x94ee('0x7')](function(_0x327cab){_0x41600b[_0x94ee('0x9')](_0x94ee('0xa'),_0x327cab['length']);ChatInteractionEvents[_0x94ee('0xb')](_0x558393+':'+_0x41600b['id'],_0x41600b);ChatInteractionEvents[_0x94ee('0xb')](_0x558393,_0x41600b);_0x274320(null);})[_0x94ee('0xc')](_0x274320(null));};}for(var e in events){if(events[_0x94ee('0xd')](e)){var event=events[e];ChatInteraction[_0x94ee('0xe')](e,emitEvent(event));}}module['exports']=ChatInteractionEvents;
\ No newline at end of file
+var _0x7a9e=['unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','findAll'];(function(_0x44d41a,_0x55b3b7){var _0x10e373=function(_0x2d71b7){while(--_0x2d71b7){_0x44d41a['push'](_0x44d41a['shift']());}};_0x10e373(++_0x55b3b7);}(_0x7a9e,0x1e5));var _0xe7a9=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x7a9e[_0x57b54c];return _0x59cc19;};'use strict';var EventEmitter=require('events');var ChatInteraction=require(_0xe7a9('0x0'))['db'][_0xe7a9('0x1')];var ChatMessage=require('../../mysqldb')['db'][_0xe7a9('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xe7a9('0x3')](0x0);var events={'afterCreate':_0xe7a9('0x4'),'afterUpdate':'update','afterDestroy':_0xe7a9('0x5')};function emitEvent(_0x3911ef){return function(_0x3662bd,_0x43a68c,_0xbbf1a0){_0x3662bd['getUsers']({'attributes':['id'],'raw':!![]})[_0xe7a9('0x6')](function(_0x1eb21b){_0x3662bd[_0xe7a9('0x7')](_0xe7a9('0x8'),_0x1eb21b[_0xe7a9('0x9')](function(_0x471cf3){return{'id':_0x471cf3['id']};}));return ChatMessage[_0xe7a9('0xa')]({'where':{'ChatInteractionId':_0x3662bd['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x28fce4){_0x3662bd[_0xe7a9('0x7')](_0xe7a9('0xb'),_0x28fce4['length']);ChatInteractionEvents[_0xe7a9('0xc')](_0x3911ef+':'+_0x3662bd['id'],_0x3662bd);ChatInteractionEvents[_0xe7a9('0xc')](_0x3911ef,_0x3662bd);_0xbbf1a0(null);})[_0xe7a9('0xd')](_0xbbf1a0(null));};}for(var e in events){if(events[_0xe7a9('0xe')](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module[_0xe7a9('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 33ea617..6321c86 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 _0x8a23=['closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./chatInteraction.attributes','define','ChatInteraction','changed','closed'];(function(_0x4a3150,_0x36cbc5){var _0x25aaa1=function(_0x189c08){while(--_0x189c08){_0x4a3150['push'](_0x4a3150['shift']());}};_0x25aaa1(++_0x36cbc5);}(_0x8a23,0xbf));var _0x38a2=function(_0x4370c7,_0x5dbfb0){_0x4370c7=_0x4370c7-0x0;var _0xce78a9=_0x8a23[_0x4370c7];return _0xce78a9;};'use strict';var _=require(_0x38a2('0x0'));var util=require(_0x38a2('0x1'));var logger=require(_0x38a2('0x2'))('api');var moment=require(_0x38a2('0x3'));var BPromise=require(_0x38a2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x38a2('0x5'));var rimraf=require(_0x38a2('0x6'));var config=require(_0x38a2('0x7'));var attributes=require(_0x38a2('0x8'));module['exports']=function(_0x4545b2,_0x4e6194){return _0x4545b2[_0x38a2('0x9')](_0x38a2('0xa'),attributes,{'tableName':'chat_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x4fd3f6,_0x3d94ae,_0x240b04){if(_0x4fd3f6[_0x38a2('0xb')](_0x38a2('0xc'))){_0x4fd3f6[_0x38a2('0xd')]=moment()[_0x38a2('0xe')](_0x38a2('0xf'));}_0x240b04(null,_0x4fd3f6);}},'charset':'utf8mb4','collate':_0x38a2('0x10')});};
\ No newline at end of file
+var _0xbdf6=['moment','bluebird','request-promise','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger'];(function(_0x31a730,_0x1982ef){var _0x193381=function(_0x20be67){while(--_0x20be67){_0x31a730['push'](_0x31a730['shift']());}};_0x193381(++_0x1982ef);}(_0xbdf6,0x1d9));var _0x6bdf=function(_0x56a09d,_0x438162){_0x56a09d=_0x56a09d-0x0;var _0x5bca7e=_0xbdf6[_0x56a09d];return _0x5bca7e;};'use strict';var _=require(_0x6bdf('0x0'));var util=require(_0x6bdf('0x1'));var logger=require(_0x6bdf('0x2'))('api');var moment=require(_0x6bdf('0x3'));var BPromise=require(_0x6bdf('0x4'));var rp=require(_0x6bdf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6bdf('0x6'));module[_0x6bdf('0x7')]=function(_0xb0f85a,_0xc2d041){return _0xb0f85a[_0x6bdf('0x8')](_0x6bdf('0x9'),attributes,{'tableName':_0x6bdf('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x58b514,_0x259429,_0x4209bc){if(_0x58b514[_0x6bdf('0xb')](_0x6bdf('0xc'))){_0x58b514[_0x6bdf('0xd')]=moment()['format'](_0x6bdf('0xe'));}_0x4209bc(null,_0x58b514);}},'charset':_0x6bdf('0xf'),'collate':_0x6bdf('0x10')});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js
index e59545d..2b9dbce 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 _0x171b=['register','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateChatInteraction','ChatInteraction','update','options','raw','where','limit','debug','AddTagsToChatInteraction','find','addTags','body','ids','AddTags','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','defaults','redis','localhost','socket.io-emitter'];(function(_0x11286e,_0x3c7daf){var _0x58dbf2=function(_0x487f62){while(--_0x487f62){_0x11286e['push'](_0x11286e['shift']());}};_0x58dbf2(++_0x3c7daf);}(_0x171b,0xe2));var _0xb171=function(_0x14499b,_0x4a57c4){_0x14499b=_0x14499b-0x0;var _0x4c52e6=_0x171b[_0x14499b];return _0x4c52e6;};'use strict';var _=require(_0xb171('0x0'));var util=require(_0xb171('0x1'));var moment=require(_0xb171('0x2'));var BPromise=require(_0xb171('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb171('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb171('0x5'));var logger=require(_0xb171('0x6'))('rpc');var config=require(_0xb171('0x7'));var jayson=require(_0xb171('0x8'));var client=jayson[_0xb171('0x9')]['http']({'port':0x232a});config['redis']=_[_0xb171('0xa')](config[_0xb171('0xb')],{'host':_0xb171('0xc'),'port':0x18eb});var socket=require(_0xb171('0xd'))(new Redis(config[_0xb171('0xb')]));require('./chatInteraction.socket')[_0xb171('0xe')](socket);function respondWithRpcPromise(_0xe5e359,_0x4006fb,_0x47c38e){return new BPromise(function(_0x3c6517,_0x25711d){return client['request'](_0xe5e359,_0x47c38e)[_0xb171('0xf')](function(_0x599ff0){logger[_0xb171('0x10')](_0xb171('0x11'),_0x4006fb,_0xb171('0x12'));logger['debug'](_0xb171('0x13'),_0x4006fb,_0xb171('0x12'),JSON[_0xb171('0x14')](_0x599ff0));if(_0x599ff0[_0xb171('0x15')]){if(_0x599ff0[_0xb171('0x15')][_0xb171('0x16')]===0x1f4){logger[_0xb171('0x15')](_0xb171('0x11'),_0x4006fb,_0x599ff0[_0xb171('0x15')][_0xb171('0x17')]);return _0x25711d(_0x599ff0[_0xb171('0x15')]['message']);}logger[_0xb171('0x15')](_0xb171('0x11'),_0x4006fb,_0x599ff0[_0xb171('0x15')][_0xb171('0x17')]);return _0x3c6517(_0x599ff0[_0xb171('0x15')]['message']);}else{logger[_0xb171('0x10')](_0xb171('0x11'),_0x4006fb,'request\x20sent');_0x3c6517(_0x599ff0[_0xb171('0x18')][_0xb171('0x17')]);}})[_0xb171('0x19')](function(_0x293a6e){logger[_0xb171('0x15')](_0xb171('0x11'),_0x4006fb,_0x293a6e);_0x25711d(_0x293a6e);});});}exports[_0xb171('0x1a')]=function(_0x40c0a2){var _0x268574=this;return new Promise(function(_0x720b9b,_0x10082b){return db[_0xb171('0x1b')][_0xb171('0x1c')](_0x40c0a2['body'],{'raw':_0x40c0a2['options']?_0x40c0a2[_0xb171('0x1d')][_0xb171('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x40c0a2[_0xb171('0x1d')]?_0x40c0a2[_0xb171('0x1d')][_0xb171('0x1f')]||null:null,'attributes':_0x40c0a2[_0xb171('0x1d')]?_0x40c0a2['options']['attributes']||null:null,'limit':_0x40c0a2[_0xb171('0x1d')]?_0x40c0a2[_0xb171('0x1d')][_0xb171('0x20')]||null:null})[_0xb171('0xf')](function(_0x5ea5cf){logger[_0xb171('0x10')](_0xb171('0x1a'),_0x40c0a2);logger[_0xb171('0x21')](_0xb171('0x1a'),_0x40c0a2,JSON[_0xb171('0x14')](_0x5ea5cf));_0x720b9b(_0x5ea5cf);})['catch'](function(_0x5df91d){logger[_0xb171('0x15')](_0xb171('0x1a'),_0x5df91d[_0xb171('0x17')],_0x40c0a2);_0x10082b(_0x268574[_0xb171('0x15')](0x1f4,_0x5df91d[_0xb171('0x17')]));});});};exports[_0xb171('0x22')]=function(_0x4d8823){return new Promise(function(_0x3d1d58,_0x5cf23a){return db[_0xb171('0x1b')][_0xb171('0x23')]({'where':_0x4d8823[_0xb171('0x1d')]?_0x4d8823[_0xb171('0x1d')][_0xb171('0x1f')]||null:null})[_0xb171('0xf')](function(_0x5114cb){if(_0x5114cb){return _0x5114cb[_0xb171('0x24')](_0x4d8823[_0xb171('0x25')][_0xb171('0x26')],_['omit'](_0x4d8823[_0xb171('0x25')],[_0xb171('0x26'),'id'])||{});}})['spread'](function(_0x4f053a){logger[_0xb171('0x10')](_0xb171('0x27'),_0x4d8823);logger['debug'](_0xb171('0x27'),_0x4d8823,JSON[_0xb171('0x14')](_0x4f053a));_0x3d1d58(_0x4f053a);})[_0xb171('0x19')](function(_0x12c107){logger[_0xb171('0x15')](_0xb171('0x27'),_0x12c107[_0xb171('0x17')],_0x4d8823);_0x5cf23a(_this[_0xb171('0x15')](0x1f4,_0x12c107[_0xb171('0x17')]));});});};
\ No newline at end of file
+var _0x166b=['ChatInteraction','addTags','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','defaults','localhost','redis','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','UpdateChatInteraction','update','body','options','raw','attributes','limit','debug'];(function(_0x551404,_0x1f05e9){var _0x4743d1=function(_0x4611ce){while(--_0x4611ce){_0x551404['push'](_0x551404['shift']());}};_0x4743d1(++_0x1f05e9);}(_0x166b,0x143));var _0xb166=function(_0x2fd21f,_0x3d6f70){_0x2fd21f=_0x2fd21f-0x0;var _0xdb2087=_0x166b[_0x2fd21f];return _0xdb2087;};'use strict';var _=require(_0xb166('0x0'));var util=require(_0xb166('0x1'));var moment=require(_0xb166('0x2'));var BPromise=require(_0xb166('0x3'));var rs=require(_0xb166('0x4'));var fs=require('fs');var Redis=require(_0xb166('0x5'));var db=require(_0xb166('0x6'))['db'];var utils=require(_0xb166('0x7'));var logger=require(_0xb166('0x8'))(_0xb166('0x9'));var config=require(_0xb166('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb166('0xb')][_0xb166('0xc')]({'port':0x232a});config['redis']=_[_0xb166('0xd')](config['redis'],{'host':_0xb166('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb166('0xf')]));require(_0xb166('0x10'))[_0xb166('0x11')](socket);function respondWithRpcPromise(_0x52da08,_0x3f6efd,_0x375013){return new BPromise(function(_0x1bc1d0,_0x25f649){return client[_0xb166('0x12')](_0x52da08,_0x375013)[_0xb166('0x13')](function(_0x5235f9){logger[_0xb166('0x14')](_0xb166('0x15'),_0x3f6efd,'request\x20sent');logger['debug'](_0xb166('0x16'),_0x3f6efd,_0xb166('0x17'),JSON[_0xb166('0x18')](_0x5235f9));if(_0x5235f9['error']){if(_0x5235f9['error'][_0xb166('0x19')]===0x1f4){logger['error'](_0xb166('0x15'),_0x3f6efd,_0x5235f9[_0xb166('0x1a')][_0xb166('0x1b')]);return _0x25f649(_0x5235f9[_0xb166('0x1a')][_0xb166('0x1b')]);}logger[_0xb166('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x3f6efd,_0x5235f9[_0xb166('0x1a')]['message']);return _0x1bc1d0(_0x5235f9['error']['message']);}else{logger[_0xb166('0x14')](_0xb166('0x15'),_0x3f6efd,_0xb166('0x17'));_0x1bc1d0(_0x5235f9['result'][_0xb166('0x1b')]);}})[_0xb166('0x1c')](function(_0x34b66a){logger['error']('ChatInteraction,\x20%s,\x20%s',_0x3f6efd,_0x34b66a);_0x25f649(_0x34b66a);});});}exports[_0xb166('0x1d')]=function(_0x1259b8){var _0x144c05=this;return new Promise(function(_0x8f8170,_0x2ce2bb){return db['ChatInteraction'][_0xb166('0x1e')](_0x1259b8[_0xb166('0x1f')],{'raw':_0x1259b8[_0xb166('0x20')]?_0x1259b8[_0xb166('0x20')][_0xb166('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1259b8[_0xb166('0x20')]?_0x1259b8['options']['where']||null:null,'attributes':_0x1259b8['options']?_0x1259b8[_0xb166('0x20')][_0xb166('0x22')]||null:null,'limit':_0x1259b8[_0xb166('0x20')]?_0x1259b8[_0xb166('0x20')][_0xb166('0x23')]||null:null})[_0xb166('0x13')](function(_0x4291db){logger[_0xb166('0x14')](_0xb166('0x1d'),_0x1259b8);logger[_0xb166('0x24')](_0xb166('0x1d'),_0x1259b8,JSON[_0xb166('0x18')](_0x4291db));_0x8f8170(_0x4291db);})['catch'](function(_0x5916ba){logger['error']('UpdateChatInteraction',_0x5916ba[_0xb166('0x1b')],_0x1259b8);_0x2ce2bb(_0x144c05[_0xb166('0x1a')](0x1f4,_0x5916ba[_0xb166('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x293800){return new Promise(function(_0xd6a3fc,_0x1c909e){return db[_0xb166('0x25')]['find']({'where':_0x293800['options']?_0x293800['options']['where']||null:null})[_0xb166('0x13')](function(_0x31ce80){if(_0x31ce80){return _0x31ce80[_0xb166('0x26')](_0x293800[_0xb166('0x1f')]['ids'],_['omit'](_0x293800[_0xb166('0x1f')],['ids','id'])||{});}})['spread'](function(_0x264914){logger[_0xb166('0x14')](_0xb166('0x27'),_0x293800);logger['debug'](_0xb166('0x27'),_0x293800,JSON[_0xb166('0x18')](_0x264914));_0xd6a3fc(_0x264914);})[_0xb166('0x1c')](function(_0x560af1){logger[_0xb166('0x1a')](_0xb166('0x27'),_0x560af1[_0xb166('0x1b')],_0x293800);_0x1c909e(_this[_0xb166('0x1a')](0x1f4,_0x560af1[_0xb166('0x1b')]));});});};
\ No newline at end of file
diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js
index 269be7c..4bf0b5a 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 _0xcba7=['length','./chatInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x5d8de3,_0x3c9a2d){var _0x5148c8=function(_0x37e414){while(--_0x37e414){_0x5d8de3['push'](_0x5d8de3['shift']());}};_0x5148c8(++_0x3c9a2d);}(_0xcba7,0x199));var _0x7cba=function(_0x504187,_0x407042){_0x504187=_0x504187-0x0;var _0x84c53d=_0xcba7[_0x504187];return _0x84c53d;};'use strict';var ChatInteractionEvents=require(_0x7cba('0x0'));var events=[_0x7cba('0x1'),_0x7cba('0x2'),_0x7cba('0x3')];function createListener(_0x5e59d1,_0x119b7f){return function(_0x461067){_0x119b7f[_0x7cba('0x4')](_0x5e59d1,_0x461067);};}function removeListener(_0x4fa145,_0x251250){return function(){ChatInteractionEvents[_0x7cba('0x5')](_0x4fa145,_0x251250);};}exports[_0x7cba('0x6')]=function(_0x2b0112){for(var _0x285928=0x0,_0x12bc28=events[_0x7cba('0x7')];_0x285928<_0x12bc28;_0x285928++){var _0x435722=events[_0x285928];var _0x1a1cef=createListener('chatInteraction:'+_0x435722,_0x2b0112);ChatInteractionEvents['on'](_0x435722,_0x1a1cef);}};
\ No newline at end of file
+var _0xbe61=['save','remove','update','emit','register','length','chatInteraction:'];(function(_0x3032b9,_0x1cecd4){var _0x15b829=function(_0x151804){while(--_0x151804){_0x3032b9['push'](_0x3032b9['shift']());}};_0x15b829(++_0x1cecd4);}(_0xbe61,0x1dc));var _0x1be6=function(_0x4a349e,_0x47e1a){_0x4a349e=_0x4a349e-0x0;var _0x3fffa3=_0xbe61[_0x4a349e];return _0x3fffa3;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0x1be6('0x0'),_0x1be6('0x1'),_0x1be6('0x2')];function createListener(_0x326181,_0x5f308a){return function(_0x5b376c){_0x5f308a[_0x1be6('0x3')](_0x326181,_0x5b376c);};}function removeListener(_0x577534,_0x388aa3){return function(){ChatInteractionEvents['removeListener'](_0x577534,_0x388aa3);};}exports[_0x1be6('0x4')]=function(_0x31cf1f){for(var _0x131f9a=0x0,_0x1fcfe5=events[_0x1be6('0x5')];_0x131f9a<_0x1fcfe5;_0x131f9a++){var _0x59fd80=events[_0x131f9a];var _0x714382=createListener(_0x1be6('0x6')+_0x59fd80,_0x31cf1f);ChatInteractionEvents['on'](_0x59fd80,_0x714382);}};
\ No newline at end of file
diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js
index 452b647..46b2646 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 _0x083e=['/:id/tags','tracked','chat','addTags','put','/:id','chatinteraction:update','update','/:id/close','close','delete','chatinteraction:destroy','removeTags','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','isAuthenticated','describe','isChatInteractionAuthorized','/:id/attachment_download','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','create','/:id/vidaoo','createVidaooSession','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','/:id/attachment_upload','file','attachmentUpload','addMessage'];(function(_0x470d13,_0x3f22fa){var _0x18cc32=function(_0x58b827){while(--_0x58b827){_0x470d13['push'](_0x470d13['shift']());}};_0x18cc32(++_0x3f22fa);}(_0x083e,0x1c6));var _0xe083=function(_0x35b87c,_0x166a8c){_0x35b87c=_0x35b87c-0x0;var _0x24795b=_0x083e[_0x35b87c];return _0x24795b;};'use strict';var multer=require(_0xe083('0x0'));var util=require('util');var path=require(_0xe083('0x1'));var timeout=require(_0xe083('0x2'));var express=require(_0xe083('0x3'));var router=express[_0xe083('0x4')]();var fs_extra=require(_0xe083('0x5'));var auth=require(_0xe083('0x6'));var interaction=require(_0xe083('0x7'));var config=require(_0xe083('0x8'));var controller=require(_0xe083('0x9'));router[_0xe083('0xa')]('/',auth['isAuthenticated'](),controller[_0xe083('0xb')]);router[_0xe083('0xa')]('/describe',auth[_0xe083('0xc')](),controller[_0xe083('0xd')]);router[_0xe083('0xa')]('/:id',auth[_0xe083('0xe')](),controller['show']);router[_0xe083('0xa')](_0xe083('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router[_0xe083('0xa')](_0xe083('0x10'),auth[_0xe083('0xc')](),controller['getMessages']);router[_0xe083('0xa')](_0xe083('0x11'),auth[_0xe083('0xe')](),controller[_0xe083('0x12')]);router[_0xe083('0xa')](_0xe083('0x13'),auth[_0xe083('0xc')](),controller['download']);router[_0xe083('0x14')]('/',auth[_0xe083('0xc')](),controller[_0xe083('0x15')]);router[_0xe083('0x14')](_0xe083('0x16'),auth['isAuthenticated'](),controller[_0xe083('0x17')]);var upload=multer({'storage':multer[_0xe083('0x18')]({'destination':function(_0x346328,_0x4e99db,_0x88cae3){_0x88cae3(null,path[_0xe083('0x19')](config[_0xe083('0x1a')],_0xe083('0x1b')));},'filename':function(_0x384f57,_0x367459,_0x38b46b){_0x38b46b(null,util[_0xe083('0x1c')](_0xe083('0x1d'),Date[_0xe083('0x1e')](),_0x367459[_0xe083('0x1f')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe083('0x14')](_0xe083('0x20'),upload['single'](_0xe083('0x21')),controller[_0xe083('0x22')]);router[_0xe083('0x14')]('/:id/messages',auth[_0xe083('0xe')](),controller[_0xe083('0x23')]);router[_0xe083('0x14')](_0xe083('0x24'),auth[_0xe083('0xc')](),interaction[_0xe083('0x25')](_0xe083('0x26'),'chatinteraction:addtags'),controller[_0xe083('0x27')]);router[_0xe083('0x28')](_0xe083('0x29'),auth[_0xe083('0xc')](),interaction[_0xe083('0x25')](_0xe083('0x26'),_0xe083('0x2a')),controller[_0xe083('0x2b')]);router[_0xe083('0x28')]('/:id/custom_update',controller['customUpdate']);router[_0xe083('0x28')]('/:id/abandon',auth[_0xe083('0xe')](),controller['abandon']);router[_0xe083('0x28')](_0xe083('0x2c'),controller[_0xe083('0x2d')]);router[_0xe083('0x2e')]('/:id',auth['isAuthenticated'](),interaction[_0xe083('0x25')](_0xe083('0x26'),_0xe083('0x2f')),controller['destroy']);router[_0xe083('0x2e')](_0xe083('0x24'),auth[_0xe083('0xc')](),controller[_0xe083('0x30')]);module['exports']=router;
\ No newline at end of file
+var _0x08a1=['/:id/vidaoo','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','replace','single','/:id/messages','tracked','addTags','put','chat','update','customUpdate','/:id/abandon','abandon','/:id/close','close','delete','chatinteraction:destroy','removeTags','multer','util','path','connect-timeout','express','fs-extra','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','index','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','getMessages','/:id/my_messages','getMyMessages','/:id/download','create','post'];(function(_0x43d199,_0x3c6f96){var _0x2f121c=function(_0x100e60){while(--_0x100e60){_0x43d199['push'](_0x43d199['shift']());}};_0x2f121c(++_0x3c6f96);}(_0x08a1,0xd0));var _0x108a=function(_0x4a5642,_0x18c3f9){_0x4a5642=_0x4a5642-0x0;var _0x4ecc72=_0x08a1[_0x4a5642];return _0x4ecc72;};'use strict';var multer=require(_0x108a('0x0'));var util=require(_0x108a('0x1'));var path=require(_0x108a('0x2'));var timeout=require(_0x108a('0x3'));var express=require(_0x108a('0x4'));var router=express['Router']();var fs_extra=require(_0x108a('0x5'));var auth=require('../../components/auth/service');var interaction=require(_0x108a('0x6'));var config=require(_0x108a('0x7'));var controller=require(_0x108a('0x8'));router[_0x108a('0x9')]('/',auth[_0x108a('0xa')](),controller[_0x108a('0xb')]);router[_0x108a('0x9')]('/describe',auth[_0x108a('0xa')](),controller['describe']);router['get'](_0x108a('0xc'),auth[_0x108a('0xd')](),controller[_0x108a('0xe')]);router['get'](_0x108a('0xf'),auth['isChatInteractionAuthorized'](),controller['attachmentDownload']);router['get']('/:id/messages',auth[_0x108a('0xa')](),controller[_0x108a('0x10')]);router[_0x108a('0x9')](_0x108a('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x108a('0x12')]);router[_0x108a('0x9')](_0x108a('0x13'),auth[_0x108a('0xa')](),controller['download']);router['post']('/',auth['isAuthenticated'](),controller[_0x108a('0x14')]);router[_0x108a('0x15')](_0x108a('0x16'),auth[_0x108a('0xa')](),controller['createVidaooSession']);var upload=multer({'storage':multer[_0x108a('0x17')]({'destination':function(_0x2ecb2a,_0x9b11aa,_0xb480de){_0xb480de(null,path[_0x108a('0x18')](config[_0x108a('0x19')],_0x108a('0x1a')));},'filename':function(_0x2dc370,_0x141f07,_0x65541a){_0x65541a(null,util[_0x108a('0x1b')](_0x108a('0x1c'),Date[_0x108a('0x1d')](),_0x141f07['originalname'][_0x108a('0x1e')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x108a('0x15')]('/:id/attachment_upload',upload[_0x108a('0x1f')]('file'),controller['attachmentUpload']);router[_0x108a('0x15')](_0x108a('0x20'),auth['isChatInteractionAuthorized'](),controller['addMessage']);router[_0x108a('0x15')]('/:id/tags',auth[_0x108a('0xa')](),interaction[_0x108a('0x21')]('chat','chatinteraction:addtags'),controller[_0x108a('0x22')]);router[_0x108a('0x23')](_0x108a('0xc'),auth['isAuthenticated'](),interaction[_0x108a('0x21')](_0x108a('0x24'),'chatinteraction:update'),controller[_0x108a('0x25')]);router[_0x108a('0x23')]('/:id/custom_update',controller[_0x108a('0x26')]);router['put'](_0x108a('0x27'),auth['isChatInteractionAuthorized'](),controller[_0x108a('0x28')]);router[_0x108a('0x23')](_0x108a('0x29'),controller[_0x108a('0x2a')]);router[_0x108a('0x2b')](_0x108a('0xc'),auth['isAuthenticated'](),interaction['tracked']('chat',_0x108a('0x2c')),controller['destroy']);router[_0x108a('0x2b')]('/:id/tags',auth[_0x108a('0xa')](),controller[_0x108a('0x2d')]);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js
index 849fb99..cbc0a6a 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 _0x5ebf=['INTEGER','sequelize','BOOLEAN'];(function(_0x475839,_0x20240e){var _0x8b2115=function(_0x53f8a6){while(--_0x53f8a6){_0x475839['push'](_0x475839['shift']());}};_0x8b2115(++_0x20240e);}(_0x5ebf,0xfd));var _0xf5eb=function(_0x265877,_0x57dcb8){_0x265877=_0x265877-0x0;var _0x3e8869=_0x5ebf[_0x265877];return _0x3e8869;};'use strict';var Sequelize=require(_0xf5eb('0x0'));module['exports']={'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xf5eb('0x1')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xf5eb('0x2')]}};
\ No newline at end of file
+var _0x72a5=['TEXT','INTEGER','sequelize'];(function(_0x3ca831,_0x768b79){var _0x40aa0b=function(_0x18d821){while(--_0x18d821){_0x3ca831['push'](_0x3ca831['shift']());}};_0x40aa0b(++_0x768b79);}(_0x72a5,0x11c));var _0x572a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x72a5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x572a('0x0'));module['exports']={'body':{'type':Sequelize[_0x572a('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x572a('0x2')]}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js
index fa02db3..127b5fb 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 _0x220c=['online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','role','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','length','push','createdAt','FromId','ToId','read','-createdAt','all','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','undefined','count','limit','Content-Range','apply','save','update','then','destroy','stack','name','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','ChatInternalMessage','includeAll','include','findAll','rows','catch','show','fields','find','create','body','params','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','User','agent','admin','user','fullname','userpic','internal'];(function(_0x7ec0ec,_0x529dd4){var _0x4c0883=function(_0x121114){while(--_0x121114){_0x7ec0ec['push'](_0x7ec0ec['shift']());}};_0x4c0883(++_0x529dd4);}(_0x220c,0x85));var _0xc220=function(_0x453a5e,_0x5625a4){_0x453a5e=_0x453a5e-0x0;var _0x438f6d=_0x220c[_0x453a5e];return _0x438f6d;};'use strict';var emlformat=require(_0xc220('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xc220('0x1'));var jsonpatch=require(_0xc220('0x2'));var rp=require(_0xc220('0x3'));var moment=require('moment');var BPromise=require(_0xc220('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc220('0x5'));var sox=require(_0xc220('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0xc220('0x7'));var _=require(_0xc220('0x8'));var squel=require(_0xc220('0x9'));var crypto=require(_0xc220('0xa'));var jsforce=require(_0xc220('0xb'));var deskjs=require(_0xc220('0xc'));var toCsv=require('to-csv');var querystring=require(_0xc220('0xd'));var Papa=require(_0xc220('0xe'));var Redis=require('ioredis');var authService=require(_0xc220('0xf'));var qs=require(_0xc220('0x10'));var as=require(_0xc220('0x11'));var hardwareService=require(_0xc220('0x12'));var logger=require(_0xc220('0x13'))(_0xc220('0x14'));var utils=require(_0xc220('0x15'));var config=require('../../config/environment');var licenseUtil=require(_0xc220('0x16'));var db=require(_0xc220('0x17'))['db'];config[_0xc220('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc220('0x19'))(new Redis(config[_0xc220('0x18')]));require(_0xc220('0x1a'))[_0xc220('0x1b')](socket);function respondWithStatusCode(_0x4e79e4,_0x36f0be){_0x36f0be=_0x36f0be||0xcc;return function(_0x335aab){if(_0x335aab){return _0x4e79e4[_0xc220('0x1c')](_0x36f0be);}return _0x4e79e4['status'](_0x36f0be)['end']();};}function respondWithResult(_0x230a03,_0x15f019){_0x15f019=_0x15f019||0xc8;return function(_0x2b4513){if(_0x2b4513){return _0x230a03[_0xc220('0x1d')](_0x15f019)[_0xc220('0x1e')](_0x2b4513);}};}function respondWithFilteredResult(_0x3c56e7,_0x48ac93){return function(_0x1d8b58){if(_0x1d8b58){var _0x458b8f=typeof _0x48ac93[_0xc220('0x1f')]===_0xc220('0x20')&&typeof _0x48ac93['limit']===_0xc220('0x20');var _0x21e306=_0x1d8b58[_0xc220('0x21')];var _0x473375=_0x458b8f?0x0:_0x48ac93[_0xc220('0x1f')];var _0x339ef0=_0x458b8f?_0x1d8b58['count']:_0x48ac93['offset']+_0x48ac93[_0xc220('0x22')];var _0x129099;if(_0x339ef0>=_0x21e306){_0x339ef0=_0x21e306;_0x129099=0xc8;}else{_0x129099=0xce;}_0x3c56e7[_0xc220('0x1d')](_0x129099);return _0x3c56e7['set'](_0xc220('0x23'),_0x473375+'-'+_0x339ef0+'/'+_0x21e306)[_0xc220('0x1e')](_0x1d8b58);}return null;};}function patchUpdates(_0xf762b8){return function(_0x1fd4c0){try{jsonpatch[_0xc220('0x24')](_0x1fd4c0,_0xf762b8,!![]);}catch(_0x3cbd58){return BPromise['reject'](_0x3cbd58);}return _0x1fd4c0[_0xc220('0x25')]();};}function saveUpdates(_0x3915c2,_0x1a14a7){return function(_0x2ee05c){if(_0x2ee05c){return _0x2ee05c[_0xc220('0x26')](_0x3915c2)[_0xc220('0x27')](function(_0x396c52){return _0x396c52;});}return null;};}function removeEntity(_0x4afc7e,_0x128d2a){return function(_0x1df4cb){if(_0x1df4cb){return _0x1df4cb[_0xc220('0x28')]()[_0xc220('0x27')](function(){_0x4afc7e[_0xc220('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6539e7,_0x317804){return function(_0x155df5){if(!_0x155df5){_0x6539e7['sendStatus'](0x194);}return _0x155df5;};}function handleError(_0x56b5fb,_0x5bdca0){_0x5bdca0=_0x5bdca0||0x1f4;return function(_0x12d752){logger['error'](_0x12d752[_0xc220('0x29')]);if(_0x12d752['name']){delete _0x12d752[_0xc220('0x2a')];}_0x56b5fb[_0xc220('0x1d')](_0x5bdca0)['send'](_0x12d752);};}exports[_0xc220('0x2b')]=function(_0xa30aaf,_0x4b3f14){var _0x5b20cd={},_0xc12cce={},_0x3bfed3={'count':0x0,'rows':[]};var _0x48abf4=_[_0xc220('0x2c')](db['ChatInternalMessage'][_0xc220('0x2d')],function(_0x3fbaa5){return{'name':_0x3fbaa5[_0xc220('0x2e')],'type':_0x3fbaa5['type'][_0xc220('0x2f')]};});_0xc12cce[_0xc220('0x30')]=_[_0xc220('0x2c')](_0x48abf4,'name');_0xc12cce[_0xc220('0x31')]=_[_0xc220('0x32')](_0xa30aaf[_0xc220('0x31')]);_0xc12cce[_0xc220('0x33')]=_[_0xc220('0x34')](_0xc12cce[_0xc220('0x30')],_0xc12cce['query']);_0x5b20cd['attributes']=_[_0xc220('0x34')](_0xc12cce[_0xc220('0x30')],qs['fields'](_0xa30aaf[_0xc220('0x31')]['fields']));_0x5b20cd[_0xc220('0x35')]=_0x5b20cd[_0xc220('0x35')]['length']?_0x5b20cd[_0xc220('0x35')]:_0xc12cce[_0xc220('0x30')];if(!_0xa30aaf[_0xc220('0x31')][_0xc220('0x36')](_0xc220('0x37'))){_0x5b20cd[_0xc220('0x22')]=qs[_0xc220('0x22')](_0xa30aaf[_0xc220('0x31')][_0xc220('0x22')]);_0x5b20cd['offset']=qs[_0xc220('0x1f')](_0xa30aaf['query']['offset']);}_0x5b20cd[_0xc220('0x38')]=qs[_0xc220('0x39')](_0xa30aaf[_0xc220('0x31')][_0xc220('0x39')]);_0x5b20cd[_0xc220('0x3a')]=qs['filters'](_[_0xc220('0x3b')](_0xa30aaf[_0xc220('0x31')],_0xc12cce[_0xc220('0x33')]),_0x48abf4);if(_0xa30aaf[_0xc220('0x31')][_0xc220('0x3c')]){_0x5b20cd[_0xc220('0x3a')]=_[_0xc220('0x3d')](_0x5b20cd[_0xc220('0x3a')],{'$or':_[_0xc220('0x2c')](_0x48abf4,function(_0x448b88){if(_0x448b88[_0xc220('0x3e')]!==_0xc220('0x3f')){var _0x2a8ccf={};_0x2a8ccf[_0x448b88[_0xc220('0x2a')]]={'$like':'%'+_0xa30aaf[_0xc220('0x31')]['filter']+'%'};return _0x2a8ccf;}})});}_0x5b20cd=_['merge']({},_0x5b20cd,_0xa30aaf[_0xc220('0x40')]);var _0x15d7b9={'where':_0x5b20cd[_0xc220('0x3a')]};return db[_0xc220('0x41')][_0xc220('0x21')](_0x15d7b9)['then'](function(_0x353ffd){_0x3bfed3[_0xc220('0x21')]=_0x353ffd;if(_0xa30aaf[_0xc220('0x31')][_0xc220('0x42')]){_0x5b20cd[_0xc220('0x43')]=[{'all':!![]}];}return db[_0xc220('0x41')][_0xc220('0x44')](_0x5b20cd);})[_0xc220('0x27')](function(_0x40f6b9){_0x3bfed3[_0xc220('0x45')]=_0x40f6b9;return _0x3bfed3;})['then'](respondWithFilteredResult(_0x4b3f14,_0x5b20cd))[_0xc220('0x46')](handleError(_0x4b3f14,null));};exports[_0xc220('0x47')]=function(_0x2c3284,_0x46c3d3){var _0x4c2fdd={'raw':!![],'where':{'id':_0x2c3284['params']['id']}},_0xab7b59={};_0xab7b59[_0xc220('0x30')]=_[_0xc220('0x32')](db['ChatInternalMessage'][_0xc220('0x2d')]);_0xab7b59[_0xc220('0x31')]=_['keys'](_0x2c3284[_0xc220('0x31')]);_0xab7b59['filters']=_['intersection'](_0xab7b59[_0xc220('0x30')],_0xab7b59['query']);_0x4c2fdd['attributes']=_['intersection'](_0xab7b59['model'],qs[_0xc220('0x48')](_0x2c3284['query'][_0xc220('0x48')]));_0x4c2fdd[_0xc220('0x35')]=_0x4c2fdd[_0xc220('0x35')]['length']?_0x4c2fdd[_0xc220('0x35')]:_0xab7b59[_0xc220('0x30')];if(_0x2c3284['query'][_0xc220('0x42')]){_0x4c2fdd[_0xc220('0x43')]=[{'all':!![]}];}_0x4c2fdd=_['merge']({},_0x4c2fdd,_0x2c3284[_0xc220('0x40')]);return db[_0xc220('0x41')][_0xc220('0x49')](_0x4c2fdd)[_0xc220('0x27')](handleEntityNotFound(_0x46c3d3,null))[_0xc220('0x27')](respondWithResult(_0x46c3d3,null))['catch'](handleError(_0x46c3d3,null));};exports['create']=function(_0x32b7e6,_0x27c0ff){return db[_0xc220('0x41')][_0xc220('0x4a')](_0x32b7e6[_0xc220('0x4b')],{})[_0xc220('0x27')](respondWithResult(_0x27c0ff,0xc9))['catch'](handleError(_0x27c0ff,null));};exports[_0xc220('0x26')]=function(_0x29e61c,_0x241f6d){if(_0x29e61c['body']['id']){delete _0x29e61c[_0xc220('0x4b')]['id'];}return db[_0xc220('0x41')][_0xc220('0x49')]({'where':{'id':_0x29e61c['params']['id']}})[_0xc220('0x27')](handleEntityNotFound(_0x241f6d,null))['then'](saveUpdates(_0x29e61c[_0xc220('0x4b')],null))[_0xc220('0x27')](respondWithResult(_0x241f6d,null))['catch'](handleError(_0x241f6d,null));};exports[_0xc220('0x28')]=function(_0x182884,_0xff81d8){return db[_0xc220('0x41')]['find']({'where':{'id':_0x182884[_0xc220('0x4c')]['id']}})[_0xc220('0x27')](handleEntityNotFound(_0xff81d8,null))['then'](removeEntity(_0xff81d8,null))[_0xc220('0x46')](handleError(_0xff81d8,null));};exports[_0xc220('0x4d')]=function(_0x819684,_0x3efa41){return db[_0xc220('0x41')][_0xc220('0x4d')]()[_0xc220('0x27')](respondWithResult(_0x3efa41,null))['catch'](handleError(_0x3efa41,null));};function wrapUser(_0x4e1053){return function(_0x5de02c){var _0x46c31f=_0x4e1053[_0xc220('0x4e')]({'plain':!![]});_0x46c31f[_0xc220('0x4f')]=[];if(_0x5de02c){_0x46c31f[_0xc220('0x50')]=_0x5de02c['createdAt'];_0x46c31f[_0xc220('0x51')]=_0x5de02c;}else{_0x46c31f[_0xc220('0x50')]=moment(0x0)[_0xc220('0x52')](_0xc220('0x53'));_0x46c31f['lastMessage']={};}return _0x46c31f;};}exports['getUsers']=function(_0x3d6742,_0x4f28af,_0x17720b){var _0xd17a79=[];return db[_0xc220('0x54')][_0xc220('0x44')]({'where':{'role':[_0xc220('0x55'),_0xc220('0x56'),_0xc220('0x57')]},'attributes':['id',_0xc220('0x58'),_0xc220('0x2a'),'role',_0xc220('0x59'),_0xc220('0x5a'),_0xc220('0x5b'),_0xc220('0x5c'),_0xc220('0x5d'),_0xc220('0x5e')],'order':qs[_0xc220('0x39')](_0xc220('0x5f')),'include':[{'model':db[_0xc220('0x60')],'as':_0xc220('0x61'),'attributes':['id',_0xc220('0x2a'),_0xc220('0x3e')],'through':{'attributes':[]}}]})['then'](function(_0x4ee270){if(_0x4ee270){var _0x4883b6=_0x3d6742['user'][_0xc220('0x4e')]({'plain':!![]});if(!_0x4883b6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4883b6[_0xc220('0x62')]===_0xc220('0x57')){return db['UserProfileSection'][_0xc220('0x49')]({'where':{'name':_0xc220('0x63'),'userProfileId':_0x4883b6[_0xc220('0x64')]},'raw':!![]})[_0xc220('0x27')](function(_0x9f74fc){if(_0x9f74fc){if(_0x9f74fc[_0xc220('0x65')]===0x0){return db[_0xc220('0x66')][_0xc220('0x44')]({'where':{'sectionId':_0x9f74fc['id']},'raw':!![]})[_0xc220('0x27')](function(_0x20d859){var _0x43b37a=[];if(_[_0xc220('0x67')](_0x20d859)){_0x43b37a=_[_0xc220('0x3c')](_0x4ee270,function(_0x4fa0ba){if(_0x4fa0ba[_0xc220('0x62')]!==_0xc220('0x55')){return _0x4fa0ba;}});return _0x43b37a;}else{for(var _0x10d48e=0x0;_0x10d48e<_0x4ee270[_0xc220('0x68')];_0x10d48e++){var _0x5e4b0a=_0x4ee270[_0x10d48e];if(_0x5e4b0a[_0xc220('0x62')]===_0xc220('0x55')){var _0x17c18b=_[_0xc220('0x49')](_0x20d859,function(_0x385e84){return _0x385e84['resourceId']===_0x5e4b0a['id'];});if(_0x17c18b)_0x43b37a['push'](_0x5e4b0a);}else{_0x43b37a[_0xc220('0x69')](_0x5e4b0a);}}return _0x43b37a;}});}else{return _0x4ee270;}}else{var _0xb4196f=_['filter'](_0x4ee270,function(_0x205ad8){if(_0x205ad8[_0xc220('0x62')]!==_0xc220('0x55')){return _0x205ad8;}});return _0xb4196f;}});}else{return _0x4ee270;}}})['then'](function(_0x4b50d8){var _0xfa5275=[];if(_0x4b50d8){_0xd17a79=_0x4b50d8;for(var _0x45a987=0x0;_0x45a987<_0x4b50d8[_0xc220('0x68')];_0x45a987+=0x1){_0xd17a79[_0x45a987]['messages']=[];_0xfa5275['push'](db[_0xc220('0x41')][_0xc220('0x49')]({'where':{'FromId':[_0x3d6742[_0xc220('0x57')]['id'],_0x4b50d8[_0x45a987]['id']],'ToId':[_0x3d6742['user']['id'],_0x4b50d8[_0x45a987]['id']],'ChatGroupId':null},'attributes':['id',_0xc220('0x6a'),_0xc220('0x6b'),_0xc220('0x6c'),_0xc220('0x6d'),'body'],'order':qs[_0xc220('0x39')](_0xc220('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0xc220('0x27')](wrapUser(_0x4b50d8[_0x45a987])));}return BPromise[_0xc220('0x6f')](_0xfa5275);}return[];})[_0xc220('0x27')](function(_0xbf6c63){return{'rows':_0xbf6c63,'count':_0xbf6c63[_0xc220('0x68')]};})[_0xc220('0x27')](respondWithResult(_0x4f28af,null))['catch'](handleError(_0x4f28af,null));};
\ No newline at end of file
+var _0xcf42=['destroy','end','error','stack','name','send','index','ChatInternalMessage','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','options','then','includeAll','include','findAll','catch','show','params','keys','merge','create','body','find','describe','get','lastMessageAt','createdAt','format','User','agent','admin','user','role','userpic','internal','online','lastLoginAt','allowmessenger','VoiceQueues','UserProfileSection','Agents','userProfileId','autoAssociation','isEmpty','resourceId','push','ToId','read','-createdAt','all','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../config/license/util','../../mysqldb','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','offset','limit','undefined','count','Content-Range','reject','save','update'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0xcf42,0x118));var _0x2cf4=function(_0x20b38b,_0x3fd615){_0x20b38b=_0x20b38b-0x0;var _0x1a28e6=_0xcf42[_0x20b38b];return _0x1a28e6;};'use strict';var emlformat=require(_0x2cf4('0x0'));var rimraf=require(_0x2cf4('0x1'));var zipdir=require(_0x2cf4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2cf4('0x3'));var moment=require(_0x2cf4('0x4'));var BPromise=require(_0x2cf4('0x5'));var Mustache=require(_0x2cf4('0x6'));var util=require(_0x2cf4('0x7'));var path=require(_0x2cf4('0x8'));var sox=require(_0x2cf4('0x9'));var csv=require(_0x2cf4('0xa'));var ejs=require(_0x2cf4('0xb'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0x2cf4('0xc'));var squel=require(_0x2cf4('0xd'));var crypto=require('crypto');var jsforce=require(_0x2cf4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x2cf4('0xa'));var querystring=require(_0x2cf4('0xf'));var Papa=require(_0x2cf4('0x10'));var Redis=require(_0x2cf4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x2cf4('0x12'));var hardwareService=require(_0x2cf4('0x13'));var logger=require(_0x2cf4('0x14'))(_0x2cf4('0x15'));var utils=require('../../config/utils');var config=require(_0x2cf4('0x16'));var licenseUtil=require(_0x2cf4('0x17'));var db=require(_0x2cf4('0x18'))['db'];config[_0x2cf4('0x19')]=_['defaults'](config[_0x2cf4('0x19')],{'host':_0x2cf4('0x1a'),'port':0x18eb});var socket=require(_0x2cf4('0x1b'))(new Redis(config['redis']));require(_0x2cf4('0x1c'))[_0x2cf4('0x1d')](socket);function respondWithStatusCode(_0x1c1ea4,_0x432f18){_0x432f18=_0x432f18||0xcc;return function(_0x36f339){if(_0x36f339){return _0x1c1ea4[_0x2cf4('0x1e')](_0x432f18);}return _0x1c1ea4['status'](_0x432f18)['end']();};}function respondWithResult(_0x4212ee,_0x5537f1){_0x5537f1=_0x5537f1||0xc8;return function(_0x5f04a7){if(_0x5f04a7){return _0x4212ee[_0x2cf4('0x1f')](_0x5537f1)[_0x2cf4('0x20')](_0x5f04a7);}};}function respondWithFilteredResult(_0x1c89e2,_0x19c1ef){return function(_0x1d023d){if(_0x1d023d){var _0x2e5448=typeof _0x19c1ef[_0x2cf4('0x21')]==='undefined'&&typeof _0x19c1ef[_0x2cf4('0x22')]===_0x2cf4('0x23');var _0x119222=_0x1d023d[_0x2cf4('0x24')];var _0x1aa167=_0x2e5448?0x0:_0x19c1ef[_0x2cf4('0x21')];var _0x246a8d=_0x2e5448?_0x1d023d['count']:_0x19c1ef[_0x2cf4('0x21')]+_0x19c1ef[_0x2cf4('0x22')];var _0x9b7a2d;if(_0x246a8d>=_0x119222){_0x246a8d=_0x119222;_0x9b7a2d=0xc8;}else{_0x9b7a2d=0xce;}_0x1c89e2['status'](_0x9b7a2d);return _0x1c89e2['set'](_0x2cf4('0x25'),_0x1aa167+'-'+_0x246a8d+'/'+_0x119222)[_0x2cf4('0x20')](_0x1d023d);}return null;};}function patchUpdates(_0x48b4d8){return function(_0x94e171){try{jsonpatch['apply'](_0x94e171,_0x48b4d8,!![]);}catch(_0x22e8d2){return BPromise[_0x2cf4('0x26')](_0x22e8d2);}return _0x94e171[_0x2cf4('0x27')]();};}function saveUpdates(_0x398f7e,_0x188651){return function(_0x430b89){if(_0x430b89){return _0x430b89[_0x2cf4('0x28')](_0x398f7e)['then'](function(_0x49cd7f){return _0x49cd7f;});}return null;};}function removeEntity(_0xd8c403,_0x4ab461){return function(_0xba27e){if(_0xba27e){return _0xba27e[_0x2cf4('0x29')]()['then'](function(){_0xd8c403[_0x2cf4('0x1f')](0xcc)[_0x2cf4('0x2a')]();});}};}function handleEntityNotFound(_0x51034d,_0x256708){return function(_0x2d7116){if(!_0x2d7116){_0x51034d[_0x2cf4('0x1e')](0x194);}return _0x2d7116;};}function handleError(_0x507ebf,_0x328f47){_0x328f47=_0x328f47||0x1f4;return function(_0x2ac6e6){logger[_0x2cf4('0x2b')](_0x2ac6e6[_0x2cf4('0x2c')]);if(_0x2ac6e6[_0x2cf4('0x2d')]){delete _0x2ac6e6[_0x2cf4('0x2d')];}_0x507ebf[_0x2cf4('0x1f')](_0x328f47)[_0x2cf4('0x2e')](_0x2ac6e6);};}exports[_0x2cf4('0x2f')]=function(_0x1de4ba,_0x466ac5){var _0x282d13={},_0x5dff40={},_0xf4c04f={'count':0x0,'rows':[]};var _0x5f5764=_['map'](db[_0x2cf4('0x30')][_0x2cf4('0x31')],function(_0x442b4e){return{'name':_0x442b4e[_0x2cf4('0x32')],'type':_0x442b4e[_0x2cf4('0x33')]['key']};});_0x5dff40[_0x2cf4('0x34')]=_[_0x2cf4('0x35')](_0x5f5764,_0x2cf4('0x2d'));_0x5dff40[_0x2cf4('0x36')]=_['keys'](_0x1de4ba[_0x2cf4('0x36')]);_0x5dff40[_0x2cf4('0x37')]=_[_0x2cf4('0x38')](_0x5dff40['model'],_0x5dff40[_0x2cf4('0x36')]);_0x282d13[_0x2cf4('0x39')]=_['intersection'](_0x5dff40['model'],qs[_0x2cf4('0x3a')](_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x3a')]));_0x282d13[_0x2cf4('0x39')]=_0x282d13[_0x2cf4('0x39')][_0x2cf4('0x3b')]?_0x282d13[_0x2cf4('0x39')]:_0x5dff40['model'];if(!_0x1de4ba['query'][_0x2cf4('0x3c')](_0x2cf4('0x3d'))){_0x282d13[_0x2cf4('0x22')]=qs[_0x2cf4('0x22')](_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x22')]);_0x282d13[_0x2cf4('0x21')]=qs[_0x2cf4('0x21')](_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x21')]);}_0x282d13['order']=qs[_0x2cf4('0x3e')](_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x3e')]);_0x282d13[_0x2cf4('0x3f')]=qs[_0x2cf4('0x37')](_[_0x2cf4('0x40')](_0x1de4ba[_0x2cf4('0x36')],_0x5dff40[_0x2cf4('0x37')]),_0x5f5764);if(_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x41')]){_0x282d13['where']=_['merge'](_0x282d13[_0x2cf4('0x3f')],{'$or':_[_0x2cf4('0x35')](_0x5f5764,function(_0x907e99){if(_0x907e99['type']!==_0x2cf4('0x42')){var _0x2c0858={};_0x2c0858[_0x907e99[_0x2cf4('0x2d')]]={'$like':'%'+_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x41')]+'%'};return _0x2c0858;}})});}_0x282d13=_['merge']({},_0x282d13,_0x1de4ba[_0x2cf4('0x43')]);var _0xfb61c2={'where':_0x282d13[_0x2cf4('0x3f')]};return db[_0x2cf4('0x30')][_0x2cf4('0x24')](_0xfb61c2)[_0x2cf4('0x44')](function(_0x4db7f2){_0xf4c04f[_0x2cf4('0x24')]=_0x4db7f2;if(_0x1de4ba[_0x2cf4('0x36')][_0x2cf4('0x45')]){_0x282d13[_0x2cf4('0x46')]=[{'all':!![]}];}return db[_0x2cf4('0x30')][_0x2cf4('0x47')](_0x282d13);})[_0x2cf4('0x44')](function(_0x52750a){_0xf4c04f['rows']=_0x52750a;return _0xf4c04f;})[_0x2cf4('0x44')](respondWithFilteredResult(_0x466ac5,_0x282d13))[_0x2cf4('0x48')](handleError(_0x466ac5,null));};exports[_0x2cf4('0x49')]=function(_0x1e5b23,_0x265438){var _0x5c2f0b={'raw':!![],'where':{'id':_0x1e5b23[_0x2cf4('0x4a')]['id']}},_0x3fff45={};_0x3fff45[_0x2cf4('0x34')]=_[_0x2cf4('0x4b')](db['ChatInternalMessage'][_0x2cf4('0x31')]);_0x3fff45['query']=_[_0x2cf4('0x4b')](_0x1e5b23[_0x2cf4('0x36')]);_0x3fff45[_0x2cf4('0x37')]=_['intersection'](_0x3fff45[_0x2cf4('0x34')],_0x3fff45['query']);_0x5c2f0b[_0x2cf4('0x39')]=_['intersection'](_0x3fff45[_0x2cf4('0x34')],qs[_0x2cf4('0x3a')](_0x1e5b23[_0x2cf4('0x36')]['fields']));_0x5c2f0b[_0x2cf4('0x39')]=_0x5c2f0b[_0x2cf4('0x39')][_0x2cf4('0x3b')]?_0x5c2f0b[_0x2cf4('0x39')]:_0x3fff45[_0x2cf4('0x34')];if(_0x1e5b23[_0x2cf4('0x36')]['includeAll']){_0x5c2f0b['include']=[{'all':!![]}];}_0x5c2f0b=_[_0x2cf4('0x4c')]({},_0x5c2f0b,_0x1e5b23[_0x2cf4('0x43')]);return db['ChatInternalMessage']['find'](_0x5c2f0b)[_0x2cf4('0x44')](handleEntityNotFound(_0x265438,null))['then'](respondWithResult(_0x265438,null))[_0x2cf4('0x48')](handleError(_0x265438,null));};exports[_0x2cf4('0x4d')]=function(_0x53c446,_0x16c769){return db[_0x2cf4('0x30')][_0x2cf4('0x4d')](_0x53c446[_0x2cf4('0x4e')],{})[_0x2cf4('0x44')](respondWithResult(_0x16c769,0xc9))[_0x2cf4('0x48')](handleError(_0x16c769,null));};exports[_0x2cf4('0x28')]=function(_0x29d016,_0x38febf){if(_0x29d016[_0x2cf4('0x4e')]['id']){delete _0x29d016[_0x2cf4('0x4e')]['id'];}return db[_0x2cf4('0x30')][_0x2cf4('0x4f')]({'where':{'id':_0x29d016[_0x2cf4('0x4a')]['id']}})[_0x2cf4('0x44')](handleEntityNotFound(_0x38febf,null))['then'](saveUpdates(_0x29d016[_0x2cf4('0x4e')],null))[_0x2cf4('0x44')](respondWithResult(_0x38febf,null))['catch'](handleError(_0x38febf,null));};exports[_0x2cf4('0x29')]=function(_0x459ff0,_0x585d7f){return db['ChatInternalMessage']['find']({'where':{'id':_0x459ff0[_0x2cf4('0x4a')]['id']}})[_0x2cf4('0x44')](handleEntityNotFound(_0x585d7f,null))[_0x2cf4('0x44')](removeEntity(_0x585d7f,null))[_0x2cf4('0x48')](handleError(_0x585d7f,null));};exports[_0x2cf4('0x50')]=function(_0x1f3e36,_0x30ec75){return db[_0x2cf4('0x30')][_0x2cf4('0x50')]()['then'](respondWithResult(_0x30ec75,null))[_0x2cf4('0x48')](handleError(_0x30ec75,null));};function wrapUser(_0x36c4b1){return function(_0x3ef993){var _0x2b2e4f=_0x36c4b1[_0x2cf4('0x51')]({'plain':!![]});_0x2b2e4f['messages']=[];if(_0x3ef993){_0x2b2e4f[_0x2cf4('0x52')]=_0x3ef993[_0x2cf4('0x53')];_0x2b2e4f['lastMessage']=_0x3ef993;}else{_0x2b2e4f[_0x2cf4('0x52')]=moment(0x0)[_0x2cf4('0x54')]('YYYY-MM-DD\x20HH:mm:ss');_0x2b2e4f['lastMessage']={};}return _0x2b2e4f;};}exports['getUsers']=function(_0x1d9fcc,_0x58ab1d,_0x78868b){var _0x931c0a=[];return db[_0x2cf4('0x55')][_0x2cf4('0x47')]({'where':{'role':[_0x2cf4('0x56'),_0x2cf4('0x57'),_0x2cf4('0x58')]},'attributes':['id','fullname',_0x2cf4('0x2d'),_0x2cf4('0x59'),_0x2cf4('0x5a'),_0x2cf4('0x5b'),_0x2cf4('0x5c'),_0x2cf4('0x5d'),_0x2cf4('0x5e'),'showWebBar'],'order':qs['sort']('-online'),'include':[{'model':db['VoiceQueue'],'as':_0x2cf4('0x5f'),'attributes':['id',_0x2cf4('0x2d'),'type'],'through':{'attributes':[]}}]})[_0x2cf4('0x44')](function(_0x2c738a){if(_0x2c738a){var _0xe4e71d=_0x1d9fcc[_0x2cf4('0x58')][_0x2cf4('0x51')]({'plain':!![]});if(!_0xe4e71d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe4e71d[_0x2cf4('0x59')]==='user'){return db[_0x2cf4('0x60')][_0x2cf4('0x4f')]({'where':{'name':_0x2cf4('0x61'),'userProfileId':_0xe4e71d[_0x2cf4('0x62')]},'raw':!![]})[_0x2cf4('0x44')](function(_0x54a95c){if(_0x54a95c){if(_0x54a95c[_0x2cf4('0x63')]===0x0){return db['UserProfileResource'][_0x2cf4('0x47')]({'where':{'sectionId':_0x54a95c['id']},'raw':!![]})['then'](function(_0xceaf7d){var _0x3d5d36=[];if(_[_0x2cf4('0x64')](_0xceaf7d)){_0x3d5d36=_[_0x2cf4('0x41')](_0x2c738a,function(_0x46844e){if(_0x46844e[_0x2cf4('0x59')]!==_0x2cf4('0x56')){return _0x46844e;}});return _0x3d5d36;}else{for(var _0x127874=0x0;_0x127874<_0x2c738a[_0x2cf4('0x3b')];_0x127874++){var _0x168197=_0x2c738a[_0x127874];if(_0x168197['role']===_0x2cf4('0x56')){var _0x5d010d=_[_0x2cf4('0x4f')](_0xceaf7d,function(_0x33a59d){return _0x33a59d[_0x2cf4('0x65')]===_0x168197['id'];});if(_0x5d010d)_0x3d5d36[_0x2cf4('0x66')](_0x168197);}else{_0x3d5d36['push'](_0x168197);}}return _0x3d5d36;}});}else{return _0x2c738a;}}else{var _0x3599cd=_[_0x2cf4('0x41')](_0x2c738a,function(_0x72eb19){if(_0x72eb19[_0x2cf4('0x59')]!=='agent'){return _0x72eb19;}});return _0x3599cd;}});}else{return _0x2c738a;}}})[_0x2cf4('0x44')](function(_0x2c58cf){var _0x26d343=[];if(_0x2c58cf){_0x931c0a=_0x2c58cf;for(var _0x203e95=0x0;_0x203e95<_0x2c58cf[_0x2cf4('0x3b')];_0x203e95+=0x1){_0x931c0a[_0x203e95]['messages']=[];_0x26d343['push'](db['ChatInternalMessage'][_0x2cf4('0x4f')]({'where':{'FromId':[_0x1d9fcc[_0x2cf4('0x58')]['id'],_0x2c58cf[_0x203e95]['id']],'ToId':[_0x1d9fcc[_0x2cf4('0x58')]['id'],_0x2c58cf[_0x203e95]['id']],'ChatGroupId':null},'attributes':['id',_0x2cf4('0x53'),'FromId',_0x2cf4('0x67'),_0x2cf4('0x68'),_0x2cf4('0x4e')],'order':qs['sort'](_0x2cf4('0x69')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x2cf4('0x44')](wrapUser(_0x2c58cf[_0x203e95])));}return BPromise[_0x2cf4('0x6a')](_0x26d343);}return[];})[_0x2cf4('0x44')](function(_0x1222de){return{'rows':_0x1222de,'count':_0x1222de[_0x2cf4('0x3b')]};})[_0x2cf4('0x44')](respondWithResult(_0x58ab1d,null))[_0x2cf4('0x48')](handleError(_0x58ab1d,null));};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js
index 245bf0a..39dc9b5 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 _0x6033=['update','remove','hasOwnProperty','exports','events','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x402495,_0x4325d3){var _0x4dde60=function(_0x5a4de1){while(--_0x5a4de1){_0x402495['push'](_0x402495['shift']());}};_0x4dde60(++_0x4325d3);}(_0x6033,0xdc));var _0x3603=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x6033[_0x502c7d];return _0x30b7ed;};'use strict';var EventEmitter=require(_0x3603('0x0'));var ChatInternalMessage=require(_0x3603('0x1'))['db'][_0x3603('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x3603('0x3')](0x0);var events={'afterCreate':_0x3603('0x4'),'afterUpdate':_0x3603('0x5'),'afterDestroy':_0x3603('0x6')};function emitEvent(_0x5cbf3a){return function(_0x5bf14c,_0xa7d477,_0x3316ed){ChatInternalMessageEvents['emit'](_0x5cbf3a+':'+_0x5bf14c['id'],_0x5bf14c);ChatInternalMessageEvents['emit'](_0x5cbf3a,_0x5bf14c);_0x3316ed(null);};}for(var e in events){if(events[_0x3603('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x3603('0x8')]=ChatInternalMessageEvents;
\ No newline at end of file
+var _0x58e4=['setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x2cb63e,_0x1ee2ba){var _0x535895=function(_0x50588b){while(--_0x50588b){_0x2cb63e['push'](_0x2cb63e['shift']());}};_0x535895(++_0x1ee2ba);}(_0x58e4,0x157));var _0x458e=function(_0x5afd58,_0x52c443){_0x5afd58=_0x5afd58-0x0;var _0x2d6d02=_0x58e4[_0x5afd58];return _0x2d6d02;};'use strict';var EventEmitter=require(_0x458e('0x0'));var ChatInternalMessage=require('../../mysqldb')['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x458e('0x1')](0x0);var events={'afterCreate':_0x458e('0x2'),'afterUpdate':'update','afterDestroy':_0x458e('0x3')};function emitEvent(_0x9c2e2a){return function(_0x35c6f2,_0x21f717,_0x20942c){ChatInternalMessageEvents[_0x458e('0x4')](_0x9c2e2a+':'+_0x35c6f2['id'],_0x35c6f2);ChatInternalMessageEvents[_0x458e('0x4')](_0x9c2e2a,_0x35c6f2);_0x20942c(null);};}for(var e in events){if(events[_0x458e('0x5')](e)){var event=events[e];ChatInternalMessage[_0x458e('0x6')](e,emitEvent(event));}}module[_0x458e('0x7')]=ChatInternalMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js
index 559ac70..cc839e0 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 _0x574e=['./chatInternalMessage.attributes','exports','define','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x2a9490,_0x43cb5f){var _0x5bf90e=function(_0x207583){while(--_0x207583){_0x2a9490['push'](_0x2a9490['shift']());}};_0x5bf90e(++_0x43cb5f);}(_0x574e,0xd9));var _0xe574=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x574e[_0x167cc1];return _0x10bc4b;};'use strict';var _=require('lodash');var util=require(_0xe574('0x0'));var logger=require(_0xe574('0x1'))(_0xe574('0x2'));var moment=require(_0xe574('0x3'));var BPromise=require(_0xe574('0x4'));var rp=require(_0xe574('0x5'));var fs=require('fs');var path=require(_0xe574('0x6'));var rimraf=require('rimraf');var config=require(_0xe574('0x7'));var attributes=require(_0xe574('0x8'));module[_0xe574('0x9')]=function(_0x34b6cf,_0x315a3c){return _0x34b6cf[_0xe574('0xa')](_0xe574('0xb'),attributes,{'tableName':_0xe574('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe574('0xd'),'collate':_0xe574('0xe')});};
\ No newline at end of file
+var _0x921d=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','../../config/logger'];(function(_0x230c6c,_0x2a0ee9){var _0x4b2e2c=function(_0x15740a){while(--_0x15740a){_0x230c6c['push'](_0x230c6c['shift']());}};_0x4b2e2c(++_0x2a0ee9);}(_0x921d,0x19f));var _0xd921=function(_0x1d201a,_0x5df173){_0x1d201a=_0x1d201a-0x0;var _0x2ab8b1=_0x921d[_0x1d201a];return _0x2ab8b1;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd921('0x0'))(_0xd921('0x1'));var moment=require(_0xd921('0x2'));var BPromise=require(_0xd921('0x3'));var rp=require(_0xd921('0x4'));var fs=require('fs');var path=require(_0xd921('0x5'));var rimraf=require(_0xd921('0x6'));var config=require(_0xd921('0x7'));var attributes=require('./chatInternalMessage.attributes');module[_0xd921('0x8')]=function(_0x3fb89c,_0x472779){return _0x3fb89c['define'](_0xd921('0x9'),attributes,{'tableName':_0xd921('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd921('0xb'),'collate':_0xd921('0xc')});};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js
index 4ced37f..4f94b14 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 _0x0f82=['jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8b7ce6,_0x50949a){var _0x30358c=function(_0x35742c){while(--_0x35742c){_0x8b7ce6['push'](_0x8b7ce6['shift']());}};_0x30358c(++_0x50949a);}(_0x0f82,0x1c6));var _0x20f8=function(_0x3c957d,_0x40d8f3){_0x3c957d=_0x3c957d-0x0;var _0x46ab64=_0x0f82[_0x3c957d];return _0x46ab64;};'use strict';var _=require(_0x20f8('0x0'));var util=require(_0x20f8('0x1'));var moment=require(_0x20f8('0x2'));var BPromise=require(_0x20f8('0x3'));var rs=require(_0x20f8('0x4'));var fs=require('fs');var Redis=require(_0x20f8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x20f8('0x6'));var logger=require(_0x20f8('0x7'))(_0x20f8('0x8'));var config=require(_0x20f8('0x9'));var jayson=require(_0x20f8('0xa'));var client=jayson[_0x20f8('0xb')][_0x20f8('0xc')]({'port':0x232a});config[_0x20f8('0xd')]=_[_0x20f8('0xe')](config[_0x20f8('0xd')],{'host':_0x20f8('0xf'),'port':0x18eb});var socket=require(_0x20f8('0x10'))(new Redis(config[_0x20f8('0xd')]));require('./chatInternalMessage.socket')['register'](socket);function respondWithRpcPromise(_0xc43dd9,_0x23e627,_0x7e5f1f){return new BPromise(function(_0x980edc,_0x5316ee){return client[_0x20f8('0x11')](_0xc43dd9,_0x7e5f1f)[_0x20f8('0x12')](function(_0x2976bf){logger[_0x20f8('0x13')](_0x20f8('0x14'),_0x23e627,_0x20f8('0x15'));logger[_0x20f8('0x16')](_0x20f8('0x17'),_0x23e627,_0x20f8('0x15'),JSON[_0x20f8('0x18')](_0x2976bf));if(_0x2976bf[_0x20f8('0x19')]){if(_0x2976bf['error'][_0x20f8('0x1a')]===0x1f4){logger[_0x20f8('0x19')]('ChatInternalMessage,\x20%s,\x20%s',_0x23e627,_0x2976bf[_0x20f8('0x19')][_0x20f8('0x1b')]);return _0x5316ee(_0x2976bf[_0x20f8('0x19')][_0x20f8('0x1b')]);}logger[_0x20f8('0x19')](_0x20f8('0x14'),_0x23e627,_0x2976bf[_0x20f8('0x19')][_0x20f8('0x1b')]);return _0x980edc(_0x2976bf['error'][_0x20f8('0x1b')]);}else{logger[_0x20f8('0x13')](_0x20f8('0x14'),_0x23e627,_0x20f8('0x15'));_0x980edc(_0x2976bf[_0x20f8('0x1c')][_0x20f8('0x1b')]);}})['catch'](function(_0x5b02ea){logger['error'](_0x20f8('0x14'),_0x23e627,_0x5b02ea);_0x5316ee(_0x5b02ea);});});}
\ No newline at end of file
+var _0xac47=['util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','request\x20sent','debug','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','ChatInternalMessage,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x4d7d63,_0x58ac67){var _0x62eaf=function(_0x383f9e){while(--_0x383f9e){_0x4d7d63['push'](_0x4d7d63['shift']());}};_0x62eaf(++_0x58ac67);}(_0xac47,0x1af));var _0x7ac4=function(_0x49f509,_0x5c7395){_0x49f509=_0x49f509-0x0;var _0x1250d2=_0xac47[_0x49f509];return _0x1250d2;};'use strict';var _=require(_0x7ac4('0x0'));var util=require(_0x7ac4('0x1'));var moment=require(_0x7ac4('0x2'));var BPromise=require(_0x7ac4('0x3'));var rs=require(_0x7ac4('0x4'));var fs=require('fs');var Redis=require(_0x7ac4('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7ac4('0x6'));var logger=require(_0x7ac4('0x7'))('rpc');var config=require(_0x7ac4('0x8'));var jayson=require(_0x7ac4('0x9'));var client=jayson[_0x7ac4('0xa')][_0x7ac4('0xb')]({'port':0x232a});config[_0x7ac4('0xc')]=_['defaults'](config[_0x7ac4('0xc')],{'host':_0x7ac4('0xd'),'port':0x18eb});var socket=require(_0x7ac4('0xe'))(new Redis(config[_0x7ac4('0xc')]));require(_0x7ac4('0xf'))[_0x7ac4('0x10')](socket);function respondWithRpcPromise(_0xf46947,_0x285bf7,_0x2e4634){return new BPromise(function(_0x14125c,_0x215d70){return client['request'](_0xf46947,_0x2e4634)[_0x7ac4('0x11')](function(_0x3835b0){logger[_0x7ac4('0x12')]('ChatInternalMessage,\x20%s,\x20%s',_0x285bf7,_0x7ac4('0x13'));logger[_0x7ac4('0x14')](_0x7ac4('0x15'),_0x285bf7,'request\x20sent',JSON['stringify'](_0x3835b0));if(_0x3835b0[_0x7ac4('0x16')]){if(_0x3835b0[_0x7ac4('0x16')]['code']===0x1f4){logger[_0x7ac4('0x16')](_0x7ac4('0x17'),_0x285bf7,_0x3835b0[_0x7ac4('0x16')][_0x7ac4('0x18')]);return _0x215d70(_0x3835b0['error'][_0x7ac4('0x18')]);}logger[_0x7ac4('0x16')](_0x7ac4('0x17'),_0x285bf7,_0x3835b0[_0x7ac4('0x16')][_0x7ac4('0x18')]);return _0x14125c(_0x3835b0[_0x7ac4('0x16')][_0x7ac4('0x18')]);}else{logger[_0x7ac4('0x12')](_0x7ac4('0x17'),_0x285bf7,'request\x20sent');_0x14125c(_0x3835b0[_0x7ac4('0x19')]['message']);}})[_0x7ac4('0x1a')](function(_0x304637){logger[_0x7ac4('0x16')](_0x7ac4('0x17'),_0x285bf7,_0x304637);_0x215d70(_0x304637);});});}
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js
index e16b4d2..306d9c2 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 _0x6287=['length','save','remove','update','removeListener'];(function(_0x5166c3,_0x534558){var _0x31da60=function(_0x4db4a2){while(--_0x4db4a2){_0x5166c3['push'](_0x5166c3['shift']());}};_0x31da60(++_0x534558);}(_0x6287,0x1b9));var _0x7628=function(_0x40b7ea,_0x550490){_0x40b7ea=_0x40b7ea-0x0;var _0x2627ec=_0x6287[_0x40b7ea];return _0x2627ec;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x7628('0x0'),_0x7628('0x1'),_0x7628('0x2')];function createListener(_0x322d9e,_0x2bd56a){return function(_0x1c01db){_0x2bd56a['emit'](_0x322d9e,_0x1c01db);};}function removeListener(_0x37fc62,_0xe0dca4){return function(){ChatInternalMessageEvents[_0x7628('0x3')](_0x37fc62,_0xe0dca4);};}exports['register']=function(_0x507802){for(var _0x1e0cc1=0x0,_0x283499=events[_0x7628('0x4')];_0x1e0cc1<_0x283499;_0x1e0cc1++){var _0x3878bd=events[_0x1e0cc1];var _0x52e376=createListener('chatInternalMessage:'+_0x3878bd,_0x507802);ChatInternalMessageEvents['on'](_0x3878bd,_0x52e376);}};
\ No newline at end of file
+var _0x4f50=['removeListener','register','length','chatInternalMessage:','remove','update','emit'];(function(_0x1bf24a,_0x9d7622){var _0x514c10=function(_0x2361c5){while(--_0x2361c5){_0x1bf24a['push'](_0x1bf24a['shift']());}};_0x514c10(++_0x9d7622);}(_0x4f50,0x1e0));var _0x04f5=function(_0xe446b9,_0x4b27df){_0xe446b9=_0xe446b9-0x0;var _0xb77c67=_0x4f50[_0xe446b9];return _0xb77c67;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=['save',_0x04f5('0x0'),_0x04f5('0x1')];function createListener(_0x3ffe3f,_0x53c264){return function(_0x44bc37){_0x53c264[_0x04f5('0x2')](_0x3ffe3f,_0x44bc37);};}function removeListener(_0x29874d,_0x354cff){return function(){ChatInternalMessageEvents[_0x04f5('0x3')](_0x29874d,_0x354cff);};}exports[_0x04f5('0x4')]=function(_0x466e44){for(var _0x2b67c1=0x0,_0x58eb14=events[_0x04f5('0x5')];_0x2b67c1<_0x58eb14;_0x2b67c1++){var _0xcf88a5=events[_0x2b67c1];var _0x39e9bc=createListener(_0x04f5('0x6')+_0xcf88a5,_0x466e44);ChatInternalMessageEvents['on'](_0xcf88a5,_0x39e9bc);}};
\ No newline at end of file
diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js
index 8431a8b..dc5b6d6 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 _0xd606=['post','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show'];(function(_0x55d763,_0x559f3e){var _0x1f51ea=function(_0x7668fe){while(--_0x7668fe){_0x55d763['push'](_0x55d763['shift']());}};_0x1f51ea(++_0x559f3e);}(_0xd606,0x1bb));var _0x6d60=function(_0x45f2e5,_0x13ea9f){_0x45f2e5=_0x45f2e5-0x0;var _0x4cc589=_0xd606[_0x45f2e5];return _0x4cc589;};'use strict';var multer=require(_0x6d60('0x0'));var util=require('util');var path=require(_0x6d60('0x1'));var timeout=require('connect-timeout');var express=require(_0x6d60('0x2'));var router=express[_0x6d60('0x3')]();var fs_extra=require('fs-extra');var auth=require(_0x6d60('0x4'));var interaction=require(_0x6d60('0x5'));var config=require(_0x6d60('0x6'));var controller=require(_0x6d60('0x7'));router[_0x6d60('0x8')]('/',auth[_0x6d60('0x9')](),controller[_0x6d60('0xa')]);router[_0x6d60('0x8')](_0x6d60('0xb'),auth[_0x6d60('0x9')](),controller[_0x6d60('0xc')]);router[_0x6d60('0x8')](_0x6d60('0xd'),auth[_0x6d60('0x9')](),controller[_0x6d60('0xe')]);router[_0x6d60('0x8')](_0x6d60('0xf'),auth[_0x6d60('0x9')](),controller[_0x6d60('0x10')]);router[_0x6d60('0x11')]('/',auth[_0x6d60('0x9')](),controller['create']);router[_0x6d60('0x12')](_0x6d60('0xf'),controller[_0x6d60('0x13')]);router[_0x6d60('0x14')](_0x6d60('0xf'),auth['isAuthenticated'](),controller[_0x6d60('0x15')]);module[_0x6d60('0x16')]=router;
\ No newline at end of file
+var _0x2400=['isAuthenticated','index','/describe','describe','/users','getUsers','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','fs-extra','../../components/auth/service','../../components/interaction/service','get'];(function(_0x45cda6,_0x41f09f){var _0xb6f62f=function(_0x3993f2){while(--_0x3993f2){_0x45cda6['push'](_0x45cda6['shift']());}};_0xb6f62f(++_0x41f09f);}(_0x2400,0xb0));var _0x0240=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0x2400[_0x172747];return _0x509692;};'use strict';var multer=require(_0x0240('0x0'));var util=require(_0x0240('0x1'));var path=require(_0x0240('0x2'));var timeout=require(_0x0240('0x3'));var express=require('express');var router=express['Router']();var fs_extra=require(_0x0240('0x4'));var auth=require(_0x0240('0x5'));var interaction=require(_0x0240('0x6'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x0240('0x7')]('/',auth[_0x0240('0x8')](),controller[_0x0240('0x9')]);router['get'](_0x0240('0xa'),auth[_0x0240('0x8')](),controller[_0x0240('0xb')]);router[_0x0240('0x7')](_0x0240('0xc'),auth[_0x0240('0x8')](),controller[_0x0240('0xd')]);router[_0x0240('0x7')](_0x0240('0xe'),auth['isAuthenticated'](),controller[_0x0240('0xf')]);router[_0x0240('0x10')]('/',auth[_0x0240('0x8')](),controller[_0x0240('0x11')]);router[_0x0240('0x12')](_0x0240('0xe'),controller[_0x0240('0x13')]);router[_0x0240('0x14')](_0x0240('0xe'),auth[_0x0240('0x8')](),controller[_0x0240('0x15')]);module[_0x0240('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js
index 421963f..6b831bc 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 _0x531a=['sequelize','exports','TEXT','medium','BOOLEAN','ENUM','out','DATE'];(function(_0xb6454d,_0x28fec5){var _0x2cbc14=function(_0x3d93ea){while(--_0x3d93ea){_0xb6454d['push'](_0xb6454d['shift']());}};_0x2cbc14(++_0x28fec5);}(_0x531a,0x100));var _0xa531=function(_0x580971,_0x10984d){_0x580971=_0x580971-0x0;var _0x16d873=_0x531a[_0x580971];return _0x16d873;};'use strict';var Sequelize=require(_0xa531('0x0'));module[_0xa531('0x1')]={'body':{'type':Sequelize[_0xa531('0x2')](_0xa531('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa531('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa531('0x5')]('in',_0xa531('0x6')),'defaultValue':_0xa531('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xa531('0x7')]},'providerName':{'type':Sequelize['STRING']},'providerResponse':{'type':Sequelize[_0xa531('0x2')]}};
\ No newline at end of file
+var _0xe1e3=['DATE','STRING','TEXT','sequelize','exports','medium','ENUM','out'];(function(_0x2f3c12,_0x4b2a09){var _0x106a20=function(_0x355b06){while(--_0x355b06){_0x2f3c12['push'](_0x2f3c12['shift']());}};_0x106a20(++_0x4b2a09);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x25dfc8,_0x50ed96){_0x25dfc8=_0x25dfc8-0x0;var _0x1828ca=_0xe1e3[_0x25dfc8];return _0x1828ca;};'use strict';var Sequelize=require(_0x3e1e('0x0'));module[_0x3e1e('0x1')]={'body':{'type':Sequelize['TEXT'](_0x3e1e('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3e1e('0x3')]('in','out'),'defaultValue':_0x3e1e('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3e1e('0x5')]},'providerName':{'type':Sequelize[_0x3e1e('0x6')]},'providerResponse':{'type':Sequelize[_0x3e1e('0x7')]}};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js
index 6f56cbc..096b619 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 _0x222a=['includeAll','include','findAll','rows','params','find','body','describe','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','agent','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','AcceptMessage','acceptMessage','sequelize','Sequelize','QueryTypes','SELECT','contact','User','fullname','internal','manual','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','formData','chat-interactions','chat','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','RejectMessage','rejectMessage','ContactId','email','rejectmessage','parse','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','fs-extra','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','defaults','redis','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','then','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','code','message','info','request\x20sent','catch','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','destroy','name','send','map','ChatMessage','rawAttributes','type','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','options'];(function(_0x4f65f8,_0x43f65e){var _0x5639ec=function(_0x2d4157){while(--_0x2d4157){_0x4f65f8['push'](_0x4f65f8['shift']());}};_0x5639ec(++_0x43f65e);}(_0x222a,0xb3));var _0xa222=function(_0x570ce9,_0x58b86e){_0x570ce9=_0x570ce9-0x0;var _0x465573=_0x222a[_0x570ce9];return _0x465573;};'use strict';var emlformat=require(_0xa222('0x0'));var rimraf=require(_0xa222('0x1'));var zipdir=require(_0xa222('0x2'));var jsonpatch=require(_0xa222('0x3'));var rp=require(_0xa222('0x4'));var moment=require('moment');var BPromise=require(_0xa222('0x5'));var Mustache=require(_0xa222('0x6'));var util=require(_0xa222('0x7'));var path=require('path');var sox=require(_0xa222('0x8'));var csv=require(_0xa222('0x9'));var ejs=require(_0xa222('0xa'));var fs=require('fs');var fs_extra=require(_0xa222('0xb'));var _=require('lodash');var squel=require('squel');var crypto=require(_0xa222('0xc'));var jsforce=require(_0xa222('0xd'));var deskjs=require(_0xa222('0xe'));var toCsv=require(_0xa222('0x9'));var querystring=require(_0xa222('0xf'));var Papa=require('papaparse');var Redis=require(_0xa222('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa222('0x11'));var as=require(_0xa222('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa222('0x13'));var utils=require(_0xa222('0x14'));var config=require(_0xa222('0x15'));var licenseUtil=require(_0xa222('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa222('0x17')](config[_0xa222('0x18')],{'host':_0xa222('0x19'),'port':0x18eb});var socket=require(_0xa222('0x1a'))(new Redis(config['redis']));require(_0xa222('0x1b'))[_0xa222('0x1c')](socket);var jayson=require(_0xa222('0x1d'));var client=jayson[_0xa222('0x1e')][_0xa222('0x1f')]({'port':0x232c});var client9002=jayson[_0xa222('0x1e')][_0xa222('0x1f')]({'port':0x232a});function respondWithRpcPromise(_0x57fe93,_0x14d52c,_0x11e748,_0x2cd368){return new BPromise(function(_0x1df564,_0x4d1067){var _0xc07e75=_0x2cd368||client;return _0xc07e75['request'](_0x57fe93,_0x11e748)[_0xa222('0x20')](function(_0x43f94a){logger['info'](_0xa222('0x21'),_0x14d52c,'request\x20sent');logger[_0xa222('0x22')](_0xa222('0x23'),_0x14d52c,'request\x20sent',JSON['stringify'](_0x43f94a));if(_0x43f94a[_0xa222('0x24')]){if(_0x43f94a[_0xa222('0x24')][_0xa222('0x25')]===0x1f4){logger['error'](_0xa222('0x21'),_0x14d52c,_0x43f94a['error'][_0xa222('0x26')]);return _0x4d1067(_0x43f94a[_0xa222('0x24')]['message']);}logger[_0xa222('0x24')]('ChatMessage,\x20%s,\x20%s',_0x14d52c,_0x43f94a['error']['message']);return _0x1df564(_0x43f94a['error'][_0xa222('0x26')]);}else{logger[_0xa222('0x27')](_0xa222('0x21'),_0x14d52c,_0xa222('0x28'));_0x1df564(_0x43f94a['result'][_0xa222('0x26')]);}})[_0xa222('0x29')](function(_0x44e57d){logger['error'](_0xa222('0x21'),_0x14d52c,_0x44e57d);_0x4d1067(_0x44e57d);});});}function respondWithStatusCode(_0x1c5a07,_0x4fc859){_0x4fc859=_0x4fc859||0xcc;return function(_0x4985aa){if(_0x4985aa){return _0x1c5a07[_0xa222('0x2a')](_0x4fc859);}return _0x1c5a07[_0xa222('0x2b')](_0x4fc859)[_0xa222('0x2c')]();};}function respondWithResult(_0xbdd9a0,_0x3c29d3){_0x3c29d3=_0x3c29d3||0xc8;return function(_0xf46e94){if(_0xf46e94){return _0xbdd9a0[_0xa222('0x2b')](_0x3c29d3)[_0xa222('0x2d')](_0xf46e94);}};}function respondWithFilteredResult(_0x454593,_0x22d923){return function(_0x4f7327){if(_0x4f7327){var _0xca2741=typeof _0x22d923['offset']==='undefined'&&typeof _0x22d923['limit']==='undefined';var _0x441a27=_0x4f7327[_0xa222('0x2e')];var _0x35bb6c=_0xca2741?0x0:_0x22d923[_0xa222('0x2f')];var _0x2e3724=_0xca2741?_0x4f7327['count']:_0x22d923['offset']+_0x22d923[_0xa222('0x30')];var _0x4d46cd;if(_0x2e3724>=_0x441a27){_0x2e3724=_0x441a27;_0x4d46cd=0xc8;}else{_0x4d46cd=0xce;}_0x454593['status'](_0x4d46cd);return _0x454593['set']('Content-Range',_0x35bb6c+'-'+_0x2e3724+'/'+_0x441a27)['json'](_0x4f7327);}return null;};}function patchUpdates(_0x15522f){return function(_0x12519d){try{jsonpatch[_0xa222('0x31')](_0x12519d,_0x15522f,!![]);}catch(_0x25f5c2){return BPromise[_0xa222('0x32')](_0x25f5c2);}return _0x12519d[_0xa222('0x33')]();};}function saveUpdates(_0x449148,_0x5c8b12){return function(_0x4aa33e){if(_0x4aa33e){return _0x4aa33e[_0xa222('0x34')](_0x449148)['then'](function(_0x14f1f9){return _0x14f1f9;});}return null;};}function removeEntity(_0x42dc6f,_0x5e9322){return function(_0x3242d2){if(_0x3242d2){return _0x3242d2[_0xa222('0x35')]()[_0xa222('0x20')](function(){_0x42dc6f[_0xa222('0x2b')](0xcc)[_0xa222('0x2c')]();});}};}function handleEntityNotFound(_0x504da6,_0x21b63f){return function(_0x4c1025){if(!_0x4c1025){_0x504da6[_0xa222('0x2a')](0x194);}return _0x4c1025;};}function handleError(_0x2e411f,_0x146c79){_0x146c79=_0x146c79||0x1f4;return function(_0x2371b6){logger[_0xa222('0x24')](_0x2371b6['stack']);if(_0x2371b6[_0xa222('0x36')]){delete _0x2371b6['name'];}_0x2e411f[_0xa222('0x2b')](_0x146c79)[_0xa222('0x37')](_0x2371b6);};}exports['index']=function(_0x5d834c,_0x4cf6c0){var _0x102b40={},_0x24796a={},_0xe2a4ca={'count':0x0,'rows':[]};var _0x54351c=_[_0xa222('0x38')](db[_0xa222('0x39')][_0xa222('0x3a')],function(_0x60bc35){return{'name':_0x60bc35['fieldName'],'type':_0x60bc35[_0xa222('0x3b')]['key']};});_0x24796a[_0xa222('0x3c')]=_[_0xa222('0x38')](_0x54351c,_0xa222('0x36'));_0x24796a[_0xa222('0x3d')]=_['keys'](_0x5d834c[_0xa222('0x3d')]);_0x24796a['filters']=_[_0xa222('0x3e')](_0x24796a[_0xa222('0x3c')],_0x24796a[_0xa222('0x3d')]);_0x102b40[_0xa222('0x3f')]=_[_0xa222('0x3e')](_0x24796a[_0xa222('0x3c')],qs['fields'](_0x5d834c['query'][_0xa222('0x40')]));_0x102b40['attributes']=_0x102b40[_0xa222('0x3f')][_0xa222('0x41')]?_0x102b40[_0xa222('0x3f')]:_0x24796a[_0xa222('0x3c')];if(!_0x5d834c[_0xa222('0x3d')][_0xa222('0x42')](_0xa222('0x43'))){_0x102b40[_0xa222('0x30')]=qs['limit'](_0x5d834c[_0xa222('0x3d')]['limit']);_0x102b40[_0xa222('0x2f')]=qs[_0xa222('0x2f')](_0x5d834c[_0xa222('0x3d')][_0xa222('0x2f')]);}_0x102b40['order']=qs['sort'](_0x5d834c['query'][_0xa222('0x44')]);_0x102b40[_0xa222('0x45')]=qs[_0xa222('0x46')](_['pick'](_0x5d834c['query'],_0x24796a[_0xa222('0x46')]),_0x54351c);if(_0x5d834c['query'][_0xa222('0x47')]){_0x102b40[_0xa222('0x45')]=_[_0xa222('0x48')](_0x102b40[_0xa222('0x45')],{'$or':_[_0xa222('0x38')](_0x54351c,function(_0x5eda4d){if(_0x5eda4d[_0xa222('0x3b')]!==_0xa222('0x49')){var _0x45942f={};_0x45942f[_0x5eda4d[_0xa222('0x36')]]={'$like':'%'+_0x5d834c[_0xa222('0x3d')][_0xa222('0x47')]+'%'};return _0x45942f;}})});}_0x102b40=_['merge']({},_0x102b40,_0x5d834c[_0xa222('0x4a')]);var _0x31168a={'where':_0x102b40[_0xa222('0x45')]};return db[_0xa222('0x39')][_0xa222('0x2e')](_0x31168a)[_0xa222('0x20')](function(_0x41d601){_0xe2a4ca[_0xa222('0x2e')]=_0x41d601;if(_0x5d834c[_0xa222('0x3d')][_0xa222('0x4b')]){_0x102b40[_0xa222('0x4c')]=[{'all':!![]}];}return db['ChatMessage'][_0xa222('0x4d')](_0x102b40);})[_0xa222('0x20')](function(_0xac03e4){_0xe2a4ca[_0xa222('0x4e')]=_0xac03e4;return _0xe2a4ca;})[_0xa222('0x20')](respondWithFilteredResult(_0x4cf6c0,_0x102b40))['catch'](handleError(_0x4cf6c0,null));};exports['show']=function(_0x2e6f6a,_0x1fc2a4){var _0x4812d1={'raw':!![],'where':{'id':_0x2e6f6a[_0xa222('0x4f')]['id']}},_0x208708={};_0x208708[_0xa222('0x3c')]=_['keys'](db[_0xa222('0x39')][_0xa222('0x3a')]);_0x208708[_0xa222('0x3d')]=_['keys'](_0x2e6f6a[_0xa222('0x3d')]);_0x208708[_0xa222('0x46')]=_['intersection'](_0x208708[_0xa222('0x3c')],_0x208708['query']);_0x4812d1[_0xa222('0x3f')]=_[_0xa222('0x3e')](_0x208708[_0xa222('0x3c')],qs['fields'](_0x2e6f6a[_0xa222('0x3d')]['fields']));_0x4812d1['attributes']=_0x4812d1[_0xa222('0x3f')]['length']?_0x4812d1[_0xa222('0x3f')]:_0x208708['model'];if(_0x2e6f6a[_0xa222('0x3d')][_0xa222('0x4b')]){_0x4812d1[_0xa222('0x4c')]=[{'all':!![]}];}_0x4812d1=_[_0xa222('0x48')]({},_0x4812d1,_0x2e6f6a[_0xa222('0x4a')]);return db['ChatMessage'][_0xa222('0x50')](_0x4812d1)['then'](handleEntityNotFound(_0x1fc2a4,null))['then'](respondWithResult(_0x1fc2a4,null))[_0xa222('0x29')](handleError(_0x1fc2a4,null));};exports['create']=function(_0x48c77c,_0x42c5fb){return db[_0xa222('0x39')]['create'](_0x48c77c['body'],{})['then'](respondWithResult(_0x42c5fb,0xc9))['catch'](handleError(_0x42c5fb,null));};exports[_0xa222('0x34')]=function(_0x15040e,_0x543c25){if(_0x15040e[_0xa222('0x51')]['id']){delete _0x15040e[_0xa222('0x51')]['id'];}return db['ChatMessage'][_0xa222('0x50')]({'where':{'id':_0x15040e[_0xa222('0x4f')]['id']}})['then'](handleEntityNotFound(_0x543c25,null))['then'](saveUpdates(_0x15040e['body'],null))[_0xa222('0x20')](respondWithResult(_0x543c25,null))['catch'](handleError(_0x543c25,null));};exports['destroy']=function(_0x3464ac,_0x403c0f){return db[_0xa222('0x39')][_0xa222('0x50')]({'where':{'id':_0x3464ac[_0xa222('0x4f')]['id']}})[_0xa222('0x20')](handleEntityNotFound(_0x403c0f,null))[_0xa222('0x20')](removeEntity(_0x403c0f,null))[_0xa222('0x29')](handleError(_0x403c0f,null));};exports[_0xa222('0x52')]=function(_0x2a8d5b,_0x4f054f){return db[_0xa222('0x39')][_0xa222('0x52')]()[_0xa222('0x20')](respondWithResult(_0x4f054f,null))[_0xa222('0x29')](handleError(_0x4f054f,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports[_0xa222('0x53')]=function(_0x505cd3,_0x3766cd,_0x81d05c){var _0x4533dc={'agent':{},'channel':'chat'};if(_0x505cd3['body']['id']){delete _0x505cd3[_0xa222('0x51')]['id'];}_0x505cd3[_0xa222('0x51')]['read']=!![];_0x505cd3[_0xa222('0x51')][_0xa222('0x54')]=moment()[_0xa222('0x55')](_0xa222('0x56'));_0x505cd3[_0xa222('0x51')][_0xa222('0x57')]=_0x505cd3[_0xa222('0x51')][_0xa222('0x57')]||_0x505cd3[_0xa222('0x58')]['id'];_0x4533dc[_0xa222('0x59')]['id']=_0x505cd3[_0xa222('0x51')]['UserId'];return db[_0xa222('0x39')][_0xa222('0x50')]({'where':{'id':_0x505cd3['params']['id'],'UserId':null}})[_0xa222('0x20')](handleEntityNotFound(_0x3766cd,null))['then'](saveUpdates(_0x505cd3[_0xa222('0x51')],null))[_0xa222('0x20')](function(_0x54b30d){if(_0x54b30d){_0x4533dc[_0xa222('0x26')]=_0x54b30d[_0xa222('0x5a')]({'plain':!![]});return db[_0xa222('0x5b')][_0xa222('0x50')]({'where':{'id':_0x54b30d[_0xa222('0x5c')]}});}return null;})['then'](handleEntityNotFound(_0x3766cd,null))['then'](function(_0x21191d){if(_0x21191d){return _0x21191d['update']({'UserId':_0x505cd3[_0xa222('0x51')][_0xa222('0x57')],'read1stAt':_[_0xa222('0x5d')](_0x21191d[_0xa222('0x5e')])?moment()[_0xa222('0x55')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa222('0x20')](function(_0x53dd77){if(_0x53dd77){_0x4533dc['interaction']=_0x53dd77[_0xa222('0x5a')]({'plain':!![]});interaction_log[_0xa222('0x27')](_0xa222('0x5f'),_0x505cd3[_0xa222('0x58')]['id'],_0x505cd3['user'][_0xa222('0x36')],_0x505cd3[_0xa222('0x58')][_0xa222('0x60')],_0x4533dc[_0xa222('0x61')]['id'],_0x505cd3[_0xa222('0x51')]?JSON['stringify'](_0x505cd3['body']):'null');return respondWithRpcPromise(_0xa222('0x62'),_0xa222('0x63'),_0x4533dc);}return null;})[_0xa222('0x20')](function(_0x176f26){var _0x3b4047='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x176f26['message']['ContactId'];return db[_0xa222('0x64')][_0xa222('0x3d')](_0x3b4047,{'type':db[_0xa222('0x65')][_0xa222('0x66')][_0xa222('0x67')],'raw':!![]})['then'](function(_0x35e9c1){return _0x35e9c1;});})['then'](function(_0xc64cfc){if(_0xc64cfc){_0x4533dc[_0xa222('0x26')][_0xa222('0x68')]=_0xc64cfc[0x0];if(!_0x505cd3[_0xa222('0x51')]['UserId'])return;return db[_0xa222('0x69')][_0xa222('0x50')]({'where':{'id':_0x505cd3[_0xa222('0x51')][_0xa222('0x57')],'role':'agent'},'attributes':['id',_0xa222('0x36'),_0xa222('0x6a'),'email',_0xa222('0x6b')],'raw':!![]});}return null;})['then'](function(_0x8b4dee){if(!_0x8b4dee)return null;_0x4533dc[_0xa222('0x26')][_0xa222('0x59')]=_0x8b4dee;return _0x4533dc;})[_0xa222('0x20')](function(_0x1d56df){if(_0x1d56df){if(_0x505cd3[_0xa222('0x51')][_0xa222('0x6c')]){_0x4533dc['message'][_0xa222('0x6d')]=util['format'](_0xa222('0x6e'),_0x505cd3[_0xa222('0x58')]['name']);_0x4533dc['message'][_0xa222('0x6f')]=_0x4533dc[_0xa222('0x6f')];_0x4533dc[_0xa222('0x26')][_0xa222('0x70')]=_0x4533dc['channel'];_0x4533dc['message'][_0xa222('0x71')]='accept';return respondWithRpcPromise(_0xa222('0x72'),_0xa222('0x72'),{'event':_0xa222('0x73'),'message':_[_0xa222('0x48')](_0x4533dc['message'],JSON['parse'](_0x4533dc[_0xa222('0x61')][_0xa222('0x74')]))},client9002)[_0xa222('0x20')](function(){return _0x4533dc;});}return _0x4533dc;}return null;})[_0xa222('0x20')](respondWithResult(_0x3766cd,null))[_0xa222('0x29')](handleError(_0x3766cd,null));};var interaction_log=require('../../config/logger')(_0xa222('0x75'));exports[_0xa222('0x32')]=function(_0x127c89,_0x383dca,_0x3ebba9){var _0x26a8f1={'agent':{},'channel':_0xa222('0x76')};if(_0x127c89[_0xa222('0x51')]['id']){delete _0x127c89['body']['id'];}_0x127c89[_0xa222('0x51')][_0xa222('0x57')]=_0x127c89[_0xa222('0x51')][_0xa222('0x57')]||_0x127c89['user']['id'];_0x26a8f1[_0xa222('0x59')]['id']=_0x127c89[_0xa222('0x51')]['UserId'];return db[_0xa222('0x39')][_0xa222('0x50')]({'where':{'id':_0x127c89[_0xa222('0x4f')]['id'],'UserId':null}})[_0xa222('0x20')](handleEntityNotFound(_0x383dca,null))[_0xa222('0x20')](function(_0x2bc459){if(_0x2bc459){_0x26a8f1[_0xa222('0x26')]=_0x2bc459[_0xa222('0x5a')]({'plain':!![]});return db[_0xa222('0x5b')][_0xa222('0x50')]({'where':{'id':_0x2bc459['ChatInteractionId']}});}return null;})[_0xa222('0x20')](handleEntityNotFound(_0x383dca,null))['then'](function(_0x1b9d7d){if(_0x1b9d7d){_0x26a8f1[_0xa222('0x61')]=_0x1b9d7d[_0xa222('0x5a')]({'plain':!![]});interaction_log[_0xa222('0x27')](_0xa222('0x77'),_0x127c89['user']['id'],_0x127c89[_0xa222('0x58')][_0xa222('0x36')],_0x127c89[_0xa222('0x58')][_0xa222('0x60')],_0x26a8f1[_0xa222('0x61')]['id'],_0x127c89['body']?JSON['stringify'](_0x127c89['body']):_0xa222('0x78'));return respondWithRpcPromise(_0xa222('0x79'),_0xa222('0x7a'),_0x26a8f1);}return null;})[_0xa222('0x20')](function(_0x274dd4){var _0x215749='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x274dd4['message'][_0xa222('0x7b')];return db[_0xa222('0x64')][_0xa222('0x3d')](_0x215749,{'type':db[_0xa222('0x65')][_0xa222('0x66')][_0xa222('0x67')],'raw':!![]})[_0xa222('0x20')](function(_0x527a2f){return _0x527a2f;});})[_0xa222('0x20')](function(_0x317842){if(_0x317842){_0x26a8f1['message'][_0xa222('0x68')]=_0x317842[0x0];if(!_0x127c89[_0xa222('0x51')][_0xa222('0x57')])return;return db['User'][_0xa222('0x50')]({'where':{'id':_0x127c89['body'][_0xa222('0x57')],'role':_0xa222('0x59')},'attributes':['id','name',_0xa222('0x6a'),_0xa222('0x7c'),_0xa222('0x6b')],'raw':!![]});}return null;})[_0xa222('0x20')](function(_0x3d1de5){if(!_0x3d1de5)return null;_0x26a8f1[_0xa222('0x26')][_0xa222('0x59')]=_0x3d1de5;return _0x26a8f1;})['then'](function(_0x265974){if(_0x265974){_0x265974[_0xa222('0x26')]['interface']=util['format'](_0xa222('0x6e'),_0x127c89[_0xa222('0x58')][_0xa222('0x36')]);_0x265974[_0xa222('0x26')][_0xa222('0x6f')]=_0x26a8f1[_0xa222('0x6f')];_0x265974['message'][_0xa222('0x70')]=_0x26a8f1['channel'];_0x265974[_0xa222('0x26')][_0xa222('0x71')]=_0xa222('0x32');respondWithRpcPromise(_0xa222('0x72'),'EventManager',{'event':_0xa222('0x7d'),'message':_[_0xa222('0x48')](_0x26a8f1[_0xa222('0x26')],JSON[_0xa222('0x7e')](_0x26a8f1[_0xa222('0x61')][_0xa222('0x74')]))},client9002);return _0x26a8f1;}return null;})[_0xa222('0x20')](respondWithResult(_0x383dca,null))['catch'](handleError(_0x383dca,null));};
\ No newline at end of file
+var _0x515b=['reject','save','update','destroy','stack','send','index','map','ChatMessage','rawAttributes','fieldName','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','chat-interactions','accept','chat','read','readAt','format','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','null','AcceptMessage','acceptMessage','SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20','ContactId','Sequelize','SELECT','contact','User','agent','fullname','email','internal','interface','SIP/%s','channel','motionChannel','event','EventManager','acceptmessage','parse','formData','role','RejectMessage','sequelize','QueryTypes','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/license/util','../../mysqldb','redis','defaults','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','undefined','limit','count','offset','Content-Range','json','apply'];(function(_0x62f344,_0x204659){var _0x34f3ef=function(_0x196c82){while(--_0x196c82){_0x62f344['push'](_0x62f344['shift']());}};_0x34f3ef(++_0x204659);}(_0x515b,0x15f));var _0xb515=function(_0x119f29,_0x5a6e3d){_0x119f29=_0x119f29-0x0;var _0x379dff=_0x515b[_0x119f29];return _0x379dff;};'use strict';var emlformat=require(_0xb515('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb515('0x1'));var rp=require('request-promise');var moment=require(_0xb515('0x2'));var BPromise=require(_0xb515('0x3'));var Mustache=require(_0xb515('0x4'));var util=require(_0xb515('0x5'));var path=require(_0xb515('0x6'));var sox=require(_0xb515('0x7'));var csv=require(_0xb515('0x8'));var ejs=require(_0xb515('0x9'));var fs=require('fs');var fs_extra=require(_0xb515('0xa'));var _=require(_0xb515('0xb'));var squel=require(_0xb515('0xc'));var crypto=require(_0xb515('0xd'));var jsforce=require(_0xb515('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb515('0x8'));var querystring=require(_0xb515('0xf'));var Papa=require(_0xb515('0x10'));var Redis=require(_0xb515('0x11'));var authService=require(_0xb515('0x12'));var qs=require(_0xb515('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb515('0x14'));var logger=require(_0xb515('0x15'))(_0xb515('0x16'));var utils=require(_0xb515('0x17'));var config=require('../../config/environment');var licenseUtil=require(_0xb515('0x18'));var db=require(_0xb515('0x19'))['db'];config[_0xb515('0x1a')]=_[_0xb515('0x1b')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xb515('0x1c'))(new Redis(config[_0xb515('0x1a')]));require(_0xb515('0x1d'))[_0xb515('0x1e')](socket);var jayson=require(_0xb515('0x1f'));var client=jayson[_0xb515('0x20')][_0xb515('0x21')]({'port':0x232c});var client9002=jayson['client'][_0xb515('0x21')]({'port':0x232a});function respondWithRpcPromise(_0xfb5f9c,_0x5f04c2,_0xbbf598,_0x86dbc1){return new BPromise(function(_0x8f3eaa,_0x381b43){var _0x26e774=_0x86dbc1||client;return _0x26e774[_0xb515('0x22')](_0xfb5f9c,_0xbbf598)[_0xb515('0x23')](function(_0x3c565b){logger[_0xb515('0x24')](_0xb515('0x25'),_0x5f04c2,_0xb515('0x26'));logger[_0xb515('0x27')](_0xb515('0x28'),_0x5f04c2,_0xb515('0x26'),JSON[_0xb515('0x29')](_0x3c565b));if(_0x3c565b[_0xb515('0x2a')]){if(_0x3c565b[_0xb515('0x2a')][_0xb515('0x2b')]===0x1f4){logger[_0xb515('0x2a')](_0xb515('0x25'),_0x5f04c2,_0x3c565b[_0xb515('0x2a')][_0xb515('0x2c')]);return _0x381b43(_0x3c565b['error'][_0xb515('0x2c')]);}logger[_0xb515('0x2a')]('ChatMessage,\x20%s,\x20%s',_0x5f04c2,_0x3c565b[_0xb515('0x2a')][_0xb515('0x2c')]);return _0x8f3eaa(_0x3c565b[_0xb515('0x2a')][_0xb515('0x2c')]);}else{logger[_0xb515('0x24')](_0xb515('0x25'),_0x5f04c2,_0xb515('0x26'));_0x8f3eaa(_0x3c565b[_0xb515('0x2d')][_0xb515('0x2c')]);}})[_0xb515('0x2e')](function(_0x3614c0){logger[_0xb515('0x2a')](_0xb515('0x25'),_0x5f04c2,_0x3614c0);_0x381b43(_0x3614c0);});});}function respondWithStatusCode(_0x135f61,_0x225fb7){_0x225fb7=_0x225fb7||0xcc;return function(_0x1021f1){if(_0x1021f1){return _0x135f61[_0xb515('0x2f')](_0x225fb7);}return _0x135f61[_0xb515('0x30')](_0x225fb7)[_0xb515('0x31')]();};}function respondWithResult(_0x1df818,_0xb3ae71){_0xb3ae71=_0xb3ae71||0xc8;return function(_0xcbe5d3){if(_0xcbe5d3){return _0x1df818['status'](_0xb3ae71)['json'](_0xcbe5d3);}};}function respondWithFilteredResult(_0x2fdcb2,_0x52c372){return function(_0x4dc9d1){if(_0x4dc9d1){var _0x3db492=typeof _0x52c372['offset']===_0xb515('0x32')&&typeof _0x52c372[_0xb515('0x33')]===_0xb515('0x32');var _0x195229=_0x4dc9d1[_0xb515('0x34')];var _0x16dfad=_0x3db492?0x0:_0x52c372[_0xb515('0x35')];var _0x37d4a6=_0x3db492?_0x4dc9d1[_0xb515('0x34')]:_0x52c372[_0xb515('0x35')]+_0x52c372[_0xb515('0x33')];var _0x12bc91;if(_0x37d4a6>=_0x195229){_0x37d4a6=_0x195229;_0x12bc91=0xc8;}else{_0x12bc91=0xce;}_0x2fdcb2[_0xb515('0x30')](_0x12bc91);return _0x2fdcb2['set'](_0xb515('0x36'),_0x16dfad+'-'+_0x37d4a6+'/'+_0x195229)[_0xb515('0x37')](_0x4dc9d1);}return null;};}function patchUpdates(_0x563d71){return function(_0x520201){try{jsonpatch[_0xb515('0x38')](_0x520201,_0x563d71,!![]);}catch(_0x24a120){return BPromise[_0xb515('0x39')](_0x24a120);}return _0x520201[_0xb515('0x3a')]();};}function saveUpdates(_0x1c874f,_0xf4239e){return function(_0x128058){if(_0x128058){return _0x128058[_0xb515('0x3b')](_0x1c874f)[_0xb515('0x23')](function(_0x116448){return _0x116448;});}return null;};}function removeEntity(_0x199f7d,_0x4bf5c7){return function(_0x45b2d8){if(_0x45b2d8){return _0x45b2d8[_0xb515('0x3c')]()[_0xb515('0x23')](function(){_0x199f7d[_0xb515('0x30')](0xcc)[_0xb515('0x31')]();});}};}function handleEntityNotFound(_0x3ec414,_0x1f3efe){return function(_0x3a8c75){if(!_0x3a8c75){_0x3ec414[_0xb515('0x2f')](0x194);}return _0x3a8c75;};}function handleError(_0x5eec6f,_0x536b1d){_0x536b1d=_0x536b1d||0x1f4;return function(_0x7be13d){logger[_0xb515('0x2a')](_0x7be13d[_0xb515('0x3d')]);if(_0x7be13d['name']){delete _0x7be13d['name'];}_0x5eec6f[_0xb515('0x30')](_0x536b1d)[_0xb515('0x3e')](_0x7be13d);};}exports[_0xb515('0x3f')]=function(_0x8cc710,_0x58310c){var _0x5b4be4={},_0xc660b0={},_0x31d8bf={'count':0x0,'rows':[]};var _0x73080c=_[_0xb515('0x40')](db[_0xb515('0x41')][_0xb515('0x42')],function(_0x51d397){return{'name':_0x51d397[_0xb515('0x43')],'type':_0x51d397['type'][_0xb515('0x44')]};});_0xc660b0[_0xb515('0x45')]=_[_0xb515('0x40')](_0x73080c,_0xb515('0x46'));_0xc660b0[_0xb515('0x47')]=_[_0xb515('0x48')](_0x8cc710[_0xb515('0x47')]);_0xc660b0[_0xb515('0x49')]=_[_0xb515('0x4a')](_0xc660b0[_0xb515('0x45')],_0xc660b0['query']);_0x5b4be4[_0xb515('0x4b')]=_[_0xb515('0x4a')](_0xc660b0[_0xb515('0x45')],qs[_0xb515('0x4c')](_0x8cc710['query'][_0xb515('0x4c')]));_0x5b4be4[_0xb515('0x4b')]=_0x5b4be4[_0xb515('0x4b')][_0xb515('0x4d')]?_0x5b4be4['attributes']:_0xc660b0[_0xb515('0x45')];if(!_0x8cc710['query'][_0xb515('0x4e')](_0xb515('0x4f'))){_0x5b4be4[_0xb515('0x33')]=qs[_0xb515('0x33')](_0x8cc710[_0xb515('0x47')][_0xb515('0x33')]);_0x5b4be4[_0xb515('0x35')]=qs[_0xb515('0x35')](_0x8cc710[_0xb515('0x47')][_0xb515('0x35')]);}_0x5b4be4['order']=qs[_0xb515('0x50')](_0x8cc710[_0xb515('0x47')][_0xb515('0x50')]);_0x5b4be4[_0xb515('0x51')]=qs[_0xb515('0x49')](_['pick'](_0x8cc710[_0xb515('0x47')],_0xc660b0[_0xb515('0x49')]),_0x73080c);if(_0x8cc710[_0xb515('0x47')][_0xb515('0x52')]){_0x5b4be4['where']=_[_0xb515('0x53')](_0x5b4be4[_0xb515('0x51')],{'$or':_[_0xb515('0x40')](_0x73080c,function(_0x8bb283){if(_0x8bb283['type']!==_0xb515('0x54')){var _0xed3bce={};_0xed3bce[_0x8bb283[_0xb515('0x46')]]={'$like':'%'+_0x8cc710[_0xb515('0x47')][_0xb515('0x52')]+'%'};return _0xed3bce;}})});}_0x5b4be4=_['merge']({},_0x5b4be4,_0x8cc710[_0xb515('0x55')]);var _0x2fa17c={'where':_0x5b4be4['where']};return db['ChatMessage'][_0xb515('0x34')](_0x2fa17c)['then'](function(_0xbdc9e7){_0x31d8bf[_0xb515('0x34')]=_0xbdc9e7;if(_0x8cc710[_0xb515('0x47')][_0xb515('0x56')]){_0x5b4be4[_0xb515('0x57')]=[{'all':!![]}];}return db[_0xb515('0x41')][_0xb515('0x58')](_0x5b4be4);})[_0xb515('0x23')](function(_0x147943){_0x31d8bf[_0xb515('0x59')]=_0x147943;return _0x31d8bf;})[_0xb515('0x23')](respondWithFilteredResult(_0x58310c,_0x5b4be4))[_0xb515('0x2e')](handleError(_0x58310c,null));};exports[_0xb515('0x5a')]=function(_0x31f0ee,_0x543cac){var _0x1e6180={'raw':!![],'where':{'id':_0x31f0ee[_0xb515('0x5b')]['id']}},_0x37a2d1={};_0x37a2d1['model']=_[_0xb515('0x48')](db[_0xb515('0x41')][_0xb515('0x42')]);_0x37a2d1[_0xb515('0x47')]=_[_0xb515('0x48')](_0x31f0ee[_0xb515('0x47')]);_0x37a2d1[_0xb515('0x49')]=_[_0xb515('0x4a')](_0x37a2d1[_0xb515('0x45')],_0x37a2d1['query']);_0x1e6180[_0xb515('0x4b')]=_[_0xb515('0x4a')](_0x37a2d1['model'],qs[_0xb515('0x4c')](_0x31f0ee[_0xb515('0x47')][_0xb515('0x4c')]));_0x1e6180['attributes']=_0x1e6180[_0xb515('0x4b')][_0xb515('0x4d')]?_0x1e6180[_0xb515('0x4b')]:_0x37a2d1[_0xb515('0x45')];if(_0x31f0ee[_0xb515('0x47')][_0xb515('0x56')]){_0x1e6180[_0xb515('0x57')]=[{'all':!![]}];}_0x1e6180=_[_0xb515('0x53')]({},_0x1e6180,_0x31f0ee[_0xb515('0x55')]);return db[_0xb515('0x41')]['find'](_0x1e6180)['then'](handleEntityNotFound(_0x543cac,null))['then'](respondWithResult(_0x543cac,null))[_0xb515('0x2e')](handleError(_0x543cac,null));};exports[_0xb515('0x5c')]=function(_0x2b3fb4,_0x25ea43){return db[_0xb515('0x41')][_0xb515('0x5c')](_0x2b3fb4[_0xb515('0x5d')],{})['then'](respondWithResult(_0x25ea43,0xc9))['catch'](handleError(_0x25ea43,null));};exports['update']=function(_0x4d2372,_0x5789be){if(_0x4d2372[_0xb515('0x5d')]['id']){delete _0x4d2372[_0xb515('0x5d')]['id'];}return db[_0xb515('0x41')][_0xb515('0x5e')]({'where':{'id':_0x4d2372['params']['id']}})[_0xb515('0x23')](handleEntityNotFound(_0x5789be,null))['then'](saveUpdates(_0x4d2372[_0xb515('0x5d')],null))[_0xb515('0x23')](respondWithResult(_0x5789be,null))[_0xb515('0x2e')](handleError(_0x5789be,null));};exports[_0xb515('0x3c')]=function(_0x5e5fbb,_0x3aae48){return db[_0xb515('0x41')][_0xb515('0x5e')]({'where':{'id':_0x5e5fbb[_0xb515('0x5b')]['id']}})[_0xb515('0x23')](handleEntityNotFound(_0x3aae48,null))['then'](removeEntity(_0x3aae48,null))[_0xb515('0x2e')](handleError(_0x3aae48,null));};exports[_0xb515('0x5f')]=function(_0x570101,_0x2e3323){return db[_0xb515('0x41')][_0xb515('0x5f')]()[_0xb515('0x23')](respondWithResult(_0x2e3323,null))[_0xb515('0x2e')](handleError(_0x2e3323,null));};var interaction_log=require(_0xb515('0x15'))(_0xb515('0x60'));exports[_0xb515('0x61')]=function(_0x5ec8e0,_0x3523dd,_0x458d1d){var _0xb5ce14={'agent':{},'channel':_0xb515('0x62')};if(_0x5ec8e0[_0xb515('0x5d')]['id']){delete _0x5ec8e0[_0xb515('0x5d')]['id'];}_0x5ec8e0['body'][_0xb515('0x63')]=!![];_0x5ec8e0[_0xb515('0x5d')][_0xb515('0x64')]=moment()[_0xb515('0x65')]('YYYY-MM-DD\x20HH:mm:ss');_0x5ec8e0[_0xb515('0x5d')][_0xb515('0x66')]=_0x5ec8e0['body'][_0xb515('0x66')]||_0x5ec8e0[_0xb515('0x67')]['id'];_0xb5ce14['agent']['id']=_0x5ec8e0[_0xb515('0x5d')][_0xb515('0x66')];return db[_0xb515('0x41')][_0xb515('0x5e')]({'where':{'id':_0x5ec8e0['params']['id'],'UserId':null}})[_0xb515('0x23')](handleEntityNotFound(_0x3523dd,null))['then'](saveUpdates(_0x5ec8e0[_0xb515('0x5d')],null))[_0xb515('0x23')](function(_0x49aafa){if(_0x49aafa){_0xb5ce14[_0xb515('0x2c')]=_0x49aafa[_0xb515('0x68')]({'plain':!![]});return db[_0xb515('0x69')][_0xb515('0x5e')]({'where':{'id':_0x49aafa[_0xb515('0x6a')]}});}return null;})[_0xb515('0x23')](handleEntityNotFound(_0x3523dd,null))[_0xb515('0x23')](function(_0x19a2ef){if(_0x19a2ef){return _0x19a2ef[_0xb515('0x3b')]({'UserId':_0x5ec8e0[_0xb515('0x5d')][_0xb515('0x66')],'read1stAt':_[_0xb515('0x6b')](_0x19a2ef[_0xb515('0x6c')])?moment()[_0xb515('0x65')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xb515('0x23')](function(_0x5afd08){if(_0x5afd08){_0xb5ce14[_0xb515('0x6d')]=_0x5afd08[_0xb515('0x68')]({'plain':!![]});interaction_log[_0xb515('0x24')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5ec8e0[_0xb515('0x67')]['id'],_0x5ec8e0[_0xb515('0x67')][_0xb515('0x46')],_0x5ec8e0[_0xb515('0x67')]['role'],_0xb5ce14[_0xb515('0x6d')]['id'],_0x5ec8e0[_0xb515('0x5d')]?JSON['stringify'](_0x5ec8e0[_0xb515('0x5d')]):_0xb515('0x6e'));return respondWithRpcPromise(_0xb515('0x6f'),_0xb515('0x70'),_0xb5ce14);}return null;})['then'](function(_0x2a36e3){var _0x127cb9=_0xb515('0x71')+_0x2a36e3[_0xb515('0x2c')][_0xb515('0x72')];return db['sequelize'][_0xb515('0x47')](_0x127cb9,{'type':db[_0xb515('0x73')]['QueryTypes'][_0xb515('0x74')],'raw':!![]})[_0xb515('0x23')](function(_0xe802b1){return _0xe802b1;});})[_0xb515('0x23')](function(_0x1bbaa7){if(_0x1bbaa7){_0xb5ce14[_0xb515('0x2c')][_0xb515('0x75')]=_0x1bbaa7[0x0];if(!_0x5ec8e0[_0xb515('0x5d')][_0xb515('0x66')])return;return db[_0xb515('0x76')][_0xb515('0x5e')]({'where':{'id':_0x5ec8e0[_0xb515('0x5d')][_0xb515('0x66')],'role':_0xb515('0x77')},'attributes':['id',_0xb515('0x46'),_0xb515('0x78'),_0xb515('0x79'),_0xb515('0x7a')],'raw':!![]});}return null;})[_0xb515('0x23')](function(_0x210faf){if(!_0x210faf)return null;_0xb5ce14[_0xb515('0x2c')][_0xb515('0x77')]=_0x210faf;return _0xb5ce14;})['then'](function(_0x2262a5){if(_0x2262a5){if(_0x5ec8e0[_0xb515('0x5d')]['manual']){_0xb5ce14[_0xb515('0x2c')][_0xb515('0x7b')]=util[_0xb515('0x65')](_0xb515('0x7c'),_0x5ec8e0[_0xb515('0x67')][_0xb515('0x46')]);_0xb5ce14[_0xb515('0x2c')][_0xb515('0x7d')]=_0xb5ce14[_0xb515('0x7d')];_0xb5ce14[_0xb515('0x2c')][_0xb515('0x7e')]=_0xb5ce14['channel'];_0xb5ce14['message'][_0xb515('0x7f')]=_0xb515('0x61');return respondWithRpcPromise(_0xb515('0x80'),'EventManager',{'event':_0xb515('0x81'),'message':_['merge'](_0xb5ce14[_0xb515('0x2c')],JSON[_0xb515('0x82')](_0xb5ce14[_0xb515('0x6d')][_0xb515('0x83')]))},client9002)[_0xb515('0x23')](function(){return _0xb5ce14;});}return _0xb5ce14;}return null;})[_0xb515('0x23')](respondWithResult(_0x3523dd,null))[_0xb515('0x2e')](handleError(_0x3523dd,null));};var interaction_log=require(_0xb515('0x15'))(_0xb515('0x60'));exports[_0xb515('0x39')]=function(_0x431e3f,_0x15cfa0,_0x5423c7){var _0x1e4609={'agent':{},'channel':_0xb515('0x62')};if(_0x431e3f[_0xb515('0x5d')]['id']){delete _0x431e3f[_0xb515('0x5d')]['id'];}_0x431e3f[_0xb515('0x5d')][_0xb515('0x66')]=_0x431e3f[_0xb515('0x5d')][_0xb515('0x66')]||_0x431e3f[_0xb515('0x67')]['id'];_0x1e4609[_0xb515('0x77')]['id']=_0x431e3f[_0xb515('0x5d')][_0xb515('0x66')];return db[_0xb515('0x41')][_0xb515('0x5e')]({'where':{'id':_0x431e3f[_0xb515('0x5b')]['id'],'UserId':null}})[_0xb515('0x23')](handleEntityNotFound(_0x15cfa0,null))[_0xb515('0x23')](function(_0x5ed91b){if(_0x5ed91b){_0x1e4609['message']=_0x5ed91b['get']({'plain':!![]});return db['ChatInteraction'][_0xb515('0x5e')]({'where':{'id':_0x5ed91b[_0xb515('0x6a')]}});}return null;})[_0xb515('0x23')](handleEntityNotFound(_0x15cfa0,null))['then'](function(_0x59802a){if(_0x59802a){_0x1e4609[_0xb515('0x6d')]=_0x59802a[_0xb515('0x68')]({'plain':!![]});interaction_log['info']('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x431e3f[_0xb515('0x67')]['id'],_0x431e3f['user'][_0xb515('0x46')],_0x431e3f[_0xb515('0x67')][_0xb515('0x84')],_0x1e4609[_0xb515('0x6d')]['id'],_0x431e3f[_0xb515('0x5d')]?JSON[_0xb515('0x29')](_0x431e3f[_0xb515('0x5d')]):_0xb515('0x6e'));return respondWithRpcPromise(_0xb515('0x85'),'rejectMessage',_0x1e4609);}return null;})[_0xb515('0x23')](function(_0x2cbb47){var _0x1c337c='SELECT\x20*\x20FROM\x20cm_contacts\x20WHERE\x20id\x20=\x20'+_0x2cbb47[_0xb515('0x2c')][_0xb515('0x72')];return db[_0xb515('0x86')]['query'](_0x1c337c,{'type':db[_0xb515('0x73')][_0xb515('0x87')]['SELECT'],'raw':!![]})[_0xb515('0x23')](function(_0x4e59fc){return _0x4e59fc;});})[_0xb515('0x23')](function(_0x2edb51){if(_0x2edb51){_0x1e4609[_0xb515('0x2c')]['contact']=_0x2edb51[0x0];if(!_0x431e3f[_0xb515('0x5d')][_0xb515('0x66')])return;return db[_0xb515('0x76')][_0xb515('0x5e')]({'where':{'id':_0x431e3f[_0xb515('0x5d')][_0xb515('0x66')],'role':_0xb515('0x77')},'attributes':['id','name',_0xb515('0x78'),'email',_0xb515('0x7a')],'raw':!![]});}return null;})[_0xb515('0x23')](function(_0x357d78){if(!_0x357d78)return null;_0x1e4609[_0xb515('0x2c')]['agent']=_0x357d78;return _0x1e4609;})[_0xb515('0x23')](function(_0x44c178){if(_0x44c178){_0x44c178[_0xb515('0x2c')][_0xb515('0x7b')]=util[_0xb515('0x65')](_0xb515('0x7c'),_0x431e3f[_0xb515('0x67')][_0xb515('0x46')]);_0x44c178['message'][_0xb515('0x7d')]=_0x1e4609['channel'];_0x44c178[_0xb515('0x2c')][_0xb515('0x7e')]=_0x1e4609[_0xb515('0x7d')];_0x44c178[_0xb515('0x2c')]['event']=_0xb515('0x39');respondWithRpcPromise(_0xb515('0x80'),_0xb515('0x80'),{'event':'rejectmessage','message':_[_0xb515('0x53')](_0x1e4609[_0xb515('0x2c')],JSON[_0xb515('0x82')](_0x1e4609[_0xb515('0x6d')][_0xb515('0x83')]))},client9002);return _0x1e4609;}return null;})[_0xb515('0x23')](respondWithResult(_0x15cfa0,null))['catch'](handleError(_0x15cfa0,null));};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js
index 47f3ae3..ca2a8f9 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 _0xa8fa=['events','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x55841f,_0x487812){var _0x4c5ccf=function(_0x2ce694){while(--_0x2ce694){_0x55841f['push'](_0x55841f['shift']());}};_0x4c5ccf(++_0x487812);}(_0xa8fa,0xe0));var _0xaa8f=function(_0x34886e,_0x399679){_0x34886e=_0x34886e-0x0;var _0x5bc3fb=_0xa8fa[_0x34886e];return _0x5bc3fb;};'use strict';var EventEmitter=require(_0xaa8f('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0xaa8f('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0xaa8f('0x2')](0x0);var events={'afterCreate':_0xaa8f('0x3'),'afterUpdate':'update','afterDestroy':_0xaa8f('0x4')};function emitEvent(_0xb272a4){return function(_0x4b0245,_0x536403,_0x4a35c8){ChatMessageEvents[_0xaa8f('0x5')](_0xb272a4+':'+_0x4b0245['id'],_0x4b0245);ChatMessageEvents[_0xaa8f('0x5')](_0xb272a4,_0x4b0245);_0x4a35c8(null);};}for(var e in events){if(events[_0xaa8f('0x6')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module['exports']=ChatMessageEvents;
\ No newline at end of file
+var _0xd3fc=['../../mysqldb','ChatMessage','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x456751,_0x5452fb){var _0x1e1046=function(_0x573591){while(--_0x573591){_0x456751['push'](_0x456751['shift']());}};_0x1e1046(++_0x5452fb);}(_0xd3fc,0x1a3));var _0xcd3f=function(_0x4e496e,_0x5dce30){_0x4e496e=_0x4e496e-0x0;var _0x11a798=_0xd3fc[_0x4e496e];return _0x11a798;};'use strict';var EventEmitter=require(_0xcd3f('0x0'));var ChatMessage=require(_0xcd3f('0x1'))['db'][_0xcd3f('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xcd3f('0x3'),'afterUpdate':_0xcd3f('0x4'),'afterDestroy':_0xcd3f('0x5')};function emitEvent(_0xd3a7dc){return function(_0x223659,_0x419532,_0x4a72dd){ChatMessageEvents[_0xcd3f('0x6')](_0xd3a7dc+':'+_0x223659['id'],_0x223659);ChatMessageEvents[_0xcd3f('0x6')](_0xd3a7dc,_0x223659);_0x4a72dd(null);};}for(var e in events){if(events[_0xcd3f('0x7')](e)){var event=events[e];ChatMessage[_0xcd3f('0x8')](e,emitEvent(event));}}module[_0xcd3f('0x9')]=ChatMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js
index 403319c..dd7301c 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 _0x650f=['error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','define','chat_messages','body','FULLTEXT','models','get','toLowerCase','direction','out','secret','isNil','UserId','ChatInteraction','ChatInteractionId','then','update','catch'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x650f,0x1d3));var _0xf650=function(_0x493552,_0x2cd527){_0x493552=_0x493552-0x0;var _0x243ea8=_0x650f[_0x493552];return _0x243ea8;};'use strict';var _=require(_0xf650('0x0'));var util=require('util');var logger=require(_0xf650('0x1'))(_0xf650('0x2'));var moment=require('moment');var BPromise=require(_0xf650('0x3'));var rp=require(_0xf650('0x4'));var fs=require('fs');var path=require(_0xf650('0x5'));var rimraf=require(_0xf650('0x6'));var config=require(_0xf650('0x7'));var attributes=require(_0xf650('0x8'));module['exports']=function(_0x37933c,_0x61f4c5){return _0x37933c[_0xf650('0x9')]('ChatMessage',attributes,{'tableName':_0xf650('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0xf650('0xb')],'type':_0xf650('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x57d6ac,_0x2b5c99,_0x513ae2){var _0x4abda4=_0x37933c[_0xf650('0xd')];var _0x128715=_0x57d6ac[_0xf650('0xe')]({'plain':!![]});if(_0x128715['direction'][_0xf650('0xf')]()==='in'||_0x128715[_0xf650('0x10')][_0xf650('0xf')]()===_0xf650('0x11')&&!_0x128715[_0xf650('0x12')]&&!_[_0xf650('0x13')](_0x128715[_0xf650('0x14')])){_0x4abda4[_0xf650('0x15')]['findOne']({'where':{'id':_0x128715[_0xf650('0x16')]}})[_0xf650('0x17')](function(_0x3e56d4){if(_0x3e56d4){_0x3e56d4[_0xf650('0x18')]({'lastMsgAt':_0x128715['createdAt'],'lastMsgDirection':_0x128715[_0xf650('0x10')][_0xf650('0xf')]()});}})[_0xf650('0x19')](function(_0x412963){console[_0xf650('0x1a')](_0x412963);});}_0x513ae2();}},'charset':_0xf650('0x1b'),'collate':_0xf650('0x1c')});};
\ No newline at end of file
+var _0xdccb=['catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./chatMessage.attributes','exports','define','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','findOne','ChatInteractionId','then','update','createdAt'];(function(_0x4efece,_0xfb649){var _0x584d70=function(_0x35263e){while(--_0x35263e){_0x4efece['push'](_0x4efece['shift']());}};_0x584d70(++_0xfb649);}(_0xdccb,0x16c));var _0xbdcc=function(_0x5c0a75,_0x146776){_0x5c0a75=_0x5c0a75-0x0;var _0x710f79=_0xdccb[_0x5c0a75];return _0x710f79;};'use strict';var _=require(_0xbdcc('0x0'));var util=require(_0xbdcc('0x1'));var logger=require(_0xbdcc('0x2'))(_0xbdcc('0x3'));var moment=require(_0xbdcc('0x4'));var BPromise=require('bluebird');var rp=require(_0xbdcc('0x5'));var fs=require('fs');var path=require(_0xbdcc('0x6'));var rimraf=require('rimraf');var config=require(_0xbdcc('0x7'));var attributes=require(_0xbdcc('0x8'));module[_0xbdcc('0x9')]=function(_0x39205b,_0x411551){return _0x39205b[_0xbdcc('0xa')](_0xbdcc('0xb'),attributes,{'tableName':_0xbdcc('0xc'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0xbdcc('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5e9010,_0x502065,_0x55913a){var _0x52a985=_0x39205b[_0xbdcc('0xe')];var _0x9b31ea=_0x5e9010[_0xbdcc('0xf')]({'plain':!![]});if(_0x9b31ea[_0xbdcc('0x10')]['toLowerCase']()==='in'||_0x9b31ea[_0xbdcc('0x10')][_0xbdcc('0x11')]()===_0xbdcc('0x12')&&!_0x9b31ea[_0xbdcc('0x13')]&&!_['isNil'](_0x9b31ea[_0xbdcc('0x14')])){_0x52a985['ChatInteraction'][_0xbdcc('0x15')]({'where':{'id':_0x9b31ea[_0xbdcc('0x16')]}})[_0xbdcc('0x17')](function(_0x23f036){if(_0x23f036){_0x23f036[_0xbdcc('0x18')]({'lastMsgAt':_0x9b31ea[_0xbdcc('0x19')],'lastMsgDirection':_0x9b31ea[_0xbdcc('0x10')][_0xbdcc('0x11')]()});}})[_0xbdcc('0x1a')](function(_0x2d22dd){console[_0xbdcc('0x1b')](_0x2d22dd);});}_0x55913a();}},'charset':_0xbdcc('0x1c'),'collate':_0xbdcc('0x1d')});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js
index 6eae3fd..46ed535 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 _0x1c22=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','./chatMessage.socket','register','request','then','ChatMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','info','result','catch','CreateChatMessage','create','body','options','util','moment'];(function(_0x1b96ae,_0x11cd19){var _0x394985=function(_0x581c14){while(--_0x581c14){_0x1b96ae['push'](_0x1b96ae['shift']());}};_0x394985(++_0x11cd19);}(_0x1c22,0x1ed));var _0x21c2=function(_0x20eb13,_0x356f48){_0x20eb13=_0x20eb13-0x0;var _0x571fdb=_0x1c22[_0x20eb13];return _0x571fdb;};'use strict';var _=require('lodash');var util=require(_0x21c2('0x0'));var moment=require(_0x21c2('0x1'));var BPromise=require(_0x21c2('0x2'));var rs=require(_0x21c2('0x3'));var fs=require('fs');var Redis=require(_0x21c2('0x4'));var db=require(_0x21c2('0x5'))['db'];var utils=require(_0x21c2('0x6'));var logger=require(_0x21c2('0x7'))(_0x21c2('0x8'));var config=require(_0x21c2('0x9'));var jayson=require(_0x21c2('0xa'));var client=jayson[_0x21c2('0xb')][_0x21c2('0xc')]({'port':0x232a});config['redis']=_['defaults'](config[_0x21c2('0xd')],{'host':_0x21c2('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x21c2('0xd')]));require(_0x21c2('0xf'))[_0x21c2('0x10')](socket);function respondWithRpcPromise(_0x5c68a7,_0x27493c,_0x3c1262){return new BPromise(function(_0x6b955f,_0x388a47){return client[_0x21c2('0x11')](_0x5c68a7,_0x3c1262)[_0x21c2('0x12')](function(_0xbca2ac){logger['info']('ChatMessage,\x20%s,\x20%s',_0x27493c,'request\x20sent');logger['debug'](_0x21c2('0x13'),_0x27493c,_0x21c2('0x14'),JSON[_0x21c2('0x15')](_0xbca2ac));if(_0xbca2ac[_0x21c2('0x16')]){if(_0xbca2ac['error'][_0x21c2('0x17')]===0x1f4){logger[_0x21c2('0x16')](_0x21c2('0x18'),_0x27493c,_0xbca2ac[_0x21c2('0x16')][_0x21c2('0x19')]);return _0x388a47(_0xbca2ac[_0x21c2('0x16')][_0x21c2('0x19')]);}logger[_0x21c2('0x16')](_0x21c2('0x18'),_0x27493c,_0xbca2ac[_0x21c2('0x16')][_0x21c2('0x19')]);return _0x6b955f(_0xbca2ac[_0x21c2('0x16')][_0x21c2('0x19')]);}else{logger[_0x21c2('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x27493c,_0x21c2('0x14'));_0x6b955f(_0xbca2ac[_0x21c2('0x1b')][_0x21c2('0x19')]);}})[_0x21c2('0x1c')](function(_0x400383){logger[_0x21c2('0x16')](_0x21c2('0x18'),_0x27493c,_0x400383);_0x388a47(_0x400383);});});}exports[_0x21c2('0x1d')]=function(_0x406559){var _0x894e78=this;return new Promise(function(_0x66df72,_0x2c58fa){return db['ChatMessage'][_0x21c2('0x1e')](_0x406559[_0x21c2('0x1f')],{'raw':_0x406559[_0x21c2('0x20')]?_0x406559[_0x21c2('0x20')]['raw']===undefined?!![]:![]:!![]})[_0x21c2('0x12')](function(_0xb59c0c){logger[_0x21c2('0x1a')](_0x21c2('0x1d'),_0x406559);logger['debug'](_0x21c2('0x1d'),_0x406559,JSON[_0x21c2('0x15')](_0xb59c0c));_0x66df72(_0xb59c0c);})[_0x21c2('0x1c')](function(_0x554c44){logger[_0x21c2('0x16')]('CreateChatMessage',_0x554c44[_0x21c2('0x19')],_0x406559);_0x2c58fa(_0x894e78[_0x21c2('0x16')](0x1f4,_0x554c44['message']));});});};
\ No newline at end of file
+var _0x0104=['jayson/promise','client','redis','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateChatMessage','ChatMessage','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x333458,_0x36619b){var _0x17922b=function(_0x2ed7eb){while(--_0x2ed7eb){_0x333458['push'](_0x333458['shift']());}};_0x17922b(++_0x36619b);}(_0x0104,0x1a4));var _0x4010=function(_0x54a5c2,_0x55e90a){_0x54a5c2=_0x54a5c2-0x0;var _0x59fc97=_0x0104[_0x54a5c2];return _0x59fc97;};'use strict';var _=require(_0x4010('0x0'));var util=require(_0x4010('0x1'));var moment=require(_0x4010('0x2'));var BPromise=require(_0x4010('0x3'));var rs=require(_0x4010('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4010('0x5'))['db'];var utils=require(_0x4010('0x6'));var logger=require(_0x4010('0x7'))(_0x4010('0x8'));var config=require('../../config/environment');var jayson=require(_0x4010('0x9'));var client=jayson[_0x4010('0xa')]['http']({'port':0x232a});config[_0x4010('0xb')]=_['defaults'](config[_0x4010('0xb')],{'host':_0x4010('0xc'),'port':0x18eb});var socket=require(_0x4010('0xd'))(new Redis(config[_0x4010('0xb')]));require(_0x4010('0xe'))[_0x4010('0xf')](socket);function respondWithRpcPromise(_0x3b4db5,_0xf9531d,_0x59de4d){return new BPromise(function(_0x3fa10d,_0xdb3f55){return client[_0x4010('0x10')](_0x3b4db5,_0x59de4d)[_0x4010('0x11')](function(_0x573084){logger[_0x4010('0x12')](_0x4010('0x13'),_0xf9531d,_0x4010('0x14'));logger['debug'](_0x4010('0x15'),_0xf9531d,_0x4010('0x14'),JSON[_0x4010('0x16')](_0x573084));if(_0x573084[_0x4010('0x17')]){if(_0x573084['error'][_0x4010('0x18')]===0x1f4){logger['error'](_0x4010('0x13'),_0xf9531d,_0x573084['error'][_0x4010('0x19')]);return _0xdb3f55(_0x573084[_0x4010('0x17')][_0x4010('0x19')]);}logger[_0x4010('0x17')](_0x4010('0x13'),_0xf9531d,_0x573084[_0x4010('0x17')]['message']);return _0x3fa10d(_0x573084['error'][_0x4010('0x19')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0xf9531d,_0x4010('0x14'));_0x3fa10d(_0x573084['result'][_0x4010('0x19')]);}})[_0x4010('0x1a')](function(_0x181401){logger[_0x4010('0x17')]('ChatMessage,\x20%s,\x20%s',_0xf9531d,_0x181401);_0xdb3f55(_0x181401);});});}exports[_0x4010('0x1b')]=function(_0x4b9176){var _0x3611c2=this;return new Promise(function(_0x5b6c5e,_0x335acd){return db[_0x4010('0x1c')]['create'](_0x4b9176[_0x4010('0x1d')],{'raw':_0x4b9176[_0x4010('0x1e')]?_0x4b9176[_0x4010('0x1e')][_0x4010('0x1f')]===undefined?!![]:![]:!![]})[_0x4010('0x11')](function(_0x15718b){logger['info'](_0x4010('0x1b'),_0x4b9176);logger[_0x4010('0x20')](_0x4010('0x1b'),_0x4b9176,JSON[_0x4010('0x16')](_0x15718b));_0x5b6c5e(_0x15718b);})[_0x4010('0x1a')](function(_0xa658ff){logger[_0x4010('0x17')](_0x4010('0x1b'),_0xa658ff[_0x4010('0x19')],_0x4b9176);_0x335acd(_0x3611c2[_0x4010('0x17')](0x1f4,_0xa658ff[_0x4010('0x19')]));});});};
\ No newline at end of file
diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js
index d3bc677..2381820 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 _0x3248=['remove','update','removeListener','length','chatMessage:','./chatMessage.events','save'];(function(_0x83531b,_0x5daca6){var _0x3696f2=function(_0x368b38){while(--_0x368b38){_0x83531b['push'](_0x83531b['shift']());}};_0x3696f2(++_0x5daca6);}(_0x3248,0x1b0));var _0x8324=function(_0x5144c1,_0x994c78){_0x5144c1=_0x5144c1-0x0;var _0xc532fa=_0x3248[_0x5144c1];return _0xc532fa;};'use strict';var ChatMessageEvents=require(_0x8324('0x0'));var events=[_0x8324('0x1'),_0x8324('0x2'),_0x8324('0x3')];function createListener(_0x9b580,_0x23b671){return function(_0x3ab598){_0x23b671['emit'](_0x9b580,_0x3ab598);};}function removeListener(_0x4c565b,_0x2e46f3){return function(){ChatMessageEvents[_0x8324('0x4')](_0x4c565b,_0x2e46f3);};}exports['register']=function(_0x18edd2){for(var _0x283f5f=0x0,_0x446423=events[_0x8324('0x5')];_0x283f5f<_0x446423;_0x283f5f++){var _0x215c15=events[_0x283f5f];var _0x5d5f01=createListener(_0x8324('0x6')+_0x215c15,_0x18edd2);ChatMessageEvents['on'](_0x215c15,_0x5d5f01);}};
\ No newline at end of file
+var _0x1dcc=['./chatMessage.events','save','remove','update','emit'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x5ac435,_0x5578ca){_0x5ac435=_0x5ac435-0x0;var _0x4a8225=_0x1dcc[_0x5ac435];return _0x4a8225;};'use strict';var ChatMessageEvents=require(_0xc1dc('0x0'));var events=[_0xc1dc('0x1'),_0xc1dc('0x2'),_0xc1dc('0x3')];function createListener(_0x5c9880,_0x934769){return function(_0x4dece3){_0x934769[_0xc1dc('0x4')](_0x5c9880,_0x4dece3);};}function removeListener(_0x3eb139,_0x2a8ff9){return function(){ChatMessageEvents['removeListener'](_0x3eb139,_0x2a8ff9);};}exports['register']=function(_0x1e57ba){for(var _0x381ab6=0x0,_0x41b667=events['length'];_0x381ab6<_0x41b667;_0x381ab6++){var _0x3ef050=events[_0x381ab6];var _0x3deb94=createListener('chatMessage:'+_0x3ef050,_0x1e57ba);ChatMessageEvents['on'](_0x3ef050,_0x3deb94);}};
\ No newline at end of file
diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js
index aedef41..8ab7c99 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 _0xdaee=['../../config/environment','./chatMessage.controller','get','/describe','isAuthenticated','describe','show','tracked','chat','chatmessage:create','create','put','/:id','/:id/accept','accept','reject','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xdaee,0xba));var _0xedae=function(_0x45d68a,_0x3994a2){_0x45d68a=_0x45d68a-0x0;var _0x3c415f=_0xdaee[_0x45d68a];return _0x3c415f;};'use strict';var multer=require('multer');var util=require(_0xedae('0x0'));var path=require(_0xedae('0x1'));var timeout=require(_0xedae('0x2'));var express=require(_0xedae('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0xedae('0x4'));var interaction=require(_0xedae('0x5'));var config=require(_0xedae('0x6'));var controller=require(_0xedae('0x7'));router[_0xedae('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xedae('0x8')](_0xedae('0x9'),auth[_0xedae('0xa')](),controller[_0xedae('0xb')]);router[_0xedae('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xedae('0xc')]);router['post']('/',auth[_0xedae('0xa')](),interaction[_0xedae('0xd')](_0xedae('0xe'),_0xedae('0xf')),controller[_0xedae('0x10')]);router[_0xedae('0x11')](_0xedae('0x12'),controller['update']);router[_0xedae('0x11')](_0xedae('0x13'),auth[_0xedae('0xa')](),controller[_0xedae('0x14')]);router['put']('/:id/reject',auth[_0xedae('0xa')](),controller[_0xedae('0x15')]);router[_0xedae('0x16')](_0xedae('0x12'),auth[_0xedae('0xa')](),controller[_0xedae('0x17')]);module['exports']=router;
\ No newline at end of file
+var _0xbf02=['describe','chat','create','put','/:id','/:id/accept','accept','reject','delete','destroy','exports','util','connect-timeout','Router','fs-extra','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xbf02,0x1ee));var _0x2bf0=function(_0x4a53d,_0x58a95e){_0x4a53d=_0x4a53d-0x0;var _0x27410e=_0xbf02[_0x4a53d];return _0x27410e;};'use strict';var multer=require('multer');var util=require(_0x2bf0('0x0'));var path=require('path');var timeout=require(_0x2bf0('0x1'));var express=require('express');var router=express[_0x2bf0('0x2')]();var fs_extra=require(_0x2bf0('0x3'));var auth=require(_0x2bf0('0x4'));var interaction=require(_0x2bf0('0x5'));var config=require('../../config/environment');var controller=require('./chatMessage.controller');router[_0x2bf0('0x6')]('/',auth[_0x2bf0('0x7')](),controller[_0x2bf0('0x8')]);router[_0x2bf0('0x6')](_0x2bf0('0x9'),auth[_0x2bf0('0x7')](),controller[_0x2bf0('0xa')]);router['get']('/:id',auth[_0x2bf0('0x7')](),controller['show']);router['post']('/',auth[_0x2bf0('0x7')](),interaction['tracked'](_0x2bf0('0xb'),'chatmessage:create'),controller[_0x2bf0('0xc')]);router[_0x2bf0('0xd')](_0x2bf0('0xe'),controller['update']);router['put'](_0x2bf0('0xf'),auth[_0x2bf0('0x7')](),controller[_0x2bf0('0x10')]);router['put']('/:id/reject',auth[_0x2bf0('0x7')](),controller[_0x2bf0('0x11')]);router[_0x2bf0('0x12')]('/:id',auth[_0x2bf0('0x7')](),controller[_0x2bf0('0x13')]);module[_0x2bf0('0x14')]=router;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js
index e13e487..8df58af 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 _0x2032=['medium','exports','TEXT'];(function(_0x160f61,_0x2689be){var _0x5c19a8=function(_0x28fb1a){while(--_0x28fb1a){_0x160f61['push'](_0x160f61['shift']());}};_0x5c19a8(++_0x2689be);}(_0x2032,0xd9));var _0x2203=function(_0x5c22df,_0x3d7b2c){_0x5c22df=_0x5c22df-0x0;var _0x185966=_0x2032[_0x5c22df];return _0x185966;};'use strict';var Sequelize=require('sequelize');module[_0x2203('0x0')]={'body':{'type':Sequelize[_0x2203('0x1')](_0x2203('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x2203('0x2')),'allowNull':![]}};
\ No newline at end of file
+var _0xdb28=['TEXT','medium','sequelize','exports'];(function(_0x38ba1c,_0x38d4c1){var _0xc0080e=function(_0x2fd346){while(--_0x2fd346){_0x38ba1c['push'](_0x38ba1c['shift']());}};_0xc0080e(++_0x38d4c1);}(_0xdb28,0x106));var _0x8db2=function(_0x1f5bc5,_0x520be1){_0x1f5bc5=_0x1f5bc5-0x0;var _0x48e9d6=_0xdb28[_0x1f5bc5];return _0x48e9d6;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x8db2('0x3')),'allowNull':![]}};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js
index 4ab24f3..a712167 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(_0x4e177e,_0x49067f){var _0xaf8126=function(_0x3ce0df){while(--_0x3ce0df){_0x4e177e['push'](_0x4e177e['shift']());}};_0xaf8126(++_0x49067f);}(_0x9957,0x93));var _0x7995=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x9957[_0x6c993a];return _0x27f547;};'use strict';var emlformat=require(_0x7995('0x0'));var rimraf=require(_0x7995('0x1'));var zipdir=require(_0x7995('0x2'));var jsonpatch=require(_0x7995('0x3'));var rp=require('request-promise');var moment=require(_0x7995('0x4'));var BPromise=require(_0x7995('0x5'));var Mustache=require(_0x7995('0x6'));var util=require(_0x7995('0x7'));var path=require('path');var sox=require(_0x7995('0x8'));var csv=require(_0x7995('0x9'));var ejs=require(_0x7995('0xa'));var fs=require('fs');var fs_extra=require(_0x7995('0xb'));var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var licenseUtil=require(_0x7995('0x19'));var db=require(_0x7995('0x1a'))['db'];function respondWithStatusCode(_0x19a27e,_0x385f00){_0x385f00=_0x385f00||0xcc;return function(_0x281576){if(_0x281576){return _0x19a27e[_0x7995('0x1b')](_0x385f00);}return _0x19a27e[_0x7995('0x1c')](_0x385f00)['end']();};}function respondWithResult(_0x58f5ad,_0x2b4e94){_0x2b4e94=_0x2b4e94||0xc8;return function(_0x2233dd){if(_0x2233dd){return _0x58f5ad[_0x7995('0x1c')](_0x2b4e94)[_0x7995('0x1d')](_0x2233dd);}};}function respondWithFilteredResult(_0x3f1d3e,_0x1a5310){return function(_0x2202ce){if(_0x2202ce){var _0x41cbf0=typeof _0x1a5310['offset']===_0x7995('0x1e')&&typeof _0x1a5310['limit']===_0x7995('0x1e');var _0x37f297=_0x2202ce[_0x7995('0x1f')];var _0x291317=_0x41cbf0?0x0:_0x1a5310[_0x7995('0x20')];var _0x37a7d4=_0x41cbf0?_0x2202ce['count']:_0x1a5310['offset']+_0x1a5310[_0x7995('0x21')];var _0x5e6f90;if(_0x37a7d4>=_0x37f297){_0x37a7d4=_0x37f297;_0x5e6f90=0xc8;}else{_0x5e6f90=0xce;}_0x3f1d3e['status'](_0x5e6f90);return _0x3f1d3e[_0x7995('0x22')](_0x7995('0x23'),_0x291317+'-'+_0x37a7d4+'/'+_0x37f297)['json'](_0x2202ce);}return null;};}function patchUpdates(_0x3a9b54){return function(_0x51f276){try{jsonpatch['apply'](_0x51f276,_0x3a9b54,!![]);}catch(_0x3e4c54){return BPromise[_0x7995('0x24')](_0x3e4c54);}return _0x51f276[_0x7995('0x25')]();};}function saveUpdates(_0x1a8568,_0x460924){return function(_0x1c278a){if(_0x1c278a){return _0x1c278a['update'](_0x1a8568)[_0x7995('0x26')](function(_0x46ee4b){return _0x46ee4b;});}return null;};}function removeEntity(_0x204507,_0x285437){return function(_0x563799){if(_0x563799){return _0x563799[_0x7995('0x27')]()[_0x7995('0x26')](function(){_0x204507[_0x7995('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x39df42,_0x34e70c){return function(_0x401dc3){if(!_0x401dc3){_0x39df42[_0x7995('0x1b')](0x194);}return _0x401dc3;};}function handleError(_0x3a3fcf,_0x2a307e){_0x2a307e=_0x2a307e||0x1f4;return function(_0x56691a){logger[_0x7995('0x28')](_0x56691a['stack']);if(_0x56691a[_0x7995('0x29')]){delete _0x56691a[_0x7995('0x29')];}_0x3a3fcf[_0x7995('0x1c')](_0x2a307e)[_0x7995('0x2a')](_0x56691a);};}exports[_0x7995('0x2b')]=function(_0x4b6f99,_0x9b2a15){var _0x514445={},_0x456a28={},_0x3250e0={'count':0x0,'rows':[]};var _0x4253e5=_['map'](db['ChatOfflineMessage']['rawAttributes'],function(_0x3573be){return{'name':_0x3573be[_0x7995('0x2c')],'type':_0x3573be[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x456a28[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x4253e5,'name');_0x456a28['query']=_[_0x7995('0x31')](_0x4b6f99['query']);_0x456a28[_0x7995('0x32')]=_[_0x7995('0x33')](_0x456a28[_0x7995('0x2f')],_0x456a28[_0x7995('0x34')]);_0x514445[_0x7995('0x35')]=_['intersection'](_0x456a28[_0x7995('0x2f')],qs[_0x7995('0x36')](_0x4b6f99['query']['fields']));_0x514445['attributes']=_0x514445[_0x7995('0x35')][_0x7995('0x37')]?_0x514445['attributes']:_0x456a28[_0x7995('0x2f')];if(!_0x4b6f99['query'][_0x7995('0x38')](_0x7995('0x39'))){_0x514445[_0x7995('0x21')]=qs['limit'](_0x4b6f99['query'][_0x7995('0x21')]);_0x514445['offset']=qs['offset'](_0x4b6f99[_0x7995('0x34')][_0x7995('0x20')]);}_0x514445['order']=qs[_0x7995('0x3a')](_0x4b6f99[_0x7995('0x34')][_0x7995('0x3a')]);_0x514445[_0x7995('0x3b')]=qs[_0x7995('0x32')](_['pick'](_0x4b6f99[_0x7995('0x34')],_0x456a28[_0x7995('0x32')]),_0x4253e5);if(_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]){_0x514445['where']=_[_0x7995('0x3d')](_0x514445[_0x7995('0x3b')],{'$or':_[_0x7995('0x30')](_0x4253e5,function(_0xe5ea43){if(_0xe5ea43[_0x7995('0x2d')]!==_0x7995('0x3e')){var _0x5688a1={};_0x5688a1[_0xe5ea43[_0x7995('0x29')]]={'$like':'%'+_0x4b6f99[_0x7995('0x34')][_0x7995('0x3c')]+'%'};return _0x5688a1;}})});}_0x514445=_[_0x7995('0x3d')]({},_0x514445,_0x4b6f99[_0x7995('0x3f')]);var _0x298fc2={'where':_0x514445[_0x7995('0x3b')]};return db[_0x7995('0x40')][_0x7995('0x1f')](_0x298fc2)[_0x7995('0x26')](function(_0x6fe77b){_0x3250e0[_0x7995('0x1f')]=_0x6fe77b;if(_0x4b6f99[_0x7995('0x34')]['includeAll']){_0x514445['include']=[{'all':!![]}];}return db[_0x7995('0x40')][_0x7995('0x41')](_0x514445);})['then'](function(_0x4b0855){_0x3250e0[_0x7995('0x42')]=_0x4b0855;return _0x3250e0;})['then'](respondWithFilteredResult(_0x9b2a15,_0x514445))['catch'](handleError(_0x9b2a15,null));};exports[_0x7995('0x43')]=function(_0x36e28b,_0x35c8ff){var _0x576b96={'raw':!![],'where':{'id':_0x36e28b['params']['id']}},_0x46ac4f={};_0x46ac4f[_0x7995('0x2f')]=_['keys'](db['ChatOfflineMessage'][_0x7995('0x44')]);_0x46ac4f[_0x7995('0x34')]=_[_0x7995('0x31')](_0x36e28b[_0x7995('0x34')]);_0x46ac4f['filters']=_[_0x7995('0x33')](_0x46ac4f[_0x7995('0x2f')],_0x46ac4f[_0x7995('0x34')]);_0x576b96[_0x7995('0x35')]=_['intersection'](_0x46ac4f['model'],qs[_0x7995('0x36')](_0x36e28b['query'][_0x7995('0x36')]));_0x576b96['attributes']=_0x576b96[_0x7995('0x35')]['length']?_0x576b96[_0x7995('0x35')]:_0x46ac4f[_0x7995('0x2f')];if(_0x36e28b['query'][_0x7995('0x45')]){_0x576b96[_0x7995('0x46')]=[{'all':!![]}];}_0x576b96=_[_0x7995('0x3d')]({},_0x576b96,_0x36e28b[_0x7995('0x3f')]);return db['ChatOfflineMessage'][_0x7995('0x47')](_0x576b96)[_0x7995('0x26')](handleEntityNotFound(_0x35c8ff,null))[_0x7995('0x26')](respondWithResult(_0x35c8ff,null))['catch'](handleError(_0x35c8ff,null));};exports[_0x7995('0x48')]=function(_0x44f516,_0x511567){return db[_0x7995('0x40')][_0x7995('0x48')](_0x44f516['body'],{})[_0x7995('0x26')](respondWithResult(_0x511567,0xc9))[_0x7995('0x49')](handleError(_0x511567,null));};exports['update']=function(_0x3d1dbb,_0x5843ba){if(_0x3d1dbb[_0x7995('0x4a')]['id']){delete _0x3d1dbb[_0x7995('0x4a')]['id'];}return db[_0x7995('0x40')][_0x7995('0x47')]({'where':{'id':_0x3d1dbb[_0x7995('0x4b')]['id']}})[_0x7995('0x26')](handleEntityNotFound(_0x5843ba,null))[_0x7995('0x26')](saveUpdates(_0x3d1dbb['body'],null))[_0x7995('0x26')](respondWithResult(_0x5843ba,null))[_0x7995('0x49')](handleError(_0x5843ba,null));};exports[_0x7995('0x27')]=function(_0x4ffc8a,_0x19da63){return db[_0x7995('0x4c')][_0x7995('0x41')]({'where':{'ChatOfflineMessageId':_0x4ffc8a['params']['id']},'raw':!![]})['then'](function(_0x5a592e){_0x5a592e[_0x7995('0x4d')](function(_0x1fd1ca){var _0x4cf5db=path[_0x7995('0x4e')](config[_0x7995('0x4f')],_0x7995('0x50'),_0x7995('0x51'),_0x7995('0x52'),'offline-chat',_0x1fd1ca[_0x7995('0x53')]);var _0x4ab09f=fs[_0x7995('0x54')](_0x4cf5db);if(_0x4ab09f)fs_extra[_0x7995('0x55')](_0x4cf5db);});})[_0x7995('0x26')](function(){return db['ChatOfflineMessage']['find']({'where':{'id':_0x4ffc8a['params']['id']},'individualHooks':!![]});})['then'](handleEntityNotFound(_0x19da63,null))[_0x7995('0x26')](removeEntity(_0x19da63,null))[_0x7995('0x49')](handleError(_0x19da63,null));};exports[_0x7995('0x56')]=function(_0x150261,_0x1d957e){return db[_0x7995('0x40')][_0x7995('0x56')]()[_0x7995('0x26')](respondWithResult(_0x1d957e,null))[_0x7995('0x49')](handleError(_0x1d957e,null));};
\ No newline at end of file
+var _0x7a54=['filter','VIRTUAL','includeAll','include','findAll','rows','show','params','length','merge','options','find','catch','body','Attachment','join','server','attachments','offline-chat','basename','remove','describe','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','fs-extra','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','ChatOfflineMessage','fieldName','type','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x173d7e,_0x3242fd){var _0x2220d6=function(_0x462828){while(--_0x462828){_0x173d7e['push'](_0x173d7e['shift']());}};_0x2220d6(++_0x3242fd);}(_0x7a54,0x106));var _0x47a5=function(_0x5238dc,_0x1175f){_0x5238dc=_0x5238dc-0x0;var _0x5c462b=_0x7a54[_0x5238dc];return _0x5c462b;};'use strict';var emlformat=require(_0x47a5('0x0'));var rimraf=require(_0x47a5('0x1'));var zipdir=require(_0x47a5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x47a5('0x3'));var moment=require(_0x47a5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x47a5('0x5'));var util=require(_0x47a5('0x6'));var path=require(_0x47a5('0x7'));var sox=require(_0x47a5('0x8'));var csv=require(_0x47a5('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x47a5('0xa'));var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var licenseUtil=require(_0x47a5('0x14'));var db=require(_0x47a5('0x15'))['db'];function respondWithStatusCode(_0xd308b8,_0x1eae59){_0x1eae59=_0x1eae59||0xcc;return function(_0x5beb89){if(_0x5beb89){return _0xd308b8[_0x47a5('0x16')](_0x1eae59);}return _0xd308b8[_0x47a5('0x17')](_0x1eae59)[_0x47a5('0x18')]();};}function respondWithResult(_0x711793,_0x139f25){_0x139f25=_0x139f25||0xc8;return function(_0x620ee9){if(_0x620ee9){return _0x711793[_0x47a5('0x17')](_0x139f25)[_0x47a5('0x19')](_0x620ee9);}};}function respondWithFilteredResult(_0x4e99a8,_0x362359){return function(_0x11faf5){if(_0x11faf5){var _0x3b001e=typeof _0x362359[_0x47a5('0x1a')]===_0x47a5('0x1b')&&typeof _0x362359['limit']==='undefined';var _0x138bc0=_0x11faf5['count'];var _0x5247fd=_0x3b001e?0x0:_0x362359[_0x47a5('0x1a')];var _0xaf70a6=_0x3b001e?_0x11faf5[_0x47a5('0x1c')]:_0x362359[_0x47a5('0x1a')]+_0x362359[_0x47a5('0x1d')];var _0x12b98e;if(_0xaf70a6>=_0x138bc0){_0xaf70a6=_0x138bc0;_0x12b98e=0xc8;}else{_0x12b98e=0xce;}_0x4e99a8[_0x47a5('0x17')](_0x12b98e);return _0x4e99a8[_0x47a5('0x1e')](_0x47a5('0x1f'),_0x5247fd+'-'+_0xaf70a6+'/'+_0x138bc0)['json'](_0x11faf5);}return null;};}function patchUpdates(_0x1570bc){return function(_0xf160ba){try{jsonpatch['apply'](_0xf160ba,_0x1570bc,!![]);}catch(_0x2b0360){return BPromise[_0x47a5('0x20')](_0x2b0360);}return _0xf160ba[_0x47a5('0x21')]();};}function saveUpdates(_0x4c5910,_0xb8ae6c){return function(_0x2f142b){if(_0x2f142b){return _0x2f142b[_0x47a5('0x22')](_0x4c5910)[_0x47a5('0x23')](function(_0x5ef1b1){return _0x5ef1b1;});}return null;};}function removeEntity(_0xe2dea9,_0x385687){return function(_0x513981){if(_0x513981){return _0x513981[_0x47a5('0x24')]()[_0x47a5('0x23')](function(){_0xe2dea9[_0x47a5('0x17')](0xcc)[_0x47a5('0x18')]();});}};}function handleEntityNotFound(_0x3abd6a,_0x50bf17){return function(_0x53078a){if(!_0x53078a){_0x3abd6a[_0x47a5('0x16')](0x194);}return _0x53078a;};}function handleError(_0x5686db,_0x1ea9c8){_0x1ea9c8=_0x1ea9c8||0x1f4;return function(_0x5b6c4e){logger[_0x47a5('0x25')](_0x5b6c4e[_0x47a5('0x26')]);if(_0x5b6c4e[_0x47a5('0x27')]){delete _0x5b6c4e[_0x47a5('0x27')];}_0x5686db[_0x47a5('0x17')](_0x1ea9c8)[_0x47a5('0x28')](_0x5b6c4e);};}exports[_0x47a5('0x29')]=function(_0x136b14,_0x16631f){var _0x361bfa={},_0x1127f8={},_0x11a4fa={'count':0x0,'rows':[]};var _0x3ad507=_['map'](db[_0x47a5('0x2a')]['rawAttributes'],function(_0x2ef875){return{'name':_0x2ef875[_0x47a5('0x2b')],'type':_0x2ef875[_0x47a5('0x2c')]['key']};});_0x1127f8[_0x47a5('0x2d')]=_[_0x47a5('0x2e')](_0x3ad507,_0x47a5('0x27'));_0x1127f8[_0x47a5('0x2f')]=_['keys'](_0x136b14['query']);_0x1127f8[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x1127f8['model'],_0x1127f8['query']);_0x361bfa[_0x47a5('0x32')]=_[_0x47a5('0x31')](_0x1127f8['model'],qs[_0x47a5('0x33')](_0x136b14['query'][_0x47a5('0x33')]));_0x361bfa[_0x47a5('0x32')]=_0x361bfa['attributes']['length']?_0x361bfa[_0x47a5('0x32')]:_0x1127f8['model'];if(!_0x136b14[_0x47a5('0x2f')][_0x47a5('0x34')](_0x47a5('0x35'))){_0x361bfa['limit']=qs[_0x47a5('0x1d')](_0x136b14['query']['limit']);_0x361bfa[_0x47a5('0x1a')]=qs['offset'](_0x136b14[_0x47a5('0x2f')]['offset']);}_0x361bfa[_0x47a5('0x36')]=qs[_0x47a5('0x37')](_0x136b14[_0x47a5('0x2f')][_0x47a5('0x37')]);_0x361bfa[_0x47a5('0x38')]=qs[_0x47a5('0x30')](_[_0x47a5('0x39')](_0x136b14[_0x47a5('0x2f')],_0x1127f8[_0x47a5('0x30')]),_0x3ad507);if(_0x136b14['query'][_0x47a5('0x3a')]){_0x361bfa[_0x47a5('0x38')]=_['merge'](_0x361bfa[_0x47a5('0x38')],{'$or':_[_0x47a5('0x2e')](_0x3ad507,function(_0x1d4348){if(_0x1d4348['type']!==_0x47a5('0x3b')){var _0x10f660={};_0x10f660[_0x1d4348['name']]={'$like':'%'+_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3a')]+'%'};return _0x10f660;}})});}_0x361bfa=_['merge']({},_0x361bfa,_0x136b14['options']);var _0x5ebd8c={'where':_0x361bfa[_0x47a5('0x38')]};return db['ChatOfflineMessage'][_0x47a5('0x1c')](_0x5ebd8c)[_0x47a5('0x23')](function(_0x301a85){_0x11a4fa[_0x47a5('0x1c')]=_0x301a85;if(_0x136b14[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x361bfa[_0x47a5('0x3d')]=[{'all':!![]}];}return db[_0x47a5('0x2a')][_0x47a5('0x3e')](_0x361bfa);})[_0x47a5('0x23')](function(_0x280500){_0x11a4fa[_0x47a5('0x3f')]=_0x280500;return _0x11a4fa;})[_0x47a5('0x23')](respondWithFilteredResult(_0x16631f,_0x361bfa))['catch'](handleError(_0x16631f,null));};exports[_0x47a5('0x40')]=function(_0x1c36fa,_0x331474){var _0x23bd8d={'raw':!![],'where':{'id':_0x1c36fa[_0x47a5('0x41')]['id']}},_0x586f4f={};_0x586f4f['model']=_['keys'](db['ChatOfflineMessage']['rawAttributes']);_0x586f4f[_0x47a5('0x2f')]=_['keys'](_0x1c36fa[_0x47a5('0x2f')]);_0x586f4f[_0x47a5('0x30')]=_[_0x47a5('0x31')](_0x586f4f['model'],_0x586f4f[_0x47a5('0x2f')]);_0x23bd8d[_0x47a5('0x32')]=_['intersection'](_0x586f4f['model'],qs[_0x47a5('0x33')](_0x1c36fa['query'][_0x47a5('0x33')]));_0x23bd8d[_0x47a5('0x32')]=_0x23bd8d[_0x47a5('0x32')][_0x47a5('0x42')]?_0x23bd8d[_0x47a5('0x32')]:_0x586f4f[_0x47a5('0x2d')];if(_0x1c36fa[_0x47a5('0x2f')][_0x47a5('0x3c')]){_0x23bd8d[_0x47a5('0x3d')]=[{'all':!![]}];}_0x23bd8d=_[_0x47a5('0x43')]({},_0x23bd8d,_0x1c36fa[_0x47a5('0x44')]);return db[_0x47a5('0x2a')][_0x47a5('0x45')](_0x23bd8d)[_0x47a5('0x23')](handleEntityNotFound(_0x331474,null))[_0x47a5('0x23')](respondWithResult(_0x331474,null))[_0x47a5('0x46')](handleError(_0x331474,null));};exports['create']=function(_0x2d38de,_0x23bb04){return db['ChatOfflineMessage']['create'](_0x2d38de[_0x47a5('0x47')],{})['then'](respondWithResult(_0x23bb04,0xc9))[_0x47a5('0x46')](handleError(_0x23bb04,null));};exports[_0x47a5('0x22')]=function(_0x54c35f,_0x4f62d3){if(_0x54c35f[_0x47a5('0x47')]['id']){delete _0x54c35f['body']['id'];}return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x54c35f[_0x47a5('0x41')]['id']}})[_0x47a5('0x23')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x23')](saveUpdates(_0x54c35f[_0x47a5('0x47')],null))[_0x47a5('0x23')](respondWithResult(_0x4f62d3,null))['catch'](handleError(_0x4f62d3,null));};exports['destroy']=function(_0x2dd1db,_0x411230){return db[_0x47a5('0x48')][_0x47a5('0x3e')]({'where':{'ChatOfflineMessageId':_0x2dd1db[_0x47a5('0x41')]['id']},'raw':!![]})[_0x47a5('0x23')](function(_0x249de5){_0x249de5['forEach'](function(_0x45cca5){var _0x1c9a62=path[_0x47a5('0x49')](config['root'],_0x47a5('0x4a'),'files',_0x47a5('0x4b'),_0x47a5('0x4c'),_0x45cca5[_0x47a5('0x4d')]);var _0xf03bd5=fs['existsSync'](_0x1c9a62);if(_0xf03bd5)fs_extra[_0x47a5('0x4e')](_0x1c9a62);});})[_0x47a5('0x23')](function(){return db[_0x47a5('0x2a')][_0x47a5('0x45')]({'where':{'id':_0x2dd1db[_0x47a5('0x41')]['id']},'individualHooks':!![]});})[_0x47a5('0x23')](handleEntityNotFound(_0x411230,null))[_0x47a5('0x23')](removeEntity(_0x411230,null))['catch'](handleError(_0x411230,null));};exports[_0x47a5('0x4f')]=function(_0x43721b,_0x187d7e){return db[_0x47a5('0x2a')][_0x47a5('0x4f')]()[_0x47a5('0x23')](respondWithResult(_0x187d7e,null))['catch'](handleError(_0x187d7e,null));};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.events.js b/server/api/chatOfflineMessage/chatOfflineMessage.events.js
index d3d38a1..7ad8d03 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 _0x4128=['ChatOfflineMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','events','../../mysqldb'];(function(_0xd3fb91,_0xfc54c0){var _0x33438c=function(_0x924998){while(--_0x924998){_0xd3fb91['push'](_0xd3fb91['shift']());}};_0x33438c(++_0xfc54c0);}(_0x4128,0x1a5));var _0x8412=function(_0x3e5db1,_0x8c4d48){_0x3e5db1=_0x3e5db1-0x0;var _0x49cf49=_0x4128[_0x3e5db1];return _0x49cf49;};'use strict';var EventEmitter=require(_0x8412('0x0'));var ChatOfflineMessage=require(_0x8412('0x1'))['db'][_0x8412('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0x8412('0x3')](0x0);var events={'afterCreate':_0x8412('0x4'),'afterUpdate':_0x8412('0x5'),'afterDestroy':_0x8412('0x6')};function emitEvent(_0x4b8c33){return function(_0x289ead,_0x4c80ce,_0x35996a){ChatOfflineMessageEvents[_0x8412('0x7')](_0x4b8c33+':'+_0x289ead['id'],_0x289ead);ChatOfflineMessageEvents['emit'](_0x4b8c33,_0x289ead);_0x35996a(null);};}for(var e in events){if(events[_0x8412('0x8')](e)){var event=events[e];ChatOfflineMessage['hook'](e,emitEvent(event));}}module['exports']=ChatOfflineMessageEvents;
\ No newline at end of file
+var _0x8fbe=['update','remove','hasOwnProperty','hook','exports','events','../../mysqldb','ChatOfflineMessage','setMaxListeners','save'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x8fbe,0xd7));var _0xe8fb=function(_0xd14487,_0x13841c){_0xd14487=_0xd14487-0x0;var _0x12d073=_0x8fbe[_0xd14487];return _0x12d073;};'use strict';var EventEmitter=require(_0xe8fb('0x0'));var ChatOfflineMessage=require(_0xe8fb('0x1'))['db'][_0xe8fb('0x2')];var ChatOfflineMessageEvents=new EventEmitter();ChatOfflineMessageEvents[_0xe8fb('0x3')](0x0);var events={'afterCreate':_0xe8fb('0x4'),'afterUpdate':_0xe8fb('0x5'),'afterDestroy':_0xe8fb('0x6')};function emitEvent(_0x4107f6){return function(_0x49e8bf,_0x421c3e,_0x4c840c){ChatOfflineMessageEvents['emit'](_0x4107f6+':'+_0x49e8bf['id'],_0x49e8bf);ChatOfflineMessageEvents['emit'](_0x4107f6,_0x49e8bf);_0x4c840c(null);};}for(var e in events){if(events[_0xe8fb('0x7')](e)){var event=events[e];ChatOfflineMessage[_0xe8fb('0x8')](e,emitEvent(event));}}module[_0xe8fb('0x9')]=ChatOfflineMessageEvents;
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js
index 68d9c7e..521a36d 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 _0x023b=['utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage'];(function(_0xb2b5f8,_0x48aa42){var _0x123591=function(_0x45d91f){while(--_0x45d91f){_0xb2b5f8['push'](_0xb2b5f8['shift']());}};_0x123591(++_0x48aa42);}(_0x023b,0x1dc));var _0xb023=function(_0x5ccf62,_0x4ccc62){_0x5ccf62=_0x5ccf62-0x0;var _0x5d2fb3=_0x023b[_0x5ccf62];return _0x5d2fb3;};'use strict';var attributes=require(_0xb023('0x0'));module[_0xb023('0x1')]=function(_0x227c4c){return _0x227c4c[_0xb023('0x2')](_0xb023('0x3'),attributes,{'tableName':'chat_offline_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb023('0x4'),'collate':_0xb023('0x5')});};
\ No newline at end of file
+var _0x8a96=['exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','./chatOfflineMessage.attributes'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x8a96,0xae));var _0x68a9=function(_0x44ce7f,_0x3d7c00){_0x44ce7f=_0x44ce7f-0x0;var _0x32cf1a=_0x8a96[_0x44ce7f];return _0x32cf1a;};'use strict';var attributes=require(_0x68a9('0x0'));module[_0x68a9('0x1')]=function(_0xf3b61c){return _0xf3b61c[_0x68a9('0x2')](_0x68a9('0x3'),attributes,{'tableName':_0x68a9('0x4'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x68a9('0x5'),'collate':_0x68a9('0x6')});};
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js
index 7c9e899..3be52d5 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 _0x44ae=['debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','ChatOfflineMessage,\x20%s,\x20%s','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x5296d6,_0x1e2d5c){var _0x54b636=function(_0x1a28fc){while(--_0x1a28fc){_0x5296d6['push'](_0x5296d6['shift']());}};_0x54b636(++_0x1e2d5c);}(_0x44ae,0x17d));var _0xe44a=function(_0x6ea81a,_0x5c03ed){_0x6ea81a=_0x6ea81a-0x0;var _0x371747=_0x44ae[_0x6ea81a];return _0x371747;};'use strict';var _=require(_0xe44a('0x0'));var util=require(_0xe44a('0x1'));var moment=require(_0xe44a('0x2'));var BPromise=require(_0xe44a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe44a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe44a('0x5'));var logger=require(_0xe44a('0x6'))(_0xe44a('0x7'));var config=require(_0xe44a('0x8'));var jayson=require(_0xe44a('0x9'));var client=jayson[_0xe44a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41a06b,_0x37bbef,_0x21f98c){return new BPromise(function(_0x202eaf,_0x4cb089){return client[_0xe44a('0xb')](_0x41a06b,_0x21f98c)[_0xe44a('0xc')](function(_0x3cc39c){logger[_0xe44a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x37bbef,_0xe44a('0xe'));logger[_0xe44a('0xf')](_0xe44a('0x10'),_0x37bbef,_0xe44a('0xe'),JSON[_0xe44a('0x11')](_0x3cc39c));if(_0x3cc39c[_0xe44a('0x12')]){if(_0x3cc39c[_0xe44a('0x12')]['code']===0x1f4){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x37bbef,_0x3cc39c[_0xe44a('0x12')][_0xe44a('0x13')]);return _0x4cb089(_0x3cc39c[_0xe44a('0x12')]['message']);}logger[_0xe44a('0x12')](_0xe44a('0x14'),_0x37bbef,_0x3cc39c[_0xe44a('0x12')][_0xe44a('0x13')]);return _0x202eaf(_0x3cc39c[_0xe44a('0x12')][_0xe44a('0x13')]);}else{logger[_0xe44a('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x37bbef,_0xe44a('0xe'));_0x202eaf(_0x3cc39c[_0xe44a('0x15')]['message']);}})['catch'](function(_0x4a6860){logger['error'](_0xe44a('0x14'),_0x37bbef,_0x4a6860);_0x4cb089(_0x4a6860);});});}
\ No newline at end of file
+var _0xa895=['request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xa895,0x145));var _0x5a89=function(_0x44cca4,_0x1c0550){_0x44cca4=_0x44cca4-0x0;var _0x46c0d6=_0xa895[_0x44cca4];return _0x46c0d6;};'use strict';var _=require(_0x5a89('0x0'));var util=require(_0x5a89('0x1'));var moment=require(_0x5a89('0x2'));var BPromise=require(_0x5a89('0x3'));var rs=require(_0x5a89('0x4'));var fs=require('fs');var Redis=require(_0x5a89('0x5'));var db=require(_0x5a89('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5a89('0x7'));var config=require('../../config/environment');var jayson=require(_0x5a89('0x8'));var client=jayson[_0x5a89('0x9')][_0x5a89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xfab113,_0x1b756b,_0x564e5){return new BPromise(function(_0x39398c,_0x3f54d8){return client[_0x5a89('0xb')](_0xfab113,_0x564e5)[_0x5a89('0xc')](function(_0x4a1f0c){logger[_0x5a89('0xd')](_0x5a89('0xe'),_0x1b756b,_0x5a89('0xf'));logger[_0x5a89('0x10')](_0x5a89('0x11'),_0x1b756b,_0x5a89('0xf'),JSON[_0x5a89('0x12')](_0x4a1f0c));if(_0x4a1f0c['error']){if(_0x4a1f0c['error'][_0x5a89('0x13')]===0x1f4){logger['error'](_0x5a89('0xe'),_0x1b756b,_0x4a1f0c['error'][_0x5a89('0x14')]);return _0x3f54d8(_0x4a1f0c[_0x5a89('0x15')][_0x5a89('0x14')]);}logger['error'](_0x5a89('0xe'),_0x1b756b,_0x4a1f0c[_0x5a89('0x15')]['message']);return _0x39398c(_0x4a1f0c[_0x5a89('0x15')][_0x5a89('0x14')]);}else{logger[_0x5a89('0xd')]('ChatOfflineMessage,\x20%s,\x20%s',_0x1b756b,_0x5a89('0xf'));_0x39398c(_0x4a1f0c[_0x5a89('0x16')][_0x5a89('0x14')]);}})[_0x5a89('0x17')](function(_0x5ae5da){logger['error'](_0x5a89('0xe'),_0x1b756b,_0x5ae5da);_0x3f54d8(_0x5ae5da);});});}
\ No newline at end of file
diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js
index 1a66a49..eb363bf 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 _0xd488=['/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','show','create','put'];(function(_0x239418,_0x4b846c){var _0x4ccda2=function(_0x3a4597){while(--_0x3a4597){_0x239418['push'](_0x239418['shift']());}};_0x4ccda2(++_0x4b846c);}(_0xd488,0x7d));var _0x8d48=function(_0x7f5123,_0x3062c5){_0x7f5123=_0x7f5123-0x0;var _0x10a02a=_0xd488[_0x7f5123];return _0x10a02a;};'use strict';var multer=require(_0x8d48('0x0'));var util=require(_0x8d48('0x1'));var path=require(_0x8d48('0x2'));var timeout=require(_0x8d48('0x3'));var express=require(_0x8d48('0x4'));var router=express[_0x8d48('0x5')]();var fs_extra=require(_0x8d48('0x6'));var auth=require(_0x8d48('0x7'));var interaction=require(_0x8d48('0x8'));var config=require(_0x8d48('0x9'));var controller=require(_0x8d48('0xa'));router[_0x8d48('0xb')]('/',auth[_0x8d48('0xc')](),controller[_0x8d48('0xd')]);router['get'](_0x8d48('0xe'),auth[_0x8d48('0xc')](),controller[_0x8d48('0xf')]);router['get']('/:id',auth[_0x8d48('0xc')](),controller[_0x8d48('0x10')]);router['post']('/',auth[_0x8d48('0xc')](),controller[_0x8d48('0x11')]);router[_0x8d48('0x12')](_0x8d48('0x13'),auth[_0x8d48('0xc')](),controller[_0x8d48('0x14')]);router[_0x8d48('0x15')](_0x8d48('0x13'),auth[_0x8d48('0xc')](),controller[_0x8d48('0x16')]);module[_0x8d48('0x17')]=router;
\ No newline at end of file
+var _0x05b4=['show','post','create','put','delete','destroy','exports','multer','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x2a38e6,_0x5bcacf){var _0x560e26=function(_0x2c64d1){while(--_0x2c64d1){_0x2a38e6['push'](_0x2a38e6['shift']());}};_0x560e26(++_0x5bcacf);}(_0x05b4,0x104));var _0x405b=function(_0x62d1cc,_0x174c05){_0x62d1cc=_0x62d1cc-0x0;var _0x2ed94a=_0x05b4[_0x62d1cc];return _0x2ed94a;};'use strict';var multer=require(_0x405b('0x0'));var util=require('util');var path=require(_0x405b('0x1'));var timeout=require(_0x405b('0x2'));var express=require(_0x405b('0x3'));var router=express[_0x405b('0x4')]();var fs_extra=require(_0x405b('0x5'));var auth=require(_0x405b('0x6'));var interaction=require(_0x405b('0x7'));var config=require(_0x405b('0x8'));var controller=require(_0x405b('0x9'));router[_0x405b('0xa')]('/',auth[_0x405b('0xb')](),controller[_0x405b('0xc')]);router[_0x405b('0xa')](_0x405b('0xd'),auth[_0x405b('0xb')](),controller[_0x405b('0xe')]);router[_0x405b('0xa')](_0x405b('0xf'),auth[_0x405b('0xb')](),controller[_0x405b('0x10')]);router[_0x405b('0x11')]('/',auth['isAuthenticated'](),controller[_0x405b('0x12')]);router[_0x405b('0x13')](_0x405b('0xf'),auth['isAuthenticated'](),controller['update']);router[_0x405b('0x14')](_0x405b('0xf'),auth[_0x405b('0xb')](),controller[_0x405b('0x15')]);module[_0x405b('0x16')]=router;
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js
index d585420..230b55d 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 _0xce5a=['ENUM','mouseOver','timeout','INTEGER','sequelize','STRING'];(function(_0x4ae625,_0xf396d0){var _0x31accf=function(_0x3ded6b){while(--_0x3ded6b){_0x4ae625['push'](_0x4ae625['shift']());}};_0x31accf(++_0xf396d0);}(_0xce5a,0xc4));var _0xace5=function(_0x15c421,_0x6366f7){_0x15c421=_0x15c421-0x0;var _0x5e5ed5=_0xce5a[_0x15c421];return _0x5e5ed5;};'use strict';var Sequelize=require(_0xace5('0x0'));module['exports']={'name':{'type':Sequelize[_0xace5('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0xace5('0x2')](_0xace5('0x3'),_0xace5('0x4')),'defaultValue':_0xace5('0x3')},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xace5('0x5')]}};
\ No newline at end of file
+var _0x62a2=['INTEGER','sequelize','exports','STRING'];(function(_0x3342d6,_0x186957){var _0x5ac09c=function(_0x399feb){while(--_0x399feb){_0x3342d6['push'](_0x3342d6['shift']());}};_0x5ac09c(++_0x186957);}(_0x62a2,0x115));var _0x262a=function(_0x40942e,_0x54c755){_0x40942e=_0x40942e-0x0;var _0x5a4935=_0x62a2[_0x40942e];return _0x5a4935;};'use strict';var Sequelize=require(_0x262a('0x0'));module[_0x262a('0x1')]={'name':{'type':Sequelize[_0x262a('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('mouseOver','timeout'),'defaultValue':'mouseOver'},'selector':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x262a('0x3')]}};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js
index f6f5c28..7a0cb3e 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 _0x9a6b=['find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','undefined','limit','count','offset','set','apply','reject','update','destroy','error','stack','name','send','params','model','ChatProactiveAction','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','include','then','create','body','catch'];(function(_0x57feea,_0x4e756d){var _0x5d61d5=function(_0x5a70c8){while(--_0x5a70c8){_0x57feea['push'](_0x57feea['shift']());}};_0x5d61d5(++_0x4e756d);}(_0x9a6b,0x77));var _0xb9a6=function(_0x19ed2e,_0x4c5da0){_0x19ed2e=_0x19ed2e-0x0;var _0xccadac=_0x9a6b[_0x19ed2e];return _0xccadac;};'use strict';var emlformat=require(_0xb9a6('0x0'));var rimraf=require(_0xb9a6('0x1'));var zipdir=require(_0xb9a6('0x2'));var jsonpatch=require(_0xb9a6('0x3'));var rp=require(_0xb9a6('0x4'));var moment=require(_0xb9a6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb9a6('0x6'));var util=require('util');var path=require(_0xb9a6('0x7'));var sox=require(_0xb9a6('0x8'));var csv=require(_0xb9a6('0x9'));var ejs=require(_0xb9a6('0xa'));var fs=require('fs');var fs_extra=require(_0xb9a6('0xb'));var _=require(_0xb9a6('0xc'));var squel=require(_0xb9a6('0xd'));var crypto=require(_0xb9a6('0xe'));var jsforce=require(_0xb9a6('0xf'));var deskjs=require(_0xb9a6('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb9a6('0x11'));var Papa=require(_0xb9a6('0x12'));var Redis=require('ioredis');var authService=require(_0xb9a6('0x13'));var qs=require(_0xb9a6('0x14'));var as=require(_0xb9a6('0x15'));var hardwareService=require(_0xb9a6('0x16'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xb9a6('0x17'));var licenseUtil=require('../../config/license/util');var db=require(_0xb9a6('0x18'))['db'];function respondWithStatusCode(_0x57b620,_0x3f4ce1){_0x3f4ce1=_0x3f4ce1||0xcc;return function(_0x21a637){if(_0x21a637){return _0x57b620[_0xb9a6('0x19')](_0x3f4ce1);}return _0x57b620[_0xb9a6('0x1a')](_0x3f4ce1)[_0xb9a6('0x1b')]();};}function respondWithResult(_0x6cbcc4,_0x3e140e){_0x3e140e=_0x3e140e||0xc8;return function(_0x158d6c){if(_0x158d6c){return _0x6cbcc4[_0xb9a6('0x1a')](_0x3e140e)['json'](_0x158d6c);}};}function respondWithFilteredResult(_0x463f33,_0x136d5d){return function(_0x414f37){if(_0x414f37){var _0x3342d2=typeof _0x136d5d['offset']===_0xb9a6('0x1c')&&typeof _0x136d5d[_0xb9a6('0x1d')]===_0xb9a6('0x1c');var _0x5b3395=_0x414f37[_0xb9a6('0x1e')];var _0x3b9a3b=_0x3342d2?0x0:_0x136d5d[_0xb9a6('0x1f')];var _0x1843e2=_0x3342d2?_0x414f37[_0xb9a6('0x1e')]:_0x136d5d['offset']+_0x136d5d[_0xb9a6('0x1d')];var _0x28e01a;if(_0x1843e2>=_0x5b3395){_0x1843e2=_0x5b3395;_0x28e01a=0xc8;}else{_0x28e01a=0xce;}_0x463f33[_0xb9a6('0x1a')](_0x28e01a);return _0x463f33[_0xb9a6('0x20')]('Content-Range',_0x3b9a3b+'-'+_0x1843e2+'/'+_0x5b3395)['json'](_0x414f37);}return null;};}function patchUpdates(_0x1cb89e){return function(_0x449b39){try{jsonpatch[_0xb9a6('0x21')](_0x449b39,_0x1cb89e,!![]);}catch(_0x49c74b){return BPromise[_0xb9a6('0x22')](_0x49c74b);}return _0x449b39['save']();};}function saveUpdates(_0xc15e48,_0x36c6c1){return function(_0x50d3d4){if(_0x50d3d4){return _0x50d3d4[_0xb9a6('0x23')](_0xc15e48)['then'](function(_0x526721){return _0x526721;});}return null;};}function removeEntity(_0x3bc642,_0x1b838a){return function(_0x73dee3){if(_0x73dee3){return _0x73dee3[_0xb9a6('0x24')]()['then'](function(){_0x3bc642[_0xb9a6('0x1a')](0xcc)[_0xb9a6('0x1b')]();});}};}function handleEntityNotFound(_0x373f62,_0x1d36e3){return function(_0x4b0be8){if(!_0x4b0be8){_0x373f62[_0xb9a6('0x19')](0x194);}return _0x4b0be8;};}function handleError(_0x3896c1,_0x3ebdcd){_0x3ebdcd=_0x3ebdcd||0x1f4;return function(_0x427890){logger[_0xb9a6('0x25')](_0x427890[_0xb9a6('0x26')]);if(_0x427890[_0xb9a6('0x27')]){delete _0x427890['name'];}_0x3896c1[_0xb9a6('0x1a')](_0x3ebdcd)[_0xb9a6('0x28')](_0x427890);};}exports['show']=function(_0x429830,_0x4c2abb){var _0x1fdb38={'raw':!![],'where':{'id':_0x429830[_0xb9a6('0x29')]['id']}},_0x5d75ce={};_0x5d75ce[_0xb9a6('0x2a')]=_['keys'](db[_0xb9a6('0x2b')][_0xb9a6('0x2c')]);_0x5d75ce[_0xb9a6('0x2d')]=_[_0xb9a6('0x2e')](_0x429830[_0xb9a6('0x2d')]);_0x5d75ce[_0xb9a6('0x2f')]=_[_0xb9a6('0x30')](_0x5d75ce['model'],_0x5d75ce[_0xb9a6('0x2d')]);_0x1fdb38[_0xb9a6('0x31')]=_[_0xb9a6('0x30')](_0x5d75ce[_0xb9a6('0x2a')],qs['fields'](_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x32')]));_0x1fdb38['attributes']=_0x1fdb38[_0xb9a6('0x31')][_0xb9a6('0x33')]?_0x1fdb38[_0xb9a6('0x31')]:_0x5d75ce[_0xb9a6('0x2a')];if(_0x429830[_0xb9a6('0x2d')][_0xb9a6('0x34')]){_0x1fdb38[_0xb9a6('0x35')]=[{'all':!![]}];}_0x1fdb38=_['merge']({},_0x1fdb38,_0x429830['options']);return db['ChatProactiveAction']['find'](_0x1fdb38)['then'](handleEntityNotFound(_0x4c2abb,null))[_0xb9a6('0x36')](respondWithResult(_0x4c2abb,null))['catch'](handleError(_0x4c2abb,null));};exports[_0xb9a6('0x37')]=function(_0x56945d,_0x287329){return db[_0xb9a6('0x2b')][_0xb9a6('0x37')](_0x56945d[_0xb9a6('0x38')],{})[_0xb9a6('0x36')](respondWithResult(_0x287329,0xc9))[_0xb9a6('0x39')](handleError(_0x287329,null));};exports[_0xb9a6('0x23')]=function(_0xc96b8,_0x1e2835){if(_0xc96b8[_0xb9a6('0x38')]['id']){delete _0xc96b8[_0xb9a6('0x38')]['id'];}return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xc96b8[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x1e2835,null))[_0xb9a6('0x36')](saveUpdates(_0xc96b8[_0xb9a6('0x38')],null))['then'](respondWithResult(_0x1e2835,null))[_0xb9a6('0x39')](handleError(_0x1e2835,null));};exports[_0xb9a6('0x24')]=function(_0xdc704f,_0x5a8bf2){return db[_0xb9a6('0x2b')][_0xb9a6('0x3a')]({'where':{'id':_0xdc704f[_0xb9a6('0x29')]['id']}})[_0xb9a6('0x36')](handleEntityNotFound(_0x5a8bf2,null))[_0xb9a6('0x36')](removeEntity(_0x5a8bf2,null))[_0xb9a6('0x39')](handleError(_0x5a8bf2,null));};
\ No newline at end of file
+var _0xb39f=['then','error','stack','name','send','show','params','model','keys','query','filters','intersection','attributes','fields','includeAll','merge','find','catch','create','ChatProactiveAction','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','mustache','path','sox','ejs','fs-extra','lodash','squel','desk.js','to-csv','../../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','undefined','limit','count','offset','set','Content-Range','json','apply','reject','save','update'];(function(_0x45505a,_0x59368a){var _0x36a1f6=function(_0x2f4542){while(--_0x2f4542){_0x45505a['push'](_0x45505a['shift']());}};_0x36a1f6(++_0x59368a);}(_0xb39f,0x1e6));var _0xfb39=function(_0x6213c6,_0x3738b3){_0x6213c6=_0x6213c6-0x0;var _0x456a81=_0xb39f[_0x6213c6];return _0x456a81;};'use strict';var emlformat=require(_0xfb39('0x0'));var rimraf=require(_0xfb39('0x1'));var zipdir=require(_0xfb39('0x2'));var jsonpatch=require(_0xfb39('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xfb39('0x4'));var util=require('util');var path=require(_0xfb39('0x5'));var sox=require(_0xfb39('0x6'));var csv=require('to-csv');var ejs=require(_0xfb39('0x7'));var fs=require('fs');var fs_extra=require(_0xfb39('0x8'));var _=require(_0xfb39('0x9'));var squel=require(_0xfb39('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfb39('0xb'));var toCsv=require(_0xfb39('0xc'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xfb39('0xd'));var qs=require(_0xfb39('0xe'));var as=require(_0xfb39('0xf'));var hardwareService=require(_0xfb39('0x10'));var logger=require(_0xfb39('0x11'))('api');var utils=require(_0xfb39('0x12'));var config=require(_0xfb39('0x13'));var licenseUtil=require(_0xfb39('0x14'));var db=require(_0xfb39('0x15'))['db'];function respondWithStatusCode(_0x35aeb4,_0x5e1cfa){_0x5e1cfa=_0x5e1cfa||0xcc;return function(_0x58249d){if(_0x58249d){return _0x35aeb4[_0xfb39('0x16')](_0x5e1cfa);}return _0x35aeb4[_0xfb39('0x17')](_0x5e1cfa)[_0xfb39('0x18')]();};}function respondWithResult(_0x480a86,_0x3ef405){_0x3ef405=_0x3ef405||0xc8;return function(_0x2a3724){if(_0x2a3724){return _0x480a86['status'](_0x3ef405)['json'](_0x2a3724);}};}function respondWithFilteredResult(_0x177a14,_0x4a0662){return function(_0x31b1dc){if(_0x31b1dc){var _0x4897be=typeof _0x4a0662['offset']===_0xfb39('0x19')&&typeof _0x4a0662[_0xfb39('0x1a')]===_0xfb39('0x19');var _0x1d1ad3=_0x31b1dc[_0xfb39('0x1b')];var _0x5cb552=_0x4897be?0x0:_0x4a0662[_0xfb39('0x1c')];var _0xd2ad6d=_0x4897be?_0x31b1dc[_0xfb39('0x1b')]:_0x4a0662[_0xfb39('0x1c')]+_0x4a0662['limit'];var _0x50765f;if(_0xd2ad6d>=_0x1d1ad3){_0xd2ad6d=_0x1d1ad3;_0x50765f=0xc8;}else{_0x50765f=0xce;}_0x177a14[_0xfb39('0x17')](_0x50765f);return _0x177a14[_0xfb39('0x1d')](_0xfb39('0x1e'),_0x5cb552+'-'+_0xd2ad6d+'/'+_0x1d1ad3)[_0xfb39('0x1f')](_0x31b1dc);}return null;};}function patchUpdates(_0x116b22){return function(_0x57bebf){try{jsonpatch[_0xfb39('0x20')](_0x57bebf,_0x116b22,!![]);}catch(_0x3d5697){return BPromise[_0xfb39('0x21')](_0x3d5697);}return _0x57bebf[_0xfb39('0x22')]();};}function saveUpdates(_0x3b4393,_0x5f2f60){return function(_0x50b2e2){if(_0x50b2e2){return _0x50b2e2[_0xfb39('0x23')](_0x3b4393)[_0xfb39('0x24')](function(_0x561b60){return _0x561b60;});}return null;};}function removeEntity(_0x1b1e65,_0x33d029){return function(_0x23bd78){if(_0x23bd78){return _0x23bd78['destroy']()['then'](function(){_0x1b1e65[_0xfb39('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x228288,_0x14651a){return function(_0x30dbc5){if(!_0x30dbc5){_0x228288[_0xfb39('0x16')](0x194);}return _0x30dbc5;};}function handleError(_0x118aa7,_0x2a7add){_0x2a7add=_0x2a7add||0x1f4;return function(_0x38e145){logger[_0xfb39('0x25')](_0x38e145[_0xfb39('0x26')]);if(_0x38e145[_0xfb39('0x27')]){delete _0x38e145[_0xfb39('0x27')];}_0x118aa7[_0xfb39('0x17')](_0x2a7add)[_0xfb39('0x28')](_0x38e145);};}exports[_0xfb39('0x29')]=function(_0x5d05e2,_0x4a98e9){var _0x34977d={'raw':!![],'where':{'id':_0x5d05e2[_0xfb39('0x2a')]['id']}},_0x233d80={};_0x233d80[_0xfb39('0x2b')]=_[_0xfb39('0x2c')](db['ChatProactiveAction']['rawAttributes']);_0x233d80[_0xfb39('0x2d')]=_['keys'](_0x5d05e2['query']);_0x233d80[_0xfb39('0x2e')]=_[_0xfb39('0x2f')](_0x233d80['model'],_0x233d80['query']);_0x34977d[_0xfb39('0x30')]=_[_0xfb39('0x2f')](_0x233d80[_0xfb39('0x2b')],qs[_0xfb39('0x31')](_0x5d05e2[_0xfb39('0x2d')]['fields']));_0x34977d[_0xfb39('0x30')]=_0x34977d[_0xfb39('0x30')]['length']?_0x34977d[_0xfb39('0x30')]:_0x233d80['model'];if(_0x5d05e2[_0xfb39('0x2d')][_0xfb39('0x32')]){_0x34977d['include']=[{'all':!![]}];}_0x34977d=_[_0xfb39('0x33')]({},_0x34977d,_0x5d05e2['options']);return db['ChatProactiveAction'][_0xfb39('0x34')](_0x34977d)[_0xfb39('0x24')](handleEntityNotFound(_0x4a98e9,null))[_0xfb39('0x24')](respondWithResult(_0x4a98e9,null))[_0xfb39('0x35')](handleError(_0x4a98e9,null));};exports[_0xfb39('0x36')]=function(_0x219936,_0x77e2b5){return db[_0xfb39('0x37')][_0xfb39('0x36')](_0x219936['body'],{})[_0xfb39('0x24')](respondWithResult(_0x77e2b5,0xc9))[_0xfb39('0x35')](handleError(_0x77e2b5,null));};exports[_0xfb39('0x23')]=function(_0x25af42,_0x39354c){if(_0x25af42[_0xfb39('0x38')]['id']){delete _0x25af42[_0xfb39('0x38')]['id'];}return db[_0xfb39('0x37')]['find']({'where':{'id':_0x25af42[_0xfb39('0x2a')]['id']}})[_0xfb39('0x24')](handleEntityNotFound(_0x39354c,null))['then'](saveUpdates(_0x25af42[_0xfb39('0x38')],null))[_0xfb39('0x24')](respondWithResult(_0x39354c,null))[_0xfb39('0x35')](handleError(_0x39354c,null));};exports[_0xfb39('0x39')]=function(_0x2297df,_0x1347c0){return db[_0xfb39('0x37')][_0xfb39('0x34')]({'where':{'id':_0x2297df[_0xfb39('0x2a')]['id']}})[_0xfb39('0x24')](handleEntityNotFound(_0x1347c0,null))[_0xfb39('0x24')](removeEntity(_0x1347c0,null))['catch'](handleError(_0x1347c0,null));};
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js
index de1fed9..48e5e3d 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 _0x7c32=['../../config/environment','./chatProactiveAction.attributes','exports','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x466409,_0x44b1a2){var _0x4e1aac=function(_0x19a6cb){while(--_0x19a6cb){_0x466409['push'](_0x466409['shift']());}};_0x4e1aac(++_0x44b1a2);}(_0x7c32,0x1f0));var _0x27c3=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0x7c32[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x27c3('0x0'));var util=require(_0x27c3('0x1'));var logger=require(_0x27c3('0x2'))(_0x27c3('0x3'));var moment=require('moment');var BPromise=require(_0x27c3('0x4'));var rp=require(_0x27c3('0x5'));var fs=require('fs');var path=require(_0x27c3('0x6'));var rimraf=require(_0x27c3('0x7'));var config=require(_0x27c3('0x8'));var attributes=require(_0x27c3('0x9'));module[_0x27c3('0xa')]=function(_0x3e1433,_0x46e66d){return _0x3e1433[_0x27c3('0xb')](_0x27c3('0xc'),attributes,{'tableName':_0x27c3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x4d10=['path','rimraf','../../config/environment','chat_proactive_actions','../../config/logger','moment','bluebird','request-promise'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x4d10,0x114));var _0x04d1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4d10[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x04d1('0x0'))('api');var moment=require(_0x04d1('0x1'));var BPromise=require(_0x04d1('0x2'));var rp=require(_0x04d1('0x3'));var fs=require('fs');var path=require(_0x04d1('0x4'));var rimraf=require(_0x04d1('0x5'));var config=require(_0x04d1('0x6'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x3c584f,_0x441cc6){return _0x3c584f['define']('ChatProactiveAction',attributes,{'tableName':_0x04d1('0x7'),'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 634931b..eebc567 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 _0xc3a6=['client','request','then','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xc3a6,0x116));var _0x6c3a=function(_0x46833f,_0x285654){_0x46833f=_0x46833f-0x0;var _0xb80091=_0xc3a6[_0x46833f];return _0xb80091;};'use strict';var _=require(_0x6c3a('0x0'));var util=require('util');var moment=require(_0x6c3a('0x1'));var BPromise=require(_0x6c3a('0x2'));var rs=require(_0x6c3a('0x3'));var fs=require('fs');var Redis=require(_0x6c3a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6c3a('0x5'));var logger=require(_0x6c3a('0x6'))(_0x6c3a('0x7'));var config=require(_0x6c3a('0x8'));var jayson=require(_0x6c3a('0x9'));var client=jayson[_0x6c3a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3501e9,_0x2bbeb5,_0x26bc39){return new BPromise(function(_0x25ea96,_0x33c926){return client[_0x6c3a('0xb')](_0x3501e9,_0x26bc39)[_0x6c3a('0xc')](function(_0x4af117){logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x2bbeb5,_0x6c3a('0xd'));logger[_0x6c3a('0xe')](_0x6c3a('0xf'),_0x2bbeb5,'request\x20sent',JSON[_0x6c3a('0x10')](_0x4af117));if(_0x4af117[_0x6c3a('0x11')]){if(_0x4af117[_0x6c3a('0x11')][_0x6c3a('0x12')]===0x1f4){logger['error'](_0x6c3a('0x13'),_0x2bbeb5,_0x4af117[_0x6c3a('0x11')][_0x6c3a('0x14')]);return _0x33c926(_0x4af117['error']['message']);}logger[_0x6c3a('0x11')](_0x6c3a('0x13'),_0x2bbeb5,_0x4af117['error']['message']);return _0x25ea96(_0x4af117[_0x6c3a('0x11')]['message']);}else{logger[_0x6c3a('0x15')](_0x6c3a('0x13'),_0x2bbeb5,_0x6c3a('0xd'));_0x25ea96(_0x4af117[_0x6c3a('0x16')][_0x6c3a('0x14')]);}})[_0x6c3a('0x17')](function(_0x33c96a){logger[_0x6c3a('0x11')](_0x6c3a('0x13'),_0x2bbeb5,_0x33c96a);_0x33c926(_0x33c96a);});});}
\ No newline at end of file
+var _0xa53c=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ChatProactiveAction,\x20%s,\x20%s','debug','request\x20sent'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xa53c,0x1af));var _0xca53=function(_0x4d65ee,_0x2e3095){_0x4d65ee=_0x4d65ee-0x0;var _0x2878cc=_0xa53c[_0x4d65ee];return _0x2878cc;};'use strict';var _=require(_0xca53('0x0'));var util=require(_0xca53('0x1'));var moment=require(_0xca53('0x2'));var BPromise=require(_0xca53('0x3'));var rs=require(_0xca53('0x4'));var fs=require('fs');var Redis=require(_0xca53('0x5'));var db=require(_0xca53('0x6'))['db'];var utils=require(_0xca53('0x7'));var logger=require(_0xca53('0x8'))(_0xca53('0x9'));var config=require(_0xca53('0xa'));var jayson=require(_0xca53('0xb'));var client=jayson[_0xca53('0xc')][_0xca53('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x566c47,_0x151a52,_0x167925){return new BPromise(function(_0x39dc50,_0x5bcc20){return client[_0xca53('0xe')](_0x566c47,_0x167925)[_0xca53('0xf')](function(_0x1f462c){logger['info'](_0xca53('0x10'),_0x151a52,'request\x20sent');logger[_0xca53('0x11')]('ChatProactiveAction,\x20%s,\x20%s,\x20%s',_0x151a52,_0xca53('0x12'),JSON[_0xca53('0x13')](_0x1f462c));if(_0x1f462c[_0xca53('0x14')]){if(_0x1f462c['error'][_0xca53('0x15')]===0x1f4){logger['error'](_0xca53('0x10'),_0x151a52,_0x1f462c[_0xca53('0x14')][_0xca53('0x16')]);return _0x5bcc20(_0x1f462c['error'][_0xca53('0x16')]);}logger[_0xca53('0x14')](_0xca53('0x10'),_0x151a52,_0x1f462c[_0xca53('0x14')]['message']);return _0x39dc50(_0x1f462c[_0xca53('0x14')][_0xca53('0x16')]);}else{logger[_0xca53('0x17')](_0xca53('0x10'),_0x151a52,_0xca53('0x12'));_0x39dc50(_0x1f462c['result']['message']);}})[_0xca53('0x18')](function(_0x481e92){logger['error'](_0xca53('0x10'),_0x151a52,_0x481e92);_0x5bcc20(_0x481e92);});});}
\ No newline at end of file
diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js
index 22ff070..c66e5e9 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 _0x8958=['show','post','put','update','delete','destroy','exports','util','fs-extra','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id','isAuthenticated'];(function(_0x3ffbf1,_0x293b60){var _0x42499a=function(_0x21e20e){while(--_0x21e20e){_0x3ffbf1['push'](_0x3ffbf1['shift']());}};_0x42499a(++_0x293b60);}(_0x8958,0x93));var _0x8895=function(_0x264b38,_0x5a64dd){_0x264b38=_0x264b38-0x0;var _0x5813e=_0x8958[_0x264b38];return _0x5813e;};'use strict';var multer=require('multer');var util=require(_0x8895('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var fs_extra=require(_0x8895('0x1'));var auth=require('../../components/auth/service');var interaction=require(_0x8895('0x2'));var config=require(_0x8895('0x3'));var controller=require(_0x8895('0x4'));router['get'](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0x7')]);router[_0x8895('0x8')]('/',auth[_0x8895('0x6')](),controller['create']);router[_0x8895('0x9')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xa')]);router[_0x8895('0xb')](_0x8895('0x5'),auth[_0x8895('0x6')](),controller[_0x8895('0xc')]);module[_0x8895('0xd')]=router;
\ No newline at end of file
+var _0x4819=['post','isAuthenticated','create','put','update','destroy','exports','util','path','connect-timeout','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','/:id'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0x4819,0xcd));var _0x9481=function(_0x4c207b,_0x59f530){_0x4c207b=_0x4c207b-0x0;var _0x560c4f=_0x4819[_0x4c207b];return _0x560c4f;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var fs_extra=require(_0x9481('0x5'));var auth=require(_0x9481('0x6'));var interaction=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var controller=require(_0x9481('0x9'));router['get'](_0x9481('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x9481('0xb')]('/',auth[_0x9481('0xc')](),controller[_0x9481('0xd')]);router[_0x9481('0xe')](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['delete'](_0x9481('0xa'),auth['isAuthenticated'](),controller[_0x9481('0x10')]);module[_0x9481('0x11')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js
index d9e9279..06589d2 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 _0xebc4=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0xebc4,0x6e));var _0x4ebc=function(_0x347dc0,_0x3aed2b){_0x347dc0=_0x347dc0-0x0;var _0x5416e3=_0xebc4[_0x347dc0];return _0x5416e3;};'use strict';var Sequelize=require(_0x4ebc('0x0'));module[_0x4ebc('0x1')]={'name':{'type':Sequelize[_0x4ebc('0x2')],'unique':_0x4ebc('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x4ebc('0x2')]},'timeout':{'type':Sequelize[_0x4ebc('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x4ebc('0x5')](_0x4ebc('0x6'),_0x4ebc('0x7'),_0x4ebc('0x8'))}};
\ No newline at end of file
+var _0x97fe=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x1f8d0c,_0x2ecdf6){var _0x4af449=function(_0x56db5e){while(--_0x56db5e){_0x1f8d0c['push'](_0x1f8d0c['shift']());}};_0x4af449(++_0x2ecdf6);}(_0x97fe,0x117));var _0xe97f=function(_0x1f4a0c,_0x901279){_0x1f4a0c=_0x1f4a0c-0x0;var _0x3ba284=_0x97fe[_0x1f4a0c];return _0x3ba284;};'use strict';var Sequelize=require(_0xe97f('0x0'));module[_0xe97f('0x1')]={'name':{'type':Sequelize[_0xe97f('0x2')],'unique':_0xe97f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe97f('0x2')]},'timeout':{'type':Sequelize[_0xe97f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xe97f('0x5'),_0xe97f('0x6'),_0xe97f('0x7'))}};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js
index eac8500..0f45206 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 _0xb02f=['addTeams','ids','Agents','online','interface','sequelize','transaction','each','forEach','userChatQueue:save','select','field','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','toString','every','TeamId','includes','compact','value','removeTeams','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','fs-extra','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','redis','./chatQueue.socket','register','jayson/promise','client','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','offset','limit','count','Content-Range','apply','reject','save','update','destroy','then','get','ChatQueues','UserProfileResource','name','index','ChatQueue','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','merge','type','VIRTUAL','filter','includeAll','include','findAll','rows','catch','show','fields','find','create','body','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','UserChatQueue','nolimit','pick','ChatQueueId','options','User','agent','updatedAt','format','SIP','chatPause','createdAt','getTeams','findOne','Team'];(function(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xb02f,0x1d0));var _0xfb02=function(_0x56dc9a,_0xde3f79){_0x56dc9a=_0x56dc9a-0x0;var _0x173231=_0xb02f[_0x56dc9a];return _0x173231;};'use strict';var emlformat=require(_0xfb02('0x0'));var rimraf=require(_0xfb02('0x1'));var zipdir=require(_0xfb02('0x2'));var jsonpatch=require(_0xfb02('0x3'));var rp=require(_0xfb02('0x4'));var moment=require(_0xfb02('0x5'));var BPromise=require(_0xfb02('0x6'));var Mustache=require(_0xfb02('0x7'));var util=require(_0xfb02('0x8'));var path=require('path');var sox=require(_0xfb02('0x9'));var csv=require('to-csv');var ejs=require(_0xfb02('0xa'));var fs=require('fs');var fs_extra=require(_0xfb02('0xb'));var _=require('lodash');var squel=require(_0xfb02('0xc'));var crypto=require(_0xfb02('0xd'));var jsforce=require(_0xfb02('0xe'));var deskjs=require(_0xfb02('0xf'));var toCsv=require(_0xfb02('0x10'));var querystring=require(_0xfb02('0x11'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfb02('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfb02('0x13'))(_0xfb02('0x14'));var utils=require(_0xfb02('0x15'));var config=require(_0xfb02('0x16'));var licenseUtil=require(_0xfb02('0x17'));var db=require(_0xfb02('0x18'))['db'];config[_0xfb02('0x19')]=_['defaults'](config[_0xfb02('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfb02('0x19')]));require(_0xfb02('0x1a'))[_0xfb02('0x1b')](socket);var jayson=require(_0xfb02('0x1c'));var client=jayson[_0xfb02('0x1d')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2aae81,_0x1ed274,_0xb02380,_0x297254){return new BPromise(function(_0x132b66,_0x5a51bf){var _0x3e342b=_0x297254||client;return _0x3e342b['request'](_0x2aae81,_0xb02380)['then'](function(_0x3a503f){logger[_0xfb02('0x1e')](_0xfb02('0x1f'),_0x1ed274,_0xfb02('0x20'));logger[_0xfb02('0x21')](_0xfb02('0x22'),_0x1ed274,_0xfb02('0x20'),JSON[_0xfb02('0x23')](_0x3a503f));if(_0x3a503f[_0xfb02('0x24')]){if(_0x3a503f[_0xfb02('0x24')][_0xfb02('0x25')]===0x1f4){logger['error']('ChatQueue,\x20%s,\x20%s',_0x1ed274,_0x3a503f[_0xfb02('0x24')][_0xfb02('0x26')]);return _0x5a51bf(_0x3a503f[_0xfb02('0x24')][_0xfb02('0x26')]);}logger[_0xfb02('0x24')](_0xfb02('0x1f'),_0x1ed274,_0x3a503f[_0xfb02('0x24')][_0xfb02('0x26')]);return _0x132b66(_0x3a503f['error'][_0xfb02('0x26')]);}else{logger[_0xfb02('0x1e')](_0xfb02('0x1f'),_0x1ed274,_0xfb02('0x20'));_0x132b66(_0x3a503f['result'][_0xfb02('0x26')]);}})['catch'](function(_0x4951a7){logger[_0xfb02('0x24')]('ChatQueue,\x20%s,\x20%s',_0x1ed274,_0x4951a7);_0x5a51bf(_0x4951a7);});});}function respondWithStatusCode(_0x208762,_0x3987d6){_0x3987d6=_0x3987d6||0xcc;return function(_0x384f8d){if(_0x384f8d){return _0x208762[_0xfb02('0x27')](_0x3987d6);}return _0x208762[_0xfb02('0x28')](_0x3987d6)[_0xfb02('0x29')]();};}function respondWithResult(_0x3b008f,_0x44bc74){_0x44bc74=_0x44bc74||0xc8;return function(_0x2c7499){if(_0x2c7499){return _0x3b008f['status'](_0x44bc74)[_0xfb02('0x2a')](_0x2c7499);}};}function respondWithFilteredResult(_0x12de87,_0x59003f){return function(_0x550d25){if(_0x550d25){var _0x41520c=typeof _0x59003f[_0xfb02('0x2b')]==='undefined'&&typeof _0x59003f[_0xfb02('0x2c')]==='undefined';var _0x3a6f12=_0x550d25[_0xfb02('0x2d')];var _0xdca304=_0x41520c?0x0:_0x59003f['offset'];var _0x3e535a=_0x41520c?_0x550d25[_0xfb02('0x2d')]:_0x59003f['offset']+_0x59003f[_0xfb02('0x2c')];var _0x55185a;if(_0x3e535a>=_0x3a6f12){_0x3e535a=_0x3a6f12;_0x55185a=0xc8;}else{_0x55185a=0xce;}_0x12de87['status'](_0x55185a);return _0x12de87['set'](_0xfb02('0x2e'),_0xdca304+'-'+_0x3e535a+'/'+_0x3a6f12)['json'](_0x550d25);}return null;};}function patchUpdates(_0x574b5c){return function(_0x7b03){try{jsonpatch[_0xfb02('0x2f')](_0x7b03,_0x574b5c,!![]);}catch(_0x713d4b){return BPromise[_0xfb02('0x30')](_0x713d4b);}return _0x7b03[_0xfb02('0x31')]();};}function saveUpdates(_0x8f6308,_0x1275aa){return function(_0x2f0c44){if(_0x2f0c44){return _0x2f0c44[_0xfb02('0x32')](_0x8f6308)['then'](function(_0xf3d0e2){return _0xf3d0e2;});}return null;};}function removeEntity(_0x45b8fd,_0x187e28){return function(_0x44d1ee){if(_0x44d1ee){return _0x44d1ee[_0xfb02('0x33')]()[_0xfb02('0x34')](function(){var _0x3775d4=_0x44d1ee[_0xfb02('0x35')]({'plain':!![]});var _0x18a1bd=_0xfb02('0x36');return db[_0xfb02('0x37')][_0xfb02('0x33')]({'where':{'type':_0x18a1bd,'resourceId':_0x3775d4['id']}})[_0xfb02('0x34')](function(){return _0x44d1ee;});})[_0xfb02('0x34')](function(){_0x45b8fd['status'](0xcc)[_0xfb02('0x29')]();});}};}function handleEntityNotFound(_0x561e22,_0x454a0f){return function(_0x282ae0){if(!_0x282ae0){_0x561e22['sendStatus'](0x194);}return _0x282ae0;};}function handleError(_0x13d1df,_0x518a21){_0x518a21=_0x518a21||0x1f4;return function(_0x52abc7){logger[_0xfb02('0x24')](_0x52abc7['stack']);if(_0x52abc7[_0xfb02('0x38')]){delete _0x52abc7[_0xfb02('0x38')];}_0x13d1df[_0xfb02('0x28')](_0x518a21)['send'](_0x52abc7);};}exports[_0xfb02('0x39')]=function(_0x2b87a0,_0xd0cee2){var _0x5c706f={},_0x139f44={},_0xe5569d={'count':0x0,'rows':[]};var _0x2c8694=_['map'](db[_0xfb02('0x3a')][_0xfb02('0x3b')],function(_0x27d001){return{'name':_0x27d001[_0xfb02('0x3c')],'type':_0x27d001['type']['key']};});_0x139f44[_0xfb02('0x3d')]=_[_0xfb02('0x3e')](_0x2c8694,'name');_0x139f44[_0xfb02('0x3f')]=_[_0xfb02('0x40')](_0x2b87a0[_0xfb02('0x3f')]);_0x139f44[_0xfb02('0x41')]=_[_0xfb02('0x42')](_0x139f44[_0xfb02('0x3d')],_0x139f44[_0xfb02('0x3f')]);_0x5c706f['attributes']=_[_0xfb02('0x42')](_0x139f44['model'],qs['fields'](_0x2b87a0[_0xfb02('0x3f')]['fields']));_0x5c706f[_0xfb02('0x43')]=_0x5c706f['attributes'][_0xfb02('0x44')]?_0x5c706f[_0xfb02('0x43')]:_0x139f44[_0xfb02('0x3d')];if(!_0x2b87a0[_0xfb02('0x3f')][_0xfb02('0x45')]('nolimit')){_0x5c706f[_0xfb02('0x2c')]=qs[_0xfb02('0x2c')](_0x2b87a0[_0xfb02('0x3f')][_0xfb02('0x2c')]);_0x5c706f[_0xfb02('0x2b')]=qs['offset'](_0x2b87a0['query'][_0xfb02('0x2b')]);}_0x5c706f[_0xfb02('0x46')]=qs['sort'](_0x2b87a0['query'][_0xfb02('0x47')]);_0x5c706f[_0xfb02('0x48')]=qs[_0xfb02('0x41')](_['pick'](_0x2b87a0[_0xfb02('0x3f')],_0x139f44[_0xfb02('0x41')]),_0x2c8694);if(_0x2b87a0['query']['filter']){_0x5c706f['where']=_[_0xfb02('0x49')](_0x5c706f[_0xfb02('0x48')],{'$or':_[_0xfb02('0x3e')](_0x2c8694,function(_0x51fd82){if(_0x51fd82[_0xfb02('0x4a')]!==_0xfb02('0x4b')){var _0x2547ca={};_0x2547ca[_0x51fd82[_0xfb02('0x38')]]={'$like':'%'+_0x2b87a0[_0xfb02('0x3f')][_0xfb02('0x4c')]+'%'};return _0x2547ca;}})});}_0x5c706f=_[_0xfb02('0x49')]({},_0x5c706f,_0x2b87a0['options']);var _0x4dad12={'where':_0x5c706f[_0xfb02('0x48')]};return db[_0xfb02('0x3a')]['count'](_0x4dad12)[_0xfb02('0x34')](function(_0xc0a5a8){_0xe5569d['count']=_0xc0a5a8;if(_0x2b87a0[_0xfb02('0x3f')][_0xfb02('0x4d')]){_0x5c706f[_0xfb02('0x4e')]=[{'all':!![]}];}return db[_0xfb02('0x3a')][_0xfb02('0x4f')](_0x5c706f);})[_0xfb02('0x34')](function(_0x33e759){_0xe5569d[_0xfb02('0x50')]=_0x33e759;return _0xe5569d;})[_0xfb02('0x34')](respondWithFilteredResult(_0xd0cee2,_0x5c706f))[_0xfb02('0x51')](handleError(_0xd0cee2,null));};exports[_0xfb02('0x52')]=function(_0x26644b,_0x4b1e93){var _0x48dab2={'raw':!![],'where':{'id':_0x26644b['params']['id']}},_0x2e845e={};_0x2e845e[_0xfb02('0x3d')]=_[_0xfb02('0x40')](db[_0xfb02('0x3a')]['rawAttributes']);_0x2e845e[_0xfb02('0x3f')]=_[_0xfb02('0x40')](_0x26644b[_0xfb02('0x3f')]);_0x2e845e['filters']=_[_0xfb02('0x42')](_0x2e845e['model'],_0x2e845e[_0xfb02('0x3f')]);_0x48dab2[_0xfb02('0x43')]=_[_0xfb02('0x42')](_0x2e845e[_0xfb02('0x3d')],qs[_0xfb02('0x53')](_0x26644b[_0xfb02('0x3f')][_0xfb02('0x53')]));_0x48dab2[_0xfb02('0x43')]=_0x48dab2[_0xfb02('0x43')][_0xfb02('0x44')]?_0x48dab2['attributes']:_0x2e845e[_0xfb02('0x3d')];if(_0x26644b[_0xfb02('0x3f')][_0xfb02('0x4d')]){_0x48dab2[_0xfb02('0x4e')]=[{'all':!![]}];}_0x48dab2=_['merge']({},_0x48dab2,_0x26644b['options']);return db[_0xfb02('0x3a')][_0xfb02('0x54')](_0x48dab2)[_0xfb02('0x34')](handleEntityNotFound(_0x4b1e93,null))[_0xfb02('0x34')](respondWithResult(_0x4b1e93,null))[_0xfb02('0x51')](handleError(_0x4b1e93,null));};exports[_0xfb02('0x55')]=function(_0x6f0b91,_0x261a50){return db[_0xfb02('0x3a')][_0xfb02('0x55')](_0x6f0b91[_0xfb02('0x56')],{})[_0xfb02('0x34')](function(_0x2db0de){var _0x2b2ce2=_0x6f0b91['user'][_0xfb02('0x35')]({'plain':!![]});if(!_0x2b2ce2)throw new Error(_0xfb02('0x57'));if(_0x2b2ce2[_0xfb02('0x58')]===_0xfb02('0x59')){var _0x1295fa=_0x2db0de[_0xfb02('0x35')]({'plain':!![]});var _0x42e87f=_0xfb02('0x36');return db[_0xfb02('0x5a')][_0xfb02('0x54')]({'where':{'name':_0x42e87f,'userProfileId':_0x2b2ce2[_0xfb02('0x5b')]},'raw':!![]})[_0xfb02('0x34')](function(_0x4e5ea7){if(_0x4e5ea7&&_0x4e5ea7[_0xfb02('0x5c')]===0x0){return db['UserProfileResource']['create']({'name':_0x1295fa[_0xfb02('0x38')],'resourceId':_0x1295fa['id'],'type':_0x4e5ea7['name'],'sectionId':_0x4e5ea7['id']},{})[_0xfb02('0x34')](function(){return _0x2db0de;});}else{return _0x2db0de;}})[_0xfb02('0x51')](function(_0x55b948){logger[_0xfb02('0x24')](_0xfb02('0x5d'),_0x55b948);throw _0x55b948;});}return _0x2db0de;})[_0xfb02('0x34')](respondWithResult(_0x261a50,0xc9))[_0xfb02('0x51')](handleError(_0x261a50,null));};exports['update']=function(_0xbbc64f,_0x19b54d){if(_0xbbc64f['body']['id']){delete _0xbbc64f[_0xfb02('0x56')]['id'];}return db[_0xfb02('0x3a')][_0xfb02('0x54')]({'where':{'id':_0xbbc64f[_0xfb02('0x5e')]['id']}})['then'](handleEntityNotFound(_0x19b54d,null))[_0xfb02('0x34')](saveUpdates(_0xbbc64f[_0xfb02('0x56')],null))[_0xfb02('0x34')](respondWithResult(_0x19b54d,null))[_0xfb02('0x51')](handleError(_0x19b54d,null));};exports[_0xfb02('0x33')]=function(_0x5d1cea,_0x55df2c){return db[_0xfb02('0x3a')]['find']({'where':{'id':_0x5d1cea['params']['id']}})[_0xfb02('0x34')](handleEntityNotFound(_0x55df2c,null))[_0xfb02('0x34')](removeEntity(_0x55df2c,null))[_0xfb02('0x51')](handleError(_0x55df2c,null));};exports['describe']=function(_0x3db0e0,_0x5698a5){return db[_0xfb02('0x3a')][_0xfb02('0x5f')]()[_0xfb02('0x34')](respondWithResult(_0x5698a5,null))['catch'](handleError(_0x5698a5,null));};exports[_0xfb02('0x60')]=function(_0x4ffb18,_0x1f66f4,_0x2be89e){var _0x55db67={'raw':!![],'where':{}},_0x3e84cd={},_0x36125b;return db['ChatQueue']['findOne']({'where':{'id':_0x4ffb18[_0xfb02('0x5e')]['id']}})[_0xfb02('0x34')](handleEntityNotFound(_0x1f66f4,null))[_0xfb02('0x34')](function(_0x23335a){if(_0x23335a){_0x36125b=_0x23335a[_0xfb02('0x35')]({'plain':!![]});_0x3e84cd[_0xfb02('0x3d')]=_[_0xfb02('0x40')](db[_0xfb02('0x61')][_0xfb02('0x3b')]);_0x3e84cd[_0xfb02('0x3f')]=_[_0xfb02('0x40')](_0x4ffb18[_0xfb02('0x3f')]);_0x3e84cd[_0xfb02('0x41')]=_[_0xfb02('0x42')](_0x3e84cd[_0xfb02('0x3d')],_0x3e84cd[_0xfb02('0x3f')]);_0x55db67[_0xfb02('0x43')]=_[_0xfb02('0x42')](_0x3e84cd[_0xfb02('0x3d')],qs[_0xfb02('0x53')](_0x4ffb18[_0xfb02('0x3f')][_0xfb02('0x53')]));_0x55db67[_0xfb02('0x43')]=_0x55db67['attributes']['length']?_0x55db67[_0xfb02('0x43')]:_0x3e84cd[_0xfb02('0x3d')];if(!_0x4ffb18[_0xfb02('0x3f')][_0xfb02('0x45')](_0xfb02('0x62'))){_0x55db67['limit']=qs[_0xfb02('0x2c')](_0x4ffb18['query']['limit']);_0x55db67[_0xfb02('0x2b')]=qs[_0xfb02('0x2b')](_0x4ffb18[_0xfb02('0x3f')]['offset']);}_0x55db67[_0xfb02('0x46')]=qs[_0xfb02('0x47')](_0x4ffb18[_0xfb02('0x3f')][_0xfb02('0x47')]);_0x55db67[_0xfb02('0x48')]=qs['filters'](_[_0xfb02('0x63')](_0x4ffb18[_0xfb02('0x3f')],_0x3e84cd[_0xfb02('0x41')]));_0x55db67[_0xfb02('0x48')][_0xfb02('0x64')]=_0x23335a['id'];if(_0x4ffb18['query'][_0xfb02('0x4c')]){_0x55db67[_0xfb02('0x48')]=_[_0xfb02('0x49')](_0x55db67['where'],{'$or':_[_0xfb02('0x3e')](_0x55db67['attributes'],function(_0xa2edb9){var _0x3739b4={};_0x3739b4[_0xa2edb9]={'$like':'%'+_0x4ffb18['query'][_0xfb02('0x4c')]+'%'};return _0x3739b4;})});}_0x55db67=_[_0xfb02('0x49')]({},_0x55db67,_0x4ffb18[_0xfb02('0x65')]);return db[_0xfb02('0x61')][_0xfb02('0x4f')](_0x55db67);}})[_0xfb02('0x34')](function(_0x860436){if(_0x860436){return db[_0xfb02('0x66')]['findAndCountAll']({'where':{'id':_[_0xfb02('0x3e')](_0x860436,'UserId'),'role':_0xfb02('0x67')},'attributes':['id',_0xfb02('0x38'),'chatPause',_0xfb02('0x68'),'createdAt']});}})[_0xfb02('0x34')](function(_0x3b4a44){if(_0x3b4a44){return{'count':_0x3b4a44[_0xfb02('0x2d')],'rows':_[_0xfb02('0x3e')](_0x3b4a44[_0xfb02('0x50')],function(_0x4dfe32){return{'membername':_0x4dfe32[_0xfb02('0x38')],'UserId':_0x4dfe32['id'],'queue_name':_0x36125b[_0xfb02('0x38')],'ChatQueueId':_0x36125b['id'],'interface':util[_0xfb02('0x69')]('%s/%s',_0xfb02('0x6a'),_0x4dfe32['name']),'penalty':0x0,'paused':_0x4dfe32[_0xfb02('0x6b')],'createdAt':_0x4dfe32[_0xfb02('0x6c')],'updatedAt':_0x4dfe32[_0xfb02('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xfb02('0x34')](respondWithFilteredResult(_0x1f66f4,_0x55db67))[_0xfb02('0x51')](handleError(_0x1f66f4,null));};exports[_0xfb02('0x6d')]=function(_0xb9faf,_0x16816b,_0x4ea74d){var _0x5dda1a={};var _0x258c26={};var _0x11392a;var _0x5d1266;return db[_0xfb02('0x3a')][_0xfb02('0x6e')]({'where':{'id':_0xb9faf[_0xfb02('0x5e')]['id']}})[_0xfb02('0x34')](handleEntityNotFound(_0x16816b,null))[_0xfb02('0x34')](function(_0x59bf05){if(_0x59bf05){_0x11392a=_0x59bf05;_0x258c26[_0xfb02('0x3d')]=_[_0xfb02('0x40')](db[_0xfb02('0x6f')]['rawAttributes']);_0x258c26[_0xfb02('0x3f')]=_[_0xfb02('0x40')](_0xb9faf[_0xfb02('0x3f')]);_0x258c26[_0xfb02('0x41')]=_['intersection'](_0x258c26[_0xfb02('0x3d')],_0x258c26['query']);_0x5dda1a['attributes']=_[_0xfb02('0x42')](_0x258c26[_0xfb02('0x3d')],qs[_0xfb02('0x53')](_0xb9faf[_0xfb02('0x3f')][_0xfb02('0x53')]));_0x5dda1a['attributes']=_0x5dda1a[_0xfb02('0x43')][_0xfb02('0x44')]?_0x5dda1a[_0xfb02('0x43')]:_0x258c26[_0xfb02('0x3d')];_0x5dda1a[_0xfb02('0x46')]=qs[_0xfb02('0x47')](_0xb9faf[_0xfb02('0x3f')]['sort']);_0x5dda1a['where']=qs[_0xfb02('0x41')](_['pick'](_0xb9faf[_0xfb02('0x3f')],_0x258c26[_0xfb02('0x41')]));if(_0xb9faf[_0xfb02('0x3f')][_0xfb02('0x4c')]){_0x5dda1a[_0xfb02('0x48')]=_['merge'](_0x5dda1a['where'],{'$or':_['map'](_0x5dda1a[_0xfb02('0x43')],function(_0x8384e7){var _0x22dd9f={};_0x22dd9f[_0x8384e7]={'$like':'%'+_0xb9faf[_0xfb02('0x3f')][_0xfb02('0x4c')]+'%'};return _0x22dd9f;})});}_0x5dda1a=_['merge']({},_0x5dda1a,_0xb9faf['options']);return _0x11392a['getTeams'](_0x5dda1a);}})[_0xfb02('0x34')](function(_0x2b7779){if(_0x2b7779){_0x5d1266=_0x2b7779[_0xfb02('0x44')];if(!_0xb9faf[_0xfb02('0x3f')][_0xfb02('0x45')](_0xfb02('0x62'))){_0x5dda1a[_0xfb02('0x2c')]=qs[_0xfb02('0x2c')](_0xb9faf[_0xfb02('0x3f')][_0xfb02('0x2c')]);_0x5dda1a[_0xfb02('0x2b')]=qs[_0xfb02('0x2b')](_0xb9faf[_0xfb02('0x3f')][_0xfb02('0x2b')]);}return _0x11392a[_0xfb02('0x6d')](_0x5dda1a);}})['then'](function(_0x18a3e2){if(_0x18a3e2){return _0x18a3e2?{'count':_0x5d1266,'rows':_0x18a3e2}:null;}})['then'](respondWithResult(_0x16816b,null))['catch'](handleError(_0x16816b,null));};exports[_0xfb02('0x70')]=function(_0x597477,_0x5c4cf6,_0x4acd1a){var _0x577042=_0x597477[_0xfb02('0x56')][_0xfb02('0x71')];return db[_0xfb02('0x6f')][_0xfb02('0x4f')]({'where':{'id':_0x577042},'attributes':['id'],'include':[{'model':db['User'],'as':_0xfb02('0x72'),'attributes':['id','name',_0xfb02('0x73'),'voicePause',_0xfb02('0x74')],'raw':!![]}]})[_0xfb02('0x34')](function(_0xa8a626){if(_0xa8a626){var _0x5dede8=_['flatMap'](_0xa8a626,function(_0x19efc1){var _0x219cf2=_0x19efc1[_0xfb02('0x35')]({'plain':!![]});return _0x219cf2[_0xfb02('0x72')];});return db[_0xfb02('0x3a')][_0xfb02('0x54')]({'where':{'id':_0x597477[_0xfb02('0x5e')]['id']}})[_0xfb02('0x34')](function(_0x44910d){return db[_0xfb02('0x75')][_0xfb02('0x76')](function(_0x44aeac){return _0x44910d[_0xfb02('0x70')](_0x577042,{'transaction':_0x44aeac})[_0xfb02('0x34')](function(){return BPromise[_0xfb02('0x77')](_0x5dede8,function(_0x53dcc2){return db[_0xfb02('0x61')]['findOrCreate']({'where':{'UserId':_0x53dcc2['id'],'ChatQueueId':_0x597477[_0xfb02('0x5e')]['id']},'transaction':_0x44aeac});});})[_0xfb02('0x34')](function(){_0x5dede8[_0xfb02('0x78')](function(_0x40f794){socket['emit'](_0xfb02('0x79'),{'UserId':_0x40f794['id'],'ChatQueueId':_0x44910d['id']});});});});});}})['then'](respondWithStatusCode(_0x5c4cf6,null))[_0xfb02('0x51')](handleError(_0x5c4cf6,null));};exports['removeTeams']=function(_0x187954,_0x57eb62,_0x389924){return db['Team'][_0xfb02('0x4f')]({'where':{'id':_0x187954[_0xfb02('0x3f')][_0xfb02('0x71')]},'attributes':['id'],'include':[{'model':db[_0xfb02('0x66')],'as':_0xfb02('0x72'),'attributes':['id'],'raw':!![]}]})[_0xfb02('0x34')](handleEntityNotFound(_0x57eb62,null))[_0xfb02('0x34')](function(_0x3b673c){var _0x53dec5=_[_0xfb02('0x3e')](_0x3b673c,'id');var _0x1874e4=[];var _0x539c34=[];var _0x5b7ccd=squel[_0xfb02('0x7a')]();_0x5b7ccd[_0xfb02('0x7b')]('tq.TeamId')[_0xfb02('0x7c')](_0xfb02('0x7d'),'tq')[_0xfb02('0x7e')](_0xfb02('0x7f'),'ut',_0xfb02('0x80'))['where'](_0xfb02('0x81'),_0x187954['params']['id']);for(var _0x3c98c7=0x0;_0x3c98c7<_0x3b673c['length'];_0x3c98c7+=0x1){let _0x3b9ae8=_0x3b673c[_0x3c98c7];for(var _0x479d4f=0x0;_0x479d4f<_0x3b9ae8[_0xfb02('0x72')][_0xfb02('0x44')];_0x479d4f+=0x1){let _0x4ccfc6=_0x3b9ae8['Agents'][_0x479d4f];var _0x5d3407=_0x5b7ccd[_0xfb02('0x82')]();_0x5d3407[_0xfb02('0x48')]('ut.UserId\x20=\x20?',_0x4ccfc6['id']);_0x539c34['push'](db[_0xfb02('0x75')][_0xfb02('0x3f')](_0x5d3407[_0xfb02('0x83')](),{'type':db[_0xfb02('0x75')]['QueryTypes']['SELECT']})['then'](function(_0x2c7044){if(_0x2c7044[_0xfb02('0x44')]===0x1){return _0x4ccfc6['id'];}else{var _0x4eb65b=_[_0xfb02('0x84')](_['map'](_0x2c7044,_0xfb02('0x85')),function(_0x3919ee){return _[_0xfb02('0x86')](_0x53dec5,_0x3919ee);});if(_0x4eb65b){return _0x4ccfc6['id'];}}}));}}return BPromise['all'](_0x539c34)[_0xfb02('0x34')](function(_0x16d91e){_0x1874e4=_(_0x1874e4)['union'](_0x16d91e)[_0xfb02('0x87')]()[_0xfb02('0x88')]();return db[_0xfb02('0x3a')][_0xfb02('0x54')]({'where':{'id':_0x187954[_0xfb02('0x5e')]['id']}})[_0xfb02('0x34')](function(_0x12e4d5){return db[_0xfb02('0x75')]['transaction'](function(_0x35da9a){return _0x12e4d5[_0xfb02('0x89')](_0x187954[_0xfb02('0x3f')][_0xfb02('0x71')],{'transaction':_0x35da9a})[_0xfb02('0x34')](function(){if(!_[_0xfb02('0x8a')](_0x1874e4)){return _0x12e4d5[_0xfb02('0x8b')](_0x1874e4,{'transaction':_0x35da9a});}})['then'](function(){_0x1874e4[_0xfb02('0x78')](function(_0x332400){socket[_0xfb02('0x8c')](_0xfb02('0x8d'),{'UserId':_0x332400,'ChatQueueId':_0x12e4d5['id']});});});});});});})[_0xfb02('0x34')](respondWithStatusCode(_0x57eb62,null))[_0xfb02('0x51')](handleError(_0x57eb62,null));};exports[_0xfb02('0x8e')]=function(_0x67145b,_0xe6af0d,_0x1ff7c2){return db['ChatQueue'][_0xfb02('0x54')]({'where':{'id':_0x67145b['params']['id']}})[_0xfb02('0x34')](handleEntityNotFound(_0xe6af0d,null))[_0xfb02('0x34')](function(_0xa946f6){if(_0xa946f6){return _0xa946f6[_0xfb02('0x8e')](_0x67145b[_0xfb02('0x56')][_0xfb02('0x71')],_['omit'](_0x67145b[_0xfb02('0x56')],[_0xfb02('0x71'),'id'])||{})['spread'](function(_0x111724){for(var _0x3f638f=0x0;_0x3f638f<_0x67145b['body']['ids'][_0xfb02('0x44')];_0x3f638f+=0x1){socket[_0xfb02('0x8c')](_0xfb02('0x79'),{'UserId':Number(_0x67145b['body'][_0xfb02('0x71')][_0x3f638f]),'ChatQueueId':Number(_0x67145b['params']['id'])});}return _0x111724;});}})[_0xfb02('0x34')](respondWithResult(_0xe6af0d,null))[_0xfb02('0x51')](handleError(_0xe6af0d,null));};exports[_0xfb02('0x8b')]=function(_0x5c86d7,_0x2f9e54,_0x1097f1){return db['ChatQueue']['find']({'where':{'id':_0x5c86d7['params']['id']}})[_0xfb02('0x34')](handleEntityNotFound(_0x2f9e54,null))['then'](function(_0x3f8d12){if(_0x3f8d12){return _0x3f8d12[_0xfb02('0x8b')](_0x5c86d7[_0xfb02('0x3f')]['ids'])[_0xfb02('0x34')](function(){if(_['isArray'](_0x5c86d7[_0xfb02('0x3f')][_0xfb02('0x71')])){for(var _0x5df92c=0x0;_0x5df92c<_0x5c86d7[_0xfb02('0x3f')][_0xfb02('0x71')][_0xfb02('0x44')];_0x5df92c+=0x1){socket[_0xfb02('0x8c')](_0xfb02('0x8d'),{'UserId':Number(_0x5c86d7[_0xfb02('0x3f')][_0xfb02('0x71')][_0x5df92c]),'ChatQueueId':Number(_0x5c86d7[_0xfb02('0x5e')]['id'])});}}else{socket[_0xfb02('0x8c')](_0xfb02('0x8d'),{'UserId':Number(_0x5c86d7[_0xfb02('0x3f')][_0xfb02('0x71')]),'ChatQueueId':Number(_0x5c86d7[_0xfb02('0x5e')]['id'])});}});}})['then'](respondWithStatusCode(_0x2f9e54,null))[_0xfb02('0x51')](handleError(_0x2f9e54,null));};exports['getAgents']=function(_0x13c0d2,_0x41a5ca,_0xab98da){var _0x387d8d={};var _0x3a83ab={};var _0x542c2c;var _0x15e083;return db[_0xfb02('0x3a')][_0xfb02('0x6e')]({'where':{'id':_0x13c0d2[_0xfb02('0x5e')]['id']}})[_0xfb02('0x34')](handleEntityNotFound(_0x41a5ca,null))['then'](function(_0x54ae0c){if(_0x54ae0c){_0x542c2c=_0x54ae0c;_0x3a83ab[_0xfb02('0x3d')]=_[_0xfb02('0x40')](db['User']['rawAttributes']);_0x3a83ab[_0xfb02('0x3f')]=_[_0xfb02('0x40')](_0x13c0d2[_0xfb02('0x3f')]);_0x3a83ab[_0xfb02('0x41')]=_[_0xfb02('0x42')](_0x3a83ab[_0xfb02('0x3d')],_0x3a83ab[_0xfb02('0x3f')]);_0x387d8d[_0xfb02('0x43')]=_[_0xfb02('0x42')](_0x3a83ab[_0xfb02('0x3d')],qs['fields'](_0x13c0d2[_0xfb02('0x3f')][_0xfb02('0x53')]));_0x387d8d['attributes']=_0x387d8d[_0xfb02('0x43')][_0xfb02('0x44')]?_0x387d8d[_0xfb02('0x43')]:_0x3a83ab[_0xfb02('0x3d')];_0x387d8d[_0xfb02('0x46')]=qs[_0xfb02('0x47')](_0x13c0d2[_0xfb02('0x3f')][_0xfb02('0x47')]);_0x387d8d[_0xfb02('0x48')]=qs[_0xfb02('0x41')](_[_0xfb02('0x63')](_0x13c0d2['query'],_0x3a83ab['filters']));if(_0x13c0d2['query']['filter']){_0x387d8d[_0xfb02('0x48')]=_[_0xfb02('0x49')](_0x387d8d[_0xfb02('0x48')],{'$or':_[_0xfb02('0x3e')](_0x387d8d[_0xfb02('0x43')],function(_0x2835cf){var _0x4d6896={};_0x4d6896[_0x2835cf]={'$like':'%'+_0x13c0d2[_0xfb02('0x3f')][_0xfb02('0x4c')]+'%'};return _0x4d6896;})});}_0x387d8d=_[_0xfb02('0x49')]({},_0x387d8d,_0x13c0d2['options']);return _0x542c2c[_0xfb02('0x8f')](_0x387d8d);}})[_0xfb02('0x34')](function(_0x49ac04){if(_0x49ac04){_0x15e083=_0x49ac04[_0xfb02('0x44')];if(!_0x13c0d2['query'][_0xfb02('0x45')](_0xfb02('0x62'))){_0x387d8d['limit']=qs[_0xfb02('0x2c')](_0x13c0d2['query'][_0xfb02('0x2c')]);_0x387d8d[_0xfb02('0x2b')]=qs['offset'](_0x13c0d2['query']['offset']);}return _0x542c2c[_0xfb02('0x8f')](_0x387d8d);}})[_0xfb02('0x34')](function(_0x25a9a1){if(_0x25a9a1){return _0x25a9a1?{'count':_0x15e083,'rows':_0x25a9a1}:null;}})['then'](respondWithResult(_0x41a5ca,null))[_0xfb02('0x51')](handleError(_0x41a5ca,null));};
\ No newline at end of file
+var _0x0235=['register','jayson/promise','client','http','request','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','end','status','json','offset','undefined','count','limit','Content-Range','reject','then','destroy','UserProfileResource','stack','name','index','ChatQueue','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','ChatQueues','UserProfileSection','userProfileId','autoAssociation','update','describe','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','findAll','User','findAndCountAll','UserId','chatPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','Agents','online','sequelize','findOrCreate','userChatQueue:save','removeTeams','field','tq.TeamId','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','includes','all','union','compact','value','transaction','isEmpty','removeAgents','emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','fs-extra','lodash','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','defaults','redis','socket.io-emitter','./chatQueue.socket'];(function(_0x535643,_0x81225){var _0x44c6e5=function(_0x58603a){while(--_0x58603a){_0x535643['push'](_0x535643['shift']());}};_0x44c6e5(++_0x81225);}(_0x0235,0x77));var _0x5023=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x0235[_0x16d10f];return _0x50c823;};'use strict';var emlformat=require(_0x5023('0x0'));var rimraf=require(_0x5023('0x1'));var zipdir=require(_0x5023('0x2'));var jsonpatch=require(_0x5023('0x3'));var rp=require(_0x5023('0x4'));var moment=require(_0x5023('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x5023('0x6'));var util=require(_0x5023('0x7'));var path=require('path');var sox=require(_0x5023('0x8'));var csv=require(_0x5023('0x9'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x5023('0xa'));var _=require(_0x5023('0xb'));var squel=require('squel');var crypto=require(_0x5023('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5023('0xd'));var Redis=require(_0x5023('0xe'));var authService=require(_0x5023('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x5023('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5023('0x11'))(_0x5023('0x12'));var utils=require(_0x5023('0x13'));var config=require(_0x5023('0x14'));var licenseUtil=require(_0x5023('0x15'));var db=require(_0x5023('0x16'))['db'];config['redis']=_[_0x5023('0x17')](config[_0x5023('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5023('0x19'))(new Redis(config[_0x5023('0x18')]));require(_0x5023('0x1a'))[_0x5023('0x1b')](socket);var jayson=require(_0x5023('0x1c'));var client=jayson[_0x5023('0x1d')][_0x5023('0x1e')]({'port':0x232a});function respondWithRpcPromise(_0x445a34,_0x56e28d,_0x1de539,_0x3d75c4){return new BPromise(function(_0x2cae99,_0x14c1cc){var _0x1c7574=_0x3d75c4||client;return _0x1c7574[_0x5023('0x1f')](_0x445a34,_0x1de539)['then'](function(_0x1b5daa){logger['info'](_0x5023('0x20'),_0x56e28d,_0x5023('0x21'));logger[_0x5023('0x22')](_0x5023('0x23'),_0x56e28d,_0x5023('0x21'),JSON[_0x5023('0x24')](_0x1b5daa));if(_0x1b5daa[_0x5023('0x25')]){if(_0x1b5daa['error'][_0x5023('0x26')]===0x1f4){logger['error'](_0x5023('0x20'),_0x56e28d,_0x1b5daa[_0x5023('0x25')]['message']);return _0x14c1cc(_0x1b5daa[_0x5023('0x25')]['message']);}logger['error'](_0x5023('0x20'),_0x56e28d,_0x1b5daa[_0x5023('0x25')]['message']);return _0x2cae99(_0x1b5daa['error'][_0x5023('0x27')]);}else{logger['info'](_0x5023('0x20'),_0x56e28d,'request\x20sent');_0x2cae99(_0x1b5daa[_0x5023('0x28')][_0x5023('0x27')]);}})[_0x5023('0x29')](function(_0x51c00e){logger[_0x5023('0x25')]('ChatQueue,\x20%s,\x20%s',_0x56e28d,_0x51c00e);_0x14c1cc(_0x51c00e);});});}function respondWithStatusCode(_0x1282a3,_0x3d2481){_0x3d2481=_0x3d2481||0xcc;return function(_0x1ed535){if(_0x1ed535){return _0x1282a3[_0x5023('0x2a')](_0x3d2481);}return _0x1282a3['status'](_0x3d2481)[_0x5023('0x2b')]();};}function respondWithResult(_0x15fcaa,_0x1a6b19){_0x1a6b19=_0x1a6b19||0xc8;return function(_0x53f729){if(_0x53f729){return _0x15fcaa[_0x5023('0x2c')](_0x1a6b19)[_0x5023('0x2d')](_0x53f729);}};}function respondWithFilteredResult(_0x307d09,_0x5ab86a){return function(_0x45b85c){if(_0x45b85c){var _0x3bc02d=typeof _0x5ab86a[_0x5023('0x2e')]==='undefined'&&typeof _0x5ab86a['limit']===_0x5023('0x2f');var _0x574e09=_0x45b85c[_0x5023('0x30')];var _0x4e2535=_0x3bc02d?0x0:_0x5ab86a[_0x5023('0x2e')];var _0x3ffa31=_0x3bc02d?_0x45b85c[_0x5023('0x30')]:_0x5ab86a['offset']+_0x5ab86a[_0x5023('0x31')];var _0x494ad0;if(_0x3ffa31>=_0x574e09){_0x3ffa31=_0x574e09;_0x494ad0=0xc8;}else{_0x494ad0=0xce;}_0x307d09['status'](_0x494ad0);return _0x307d09['set'](_0x5023('0x32'),_0x4e2535+'-'+_0x3ffa31+'/'+_0x574e09)[_0x5023('0x2d')](_0x45b85c);}return null;};}function patchUpdates(_0x44f59c){return function(_0xf25b71){try{jsonpatch['apply'](_0xf25b71,_0x44f59c,!![]);}catch(_0x4aef06){return BPromise[_0x5023('0x33')](_0x4aef06);}return _0xf25b71['save']();};}function saveUpdates(_0xa359b4,_0x25fd31){return function(_0x1bcb8b){if(_0x1bcb8b){return _0x1bcb8b['update'](_0xa359b4)[_0x5023('0x34')](function(_0x29413c){return _0x29413c;});}return null;};}function removeEntity(_0x49dab6,_0x3bed60){return function(_0x104ce9){if(_0x104ce9){return _0x104ce9[_0x5023('0x35')]()[_0x5023('0x34')](function(){var _0x5d5d59=_0x104ce9['get']({'plain':!![]});var _0x49c112='ChatQueues';return db[_0x5023('0x36')]['destroy']({'where':{'type':_0x49c112,'resourceId':_0x5d5d59['id']}})[_0x5023('0x34')](function(){return _0x104ce9;});})[_0x5023('0x34')](function(){_0x49dab6['status'](0xcc)[_0x5023('0x2b')]();});}};}function handleEntityNotFound(_0x2b9cb5,_0x47d116){return function(_0x41cf8a){if(!_0x41cf8a){_0x2b9cb5[_0x5023('0x2a')](0x194);}return _0x41cf8a;};}function handleError(_0x5a43ed,_0x563916){_0x563916=_0x563916||0x1f4;return function(_0x41424d){logger[_0x5023('0x25')](_0x41424d[_0x5023('0x37')]);if(_0x41424d[_0x5023('0x38')]){delete _0x41424d[_0x5023('0x38')];}_0x5a43ed[_0x5023('0x2c')](_0x563916)['send'](_0x41424d);};}exports[_0x5023('0x39')]=function(_0x487dee,_0x35f0b0){var _0x49b81b={},_0x322979={},_0x85e909={'count':0x0,'rows':[]};var _0x27a221=_['map'](db[_0x5023('0x3a')]['rawAttributes'],function(_0x888414){return{'name':_0x888414[_0x5023('0x3b')],'type':_0x888414[_0x5023('0x3c')][_0x5023('0x3d')]};});_0x322979['model']=_[_0x5023('0x3e')](_0x27a221,_0x5023('0x38'));_0x322979['query']=_[_0x5023('0x3f')](_0x487dee[_0x5023('0x40')]);_0x322979[_0x5023('0x41')]=_[_0x5023('0x42')](_0x322979[_0x5023('0x43')],_0x322979[_0x5023('0x40')]);_0x49b81b[_0x5023('0x44')]=_[_0x5023('0x42')](_0x322979[_0x5023('0x43')],qs['fields'](_0x487dee[_0x5023('0x40')][_0x5023('0x45')]));_0x49b81b[_0x5023('0x44')]=_0x49b81b[_0x5023('0x44')][_0x5023('0x46')]?_0x49b81b[_0x5023('0x44')]:_0x322979[_0x5023('0x43')];if(!_0x487dee['query']['hasOwnProperty'](_0x5023('0x47'))){_0x49b81b[_0x5023('0x31')]=qs[_0x5023('0x31')](_0x487dee[_0x5023('0x40')]['limit']);_0x49b81b[_0x5023('0x2e')]=qs[_0x5023('0x2e')](_0x487dee['query']['offset']);}_0x49b81b[_0x5023('0x48')]=qs['sort'](_0x487dee[_0x5023('0x40')][_0x5023('0x49')]);_0x49b81b['where']=qs[_0x5023('0x41')](_['pick'](_0x487dee['query'],_0x322979[_0x5023('0x41')]),_0x27a221);if(_0x487dee[_0x5023('0x40')]['filter']){_0x49b81b[_0x5023('0x4a')]=_['merge'](_0x49b81b[_0x5023('0x4a')],{'$or':_[_0x5023('0x3e')](_0x27a221,function(_0xe247c1){if(_0xe247c1[_0x5023('0x3c')]!==_0x5023('0x4b')){var _0x78ff43={};_0x78ff43[_0xe247c1[_0x5023('0x38')]]={'$like':'%'+_0x487dee[_0x5023('0x40')][_0x5023('0x4c')]+'%'};return _0x78ff43;}})});}_0x49b81b=_[_0x5023('0x4d')]({},_0x49b81b,_0x487dee[_0x5023('0x4e')]);var _0x27e8bc={'where':_0x49b81b[_0x5023('0x4a')]};return db[_0x5023('0x3a')]['count'](_0x27e8bc)[_0x5023('0x34')](function(_0x179bc1){_0x85e909['count']=_0x179bc1;if(_0x487dee[_0x5023('0x40')][_0x5023('0x4f')]){_0x49b81b[_0x5023('0x50')]=[{'all':!![]}];}return db[_0x5023('0x3a')]['findAll'](_0x49b81b);})[_0x5023('0x34')](function(_0x52e5fc){_0x85e909[_0x5023('0x51')]=_0x52e5fc;return _0x85e909;})[_0x5023('0x34')](respondWithFilteredResult(_0x35f0b0,_0x49b81b))[_0x5023('0x29')](handleError(_0x35f0b0,null));};exports[_0x5023('0x52')]=function(_0x5260d7,_0x97bd07){var _0x178b87={'raw':!![],'where':{'id':_0x5260d7[_0x5023('0x53')]['id']}},_0x353822={};_0x353822[_0x5023('0x43')]=_['keys'](db[_0x5023('0x3a')][_0x5023('0x54')]);_0x353822[_0x5023('0x40')]=_[_0x5023('0x3f')](_0x5260d7[_0x5023('0x40')]);_0x353822['filters']=_[_0x5023('0x42')](_0x353822[_0x5023('0x43')],_0x353822[_0x5023('0x40')]);_0x178b87[_0x5023('0x44')]=_['intersection'](_0x353822['model'],qs[_0x5023('0x45')](_0x5260d7[_0x5023('0x40')]['fields']));_0x178b87[_0x5023('0x44')]=_0x178b87[_0x5023('0x44')]['length']?_0x178b87[_0x5023('0x44')]:_0x353822['model'];if(_0x5260d7[_0x5023('0x40')][_0x5023('0x4f')]){_0x178b87[_0x5023('0x50')]=[{'all':!![]}];}_0x178b87=_[_0x5023('0x4d')]({},_0x178b87,_0x5260d7['options']);return db[_0x5023('0x3a')][_0x5023('0x55')](_0x178b87)[_0x5023('0x34')](handleEntityNotFound(_0x97bd07,null))[_0x5023('0x34')](respondWithResult(_0x97bd07,null))[_0x5023('0x29')](handleError(_0x97bd07,null));};exports[_0x5023('0x56')]=function(_0x58830a,_0x2f8384){return db[_0x5023('0x3a')][_0x5023('0x56')](_0x58830a[_0x5023('0x57')],{})[_0x5023('0x34')](function(_0x22529a){var _0x1288d4=_0x58830a[_0x5023('0x58')]['get']({'plain':!![]});if(!_0x1288d4)throw new Error(_0x5023('0x59'));if(_0x1288d4[_0x5023('0x5a')]==='user'){var _0x2c8f54=_0x22529a[_0x5023('0x5b')]({'plain':!![]});var _0xf055fd=_0x5023('0x5c');return db[_0x5023('0x5d')][_0x5023('0x55')]({'where':{'name':_0xf055fd,'userProfileId':_0x1288d4[_0x5023('0x5e')]},'raw':!![]})[_0x5023('0x34')](function(_0x26af6d){if(_0x26af6d&&_0x26af6d[_0x5023('0x5f')]===0x0){return db[_0x5023('0x36')][_0x5023('0x56')]({'name':_0x2c8f54[_0x5023('0x38')],'resourceId':_0x2c8f54['id'],'type':_0x26af6d[_0x5023('0x38')],'sectionId':_0x26af6d['id']},{})[_0x5023('0x34')](function(){return _0x22529a;});}else{return _0x22529a;}})[_0x5023('0x29')](function(_0x568178){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x568178);throw _0x568178;});}return _0x22529a;})['then'](respondWithResult(_0x2f8384,0xc9))['catch'](handleError(_0x2f8384,null));};exports[_0x5023('0x60')]=function(_0x5d7c3a,_0x161fad){if(_0x5d7c3a[_0x5023('0x57')]['id']){delete _0x5d7c3a[_0x5023('0x57')]['id'];}return db[_0x5023('0x3a')][_0x5023('0x55')]({'where':{'id':_0x5d7c3a[_0x5023('0x53')]['id']}})[_0x5023('0x34')](handleEntityNotFound(_0x161fad,null))['then'](saveUpdates(_0x5d7c3a['body'],null))[_0x5023('0x34')](respondWithResult(_0x161fad,null))['catch'](handleError(_0x161fad,null));};exports[_0x5023('0x35')]=function(_0x15b218,_0x4473af){return db['ChatQueue'][_0x5023('0x55')]({'where':{'id':_0x15b218['params']['id']}})[_0x5023('0x34')](handleEntityNotFound(_0x4473af,null))[_0x5023('0x34')](removeEntity(_0x4473af,null))[_0x5023('0x29')](handleError(_0x4473af,null));};exports[_0x5023('0x61')]=function(_0x45ad88,_0x111508){return db[_0x5023('0x3a')][_0x5023('0x61')]()['then'](respondWithResult(_0x111508,null))[_0x5023('0x29')](handleError(_0x111508,null));};exports['getMembers']=function(_0x21bda,_0x4a5898,_0x11c06e){var _0x3d0454={'raw':!![],'where':{}},_0x35567d={},_0x65dc8;return db[_0x5023('0x3a')][_0x5023('0x62')]({'where':{'id':_0x21bda[_0x5023('0x53')]['id']}})[_0x5023('0x34')](handleEntityNotFound(_0x4a5898,null))[_0x5023('0x34')](function(_0x205dd8){if(_0x205dd8){_0x65dc8=_0x205dd8[_0x5023('0x5b')]({'plain':!![]});_0x35567d[_0x5023('0x43')]=_[_0x5023('0x3f')](db[_0x5023('0x63')][_0x5023('0x54')]);_0x35567d[_0x5023('0x40')]=_[_0x5023('0x3f')](_0x21bda[_0x5023('0x40')]);_0x35567d['filters']=_[_0x5023('0x42')](_0x35567d[_0x5023('0x43')],_0x35567d[_0x5023('0x40')]);_0x3d0454[_0x5023('0x44')]=_['intersection'](_0x35567d[_0x5023('0x43')],qs[_0x5023('0x45')](_0x21bda[_0x5023('0x40')][_0x5023('0x45')]));_0x3d0454[_0x5023('0x44')]=_0x3d0454[_0x5023('0x44')][_0x5023('0x46')]?_0x3d0454[_0x5023('0x44')]:_0x35567d[_0x5023('0x43')];if(!_0x21bda[_0x5023('0x40')][_0x5023('0x64')](_0x5023('0x47'))){_0x3d0454['limit']=qs[_0x5023('0x31')](_0x21bda[_0x5023('0x40')][_0x5023('0x31')]);_0x3d0454[_0x5023('0x2e')]=qs[_0x5023('0x2e')](_0x21bda[_0x5023('0x40')][_0x5023('0x2e')]);}_0x3d0454['order']=qs[_0x5023('0x49')](_0x21bda[_0x5023('0x40')][_0x5023('0x49')]);_0x3d0454[_0x5023('0x4a')]=qs['filters'](_[_0x5023('0x65')](_0x21bda[_0x5023('0x40')],_0x35567d[_0x5023('0x41')]));_0x3d0454[_0x5023('0x4a')][_0x5023('0x66')]=_0x205dd8['id'];if(_0x21bda[_0x5023('0x40')][_0x5023('0x4c')]){_0x3d0454['where']=_['merge'](_0x3d0454[_0x5023('0x4a')],{'$or':_[_0x5023('0x3e')](_0x3d0454[_0x5023('0x44')],function(_0x54a717){var _0x4b64f0={};_0x4b64f0[_0x54a717]={'$like':'%'+_0x21bda[_0x5023('0x40')][_0x5023('0x4c')]+'%'};return _0x4b64f0;})});}_0x3d0454=_[_0x5023('0x4d')]({},_0x3d0454,_0x21bda[_0x5023('0x4e')]);return db[_0x5023('0x63')][_0x5023('0x67')](_0x3d0454);}})[_0x5023('0x34')](function(_0x11b547){if(_0x11b547){return db[_0x5023('0x68')][_0x5023('0x69')]({'where':{'id':_['map'](_0x11b547,_0x5023('0x6a')),'role':'agent'},'attributes':['id','name',_0x5023('0x6b'),'updatedAt',_0x5023('0x6c')]});}})['then'](function(_0x184030){if(_0x184030){return{'count':_0x184030[_0x5023('0x30')],'rows':_[_0x5023('0x3e')](_0x184030['rows'],function(_0x20186d){return{'membername':_0x20186d[_0x5023('0x38')],'UserId':_0x20186d['id'],'queue_name':_0x65dc8[_0x5023('0x38')],'ChatQueueId':_0x65dc8['id'],'interface':util[_0x5023('0x6d')](_0x5023('0x6e'),_0x5023('0x6f'),_0x20186d[_0x5023('0x38')]),'penalty':0x0,'paused':_0x20186d[_0x5023('0x6b')],'createdAt':_0x20186d['createdAt'],'updatedAt':_0x20186d[_0x5023('0x70')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4a5898,_0x3d0454))[_0x5023('0x29')](handleError(_0x4a5898,null));};exports['getTeams']=function(_0x20b7aa,_0xe70a39,_0x269eed){var _0x55535c={};var _0x2a00ce={};var _0x2d2135;var _0x43c9ee;return db['ChatQueue']['findOne']({'where':{'id':_0x20b7aa[_0x5023('0x53')]['id']}})[_0x5023('0x34')](handleEntityNotFound(_0xe70a39,null))[_0x5023('0x34')](function(_0x463a6c){if(_0x463a6c){_0x2d2135=_0x463a6c;_0x2a00ce[_0x5023('0x43')]=_[_0x5023('0x3f')](db[_0x5023('0x71')][_0x5023('0x54')]);_0x2a00ce[_0x5023('0x40')]=_['keys'](_0x20b7aa[_0x5023('0x40')]);_0x2a00ce['filters']=_[_0x5023('0x42')](_0x2a00ce['model'],_0x2a00ce[_0x5023('0x40')]);_0x55535c[_0x5023('0x44')]=_['intersection'](_0x2a00ce[_0x5023('0x43')],qs[_0x5023('0x45')](_0x20b7aa[_0x5023('0x40')]['fields']));_0x55535c[_0x5023('0x44')]=_0x55535c[_0x5023('0x44')][_0x5023('0x46')]?_0x55535c[_0x5023('0x44')]:_0x2a00ce[_0x5023('0x43')];_0x55535c[_0x5023('0x48')]=qs[_0x5023('0x49')](_0x20b7aa[_0x5023('0x40')]['sort']);_0x55535c[_0x5023('0x4a')]=qs['filters'](_[_0x5023('0x65')](_0x20b7aa[_0x5023('0x40')],_0x2a00ce[_0x5023('0x41')]));if(_0x20b7aa['query']['filter']){_0x55535c[_0x5023('0x4a')]=_[_0x5023('0x4d')](_0x55535c[_0x5023('0x4a')],{'$or':_[_0x5023('0x3e')](_0x55535c[_0x5023('0x44')],function(_0x57e7a4){var _0x9e1910={};_0x9e1910[_0x57e7a4]={'$like':'%'+_0x20b7aa[_0x5023('0x40')][_0x5023('0x4c')]+'%'};return _0x9e1910;})});}_0x55535c=_['merge']({},_0x55535c,_0x20b7aa['options']);return _0x2d2135[_0x5023('0x72')](_0x55535c);}})['then'](function(_0x4e312c){if(_0x4e312c){_0x43c9ee=_0x4e312c[_0x5023('0x46')];if(!_0x20b7aa[_0x5023('0x40')][_0x5023('0x64')](_0x5023('0x47'))){_0x55535c[_0x5023('0x31')]=qs[_0x5023('0x31')](_0x20b7aa['query'][_0x5023('0x31')]);_0x55535c[_0x5023('0x2e')]=qs['offset'](_0x20b7aa[_0x5023('0x40')][_0x5023('0x2e')]);}return _0x2d2135[_0x5023('0x72')](_0x55535c);}})[_0x5023('0x34')](function(_0x32a59c){if(_0x32a59c){return _0x32a59c?{'count':_0x43c9ee,'rows':_0x32a59c}:null;}})[_0x5023('0x34')](respondWithResult(_0xe70a39,null))[_0x5023('0x29')](handleError(_0xe70a39,null));};exports[_0x5023('0x73')]=function(_0x45f291,_0x1ef1f4,_0x42ae4f){var _0x35769f=_0x45f291[_0x5023('0x57')][_0x5023('0x74')];return db['Team'][_0x5023('0x67')]({'where':{'id':_0x35769f},'attributes':['id'],'include':[{'model':db[_0x5023('0x68')],'as':_0x5023('0x75'),'attributes':['id','name',_0x5023('0x76'),'voicePause','interface'],'raw':!![]}]})[_0x5023('0x34')](function(_0x5ea891){if(_0x5ea891){var _0x370446=_['flatMap'](_0x5ea891,function(_0x354d7f){var _0xe97fba=_0x354d7f[_0x5023('0x5b')]({'plain':!![]});return _0xe97fba[_0x5023('0x75')];});return db[_0x5023('0x3a')][_0x5023('0x55')]({'where':{'id':_0x45f291[_0x5023('0x53')]['id']}})[_0x5023('0x34')](function(_0x1c001e){return db[_0x5023('0x77')]['transaction'](function(_0x5e4ae3){return _0x1c001e[_0x5023('0x73')](_0x35769f,{'transaction':_0x5e4ae3})[_0x5023('0x34')](function(){return BPromise['each'](_0x370446,function(_0x4ced8f){return db[_0x5023('0x63')][_0x5023('0x78')]({'where':{'UserId':_0x4ced8f['id'],'ChatQueueId':_0x45f291[_0x5023('0x53')]['id']},'transaction':_0x5e4ae3});});})[_0x5023('0x34')](function(){_0x370446['forEach'](function(_0x529924){socket['emit'](_0x5023('0x79'),{'UserId':_0x529924['id'],'ChatQueueId':_0x1c001e['id']});});});});});}})[_0x5023('0x34')](respondWithStatusCode(_0x1ef1f4,null))[_0x5023('0x29')](handleError(_0x1ef1f4,null));};exports[_0x5023('0x7a')]=function(_0xb11635,_0x42d904,_0x487007){return db[_0x5023('0x71')][_0x5023('0x67')]({'where':{'id':_0xb11635[_0x5023('0x40')]['ids']},'attributes':['id'],'include':[{'model':db[_0x5023('0x68')],'as':_0x5023('0x75'),'attributes':['id'],'raw':!![]}]})[_0x5023('0x34')](handleEntityNotFound(_0x42d904,null))[_0x5023('0x34')](function(_0x596183){var _0x48b180=_['map'](_0x596183,'id');var _0x553dfe=[];var _0x4d7f24=[];var _0x33c21c=squel['select']();_0x33c21c[_0x5023('0x7b')](_0x5023('0x7c'))['from']('team_has_chat_queues','tq')[_0x5023('0x7d')]('user_has_teams','ut',_0x5023('0x7e'))[_0x5023('0x4a')]('ChatQueueId\x20=\x20?',_0xb11635[_0x5023('0x53')]['id']);for(var _0x5c0c38=0x0;_0x5c0c38<_0x596183[_0x5023('0x46')];_0x5c0c38+=0x1){let _0x505140=_0x596183[_0x5c0c38];for(var _0x2f9dab=0x0;_0x2f9dab<_0x505140['Agents']['length'];_0x2f9dab+=0x1){let _0x19c0d0=_0x505140[_0x5023('0x75')][_0x2f9dab];var _0x280e02=_0x33c21c['clone']();_0x280e02[_0x5023('0x4a')]('ut.UserId\x20=\x20?',_0x19c0d0['id']);_0x4d7f24[_0x5023('0x7f')](db['sequelize'][_0x5023('0x40')](_0x280e02[_0x5023('0x80')](),{'type':db['sequelize']['QueryTypes'][_0x5023('0x81')]})[_0x5023('0x34')](function(_0x55062f){if(_0x55062f[_0x5023('0x46')]===0x1){return _0x19c0d0['id'];}else{var _0x80f652=_[_0x5023('0x82')](_[_0x5023('0x3e')](_0x55062f,'TeamId'),function(_0x32838f){return _[_0x5023('0x83')](_0x48b180,_0x32838f);});if(_0x80f652){return _0x19c0d0['id'];}}}));}}return BPromise[_0x5023('0x84')](_0x4d7f24)[_0x5023('0x34')](function(_0x51e03e){_0x553dfe=_(_0x553dfe)[_0x5023('0x85')](_0x51e03e)[_0x5023('0x86')]()[_0x5023('0x87')]();return db[_0x5023('0x3a')][_0x5023('0x55')]({'where':{'id':_0xb11635[_0x5023('0x53')]['id']}})[_0x5023('0x34')](function(_0x491161){return db[_0x5023('0x77')][_0x5023('0x88')](function(_0x42eb9c){return _0x491161[_0x5023('0x7a')](_0xb11635[_0x5023('0x40')][_0x5023('0x74')],{'transaction':_0x42eb9c})['then'](function(){if(!_[_0x5023('0x89')](_0x553dfe)){return _0x491161[_0x5023('0x8a')](_0x553dfe,{'transaction':_0x42eb9c});}})['then'](function(){_0x553dfe['forEach'](function(_0x1f055d){socket[_0x5023('0x8b')](_0x5023('0x8c'),{'UserId':_0x1f055d,'ChatQueueId':_0x491161['id']});});});});});});})[_0x5023('0x34')](respondWithStatusCode(_0x42d904,null))[_0x5023('0x29')](handleError(_0x42d904,null));};exports[_0x5023('0x8d')]=function(_0x2632f6,_0x134340,_0x21a7ee){return db[_0x5023('0x3a')]['find']({'where':{'id':_0x2632f6['params']['id']}})[_0x5023('0x34')](handleEntityNotFound(_0x134340,null))[_0x5023('0x34')](function(_0x31900a){if(_0x31900a){return _0x31900a['addAgents'](_0x2632f6[_0x5023('0x57')][_0x5023('0x74')],_[_0x5023('0x8e')](_0x2632f6['body'],['ids','id'])||{})[_0x5023('0x8f')](function(_0x4198a0){for(var _0x5329f6=0x0;_0x5329f6<_0x2632f6[_0x5023('0x57')][_0x5023('0x74')][_0x5023('0x46')];_0x5329f6+=0x1){socket['emit'](_0x5023('0x79'),{'UserId':Number(_0x2632f6[_0x5023('0x57')][_0x5023('0x74')][_0x5329f6]),'ChatQueueId':Number(_0x2632f6['params']['id'])});}return _0x4198a0;});}})[_0x5023('0x34')](respondWithResult(_0x134340,null))[_0x5023('0x29')](handleError(_0x134340,null));};exports[_0x5023('0x8a')]=function(_0x4eace6,_0x185f71,_0x54f3d5){return db[_0x5023('0x3a')][_0x5023('0x55')]({'where':{'id':_0x4eace6[_0x5023('0x53')]['id']}})[_0x5023('0x34')](handleEntityNotFound(_0x185f71,null))[_0x5023('0x34')](function(_0x21112e){if(_0x21112e){return _0x21112e[_0x5023('0x8a')](_0x4eace6['query'][_0x5023('0x74')])[_0x5023('0x34')](function(){if(_[_0x5023('0x90')](_0x4eace6['query'][_0x5023('0x74')])){for(var _0x1a2556=0x0;_0x1a2556<_0x4eace6[_0x5023('0x40')][_0x5023('0x74')]['length'];_0x1a2556+=0x1){socket['emit'](_0x5023('0x8c'),{'UserId':Number(_0x4eace6['query'][_0x5023('0x74')][_0x1a2556]),'ChatQueueId':Number(_0x4eace6[_0x5023('0x53')]['id'])});}}else{socket[_0x5023('0x8b')](_0x5023('0x8c'),{'UserId':Number(_0x4eace6['query'][_0x5023('0x74')]),'ChatQueueId':Number(_0x4eace6[_0x5023('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x185f71,null))[_0x5023('0x29')](handleError(_0x185f71,null));};exports['getAgents']=function(_0x5c4a10,_0x4b896c,_0x15a27b){var _0x3ed55b={};var _0x3411a9={};var _0x161d5a;var _0x194ed3;return db[_0x5023('0x3a')][_0x5023('0x62')]({'where':{'id':_0x5c4a10[_0x5023('0x53')]['id']}})['then'](handleEntityNotFound(_0x4b896c,null))['then'](function(_0x2947b9){if(_0x2947b9){_0x161d5a=_0x2947b9;_0x3411a9[_0x5023('0x43')]=_[_0x5023('0x3f')](db[_0x5023('0x68')]['rawAttributes']);_0x3411a9[_0x5023('0x40')]=_[_0x5023('0x3f')](_0x5c4a10[_0x5023('0x40')]);_0x3411a9['filters']=_['intersection'](_0x3411a9[_0x5023('0x43')],_0x3411a9['query']);_0x3ed55b[_0x5023('0x44')]=_[_0x5023('0x42')](_0x3411a9['model'],qs[_0x5023('0x45')](_0x5c4a10[_0x5023('0x40')][_0x5023('0x45')]));_0x3ed55b[_0x5023('0x44')]=_0x3ed55b[_0x5023('0x44')][_0x5023('0x46')]?_0x3ed55b['attributes']:_0x3411a9[_0x5023('0x43')];_0x3ed55b[_0x5023('0x48')]=qs[_0x5023('0x49')](_0x5c4a10[_0x5023('0x40')][_0x5023('0x49')]);_0x3ed55b[_0x5023('0x4a')]=qs[_0x5023('0x41')](_[_0x5023('0x65')](_0x5c4a10[_0x5023('0x40')],_0x3411a9[_0x5023('0x41')]));if(_0x5c4a10['query'][_0x5023('0x4c')]){_0x3ed55b['where']=_[_0x5023('0x4d')](_0x3ed55b['where'],{'$or':_['map'](_0x3ed55b[_0x5023('0x44')],function(_0x19eafa){var _0x22957e={};_0x22957e[_0x19eafa]={'$like':'%'+_0x5c4a10[_0x5023('0x40')]['filter']+'%'};return _0x22957e;})});}_0x3ed55b=_[_0x5023('0x4d')]({},_0x3ed55b,_0x5c4a10['options']);return _0x161d5a[_0x5023('0x91')](_0x3ed55b);}})[_0x5023('0x34')](function(_0x329c08){if(_0x329c08){_0x194ed3=_0x329c08[_0x5023('0x46')];if(!_0x5c4a10[_0x5023('0x40')][_0x5023('0x64')](_0x5023('0x47'))){_0x3ed55b[_0x5023('0x31')]=qs[_0x5023('0x31')](_0x5c4a10['query']['limit']);_0x3ed55b[_0x5023('0x2e')]=qs[_0x5023('0x2e')](_0x5c4a10[_0x5023('0x40')][_0x5023('0x2e')]);}return _0x161d5a[_0x5023('0x91')](_0x3ed55b);}})[_0x5023('0x34')](function(_0x3cec82){if(_0x3cec82){return _0x3cec82?{'count':_0x194ed3,'rows':_0x3cec82}:null;}})[_0x5023('0x34')](respondWithResult(_0x4b896c,null))[_0x5023('0x29')](handleError(_0x4b896c,null));};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js
index 02f57ef..29b0ba8 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 _0x13a0=['hasOwnProperty','exports','events','ChatQueue','update','remove','emit'];(function(_0x387334,_0x2c6b6e){var _0x38b481=function(_0x255842){while(--_0x255842){_0x387334['push'](_0x387334['shift']());}};_0x38b481(++_0x2c6b6e);}(_0x13a0,0x128));var _0x013a=function(_0x23da4d,_0x63498c){_0x23da4d=_0x23da4d-0x0;var _0x4ae55=_0x13a0[_0x23da4d];return _0x4ae55;};'use strict';var EventEmitter=require(_0x013a('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0x013a('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x013a('0x2'),'afterDestroy':_0x013a('0x3')};function emitEvent(_0x3ce224){return function(_0x683ce0,_0xc7604,_0x181551){ChatQueueEvents[_0x013a('0x4')](_0x3ce224+':'+_0x683ce0['id'],_0x683ce0);ChatQueueEvents[_0x013a('0x4')](_0x3ce224,_0x683ce0);_0x181551(null);};}for(var e in events){if(events[_0x013a('0x5')](e)){var event=events[e];ChatQueue['hook'](e,emitEvent(event));}}module[_0x013a('0x6')]=ChatQueueEvents;
\ No newline at end of file
+var _0x7ec2=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue'];(function(_0x296923,_0x4adaed){var _0x29af70=function(_0x4eeedb){while(--_0x4eeedb){_0x296923['push'](_0x296923['shift']());}};_0x29af70(++_0x4adaed);}(_0x7ec2,0x15c));var _0x27ec=function(_0x5c4311,_0x5da2d5){_0x5c4311=_0x5c4311-0x0;var _0x46bc6b=_0x7ec2[_0x5c4311];return _0x46bc6b;};'use strict';var EventEmitter=require(_0x27ec('0x0'));var ChatQueue=require(_0x27ec('0x1'))['db'][_0x27ec('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x27ec('0x3'),'afterUpdate':_0x27ec('0x4'),'afterDestroy':'remove'};function emitEvent(_0x45b293){return function(_0x340231,_0x3e1120,_0x39badf){ChatQueueEvents[_0x27ec('0x5')](_0x45b293+':'+_0x340231['id'],_0x340231);ChatQueueEvents[_0x27ec('0x5')](_0x45b293,_0x340231);_0x39badf(null);};}for(var e in events){if(events[_0x27ec('0x6')](e)){var event=events[e];ChatQueue[_0x27ec('0x7')](e,emitEvent(event));}}module[_0x27ec('0x8')]=ChatQueueEvents;
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js
index 0d329ea..2b055f9 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 _0xbe71=['request-promise','path','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','moment','bluebird'];(function(_0x1d7efb,_0x11d3fd){var _0x435535=function(_0x176f54){while(--_0x176f54){_0x1d7efb['push'](_0x1d7efb['shift']());}};_0x435535(++_0x11d3fd);}(_0xbe71,0x1e7));var _0x1be7=function(_0x4830ea,_0x147ef1){_0x4830ea=_0x4830ea-0x0;var _0x5d986b=_0xbe71[_0x4830ea];return _0x5d986b;};'use strict';var _=require(_0x1be7('0x0'));var util=require(_0x1be7('0x1'));var logger=require('../../config/logger')(_0x1be7('0x2'));var moment=require(_0x1be7('0x3'));var BPromise=require(_0x1be7('0x4'));var rp=require(_0x1be7('0x5'));var fs=require('fs');var path=require(_0x1be7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1be7('0x7'));module[_0x1be7('0x8')]=function(_0x2a9635,_0x55bb7b){return _0x2a9635[_0x1be7('0x9')](_0x1be7('0xa'),attributes,{'tableName':_0x1be7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x2a49=['request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','define','lodash','api','moment','bluebird'];(function(_0x261b8a,_0x553ec4){var _0x3455e8=function(_0xdf10d4){while(--_0xdf10d4){_0x261b8a['push'](_0x261b8a['shift']());}};_0x3455e8(++_0x553ec4);}(_0x2a49,0x1c8));var _0x92a4=function(_0x56ed85,_0x3c9de6){_0x56ed85=_0x56ed85-0x0;var _0x5a375=_0x2a49[_0x56ed85];return _0x5a375;};'use strict';var _=require(_0x92a4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x92a4('0x1'));var moment=require(_0x92a4('0x2'));var BPromise=require(_0x92a4('0x3'));var rp=require(_0x92a4('0x4'));var fs=require('fs');var path=require(_0x92a4('0x5'));var rimraf=require(_0x92a4('0x6'));var config=require(_0x92a4('0x7'));var attributes=require(_0x92a4('0x8'));module['exports']=function(_0x2e5ff5,_0x3501c8){return _0x2e5ff5[_0x92a4('0x9')]('ChatQueue',attributes,{'tableName':'chat_queues','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 e89cc0f..758f30e 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 _0xaa56=['../../config/utils','../../config/environment','jayson/promise','client','http','localhost','socket.io-emitter','./chatQueue.socket','register','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','GetChatQueue','options','attributes','limit','include','map','model','ShowChatQueue','ChatQueue','where','util','moment','randomstring','ioredis'];(function(_0x1195ed,_0xc5857e){var _0x26e1a6=function(_0x36232c){while(--_0x36232c){_0x1195ed['push'](_0x1195ed['shift']());}};_0x26e1a6(++_0xc5857e);}(_0xaa56,0x1ac));var _0x6aa5=function(_0x3e20bf,_0x137dc7){_0x3e20bf=_0x3e20bf-0x0;var _0x59a75b=_0xaa56[_0x3e20bf];return _0x59a75b;};'use strict';var _=require('lodash');var util=require(_0x6aa5('0x0'));var moment=require(_0x6aa5('0x1'));var BPromise=require('bluebird');var rs=require(_0x6aa5('0x2'));var fs=require('fs');var Redis=require(_0x6aa5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x6aa5('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x6aa5('0x5'));var jayson=require(_0x6aa5('0x6'));var client=jayson[_0x6aa5('0x7')][_0x6aa5('0x8')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6aa5('0x9'),'port':0x18eb});var socket=require(_0x6aa5('0xa'))(new Redis(config['redis']));require(_0x6aa5('0xb'))[_0x6aa5('0xc')](socket);function respondWithRpcPromise(_0x268e07,_0xe703f1,_0x24e44c){return new BPromise(function(_0x2c689f,_0x17c0df){return client[_0x6aa5('0xd')](_0x268e07,_0x24e44c)[_0x6aa5('0xe')](function(_0x643691){logger[_0x6aa5('0xf')]('ChatQueue,\x20%s,\x20%s',_0xe703f1,_0x6aa5('0x10'));logger[_0x6aa5('0x11')](_0x6aa5('0x12'),_0xe703f1,'request\x20sent',JSON[_0x6aa5('0x13')](_0x643691));if(_0x643691[_0x6aa5('0x14')]){if(_0x643691[_0x6aa5('0x14')][_0x6aa5('0x15')]===0x1f4){logger[_0x6aa5('0x14')](_0x6aa5('0x16'),_0xe703f1,_0x643691[_0x6aa5('0x14')][_0x6aa5('0x17')]);return _0x17c0df(_0x643691[_0x6aa5('0x14')]['message']);}logger[_0x6aa5('0x14')]('ChatQueue,\x20%s,\x20%s',_0xe703f1,_0x643691[_0x6aa5('0x14')][_0x6aa5('0x17')]);return _0x2c689f(_0x643691['error'][_0x6aa5('0x17')]);}else{logger[_0x6aa5('0xf')]('ChatQueue,\x20%s,\x20%s',_0xe703f1,_0x6aa5('0x10'));_0x2c689f(_0x643691[_0x6aa5('0x18')][_0x6aa5('0x17')]);}})[_0x6aa5('0x19')](function(_0x2fded3){logger['error'](_0x6aa5('0x16'),_0xe703f1,_0x2fded3);_0x17c0df(_0x2fded3);});});}exports[_0x6aa5('0x1a')]=function(_0x1f6458){var _0x1e0b1a=this;return new Promise(function(_0xd80c38,_0x1c1a91){return db['ChatQueue']['findAll']({'raw':_0x1f6458['options']?_0x1f6458[_0x6aa5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458[_0x6aa5('0x1b')]['where']||null:null,'attributes':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458[_0x6aa5('0x1b')][_0x6aa5('0x1c')]||null:null,'limit':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458['options'][_0x6aa5('0x1d')]||null:null,'include':_0x1f6458[_0x6aa5('0x1b')]?_0x1f6458[_0x6aa5('0x1b')][_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x1f6458[_0x6aa5('0x1b')][_0x6aa5('0x1e')],function(_0x132f13){return{'model':db[_0x132f13['model']],'as':_0x132f13['as'],'attributes':_0x132f13['attributes'],'include':_0x132f13[_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x132f13['include'],function(_0x563805){return{'model':db[_0x563805[_0x6aa5('0x20')]],'as':_0x563805['as'],'attributes':_0x563805['attributes'],'include':_0x563805[_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x563805[_0x6aa5('0x1e')],function(_0x482e8f){return{'model':db[_0x482e8f[_0x6aa5('0x20')]],'as':_0x482e8f['as'],'attributes':_0x482e8f[_0x6aa5('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2ca2a3){logger[_0x6aa5('0xf')](_0x6aa5('0x1a'),_0x1f6458);logger[_0x6aa5('0x11')](_0x6aa5('0x1a'),_0x1f6458,JSON[_0x6aa5('0x13')](_0x2ca2a3));_0xd80c38(_0x2ca2a3);})[_0x6aa5('0x19')](function(_0x2f4952){logger[_0x6aa5('0x14')](_0x6aa5('0x1a'),_0x2f4952[_0x6aa5('0x17')],_0x1f6458);_0x1c1a91(_0x1e0b1a[_0x6aa5('0x14')](0x1f4,_0x2f4952[_0x6aa5('0x17')]));});});};exports[_0x6aa5('0x21')]=function(_0x44bf86){var _0x263e1e=this;return new Promise(function(_0x40e3c7,_0x5d2669){return db[_0x6aa5('0x22')]['find']({'raw':_0x44bf86[_0x6aa5('0x1b')]?_0x44bf86[_0x6aa5('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x44bf86[_0x6aa5('0x1b')]?_0x44bf86[_0x6aa5('0x1b')][_0x6aa5('0x23')]||null:null,'attributes':_0x44bf86[_0x6aa5('0x1b')]?_0x44bf86[_0x6aa5('0x1b')][_0x6aa5('0x1c')]||null:null,'include':_0x44bf86['options']?_0x44bf86['options'][_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x44bf86['options'][_0x6aa5('0x1e')],function(_0x9e3915){return{'model':db[_0x9e3915[_0x6aa5('0x20')]],'as':_0x9e3915['as'],'attributes':_0x9e3915[_0x6aa5('0x1c')],'include':_0x9e3915[_0x6aa5('0x1e')]?_[_0x6aa5('0x1f')](_0x9e3915['include'],function(_0x52a091){return{'model':db[_0x52a091[_0x6aa5('0x20')]],'as':_0x52a091['as'],'attributes':_0x52a091[_0x6aa5('0x1c')],'include':_0x52a091['include']?_['map'](_0x52a091['include'],function(_0x4d8494){return{'model':db[_0x4d8494[_0x6aa5('0x20')]],'as':_0x4d8494['as'],'attributes':_0x4d8494[_0x6aa5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x6aa5('0xe')](function(_0x15aa86){logger[_0x6aa5('0xf')](_0x6aa5('0x21'),_0x44bf86);logger[_0x6aa5('0x11')](_0x6aa5('0x21'),_0x44bf86,JSON[_0x6aa5('0x13')](_0x15aa86));_0x40e3c7(_0x15aa86);})[_0x6aa5('0x19')](function(_0x262558){logger[_0x6aa5('0x14')](_0x6aa5('0x21'),_0x262558['message'],_0x44bf86);_0x5d2669(_0x263e1e[_0x6aa5('0x14')](0x1f4,_0x262558['message']));});});};
\ No newline at end of file
+var _0x1410=['findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','stringify','find','then','ShowChatQueue','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./chatQueue.socket','request','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','ChatQueue'];(function(_0x1ff60d,_0x2d5f5a){var _0x3102c0=function(_0x323aa9){while(--_0x323aa9){_0x1ff60d['push'](_0x1ff60d['shift']());}};_0x3102c0(++_0x2d5f5a);}(_0x1410,0x19e));var _0x0141=function(_0x3b70ae,_0x34fef0){_0x3b70ae=_0x3b70ae-0x0;var _0x56a0a7=_0x1410[_0x3b70ae];return _0x56a0a7;};'use strict';var _=require(_0x0141('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0141('0x1'));var rs=require(_0x0141('0x2'));var fs=require('fs');var Redis=require(_0x0141('0x3'));var db=require(_0x0141('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0141('0x5'))(_0x0141('0x6'));var config=require(_0x0141('0x7'));var jayson=require(_0x0141('0x8'));var client=jayson[_0x0141('0x9')][_0x0141('0xa')]({'port':0x232a});config[_0x0141('0xb')]=_[_0x0141('0xc')](config[_0x0141('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x0141('0xd'))(new Redis(config[_0x0141('0xb')]));require(_0x0141('0xe'))['register'](socket);function respondWithRpcPromise(_0x318fb4,_0x1571a2,_0x9127d8){return new BPromise(function(_0x5f3884,_0x263d78){return client[_0x0141('0xf')](_0x318fb4,_0x9127d8)['then'](function(_0x24424a){logger[_0x0141('0x10')](_0x0141('0x11'),_0x1571a2,_0x0141('0x12'));logger[_0x0141('0x13')](_0x0141('0x14'),_0x1571a2,_0x0141('0x12'),JSON['stringify'](_0x24424a));if(_0x24424a['error']){if(_0x24424a['error']['code']===0x1f4){logger[_0x0141('0x15')](_0x0141('0x11'),_0x1571a2,_0x24424a[_0x0141('0x15')][_0x0141('0x16')]);return _0x263d78(_0x24424a[_0x0141('0x15')][_0x0141('0x16')]);}logger[_0x0141('0x15')](_0x0141('0x11'),_0x1571a2,_0x24424a['error']['message']);return _0x5f3884(_0x24424a[_0x0141('0x15')]['message']);}else{logger[_0x0141('0x10')](_0x0141('0x11'),_0x1571a2,_0x0141('0x12'));_0x5f3884(_0x24424a[_0x0141('0x17')]['message']);}})[_0x0141('0x18')](function(_0x31946f){logger['error'](_0x0141('0x11'),_0x1571a2,_0x31946f);_0x263d78(_0x31946f);});});}exports['GetChatQueue']=function(_0x5b372e){var _0x2398d5=this;return new Promise(function(_0xda0da,_0x25a49c){return db[_0x0141('0x19')][_0x0141('0x1a')]({'raw':_0x5b372e[_0x0141('0x1b')]?_0x5b372e[_0x0141('0x1b')][_0x0141('0x1c')]===undefined?!![]:![]:!![],'where':_0x5b372e[_0x0141('0x1b')]?_0x5b372e[_0x0141('0x1b')][_0x0141('0x1d')]||null:null,'attributes':_0x5b372e[_0x0141('0x1b')]?_0x5b372e[_0x0141('0x1b')][_0x0141('0x1e')]||null:null,'limit':_0x5b372e['options']?_0x5b372e[_0x0141('0x1b')][_0x0141('0x1f')]||null:null,'include':_0x5b372e[_0x0141('0x1b')]?_0x5b372e[_0x0141('0x1b')][_0x0141('0x20')]?_[_0x0141('0x21')](_0x5b372e[_0x0141('0x1b')]['include'],function(_0x3bc4fc){return{'model':db[_0x3bc4fc[_0x0141('0x22')]],'as':_0x3bc4fc['as'],'attributes':_0x3bc4fc[_0x0141('0x1e')],'include':_0x3bc4fc['include']?_[_0x0141('0x21')](_0x3bc4fc[_0x0141('0x20')],function(_0x599c62){return{'model':db[_0x599c62[_0x0141('0x22')]],'as':_0x599c62['as'],'attributes':_0x599c62[_0x0141('0x1e')],'include':_0x599c62['include']?_[_0x0141('0x21')](_0x599c62['include'],function(_0x11479b){return{'model':db[_0x11479b[_0x0141('0x22')]],'as':_0x11479b['as'],'attributes':_0x11479b[_0x0141('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x332eaa){logger[_0x0141('0x10')](_0x0141('0x23'),_0x5b372e);logger['debug']('GetChatQueue',_0x5b372e,JSON[_0x0141('0x24')](_0x332eaa));_0xda0da(_0x332eaa);})[_0x0141('0x18')](function(_0x142e21){logger[_0x0141('0x15')](_0x0141('0x23'),_0x142e21[_0x0141('0x16')],_0x5b372e);_0x25a49c(_0x2398d5[_0x0141('0x15')](0x1f4,_0x142e21[_0x0141('0x16')]));});});};exports['ShowChatQueue']=function(_0x39b66c){var _0xac1ad2=this;return new Promise(function(_0x3ebf24,_0x3816c2){return db[_0x0141('0x19')][_0x0141('0x25')]({'raw':_0x39b66c[_0x0141('0x1b')]?_0x39b66c[_0x0141('0x1b')][_0x0141('0x1c')]===undefined?!![]:![]:!![],'where':_0x39b66c[_0x0141('0x1b')]?_0x39b66c[_0x0141('0x1b')][_0x0141('0x1d')]||null:null,'attributes':_0x39b66c[_0x0141('0x1b')]?_0x39b66c[_0x0141('0x1b')][_0x0141('0x1e')]||null:null,'include':_0x39b66c[_0x0141('0x1b')]?_0x39b66c[_0x0141('0x1b')][_0x0141('0x20')]?_[_0x0141('0x21')](_0x39b66c[_0x0141('0x1b')][_0x0141('0x20')],function(_0x59f942){return{'model':db[_0x59f942[_0x0141('0x22')]],'as':_0x59f942['as'],'attributes':_0x59f942[_0x0141('0x1e')],'include':_0x59f942[_0x0141('0x20')]?_[_0x0141('0x21')](_0x59f942[_0x0141('0x20')],function(_0x2b06bf){return{'model':db[_0x2b06bf[_0x0141('0x22')]],'as':_0x2b06bf['as'],'attributes':_0x2b06bf['attributes'],'include':_0x2b06bf[_0x0141('0x20')]?_[_0x0141('0x21')](_0x2b06bf[_0x0141('0x20')],function(_0x1e025b){return{'model':db[_0x1e025b[_0x0141('0x22')]],'as':_0x1e025b['as'],'attributes':_0x1e025b[_0x0141('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x0141('0x26')](function(_0x46eec2){logger[_0x0141('0x10')](_0x0141('0x27'),_0x39b66c);logger[_0x0141('0x13')](_0x0141('0x27'),_0x39b66c,JSON[_0x0141('0x24')](_0x46eec2));_0x3ebf24(_0x46eec2);})[_0x0141('0x18')](function(_0x4e7b31){logger[_0x0141('0x15')](_0x0141('0x27'),_0x4e7b31[_0x0141('0x16')],_0x39b66c);_0x3816c2(_0xac1ad2['error'](0x1f4,_0x4e7b31['message']));});});};
\ No newline at end of file
diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js
index 9b5afd6..dc8b543 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 _0xc874=['emit','removeListener','register','length','./chatQueue.events','remove','update'];(function(_0x1fee02,_0x4859e0){var _0x5ef284=function(_0x5a8804){while(--_0x5a8804){_0x1fee02['push'](_0x1fee02['shift']());}};_0x5ef284(++_0x4859e0);}(_0xc874,0x154));var _0x4c87=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0xc874[_0x4b2cc6];return _0x3e0b08;};'use strict';var ChatQueueEvents=require(_0x4c87('0x0'));var events=['save',_0x4c87('0x1'),_0x4c87('0x2')];function createListener(_0x505440,_0x5e6d61){return function(_0xfc1b9f){_0x5e6d61[_0x4c87('0x3')](_0x505440,_0xfc1b9f);};}function removeListener(_0x1c3dbc,_0x575a7c){return function(){ChatQueueEvents[_0x4c87('0x4')](_0x1c3dbc,_0x575a7c);};}exports[_0x4c87('0x5')]=function(_0x5d63ae){for(var _0x46e0f5=0x0,_0x3dafe0=events[_0x4c87('0x6')];_0x46e0f5<_0x3dafe0;_0x46e0f5++){var _0xdc4a29=events[_0x46e0f5];var _0x116649=createListener('chatQueue:'+_0xdc4a29,_0x5d63ae);ChatQueueEvents['on'](_0xdc4a29,_0x116649);}};
\ No newline at end of file
+var _0xe107=['remove','update','removeListener','register','length','./chatQueue.events'];(function(_0x5620dc,_0xa78c54){var _0x237f8a=function(_0x479f61){while(--_0x479f61){_0x5620dc['push'](_0x5620dc['shift']());}};_0x237f8a(++_0xa78c54);}(_0xe107,0xb3));var _0x7e10=function(_0x1f0f40,_0x2bacad){_0x1f0f40=_0x1f0f40-0x0;var _0xc8aa86=_0xe107[_0x1f0f40];return _0xc8aa86;};'use strict';var ChatQueueEvents=require(_0x7e10('0x0'));var events=['save',_0x7e10('0x1'),_0x7e10('0x2')];function createListener(_0x2871b0,_0x570b2a){return function(_0x31212d){_0x570b2a['emit'](_0x2871b0,_0x31212d);};}function removeListener(_0x4db676,_0x2bdf3c){return function(){ChatQueueEvents[_0x7e10('0x3')](_0x4db676,_0x2bdf3c);};}exports[_0x7e10('0x4')]=function(_0x5be19f){for(var _0x5f1edf=0x0,_0x1dd3de=events[_0x7e10('0x5')];_0x5f1edf<_0x1dd3de;_0x5f1edf++){var _0x156c56=events[_0x5f1edf];var _0x3413f7=createListener('chatQueue:'+_0x156c56,_0x5be19f);ChatQueueEvents['on'](_0x156c56,_0x3413f7);}};
\ No newline at end of file
diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js
index 9b108d4..77b8eb0 100644
--- a/server/api/chatQueue/index.js
+++ b/server/api/chatQueue/index.js
@@ -15,4 +15,4 @@
// * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
// * *
// *************************************************************************
-var _0x008c=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','show','/:id/teams','getTeams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','/:id','removeTeams','multer','util','path','connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service'];(function(_0x27eac1,_0x30116e){var _0x1165ba=function(_0x5ab072){while(--_0x5ab072){_0x27eac1['push'](_0x27eac1['shift']());}};_0x1165ba(++_0x30116e);}(_0x008c,0x188));var _0xc008=function(_0x32dce6,_0x23f570){_0x32dce6=_0x32dce6-0x0;var _0x1191ba=_0x008c[_0x32dce6];return _0x1191ba;};'use strict';var multer=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var timeout=require(_0xc008('0x3'));var express=require(_0xc008('0x4'));var router=express['Router']();var fs_extra=require(_0xc008('0x5'));var auth=require(_0xc008('0x6'));var interaction=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var controller=require(_0xc008('0x9'));router[_0xc008('0xa')]('/',auth[_0xc008('0xb')](),controller[_0xc008('0xc')]);router[_0xc008('0xa')]('/describe',auth[_0xc008('0xb')](),controller['describe']);router[_0xc008('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xc008('0xd')]);router[_0xc008('0xa')]('/:id/members',auth['isAuthenticated'](),controller['getMembers']);router[_0xc008('0xa')](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0xf')]);router[_0xc008('0xa')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x11')]);router[_0xc008('0x12')]('/',auth[_0xc008('0xb')](),controller['create']);router['post'](_0xc008('0xe'),auth['isAuthenticated'](),controller[_0xc008('0x13')]);router[_0xc008('0x12')](_0xc008('0x10'),auth[_0xc008('0xb')](),controller[_0xc008('0x14')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc008('0x15')]);router[_0xc008('0x16')](_0xc008('0x17'),auth[_0xc008('0xb')](),controller['destroy']);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xc008('0x18')]);router[_0xc008('0x16')]('/:id/users',auth[_0xc008('0xb')](),controller['removeAgents']);module['exports']=router;
\ No newline at end of file
+var _0x3e74=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getMembers','/:id/teams','getTeams','getAgents','post','addTeams','addAgents','put','delete','removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x3e74,0x175));var _0x43e7=function(_0x302c8e,_0x22fd0c){_0x302c8e=_0x302c8e-0x0;var _0x284f24=_0x3e74[_0x302c8e];return _0x284f24;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var fs_extra=require('fs-extra');var auth=require(_0x43e7('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43e7('0x5'));var controller=require(_0x43e7('0x6'));router[_0x43e7('0x7')]('/',auth[_0x43e7('0x8')](),controller[_0x43e7('0x9')]);router['get'](_0x43e7('0xa'),auth[_0x43e7('0x8')](),controller[_0x43e7('0xb')]);router[_0x43e7('0x7')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router['get']('/:id/members',auth[_0x43e7('0x8')](),controller[_0x43e7('0xe')]);router['get'](_0x43e7('0xf'),auth['isAuthenticated'](),controller[_0x43e7('0x10')]);router[_0x43e7('0x7')]('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x8')](),controller['create']);router['post'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x13')]);router['post']('/:id/users',auth[_0x43e7('0x8')](),controller[_0x43e7('0x14')]);router[_0x43e7('0x15')](_0x43e7('0xc'),auth['isAuthenticated'](),controller['update']);router[_0x43e7('0x16')](_0x43e7('0xc'),auth[_0x43e7('0x8')](),controller['destroy']);router['delete'](_0x43e7('0xf'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x17')]);router[_0x43e7('0x16')](_0x43e7('0x18'),auth[_0x43e7('0x8')](),controller[_0x43e7('0x19')]);module[_0x43e7('0x1a')]=router;
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js
index 476af9f..988de01 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 _0x7ec6=['exports','STRING','DATE','sequelize'];(function(_0x58f363,_0x135c64){var _0xcb2c83=function(_0x55d7fd){while(--_0x55d7fd){_0x58f363['push'](_0x58f363['shift']());}};_0xcb2c83(++_0x135c64);}(_0x7ec6,0x197));var _0x67ec=function(_0x1126aa,_0x3ac6db){_0x1126aa=_0x1126aa-0x0;var _0x5e2bd9=_0x7ec6[_0x1126aa];return _0x5e2bd9;};'use strict';var moment=require('moment');var Sequelize=require(_0x67ec('0x0'));module[_0x67ec('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x67ec('0x2')]},'joinAt':{'type':Sequelize[_0x67ec('0x3')]},'leaveAt':{'type':Sequelize[_0x67ec('0x3')]},'acceptAt':{'type':Sequelize[_0x67ec('0x3')]},'exitAt':{'type':Sequelize[_0x67ec('0x3')]},'reason':{'type':Sequelize[_0x67ec('0x2')]}};
\ No newline at end of file
+var _0x1b3d=['DATE','moment','exports','STRING'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1b3d,0xc5));var _0xd1b3=function(_0x288e18,_0x23bd84){_0x288e18=_0x288e18-0x0;var _0x415c2a=_0x1b3d[_0x288e18];return _0x415c2a;};'use strict';var moment=require(_0xd1b3('0x0'));var Sequelize=require('sequelize');module[_0xd1b3('0x1')]={'uniqueid':{'type':Sequelize[_0xd1b3('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xd1b3('0x2')]},'joinAt':{'type':Sequelize[_0xd1b3('0x3')]},'leaveAt':{'type':Sequelize[_0xd1b3('0x3')]},'acceptAt':{'type':Sequelize[_0xd1b3('0x3')]},'exitAt':{'type':Sequelize[_0xd1b3('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 d6ea483..b8b6a84 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 _0x576b=['apply','save','update','then','destroy','error','name','send','index','map','ChatQueueReport','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','rawAttributes','options','create','body','find','catch','describe','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','fs-extra','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','undefined','limit','count','set'];(function(_0x541cd7,_0x5f4baf){var _0x5a426a=function(_0x477307){while(--_0x477307){_0x541cd7['push'](_0x541cd7['shift']());}};_0x5a426a(++_0x5f4baf);}(_0x576b,0x1d9));var _0xb576=function(_0x4d1d5c,_0x549405){_0x4d1d5c=_0x4d1d5c-0x0;var _0x5358d8=_0x576b[_0x4d1d5c];return _0x5358d8;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb576('0x0'));var rp=require(_0xb576('0x1'));var moment=require('moment');var BPromise=require(_0xb576('0x2'));var Mustache=require(_0xb576('0x3'));var util=require('util');var path=require(_0xb576('0x4'));var sox=require(_0xb576('0x5'));var csv=require(_0xb576('0x6'));var ejs=require(_0xb576('0x7'));var fs=require('fs');var fs_extra=require(_0xb576('0x8'));var _=require(_0xb576('0x9'));var squel=require(_0xb576('0xa'));var crypto=require(_0xb576('0xb'));var jsforce=require(_0xb576('0xc'));var deskjs=require(_0xb576('0xd'));var toCsv=require(_0xb576('0x6'));var querystring=require(_0xb576('0xe'));var Papa=require(_0xb576('0xf'));var Redis=require(_0xb576('0x10'));var authService=require(_0xb576('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb576('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb576('0x13'))(_0xb576('0x14'));var utils=require(_0xb576('0x15'));var config=require('../../config/environment');var licenseUtil=require('../../config/license/util');var db=require(_0xb576('0x16'))['db'];function respondWithStatusCode(_0x420041,_0x8d09e0){_0x8d09e0=_0x8d09e0||0xcc;return function(_0x1c5cf2){if(_0x1c5cf2){return _0x420041[_0xb576('0x17')](_0x8d09e0);}return _0x420041[_0xb576('0x18')](_0x8d09e0)[_0xb576('0x19')]();};}function respondWithResult(_0x1f3a23,_0xb80ee8){_0xb80ee8=_0xb80ee8||0xc8;return function(_0x1791f0){if(_0x1791f0){return _0x1f3a23['status'](_0xb80ee8)['json'](_0x1791f0);}};}function respondWithFilteredResult(_0x5cf596,_0x4173de){return function(_0x44f1b3){if(_0x44f1b3){var _0x18cd64=typeof _0x4173de[_0xb576('0x1a')]===_0xb576('0x1b')&&typeof _0x4173de[_0xb576('0x1c')]==='undefined';var _0x91d029=_0x44f1b3[_0xb576('0x1d')];var _0x5406c9=_0x18cd64?0x0:_0x4173de['offset'];var _0x394d7e=_0x18cd64?_0x44f1b3[_0xb576('0x1d')]:_0x4173de[_0xb576('0x1a')]+_0x4173de['limit'];var _0x4e8677;if(_0x394d7e>=_0x91d029){_0x394d7e=_0x91d029;_0x4e8677=0xc8;}else{_0x4e8677=0xce;}_0x5cf596['status'](_0x4e8677);return _0x5cf596[_0xb576('0x1e')]('Content-Range',_0x5406c9+'-'+_0x394d7e+'/'+_0x91d029)['json'](_0x44f1b3);}return null;};}function patchUpdates(_0x2243b1){return function(_0x2bedf0){try{jsonpatch[_0xb576('0x1f')](_0x2bedf0,_0x2243b1,!![]);}catch(_0x2a95a3){return BPromise['reject'](_0x2a95a3);}return _0x2bedf0[_0xb576('0x20')]();};}function saveUpdates(_0x38cf07,_0xde0fb1){return function(_0x2295ed){if(_0x2295ed){return _0x2295ed[_0xb576('0x21')](_0x38cf07)[_0xb576('0x22')](function(_0x2b6074){return _0x2b6074;});}return null;};}function removeEntity(_0x2a930d,_0x23d3e7){return function(_0x189c32){if(_0x189c32){return _0x189c32[_0xb576('0x23')]()[_0xb576('0x22')](function(){_0x2a930d[_0xb576('0x18')](0xcc)[_0xb576('0x19')]();});}};}function handleEntityNotFound(_0x5c343f,_0x456648){return function(_0xa0be5e){if(!_0xa0be5e){_0x5c343f[_0xb576('0x17')](0x194);}return _0xa0be5e;};}function handleError(_0x3b8a50,_0x12098f){_0x12098f=_0x12098f||0x1f4;return function(_0x46863c){logger[_0xb576('0x24')](_0x46863c['stack']);if(_0x46863c[_0xb576('0x25')]){delete _0x46863c[_0xb576('0x25')];}_0x3b8a50[_0xb576('0x18')](_0x12098f)[_0xb576('0x26')](_0x46863c);};}exports[_0xb576('0x27')]=function(_0x592dfc,_0x13d833){var _0x5a7b3d={},_0xc6cbc={},_0x19f443={'count':0x0,'rows':[]};var _0x239638=_[_0xb576('0x28')](db[_0xb576('0x29')]['rawAttributes'],function(_0x1be38b){return{'name':_0x1be38b[_0xb576('0x2a')],'type':_0x1be38b[_0xb576('0x2b')][_0xb576('0x2c')]};});_0xc6cbc['model']=_[_0xb576('0x28')](_0x239638,_0xb576('0x25'));_0xc6cbc[_0xb576('0x2d')]=_['keys'](_0x592dfc['query']);_0xc6cbc['filters']=_[_0xb576('0x2e')](_0xc6cbc[_0xb576('0x2f')],_0xc6cbc[_0xb576('0x2d')]);_0x5a7b3d[_0xb576('0x30')]=_[_0xb576('0x2e')](_0xc6cbc[_0xb576('0x2f')],qs[_0xb576('0x31')](_0x592dfc[_0xb576('0x2d')][_0xb576('0x31')]));_0x5a7b3d['attributes']=_0x5a7b3d[_0xb576('0x30')]['length']?_0x5a7b3d['attributes']:_0xc6cbc[_0xb576('0x2f')];if(!_0x592dfc[_0xb576('0x2d')][_0xb576('0x32')]('nolimit')){_0x5a7b3d[_0xb576('0x1c')]=qs[_0xb576('0x1c')](_0x592dfc['query'][_0xb576('0x1c')]);_0x5a7b3d[_0xb576('0x1a')]=qs[_0xb576('0x1a')](_0x592dfc[_0xb576('0x2d')][_0xb576('0x1a')]);}_0x5a7b3d[_0xb576('0x33')]=qs[_0xb576('0x34')](_0x592dfc[_0xb576('0x2d')][_0xb576('0x34')]);_0x5a7b3d[_0xb576('0x35')]=qs[_0xb576('0x36')](_['pick'](_0x592dfc['query'],_0xc6cbc[_0xb576('0x36')]),_0x239638);if(_0x592dfc['query'][_0xb576('0x37')]){_0x5a7b3d[_0xb576('0x35')]=_[_0xb576('0x38')](_0x5a7b3d[_0xb576('0x35')],{'$or':_['map'](_0x239638,function(_0x17f0dc){if(_0x17f0dc['type']!==_0xb576('0x39')){var _0x3e076a={};_0x3e076a[_0x17f0dc[_0xb576('0x25')]]={'$like':'%'+_0x592dfc['query'][_0xb576('0x37')]+'%'};return _0x3e076a;}})});}_0x5a7b3d=_['merge']({},_0x5a7b3d,_0x592dfc['options']);var _0x47012a={'where':_0x5a7b3d[_0xb576('0x35')]};return db[_0xb576('0x29')][_0xb576('0x1d')](_0x47012a)[_0xb576('0x22')](function(_0x3a61c9){_0x19f443['count']=_0x3a61c9;if(_0x592dfc[_0xb576('0x2d')][_0xb576('0x3a')]){_0x5a7b3d[_0xb576('0x3b')]=[{'all':!![]}];}return db[_0xb576('0x29')][_0xb576('0x3c')](_0x5a7b3d);})[_0xb576('0x22')](function(_0x1207f4){_0x19f443[_0xb576('0x3d')]=_0x1207f4;return _0x19f443;})[_0xb576('0x22')](respondWithFilteredResult(_0x13d833,_0x5a7b3d))['catch'](handleError(_0x13d833,null));};exports[_0xb576('0x3e')]=function(_0x30a358,_0xbf5ca7){var _0x1c6a4c={'raw':!![],'where':{'id':_0x30a358[_0xb576('0x3f')]['id']}},_0x28a0cb={};_0x28a0cb[_0xb576('0x2f')]=_[_0xb576('0x40')](db[_0xb576('0x29')][_0xb576('0x41')]);_0x28a0cb[_0xb576('0x2d')]=_['keys'](_0x30a358['query']);_0x28a0cb[_0xb576('0x36')]=_[_0xb576('0x2e')](_0x28a0cb[_0xb576('0x2f')],_0x28a0cb[_0xb576('0x2d')]);_0x1c6a4c[_0xb576('0x30')]=_[_0xb576('0x2e')](_0x28a0cb[_0xb576('0x2f')],qs[_0xb576('0x31')](_0x30a358[_0xb576('0x2d')]['fields']));_0x1c6a4c['attributes']=_0x1c6a4c[_0xb576('0x30')]['length']?_0x1c6a4c['attributes']:_0x28a0cb[_0xb576('0x2f')];if(_0x30a358[_0xb576('0x2d')][_0xb576('0x3a')]){_0x1c6a4c['include']=[{'all':!![]}];}_0x1c6a4c=_[_0xb576('0x38')]({},_0x1c6a4c,_0x30a358[_0xb576('0x42')]);return db[_0xb576('0x29')]['find'](_0x1c6a4c)['then'](handleEntityNotFound(_0xbf5ca7,null))[_0xb576('0x22')](respondWithResult(_0xbf5ca7,null))['catch'](handleError(_0xbf5ca7,null));};exports[_0xb576('0x43')]=function(_0xe74e70,_0x58f269){return db['ChatQueueReport'][_0xb576('0x43')](_0xe74e70[_0xb576('0x44')],{})[_0xb576('0x22')](respondWithResult(_0x58f269,0xc9))['catch'](handleError(_0x58f269,null));};exports[_0xb576('0x21')]=function(_0x27e80d,_0x35a707){if(_0x27e80d[_0xb576('0x44')]['id']){delete _0x27e80d[_0xb576('0x44')]['id'];}return db[_0xb576('0x29')][_0xb576('0x45')]({'where':{'id':_0x27e80d[_0xb576('0x3f')]['id']}})[_0xb576('0x22')](handleEntityNotFound(_0x35a707,null))[_0xb576('0x22')](saveUpdates(_0x27e80d[_0xb576('0x44')],null))[_0xb576('0x22')](respondWithResult(_0x35a707,null))[_0xb576('0x46')](handleError(_0x35a707,null));};exports[_0xb576('0x23')]=function(_0x32b58c,_0x33e0df){return db[_0xb576('0x29')][_0xb576('0x45')]({'where':{'id':_0x32b58c['params']['id']}})[_0xb576('0x22')](handleEntityNotFound(_0x33e0df,null))[_0xb576('0x22')](removeEntity(_0x33e0df,null))[_0xb576('0x46')](handleError(_0x33e0df,null));};exports[_0xb576('0x47')]=function(_0x40f867,_0x3fd02e){return db[_0xb576('0x29')]['describe']()['then'](respondWithResult(_0x3fd02e,null))['catch'](handleError(_0x3fd02e,null));};
\ No newline at end of file
+var _0xb7f0=['fields','length','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','fs-extra','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','status','end','json','offset','undefined','count','set','Content-Range','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes'];(function(_0x4cb8e7,_0x2e1d22){var _0x3d0188=function(_0x6c6a39){while(--_0x6c6a39){_0x4cb8e7['push'](_0x4cb8e7['shift']());}};_0x3d0188(++_0x2e1d22);}(_0xb7f0,0x1eb));var _0x0b7f=function(_0x459573,_0x35679e){_0x459573=_0x459573-0x0;var _0x51ffcd=_0xb7f0[_0x459573];return _0x51ffcd;};'use strict';var emlformat=require(_0x0b7f('0x0'));var rimraf=require(_0x0b7f('0x1'));var zipdir=require(_0x0b7f('0x2'));var jsonpatch=require(_0x0b7f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0b7f('0x4'));var Mustache=require(_0x0b7f('0x5'));var util=require(_0x0b7f('0x6'));var path=require(_0x0b7f('0x7'));var sox=require(_0x0b7f('0x8'));var csv=require(_0x0b7f('0x9'));var ejs=require(_0x0b7f('0xa'));var fs=require('fs');var fs_extra=require(_0x0b7f('0xb'));var _=require(_0x0b7f('0xc'));var squel=require(_0x0b7f('0xd'));var crypto=require('crypto');var jsforce=require(_0x0b7f('0xe'));var deskjs=require(_0x0b7f('0xf'));var toCsv=require('to-csv');var querystring=require(_0x0b7f('0x10'));var Papa=require(_0x0b7f('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x0b7f('0x12'));var hardwareService=require(_0x0b7f('0x13'));var logger=require(_0x0b7f('0x14'))(_0x0b7f('0x15'));var utils=require(_0x0b7f('0x16'));var config=require(_0x0b7f('0x17'));var licenseUtil=require(_0x0b7f('0x18'));var db=require(_0x0b7f('0x19'))['db'];function respondWithStatusCode(_0x1af907,_0x34121a){_0x34121a=_0x34121a||0xcc;return function(_0x930432){if(_0x930432){return _0x1af907['sendStatus'](_0x34121a);}return _0x1af907[_0x0b7f('0x1a')](_0x34121a)[_0x0b7f('0x1b')]();};}function respondWithResult(_0x1e3f86,_0x19ddf2){_0x19ddf2=_0x19ddf2||0xc8;return function(_0x294db5){if(_0x294db5){return _0x1e3f86[_0x0b7f('0x1a')](_0x19ddf2)[_0x0b7f('0x1c')](_0x294db5);}};}function respondWithFilteredResult(_0x18069a,_0x5a2b0b){return function(_0x20e15d){if(_0x20e15d){var _0x1d223f=typeof _0x5a2b0b[_0x0b7f('0x1d')]===_0x0b7f('0x1e')&&typeof _0x5a2b0b['limit']===_0x0b7f('0x1e');var _0x3f6463=_0x20e15d[_0x0b7f('0x1f')];var _0x168e7e=_0x1d223f?0x0:_0x5a2b0b[_0x0b7f('0x1d')];var _0x50cee2=_0x1d223f?_0x20e15d[_0x0b7f('0x1f')]:_0x5a2b0b['offset']+_0x5a2b0b['limit'];var _0x36a619;if(_0x50cee2>=_0x3f6463){_0x50cee2=_0x3f6463;_0x36a619=0xc8;}else{_0x36a619=0xce;}_0x18069a[_0x0b7f('0x1a')](_0x36a619);return _0x18069a[_0x0b7f('0x20')](_0x0b7f('0x21'),_0x168e7e+'-'+_0x50cee2+'/'+_0x3f6463)[_0x0b7f('0x1c')](_0x20e15d);}return null;};}function patchUpdates(_0x52abc6){return function(_0x55362c){try{jsonpatch[_0x0b7f('0x22')](_0x55362c,_0x52abc6,!![]);}catch(_0x3ca024){return BPromise[_0x0b7f('0x23')](_0x3ca024);}return _0x55362c['save']();};}function saveUpdates(_0xb130f0,_0x1ec1d3){return function(_0x26f974){if(_0x26f974){return _0x26f974[_0x0b7f('0x24')](_0xb130f0)[_0x0b7f('0x25')](function(_0x44a0ae){return _0x44a0ae;});}return null;};}function removeEntity(_0x459389,_0x45ab0e){return function(_0xc74a5d){if(_0xc74a5d){return _0xc74a5d['destroy']()[_0x0b7f('0x25')](function(){_0x459389[_0x0b7f('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x50776a,_0x4a2841){return function(_0x37a5e5){if(!_0x37a5e5){_0x50776a[_0x0b7f('0x26')](0x194);}return _0x37a5e5;};}function handleError(_0x4e61be,_0xd3cb99){_0xd3cb99=_0xd3cb99||0x1f4;return function(_0x3cda59){logger[_0x0b7f('0x27')](_0x3cda59[_0x0b7f('0x28')]);if(_0x3cda59[_0x0b7f('0x29')]){delete _0x3cda59[_0x0b7f('0x29')];}_0x4e61be[_0x0b7f('0x1a')](_0xd3cb99)[_0x0b7f('0x2a')](_0x3cda59);};}exports[_0x0b7f('0x2b')]=function(_0x4ae467,_0x599bae){var _0x4ada58={},_0x3ea675={},_0x4f7e74={'count':0x0,'rows':[]};var _0x34b54c=_[_0x0b7f('0x2c')](db[_0x0b7f('0x2d')][_0x0b7f('0x2e')],function(_0x2d4727){return{'name':_0x2d4727[_0x0b7f('0x2f')],'type':_0x2d4727[_0x0b7f('0x30')]['key']};});_0x3ea675['model']=_[_0x0b7f('0x2c')](_0x34b54c,'name');_0x3ea675[_0x0b7f('0x31')]=_[_0x0b7f('0x32')](_0x4ae467[_0x0b7f('0x31')]);_0x3ea675[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x3ea675[_0x0b7f('0x35')],_0x3ea675[_0x0b7f('0x31')]);_0x4ada58[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x3ea675['model'],qs['fields'](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x4ada58[_0x0b7f('0x36')]=_0x4ada58[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x4ada58[_0x0b7f('0x36')]:_0x3ea675[_0x0b7f('0x35')];if(!_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x39')]('nolimit')){_0x4ada58['limit']=qs[_0x0b7f('0x3a')](_0x4ae467['query'][_0x0b7f('0x3a')]);_0x4ada58['offset']=qs[_0x0b7f('0x1d')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x1d')]);}_0x4ada58[_0x0b7f('0x3b')]=qs[_0x0b7f('0x3c')](_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x3c')]);_0x4ada58[_0x0b7f('0x3d')]=qs[_0x0b7f('0x33')](_['pick'](_0x4ae467['query'],_0x3ea675['filters']),_0x34b54c);if(_0x4ae467[_0x0b7f('0x31')]['filter']){_0x4ada58[_0x0b7f('0x3d')]=_[_0x0b7f('0x3e')](_0x4ada58[_0x0b7f('0x3d')],{'$or':_[_0x0b7f('0x2c')](_0x34b54c,function(_0x1e2f6c){if(_0x1e2f6c['type']!==_0x0b7f('0x3f')){var _0x2eafb6={};_0x2eafb6[_0x1e2f6c[_0x0b7f('0x29')]]={'$like':'%'+_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x40')]+'%'};return _0x2eafb6;}})});}_0x4ada58=_['merge']({},_0x4ada58,_0x4ae467[_0x0b7f('0x41')]);var _0x2f5351={'where':_0x4ada58[_0x0b7f('0x3d')]};return db[_0x0b7f('0x2d')][_0x0b7f('0x1f')](_0x2f5351)[_0x0b7f('0x25')](function(_0x40b1c5){_0x4f7e74[_0x0b7f('0x1f')]=_0x40b1c5;if(_0x4ae467[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x4ada58[_0x0b7f('0x43')]=[{'all':!![]}];}return db[_0x0b7f('0x2d')][_0x0b7f('0x44')](_0x4ada58);})['then'](function(_0x4aaf15){_0x4f7e74[_0x0b7f('0x45')]=_0x4aaf15;return _0x4f7e74;})[_0x0b7f('0x25')](respondWithFilteredResult(_0x599bae,_0x4ada58))[_0x0b7f('0x46')](handleError(_0x599bae,null));};exports[_0x0b7f('0x47')]=function(_0x2c25fc,_0x230c6b){var _0x57c147={'raw':!![],'where':{'id':_0x2c25fc[_0x0b7f('0x48')]['id']}},_0x2176c6={};_0x2176c6[_0x0b7f('0x35')]=_[_0x0b7f('0x32')](db['ChatQueueReport'][_0x0b7f('0x2e')]);_0x2176c6['query']=_[_0x0b7f('0x32')](_0x2c25fc[_0x0b7f('0x31')]);_0x2176c6[_0x0b7f('0x33')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],_0x2176c6['query']);_0x57c147[_0x0b7f('0x36')]=_[_0x0b7f('0x34')](_0x2176c6[_0x0b7f('0x35')],qs[_0x0b7f('0x37')](_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x37')]));_0x57c147[_0x0b7f('0x36')]=_0x57c147[_0x0b7f('0x36')][_0x0b7f('0x38')]?_0x57c147[_0x0b7f('0x36')]:_0x2176c6[_0x0b7f('0x35')];if(_0x2c25fc[_0x0b7f('0x31')][_0x0b7f('0x42')]){_0x57c147['include']=[{'all':!![]}];}_0x57c147=_[_0x0b7f('0x3e')]({},_0x57c147,_0x2c25fc[_0x0b7f('0x41')]);return db[_0x0b7f('0x2d')][_0x0b7f('0x49')](_0x57c147)[_0x0b7f('0x25')](handleEntityNotFound(_0x230c6b,null))[_0x0b7f('0x25')](respondWithResult(_0x230c6b,null))[_0x0b7f('0x46')](handleError(_0x230c6b,null));};exports['create']=function(_0x4d432b,_0x562843){return db[_0x0b7f('0x2d')][_0x0b7f('0x4a')](_0x4d432b['body'],{})[_0x0b7f('0x25')](respondWithResult(_0x562843,0xc9))[_0x0b7f('0x46')](handleError(_0x562843,null));};exports['update']=function(_0x2469e2,_0x4a825c){if(_0x2469e2[_0x0b7f('0x4b')]['id']){delete _0x2469e2['body']['id'];}return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x2469e2[_0x0b7f('0x48')]['id']}})[_0x0b7f('0x25')](handleEntityNotFound(_0x4a825c,null))[_0x0b7f('0x25')](saveUpdates(_0x2469e2[_0x0b7f('0x4b')],null))[_0x0b7f('0x25')](respondWithResult(_0x4a825c,null))[_0x0b7f('0x46')](handleError(_0x4a825c,null));};exports[_0x0b7f('0x4c')]=function(_0x3cfa81,_0x23e3ef){return db[_0x0b7f('0x2d')][_0x0b7f('0x49')]({'where':{'id':_0x3cfa81[_0x0b7f('0x48')]['id']}})['then'](handleEntityNotFound(_0x23e3ef,null))[_0x0b7f('0x25')](removeEntity(_0x23e3ef,null))[_0x0b7f('0x46')](handleError(_0x23e3ef,null));};exports[_0x0b7f('0x4d')]=function(_0xe820e0,_0xbad1cd){return db[_0x0b7f('0x2d')]['describe']()[_0x0b7f('0x25')](respondWithResult(_0xbad1cd,null))['catch'](handleError(_0xbad1cd,null));};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js
index 2c8bd13..928472d 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 _0xd8b0=['define','report_chat_queue','uniqueid','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x99fd59,_0x5d01b2){var _0x49d02d=function(_0x43bd0f){while(--_0x43bd0f){_0x99fd59['push'](_0x99fd59['shift']());}};_0x49d02d(++_0x5d01b2);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'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
+var _0xbaf0=['define','ChatQueueReport','report_chat_queue','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports'];(function(_0x21da2f,_0x3c62d0){var _0x59ca2e=function(_0x2122eb){while(--_0x2122eb){_0x21da2f['push'](_0x21da2f['shift']());}};_0x59ca2e(++_0x3c62d0);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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
diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js
index 64672d9..d05377a 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 _0x605f=['request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body','options','raw','stringify','UpdateChatQueueReport','update','where','limit','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x410fc4,_0x51c7a3){var _0x19880c=function(_0x7d124){while(--_0x7d124){_0x410fc4['push'](_0x410fc4['shift']());}};_0x19880c(++_0x51c7a3);}(_0x605f,0x1a6));var _0xf605=function(_0x5d3c2f,_0x116cd3){_0x5d3c2f=_0x5d3c2f-0x0;var _0x262ad1=_0x605f[_0x5d3c2f];return _0x262ad1;};'use strict';var _=require('lodash');var util=require(_0xf605('0x0'));var moment=require(_0xf605('0x1'));var BPromise=require('bluebird');var rs=require(_0xf605('0x2'));var fs=require('fs');var Redis=require(_0xf605('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf605('0x4'));var logger=require(_0xf605('0x5'))('rpc');var config=require(_0xf605('0x6'));var jayson=require(_0xf605('0x7'));var client=jayson[_0xf605('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1bdca3,_0xb8a4ed,_0x3b5bbe){return new BPromise(function(_0x2fe81e,_0x2c0a46){return client['request'](_0x1bdca3,_0x3b5bbe)[_0xf605('0x9')](function(_0x94ed81){logger[_0xf605('0xa')](_0xf605('0xb'),_0xb8a4ed,_0xf605('0xc'));logger[_0xf605('0xd')](_0xf605('0xe'),_0xb8a4ed,_0xf605('0xc'),JSON['stringify'](_0x94ed81));if(_0x94ed81[_0xf605('0xf')]){if(_0x94ed81[_0xf605('0xf')][_0xf605('0x10')]===0x1f4){logger[_0xf605('0xf')](_0xf605('0xb'),_0xb8a4ed,_0x94ed81[_0xf605('0xf')]['message']);return _0x2c0a46(_0x94ed81['error'][_0xf605('0x11')]);}logger[_0xf605('0xf')](_0xf605('0xb'),_0xb8a4ed,_0x94ed81['error'][_0xf605('0x11')]);return _0x2fe81e(_0x94ed81['error'][_0xf605('0x11')]);}else{logger[_0xf605('0xa')](_0xf605('0xb'),_0xb8a4ed,_0xf605('0xc'));_0x2fe81e(_0x94ed81[_0xf605('0x12')][_0xf605('0x11')]);}})[_0xf605('0x13')](function(_0x2dea28){logger[_0xf605('0xf')](_0xf605('0xb'),_0xb8a4ed,_0x2dea28);_0x2c0a46(_0x2dea28);});});}exports[_0xf605('0x14')]=function(_0x2739ad){var _0x5f09c3=this;return new Promise(function(_0x51fa70,_0x510ea1){return db[_0xf605('0x15')][_0xf605('0x16')](_0x2739ad[_0xf605('0x17')],{'raw':_0x2739ad[_0xf605('0x18')]?_0x2739ad[_0xf605('0x18')][_0xf605('0x19')]===undefined?!![]:![]:!![]})[_0xf605('0x9')](function(_0x477967){logger[_0xf605('0xa')](_0xf605('0x14'),_0x2739ad);logger[_0xf605('0xd')]('CreateChatQueueReport',_0x2739ad,JSON[_0xf605('0x1a')](_0x477967));_0x51fa70(_0x477967);})['catch'](function(_0x122c36){logger['error'](_0xf605('0x14'),_0x122c36['message'],_0x2739ad);_0x510ea1(_0x5f09c3[_0xf605('0xf')](0x1f4,_0x122c36[_0xf605('0x11')]));});});};exports[_0xf605('0x1b')]=function(_0x379c53){var _0x3d5d41=this;return new Promise(function(_0x4740a5,_0x5ad86d){return db[_0xf605('0x15')][_0xf605('0x1c')](_0x379c53['body'],{'raw':_0x379c53['options']?_0x379c53[_0xf605('0x18')][_0xf605('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x379c53[_0xf605('0x18')]?_0x379c53[_0xf605('0x18')][_0xf605('0x1d')]||null:null,'attributes':_0x379c53[_0xf605('0x18')]?_0x379c53[_0xf605('0x18')]['attributes']||null:null,'limit':_0x379c53[_0xf605('0x18')]?_0x379c53[_0xf605('0x18')][_0xf605('0x1e')]||null:null})['then'](function(_0x5f43fa){logger['info'](_0xf605('0x1b'),_0x379c53);logger[_0xf605('0xd')](_0xf605('0x1b'),_0x379c53,JSON[_0xf605('0x1a')](_0x5f43fa));_0x4740a5(_0x5f43fa);})[_0xf605('0x13')](function(_0x73aeb4){logger[_0xf605('0xf')](_0xf605('0x1b'),_0x73aeb4[_0xf605('0x11')],_0x379c53);_0x5ad86d(_0x3d5d41['error'](0x1f4,_0x73aeb4[_0xf605('0x11')]));});});};
\ No newline at end of file
+var _0x6f2a=['request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','update','where','attributes','limit','UpdateChatQueueReport','debug','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s'];(function(_0x27075a,_0x3c79b9){var _0x191311=function(_0x355d49){while(--_0x355d49){_0x27075a['push'](_0x27075a['shift']());}};_0x191311(++_0x3c79b9);}(_0x6f2a,0x189));var _0xa6f2=function(_0x44c316,_0x5d47a3){_0x44c316=_0x44c316-0x0;var _0x321904=_0x6f2a[_0x44c316];return _0x321904;};'use strict';var _=require(_0xa6f2('0x0'));var util=require('util');var moment=require(_0xa6f2('0x1'));var BPromise=require(_0xa6f2('0x2'));var rs=require(_0xa6f2('0x3'));var fs=require('fs');var Redis=require(_0xa6f2('0x4'));var db=require(_0xa6f2('0x5'))['db'];var utils=require(_0xa6f2('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xa6f2('0x7'));var jayson=require(_0xa6f2('0x8'));var client=jayson[_0xa6f2('0x9')][_0xa6f2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2dc568,_0x3e785f,_0x27fc13){return new BPromise(function(_0x400149,_0x24340c){return client[_0xa6f2('0xb')](_0x2dc568,_0x27fc13)[_0xa6f2('0xc')](function(_0x23a9fe){logger[_0xa6f2('0xd')](_0xa6f2('0xe'),_0x3e785f,_0xa6f2('0xf'));logger['debug'](_0xa6f2('0x10'),_0x3e785f,_0xa6f2('0xf'),JSON['stringify'](_0x23a9fe));if(_0x23a9fe[_0xa6f2('0x11')]){if(_0x23a9fe[_0xa6f2('0x11')][_0xa6f2('0x12')]===0x1f4){logger[_0xa6f2('0x11')](_0xa6f2('0xe'),_0x3e785f,_0x23a9fe[_0xa6f2('0x11')][_0xa6f2('0x13')]);return _0x24340c(_0x23a9fe[_0xa6f2('0x11')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x3e785f,_0x23a9fe['error'][_0xa6f2('0x13')]);return _0x400149(_0x23a9fe[_0xa6f2('0x11')][_0xa6f2('0x13')]);}else{logger[_0xa6f2('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x3e785f,'request\x20sent');_0x400149(_0x23a9fe[_0xa6f2('0x14')][_0xa6f2('0x13')]);}})[_0xa6f2('0x15')](function(_0x5de7a9){logger['error'](_0xa6f2('0xe'),_0x3e785f,_0x5de7a9);_0x24340c(_0x5de7a9);});});}exports[_0xa6f2('0x16')]=function(_0x412692){var _0x5da4af=this;return new Promise(function(_0xc8696,_0x322209){return db[_0xa6f2('0x17')]['create'](_0x412692[_0xa6f2('0x18')],{'raw':_0x412692[_0xa6f2('0x19')]?_0x412692[_0xa6f2('0x19')][_0xa6f2('0x1a')]===undefined?!![]:![]:!![]})[_0xa6f2('0xc')](function(_0x125f55){logger[_0xa6f2('0xd')](_0xa6f2('0x16'),_0x412692);logger['debug'](_0xa6f2('0x16'),_0x412692,JSON['stringify'](_0x125f55));_0xc8696(_0x125f55);})['catch'](function(_0x81d365){logger[_0xa6f2('0x11')](_0xa6f2('0x16'),_0x81d365[_0xa6f2('0x13')],_0x412692);_0x322209(_0x5da4af[_0xa6f2('0x11')](0x1f4,_0x81d365['message']));});});};exports['UpdateChatQueueReport']=function(_0x48592e){var _0x46e12e=this;return new Promise(function(_0x3ebfea,_0x250912){return db[_0xa6f2('0x17')][_0xa6f2('0x1b')](_0x48592e[_0xa6f2('0x18')],{'raw':_0x48592e['options']?_0x48592e[_0xa6f2('0x19')][_0xa6f2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x48592e['options']?_0x48592e[_0xa6f2('0x19')][_0xa6f2('0x1c')]||null:null,'attributes':_0x48592e['options']?_0x48592e[_0xa6f2('0x19')][_0xa6f2('0x1d')]||null:null,'limit':_0x48592e['options']?_0x48592e[_0xa6f2('0x19')][_0xa6f2('0x1e')]||null:null})['then'](function(_0x2ab0cf){logger['info'](_0xa6f2('0x1f'),_0x48592e);logger[_0xa6f2('0x20')](_0xa6f2('0x1f'),_0x48592e,JSON[_0xa6f2('0x21')](_0x2ab0cf));_0x3ebfea(_0x2ab0cf);})[_0xa6f2('0x15')](function(_0x2712fa){logger[_0xa6f2('0x11')](_0xa6f2('0x1f'),_0x2712fa[_0xa6f2('0x13')],_0x48592e);_0x250912(_0x46e12e[_0xa6f2('0x11')](0x1f4,_0x2712fa[_0xa6f2('0x13')]));});});};
\ No newline at end of file
diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js
index 1f6215d..c22a485 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 _0x445d=['connect-timeout','express','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','path'];(function(_0x25a055,_0x173511){var _0x2295f9=function(_0x579d8e){while(--_0x579d8e){_0x25a055['push'](_0x25a055['shift']());}};_0x2295f9(++_0x173511);}(_0x445d,0x1c9));var _0xd445=function(_0x6ffea2,_0x40281d){_0x6ffea2=_0x6ffea2-0x0;var _0x27c8b3=_0x445d[_0x6ffea2];return _0x27c8b3;};'use strict';var multer=require(_0xd445('0x0'));var util=require(_0xd445('0x1'));var path=require(_0xd445('0x2'));var timeout=require(_0xd445('0x3'));var express=require(_0xd445('0x4'));var router=express['Router']();var fs_extra=require(_0xd445('0x5'));var auth=require(_0xd445('0x6'));var interaction=require(_0xd445('0x7'));var config=require(_0xd445('0x8'));var controller=require('./chatQueueReport.controller');router[_0xd445('0x9')]('/',auth[_0xd445('0xa')](),controller[_0xd445('0xb')]);router['get']('/describe',auth[_0xd445('0xa')](),controller[_0xd445('0xc')]);router[_0xd445('0x9')](_0xd445('0xd'),auth[_0xd445('0xa')](),controller[_0xd445('0xe')]);router['post']('/',auth[_0xd445('0xa')](),controller[_0xd445('0xf')]);router[_0xd445('0x10')](_0xd445('0xd'),auth[_0xd445('0xa')](),controller[_0xd445('0x11')]);router[_0xd445('0x12')](_0xd445('0xd'),auth[_0xd445('0xa')](),controller['destroy']);module[_0xd445('0x13')]=router;
\ No newline at end of file
+var _0x6ac1=['express','fs-extra','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','/describe','describe','get','/:id','show','post','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3593ea,_0x295ab4){var _0x5be81c=function(_0x3ebca){while(--_0x3ebca){_0x3593ea['push'](_0x3593ea['shift']());}};_0x5be81c(++_0x295ab4);}(_0x6ac1,0x179));var _0x16ac=function(_0x2c03ca,_0xad92ca){_0x2c03ca=_0x2c03ca-0x0;var _0xe670b=_0x6ac1[_0x2c03ca];return _0xe670b;};'use strict';var multer=require('multer');var util=require(_0x16ac('0x0'));var path=require(_0x16ac('0x1'));var timeout=require(_0x16ac('0x2'));var express=require(_0x16ac('0x3'));var router=express['Router']();var fs_extra=require(_0x16ac('0x4'));var auth=require(_0x16ac('0x5'));var interaction=require(_0x16ac('0x6'));var config=require('../../config/environment');var controller=require('./chatQueueReport.controller');router['get']('/',auth[_0x16ac('0x7')](),controller[_0x16ac('0x8')]);router['get'](_0x16ac('0x9'),auth[_0x16ac('0x7')](),controller[_0x16ac('0xa')]);router[_0x16ac('0xb')](_0x16ac('0xc'),auth['isAuthenticated'](),controller[_0x16ac('0xd')]);router[_0x16ac('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x16ac('0xc'),auth['isAuthenticated'](),controller[_0x16ac('0xf')]);router[_0x16ac('0x10')](_0x16ac('0xc'),auth[_0x16ac('0x7')](),controller[_0x16ac('0x11')]);module[_0x16ac('0x12')]=router;
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js
index 0e63c33..10b903c 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 _0x9bde=['NOW','sequelize','STRING','account','agent','queue','DATE'];(function(_0x202d24,_0x5e8641){var _0x2b3a8e=function(_0x4c7c4a){while(--_0x4c7c4a){_0x202d24['push'](_0x202d24['shift']());}};_0x2b3a8e(++_0x5e8641);}(_0x9bde,0xe1));var _0xe9bd=function(_0x467d8b,_0x8eb260){_0x467d8b=_0x467d8b-0x0;var _0x395255=_0x9bde[_0x467d8b];return _0x395255;};'use strict';var moment=require('moment');var Sequelize=require(_0xe9bd('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0xe9bd('0x1')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xe9bd('0x2'),_0xe9bd('0x3'),_0xe9bd('0x4')),'allowNull':![],'defaultValue':_0xe9bd('0x4')},'transferredAt':{'type':Sequelize[_0xe9bd('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xe9bd('0x6')]}};
\ No newline at end of file
+var _0x54ef=['agent','queue','DATE','NOW','moment','sequelize','exports','ENUM','account'];(function(_0x21a1a6,_0x1474bf){var _0x5cec0e=function(_0x13abb9){while(--_0x13abb9){_0x21a1a6['push'](_0x21a1a6['shift']());}};_0x5cec0e(++_0x1474bf);}(_0x54ef,0x112));var _0xf54e=function(_0x3fd4a2,_0x13dc04){_0x3fd4a2=_0x3fd4a2-0x0;var _0x2404c6=_0x54ef[_0x3fd4a2];return _0x2404c6;};'use strict';var moment=require(_0xf54e('0x0'));var Sequelize=require(_0xf54e('0x1'));module[_0xf54e('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xf54e('0x3')](_0xf54e('0x4'),_0xf54e('0x5'),_0xf54e('0x6')),'allowNull':![],'defaultValue':_0xf54e('0x6')},'transferredAt':{'type':Sequelize[_0xf54e('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xf54e('0x8')]}};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js
index 8f5d996..06ef944 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 _0x4071=['hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','then','includeAll','catch','keys','include','create','body','update','find','params','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','fs-extra','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','status','end','json','undefined','count','offset','limit','Content-Range','apply','reject','destroy','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length'];(function(_0x405fb7,_0xb788df){var _0x1b4117=function(_0x5630ea){while(--_0x5630ea){_0x405fb7['push'](_0x405fb7['shift']());}};_0x1b4117(++_0xb788df);}(_0x4071,0x1d7));var _0x1407=function(_0x369064,_0x6f8096){_0x369064=_0x369064-0x0;var _0x2242c9=_0x4071[_0x369064];return _0x2242c9;};'use strict';var emlformat=require(_0x1407('0x0'));var rimraf=require(_0x1407('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1407('0x2'));var rp=require(_0x1407('0x3'));var moment=require(_0x1407('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1407('0x5'));var path=require(_0x1407('0x6'));var sox=require('sox');var csv=require(_0x1407('0x7'));var ejs=require(_0x1407('0x8'));var fs=require('fs');var fs_extra=require(_0x1407('0x9'));var _=require('lodash');var squel=require(_0x1407('0xa'));var crypto=require(_0x1407('0xb'));var jsforce=require(_0x1407('0xc'));var deskjs=require(_0x1407('0xd'));var toCsv=require(_0x1407('0x7'));var querystring=require(_0x1407('0xe'));var Papa=require(_0x1407('0xf'));var Redis=require(_0x1407('0x10'));var authService=require(_0x1407('0x11'));var qs=require(_0x1407('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1407('0x13'));var logger=require(_0x1407('0x14'))(_0x1407('0x15'));var utils=require(_0x1407('0x16'));var config=require(_0x1407('0x17'));var licenseUtil=require(_0x1407('0x18'));var db=require(_0x1407('0x19'))['db'];function respondWithStatusCode(_0x574130,_0x3bb0b6){_0x3bb0b6=_0x3bb0b6||0xcc;return function(_0x5d2fa0){if(_0x5d2fa0){return _0x574130[_0x1407('0x1a')](_0x3bb0b6);}return _0x574130[_0x1407('0x1b')](_0x3bb0b6)[_0x1407('0x1c')]();};}function respondWithResult(_0x11f075,_0x5a5492){_0x5a5492=_0x5a5492||0xc8;return function(_0x1e421f){if(_0x1e421f){return _0x11f075['status'](_0x5a5492)[_0x1407('0x1d')](_0x1e421f);}};}function respondWithFilteredResult(_0x415bc5,_0x5241ba){return function(_0x23e51c){if(_0x23e51c){var _0x534d2e=typeof _0x5241ba['offset']==='undefined'&&typeof _0x5241ba['limit']===_0x1407('0x1e');var _0x1a0889=_0x23e51c[_0x1407('0x1f')];var _0x40dff9=_0x534d2e?0x0:_0x5241ba[_0x1407('0x20')];var _0x542a31=_0x534d2e?_0x23e51c[_0x1407('0x1f')]:_0x5241ba['offset']+_0x5241ba[_0x1407('0x21')];var _0x542337;if(_0x542a31>=_0x1a0889){_0x542a31=_0x1a0889;_0x542337=0xc8;}else{_0x542337=0xce;}_0x415bc5[_0x1407('0x1b')](_0x542337);return _0x415bc5['set'](_0x1407('0x22'),_0x40dff9+'-'+_0x542a31+'/'+_0x1a0889)['json'](_0x23e51c);}return null;};}function patchUpdates(_0x51df64){return function(_0x4064e7){try{jsonpatch[_0x1407('0x23')](_0x4064e7,_0x51df64,!![]);}catch(_0x5d848e){return BPromise[_0x1407('0x24')](_0x5d848e);}return _0x4064e7['save']();};}function saveUpdates(_0x1ee891,_0x1b1180){return function(_0x430a66){if(_0x430a66){return _0x430a66['update'](_0x1ee891)['then'](function(_0x57fb2b){return _0x57fb2b;});}return null;};}function removeEntity(_0x5106a5,_0x425209){return function(_0x4fb71b){if(_0x4fb71b){return _0x4fb71b[_0x1407('0x25')]()['then'](function(){_0x5106a5[_0x1407('0x1b')](0xcc)[_0x1407('0x1c')]();});}};}function handleEntityNotFound(_0x5ad31b,_0x299692){return function(_0x121152){if(!_0x121152){_0x5ad31b[_0x1407('0x1a')](0x194);}return _0x121152;};}function handleError(_0x21b0b4,_0x555ab2){_0x555ab2=_0x555ab2||0x1f4;return function(_0x40dc6d){logger[_0x1407('0x26')](_0x40dc6d['stack']);if(_0x40dc6d[_0x1407('0x27')]){delete _0x40dc6d['name'];}_0x21b0b4['status'](_0x555ab2)[_0x1407('0x28')](_0x40dc6d);};}exports[_0x1407('0x29')]=function(_0x5a2359,_0x57331d){var _0x9ac8db={},_0x1867cc={},_0x5ae0e4={'count':0x0,'rows':[]};var _0x10aff6=_[_0x1407('0x2a')](db[_0x1407('0x2b')][_0x1407('0x2c')],function(_0x10a355){return{'name':_0x10a355[_0x1407('0x2d')],'type':_0x10a355[_0x1407('0x2e')][_0x1407('0x2f')]};});_0x1867cc['model']=_[_0x1407('0x2a')](_0x10aff6,'name');_0x1867cc['query']=_['keys'](_0x5a2359[_0x1407('0x30')]);_0x1867cc['filters']=_[_0x1407('0x31')](_0x1867cc[_0x1407('0x32')],_0x1867cc['query']);_0x9ac8db[_0x1407('0x33')]=_[_0x1407('0x31')](_0x1867cc[_0x1407('0x32')],qs[_0x1407('0x34')](_0x5a2359['query'][_0x1407('0x34')]));_0x9ac8db[_0x1407('0x33')]=_0x9ac8db[_0x1407('0x33')][_0x1407('0x35')]?_0x9ac8db[_0x1407('0x33')]:_0x1867cc[_0x1407('0x32')];if(!_0x5a2359['query'][_0x1407('0x36')](_0x1407('0x37'))){_0x9ac8db[_0x1407('0x21')]=qs[_0x1407('0x21')](_0x5a2359[_0x1407('0x30')][_0x1407('0x21')]);_0x9ac8db[_0x1407('0x20')]=qs[_0x1407('0x20')](_0x5a2359[_0x1407('0x30')][_0x1407('0x20')]);}_0x9ac8db['order']=qs[_0x1407('0x38')](_0x5a2359[_0x1407('0x30')][_0x1407('0x38')]);_0x9ac8db['where']=qs[_0x1407('0x39')](_[_0x1407('0x3a')](_0x5a2359[_0x1407('0x30')],_0x1867cc[_0x1407('0x39')]),_0x10aff6);if(_0x5a2359['query'][_0x1407('0x3b')]){_0x9ac8db[_0x1407('0x3c')]=_[_0x1407('0x3d')](_0x9ac8db['where'],{'$or':_[_0x1407('0x2a')](_0x10aff6,function(_0x4c4975){if(_0x4c4975[_0x1407('0x2e')]!==_0x1407('0x3e')){var _0x27460a={};_0x27460a[_0x4c4975['name']]={'$like':'%'+_0x5a2359[_0x1407('0x30')][_0x1407('0x3b')]+'%'};return _0x27460a;}})});}_0x9ac8db=_[_0x1407('0x3d')]({},_0x9ac8db,_0x5a2359[_0x1407('0x3f')]);var _0x4c9618={'where':_0x9ac8db[_0x1407('0x3c')]};return db[_0x1407('0x2b')][_0x1407('0x1f')](_0x4c9618)[_0x1407('0x40')](function(_0x589404){_0x5ae0e4[_0x1407('0x1f')]=_0x589404;if(_0x5a2359['query'][_0x1407('0x41')]){_0x9ac8db['include']=[{'all':!![]}];}return db[_0x1407('0x2b')]['findAll'](_0x9ac8db);})[_0x1407('0x40')](function(_0x4d0e72){_0x5ae0e4['rows']=_0x4d0e72;return _0x5ae0e4;})[_0x1407('0x40')](respondWithFilteredResult(_0x57331d,_0x9ac8db))[_0x1407('0x42')](handleError(_0x57331d,null));};exports['show']=function(_0x367807,_0x2da4de){var _0x34e81d={'raw':!![],'where':{'id':_0x367807['params']['id']}},_0x23fb02={};_0x23fb02['model']=_[_0x1407('0x43')](db['ChatTransferReport'][_0x1407('0x2c')]);_0x23fb02[_0x1407('0x30')]=_[_0x1407('0x43')](_0x367807[_0x1407('0x30')]);_0x23fb02[_0x1407('0x39')]=_['intersection'](_0x23fb02[_0x1407('0x32')],_0x23fb02['query']);_0x34e81d['attributes']=_[_0x1407('0x31')](_0x23fb02[_0x1407('0x32')],qs[_0x1407('0x34')](_0x367807[_0x1407('0x30')][_0x1407('0x34')]));_0x34e81d['attributes']=_0x34e81d['attributes']['length']?_0x34e81d[_0x1407('0x33')]:_0x23fb02[_0x1407('0x32')];if(_0x367807['query'][_0x1407('0x41')]){_0x34e81d[_0x1407('0x44')]=[{'all':!![]}];}_0x34e81d=_['merge']({},_0x34e81d,_0x367807[_0x1407('0x3f')]);return db[_0x1407('0x2b')]['find'](_0x34e81d)[_0x1407('0x40')](handleEntityNotFound(_0x2da4de,null))['then'](respondWithResult(_0x2da4de,null))[_0x1407('0x42')](handleError(_0x2da4de,null));};exports[_0x1407('0x45')]=function(_0x498652,_0x37e03e){return db[_0x1407('0x2b')][_0x1407('0x45')](_0x498652[_0x1407('0x46')],{})[_0x1407('0x40')](respondWithResult(_0x37e03e,0xc9))[_0x1407('0x42')](handleError(_0x37e03e,null));};exports[_0x1407('0x47')]=function(_0x4c02a9,_0x50643a){if(_0x4c02a9[_0x1407('0x46')]['id']){delete _0x4c02a9[_0x1407('0x46')]['id'];}return db[_0x1407('0x2b')][_0x1407('0x48')]({'where':{'id':_0x4c02a9[_0x1407('0x49')]['id']}})[_0x1407('0x40')](handleEntityNotFound(_0x50643a,null))['then'](saveUpdates(_0x4c02a9['body'],null))[_0x1407('0x40')](respondWithResult(_0x50643a,null))[_0x1407('0x42')](handleError(_0x50643a,null));};exports[_0x1407('0x25')]=function(_0x52d526,_0x17b680){return db['ChatTransferReport'][_0x1407('0x48')]({'where':{'id':_0x52d526[_0x1407('0x49')]['id']}})[_0x1407('0x40')](handleEntityNotFound(_0x17b680,null))['then'](removeEntity(_0x17b680,null))['catch'](handleError(_0x17b680,null));};exports['describe']=function(_0x108d8b,_0x1cf624){return db[_0x1407('0x2b')][_0x1407('0x4a')]()[_0x1407('0x40')](respondWithResult(_0x1cf624,null))[_0x1407('0x42')](handleError(_0x1cf624,null));};
\ No newline at end of file
+var _0x158e=['map','ChatTransferReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','limit','order','sort','where','pick','filter','type','VIRTUAL','options','includeAll','findAll','catch','params','include','merge','find','body','describe','zip-dir','request-promise','bluebird','util','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','offset','undefined','count','Content-Range','json','apply','reject','save','update','then','destroy','name','send','index'];(function(_0x5957b9,_0xbd5ce1){var _0x166fc6=function(_0x1133f6){while(--_0x1133f6){_0x5957b9['push'](_0x5957b9['shift']());}};_0x166fc6(++_0xbd5ce1);}(_0x158e,0xdd));var _0xe158=function(_0x32aa0c,_0x40ccce){_0x32aa0c=_0x32aa0c-0x0;var _0x21fb26=_0x158e[_0x32aa0c];return _0x21fb26;};'use strict';var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe158('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe158('0x1'));var moment=require('moment');var BPromise=require(_0xe158('0x2'));var Mustache=require('mustache');var util=require(_0xe158('0x3'));var path=require('path');var sox=require('sox');var csv=require(_0xe158('0x4'));var ejs=require(_0xe158('0x5'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xe158('0x6'));var squel=require(_0xe158('0x7'));var crypto=require(_0xe158('0x8'));var jsforce=require(_0xe158('0x9'));var deskjs=require('desk.js');var toCsv=require(_0xe158('0x4'));var querystring=require(_0xe158('0xa'));var Papa=require(_0xe158('0xb'));var Redis=require('ioredis');var authService=require(_0xe158('0xc'));var qs=require(_0xe158('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe158('0xe'));var logger=require(_0xe158('0xf'))('api');var utils=require('../../config/utils');var config=require(_0xe158('0x10'));var licenseUtil=require('../../config/license/util');var db=require(_0xe158('0x11'))['db'];function respondWithStatusCode(_0x3c8979,_0x26d12e){_0x26d12e=_0x26d12e||0xcc;return function(_0x2c9246){if(_0x2c9246){return _0x3c8979[_0xe158('0x12')](_0x26d12e);}return _0x3c8979[_0xe158('0x13')](_0x26d12e)[_0xe158('0x14')]();};}function respondWithResult(_0x5aaf8b,_0x2aa833){_0x2aa833=_0x2aa833||0xc8;return function(_0x11a3f9){if(_0x11a3f9){return _0x5aaf8b[_0xe158('0x13')](_0x2aa833)['json'](_0x11a3f9);}};}function respondWithFilteredResult(_0x5d8865,_0x26cd1e){return function(_0x54a627){if(_0x54a627){var _0xb73dbc=typeof _0x26cd1e[_0xe158('0x15')]===_0xe158('0x16')&&typeof _0x26cd1e['limit']==='undefined';var _0x12f09c=_0x54a627[_0xe158('0x17')];var _0x5beff6=_0xb73dbc?0x0:_0x26cd1e[_0xe158('0x15')];var _0x5ffda4=_0xb73dbc?_0x54a627[_0xe158('0x17')]:_0x26cd1e[_0xe158('0x15')]+_0x26cd1e['limit'];var _0x24dd0c;if(_0x5ffda4>=_0x12f09c){_0x5ffda4=_0x12f09c;_0x24dd0c=0xc8;}else{_0x24dd0c=0xce;}_0x5d8865[_0xe158('0x13')](_0x24dd0c);return _0x5d8865['set'](_0xe158('0x18'),_0x5beff6+'-'+_0x5ffda4+'/'+_0x12f09c)[_0xe158('0x19')](_0x54a627);}return null;};}function patchUpdates(_0x3e274d){return function(_0x53492d){try{jsonpatch[_0xe158('0x1a')](_0x53492d,_0x3e274d,!![]);}catch(_0x5cf83c){return BPromise[_0xe158('0x1b')](_0x5cf83c);}return _0x53492d[_0xe158('0x1c')]();};}function saveUpdates(_0x58139d,_0x4918ed){return function(_0x3da0b7){if(_0x3da0b7){return _0x3da0b7[_0xe158('0x1d')](_0x58139d)[_0xe158('0x1e')](function(_0x1870de){return _0x1870de;});}return null;};}function removeEntity(_0x35bf38,_0x14c413){return function(_0x3417de){if(_0x3417de){return _0x3417de[_0xe158('0x1f')]()[_0xe158('0x1e')](function(){_0x35bf38['status'](0xcc)[_0xe158('0x14')]();});}};}function handleEntityNotFound(_0x4352cc,_0xd9277a){return function(_0x125d67){if(!_0x125d67){_0x4352cc['sendStatus'](0x194);}return _0x125d67;};}function handleError(_0x7c7c79,_0x4c41b6){_0x4c41b6=_0x4c41b6||0x1f4;return function(_0x48199f){logger['error'](_0x48199f['stack']);if(_0x48199f[_0xe158('0x20')]){delete _0x48199f[_0xe158('0x20')];}_0x7c7c79[_0xe158('0x13')](_0x4c41b6)[_0xe158('0x21')](_0x48199f);};}exports[_0xe158('0x22')]=function(_0x4a8998,_0x1d2c7e){var _0x35ab5c={},_0x35e851={},_0x41ebdc={'count':0x0,'rows':[]};var _0x516d13=_[_0xe158('0x23')](db[_0xe158('0x24')][_0xe158('0x25')],function(_0x549e4e){return{'name':_0x549e4e['fieldName'],'type':_0x549e4e['type']['key']};});_0x35e851[_0xe158('0x26')]=_[_0xe158('0x23')](_0x516d13,_0xe158('0x20'));_0x35e851[_0xe158('0x27')]=_[_0xe158('0x28')](_0x4a8998[_0xe158('0x27')]);_0x35e851[_0xe158('0x29')]=_[_0xe158('0x2a')](_0x35e851[_0xe158('0x26')],_0x35e851[_0xe158('0x27')]);_0x35ab5c[_0xe158('0x2b')]=_['intersection'](_0x35e851[_0xe158('0x26')],qs[_0xe158('0x2c')](_0x4a8998['query'][_0xe158('0x2c')]));_0x35ab5c[_0xe158('0x2b')]=_0x35ab5c[_0xe158('0x2b')][_0xe158('0x2d')]?_0x35ab5c[_0xe158('0x2b')]:_0x35e851['model'];if(!_0x4a8998[_0xe158('0x27')]['hasOwnProperty']('nolimit')){_0x35ab5c[_0xe158('0x2e')]=qs[_0xe158('0x2e')](_0x4a8998[_0xe158('0x27')]['limit']);_0x35ab5c['offset']=qs['offset'](_0x4a8998[_0xe158('0x27')][_0xe158('0x15')]);}_0x35ab5c[_0xe158('0x2f')]=qs[_0xe158('0x30')](_0x4a8998[_0xe158('0x27')]['sort']);_0x35ab5c[_0xe158('0x31')]=qs[_0xe158('0x29')](_[_0xe158('0x32')](_0x4a8998[_0xe158('0x27')],_0x35e851['filters']),_0x516d13);if(_0x4a8998[_0xe158('0x27')][_0xe158('0x33')]){_0x35ab5c[_0xe158('0x31')]=_['merge'](_0x35ab5c['where'],{'$or':_['map'](_0x516d13,function(_0x461574){if(_0x461574[_0xe158('0x34')]!==_0xe158('0x35')){var _0x5a7c68={};_0x5a7c68[_0x461574['name']]={'$like':'%'+_0x4a8998[_0xe158('0x27')][_0xe158('0x33')]+'%'};return _0x5a7c68;}})});}_0x35ab5c=_['merge']({},_0x35ab5c,_0x4a8998[_0xe158('0x36')]);var _0x39ac56={'where':_0x35ab5c[_0xe158('0x31')]};return db[_0xe158('0x24')][_0xe158('0x17')](_0x39ac56)[_0xe158('0x1e')](function(_0x37f686){_0x41ebdc[_0xe158('0x17')]=_0x37f686;if(_0x4a8998[_0xe158('0x27')][_0xe158('0x37')]){_0x35ab5c['include']=[{'all':!![]}];}return db['ChatTransferReport'][_0xe158('0x38')](_0x35ab5c);})[_0xe158('0x1e')](function(_0xade240){_0x41ebdc['rows']=_0xade240;return _0x41ebdc;})[_0xe158('0x1e')](respondWithFilteredResult(_0x1d2c7e,_0x35ab5c))[_0xe158('0x39')](handleError(_0x1d2c7e,null));};exports['show']=function(_0x20fa12,_0x42d771){var _0x58e59c={'raw':!![],'where':{'id':_0x20fa12[_0xe158('0x3a')]['id']}},_0x95673c={};_0x95673c[_0xe158('0x26')]=_[_0xe158('0x28')](db[_0xe158('0x24')][_0xe158('0x25')]);_0x95673c[_0xe158('0x27')]=_[_0xe158('0x28')](_0x20fa12[_0xe158('0x27')]);_0x95673c['filters']=_[_0xe158('0x2a')](_0x95673c['model'],_0x95673c[_0xe158('0x27')]);_0x58e59c[_0xe158('0x2b')]=_[_0xe158('0x2a')](_0x95673c['model'],qs[_0xe158('0x2c')](_0x20fa12[_0xe158('0x27')]['fields']));_0x58e59c['attributes']=_0x58e59c[_0xe158('0x2b')]['length']?_0x58e59c[_0xe158('0x2b')]:_0x95673c[_0xe158('0x26')];if(_0x20fa12[_0xe158('0x27')][_0xe158('0x37')]){_0x58e59c[_0xe158('0x3b')]=[{'all':!![]}];}_0x58e59c=_[_0xe158('0x3c')]({},_0x58e59c,_0x20fa12['options']);return db[_0xe158('0x24')][_0xe158('0x3d')](_0x58e59c)[_0xe158('0x1e')](handleEntityNotFound(_0x42d771,null))[_0xe158('0x1e')](respondWithResult(_0x42d771,null))[_0xe158('0x39')](handleError(_0x42d771,null));};exports['create']=function(_0x4ed184,_0x3a43b8){return db['ChatTransferReport']['create'](_0x4ed184[_0xe158('0x3e')],{})[_0xe158('0x1e')](respondWithResult(_0x3a43b8,0xc9))[_0xe158('0x39')](handleError(_0x3a43b8,null));};exports[_0xe158('0x1d')]=function(_0x2f88a8,_0x4c649e){if(_0x2f88a8[_0xe158('0x3e')]['id']){delete _0x2f88a8['body']['id'];}return db[_0xe158('0x24')][_0xe158('0x3d')]({'where':{'id':_0x2f88a8[_0xe158('0x3a')]['id']}})[_0xe158('0x1e')](handleEntityNotFound(_0x4c649e,null))[_0xe158('0x1e')](saveUpdates(_0x2f88a8[_0xe158('0x3e')],null))[_0xe158('0x1e')](respondWithResult(_0x4c649e,null))['catch'](handleError(_0x4c649e,null));};exports['destroy']=function(_0x2c6461,_0x4c09c3){return db['ChatTransferReport'][_0xe158('0x3d')]({'where':{'id':_0x2c6461[_0xe158('0x3a')]['id']}})['then'](handleEntityNotFound(_0x4c09c3,null))[_0xe158('0x1e')](removeEntity(_0x4c09c3,null))[_0xe158('0x39')](handleError(_0x4c09c3,null));};exports[_0xe158('0x3f')]=function(_0x21d5e9,_0x1758c4){return db[_0xe158('0x24')][_0xe158('0x3f')]()[_0xe158('0x1e')](respondWithResult(_0x1758c4,null))[_0xe158('0x39')](handleError(_0x1758c4,null));};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js
index e7c1fe5..92d4175 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 _0x8819=['exports','define','ChatTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatTransferReport.attributes'];(function(_0x3ce9ee,_0x3a7252){var _0x5193f5=function(_0x1bfda0){while(--_0x1bfda0){_0x3ce9ee['push'](_0x3ce9ee['shift']());}};_0x5193f5(++_0x3a7252);}(_0x8819,0x156));var _0x9881=function(_0xd3ad15,_0x576f4b){_0xd3ad15=_0xd3ad15-0x0;var _0xcf308a=_0x8819[_0xd3ad15];return _0xcf308a;};'use strict';var _=require(_0x9881('0x0'));var util=require('util');var logger=require(_0x9881('0x1'))(_0x9881('0x2'));var moment=require(_0x9881('0x3'));var BPromise=require(_0x9881('0x4'));var rp=require(_0x9881('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9881('0x6'));var config=require(_0x9881('0x7'));var attributes=require(_0x9881('0x8'));module[_0x9881('0x9')]=function(_0x39fe36,_0x56aca5){return _0x39fe36[_0x9881('0xa')](_0x9881('0xb'),attributes,{'tableName':'report_chat_transfer','paranoid':![],'indexes':[{'name':_0x9881('0xc'),'fields':[_0x9881('0xc')]}],'timestamps':!![]});};
\ No newline at end of file
+var _0xdc9c=['path','rimraf','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','lodash','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc9c,0x127));var _0xcdc9=function(_0x473b0b,_0x3c720c){_0x473b0b=_0x473b0b-0x0;var _0x1c44db=_0xdc9c[_0x473b0b];return _0x1c44db;};'use strict';var _=require(_0xcdc9('0x0'));var util=require('util');var logger=require(_0xcdc9('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdc9('0x2'));var rimraf=require(_0xcdc9('0x3'));var config=require('../../config/environment');var attributes=require(_0xcdc9('0x4'));module[_0xcdc9('0x5')]=function(_0x47a10b,_0x3dc3e7){return _0x47a10b[_0xcdc9('0x6')](_0xcdc9('0x7'),attributes,{'tableName':_0xcdc9('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js
index 8d1e212..9c26d19 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 _0xd78c=['../../mysqldb','../../config/logger','../../config/environment','jayson/promise','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','moment','bluebird','randomstring'];(function(_0x123630,_0x28b6f9){var _0x2e7dab=function(_0x2ba771){while(--_0x2ba771){_0x123630['push'](_0x123630['shift']());}};_0x2e7dab(++_0x28b6f9);}(_0xd78c,0x1e3));var _0xcd78=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xd78c[_0x5b644e];return _0x49c6bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcd78('0x0'));var BPromise=require(_0xcd78('0x1'));var rs=require(_0xcd78('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xcd78('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xcd78('0x4'))('rpc');var config=require(_0xcd78('0x5'));var jayson=require(_0xcd78('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x53fec4,_0x2a535d,_0x1b95f4){return new BPromise(function(_0x282df1,_0x406f1c){return client['request'](_0x53fec4,_0x1b95f4)[_0xcd78('0x7')](function(_0xcd3268){logger['info'](_0xcd78('0x8'),_0x2a535d,_0xcd78('0x9'));logger[_0xcd78('0xa')]('ChatTransferReport,\x20%s,\x20%s,\x20%s',_0x2a535d,_0xcd78('0x9'),JSON[_0xcd78('0xb')](_0xcd3268));if(_0xcd3268['error']){if(_0xcd3268[_0xcd78('0xc')][_0xcd78('0xd')]===0x1f4){logger[_0xcd78('0xc')](_0xcd78('0x8'),_0x2a535d,_0xcd3268[_0xcd78('0xc')]['message']);return _0x406f1c(_0xcd3268[_0xcd78('0xc')][_0xcd78('0xe')]);}logger[_0xcd78('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x2a535d,_0xcd3268[_0xcd78('0xc')][_0xcd78('0xe')]);return _0x282df1(_0xcd3268[_0xcd78('0xc')]['message']);}else{logger[_0xcd78('0xf')]('ChatTransferReport,\x20%s,\x20%s',_0x2a535d,_0xcd78('0x9'));_0x282df1(_0xcd3268[_0xcd78('0x10')][_0xcd78('0xe')]);}})[_0xcd78('0x11')](function(_0x3a419d){logger[_0xcd78('0xc')]('ChatTransferReport,\x20%s,\x20%s',_0x2a535d,_0x3a419d);_0x406f1c(_0x3a419d);});});}
\ No newline at end of file
+var _0xbc7b=['info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x51a063,_0x675fc5){var _0x16f2cc=function(_0x493302){while(--_0x493302){_0x51a063['push'](_0x51a063['shift']());}};_0x16f2cc(++_0x675fc5);}(_0xbc7b,0xf0));var _0xbbc7=function(_0x122573,_0x3449c0){_0x122573=_0x122573-0x0;var _0x1c4981=_0xbc7b[_0x122573];return _0x1c4981;};'use strict';var _=require(_0xbbc7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xbbc7('0x1'));var fs=require('fs');var Redis=require(_0xbbc7('0x2'));var db=require(_0xbbc7('0x3'))['db'];var utils=require(_0xbbc7('0x4'));var logger=require(_0xbbc7('0x5'))(_0xbbc7('0x6'));var config=require(_0xbbc7('0x7'));var jayson=require(_0xbbc7('0x8'));var client=jayson[_0xbbc7('0x9')][_0xbbc7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x377865,_0x34dfb8,_0x20c247){return new BPromise(function(_0x5c2ef9,_0x8352b0){return client[_0xbbc7('0xb')](_0x377865,_0x20c247)[_0xbbc7('0xc')](function(_0x2ae6aa){logger[_0xbbc7('0xd')](_0xbbc7('0xe'),_0x34dfb8,_0xbbc7('0xf'));logger['debug'](_0xbbc7('0x10'),_0x34dfb8,_0xbbc7('0xf'),JSON[_0xbbc7('0x11')](_0x2ae6aa));if(_0x2ae6aa[_0xbbc7('0x12')]){if(_0x2ae6aa['error'][_0xbbc7('0x13')]===0x1f4){logger['error'](_0xbbc7('0xe'),_0x34dfb8,_0x2ae6aa[_0xbbc7('0x12')][_0xbbc7('0x14')]);return _0x8352b0(_0x2ae6aa[_0xbbc7('0x12')][_0xbbc7('0x14')]);}logger[_0xbbc7('0x12')](_0xbbc7('0xe'),_0x34dfb8,_0x2ae6aa[_0xbbc7('0x12')][_0xbbc7('0x14')]);return _0x5c2ef9(_0x2ae6aa[_0xbbc7('0x12')][_0xbbc7('0x14')]);}else{logger['info'](_0xbbc7('0xe'),_0x34dfb8,_0xbbc7('0xf'));_0x5c2ef9(_0x2ae6aa[_0xbbc7('0x15')][_0xbbc7('0x14')]);}})[_0xbbc7('0x16')](function(_0x38a786){logger[_0xbbc7('0x12')](_0xbbc7('0xe'),_0x34dfb8,_0x38a786);_0x8352b0(_0x38a786);});});}
\ No newline at end of file
diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js
index d65f68e..a6632db 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 _0x79a6=['../../components/interaction/service','../../config/environment','./chatTransferReport.controller','isAuthenticated','index','get','/describe','/:id','show','post','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5c3ae9,_0x450f9a){var _0x3f5950=function(_0x594c1f){while(--_0x594c1f){_0x5c3ae9['push'](_0x5c3ae9['shift']());}};_0x3f5950(++_0x450f9a);}(_0x79a6,0xc1));var _0x679a=function(_0x7c0646,_0x45d16b){_0x7c0646=_0x7c0646-0x0;var _0x32416d=_0x79a6[_0x7c0646];return _0x32416d;};'use strict';var multer=require(_0x679a('0x0'));var util=require(_0x679a('0x1'));var path=require(_0x679a('0x2'));var timeout=require(_0x679a('0x3'));var express=require(_0x679a('0x4'));var router=express[_0x679a('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x679a('0x6'));var interaction=require(_0x679a('0x7'));var config=require(_0x679a('0x8'));var controller=require(_0x679a('0x9'));router['get']('/',auth[_0x679a('0xa')](),controller[_0x679a('0xb')]);router[_0x679a('0xc')](_0x679a('0xd'),auth[_0x679a('0xa')](),controller['describe']);router[_0x679a('0xc')](_0x679a('0xe'),auth[_0x679a('0xa')](),controller[_0x679a('0xf')]);router[_0x679a('0x10')]('/',auth[_0x679a('0xa')](),controller['create']);router[_0x679a('0x11')](_0x679a('0xe'),auth[_0x679a('0xa')](),controller[_0x679a('0x12')]);router[_0x679a('0x13')](_0x679a('0xe'),auth[_0x679a('0xa')](),controller['destroy']);module['exports']=router;
\ No newline at end of file
+var _0x32f6=['util','path','connect-timeout','express','Router','fs-extra','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','destroy','exports'];(function(_0x1acc2d,_0x597696){var _0xabfa6d=function(_0x41e83c){while(--_0x41e83c){_0x1acc2d['push'](_0x1acc2d['shift']());}};_0xabfa6d(++_0x597696);}(_0x32f6,0x78));var _0x632f=function(_0x25e7cb,_0x3579b7){_0x25e7cb=_0x25e7cb-0x0;var _0x375d92=_0x32f6[_0x25e7cb];return _0x375d92;};'use strict';var multer=require('multer');var util=require(_0x632f('0x0'));var path=require(_0x632f('0x1'));var timeout=require(_0x632f('0x2'));var express=require(_0x632f('0x3'));var router=express[_0x632f('0x4')]();var fs_extra=require(_0x632f('0x5'));var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x632f('0x6'));var controller=require(_0x632f('0x7'));router[_0x632f('0x8')]('/',auth[_0x632f('0x9')](),controller[_0x632f('0xa')]);router[_0x632f('0x8')]('/describe',auth[_0x632f('0x9')](),controller[_0x632f('0xb')]);router[_0x632f('0x8')](_0x632f('0xc'),auth[_0x632f('0x9')](),controller[_0x632f('0xd')]);router[_0x632f('0xe')]('/',auth['isAuthenticated'](),controller[_0x632f('0xf')]);router[_0x632f('0x10')](_0x632f('0xc'),auth[_0x632f('0x9')](),controller[_0x632f('0x11')]);router['delete'](_0x632f('0xc'),auth[_0x632f('0x9')](),controller[_0x632f('0x12')]);module[_0x632f('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 4b6453c..fd939e2 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 _0xcb91=['INTEGER','BOOLEAN','ENUM','squared','rounded','We\x20are\x20here!','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20submission\x20error','Note','Type\x20a\x20message','Send','Skip','thumb','star','stringify','input','name','text','onlineForm','parse','getDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','Meeting\x20generated\x20for\x20interaction\x20#{{interaction.id}}\x20by\x20{{agent.name}}','exports','STRING','address','email','Agent','#011F6A','#ffffff'];(function(_0x3124f8,_0x1a8b23){var _0x5bab5f=function(_0x18b09b){while(--_0x18b09b){_0x3124f8['push'](_0x3124f8['shift']());}};_0x5bab5f(++_0x1a8b23);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xcb91[_0x231b2e];return _0x3feb2a;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0x1cb9('0x0')]={'name':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'address':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'unique':_0x1cb9('0x2')},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x3')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x3')},'key':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x4')},'customerAlias':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#011F6A','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x1cb9('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x1cb9('0x1')]},'animation':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x1cb9('0x9')]('rounded',_0x1cb9('0xa')),'defaultValue':_0x1cb9('0xb')},'header_online':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0xc')},'start_chat_button':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0xd')},'download_transcript':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0xe')},'defaultWhiteLabel':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x1cb9('0xf')]},'closingQuestion':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x10')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x11')},'noteTitle':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x12')},'placeholderMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x13')},'closingMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x1cb9('0x14')},'skipMessageButton':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x15')},'conditionAgreement':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x1cb9('0x9')]('star',_0x1cb9('0x16')),'defaultValue':_0x1cb9('0x17')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1cb9('0x18')]({'items':[{'type':_0x1cb9('0x19'),'variable':null,'config':{'placeholder':_0x1cb9('0x1a'),'type':_0x1cb9('0x1b'),'required':!![]},'props':{'title':_0x1cb9('0x1a'),'helpText':''}},{'type':_0x1cb9('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x1cb9('0x3')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x1cb9('0x1c'))?JSON[_0x1cb9('0x1d')](this[_0x1cb9('0x1e')](_0x1cb9('0x1c'))):{};},'set':function(_0x43a100){return this['setDataValue'](_0x1cb9('0x1c'),JSON[_0x1cb9('0x18')](_0x43a100));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x1cb9('0x18')]({'items':[{'type':_0x1cb9('0x19'),'props':{'title':_0x1cb9('0x3'),'helpText':''},'config':{'required':!![],'placeholder':_0x1cb9('0x3'),'type':_0x1cb9('0x3')},'variable':null},{'type':_0x1cb9('0x1f'),'config':{'placeholder':_0x1cb9('0x20')},'props':{'title':_0x1cb9('0x20'),'helpText':_0x1cb9('0x21')}}],'fromKey':0x0});},'get':function(){return this[_0x1cb9('0x1e')]('offlineForm')?JSON[_0x1cb9('0x1d')](this['getDataValue'](_0x1cb9('0x22'))):{};},'set':function(_0x4efebc){return this[_0x1cb9('0x23')](_0x1cb9('0x22'),JSON[_0x1cb9('0x18')](_0x4efebc));}},'token':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x1cb9('0x1')]},'forwardOffline':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.'},'waitingMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x24')},'offlineMessageBody':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x25')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x26')},'skipUnmanaged':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x15')},'sendUnmanaged':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x14')},'enableCustomerAttachment':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x1cb9('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x1cb9('0x1')]},'notificationTemplate':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':function(){return _0x1cb9('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x29')},'verticalAlignment':{'type':Sequelize[_0x1cb9('0x7')],'defaultValue':0x1e},'labelText':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':'CHAT'},'messagesAlignment':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x2a')},'defaultTitle':{'type':Sequelize[_0x1cb9('0x1')]},'customerAvatar':{'type':Sequelize['TEXT']},'showCustomerAvatar':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'messageFontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x1cb9('0x1')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1cb9('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':_0x1cb9('0x2b')},'systemAvatar':{'type':Sequelize[_0x1cb9('0xf')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![],'comment':_0x1cb9('0x2c'),'set':function(_0x7a0d8b){if(!_0x7a0d8b)this[_0x1cb9('0x23')](_0x1cb9('0x2d'),null);this[_0x1cb9('0x23')](_0x1cb9('0x2e'),_0x7a0d8b);}},'vidaooEscalation':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x1cb9('0x1')]},'vidaooTopic':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'Generated\x20by\x20XCALLY\x20Motion'},'vidaooNote':{'type':Sequelize['STRING'],'defaultValue':function(){return _0x1cb9('0x2f');}},'vidaooMetadata':{'type':Sequelize[_0x1cb9('0xf')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x1cb9('0x8')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x1cb9('0xf')]}};
\ No newline at end of file
+var _0xb903=['BOOLEAN','Feedback','star','thumb','INTEGER','TEXT','stringify','input','text','name','parse','getDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','setDataValue','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','CHAT','alternate','#fafafa','System','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','randomstring','exports','STRING','address','email','Agent','#011F6A','ENUM','rounded','Chat','Contact\x20us','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Note','Thanks\x20you\x20for\x20your\x20time!','Send','Skip'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xb903,0x185));var _0x3b90=function(_0x54ae70,_0x16e7b1){_0x54ae70=_0x54ae70-0x0;var _0x3b3701=_0xb903[_0x54ae70];return _0x3b3701;};'use strict';var Sequelize=require(_0x3b90('0x0'));var rs=require(_0x3b90('0x1'));module[_0x3b90('0x2')]={'name':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3b90('0x4')},'description':{'type':Sequelize[_0x3b90('0x3')]},'mapKey':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x5')},'mapKeyOffline':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x5')},'key':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0x6')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3b90('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![],'defaultValue':_0x3b90('0x7'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'textButtonColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize['INTEGER'],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x3b90('0x8')](_0x3b90('0x9'),'squared'),'defaultValue':_0x3b90('0x9')},'header_online':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0xa')},'offline_chat_button':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0xb')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0xc')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0xd')},'formSubmitSuccessMessage':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0xe')},'formSubmitFailureMessage':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0xf')},'placeholderMessage':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x10')},'closingMessageButton':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x11')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0x12')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x14')},'ratingType':{'type':Sequelize[_0x3b90('0x8')](_0x3b90('0x15'),_0x3b90('0x16')),'defaultValue':_0x3b90('0x15')},'ratingStarsNumber':{'type':Sequelize[_0x3b90('0x17')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x3b90('0x18')],'defaultValue':function(){return JSON[_0x3b90('0x19')]({'items':[{'type':_0x3b90('0x1a'),'variable':null,'config':{'placeholder':'name','type':_0x3b90('0x1b'),'required':!![]},'props':{'title':_0x3b90('0x1c'),'helpText':''}},{'type':_0x3b90('0x1a'),'props':{'title':_0x3b90('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3b90('0x5'),'type':_0x3b90('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue']('onlineForm')?JSON[_0x3b90('0x1d')](this[_0x3b90('0x1e')](_0x3b90('0x1f'))):{};},'set':function(_0x2ffa1a){return this['setDataValue'](_0x3b90('0x1f'),JSON[_0x3b90('0x19')](_0x2ffa1a));}},'offlineForm':{'type':Sequelize[_0x3b90('0x18')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x3b90('0x1a'),'props':{'title':_0x3b90('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x3b90('0x5'),'type':_0x3b90('0x5')},'variable':null},{'type':_0x3b90('0x20'),'config':{'placeholder':_0x3b90('0x21')},'props':{'title':'Comments','helpText':_0x3b90('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x3b90('0x23'))?JSON[_0x3b90('0x1d')](this[_0x3b90('0x1e')](_0x3b90('0x23'))):{};},'set':function(_0xd515bd){return this[_0x3b90('0x24')](_0x3b90('0x23'),JSON[_0x3b90('0x19')](_0xd515bd));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x3b90('0x3')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x25')},'waitingMessage':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0x27')},'skipUnmanaged':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x12')},'sendUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x3b90('0x18')]},'showAgentAvatar':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x3b90('0x28');}},'notificationSound':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x3b90('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize[_0x3b90('0x17')],'defaultValue':0x1e},'labelText':{'type':Sequelize['STRING'],'defaultValue':_0x3b90('0x2a')},'messagesAlignment':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x2b')},'defaultTitle':{'type':Sequelize[_0x3b90('0x3')]},'customerAvatar':{'type':Sequelize[_0x3b90('0x18')]},'showCustomerAvatar':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x3b90('0x17')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x3b90('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x3b90('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x3b90('0x17')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':_0x3b90('0x2d')},'systemAvatar':{'type':Sequelize[_0x3b90('0x18')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3b90('0x17')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![],'comment':_0x3b90('0x2e'),'set':function(_0x40ce3a){if(!_0x40ce3a)this[_0x3b90('0x24')](_0x3b90('0x2f'),null);this[_0x3b90('0x24')](_0x3b90('0x30'),_0x40ce3a);}},'vidaooEscalation':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![]},'vidaooApiKey':{'type':Sequelize[_0x3b90('0x3')]},'vidaooTopic':{'type':Sequelize[_0x3b90('0x3')],'allowNull':![],'defaultValue':_0x3b90('0x31')},'vidaooNote':{'type':Sequelize[_0x3b90('0x3')],'defaultValue':function(){return _0x3b90('0x32');}},'vidaooMetadata':{'type':Sequelize[_0x3b90('0x18')],'defaultValue':null},'openNewInteraction':{'type':Sequelize[_0x3b90('0x13')],'defaultValue':![],'allowNull':!![]},'subjectOffline':{'type':Sequelize[_0x3b90('0x18')]}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js
index cb77513..53aaa0b 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 _0x0c44=['MailAccountId','toPairsIn','mapValues','email','NotifyMailAccount','notifyMail','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','getInteractions','Contact','fullname','internal','Tag','tag','Command','iftime\x20%s,%s','interval','timezone','iftime\x20%s','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','getSnippet','Intervals','custom','License','increment','chatLicenseExceeded','Interval','push','some','server/files/chat/iframe.ejs','utf8','remote','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','labelText','textColor','textButtonColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','sequelize','Transaction','ISOLATION_LEVELS','READ_COMMITTED','findAndCountAll','priority','finally','getApplications','addProactiveActions','chatProactiveAction','omit','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','ChatOfflineMessage','Attachment','Attachments','addAgents','emit','userChatWebsite:remove','getAgents','bluebird','mustache','util','path','fs-extra','lodash','querystring','ioredis','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','./chatWebsite.socket','register','html-to-text','jayson/promise','client','http','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','status','end','json','offset','undefined','limit','count','set','Content-Range','update','get','ChatWebsites','UserProfileResource','destroy','stack','index','Pause','mandatoryDispositionPause','ChatWebsite','rawAttributes','fieldName','type','key','model','map','name','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','params','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','body','ChatWebsiteId','Disposition','hasOwnProperty','merge','removeDispositions','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','ids','addLogo','file','filename','addAvatar','agentAvatar','addSystemAvatar','systemAvatar','getLogo','join','server/files/images/logos/default_logo.svg','sitepic','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','root','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','getCustomerAvatar','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','user-agent-parser','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','list','applications','asc','account','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','version','%s\x20%s','device','vendor','threadId','externalUrl','interaction','ChatInteraction','spread','messageId','created','autoclose','close','unmanaged','*,*,*,*','ChatMessage','UserId','User','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','notify','offline','files','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','MailAccount','ListId','readFileSync','server/files/templates/chatOfflineMessage.ejs','toPairs','offlineMessageBody','fromString','originalname','mimetype','server','attachments','offline-chat','basename','openNewInteraction','transaction','bulkCreate','MailServerOut','Smtp','CloudProvider','forwardOffline','forwardOfflineAddress','getSmtpOptions','SendMail','sendMail','format','\x22%s\x22\x20<%s>','offlineMessageSubject'];(function(_0x377937,_0x35c135){var _0x3c8c93=function(_0xc29357){while(--_0xc29357){_0x377937['push'](_0x377937['shift']());}};_0x3c8c93(++_0x35c135);}(_0x0c44,0x17e));var _0x40c4=function(_0x451fc1,_0x5f4025){_0x451fc1=_0x451fc1-0x0;var _0x420837=_0x0c44[_0x451fc1];return _0x420837;};'use strict';var BPromise=require(_0x40c4('0x0'));var Mustache=require(_0x40c4('0x1'));var util=require(_0x40c4('0x2'));var path=require(_0x40c4('0x3'));var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x40c4('0x4'));var _=require(_0x40c4('0x5'));var querystring=require(_0x40c4('0x6'));var Redis=require(_0x40c4('0x7'));var qs=require(_0x40c4('0x8'));var logger=require(_0x40c4('0x9'))(_0x40c4('0xa'));var config=require('../../config/environment');var db=require(_0x40c4('0xb'))['db'];config[_0x40c4('0xc')]=_[_0x40c4('0xd')](config[_0x40c4('0xc')],{'host':_0x40c4('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x40c4('0xc')]));require(_0x40c4('0xf'))[_0x40c4('0x10')](socket);var htmlToText=require(_0x40c4('0x11'));var jayson=require(_0x40c4('0x12'));var client=jayson[_0x40c4('0x13')][_0x40c4('0x14')]({'port':0x232c});var client9002=jayson[_0x40c4('0x13')][_0x40c4('0x14')]({'port':0x232a});var client9003=jayson[_0x40c4('0x13')][_0x40c4('0x14')]({'port':0x232b});var client9001=jayson['client'][_0x40c4('0x14')]({'port':0x2329});function respondWithRpcPromise(_0x2c4364,_0xfe8913,_0xddf19c,_0x99f360){return new BPromise(function(_0x477c42,_0x668560){var _0x449f85=_0x99f360||client;return _0x449f85['request'](_0x2c4364,_0xddf19c)[_0x40c4('0x15')](function(_0x431d98){logger[_0x40c4('0x16')](_0x40c4('0x17'),_0xfe8913,_0x40c4('0x18'));logger[_0x40c4('0x19')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0xfe8913,_0x40c4('0x18'),JSON[_0x40c4('0x1a')](_0x431d98));if(_0x431d98[_0x40c4('0x1b')]){if(_0x431d98[_0x40c4('0x1b')][_0x40c4('0x1c')]===0x1f4){logger[_0x40c4('0x1b')](_0x40c4('0x17'),_0xfe8913,_0x431d98['error'][_0x40c4('0x1d')]);return _0x668560(_0x431d98[_0x40c4('0x1b')][_0x40c4('0x1d')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0xfe8913,_0x431d98['error'][_0x40c4('0x1d')]);return _0x477c42(_0x431d98[_0x40c4('0x1b')][_0x40c4('0x1d')]);}else{logger['info'](_0x40c4('0x17'),_0xfe8913,_0x40c4('0x18'));_0x477c42(_0x431d98[_0x40c4('0x1e')][_0x40c4('0x1d')]);}})['catch'](function(_0x373293){logger[_0x40c4('0x1b')](_0x40c4('0x17'),_0xfe8913,_0x373293);_0x668560(_0x373293);});});}function respondWithStatusCode(_0x10f123,_0x3d5f44){_0x3d5f44=_0x3d5f44||0xcc;return function(_0x3c9bf7){if(_0x3c9bf7){return _0x10f123[_0x40c4('0x1f')](_0x3d5f44);}return _0x10f123[_0x40c4('0x20')](_0x3d5f44)[_0x40c4('0x21')]();};}function respondWithResult(_0x1246ee,_0x3bcb51){_0x3bcb51=_0x3bcb51||0xc8;return function(_0x15e01e){if(_0x15e01e){return _0x1246ee['status'](_0x3bcb51)[_0x40c4('0x22')](_0x15e01e);}};}function respondWithFilteredResult(_0x4d5840,_0x2863c1){return function(_0x3d1eff){if(_0x3d1eff){var _0x44d295=typeof _0x2863c1[_0x40c4('0x23')]===_0x40c4('0x24')&&typeof _0x2863c1[_0x40c4('0x25')]===_0x40c4('0x24');var _0x2b360b=_0x3d1eff[_0x40c4('0x26')];var _0x9553d1=_0x44d295?0x0:_0x2863c1[_0x40c4('0x23')];var _0x527e56=_0x44d295?_0x3d1eff[_0x40c4('0x26')]:_0x2863c1[_0x40c4('0x23')]+_0x2863c1[_0x40c4('0x25')];var _0x1e6a8a;if(_0x527e56>=_0x2b360b){_0x527e56=_0x2b360b;_0x1e6a8a=0xc8;}else{_0x1e6a8a=0xce;}_0x4d5840['status'](_0x1e6a8a);return _0x4d5840[_0x40c4('0x27')](_0x40c4('0x28'),_0x9553d1+'-'+_0x527e56+'/'+_0x2b360b)[_0x40c4('0x22')](_0x3d1eff);}return null;};}function saveUpdates(_0x14fe73){return function(_0x3b85c5){if(_0x3b85c5){return _0x3b85c5[_0x40c4('0x29')](_0x14fe73)['then'](function(_0x32c7ad){return _0x32c7ad;});}return null;};}function removeEntity(_0x86ad81){return function(_0x6cc6f0){if(_0x6cc6f0){return _0x6cc6f0['destroy']()[_0x40c4('0x15')](function(){var _0x5b3145=_0x6cc6f0[_0x40c4('0x2a')]({'plain':!![]});var _0x95f156=_0x40c4('0x2b');return db[_0x40c4('0x2c')][_0x40c4('0x2d')]({'where':{'type':_0x95f156,'resourceId':_0x5b3145['id']}})[_0x40c4('0x15')](function(){return _0x6cc6f0;});})[_0x40c4('0x15')](function(){_0x86ad81[_0x40c4('0x20')](0xcc)[_0x40c4('0x21')]();});}};}function handleEntityNotFound(_0x8fa61c){return function(_0x40bd6f){if(!_0x40bd6f){_0x8fa61c[_0x40c4('0x1f')](0x194);}return _0x40bd6f;};}function handleError(_0x4a744c,_0x1b5576){_0x1b5576=_0x1b5576||0x1f4;return function(_0x2ade6e){logger[_0x40c4('0x1b')](_0x2ade6e[_0x40c4('0x2e')]);if(_0x2ade6e['name']){delete _0x2ade6e['name'];}_0x4a744c[_0x40c4('0x20')](_0x1b5576)['send'](_0x2ade6e);};}exports[_0x40c4('0x2f')]=function(_0x40c0bb,_0x402109){var _0x2d0bfb={'include':[{'model':db[_0x40c4('0x30')],'as':_0x40c4('0x31')}]},_0x146aea={},_0x1d9a79={'count':0x0,'rows':[]};var _0x21b452=_['map'](db[_0x40c4('0x32')][_0x40c4('0x33')],function(_0x25eff7){return{'name':_0x25eff7[_0x40c4('0x34')],'type':_0x25eff7[_0x40c4('0x35')][_0x40c4('0x36')]};});_0x146aea[_0x40c4('0x37')]=_[_0x40c4('0x38')](_0x21b452,_0x40c4('0x39'));_0x146aea['query']=_[_0x40c4('0x3a')](_0x40c0bb[_0x40c4('0x3b')]);_0x146aea[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x146aea[_0x40c4('0x37')],_0x146aea['query']);_0x2d0bfb[_0x40c4('0x3e')]=_['intersection'](_0x146aea['model'],qs['fields'](_0x40c0bb[_0x40c4('0x3b')][_0x40c4('0x3f')]));_0x2d0bfb['attributes']=_0x2d0bfb['attributes'][_0x40c4('0x40')]?_0x2d0bfb['attributes']:_0x146aea[_0x40c4('0x37')];if(!_0x40c0bb[_0x40c4('0x3b')]['hasOwnProperty'](_0x40c4('0x41'))){_0x2d0bfb[_0x40c4('0x25')]=qs[_0x40c4('0x25')](_0x40c0bb[_0x40c4('0x3b')]['limit']);_0x2d0bfb[_0x40c4('0x23')]=qs[_0x40c4('0x23')](_0x40c0bb[_0x40c4('0x3b')][_0x40c4('0x23')]);}_0x2d0bfb[_0x40c4('0x42')]=qs[_0x40c4('0x43')](_0x40c0bb['query'][_0x40c4('0x43')]);_0x2d0bfb['where']=qs[_0x40c4('0x3c')](_[_0x40c4('0x44')](_0x40c0bb['query'],_0x146aea['filters']),_0x21b452);if(_0x40c0bb[_0x40c4('0x3b')][_0x40c4('0x45')]){_0x2d0bfb[_0x40c4('0x46')]=_['merge'](_0x2d0bfb[_0x40c4('0x46')],{'$or':_['map'](_0x21b452,function(_0x283a78){if(_0x283a78['type']!==_0x40c4('0x47')){var _0x5ee607={};_0x5ee607[_0x283a78['name']]={'$like':'%'+_0x40c0bb[_0x40c4('0x3b')][_0x40c4('0x45')]+'%'};return _0x5ee607;}})});}_0x2d0bfb=_['merge']({},_0x2d0bfb,_0x40c0bb[_0x40c4('0x48')]);var _0x4586f1={'where':_0x2d0bfb['where']};return db[_0x40c4('0x32')][_0x40c4('0x26')](_0x4586f1)[_0x40c4('0x15')](function(_0x2972c2){_0x1d9a79['count']=_0x2972c2;if(_0x40c0bb['query'][_0x40c4('0x49')]){_0x2d0bfb['include']=[{'all':!![]}];}return db[_0x40c4('0x32')][_0x40c4('0x4a')](_0x2d0bfb);})['then'](function(_0x234af2){_0x1d9a79[_0x40c4('0x4b')]=_0x234af2;return _0x1d9a79;})[_0x40c4('0x15')](respondWithFilteredResult(_0x402109,_0x2d0bfb))[_0x40c4('0x4c')](handleError(_0x402109,null));};exports['show']=function(_0x2fa6fd,_0x55190a){var _0x4a8a41={'raw':![],'where':{'id':_0x2fa6fd[_0x40c4('0x4d')]['id']},'include':[{'model':db[_0x40c4('0x30')],'as':_0x40c4('0x31')}]},_0x5786b9={};_0x5786b9[_0x40c4('0x37')]=_[_0x40c4('0x3a')](db[_0x40c4('0x32')]['rawAttributes']);_0x5786b9[_0x40c4('0x3b')]=_[_0x40c4('0x3a')](_0x2fa6fd[_0x40c4('0x3b')]);_0x5786b9[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x5786b9['model'],_0x5786b9['query']);_0x4a8a41[_0x40c4('0x3e')]=_['intersection'](_0x5786b9[_0x40c4('0x37')],qs['fields'](_0x2fa6fd['query'][_0x40c4('0x3f')]));_0x4a8a41[_0x40c4('0x3e')]=_0x4a8a41[_0x40c4('0x3e')][_0x40c4('0x40')]?_0x4a8a41['attributes']:_0x5786b9[_0x40c4('0x37')];if(_0x2fa6fd['query'][_0x40c4('0x49')]){_0x4a8a41[_0x40c4('0x4e')]=[{'all':!![]}];}_0x4a8a41=_['merge']({},_0x4a8a41,_0x2fa6fd[_0x40c4('0x48')]);return db['ChatWebsite'][_0x40c4('0x4f')](_0x4a8a41)[_0x40c4('0x15')](handleEntityNotFound(_0x55190a,null))[_0x40c4('0x15')](respondWithResult(_0x55190a,null))[_0x40c4('0x4c')](handleError(_0x55190a,null));};exports[_0x40c4('0x50')]=function(_0x35911e,_0x5344fa){return db[_0x40c4('0x32')]['create'](_0x35911e['body'],{})[_0x40c4('0x15')](function(_0x19ddea){var _0x84956c=_0x35911e[_0x40c4('0x51')]['get']({'plain':!![]});if(!_0x84956c)throw new Error(_0x40c4('0x52'));if(_0x84956c[_0x40c4('0x53')]===_0x40c4('0x51')){var _0x3c0cfd=_0x19ddea[_0x40c4('0x2a')]({'plain':!![]});var _0x2e2f60=_0x40c4('0x2b');return db['UserProfileSection'][_0x40c4('0x4f')]({'where':{'name':_0x2e2f60,'userProfileId':_0x84956c[_0x40c4('0x54')]},'raw':!![]})[_0x40c4('0x15')](function(_0x18655c){if(_0x18655c&&_0x18655c[_0x40c4('0x55')]===0x0){return db[_0x40c4('0x2c')][_0x40c4('0x50')]({'name':_0x3c0cfd['name'],'resourceId':_0x3c0cfd['id'],'type':_0x18655c[_0x40c4('0x39')],'sectionId':_0x18655c['id']},{})[_0x40c4('0x15')](function(){return _0x19ddea;});}else{return _0x19ddea;}})[_0x40c4('0x4c')](function(_0x392ddd){logger['error'](_0x40c4('0x56'),_0x392ddd);throw _0x392ddd;});}return _0x19ddea;})[_0x40c4('0x15')](respondWithResult(_0x5344fa,0xc9))[_0x40c4('0x4c')](handleError(_0x5344fa,null));};exports['update']=function(_0x3348c3,_0x4e4591){if(_0x3348c3['body']['id']){delete _0x3348c3['body']['id'];}return db[_0x40c4('0x32')]['find']({'where':{'id':_0x3348c3[_0x40c4('0x4d')]['id']},'include':[{'model':db[_0x40c4('0x30')],'as':_0x40c4('0x31')}]})[_0x40c4('0x15')](handleEntityNotFound(_0x4e4591,null))['then'](saveUpdates(_0x3348c3['body'],null))[_0x40c4('0x15')](respondWithResult(_0x4e4591,null))[_0x40c4('0x4c')](handleError(_0x4e4591,null));};exports[_0x40c4('0x2d')]=function(_0xbf3782,_0x44238c){return db['ChatWebsite'][_0x40c4('0x4f')]({'where':{'id':_0xbf3782['params']['id']}})['then'](handleEntityNotFound(_0x44238c,null))[_0x40c4('0x15')](removeEntity(_0x44238c,null))[_0x40c4('0x4c')](handleError(_0x44238c,null));};exports[_0x40c4('0x57')]=function(_0x43862a,_0x3393a7){return db['ChatWebsite'][_0x40c4('0x57')]()[_0x40c4('0x15')](respondWithResult(_0x3393a7,null))['catch'](handleError(_0x3393a7,null));};exports[_0x40c4('0x58')]=function(_0x50e962,_0x57992a){if(_0x50e962['body']['id']){delete _0x50e962['body']['id'];}return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'where':{'id':_0x50e962['params']['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x57992a,null))['then'](function(_0x142bcf){if(_0x142bcf){_0x50e962[_0x40c4('0x59')][_0x40c4('0x5a')]=_0x142bcf['id'];return db[_0x40c4('0x5b')]['create'](_0x50e962[_0x40c4('0x59')]);}})[_0x40c4('0x15')](respondWithResult(_0x57992a,null))[_0x40c4('0x4c')](handleError(_0x57992a,null));};exports['getDispositions']=function(_0x17638f,_0x5e408d){var _0x3b6885={'raw':![],'where':{}};var _0x3c9646={};var _0x27ff20={'count':0x0,'rows':[]};return db['ChatWebsite']['findOne']({'where':{'id':_0x17638f[_0x40c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5e408d,null))[_0x40c4('0x15')](function(_0x3f4f52){if(_0x3f4f52){_0x3c9646[_0x40c4('0x37')]=_[_0x40c4('0x3a')](db[_0x40c4('0x5b')][_0x40c4('0x33')]);_0x3c9646['query']=_['keys'](_0x17638f['query']);_0x3c9646[_0x40c4('0x3c')]=_['intersection'](_0x3c9646[_0x40c4('0x37')],_0x3c9646[_0x40c4('0x3b')]);_0x3b6885['attributes']=_['intersection'](_0x3c9646['model'],qs[_0x40c4('0x3f')](_0x17638f['query'][_0x40c4('0x3f')]));_0x3b6885[_0x40c4('0x3e')]=_0x3b6885['attributes'][_0x40c4('0x40')]?_0x3b6885[_0x40c4('0x3e')]:_0x3c9646[_0x40c4('0x37')];if(!_0x17638f[_0x40c4('0x3b')][_0x40c4('0x5c')](_0x40c4('0x41'))){_0x3b6885['limit']=qs[_0x40c4('0x25')](_0x17638f['query'][_0x40c4('0x25')]);_0x3b6885['offset']=qs['offset'](_0x17638f[_0x40c4('0x3b')][_0x40c4('0x23')]);}_0x3b6885[_0x40c4('0x42')]=qs[_0x40c4('0x43')](_0x17638f[_0x40c4('0x3b')][_0x40c4('0x43')]);_0x3b6885[_0x40c4('0x46')]=qs['filters'](_[_0x40c4('0x44')](_0x17638f['query'],_0x3c9646[_0x40c4('0x3c')]));_0x3b6885['where'][_0x40c4('0x5a')]=_0x3f4f52['id'];if(_0x17638f['query']['filter']){_0x3b6885[_0x40c4('0x46')]=_['merge'](_0x3b6885['where'],{'$or':_[_0x40c4('0x38')](_0x3b6885[_0x40c4('0x3e')],function(_0x2d84ba){var _0x33e8f8={};_0x33e8f8[_0x2d84ba]={'$like':'%'+_0x17638f[_0x40c4('0x3b')][_0x40c4('0x45')]+'%'};return _0x33e8f8;})});}_0x3b6885=_[_0x40c4('0x5d')]({},_0x3b6885,_0x17638f[_0x40c4('0x48')]);return db[_0x40c4('0x5b')]['count']({'where':_0x3b6885[_0x40c4('0x46')]})[_0x40c4('0x15')](function(_0x2b9a05){_0x27ff20[_0x40c4('0x26')]=_0x2b9a05;if(_0x17638f[_0x40c4('0x3b')][_0x40c4('0x49')]){_0x3b6885['include']=[{'all':!![]}];}return db[_0x40c4('0x5b')][_0x40c4('0x4a')](_0x3b6885);})[_0x40c4('0x15')](function(_0x106fd4){_0x27ff20[_0x40c4('0x4b')]=_0x106fd4;return _0x27ff20;});}})[_0x40c4('0x15')](respondWithFilteredResult(_0x5e408d,_0x3b6885))[_0x40c4('0x4c')](handleError(_0x5e408d,null));};exports[_0x40c4('0x5e')]=function(_0x2a9ab3,_0x257d1f){return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'where':{'id':_0x2a9ab3[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x257d1f,null))[_0x40c4('0x15')](function(_0x3e654f){if(_0x3e654f){return _0x3e654f[_0x40c4('0x5e')](_0x2a9ab3[_0x40c4('0x3b')]['ids']);}})[_0x40c4('0x15')](respondWithStatusCode(_0x257d1f,null))['catch'](handleError(_0x257d1f,null));};exports[_0x40c4('0x5f')]=function(_0x40e696,_0x401104){if(_0x40e696[_0x40c4('0x59')]['id']){delete _0x40e696['body']['id'];}return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'where':{'id':_0x40e696['params']['id']}})['then'](handleEntityNotFound(_0x401104,null))['then'](function(_0x239516){if(_0x239516){_0x40e696['body'][_0x40c4('0x5a')]=_0x239516['id'];return db['CannedAnswer'][_0x40c4('0x50')](_0x40e696[_0x40c4('0x59')]);}})[_0x40c4('0x15')](respondWithResult(_0x401104,null))[_0x40c4('0x4c')](handleError(_0x401104,null));};exports[_0x40c4('0x60')]=function(_0x4639f2,_0x5a7139){var _0x49753a={'raw':![],'where':{}};var _0x52d5ab={};var _0x1f673d={'count':0x0,'rows':[]};return db[_0x40c4('0x32')][_0x40c4('0x61')]({'where':{'id':_0x4639f2[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x5a7139,null))['then'](function(_0x37359c){if(_0x37359c){_0x52d5ab[_0x40c4('0x37')]=_[_0x40c4('0x3a')](db[_0x40c4('0x62')]['rawAttributes']);_0x52d5ab[_0x40c4('0x3b')]=_[_0x40c4('0x3a')](_0x4639f2[_0x40c4('0x3b')]);_0x52d5ab[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x52d5ab['model'],_0x52d5ab[_0x40c4('0x3b')]);_0x49753a['attributes']=_[_0x40c4('0x3d')](_0x52d5ab['model'],qs[_0x40c4('0x3f')](_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x3f')]));_0x49753a[_0x40c4('0x3e')]=_0x49753a[_0x40c4('0x3e')]['length']?_0x49753a['attributes']:_0x52d5ab[_0x40c4('0x37')];if(!_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x5c')](_0x40c4('0x41'))){_0x49753a['limit']=qs[_0x40c4('0x25')](_0x4639f2['query']['limit']);_0x49753a[_0x40c4('0x23')]=qs['offset'](_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x23')]);}_0x49753a[_0x40c4('0x42')]=qs[_0x40c4('0x43')](_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x43')]);_0x49753a['where']=qs[_0x40c4('0x3c')](_[_0x40c4('0x44')](_0x4639f2[_0x40c4('0x3b')],_0x52d5ab[_0x40c4('0x3c')]));_0x49753a[_0x40c4('0x46')]['ChatWebsiteId']=_0x37359c['id'];if(_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x45')]){_0x49753a[_0x40c4('0x46')]=_[_0x40c4('0x5d')](_0x49753a['where'],{'$or':_[_0x40c4('0x38')](_0x49753a['attributes'],function(_0xe32bac){var _0x532377={};_0x532377[_0xe32bac]={'$like':'%'+_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x45')]+'%'};return _0x532377;})});}_0x49753a=_[_0x40c4('0x5d')]({},_0x49753a,_0x4639f2[_0x40c4('0x48')]);return db[_0x40c4('0x62')][_0x40c4('0x26')]({'where':_0x49753a[_0x40c4('0x46')]})[_0x40c4('0x15')](function(_0x2ef7bb){_0x1f673d[_0x40c4('0x26')]=_0x2ef7bb;if(_0x4639f2[_0x40c4('0x3b')][_0x40c4('0x49')]){_0x49753a['include']=[{'all':!![]}];}return db[_0x40c4('0x62')]['findAll'](_0x49753a);})[_0x40c4('0x15')](function(_0x92f917){_0x1f673d[_0x40c4('0x4b')]=_0x92f917;return _0x1f673d;});}})[_0x40c4('0x15')](respondWithFilteredResult(_0x5a7139,_0x49753a))[_0x40c4('0x4c')](handleError(_0x5a7139,null));};exports[_0x40c4('0x63')]=function(_0x2f5978,_0x3207b3){return db[_0x40c4('0x32')]['find']({'where':{'id':_0x2f5978['params']['id']}})['then'](handleEntityNotFound(_0x3207b3,null))['then'](function(_0x4d4e90){if(_0x4d4e90){return _0x4d4e90['removeAnswers'](_0x2f5978['query'][_0x40c4('0x64')]);}})['then'](respondWithStatusCode(_0x3207b3,null))[_0x40c4('0x4c')](handleError(_0x3207b3,null));};exports[_0x40c4('0x65')]=function(_0x2a0147,_0x25ff91){_0x2a0147[_0x40c4('0x59')]['sitepic']=_0x2a0147[_0x40c4('0x66')][_0x40c4('0x67')];return db[_0x40c4('0x32')]['find']({'where':{'id':_0x2a0147[_0x40c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x25ff91,null))[_0x40c4('0x15')](saveUpdates(_0x2a0147[_0x40c4('0x59')],null))[_0x40c4('0x15')](respondWithResult(_0x25ff91,null))[_0x40c4('0x4c')](handleError(_0x25ff91,null));};exports[_0x40c4('0x68')]=function(_0x559787,_0xa002e7){_0x559787['body'][_0x40c4('0x69')]=_0x559787['file']['filename'];return db['ChatWebsite'][_0x40c4('0x4f')]({'where':{'id':_0x559787[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0xa002e7,null))['then'](saveUpdates(_0x559787['body'],null))[_0x40c4('0x15')](respondWithResult(_0xa002e7,null))[_0x40c4('0x4c')](handleError(_0xa002e7,null));};exports['addCustomerAvatar']=function(_0x3ea1b1,_0x3b0cce){_0x3ea1b1['body']['customerAvatar']=_0x3ea1b1[_0x40c4('0x66')][_0x40c4('0x67')];return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'where':{'id':_0x3ea1b1['params']['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x3b0cce,null))[_0x40c4('0x15')](saveUpdates(_0x3ea1b1[_0x40c4('0x59')],null))[_0x40c4('0x15')](respondWithResult(_0x3b0cce,null))['catch'](handleError(_0x3b0cce,null));};exports[_0x40c4('0x6a')]=function(_0x582c84,_0x5adea4){_0x582c84[_0x40c4('0x59')][_0x40c4('0x6b')]=_0x582c84[_0x40c4('0x66')]['filename'];return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'where':{'id':_0x582c84[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x5adea4,null))['then'](saveUpdates(_0x582c84[_0x40c4('0x59')],null))[_0x40c4('0x15')](respondWithResult(_0x5adea4,null))[_0x40c4('0x4c')](handleError(_0x5adea4,null));};exports[_0x40c4('0x6c')]=function(_0x337dd4,_0x47700c){var _0x227f7f=path[_0x40c4('0x6d')](config['root'],_0x40c4('0x6e'));var _0x7ffc11={'where':{'id':_0x337dd4[_0x40c4('0x4d')]['id']},'attributes':['id',_0x40c4('0x6f')],'raw':!![]};var _0x2a4fae=![];return require(_0x40c4('0x70'))[_0x40c4('0x71')]()[_0x40c4('0x15')](function(_0x29122f){if(_0x29122f){_0x2a4fae=_0x29122f['custom'];}})[_0x40c4('0x15')](function(){return db[_0x40c4('0x32')][_0x40c4('0x4f')](_0x7ffc11);})[_0x40c4('0x15')](handleEntityNotFound(_0x47700c,null))[_0x40c4('0x15')](function(_0x19946e){if(_0x19946e){if(!_[_0x40c4('0x72')](_0x19946e['sitepic'])){if(fs[_0x40c4('0x73')](path[_0x40c4('0x6d')](config['root'],_0x40c4('0x74'),_0x19946e[_0x40c4('0x6f')]))&&_0x2a4fae){_0x227f7f=path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x74'),_0x19946e[_0x40c4('0x6f')]);}}return _0x47700c[_0x40c4('0x76')](_0x227f7f);}})[_0x40c4('0x4c')](handleError(_0x47700c,null));};exports['getAvatar']=function(_0xdcb110,_0x194438){var _0x407a2e=path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x77'));var _0x32728f={'where':{'id':_0xdcb110[_0x40c4('0x4d')]['id']},'attributes':['id',_0x40c4('0x69')],'raw':!![]};return db['ChatWebsite'][_0x40c4('0x4f')](_0x32728f)[_0x40c4('0x15')](handleEntityNotFound(_0x194438,null))[_0x40c4('0x15')](function(_0x2ff028){if(_0x2ff028){if(!_[_0x40c4('0x72')](_0x2ff028[_0x40c4('0x69')])){if(fs['existsSync'](path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x78'),_0x2ff028['agentAvatar']))){_0x407a2e=path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x78'),_0x2ff028['agentAvatar']);}}return _0x194438['download'](_0x407a2e);}})[_0x40c4('0x4c')](handleError(_0x194438,null));};exports[_0x40c4('0x79')]=function(_0x576751,_0x563eee){var _0x1a6152=path['join'](config[_0x40c4('0x75')],'server/files/images/avatars/customer_avatar.png');var _0x2d986d={'where':{'id':_0x576751[_0x40c4('0x4d')]['id']},'attributes':['id',_0x40c4('0x7a'),_0x40c4('0x7b')],'raw':!![]};return db[_0x40c4('0x32')][_0x40c4('0x4f')](_0x2d986d)[_0x40c4('0x15')](handleEntityNotFound(_0x563eee,null))['then'](function(_0x2f44b0){if(_0x2f44b0){if(!_[_0x40c4('0x72')](_0x2f44b0['customerAvatar'])){if(fs[_0x40c4('0x73')](path[_0x40c4('0x6d')](config[_0x40c4('0x75')],'server/files/images/avatars/',_0x2f44b0[_0x40c4('0x7a')]))&&_0x2f44b0[_0x40c4('0x7b')]){_0x1a6152=path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x78'),_0x2f44b0['customerAvatar']);}}return _0x563eee['download'](_0x1a6152);}})[_0x40c4('0x4c')](handleError(_0x563eee,null));};exports[_0x40c4('0x7c')]=function(_0x188a55,_0x467af1){var _0xa50ad2=path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x7d'));var _0x19dd8a={'where':{'id':_0x188a55['params']['id']},'attributes':['id',_0x40c4('0x6b')],'raw':!![]};return db[_0x40c4('0x32')][_0x40c4('0x4f')](_0x19dd8a)['then'](handleEntityNotFound(_0x467af1,null))['then'](function(_0xa1f98b){if(_0xa1f98b){if(!_[_0x40c4('0x72')](_0xa1f98b[_0x40c4('0x6b')])){if(fs[_0x40c4('0x73')](path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x78'),_0xa1f98b[_0x40c4('0x6b')]))){_0xa50ad2=path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x78'),_0xa1f98b[_0x40c4('0x6b')]);}}return _0x467af1['download'](_0xa50ad2);}})[_0x40c4('0x4c')](handleError(_0x467af1,null));};exports['notify']=function(_0x5d73d5,_0x3b794e){var _0x5ad31c=require(_0x40c4('0x7e'));var _0x552179=new _0x5ad31c();var _0x17f071=_0x552179[_0x40c4('0x7f')](_0x5d73d5[_0x40c4('0x80')][_0x40c4('0x81')])[_0x40c4('0x82')]();var _0x4c57f1={'body':_0x5d73d5[_0x40c4('0x59')],'channel':_0x40c4('0x83')};var _0x5ae5a6=[];var _0x4130d1=[];var _0x3bc632={};var _0x2337cb=![];return db[_0x40c4('0x84')]['describe']()[_0x40c4('0x15')](function(_0x2a4ac6){if(!_0x2a4ac6){throw new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0x87'));}_0x5ae5a6=_[_0x40c4('0x88')](_['keys'](_0x2a4ac6),['createdAt',_0x40c4('0x89')]);_0x4130d1=_[_0x40c4('0x88')](_[_0x40c4('0x3a')](_0x2a4ac6),[_0x40c4('0x8a'),_0x40c4('0x89'),_0x40c4('0x8b'),'ListId']);if(_0x5d73d5[_0x40c4('0x59')]['id']){delete _0x5d73d5[_0x40c4('0x59')]['id'];}if(_['isNil'](_0x5d73d5['body'][_0x40c4('0x8c')])){throw new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0x8d'));}if(_[_0x40c4('0x72')](_0x5d73d5['body'][_0x40c4('0x59')])||_0x5d73d5[_0x40c4('0x59')]['body']===''){throw new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0x8e'));}if(_['isNil'](_0x5d73d5[_0x40c4('0x59')][_0x40c4('0x8f')])){throw new db[(_0x40c4('0x85'))]['ValidationError'](_0x40c4('0x90')+_0x4130d1);}if(!_[_0x40c4('0x91')](_0x4130d1,_0x5d73d5[_0x40c4('0x59')]['mapKey'])){throw new db['Sequelize'][(_0x40c4('0x86'))](_0x40c4('0x92')+_0x4130d1);}_0x3bc632[_0x5d73d5[_0x40c4('0x59')]['mapKey']]=_0x5d73d5['body'][_0x40c4('0x8c')];})[_0x40c4('0x15')](function(){return db['ChatWebsite'][_0x40c4('0x4f')]({'where':{'id':_0x5d73d5[_0x40c4('0x4d')]['id']},'include':[{'model':db[_0x40c4('0x93')],'as':_0x40c4('0x94'),'include':[{'model':db[_0x40c4('0x84')],'as':'Contacts','where':_0x3bc632,'limit':0x1,'order':[['updatedAt',_0x40c4('0x95')]]}]},{'model':db[_0x40c4('0x96')],'as':_0x40c4('0x97')}]});})['then'](handleEntityNotFound(_0x3b794e,null))[_0x40c4('0x15')](function(_0x49fcf9){if(_0x49fcf9&&_0x49fcf9[_0x40c4('0x94')]){_0x4c57f1['account']=_0x49fcf9;_0x4c57f1['applications']=_0x49fcf9[_0x40c4('0x97')];_0x4c57f1[_0x40c4('0x98')]=_0x49fcf9[_0x40c4('0x94')];_0x4c57f1[_0x40c4('0x99')]=_['orderBy'](_0x4c57f1[_0x40c4('0x99')],['priority'],[_0x40c4('0x9a')]);if(_0x4c57f1[_0x40c4('0x9b')][_0x40c4('0x97')]){delete _0x4c57f1['account']['Applications'];}if(_0x4c57f1[_0x40c4('0x9b')][_0x40c4('0x94')]&&_0x4c57f1[_0x40c4('0x9b')][_0x40c4('0x94')][_0x40c4('0x9c')][_0x40c4('0x40')]){return _0x4c57f1[_0x40c4('0x9b')][_0x40c4('0x94')][_0x40c4('0x9c')][0x0];}var _0x3ec92b=_['defaults'](_0x5d73d5['body'],{'firstName':_0x5d73d5['body'][_0x40c4('0x8c')],'ListId':_0x49fcf9['ListId']});_0x3ec92b[_0x5d73d5['body'][_0x40c4('0x8f')]]=_0x5d73d5['body'][_0x40c4('0x8c')];return db[_0x40c4('0x84')][_0x40c4('0x50')](_0x3ec92b,{'fields':_0x5ae5a6,'raw':!![]});}})['then'](handleEntityNotFound(_0x3b794e,null))[_0x40c4('0x15')](function(_0x616890){_0x4c57f1[_0x40c4('0x9d')]=_0x616890;var _0x20c926=_0x5d73d5[_0x40c4('0x59')][_0x40c4('0x9e')];if(_0x5d73d5['headers'][_0x40c4('0x9f')]){_0x20c926=_0x5d73d5[_0x40c4('0x80')][_0x40c4('0x9f')];}else if(_0x5d73d5['headers'][_0x40c4('0xa0')]){_0x20c926=_[_0x40c4('0xa1')](_0x5d73d5[_0x40c4('0x80')][_0x40c4('0xa0')][_0x40c4('0xa2')](','));}if(_0x616890){var _0x587865={'ContactId':_0x616890['id'],'ChatWebsiteId':_0x5d73d5['params']['id'],'from':(_0x616890[_0x40c4('0xa3')]||'')+'\x20'+(_0x616890[_0x40c4('0xa4')]||''),'customerIp':_0x20c926,'customerPort':_0x5d73d5[_0x40c4('0x80')][_0x40c4('0xa5')]?_0x5d73d5[_0x40c4('0x80')][_0x40c4('0xa5')]:null,'referer':_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xa6')],'browserName':_0x17f071[_0x40c4('0xa7')]['name']&&_0x17f071[_0x40c4('0xa7')][_0x40c4('0xa8')]?util['format'](_0x40c4('0xa9'),_0x17f071['browser'][_0x40c4('0x39')],_0x17f071['browser']['version']):'unknown','browserVersion':_0x17f071[_0x40c4('0xa7')]['version']||'unknown','osName':util['format'](_0x40c4('0xa9'),_0x17f071['os'][_0x40c4('0x39')],_0x17f071['os']['version']),'osVersion':_0x17f071['os'][_0x40c4('0xa8')],'deviceModel':_0x17f071[_0x40c4('0xaa')][_0x40c4('0x37')]&&_0x17f071[_0x40c4('0xaa')][_0x40c4('0xab')]?util['format']('%s\x20%s\x20%s',_0x17f071['device'][_0x40c4('0x37')],_0x17f071['device'][_0x40c4('0xab')],_0x17f071['device'][_0x40c4('0x35')]):null,'deviceVendor':_0x17f071[_0x40c4('0xaa')][_0x40c4('0xab')],'deviceType':_0x17f071['device']['type'],'formData':JSON['stringify'](_0x5d73d5['body'])};var _0x7522c={'ChatWebsiteId':_0x5d73d5[_0x40c4('0x4d')]['id'],'closed':![]};if(_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xac')]){_0x7522c[_0x40c4('0xac')]=_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xac')];return db['ChatInteraction'][_0x40c4('0x4f')]({'where':_0x7522c})[_0x40c4('0x15')](function(_0x22c31e){if(_0x22c31e){return[_0x22c31e,![]];}_0x587865['threadId']=_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xac')];_0x587865[_0x40c4('0xad')]=_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xad')];return db['ChatInteraction'][_0x40c4('0x50')](_0x587865)[_0x40c4('0x15')](function(_0x5163c6){return[_0x5163c6,!![]];});});}_0x7522c['ContactId']=_0x616890['id'];if(_0x5d73d5['body'][_0x40c4('0xae')]&&_0x5d73d5[_0x40c4('0x59')]['interaction']['id']){_0x7522c['id']=_0x5d73d5['body'][_0x40c4('0xae')]['id'];return db[_0x40c4('0xaf')][_0x40c4('0x4f')]({'where':_0x7522c})['then'](function(_0x2f1550){if(_0x2f1550){return[_0x2f1550,![]];}return db[_0x40c4('0xaf')][_0x40c4('0x50')](_0x587865)[_0x40c4('0x15')](function(_0xdba345){return[_0xdba345,!![]];});});}return db[_0x40c4('0xaf')]['create'](_0x587865)[_0x40c4('0x15')](function(_0x3f48cd){return[_0x3f48cd,!![]];});}})[_0x40c4('0xb0')](function(_0x177be8,_0x478182){if(_0x177be8){_0x2337cb=_0x478182;if(!_0x478182){var _0x17fe5c={'from':(_0x4c57f1[_0x40c4('0x9d')][_0x40c4('0xa3')]||'')+'\x20'+(_0x4c57f1[_0x40c4('0x9d')][_0x40c4('0xa4')]||'')};if(_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xac')]&&_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xb1')]&&_0x5d73d5['body'][_0x40c4('0xac')]!=_0x5d73d5[_0x40c4('0x59')][_0x40c4('0xb1')]){_0x17fe5c[_0x40c4('0xac')]=_0x5d73d5['body'][_0x40c4('0xb1')];}return _0x177be8[_0x40c4('0x29')](_0x17fe5c);}else{return _0x177be8;}}})[_0x40c4('0x15')](function(_0xd38f05){_0x4c57f1[_0x40c4('0xae')]=_0xd38f05['get']({'plain':!![]});_0x4c57f1[_0x40c4('0xae')][_0x40c4('0xb2')]=_0x2337cb;if(_0x4c57f1[_0x40c4('0xae')][_0x40c4('0xb2')]){if(_0x4c57f1[_0x40c4('0x9b')][_0x40c4('0xb3')]){_0x4c57f1[_0x40c4('0x99')]['push']({'id':0x0,'priority':_0x4c57f1[_0x40c4('0x99')][_0x40c4('0x40')]+0x1,'app':_0x40c4('0xb4'),'appdata':_0x40c4('0xb5'),'interval':_0x40c4('0xb6')});}}return db[_0x40c4('0xb7')][_0x40c4('0x50')]({'body':_0x5d73d5['body']['body'],'ChatWebsiteId':_0x5d73d5[_0x40c4('0x4d')]['id'],'ChatInteractionId':_0xd38f05['id'],'direction':'in','ContactId':_0x4c57f1[_0x40c4('0x9d')]['id'],'AttachmentId':_0x5d73d5['body']['AttachmentId']});})[_0x40c4('0x15')](function(_0x5c3e7a){_0x4c57f1[_0x40c4('0x1d')]=_0x5c3e7a;if(_0x4c57f1[_0x40c4('0xae')][_0x40c4('0xb8')]){return db[_0x40c4('0xb9')][_0x40c4('0x4f')]({'attributes':['id',_0x40c4('0x39')],'where':{'id':_0x4c57f1['interaction'][_0x40c4('0xb8')]}})[_0x40c4('0x15')](function(_0x37f715){if(_0x37f715){_0x4c57f1[_0x40c4('0x99')]['unshift']({'id':0x0,'priority':0x0,'app':_0x40c4('0xba'),'appdata':_0x37f715[_0x40c4('0x39')]+','+(_0x4c57f1[_0x40c4('0x9b')][_0x40c4('0xbb')]||0xa),'interval':'*,*,*,*'});_0x4c57f1[_0x40c4('0xbc')]=!![];}return respondWithRpcPromise(_0x40c4('0xbd'),_0x40c4('0xbe'),_0x4c57f1);});}return respondWithRpcPromise(_0x40c4('0xbd'),'startRouting',_0x4c57f1);})[_0x40c4('0x15')](function(_0x113e7d){respondWithRpcPromise(_0x40c4('0xbf'),_0x40c4('0xbf'),{'event':_0x40c4('0xc0'),'message':_0x113e7d},client9002);return _0x113e7d;})['then'](respondWithResult(_0x3b794e,null))[_0x40c4('0x4c')](handleError(_0x3b794e,null));};exports[_0x40c4('0xc1')]=function(_0x2fd3e8,_0x1bab5b){var _0x2b481b,_0x2717d3,_0x9cfd54;var _0x572269=[];var _0x5a205f={};var _0x3cd793=_0x2fd3e8[_0x40c4('0xc2')]||[];var _0x2898ed=[];var _0x1589e4;return db['CmContact'][_0x40c4('0x57')]()[_0x40c4('0x15')](function(_0x5e6b80){if(!_0x5e6b80){throw new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0x87'));}_0x572269=_[_0x40c4('0x88')](_['keys'](_0x5e6b80),[_0x40c4('0x8a'),'updatedAt',_0x40c4('0x8b'),'ListId']);if(_0x2fd3e8[_0x40c4('0x59')]['id']){delete _0x2fd3e8[_0x40c4('0x59')]['id'];}if(_[_0x40c4('0x72')](_0x2fd3e8[_0x40c4('0x59')][_0x40c4('0x8c')])){throw _0x1bab5b[_0x40c4('0x20')](0x1f4)[_0x40c4('0xc3')](new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0x8d')));}if(_[_0x40c4('0x72')](_0x2fd3e8['body']['body'])||_0x2fd3e8[_0x40c4('0x59')][_0x40c4('0x59')]===''){throw _0x1bab5b[_0x40c4('0x20')](0x1f4)[_0x40c4('0xc3')](new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0x8e')));}if(_[_0x40c4('0x72')](_0x2fd3e8['body'][_0x40c4('0xc4')])){throw _0x1bab5b[_0x40c4('0x20')](0x1f4)[_0x40c4('0xc3')](new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0xc5')+_0x572269));}if(!_[_0x40c4('0x91')](_0x572269,_0x2fd3e8[_0x40c4('0x59')]['mapKeyOffline'])){throw _0x1bab5b[_0x40c4('0x20')](0x1f4)['send'](new db[(_0x40c4('0x85'))][(_0x40c4('0x86'))](_0x40c4('0xc6')+_0x572269));}_0x5a205f[_0x2fd3e8['body'][_0x40c4('0xc4')]]=_0x2fd3e8[_0x40c4('0x59')]['from'];})[_0x40c4('0x15')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x2fd3e8['params']['id']},'include':[{'model':db[_0x40c4('0x93')],'as':_0x40c4('0x94')},{'model':db[_0x40c4('0xc7')],'as':'MailAccount'}]});})[_0x40c4('0x15')](handleEntityNotFound(_0x1bab5b,null))['then'](function(_0x5d4cb3){if(_0x5d4cb3&&_0x5d4cb3[_0x40c4('0x94')]){_0x2717d3=_0x5d4cb3;var _0xb36084=_[_0x40c4('0xd')](_0x2fd3e8['body'],{'firstName':_0x2fd3e8['body'][_0x40c4('0x8c')],'phone':_0x2fd3e8[_0x40c4('0x59')][_0x40c4('0x8c')],'ListId':_0x5d4cb3[_0x40c4('0xc8')]});_0xb36084[_0x2fd3e8[_0x40c4('0x59')][_0x40c4('0xc4')]]=_0x2fd3e8[_0x40c4('0x59')][_0x40c4('0x8c')];return db[_0x40c4('0x84')]['findOrCreate']({'where':_0x5a205f,'defaults':_0xb36084});}})[_0x40c4('0xb0')](function(_0x3c25ba){if(_0x3c25ba){_0x9cfd54=_0x3c25ba;var _0x17e8f1=fs[_0x40c4('0xc9')](path['join'](config[_0x40c4('0x75')],_0x40c4('0xca')),'utf8');var _0x431401=ejs['render'](_0x17e8f1,{'body':_[_0x40c4('0xcb')](_0x2fd3e8[_0x40c4('0x59')][_0x40c4('0x59')]),'bodyTitle':_0x2717d3[_0x40c4('0xcc')]});return db['ChatOfflineMessage'][_0x40c4('0x50')]({'body':_0x431401,'plainBody':htmlToText[_0x40c4('0xcd')](_0x431401),'ContactId':_0x3c25ba['id'],'ChatWebsiteId':_0x2717d3['id']});}})[_0x40c4('0x15')](function(_0x38c580){_0x1589e4=_0x38c580;if(_0x3cd793[_0x40c4('0x40')]){var _0x52469f=_0x3cd793[_0x40c4('0x38')](function(_0x4f6438){return{'name':_0x4f6438[_0x40c4('0xce')],'basename':_0x4f6438[_0x40c4('0x67')],'type':_0x4f6438[_0x40c4('0xcf')],'ChatOfflineMessageId':_0x38c580['id']};});_0x2898ed=_0x52469f[_0x40c4('0x38')](_0x52e829=>{var _0x372977={'filename':_0x52e829[_0x40c4('0x39')],'path':path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0xd0'),_0x40c4('0xc2'),_0x40c4('0xd1'),_0x40c4('0xd2'),_0x52e829[_0x40c4('0xd3')])};return _0x372977;});if(!_0x2717d3[_0x40c4('0xd4')]){return db['sequelize'][_0x40c4('0xd5')](function(_0x1f2e9e){return db['Attachment'][_0x40c4('0xd6')](_0x52469f,{'transaction':_0x1f2e9e});});}}})[_0x40c4('0x15')](function(){if(_0x1589e4){_0x2b481b=_0x1589e4;return db['MailAccount'][_0x40c4('0x61')]({'where':{'service':!![]},'include':[{'model':db[_0x40c4('0xd7')],'as':_0x40c4('0xd8'),'raw':!![],'include':[{'model':db[_0x40c4('0xd9')],'as':_0x40c4('0xd9'),'raw':!![]}]}]});}})['then'](function(_0x1c8b92){if(_0x1c8b92&&_0x1c8b92['Smtp']&&_0x2717d3[_0x40c4('0xda')]&&_0x2717d3[_0x40c4('0xdb')]){var _0x4a3fb1=_0x1c8b92[_0x40c4('0xdc')]();return respondWithRpcPromise(_0x40c4('0xdd'),_0x40c4('0xde'),{'account':_0x4a3fb1,'message':{'from':util[_0x40c4('0xdf')](_0x40c4('0xe0'),_0x1c8b92[_0x40c4('0x39')],_0x1c8b92['email']||_0x1c8b92[_0x40c4('0xd8')][_0x40c4('0x51')]),'to':_0x2717d3[_0x40c4('0xdb')],'subject':_0x2717d3[_0x40c4('0xe1')],'html':_0x2b481b['body'],'attachments':_0x2898ed}},client9003)[_0x40c4('0x15')](function(){return _0x2b481b;})[_0x40c4('0x4c')](function(_0x3ea69c){logger[_0x40c4('0x1b')](_0x3ea69c);});}})[_0x40c4('0x15')](function(){if(_0x2717d3&&_0x2717d3[_0x40c4('0xd4')]&&_0x2717d3[_0x40c4('0xe2')]){var _0x553e44=[];if(_0x3cd793[_0x40c4('0x40')]){_0x553e44=_0x3cd793[_0x40c4('0x38')](function(_0xbc1340){return{'name':_0xbc1340[_0x40c4('0xce')],'basename':_0xbc1340[_0x40c4('0x67')],'type':_0xbc1340['mimetype'],'ChatOfflineMessageId':_0x1589e4['id']};});}var _0x2f1cc7;if(!_[_0x40c4('0x72')](_0x2717d3['subjectOffline'])){var _0x35e487=_[_0x40c4('0x38')](_0x2fd3e8[_0x40c4('0x59')],function(_0x55809e){return _0x55809e;});var _0x1111f9=_[_0x40c4('0xe3')](_0x35e487)[0x0];var _0x4a7433=_[_0x40c4('0xe4')](_0x1111f9,function(_0x42244c){return _0x42244c;});_0x2f1cc7=_0x4a7433[0x1][_0x2717d3['subjectOffline']];}var _0x28a6dc={'from':_0x9cfd54['email'],'firstName':_0x9cfd54[_0x40c4('0xa3')],'lastName':_0x9cfd54[_0x40c4('0xa4')],'mapKey':_0x40c4('0xe5'),'message':{'from':_0x9cfd54[_0x40c4('0xe5')],'to':_0x2717d3[_0x40c4('0xc7')][_0x40c4('0xe5')],'cc':'','subject':_[_0x40c4('0x72')](_0x2f1cc7)?_0x2717d3[_0x40c4('0xe1')]:_0x2f1cc7,'messageId':'','sentAt':new Date(),'attach':_0x553e44['length'],'attachments':_0x553e44,'originChannel':'Chat','ChatWebsiteId':_0x2717d3['id'],'ChatOfflineMessageId':_0x2b481b['id'],'originTo':_0x2717d3[_0x40c4('0xc7')][_0x40c4('0xe5')]},'body':_0x2b481b[_0x40c4('0x59')]};var _0x588ad3={'account':{'id':_0x2717d3[_0x40c4('0xe2')]},'body':_0x28a6dc,'log':_0x40c4('0xe6')};return respondWithRpcPromise(_0x40c4('0xe6'),_0x40c4('0xe7'),_0x588ad3,client9001)[_0x40c4('0x15')](function(){return _0x2b481b;})[_0x40c4('0x4c')](function(_0x4631e8){logger[_0x40c4('0x1b')](_0x4631e8);});}return;})[_0x40c4('0x15')](function(){if(_0x2b481b){return _0x2b481b;}})[_0x40c4('0x15')](respondWithResult(_0x1bab5b,null))[_0x40c4('0x4c')](function(_0x35af88){logger[_0x40c4('0x1b')](_0x40c4('0x4c'),_0x35af88);for(var _0x1c0f46 of _0x3cd793){var _0x42cfcc=path['join'](config[_0x40c4('0x75')],_0x40c4('0xd0'),_0x40c4('0xc2'),_0x40c4('0xd1'),_0x40c4('0xd2'),_0x1c0f46[_0x40c4('0x67')]);fs_extra[_0x40c4('0xe8')](_0x42cfcc)[_0x40c4('0x4c')](function(_0x466b8a){logger[_0x40c4('0x1b')](_0x40c4('0xe9'),_0x42cfcc,_0x466b8a);});}});};exports[_0x40c4('0xea')]=function(_0x458571,_0x4b8416){return db[_0x40c4('0xaf')][_0x40c4('0x4f')]({'where':{'id':_0x458571['params']['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x4b8416,null))[_0x40c4('0x15')](function(_0x2a85c9){if(_0x2a85c9){return _0x2a85c9[_0x40c4('0xea')](_0x458571[_0x40c4('0x59')][_0x40c4('0x64')],_['omit'](_0x458571[_0x40c4('0x59')],[_0x40c4('0x64'),'id'])||{});}})[_0x40c4('0x15')](respondWithResult(_0x4b8416,null))[_0x40c4('0x4c')](handleError(_0x4b8416,null));};exports[_0x40c4('0xeb')]=function(_0x3ad39b,_0x29d0a6){var _0x128788={'raw':![],'where':{}};var _0x6022ee={};var _0xa725aa={'count':0x0,'rows':[]};return db[_0x40c4('0x32')][_0x40c4('0x61')]({'where':{'id':_0x3ad39b[_0x40c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29d0a6,null))[_0x40c4('0x15')](function(_0x31ea3e){if(_0x31ea3e){_0x6022ee[_0x40c4('0x37')]=_['keys'](db[_0x40c4('0xaf')][_0x40c4('0x33')]);_0x6022ee[_0x40c4('0x3b')]=_[_0x40c4('0x3a')](_0x3ad39b[_0x40c4('0x3b')]);_0x6022ee['filters']=_[_0x40c4('0x3d')](_0x6022ee[_0x40c4('0x37')],_0x6022ee[_0x40c4('0x3b')]);_0x128788[_0x40c4('0x3e')]=_[_0x40c4('0x3d')](_0x6022ee[_0x40c4('0x37')],qs[_0x40c4('0x3f')](_0x3ad39b['query'][_0x40c4('0x3f')]));_0x128788[_0x40c4('0x3e')]=_0x128788[_0x40c4('0x3e')][_0x40c4('0x40')]?_0x128788[_0x40c4('0x3e')]:_0x6022ee[_0x40c4('0x37')];if(!_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0x5c')](_0x40c4('0x41'))){_0x128788[_0x40c4('0x25')]=qs[_0x40c4('0x25')](_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0x25')]);_0x128788[_0x40c4('0x23')]=qs[_0x40c4('0x23')](_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0x23')]);}_0x128788[_0x40c4('0x42')]=qs[_0x40c4('0x43')](_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0x43')]);_0x128788['where']=qs[_0x40c4('0x3c')](_[_0x40c4('0x44')](_0x3ad39b[_0x40c4('0x3b')],_0x6022ee[_0x40c4('0x3c')]));_0x128788[_0x40c4('0x46')][_0x40c4('0x5a')]=_0x31ea3e['id'];if(_0x3ad39b['query'][_0x40c4('0x45')]){_0x128788[_0x40c4('0x46')]=_[_0x40c4('0x5d')](_0x128788['where'],{'$or':_[_0x40c4('0x38')](_0x128788[_0x40c4('0x3e')],function(_0x224674){var _0xdbfec7={};_0xdbfec7[_0x224674]={'$like':'%'+_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0x45')]+'%'};return _0xdbfec7;})});}_0x128788=_[_0x40c4('0x5d')]({},_0x128788,_0x3ad39b[_0x40c4('0x48')]);return db[_0x40c4('0xaf')][_0x40c4('0x26')]({'where':_0x128788['where']})[_0x40c4('0x15')](function(_0x456440){_0xa725aa[_0x40c4('0x26')]=_0x456440;if(_0x3ad39b['query'][_0x40c4('0x49')]){_0x128788[_0x40c4('0x4e')]=[{'model':db[_0x40c4('0x84')],'as':_0x40c4('0xec'),'required':![]},{'model':db[_0x40c4('0xb9')],'as':'Owner','attributes':[_0x40c4('0x39'),_0x40c4('0xed'),_0x40c4('0xee')],'required':![]},{'model':db[_0x40c4('0xef')],'as':'Tags','attributes':['id',_0x40c4('0x39'),'color'],'where':_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0xf0')]?{'id':_0x3ad39b[_0x40c4('0x3b')]['tag']}:undefined,'required':_0x3ad39b[_0x40c4('0x3b')][_0x40c4('0xf0')]?!![]:![]}];}return db['ChatInteraction'][_0x40c4('0x4a')](_0x128788);})[_0x40c4('0x15')](function(_0x295e39){_0xa725aa[_0x40c4('0x4b')]=_0x295e39;return _0xa725aa;});}})['then'](respondWithFilteredResult(_0x29d0a6,_0x128788))[_0x40c4('0x4c')](handleError(_0x29d0a6,null));};function iftimePromise(_0x633d25,_0xb75c64){return respondWithRpcPromise(_0x40c4('0xf1'),'getSnippet',{'command':_0xb75c64['timezone']?util[_0x40c4('0xdf')](_0x40c4('0xf2'),_0x633d25[_0x40c4('0xf3')],_0xb75c64[_0x40c4('0xf4')]):util[_0x40c4('0xdf')](_0x40c4('0xf5'),_0x633d25['interval'])},client9002)[_0x40c4('0x15')](function(_0x4038d6){var _0x438269=_0x4038d6&&_0x4038d6['indexOf']('true')>=0x0?!![]:![];logger[_0x40c4('0x16')](_0x40c4('0xf6'),_0xb75c64['id'],_0x633d25['id'],_0x633d25['interval'],_0x438269?'ONLINE':_0x40c4('0xf7'),_0xb75c64[_0x40c4('0xf4')]?_0xb75c64[_0x40c4('0xf4')]:'No\x20timezone');return _0x438269;})[_0x40c4('0x4c')](function(_0x718606){logger[_0x40c4('0x1b')](_0x40c4('0xf6'),_0xb75c64['id'],_0x633d25['id'],_0x633d25[_0x40c4('0xf3')],util[_0x40c4('0xf8')](_0x718606,{'showHidden':![],'depth':null}),_0xb75c64[_0x40c4('0xf4')]?_0xb75c64[_0x40c4('0xf4')]:'No\x20timezone');return![];});}exports[_0x40c4('0xf9')]=function(_0x518d0a,_0x137244){var _0x4b645d=0x0;var _0x3b4d3c=0x0;var _0x177a58=![];var _0x5214a9;var _0x3487c4;return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'where':{'id':_0x518d0a[_0x40c4('0x4d')]['id']},'include':[{'model':db['Interval'],'as':'Interval','include':[{'model':db['Interval'],'as':_0x40c4('0xfa'),'attributes':['id',_0x40c4('0xf3')],'raw':!![]}]}]})[_0x40c4('0x15')](handleEntityNotFound(_0x137244,null))[_0x40c4('0x15')](function(_0x18703a){if(_0x18703a){_0x5214a9=_0x18703a;return _0x18703a['getProactiveActions']({'raw':!![]});}})[_0x40c4('0x15')](function(_0x9b9a59){if(_0x5214a9){if(_0x9b9a59){_0x3487c4=_0x9b9a59;}}return require(_0x40c4('0x70'))[_0x40c4('0x71')]();})[_0x40c4('0x15')](function(_0x3846a2){if(_0x3846a2){_0x3b4d3c=_0x3846a2['virtual'];_0x177a58=_0x3846a2[_0x40c4('0xfb')];}})[_0x40c4('0x15')](function(){return db['ChatInteraction'][_0x40c4('0x26')]({'where':{'closed':![]}});})['then'](function(_0x2b010c){_0x4b645d=_0x2b010c;if(_0x3b4d3c&&_0x2b010c>_0x3b4d3c){return db[_0x40c4('0xfc')][_0x40c4('0x61')]({'where':{'id':0x1}})[_0x40c4('0x15')](function(_0x494d6b){if(_0x494d6b){_0x494d6b[_0x40c4('0xfd')](_0x40c4('0xfe'));}});}})[_0x40c4('0x15')](function(){if(_0x5214a9[_0x40c4('0xff')]&&_0x5214a9[_0x40c4('0xff')][_0x40c4('0xfa')]){var _0x3837ef=[];for(var _0x48aaf6=0x0;_0x48aaf6<_0x5214a9[_0x40c4('0xff')][_0x40c4('0xfa')][_0x40c4('0x40')];_0x48aaf6++){var _0x1a4af4=_0x5214a9['Interval'][_0x40c4('0xfa')][_0x48aaf6][_0x40c4('0x2a')]({'plain':!![]});_0x3837ef[_0x40c4('0x100')](iftimePromise(_0x1a4af4,_0x5214a9));}return BPromise['all'](_0x3837ef)[_0x40c4('0x15')](function(_0x313ced){return _[_0x40c4('0x101')](_0x313ced);});}else{return!![];}})[_0x40c4('0x15')](function(_0x1b7fdc){var _0x2eefa3=fs['readFileSync'](path[_0x40c4('0x6d')](config[_0x40c4('0x75')],_0x40c4('0x102')),_0x40c4('0x103'));var _0x13e252={'remote':_0x5214a9[_0x40c4('0x104')],'query':querystring[_0x40c4('0x1a')](_[_0x40c4('0x5d')](_0x5214a9[_0x40c4('0x2a')]({'plain':!![]}),{'customerIp':_0x518d0a[_0x40c4('0x80')][_0x40c4('0xa0')]||_0x518d0a['headers'][_0x40c4('0x105')]||_0x518d0a[_0x40c4('0x106')][_0x40c4('0x107')]||_0x518d0a['ip'],'referer':_0x518d0a['headers'][_0x40c4('0xa6')],'openedInteractions':_0x4b645d,'maxInteractions':_0x3b4d3c,'virtual':_0x177a58['virtual'],'online':_0x1b7fdc,'custom':_0x177a58}))[_0x40c4('0x108')](/'/g,'\x5c\x27')};_0x137244[_0x40c4('0xc3')](ejs[_0x40c4('0x109')](Mustache['render'](_0x2eefa3,_0x13e252),{'proactiveActions':_0x3487c4,'alignment':_0x5214a9[_0x40c4('0x10a')],'verticalAlignment':_0x5214a9[_0x40c4('0x10b')],'div_color':_0x5214a9['color'],'labelText':_0x5214a9[_0x40c4('0x10c')],'text_color':_0x5214a9[_0x40c4('0x10d')],'text_button_color':_0x5214a9[_0x40c4('0x10e')],'button_color':_0x5214a9[_0x40c4('0x10f')],'background_color':_0x5214a9[_0x40c4('0x110')],'hideWhenOffline':_0x5214a9[_0x40c4('0x111')],'interval':_0x5214a9[_0x40c4('0x112')]}));})[_0x40c4('0x4c')](handleError(_0x137244,null));};exports[_0x40c4('0x113')]=function(_0x7f929d,_0x5c4eb6){var _0x2f81e9=_0x7f929d[_0x40c4('0x4d')]['id'];var _0x14f31c=_0x7f929d[_0x40c4('0x59')];var _0x22ddee=0xc8;var _0x5e7ca1=null;return db[_0x40c4('0x114')]['transaction']({'isolationLevel':db['sequelize'][_0x40c4('0x115')][_0x40c4('0x116')][_0x40c4('0x117')]},function(_0x18b349){return db[_0x40c4('0x32')][_0x40c4('0x61')]({'where':{'id':_0x2f81e9},'transaction':_0x18b349})[_0x40c4('0x15')](function(_0x53184c){if(_0x53184c){return db[_0x40c4('0x96')][_0x40c4('0x2d')]({'where':{'ChatWebsiteId':_0x2f81e9},'transaction':_0x18b349})[_0x40c4('0x15')](function(){var _0x2aaa35=_['map'](_0x14f31c,function(_0xccc711){_0xccc711[_0x40c4('0x5a')]=_0x2f81e9;return _0xccc711;});return db[_0x40c4('0x96')]['bulkCreate'](_0x2aaa35,{'transaction':_0x18b349});});}else{_0x22ddee=0x194;_0x5e7ca1=[];}});})[_0x40c4('0x15')](function(){if(_0x22ddee!==0x194){return db[_0x40c4('0x96')][_0x40c4('0x118')]({'where':{'ChatWebsiteId':_0x2f81e9},'order':_0x40c4('0x119')})[_0x40c4('0x15')](function(_0x36b54d){_0x5e7ca1=_0x36b54d;});}})[_0x40c4('0x4c')](function(_0x9e1b80){_0x22ddee=0x1f4;logger[_0x40c4('0x1b')](_0x9e1b80[_0x40c4('0x2e')]);if(_0x9e1b80[_0x40c4('0x39')]){delete _0x9e1b80[_0x40c4('0x39')];}_0x5e7ca1=_0x9e1b80;})[_0x40c4('0x11a')](function(){if(_0x5e7ca1===null){_0x5c4eb6[_0x40c4('0x1f')](_0x22ddee);}else{if(_0x22ddee===0x1f4){_0x5c4eb6[_0x40c4('0x20')](_0x22ddee)[_0x40c4('0xc3')](_0x5e7ca1);}else{_0x5c4eb6['status'](_0x22ddee)[_0x40c4('0x22')](_0x5e7ca1);}}});};exports['getApplications']=function(_0x44f38f,_0x1fbd36){var _0x1af056={};var _0x149153={};var _0x4d353a;var _0x369d81;return db['ChatWebsite'][_0x40c4('0x61')]({'where':{'id':_0x44f38f[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x1fbd36,null))[_0x40c4('0x15')](function(_0x6db34e){if(_0x6db34e){_0x4d353a=_0x6db34e;_0x149153[_0x40c4('0x37')]=_['keys'](db[_0x40c4('0x96')][_0x40c4('0x33')]);_0x149153[_0x40c4('0x3b')]=_[_0x40c4('0x3a')](_0x44f38f[_0x40c4('0x3b')]);_0x149153[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x149153['model'],_0x149153[_0x40c4('0x3b')]);_0x1af056[_0x40c4('0x3e')]=_[_0x40c4('0x3d')](_0x149153[_0x40c4('0x37')],qs[_0x40c4('0x3f')](_0x44f38f[_0x40c4('0x3b')][_0x40c4('0x3f')]));_0x1af056[_0x40c4('0x3e')]=_0x1af056[_0x40c4('0x3e')][_0x40c4('0x40')]?_0x1af056[_0x40c4('0x3e')]:_0x149153[_0x40c4('0x37')];_0x1af056['order']=qs[_0x40c4('0x43')](_0x44f38f[_0x40c4('0x3b')][_0x40c4('0x43')]);_0x1af056[_0x40c4('0x46')]=qs[_0x40c4('0x3c')](_[_0x40c4('0x44')](_0x44f38f['query'],_0x149153[_0x40c4('0x3c')]));if(_0x44f38f['query'][_0x40c4('0x45')]){_0x1af056['where']=_['merge'](_0x1af056[_0x40c4('0x46')],{'$or':_[_0x40c4('0x38')](_0x1af056[_0x40c4('0x3e')],function(_0x2c5162){var _0x2d1396={};_0x2d1396[_0x2c5162]={'$like':'%'+_0x44f38f['query'][_0x40c4('0x45')]+'%'};return _0x2d1396;})});}_0x1af056=_[_0x40c4('0x5d')]({},_0x1af056,_0x44f38f['options']);return _0x4d353a[_0x40c4('0x11b')](_0x1af056);}})[_0x40c4('0x15')](function(_0x5a4496){if(_0x5a4496){_0x369d81=_0x5a4496[_0x40c4('0x40')];if(!_0x44f38f[_0x40c4('0x3b')][_0x40c4('0x5c')](_0x40c4('0x41'))){_0x1af056[_0x40c4('0x25')]=qs[_0x40c4('0x25')](_0x44f38f[_0x40c4('0x3b')][_0x40c4('0x25')]);_0x1af056[_0x40c4('0x23')]=qs['offset'](_0x44f38f[_0x40c4('0x3b')][_0x40c4('0x23')]);}return _0x4d353a[_0x40c4('0x11b')](_0x1af056);}})[_0x40c4('0x15')](function(_0x3a070b){if(_0x3a070b){return _0x3a070b?{'count':_0x369d81,'rows':_0x3a070b}:null;}})[_0x40c4('0x15')](respondWithResult(_0x1fbd36,null))[_0x40c4('0x4c')](handleError(_0x1fbd36,null));};exports[_0x40c4('0x11c')]=function(_0x43519,_0x255fef){return db[_0x40c4('0x11d')]['find']({'where':{'id':_0x43519['params']['id']}})['then'](handleEntityNotFound(_0x255fef,null))[_0x40c4('0x15')](function(_0x1a6376){if(_0x1a6376){return _0x1a6376['addProactiveActions'](_0x43519[_0x40c4('0x59')][_0x40c4('0x64')],_[_0x40c4('0x11e')](_0x43519[_0x40c4('0x59')],['ids','id'])||{});}})[_0x40c4('0x15')](respondWithResult(_0x255fef,null))[_0x40c4('0x4c')](handleError(_0x255fef,null));};exports['getProactiveActions']=function(_0x1757da,_0x1087cf){var _0x3fefe7={};var _0x462e61={};var _0xed58bf;var _0x235b25;return db['ChatWebsite'][_0x40c4('0x61')]({'where':{'id':_0x1757da[_0x40c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1087cf,null))[_0x40c4('0x15')](function(_0xf765de){if(_0xf765de){_0xed58bf=_0xf765de;_0x462e61['model']=_[_0x40c4('0x3a')](db[_0x40c4('0x11f')][_0x40c4('0x33')]);_0x462e61[_0x40c4('0x3b')]=_[_0x40c4('0x3a')](_0x1757da[_0x40c4('0x3b')]);_0x462e61[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x462e61[_0x40c4('0x37')],_0x462e61[_0x40c4('0x3b')]);_0x3fefe7[_0x40c4('0x3e')]=_['intersection'](_0x462e61['model'],qs[_0x40c4('0x3f')](_0x1757da[_0x40c4('0x3b')][_0x40c4('0x3f')]));_0x3fefe7[_0x40c4('0x3e')]=_0x3fefe7[_0x40c4('0x3e')]['length']?_0x3fefe7[_0x40c4('0x3e')]:_0x462e61[_0x40c4('0x37')];_0x3fefe7['order']=qs['sort'](_0x1757da[_0x40c4('0x3b')][_0x40c4('0x43')]);_0x3fefe7[_0x40c4('0x46')]=qs[_0x40c4('0x3c')](_[_0x40c4('0x44')](_0x1757da['query'],_0x462e61['filters']));if(_0x1757da[_0x40c4('0x3b')][_0x40c4('0x45')]){_0x3fefe7[_0x40c4('0x46')]=_[_0x40c4('0x5d')](_0x3fefe7[_0x40c4('0x46')],{'$or':_['map'](_0x3fefe7[_0x40c4('0x3e')],function(_0x131b6d){var _0x1ba497={};_0x1ba497[_0x131b6d]={'$like':'%'+_0x1757da[_0x40c4('0x3b')][_0x40c4('0x45')]+'%'};return _0x1ba497;})});}_0x3fefe7=_[_0x40c4('0x5d')]({},_0x3fefe7,_0x1757da[_0x40c4('0x48')]);return _0xed58bf[_0x40c4('0x120')](_0x3fefe7);}})['then'](function(_0x6121d0){if(_0x6121d0){_0x235b25=_0x6121d0[_0x40c4('0x40')];if(!_0x1757da['query'][_0x40c4('0x5c')](_0x40c4('0x41'))){_0x3fefe7[_0x40c4('0x25')]=qs[_0x40c4('0x25')](_0x1757da[_0x40c4('0x3b')][_0x40c4('0x25')]);_0x3fefe7[_0x40c4('0x23')]=qs['offset'](_0x1757da['query'][_0x40c4('0x23')]);}return _0xed58bf[_0x40c4('0x120')](_0x3fefe7);}})[_0x40c4('0x15')](function(_0x17b826){if(_0x17b826){return _0x17b826?{'count':_0x235b25,'rows':_0x17b826}:null;}})[_0x40c4('0x15')](respondWithResult(_0x1087cf,null))[_0x40c4('0x4c')](handleError(_0x1087cf,null));};exports[_0x40c4('0x121')]=function(_0x39c590,_0x4d63bc){var _0x2208ca=_0x39c590[_0x40c4('0x3b')][_0x40c4('0x122')]===_0x40c4('0x123')?_0x40c4('0x124'):_0x40c4('0x125');return db[_0x40c4('0x32')][_0x40c4('0x4f')]({'attributes':['id',_0x2208ca],'where':{'id':_0x39c590[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x4d63bc,null))[_0x40c4('0x15')](function(_0x425c2d){if(_0x425c2d){var _0x37897f=_0x425c2d[_0x2208ca];var _0x3b04ab=_0x37897f&&_0x37897f[_0x40c4('0x126')]?_0x37897f[_0x40c4('0x126')]:[];_0x4d63bc[_0x40c4('0xc3')]({'fromKey':_['isNil'](_0x37897f[_0x40c4('0x127')])?undefined:_0x37897f[_0x40c4('0x127')],'count':_0x3b04ab[_0x40c4('0x40')],'rows':_0x3b04ab});}})[_0x40c4('0x4c')](handleError(_0x4d63bc,null));};exports[_0x40c4('0x128')]=function(_0x442f57,_0x40321f){var _0x4cba06={'raw':![],'where':{}};var _0x18ffb0={};var _0x1714e3={'count':0x0,'rows':[]};return db[_0x40c4('0x32')][_0x40c4('0x61')]({'where':{'id':_0x442f57[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x40321f,null))[_0x40c4('0x15')](function(_0x531c3d){if(_0x531c3d){_0x18ffb0[_0x40c4('0x37')]=_[_0x40c4('0x3a')](db[_0x40c4('0x129')][_0x40c4('0x33')]);_0x18ffb0['query']=_[_0x40c4('0x3a')](_0x442f57[_0x40c4('0x3b')]);_0x18ffb0[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x18ffb0[_0x40c4('0x37')],_0x18ffb0['query']);_0x4cba06[_0x40c4('0x3e')]=_[_0x40c4('0x3d')](_0x18ffb0[_0x40c4('0x37')],qs[_0x40c4('0x3f')](_0x442f57[_0x40c4('0x3b')][_0x40c4('0x3f')]));_0x4cba06['attributes']=_0x4cba06[_0x40c4('0x3e')][_0x40c4('0x40')]?_0x4cba06[_0x40c4('0x3e')]:_0x18ffb0[_0x40c4('0x37')];if(!_0x442f57[_0x40c4('0x3b')][_0x40c4('0x5c')](_0x40c4('0x41'))){_0x4cba06[_0x40c4('0x25')]=qs[_0x40c4('0x25')](_0x442f57['query']['limit']);_0x4cba06[_0x40c4('0x23')]=qs[_0x40c4('0x23')](_0x442f57[_0x40c4('0x3b')][_0x40c4('0x23')]);}_0x4cba06[_0x40c4('0x42')]=qs['sort'](_0x442f57[_0x40c4('0x3b')]['sort']);_0x4cba06[_0x40c4('0x46')]=qs[_0x40c4('0x3c')](_['pick'](_0x442f57['query'],_0x18ffb0[_0x40c4('0x3c')]));_0x4cba06[_0x40c4('0x46')][_0x40c4('0x5a')]=_0x531c3d['id'];if(_0x442f57[_0x40c4('0x3b')][_0x40c4('0x45')]){_0x4cba06[_0x40c4('0x46')]=_['merge'](_0x4cba06['where'],{'$or':_['map'](_0x4cba06[_0x40c4('0x3e')],function(_0x6de5be){var _0x3d8769={};_0x3d8769[_0x6de5be]={'$like':'%'+_0x442f57[_0x40c4('0x3b')][_0x40c4('0x45')]+'%'};return _0x3d8769;})});}_0x4cba06=_[_0x40c4('0x5d')]({},_0x4cba06,_0x442f57[_0x40c4('0x48')]);return db['ChatOfflineMessage']['count']({'where':_0x4cba06['where']})[_0x40c4('0x15')](function(_0x336d0a){_0x1714e3['count']=_0x336d0a;if(_0x442f57['query'][_0x40c4('0x49')]){_0x4cba06[_0x40c4('0x4e')]=[{'all':!![]}];}else{_0x4cba06[_0x40c4('0x4e')]=[{'model':db[_0x40c4('0x84')],'as':_0x40c4('0xec'),'required':![]},{'model':db[_0x40c4('0x12a')],'as':_0x40c4('0x12b'),'required':![]}];}return db[_0x40c4('0x129')][_0x40c4('0x4a')](_0x4cba06);})[_0x40c4('0x15')](function(_0x58e7b0){_0x1714e3[_0x40c4('0x4b')]=_0x58e7b0;return _0x1714e3;});}})[_0x40c4('0x15')](respondWithFilteredResult(_0x40321f,_0x4cba06))[_0x40c4('0x4c')](handleError(_0x40321f,null));};exports[_0x40c4('0x12c')]=function(_0x2dd722,_0x4372d9){return db['ChatWebsite'][_0x40c4('0x4f')]({'where':{'id':_0x2dd722[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x4372d9,null))[_0x40c4('0x15')](function(_0x5cc097){if(_0x5cc097){return _0x5cc097['addAgents'](_0x2dd722['body'][_0x40c4('0x64')],_[_0x40c4('0x11e')](_0x2dd722['body'],[_0x40c4('0x64'),'id'])||{})['spread'](function(_0x3a60ed){for(var _0x11d5a6=0x0;_0x11d5a6<_0x2dd722['body']['ids']['length'];_0x11d5a6+=0x1){socket[_0x40c4('0x12d')]('userChatWebsite:save',{'UserId':Number(_0x2dd722['body'][_0x40c4('0x64')][_0x11d5a6]),'ChatWebsiteId':Number(_0x2dd722[_0x40c4('0x4d')]['id'])});}return _0x3a60ed;});}})[_0x40c4('0x15')](respondWithResult(_0x4372d9,null))['catch'](handleError(_0x4372d9,null));};exports['removeAgents']=function(_0x2bbb77,_0x163ad8){return db[_0x40c4('0x32')]['find']({'where':{'id':_0x2bbb77[_0x40c4('0x4d')]['id']}})[_0x40c4('0x15')](handleEntityNotFound(_0x163ad8,null))[_0x40c4('0x15')](function(_0x4e24b6){if(_0x4e24b6){return _0x4e24b6['removeAgents'](_0x2bbb77[_0x40c4('0x3b')][_0x40c4('0x64')])[_0x40c4('0x15')](function(){if(_['isArray'](_0x2bbb77[_0x40c4('0x3b')]['ids'])){for(var _0x33caad=0x0;_0x33caad<_0x2bbb77[_0x40c4('0x3b')]['ids'][_0x40c4('0x40')];_0x33caad+=0x1){socket[_0x40c4('0x12d')](_0x40c4('0x12e'),{'UserId':Number(_0x2bbb77['query'][_0x40c4('0x64')][_0x33caad]),'ChatWebsiteId':Number(_0x2bbb77[_0x40c4('0x4d')]['id'])});}}else{socket['emit'](_0x40c4('0x12e'),{'UserId':Number(_0x2bbb77['query']['ids']),'ChatWebsiteId':Number(_0x2bbb77[_0x40c4('0x4d')]['id'])});}});}})[_0x40c4('0x15')](respondWithStatusCode(_0x163ad8,null))[_0x40c4('0x4c')](handleError(_0x163ad8,null));};exports[_0x40c4('0x12f')]=function(_0x4792cf,_0x55f167){var _0x125352={};var _0x283488={};var _0x2f1b55;var _0x1b6708;return db['ChatWebsite'][_0x40c4('0x61')]({'where':{'id':_0x4792cf[_0x40c4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55f167,null))[_0x40c4('0x15')](function(_0x59c478){if(_0x59c478){_0x2f1b55=_0x59c478;_0x283488[_0x40c4('0x37')]=_[_0x40c4('0x3a')](db[_0x40c4('0xb9')][_0x40c4('0x33')]);_0x283488[_0x40c4('0x3b')]=_[_0x40c4('0x3a')](_0x4792cf['query']);_0x283488[_0x40c4('0x3c')]=_[_0x40c4('0x3d')](_0x283488['model'],_0x283488[_0x40c4('0x3b')]);_0x125352['attributes']=_[_0x40c4('0x3d')](_0x283488[_0x40c4('0x37')],qs[_0x40c4('0x3f')](_0x4792cf[_0x40c4('0x3b')][_0x40c4('0x3f')]));_0x125352[_0x40c4('0x3e')]=_0x125352[_0x40c4('0x3e')]['length']?_0x125352[_0x40c4('0x3e')]:_0x283488[_0x40c4('0x37')];_0x125352['order']=qs[_0x40c4('0x43')](_0x4792cf['query'][_0x40c4('0x43')]);_0x125352[_0x40c4('0x46')]=qs[_0x40c4('0x3c')](_[_0x40c4('0x44')](_0x4792cf[_0x40c4('0x3b')],_0x283488[_0x40c4('0x3c')]));if(_0x4792cf[_0x40c4('0x3b')][_0x40c4('0x45')]){_0x125352[_0x40c4('0x46')]=_[_0x40c4('0x5d')](_0x125352['where'],{'$or':_[_0x40c4('0x38')](_0x125352['attributes'],function(_0x27025c){var _0x29d92b={};_0x29d92b[_0x27025c]={'$like':'%'+_0x4792cf['query'][_0x40c4('0x45')]+'%'};return _0x29d92b;})});}_0x125352=_[_0x40c4('0x5d')]({},_0x125352,_0x4792cf[_0x40c4('0x48')]);return _0x2f1b55[_0x40c4('0x12f')](_0x125352);}})['then'](function(_0x366636){if(_0x366636){_0x1b6708=_0x366636[_0x40c4('0x40')];if(!_0x4792cf['query'][_0x40c4('0x5c')]('nolimit')){_0x125352['limit']=qs[_0x40c4('0x25')](_0x4792cf[_0x40c4('0x3b')][_0x40c4('0x25')]);_0x125352['offset']=qs['offset'](_0x4792cf['query'][_0x40c4('0x23')]);}return _0x2f1b55[_0x40c4('0x12f')](_0x125352);}})[_0x40c4('0x15')](function(_0x538cf0){if(_0x538cf0){return _0x538cf0?{'count':_0x1b6708,'rows':_0x538cf0}:null;}})[_0x40c4('0x15')](respondWithResult(_0x55f167,null))[_0x40c4('0x4c')](handleError(_0x55f167,null));};
\ No newline at end of file
+var _0xd18e=['UserId','agent','forcedOwnership','Start','startRouting','EventManager','offline','files','no\x20available\x20attributes','CompanyId','mapKeyOffline','MailAccount','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','fromString','originalname','mimetype','attachments','offline-chat','basename','openNewInteraction','sequelize','transaction','Attachment','MailServerOut','Smtp','CloudProvider','forwardOffline','getSmtpOptions','SendMail','sendMail','email','forwardOfflineAddress','offlineMessageSubject','MailAccountId','subjectOffline','mapValues','Chat','NotifyMailAccount','notifyMail','server','remove','Could\x20not\x20remove\x20attachment\x20file','addInteraction','omit','getInteractions','Contact','Owner','fullname','internal','Tags','tag','Command','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','OFFLINE','timezone','No\x20timezone','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','Interval','Intervals','License','chatLicenseExceeded','all','some','server/files/chat/iframe.ejs','remote','connection','remoteAddress','replace','alignment','color','textColor','color_button','backgroundColor','hideWhenOffline','IntervalId','addApplications','Transaction','ISOLATION_LEVELS','READ_COMMITTED','bulkCreate','findAndCountAll','stack','finally','addProactiveActions','chatProactiveAction','ChatProactiveAction','getProactiveActions','getFields','online','false','offlineForm','items','Attachments','addAgents','emit','removeAgents','userChatWebsite:remove','getAgents','bluebird','util','path','ejs','lodash','querystring','../../components/parsers/qs','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','html-to-text','client','http','request','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','count','set','Content-Range','update','then','get','UserProfileResource','destroy','name','send','mandatoryDispositionPause','map','ChatWebsite','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','include','findAll','rows','show','params','Pause','intersection','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','findOne','rawAttributes','removeDispositions','ids','addAnswer','getAnswers','CannedAnswer','removeAnswers','sitepic','filename','agentAvatar','file','customerAvatar','addSystemAvatar','systemAvatar','getLogo','server/files/images/logos/default_logo.svg','getLicense','custom','isNil','existsSync','join','root','server/files/images/logos/','download','server/files/images/avatars/','getCustomerAvatar','showCustomerAvatar','server/files/images/avatars/system_avatar.png','notify','setUA','headers','user-agent','getResult','chat','CmContact','Sequelize','difference','updatedAt','createdAt','ListId','from','ValidationError','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','DESC','ChatApplication','Applications','applications','account','Contacts','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','version','format','browser','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','ContactId','interaction','spread','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId'];(function(_0x39a6ca,_0x10c9f0){var _0x752c2f=function(_0x3f6ed1){while(--_0x3f6ed1){_0x39a6ca['push'](_0x39a6ca['shift']());}};_0x752c2f(++_0x10c9f0);}(_0xd18e,0x18f));var _0xed18=function(_0x4c66b7,_0x5c3259){_0x4c66b7=_0x4c66b7-0x0;var _0x1f04e4=_0xd18e[_0x4c66b7];return _0x1f04e4;};'use strict';var BPromise=require(_0xed18('0x0'));var Mustache=require('mustache');var util=require(_0xed18('0x1'));var path=require(_0xed18('0x2'));var ejs=require(_0xed18('0x3'));var fs=require('fs');var fs_extra=require('fs-extra');var _=require(_0xed18('0x4'));var querystring=require(_0xed18('0x5'));var Redis=require('ioredis');var qs=require(_0xed18('0x6'));var logger=require(_0xed18('0x7'))(_0xed18('0x8'));var config=require('../../config/environment');var db=require(_0xed18('0x9'))['db'];config[_0xed18('0xa')]=_[_0xed18('0xb')](config['redis'],{'host':_0xed18('0xc'),'port':0x18eb});var socket=require(_0xed18('0xd'))(new Redis(config[_0xed18('0xa')]));require(_0xed18('0xe'))[_0xed18('0xf')](socket);var htmlToText=require(_0xed18('0x10'));var jayson=require('jayson/promise');var client=jayson[_0xed18('0x11')]['http']({'port':0x232c});var client9002=jayson[_0xed18('0x11')][_0xed18('0x12')]({'port':0x232a});var client9003=jayson[_0xed18('0x11')]['http']({'port':0x232b});var client9001=jayson['client'][_0xed18('0x12')]({'port':0x2329});function respondWithRpcPromise(_0x1f15c8,_0x1e8c15,_0x4acdd0,_0x21aa81){return new BPromise(function(_0x549749,_0x38811e){var _0x478c42=_0x21aa81||client;return _0x478c42[_0xed18('0x13')](_0x1f15c8,_0x4acdd0)['then'](function(_0x26af4a){logger[_0xed18('0x14')]('ChatWebsite,\x20%s,\x20%s',_0x1e8c15,_0xed18('0x15'));logger[_0xed18('0x16')](_0xed18('0x17'),_0x1e8c15,_0xed18('0x15'),JSON[_0xed18('0x18')](_0x26af4a));if(_0x26af4a[_0xed18('0x19')]){if(_0x26af4a[_0xed18('0x19')][_0xed18('0x1a')]===0x1f4){logger['error'](_0xed18('0x1b'),_0x1e8c15,_0x26af4a[_0xed18('0x19')][_0xed18('0x1c')]);return _0x38811e(_0x26af4a['error']['message']);}logger[_0xed18('0x19')](_0xed18('0x1b'),_0x1e8c15,_0x26af4a['error'][_0xed18('0x1c')]);return _0x549749(_0x26af4a['error'][_0xed18('0x1c')]);}else{logger[_0xed18('0x14')](_0xed18('0x1b'),_0x1e8c15,_0xed18('0x15'));_0x549749(_0x26af4a[_0xed18('0x1d')][_0xed18('0x1c')]);}})[_0xed18('0x1e')](function(_0x5832be){logger[_0xed18('0x19')](_0xed18('0x1b'),_0x1e8c15,_0x5832be);_0x38811e(_0x5832be);});});}function respondWithStatusCode(_0x11c82e,_0x490ba2){_0x490ba2=_0x490ba2||0xcc;return function(_0x16dd1a){if(_0x16dd1a){return _0x11c82e[_0xed18('0x1f')](_0x490ba2);}return _0x11c82e[_0xed18('0x20')](_0x490ba2)['end']();};}function respondWithResult(_0x23e9ad,_0x31eda3){_0x31eda3=_0x31eda3||0xc8;return function(_0x53696f){if(_0x53696f){return _0x23e9ad[_0xed18('0x20')](_0x31eda3)[_0xed18('0x21')](_0x53696f);}};}function respondWithFilteredResult(_0x29ae2d,_0x262fce){return function(_0x3d691b){if(_0x3d691b){var _0x124854=typeof _0x262fce[_0xed18('0x22')]==='undefined'&&typeof _0x262fce[_0xed18('0x23')]==='undefined';var _0x14c532=_0x3d691b[_0xed18('0x24')];var _0x37df05=_0x124854?0x0:_0x262fce[_0xed18('0x22')];var _0x146a4d=_0x124854?_0x3d691b['count']:_0x262fce['offset']+_0x262fce[_0xed18('0x23')];var _0x3c2d92;if(_0x146a4d>=_0x14c532){_0x146a4d=_0x14c532;_0x3c2d92=0xc8;}else{_0x3c2d92=0xce;}_0x29ae2d[_0xed18('0x20')](_0x3c2d92);return _0x29ae2d[_0xed18('0x25')](_0xed18('0x26'),_0x37df05+'-'+_0x146a4d+'/'+_0x14c532)['json'](_0x3d691b);}return null;};}function saveUpdates(_0x5223cc){return function(_0x45c25c){if(_0x45c25c){return _0x45c25c[_0xed18('0x27')](_0x5223cc)[_0xed18('0x28')](function(_0x37d2c9){return _0x37d2c9;});}return null;};}function removeEntity(_0x2aa464){return function(_0x5039dc){if(_0x5039dc){return _0x5039dc['destroy']()[_0xed18('0x28')](function(){var _0x32a281=_0x5039dc[_0xed18('0x29')]({'plain':!![]});var _0x5208a1='ChatWebsites';return db[_0xed18('0x2a')][_0xed18('0x2b')]({'where':{'type':_0x5208a1,'resourceId':_0x32a281['id']}})['then'](function(){return _0x5039dc;});})[_0xed18('0x28')](function(){_0x2aa464[_0xed18('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27bb14){return function(_0x250794){if(!_0x250794){_0x27bb14[_0xed18('0x1f')](0x194);}return _0x250794;};}function handleError(_0x241701,_0x15c009){_0x15c009=_0x15c009||0x1f4;return function(_0x3981d4){logger[_0xed18('0x19')](_0x3981d4['stack']);if(_0x3981d4[_0xed18('0x2c')]){delete _0x3981d4['name'];}_0x241701['status'](_0x15c009)[_0xed18('0x2d')](_0x3981d4);};}exports['index']=function(_0x395358,_0x1efe74){var _0x3002b9={'include':[{'model':db['Pause'],'as':_0xed18('0x2e')}]},_0x251686={},_0x3c54ed={'count':0x0,'rows':[]};var _0x37ef13=_[_0xed18('0x2f')](db[_0xed18('0x30')]['rawAttributes'],function(_0x12a988){return{'name':_0x12a988['fieldName'],'type':_0x12a988[_0xed18('0x31')]['key']};});_0x251686[_0xed18('0x32')]=_['map'](_0x37ef13,_0xed18('0x2c'));_0x251686[_0xed18('0x33')]=_[_0xed18('0x34')](_0x395358['query']);_0x251686[_0xed18('0x35')]=_['intersection'](_0x251686[_0xed18('0x32')],_0x251686[_0xed18('0x33')]);_0x3002b9[_0xed18('0x36')]=_['intersection'](_0x251686[_0xed18('0x32')],qs[_0xed18('0x37')](_0x395358['query'][_0xed18('0x37')]));_0x3002b9[_0xed18('0x36')]=_0x3002b9[_0xed18('0x36')][_0xed18('0x38')]?_0x3002b9['attributes']:_0x251686['model'];if(!_0x395358['query'][_0xed18('0x39')](_0xed18('0x3a'))){_0x3002b9[_0xed18('0x23')]=qs[_0xed18('0x23')](_0x395358['query']['limit']);_0x3002b9['offset']=qs[_0xed18('0x22')](_0x395358[_0xed18('0x33')][_0xed18('0x22')]);}_0x3002b9[_0xed18('0x3b')]=qs['sort'](_0x395358[_0xed18('0x33')][_0xed18('0x3c')]);_0x3002b9['where']=qs['filters'](_[_0xed18('0x3d')](_0x395358[_0xed18('0x33')],_0x251686[_0xed18('0x35')]),_0x37ef13);if(_0x395358[_0xed18('0x33')][_0xed18('0x3e')]){_0x3002b9[_0xed18('0x3f')]=_[_0xed18('0x40')](_0x3002b9['where'],{'$or':_['map'](_0x37ef13,function(_0x1d7927){if(_0x1d7927[_0xed18('0x31')]!=='VIRTUAL'){var _0x1de5e1={};_0x1de5e1[_0x1d7927['name']]={'$like':'%'+_0x395358[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x1de5e1;}})});}_0x3002b9=_['merge']({},_0x3002b9,_0x395358[_0xed18('0x41')]);var _0x54ab07={'where':_0x3002b9[_0xed18('0x3f')]};return db['ChatWebsite']['count'](_0x54ab07)[_0xed18('0x28')](function(_0x35e8ec){_0x3c54ed['count']=_0x35e8ec;if(_0x395358['query']['includeAll']){_0x3002b9[_0xed18('0x42')]=[{'all':!![]}];}return db[_0xed18('0x30')][_0xed18('0x43')](_0x3002b9);})[_0xed18('0x28')](function(_0x6aeed){_0x3c54ed[_0xed18('0x44')]=_0x6aeed;return _0x3c54ed;})[_0xed18('0x28')](respondWithFilteredResult(_0x1efe74,_0x3002b9))[_0xed18('0x1e')](handleError(_0x1efe74,null));};exports[_0xed18('0x45')]=function(_0x45611a,_0x14ed51){var _0x3a95f9={'raw':![],'where':{'id':_0x45611a[_0xed18('0x46')]['id']},'include':[{'model':db[_0xed18('0x47')],'as':'mandatoryDispositionPause'}]},_0x3b453c={};_0x3b453c['model']=_['keys'](db[_0xed18('0x30')]['rawAttributes']);_0x3b453c[_0xed18('0x33')]=_[_0xed18('0x34')](_0x45611a['query']);_0x3b453c[_0xed18('0x35')]=_[_0xed18('0x48')](_0x3b453c[_0xed18('0x32')],_0x3b453c['query']);_0x3a95f9[_0xed18('0x36')]=_[_0xed18('0x48')](_0x3b453c[_0xed18('0x32')],qs['fields'](_0x45611a[_0xed18('0x33')][_0xed18('0x37')]));_0x3a95f9['attributes']=_0x3a95f9['attributes'][_0xed18('0x38')]?_0x3a95f9[_0xed18('0x36')]:_0x3b453c[_0xed18('0x32')];if(_0x45611a[_0xed18('0x33')][_0xed18('0x49')]){_0x3a95f9[_0xed18('0x42')]=[{'all':!![]}];}_0x3a95f9=_[_0xed18('0x40')]({},_0x3a95f9,_0x45611a[_0xed18('0x41')]);return db[_0xed18('0x30')][_0xed18('0x4a')](_0x3a95f9)[_0xed18('0x28')](handleEntityNotFound(_0x14ed51,null))[_0xed18('0x28')](respondWithResult(_0x14ed51,null))[_0xed18('0x1e')](handleError(_0x14ed51,null));};exports[_0xed18('0x4b')]=function(_0x877f59,_0x3928a2){return db['ChatWebsite']['create'](_0x877f59[_0xed18('0x4c')],{})[_0xed18('0x28')](function(_0x5e2748){var _0x45975c=_0x877f59[_0xed18('0x4d')][_0xed18('0x29')]({'plain':!![]});if(!_0x45975c)throw new Error(_0xed18('0x4e'));if(_0x45975c[_0xed18('0x4f')]==='user'){var _0x305903=_0x5e2748['get']({'plain':!![]});var _0x3d84c0=_0xed18('0x50');return db[_0xed18('0x51')]['find']({'where':{'name':_0x3d84c0,'userProfileId':_0x45975c[_0xed18('0x52')]},'raw':!![]})[_0xed18('0x28')](function(_0x1ef9f5){if(_0x1ef9f5&&_0x1ef9f5[_0xed18('0x53')]===0x0){return db[_0xed18('0x2a')][_0xed18('0x4b')]({'name':_0x305903[_0xed18('0x2c')],'resourceId':_0x305903['id'],'type':_0x1ef9f5['name'],'sectionId':_0x1ef9f5['id']},{})[_0xed18('0x28')](function(){return _0x5e2748;});}else{return _0x5e2748;}})[_0xed18('0x1e')](function(_0x4f1ec0){logger[_0xed18('0x19')](_0xed18('0x54'),_0x4f1ec0);throw _0x4f1ec0;});}return _0x5e2748;})[_0xed18('0x28')](respondWithResult(_0x3928a2,0xc9))[_0xed18('0x1e')](handleError(_0x3928a2,null));};exports[_0xed18('0x27')]=function(_0x27c7da,_0x589f1c){if(_0x27c7da[_0xed18('0x4c')]['id']){delete _0x27c7da[_0xed18('0x4c')]['id'];}return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x27c7da[_0xed18('0x46')]['id']},'include':[{'model':db[_0xed18('0x47')],'as':_0xed18('0x2e')}]})[_0xed18('0x28')](handleEntityNotFound(_0x589f1c,null))[_0xed18('0x28')](saveUpdates(_0x27c7da['body'],null))[_0xed18('0x28')](respondWithResult(_0x589f1c,null))[_0xed18('0x1e')](handleError(_0x589f1c,null));};exports[_0xed18('0x2b')]=function(_0x1391a9,_0x5a78eb){return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x1391a9['params']['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x5a78eb,null))[_0xed18('0x28')](removeEntity(_0x5a78eb,null))[_0xed18('0x1e')](handleError(_0x5a78eb,null));};exports[_0xed18('0x55')]=function(_0x5bb75b,_0x11287a){return db['ChatWebsite'][_0xed18('0x55')]()[_0xed18('0x28')](respondWithResult(_0x11287a,null))[_0xed18('0x1e')](handleError(_0x11287a,null));};exports[_0xed18('0x56')]=function(_0x23a5d8,_0x1034af){if(_0x23a5d8[_0xed18('0x4c')]['id']){delete _0x23a5d8[_0xed18('0x4c')]['id'];}return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x23a5d8[_0xed18('0x46')]['id']}})['then'](handleEntityNotFound(_0x1034af,null))[_0xed18('0x28')](function(_0x1654dd){if(_0x1654dd){_0x23a5d8[_0xed18('0x4c')][_0xed18('0x57')]=_0x1654dd['id'];return db[_0xed18('0x58')]['create'](_0x23a5d8['body']);}})[_0xed18('0x28')](respondWithResult(_0x1034af,null))[_0xed18('0x1e')](handleError(_0x1034af,null));};exports[_0xed18('0x59')]=function(_0x499b1b,_0x137eb4){var _0x4b72b7={'raw':![],'where':{}};var _0x3665a3={};var _0x4daac3={'count':0x0,'rows':[]};return db[_0xed18('0x30')][_0xed18('0x5a')]({'where':{'id':_0x499b1b['params']['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x137eb4,null))[_0xed18('0x28')](function(_0x35cadf){if(_0x35cadf){_0x3665a3[_0xed18('0x32')]=_[_0xed18('0x34')](db[_0xed18('0x58')][_0xed18('0x5b')]);_0x3665a3[_0xed18('0x33')]=_['keys'](_0x499b1b[_0xed18('0x33')]);_0x3665a3['filters']=_[_0xed18('0x48')](_0x3665a3['model'],_0x3665a3[_0xed18('0x33')]);_0x4b72b7['attributes']=_[_0xed18('0x48')](_0x3665a3[_0xed18('0x32')],qs[_0xed18('0x37')](_0x499b1b[_0xed18('0x33')][_0xed18('0x37')]));_0x4b72b7[_0xed18('0x36')]=_0x4b72b7['attributes'][_0xed18('0x38')]?_0x4b72b7[_0xed18('0x36')]:_0x3665a3[_0xed18('0x32')];if(!_0x499b1b[_0xed18('0x33')][_0xed18('0x39')](_0xed18('0x3a'))){_0x4b72b7[_0xed18('0x23')]=qs[_0xed18('0x23')](_0x499b1b[_0xed18('0x33')][_0xed18('0x23')]);_0x4b72b7[_0xed18('0x22')]=qs[_0xed18('0x22')](_0x499b1b[_0xed18('0x33')]['offset']);}_0x4b72b7[_0xed18('0x3b')]=qs[_0xed18('0x3c')](_0x499b1b['query'][_0xed18('0x3c')]);_0x4b72b7['where']=qs[_0xed18('0x35')](_[_0xed18('0x3d')](_0x499b1b[_0xed18('0x33')],_0x3665a3[_0xed18('0x35')]));_0x4b72b7[_0xed18('0x3f')]['ChatWebsiteId']=_0x35cadf['id'];if(_0x499b1b[_0xed18('0x33')][_0xed18('0x3e')]){_0x4b72b7[_0xed18('0x3f')]=_[_0xed18('0x40')](_0x4b72b7[_0xed18('0x3f')],{'$or':_[_0xed18('0x2f')](_0x4b72b7[_0xed18('0x36')],function(_0xd4375){var _0x2a432e={};_0x2a432e[_0xd4375]={'$like':'%'+_0x499b1b[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x2a432e;})});}_0x4b72b7=_[_0xed18('0x40')]({},_0x4b72b7,_0x499b1b[_0xed18('0x41')]);return db['Disposition'][_0xed18('0x24')]({'where':_0x4b72b7['where']})['then'](function(_0xa01069){_0x4daac3[_0xed18('0x24')]=_0xa01069;if(_0x499b1b['query'][_0xed18('0x49')]){_0x4b72b7['include']=[{'all':!![]}];}return db['Disposition'][_0xed18('0x43')](_0x4b72b7);})[_0xed18('0x28')](function(_0x5c0a49){_0x4daac3['rows']=_0x5c0a49;return _0x4daac3;});}})[_0xed18('0x28')](respondWithFilteredResult(_0x137eb4,_0x4b72b7))['catch'](handleError(_0x137eb4,null));};exports['removeDispositions']=function(_0x400058,_0x577558){return db['ChatWebsite'][_0xed18('0x4a')]({'where':{'id':_0x400058[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x577558,null))[_0xed18('0x28')](function(_0x296072){if(_0x296072){return _0x296072[_0xed18('0x5c')](_0x400058['query'][_0xed18('0x5d')]);}})[_0xed18('0x28')](respondWithStatusCode(_0x577558,null))['catch'](handleError(_0x577558,null));};exports[_0xed18('0x5e')]=function(_0x311fe0,_0x598ae7){if(_0x311fe0[_0xed18('0x4c')]['id']){delete _0x311fe0['body']['id'];}return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x311fe0['params']['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x598ae7,null))[_0xed18('0x28')](function(_0x4f5716){if(_0x4f5716){_0x311fe0[_0xed18('0x4c')][_0xed18('0x57')]=_0x4f5716['id'];return db['CannedAnswer'][_0xed18('0x4b')](_0x311fe0[_0xed18('0x4c')]);}})['then'](respondWithResult(_0x598ae7,null))[_0xed18('0x1e')](handleError(_0x598ae7,null));};exports[_0xed18('0x5f')]=function(_0x3b4edf,_0x58b010){var _0x5f2085={'raw':![],'where':{}};var _0xfca6a4={};var _0x565c03={'count':0x0,'rows':[]};return db[_0xed18('0x30')][_0xed18('0x5a')]({'where':{'id':_0x3b4edf[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x58b010,null))[_0xed18('0x28')](function(_0x309754){if(_0x309754){_0xfca6a4[_0xed18('0x32')]=_['keys'](db[_0xed18('0x60')]['rawAttributes']);_0xfca6a4[_0xed18('0x33')]=_[_0xed18('0x34')](_0x3b4edf[_0xed18('0x33')]);_0xfca6a4[_0xed18('0x35')]=_[_0xed18('0x48')](_0xfca6a4[_0xed18('0x32')],_0xfca6a4[_0xed18('0x33')]);_0x5f2085['attributes']=_[_0xed18('0x48')](_0xfca6a4[_0xed18('0x32')],qs[_0xed18('0x37')](_0x3b4edf[_0xed18('0x33')][_0xed18('0x37')]));_0x5f2085['attributes']=_0x5f2085[_0xed18('0x36')][_0xed18('0x38')]?_0x5f2085[_0xed18('0x36')]:_0xfca6a4[_0xed18('0x32')];if(!_0x3b4edf['query'][_0xed18('0x39')](_0xed18('0x3a'))){_0x5f2085[_0xed18('0x23')]=qs[_0xed18('0x23')](_0x3b4edf['query'][_0xed18('0x23')]);_0x5f2085[_0xed18('0x22')]=qs['offset'](_0x3b4edf[_0xed18('0x33')]['offset']);}_0x5f2085[_0xed18('0x3b')]=qs[_0xed18('0x3c')](_0x3b4edf[_0xed18('0x33')]['sort']);_0x5f2085[_0xed18('0x3f')]=qs[_0xed18('0x35')](_[_0xed18('0x3d')](_0x3b4edf[_0xed18('0x33')],_0xfca6a4['filters']));_0x5f2085[_0xed18('0x3f')][_0xed18('0x57')]=_0x309754['id'];if(_0x3b4edf[_0xed18('0x33')][_0xed18('0x3e')]){_0x5f2085[_0xed18('0x3f')]=_['merge'](_0x5f2085[_0xed18('0x3f')],{'$or':_[_0xed18('0x2f')](_0x5f2085['attributes'],function(_0x26f282){var _0x3f96a2={};_0x3f96a2[_0x26f282]={'$like':'%'+_0x3b4edf[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x3f96a2;})});}_0x5f2085=_[_0xed18('0x40')]({},_0x5f2085,_0x3b4edf['options']);return db[_0xed18('0x60')][_0xed18('0x24')]({'where':_0x5f2085[_0xed18('0x3f')]})[_0xed18('0x28')](function(_0x1805c6){_0x565c03['count']=_0x1805c6;if(_0x3b4edf['query'][_0xed18('0x49')]){_0x5f2085['include']=[{'all':!![]}];}return db[_0xed18('0x60')][_0xed18('0x43')](_0x5f2085);})[_0xed18('0x28')](function(_0x1e7bac){_0x565c03[_0xed18('0x44')]=_0x1e7bac;return _0x565c03;});}})[_0xed18('0x28')](respondWithFilteredResult(_0x58b010,_0x5f2085))['catch'](handleError(_0x58b010,null));};exports[_0xed18('0x61')]=function(_0x468475,_0xa0100){return db['ChatWebsite'][_0xed18('0x4a')]({'where':{'id':_0x468475[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0xa0100,null))[_0xed18('0x28')](function(_0x2f1285){if(_0x2f1285){return _0x2f1285[_0xed18('0x61')](_0x468475[_0xed18('0x33')][_0xed18('0x5d')]);}})[_0xed18('0x28')](respondWithStatusCode(_0xa0100,null))[_0xed18('0x1e')](handleError(_0xa0100,null));};exports['addLogo']=function(_0x39bc08,_0x199944){_0x39bc08[_0xed18('0x4c')][_0xed18('0x62')]=_0x39bc08['file'][_0xed18('0x63')];return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x39bc08[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x199944,null))[_0xed18('0x28')](saveUpdates(_0x39bc08['body'],null))[_0xed18('0x28')](respondWithResult(_0x199944,null))[_0xed18('0x1e')](handleError(_0x199944,null));};exports['addAvatar']=function(_0x1b17aa,_0x2d2fa1){_0x1b17aa[_0xed18('0x4c')][_0xed18('0x64')]=_0x1b17aa[_0xed18('0x65')][_0xed18('0x63')];return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x1b17aa[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x2d2fa1,null))[_0xed18('0x28')](saveUpdates(_0x1b17aa[_0xed18('0x4c')],null))['then'](respondWithResult(_0x2d2fa1,null))[_0xed18('0x1e')](handleError(_0x2d2fa1,null));};exports['addCustomerAvatar']=function(_0x26aee2,_0x6a9a09){_0x26aee2[_0xed18('0x4c')][_0xed18('0x66')]=_0x26aee2[_0xed18('0x65')][_0xed18('0x63')];return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x26aee2[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x6a9a09,null))[_0xed18('0x28')](saveUpdates(_0x26aee2[_0xed18('0x4c')],null))[_0xed18('0x28')](respondWithResult(_0x6a9a09,null))['catch'](handleError(_0x6a9a09,null));};exports[_0xed18('0x67')]=function(_0x29fdac,_0x50a4b2){_0x29fdac['body'][_0xed18('0x68')]=_0x29fdac[_0xed18('0x65')]['filename'];return db[_0xed18('0x30')]['find']({'where':{'id':_0x29fdac['params']['id']}})['then'](handleEntityNotFound(_0x50a4b2,null))['then'](saveUpdates(_0x29fdac[_0xed18('0x4c')],null))[_0xed18('0x28')](respondWithResult(_0x50a4b2,null))['catch'](handleError(_0x50a4b2,null));};exports[_0xed18('0x69')]=function(_0x50fecc,_0x2160f5){var _0x8334ee=path['join'](config['root'],_0xed18('0x6a'));var _0x11a288={'where':{'id':_0x50fecc[_0xed18('0x46')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x20d0bd=![];return require('../../config/license/util')[_0xed18('0x6b')]()['then'](function(_0x3c354b){if(_0x3c354b){_0x20d0bd=_0x3c354b[_0xed18('0x6c')];}})['then'](function(){return db[_0xed18('0x30')][_0xed18('0x4a')](_0x11a288);})[_0xed18('0x28')](handleEntityNotFound(_0x2160f5,null))[_0xed18('0x28')](function(_0xf7c120){if(_0xf7c120){if(!_[_0xed18('0x6d')](_0xf7c120[_0xed18('0x62')])){if(fs[_0xed18('0x6e')](path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x71'),_0xf7c120[_0xed18('0x62')]))&&_0x20d0bd){_0x8334ee=path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x71'),_0xf7c120[_0xed18('0x62')]);}}return _0x2160f5[_0xed18('0x72')](_0x8334ee);}})[_0xed18('0x1e')](handleError(_0x2160f5,null));};exports['getAvatar']=function(_0x233f9d,_0x2b057a){var _0x5beac0=path[_0xed18('0x6f')](config[_0xed18('0x70')],'server/files/images/avatars/default_avatar.png');var _0x12cb86={'where':{'id':_0x233f9d[_0xed18('0x46')]['id']},'attributes':['id',_0xed18('0x64')],'raw':!![]};return db[_0xed18('0x30')][_0xed18('0x4a')](_0x12cb86)['then'](handleEntityNotFound(_0x2b057a,null))[_0xed18('0x28')](function(_0x101185){if(_0x101185){if(!_['isNil'](_0x101185[_0xed18('0x64')])){if(fs[_0xed18('0x6e')](path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x73'),_0x101185[_0xed18('0x64')]))){_0x5beac0=path[_0xed18('0x6f')](config[_0xed18('0x70')],'server/files/images/avatars/',_0x101185[_0xed18('0x64')]);}}return _0x2b057a[_0xed18('0x72')](_0x5beac0);}})[_0xed18('0x1e')](handleError(_0x2b057a,null));};exports[_0xed18('0x74')]=function(_0x4c8eff,_0x213590){var _0x17f3c6=path[_0xed18('0x6f')](config[_0xed18('0x70')],'server/files/images/avatars/customer_avatar.png');var _0x4860cc={'where':{'id':_0x4c8eff['params']['id']},'attributes':['id',_0xed18('0x66'),_0xed18('0x75')],'raw':!![]};return db[_0xed18('0x30')][_0xed18('0x4a')](_0x4860cc)[_0xed18('0x28')](handleEntityNotFound(_0x213590,null))[_0xed18('0x28')](function(_0x2aa343){if(_0x2aa343){if(!_['isNil'](_0x2aa343['customerAvatar'])){if(fs[_0xed18('0x6e')](path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x73'),_0x2aa343['customerAvatar']))&&_0x2aa343['showCustomerAvatar']){_0x17f3c6=path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x73'),_0x2aa343[_0xed18('0x66')]);}}return _0x213590[_0xed18('0x72')](_0x17f3c6);}})['catch'](handleError(_0x213590,null));};exports['getSystemAvatar']=function(_0x2fcd43,_0x162964){var _0x20311c=path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x76'));var _0x5300bb={'where':{'id':_0x2fcd43[_0xed18('0x46')]['id']},'attributes':['id',_0xed18('0x68')],'raw':!![]};return db[_0xed18('0x30')][_0xed18('0x4a')](_0x5300bb)[_0xed18('0x28')](handleEntityNotFound(_0x162964,null))[_0xed18('0x28')](function(_0x135b5c){if(_0x135b5c){if(!_['isNil'](_0x135b5c[_0xed18('0x68')])){if(fs[_0xed18('0x6e')](path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0x73'),_0x135b5c['systemAvatar']))){_0x20311c=path[_0xed18('0x6f')](config['root'],_0xed18('0x73'),_0x135b5c[_0xed18('0x68')]);}}return _0x162964['download'](_0x20311c);}})['catch'](handleError(_0x162964,null));};exports[_0xed18('0x77')]=function(_0x1d25fc,_0x2ad5c7){var _0x2e6c66=require('user-agent-parser');var _0x4b1a54=new _0x2e6c66();var _0x2929fa=_0x4b1a54[_0xed18('0x78')](_0x1d25fc[_0xed18('0x79')][_0xed18('0x7a')])[_0xed18('0x7b')]();var _0x205ab8={'body':_0x1d25fc[_0xed18('0x4c')],'channel':_0xed18('0x7c')};var _0xf3be98=[];var _0x4077d3=[];var _0x50157a={};var _0x3a52a3=![];return db[_0xed18('0x7d')][_0xed18('0x55')]()[_0xed18('0x28')](function(_0x3c3ad6){if(!_0x3c3ad6){throw new db[(_0xed18('0x7e'))]['ValidationError']('no\x20available\x20attributes');}_0xf3be98=_[_0xed18('0x7f')](_[_0xed18('0x34')](_0x3c3ad6),['createdAt',_0xed18('0x80')]);_0x4077d3=_[_0xed18('0x7f')](_['keys'](_0x3c3ad6),[_0xed18('0x81'),'updatedAt','CompanyId',_0xed18('0x82')]);if(_0x1d25fc[_0xed18('0x4c')]['id']){delete _0x1d25fc[_0xed18('0x4c')]['id'];}if(_[_0xed18('0x6d')](_0x1d25fc[_0xed18('0x4c')][_0xed18('0x83')])){throw new db[(_0xed18('0x7e'))][(_0xed18('0x84'))](_0xed18('0x85'));}if(_['isNil'](_0x1d25fc[_0xed18('0x4c')][_0xed18('0x4c')])||_0x1d25fc[_0xed18('0x4c')][_0xed18('0x4c')]===''){throw new db[(_0xed18('0x7e'))]['ValidationError'](_0xed18('0x86'));}if(_[_0xed18('0x6d')](_0x1d25fc['body'][_0xed18('0x87')])){throw new db[(_0xed18('0x7e'))][(_0xed18('0x84'))](_0xed18('0x88')+_0x4077d3);}if(!_[_0xed18('0x89')](_0x4077d3,_0x1d25fc[_0xed18('0x4c')][_0xed18('0x87')])){throw new db['Sequelize'][(_0xed18('0x84'))](_0xed18('0x8a')+_0x4077d3);}_0x50157a[_0x1d25fc[_0xed18('0x4c')]['mapKey']]=_0x1d25fc['body'][_0xed18('0x83')];})[_0xed18('0x28')](function(){return db['ChatWebsite']['find']({'where':{'id':_0x1d25fc['params']['id']},'include':[{'model':db[_0xed18('0x8b')],'as':_0xed18('0x8c'),'include':[{'model':db[_0xed18('0x7d')],'as':'Contacts','where':_0x50157a,'limit':0x1,'order':[[_0xed18('0x80'),_0xed18('0x8d')]]}]},{'model':db[_0xed18('0x8e')],'as':_0xed18('0x8f')}]});})[_0xed18('0x28')](handleEntityNotFound(_0x2ad5c7,null))[_0xed18('0x28')](function(_0x4fb137){if(_0x4fb137&&_0x4fb137[_0xed18('0x8c')]){_0x205ab8['account']=_0x4fb137;_0x205ab8[_0xed18('0x90')]=_0x4fb137[_0xed18('0x8f')];_0x205ab8['list']=_0x4fb137[_0xed18('0x8c')];_0x205ab8[_0xed18('0x90')]=_['orderBy'](_0x205ab8[_0xed18('0x90')],['priority'],['asc']);if(_0x205ab8['account']['Applications']){delete _0x205ab8[_0xed18('0x91')]['Applications'];}if(_0x205ab8[_0xed18('0x91')][_0xed18('0x8c')]&&_0x205ab8[_0xed18('0x91')][_0xed18('0x8c')][_0xed18('0x92')][_0xed18('0x38')]){return _0x205ab8[_0xed18('0x91')]['List'][_0xed18('0x92')][0x0];}var _0x32074b=_[_0xed18('0xb')](_0x1d25fc[_0xed18('0x4c')],{'firstName':_0x1d25fc[_0xed18('0x4c')][_0xed18('0x83')],'ListId':_0x4fb137[_0xed18('0x82')]});_0x32074b[_0x1d25fc['body'][_0xed18('0x87')]]=_0x1d25fc['body'][_0xed18('0x83')];return db[_0xed18('0x7d')][_0xed18('0x4b')](_0x32074b,{'fields':_0xf3be98,'raw':!![]});}})[_0xed18('0x28')](handleEntityNotFound(_0x2ad5c7,null))[_0xed18('0x28')](function(_0x3ad7ff){_0x205ab8[_0xed18('0x93')]=_0x3ad7ff;var _0x4ce7b1=_0x1d25fc[_0xed18('0x4c')][_0xed18('0x94')];if(_0x1d25fc[_0xed18('0x79')][_0xed18('0x95')]){_0x4ce7b1=_0x1d25fc[_0xed18('0x79')][_0xed18('0x95')];}else if(_0x1d25fc['headers'][_0xed18('0x96')]){_0x4ce7b1=_[_0xed18('0x97')](_0x1d25fc['headers'][_0xed18('0x96')][_0xed18('0x98')](','));}if(_0x3ad7ff){var _0x46b4f4={'ContactId':_0x3ad7ff['id'],'ChatWebsiteId':_0x1d25fc[_0xed18('0x46')]['id'],'from':(_0x3ad7ff[_0xed18('0x99')]||'')+'\x20'+(_0x3ad7ff[_0xed18('0x9a')]||''),'customerIp':_0x4ce7b1,'customerPort':_0x1d25fc[_0xed18('0x79')][_0xed18('0x9b')]?_0x1d25fc[_0xed18('0x79')]['x-real-port']:null,'referer':_0x1d25fc['body'][_0xed18('0x9c')],'browserName':_0x2929fa['browser'][_0xed18('0x2c')]&&_0x2929fa['browser'][_0xed18('0x9d')]?util[_0xed18('0x9e')]('%s\x20%s',_0x2929fa[_0xed18('0x9f')][_0xed18('0x2c')],_0x2929fa[_0xed18('0x9f')][_0xed18('0x9d')]):_0xed18('0xa0'),'browserVersion':_0x2929fa['browser'][_0xed18('0x9d')]||_0xed18('0xa0'),'osName':util[_0xed18('0x9e')](_0xed18('0xa1'),_0x2929fa['os']['name'],_0x2929fa['os'][_0xed18('0x9d')]),'osVersion':_0x2929fa['os'][_0xed18('0x9d')],'deviceModel':_0x2929fa[_0xed18('0xa2')]['model']&&_0x2929fa[_0xed18('0xa2')][_0xed18('0xa3')]?util['format'](_0xed18('0xa4'),_0x2929fa[_0xed18('0xa2')][_0xed18('0x32')],_0x2929fa[_0xed18('0xa2')]['vendor'],_0x2929fa[_0xed18('0xa2')][_0xed18('0x31')]):null,'deviceVendor':_0x2929fa[_0xed18('0xa2')][_0xed18('0xa3')],'deviceType':_0x2929fa[_0xed18('0xa2')][_0xed18('0x31')],'formData':JSON[_0xed18('0x18')](_0x1d25fc[_0xed18('0x4c')])};var _0x526ba0={'ChatWebsiteId':_0x1d25fc['params']['id'],'closed':![]};if(_0x1d25fc[_0xed18('0x4c')][_0xed18('0xa5')]){_0x526ba0[_0xed18('0xa5')]=_0x1d25fc[_0xed18('0x4c')]['threadId'];return db['ChatInteraction'][_0xed18('0x4a')]({'where':_0x526ba0})[_0xed18('0x28')](function(_0x295f5c){if(_0x295f5c){return[_0x295f5c,![]];}_0x46b4f4['threadId']=_0x1d25fc[_0xed18('0x4c')][_0xed18('0xa5')];_0x46b4f4[_0xed18('0xa6')]=_0x1d25fc[_0xed18('0x4c')]['externalUrl'];return db[_0xed18('0xa7')][_0xed18('0x4b')](_0x46b4f4)[_0xed18('0x28')](function(_0x2a9c5c){return[_0x2a9c5c,!![]];});});}_0x526ba0[_0xed18('0xa8')]=_0x3ad7ff['id'];if(_0x1d25fc[_0xed18('0x4c')]['interaction']&&_0x1d25fc[_0xed18('0x4c')][_0xed18('0xa9')]['id']){_0x526ba0['id']=_0x1d25fc[_0xed18('0x4c')]['interaction']['id'];return db[_0xed18('0xa7')][_0xed18('0x4a')]({'where':_0x526ba0})[_0xed18('0x28')](function(_0x28001f){if(_0x28001f){return[_0x28001f,![]];}return db[_0xed18('0xa7')][_0xed18('0x4b')](_0x46b4f4)[_0xed18('0x28')](function(_0x47012d){return[_0x47012d,!![]];});});}return db[_0xed18('0xa7')][_0xed18('0x4b')](_0x46b4f4)[_0xed18('0x28')](function(_0x2b0e9e){return[_0x2b0e9e,!![]];});}})[_0xed18('0xaa')](function(_0x4da4bc,_0x1ad05d){if(_0x4da4bc){_0x3a52a3=_0x1ad05d;if(!_0x1ad05d){var _0xefb6af={'from':(_0x205ab8[_0xed18('0x93')][_0xed18('0x99')]||'')+'\x20'+(_0x205ab8[_0xed18('0x93')][_0xed18('0x9a')]||'')};if(_0x1d25fc[_0xed18('0x4c')]['threadId']&&_0x1d25fc[_0xed18('0x4c')][_0xed18('0xab')]&&_0x1d25fc[_0xed18('0x4c')][_0xed18('0xa5')]!=_0x1d25fc[_0xed18('0x4c')][_0xed18('0xab')]){_0xefb6af[_0xed18('0xa5')]=_0x1d25fc[_0xed18('0x4c')][_0xed18('0xab')];}return _0x4da4bc[_0xed18('0x27')](_0xefb6af);}else{return _0x4da4bc;}}})[_0xed18('0x28')](function(_0x302622){_0x205ab8[_0xed18('0xa9')]=_0x302622[_0xed18('0x29')]({'plain':!![]});_0x205ab8['interaction'][_0xed18('0xac')]=_0x3a52a3;if(_0x205ab8['interaction'][_0xed18('0xac')]){if(_0x205ab8[_0xed18('0x91')][_0xed18('0xad')]){_0x205ab8[_0xed18('0x90')][_0xed18('0xae')]({'id':0x0,'priority':_0x205ab8[_0xed18('0x90')][_0xed18('0x38')]+0x1,'app':_0xed18('0xaf'),'appdata':_0xed18('0xb0'),'interval':_0xed18('0xb1')});}}return db['ChatMessage'][_0xed18('0x4b')]({'body':_0x1d25fc[_0xed18('0x4c')][_0xed18('0x4c')],'ChatWebsiteId':_0x1d25fc[_0xed18('0x46')]['id'],'ChatInteractionId':_0x302622['id'],'direction':'in','ContactId':_0x205ab8[_0xed18('0x93')]['id'],'AttachmentId':_0x1d25fc[_0xed18('0x4c')][_0xed18('0xb2')]});})[_0xed18('0x28')](function(_0x437867){_0x205ab8[_0xed18('0x1c')]=_0x437867;if(_0x205ab8[_0xed18('0xa9')][_0xed18('0xb3')]){return db['User'][_0xed18('0x4a')]({'attributes':['id',_0xed18('0x2c')],'where':{'id':_0x205ab8[_0xed18('0xa9')][_0xed18('0xb3')]}})[_0xed18('0x28')](function(_0x2dc5cd){if(_0x2dc5cd){_0x205ab8[_0xed18('0x90')]['unshift']({'id':0x0,'priority':0x0,'app':_0xed18('0xb4'),'appdata':_0x2dc5cd['name']+','+(_0x205ab8[_0xed18('0x91')]['waitForTheAssignedAgent']||0xa),'interval':_0xed18('0xb1')});_0x205ab8[_0xed18('0xb5')]=!![];}return respondWithRpcPromise(_0xed18('0xb6'),_0xed18('0xb7'),_0x205ab8);});}return respondWithRpcPromise(_0xed18('0xb6'),'startRouting',_0x205ab8);})[_0xed18('0x28')](function(_0x94173f){respondWithRpcPromise('EventManager',_0xed18('0xb8'),{'event':'notify','message':_0x94173f},client9002);return _0x94173f;})[_0xed18('0x28')](respondWithResult(_0x2ad5c7,null))['catch'](handleError(_0x2ad5c7,null));};exports[_0xed18('0xb9')]=function(_0x4ba413,_0xb47f5a){var _0x1e3440,_0x3cd812,_0x4c0fe0;var _0x5ca994=[];var _0x5b8dbd={};var _0x44962f=_0x4ba413[_0xed18('0xba')]||[];var _0x2ea77=[];var _0x10458a;return db['CmContact'][_0xed18('0x55')]()[_0xed18('0x28')](function(_0x5b479f){if(!_0x5b479f){throw new db[(_0xed18('0x7e'))]['ValidationError'](_0xed18('0xbb'));}_0x5ca994=_[_0xed18('0x7f')](_['keys'](_0x5b479f),[_0xed18('0x81'),'updatedAt',_0xed18('0xbc'),_0xed18('0x82')]);if(_0x4ba413[_0xed18('0x4c')]['id']){delete _0x4ba413[_0xed18('0x4c')]['id'];}if(_[_0xed18('0x6d')](_0x4ba413[_0xed18('0x4c')]['from'])){throw _0xb47f5a['status'](0x1f4)[_0xed18('0x2d')](new db[(_0xed18('0x7e'))][(_0xed18('0x84'))](_0xed18('0x85')));}if(_['isNil'](_0x4ba413[_0xed18('0x4c')][_0xed18('0x4c')])||_0x4ba413[_0xed18('0x4c')][_0xed18('0x4c')]===''){throw _0xb47f5a['status'](0x1f4)[_0xed18('0x2d')](new db[(_0xed18('0x7e'))]['ValidationError'](_0xed18('0x86')));}if(_[_0xed18('0x6d')](_0x4ba413[_0xed18('0x4c')][_0xed18('0xbd')])){throw _0xb47f5a[_0xed18('0x20')](0x1f4)[_0xed18('0x2d')](new db[(_0xed18('0x7e'))]['ValidationError']('mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ca994));}if(!_['includes'](_0x5ca994,_0x4ba413[_0xed18('0x4c')][_0xed18('0xbd')])){throw _0xb47f5a[_0xed18('0x20')](0x1f4)['send'](new db[(_0xed18('0x7e'))][(_0xed18('0x84'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5ca994));}_0x5b8dbd[_0x4ba413[_0xed18('0x4c')][_0xed18('0xbd')]]=_0x4ba413[_0xed18('0x4c')][_0xed18('0x83')];})[_0xed18('0x28')](function(){return db[_0xed18('0x30')]['find']({'where':{'id':_0x4ba413['params']['id']},'include':[{'model':db[_0xed18('0x8b')],'as':_0xed18('0x8c')},{'model':db[_0xed18('0xbe')],'as':_0xed18('0xbe')}]});})['then'](handleEntityNotFound(_0xb47f5a,null))[_0xed18('0x28')](function(_0x4583a3){if(_0x4583a3&&_0x4583a3[_0xed18('0x8c')]){_0x3cd812=_0x4583a3;var _0x246556=_[_0xed18('0xb')](_0x4ba413[_0xed18('0x4c')],{'firstName':_0x4ba413[_0xed18('0x4c')][_0xed18('0x83')],'phone':_0x4ba413[_0xed18('0x4c')]['from'],'ListId':_0x4583a3[_0xed18('0x82')]});_0x246556[_0x4ba413['body'][_0xed18('0xbd')]]=_0x4ba413[_0xed18('0x4c')][_0xed18('0x83')];return db[_0xed18('0x7d')][_0xed18('0xbf')]({'where':_0x5b8dbd,'defaults':_0x246556});}})[_0xed18('0xaa')](function(_0x379378){if(_0x379378){_0x4c0fe0=_0x379378;var _0x4b8163=fs[_0xed18('0xc0')](path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0xc1')),_0xed18('0xc2'));var _0x2c92eb=ejs[_0xed18('0xc3')](_0x4b8163,{'body':_[_0xed18('0xc4')](_0x4ba413[_0xed18('0x4c')][_0xed18('0x4c')]),'bodyTitle':_0x3cd812[_0xed18('0xc5')]});return db[_0xed18('0xc6')]['create']({'body':_0x2c92eb,'plainBody':htmlToText[_0xed18('0xc7')](_0x2c92eb),'ContactId':_0x379378['id'],'ChatWebsiteId':_0x3cd812['id']});}})['then'](function(_0x1956da){_0x10458a=_0x1956da;if(_0x44962f[_0xed18('0x38')]){var _0x49e556=_0x44962f[_0xed18('0x2f')](function(_0x5137c8){return{'name':_0x5137c8[_0xed18('0xc8')],'basename':_0x5137c8['filename'],'type':_0x5137c8[_0xed18('0xc9')],'ChatOfflineMessageId':_0x1956da['id']};});_0x2ea77=_0x49e556[_0xed18('0x2f')](_0x1374d3=>{var _0x36c37f={'filename':_0x1374d3['name'],'path':path[_0xed18('0x6f')](config[_0xed18('0x70')],'server','files',_0xed18('0xca'),_0xed18('0xcb'),_0x1374d3[_0xed18('0xcc')])};return _0x36c37f;});if(!_0x3cd812[_0xed18('0xcd')]){return db[_0xed18('0xce')][_0xed18('0xcf')](function(_0xf47b07){return db[_0xed18('0xd0')]['bulkCreate'](_0x49e556,{'transaction':_0xf47b07});});}}})['then'](function(){if(_0x10458a){_0x1e3440=_0x10458a;return db[_0xed18('0xbe')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xed18('0xd1')],'as':_0xed18('0xd2'),'raw':!![],'include':[{'model':db[_0xed18('0xd3')],'as':_0xed18('0xd3'),'raw':!![]}]}]});}})['then'](function(_0x4fc19e){if(_0x4fc19e&&_0x4fc19e[_0xed18('0xd2')]&&_0x3cd812[_0xed18('0xd4')]&&_0x3cd812['forwardOfflineAddress']){var _0x4ea996=_0x4fc19e[_0xed18('0xd5')]();return respondWithRpcPromise(_0xed18('0xd6'),_0xed18('0xd7'),{'account':_0x4ea996,'message':{'from':util[_0xed18('0x9e')]('\x22%s\x22\x20<%s>',_0x4fc19e['name'],_0x4fc19e[_0xed18('0xd8')]||_0x4fc19e[_0xed18('0xd2')][_0xed18('0x4d')]),'to':_0x3cd812[_0xed18('0xd9')],'subject':_0x3cd812[_0xed18('0xda')],'html':_0x1e3440[_0xed18('0x4c')],'attachments':_0x2ea77}},client9003)[_0xed18('0x28')](function(){return _0x1e3440;})[_0xed18('0x1e')](function(_0x288667){logger['error'](_0x288667);});}})['then'](function(){if(_0x3cd812&&_0x3cd812[_0xed18('0xcd')]&&_0x3cd812[_0xed18('0xdb')]){var _0x2fb8fa=[];if(_0x44962f['length']){_0x2fb8fa=_0x44962f[_0xed18('0x2f')](function(_0x58e69e){return{'name':_0x58e69e[_0xed18('0xc8')],'basename':_0x58e69e[_0xed18('0x63')],'type':_0x58e69e[_0xed18('0xc9')],'ChatOfflineMessageId':_0x10458a['id']};});}var _0x578d31;if(!_[_0xed18('0x6d')](_0x3cd812[_0xed18('0xdc')])){var _0x53a831=_[_0xed18('0x2f')](_0x4ba413['body'],function(_0x18ee0d){return _0x18ee0d;});var _0x4f72fb=_['toPairsIn'](_0x53a831)[0x0];var _0x8876b0=_[_0xed18('0xdd')](_0x4f72fb,function(_0x4df5d0){return _0x4df5d0;});_0x578d31=_0x8876b0[0x1][_0x3cd812[_0xed18('0xdc')]];}var _0x325715={'from':_0x4c0fe0['email'],'firstName':_0x4c0fe0[_0xed18('0x99')],'lastName':_0x4c0fe0['lastName'],'mapKey':_0xed18('0xd8'),'message':{'from':_0x4c0fe0[_0xed18('0xd8')],'to':_0x3cd812[_0xed18('0xbe')]['email'],'cc':'','subject':_[_0xed18('0x6d')](_0x578d31)?_0x3cd812[_0xed18('0xda')]:_0x578d31,'messageId':'','sentAt':new Date(),'attach':_0x2fb8fa[_0xed18('0x38')],'attachments':_0x2fb8fa,'originChannel':_0xed18('0xde'),'ChatWebsiteId':_0x3cd812['id'],'ChatOfflineMessageId':_0x1e3440['id'],'originTo':_0x3cd812[_0xed18('0xbe')][_0xed18('0xd8')]},'body':_0x1e3440[_0xed18('0x4c')]};var _0x1a0158={'account':{'id':_0x3cd812[_0xed18('0xdb')]},'body':_0x325715,'log':_0xed18('0xdf')};return respondWithRpcPromise(_0xed18('0xdf'),_0xed18('0xe0'),_0x1a0158,client9001)[_0xed18('0x28')](function(){return _0x1e3440;})[_0xed18('0x1e')](function(_0x391ab9){logger[_0xed18('0x19')](_0x391ab9);});}return;})[_0xed18('0x28')](function(){if(_0x1e3440){return _0x1e3440;}})[_0xed18('0x28')](respondWithResult(_0xb47f5a,null))['catch'](function(_0x318ad4){logger['error'](_0xed18('0x1e'),_0x318ad4);for(var _0xc818f2 of _0x44962f){var _0x5009b7=path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0xe1'),'files',_0xed18('0xca'),_0xed18('0xcb'),_0xc818f2['filename']);fs_extra[_0xed18('0xe2')](_0x5009b7)[_0xed18('0x1e')](function(_0x45fd2c){logger['error'](_0xed18('0xe3'),_0x5009b7,_0x45fd2c);});}});};exports[_0xed18('0xe4')]=function(_0x44684f,_0x4b1791){return db[_0xed18('0xa7')][_0xed18('0x4a')]({'where':{'id':_0x44684f[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x4b1791,null))[_0xed18('0x28')](function(_0x5b37a4){if(_0x5b37a4){return _0x5b37a4['addInteraction'](_0x44684f[_0xed18('0x4c')][_0xed18('0x5d')],_[_0xed18('0xe5')](_0x44684f['body'],[_0xed18('0x5d'),'id'])||{});}})[_0xed18('0x28')](respondWithResult(_0x4b1791,null))[_0xed18('0x1e')](handleError(_0x4b1791,null));};exports[_0xed18('0xe6')]=function(_0x6e759b,_0x6dcc3d){var _0x74f64b={'raw':![],'where':{}};var _0x5d86bc={};var _0x3f2db9={'count':0x0,'rows':[]};return db[_0xed18('0x30')][_0xed18('0x5a')]({'where':{'id':_0x6e759b[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x6dcc3d,null))[_0xed18('0x28')](function(_0x251bd8){if(_0x251bd8){_0x5d86bc['model']=_[_0xed18('0x34')](db[_0xed18('0xa7')][_0xed18('0x5b')]);_0x5d86bc[_0xed18('0x33')]=_[_0xed18('0x34')](_0x6e759b['query']);_0x5d86bc[_0xed18('0x35')]=_[_0xed18('0x48')](_0x5d86bc[_0xed18('0x32')],_0x5d86bc['query']);_0x74f64b['attributes']=_['intersection'](_0x5d86bc[_0xed18('0x32')],qs['fields'](_0x6e759b[_0xed18('0x33')][_0xed18('0x37')]));_0x74f64b[_0xed18('0x36')]=_0x74f64b[_0xed18('0x36')][_0xed18('0x38')]?_0x74f64b[_0xed18('0x36')]:_0x5d86bc[_0xed18('0x32')];if(!_0x6e759b[_0xed18('0x33')][_0xed18('0x39')]('nolimit')){_0x74f64b[_0xed18('0x23')]=qs[_0xed18('0x23')](_0x6e759b[_0xed18('0x33')][_0xed18('0x23')]);_0x74f64b['offset']=qs['offset'](_0x6e759b[_0xed18('0x33')][_0xed18('0x22')]);}_0x74f64b[_0xed18('0x3b')]=qs[_0xed18('0x3c')](_0x6e759b[_0xed18('0x33')][_0xed18('0x3c')]);_0x74f64b[_0xed18('0x3f')]=qs[_0xed18('0x35')](_[_0xed18('0x3d')](_0x6e759b['query'],_0x5d86bc['filters']));_0x74f64b[_0xed18('0x3f')][_0xed18('0x57')]=_0x251bd8['id'];if(_0x6e759b[_0xed18('0x33')]['filter']){_0x74f64b[_0xed18('0x3f')]=_[_0xed18('0x40')](_0x74f64b[_0xed18('0x3f')],{'$or':_[_0xed18('0x2f')](_0x74f64b[_0xed18('0x36')],function(_0x30a6c0){var _0x2b09fc={};_0x2b09fc[_0x30a6c0]={'$like':'%'+_0x6e759b[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x2b09fc;})});}_0x74f64b=_[_0xed18('0x40')]({},_0x74f64b,_0x6e759b[_0xed18('0x41')]);return db[_0xed18('0xa7')]['count']({'where':_0x74f64b['where']})[_0xed18('0x28')](function(_0x10c9b2){_0x3f2db9[_0xed18('0x24')]=_0x10c9b2;if(_0x6e759b['query'][_0xed18('0x49')]){_0x74f64b[_0xed18('0x42')]=[{'model':db[_0xed18('0x7d')],'as':_0xed18('0xe7'),'required':![]},{'model':db['User'],'as':_0xed18('0xe8'),'attributes':[_0xed18('0x2c'),_0xed18('0xe9'),_0xed18('0xea')],'required':![]},{'model':db['Tag'],'as':_0xed18('0xeb'),'attributes':['id',_0xed18('0x2c'),'color'],'where':_0x6e759b[_0xed18('0x33')]['tag']?{'id':_0x6e759b[_0xed18('0x33')][_0xed18('0xec')]}:undefined,'required':_0x6e759b[_0xed18('0x33')][_0xed18('0xec')]?!![]:![]}];}return db[_0xed18('0xa7')]['findAll'](_0x74f64b);})['then'](function(_0x54d9bd){_0x3f2db9[_0xed18('0x44')]=_0x54d9bd;return _0x3f2db9;});}})[_0xed18('0x28')](respondWithFilteredResult(_0x6dcc3d,_0x74f64b))[_0xed18('0x1e')](handleError(_0x6dcc3d,null));};function iftimePromise(_0x1b1390,_0x8b4535){return respondWithRpcPromise(_0xed18('0xed'),'getSnippet',{'command':_0x8b4535['timezone']?util[_0xed18('0x9e')](_0xed18('0xee'),_0x1b1390[_0xed18('0xef')],_0x8b4535['timezone']):util[_0xed18('0x9e')](_0xed18('0xf0'),_0x1b1390[_0xed18('0xef')])},client9002)[_0xed18('0x28')](function(_0x424ded){var _0x3bf2bd=_0x424ded&&_0x424ded['indexOf'](_0xed18('0xf1'))>=0x0?!![]:![];logger['info']('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x8b4535['id'],_0x1b1390['id'],_0x1b1390[_0xed18('0xef')],_0x3bf2bd?_0xed18('0xf2'):_0xed18('0xf3'),_0x8b4535['timezone']?_0x8b4535[_0xed18('0xf4')]:_0xed18('0xf5'));return _0x3bf2bd;})[_0xed18('0x1e')](function(_0x41865c){logger[_0xed18('0x19')](_0xed18('0xf6'),_0x8b4535['id'],_0x1b1390['id'],_0x1b1390[_0xed18('0xef')],util[_0xed18('0xf7')](_0x41865c,{'showHidden':![],'depth':null}),_0x8b4535[_0xed18('0xf4')]?_0x8b4535['timezone']:_0xed18('0xf5'));return![];});}exports['getSnippet']=function(_0x45fb25,_0x521842){var _0x2391c4=0x0;var _0x1913f3=0x0;var _0x1c16ca=![];var _0x2ebaaa;var _0x4122b0;return db['ChatWebsite'][_0xed18('0x4a')]({'where':{'id':_0x45fb25['params']['id']},'include':[{'model':db['Interval'],'as':_0xed18('0xf8'),'include':[{'model':db[_0xed18('0xf8')],'as':_0xed18('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x521842,null))[_0xed18('0x28')](function(_0x15e32e){if(_0x15e32e){_0x2ebaaa=_0x15e32e;return _0x15e32e['getProactiveActions']({'raw':!![]});}})[_0xed18('0x28')](function(_0x5dd2d6){if(_0x2ebaaa){if(_0x5dd2d6){_0x4122b0=_0x5dd2d6;}}return require('../../config/license/util')[_0xed18('0x6b')]();})['then'](function(_0x49f705){if(_0x49f705){_0x1913f3=_0x49f705['virtual'];_0x1c16ca=_0x49f705[_0xed18('0x6c')];}})[_0xed18('0x28')](function(){return db['ChatInteraction']['count']({'where':{'closed':![]}});})[_0xed18('0x28')](function(_0x3a69d0){_0x2391c4=_0x3a69d0;if(_0x1913f3&&_0x3a69d0>_0x1913f3){return db[_0xed18('0xfa')][_0xed18('0x5a')]({'where':{'id':0x1}})[_0xed18('0x28')](function(_0xecaad6){if(_0xecaad6){_0xecaad6['increment'](_0xed18('0xfb'));}});}})[_0xed18('0x28')](function(){if(_0x2ebaaa[_0xed18('0xf8')]&&_0x2ebaaa[_0xed18('0xf8')]['Intervals']){var _0x33956c=[];for(var _0x2e0909=0x0;_0x2e0909<_0x2ebaaa[_0xed18('0xf8')][_0xed18('0xf9')]['length'];_0x2e0909++){var _0x16c735=_0x2ebaaa[_0xed18('0xf8')][_0xed18('0xf9')][_0x2e0909][_0xed18('0x29')]({'plain':!![]});_0x33956c[_0xed18('0xae')](iftimePromise(_0x16c735,_0x2ebaaa));}return BPromise[_0xed18('0xfc')](_0x33956c)[_0xed18('0x28')](function(_0x2b62be){return _[_0xed18('0xfd')](_0x2b62be);});}else{return!![];}})['then'](function(_0x362d6f){var _0x9e69f2=fs[_0xed18('0xc0')](path[_0xed18('0x6f')](config[_0xed18('0x70')],_0xed18('0xfe')),_0xed18('0xc2'));var _0x37653b={'remote':_0x2ebaaa[_0xed18('0xff')],'query':querystring['stringify'](_[_0xed18('0x40')](_0x2ebaaa[_0xed18('0x29')]({'plain':!![]}),{'customerIp':_0x45fb25[_0xed18('0x79')][_0xed18('0x96')]||_0x45fb25[_0xed18('0x79')]['x-real-ip']||_0x45fb25[_0xed18('0x100')][_0xed18('0x101')]||_0x45fb25['ip'],'referer':_0x45fb25[_0xed18('0x79')][_0xed18('0x9c')],'openedInteractions':_0x2391c4,'maxInteractions':_0x1913f3,'virtual':_0x1c16ca['virtual'],'online':_0x362d6f,'custom':_0x1c16ca}))[_0xed18('0x102')](/'/g,'\x5c\x27')};_0x521842[_0xed18('0x2d')](ejs['render'](Mustache[_0xed18('0xc3')](_0x9e69f2,_0x37653b),{'proactiveActions':_0x4122b0,'alignment':_0x2ebaaa[_0xed18('0x103')],'verticalAlignment':_0x2ebaaa['verticalAlignment'],'div_color':_0x2ebaaa[_0xed18('0x104')],'labelText':_0x2ebaaa['labelText'],'text_color':_0x2ebaaa[_0xed18('0x105')],'text_button_color':_0x2ebaaa['textButtonColor'],'button_color':_0x2ebaaa[_0xed18('0x106')],'background_color':_0x2ebaaa[_0xed18('0x107')],'hideWhenOffline':_0x2ebaaa[_0xed18('0x108')],'interval':_0x2ebaaa[_0xed18('0x109')]}));})[_0xed18('0x1e')](handleError(_0x521842,null));};exports[_0xed18('0x10a')]=function(_0x4f5db1,_0x480349){var _0x7eb4c9=_0x4f5db1[_0xed18('0x46')]['id'];var _0x5d9a86=_0x4f5db1[_0xed18('0x4c')];var _0x309237=0xc8;var _0x443d41=null;return db[_0xed18('0xce')]['transaction']({'isolationLevel':db['sequelize'][_0xed18('0x10b')][_0xed18('0x10c')][_0xed18('0x10d')]},function(_0x1a2953){return db[_0xed18('0x30')]['findOne']({'where':{'id':_0x7eb4c9},'transaction':_0x1a2953})['then'](function(_0x59d511){if(_0x59d511){return db['ChatApplication'][_0xed18('0x2b')]({'where':{'ChatWebsiteId':_0x7eb4c9},'transaction':_0x1a2953})['then'](function(){var _0xb82e72=_['map'](_0x5d9a86,function(_0x2c8c50){_0x2c8c50[_0xed18('0x57')]=_0x7eb4c9;return _0x2c8c50;});return db['ChatApplication'][_0xed18('0x10e')](_0xb82e72,{'transaction':_0x1a2953});});}else{_0x309237=0x194;_0x443d41=[];}});})[_0xed18('0x28')](function(){if(_0x309237!==0x194){return db[_0xed18('0x8e')][_0xed18('0x10f')]({'where':{'ChatWebsiteId':_0x7eb4c9},'order':'priority'})[_0xed18('0x28')](function(_0x359cb8){_0x443d41=_0x359cb8;});}})[_0xed18('0x1e')](function(_0x297503){_0x309237=0x1f4;logger[_0xed18('0x19')](_0x297503[_0xed18('0x110')]);if(_0x297503['name']){delete _0x297503[_0xed18('0x2c')];}_0x443d41=_0x297503;})[_0xed18('0x111')](function(){if(_0x443d41===null){_0x480349['sendStatus'](_0x309237);}else{if(_0x309237===0x1f4){_0x480349[_0xed18('0x20')](_0x309237)[_0xed18('0x2d')](_0x443d41);}else{_0x480349['status'](_0x309237)[_0xed18('0x21')](_0x443d41);}}});};exports['getApplications']=function(_0x3074ed,_0x5ad88d){var _0x21a337={};var _0x56a59e={};var _0x4b5e30;var _0x17f165;return db[_0xed18('0x30')]['findOne']({'where':{'id':_0x3074ed[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x5ad88d,null))['then'](function(_0x34dc01){if(_0x34dc01){_0x4b5e30=_0x34dc01;_0x56a59e[_0xed18('0x32')]=_[_0xed18('0x34')](db[_0xed18('0x8e')][_0xed18('0x5b')]);_0x56a59e['query']=_[_0xed18('0x34')](_0x3074ed[_0xed18('0x33')]);_0x56a59e['filters']=_[_0xed18('0x48')](_0x56a59e[_0xed18('0x32')],_0x56a59e[_0xed18('0x33')]);_0x21a337['attributes']=_['intersection'](_0x56a59e[_0xed18('0x32')],qs[_0xed18('0x37')](_0x3074ed['query'][_0xed18('0x37')]));_0x21a337['attributes']=_0x21a337['attributes'][_0xed18('0x38')]?_0x21a337[_0xed18('0x36')]:_0x56a59e[_0xed18('0x32')];_0x21a337[_0xed18('0x3b')]=qs[_0xed18('0x3c')](_0x3074ed[_0xed18('0x33')][_0xed18('0x3c')]);_0x21a337[_0xed18('0x3f')]=qs[_0xed18('0x35')](_['pick'](_0x3074ed[_0xed18('0x33')],_0x56a59e[_0xed18('0x35')]));if(_0x3074ed[_0xed18('0x33')][_0xed18('0x3e')]){_0x21a337[_0xed18('0x3f')]=_[_0xed18('0x40')](_0x21a337['where'],{'$or':_[_0xed18('0x2f')](_0x21a337[_0xed18('0x36')],function(_0x43ceae){var _0x14871c={};_0x14871c[_0x43ceae]={'$like':'%'+_0x3074ed[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x14871c;})});}_0x21a337=_[_0xed18('0x40')]({},_0x21a337,_0x3074ed['options']);return _0x4b5e30['getApplications'](_0x21a337);}})[_0xed18('0x28')](function(_0x2def4a){if(_0x2def4a){_0x17f165=_0x2def4a[_0xed18('0x38')];if(!_0x3074ed['query']['hasOwnProperty'](_0xed18('0x3a'))){_0x21a337[_0xed18('0x23')]=qs[_0xed18('0x23')](_0x3074ed['query'][_0xed18('0x23')]);_0x21a337['offset']=qs[_0xed18('0x22')](_0x3074ed[_0xed18('0x33')][_0xed18('0x22')]);}return _0x4b5e30['getApplications'](_0x21a337);}})[_0xed18('0x28')](function(_0x3bc20d){if(_0x3bc20d){return _0x3bc20d?{'count':_0x17f165,'rows':_0x3bc20d}:null;}})[_0xed18('0x28')](respondWithResult(_0x5ad88d,null))['catch'](handleError(_0x5ad88d,null));};exports[_0xed18('0x112')]=function(_0x228178,_0x228df5){return db[_0xed18('0x113')][_0xed18('0x4a')]({'where':{'id':_0x228178[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x228df5,null))[_0xed18('0x28')](function(_0x3ea420){if(_0x3ea420){return _0x3ea420['addProactiveActions'](_0x228178[_0xed18('0x4c')][_0xed18('0x5d')],_['omit'](_0x228178[_0xed18('0x4c')],[_0xed18('0x5d'),'id'])||{});}})[_0xed18('0x28')](respondWithResult(_0x228df5,null))[_0xed18('0x1e')](handleError(_0x228df5,null));};exports['getProactiveActions']=function(_0x337ba5,_0x56a2aa){var _0x4d4b09={};var _0x381ea1={};var _0x4bfaac;var _0x53d938;return db[_0xed18('0x30')][_0xed18('0x5a')]({'where':{'id':_0x337ba5[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x56a2aa,null))[_0xed18('0x28')](function(_0x188fc1){if(_0x188fc1){_0x4bfaac=_0x188fc1;_0x381ea1[_0xed18('0x32')]=_[_0xed18('0x34')](db[_0xed18('0x114')][_0xed18('0x5b')]);_0x381ea1['query']=_[_0xed18('0x34')](_0x337ba5[_0xed18('0x33')]);_0x381ea1[_0xed18('0x35')]=_[_0xed18('0x48')](_0x381ea1['model'],_0x381ea1[_0xed18('0x33')]);_0x4d4b09[_0xed18('0x36')]=_[_0xed18('0x48')](_0x381ea1[_0xed18('0x32')],qs[_0xed18('0x37')](_0x337ba5['query'][_0xed18('0x37')]));_0x4d4b09[_0xed18('0x36')]=_0x4d4b09['attributes'][_0xed18('0x38')]?_0x4d4b09['attributes']:_0x381ea1[_0xed18('0x32')];_0x4d4b09['order']=qs[_0xed18('0x3c')](_0x337ba5[_0xed18('0x33')]['sort']);_0x4d4b09[_0xed18('0x3f')]=qs[_0xed18('0x35')](_[_0xed18('0x3d')](_0x337ba5['query'],_0x381ea1[_0xed18('0x35')]));if(_0x337ba5['query'][_0xed18('0x3e')]){_0x4d4b09['where']=_['merge'](_0x4d4b09['where'],{'$or':_[_0xed18('0x2f')](_0x4d4b09['attributes'],function(_0x39d56f){var _0x341653={};_0x341653[_0x39d56f]={'$like':'%'+_0x337ba5[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x341653;})});}_0x4d4b09=_[_0xed18('0x40')]({},_0x4d4b09,_0x337ba5[_0xed18('0x41')]);return _0x4bfaac['getProactiveActions'](_0x4d4b09);}})['then'](function(_0x301d0e){if(_0x301d0e){_0x53d938=_0x301d0e['length'];if(!_0x337ba5[_0xed18('0x33')]['hasOwnProperty'](_0xed18('0x3a'))){_0x4d4b09[_0xed18('0x23')]=qs[_0xed18('0x23')](_0x337ba5[_0xed18('0x33')][_0xed18('0x23')]);_0x4d4b09['offset']=qs[_0xed18('0x22')](_0x337ba5[_0xed18('0x33')][_0xed18('0x22')]);}return _0x4bfaac[_0xed18('0x115')](_0x4d4b09);}})['then'](function(_0x379781){if(_0x379781){return _0x379781?{'count':_0x53d938,'rows':_0x379781}:null;}})['then'](respondWithResult(_0x56a2aa,null))[_0xed18('0x1e')](handleError(_0x56a2aa,null));};exports[_0xed18('0x116')]=function(_0x34c096,_0x851a07){var _0x4a9c38=_0x34c096['query'][_0xed18('0x117')]===_0xed18('0x118')?_0xed18('0x119'):'onlineForm';return db[_0xed18('0x30')][_0xed18('0x4a')]({'attributes':['id',_0x4a9c38],'where':{'id':_0x34c096[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x851a07,null))[_0xed18('0x28')](function(_0x360d75){if(_0x360d75){var _0x19e852=_0x360d75[_0x4a9c38];var _0x146b69=_0x19e852&&_0x19e852[_0xed18('0x11a')]?_0x19e852[_0xed18('0x11a')]:[];_0x851a07['send']({'fromKey':_['isNil'](_0x19e852['fromKey'])?undefined:_0x19e852['fromKey'],'count':_0x146b69[_0xed18('0x38')],'rows':_0x146b69});}})[_0xed18('0x1e')](handleError(_0x851a07,null));};exports['getOfflineMessages']=function(_0x321078,_0x7abcf5){var _0x3f1067={'raw':![],'where':{}};var _0x3c55ac={};var _0x37d638={'count':0x0,'rows':[]};return db[_0xed18('0x30')][_0xed18('0x5a')]({'where':{'id':_0x321078[_0xed18('0x46')]['id']}})['then'](handleEntityNotFound(_0x7abcf5,null))['then'](function(_0x2941cd){if(_0x2941cd){_0x3c55ac['model']=_[_0xed18('0x34')](db[_0xed18('0xc6')][_0xed18('0x5b')]);_0x3c55ac['query']=_['keys'](_0x321078[_0xed18('0x33')]);_0x3c55ac[_0xed18('0x35')]=_[_0xed18('0x48')](_0x3c55ac['model'],_0x3c55ac[_0xed18('0x33')]);_0x3f1067['attributes']=_[_0xed18('0x48')](_0x3c55ac[_0xed18('0x32')],qs[_0xed18('0x37')](_0x321078[_0xed18('0x33')][_0xed18('0x37')]));_0x3f1067[_0xed18('0x36')]=_0x3f1067[_0xed18('0x36')]['length']?_0x3f1067[_0xed18('0x36')]:_0x3c55ac[_0xed18('0x32')];if(!_0x321078['query'][_0xed18('0x39')]('nolimit')){_0x3f1067['limit']=qs[_0xed18('0x23')](_0x321078['query']['limit']);_0x3f1067[_0xed18('0x22')]=qs[_0xed18('0x22')](_0x321078['query'][_0xed18('0x22')]);}_0x3f1067[_0xed18('0x3b')]=qs['sort'](_0x321078[_0xed18('0x33')][_0xed18('0x3c')]);_0x3f1067[_0xed18('0x3f')]=qs['filters'](_[_0xed18('0x3d')](_0x321078[_0xed18('0x33')],_0x3c55ac['filters']));_0x3f1067[_0xed18('0x3f')][_0xed18('0x57')]=_0x2941cd['id'];if(_0x321078['query'][_0xed18('0x3e')]){_0x3f1067[_0xed18('0x3f')]=_[_0xed18('0x40')](_0x3f1067[_0xed18('0x3f')],{'$or':_[_0xed18('0x2f')](_0x3f1067['attributes'],function(_0x5b3f2e){var _0x1c041d={};_0x1c041d[_0x5b3f2e]={'$like':'%'+_0x321078[_0xed18('0x33')][_0xed18('0x3e')]+'%'};return _0x1c041d;})});}_0x3f1067=_[_0xed18('0x40')]({},_0x3f1067,_0x321078[_0xed18('0x41')]);return db[_0xed18('0xc6')][_0xed18('0x24')]({'where':_0x3f1067[_0xed18('0x3f')]})[_0xed18('0x28')](function(_0x3a0176){_0x37d638[_0xed18('0x24')]=_0x3a0176;if(_0x321078[_0xed18('0x33')][_0xed18('0x49')]){_0x3f1067[_0xed18('0x42')]=[{'all':!![]}];}else{_0x3f1067['include']=[{'model':db[_0xed18('0x7d')],'as':_0xed18('0xe7'),'required':![]},{'model':db[_0xed18('0xd0')],'as':_0xed18('0x11b'),'required':![]}];}return db[_0xed18('0xc6')]['findAll'](_0x3f1067);})[_0xed18('0x28')](function(_0x2ad8bd){_0x37d638[_0xed18('0x44')]=_0x2ad8bd;return _0x37d638;});}})[_0xed18('0x28')](respondWithFilteredResult(_0x7abcf5,_0x3f1067))[_0xed18('0x1e')](handleError(_0x7abcf5,null));};exports[_0xed18('0x11c')]=function(_0x1e8332,_0x48e148){return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x1e8332[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x48e148,null))[_0xed18('0x28')](function(_0x460b7b){if(_0x460b7b){return _0x460b7b['addAgents'](_0x1e8332['body'][_0xed18('0x5d')],_['omit'](_0x1e8332['body'],[_0xed18('0x5d'),'id'])||{})[_0xed18('0xaa')](function(_0x2047c6){for(var _0x3c74a1=0x0;_0x3c74a1<_0x1e8332['body']['ids'][_0xed18('0x38')];_0x3c74a1+=0x1){socket[_0xed18('0x11d')]('userChatWebsite:save',{'UserId':Number(_0x1e8332[_0xed18('0x4c')][_0xed18('0x5d')][_0x3c74a1]),'ChatWebsiteId':Number(_0x1e8332['params']['id'])});}return _0x2047c6;});}})[_0xed18('0x28')](respondWithResult(_0x48e148,null))[_0xed18('0x1e')](handleError(_0x48e148,null));};exports[_0xed18('0x11e')]=function(_0x581341,_0x4a77ae){return db[_0xed18('0x30')][_0xed18('0x4a')]({'where':{'id':_0x581341['params']['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x4a77ae,null))['then'](function(_0x51a0e8){if(_0x51a0e8){return _0x51a0e8[_0xed18('0x11e')](_0x581341[_0xed18('0x33')]['ids'])[_0xed18('0x28')](function(){if(_['isArray'](_0x581341['query'][_0xed18('0x5d')])){for(var _0x2efe70=0x0;_0x2efe70<_0x581341[_0xed18('0x33')][_0xed18('0x5d')][_0xed18('0x38')];_0x2efe70+=0x1){socket[_0xed18('0x11d')]('userChatWebsite:remove',{'UserId':Number(_0x581341[_0xed18('0x33')][_0xed18('0x5d')][_0x2efe70]),'ChatWebsiteId':Number(_0x581341[_0xed18('0x46')]['id'])});}}else{socket[_0xed18('0x11d')](_0xed18('0x11f'),{'UserId':Number(_0x581341[_0xed18('0x33')][_0xed18('0x5d')]),'ChatWebsiteId':Number(_0x581341['params']['id'])});}});}})[_0xed18('0x28')](respondWithStatusCode(_0x4a77ae,null))[_0xed18('0x1e')](handleError(_0x4a77ae,null));};exports[_0xed18('0x120')]=function(_0x463dbe,_0x43e911){var _0x28432e={};var _0x1e78b5={};var _0x199b31;var _0x50cf73;return db['ChatWebsite'][_0xed18('0x5a')]({'where':{'id':_0x463dbe[_0xed18('0x46')]['id']}})[_0xed18('0x28')](handleEntityNotFound(_0x43e911,null))[_0xed18('0x28')](function(_0x71212e){if(_0x71212e){_0x199b31=_0x71212e;_0x1e78b5[_0xed18('0x32')]=_[_0xed18('0x34')](db['User']['rawAttributes']);_0x1e78b5['query']=_[_0xed18('0x34')](_0x463dbe[_0xed18('0x33')]);_0x1e78b5[_0xed18('0x35')]=_[_0xed18('0x48')](_0x1e78b5[_0xed18('0x32')],_0x1e78b5[_0xed18('0x33')]);_0x28432e['attributes']=_['intersection'](_0x1e78b5[_0xed18('0x32')],qs['fields'](_0x463dbe['query']['fields']));_0x28432e[_0xed18('0x36')]=_0x28432e['attributes'][_0xed18('0x38')]?_0x28432e[_0xed18('0x36')]:_0x1e78b5[_0xed18('0x32')];_0x28432e['order']=qs[_0xed18('0x3c')](_0x463dbe[_0xed18('0x33')][_0xed18('0x3c')]);_0x28432e[_0xed18('0x3f')]=qs[_0xed18('0x35')](_['pick'](_0x463dbe['query'],_0x1e78b5['filters']));if(_0x463dbe[_0xed18('0x33')]['filter']){_0x28432e[_0xed18('0x3f')]=_[_0xed18('0x40')](_0x28432e[_0xed18('0x3f')],{'$or':_[_0xed18('0x2f')](_0x28432e[_0xed18('0x36')],function(_0x321803){var _0x3421ec={};_0x3421ec[_0x321803]={'$like':'%'+_0x463dbe['query'][_0xed18('0x3e')]+'%'};return _0x3421ec;})});}_0x28432e=_[_0xed18('0x40')]({},_0x28432e,_0x463dbe['options']);return _0x199b31[_0xed18('0x120')](_0x28432e);}})['then'](function(_0x27d3f0){if(_0x27d3f0){_0x50cf73=_0x27d3f0['length'];if(!_0x463dbe['query']['hasOwnProperty'](_0xed18('0x3a'))){_0x28432e[_0xed18('0x23')]=qs['limit'](_0x463dbe[_0xed18('0x33')]['limit']);_0x28432e[_0xed18('0x22')]=qs[_0xed18('0x22')](_0x463dbe[_0xed18('0x33')]['offset']);}return _0x199b31[_0xed18('0x120')](_0x28432e);}})['then'](function(_0x463a24){if(_0x463a24){return _0x463a24?{'count':_0x50cf73,'rows':_0x463a24}:null;}})['then'](respondWithResult(_0x43e911,null))[_0xed18('0x1e')](handleError(_0x43e911,null));};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js
index c36c38a..d439472 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 _0x097c=['hook','events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty'];(function(_0x23b7a6,_0x220128){var _0x5a2b6f=function(_0x3f3449){while(--_0x3f3449){_0x23b7a6['push'](_0x23b7a6['shift']());}};_0x5a2b6f(++_0x220128);}(_0x097c,0x1d5));var _0xc097=function(_0x52f974,_0x2777d1){_0x52f974=_0x52f974-0x0;var _0x3b693e=_0x097c[_0x52f974];return _0x3b693e;};'use strict';var EventEmitter=require(_0xc097('0x0'));var ChatWebsite=require(_0xc097('0x1'))['db'][_0xc097('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc097('0x3'),'afterUpdate':_0xc097('0x4'),'afterDestroy':_0xc097('0x5')};function emitEvent(_0x1b9efd){return function(_0x5aa3c1,_0x265284,_0x4ac03b){ChatWebsiteEvents[_0xc097('0x6')](_0x1b9efd+':'+_0x5aa3c1['id'],_0x5aa3c1);ChatWebsiteEvents[_0xc097('0x6')](_0x1b9efd,_0x5aa3c1);_0x4ac03b(null);};}for(var e in events){if(events[_0xc097('0x7')](e)){var event=events[e];ChatWebsite[_0xc097('0x8')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents;
\ No newline at end of file
+var _0xa630=['exports','events','../../mysqldb','save','remove','emit','hook'];(function(_0x2e47a2,_0x2862e0){var _0x2965d2=function(_0x3d43ab){while(--_0x3d43ab){_0x2e47a2['push'](_0x2e47a2['shift']());}};_0x2965d2(++_0x2862e0);}(_0xa630,0xbe));var _0x0a63=function(_0x1e97a5,_0x1e03fd){_0x1e97a5=_0x1e97a5-0x0;var _0x53c1d4=_0xa630[_0x1e97a5];return _0x53c1d4;};'use strict';var EventEmitter=require(_0x0a63('0x0'));var ChatWebsite=require(_0x0a63('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0a63('0x2'),'afterUpdate':'update','afterDestroy':_0x0a63('0x3')};function emitEvent(_0x506b55){return function(_0x91a747,_0x3bcb90,_0x2cfdeb){ChatWebsiteEvents[_0x0a63('0x4')](_0x506b55+':'+_0x91a747['id'],_0x91a747);ChatWebsiteEvents[_0x0a63('0x4')](_0x506b55,_0x91a747);_0x2cfdeb(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatWebsite[_0x0a63('0x5')](e,emitEvent(event));}}module[_0x0a63('0x6')]=ChatWebsiteEvents;
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js
index 9a9fed9..8955bd1 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 _0x907f=['ChatWebsite','chat_websites','lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./chatWebsite.attributes','exports','define'];(function(_0x4726fd,_0x3a9f5f){var _0x50def0=function(_0x284e6e){while(--_0x284e6e){_0x4726fd['push'](_0x4726fd['shift']());}};_0x50def0(++_0x3a9f5f);}(_0x907f,0xfe));var _0xf907=function(_0x509276,_0x5ce6d3){_0x509276=_0x509276-0x0;var _0x352e71=_0x907f[_0x509276];return _0x352e71;};'use strict';var _=require(_0xf907('0x0'));var util=require('util');var logger=require(_0xf907('0x1'))(_0xf907('0x2'));var moment=require(_0xf907('0x3'));var BPromise=require(_0xf907('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf907('0x5'));var rimraf=require('rimraf');var config=require(_0xf907('0x6'));var attributes=require(_0xf907('0x7'));module[_0xf907('0x8')]=function(_0x47ccc3,_0x5d9d49){return _0x47ccc3[_0xf907('0x9')](_0xf907('0xa'),attributes,{'tableName':_0xf907('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xd47c=['api','moment','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x2be339,_0x39f6fd){var _0xa3c769=function(_0x22e4f8){while(--_0x22e4f8){_0x2be339['push'](_0x2be339['shift']());}};_0xa3c769(++_0x39f6fd);}(_0xd47c,0xf9));var _0xcd47=function(_0x2827b0,_0x5c1edd){_0x2827b0=_0x2827b0-0x0;var _0x110efe=_0xd47c[_0x2827b0];return _0x110efe;};'use strict';var _=require(_0xcd47('0x0'));var util=require(_0xcd47('0x1'));var logger=require(_0xcd47('0x2'))(_0xcd47('0x3'));var moment=require(_0xcd47('0x4'));var BPromise=require('bluebird');var rp=require(_0xcd47('0x5'));var fs=require('fs');var path=require(_0xcd47('0x6'));var rimraf=require(_0xcd47('0x7'));var config=require(_0xcd47('0x8'));var attributes=require(_0xcd47('0x9'));module['exports']=function(_0x3ee3fd,_0x7ed31c){return _0x3ee3fd['define'](_0xcd47('0xa'),attributes,{'tableName':_0xcd47('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js
index a153b42..6ed25f1 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 _0x6326=['http','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x56ef8b,_0xdbf624){var _0x356f9c=function(_0x5df79a){while(--_0x5df79a){_0x56ef8b['push'](_0x56ef8b['shift']());}};_0x356f9c(++_0xdbf624);}(_0x6326,0x86));var _0x6632=function(_0x408b80,_0x50d130){_0x408b80=_0x408b80-0x0;var _0x257a4e=_0x6326[_0x408b80];return _0x257a4e;};'use strict';var _=require(_0x6632('0x0'));var util=require(_0x6632('0x1'));var moment=require(_0x6632('0x2'));var BPromise=require('bluebird');var rs=require(_0x6632('0x3'));var fs=require('fs');var Redis=require(_0x6632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6632('0x5'));var logger=require(_0x6632('0x6'))(_0x6632('0x7'));var config=require(_0x6632('0x8'));var jayson=require(_0x6632('0x9'));var client=jayson[_0x6632('0xa')][_0x6632('0xb')]({'port':0x232a});config[_0x6632('0xc')]=_['defaults'](config['redis'],{'host':_0x6632('0xd'),'port':0x18eb});var socket=require(_0x6632('0xe'))(new Redis(config[_0x6632('0xc')]));require(_0x6632('0xf'))[_0x6632('0x10')](socket);function respondWithRpcPromise(_0x4016ed,_0x1359e1,_0x1e8bc3){return new BPromise(function(_0x138e4f,_0x3b7d81){return client['request'](_0x4016ed,_0x1e8bc3)[_0x6632('0x11')](function(_0x55bb9f){logger[_0x6632('0x12')](_0x6632('0x13'),_0x1359e1,_0x6632('0x14'));logger[_0x6632('0x15')](_0x6632('0x16'),_0x1359e1,_0x6632('0x14'),JSON[_0x6632('0x17')](_0x55bb9f));if(_0x55bb9f[_0x6632('0x18')]){if(_0x55bb9f[_0x6632('0x18')][_0x6632('0x19')]===0x1f4){logger[_0x6632('0x18')](_0x6632('0x13'),_0x1359e1,_0x55bb9f['error'][_0x6632('0x1a')]);return _0x3b7d81(_0x55bb9f[_0x6632('0x18')][_0x6632('0x1a')]);}logger[_0x6632('0x18')](_0x6632('0x13'),_0x1359e1,_0x55bb9f[_0x6632('0x18')][_0x6632('0x1a')]);return _0x138e4f(_0x55bb9f[_0x6632('0x18')][_0x6632('0x1a')]);}else{logger[_0x6632('0x12')](_0x6632('0x13'),_0x1359e1,_0x6632('0x14'));_0x138e4f(_0x55bb9f[_0x6632('0x1b')]['message']);}})[_0x6632('0x1c')](function(_0x4f0180){logger[_0x6632('0x18')](_0x6632('0x13'),_0x1359e1,_0x4f0180);_0x3b7d81(_0x4f0180);});});}
\ No newline at end of file
+var _0x8e8f=['defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2c1d94,_0x1065c5){var _0x3586d8=function(_0x248d72){while(--_0x248d72){_0x2c1d94['push'](_0x2c1d94['shift']());}};_0x3586d8(++_0x1065c5);}(_0x8e8f,0x6c));var _0xf8e8=function(_0x55c6f2,_0x5efaf9){_0x55c6f2=_0x55c6f2-0x0;var _0x185c3c=_0x8e8f[_0x55c6f2];return _0x185c3c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf8e8('0x0'));var BPromise=require(_0xf8e8('0x1'));var rs=require(_0xf8e8('0x2'));var fs=require('fs');var Redis=require(_0xf8e8('0x3'));var db=require(_0xf8e8('0x4'))['db'];var utils=require(_0xf8e8('0x5'));var logger=require(_0xf8e8('0x6'))('rpc');var config=require(_0xf8e8('0x7'));var jayson=require(_0xf8e8('0x8'));var client=jayson[_0xf8e8('0x9')][_0xf8e8('0xa')]({'port':0x232a});config[_0xf8e8('0xb')]=_[_0xf8e8('0xc')](config[_0xf8e8('0xb')],{'host':_0xf8e8('0xd'),'port':0x18eb});var socket=require(_0xf8e8('0xe'))(new Redis(config['redis']));require(_0xf8e8('0xf'))[_0xf8e8('0x10')](socket);function respondWithRpcPromise(_0x3b17b5,_0x1b882e,_0x2668d3){return new BPromise(function(_0x467549,_0x23f228){return client[_0xf8e8('0x11')](_0x3b17b5,_0x2668d3)[_0xf8e8('0x12')](function(_0x30fa61){logger[_0xf8e8('0x13')](_0xf8e8('0x14'),_0x1b882e,_0xf8e8('0x15'));logger[_0xf8e8('0x16')](_0xf8e8('0x17'),_0x1b882e,'request\x20sent',JSON[_0xf8e8('0x18')](_0x30fa61));if(_0x30fa61[_0xf8e8('0x19')]){if(_0x30fa61[_0xf8e8('0x19')][_0xf8e8('0x1a')]===0x1f4){logger[_0xf8e8('0x19')]('ChatWebsite,\x20%s,\x20%s',_0x1b882e,_0x30fa61[_0xf8e8('0x19')]['message']);return _0x23f228(_0x30fa61[_0xf8e8('0x19')][_0xf8e8('0x1b')]);}logger['error'](_0xf8e8('0x14'),_0x1b882e,_0x30fa61[_0xf8e8('0x19')][_0xf8e8('0x1b')]);return _0x467549(_0x30fa61[_0xf8e8('0x19')][_0xf8e8('0x1b')]);}else{logger[_0xf8e8('0x13')](_0xf8e8('0x14'),_0x1b882e,_0xf8e8('0x15'));_0x467549(_0x30fa61[_0xf8e8('0x1c')][_0xf8e8('0x1b')]);}})[_0xf8e8('0x1d')](function(_0x19e8b2){logger[_0xf8e8('0x19')](_0xf8e8('0x14'),_0x1b882e,_0x19e8b2);_0x23f228(_0x19e8b2);});});}
\ No newline at end of file
diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js
index 6eba0c7..1976db3 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 _0x5a1b=['chatWebsite:','./chatWebsite.events','save','remove','update','emit','removeListener','register'];(function(_0x2dd58e,_0x5de4a3){var _0x11e298=function(_0x1281a5){while(--_0x1281a5){_0x2dd58e['push'](_0x2dd58e['shift']());}};_0x11e298(++_0x5de4a3);}(_0x5a1b,0x1b9));var _0xb5a1=function(_0x2f4dda,_0x4eb009){_0x2f4dda=_0x2f4dda-0x0;var _0x459099=_0x5a1b[_0x2f4dda];return _0x459099;};'use strict';var ChatWebsiteEvents=require(_0xb5a1('0x0'));var events=[_0xb5a1('0x1'),_0xb5a1('0x2'),_0xb5a1('0x3')];function createListener(_0x371ab1,_0xec61d){return function(_0x451f9d){_0xec61d[_0xb5a1('0x4')](_0x371ab1,_0x451f9d);};}function removeListener(_0x35654c,_0x4e1af2){return function(){ChatWebsiteEvents[_0xb5a1('0x5')](_0x35654c,_0x4e1af2);};}exports[_0xb5a1('0x6')]=function(_0x29eff5){for(var _0xadeae=0x0,_0x22ff7c=events['length'];_0xadeae<_0x22ff7c;_0xadeae++){var _0x40f501=events[_0xadeae];var _0xf0ae28=createListener(_0xb5a1('0x7')+_0x40f501,_0x29eff5);ChatWebsiteEvents['on'](_0x40f501,_0xf0ae28);}};
\ No newline at end of file
+var _0xd1b1=['removeListener','register','length','chatWebsite:','./chatWebsite.events','save','remove','update','emit'];(function(_0x282beb,_0xc55436){var _0x1a072b=function(_0x258fc3){while(--_0x258fc3){_0x282beb['push'](_0x282beb['shift']());}};_0x1a072b(++_0xc55436);}(_0xd1b1,0x16c));var _0x1d1b=function(_0x127f93,_0x4be621){_0x127f93=_0x127f93-0x0;var _0x1842e6=_0xd1b1[_0x127f93];return _0x1842e6;};'use strict';var ChatWebsiteEvents=require(_0x1d1b('0x0'));var events=[_0x1d1b('0x1'),_0x1d1b('0x2'),_0x1d1b('0x3')];function createListener(_0x182a31,_0x49be28){return function(_0x5a7e21){_0x49be28[_0x1d1b('0x4')](_0x182a31,_0x5a7e21);};}function removeListener(_0x536561,_0xbfee3e){return function(){ChatWebsiteEvents[_0x1d1b('0x5')](_0x536561,_0xbfee3e);};}exports[_0x1d1b('0x6')]=function(_0xbba179){for(var _0x2d77a4=0x0,_0x25a256=events[_0x1d1b('0x7')];_0x2d77a4<_0x25a256;_0x2d77a4++){var _0x1055a3=events[_0x2d77a4];var _0x57bf9b=createListener(_0x1d1b('0x8')+_0x1055a3,_0xbba179);ChatWebsiteEvents['on'](_0x1055a3,_0x57bf9b);}};
\ No newline at end of file
diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js
index 2dd0737..3f2c6bf 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 _0x9548=['path','express','Router','fs-extra','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','/:id/offline_messages','post','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','file','addLogo','server/files/images/avatars/','originalname','/:id/avatar','single','addAvatar','addCustomerAvatar','/:id/notify','notify','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','addAgents','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents'];(function(_0x1b064d,_0x55b3ee){var _0x50c8fc=function(_0x4f965d){while(--_0x4f965d){_0x1b064d['push'](_0x1b064d['shift']());}};_0x50c8fc(++_0x55b3ee);}(_0x9548,0x1a4));var _0x8954=function(_0x2c4c98,_0x321f7f){_0x2c4c98=_0x2c4c98-0x0;var _0x472f65=_0x9548[_0x2c4c98];return _0x472f65;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x8954('0x0'));var timeout=require('connect-timeout');var express=require(_0x8954('0x1'));var router=express[_0x8954('0x2')]();var fs_extra=require(_0x8954('0x3'));var auth=require(_0x8954('0x4'));var interaction=require(_0x8954('0x5'));var config=require(_0x8954('0x6'));var controller=require('./chatWebsite.controller');router[_0x8954('0x7')]('/',auth[_0x8954('0x8')](),controller[_0x8954('0x9')]);router[_0x8954('0x7')](_0x8954('0xa'),auth[_0x8954('0x8')](),controller['describe']);router[_0x8954('0x7')](_0x8954('0xb'),auth[_0x8954('0x8')](),controller['show']);router[_0x8954('0x7')](_0x8954('0xc'),auth[_0x8954('0x8')](),controller[_0x8954('0xd')]);router[_0x8954('0x7')](_0x8954('0xe'),auth[_0x8954('0x8')](),controller['getAnswers']);router[_0x8954('0x7')]('/:id/logo',controller[_0x8954('0xf')]);router['get']('/:id/avatar',controller[_0x8954('0x10')]);router['get'](_0x8954('0x11'),controller['getCustomerAvatar']);router[_0x8954('0x7')](_0x8954('0x12'),controller[_0x8954('0x13')]);router[_0x8954('0x7')](_0x8954('0x14'),auth[_0x8954('0x8')](),controller[_0x8954('0x15')]);router[_0x8954('0x7')](_0x8954('0x16'),controller[_0x8954('0x17')]);router[_0x8954('0x7')]('/:id/applications',auth['isAuthenticated'](),controller[_0x8954('0x18')]);router[_0x8954('0x7')](_0x8954('0x19'),auth[_0x8954('0x8')](),controller[_0x8954('0x1a')]);router[_0x8954('0x7')](_0x8954('0x1b'),controller['getFields']);router[_0x8954('0x7')](_0x8954('0x1c'),auth['isAuthenticated'](),controller['getOfflineMessages']);router[_0x8954('0x7')]('/:id/users',auth[_0x8954('0x8')](),controller['getAgents']);router['post']('/',auth[_0x8954('0x8')](),controller['create']);router[_0x8954('0x1d')](_0x8954('0xc'),auth[_0x8954('0x8')](),controller['addDisposition']);router[_0x8954('0x1d')]('/:id/canned_answers',auth[_0x8954('0x8')](),controller[_0x8954('0x1e')]);var upload=multer({'storage':multer[_0x8954('0x1f')]({'destination':function(_0x299aa5,_0x5757db,_0x40c75b){_0x40c75b(null,path[_0x8954('0x20')](config[_0x8954('0x21')],_0x8954('0x22')));},'filename':function(_0x2de715,_0x1537a8,_0x318d89){_0x318d89(null,util[_0x8954('0x23')](_0x8954('0x24'),Date[_0x8954('0x25')](),_0x1537a8['originalname']));}})});router[_0x8954('0x1d')](_0x8954('0x26'),upload['single'](_0x8954('0x27')),controller[_0x8954('0x28')]);var upload=multer({'storage':multer[_0x8954('0x1f')]({'destination':function(_0x398b8e,_0x505b9f,_0x35a306){_0x35a306(null,path[_0x8954('0x20')](config['root'],_0x8954('0x29')));},'filename':function(_0x231d49,_0x49f861,_0x3585c4){_0x3585c4(null,util['format'](_0x8954('0x24'),Date[_0x8954('0x25')](),_0x49f861[_0x8954('0x2a')]));}})});router[_0x8954('0x1d')](_0x8954('0x2b'),upload[_0x8954('0x2c')]('file'),controller[_0x8954('0x2d')]);var upload=multer({'storage':multer[_0x8954('0x1f')]({'destination':function(_0x21db80,_0x2680a5,_0x5ab34f){_0x5ab34f(null,path[_0x8954('0x20')](config[_0x8954('0x21')],_0x8954('0x29')));},'filename':function(_0x44f076,_0x5bdc7f,_0x246e60){_0x246e60(null,util[_0x8954('0x23')](_0x8954('0x24'),Date[_0x8954('0x25')](),_0x5bdc7f[_0x8954('0x2a')]));}})});router[_0x8954('0x1d')](_0x8954('0x11'),upload[_0x8954('0x2c')](_0x8954('0x27')),controller[_0x8954('0x2e')]);var upload=multer({'storage':multer[_0x8954('0x1f')]({'destination':function(_0xeb8ff8,_0x32fbfe,_0x6d11b5){_0x6d11b5(null,path[_0x8954('0x20')](config[_0x8954('0x21')],_0x8954('0x29')));},'filename':function(_0x390f60,_0xf9d38,_0x6ba5fa){_0x6ba5fa(null,util[_0x8954('0x23')](_0x8954('0x24'),Date['now'](),_0xf9d38[_0x8954('0x2a')]));}})});router['post'](_0x8954('0x12'),upload['single'](_0x8954('0x27')),controller['addSystemAvatar']);router['post'](_0x8954('0x2f'),controller[_0x8954('0x30')]);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x43b31d,_0x482981,_0x68fc59){const _0x19e5a6=path[_0x8954('0x20')](config['root'],_0x8954('0x31'),_0x8954('0x32'),_0x8954('0x33'));fs_extra[_0x8954('0x34')](_0x19e5a6,function(){_0x68fc59(null,_0x19e5a6);});},'filename':function(_0x46bbbe,_0x1b367a,_0x57e068){const _0x4cfdd4=_0x1b367a[_0x8954('0x2a')][_0x8954('0x35')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x201007=path[_0x8954('0x36')](_0x4cfdd4);const _0x51993d=Date[_0x8954('0x25')]()+'-'+_0x4cfdd4[_0x8954('0x35')](_0x201007,'')+_0x201007;_0x57e068(null,_0x51993d);}})});router[_0x8954('0x1d')](_0x8954('0x37'),offlineUploadMulter[_0x8954('0x38')](),controller[_0x8954('0x39')]);router[_0x8954('0x1d')](_0x8954('0x14'),auth['isAuthenticated'](),controller[_0x8954('0x3a')]);router[_0x8954('0x1d')]('/:id/applications',auth[_0x8954('0x8')](),controller[_0x8954('0x3b')]);router[_0x8954('0x1d')]('/:id/proactive_actions',auth[_0x8954('0x8')](),controller[_0x8954('0x3c')]);router[_0x8954('0x1d')](_0x8954('0x3d'),auth[_0x8954('0x8')](),controller[_0x8954('0x3e')]);router[_0x8954('0x3f')](_0x8954('0xb'),auth[_0x8954('0x8')](),controller[_0x8954('0x40')]);router[_0x8954('0x41')](_0x8954('0xb'),auth[_0x8954('0x8')](),controller[_0x8954('0x42')]);router[_0x8954('0x41')](_0x8954('0xc'),auth[_0x8954('0x8')](),controller[_0x8954('0x43')]);router[_0x8954('0x41')](_0x8954('0xe'),auth[_0x8954('0x8')](),controller[_0x8954('0x44')]);router[_0x8954('0x41')](_0x8954('0x3d'),auth['isAuthenticated'](),controller[_0x8954('0x45')]);module['exports']=router;
\ No newline at end of file
+var _0xe0bb=['getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/offline_messages','getOfflineMessages','getAgents','post','addAnswer','diskStorage','join','server/files/images/logos/','format','%s-%s','now','originalname','single','addLogo','server/files/images/avatars/','root','file','addCustomerAvatar','addSystemAvatar','server/files','attachments','offline-chat','ensureDir','replace','extname','/:id/offline','any','offline','addInteraction','addApplications','addProactiveActions','/:id/users','put','/:id','update','destroy','delete','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions'];(function(_0x9b3589,_0x4726ef){var _0x1cb999=function(_0x3a4f1a){while(--_0x3a4f1a){_0x9b3589['push'](_0x9b3589['shift']());}};_0x1cb999(++_0x4726ef);}(_0xe0bb,0x76));var _0xbe0b=function(_0x38c652,_0x1ea1b7){_0x38c652=_0x38c652-0x0;var _0x218a37=_0xe0bb[_0x38c652];return _0x218a37;};'use strict';var multer=require(_0xbe0b('0x0'));var util=require(_0xbe0b('0x1'));var path=require(_0xbe0b('0x2'));var timeout=require(_0xbe0b('0x3'));var express=require(_0xbe0b('0x4'));var router=express[_0xbe0b('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0xbe0b('0x6'));var interaction=require(_0xbe0b('0x7'));var config=require(_0xbe0b('0x8'));var controller=require('./chatWebsite.controller');router[_0xbe0b('0x9')]('/',auth[_0xbe0b('0xa')](),controller['index']);router[_0xbe0b('0x9')](_0xbe0b('0xb'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0xc')]);router[_0xbe0b('0x9')]('/:id',auth[_0xbe0b('0xa')](),controller[_0xbe0b('0xd')]);router['get'](_0xbe0b('0xe'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0xf')]);router[_0xbe0b('0x9')](_0xbe0b('0x10'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x11')]);router[_0xbe0b('0x9')](_0xbe0b('0x12'),controller[_0xbe0b('0x13')]);router['get'](_0xbe0b('0x14'),controller['getAvatar']);router[_0xbe0b('0x9')](_0xbe0b('0x15'),controller[_0xbe0b('0x16')]);router[_0xbe0b('0x9')](_0xbe0b('0x17'),controller[_0xbe0b('0x18')]);router[_0xbe0b('0x9')](_0xbe0b('0x19'),auth['isAuthenticated'](),controller[_0xbe0b('0x1a')]);router[_0xbe0b('0x9')](_0xbe0b('0x1b'),controller[_0xbe0b('0x1c')]);router[_0xbe0b('0x9')](_0xbe0b('0x1d'),auth['isAuthenticated'](),controller[_0xbe0b('0x1e')]);router[_0xbe0b('0x9')](_0xbe0b('0x1f'),auth['isAuthenticated'](),controller[_0xbe0b('0x20')]);router['get']('/:id/fields',controller['getFields']);router['get'](_0xbe0b('0x21'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x22')]);router[_0xbe0b('0x9')]('/:id/users',auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x23')]);router[_0xbe0b('0x24')]('/',auth[_0xbe0b('0xa')](),controller['create']);router[_0xbe0b('0x24')](_0xbe0b('0xe'),auth[_0xbe0b('0xa')](),controller['addDisposition']);router[_0xbe0b('0x24')]('/:id/canned_answers',auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x25')]);var upload=multer({'storage':multer[_0xbe0b('0x26')]({'destination':function(_0x396d6d,_0x3f5616,_0x58b016){_0x58b016(null,path[_0xbe0b('0x27')](config['root'],_0xbe0b('0x28')));},'filename':function(_0x422d9f,_0x169e66,_0x451bef){_0x451bef(null,util[_0xbe0b('0x29')](_0xbe0b('0x2a'),Date[_0xbe0b('0x2b')](),_0x169e66[_0xbe0b('0x2c')]));}})});router[_0xbe0b('0x24')](_0xbe0b('0x12'),upload[_0xbe0b('0x2d')]('file'),controller[_0xbe0b('0x2e')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x542735,_0x34b8a7,_0x1787f4){_0x1787f4(null,path[_0xbe0b('0x27')](config['root'],_0xbe0b('0x2f')));},'filename':function(_0x3cdcdc,_0x32ed9c,_0x495492){_0x495492(null,util[_0xbe0b('0x29')](_0xbe0b('0x2a'),Date[_0xbe0b('0x2b')](),_0x32ed9c['originalname']));}})});router[_0xbe0b('0x24')](_0xbe0b('0x14'),upload[_0xbe0b('0x2d')]('file'),controller['addAvatar']);var upload=multer({'storage':multer[_0xbe0b('0x26')]({'destination':function(_0x1eb7e8,_0x57e61f,_0x7f220f){_0x7f220f(null,path[_0xbe0b('0x27')](config[_0xbe0b('0x30')],_0xbe0b('0x2f')));},'filename':function(_0x30a9c2,_0x4263af,_0x1a7fdc){_0x1a7fdc(null,util[_0xbe0b('0x29')](_0xbe0b('0x2a'),Date[_0xbe0b('0x2b')](),_0x4263af[_0xbe0b('0x2c')]));}})});router[_0xbe0b('0x24')](_0xbe0b('0x15'),upload[_0xbe0b('0x2d')](_0xbe0b('0x31')),controller[_0xbe0b('0x32')]);var upload=multer({'storage':multer[_0xbe0b('0x26')]({'destination':function(_0x56d7f7,_0x272909,_0x5c79eb){_0x5c79eb(null,path[_0xbe0b('0x27')](config[_0xbe0b('0x30')],_0xbe0b('0x2f')));},'filename':function(_0x4f5b7e,_0x1b0307,_0x5cd6a2){_0x5cd6a2(null,util[_0xbe0b('0x29')](_0xbe0b('0x2a'),Date['now'](),_0x1b0307[_0xbe0b('0x2c')]));}})});router[_0xbe0b('0x24')]('/:id/system_avatar',upload['single'](_0xbe0b('0x31')),controller[_0xbe0b('0x33')]);router['post']('/:id/notify',controller['notify']);const offlineUploadMulter=multer({'storage':multer['diskStorage']({'destination':function(_0x5192d5,_0x3cbf10,_0x1cce4b){const _0x402936=path[_0xbe0b('0x27')](config[_0xbe0b('0x30')],_0xbe0b('0x34'),_0xbe0b('0x35'),_0xbe0b('0x36'));fs_extra[_0xbe0b('0x37')](_0x402936,function(){_0x1cce4b(null,_0x402936);});},'filename':function(_0x55a0db,_0x3ac96e,_0x21970c){const _0x44c1f4=_0x3ac96e['originalname'][_0xbe0b('0x38')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');const _0x2e381c=path[_0xbe0b('0x39')](_0x44c1f4);const _0x5ef3f4=Date[_0xbe0b('0x2b')]()+'-'+_0x44c1f4[_0xbe0b('0x38')](_0x2e381c,'')+_0x2e381c;_0x21970c(null,_0x5ef3f4);}})});router[_0xbe0b('0x24')](_0xbe0b('0x3a'),offlineUploadMulter[_0xbe0b('0x3b')](),controller[_0xbe0b('0x3c')]);router[_0xbe0b('0x24')](_0xbe0b('0x19'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x3d')]);router[_0xbe0b('0x24')]('/:id/applications',auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x3e')]);router[_0xbe0b('0x24')](_0xbe0b('0x1f'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x3f')]);router['post'](_0xbe0b('0x40'),auth['isAuthenticated'](),controller['addAgents']);router[_0xbe0b('0x41')](_0xbe0b('0x42'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x43')]);router['delete'](_0xbe0b('0x42'),auth[_0xbe0b('0xa')](),controller[_0xbe0b('0x44')]);router[_0xbe0b('0x45')]('/:id/dispositions',auth[_0xbe0b('0xa')](),controller['removeDispositions']);router[_0xbe0b('0x45')](_0xbe0b('0x10'),auth['isAuthenticated'](),controller[_0xbe0b('0x46')]);router[_0xbe0b('0x45')](_0xbe0b('0x40'),auth['isAuthenticated'](),controller['removeAgents']);module[_0xbe0b('0x47')]=router;
\ No newline at end of file
diff --git a/server/api/client-side-logs.js b/server/api/client-side-logs.js
index 8f7bcfa..88e37ea 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 _0xd97b=['Client-Side\x20logger\x20not\x20found!','expressEndpoint','/client-logs','use','exports','beaver-logger/server','express','../components/auth/service','../config/environment','Router','env','production','get','client-side-logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xd97b,0x1ef));var _0xbd97=function(_0x2adc52,_0x24cecb){_0x2adc52=_0x2adc52-0x0;var _0xb56489=_0xd97b[_0x2adc52];return _0xb56489;};var beaverLogger=require(_0xbd97('0x0'));var express=require(_0xbd97('0x1'));var auth=require(_0xbd97('0x2'));var config=require(_0xbd97('0x3'));var router=express[_0xbd97('0x4')]();var isProduction=config[_0xbd97('0x5')]===_0xbd97('0x6')||![];function clientSideLogs(_0x3b93a9,_0x23393d,_0x148697){var _0x580986=_0x3b93a9['app'][_0xbd97('0x7')](_0xbd97('0x8'));if(!_0x580986){throw new Error(_0xbd97('0x9'));}return beaverLogger[_0xbd97('0xa')]({'uri':_0xbd97('0xb'),'logger':_0x580986,'enableCors':!isProduction})(_0x3b93a9,_0x23393d,_0x148697);}router[_0xbd97('0xc')](auth['isAuthenticated'](),clientSideLogs);module[_0xbd97('0xd')]=router;
\ No newline at end of file
+var _0x8e57=['Router','app','get','client-side-logger','expressEndpoint','/client-logs','isAuthenticated','beaver-logger/server','express','../config/environment'];(function(_0x1ee9a1,_0x5f1434){var _0x21270f=function(_0x303251){while(--_0x303251){_0x1ee9a1['push'](_0x1ee9a1['shift']());}};_0x21270f(++_0x5f1434);}(_0x8e57,0x6b));var _0x78e5=function(_0x3b8746,_0x4796f4){_0x3b8746=_0x3b8746-0x0;var _0x491036=_0x8e57[_0x3b8746];return _0x491036;};var beaverLogger=require(_0x78e5('0x0'));var express=require(_0x78e5('0x1'));var auth=require('../components/auth/service');var config=require(_0x78e5('0x2'));var router=express[_0x78e5('0x3')]();var isProduction=config['env']==='production'||![];function clientSideLogs(_0x5bdc85,_0x40a950,_0x1508ea){var _0x2db7f8=_0x5bdc85[_0x78e5('0x4')][_0x78e5('0x5')](_0x78e5('0x6'));if(!_0x2db7f8){throw new Error('Client-Side\x20logger\x20not\x20found!');}return beaverLogger[_0x78e5('0x7')]({'uri':_0x78e5('0x8'),'logger':_0x2db7f8,'enableCors':!isProduction})(_0x5bdc85,_0x40a950,_0x1508ea);}router['use'](auth[_0x78e5('0x9')](),clientSideLogs);module['exports']=router;
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.attributes.js b/server/api/cloudProvider/cloudProvider.attributes.js
index 6c60fd9..dd541bc 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 _0x8f62=['Google','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20tenant','MicrosoftAzure\x20=>\x20client_secret','TEXT','MicrosoftAzure\x20=>\x20access_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','exports','STRING','ENUM'];(function(_0x1df18d,_0x3cf08d){var _0x16250e=function(_0x5e8727){while(--_0x5e8727){_0x1df18d['push'](_0x1df18d['shift']());}};_0x16250e(++_0x3cf08d);}(_0x8f62,0x81));var _0x28f6=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8f62[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module[_0x28f6('0x0')]={'name':{'type':Sequelize[_0x28f6('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0x28f6('0x2')]('AmazonAWS',_0x28f6('0x3'),'MicrosoftAzure'),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0x28f6('0x2')](_0x28f6('0x4'),'Dynamics365')},'data1':{'type':Sequelize[_0x28f6('0x1')],'comment':_0x28f6('0x5')},'data2':{'type':Sequelize[_0x28f6('0x1')],'comment':_0x28f6('0x6')},'data3':{'type':Sequelize[_0x28f6('0x1')],'comment':_0x28f6('0x7')},'data4':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20redirect_uri'},'data5':{'type':Sequelize[_0x28f6('0x8')],'comment':_0x28f6('0x9')},'data6':{'type':Sequelize[_0x28f6('0x8')],'comment':'MicrosoftAzure\x20=>\x20refresh_token'},'data7':{'type':Sequelize[_0x28f6('0x8')],'comment':_0x28f6('0xa')}};
\ No newline at end of file
+var _0xc47b=['MicrosoftAzure\x20=>\x20refresh_token','MicrosoftAzure\x20=>\x20Dynamics365\x20=>\x20remote_uri','STRING','ENUM','Google','MicrosoftAzure','Outlook365','MicrosoftAzure\x20=>\x20client_id','MicrosoftAzure\x20=>\x20client_secret','MicrosoftAzure\x20=>\x20redirect_uri','TEXT','MicrosoftAzure\x20=>\x20access_token'];(function(_0x203121,_0x1790d5){var _0x2978b7=function(_0x1c122c){while(--_0x1c122c){_0x203121['push'](_0x203121['shift']());}};_0x2978b7(++_0x1790d5);}(_0xc47b,0x19a));var _0xbc47=function(_0x3203e1,_0x305b1c){_0x3203e1=_0x3203e1-0x0;var _0x3139eb=_0xc47b[_0x3203e1];return _0x3139eb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xbc47('0x0')],'allowNull':![],'validate':{'notEmpty':!![]}},'service':{'type':Sequelize[_0xbc47('0x1')]('AmazonAWS',_0xbc47('0x2'),_0xbc47('0x3')),'allowNull':![],'validate':{'notEmpty':!![]}},'type':{'type':Sequelize[_0xbc47('0x1')](_0xbc47('0x4'),'Dynamics365')},'data1':{'type':Sequelize['STRING'],'comment':_0xbc47('0x5')},'data2':{'type':Sequelize['STRING'],'comment':'MicrosoftAzure\x20=>\x20tenant'},'data3':{'type':Sequelize[_0xbc47('0x0')],'comment':_0xbc47('0x6')},'data4':{'type':Sequelize['STRING'],'comment':_0xbc47('0x7')},'data5':{'type':Sequelize[_0xbc47('0x8')],'comment':_0xbc47('0x9')},'data6':{'type':Sequelize['TEXT'],'comment':_0xbc47('0xa')},'data7':{'type':Sequelize[_0xbc47('0x8')],'comment':_0xbc47('0xb')}};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.controller.js b/server/api/cloudProvider/cloudProvider.controller.js
index 1a988cf..51ac471 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 _0x7aba=['microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','send','message','stringify','lodash','../../components/parsers/qs','../../components/encryptor','../../config/environment','../../config/logger','api','redis','defaults','socket.io-emitter','sendStatus','status','end','json','offset','undefined','count','limit','set','Content-Range','update','then','error','name','slice','index','map','CloudProvider','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','filter','merge','type','where','includeAll','include','findAll','service','MicrosoftAzure','decryptString','data3','show','params','find','catch','create','body','Name\x20parameter\x20not\x20specified','Service\x20parameter\x20not\x20specified','values','includes','encryptString','destroy','findOne','generateMicrosoftAuthorizationUrl','user','oauth2MicrosoftCallback','get','state','Invalid\x20state\x20parameter','parse','toString','isValidIdToken','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','data6','emit'];(function(_0x338adf,_0x822d51){var _0x1fee0a=function(_0x48aaf7){while(--_0x48aaf7){_0x338adf['push'](_0x338adf['shift']());}};_0x1fee0a(++_0x822d51);}(_0x7aba,0xaf));var _0xa7ab=function(_0x201b49,_0x2f73f0){_0x201b49=_0x201b49-0x0;var _0x4562d9=_0x7aba[_0x201b49];return _0x4562d9;};'use strict';var _=require(_0xa7ab('0x0'));var Redis=require('ioredis');var qs=require(_0xa7ab('0x1'));var encryptor=require(_0xa7ab('0x2'));var config=require(_0xa7ab('0x3'));var logger=require(_0xa7ab('0x4'))(_0xa7ab('0x5'));var db=require('../../mysqldb')['db'];var oauth=require('./cloudProvider.oauth');config[_0xa7ab('0x6')]=_[_0xa7ab('0x7')](config[_0xa7ab('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7ab('0x8'))(new Redis(config[_0xa7ab('0x6')]));var redis=new Redis(config[_0xa7ab('0x6')]);function respondWithStatusCode(_0x37967d,_0x1700d7){_0x1700d7=_0x1700d7||0xcc;return function(_0x582541){if(_0x582541){return _0x37967d[_0xa7ab('0x9')](_0x1700d7);}return _0x37967d[_0xa7ab('0xa')](_0x1700d7)[_0xa7ab('0xb')]();};}function respondWithResult(_0x54b83f,_0xc35c0){_0xc35c0=_0xc35c0||0xc8;return function(_0x1d91c8){if(_0x1d91c8){return _0x54b83f[_0xa7ab('0xa')](_0xc35c0)[_0xa7ab('0xc')](_0x1d91c8);}};}function respondWithFilteredResult(_0x46c7f4,_0x160041){return function(_0x3a8294){if(_0x3a8294){var _0x3ef6be=typeof _0x160041[_0xa7ab('0xd')]===_0xa7ab('0xe')&&typeof _0x160041['limit']==='undefined';var _0x4c785f=_0x3a8294['count'];var _0x5542eb=_0x3ef6be?0x0:_0x160041['offset'];var _0x17ed27=_0x3ef6be?_0x3a8294[_0xa7ab('0xf')]:_0x160041[_0xa7ab('0xd')]+_0x160041[_0xa7ab('0x10')];var _0x568141;if(_0x17ed27>=_0x4c785f){_0x17ed27=_0x4c785f;_0x568141=0xc8;}else{_0x568141=0xce;}_0x46c7f4[_0xa7ab('0xa')](_0x568141);return _0x46c7f4[_0xa7ab('0x11')](_0xa7ab('0x12'),_0x5542eb+'-'+_0x17ed27+'/'+_0x4c785f)['json'](_0x3a8294);}return null;};}function saveUpdates(_0x40daeb){return function(_0x3fd4c4){if(_0x3fd4c4){return _0x3fd4c4[_0xa7ab('0x13')](_0x40daeb)[_0xa7ab('0x14')](function(_0x21443b){return _0x21443b;});}return null;};}function removeEntity(_0x136366){return function(_0x35248e){if(_0x35248e){return _0x35248e['destroy']()[_0xa7ab('0x14')](function(){_0x136366[_0xa7ab('0xa')](0xcc)[_0xa7ab('0xb')]();});}};}function handleEntityNotFound(_0x54cddf){return function(_0x187b8b){if(!_0x187b8b){_0x54cddf[_0xa7ab('0x9')](0x194);}return _0x187b8b;};}function handleError(_0x1919ee,_0x2fe446){_0x2fe446=_0x2fe446||0x1f4;return function(_0x42bb15){logger[_0xa7ab('0x15')](_0x42bb15['stack']);if(_0x42bb15[_0xa7ab('0x16')]){delete _0x42bb15[_0xa7ab('0x16')];}_0x1919ee[_0xa7ab('0xa')](_0x2fe446)['send'](_0x42bb15);};}function maskClientSecret(_0x59aed0){return _['padEnd'](_0x59aed0[_0xa7ab('0x17')](0x0,0x3),0x14,'*');}exports[_0xa7ab('0x18')]=function(_0x51daa0,_0xd8034){var _0x5d2b85={},_0x14478a={},_0x4eb43c={'count':0x0,'rows':[]};var _0xd527bc=_[_0xa7ab('0x19')](db[_0xa7ab('0x1a')][_0xa7ab('0x1b')],function(_0x1363dc){return{'name':_0x1363dc[_0xa7ab('0x1c')],'type':_0x1363dc['type'][_0xa7ab('0x1d')]};});_0x14478a[_0xa7ab('0x1e')]=_[_0xa7ab('0x19')](_0xd527bc,_0xa7ab('0x16'));_0x14478a[_0xa7ab('0x1f')]=_[_0xa7ab('0x20')](_0x51daa0['query']);_0x14478a[_0xa7ab('0x21')]=_[_0xa7ab('0x22')](_0x14478a[_0xa7ab('0x1e')],_0x14478a[_0xa7ab('0x1f')]);_0x5d2b85[_0xa7ab('0x23')]=_[_0xa7ab('0x22')](_0x14478a[_0xa7ab('0x1e')],qs[_0xa7ab('0x24')](_0x51daa0[_0xa7ab('0x1f')][_0xa7ab('0x24')]));_0x5d2b85['attributes']=_0x5d2b85[_0xa7ab('0x23')][_0xa7ab('0x25')]?_0x5d2b85['attributes']:_0x14478a[_0xa7ab('0x1e')];if(!_0x51daa0['query']['hasOwnProperty'](_0xa7ab('0x26'))){_0x5d2b85['limit']=qs[_0xa7ab('0x10')](_0x51daa0[_0xa7ab('0x1f')]['limit']);_0x5d2b85[_0xa7ab('0xd')]=qs[_0xa7ab('0xd')](_0x51daa0[_0xa7ab('0x1f')][_0xa7ab('0xd')]);}_0x5d2b85['order']=qs[_0xa7ab('0x27')](_0x51daa0[_0xa7ab('0x1f')][_0xa7ab('0x27')]);_0x5d2b85['where']=qs[_0xa7ab('0x21')](_['pick'](_0x51daa0['query'],_0x14478a[_0xa7ab('0x21')]),_0xd527bc);if(_0x51daa0[_0xa7ab('0x1f')][_0xa7ab('0x28')]){_0x5d2b85['where']=_[_0xa7ab('0x29')](_0x5d2b85['where'],{'$or':_[_0xa7ab('0x19')](_0xd527bc,function(_0x24a878){if(_0x24a878[_0xa7ab('0x2a')]!=='VIRTUAL'){var _0x1ef9d9={};_0x1ef9d9[_0x24a878[_0xa7ab('0x16')]]={'$like':'%'+_0x51daa0[_0xa7ab('0x1f')][_0xa7ab('0x28')]+'%'};return _0x1ef9d9;}})});}_0x5d2b85=_[_0xa7ab('0x29')]({},_0x5d2b85,_0x51daa0['options']);var _0x311941={'where':_0x5d2b85[_0xa7ab('0x2b')]};return db[_0xa7ab('0x1a')][_0xa7ab('0xf')](_0x311941)[_0xa7ab('0x14')](function(_0x440950){_0x4eb43c[_0xa7ab('0xf')]=_0x440950;if(_0x51daa0[_0xa7ab('0x1f')][_0xa7ab('0x2c')]){_0x5d2b85[_0xa7ab('0x2d')]=[{'all':!![]}];}return db['CloudProvider'][_0xa7ab('0x2e')](_0x5d2b85);})[_0xa7ab('0x14')](function(_0x2be7af){_0x4eb43c['rows']=_['map'](_0x2be7af,function(_0x1e36ee){if(_0x1e36ee[_0xa7ab('0x2f')]===_0xa7ab('0x30')){var _0x204ffa=encryptor[_0xa7ab('0x31')](_0x1e36ee['data3']);_0x1e36ee[_0xa7ab('0x32')]=maskClientSecret(_0x204ffa);}return _0x1e36ee;});return _0x4eb43c;})[_0xa7ab('0x14')](respondWithFilteredResult(_0xd8034,_0x5d2b85))['catch'](handleError(_0xd8034,null));};exports[_0xa7ab('0x33')]=function(_0x2b3449,_0x295168){var _0x9cc303={'raw':!![],'where':{'id':_0x2b3449[_0xa7ab('0x34')]['id']}},_0x39fc1d={};_0x39fc1d[_0xa7ab('0x1e')]=_['keys'](db[_0xa7ab('0x1a')][_0xa7ab('0x1b')]);_0x39fc1d[_0xa7ab('0x1f')]=_['keys'](_0x2b3449[_0xa7ab('0x1f')]);_0x39fc1d[_0xa7ab('0x21')]=_[_0xa7ab('0x22')](_0x39fc1d[_0xa7ab('0x1e')],_0x39fc1d[_0xa7ab('0x1f')]);_0x9cc303[_0xa7ab('0x23')]=_[_0xa7ab('0x22')](_0x39fc1d[_0xa7ab('0x1e')],qs[_0xa7ab('0x24')](_0x2b3449['query'][_0xa7ab('0x24')]));_0x9cc303[_0xa7ab('0x23')]=_0x9cc303['attributes']['length']?_0x9cc303['attributes']:_0x39fc1d[_0xa7ab('0x1e')];if(_0x2b3449['query']['includeAll']){_0x9cc303[_0xa7ab('0x2d')]=[{'all':!![]}];}_0x9cc303=_['merge']({},_0x9cc303,_0x2b3449['options']);return db[_0xa7ab('0x1a')][_0xa7ab('0x35')](_0x9cc303)[_0xa7ab('0x14')](handleEntityNotFound(_0x295168,null))[_0xa7ab('0x14')](function(_0x95ddbd){if(_0x95ddbd['service']===_0xa7ab('0x30')){var _0x75ad91=encryptor[_0xa7ab('0x31')](_0x95ddbd[_0xa7ab('0x32')]);_0x95ddbd[_0xa7ab('0x32')]=maskClientSecret(_0x75ad91);}return _0x95ddbd;})[_0xa7ab('0x14')](respondWithResult(_0x295168,null))[_0xa7ab('0x36')](handleError(_0x295168,null));};exports[_0xa7ab('0x37')]=function(_0xdec2cb,_0x1916a9){if(!_0xdec2cb[_0xa7ab('0x38')][_0xa7ab('0x16')])throw new Error(_0xa7ab('0x39'));if(!_0xdec2cb['body'][_0xa7ab('0x2f')])throw new Error(_0xa7ab('0x3a'));var _0x37fea9=db[_0xa7ab('0x1a')]['rawAttributes']['service'][_0xa7ab('0x3b')];if(!_0x37fea9[_0xa7ab('0x3c')](_0xdec2cb[_0xa7ab('0x38')][_0xa7ab('0x2f')]))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x37fea9['join'](',\x20'));if(_0xdec2cb[_0xa7ab('0x38')][_0xa7ab('0x2f')]==='MicrosoftAzure'&&_0xdec2cb[_0xa7ab('0x38')][_0xa7ab('0x32')]){_0xdec2cb[_0xa7ab('0x38')][_0xa7ab('0x32')]=encryptor[_0xa7ab('0x3d')](_0xdec2cb[_0xa7ab('0x38')][_0xa7ab('0x32')]);}return db[_0xa7ab('0x1a')][_0xa7ab('0x37')](_0xdec2cb[_0xa7ab('0x38')],{})[_0xa7ab('0x14')](respondWithResult(_0x1916a9,0xc9))[_0xa7ab('0x36')](handleError(_0x1916a9,null));};exports[_0xa7ab('0x13')]=function(_0x10f7eb,_0x36da24){if(_0x10f7eb[_0xa7ab('0x38')]['id']){delete _0x10f7eb[_0xa7ab('0x38')]['id'];}return db[_0xa7ab('0x1a')][_0xa7ab('0x35')]({'where':{'id':_0x10f7eb[_0xa7ab('0x34')]['id']}})['then'](handleEntityNotFound(_0x36da24,null))[_0xa7ab('0x14')](function(_0x12dcdd){if(_0x12dcdd[_0xa7ab('0x2f')]===_0xa7ab('0x30')&&_0x10f7eb[_0xa7ab('0x38')][_0xa7ab('0x32')]){_0x10f7eb['body'][_0xa7ab('0x32')]=encryptor[_0xa7ab('0x3d')](_0x10f7eb[_0xa7ab('0x38')][_0xa7ab('0x32')]);}return _0x12dcdd;})[_0xa7ab('0x14')](saveUpdates(_0x10f7eb['body'],null))[_0xa7ab('0x14')](respondWithResult(_0x36da24,null))['catch'](handleError(_0x36da24,null));};exports[_0xa7ab('0x3e')]=function(_0x4c8775,_0x1571a6){return db[_0xa7ab('0x1a')][_0xa7ab('0x35')]({'where':{'id':_0x4c8775[_0xa7ab('0x34')]['id']}})[_0xa7ab('0x14')](handleEntityNotFound(_0x1571a6,null))[_0xa7ab('0x14')](removeEntity(_0x1571a6,null))[_0xa7ab('0x36')](handleError(_0x1571a6,null));};exports['oauth2MicrosoftAuthorize']=function(_0x418f69,_0x43c00d){return db[_0xa7ab('0x1a')][_0xa7ab('0x3f')]({'where':{'id':_0x418f69[_0xa7ab('0x34')]['id']},'raw':!![]})[_0xa7ab('0x14')](function(_0x13ef1f){if(!_0x13ef1f)return _0x43c00d[_0xa7ab('0x9')](0x194);return{'url':oauth[_0xa7ab('0x40')](_0x13ef1f,_0x418f69[_0xa7ab('0x41')]['id'])};})[_0xa7ab('0x14')](respondWithResult(_0x43c00d,null))[_0xa7ab('0x36')](handleError(_0x43c00d,null));};exports[_0xa7ab('0x42')]=function(_0x1f5d04,_0x24c2af){var _0x55691e=_0x1f5d04['body'];var _0x44d065;var _0x2726b6;if(_0x55691e[_0xa7ab('0x15')])throw _0x55691e;redis[_0xa7ab('0x43')](_0x55691e[_0xa7ab('0x44')])['then'](function(_0x36b869){if(!_0x36b869)throw new Error(_0xa7ab('0x45'));_0x44d065=JSON[_0xa7ab('0x46')](_0x36b869);var _0x4f546c=Buffer['from'](_0x55691e[_0xa7ab('0x44')],'base64')[_0xa7ab('0x47')]('ascii');_0x2726b6=JSON[_0xa7ab('0x46')](_0x4f546c);if(!oauth[_0xa7ab('0x48')](_0x55691e['id_token'],_0x44d065['oauth2Claims']))throw new Error(_0xa7ab('0x49'));redis[_0xa7ab('0x4a')](_0x55691e['state']);return oauth[_0xa7ab('0x4b')](_0x55691e[_0xa7ab('0x4c')],_0x44d065);})[_0xa7ab('0x14')](function(_0x470ae3){_0x44d065[_0xa7ab('0x4d')]=_0x470ae3['access_token'];_0x44d065[_0xa7ab('0x4e')]=_0x470ae3['refresh_token'];return db[_0xa7ab('0x1a')][_0xa7ab('0x13')]({'data5':_0x44d065[_0xa7ab('0x4d')],'data6':_0x44d065[_0xa7ab('0x4e')]},{'where':{'id':_0x44d065['id']}});})[_0xa7ab('0x14')](function(){oauth['startRefreshInterval'](_0x44d065);socket[_0xa7ab('0x4f')]('microsoftAuthorization:success',{'id':_0x2726b6['id']});return;})[_0xa7ab('0x14')](respondWithStatusCode(_0x24c2af,null))[_0xa7ab('0x36')](function(_0x170650){if(_0x2726b6){socket[_0xa7ab('0x4f')](_0xa7ab('0x50'),{'id':_0x2726b6['id']});}if(!_0x44d065){logger['error'](_0xa7ab('0x51'),_0x170650);return _0x24c2af['status'](0x1f4)[_0xa7ab('0x52')](_0x170650[_0xa7ab('0x53')]);}logger['error']('Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s',_0x44d065['id'],JSON[_0xa7ab('0x54')](_0x170650));});};
\ No newline at end of file
+var _0xa4f0=['Invalid\x20state\x20parameter','parse','from','base64','isValidIdToken','oauth2Claims','Unable\x20to\x20validate\x20id_token','del','getOauth2MicrosoftAccessToken','code','data5','access_token','refresh_token','data6','startRefreshInterval','emit','microsoftAuthorization:success','microsoftAuthorization:error','Invalid\x20authentication\x20state\x20parameter','message','Authentication\x20failed\x20for\x20cloud\x20provider\x20#%s,\x20err:%s','stringify','lodash','ioredis','../../components/parsers/qs','api','../../mysqldb','redis','defaults','socket.io-emitter','sendStatus','status','end','offset','undefined','limit','count','set','json','then','destroy','error','stack','name','send','map','CloudProvider','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','filter','merge','VIRTUAL','options','rows','MicrosoftAzure','decryptString','data3','show','params','includeAll','include','service','create','body','includes','join','update','find','encryptString','catch','findOne','oauth2MicrosoftCallback','get','state'];(function(_0x10ec0f,_0x5ece09){var _0x1587ee=function(_0x54ac17){while(--_0x54ac17){_0x10ec0f['push'](_0x10ec0f['shift']());}};_0x1587ee(++_0x5ece09);}(_0xa4f0,0x6d));var _0x0a4f=function(_0x24cfb2,_0x10a47c){_0x24cfb2=_0x24cfb2-0x0;var _0x520808=_0xa4f0[_0x24cfb2];return _0x520808;};'use strict';var _=require(_0x0a4f('0x0'));var Redis=require(_0x0a4f('0x1'));var qs=require(_0x0a4f('0x2'));var encryptor=require('../../components/encryptor');var config=require('../../config/environment');var logger=require('../../config/logger')(_0x0a4f('0x3'));var db=require(_0x0a4f('0x4'))['db'];var oauth=require('./cloudProvider.oauth');config[_0x0a4f('0x5')]=_[_0x0a4f('0x6')](config[_0x0a4f('0x5')],{'host':'localhost','port':0x18eb});var socket=require(_0x0a4f('0x7'))(new Redis(config['redis']));var redis=new Redis(config['redis']);function respondWithStatusCode(_0x404c6c,_0x4924b7){_0x4924b7=_0x4924b7||0xcc;return function(_0x1d1ed2){if(_0x1d1ed2){return _0x404c6c[_0x0a4f('0x8')](_0x4924b7);}return _0x404c6c[_0x0a4f('0x9')](_0x4924b7)[_0x0a4f('0xa')]();};}function respondWithResult(_0x230be9,_0x5bf13e){_0x5bf13e=_0x5bf13e||0xc8;return function(_0x4c2310){if(_0x4c2310){return _0x230be9[_0x0a4f('0x9')](_0x5bf13e)['json'](_0x4c2310);}};}function respondWithFilteredResult(_0x333489,_0xd973d2){return function(_0x137ce6){if(_0x137ce6){var _0x2e8425=typeof _0xd973d2[_0x0a4f('0xb')]===_0x0a4f('0xc')&&typeof _0xd973d2[_0x0a4f('0xd')]===_0x0a4f('0xc');var _0x29057b=_0x137ce6['count'];var _0x420a82=_0x2e8425?0x0:_0xd973d2[_0x0a4f('0xb')];var _0x115fe8=_0x2e8425?_0x137ce6[_0x0a4f('0xe')]:_0xd973d2['offset']+_0xd973d2[_0x0a4f('0xd')];var _0xa2b12f;if(_0x115fe8>=_0x29057b){_0x115fe8=_0x29057b;_0xa2b12f=0xc8;}else{_0xa2b12f=0xce;}_0x333489[_0x0a4f('0x9')](_0xa2b12f);return _0x333489[_0x0a4f('0xf')]('Content-Range',_0x420a82+'-'+_0x115fe8+'/'+_0x29057b)[_0x0a4f('0x10')](_0x137ce6);}return null;};}function saveUpdates(_0x33e9c5){return function(_0x616a1a){if(_0x616a1a){return _0x616a1a['update'](_0x33e9c5)[_0x0a4f('0x11')](function(_0x36366c){return _0x36366c;});}return null;};}function removeEntity(_0x2aee88){return function(_0x1e825e){if(_0x1e825e){return _0x1e825e[_0x0a4f('0x12')]()[_0x0a4f('0x11')](function(){_0x2aee88[_0x0a4f('0x9')](0xcc)[_0x0a4f('0xa')]();});}};}function handleEntityNotFound(_0x3658ae){return function(_0x17498e){if(!_0x17498e){_0x3658ae[_0x0a4f('0x8')](0x194);}return _0x17498e;};}function handleError(_0x42df4b,_0x1b4a5f){_0x1b4a5f=_0x1b4a5f||0x1f4;return function(_0x58c193){logger[_0x0a4f('0x13')](_0x58c193[_0x0a4f('0x14')]);if(_0x58c193['name']){delete _0x58c193[_0x0a4f('0x15')];}_0x42df4b[_0x0a4f('0x9')](_0x1b4a5f)[_0x0a4f('0x16')](_0x58c193);};}function maskClientSecret(_0x16d165){return _['padEnd'](_0x16d165['slice'](0x0,0x3),0x14,'*');}exports['index']=function(_0x178511,_0xe9cd7e){var _0x52357b={},_0x1fa74b={},_0x5c235d={'count':0x0,'rows':[]};var _0x34cd08=_[_0x0a4f('0x17')](db[_0x0a4f('0x18')][_0x0a4f('0x19')],function(_0xb48d55){return{'name':_0xb48d55[_0x0a4f('0x1a')],'type':_0xb48d55[_0x0a4f('0x1b')]['key']};});_0x1fa74b[_0x0a4f('0x1c')]=_[_0x0a4f('0x17')](_0x34cd08,'name');_0x1fa74b['query']=_[_0x0a4f('0x1d')](_0x178511[_0x0a4f('0x1e')]);_0x1fa74b[_0x0a4f('0x1f')]=_[_0x0a4f('0x20')](_0x1fa74b[_0x0a4f('0x1c')],_0x1fa74b[_0x0a4f('0x1e')]);_0x52357b[_0x0a4f('0x21')]=_['intersection'](_0x1fa74b[_0x0a4f('0x1c')],qs[_0x0a4f('0x22')](_0x178511[_0x0a4f('0x1e')][_0x0a4f('0x22')]));_0x52357b['attributes']=_0x52357b[_0x0a4f('0x21')][_0x0a4f('0x23')]?_0x52357b[_0x0a4f('0x21')]:_0x1fa74b[_0x0a4f('0x1c')];if(!_0x178511[_0x0a4f('0x1e')]['hasOwnProperty'](_0x0a4f('0x24'))){_0x52357b['limit']=qs['limit'](_0x178511[_0x0a4f('0x1e')][_0x0a4f('0xd')]);_0x52357b[_0x0a4f('0xb')]=qs[_0x0a4f('0xb')](_0x178511['query'][_0x0a4f('0xb')]);}_0x52357b[_0x0a4f('0x25')]=qs['sort'](_0x178511[_0x0a4f('0x1e')][_0x0a4f('0x26')]);_0x52357b[_0x0a4f('0x27')]=qs[_0x0a4f('0x1f')](_['pick'](_0x178511[_0x0a4f('0x1e')],_0x1fa74b[_0x0a4f('0x1f')]),_0x34cd08);if(_0x178511[_0x0a4f('0x1e')][_0x0a4f('0x28')]){_0x52357b['where']=_[_0x0a4f('0x29')](_0x52357b[_0x0a4f('0x27')],{'$or':_['map'](_0x34cd08,function(_0x1f79a4){if(_0x1f79a4[_0x0a4f('0x1b')]!==_0x0a4f('0x2a')){var _0x519d42={};_0x519d42[_0x1f79a4[_0x0a4f('0x15')]]={'$like':'%'+_0x178511[_0x0a4f('0x1e')][_0x0a4f('0x28')]+'%'};return _0x519d42;}})});}_0x52357b=_[_0x0a4f('0x29')]({},_0x52357b,_0x178511[_0x0a4f('0x2b')]);var _0x39996d={'where':_0x52357b[_0x0a4f('0x27')]};return db[_0x0a4f('0x18')]['count'](_0x39996d)[_0x0a4f('0x11')](function(_0x4413a3){_0x5c235d['count']=_0x4413a3;if(_0x178511['query']['includeAll']){_0x52357b['include']=[{'all':!![]}];}return db['CloudProvider']['findAll'](_0x52357b);})['then'](function(_0x81a892){_0x5c235d[_0x0a4f('0x2c')]=_['map'](_0x81a892,function(_0x58ee37){if(_0x58ee37['service']===_0x0a4f('0x2d')){var _0x4cf25f=encryptor[_0x0a4f('0x2e')](_0x58ee37[_0x0a4f('0x2f')]);_0x58ee37['data3']=maskClientSecret(_0x4cf25f);}return _0x58ee37;});return _0x5c235d;})[_0x0a4f('0x11')](respondWithFilteredResult(_0xe9cd7e,_0x52357b))['catch'](handleError(_0xe9cd7e,null));};exports[_0x0a4f('0x30')]=function(_0x2bd3bd,_0x17b12d){var _0x26c9b2={'raw':!![],'where':{'id':_0x2bd3bd[_0x0a4f('0x31')]['id']}},_0x4a528e={};_0x4a528e[_0x0a4f('0x1c')]=_['keys'](db[_0x0a4f('0x18')][_0x0a4f('0x19')]);_0x4a528e[_0x0a4f('0x1e')]=_[_0x0a4f('0x1d')](_0x2bd3bd[_0x0a4f('0x1e')]);_0x4a528e[_0x0a4f('0x1f')]=_[_0x0a4f('0x20')](_0x4a528e[_0x0a4f('0x1c')],_0x4a528e['query']);_0x26c9b2[_0x0a4f('0x21')]=_[_0x0a4f('0x20')](_0x4a528e[_0x0a4f('0x1c')],qs['fields'](_0x2bd3bd[_0x0a4f('0x1e')][_0x0a4f('0x22')]));_0x26c9b2[_0x0a4f('0x21')]=_0x26c9b2[_0x0a4f('0x21')][_0x0a4f('0x23')]?_0x26c9b2[_0x0a4f('0x21')]:_0x4a528e[_0x0a4f('0x1c')];if(_0x2bd3bd[_0x0a4f('0x1e')][_0x0a4f('0x32')]){_0x26c9b2[_0x0a4f('0x33')]=[{'all':!![]}];}_0x26c9b2=_[_0x0a4f('0x29')]({},_0x26c9b2,_0x2bd3bd[_0x0a4f('0x2b')]);return db[_0x0a4f('0x18')]['find'](_0x26c9b2)['then'](handleEntityNotFound(_0x17b12d,null))['then'](function(_0x391375){if(_0x391375[_0x0a4f('0x34')]===_0x0a4f('0x2d')){var _0x16f5df=encryptor[_0x0a4f('0x2e')](_0x391375[_0x0a4f('0x2f')]);_0x391375[_0x0a4f('0x2f')]=maskClientSecret(_0x16f5df);}return _0x391375;})[_0x0a4f('0x11')](respondWithResult(_0x17b12d,null))['catch'](handleError(_0x17b12d,null));};exports[_0x0a4f('0x35')]=function(_0x3bbdec,_0x5475dd){if(!_0x3bbdec[_0x0a4f('0x36')][_0x0a4f('0x15')])throw new Error('Name\x20parameter\x20not\x20specified');if(!_0x3bbdec[_0x0a4f('0x36')][_0x0a4f('0x34')])throw new Error('Service\x20parameter\x20not\x20specified');var _0x60adb6=db[_0x0a4f('0x18')][_0x0a4f('0x19')][_0x0a4f('0x34')]['values'];if(!_0x60adb6[_0x0a4f('0x37')](_0x3bbdec['body']['service']))throw new Error('Invalid\x20service\x20parameter.\x20Allowed\x20values:\x20'+_0x60adb6[_0x0a4f('0x38')](',\x20'));if(_0x3bbdec[_0x0a4f('0x36')][_0x0a4f('0x34')]===_0x0a4f('0x2d')&&_0x3bbdec['body']['data3']){_0x3bbdec['body']['data3']=encryptor['encryptString'](_0x3bbdec[_0x0a4f('0x36')][_0x0a4f('0x2f')]);}return db['CloudProvider'][_0x0a4f('0x35')](_0x3bbdec[_0x0a4f('0x36')],{})[_0x0a4f('0x11')](respondWithResult(_0x5475dd,0xc9))['catch'](handleError(_0x5475dd,null));};exports[_0x0a4f('0x39')]=function(_0xd1ca4f,_0x13fadf){if(_0xd1ca4f[_0x0a4f('0x36')]['id']){delete _0xd1ca4f[_0x0a4f('0x36')]['id'];}return db[_0x0a4f('0x18')][_0x0a4f('0x3a')]({'where':{'id':_0xd1ca4f[_0x0a4f('0x31')]['id']}})[_0x0a4f('0x11')](handleEntityNotFound(_0x13fadf,null))[_0x0a4f('0x11')](function(_0x400afa){if(_0x400afa[_0x0a4f('0x34')]===_0x0a4f('0x2d')&&_0xd1ca4f[_0x0a4f('0x36')][_0x0a4f('0x2f')]){_0xd1ca4f[_0x0a4f('0x36')]['data3']=encryptor[_0x0a4f('0x3b')](_0xd1ca4f[_0x0a4f('0x36')][_0x0a4f('0x2f')]);}return _0x400afa;})[_0x0a4f('0x11')](saveUpdates(_0xd1ca4f['body'],null))[_0x0a4f('0x11')](respondWithResult(_0x13fadf,null))[_0x0a4f('0x3c')](handleError(_0x13fadf,null));};exports[_0x0a4f('0x12')]=function(_0x377333,_0x5b1378){return db[_0x0a4f('0x18')][_0x0a4f('0x3a')]({'where':{'id':_0x377333[_0x0a4f('0x31')]['id']}})[_0x0a4f('0x11')](handleEntityNotFound(_0x5b1378,null))[_0x0a4f('0x11')](removeEntity(_0x5b1378,null))[_0x0a4f('0x3c')](handleError(_0x5b1378,null));};exports['oauth2MicrosoftAuthorize']=function(_0x301aeb,_0x9c509c){return db[_0x0a4f('0x18')][_0x0a4f('0x3d')]({'where':{'id':_0x301aeb[_0x0a4f('0x31')]['id']},'raw':!![]})[_0x0a4f('0x11')](function(_0x37189d){if(!_0x37189d)return _0x9c509c[_0x0a4f('0x8')](0x194);return{'url':oauth['generateMicrosoftAuthorizationUrl'](_0x37189d,_0x301aeb['user']['id'])};})['then'](respondWithResult(_0x9c509c,null))['catch'](handleError(_0x9c509c,null));};exports[_0x0a4f('0x3e')]=function(_0x1167c8,_0x459f5c){var _0xc940fb=_0x1167c8[_0x0a4f('0x36')];var _0x315f5b;var _0x3c2ef2;if(_0xc940fb[_0x0a4f('0x13')])throw _0xc940fb;redis[_0x0a4f('0x3f')](_0xc940fb[_0x0a4f('0x40')])[_0x0a4f('0x11')](function(_0x41d012){if(!_0x41d012)throw new Error(_0x0a4f('0x41'));_0x315f5b=JSON[_0x0a4f('0x42')](_0x41d012);var _0x3cee6e=Buffer[_0x0a4f('0x43')](_0xc940fb[_0x0a4f('0x40')],_0x0a4f('0x44'))['toString']('ascii');_0x3c2ef2=JSON[_0x0a4f('0x42')](_0x3cee6e);if(!oauth[_0x0a4f('0x45')](_0xc940fb['id_token'],_0x315f5b[_0x0a4f('0x46')]))throw new Error(_0x0a4f('0x47'));redis[_0x0a4f('0x48')](_0xc940fb[_0x0a4f('0x40')]);return oauth[_0x0a4f('0x49')](_0xc940fb[_0x0a4f('0x4a')],_0x315f5b);})[_0x0a4f('0x11')](function(_0x3a8ec8){_0x315f5b[_0x0a4f('0x4b')]=_0x3a8ec8[_0x0a4f('0x4c')];_0x315f5b['data6']=_0x3a8ec8[_0x0a4f('0x4d')];return db[_0x0a4f('0x18')]['update']({'data5':_0x315f5b[_0x0a4f('0x4b')],'data6':_0x315f5b[_0x0a4f('0x4e')]},{'where':{'id':_0x315f5b['id']}});})[_0x0a4f('0x11')](function(){oauth[_0x0a4f('0x4f')](_0x315f5b);socket[_0x0a4f('0x50')](_0x0a4f('0x51'),{'id':_0x3c2ef2['id']});return;})[_0x0a4f('0x11')](respondWithStatusCode(_0x459f5c,null))[_0x0a4f('0x3c')](function(_0x593071){if(_0x3c2ef2){socket[_0x0a4f('0x50')](_0x0a4f('0x52'),{'id':_0x3c2ef2['id']});}if(!_0x315f5b){logger[_0x0a4f('0x13')](_0x0a4f('0x53'),_0x593071);return _0x459f5c[_0x0a4f('0x9')](0x1f4)[_0x0a4f('0x16')](_0x593071[_0x0a4f('0x54')]);}logger[_0x0a4f('0x13')](_0x0a4f('0x55'),_0x315f5b['id'],JSON[_0x0a4f('0x56')](_0x593071));});};
\ No newline at end of file
diff --git a/server/api/cloudProvider/cloudProvider.model.js b/server/api/cloudProvider/cloudProvider.model.js
index b2735ed..0839d1f 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 _0xffd3=['CloudProvider','cloud_providers','util','api','moment','request-promise','path','rimraf','exports','define'];(function(_0x57dcad,_0x237449){var _0x4c968a=function(_0x2379dd){while(--_0x2379dd){_0x57dcad['push'](_0x57dcad['shift']());}};_0x4c968a(++_0x237449);}(_0xffd3,0x142));var _0x3ffd=function(_0x3a2b24,_0x401b6c){_0x3a2b24=_0x3a2b24-0x0;var _0x37e45b=_0xffd3[_0x3a2b24];return _0x37e45b;};'use strict';var _=require('lodash');var util=require(_0x3ffd('0x0'));var logger=require('../../config/logger')(_0x3ffd('0x1'));var moment=require(_0x3ffd('0x2'));var BPromise=require('bluebird');var rp=require(_0x3ffd('0x3'));var fs=require('fs');var path=require(_0x3ffd('0x4'));var rimraf=require(_0x3ffd('0x5'));var config=require('../../config/environment');var attributes=require('./cloudProvider.attributes');module[_0x3ffd('0x6')]=function(_0x14a613,_0x2990a0){return _0x14a613[_0x3ffd('0x7')](_0x3ffd('0x8'),attributes,{'tableName':_0x3ffd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0xfe3e=['moment','request-promise','path','rimraf','../../config/environment','./cloudProvider.attributes','define','CloudProvider','cloud_providers','lodash','util','api'];(function(_0x247f68,_0x5c7cd1){var _0x110f6b=function(_0xe994fa){while(--_0xe994fa){_0x247f68['push'](_0x247f68['shift']());}};_0x110f6b(++_0x5c7cd1);}(_0xfe3e,0x81));var _0xefe3=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfe3e[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0xefe3('0x0'));var util=require(_0xefe3('0x1'));var logger=require('../../config/logger')(_0xefe3('0x2'));var moment=require(_0xefe3('0x3'));var BPromise=require('bluebird');var rp=require(_0xefe3('0x4'));var fs=require('fs');var path=require(_0xefe3('0x5'));var rimraf=require(_0xefe3('0x6'));var config=require(_0xefe3('0x7'));var attributes=require(_0xefe3('0x8'));module['exports']=function(_0x3e46dd,_0x5de65e){return _0x3e46dd[_0xefe3('0x9')](_0xefe3('0xa'),attributes,{'tableName':_0xefe3('0xb'),'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 264dfe4..5a6d985 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 _0x7afe=['data5','access_token','data6','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','data4','intervals','bind','findAll','map','all','catch','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','exports','jsonwebtoken','moment','request-promise','util','../../components/encryptor','../../config/environment','../../config/logger','api','../../mysqldb','redis','defaults','localhost','https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0','profile','email','offline_access','https://outlook.office365.com/IMAP.AccessAsUser.All','https://outlook.office.com/SMTP.Send','openid','/authorize','/token','type','Dynamics365','/.default','Outlook365','data7','replace','{TENANT_ID}','data2','code','id_token','from','stringify','base64','randomBytes','hex','response_type','join','redirect_uri','form_post','scope','state','nonce','prompt','login','key','oauth2/','data1','set','decode','payload','iss','issuer','aud','audience','isAfter','unix','exp','resolve','then','data3','CloudProvider','findOne','refresh_token','decryptString','POST'];(function(_0x81dfb5,_0x3545ca){var _0x1d7853=function(_0x51c1ee){while(--_0x51c1ee){_0x81dfb5['push'](_0x81dfb5['shift']());}};_0x1d7853(++_0x3545ca);}(_0x7afe,0x153));var _0xe7af=function(_0x15fd2c,_0x2efe29){_0x15fd2c=_0x15fd2c-0x0;var _0x314c47=_0x7afe[_0x15fd2c];return _0x314c47;};'use strict';var _=require('lodash');var crypto=require('crypto');var jwt=require(_0xe7af('0x0'));var moment=require(_0xe7af('0x1'));var Redis=require('ioredis');var rp=require(_0xe7af('0x2'));var util=require(_0xe7af('0x3'));var encryptor=require(_0xe7af('0x4'));var config=require(_0xe7af('0x5'));var logger=require(_0xe7af('0x6'))(_0xe7af('0x7'));var schedule=require('../../config/schedule/cloud-provider');var db=require(_0xe7af('0x8'))['db'];config[_0xe7af('0x9')]=_[_0xe7af('0xa')](config[_0xe7af('0x9')],{'host':_0xe7af('0xb'),'port':0x18eb});var redis=new Redis(config[_0xe7af('0x9')]);var MICROSOFT_AUTH_URL=_0xe7af('0xc');var AZURE_AUTH_SCOPES={'Outlook365':['openid',_0xe7af('0xd'),_0xe7af('0xe'),_0xe7af('0xf'),_0xe7af('0x10'),'https://outlook.office.com/POP.AccessAsUser.All',_0xe7af('0x11')],'Dynamics365':[_0xe7af('0x12'),'offline_access']};var MICROSOFT_AUTH_ENDPOINT=_0xe7af('0x13');var MICROSOFT_TOKEN_ENDPOINT=_0xe7af('0x14');var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x4abc3b){var _0x434dc1=_['map'](AZURE_AUTH_SCOPES[_0x4abc3b[_0xe7af('0x15')]]);if(_0x4abc3b[_0xe7af('0x15')]===_0xe7af('0x16'))_0x434dc1['push'](_0x4abc3b['data7']+_0xe7af('0x17'));return _0x434dc1['join']('\x20');}function getAccessTokenScope(_0x1b6255){if(_0x1b6255[_0xe7af('0x15')]===_0xe7af('0x18'))return _0xe7af('0x10');if(_0x1b6255[_0xe7af('0x15')]===_0xe7af('0x16'))return _0x1b6255[_0xe7af('0x19')]+'/.default';}function generateMicrosoftAuthorizationUrl(_0x5a29b1,_0x823f37){var _0x332a4c=MICROSOFT_AUTH_URL[_0xe7af('0x1a')](_0xe7af('0x1b'),_0x5a29b1[_0xe7af('0x1c')]);var _0x3ae911=[_0xe7af('0x1d'),_0xe7af('0x1e')];var _0x1ccf5b=Buffer[_0xe7af('0x1f')](JSON[_0xe7af('0x20')]({'id':_0x823f37}))['toString'](_0xe7af('0x21'));var _0x6b04fb=crypto[_0xe7af('0x22')](0x10)['toString'](_0xe7af('0x23'));var _0x257239=getAuthorizationScopes(_0x5a29b1);var _0x402292=[{'key':'client_id','value':_0x5a29b1['data1']},{'key':_0xe7af('0x24'),'value':encodeURIComponent(_0x3ae911[_0xe7af('0x25')]('\x20'))},{'key':_0xe7af('0x26'),'value':_0x5a29b1['data4']},{'key':'response_mode','value':_0xe7af('0x27')},{'key':_0xe7af('0x28'),'value':encodeURIComponent(_0x257239)},{'key':_0xe7af('0x29'),'value':_0x1ccf5b},{'key':_0xe7af('0x2a'),'value':_0x6b04fb},{'key':_0xe7af('0x2b'),'value':_0xe7af('0x2c')}];var _0x3e575e=_0x332a4c+MICROSOFT_AUTH_ENDPOINT+'?'+_['map'](_0x402292,function(_0x172470){return _0x172470[_0xe7af('0x2d')]+'='+_0x172470['value'];})[_0xe7af('0x25')]('&');_0x5a29b1['oauth2Claims']={'issuer':_0x332a4c[_0xe7af('0x1a')](_0xe7af('0x2e'),''),'audience':_0x5a29b1[_0xe7af('0x2f')],'state':_0x1ccf5b,'nonce':_0x6b04fb};redis[_0xe7af('0x30')](_0x1ccf5b,JSON['stringify'](_0x5a29b1));return _0x3e575e;}function isValidIdToken(_0x24715f,_0x34407a){try{var _0x212354=jwt[_0xe7af('0x31')](_0x24715f,{'complete':!![]});var _0x46002f=_0x212354[_0xe7af('0x32')];if(_0x46002f[_0xe7af('0x33')]!==_0x34407a[_0xe7af('0x34')])return![];if(_0x46002f[_0xe7af('0x35')]!==_0x34407a[_0xe7af('0x36')])return![];if(_0x46002f[_0xe7af('0x2a')]!==_0x34407a['nonce'])return![];if(moment()[_0xe7af('0x37')](moment[_0xe7af('0x38')](_0x46002f[_0xe7af('0x39')])))return![];return!![];}catch(_0x30664e){throw _0x30664e;}}function refreshOauth2MicrosoftAccessToken(_0x2349f8){return Promise[_0xe7af('0x3a')]()[_0xe7af('0x3b')](function(){if(_0x2349f8[_0xe7af('0x3c')])return _0x2349f8;return db[_0xe7af('0x3d')][_0xe7af('0x3e')]({'where':{'id':_0x2349f8['id']},'raw':!![]});})[_0xe7af('0x3b')](function(_0x2e6fa3){var _0x260890={'grant_type':_0xe7af('0x3f'),'refresh_token':_0x2e6fa3['data6'],'scope':getAccessTokenScope(_0x2e6fa3),'redirect_uri':_0x2e6fa3['data4'],'client_id':_0x2e6fa3['data1'],'client_secret':encryptor[_0xe7af('0x40')](_0x2e6fa3['data3'])};var _0x2af8fe={'method':_0xe7af('0x41'),'uri':MICROSOFT_AUTH_URL[_0xe7af('0x1a')](_0xe7af('0x1b'),_0x2e6fa3[_0xe7af('0x1c')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x260890,'json':!![]};return rp(_0x2af8fe);})['then'](function(_0x4c7c6d){_0x2349f8[_0xe7af('0x42')]=_0x4c7c6d[_0xe7af('0x43')];_0x2349f8[_0xe7af('0x44')]=_0x4c7c6d['refresh_token'];return db[_0xe7af('0x3d')][_0xe7af('0x45')]({'data5':_0x2349f8['data5'],'data6':_0x2349f8[_0xe7af('0x44')]},{'where':{'id':_0x2349f8['id']}});})['then'](function(){return _0x2349f8;})['catch'](function(_0x38e063){logger[_0xe7af('0x46')](_0xe7af('0x47'),_0x2349f8['id'],_0x38e063);});}function getOauth2MicrosoftAccessToken(_0x34594e,_0x4ac5b8){var _0x3420cc={'grant_type':'authorization_code','code':_0x34594e,'scope':getAccessTokenScope(_0x4ac5b8),'redirect_uri':_0x4ac5b8[_0xe7af('0x48')],'client_id':_0x4ac5b8[_0xe7af('0x2f')],'client_secret':encryptor[_0xe7af('0x40')](_0x4ac5b8[_0xe7af('0x3c')])};var _0xbc6c7c={'method':_0xe7af('0x41'),'uri':MICROSOFT_AUTH_URL['replace'](_0xe7af('0x1b'),_0x4ac5b8['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x3420cc,'json':!![]};return rp(_0xbc6c7c);}function startRefreshInterval(_0x8db681){var _0x20bcef=schedule[_0xe7af('0x49')];if(_0x20bcef[_0x8db681['id']])clearInterval(_0x20bcef[_0x8db681['id']]);_0x20bcef[_0x8db681['id']]=setInterval(refreshOauth2MicrosoftAccessToken[_0xe7af('0x4a')](this,{'id':_0x8db681['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0xe7af('0x49')]=_0x20bcef;}function startAllRefreshIntervals(){return db[_0xe7af('0x3d')][_0xe7af('0x4b')]({'where':{'data6':{'$ne':null}},'raw':!![]})[_0xe7af('0x3b')](function(_0x325181){var _0x28665a=_0x325181[_0xe7af('0x4c')](function(_0x546524){return refreshOauth2MicrosoftAccessToken(_0x546524)['then'](function(_0x28729f){startRefreshInterval(_0x28729f);});});return Promise[_0xe7af('0x4d')](_0x28665a);})[_0xe7af('0x4e')](function(_0x3e8a15){var _0x7bb0b2=_0x3e8a15?util['inspect'](_0x3e8a15,{'showHidden':![],'depth':null}):'';logger[_0xe7af('0x46')](_0xe7af('0x4f'),_0x7bb0b2);});}module[_0xe7af('0x50')]={'generateMicrosoftAuthorizationUrl':generateMicrosoftAuthorizationUrl,'getOauth2MicrosoftAccessToken':getOauth2MicrosoftAccessToken,'isValidIdToken':isValidIdToken,'startAllRefreshIntervals':startAllRefreshIntervals,'refreshOauth2MicrosoftAccessToken':refreshOauth2MicrosoftAccessToken,'startRefreshInterval':startRefreshInterval};
\ No newline at end of file
+var _0x9534=['oauth2Claims','oauth2/','decode','payload','iss','issuer','aud','audience','isAfter','unix','resolve','CloudProvider','findOne','then','data6','data4','POST','{TENANT_ID}','data5','access_token','refresh_token','update','error','Failed\x20to\x20refresh\x20access\x20token\x20for\x20cloud\x20provider\x20#%s,\x20-\x20err:%s','authorization_code','intervals','catch','inspect','[CLOUD_PROVIDER]\x20Error\x20while\x20refreshing\x20the\x20tokens\x20after\x20service\x20restart\x20error:%s','lodash','jsonwebtoken','moment','ioredis','util','../../components/encryptor','api','../../config/schedule/cloud-provider','../../mysqldb','redis','defaults','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','map','type','Dynamics365','push','data7','join','Outlook365','/.default','replace','data2','code','id_token','from','stringify','toString','base64','randomBytes','hex','data1','redirect_uri','response_mode','form_post','scope','state','nonce','prompt','value'];(function(_0x5e8eaa,_0x594767){var _0x1cbf39=function(_0x5c70b7){while(--_0x5c70b7){_0x5e8eaa['push'](_0x5e8eaa['shift']());}};_0x1cbf39(++_0x594767);}(_0x9534,0xfb));var _0x4953=function(_0x4a906f,_0x45b442){_0x4a906f=_0x4a906f-0x0;var _0x291ca2=_0x9534[_0x4a906f];return _0x291ca2;};'use strict';var _=require(_0x4953('0x0'));var crypto=require('crypto');var jwt=require(_0x4953('0x1'));var moment=require(_0x4953('0x2'));var Redis=require(_0x4953('0x3'));var rp=require('request-promise');var util=require(_0x4953('0x4'));var encryptor=require(_0x4953('0x5'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x4953('0x6'));var schedule=require(_0x4953('0x7'));var db=require(_0x4953('0x8'))['db'];config[_0x4953('0x9')]=_[_0x4953('0xa')](config[_0x4953('0x9')],{'host':'localhost','port':0x18eb});var redis=new Redis(config['redis']);var MICROSOFT_AUTH_URL='https://login.microsoftonline.com/{TENANT_ID}/oauth2/v2.0';var AZURE_AUTH_SCOPES={'Outlook365':[_0x4953('0xb'),_0x4953('0xc'),_0x4953('0xd'),_0x4953('0xe'),_0x4953('0xf'),_0x4953('0x10'),_0x4953('0x11')],'Dynamics365':[_0x4953('0xb'),_0x4953('0xe')]};var MICROSOFT_AUTH_ENDPOINT='/authorize';var MICROSOFT_TOKEN_ENDPOINT='/token';var OAUTH_REFRESH_INTERVAL=0xfa;function getAuthorizationScopes(_0x399132){var _0x37196e=_[_0x4953('0x12')](AZURE_AUTH_SCOPES[_0x399132['type']]);if(_0x399132[_0x4953('0x13')]===_0x4953('0x14'))_0x37196e[_0x4953('0x15')](_0x399132[_0x4953('0x16')]+'/.default');return _0x37196e[_0x4953('0x17')]('\x20');}function getAccessTokenScope(_0x1969ea){if(_0x1969ea['type']===_0x4953('0x18'))return _0x4953('0xf');if(_0x1969ea[_0x4953('0x13')]===_0x4953('0x14'))return _0x1969ea[_0x4953('0x16')]+_0x4953('0x19');}function generateMicrosoftAuthorizationUrl(_0x1e32ba,_0x10f9e7){var _0x5eb417=MICROSOFT_AUTH_URL[_0x4953('0x1a')]('{TENANT_ID}',_0x1e32ba[_0x4953('0x1b')]);var _0x1818a4=[_0x4953('0x1c'),_0x4953('0x1d')];var _0x370a54=Buffer[_0x4953('0x1e')](JSON[_0x4953('0x1f')]({'id':_0x10f9e7}))[_0x4953('0x20')](_0x4953('0x21'));var _0x5779e1=crypto[_0x4953('0x22')](0x10)[_0x4953('0x20')](_0x4953('0x23'));var _0x42c116=getAuthorizationScopes(_0x1e32ba);var _0x1d4ecf=[{'key':'client_id','value':_0x1e32ba[_0x4953('0x24')]},{'key':'response_type','value':encodeURIComponent(_0x1818a4[_0x4953('0x17')]('\x20'))},{'key':_0x4953('0x25'),'value':_0x1e32ba['data4']},{'key':_0x4953('0x26'),'value':_0x4953('0x27')},{'key':_0x4953('0x28'),'value':encodeURIComponent(_0x42c116)},{'key':_0x4953('0x29'),'value':_0x370a54},{'key':_0x4953('0x2a'),'value':_0x5779e1},{'key':_0x4953('0x2b'),'value':'login'}];var _0x555ce5=_0x5eb417+MICROSOFT_AUTH_ENDPOINT+'?'+_[_0x4953('0x12')](_0x1d4ecf,function(_0x1f3f14){return _0x1f3f14['key']+'='+_0x1f3f14[_0x4953('0x2c')];})[_0x4953('0x17')]('&');_0x1e32ba[_0x4953('0x2d')]={'issuer':_0x5eb417[_0x4953('0x1a')](_0x4953('0x2e'),''),'audience':_0x1e32ba[_0x4953('0x24')],'state':_0x370a54,'nonce':_0x5779e1};redis['set'](_0x370a54,JSON['stringify'](_0x1e32ba));return _0x555ce5;}function isValidIdToken(_0x51715a,_0x2970d1){try{var _0x1e463d=jwt[_0x4953('0x2f')](_0x51715a,{'complete':!![]});var _0x58e29f=_0x1e463d[_0x4953('0x30')];if(_0x58e29f[_0x4953('0x31')]!==_0x2970d1[_0x4953('0x32')])return![];if(_0x58e29f[_0x4953('0x33')]!==_0x2970d1[_0x4953('0x34')])return![];if(_0x58e29f[_0x4953('0x2a')]!==_0x2970d1[_0x4953('0x2a')])return![];if(moment()[_0x4953('0x35')](moment[_0x4953('0x36')](_0x58e29f['exp'])))return![];return!![];}catch(_0x3905f8){throw _0x3905f8;}}function refreshOauth2MicrosoftAccessToken(_0x264e9a){return Promise[_0x4953('0x37')]()['then'](function(){if(_0x264e9a['data3'])return _0x264e9a;return db[_0x4953('0x38')][_0x4953('0x39')]({'where':{'id':_0x264e9a['id']},'raw':!![]});})[_0x4953('0x3a')](function(_0x27363c){var _0x5f10d3={'grant_type':'refresh_token','refresh_token':_0x27363c[_0x4953('0x3b')],'scope':getAccessTokenScope(_0x27363c),'redirect_uri':_0x27363c[_0x4953('0x3c')],'client_id':_0x27363c[_0x4953('0x24')],'client_secret':encryptor['decryptString'](_0x27363c['data3'])};var _0x1918e9={'method':_0x4953('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x4953('0x1a')](_0x4953('0x3e'),_0x27363c['data2'])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x5f10d3,'json':!![]};return rp(_0x1918e9);})[_0x4953('0x3a')](function(_0x5758dc){_0x264e9a[_0x4953('0x3f')]=_0x5758dc[_0x4953('0x40')];_0x264e9a[_0x4953('0x3b')]=_0x5758dc[_0x4953('0x41')];return db[_0x4953('0x38')][_0x4953('0x42')]({'data5':_0x264e9a[_0x4953('0x3f')],'data6':_0x264e9a[_0x4953('0x3b')]},{'where':{'id':_0x264e9a['id']}});})[_0x4953('0x3a')](function(){return _0x264e9a;})['catch'](function(_0x4cbfef){logger[_0x4953('0x43')](_0x4953('0x44'),_0x264e9a['id'],_0x4cbfef);});}function getOauth2MicrosoftAccessToken(_0xde43c0,_0x2a6223){var _0x17c9cf={'grant_type':_0x4953('0x45'),'code':_0xde43c0,'scope':getAccessTokenScope(_0x2a6223),'redirect_uri':_0x2a6223[_0x4953('0x3c')],'client_id':_0x2a6223['data1'],'client_secret':encryptor['decryptString'](_0x2a6223['data3'])};var _0x4b792a={'method':_0x4953('0x3d'),'uri':MICROSOFT_AUTH_URL[_0x4953('0x1a')](_0x4953('0x3e'),_0x2a6223[_0x4953('0x1b')])+MICROSOFT_TOKEN_ENDPOINT,'form':_0x17c9cf,'json':!![]};return rp(_0x4b792a);}function startRefreshInterval(_0x51d559){var _0x5ac87f=schedule[_0x4953('0x46')];if(_0x5ac87f[_0x51d559['id']])clearInterval(_0x5ac87f[_0x51d559['id']]);_0x5ac87f[_0x51d559['id']]=setInterval(refreshOauth2MicrosoftAccessToken['bind'](this,{'id':_0x51d559['id']}),OAUTH_REFRESH_INTERVAL*0x3e8);schedule[_0x4953('0x46')]=_0x5ac87f;}function startAllRefreshIntervals(){return db[_0x4953('0x38')]['findAll']({'where':{'data6':{'$ne':null}},'raw':!![]})[_0x4953('0x3a')](function(_0x30f4bd){var _0x3b405e=_0x30f4bd[_0x4953('0x12')](function(_0x16e246){return refreshOauth2MicrosoftAccessToken(_0x16e246)[_0x4953('0x3a')](function(_0x54ca12){startRefreshInterval(_0x54ca12);});});return Promise['all'](_0x3b405e);})[_0x4953('0x47')](function(_0x51087c){var _0x59c809=_0x51087c?util[_0x4953('0x48')](_0x51087c,{'showHidden':![],'depth':null}):'';logger[_0x4953('0x43')](_0x4953('0x49'),_0x59c809);});}module['exports']={'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 283250f..766a923 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 _0x6d11=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','then','info','CloudProvider,\x20%s,\x20%s','debug','CloudProvider,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x47c1f2,_0x234b80){var _0x29ec31=function(_0x3c57a1){while(--_0x3c57a1){_0x47c1f2['push'](_0x47c1f2['shift']());}};_0x29ec31(++_0x234b80);}(_0x6d11,0xbf));var _0x16d1=function(_0x47baed,_0x55d257){_0x47baed=_0x47baed-0x0;var _0x32cd90=_0x6d11[_0x47baed];return _0x32cd90;};'use strict';var _=require(_0x16d1('0x0'));var util=require(_0x16d1('0x1'));var moment=require(_0x16d1('0x2'));var BPromise=require('bluebird');var rs=require(_0x16d1('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x16d1('0x4'))['db'];var utils=require(_0x16d1('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x16d1('0x6'));var jayson=require(_0x16d1('0x7'));var client=jayson[_0x16d1('0x8')][_0x16d1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1009dc,_0x150217,_0x19390d){return new BPromise(function(_0x5d0e3f,_0x58a7a2){return client['request'](_0x1009dc,_0x19390d)[_0x16d1('0xa')](function(_0xcfbb15){logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,'request\x20sent');logger[_0x16d1('0xd')](_0x16d1('0xe'),_0x150217,_0x16d1('0xf'),JSON[_0x16d1('0x10')](_0xcfbb15));if(_0xcfbb15[_0x16d1('0x11')]){if(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x12')]===0x1f4){logger[_0x16d1('0x11')]('CloudProvider,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x58a7a2(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}logger[_0x16d1('0x11')]('CloudProvider,\x20%s,\x20%s',_0x150217,_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);return _0x5d0e3f(_0xcfbb15[_0x16d1('0x11')][_0x16d1('0x13')]);}else{logger[_0x16d1('0xb')](_0x16d1('0xc'),_0x150217,_0x16d1('0xf'));_0x5d0e3f(_0xcfbb15['result'][_0x16d1('0x13')]);}})[_0x16d1('0x14')](function(_0x555b2d){logger['error'](_0x16d1('0xc'),_0x150217,_0x555b2d);_0x58a7a2(_0x555b2d);});});}
\ No newline at end of file
+var _0xafcd=['debug','CloudProvider,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','CloudProvider,\x20%s,\x20%s','request\x20sent'];(function(_0x49b263,_0x1df0c1){var _0x26e630=function(_0x3c5c55){while(--_0x3c5c55){_0x49b263['push'](_0x49b263['shift']());}};_0x26e630(++_0x1df0c1);}(_0xafcd,0x157));var _0xdafc=function(_0x12a04a,_0x4e3d1a){_0x12a04a=_0x12a04a-0x0;var _0x6d5409=_0xafcd[_0x12a04a];return _0x6d5409;};'use strict';var _=require(_0xdafc('0x0'));var util=require(_0xdafc('0x1'));var moment=require(_0xdafc('0x2'));var BPromise=require(_0xdafc('0x3'));var rs=require(_0xdafc('0x4'));var fs=require('fs');var Redis=require(_0xdafc('0x5'));var db=require(_0xdafc('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xdafc('0x7'))(_0xdafc('0x8'));var config=require(_0xdafc('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xdafc('0xa')][_0xdafc('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33adc9,_0x52872c,_0x24f2e7){return new BPromise(function(_0x255125,_0x397db6){return client[_0xdafc('0xc')](_0x33adc9,_0x24f2e7)[_0xdafc('0xd')](function(_0x241787){logger[_0xdafc('0xe')](_0xdafc('0xf'),_0x52872c,_0xdafc('0x10'));logger[_0xdafc('0x11')](_0xdafc('0x12'),_0x52872c,'request\x20sent',JSON['stringify'](_0x241787));if(_0x241787[_0xdafc('0x13')]){if(_0x241787[_0xdafc('0x13')][_0xdafc('0x14')]===0x1f4){logger[_0xdafc('0x13')](_0xdafc('0xf'),_0x52872c,_0x241787['error']['message']);return _0x397db6(_0x241787['error'][_0xdafc('0x15')]);}logger['error'](_0xdafc('0xf'),_0x52872c,_0x241787['error'][_0xdafc('0x15')]);return _0x255125(_0x241787[_0xdafc('0x13')][_0xdafc('0x15')]);}else{logger[_0xdafc('0xe')]('CloudProvider,\x20%s,\x20%s',_0x52872c,'request\x20sent');_0x255125(_0x241787[_0xdafc('0x16')][_0xdafc('0x15')]);}})[_0xdafc('0x17')](function(_0x5bfac1){logger['error'](_0xdafc('0xf'),_0x52872c,_0x5bfac1);_0x397db6(_0x5bfac1);});});}
\ No newline at end of file
diff --git a/server/api/cloudProvider/index.js b/server/api/cloudProvider/index.js
index b975e88..283cf3f 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 _0xdb28=['delete','destroy','/:id/oauth2/microsoft/authorize/','oauth2MicrosoftAuthorize','/oauth2/microsoft/callback','oauth2MicrosoftCallback','express','Router','../../components/auth/service','./cloudProvider.controller','isAuthenticated','index','get','/:id','post','update'];(function(_0x2d643f,_0x335fe6){var _0x23958b=function(_0x17e8fc){while(--_0x17e8fc){_0x2d643f['push'](_0x2d643f['shift']());}};_0x23958b(++_0x335fe6);}(_0xdb28,0x106));var _0x8db2=function(_0x19ccfb,_0x11d76e){_0x19ccfb=_0x19ccfb-0x0;var _0x3450c9=_0xdb28[_0x19ccfb];return _0x3450c9;};'use strict';var express=require(_0x8db2('0x0'));var router=express[_0x8db2('0x1')]();var auth=require(_0x8db2('0x2'));var controller=require(_0x8db2('0x3'));router['get']('/',auth[_0x8db2('0x4')](),controller[_0x8db2('0x5')]);router[_0x8db2('0x6')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller['show']);router[_0x8db2('0x8')]('/',auth[_0x8db2('0x4')](),controller['create']);router['put'](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0x9')]);router[_0x8db2('0xa')](_0x8db2('0x7'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xb')]);router['get'](_0x8db2('0xc'),auth[_0x8db2('0x4')](),controller[_0x8db2('0xd')]);router['post'](_0x8db2('0xe'),controller[_0x8db2('0xf')]);module['exports']=router;
\ No newline at end of file
+var _0xadb5=['put','update','delete','destroy','/:id/oauth2/microsoft/authorize/','/oauth2/microsoft/callback','oauth2MicrosoftCallback','exports','Router','./cloudProvider.controller','get','isAuthenticated','/:id','post','create'];(function(_0x29a0c9,_0x512058){var _0x173b36=function(_0x462743){while(--_0x462743){_0x29a0c9['push'](_0x29a0c9['shift']());}};_0x173b36(++_0x512058);}(_0xadb5,0xad));var _0x5adb=function(_0x5680de,_0x123826){_0x5680de=_0x5680de-0x0;var _0xf04e55=_0xadb5[_0x5680de];return _0xf04e55;};'use strict';var express=require('express');var router=express[_0x5adb('0x0')]();var auth=require('../../components/auth/service');var controller=require(_0x5adb('0x1'));router[_0x5adb('0x2')]('/',auth[_0x5adb('0x3')](),controller['index']);router[_0x5adb('0x2')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller['show']);router[_0x5adb('0x5')]('/',auth[_0x5adb('0x3')](),controller[_0x5adb('0x6')]);router[_0x5adb('0x7')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0x4'),auth[_0x5adb('0x3')](),controller[_0x5adb('0xa')]);router[_0x5adb('0x2')](_0x5adb('0xb'),auth[_0x5adb('0x3')](),controller['oauth2MicrosoftAuthorize']);router['post'](_0x5adb('0xc'),controller[_0x5adb('0xd')]);module[_0x5adb('0xe')]=router;
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js
index 2865a84..0a893eb 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 _0x31a2=['STRING','name','exports'];(function(_0x88eed3,_0x1741d7){var _0xf8b3a6=function(_0xb53a90){while(--_0xb53a90){_0x88eed3['push'](_0x88eed3['shift']());}};_0xf8b3a6(++_0x1741d7);}(_0x31a2,0x1eb));var _0x231a=function(_0x47180d,_0x1f18f3){_0x47180d=_0x47180d-0x0;var _0x2420eb=_0x31a2[_0x47180d];return _0x2420eb;};'use strict';var Sequelize=require('sequelize');module[_0x231a('0x0')]={'name':{'type':Sequelize[_0x231a('0x1')],'unique':_0x231a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x231a('0x1')]},'companyId':{'type':Sequelize[_0x231a('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x231a('0x1')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x231a('0x1')]},'city':{'type':Sequelize[_0x231a('0x1')]},'country':{'type':Sequelize[_0x231a('0x1')]},'email':{'type':Sequelize[_0x231a('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize['STRING']},'sStreet':{'type':Sequelize[_0x231a('0x1')]},'sPostalCode':{'type':Sequelize[_0x231a('0x1')]},'sCity':{'type':Sequelize['STRING']},'sCountry':{'type':Sequelize[_0x231a('0x1')]},'description':{'type':Sequelize[_0x231a('0x1')]}};
\ No newline at end of file
+var _0x1a54=['name','STRING','exports'];(function(_0x644977,_0x40749d){var _0x24c3c1=function(_0x4cbe1){while(--_0x4cbe1){_0x644977['push'](_0x644977['shift']());}};_0x24c3c1(++_0x40749d);}(_0x1a54,0x14f));var _0x41a5=function(_0x272943,_0x2c64f4){_0x272943=_0x272943-0x0;var _0x468f53=_0x1a54[_0x272943];return _0x468f53;};'use strict';var Sequelize=require('sequelize');module[_0x41a5('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x41a5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x41a5('0x2')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize[_0x41a5('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x41a5('0x2')]},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x41a5('0x2')]},'postalCode':{'type':Sequelize[_0x41a5('0x2')]},'city':{'type':Sequelize[_0x41a5('0x2')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x41a5('0x2')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x41a5('0x2')]},'sStreet':{'type':Sequelize[_0x41a5('0x2')]},'sPostalCode':{'type':Sequelize[_0x41a5('0x2')]},'sCity':{'type':Sequelize[_0x41a5('0x2')]},'sCountry':{'type':Sequelize[_0x41a5('0x2')]},'description':{'type':Sequelize['STRING']}};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js
index e726bf2..7d0be51 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 _0xbd47=['lodash','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','undefined','count','set','apply','save','then','get','UserProfileResource','error','stack','name','send','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','CmCompany','includeAll','include','findAll','rows','params','filters','options','find','catch','create','body','user','role','Companies','autoAssociation','update','destroy','describe','addContacts','CmContact','ids','omit','rawAttributes','map','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','fs-extra'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbd47,0x12e));var _0x7bd4=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xbd47[_0x36c5b0];return _0xf19333;};'use strict';var emlformat=require(_0x7bd4('0x0'));var rimraf=require(_0x7bd4('0x1'));var zipdir=require(_0x7bd4('0x2'));var jsonpatch=require(_0x7bd4('0x3'));var rp=require(_0x7bd4('0x4'));var moment=require(_0x7bd4('0x5'));var BPromise=require(_0x7bd4('0x6'));var Mustache=require('mustache');var util=require(_0x7bd4('0x7'));var path=require(_0x7bd4('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var fs_extra=require(_0x7bd4('0x9'));var _=require(_0x7bd4('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bd4('0xb'));var deskjs=require(_0x7bd4('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bd4('0xd'));var Redis=require('ioredis');var authService=require(_0x7bd4('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x7bd4('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7bd4('0x10'))('api');var utils=require(_0x7bd4('0x11'));var config=require(_0x7bd4('0x12'));var licenseUtil=require('../../config/license/util');var db=require(_0x7bd4('0x13'))['db'];function respondWithStatusCode(_0x29100f,_0x29f652){_0x29f652=_0x29f652||0xcc;return function(_0x16f9ea){if(_0x16f9ea){return _0x29100f[_0x7bd4('0x14')](_0x29f652);}return _0x29100f[_0x7bd4('0x15')](_0x29f652)[_0x7bd4('0x16')]();};}function respondWithResult(_0x5b8af6,_0x2c1972){_0x2c1972=_0x2c1972||0xc8;return function(_0xd9fe7a){if(_0xd9fe7a){return _0x5b8af6['status'](_0x2c1972)[_0x7bd4('0x17')](_0xd9fe7a);}};}function respondWithFilteredResult(_0x3f4240,_0x276126){return function(_0x299b50){if(_0x299b50){var _0x2d88cf=typeof _0x276126[_0x7bd4('0x18')]==='undefined'&&typeof _0x276126[_0x7bd4('0x19')]===_0x7bd4('0x1a');var _0x1bbca7=_0x299b50[_0x7bd4('0x1b')];var _0x5efe42=_0x2d88cf?0x0:_0x276126[_0x7bd4('0x18')];var _0x3718f6=_0x2d88cf?_0x299b50['count']:_0x276126[_0x7bd4('0x18')]+_0x276126[_0x7bd4('0x19')];var _0x3cd5b2;if(_0x3718f6>=_0x1bbca7){_0x3718f6=_0x1bbca7;_0x3cd5b2=0xc8;}else{_0x3cd5b2=0xce;}_0x3f4240[_0x7bd4('0x15')](_0x3cd5b2);return _0x3f4240[_0x7bd4('0x1c')]('Content-Range',_0x5efe42+'-'+_0x3718f6+'/'+_0x1bbca7)[_0x7bd4('0x17')](_0x299b50);}return null;};}function patchUpdates(_0x57882c){return function(_0x3f5d39){try{jsonpatch[_0x7bd4('0x1d')](_0x3f5d39,_0x57882c,!![]);}catch(_0x5d8a58){return BPromise['reject'](_0x5d8a58);}return _0x3f5d39[_0x7bd4('0x1e')]();};}function saveUpdates(_0x122c29,_0x175728){return function(_0x57bc83){if(_0x57bc83){return _0x57bc83['update'](_0x122c29)[_0x7bd4('0x1f')](function(_0x3671cd){return _0x3671cd;});}return null;};}function removeEntity(_0x227efd,_0x12964f){return function(_0xf653ad){if(_0xf653ad){return _0xf653ad['destroy']()['then'](function(){var _0x33ff14=_0xf653ad[_0x7bd4('0x20')]({'plain':!![]});var _0x2bfef2='Companies';return db[_0x7bd4('0x21')]['destroy']({'where':{'type':_0x2bfef2,'resourceId':_0x33ff14['id']}})[_0x7bd4('0x1f')](function(){return _0xf653ad;});})[_0x7bd4('0x1f')](function(){_0x227efd[_0x7bd4('0x15')](0xcc)[_0x7bd4('0x16')]();});}};}function handleEntityNotFound(_0x4c531b,_0x452b23){return function(_0x3290e5){if(!_0x3290e5){_0x4c531b[_0x7bd4('0x14')](0x194);}return _0x3290e5;};}function handleError(_0x6e8e0c,_0x149f14){_0x149f14=_0x149f14||0x1f4;return function(_0xba4233){logger[_0x7bd4('0x22')](_0xba4233[_0x7bd4('0x23')]);if(_0xba4233[_0x7bd4('0x24')]){delete _0xba4233['name'];}_0x6e8e0c[_0x7bd4('0x15')](_0x149f14)[_0x7bd4('0x25')](_0xba4233);};}exports['index']=function(_0x255ad0,_0x51902a){var _0x33e28b={},_0x492bf0={},_0x17f4b5={'count':0x0,'rows':[]};return db['CmCompany']['describe']()[_0x7bd4('0x1f')](function(_0x25b772){_0x492bf0[_0x7bd4('0x26')]=_[_0x7bd4('0x27')](_0x25b772);_0x492bf0[_0x7bd4('0x28')]=_['keys'](_0x255ad0[_0x7bd4('0x28')]);_0x492bf0['filters']=_[_0x7bd4('0x29')](_0x492bf0['model'],_0x492bf0['query']);_0x33e28b['attributes']=_['intersection'](_0x492bf0[_0x7bd4('0x26')],qs[_0x7bd4('0x2a')](_0x255ad0[_0x7bd4('0x28')]['fields']));_0x33e28b[_0x7bd4('0x2b')]=_0x33e28b[_0x7bd4('0x2b')][_0x7bd4('0x2c')]?_0x33e28b[_0x7bd4('0x2b')]:_0x492bf0[_0x7bd4('0x26')];if(!_0x255ad0[_0x7bd4('0x28')][_0x7bd4('0x2d')](_0x7bd4('0x2e'))){_0x33e28b[_0x7bd4('0x19')]=qs['limit'](_0x255ad0[_0x7bd4('0x28')][_0x7bd4('0x19')]);_0x33e28b[_0x7bd4('0x18')]=qs[_0x7bd4('0x18')](_0x255ad0[_0x7bd4('0x28')][_0x7bd4('0x18')]);}_0x33e28b['order']=qs['sort'](_0x255ad0[_0x7bd4('0x28')][_0x7bd4('0x2f')]);_0x33e28b[_0x7bd4('0x30')]=qs['filters'](_[_0x7bd4('0x31')](_0x255ad0[_0x7bd4('0x28')],_0x492bf0['filters']),_0x25b772);if(_0x255ad0[_0x7bd4('0x28')][_0x7bd4('0x32')]){_0x33e28b[_0x7bd4('0x30')]=_[_0x7bd4('0x33')](_0x33e28b[_0x7bd4('0x30')],{'$or':_['map'](_0x33e28b[_0x7bd4('0x2b')],function(_0x484f6c){var _0x2f71cb={};_0x2f71cb[_0x484f6c]={'$like':'%'+_0x255ad0[_0x7bd4('0x28')]['filter']+'%'};return _0x2f71cb;})});}_0x33e28b=_['merge']({},_0x33e28b,_0x255ad0['options']);var _0x4ed8e0={'where':_0x33e28b[_0x7bd4('0x30')]};return db[_0x7bd4('0x34')][_0x7bd4('0x1b')](_0x4ed8e0)['then'](function(_0x51c550){_0x17f4b5[_0x7bd4('0x1b')]=_0x51c550;if(_0x255ad0[_0x7bd4('0x28')][_0x7bd4('0x35')]){_0x33e28b[_0x7bd4('0x36')]=[{'all':!![]}];}return db['CmCompany'][_0x7bd4('0x37')](_0x33e28b);})[_0x7bd4('0x1f')](function(_0x587c7e){_0x17f4b5[_0x7bd4('0x38')]=_0x587c7e;return _0x17f4b5;})[_0x7bd4('0x1f')](respondWithFilteredResult(_0x51902a,_0x33e28b))['catch'](handleError(_0x51902a,null));})['catch'](handleError(_0x51902a,null));};exports['show']=function(_0x2634da,_0x853c1){var _0x2cf33a={'raw':![],'where':{'id':_0x2634da[_0x7bd4('0x39')]['id']}},_0x4b496e={};_0x4b496e[_0x7bd4('0x26')]=_[_0x7bd4('0x27')](db[_0x7bd4('0x34')]['rawAttributes']);_0x4b496e[_0x7bd4('0x28')]=_[_0x7bd4('0x27')](_0x2634da[_0x7bd4('0x28')]);_0x4b496e[_0x7bd4('0x3a')]=_[_0x7bd4('0x29')](_0x4b496e[_0x7bd4('0x26')],_0x4b496e[_0x7bd4('0x28')]);_0x2cf33a[_0x7bd4('0x2b')]=_[_0x7bd4('0x29')](_0x4b496e['model'],qs[_0x7bd4('0x2a')](_0x2634da[_0x7bd4('0x28')][_0x7bd4('0x2a')]));_0x2cf33a[_0x7bd4('0x2b')]=_0x2cf33a['attributes'][_0x7bd4('0x2c')]?_0x2cf33a[_0x7bd4('0x2b')]:_0x4b496e[_0x7bd4('0x26')];if(_0x2634da[_0x7bd4('0x28')][_0x7bd4('0x35')]){_0x2cf33a[_0x7bd4('0x36')]=[{'all':!![]}];}_0x2cf33a=_[_0x7bd4('0x33')]({},_0x2cf33a,_0x2634da[_0x7bd4('0x3b')]);return db[_0x7bd4('0x34')][_0x7bd4('0x3c')](_0x2cf33a)[_0x7bd4('0x1f')](handleEntityNotFound(_0x853c1,null))['then'](respondWithResult(_0x853c1,null))[_0x7bd4('0x3d')](handleError(_0x853c1,null));};exports[_0x7bd4('0x3e')]=function(_0xff545b,_0x9b4dae){return db['CmCompany'][_0x7bd4('0x3e')](_0xff545b[_0x7bd4('0x3f')],{})['then'](function(_0x5b69e6){var _0x428b6e=_0xff545b[_0x7bd4('0x40')][_0x7bd4('0x20')]({'plain':!![]});if(!_0x428b6e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x428b6e[_0x7bd4('0x41')]===_0x7bd4('0x40')){var _0x1b5308=_0x5b69e6[_0x7bd4('0x20')]({'plain':!![]});var _0x189550=_0x7bd4('0x42');return db['UserProfileSection'][_0x7bd4('0x3c')]({'where':{'name':_0x189550,'userProfileId':_0x428b6e['userProfileId']},'raw':!![]})[_0x7bd4('0x1f')](function(_0x368118){if(_0x368118&&_0x368118[_0x7bd4('0x43')]===0x0){return db[_0x7bd4('0x21')]['create']({'name':_0x1b5308[_0x7bd4('0x24')],'resourceId':_0x1b5308['id'],'type':_0x368118['name'],'sectionId':_0x368118['id']},{})[_0x7bd4('0x1f')](function(){return _0x5b69e6;});}else{return _0x5b69e6;}})[_0x7bd4('0x3d')](function(_0x46b7e1){logger[_0x7bd4('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x46b7e1);throw _0x46b7e1;});}return _0x5b69e6;})[_0x7bd4('0x1f')](respondWithResult(_0x9b4dae,0xc9))[_0x7bd4('0x3d')](handleError(_0x9b4dae,null));};exports[_0x7bd4('0x44')]=function(_0x189063,_0x119dc5){if(_0x189063[_0x7bd4('0x3f')]['id']){delete _0x189063[_0x7bd4('0x3f')]['id'];}return db[_0x7bd4('0x34')][_0x7bd4('0x3c')]({'where':{'id':_0x189063[_0x7bd4('0x39')]['id']}})[_0x7bd4('0x1f')](handleEntityNotFound(_0x119dc5,null))[_0x7bd4('0x1f')](saveUpdates(_0x189063[_0x7bd4('0x3f')],null))['then'](respondWithResult(_0x119dc5,null))[_0x7bd4('0x3d')](handleError(_0x119dc5,null));};exports[_0x7bd4('0x45')]=function(_0x7da01a,_0x125116){return db[_0x7bd4('0x34')][_0x7bd4('0x3c')]({'where':{'id':_0x7da01a[_0x7bd4('0x39')]['id']}})['then'](handleEntityNotFound(_0x125116,null))['then'](removeEntity(_0x125116,null))[_0x7bd4('0x3d')](handleError(_0x125116,null));};exports[_0x7bd4('0x46')]=function(_0x567a74,_0x1e0d2c){return db[_0x7bd4('0x34')]['describe']()['then'](respondWithResult(_0x1e0d2c,null))[_0x7bd4('0x3d')](handleError(_0x1e0d2c,null));};exports[_0x7bd4('0x47')]=function(_0x5c96f1,_0x5ce460,_0x107a7b){return db[_0x7bd4('0x48')][_0x7bd4('0x3c')]({'where':{'id':_0x5c96f1['params']['id']}})['then'](handleEntityNotFound(_0x5ce460,null))[_0x7bd4('0x1f')](function(_0xf50d73){if(_0xf50d73){return _0xf50d73[_0x7bd4('0x47')](_0x5c96f1[_0x7bd4('0x3f')][_0x7bd4('0x49')],_[_0x7bd4('0x4a')](_0x5c96f1[_0x7bd4('0x3f')],[_0x7bd4('0x49'),'id'])||{});}})['then'](respondWithResult(_0x5ce460,null))['catch'](handleError(_0x5ce460,null));};exports['getContacts']=function(_0x56d4b0,_0x2aeba5,_0x28c2ce){var _0xb21434={};var _0xb7aa75={};var _0x7c3398;var _0x5a86ba;return db[_0x7bd4('0x34')]['findOne']({'where':{'id':_0x56d4b0[_0x7bd4('0x39')]['id']}})[_0x7bd4('0x1f')](handleEntityNotFound(_0x2aeba5,null))['then'](function(_0x5aa75b){if(_0x5aa75b){_0x7c3398=_0x5aa75b;_0xb7aa75['model']=_['keys'](db['CmContact'][_0x7bd4('0x4b')]);_0xb7aa75[_0x7bd4('0x28')]=_['keys'](_0x56d4b0['query']);_0xb7aa75[_0x7bd4('0x3a')]=_[_0x7bd4('0x29')](_0xb7aa75[_0x7bd4('0x26')],_0xb7aa75[_0x7bd4('0x28')]);_0xb21434['attributes']=_['intersection'](_0xb7aa75[_0x7bd4('0x26')],qs[_0x7bd4('0x2a')](_0x56d4b0[_0x7bd4('0x28')][_0x7bd4('0x2a')]));_0xb21434['attributes']=_0xb21434[_0x7bd4('0x2b')][_0x7bd4('0x2c')]?_0xb21434[_0x7bd4('0x2b')]:_0xb7aa75[_0x7bd4('0x26')];_0xb21434['order']=qs[_0x7bd4('0x2f')](_0x56d4b0[_0x7bd4('0x28')]['sort']);_0xb21434['where']=qs[_0x7bd4('0x3a')](_[_0x7bd4('0x31')](_0x56d4b0[_0x7bd4('0x28')],_0xb7aa75['filters']));if(_0x56d4b0[_0x7bd4('0x28')]['filter']){_0xb21434[_0x7bd4('0x30')]=_['merge'](_0xb21434[_0x7bd4('0x30')],{'$or':_[_0x7bd4('0x4c')](_0xb21434[_0x7bd4('0x2b')],function(_0x478a1e){var _0x4a9673={};_0x4a9673[_0x478a1e]={'$like':'%'+_0x56d4b0['query']['filter']+'%'};return _0x4a9673;})});}_0xb21434=_[_0x7bd4('0x33')]({},_0xb21434,_0x56d4b0[_0x7bd4('0x3b')]);return _0x7c3398['getContacts'](_0xb21434);}})[_0x7bd4('0x1f')](function(_0x2b1d73){if(_0x2b1d73){_0x5a86ba=_0x2b1d73[_0x7bd4('0x2c')];if(!_0x56d4b0[_0x7bd4('0x28')][_0x7bd4('0x2d')](_0x7bd4('0x2e'))){_0xb21434[_0x7bd4('0x19')]=qs['limit'](_0x56d4b0[_0x7bd4('0x28')]['limit']);_0xb21434[_0x7bd4('0x18')]=qs['offset'](_0x56d4b0[_0x7bd4('0x28')][_0x7bd4('0x18')]);}return _0x7c3398[_0x7bd4('0x4d')](_0xb21434);}})[_0x7bd4('0x1f')](function(_0x1ce5ee){if(_0x1ce5ee){return _0x1ce5ee?{'count':_0x5a86ba,'rows':_0x1ce5ee}:null;}})[_0x7bd4('0x1f')](respondWithResult(_0x2aeba5,null))['catch'](handleError(_0x2aeba5,null));};
\ No newline at end of file
+var _0xa2fc=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','catch','error','body','addContacts','omit','ids','getContacts','findOne','CmContact','eml-format','zip-dir','request-promise','moment','util','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','../../config/logger','api','../../config/utils','../../config/environment','../../config/license/util','../../mysqldb','sendStatus','end','status','json','offset','undefined','limit','count','set','Content-Range','apply','reject','save','update','destroy','then','get','Companies','UserProfileResource','name','send','index','CmCompany','describe','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','includeAll','findAll','rows','show','params','rawAttributes','include','find','create'];(function(_0x1912fa,_0xb6bfa7){var _0x262a5c=function(_0xd6f3b6){while(--_0xd6f3b6){_0x1912fa['push'](_0x1912fa['shift']());}};_0x262a5c(++_0xb6bfa7);}(_0xa2fc,0x16d));var _0xca2f=function(_0x3fc97b,_0x20ca29){_0x3fc97b=_0x3fc97b-0x0;var _0x3a0c82=_0xa2fc[_0x3fc97b];return _0x3a0c82;};'use strict';var emlformat=require(_0xca2f('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xca2f('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca2f('0x2'));var moment=require(_0xca2f('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xca2f('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0xca2f('0x5'));var ejs=require(_0xca2f('0x6'));var fs=require('fs');var fs_extra=require(_0xca2f('0x7'));var _=require(_0xca2f('0x8'));var squel=require(_0xca2f('0x9'));var crypto=require('crypto');var jsforce=require(_0xca2f('0xa'));var deskjs=require(_0xca2f('0xb'));var toCsv=require(_0xca2f('0x5'));var querystring=require(_0xca2f('0xc'));var Papa=require(_0xca2f('0xd'));var Redis=require(_0xca2f('0xe'));var authService=require(_0xca2f('0xf'));var qs=require(_0xca2f('0x10'));var as=require(_0xca2f('0x11'));var hardwareService=require(_0xca2f('0x12'));var logger=require(_0xca2f('0x13'))(_0xca2f('0x14'));var utils=require(_0xca2f('0x15'));var config=require(_0xca2f('0x16'));var licenseUtil=require(_0xca2f('0x17'));var db=require(_0xca2f('0x18'))['db'];function respondWithStatusCode(_0x41c274,_0x536556){_0x536556=_0x536556||0xcc;return function(_0x297755){if(_0x297755){return _0x41c274[_0xca2f('0x19')](_0x536556);}return _0x41c274['status'](_0x536556)[_0xca2f('0x1a')]();};}function respondWithResult(_0x2711fa,_0x378253){_0x378253=_0x378253||0xc8;return function(_0x4dbd71){if(_0x4dbd71){return _0x2711fa[_0xca2f('0x1b')](_0x378253)[_0xca2f('0x1c')](_0x4dbd71);}};}function respondWithFilteredResult(_0x1942fd,_0x2ee0d7){return function(_0xbc46b5){if(_0xbc46b5){var _0x342887=typeof _0x2ee0d7[_0xca2f('0x1d')]===_0xca2f('0x1e')&&typeof _0x2ee0d7[_0xca2f('0x1f')]===_0xca2f('0x1e');var _0x3b9b95=_0xbc46b5[_0xca2f('0x20')];var _0x1e0921=_0x342887?0x0:_0x2ee0d7[_0xca2f('0x1d')];var _0x30db90=_0x342887?_0xbc46b5['count']:_0x2ee0d7['offset']+_0x2ee0d7[_0xca2f('0x1f')];var _0x46885f;if(_0x30db90>=_0x3b9b95){_0x30db90=_0x3b9b95;_0x46885f=0xc8;}else{_0x46885f=0xce;}_0x1942fd[_0xca2f('0x1b')](_0x46885f);return _0x1942fd[_0xca2f('0x21')](_0xca2f('0x22'),_0x1e0921+'-'+_0x30db90+'/'+_0x3b9b95)[_0xca2f('0x1c')](_0xbc46b5);}return null;};}function patchUpdates(_0x202461){return function(_0x1c1e3f){try{jsonpatch[_0xca2f('0x23')](_0x1c1e3f,_0x202461,!![]);}catch(_0x2337b4){return BPromise[_0xca2f('0x24')](_0x2337b4);}return _0x1c1e3f[_0xca2f('0x25')]();};}function saveUpdates(_0x5c4869,_0x459dd0){return function(_0x31fb53){if(_0x31fb53){return _0x31fb53[_0xca2f('0x26')](_0x5c4869)['then'](function(_0x2b8645){return _0x2b8645;});}return null;};}function removeEntity(_0xbdf308,_0x48b4d5){return function(_0x252f94){if(_0x252f94){return _0x252f94[_0xca2f('0x27')]()[_0xca2f('0x28')](function(){var _0x4355d7=_0x252f94[_0xca2f('0x29')]({'plain':!![]});var _0x13de45=_0xca2f('0x2a');return db[_0xca2f('0x2b')]['destroy']({'where':{'type':_0x13de45,'resourceId':_0x4355d7['id']}})[_0xca2f('0x28')](function(){return _0x252f94;});})[_0xca2f('0x28')](function(){_0xbdf308['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x34b38a,_0x43c681){return function(_0x3ec5e8){if(!_0x3ec5e8){_0x34b38a[_0xca2f('0x19')](0x194);}return _0x3ec5e8;};}function handleError(_0x30b513,_0xcd4a2d){_0xcd4a2d=_0xcd4a2d||0x1f4;return function(_0x13bd4f){logger['error'](_0x13bd4f['stack']);if(_0x13bd4f[_0xca2f('0x2c')]){delete _0x13bd4f[_0xca2f('0x2c')];}_0x30b513['status'](_0xcd4a2d)[_0xca2f('0x2d')](_0x13bd4f);};}exports[_0xca2f('0x2e')]=function(_0x5c27ef,_0x2584b8){var _0x42da9a={},_0x2dc739={},_0x597f79={'count':0x0,'rows':[]};return db[_0xca2f('0x2f')][_0xca2f('0x30')]()[_0xca2f('0x28')](function(_0x2e6bb4){_0x2dc739[_0xca2f('0x31')]=_[_0xca2f('0x32')](_0x2e6bb4);_0x2dc739[_0xca2f('0x33')]=_[_0xca2f('0x32')](_0x5c27ef[_0xca2f('0x33')]);_0x2dc739[_0xca2f('0x34')]=_['intersection'](_0x2dc739[_0xca2f('0x31')],_0x2dc739[_0xca2f('0x33')]);_0x42da9a[_0xca2f('0x35')]=_[_0xca2f('0x36')](_0x2dc739['model'],qs['fields'](_0x5c27ef['query'][_0xca2f('0x37')]));_0x42da9a[_0xca2f('0x35')]=_0x42da9a[_0xca2f('0x35')][_0xca2f('0x38')]?_0x42da9a[_0xca2f('0x35')]:_0x2dc739[_0xca2f('0x31')];if(!_0x5c27ef[_0xca2f('0x33')][_0xca2f('0x39')](_0xca2f('0x3a'))){_0x42da9a[_0xca2f('0x1f')]=qs[_0xca2f('0x1f')](_0x5c27ef[_0xca2f('0x33')]['limit']);_0x42da9a[_0xca2f('0x1d')]=qs['offset'](_0x5c27ef[_0xca2f('0x33')][_0xca2f('0x1d')]);}_0x42da9a[_0xca2f('0x3b')]=qs[_0xca2f('0x3c')](_0x5c27ef[_0xca2f('0x33')][_0xca2f('0x3c')]);_0x42da9a[_0xca2f('0x3d')]=qs[_0xca2f('0x34')](_[_0xca2f('0x3e')](_0x5c27ef[_0xca2f('0x33')],_0x2dc739[_0xca2f('0x34')]),_0x2e6bb4);if(_0x5c27ef[_0xca2f('0x33')]['filter']){_0x42da9a[_0xca2f('0x3d')]=_[_0xca2f('0x3f')](_0x42da9a['where'],{'$or':_[_0xca2f('0x40')](_0x42da9a[_0xca2f('0x35')],function(_0xae4faf){var _0xae4727={};_0xae4727[_0xae4faf]={'$like':'%'+_0x5c27ef[_0xca2f('0x33')][_0xca2f('0x41')]+'%'};return _0xae4727;})});}_0x42da9a=_['merge']({},_0x42da9a,_0x5c27ef['options']);var _0x5d6c20={'where':_0x42da9a['where']};return db['CmCompany']['count'](_0x5d6c20)[_0xca2f('0x28')](function(_0x4e5d5e){_0x597f79[_0xca2f('0x20')]=_0x4e5d5e;if(_0x5c27ef[_0xca2f('0x33')][_0xca2f('0x42')]){_0x42da9a['include']=[{'all':!![]}];}return db[_0xca2f('0x2f')][_0xca2f('0x43')](_0x42da9a);})[_0xca2f('0x28')](function(_0x49e636){_0x597f79[_0xca2f('0x44')]=_0x49e636;return _0x597f79;})['then'](respondWithFilteredResult(_0x2584b8,_0x42da9a))['catch'](handleError(_0x2584b8,null));})['catch'](handleError(_0x2584b8,null));};exports[_0xca2f('0x45')]=function(_0x5752b7,_0xe50861){var _0x28e5b0={'raw':![],'where':{'id':_0x5752b7[_0xca2f('0x46')]['id']}},_0x14df3a={};_0x14df3a['model']=_[_0xca2f('0x32')](db['CmCompany'][_0xca2f('0x47')]);_0x14df3a[_0xca2f('0x33')]=_['keys'](_0x5752b7[_0xca2f('0x33')]);_0x14df3a[_0xca2f('0x34')]=_[_0xca2f('0x36')](_0x14df3a[_0xca2f('0x31')],_0x14df3a[_0xca2f('0x33')]);_0x28e5b0[_0xca2f('0x35')]=_[_0xca2f('0x36')](_0x14df3a[_0xca2f('0x31')],qs[_0xca2f('0x37')](_0x5752b7[_0xca2f('0x33')]['fields']));_0x28e5b0[_0xca2f('0x35')]=_0x28e5b0[_0xca2f('0x35')]['length']?_0x28e5b0[_0xca2f('0x35')]:_0x14df3a[_0xca2f('0x31')];if(_0x5752b7['query'][_0xca2f('0x42')]){_0x28e5b0[_0xca2f('0x48')]=[{'all':!![]}];}_0x28e5b0=_[_0xca2f('0x3f')]({},_0x28e5b0,_0x5752b7['options']);return db[_0xca2f('0x2f')][_0xca2f('0x49')](_0x28e5b0)['then'](handleEntityNotFound(_0xe50861,null))['then'](respondWithResult(_0xe50861,null))['catch'](handleError(_0xe50861,null));};exports[_0xca2f('0x4a')]=function(_0x5ec77a,_0x28e414){return db[_0xca2f('0x2f')][_0xca2f('0x4a')](_0x5ec77a['body'],{})[_0xca2f('0x28')](function(_0x1b6716){var _0x282e84=_0x5ec77a[_0xca2f('0x4b')][_0xca2f('0x29')]({'plain':!![]});if(!_0x282e84)throw new Error(_0xca2f('0x4c'));if(_0x282e84['role']===_0xca2f('0x4b')){var _0x4c7536=_0x1b6716[_0xca2f('0x29')]({'plain':!![]});var _0x4401ba=_0xca2f('0x2a');return db[_0xca2f('0x4d')][_0xca2f('0x49')]({'where':{'name':_0x4401ba,'userProfileId':_0x282e84[_0xca2f('0x4e')]},'raw':!![]})[_0xca2f('0x28')](function(_0x28796a){if(_0x28796a&&_0x28796a['autoAssociation']===0x0){return db[_0xca2f('0x2b')]['create']({'name':_0x4c7536['name'],'resourceId':_0x4c7536['id'],'type':_0x28796a[_0xca2f('0x2c')],'sectionId':_0x28796a['id']},{})[_0xca2f('0x28')](function(){return _0x1b6716;});}else{return _0x1b6716;}})[_0xca2f('0x4f')](function(_0x1069fe){logger[_0xca2f('0x50')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1069fe);throw _0x1069fe;});}return _0x1b6716;})[_0xca2f('0x28')](respondWithResult(_0x28e414,0xc9))[_0xca2f('0x4f')](handleError(_0x28e414,null));};exports[_0xca2f('0x26')]=function(_0x50415a,_0x3cc3ff){if(_0x50415a[_0xca2f('0x51')]['id']){delete _0x50415a[_0xca2f('0x51')]['id'];}return db[_0xca2f('0x2f')][_0xca2f('0x49')]({'where':{'id':_0x50415a[_0xca2f('0x46')]['id']}})['then'](handleEntityNotFound(_0x3cc3ff,null))[_0xca2f('0x28')](saveUpdates(_0x50415a[_0xca2f('0x51')],null))['then'](respondWithResult(_0x3cc3ff,null))[_0xca2f('0x4f')](handleError(_0x3cc3ff,null));};exports[_0xca2f('0x27')]=function(_0x417dab,_0xb329aa){return db['CmCompany'][_0xca2f('0x49')]({'where':{'id':_0x417dab['params']['id']}})[_0xca2f('0x28')](handleEntityNotFound(_0xb329aa,null))[_0xca2f('0x28')](removeEntity(_0xb329aa,null))[_0xca2f('0x4f')](handleError(_0xb329aa,null));};exports[_0xca2f('0x30')]=function(_0x53890f,_0x153daa){return db['CmCompany']['describe']()[_0xca2f('0x28')](respondWithResult(_0x153daa,null))[_0xca2f('0x4f')](handleError(_0x153daa,null));};exports[_0xca2f('0x52')]=function(_0x1d14a4,_0x362e60,_0x356843){return db['CmContact'][_0xca2f('0x49')]({'where':{'id':_0x1d14a4[_0xca2f('0x46')]['id']}})[_0xca2f('0x28')](handleEntityNotFound(_0x362e60,null))[_0xca2f('0x28')](function(_0x22dba5){if(_0x22dba5){return _0x22dba5[_0xca2f('0x52')](_0x1d14a4[_0xca2f('0x51')]['ids'],_[_0xca2f('0x53')](_0x1d14a4[_0xca2f('0x51')],[_0xca2f('0x54'),'id'])||{});}})[_0xca2f('0x28')](respondWithResult(_0x362e60,null))[_0xca2f('0x4f')](handleError(_0x362e60,null));};exports[_0xca2f('0x55')]=function(_0x3d0bdc,_0x1abfb2,_0x1f869a){var _0x109ece={};var _0x17a827={};var _0x59a954;var _0x3d53fa;return db[_0xca2f('0x2f')][_0xca2f('0x56')]({'where':{'id':_0x3d0bdc[_0xca2f('0x46')]['id']}})[_0xca2f('0x28')](handleEntityNotFound(_0x1abfb2,null))['then'](function(_0x5daab2){if(_0x5daab2){_0x59a954=_0x5daab2;_0x17a827['model']=_[_0xca2f('0x32')](db[_0xca2f('0x57')]['rawAttributes']);_0x17a827['query']=_[_0xca2f('0x32')](_0x3d0bdc[_0xca2f('0x33')]);_0x17a827[_0xca2f('0x34')]=_[_0xca2f('0x36')](_0x17a827[_0xca2f('0x31')],_0x17a827[_0xca2f('0x33')]);_0x109ece[_0xca2f('0x35')]=_[_0xca2f('0x36')](_0x17a827['model'],qs[_0xca2f('0x37')](_0x3d0bdc[_0xca2f('0x33')][_0xca2f('0x37')]));_0x109ece['attributes']=_0x109ece[_0xca2f('0x35')][_0xca2f('0x38')]?_0x109ece[_0xca2f('0x35')]:_0x17a827['model'];_0x109ece[_0xca2f('0x3b')]=qs[_0xca2f('0x3c')](_0x3d0bdc[_0xca2f('0x33')][_0xca2f('0x3c')]);_0x109ece[_0xca2f('0x3d')]=qs[_0xca2f('0x34')](_[_0xca2f('0x3e')](_0x3d0bdc[_0xca2f('0x33')],_0x17a827[_0xca2f('0x34')]));if(_0x3d0bdc['query'][_0xca2f('0x41')]){_0x109ece['where']=_['merge'](_0x109ece[_0xca2f('0x3d')],{'$or':_[_0xca2f('0x40')](_0x109ece[_0xca2f('0x35')],function(_0x3fd5c6){var _0x441bc8={};_0x441bc8[_0x3fd5c6]={'$like':'%'+_0x3d0bdc[_0xca2f('0x33')][_0xca2f('0x41')]+'%'};return _0x441bc8;})});}_0x109ece=_[_0xca2f('0x3f')]({},_0x109ece,_0x3d0bdc['options']);return _0x59a954[_0xca2f('0x55')](_0x109ece);}})[_0xca2f('0x28')](function(_0x1441ff){if(_0x1441ff){_0x3d53fa=_0x1441ff[_0xca2f('0x38')];if(!_0x3d0bdc['query'][_0xca2f('0x39')](_0xca2f('0x3a'))){_0x109ece[_0xca2f('0x1f')]=qs[_0xca2f('0x1f')](_0x3d0bdc[_0xca2f('0x33')]['limit']);_0x109ece['offset']=qs[_0xca2f('0x1d')](_0x3d0bdc[_0xca2f('0x33')][_0xca2f('0x1d')]);}return _0x59a954[_0xca2f('0x55')](_0x109ece);}})[_0xca2f('0x28')](function(_0x1fa899){if(_0x1fa899){return _0x1fa899?{'count':_0x3d53fa,'rows':_0x1fa899}:null;}})[_0xca2f('0x28')](respondWithResult(_0x1abfb2,null))[_0xca2f('0x4f')](handleError(_0x1abfb2,null));};
\ No newline at end of file
diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js
index bde2e3a..a6828eb 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 _0x8e6c=['./cmCompany.attributes','exports','define','CmCompany','util','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x3a439c,_0x29004f){var _0x1dda96=function(_0x29e6c7){while(--_0x29e6c7){_0x3a439c['push'](_0x3a439c['shift']());}};_0x1dda96(++_0x29004f);}(_0x8e6c,0xf6));var _0xc8e6=function(_0x4fa17f,_0x285b13){_0x4fa17f=_0x4fa17f-0x0;var _0x843bd8=_0x8e6c[_0x4fa17f];return _0x843bd8;};'use strict';var _=require('lodash');var util=require(_0xc8e6('0x0'));var logger=require(_0xc8e6('0x1'))(_0xc8e6('0x2'));var moment=require(_0xc8e6('0x3'));var BPromise=require(_0xc8e6('0x4'));var rp=require(_0xc8e6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc8e6('0x6'));var attributes=require(_0xc8e6('0x7'));module[_0xc8e6('0x8')]=function(_0x4fe700,_0x55005d){return _0x4fe700[_0xc8e6('0x9')](_0xc8e6('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});};
\ No newline at end of file
+var _0x9516=['cm_companies','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','define'];(function(_0x3b9771,_0x2dfe72){var _0x16b062=function(_0x5d3d92){while(--_0x5d3d92){_0x3b9771['push'](_0x3b9771['shift']());}};_0x16b062(++_0x2dfe72);}(_0x9516,0x1ed));var _0x6951=function(_0x4024bd,_0x164def){_0x4024bd=_0x4024bd-0x0;var _0x5cbe79=_0x9516[_0x4024bd];return _0x5cbe79;};'use strict';var _=require(_0x6951('0x0'));var util=require(_0x6951('0x1'));var logger=require(_0x6951('0x2'))(_0x6951('0x3'));var moment=require(_0x6951('0x4'));var BPromise=require(_0x6951('0x5'));var rp=require(_0x6951('0x6'));var fs=require('fs');var path=require(_0x6951('0x7'));var rimraf=require('rimraf');var config=require(_0x6951('0x8'));var attributes=require(_0x6951('0x9'));module['exports']=function(_0x25654c,_0x550802){return _0x25654c[_0x6951('0xa')]('CmCompany',attributes,{'tableName':_0x6951('0xb'),'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 cc2f359..60d78cb 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 _0x360e=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x412041,_0x2d16aa){var _0x274fe2=function(_0x3f7578){while(--_0x3f7578){_0x412041['push'](_0x412041['shift']());}};_0x274fe2(++_0x2d16aa);}(_0x360e,0x64));var _0xe360=function(_0x4970d6,_0x2e6b07){_0x4970d6=_0x4970d6-0x0;var _0x2857f3=_0x360e[_0x4970d6];return _0x2857f3;};'use strict';var _=require(_0xe360('0x0'));var util=require(_0xe360('0x1'));var moment=require(_0xe360('0x2'));var BPromise=require(_0xe360('0x3'));var rs=require(_0xe360('0x4'));var fs=require('fs');var Redis=require(_0xe360('0x5'));var db=require(_0xe360('0x6'))['db'];var utils=require(_0xe360('0x7'));var logger=require(_0xe360('0x8'))(_0xe360('0x9'));var config=require(_0xe360('0xa'));var jayson=require(_0xe360('0xb'));var client=jayson[_0xe360('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4923e5,_0x4df28d,_0x2292e2){return new BPromise(function(_0x473efb,_0x1d8f3b){return client[_0xe360('0xd')](_0x4923e5,_0x2292e2)[_0xe360('0xe')](function(_0xd93048){logger[_0xe360('0xf')]('CmCompany,\x20%s,\x20%s',_0x4df28d,_0xe360('0x10'));logger[_0xe360('0x11')](_0xe360('0x12'),_0x4df28d,_0xe360('0x10'),JSON[_0xe360('0x13')](_0xd93048));if(_0xd93048['error']){if(_0xd93048[_0xe360('0x14')][_0xe360('0x15')]===0x1f4){logger[_0xe360('0x14')](_0xe360('0x16'),_0x4df28d,_0xd93048['error']['message']);return _0x1d8f3b(_0xd93048['error'][_0xe360('0x17')]);}logger[_0xe360('0x14')](_0xe360('0x16'),_0x4df28d,_0xd93048['error'][_0xe360('0x17')]);return _0x473efb(_0xd93048[_0xe360('0x14')][_0xe360('0x17')]);}else{logger[_0xe360('0xf')]('CmCompany,\x20%s,\x20%s',_0x4df28d,'request\x20sent');_0x473efb(_0xd93048[_0xe360('0x18')]['message']);}})[_0xe360('0x19')](function(_0x5631fd){logger[_0xe360('0x14')](_0xe360('0x16'),_0x4df28d,_0x5631fd);_0x1d8f3b(_0x5631fd);});});}
\ No newline at end of file
+var _0x01c2=['client','http','request','then','info','request\x20sent','debug','stringify','error','code','CmCompany,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0x4ad0f7,_0x1920b0){var _0x30f5c8=function(_0x2aa6b6){while(--_0x2aa6b6){_0x4ad0f7['push'](_0x4ad0f7['shift']());}};_0x30f5c8(++_0x1920b0);}(_0x01c2,0x1af));var _0x201c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x01c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x201c('0x0'));var util=require(_0x201c('0x1'));var moment=require(_0x201c('0x2'));var BPromise=require(_0x201c('0x3'));var rs=require(_0x201c('0x4'));var fs=require('fs');var Redis=require(_0x201c('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x201c('0x6'))(_0x201c('0x7'));var config=require(_0x201c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x201c('0x9')][_0x201c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x54542a,_0x2adf4b,_0x4d8391){return new BPromise(function(_0x5afb10,_0x431487){return client[_0x201c('0xb')](_0x54542a,_0x4d8391)[_0x201c('0xc')](function(_0x3bbc30){logger[_0x201c('0xd')]('CmCompany,\x20%s,\x20%s',_0x2adf4b,_0x201c('0xe'));logger[_0x201c('0xf')]('CmCompany,\x20%s,\x20%s,\x20%s',_0x2adf4b,_0x201c('0xe'),JSON[_0x201c('0x10')](_0x3bbc30));if(_0x3bbc30[_0x201c('0x11')]){if(_0x3bbc30[_0x201c('0x11')][_0x201c('0x12')]===0x1f4){logger[_0x201c('0x11')](_0x201c('0x13'),_0x2adf4b,_0x3bbc30['error'][_0x201c('0x14')]);return _0x431487(_0x3bbc30[_0x201c('0x11')][_0x201c('0x14')]);}logger[_0x201c('0x11')](_0x201c('0x13'),_0x2adf4b,_0x3bbc30['error'][_0x201c('0x14')]);return _0x5afb10(_0x3bbc30[_0x201c('0x11')]['message']);}else{logger['info'](_0x201c('0x13'),_0x2adf4b,_0x201c('0xe'));_0x5afb10(_0x3bbc30['result'][_0x201c('0x14')]);}})[_0x201c('0x15')](function(_0x539ee0){logger[_0x201c('0x11')](_0x201c('0x13'),_0x2adf4b,_0x539ee0);_0x431487(_0x539ee0);});});}
\ No newline at end of file
diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js
index 5e6f358..4167f79 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 _0x7b90=['/describe','describe','/:id','isAuthenticated','show','getContacts','post','create','/:id/contacts','addContacts','put','update','delete','exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCompany.controller','get'];(function(_0x2ea375,_0x5ed6b9){var _0x5df61f=function(_0x27471f){while(--_0x27471f){_0x2ea375['push'](_0x2ea375['shift']());}};_0x5df61f(++_0x5ed6b9);}(_0x7b90,0xea));var _0x07b9=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x7b90[_0x432682];return _0x463d05;};'use strict';var multer=require(_0x07b9('0x0'));var util=require('util');var path=require(_0x07b9('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x07b9('0x2')]();var fs_extra=require('fs-extra');var auth=require(_0x07b9('0x3'));var interaction=require(_0x07b9('0x4'));var config=require(_0x07b9('0x5'));var controller=require(_0x07b9('0x6'));router[_0x07b9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x07b9('0x7')](_0x07b9('0x8'),auth['isAuthenticated'](),controller[_0x07b9('0x9')]);router[_0x07b9('0x7')](_0x07b9('0xa'),auth[_0x07b9('0xb')](),controller[_0x07b9('0xc')]);router[_0x07b9('0x7')]('/:id/contacts',auth['isAuthenticated'](),controller[_0x07b9('0xd')]);router[_0x07b9('0xe')]('/',auth[_0x07b9('0xb')](),controller[_0x07b9('0xf')]);router['post'](_0x07b9('0x10'),auth['isAuthenticated'](),controller[_0x07b9('0x11')]);router[_0x07b9('0x12')](_0x07b9('0xa'),auth[_0x07b9('0xb')](),controller[_0x07b9('0x13')]);router[_0x07b9('0x14')](_0x07b9('0xa'),auth[_0x07b9('0xb')](),controller['destroy']);module[_0x07b9('0x15')]=router;
\ No newline at end of file
+var _0x91e5=['addContacts','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','post'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0x91e5,0x126));var _0x591e=function(_0x2e7d35,_0x1651e7){_0x2e7d35=_0x2e7d35-0x0;var _0x1acb86=_0x91e5[_0x2e7d35];return _0x1acb86;};'use strict';var multer=require(_0x591e('0x0'));var util=require(_0x591e('0x1'));var path=require(_0x591e('0x2'));var timeout=require(_0x591e('0x3'));var express=require(_0x591e('0x4'));var router=express[_0x591e('0x5')]();var fs_extra=require('fs-extra');var auth=require(_0x591e('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x591e('0x7'));var controller=require(_0x591e('0x8'));router[_0x591e('0x9')]('/',auth[_0x591e('0xa')](),controller[_0x591e('0xb')]);router[_0x591e('0x9')](_0x591e('0xc'),auth['isAuthenticated'](),controller[_0x591e('0xd')]);router[_0x591e('0x9')](_0x591e('0xe'),auth[_0x591e('0xa')](),controller[_0x591e('0xf')]);router[_0x591e('0x9')](_0x591e('0x10'),auth[_0x591e('0xa')](),controller['getContacts']);router[_0x591e('0x11')]('/',auth[_0x591e('0xa')](),controller['create']);router[_0x591e('0x11')]('/:id/contacts',auth[_0x591e('0xa')](),controller[_0x591e('0x12')]);router[_0x591e('0x13')]('/:id',auth[_0x591e('0xa')](),controller[_0x591e('0x14')]);router[_0x591e('0x15')](_0x591e('0xe'),auth[_0x591e('0xa')](),controller[_0x591e('0x16')]);module[_0x591e('0x17')]=router;
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js
index 043bcd1..de930e9 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 _0xcbe1=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xcbe1,0x1aa));var _0x1cbe=function(_0x8fee0f,_0x118ab0){_0x8fee0f=_0x8fee0f-0x0;var _0xa5e569=_0xcbe1[_0x8fee0f];return _0xa5e569;};'use strict';var _=require(_0x1cbe('0x0'));var Sequelize=require(_0x1cbe('0x1'));module[_0x1cbe('0x2')]={'firstName':{'type':Sequelize[_0x1cbe('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x1cbe('0x3')]},'street':{'type':Sequelize[_0x1cbe('0x3')]},'postalCode':{'type':Sequelize[_0x1cbe('0x3')]},'city':{'type':Sequelize[_0x1cbe('0x3')]},'country':{'type':Sequelize[_0x1cbe('0x3')]},'dateOfBirth':{'type':Sequelize[_0x1cbe('0x3')]},'description':{'type':Sequelize[_0x1cbe('0x4')]},'phone':{'type':Sequelize['STRING']},'mobile':{'type':Sequelize[_0x1cbe('0x3')]},'fax':{'type':Sequelize[_0x1cbe('0x3')]},'email':{'type':Sequelize[_0x1cbe('0x3')]},'url':{'type':Sequelize[_0x1cbe('0x3')]},'facebook':{'type':Sequelize[_0x1cbe('0x3')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0x1cbe('0x3')]},'skype':{'type':Sequelize[_0x1cbe('0x3')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize[_0x1cbe('0x3')]},'telegram':{'type':Sequelize[_0x1cbe('0x3')]},'UserId':{'type':Sequelize[_0x1cbe('0x5')]},'AdditionalPhones':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x1cbe('0x5')](0x2)[_0x1cbe('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x1cbe('0x7')]},'dialTimezone':{'type':Sequelize[_0x1cbe('0x3')]},'utcOffset':{'type':Sequelize[_0x1cbe('0x5')]}};
\ No newline at end of file
+var _0xf382=['INTEGER','UNSIGNED','DATE','NOW','lodash','exports','STRING','TEXT'];(function(_0x104f4d,_0x49996d){var _0x50cf50=function(_0x2a4129){while(--_0x2a4129){_0x104f4d['push'](_0x104f4d['shift']());}};_0x50cf50(++_0x49996d);}(_0xf382,0x10c));var _0x2f38=function(_0x75e143,_0x218710){_0x75e143=_0x75e143-0x0;var _0xdddfdb=_0xf382[_0x75e143];return _0xdddfdb;};'use strict';var _=require(_0x2f38('0x0'));var Sequelize=require('sequelize');module[_0x2f38('0x1')]={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0x2f38('0x2')]},'street':{'type':Sequelize[_0x2f38('0x2')]},'postalCode':{'type':Sequelize[_0x2f38('0x2')]},'city':{'type':Sequelize[_0x2f38('0x2')]},'country':{'type':Sequelize[_0x2f38('0x2')]},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x2f38('0x3')]},'phone':{'type':Sequelize[_0x2f38('0x2')]},'mobile':{'type':Sequelize[_0x2f38('0x2')]},'fax':{'type':Sequelize[_0x2f38('0x2')]},'email':{'type':Sequelize[_0x2f38('0x2')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x2f38('0x2')]},'fb_data':{'type':Sequelize[_0x2f38('0x2')]},'twitter':{'type':Sequelize[_0x2f38('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0x2f38('0x2')]},'line':{'type':Sequelize[_0x2f38('0x2')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x2f38('0x2')]},'UserId':{'type':Sequelize[_0x2f38('0x4')]},'AdditionalPhones':{'type':Sequelize[_0x2f38('0x2')]},'priority':{'type':Sequelize[_0x2f38('0x4')](0x2)[_0x2f38('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0x2f38('0x6')],'defaultValue':Sequelize[_0x2f38('0x7')]},'dialTimezone':{'type':Sequelize[_0x2f38('0x2')]},'utcOffset':{'type':Sequelize[_0x2f38('0x4')]}};
\ No newline at end of file
diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js
index aa7a59e..20634ce 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 _0xa9e0=['source','destination','endtime','duration','note','createdAt','userDisposition','userSecondDisposition','userThirdDisposition','UserId','fullname','alias','DESC','findAndCountAll','startCase','Website','Account','closedAt','disposition','secondDisposition','thirdDisposition','Owner','browserName','customerIp','osName','ratingType','subject','substatus','externalUrl','threadId','Interaction','flatten','reverse','value','slice','moment','bluebird','util','squel','ioredis','../../components/contacts','../../components/parsers/qs','../../config/logger','api','../../config/environment/shared','../../mysqldb','redis','localhost','./cmContact.socket','register','status','offset','undefined','limit','count','Content-Range','then','destroy','end','sendStatus','stack','name','describe','getOptions','findAll','query','user','catch','CmContact','find','params','tags','keys','startsWith','cf_','displayName','analytics','CmCustomField','length','columnName','custom','type','values','forEach','hasOwnProperty','body','from','get','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','create','ChatInteraction','update','ChatMessage','ChatOfflineMessage','MailInteraction','MailMessage','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','OpenchannelMessage','CmContactHasItem','CmHopperFinal','ReportAgentPreview','VoiceCallReport','ChatQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','WhatsappInteraction','WhatsappMessage','WhatsappQueueReport','dialTimezone','isNil','timezones','utcOffset','additionalPhones','bulkCreate','duplicates','where','$or','push','ListId','findOrCreate','spread','all','show','Tag','color','tag','Phones','ContactItemType','ItemType','literal','Phones.OrderBy','$and','map','format','omit','cf_%d','isEmpty','cm_contacts','id\x20=\x20?','toParam','text','phone','getTags','model','rawAttributes','filters','intersection','attributes','fields','order','sort','pick','filter','merge','nolimit','setTags','findOne','ids','setAdditionalPhones','OrderBy','items','item_types','ItemTypeId','description','contact\x20phone\x20exists','CmHopperAdditionalPhone','item','sequelize','`ItemType`.OrderBy','CmHopperId','ItemType.OrderBy','getAdditionalPhones','PHONE','duplicateAdditionalPhones','CmContactId','toContactId','rescheduleAdditionalPhones','ContactId','options','includeAll','include','getHopperHistories','CmHopperHistory','rows','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','split','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','file','chmodSync','0777','child_process','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','send','path','meta','import','agent','binding','stringify','message','start\x20child\x20process\x20correctly!','error\x20child\x20process','importUpdates','User','../../components/import/cm/csvUpdates','exit','getJourney','mail','chat','sms','openchannel','fax','whatsapp','voice','-createdAt','resolve','channel','includes','toLowerCase','Invalid\x20channel','range','parse','isValid','Invalid\x20date\x20for\x20range\x20to\x20filter','Invalid\x20createdAt\x20filter'];(function(_0x3df223,_0x1740fc){var _0x562d11=function(_0x343009){while(--_0x343009){_0x3df223['push'](_0x3df223['shift']());}};_0x562d11(++_0x1740fc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var moment=require(_0x0a9e('0x0'));var BPromise=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var path=require('path');var fs=require('fs');var _=require('lodash');var squel=require(_0x0a9e('0x3'));var Papa=require('papaparse');var Redis=require(_0x0a9e('0x4'));var contacts=require(_0x0a9e('0x5'));var qs=require(_0x0a9e('0x6'));var logger=require(_0x0a9e('0x7'))(_0x0a9e('0x8'));var config=require('../../config/environment');var shared=require(_0x0a9e('0x9'));var db=require(_0x0a9e('0xa'))['db'];config[_0x0a9e('0xb')]=_['defaults'](config['redis'],{'host':_0x0a9e('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x0a9e('0xd'))[_0x0a9e('0xe')](socket);function respondWithResult(_0x307b3e,_0x3ab53f){_0x3ab53f=_0x3ab53f||0xc8;return function(_0xfeb75b){if(_0xfeb75b){return _0x307b3e[_0x0a9e('0xf')](_0x3ab53f)['json'](_0xfeb75b);}};}function respondWithFilteredResult(_0x50dfb2,_0x527cdd){return function(_0x4cfe67){if(_0x4cfe67){var _0x273d4d=typeof _0x527cdd[_0x0a9e('0x10')]===_0x0a9e('0x11')&&typeof _0x527cdd[_0x0a9e('0x12')]===_0x0a9e('0x11');var _0x69aeb7=_0x4cfe67['count'];var _0x4283ce=_0x273d4d?0x0:_0x527cdd[_0x0a9e('0x10')];var _0x2b4227=_0x273d4d?_0x4cfe67[_0x0a9e('0x13')]:_0x527cdd[_0x0a9e('0x10')]+_0x527cdd[_0x0a9e('0x12')];var _0x52a03d;if(_0x2b4227>=_0x69aeb7){_0x2b4227=_0x69aeb7;_0x52a03d=0xc8;}else{_0x52a03d=0xce;}_0x50dfb2[_0x0a9e('0xf')](_0x52a03d);return _0x50dfb2['set'](_0x0a9e('0x14'),_0x4283ce+'-'+_0x2b4227+'/'+_0x69aeb7)['json'](_0x4cfe67);}return null;};}function saveUpdates(_0x16033c){return function(_0x12066b){if(_0x12066b){return _0x12066b['update'](_0x16033c)[_0x0a9e('0x15')](function(_0x5a0a06){return _0x5a0a06;});}return null;};}function removeEntity(_0x459eb1){return function(_0x478723){if(_0x478723){return _0x478723[_0x0a9e('0x16')]()[_0x0a9e('0x15')](function(){_0x459eb1[_0x0a9e('0xf')](0xcc)[_0x0a9e('0x17')]();});}};}function handleEntityNotFound(_0x530eb7){return function(_0x20559e){if(!_0x20559e){_0x530eb7[_0x0a9e('0x18')](0x194);}return _0x20559e;};}function handleError(_0x112016,_0x1c696a){_0x1c696a=_0x1c696a||0x1f4;return function(_0x105080){logger['error'](_0x105080[_0x0a9e('0x19')]);if(_0x105080[_0x0a9e('0x1a')]){delete _0x105080['name'];}_0x112016[_0x0a9e('0xf')](_0x1c696a)['send'](_0x105080);};}exports['index']=function(_0x3a02e1,_0x432e56){var _0x38e7c4={};return contacts[_0x0a9e('0x1b')]()['then'](function(_0xfb6e48){_0x38e7c4=qs[_0x0a9e('0x1c')](_0xfb6e48,_0x3a02e1);return contacts[_0x0a9e('0x1d')](_0x3a02e1[_0x0a9e('0x1e')],_0x3a02e1[_0x0a9e('0x1f')],_0x38e7c4,_0xfb6e48);})[_0x0a9e('0x15')](respondWithFilteredResult(_0x432e56,_0x38e7c4))[_0x0a9e('0x20')](handleError(_0x432e56,null));};exports['destroy']=function(_0x59181e,_0x197ec0){return db[_0x0a9e('0x21')][_0x0a9e('0x22')]({'where':{'id':_0x59181e[_0x0a9e('0x23')]['id']}})['then'](handleEntityNotFound(_0x197ec0,null))[_0x0a9e('0x15')](removeEntity(_0x197ec0,null))['catch'](handleError(_0x197ec0,null));};exports[_0x0a9e('0x1b')]=function(_0x5bfb33,_0x1dc186){return db[_0x0a9e('0x21')][_0x0a9e('0x1b')]()[_0x0a9e('0x15')](function(_0x140511){delete _0x140511[_0x0a9e('0x24')];for(var _0x11c3b6=0x0;_0x11c3b6
','generateXOAuth2Token','user=','auth=Bearer\x20','utf-8','toString','lodash','randomstring','util','node-tnef','../../../config/environment','head','value','address','anonymous','generate','name','substring','indexOf','split','length'];(function(_0x49802b,_0x34ff39){var _0x1ecad3=function(_0x370218){while(--_0x370218){_0x49802b['push'](_0x49802b['shift']());}};_0x1ecad3(++_0x34ff39);}(_0x3278,0x14a));var _0x8327=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3278[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x8327('0x0'));var moment=require('moment');var random=require(_0x8327('0x1'));var fs=require('fs');var path=require('path');var util=require(_0x8327('0x2'));var tnef=require(_0x8327('0x3'));var logger=require('../../../config/logger')('email');var config=require(_0x8327('0x4'));function getAddress(_0x27a354){var _0x1ad1ef=_[_0x8327('0x5')](_0x27a354[_0x8327('0x6')]);return _0x1ad1ef&&_0x1ad1ef[_0x8327('0x7')]?_0x1ad1ef[_0x8327('0x7')]:_0x8327('0x8')+random[_0x8327('0x9')](0x6)+'@xcally.com';}function getFirstName(_0x339aac){var _0x174e2=_[_0x8327('0x5')](_0x339aac[_0x8327('0x6')]);if(_0x174e2&&_0x174e2['name']){if(_0x174e2[_0x8327('0xa')]==_0x174e2[_0x8327('0x7')]){return _0x174e2[_0x8327('0xa')][_0x8327('0xb')](0x0,_0x174e2[_0x8327('0xa')][_0x8327('0xc')]('@'));}var _0x3218b3=_0x174e2[_0x8327('0xa')][_0x8327('0xd')](/\s+/);return _0x3218b3[_0x8327('0xe')]>0x1?_0x3218b3['slice'](0x0,-0x1)[_0x8327('0xf')]('\x20'):_0x174e2[_0x8327('0xa')];}return _0x8327('0x10');}function getLastName(_0x4d6b89){var _0x5a835b=_[_0x8327('0x5')](_0x4d6b89[_0x8327('0x6')]);if(_0x5a835b&&_0x5a835b['name']){var _0x3b6a90=_0x5a835b[_0x8327('0xa')]['split'](/\s+/);return _0x3b6a90['length']>0x1?_0x3b6a90[_0x8327('0x11')]():'';}return'';}function getMails(_0x4ea9d8,_0xbfd9ab){var _0xffa8c2='';for(var _0x22cc29=0x0;_0x22cc29<_0xbfd9ab[_0x8327('0x6')]['length'];_0x22cc29+=0x1){if(_0xbfd9ab['value'][_0x22cc29]['address']!==_0x4ea9d8){if(!_[_0x8327('0x12')](_0xffa8c2)){_0xffa8c2+=',';}_0xffa8c2+=_0xbfd9ab[_0x8327('0x6')][_0x22cc29][_0x8327('0xa')]||_0xbfd9ab[_0x8327('0x6')][_0x22cc29][_0x8327('0x7')]||'';_0xffa8c2+='\x20<';_0xffa8c2+=_0xbfd9ab[_0x8327('0x6')][_0x22cc29]['address']?_0xbfd9ab[_0x8327('0x6')][_0x22cc29][_0x8327('0x7')]:'anonymous'+random[_0x8327('0x9')](0x6)+_0x8327('0x13');_0xffa8c2+='>';}}return _0xffa8c2;}function parseEmail(_0x359fcb,_0x78ade6,_0x2758c5){if(_0x78ade6[_0x8327('0x14')]){var _0x2865f1=/